R4RIN
MCQS
SQL MCQ Quiz Hub
SQL MCQ SET 13
Choose a topic to test your knowledge and improve your SQL skills
1. Which type of database management system is MySQL?
Object-oriented
Hierarchical
Relational
Network
2. What is data in a MySQL database organized into?
Objects
Tables
Networks
File systems
3. What represents an ‘attribute’ in a relational database?
Table
Row
Column
Object
4. What represents a ‘tuple’ in a relational database?
Table
Row
Column
Object
5. How is communication established with MySQL?
SQL
Network calls
A programming language like C++
APIs
6. Which is the MySQL instance responsible for data processing?
MySQL client
MySQL server
SQL
Server daemon program
7. The MySQL server used in its client/server architecture is _______________
mysqla
mysqlb
mysqlc
mysqld
8. In MySQL databases, the structure representing the organizational views of the entire databases is ____________
Schema
View
Instance
Table
9. Which of the following clauses is used to display information that match a given pattern?
LIKE
WHERE
IS
SAME
10. The special database that always exists after setting up MySQL in a computer is __________
sampdb
mysql
information_schema
readme_db
11. The NULL value also means ___________
value equal to zero
unknown value
negative values
a large value
12. What does comparing a known value with NULL result into?
zero
a positive value
a negative value
null
13. Which clause is used to sort query elements?
GROUP
GROUP BY
ORDER
ORDER BY
14. Which of the following options tells mysql to ask for entering the password?
-e
-p
-u
-h
15. The query ‘SELECT NOW()’ shows the current _____________
table
time only
date only
date and time
16. Suppose you want to select a database named ‘sampledb’ as the default database. Which of the following commands do you use?
SELECT DATABASE()
SELECT DATABASE sampledb
USE DATABASE sampledb
USE sampledb
17. To see the table structure, which of the following SQL commands is issued?
DESCRIBE tbl_name
VIEW tbl_name
SELECT TABLE tbl_name
SELECT tbl_name
18. The command to move the cursor to the beginning of line in MySQL input editor is?
Ctrl-A
Ctrl-E
Ctrl-D
Esc-a
19. What does Control-_ do in MySQL input editor?
copies to clipboard
pastes from clipboard
undoes last change
deletes the current line
20. On UNIX, statements entered in ‘MySQL’ are saved in which file?
.mysql_queries
.queries
.mysql_history
.history
21. Suppose run_me.sh is a script file. Which command is used to make it executable?
chmod +e run_me.sh
chmod +a run_me.sh
chmod +y run_me.sh
chmod +x run_me.sh
22. To execute the contents of a query file ‘exec.sql’ by feeding it to mysql, which command is used?
mysql exec.sql > sampdb
mysql sampdb < exec.sql
mysql exec.sql
mysql exec
23. The clause that enables mapping a short command to a long command is __________
map
direct
label
alias
24. In UNIX, the name of the option file is __________
.my.cnf
.my.ini
.my.opt
.my.opc
25. The system variable in MySQL server that enables to configure the SQL mode is __________
sql_config
sql_mode
sql_server
sql_enable
26. How do the STRICT_ALL_TABLES and STRICT_TRANS_TABLES mode values deal with bad data?
reject them
accept them
change them to the closest legal value and accept
change them to the closest legal value and reject
27. Which mode tells the server to recognize double quote as an identifier quoting character?
ANSI_DQ
ANSI_QUOTES
ANSI_RECG_QUOTES
ANSI_RECG_DQUOTES
28. Which mode tells the server to recognize || as the string concatenation operator?
PIPES_AS_CONCAT
ORS_AS_CONCAT
DOUBLE_PIPE_AS_CONCAT
LOGIC_OR_AS_CONCAT
29. Which of these modes is a composite server mode?
COMPOSITE
COMPOSITE_MODE
COMPOSITE_SERVER
ANSI
30. Which of the following commands sets the SQL mode as TRADITIONAL?
–sqlmode=’TRADITIONAL’
–sql_mode=’TRADITIONAL’
–sql-mode=’TRADITIONAL’
–sql.mode=’TRADITIONAL’
31. Which statement can be used to specify the sql_mode system variable at runtime?
SPECIFY
SET
ASSIGN
CHANGE
32. Which of the following characters is illegal in naming an unquoted identifier in SQL?
_
$
2
.
33. How are identifiers quoted in MySQL?
single quotes
double quotes
backticks
can't be quoted
34. Which of the following is an illegal unquoted identifier name?
123_id
123id
id1
123
35. Which server mode value enables use of double quotes to wrap identifier names?
ANSI
ANSI_QUOTES
TRADITIONAL
PIPES_AS_CONCAT
36. Which server mode value disables use of built in function names as identifiers?
ANSI
IGNORE_FUNC
TRADITIONAL
IGNORE_SPACE
37. What is the maximum length for alias names in terms of characters?
64
128
256
32
38. What does a fully qualified table name consist of?
only the table name
only the database name
table name followed by database name
database name followed by table name
39. Which of the following MySQL statements is valid if ‘`sampledb`’ is a database and ‘`tbl`’ is a table in it?
SELECT * FROM `sampledb.member`
SELECT * FROM `sampledb`.`member`
SELECT * FROM `member`.`sampledb`
SELECT * FROM `member.sampledb`
40. What is true about the following SQL statement?
invalid
display contents of table_1
improper case being used
display only column names in table_1
41. The default case sensitivity of database and table names depends on ___________
SQL server
Server SQL mode
Operating system of machine
Does not depend on anything
42. Which of the following is case sensitive?
Stored function name
Stored procedure name
Trigger name
Event name
43. Which variable is used to set table alias names as non-case sensitive?
lower_case_table_names
lower_case_all
lower_case_alias
lower_case_aliases
44. Which case does InnoDB store database names in?
lower
upper
mixed
random
45. Which of the following is case sensitive in MySQL?
Event names
Logfile group names
Column names
Indexes
46. Which property determines whether a database object is a case sensitive?
COLLATION
ATOMICITY
COLLABORATION
NORMALIZATION
47. What is AI in terms of database collation?
Accent Insensitive
Augment Insensitive
Articulate Insensitive
Addition Insensitive
48. What is the maximum collations a character set can have?
0
1
2
more than 1
49. Which clause can be used to sort string values according to a specific collation?
SORT
GROUP
FILTER
COLLATE
Submit