Assignment No_4
Data Base Management System
Total Marks = 20
Solution:
CREATE TABLE Customer (
CID char (20) primary key,
CName varchar (50),
Address varchar (100),
Phone char (10)
)
****************************************************************************
CREATE TABLE _Order (
Order_ID char (10) primary key,
_Description varchar (100),
CID char (20) references Customer (CID)
)
****************************************************************************
CREATE TABLE Product (
PID char (10) primary key,
PName varchar (50),
Price real,
Cat_ID char (10) references Category (Cat_ID)
)
****************************************************************************
CREATE TABLE Product_Order (
Order_ID char (10)
PID char (10)
Primary key (Order_ID, PID)
)
CREATE TABLE Invoice (
Inv_ID char (10) primary key,
_Description varchar (100),
Total_Amount real
Order_ID char (10) references _Order (Order_ID)
)
****************************************************************************
CREATE TABLE Category (
Cat_ID char (10) primary key,
CatName varchar (50)
****************************************************************************
CREATE TABLE Vendor (
Ven_ID char (10) primary key,
_Name varchar (50),
Address varchar (100)
)
CREATE TABLE Product_Vendor (
PID char (10),
Ven_ID char (10),
Primary key (PID, Ven_ID)
)
No comments:
Post a Comment