CREATE TABLE Opportunity(opp_id INT PRIMARY KEY NOT NULL IDENTITY(0,1),first_name VARCHAR(20),last_name VARCHAR(20),
mobile INT,email VARCHAR(30))
CREATE TABLE Product(p_id INT PRIMARY KEY NOT NULL IDENTITY(0,1),p_Name VARCHAR(30),p_Desc VARCHAR(150))
CREATE TABLE Package(pkg_id INT PRIMARY KEY NOT NULL IDENTITY(0,1),pkg_Name VARCHAR(30),pkg_Code VARCHAR(20))
CREATE TABLE Package_Line_Item
(pkg_line_item_id INT PRIMARY KEY NOT NULL IDENTITY(0,1),
pkg_id_r int REFERENCES Package(pkg_id) NOT NULL,
pli_days VARCHAR(20),outbond_dep_airport VARCHAR(40),outbond_Arrival_airport VARCHAR(40),inbond_dep_airport VARCHAR(40),
inbond_Arrival_airport VARCHAR(40)
)
CREATE TABLE Booking(b_id INT PRIMARY KEY NOT NULL IDENTITY(0,1),opp_id_r INT REFERENCES Opportunity(opp_id) NOT NULL,
p_id_r INT REFERENCES Product(p_id) NOT NULL,pkg_id INT REFERENCES Package(pkg_id) NOT NULL,total_booking_cost int,total_booking_price int,
booking_margin INT,booking_marging_percent INT,booking_confirmed BIT
)
CREATE TABLE Agent(a_id INT PRIMARY KEY NOT NULL IDENTITY(0,1),a_name VARCHAR(30),a_code VARCHAR(20),branch_code VARCHAR(20),region_code VARCHAR(20))
CREATE TABLE TUI_Service(s_id INT PRIMARY KEY NOT NULL IDENTITY(0,1),s_name VARCHAR(20),s_type VARCHAR(20),s_Code VARCHAR(20),
b_id_r INT REFERENCES Booking(b_id) NOT NULL,pkg_id_r INT REFERENCES Package(pkg_id) NOT NULL,
pkg_line_item_id_r INT REFERENCES Package_Line_Item(pkg_line_item_id) NOT NULL
)
No comments:
Post a Comment