This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Structure of the Data Directory”.
1. Each database has a data directory located under database directory.
a) True
b) False
View Answer
Explanation: In MySQL, each database has a database directory that is located under the data directory. The tables, views and triggers within a database correspond to files in the database directory.
2. In the database directory of the database each view and trigger object is associated with how many files?
a) 0
b) 1
c) 2
d) 3
View Answer
Explanation: Each view and trigger object is associated with one file in the database directory of the database containing that object. A view consists of a .frm file that contains the view definition.
3. What is the maximum number of characters allowed for a database name to have?
a) 16
b) 32
c) 64
d) 128
View Answer
Explanation: MySQL allows the database names and the table names to be a maximum of 64 characters long. The length of these names is also bound by the length allowed by the operating system on the machine.
4. The data directory subdirectory that corresponds to the nbdinfo database is ______________
a) mysql
b) performance_schema
c) sys
d) nbdinfo
View Answer
Explanation: The sys directory corresponds to the sys schema. It provides a set of objects to interpret Performance Schema information. The ‘performance_schema’ directory corresponds to the Performance Schema.
5. Which of these is preferred when stored procedures are not being used?
CLIENT_MULTI_STATEMENTS, mysql_set_server_option()
a) CLIENT_MULTI_STATEMENTS
b) mysql_set_server_option()
c) any of the two
d) neither of the two
View Answer
Explanation: If the program does not use stored procedures anyone is suitable. If the program uses stored procedures and invokes a ‘CALL’ statement that returns a result set, the first method is better.
6. mysql_next_result() does not return.
a) True
b) False
View Answer
Explanation: The function ‘mysql_next_result()’ returns a status and initiates retrieval of the next set if more results are available. The status is zero if more results are available and -1 if not.
7. The option that executes all SQL statements in a SQL script irrespective of the number of errors is ______________
a) –ensure
b) –force
c) –violent
d) –run
View Answer
Explanation: If SQL queries in a file are run using mysql in batch mode, mysql either quits after the first error. If the –force option is specified all the queries are executed indiscriminately.
8. What is the synonym for CHARACTER SET?
a) CSET
b) CHSET
c) CHARSET
d) CHCSET
View Answer
Explanation: ‘CHARACTER SET’ can be abbreviated into ‘CHARSET’ and can be used in the same contexts and statements where ‘CHARACTER SET’ is used. ‘charset’ is the server-supported character set.
9. What is the statement used to select a default database?
a) USE
b) CREATE
c) DROP
d) SCHEMA
View Answer
Explanation: MySQL has the facility to use various statements specifically at the database level. For selecting a default database, the keyword or clause used is the ‘USE’ statement.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check Information Technology Books
- Apply for Programming Internship
- Check MySQL Books
- Practice Programming MCQs