Create Database
- Which statement is used to see the definition for an existing database?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The statement ‘SHOW CREATE DATABASE’ is invoked to see the definition of an existing database in the MySQL server. It is followed by the qualified name of the database.
- MySQL stores the database character set and collation attributes in the file _________.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The file named ‘db.opt’ is of a great significance to MySQL, espectially the MySQL server. It stores the database attributes along with the db charset and collation attributes.
- If COLLATE is given without CHARACTER SET, the first part of the collation name gives the character set.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
When a database is created, the ‘CHARACTER SET’ and ‘COLLATE’ values are specified. When ‘CHARACTER SET’ is given without ‘COLLATE’, the default collation is used.
- To create a database only if it doesn’t already exist, which clause is used?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The ‘CREATE DATABASE’ statement supports many optional values. To create a database named ‘my_db’ only if it doesn’t already exist, we write ‘CREATE DATABASE IF NOT EXISTS my_db’.
- The file created by the server to store the database attributes is __________.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Whenever a database is created in MySQL, the MySQL server creates a directory with the same name as the database. It creates the file db.opt to store the attributes.