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.
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?
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 an .frm file that contains the view definition.
3. What is the maximum number of characters allowed for a database name to have?
Explanation: MySQL allows the database names and the table names to be maximum 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 ______________
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?
c) any of the two
d) neither of the two
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.
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 ______________
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 maximum collations a character set can have?
d) more than 1
Explanation: The MySQL server allows simultaneous use of multiple character sets. A given character set is allowed to have one or more collations. It can be chosen according to the need of the database.
9. What is the synonym for CHARACTER SET?
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.
10. What is the statement used to select a default database?
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.