Create Database


  1. Which statement is used to see the definition for an existing database?











  1. 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.


  1. MySQL stores the database character set and collation attributes in the file _________.











  1. 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.



  1. If COLLATE is given without CHARACTER SET, the first part of the collation name gives the character set.











  1. 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.


  1. To create a database only if it doesn’t already exist, which clause is used?











  1. 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’.



  1. The file created by the server to store the database attributes is __________.











  1. 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.