Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

CREATE TABLE πŸ“

Learning Goals

By the end of this section you will:

The CREATE TABLE statement is used to create a new table in a database.

Go to the W3schools Tutorial on the CREATE TABLE Statement and complete their exercises.

We will use DB Broswer to create our databases. Watch the videos below to see how.

Β 

CREATE TABLE orderΒΆ

When creating a relational database containing multiple tables, you need to be findful of order in which they’re created. If a table contains a foreign key, this foreign key needs to be able point to the table of where it is the primary key, ie. the one side of the one-to-many relationship. So the table containing the primary key needs to be create first.

Let’s look at the student subject database from the ERD / RS section:

ERD/RS

We can observe: