Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

The security context when a user creates a stored program that accesses sensitive data but forgets that other people who can invoke the object have the same access is __________(a) good(b) bad(c) illegal(d) fareThe question was asked in a job interview.The origin of the question is Setting Up Secure Connections in portion Access Control and Security of MySQL

Answer»

The correct option is (b) bad

Best explanation: The security context is bad if a user creates a stored program that accesses sensitive DATA but FORGETS that other PEOPLE who can INVOKE the object have the same access to that data as its definer.

2.

The datatype that stores the longest length of strings is ______________(a) CHAR(b) VARCHAR(c) TINYTEXT(d) TEXTThe question was posed to me at a job interview.My question is based upon Setting Up Secure Connections topic in chapter Access Control and Security of MySQL

Answer» RIGHT option is (d) TEXT

To elaborate: In MySQL, the different string DATATYPES are USED to store different lenghts of the string. Here, the length would REFER to the NUMBER of characters in the string. TEXT stores longer strings.
3.

What is the best datatype for a column that is expected to store values up to 2 million?(a) SMALLINT(b) TINYINT(c) MEDIUMINT(d) BIGINTThis question was posed to me in my homework.This interesting question is from Setting Up Secure Connections in section Access Control and Security of MySQL

Answer»

Right option is (d) BIGINT

For explanation I would say: The different NUMERIC types used in MySQL are used to store a different RANGE of values. To store values of the order of a million, the MEDIUMINT or BIGINT DATATYPE is SUFFICIENT.

4.

MySQL does not provide a date type that has an optional time part.(a) True(b) FalseI have been asked this question during an online interview.This key question is from Setting Up Secure Connections in division Access Control and Security of MySQL

Answer»

Correct choice is (a) True

For EXPLANATION: In MYSQL, there is no data type provided which has an optional time part. The ‘DATE’ type values never have a time part. The ‘DATETIME’ type values MUST have a time part in them.

5.

Which variable checks for the availability of SSL support?(a) have_ssl(b) has_ssl(c) avail_ssl(d) ssl_availThis question was addressed to me in quiz.Query is from Setting Up Secure Connections topic in section Access Control and Security of MySQL

Answer»

Correct answer is (a) have_ssl

Easy explanation: After the SSL-capable SERVER is started, to VERIFY that it SUPPORTS SSL, connection is established with ‘mysql’ and the following query is issued: SHOW VARIABLES LIKE ‘have_ssl’.

6.

The grant table scope columns that is case insensitive is _____________(a) Host(b) User(c) Password(d) DbThe question was posed to me during an internship interview.Enquiry is from Setting Up Secure Connections in section Access Control and Security of MySQL

Answer»

The CORRECT option is (a) HOST

To EXPLAIN: ‘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.

7.

The TLS protocol is _____________(a) transparent layer security(b) transport layer security(c) transparent level security(d) transport level securityI had been asked this question in an online interview.My query is from Setting Up Secure Connections topic in division Access Control and Security of MySQL

Answer»

Right choice is (b) transport LAYER security

Best explanation: MYSQL supports encrypted connections between CLIENTS and the SERVER USING the TLS protocol. It is also referred to as SSL but MySQL does not actually use the SSL protocol for encrypted connections.

8.

How many files does each end of a client/server connection including SSL support use to set up secure communications?(a) 0(b) 1(c) 2(d) 3The question was asked by my school principal while I was bunking the class.My question is based upon Setting Up Secure Connections in division Access Control and Security of MySQL

Answer»

Correct option is (d) 3

The best I can EXPLAIN: With a MySQL installation that includes SSL support the SERVER and its clients can communicate securely. Each end of a connection USES three FILES to set up secure communications.

9.

The value of event_scheduler that enables checking status but not changing it at runtime is ______________(a) ON(b) OFF(c) DISABLED(d) ENABLEDThe question was posed to me in quiz.My enquiry is from External Security: Preventing Unauthorized Network Access topic in division Access Control and Security of MySQL

Answer»

Correct option is (c) DISABLED

For explanation I would SAY: 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.

