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.

Which command is used to make a script file ‘run_me.sh’ executable?(a) chmod +e run_me.sh(b) chmod +a run_me.sh(c) chmod +y run_me.sh(d) chmod +x run_me.shThe question was posed to me during an interview for a job.This intriguing question comes from Relocating Data Directory Contents in section MySQL Data Directory of MySQL

Answer»

The correct choice is (d) chmod +x run_me.sh

Explanation: The command NAME ‘chmod’ stands for ‘change mode’. It is USED to define the way a FILE can be ACCESSED. To MAKE the script file ‘run_me.sh’ executable, the chmod command is used.

2.

Mysql cannot be used to execute script files.(a) True(b) FalseThe question was posed to me in an interview for internship.The question is from Relocating Data Directory Contents topic in section MySQL Data Directory of MySQL

Answer»

The correct option is (b) False

To EXPLAIN: Mysql is CAPABLE of READING input from a file in batch MODE. This is also known as the non-interactive mode. A lot of typing and time can be saved when COMMANDS are stored in a file and executed from a file.

3.

In which file are the statements entered in ‘mysql’ saved?(a) .mysql_queries(b) .queries(c) .mysql_history(d) .historyI had been asked this question in an internship interview.I want to ask this question from Relocating Data Directory Contents in section MySQL Data Directory of MySQL

Answer»

Correct ANSWER is (C) .mysql_history

Best explanation: Statements ENTERED in ‘mysql’ are stored in the file named ‘.mysql_history’. This file is LOCATED in the home directory itself. The SQL statements can be directly pasted into this file.

4.

What is the special database that always exists after setting up MySQL on a computer?(a) sampdb(b) mysql(c) information_schema(d) readme_dbI have been asked this question during an interview for a job.The question is from Relocating Data Directory Contents in division MySQL Data Directory of MySQL

Answer»

Right answer is (c) information_schema

To explain I would say: After installation of MYSQL, ‘information_schema’ is the special database that always EXISTS. ‘mysql’ can be seen depending on access rights. It holds the GRANT TABLES. ‘sampdb’ and ‘readme_db’ do not exist by default.

5.

When relocating an individual table, the table to be relocated should be ______________(a) MyISAM(b) InnoDB(c) TRANSACTION(d) ENGINEThis question was addressed to me during an interview.My enquiry is from Relocating Data Directory Contents in division MySQL Data Directory of MySQL

Answer»

Right ANSWER is (a) MyISAM

The best EXPLANATION: The RELOCATION of an individual table is supported only under certain LIMITED CIRCUMSTANCES. When relocating an individual table, the table to be relocated should be a MyISAM table.

6.

Before relocation of database, the server should be stopped if running.(a) True(b) FalseI have been asked this question during an online interview.My enquiry is from Relocating Data Directory Contents in division MySQL Data Directory of MySQL

Answer» CORRECT answer is (a) True

For explanation: The server ALWAYS looks for the database directories in the data directory. The only way to RELOCATE a database is by the symlink method. The server should be stopped if RUNNING.
7.

For which of these is the startup option best suited?(a) entire data directory(b) individual database tables(c) server PID file(d) individual database directoriesI have been asked this question in an online quiz.I'd like to ask this question from Relocating Data Directory Contents in portion MySQL Data Directory of MySQL

Answer» RIGHT answer is (C) server PID file

Best explanation: The startup option is BETTER suited relocation method for server PID file and the log FILES, while symlink is an applicable relocation method for the individual DATABASE tables.
8.

Symlink is an applicable relocation method for ______________(a) entire data directory(b) individual database tables(c) server PID file(d) log filesI had been asked this question in my homework.Enquiry is from Relocating Data Directory Contents topic in portion MySQL Data Directory of MySQL

Answer»

Correct answer is (b) individual database TABLES

The best I can explain: Symlink is an APPLICABLE relocation method for the individual database tables. However, the startup OPTION is better suited relocation method for server PID file and the log FILES.

9.

What is the statement used to select a default database?(a) USE(b) CREATE(c) DROP(d) SCHEMAThis question was posed to me in semester exam.My question comes from Structure of the Data Directory in portion MySQL Data Directory of MySQL

