MySQL Questions and Answers – Managing MySQL User Accounts

This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses 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
View Answer

Answer: a
Explanation: 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
View Answer

Answer: d
Explanation: ‘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
View Answer

Answer: c
Explanation: 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.
advertisement
advertisement

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

Answer: b
Explanation: 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
View Answer

Answer: a
Explanation: 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.
Note: Join free Sanfoundry classes at Telegram or Youtube

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
View Answer

Answer: a
Explanation: 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
View Answer

Answer: b
Explanation: 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.
advertisement

8. The following MySQL statement is valid.

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

a) True
b) False
View Answer

Answer: a
Explanation: 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.
advertisement

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

Answer: d
Explanation: 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
View Answer

Answer: a
Explanation: 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.

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.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.