Skip
Arish's avatar

263. Practice - FOREIGN KEY 1


Exercise: Create FK

Create orders referencing customers.

Solution

sql
1CREATE TABLE orders (
2  id INTEGER PRIMARY KEY,
3  customer_id INTEGER NOT NULL,
4  FOREIGN KEY (customer_id) REFERENCES customers(id)
5);