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 of the following functions are not performed by “ALTER” clause?(a) Change the name of the table(b) Change the name of the column(c) Drop a column(d) All of the mentionedI have been asked this question in unit test.My question is from Populating & Modifying Tables topic in chapter Using SQL to Manage Data of MySQL

Answer» CORRECT OPTION is (d) All of the mentioned

Explanation: NONE.
2.

Which of the following functions are not performed by “ALTER” clause?(a) Change the name of the table(b) Change the name of the column(c) Drop a column(d) All of the mentionedThe question was posed to me in examination.My query is from Populating & Modifying Tables topic in section Using SQL to Manage Data of MySQL

Answer»
3.

Which clause is used to rename the existing table?(a) RENAME(b) MODIFY(c) ALTER(d) None of the mentionedThe question was posed to me in an internship interview.I would like to ask this question from Populating & Modifying Tables topic in section Using SQL to Manage Data of MySQL

Answer» RIGHT CHOICE is (a) RENAME

The EXPLANATION: NONE.
4.

“INSERT” is same as “UPDATE”?(a) NO(b) YES(c) May be(d) None of the mentionedI got this question in an interview for job.This key question is from Populating & Modifying Tables in division Using SQL to Manage Data of MySQL

Answer» CORRECT answer is (a) NO

To explain: “INSERT “is used to entering the data in the NEWLY created table while “UPDATE” is used to modify the data which is already inserted with help of statement “INSERT”.
5.

Which statement is used to delete an existing row from the table?(a) DELETE(b) WHERE(c) MODIFY(d) None of the mentionedI had been asked this question during an interview.Query is from Populating & Modifying Tables in division Using SQL to Manage Data of MySQL

Answer»

The CORRECT OPTION is (a) DELETE

For explanation I WOULD SAY: None.

6.

Which statement is used for updating existing information in the table?(a) UPDATE(b) WHERE(c) MODIFY(d) ALTERThis question was addressed to me in a national level competition.Asked question is from Populating & Modifying Tables in portion Using SQL to Manage Data of MySQL

Answer»

The CORRECT OPTION is (a) UPDATE

Best EXPLANATION: NONE.

7.

Which among the following is the correct syntax for showing all tables in the database?(a) SHOWS TABLES(b) SHOW TABLE(c) SHOW(d) SHOWS TABLES;This question was posed to me in unit test.My doubt stems from Populating & Modifying Tables in portion Using SQL to Manage Data of MySQL

Answer» RIGHT choice is (d) SHOWS TABLES;

Explanation: NONE.
8.

Which command is used to show all tables that are stored in a database?(a) SHOWS(b) SHOW(c) SHOWES(d) None of the mentionedI have been asked this question in class test.I need to ask this question from Populating & Modifying Tables topic in section Using SQL to Manage Data of MySQL

Answer»

The CORRECT ANSWER is (d) NONE of the mentioned

For EXPLANATION: None.

9.

Which Clause is used to select a particular table in Mysql?(a) WHERE(b) SELECT(c) FROM(d) ALTERThe question was posed to me in a national level competition.My question comes from Populating & Modifying Tables in portion Using SQL to Manage Data of MySQL

Answer»

The CORRECT answer is (C) FROM

To explain I would SAY: None.

10.

Which Clause is used to sort the stored data in alphabetical order?(a) ORDER by CLAUSE(b) MODIFY(c) ALTER(d) UPDATEI got this question in my homework.I'd like to ask this question from Populating & Modifying Tables topic in section Using SQL to Manage Data of MySQL

Answer» RIGHT OPTION is (a) ORDER by CLAUSE

Explanation: NONE.
11.

Which Clause is used to select a particular row from the set of row in an existing table?(a) WHERE(b) FROM(c) ALTER(d) None of the mentionedI have been asked this question in class test.Question is from Populating & Modifying Tables in chapter Using SQL to Manage Data of MySQL

Answer» RIGHT ANSWER is (a) WHERE

Easiest EXPLANATION: NONE.
12.

Which statement is used to select columns and rows from the table?(a) SELECT(b) ALTER(c) MODIFY(d) FROMI had been asked this question in quiz.Question is from Populating & Modifying Tables topic in portion Using SQL to Manage Data of MySQL

Answer» RIGHT OPTION is (a) SELECT

