SSD9 Exercise 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Exercise 2.

Mukhanov Samat -----------------------------------------------------------------------------Table Descriptions: Product id name retail price shipping weight textual description image Shipment name price Client login password registration Order order number order date client login shipping method total cost Order item id order number product id quantity - primary key (int) - foreign key refers to Order table (text) - foreign key refers to Product table (int) - int - primary key (char) - date - foreign key refers to Client table (char) foreign key refers to Shipment table (char) - double - primary key (char) - char - char primary key (char) - char - primary key (int) - char - char - char - char - char (pointer to the image)

----------------------------------------------------------------------------Script for Creating the tables in Oracle (PL/SQL Developer):


CREATE TABLE products (product_id integer NOT NULL, name char, price char, weight char, description clob, image char, PRIMARY KEY (product_id) ); CREATE TABLE shipments (shipping_name char(6) NOT NULL, price char, PRIMARY KEY (shipping_name) ); CREATE TABLE client (login char(16) NOT NULL, password char(20), registration char(20), PRIMARY KEY (login) ); CREATE TABLE orders (order_number char(16) NOT NULL, order_date date, login char(16) references client(login), shipping_name char(6) references shipments(shipping_name), cost numeric, PRIMARY KEY (order_number) ); CREATE TABLE order_item (item_id integer NOT NULL, order_number char(16) references orders(order_number), product_id integer references products(product_id), quantity integer, PRIMARY KEY (item_id) );

----------------------------------------------------------------------------------ER Diagram:

You might also like