0% found this document useful (0 votes)
258 views3 pages

SSD9 Exercise 2

The document describes the tables needed for an online store database including products, shipments, clients, orders, and order items. It provides the table descriptions and attributes for each table. It also includes the SQL script to create the tables in an Oracle database and shows the entity relationship diagram connecting the tables.

Uploaded by

Aza Tolegenov
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
258 views3 pages

SSD9 Exercise 2

The document describes the tables needed for an online store database including products, shipments, clients, orders, and order items. It provides the table descriptions and attributes for each table. It also includes the SQL script to create the tables in an Oracle database and shows the entity relationship diagram connecting the tables.

Uploaded by

Aza Tolegenov
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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