This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “SQL Statement Syntax (Non-Compound Statements)”.
1. Which statement upgrades the database directory name encoding?
a) ALTER DATABASE
b) ALTER SERVER
c) ALTER EVENT
d) ALTER FUNCTION
View Answer
Explanation: The statement ‘ALTER DATABASE’ changes database attributes or upgrades the database directory name encoding. It requires the ‘ALTER’ privilege for the database to be given.
2. The statement that alters an existing event to have the given definition is _____________
a) ALTER EVENT
b) ALTER DATABASE
c) ALTER FUNCTION
d) ALTER DATABASE
View Answer
Explanation: The statement ‘ALTER EVENT’ alters an existing event to have the given definition. The ‘RENAME TO’ clause renames the event. The other clauses are described in the entry for ‘CREATE EVENT’.
3. What sets up an association between one or more MyISAM tables and the named key cache?
a) BEGIN
b) CACHE INDEX
c) ALTER DATABASE
d) ALTER EVENT
View Answer
Explanation: ‘CACHE INDEX’ sets up an association between one or more MyISAM tables and the named key cache which must already exist. The INDEX privilege is needed for each table named in the statement.
4. Which statement can produce the same output as ‘SHOW COLUMNS’?
a) DESCRIBE
b) DISPLAY
c) SEE
d) GET
View Answer
Explanation: The ‘DESCRIBE’ statement with a table name or view name produces the same kind of output as the ‘SHOW COLUMNS’ statement. The ‘SHOW’ entry can be referred to for further information.
5. Converting a client/server application to embedded server is difficult.
a) True
b) False
View Answer
Explanation: Writing an application that uses the embedded server is different from writing one that operates in a client/server context. A program that is written as a client/server application can easily be converted to use the embedded server.
6. The option that executes all SQL statements in a SQL script irrespective of the number of errors is _______________
a) –run
b) –ensure
c) –force
d) –violent
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.
7. The clause that is used to display information that matches a given pattern is _____________
a) WHERE
b) IS
c) SAME
d) LIKE
View Answer
Explanation: The ‘LIKE’ clause filters information that matches a given pattern. ‘WHERE’ clause selects information that is specified by a condition. ‘IS’ is used to match the exact condition specified.
8. The header that should be included first is ________________
a) my_global.h
b) my_sys.h
c) mysql.h
d) my_local.h
View Answer
Explanation: The file ‘my_global.h’ takes care of including several other header files that are likely to be generally useful, like ‘stdio.h’. It also includes Windows compatibility information.
9. What does mysql_init() return?
a) integer
b) float
c) structure
d) pointer to a structure
View Answer
Explanation: When NULL is passed to mysql_init() it automatically allocates an MYSQL structure, initializes it, and returns a pointer to it. The MYSQL data type is a structure containing information about a connection.
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.
- Practice Programming MCQs
- Apply for Programming Internship
- Check Information Technology Books
- Check MySQL Books