MySQL Questions and Answers – Case Sensitivity in SQL Statements

This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses 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
View Answer

Answer: b
Explanation: 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?

SELECT * FROM table_1;

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

Answer: b
Explanation: 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’.
advertisement
advertisement

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
View Answer

Answer: c
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.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

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

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
View Answer

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

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

Answer: a
Explanation: 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
View Answer

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

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

Answer: b
Explanation: 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
View Answer

Answer: a
Explanation: 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
View Answer

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

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.