For EXPLANATION: NONE.
13.

What is the default value of column?(a) NULL(b) 0(c) -1(d) UndefinedThis question was posed to me by my school teacher while I was bunking the class.This is a very interesting question from Populating & Modifying Tables topic in section Using SQL to Manage Data of MySQL

Answer»

Correct choice is (a) NULL

Easiest explanation: When table is DEFINED in MYSQL then each column related to table will contain NULL Value as DEFAULT.

14.

Which among the following is the correct syntax for modifying the definition of an existing table?(a) ALTER TABLE person MODIFY person_id SMALLINT UNSIGNED AUTO_INCREMENT;(b) ALTER TABLE personperson_id SMALLINT UNSIGNED AUTO_INCREMENT;(c) ALTER TABLE person MODIFY person_id ;(d) ALTER TABLE personI got this question in an online quiz.I'm obligated to ask this question of Populating & Modifying Tables topic in chapter Using SQL to Manage Data of MySQL

Answer»

The correct OPTION is (a) ALTER TABLE person MODIFY person_id SMALLINT UNSIGNED AUTO_INCREMENT;

EXPLANATION: NONE.

15.

Which feature is used for the automatic increment of the column?(a) AUTO_INCREMENT(b) AUTO(c) INCREMENT(d) All of the mentionedI had been asked this question in a national level competition.The origin of the question is Populating & Modifying Tables in section Using SQL to Manage Data of MySQL

Answer»

The correct answer is (a) AUTO_INCREMENT

For EXPLANATION I WOULD say: NONE.

16.

Which statement can be used for modifying the definition for an existing table?(a) ALTER(b) Modified(c) SELECT(d) FROMThis question was posed to me in semester exam.The origin of the question is Populating & Modifying Tables topic in division Using SQL to Manage Data of MySQL

Answer» CORRECT CHOICE is (a) ALTER

Easiest EXPLANATION: NONE.
17.

Is it necessary to insert the value in each column of the table?(a) Yes(b) No(c) Depends on the server(d) Depends on the usage of the tableI got this question at a job interview.Enquiry is from Populating & Modifying Tables in division Using SQL to Manage Data of MySQL

Answer» RIGHT option is (b) No

The BEST I can explain: It is not necessary to insert the value in each COLUMN because there ALWAYS a default value is inserted by the server “NULL”.
18.

Which Statement is used to insert the values in the table?(a) INSERT INTO(b) Insert(c) INSERT(d) None of the mentionedI have been asked this question in my homework.Enquiry is from Populating & Modifying Tables topic in portion Using SQL to Manage Data of MySQL

Answer» CORRECT ANSWER is (a) INSERT INTO

Explanation: NONE.
19.

What default value gets stored in columns of the table?(a) NULL(b) 0(c) 1(d) -1This question was addressed to me in an online quiz.This question is from Table Creation in section Using SQL to Manage Data of MySQL

Answer»

The correct choice is (a) NULL

The best explanation: NULL is the DEFAULT VALUE as it STANDS for “Absence of value”.

20.

What is the meaning of “REFERENCES” in table definition?(a) Primary key(b) NULL(c) Foreign Key(d) A ”foreign Key” belong to this particular tableThe question was posed to me by my school teacher while I was bunking the class.Question is from Table Creation topic in portion Using SQL to Manage Data of MySQL

Answer»

The correct option is (d) A ”foreign Key” BELONG to this particular table

The best I can explain: When “Foreign Key” declared in a table then it necessary to DEFINE the NAME of the table to which it belong with HELP of constraint “REFERENCES”.

21.

Which among the following are the correct definitions for “NULL” in Mysql?(a) Absence of value(b) Unknown(c) Empty set(d) All of the mentionedThis question was addressed to me in a job interview.My enquiry is from Table Creation in portion Using SQL to Manage Data of MySQL

Answer» RIGHT ANSWER is (d) All of the mentioned

The BEST EXPLANATION: NONE.
22.

Which among the following is the correct syntax for defining “ENUM” in Mysql?(a) gender ENUM (‘M’, ‘F’),(b) gender ENUM,(c) gender ENUM ( ),(d) none of the mentionedI have been asked this question in quiz.This key question is from Table Creation topic in portion Using SQL to Manage Data of MySQL