Answer»

Right answer is (a) USE

To explain I would say: MySQL has the FACILITY to use various statements specifically at the database level. For selecting a default database, the KEYWORD or clause used is the ‘USE’ statement.

10.

What is the synonym for CHARACTER SET?(a) CSET(b) CHSET(c) CHARSET(d) CHCSETI got this question in class test.This interesting question is from Structure of the Data Directory in section MySQL Data Directory of MySQL

Answer»

Right option is (c) CHARSET

Easy explanation: ‘CHARACTER SET’ can be abbreviated into ‘CHARSET’ and can be used in the same contexts and STATEMENTS where ‘CHARACTER SET’ is used. ‘charset’ is the server-supported character set.

11.

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) –runThis question was addressed to me in final exam.Asked question is from Structure of the Data Directory in chapter MySQL Data Directory of MySQL

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.

12.

mysql_next_result() does not return.(a) True(b) FalseI got this question in an online interview.My doubt is from Structure of the Data Directory in section MySQL Data Directory of MySQL

Answer»

Correct answer is (b) False

Easy explanation: The FUNCTION ‘mysql_next_result()’ RETURNS a status and INITIATES retrieval of the next set if more results are AVAILABLE. The status is zero if more results are available and -1 if not.

13.

The data directory subdirectory that corresponds to the nbdinfo database is ______________(a) mysql(b) performance_schema(c) sys(d) nbdinfoThis question was posed to me in semester exam.This is a very interesting question from Structure of the Data Directory topic in division MySQL Data Directory of MySQL

Answer» CORRECT choice is (b) performance_schema

The BEST explanation: The SYS directory corresponds to the sys SCHEMA. It provides a SET of objects to interpret Performance Schema information. The ‘performance_schema’ directory corresponds to the Performance Schema.
14.

What is the maximum number of characters allowed for a database name to have?(a) 16(b) 32(c) 64(d) 128The question was asked in an interview for job.I want to ask this question from Structure of the Data Directory in section MySQL Data Directory of MySQL

Answer»

Correct OPTION is (C) 64

The EXPLANATION: MYSQL allows the database names and the table names to be a maximum of 64 characters long. The length of these names is also bound by the length allowed by the operating system on the machine.

15.

In the database directory of the database each view and trigger object is associated with how many files?(a) 0(b) 1(c) 2(d) 3This question was posed to me at a job interview.My question comes from Structure of the Data Directory topic in chapter MySQL Data Directory of MySQL

Answer»

Right option is (b) 1

Easy explanation: Each view and trigger object is ASSOCIATED with one FILE in the DATABASE directory of the database containing that object. A view consists of a .FRM file that contains the view DEFINITION.

16.

Each database has a data directory located under database directory.(a) True(b) FalseI had been asked this question by my school teacher while I was bunking the class.The above asked question is from Structure of the Data Directory topic in section MySQL Data Directory of MySQL

Answer»

The CORRECT option is (b) False

For explanation: In MySQL, each database has a database directory that is LOCATED under the data directory. The tables, VIEWS and triggers within a database correspond to FILES in the database directory.

17.

An embedded application includes the server side and client side.(a) True(b) FalseI have been asked this question in an international level competition.I'm obligated to ask this question of Location of the Data Directory in chapter MySQL Data Directory of MySQL

Answer»

The correct option is (a) True

The best I can EXPLAIN: In MySQL, an embedded application includes both a CLIENT side and a server side, in order that it can PROCESS one group of OPTIONS for the client and another group for the server.

18.

Multiple statement execution is not enabled by default.(a) True(b) FalseI have been asked this question during an interview for a job.Origin of the question is Location of the Data Directory in portion MySQL Data Directory of MySQL

Answer»

The CORRECT choice is (a) True

For explanation: The ‘multiple-statement’ execution is not ENABLED by default, so the server must be TOLD that it is INTENDED to be USED. There are two ways to tell the server to enable the execution.

19.