10.

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’I got this question during an online exam.The question is from External Security: Preventing Unauthorized Network Access topic in division Access Control and Security of MySQL

Answer»

Right choice is (d) SHOW VARIABLES LIKE ‘event_scheduler’

The explanation is: 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.

11.

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_ONThe question was asked in my homework.Question is from External Security: Preventing Unauthorized Network Access in portion Access Control and Security of MySQL

Answer»

Correct choice is (a) event_scheduler = ON

Easiest 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.

12.

REGEXP does not take collation into account.(a) True(b) FalseI got this question by my school teacher while I was bunking the class.The origin of the question is External Security: Preventing Unauthorized Network Access topic in section Access Control and Security of MySQL

Answer»

The correct OPTION is (a) True

The explanation is: 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.

13.

What does the expression ‘2 BETWEEN 2 AND 5’ result in?(a) True(b) False(c) -1(d) 2I got this question during a job interview.My question is from External Security: Preventing Unauthorized Network Access in division Access Control and Security of MySQL

Answer» RIGHT choice is (a) True

To explain I would say: 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.
14.

What does ‘abc’ || ‘xyz’, when PIPES_AS_CONCAT is enabled, result in?(a) 0(b) 1(c) abcxyz(d) xyzabcThe question was asked in quiz.My doubt is from External Security: Preventing Unauthorized Network Access in division Access Control and Security of MySQL

Answer»

The correct answer is (c) ABCXYZ

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’.

15.

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 LOGSThis question was posed to me by my school teacher while I was bunking the class.My question is based upon External Security: Preventing Unauthorized Network Access in division Access Control and Security of MySQL

Answer»

The correct choice is (a) RESET MASTER 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.

16.

Which of these grant table scope columns is case insensitive?(a) Host(b) User(c) Password(d) DbThe question was posed to me in final exam.My question is based upon External Security: Preventing Unauthorized Network Access topic in division Access Control and Security of MySQL

Answer»

The CORRECT choice is (a) Host

Best 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.

17.

The table that lists the column level privileges is _____________(a) columns_priv(b) db(c) tables_priv(d) procs_privThe question was posed to me during an online interview.My doubt is from External Security: Preventing Unauthorized Network Access in portion Access Control and Security of MySQL

Answer» CORRECT answer is (a) columns_priv

The 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.
18.

Which table lists the accounts and the databases for which the privileges are provided?(a) user(b) db(c) tables_priv(d) procs_privThe question was asked in final exam.Question is taken from External Security: Preventing Unauthorized Network Access in chapter Access Control and Security of MySQL

Answer»

The correct CHOICE is (B) db

For explanation I would SAY: 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).

19.

How is a stored procedure invoked?(a) INVOKE(b) SEE(c) CALL(d) RETURNThe question was posed to me by my school teacher while I was bunking the class.Question is from Internal Security: Preventing Unauthorized Filesystem Access topic in portion Access Control and Security of MySQL

Answer»

Correct OPTION is (c) CALL

Easy explanation: In MYSQL, a stored PROCEDURE is INVOKED using the CALL statement. A stored procedure does not have a return value but can modify its parameters. It also returns some result sets.

20.

Triggers and events are not invoked automatically by the server.(a) True(b) FalseI had been asked this question in an interview.My doubt is from Internal Security: Preventing Unauthorized Filesystem Access topic in portion Access Control and Security of MySQL

Answer»

Right choice is (b) False

Explanation: The triggers and EVENTS are invoked AUTOMATICALLY by the server, so the concept of invoking user is not APPLIED. Thus, they have no SQL SECURITY CHARACTERISTIC and always execute with definer privileges.

21.

Triggers are not supported for _____________(a) delete(b) update(c) insert(d) viewsI had been asked this question in an online interview.The doubt is from Internal Security: Preventing Unauthorized Filesystem Access topic in chapter Access Control and Security of MySQL

Answer»

The correct OPTION is (d) views

For EXPLANATION: In MySQL, the triggers are RUN only after the table modifications like insert, update and DELETE are run. Triggers are not supported for views. In order to create a trigger, the CREATE TRIGGER STATEMENT is used.

