The database is a collection of tables and it has a unique name.
Syntax:-
CREATE DATABASE databaseName
Example:-
If you want to create database employee_management then use below command
CREATE DATABASES employee_management
Now, you can check the created database through below command
SHOW DATABASES
Output:-
employee_management
schools_management
SQL Create Database – Interview Questions
Q 1: What is the CREATE DATABASE statement?
Ans: The CREATE DATABASE statement is used to create a new database in the database management system.
Q 2: What is the syntax for creating a database?
Ans: CREATE DATABASE database_name;
Q 3: Can we check if a database already exists before creating it?
Ans: Yes, many databases support IF NOT EXISTS to avoid errors.
Q 4: What privileges are required to create a database?
Ans: The user must have database creation privileges granted by the administrator.
Q 5: Can we specify character set while creating a database?
Ans: Yes, databases like MySQL allow specifying character set and collation during creation.
SQL Create Database – Objective Questions (MCQs)
Q1. Which command is used to create a database in SQL?
Q2. What is the correct syntax to create a database named school?
Q3. Which privilege is required to create a database?
Q4. The CREATE DATABASE command belongs to which SQL category?
Q5. What happens if you try to create a database that already exists?