Answer»

Correct OPTION is (a) GENDER ENUM (‘M’, ‘F’),

EASY EXPLANATION: None.

23.

Which data type character merges the “Check Constraint” into a data type definition?(a) ENUM(b) ENUM1(c) ENUM2(d) None of the mentionedThe question was asked during an interview for a job.This intriguing question comes from Table Creation topic in chapter Using SQL to Manage Data of MySQL

Answer»

The CORRECT OPTION is (a) ENUM

Easiest EXPLANATION: NONE.

24.

Which among the following is the correct syntax for defining “Constraint Check” in Mysql?(a) genderchar(1)check( gender IN (‘M’, ‘F’)),(b) gender char (1) check,(c) gender char (1) check ( gender ),(d) none of the mentionedThe question was posed to me in class test.Asked question is from Table Creation topic in section Using SQL to Manage Data of MySQL

Answer»

Correct choice is (a) genderchar(1)check( gender IN (‘M’, ‘F’)),

EXPLANATION: Check CONSTRAINT CONSTRAINS the allowable values for a particular column.

25.

Which command is used for the table definition in Mysql?(a) DESCtable_name;(b) DESC table_name(c) DESC(d) None of the mentionedI have been asked this question in final exam.My question is based upon Table Creation topic in division Using SQL to Manage Data of MySQL

Answer»

The CORRECT CHOICE is (a) DESCtable_name;

EXPLANATION: NONE.

26.

What is the role of “CONSTRAINS” in defining a table in Mysql?(a) Declaring primary key(b) Declaring Foreign Key(c) Restrictions on columns(d) All of the mentionedThe question was asked at a job interview.The question is from Table Creation topic in portion Using SQL to Manage Data of MySQL

Answer» RIGHT OPTION is (d) All of the mentioned

Easiest EXPLANATION: NONE.
27.

Which among the following is the correct syntax for creating table?(a) CREATE TABLE name;(b) CREATE name;(c) CREATE TABLE(d) All of the mentionedThe question was asked in an internship interview.My doubt stems from Table Creation topic in chapter Using SQL to Manage Data of MySQL

Answer» RIGHT choice is (a) CREATE TABLE NAME;

The explanation is: None.
28.

Which command is used for showing current date and time in Mysql command line tool?(a) select now()(b) SELECT now();(c) SELECT now()(d) None of the mentionedThis question was addressed to me during a job interview.My doubt is from Using MySQL Command Line Tool in section Using SQL to Manage Data of MySQL

Answer» CORRECT CHOICE is (B) SELECT now();

To explain: None.
29.

Mysql command line tool is used to show “how many rows are returned and how long SQL command took to execute”.(a) True(b) False(c) Undetermined(d) DependThis question was addressed to me in semester exam.I need to ask this question from Using MySQL Command Line Tool in portion Using SQL to Manage Data of MySQL

Answer» RIGHT ANSWER is (C) Undetermined

Explanation: NONE.
30.

Which authentications are required for login into Mysql command line tool?(a) Username(b) Password(c) Only Username(d) Both Username and PasswordI got this question during an online exam.I'd like to ask this question from Using MySQL Command Line Tool in chapter Using SQL to Manage Data of MySQL

Answer» RIGHT CHOICE is (d) Both USERNAME and Password

For EXPLANATION: NONE.
31.

Which command is used for taking “server side help” in Mysql command line tool?(a) /h(b) /c(c) /e(d) None of the mentionedI got this question in quiz.This interesting question is from Using MySQL Command Line Tool topic in section Using SQL to Manage Data of MySQL

Answer» RIGHT OPTION is (a) /h

The best EXPLANATION: /h represents HELP CONTENTS for Mysql.
32.

Which command is used in Mysql command line tool to return to window command shell?(a) exit;(b) quit;(c) both exit; and quit;(d) only exit;This question was addressed to me during an online exam.This is a very interesting question from Using MySQL Command Line Tool in chapter Using SQL to Manage Data of MySQL

Answer»

The CORRECT CHOICE is (C) both EXIT; and QUIT;

Explanation: None.

33.

Which command is used on Mysql command line tool to return to window command shell?(a) exit(b) exit;(c) exit()(d) exit();I have been asked this question by my college professor while I was bunking the class.This intriguing question comes from Using MySQL Command Line Tool topic in division Using SQL to Manage Data of MySQL

