InterviewSolution
Saved Bookmarks
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.
| 51. |
The Perl DBI is ______________(a) database inheritance(b) database integrity(c) database interface(d) database isolation |
|
Answer» Correct option is (c) database interface To elaborate: The Perl DBI is the Perl Database Interface. The work of the interface is to form a link between the application programming interface in C with all the other programming languages. |
|
| 52. |
What is the default path to Perl in Unix?(a) /usr/bin/perl(b) /usr/bin(c) /usr/perl(d) /usr/perl/bin |
|
Answer» Correct answer is (a) /usr/bin/perl For explanation: All Perl scripts generally begin with a #! (shebang) line. A script is a file containing a sequence of commands. The Perl scripts are text files, which can be created using any text editor. |
|
| 53. |
Which of these is used during MySQL setup?(a) mysqld_multi(b) mysql.server(c) mysqld_safe(d) comp_err |
|
Answer» Right option is (d) comp_err To explain: The program ‘comp_err’ is used during the MySQL build or the MySQL installation process. This program compiles the error message files from the error source files. The others are not run during startup. |
|
| 54. |
A stored program associated with a schedule is ______________(a) Trigger(b) Event(c) Stored function(d) Stored procedure |
|
Answer» Right answer is (b) Event The best explanation: The MySQL version 5.1.6 and above has an event scheduler. It enables to perform time activated database operations. An event is a stored program that is associated with a schedule. |
|
| 55. |
The stored-routine privileges are contained in ______________(a) user(b) db(c) tables_priv(d) procs_priv |
|
Answer» Correct choice is (d) procs_priv The best 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. |
|
| 56. |
Which grant table scope columns are case insensitive?(a) Host(b) User(c) Password(d) Db |
|
Answer» Right choice is (a) Host To elaborate: ‘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. |
|
| 57. |
Which of the following are the valid “database datatypes” in Mysql?(a) Numerical(b) Temporal(c) Text(d) All of the mentioned |
|
Answer» Correct choice is (d) All of the mentioned The best explanation: None. |
|
| 58. |
Which line of the following statements will produce error?(a) SELECT * FROM person WHERE person_id=1;(b) SELECT pname FROM person;(c) SELECT pname, lname, person_id FROM person;(d) None of the mentioned |
|
Answer» Right answer is (d) None of the mentioned To explain: None. |
|
| 59. |
“CREATE VIEW …” command is used to create which type of table in Mysql?(a) Permanent Tables(b) Virtual tables(c) Temporary tables(d) All of the mentioned |
|
Answer» The correct answer is (b) Virtual tables Explanation: CREATE VIEW is used to create virtual tables. |
|
| 60. |
“CREATE TABLE …” command is used to create which type of table in Mysql?(a) Permanent Tables(b) Virtual tables(c) Temporary tables(d) All of the mentioned |
|
Answer» Correct option is (a) Permanent Tables The best I can explain: CREATE table is used to create permanent tables in database. |
|
| 61. |
REPAIR TABLE does not work for _____________(a) MyISAM(b) ARCHIVE(c) InnoDB(d) CSV |
|
Answer» Correct choice is (c) InnoDB To elaborate: ‘REPAIR TABLE’ works for MyISAM, ARCHIVE, and CSV tables. For MyISAM tables, it has the same effect as ‘myisamchk –recover’ tbl_name by default. This statement does not work with views. |
|
| 62. |
What is the Perl DBI?(a) database inheritance(b) database integrity(c) database interface(d) database isolation |
|
Answer» The correct option is (c) database interface Easiest explanation: The Perl DBI is the Perl Database Interface. The work of the interface is to form a link between the application programming interface in C with all the other programming languages. |
|
| 63. |
The option that executes all SQL statements in a SQL script irrespective of the number of errors is ______________(a) –ensure(b) –force(c) –violent(d) –run |
|
Answer» Right choice is (b) –force The explanation is: If SQL queries in a file are run using mysql in batch mode, mysql either quits after the first error. If the –force option is specified all the queries are executed indiscriminately. |
|
| 64. |
Which option executes all SQL statements in a SQL script irrespective of the number of errors?(a) –ensure(b) –violent(c) –force(d) –run |
|
Answer» Correct choice is (c) –force For explanation I would say: If SQL queries in a file are run using mysql in batch mode, mysql either quits after the first error. If the –force option is specified all the queries are executed indiscriminately. |
|
| 65. |
The value of event_scheduler that enables checking status but not changing it at runtime is ______________(a) ON(b) OFF(c) DISABLED(d) ENABLED |
|
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. |
|
| 66. |
The number of values that can be returned from a given stored function is ______________(a) 0(b) 1(c) 2(d) 3 |
|
Answer» The correct option is (b) 1 The explanation: In MySQL, the stored function cannot return multiple values. Instead, multiple stored functions can be written and invoked from within a single statement however, they are different from stored procedures. |
|
| 67. |
The option that enables multiple-statement execution is ____________(a) CLIENT_MULTI_STATEMENTS(b) CLIENT_STATEMENTS_MULTI(c) MULTI_STATEMENTS_CLIENT(d) MULTI_CLIENTS_STATEMENTS |
|
Answer» The correct choice is (a) CLIENT_MULTI_STATEMENTS For explanation I would say: There are two ways to enable the multiple-statement execution. The first is to add the ‘CLIENT_MULTI_STATEMENTS’ option in the flags argument to ‘mysql_real_connect()’ at connect time. |
|
| 68. |
How many values can be returned from a given stored function?(a) 0(b) 1(c) 2(d) 3 |
|
Answer» The correct answer is (b) 1 The best explanation: In MySQL, the stored function cannot return multiple values. Instead, multiple stored functions can be written and invoked from within a single statement however, they are different from stored procedures. |
|
| 69. |
Which Key is used to link two tables in Mysql?(a) Primary Key(b) Foreign Key(c) Both Primary and Foreign Key(d) None of the mentioned |
|
Answer» The correct option is (b) Foreign Key The best I can explain: Foreign Key is only the Key which can link two tables. |
|
| 70. |
How many values can be returned from a stored procedure?(a) 0(b) 1(c) 2(d) 3 |
|
Answer» Right option is (a) 0 For explanation I would say: In MySQL, unlike the stored functions, the stored procedures cannot return values. They can be used to perform calculations or produce the result sets passed back to the clients. |
|
| 71. |
For which table does ‘REPAIR TABLE’ not work?(a) MyISAM(b) ARCHIVE(c) CSV(d) InnoDB |
|
Answer» The correct option is (d) InnoDB The explanation: ‘REPAIR TABLE’ works for MyISAM, ARCHIVE, and CSV tables. For MyISAM tables, it has the same effect as ‘myisamchk –recover’ tbl_name by default. This statement does not work with views. |
|
| 72. |
Which option executes all SQL statements in a SQL script irrespective of the number of errors?(a) –ensure(b) –force(c) –violent(d) –run |
|
Answer» The correct option is (b) –force To elaborate: If SQL queries in a file are run using mysql in batch mode, mysql either quits after the first error. If the –force option is specified all the queries are executed indiscriminately. |
|
| 73. |
Which option enables multiple-statement execution?(a) CLIENT_MULTI_STATEMENTS(b) CLIENT_STATEMENTS_MULTI(c) MULTI_STATEMENTS_CLIENT(d) MULTI_CLIENTS_STATEMENTS |
|
Answer» The correct choice is (a) CLIENT_MULTI_STATEMENTS Explanation: There are two ways to enable the multiple-statement execution. The first is to add the ‘CLIENT_MULTI_STATEMENTS’ option in the flags argument to ‘mysql_real_connect()’ at connect time. |
|
| 74. |
Which file is created by the server to store the database attributes?(a) db.otp(b) dp.zip(c) db.opt(d) db.cls |
|
Answer» Correct option is (c) db.opt For explanation: Whenever a database is created in MySQL, the MySQL server creates a directory with the same name as the database. It creates the file db.opt to store the attributes. |
|
| 75. |
The file created by the server to store the database attributes is __________(a) db.otp(b) dp.zip(c) db.opt(d) db.cls |
|
Answer» Right choice is (c) db.opt Explanation: Whenever a database is created in MySQL, the MySQL server creates a directory with the same name as the database. It creates the file db.opt to store the attributes. |
|
| 76. |
What sets the association between one or more MyISAM tables and the named key cache?(a) BEGIN(b) CACHE INDEX(c) ALTER DATABASE(d) ALTER EVENT |
|
Answer» Correct choice is (b) CACHE INDEX The explanation is: ‘CACHE INDEX’ sets up an association between one or more MyISAM tables and the named key cache which must already exist. The INDEX privilege is needed for each table named in the statement. |
|
| 77. |
What sets up an association between one or more MyISAM tables and the named key cache?(a) BEGIN(b) CACHE INDEX(c) ALTER DATABASE(d) ALTER EVENT |
|
Answer» Right choice is (b) CACHE INDEX The best I can explain: ‘CACHE INDEX’ sets up an association between one or more MyISAM tables and the named key cache which must already exist. The INDEX privilege is needed for each table named in the statement. |
|
| 78. |
What is AI in terms of database collation?(a) Accent Insensitive(b) Augment Insensitive(c) Articulate Insensitive(d) Addition Insensitive |
|
Answer» Correct choice is (a) Accent Insensitive To explain: The collation in the database can also be specified in the join or comparison conditions. The value ‘AI’ means ‘Accent Insensitive’. ‘CS’ is case sensitive and ‘CI’ is case insensitive. |
|
| 79. |
Which statement is used to show the server’s current character set and collation settings?(a) SHOW CONSTANTS(b) SHOW CONSTRAINTS(c) SHOW VARIABLES(d) DISP VARIABLES |
|
Answer» Correct option is (c) SHOW VARIABLES Easy explanation: The statement ‘SHOW VARIABLES LIKE ‘character\_set\_%” displays a table consisting of two columns, ‘Variable_name’ and ‘Value’. Replacing characer\_set\_% with collation\_% shows the collation variables. |
|
| 80. |
The program that performs logical backups is _____________(a) mysqlimport(b) mysqldump(c) myslqpit(d) mysqllogic |
|
Answer» The correct choice is (b) mysqldump The best I can explain: The ‘mysqldump’ performs logical backups. It produces a set of SQL statements that are executed to reproduce the original database object definitions. It dumps one or more MySQL databases for backup. |
|
| 81. |
The column not returned by ‘OPTIMIZE TABLE’ is _____________(a) Table(b) Msg_txt(c) Op(d) Msg_type |
|
Answer» Correct option is (b) Msg_txt To explain: ‘OPTIMIZE TABLE’ table catches and throws any errors that occur while copying table statistics from the old file to the newly created file. It returns a result set of columns. |
|
| 82. |
What performs a key distribution analysis and stores the distribution for the named table or tables?(a) ANALYZE TABLE(b) CHECK TABLE(c) CHECKSUM TABLE(d) OPTIMIZE TABLE |
|
Answer» Right choice is (a) ANALYZE TABLE For explanation: ‘ANALYZE TABLE’ performs a key distribution analysis and stores the distribution for the named table or tables. For the MyISAM tables, this statement is equivalent to using ‘myisamchk –analyze’. |
|
| 83. |
Which clause specifies periodic execution at fixed intervals?(a) EVERY(b) ALL(c) AT(d) ALTERNATE |
|
Answer» Correct choice is (a) EVERY The best I can explain: The ‘EVERY n interval’ clause specifies the periodic execution at fixed intervals. The interval values are like those used for the DATE_ADD() function, such as HOUR, DAY or MONTH. |
|
| 84. |
Which privilege must be given to the database to create a stored function or procedure?(a) CREATE ROUTINE(b) CREATE METHOD(c) CREATE FUNCTION(d) CREATE PROCEDURE |
|
Answer» Correct answer is (a) CREATE ROUTINE To explain: The ‘CREATE ROUTINE’ privilege must be given for the database in order to create a stored function or procedure. Stored functions and procedures always belong to a particular database. |
|
| 85. |
The statement that performs key distribution analysis and stores the distribution for the named tables is _____________(a) CHECK TABLE(b) ANALYZE TABLE(c) CHECKSUM TABLE(d) OPTIMIZE TABLE |
|
Answer» Right answer is (b) ANALYZE TABLE The best explanation: ‘ANALYZE TABLE’ performs a key distribution analysis and stores the distribution for the named table or tables. For the MyISAM tables, this statement is equivalent to using ‘myisamchk –analyze’. |
|
| 86. |
MySQL stores the database character set and collation attributes in the file _________(a) dp.opt(b) db.opt(c) db.sv(d) db.zip |
|
Answer» Right option is (b) db.opt For explanation I would say: The file named ‘db.opt’ is of a great significance to MySQL, espectially the MySQL server. It stores the database attributes along with the db charset and collation attributes. |
|
| 87. |
The default definer of an event is the user who _______________(a) created the database(b) created the event(c) created the table(d) created the column |
|
Answer» The correct answer is (b) created the event To explain: Unless the event has been altered, the default definer of an event is the user who created the event. In this case, the definer is the one who called the last ‘ALTER EVENT’ statement. |
|
| 88. |
For the same input parameters, if the stored function returns the same result, it is called _____________(a) deterministic(b) non deterministic(c) regular(d) monotonous |
|
Answer» Right answer is (a) deterministic Explanation: For the same input parameters, if the stored function returns the same result, it is called a deterministic function. Otherwise, the stored function is called not deterministic. |
|
| 89. |
To create or drop events for a database, which privilege should be granted?(a) CREATE(b) DROP(c) PRIVILEGE(d) EVENT |
|
Answer» Right choice is (d) EVENT The best explanation: In MySQL, all events belong to some database, so the EVENT privilege must be granted for that database in order to both create or drop the events for it. An event is a stored program. |
|
| 90. |
The statement that suspends the replication related activity of the slave server is _____________(a) RESUME SLAVE(b) START SLAVE(c) STOP SLAVE(d) GET SLAVE |
|
Answer» Correct answer is (c) STOP SLAVE Best explanation: The ‘STOP SLAVE’ and ‘START SLAVE’ statements suspend and resume the replication-related activity of a slave server. These statements are useful for telling the slave to be quiescent. |
|
| 91. |
What is the log in which data changes received from a replication master server are written?(a) error log(b) general query log(c) binary log(d) relay log |
|
Answer» Correct choice is (d) relay log Explanation: The Relay Log has the data changes received from a replication master server written in it. The problems encountered during the starting, running or stopping of ‘mysqld’ is written in error log. |
|
| 92. |
The option which delays index flushing for slave server is _________________(a) –delay-write-key=ALL(b) –delay-key-write=ALL(c) –key-write-delay=NONE(d) –key-delay-write=NONE |
|
Answer» Right option is (b) –delay-key-write=ALL The best I can explain: For the replication slave servers, the –delay-key-write=ALL option delays index flushing for all MyISAM tables, regardless of how they were created originally on the master server. |
|
| 93. |
The log in which data changes received from a replication master server are written is _____________(a) error log(b) general query log(c) binary log(d) relay log |
|
Answer» Correct option is (d) relay log The explanation is: The Relay Log has the data changes received from a replication master server written in it. The problems encountered during the starting, running or stopping of ‘mysqld’ are written in error log. |
|
| 94. |
The slave stores the CHANGE MASTER parameters in the file _____________(a) slave.info(b) slave.inf(c) master.info(d) master.inf |
|
Answer» Right option is (c) master.info Explanation: The ‘slave’ stores the ‘CHANGE MASTER’ parameters in a file named ‘master.info’ in its data directory in order to record the initial replication status. It updates the file as replication proceeds. |
|
| 95. |
The Audit_log_events system variable is of type _____________(a) string(b) integer(c) float(d) double |
|
Answer» Right option is (b) integer To elaborate: The system variable ‘Audit_log_events’ is of type integer. The variable scope if GLOBAL, that is, it can be viewed by issuing the statement ‘SHOW GLOBAL STATUS’, instead of ‘SESSION’. |
|
| 96. |
The primary programming interface to MySQL is _____________(a) C API(b) C++ API(c) Java API(d) Python API |
|
Answer» Correct option is (a) C API To explain: The primary programming interface to MySQL is the C API. It is used to implement some of the standard clients in the MySQL distribution including mysql, mysqladmin and mysqldump. |
|
| 97. |
Which myisamchk variable represents the size of buffer used to hold index blocks?(a) key_buffer_size(b) read_buffer_size(c) sort_buffer_size(d) write_buffer_size |
|
Answer» The correct choice is (a) key_buffer_size Easy explanation: The myisamchk variable ‘key_buffer_size’ stores the size of buffer that is used to hold index blocks. ‘read_buffer_size’ stores the size of buffer used for read operations, ‘sort_buffer_size’ is used for sorting. |
|
| 98. |
The system variable to maintain InnoDB log buffer size is _________________(a) innodb_log_buffer_size(b) innodb_buffer_log_size(c) buffer_log_innodb_size(d) log_buffer_innodb_size |
|
Answer» The correct choice is (a) innodb_log_buffer_size To elaborate: The InnoDB storage engine has its own cache used for buffering the data and index values. It maintains a log buffer. The size for this is controlled by innodb_log_buffer_size. |
|
| 99. |
The ‘mysqlbackup’ command to perform a restore operation is _____________(a) copy-back-and-apply-log(b) apply-log-and-copy-back(c) copy-log-and-apply-back(d) apply-back-and-copy-log |
|
Answer» Correct option is (a) copy-back-and-apply-log Easiest explanation: The ‘mysqlbackup’ commands to perform a restore operation are ‘copy-back-and-apply-log’ and ‘copy-back’ (for directory backup only). The restoration process requires the database server to be already shut down. |
|
| 100. |
Which statement suspends the replication related activity of the slave server?(a) RESUME SLAVE(b) START SLAVE(c) STOP SLAVE(d) GET SLAVE |
|
Answer» Correct option is (c) STOP SLAVE The explanation is: The ‘STOP SLAVE’ and ‘START SLAVE’ statements suspend and resume the replication-related activity of a slave server. These statements are useful for telling the slave to be quiescent. |
|