Курсовая работа: База даних клієнтів і замовлень
[zip_postcode] CHAR (20),
[state_province_county] VARCHAR (50),
[iso_country_code] VARCHAR (50),
[other_address_details] VARCHAR (255),
CONSTRAINT [PK_Addresses] PRIMARY KEY ([address_id]))
Створення таблиці Customer_Addresses
CREATE TABLE [Customer_Addresses] (
[customer_id] INTEGER NOT NULL,
[address_id] INTEGER NOT NULL,
[date_from] DATETIME NOT NULL,
[address_type_code] CHAR (15) NOT NULL,
[date_to] DATETIME,
CONSTRAINT [PK_Customer_Addresses] PRIMARY KEY ([customer_id], [address_id], [date_from]))
Створення таблиці Ref_Address_Types
CREATE TABLE [Ref_Address_Types] (
[address_type_code] CHAR (15) NOT NULL,
[address_type_description] VARCHAR (80),
CONSTRAINT [PK_Ref_Address_Types] PRIMARY KEY ([address_type_code])
Створення таблиці Customer_Orders_Products
CREATE TABLE [Customer_Orders_Products] (
[order_id] INTEGER NOT NULL,
[product_id] INTEGER NOT NULL,
[quantity] VARCHAR (40),
[comments] VARCHAR (40),
CONSTRAINT [PK_Customer_Orders_Products] PRIMARY KEY ([order_id], [product_id]))
Створення таблиці Customers_Payment_Methods
CREATE TABLE [Customers_Payment_Methods] (
[customer_payment_method_id] INTEGER IDENTITY (1,1) NOT NULL,
[customer_id] INTEGER NOT NULL,