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
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
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’.
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
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.
4. Which of the following is case sensitive?
a) Stored function name
b) Stored procedure name
c) Trigger name
d) Event name
View Answer
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
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.
6. Which case does InnoDB store database names in?
a) lower
b) upper
c) mixed
d) random
View Answer
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
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.
8. Which of the following is case sensitive in MySQL?
a) Event names
b) Logfile group names
c) Column names
d) Indexes
View Answer
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
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
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]
- Check MySQL Books
- Apply for Programming Internship
- Check Information Technology Books
- Practice Programming MCQs