22.

What does LAST_INSERT_ID() return when no AUTO_INCREMENT value has been generated during the current connection?(a) -1(b) 0(c) 1(d) 2I have been asked this question during an online interview.Enquiry is from Internal Security: Preventing Unauthorized Filesystem Access topic in chapter Access Control and Security of MySQL

Answer»

Right answer is (b) 0

Explanation: The ‘LAST_INSERT_ID()’ FUNCTION returns zero when no ‘AUTO_INCREMENT’ value has been generated during the CURRENT CONNECTION with the server. It is tied to the current connection.

23.

How can the value of recently generated sequence number be obtained?(a) LAST_INSERT_ID()(b) LATEST_INSERT_ID()(c) INITIAL_INSERT_ID()(d) INSERT_ID()I got this question in class test.My question is taken from Internal Security: Preventing Unauthorized Filesystem Access topic in chapter Access Control and Security of MySQL

Answer»

Correct choice is (a) LAST_INSERT_ID()

For explanation I would say: The value of most recently GENERATED sequence number can be OBTAINED by calling the LAST_INSERT_ID() function. This ENABLES to reference the AUTO_INCREMENT value in the SUBSEQUENT statement.

24.

What does the AUTO_INCREMENT sequences normally begin at?(a) 0(b) 1(c) -1(d) 2The question was asked in an online interview.My doubt stems from Internal Security: Preventing Unauthorized Filesystem Access topic in section Access Control and Security of MySQL

Answer» RIGHT CHOICE is (b) 1

To elaborate: The AUTO_INCREMENT column ATTRIBUTE provides unique numbers for column identification. AUTO_INCREMENT sequences normally begin at 1 and increase MONOTONICALLY LIKE 1, 2, 3, and so on.
25.

Which program is used as a utility for MyISAM table maintenance?(a) innochecksum(b) myisam_ftdump(c) myisamchk(d) myisamlogThis question was addressed to me in homework.This key question is from Internal Security: Preventing Unauthorized Filesystem Access topic in division Access Control and Security of MySQL

Answer»

The correct answer is (C) myisamchk

For explanation: The program ‘myisamchk’ is a UTILITY for the table maintenance. ‘innochecksum’ is USED for offline InnoDB file checksum utility. To DISPLAY full TEXT index information ‘myisam_ftdump’ is used.

26.

The server uses a Unix domain socket file for connections by clients to localhost.(a) True(b) FalseThe question was asked in final exam.I need to ask this question from Internal Security: Preventing Unauthorized Filesystem Access topic in section Access Control and Security of MySQL

Answer»

Correct option is (a) True

Easiest explanation: The server uses a Unix domain socket FILE for connections by clients to LOCALHOST. The socket file NORMALLY is publicly ACCESSIBLE so that client programs can use it again properly.

27.

What enables the read and execute access to all users outside of mysql group.(a) drwxrwxr-x(b) drwxrwxr-y(c) drwyrwyr-x(d) drwyrwyr-yI have been asked this question by my college director while I was bunking the class.The question is from Internal Security: Preventing Unauthorized Filesystem Access in chapter Access Control and Security of MySQL

Answer»

The correct answer is (a) drwxrwxr-x

Explanation: Some database directories have the proper permissions LIKE ‘drwx——‘ ENABLES READ, write, and EXECUTE access to the owner, but no access to anyone else. Other directories have an overly permissive access MODE like ‘drwxrwxr-x’.

28.

To check if the data directory contains insecure files or directories, the command executed is _____________(a) ls -l(b) ls -a(c) ls -la(d) ls -luThis question was posed to me during a job interview.The above asked question is from Internal Security: Preventing Unauthorized Filesystem Access in chapter Access Control and Security of MySQL

Answer»

The CORRECT ANSWER is (c) ls -la

Explanation: It can be determined whether the data directory contains INSECURE files or directories by executing ‘ls -la’. Then the lookup for files or directories that have the “group” or “other” permissions TURNED on.