MySQL Questions and Answers – External Security: Preventing Unauthorized Network Access

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?
a) user
b) db
c) tables_priv
d) procs_priv
View Answer

Answer: b
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 _____________
a) columns_priv
b) db
c) tables_priv
d) procs_priv
View Answer

Answer: a
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?
a) Host
b) User
c) Password
d) Db
View Answer

Answer: a
Explanation: ‘Db’ and ‘Table_name’ values are always treated as case sensitive even though the treatment of database and table names in SQL statements depends on the filesystem case sensitivity of the host.
advertisement
advertisement

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
c) RELOAD
d) FLUSH LOGS
View Answer

Answer: a
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?
a) 0
b) 1
c) abcxyz
d) xyzabc
View Answer

Answer: c
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?
a) True
b) False
c) -1
d) 2
View Answer

Answer: a
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.
a) True
b) False
View Answer

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

8. The line that is not used to turn on the event scheduler is _________________
a) event_scheduler = ON
b) eventscheduler = ON
c) event_scheduler_ON
d) events_scheduler_ON
View Answer

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

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

10. The value of event_scheduler that enables checking status but not changing it at runtime is ______________
a) ON
b) OFF
c) DISABLED
d) ENABLED
View Answer

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

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.