Answer» CORRECT CHOICE is (a) exit

To ELABORATE: NONE.
34.

The “Mysql command line tool” formats are bounded by ______________(a) +-|(b) +-*(c) +-/(d) +-}The question was asked during an internship interview.The above asked question is from Using MySQL Command Line Tool topic in chapter Using SQL to Manage Data of MySQL

Answer» RIGHT ANSWER is (a) +-|

To ELABORATE: NONE.
35.

The “Mysql command line tool” formatthe results in which of the following format?(a) Rectangle(b) Square(c) Sphere(d) None of the mentionedI have been asked this question by my college professor while I was bunking the class.This interesting question is from Using MySQL Command Line Tool in division Using SQL to Manage Data of MySQL

Answer» CORRECT ANSWER is (a) Rectangle

Easy EXPLANATION: NONE.
36.

Which statement is used to access an existing Database?(a) Use(b) use database.name(c) USE databasename;(d) None of the mentionedThis question was posed to me by my school teacher while I was bunking the class.This intriguing question comes from Using MySQL Command Line Tool in division Using SQL to Manage Data of MySQL

Answer» RIGHT OPTION is (C) USE DATABASENAME;

Easy explanation: None.
37.

Which parameter determines the shortest words to index in FULLTEXT indexes?(a) ft_min_word_len(b) ft_min_len_word(c) ft_word_min_len(d) ft_word_len_wordI had been asked this question during an interview.My question is taken from Using Full Text Searches in chapter Using SQL to Manage Data of MySQL

Answer» RIGHT option is (a) ft_min_word_len

Easy explanation: There are MANY full-text PARAMETERS that are configurable. They can be modified by setting the system variables accordingly. The ‘ft_min_word_len’ parameter DETERMINES the shortest words to INDEX in FULLTEXT indexes.
38.

In Boolean search, results are sorted by relevance.(a) True(b) FalseThis question was addressed to me in final exam.The doubt is from Using Full Text Searches in division Using SQL to Manage Data of MySQL

Answer»

The correct choice is (b) False

For explanation: Boolean mode FULLTEXT search is one of the three modes of FULLTEXT searches in MySQL. Boolean searches deal with the presence or ABSENCE of a WORD in a particular ROW to carry out the searches.

39.

Which keyword is used to search through natural language fulltext?(a) MATCH(b) AGAINST(c) SEARCH(d) FINDThis question was posed to me during an interview.The doubt is from Using Full Text Searches topic in chapter Using SQL to Manage Data of MySQL

Answer»

Right CHOICE is (a) MATCH

The explanation: In MYSQL, fulltext searches are carried in THREE modes. Natural language fulltext search is carried out USING the MATCH and AGAINST clause. MATCH keyword specifies the column to be searched.

40.

A FULLTEXT index cannot be created for multiple columns.(a) True(b) FalseThis question was addressed to me in semester exam.My enquiry is from Using Full Text Searches in portion Using SQL to Manage Data of MySQL

Answer» RIGHT answer is (B) False

The explanation is: In MySQL, a full-text search is based on the FULLTEXT indexes. A FULLTEXT index can be created both for a single COLUMN and for multiple columns. Searching is possible across columns.
41.

FULLTEXT indexes can be created only for ____________(a) MyISAM(b) InnoDB(c) MEMORY(d) TRANSITIONThis question was addressed to me in my homework.This intriguing question comes from Using Full Text Searches topic in section Using SQL to Manage Data of MySQL

Answer» RIGHT OPTION is (a) MyISAM

For EXPLANATION I would say: Full-text searches are based on the FULLTEXT indexes. They can be CREATED for MyISAM tables only. In MySQL, a full text search enables to look for words or phrases without USING pattern-matching operations.
42.

Which search mode uses natural language search as a subroutine?(a) Natural language(b) Boolean mode(c) Query expansion(d) Cross modeI have been asked this question in my homework.I'm obligated to ask this question of Using Full Text Searches in section Using SQL to Manage Data of MySQL

Answer»

The CORRECT choice is (C) Query expansion

The explanation is: The query expansion search occurs in two phases. The NATURAL language search is APPLIED in the first phase. Query expansion search is one of the three modes of fulltext SEARCHING.

