Olete.in
Articles
Mock Tests
🧪 SQL MCQ Quiz Hub
SQL MCQ SET 2
Choose a topic to test your knowledge and improve your SQL skills
1. The maximum number of indexes on MyISAM table is _____
0
1
2
more than 1
2. The data rows of a MyISAM table are stored in _______
data file
index file
log file
error file
3. In a single table (with 10 columns) join query the number of values needed to examine per column is _____
1
10
0
2
4. If a column contains 7 values and 6 distinct values, the cardinality is _____
7
6
13
1
5. For a table having 4 columns, the number of columns to which hash function is applied when using hash indexes is _____
1
2
3
4
6. The slow query log is written as ____
numbers
text
image
graph
7. To check how MySQL would execute a SELECT query, which statement is used?
TELL
SHOW
DISPLAY
EXPLAIN
8. To perform analysis of key values by the server, the statement used is ______
ANALYZE KEYS
ANALYZE TABLE
PERFORM ANALYSIS
PERFORM TABLE ANALYSIS
9. Which statement is used to verify optimizer operation?
ANALYZE
VERIFY
EXPLAIN
SHOW
10. Which statement is used to force the optimizer to use tables in a particular order?
FORCE INDEX
USE INDEX
IGNORE INDEX
STRAIGHT_JOIN
11. Which of these comparisons is slowest?
INT/INT
INT/BIGINT
BIGINT/BIGINT
All are of same speed
12. Which system variable tells the optimizer to skip certain plans based on estimates of the number of rows accessed for each table?
optimizer_prune_level
optimizer_search_depth
optimizer_search
optimizer_prune
13. Which system variable tells how far into the rest of each incomplete plan the optimizer should look to evaluate whether it should be expanded further?
optimizer_prune_level
optimizer_search_depth
optimizer_search
optimizer_prune
14. To convert an int to string, the function is _____
INET_ATON()
INET_NTOA()
INET_ITOS()
INET_STOI()
15. To convert a string to an int, the function is ______
INET_ATON()
INET_NTOA()
INET_ITOS()
INET_STOI()
16. To maintain performance of tables having variable length rows, which statement is used?
MAINTAIN TABLE
BALANCE TABLE
ADJUST TABLE
OPTIMIZE TABLE
17. Which of these can be used to generate hash values?
MS5()
MA5()
MF5()
MD5()
18. IP numbers can be represented as ______
both integers and a string
a string but not integers
integers but not a string
neither a string nor integers
19. Which is more efficient?
LOAD DATA
INSERT
Same
Indeterminate
20. Without LOCAL, LOAD DATA is ______
more efficient
Less efficient
same speed
arbitrary
21. Which option turns on the extended-insert?
opt
opti
op
optimize
22. Which table option for MyISAM tables reduces index flushing?
DELAY_KEY_WRITE
DELAY_WRITE_KEY
KEY_WRITE_DELAY
WRITE_KEY_DELAY
23. Which option repairs MyISAM tables automatically after they open?
myisam-recover=FORCE
myisam-recover=STOP
recover-myisam=FORCE
recover-myisam=STOP
24. The option which delays index flushing for slave server is ______
delay-write-key=ALL
delay-key-write=ALL
key-write-delay=NONE
key-delay-write=NONE
25. TO enable the compressed client/server protocol the option is ______
enable
compress
reduce
restrict
26. To reactivate indexes the command used is ____
DISABLE KEYS
DISABLE INDEXES
ENABLE KEYS
ENABLE INDEXES
27. Which statement issues a lock on tables?
ISSUE LOCK
LOCK ISSUE
LOCK TABLES
ISSUE LOCKS
28. Find the odd one out in terms of scheduling policies.
MyISAM
InnoDB
MEMORY
MERGE
29. Which table is preferred when there are many updates?
MyISAM
InnoDB
MEMORY
MERGE
30. Which system variable controls the size of the table cache?
table_cache
cache_table
open_cache
cache_open
31. Which status indicator assesses how effective the table cache is?
Open_tables
Opened_tables
Close_tables
Closed_tables
32. In MySQL, the default size of the key buffer in MB is _____
4
8
16
32
33. The system variable to maintain InnoDB log buffer size is ____
innodb_log_buffer_size
innodb_buffer_log_size
buffer_log_innodb_size
log_buffer_innodb_size
34. To determine whether query cache is supported by the server the variable is _____
have_query_cache
have_cache_query
query_cache_have
cache_query_have
35. Which mode tells not to cache query results?
0
1
2
3
36. Which mode tells cache queries that begin with SELECT SQL_CACHE?
0
1
2
3
37. Which command is used to remove existing tables or database?
DROP TABLE
DELETE
Either DROP TABLE or DELETE
None of the mentioned
38. Which command is used to display all the existing tables in a database?
SHOW TABLES
SHOW TABLE
SHOW
None of the mentioned
39. Is duplicate entry of primary key is allowed in SQL?
Yes
No
Depends
None of the mentioned
40. Is duplicate entry of other attributes are allowed in SQL?
Yes
No
Depends
None of the mentioned
41. Which is the correct format to store date in the SQL?
DEC-01-1991
01-1991-11
01-DEC-12
01-11-1991
42. Which of the following are the valid database datatypes in Mysql?
Numerical
Temporal
Text
All of the mentioned
43. Which Key is used to link two tables in Mysql?
Primary Key
Foreign Key
Both Primary and Foreign Key
None of the mentioned
44. Which line of the following statements will produce error?
SELECT * FROM person WHERE person_id=1;
SELECT pname FROM person;
SELECT pname, lname, person_id FROM person;
None of the mentioned
45. Which compiler is used to execute the structured query language?
DCL
DDL
DML
None of the mentioned
46. Which among the following tags belong to Data definition language?
SELECT
FROM
WHERE
All of the mentioned
47. Which among the following tags belong to Data Manipulation language?
UPDATE
ALTER
MODIFY
All of the mentioned
48. Query Mechanism performs the following functions?
Syntax correction
Checking permission for executing the query
Checking permission for accessing the desired data
All of the mentioned
49. What jobs Query Optimizer perform in Mysql?
Determine the efficient way to execute a query
Syntax errors
Permissions
All of the mentioned
50. Which are the two languages used in Mysql?
DML/DDL
DDL/DCL
DML/DDM
None of the mentioned
Submit