1.

To create a database only if it doesn’t already exist, which clause is used?(a) IF EXISTS(b) IF NOT EXISTS(c) CREATE EXISTS(d) EXISTS IFThe question was asked during an interview for a job.Question is from Selecting, Creating, Dropping and Altering Databases in division Using SQL to Manage Data of MySQL

Answer»

The CORRECT choice is (b) IF NOT EXISTS

Best explanation: The ‘CREATE DATABASESTATEMENT 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’.



Discussion

No Comment Found

Related InterviewSolutions