AI Features

Create the orders Table

Learn to create another table with appropriate attributes and constraints.

We'll cover the following...

Introduction

We’ll continue the creation of our simple customer relationship management system. We already created the customers and products tables, and we’re now ready to create two more tables, orders and order_items.

Model details

The orders table holds the header of the order:

  • It has a reference to the owning customer by the customer_id column. This is going to be a foreign key. Given one order, we can locate the single customer that the order belongs to. That ...