250+ TOP MCQs on Case Sensitivity in SQL Statements and Answers

MySQL Database Multiple Choice Questions on “Case Sensitivity in SQL Statements”.

1. Case sensitivity in SQL statements does not vary for different operating systems of the machine on which the server is running.
a) True
b) False

Answer: b
Clarification: The case sensitivity rules in SQL statements are different for different statement elements, depend on what is being referred to and also on the machine’s operating system on which the server is running.

2. What is true about the following SQL statement?

a) invalid
b) display contents of table_1
c) improper case being used
d) display only column names in table_1

Answer: b
Clarification: The keywords and function names are not case sensitive in SQL. They can be named in any letter case. So, the above statement is correct and legal. It retrieves information from the table ‘table_1’.

3. The default case sensitivity of database and table names depends on ___________
a) SQL server
b) Server SQL mode
c) Operating system of machine
d) Does not depend on anything

Answer: c
Clarification: 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.

4. Which of the following is case sensitive?
a) Stored function name
b) Stored procedure name
c) Trigger name
d) Event name

Answer: c
Clarification: The stored functions and stored procedure names in MySQL are not case sensitive. Event names are also not case sensitive. Unlike the standard SQL, the trigger names in MySQL is case sensitive.

  250+ TOP MCQs on Expression Evaluation and Type Conversion

5. Which variable is used to set table alias names as non-case sensitive?
a) lower_case_table_names
b) lower_case_all
c) lower_case_alias
d) lower_case_aliases

Answer: a
Clarification: In MySQL, by default the alias names are case sensitive. An alias can hence be specified in any letter case, upper, lower or mixed. If the variable ‘lower_case_table_names’ is non zero, the alias names of tables are not case sensitive.

6. Which case does InnoDB store database names in?
a) lower
b) upper
c) mixed
d) random

Answer: a
Clarification: In InnoDB, all the database names as well as all the table names are stored in lowercase internally. There is no random case assignment to the database elements when the engine is set as InnoDB.

7. Regardless of whether a database or table name is case sensitive on the system, it must be referred to using the same lettercase throughout a given query.
a) True
b) False

Answer: a
Clarification: A database or table name must be referred to using the same lettercase throughout a given query. This is regardless of the fact whether it is case sensitive on the system or not.

8. Which of the following is case sensitive in MySQL?
a) Event names
b) Logfile group names
c) Column names
d) Indexes

Answer: b
Clarification: Column names and indexes are not case sensitive on any platform and neither are column aliases. Unlike the standard SQL, the names of the log file groups are always case sensitive.

9. Which property determines whether a database object is a case sensitive?
a) COLLATION
b) ATOMICITY
c) COLLABORATION
d) NORMALIZATION

  250+ TOP MCQs on Stored Functions and Procedures and Answers

Answer: a
Clarification: The way to determine whether a database object or a database is case sensitive or not is to check the ‘COLLATION’ property. The result would be either CI for insensitive or CS for sensitive.

10. What is AI in terms of database collation?
a) Accent Insensitive
b) Augment Insensitive
c) Articulate Insensitive
d) Addition Insensitive

Answer: a
Clarification: 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.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top