250+ TOP MCQs on Managing MySQL User Accounts and Answers

MySQL Database Multiple Choice Questions on “Managing MySQL User Accounts”.

1. The grant table that stores users who can connect to the server and their global privileges are ______________
a) user
b) db
c) tables_priv
d) procs_priv

Answer: a
Clarification: The grant table ‘user’ stores the users who can connect to the server and their global privileges. ‘db’ has the database privileges records. ‘tables_priv’ has table privileges.

2. The stored-routine privileges are contained in ______________
a) user
b) db
c) tables_priv
d) procs_priv

Answer: d
Clarification: ‘procs_priv’ stores stored-routine privileges. The grant table ‘user’ stores the users who can connect to the server and their global privileges. ‘db’ has the database privileges records.

3. The statement used to obtain access privileges to an account is ______________
a) OBTAIN
b) GET
c) GRANT
d) NEED

Answer: c
Clarification: If the named account exists, ‘GRANT’ modifies its privileges. If the account does not exist, ‘GRANT’ creates it with the given privileges. It is used to obtain access privileges.

4. MySQL does not support the shared-memory connections on Windows.
a) True
b) False

Answer: b
Clarification: MySQL supports shared memory connections on Windows. This capability is disabled by default. In order to enable it, the server is started with the ‘–shared-memory’ option.

5. Usage of aggregates in WHERE clause is disallowed.
a) True
b) False

Answer: a
Clarification: The usage of aggregates inside ‘WHERE’ clauses is not allowed. For example, the following statement will not work: ‘SELECT * FROM my_table WHERE attribute_name = MAX(attribute_name)’, because the MAX value is not known yet.

6. The operators used when a subquery returns multiple rows to be evaluated in comparison to the outer query are _____________
a) IN and NOT IN
b) EXISTS and NOT EXISTS
c) OUTER JOIN and INNER JOIN
d) LEFT JOIN and RIGHT JOIN

Answer: a
Clarification: When there is a need to evaluate multiple rows in comparison to the outer query, the ‘IN’ and ‘NOT IN’ operators are used. They are used for testing whether a comparison value is present in a set of values.

7. The ALL subquery performs the operation _____________
a) row
b) column
c) table
d) database

Answer: b
Clarification: The operators ‘ALL’ and ‘ANY’ are used to perform operations on columns. They are used in conjunction with a comparison operator in order to test the result of a column subquery.

8. The following MySQL statement is valid.

SELECT abc, xyz FROM table1 UNION abc, def FROM table2;

a) True
b) False

Answer: a
Clarification: Even if the columns ‘xyz’ and ‘def’ have different data types, the results from these columns are placed into the column ‘xyz’. The data types can be determined from the values in the columns.

9. The keyword used with UNION that does not retain duplicate rows is _____________
a) ALL
b) NARROW
c) STRICT
d) DISTINCT

Answer: d
Clarification: The keyword ‘DISTINCT’ used along with ‘UNION’ is synonymous with just the ‘UNION’ statement. It produces only the distinct rows from the combination of the two tables in the SELECT query.

10. The keyword used with UNION that retains duplicate rows is ______________
a) ALL
b) NARROW
c) STRICT
d) DISTINCT

Answer: a
Clarification: The keyword ‘ALL’ used along with ‘UNION’ is not synonymous with just the ‘UNION’ statement. It produces the duplicate rows, if they exist, from the combination of the two tables in the SELECT query.

Leave a Reply

Your email address will not be published. Required fields are marked *