What is the embedded server library when building from source enabled by?(a) –with-embedded-server(b) –with-server-embedded(c) –with-embedded-library(d) –with-library-embeddedThis question was addressed to me in an internship interview.The query is from Location of the Data Directory topic in chapter MySQL Data Directory of MySQL

Answer»

Right answer is (a) –with-embedded-SERVER

Easiest explanation: While building from the source, the embedded server LIBRARY is enabled by using the option ‘–with-embedded-server’ while running ‘configure’. This applies EQUALLY to MYSQL 5.0 and 5.1.

20.

What is the embedded server library containing the MySQL server linkable into applications?(a) libmysqla(b) libmysqlb(c) libmysqlc(d) libmysqldI have been asked this question during an online exam.This key question is from Location of the Data Directory in chapter MySQL Data Directory of MySQL

Answer»

Right choice is (d) libmysqld

To explain: MySQL INCLUDES an embedded server library, libmysqld, containing the MySQL server in a way that can be linked into APPLICATIONS. This ENABLES the production of MySQL-based standalone applications.

21.

What is exec_stmt_ssl written in?(a) C++(b) C(c) Python(d) PerlThe question was asked in class test.My query is from Location of the Data Directory topic in chapter MySQL Data Directory of MySQL

Answer»

The CORRECT choice is (b) C

Easy EXPLANATION: In MySQL, the ‘sampdb’ distribution contains a source file named ‘exec_stmt_ssl.c’ from which the client PROGRAM ‘exec_stmt_ssl’ can be built. There is a procedure to BUILD this file.

22.

Encrypted connections can be established using ______________(a) exec_stmt_ssl(b) exec_ssl_stmt(c) exec_stmnt_ssl(d) exec_ssl_stmntI got this question during an interview for a job.My question is from Location of the Data Directory in chapter MySQL Data Directory of MySQL

Answer»

Correct answer is (a) exec_stmt_ssl

The explanation: For the ‘exec_stmt_ssl’ to work PROPERLY, MYSQL must have been built with SSL SUPPORT, and the server must be started with the proper options that IDENTIFY its certificate and key files.

23.

Which data directory subdirectory corresponds to the nbdinfo database?(a) mysql(b) performance_schema(c) sys(d) nbdinfoThe question was posed to me during an interview.My enquiry is from Location of the Data Directory topic in chapter MySQL Data Directory of MySQL

Answer»

Correct ANSWER is (B) performance_schema

Explanation: The sys DIRECTORY corresponds to the sys schema. It provides a SET of objects to interpreting PERFORMANCE Schema information. The ‘performance_schema’ directory corresponds to the Performance Schema.

24.

Which data directory subdirectory provides the information used to inspect the internal execution of the server at runtime.(a) mysql(b) performance_schema(c) sys(d) nbdinfoThis question was posed to me during an interview for a job.This is a very interesting question from Location of the Data Directory in division MySQL Data Directory of MySQL

Answer» RIGHT option is (b) performance_schema

To elaborate: The ‘performance_schema’ directory corresponds to the Performance Schema. It provides information used to inspect the internal execution of the server at RUNTIME. The ‘SYS’ directory maps to ‘nbdinfo’.
25.

The datadir variable value can be seen using ______________(a) SHOW VARIABLES(b) DISP VARIABLES(c) CONNECT VARIABLES(d) SHOW VARIABLEThe question was asked in exam.I need to ask this question from Location of the Data Directory topic in chapter MySQL Data Directory of MySQL

Answer»

Right choice is (a) SHOW VARIABLES

Explanation: The data directory location is checked by the ‘datadir’ variable. It can be obtained using a ‘SHOW VARIABLES’ STATEMENT or a ‘mysqladmin’ variables command, LIKE: SHOW VARIABLES LIKE ‘datadir’.

26.

The option that specifies the data directory location at server startup is ______________(a) –data(b) –data_dir(c) –data-dir(d) –datadirI got this question in final exam.This interesting question is from Location of the Data Directory in division MySQL Data Directory of MySQL

Answer»

Right choice is (d) –datadir

To EXPLAIN I would SAY: At the SERVER STARTUP the data directory location is specified by using a ‘–datadir=dir_name’ option. It is helpful for naming a location other than the compiled in DEFAULT.