Курсовая работа: База даних клієнтів і замовлень
[other_customer_details] VARCHAR (255),
CONSTRAINT [PK_Customers] PRIMARY KEY ([customer_id]))
Створення таблиці Customer_Orders
CREATE TABLE [Customer_Orders] (
[order_id] INTEGER IDENTITY (1,1) NOT NULL,
[customer_id] INTEGER NOT NULL,
[customer_payment_method_id] INTEGER NOT NULL,
[order_status_code] CHAR (15) NOT NULL,
[date_order_placed] DATETIME NOT NULL,
[date_order_paid] DATETIME,
[der_total_order_price] SMALLMONEY,
[other_order_details] VARCHAR (255),
CONSTRAINT [PK_Customer_Orders] PRIMARY KEY ([order_id]))
Створення таблиці Ref_Payment_Methods
CREATE TABLE [Ref_Payment_Methods] (
[payment_method_code] CHAR (15) NOT NULL,
[payment_method_description] VARCHAR (80),
CONSTRAINT [PK_Ref_Payment_Methods] PRIMARY KEY ([payment_method_code]))
Створення таблиці Ref_Order_Status_Codes
CREATE TABLE [Ref_Order_Status_Codes] (
[order_status_code] CHAR (15) NOT NULL,
[order_status_description] VARCHAR (80),
CONSTRAINT [PK_Ref_Order_Status_Codes] PRIMARY KEY ([order_status_code]))
Створення таблиці Addresses
CREATE TABLE [Addresses] (
[address_id] INTEGER IDENTITY (1,1) NOT NULL,
[line_1] VARCHAR (80),
[line_2] VARCHAR (80),
[line_3] VARCHAR (80),