InterviewSolution
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. |
What is the general term for information about databases and the objects in MySQL?(a) datum(b) info(c) record(d) metadataI had been asked this question in a national level competition.I need to ask this question from Using Server-Side Prepared Statements in division MySQL Programs Using C of MySQL |
|
Answer» RIGHT choice is (d) metadata To explain I would say: There are various ways in which MYSQL facilitates the METHODS to obtain information about databases and the objects in them. For example, ‘SHOW’ STATEMENTS and ‘INFORMATION_SCHEMA’. |
|
| 2. |
The statement used to change the table name is __________(a) RENAME(b) CHANGE(c) CHANGENAME(d) CHANGENMThis question was posed to me by my school teacher while I was bunking the class.Enquiry is from Using Server-Side Prepared Statements in division MySQL Programs Using C of MySQL |
|
Answer» The CORRECT answer is (a) RENAME |
|
| 3. |
The statement used to remove indexes on tables is ______________(a) DROP INDEX(b) DELETE INDEX(c) REMOVE INDEX(d) FLUSH INDEXI have been asked this question during an interview.This is a very interesting question from Using Server-Side Prepared Statements topic in division MySQL Programs Using C of MySQL |
|
Answer» The correct choice is (a) DROP INDEX |
|
| 4. |
The statement that makes changes to the global attributes of the database is ______________(a) CHANGE(b) ALTER(c) ALTERNATE(d) UPDATEThis question was addressed to me in a national level competition.Question is from Using Server-Side Prepared Statements in portion MySQL Programs Using C of MySQL |
|
Answer» Right option is (b) ALTER |
|
| 5. |
The statement used to select a default database is ______________(a) USE(b) CREATE(c) DROP(d) SCHEMAThis question was addressed to me in an international level competition.Question is taken from Using Server-Side Prepared Statements in portion MySQL Programs Using C of MySQL |
|
Answer» The correct option is (a) USE |
|
| 6. |
A synonym for CHARACTER SET is ______________(a) CSET(b) CHSET(c) CHARSET(d) CHCSETI got this question in a national level competition.The question is from Using Server-Side Prepared Statements topic in chapter MySQL Programs Using C of MySQL |
|
Answer» CORRECT OPTION is (c) CHARSET To explain I WOULD say: ‘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. |
|
| 7. |
The maximum collations a character set can have is ______________(a) 0(b) 1(c) 2(d) more than 1This question was posed to me in an interview for internship.Query is from Using Server-Side Prepared Statements topic in division MySQL Programs Using C of MySQL |
|
Answer» Correct answer is (d) more than 1 |
|
| 8. |
The binary protocol is more difficult to use.(a) True(b) FalseThe question was posed to me in an online quiz.This intriguing question comes from Using Server-Side Prepared Statements topic in division MySQL Programs Using C of MySQL |
|
Answer» Right answer is (a) True |
|
| 9. |
The binary protocol does not support all statements.(a) True(b) FalseThis question was posed to me in examination.I'd like to ask this question from Using Server-Side Prepared Statements in chapter MySQL Programs Using C of MySQL |
|
Answer» The CORRECT OPTION is (a) True |
|
| 10. |
The default case sensitivity of the database and table names depends on ___________(a) Server SQL mode(b) Operating system of machine(c) Does not depend on anything(d) SQL serverThis question was posed to me in final exam.My doubt stems from Using Multiple-Statement Execution topic in section MySQL Programs Using C of MySQL |
|
Answer» RIGHT option is (b) Operating system of MACHINE For explanation: The DEFAULT case sensitivity imposes a dependency on the operating system of the machine on which the MYSQL server is running. Windows does not treat database and table names as case sensitive unlike Unix. |
|
| 11. |
Which statement is valid if ‘`sampledb`’ is a database and ‘`tbl`’ is a table in it?(a) SELECT * FROM `sampledb.member`(b) SELECT * FROM `sampledb`.`member`(c) SELECT * FROM `member`.`sampledb`(d) SELECT * FROM `member.sampledb`The question was posed to me during an interview.Asked question is from Using Multiple-Statement Execution topic in section MySQL Programs Using C of MySQL |
|
Answer» Correct OPTION is (B) SELECT * FROM `sampledb`.`member` |
|
| 12. |
Which character is illegal in naming an unquoted identifier in SQL?(a) .(b) _(c) $(d) 2The question was posed to me in an online interview.My question comes from Using Multiple-Statement Execution topic in chapter MySQL Programs Using C of MySQL |
|
Answer» CORRECT option is (a) . The explanation: An IDENTIFIER is used to REFER to a database or its ELEMENTS. These elements can be entire tables or attributes. The names of these identifiers follow some set of rules, so they have a set of LEGAL characters. |
|
| 13. |
To see the table structure which command is issued?(a) VIEW tbl_name;(b) SELECT TABLE tbl_name;(c) SELECT tbl_name;(d) DESCRIBE tbl_name;The question was posed to me in an online interview.I need to ask this question from Using Multiple-Statement Execution in chapter MySQL Programs Using C of MySQL |
|
Answer» RIGHT answer is (d) DESCRIBE tbl_name; To elaborate: The ‘DESCRIBE’ command is ISSUED to see the structure of the table ‘tbl_name’. It shows the structure in the format: Field-Type-Null-Key-Default-Extra. The ‘VIEW’ and ‘SELECT’ commands are USED to see the contents of the table. |
|
| 14. |
Which option executes all SQL statements in a SQL script irrespective of the number of errors?(a) –ensure(b) –force(c) –violent(d) –runThe question was asked in semester exam.This key question is from Using Multiple-Statement Execution topic in section MySQL Programs Using C of MySQL |
|
Answer» The correct option is (b) –force |
|
| 15. |
mysql_next_result() returns a status.(a) True(b) FalseThis question was addressed to me during an online exam.My question is based upon Using Multiple-Statement Execution topic in section MySQL Programs Using C of MySQL |
|
Answer» RIGHT CHOICE is (a) True 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. |
|
| 16. |
Which option enables multiple-statement execution?(a) CLIENT_MULTI_STATEMENTS(b) CLIENT_STATEMENTS_MULTI(c) MULTI_STATEMENTS_CLIENT(d) MULTI_CLIENTS_STATEMENTSI have been asked this question in exam.This interesting question is from Using Multiple-Statement Execution topic in chapter MySQL Programs Using C of MySQL |
|
Answer» The CORRECT choice is (a) CLIENT_MULTI_STATEMENTS |
|
| 17. |
Multiple statement execution is enabled by default.(a) True(b) FalseThis question was addressed to me at a job interview.Question is taken from Using Multiple-Statement Execution in section MySQL Programs Using C of MySQL |
|
Answer» Correct OPTION is (B) False |
|
| 18. |
System variable in MySQL server that enables to configure the SQL mode is __________(a) sql_mode(b) sql_config(c) sql_server(d) sql_enableThe question was asked in semester exam.My question is taken from Using the Embedded Server Library in portion MySQL Programs Using C of MySQL |
|
Answer» Correct answer is (a) sql_mode |
|
| 19. |
The name of the option file in Unix is __________(a) .my.cnf(b) .my.ini(c) .my.opt(d) .my.opcI had been asked this question during an internship interview.My question is taken from Using the Embedded Server Library topic in division MySQL Programs Using C of MySQL |
|
Answer» Right OPTION is (a) .my.cnf |
|
| 20. |
Which is the command to move the cursor to the beginning of line in mysql input editor?(a) Ctrl-E(b) Ctrl-D(c) Esc-a(d) Ctrl-AI had been asked this question by my school principal while I was bunking the class.This intriguing question originated from Using the Embedded Server Library in portion MySQL Programs Using C of MySQL |
|
Answer» Right ANSWER is (d) Ctrl-A |
|
| 21. |
Comparing a known value with NULL results into _______________(a) null(b) zero(c) a positive value(d) a negative valueThe question was asked during an online exam.The question is from Using the Embedded Server Library topic in division MySQL Programs Using C of MySQL |
|
Answer» Correct option is (a) NULL |
|
| 22. |
Which clause is used to display information that matches a given pattern?(a) WHERE(b) IS(c) SAME(d) LIKEThe question was asked in a national level competition.My question comes from Using the Embedded Server Library topic in division MySQL Programs Using C of MySQL |
|
Answer» Right choice is (d) LIKE |
|
| 23. |
Converting a client/server application to embedded server is simpler.(a) True(b) FalseI have been asked this question in a job interview.My doubt stems from Using the Embedded Server Library topic in chapter MySQL Programs Using C of MySQL |
|
Answer» Right answer is (a) True |
|
| 24. |
An embedded application includes the server side only.(a) True(b) FalseI had been asked this question in semester exam.I would like to ask this question from Using the Embedded Server Library topic in section MySQL Programs Using C of MySQL |
|
Answer» Correct CHOICE is (B) False |
|
| 25. |
When building from source, the embedded server library is enabled by _______________(a) –with-embedded-server(b) –with-server-embedded(c) –with-embedded-library(d) –with-library-embeddedI got this question during an online exam.Origin of the question is Using the Embedded Server Library in section MySQL Programs Using C of MySQL |
|
Answer» Correct ANSWER is (a) –with-embedded-server |
|
| 26. |
The embedded server library containing the MySQL server linkable into applications is _______________(a) libmysqla(b) libmysqlb(c) libmysqlc(d) libmysqldThis question was addressed to me in class test.The doubt is from Using the Embedded Server Library in chapter MySQL Programs Using C of MySQL |
|
Answer» CORRECT choice is (d) libmysqld To elaborate: 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. |
|
| 27. |
Which table in the ‘INFORMATION_SCHEMA’ stores information about storage engines and server plugins?(a) ENGINES, PLUGINS(b) FILES, PLUGINS(c) PLUGINS, STATISTICS(d) ENGINES, FILESThe question was asked in an international level competition.My doubt is from Writing Clients That Include SSL Support topic in portion MySQL Programs Using C of MySQL |
|
Answer» Right CHOICE is (a) ENGINES, PLUGINS |
|
| 28. |
Which statement is used to determine the storage engine for individual tables?(a) SHOW TABLE STATUS(b) SHOW DEFAULT STATUS(c) SHOW STATUS OF TABLE(d) SHOW STATUS TABLEThis question was addressed to me in an interview for job.My question is taken from Writing Clients That Include SSL Support in portion MySQL Programs Using C of MySQL |
|
Answer» Right choice is (a) SHOW TABLE STATUS |
|
| 29. |
Which mode prevents MySQL to perform full checking of date parts?(a) PREVENT_DATE_CHECK(b) STOP_DATES_CHECK(c) ALLOW_DATES_INVALID(d) ALLOW_INVALID_DATESThis question was posed to me during an internship interview.The doubt is from Writing Clients That Include SSL Support in portion MySQL Programs Using C of MySQL |
|
Answer» The correct answer is (d) ALLOW_INVALID_DATES |
|
| 30. |
By default, MySQL does not clip out of range numeric values to the nearest fit value.(a) True(b) FalseThis question was addressed to me during an online interview.This key question is from Writing Clients That Include SSL Support in chapter MySQL Programs Using C of MySQL |
|
Answer» Correct answer is (b) False |
|
| 31. |
Input handling cannot be customized with MySQL.(a) True(b) FalseI had been asked this question in an online quiz.Query is from Writing Clients That Include SSL Support in division MySQL Programs Using C of MySQL |
|
Answer» The correct answer is (b) False |
|
| 32. |
On failure, ‘mysql_query()’ returns _______________(a) 0(b) 1(c) -1(d) a non-zero valueI had been asked this question during an interview.My doubt is from Writing Clients That Include SSL Support in section MySQL Programs Using C of MySQL |
|
Answer» CORRECT OPTION is (d) a non-zero value Explanation: Both of the FUNCTIONS named ‘mysql_query()’ and ‘mysql_real_query()’ RETURN zero for statements that succeed. They return non zero for failure. A statement is successfully executed if the server accepts it. |
|
| 33. |
The exec_stmt_ssl is written in _______________(a) C++(b) C(c) Python(d) PerlI got this question in an interview.The doubt is from Writing Clients That Include SSL Support in section MySQL Programs Using C of MySQL |
|
Answer» CORRECT answer is (b) C The best I can EXPLAIN: 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. |
|
| 34. |
What enables encrypted connections to be established?(a) exec_stmt_ssl(b) exec_ssl_stmt(c) exec_stmnt_ssl(d) exec_ssl_stmntI got this question during an interview.My doubt is from Writing Clients That Include SSL Support in section MySQL Programs Using C of MySQL |
|
Answer» The correct option is (a) exec_stmt_ssl |
|
| 35. |
mysql_store_result() does not return a result set.(a) True(b) FalseI had been asked this question in semester exam.This intriguing question comes from Processing SQL Statements topic in chapter MySQL Programs Using C of MySQL |
|
Answer» Correct choice is (B) False |
|
| 36. |
The columns containing binary value that include null bytes will not print properly using the %s printf() format specifier.(a) True(b) FalseI had been asked this question during an internship interview.The question is from Processing SQL Statements topic in chapter MySQL Programs Using C of MySQL |
|
Answer» Right choice is (a) True |
|
| 37. |
mysql_fetch_row() returns _______________(a) integer(b) float(c) structure(d) pointerI have been asked this question in a job interview.This interesting question is from Processing SQL Statements topic in section MySQL Programs Using C of MySQL |
|
Answer» CORRECT choice is (d) pointer The explanation is: ‘mysql_fetch_row()’ returns a MYSQL_ROW value, a pointer to an array of values. If the RETURN value is ASSIGNED to a variable named ROW each value within the row is accessed as row[i]. |
|
| 38. |
For failure, mysql_query() returns _______________(a) 0(b) 1(c) -1(d) a non-zeroThe question was asked in unit test.My question comes from Processing SQL Statements topic in portion MySQL Programs Using C of MySQL |
|
Answer» Right choice is (d) a non-zero |
|
| 39. |
The general statement-issuing routine is _______________(a) mysql_real_query()(b) mysql_query_real()(c) mysql_image_query()(d) mysql_query_image()I have been asked this question in an interview for job.This interesting question is from Processing SQL Statements in section MySQL Programs Using C of MySQL |
|
Answer» The correct answer is (a) mysql_real_query() |
|
| 40. |
All API calls return a value.(a) True(b) FalseThe question was posed to me by my college professor while I was bunking the class.The question is from Handling Errors and Processing Command Options topic in chapter MySQL Programs Using C of MySQL |
|
Answer» The CORRECT answer is (B) False |
|
| 41. |
The –protocol value ‘TCP’ runs on which operating systems?(a) unix only(b) windows only(c) all(d) noneI got this question in quiz.Question is from Handling Errors and Processing Command Options in section MySQL Programs Using C of MySQL |
|
Answer» The correct CHOICE is (c) all |
|
| 42. |
The function load_defaults() reads the option files.(a) True(b) FalseThis question was posed to me in an online quiz.My question is from Handling Errors and Processing Command Options topic in portion MySQL Programs Using C of MySQL |
|
Answer» The correct answer is (a) True |
|
| 43. |
What does mysql_real_connect() return if it fails?(a) integer(b) float(c) structure(d) NULLThe question was asked in class test.This intriguing question comes from Handling Errors and Processing Command Options topic in portion MySQL Programs Using C of MySQL |
|
Answer» The correct ANSWER is (d) NULL |
|
| 44. |
The argument to the function mysql_error() is _______________(a) integer(b) float(c) structure(d) pointerThe question was posed to me in a national level competition.Enquiry is from Handling Errors and Processing Command Options in division MySQL Programs Using C of MySQL |
|
Answer» CORRECT answer is (d) pointer To EXPLAIN: The argument to the API functions ‘mysql_error()’, ‘mysql_errno()’ and ‘mysql_sqlstate()’ is a pointer to the connection HANDLER. These should be CALLED after an error occurs. |
|
| 45. |
Which of the following returns an SQLSTATE code?(a) mysql_error()(b) mysql_errno()(c) mysql_sqlstate()(d) mysql_close()The question was posed to me during an interview.My question is taken from Handling Errors and Processing Command Options in section MySQL Programs Using C of MySQL |
|
Answer» Right choice is (C) mysql_sqlstate() |
|
| 46. |
Which of the following returns a MySQL-specific numeric code?(a) mysql_error()(b) mysql_errno()(c) mysql_sqlstate()(d) mysql_close()The question was posed to me during an interview.The origin of the question is Handling Errors and Processing Command Options in division MySQL Programs Using C of MySQL |
|
Answer» The CORRECT option is (b) mysql_errno() |
|
| 47. |
Which of these returns a string containing an error message?(a) mysql_error()(b) mysql_errno()(c) mysql_sqlstate()(d) mysql_close()The question was asked during an interview.My question is taken from Handling Errors and Processing Command Options topic in division MySQL Programs Using C of MySQL |
|
Answer» The correct ANSWER is (a) mysql_error() |
|
| 48. |
The ‘SOCKET’ protocol is permitted on which operating systems?(a) all(b) unix only(c) windows only(d) noneI have been asked this question by my school teacher while I was bunking the class.Question is taken from Connecting to the Server topic in portion MySQL Programs Using C of MySQL |
|
Answer» Correct ANSWER is (B) unix only |
|
| 49. |
The –protocol value ‘TCP’ runs on which operating systems?(a) all(b) unix only(c) windows only(d) noneI got this question during an interview for a job.My doubt stems from Connecting to the Server in chapter MySQL Programs Using C of MySQL |
|
Answer» The correct OPTION is (a) all |
|
| 50. |
Connections to remote servers always use TCP/IP.(a) True(b) FalseThis question was posed to me in a job interview.This question is from Connecting to the Server in portion MySQL Programs Using C of MySQL |
|
Answer» CORRECT option is (a) True The explanation: The connections to remote servers ALWAYS USE TCP/IP. To CONNECT to the server running on remote.example.com using the default port number (3306) this command is used: mysql –host=remote.example.com. |
|