Database Chapter 4

Create the database.

CREATE DATABASE TwoTrees;

Create the schema.

CREATE SCHEMA products;

Create the products table.

CREATE TABLE products.products (
    SKU CHAR(7) NOT NULL,
    ProductName CHAR(50) NOT NULL,
    CategoryID INT,
    Size INT,
    Price DECIMAL(5,2) NOT NULL);

Create the categories table.

CREATE TABLE products.categories (
    CategoryID INT PRIMARY KEY,
    CategoryDescription CHAR(50),
    ProductLine CHAR(25)
);

Leave a Reply

Your email address will not be published. Required fields are marked *