This set of MySQL Questions and Answers for Entrance exams focuses on “External Security: Preventing Unauthorized Network Access”.
1. Which table lists the accounts and the databases for which the privileges are provided?
Explanation: The ‘db’ table lists which accounts have privileges for which databases. If a privilege is granted here, it applies to all objects in a database (tables, stored routines and so on).
2. The table that lists the column level privileges is _____________
Explanation: The ‘columns_priv’ table lists the column-level privileges. A privilege that is supplied here applies to a particular column. The ‘db’ table lists which accounts have privileges for which databases.
3. Which of these grant table scope columns is case insensitive?
Explanation: ‘Db’ and ‘Table_name’ values are always treated as case sensitive even though treatment of database and table names in SQL statements depends on the filesystem case sensitivity of the host.
4. What causes a replication master server to delete all the binary log files even if they are still in use?
a) RESET MASTER LOGS
b) FLUSH TABLES
d) FLUSH LOGS
Explanation: ‘RESET MASTER LOGS’ causes a replication master server to delete all binary log files even if they are in use which removes the information necessary to maintain the replication integrity.
5. What does ‘abc’ || ‘xyz’, when PIPES_AS_CONCAT is enabled, result in?
Explanation: If the SQL mode PIPES_AS_CONCAT has been enabled, the SQL standard ‘||’ operation for string concatenation becomes valid in MySQL. Both operands are concatenated to give ‘abcxyz’.
6. What does the expression ‘2 BETWEEN 2 AND 5’ result in?
Explanation: The ‘BETWEEN ……. AND’ clause is used to return a boolean value, if the given operand value lies between the values specified by the ‘AND’ clause. The range endpoints are inclusive.
7. REGEXP does not take collation into account.
Explanation: MySQL provides pattern matching based on the ‘REGEXP’ operator and regular expressions that are similar to those used in Unix programs, namely, grep, sed and vi. REGEXP does not take collation into account.
8. The line that is not used to turn on the event scheduler is _________________
a) event_scheduler = ON
b) eventscheduler = ON
Explanation: The line ‘event_scheduler = ON’ is put in the option file that the server reads. The event scheduler does not run by default. It must be turned on if events are to used in the database.
9. The statement that is used to check the status of the event scheduler at runtime is _____________
a) SHOW STATUS OF ‘event_scheduler’
b) SHOW VARIABLES OF ‘event_scheduler’
c) SHOW STATUS LIKE ‘event_scheduler’
d) SHOW VARIABLES LIKE ‘event_scheduler’
Explanation: In MySQL, in order to check the status of the event scheduler at runtime, the statement: SHOW VARIABLES LIKE ‘event_scheduler’; is used. The event_scheduler is a system variable.
10. The value of event_scheduler that enables checking status but not changing it at runtime is ______________
Explanation: In MySQL, if the event_scheduler is set to ‘DISABLED’ at startup, its status cannot be changed but can be checked at runtime. The events can be created but they will not execute.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice all areas of MySQL for Entrance exams, here is complete set of 1000+ Multiple Choice Questions and Answers.