This article contains the SQL
CREATE DATABASE syntax, as implemented by various database management systems (DBMSs). The syntax is listed exactly as each vendor has listed it on their website. Click on the applicable link to view more detail about the syntax for a particular vendor.
The DBMSs covered are MySQL, SQL Server, PostgreSQL, and Oracle Database.
This article is part 1 of the database tutorial.
Here, we cover the following:
- What is a database?
- What is a Database Management System (DBMS)?
- Types of databases
- What does a relational database look like?
- Creating a database
- Creating tables
- Data types
This database tutorial is for beginners. It explains basic concepts and assumes no prior knowledge of databases.
You don’t need to follow along – there aren’t any exercises. But there are plenty of screenshots and a few diagrams. The purpose of the tutorial is to introduce you to the basic concepts of databases.
This article is Part 1 of the Microsoft Access tutorial.
Here’s what’s included in this article:
- Create a database.
- Add a table to the database.
- Add four fields to the table, name/rename them, and set up their data type.
To create a database from a script in MySQL:
- Open a Query tab in MySQL Workbench
- Run a
CREATE DATABASE or
CREATE SCHEMA statement to create the database (example below)
This will create a new database.
Example of an SQL script that creates a database with tables, columns etc. In this case, the script has just run and has created the “Music” database. You can see the tables and their columns open in the left navigation pane.
To create a database in the MySQL Workbench GUI:
- Click the “new schema” button on the MySQL Workbench toolbar
- Enter a schema name (database name) and its default collation and click Apply
- Review the SQL statement and click Apply
The database will now be created, and a message will display advising that the script was successful.
To create a database in SQL Server using the GUI:
- From the Object Explorer, right click on Databases and select New database...
- Name the database, adjust settings if required, then click OK
Once you’ve created the database, you can create tables and other database objects. You can also modify any database properties as required.
In Microsoft Access 2013 & 2016, you can create a database straight from the Welcome screen or from the work area. You can create either a blank database, or a database from a template.
Create a Blank Database
From the Welcome Screen
When you first open Access, the Welcome screen is displayed. You can create your database straight from here.
- Click Blank desktop database
- Name the database at the prompt and click Create
Your new database will have one table called “Table1”. You can modify this table to your needs. You can also create new tables and other database objects.