Quick Revision

GK One-Line Question & Answer

15541+ short questions with short answers, covering every category and sub-category on the site — no long articles to scroll through. Good for a fast recap before an exam, or a few minutes of daily practice.

Computer Fundamentals → Introduction to Computer 39

DESCRIBE table_name in MySQL?
Shows table structure (column names, types, constraints)
click to copy
EXPLAIN in SQL is used for?
Showing query execution plan for performance analysis
click to copy
Which MySQL statement modifies table structure?
ALTER TABLE
click to copy
Which constraint ensures unique values in a column?
UNIQUE
click to copy
CHECK constraint in SQL?
Validates that column values meet specified condition
click to copy
DEFAULT constraint in SQL?
Specifies a default value when no value is provided during INSERT
click to copy
Stored procedure advantages include?
Pre-compiled execution, reduced network traffic, code reuse, security
click to copy
Function vs Stored Procedure in SQL?
Functions must return a value and can be used in SELECT; procedures can't be in SELECT
click to copy
Trigger AFTER INSERT fires?
After a row is successfully inserted into the table
click to copy
BEFORE DELETE trigger is used to?
Perform actions before a row is deleted (e.g., archive data)
click to copy
Which SQL view cannot be updated?
View with GROUP BY, DISTINCT, aggregates, or multiple tables (in most cases)
click to copy
Database cursor is used for?
Row-by-row processing of query results
click to copy
COMMIT in SQL?
Permanently saves all changes made in the current transaction
click to copy
ROLLBACK in SQL?
Undoes all changes made since the last COMMIT or SAVEPOINT
click to copy
SAVEPOINT in SQL allows?
Partial rollback to a named point within a transaction
click to copy
Which isolation level prevents dirty reads, phantom reads, and non-repeatable reads?
Serializable
click to copy
Dirty read in databases occurs when?
Transaction reads uncommitted data from another transaction
click to copy
Phantom read occurs when?
Same query returns different rows in same transaction due to another transaction's INSERT/DELETE
click to copy
Database sharding is?
Horizontal partitioning of data across multiple database instances
click to copy
Read replica in databases is used for?
Scaling read operations — copy of primary database for SELECT queries
click to copy
Connection pooling in applications?
Reuses existing database connections from a pool — improves performance
click to copy
ORM (Object Relational Mapping) maps?
Object-oriented code classes to database tables automatically
click to copy
Which NoSQL type stores data as key-value pairs?
Key-value store
click to copy
Which data type in Python is immutable?
Tuple
click to copy
Python list comprehension [x*2 for x in range(5)] produces?
[0,2,4,6,8]
click to copy
What does len([1,2,3,4,5]) return in Python?
5
click to copy
Python dictionary key must be?
Immutable (string, int, tuple)
click to copy
Which Python keyword is used to handle exceptions?
except
click to copy
What is the output of print(type(3.14)) in Python?
<class 'float'>
click to copy
Python's 'pass' statement?
Does nothing — placeholder for empty code block
click to copy
Which Python function converts integer to string?
str()
click to copy
Python range(1,10,2) generates?
[1,3,5,7,9]
click to copy
Lambda in Python is?
An anonymous function defined in one line
click to copy
What does *args in Python function mean?
Variable number of positional arguments as tuple
click to copy
**kwargs in Python?
Variable number of keyword arguments as dictionary
click to copy
Python decorator is used to?
Wrap a function to modify or extend its behavior without changing its code
click to copy
Generator in Python uses which keyword?
yield
click to copy
Python 'with' statement is used for?
Context management — automatically handles resource cleanup (close files)
click to copy
What does __init__ method do in Python class?
Constructor — initializes a new object instance's attributes
click to copy

Computer Fundamentals → Memory Units 1

Materialized view differs from regular view because?
Stores the query result physically — must be refreshed to stay current
click to copy