43.

The indicator of presence or absence of a word in search is used in which mode?(a) Natural language(b) Boolean mode(c) Query expansion(d) Cross modeI have been asked this question during an internship interview.This question is from Using Full Text Searches topic in chapter Using SQL to Manage Data of MySQL

Answer»

The correct choice is (b) Boolean mode

For EXPLANATION: A FULL TEXT search capability is PROVIDED in MySQL. It facilitates to look for words or phrases without using pattern-matching operations. Boolean search is one of the three MODES.

44.

In which mode of search is the search string parsed into words and the search looks for rows?(a) Natural language(b) Boolean mode(c) Query expansion(d) Cross modeI have been asked this question during an interview.The above asked question is from Using Full Text Searches topic in portion Using SQL to Manage Data of MySQL

Answer»

The correct choice is (a) Natural language

Explanation: In MYSQL, a full TEXT SEARCH capability is provided, which enables to look for words or PHRASES without using pattern-matching OPERATIONS. There are three kinds of full text searches.

45.

Which clause in the SQL standard controls how NULL values in a composite foreign key are handled when comparing to a primary key.(a) SET(b) MATCH(c) ON DELETE(d) ON CASCADEThe question was asked during an interview.This key question is from Foreign Keys and Referential Integrity in portion Using SQL to Manage Data of MySQL

Answer»

Correct answer is (b) MATCH

The explanation: The MATCH clause in the SQL standard controls how NULL values in a composite (multiple-column) foreign KEY are handled when comparing to a primary key. MySQL essentially implements the semantics DEFINED by MATCH SIMPLE.

46.

Which keyword is used to specify the foreign key after the table is created?(a) SETUP(b) SET(c) ALTER TABLE(d) SPECIFYI have been asked this question in an interview for internship.My question is taken from Foreign Keys and Referential Integrity in portion Using SQL to Manage Data of MySQL

Answer»

The correct ANSWER is (c) ALTER TABLE

Easiest explanation: When the table has ALREADY been created but the foreign KEY has not been set of foreign key CONSTRAINTS are not specified, the ‘ALTER TABLE – ADD FOREIGN KEY’ clause is USED.

47.

Which clause is used to remove a foreign key constraint?(a) REMOVE(b) DELETE(c) DROP(d) EXCLUDEThis question was posed to me at a job interview.This question is from Foreign Keys and Referential Integrity in portion Using SQL to Manage Data of MySQL

Answer» CORRECT answer is (c) DROP

Best EXPLANATION: In MYSQL foreign KEY definition syntax, there are various components. A foreign key links one table to another table in the table. To remove a foreign key constraint, the ‘DROP’ CLAUSE is used.
48.

If the storage engine InnoDB is not used, foreign key cannot be used.(a) True(b) FalseI have been asked this question in unit test.This interesting question is from Foreign Keys and Referential Integrity in portion Using SQL to Manage Data of MySQL

Answer»

Correct ANSWER is (a) True

To explain I WOULD say: The foreign key support is exclusively provided by the storage engine NAMED InnoDB. WITHOUT its inclusion, foreign keys cannot be USED. However it is possible to implement with application logic.

49.

Which clause names the parent table and the index columns in the table?(a) REFERENCES(b) ON DELETE(c) CONSTRAINT(d) FOREIGN KEYThe question was posed to me in homework.I'm obligated to ask this question of Foreign Keys and Referential Integrity topic in portion Using SQL to Manage Data of MySQL

Answer» RIGHT option is (a) REFERENCES

The EXPLANATION: In MySQL foreign key DEFINITION syntax, there are various components, namely, FOREIGN KEY, CONSTRAINT, REFERENCES and ON DELETE. The REFERENCES clause names the PARENT table and the INDEX columns in the table.
50.

The property of InnoDB that enforces foreign key relationships stay intact is called _____________(a) atomicity(b) durability(c) consistency(d) referential integrityI got this question in a job interview.This is a very interesting question from Foreign Keys and Referential Integrity topic in section Using SQL to Manage Data of MySQL

Answer»

Right answer is (d) referential integrity

Easy explanation: The storage engine RESPONSIBLE for providing FOREIGN key support is InnoDB. It ENFORCES that the RULES guarantee the foreign key relationship stays intact with no mismatching of data.