Beginner

11. CREATE DATABASE

Learn how to create a new database using the CREATE DATABASE statement.

📘 Lesson 11 of 728 ⏱ 5 min 🎯 Beginner

CREATE DATABASE is a Data Definition Language (DDL) command used to create a new database on a database server. A database acts as a container that stores tables, views, procedures, functions, and other database objects.

Every SQL project begins with a database. Before storing customer information, employee records, sales transactions, or inventory data, a database must first be created.

A company is developing a new HR Management System. The first step is to create a database named HRManagement where all employee-related tables will be stored.

SQL
CREATE DATABASE HRManagement;

Software companies, banks, hospitals, schools, and e-commerce businesses create separate databases for different applications to organize and secure their data.

  • Creates a new database.
  • It is a DDL command.
  • Requires appropriate database permissions.
  • A database can contain multiple tables.
  • Database names should be meaningful.
  • Usually executed only once.
  • The database must exist before creating tables.
Which SQL statement is used to create a database?

The CREATE DATABASE statement is used to create a new database.

Can a database exist without tables?

Yes. A newly created database can exist without containing any tables.

Have you finished this lesson?

Introduction to SQL – All Lessons