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

SQL ORDER BY default sort order is?
Ascending
click to copy
Which SQL keyword filters duplicate rows?
DISTINCT
click to copy
SQL LIKE operator uses which wildcard for multiple characters?
%
click to copy
SQL BETWEEN operator is?
Inclusive of both boundary values
click to copy
NULL in SQL represents?
Unknown or missing value
click to copy
IS NULL vs = NULL in SQL?
IS NULL is correct; = NULL always returns false (no value equals NULL)
click to copy
TRUNCATE vs DELETE in SQL?
TRUNCATE faster (removes all rows, can't rollback in many DBs); DELETE is slower but rollbackable
click to copy
DROP TABLE vs TRUNCATE TABLE?
DROP removes table structure AND data; TRUNCATE removes only data
click to copy
Which SQL clause groups rows with same values?
GROUP BY
click to copy
HAVING clause in SQL filters?
Groups created by GROUP BY after aggregation
click to copy
Which aggregate function calculates average?
AVG()
click to copy
SQL subquery is?
A nested SQL query inside another query
click to copy
Correlated subquery refers to?
A subquery that references a column from the outer query
click to copy
EXISTS operator in SQL?
Returns TRUE if subquery returns any rows
click to copy
UNION vs UNION ALL in SQL?
UNION removes duplicates; UNION ALL keeps all rows including duplicates
click to copy
EXCEPT (or MINUS in Oracle) returns?
Rows in first query not present in second query
click to copy
INTERSECT in SQL returns?
Rows common to both queries
click to copy
Which SQL function gets current date and time?
All of the above (varies by DBMS)
click to copy
CHAR vs VARCHAR in SQL?
CHAR is fixed-length; VARCHAR is variable-length (more efficient for varying text)
click to copy
Which SQL data type stores large text?
TEXT / CLOB (Character Large Object)
click to copy
BLOB in SQL stores?
Binary Large Objects — images, files, audio
click to copy
AUTO_INCREMENT in MySQL?
Automatically generates unique sequential integers for primary key
click to copy
Which MySQL command shows all databases?
SHOW DATABASES
click to copy
USE database_name in MySQL?
Selects/switches to specified database for subsequent queries
click to copy
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

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