-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTABLES.txt
124 lines (102 loc) · 6.85 KB
/
TABLES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
CREATE TABLE products (
ProductID int NOT NULL,
ProductName varchar(45) DEFAULT NULL,
Price double DEFAULT NULL,
Quantity int DEFAULT NULL,
Category varchar(45) DEFAULT NULL,
Supplier varchar(45) DEFAULT NULL,
EID int DEFAULT NULL,
PRIMARY KEY ( ProductID )
)
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (1,'Milk',7,10,'Dairy','Almarai',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (2,'Yogurt',2.5,20,'Dairy','Almarai',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (3,'Cheese Slices',3.75,10,'Dairy','Almarai',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (4,'Eggs',12,20,'Dairy','Rahima',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (5,'Tea',14,30,'Beverages','Lipton',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (6,'Orange Juice',3.5,50,'Beverages','Almarai',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (7,'Apple Juice',3.5,50,'Beverages','Almarai',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (8,'Water Bottle',1,100,'Beverages','Nova',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (9,'White Bread',6,30,'Bakery','Billing Supermarket',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (10,'Hamburger Buns',6,30,'Bakery','Billing Supermarket',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (11,'Cereal',21,20,'Grain','Kelloggs',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (12,'Rice 10Kg',67,40,'Grain','Alaila',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (13,'Pasta',3.35,30,'Grain','Goody',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (14,'Vanilla Ice Cream',4.75,10,'Dairy','Baskin Robbins',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (15,'Chocolate Ice Cream',4.75,10,'Dairy','Baskin Robbins',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (16,'Beef',21,20,'Meat & Seafood','Americana',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (17,'Fish Fillet',41,10,'Meat & Seafood','Billing Supermarket',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (18,'Dishwashing Liquid',9.5,30,'Cleaners','Fairy',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (19,'Laundry Detergent',27,30,'Cleaners','Tide',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (20,'Bananas',4.95,50,'Produced','Billing Supermarket',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (21,'Apple Packaged',11.95,40,'Produced','Billing Supermarket',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (22,'Tomatoes Packaged',25.95,40,'Produced','Billing Supermarket',221004);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (23,'AA Battery',37.5,10,'Electrical','Duracell',221003);
INSERT INTO products ( ProductID , ProductName , Price , Quantity , Category , Supplier , EID ) VALUES (24,'LED light pulp',17.95,10,'Electrical','Philips',221003);
CREATE TABLE customerTable(
CustomerID INT NOT NULL,
FName VARCHAR(20) NOT NULL,
Lname VARCHAR(20) NOT NULL,
PhoneNum INT,
Membership VARCHAR(10)
PRIMARY KEY (CustomerID)
);
INSERT INTO customerTable (CustomerID, FName, Lname, PhoneNum )
VALUES (1,'Yasser','Alali' ,0572964266, 'None');
INSERT INTO customerTable (CustomerID, FName, Lname, PhoneNum )
VALUES (2,'Amal','Alhashim',0505871220, 'Gold');
INSERT INTO customerTable (CustomerID, FName, Lname, PhoneNum )
VALUES (3,'Maha','Alaqeel',0506799357, 'Silver');
INSERT INTO customerTable (CustomerID, FName, Lname, PhoneNum )
VALUES (4,'Ahmed','Alkhaldi',0596468112, 'Silver');
INSERT INTO customerTable (CustomerID, FName, Lname, PhoneNum )
VALUES (5,'Dana','Aziz',0505884543, 'None');
INSERT INTO customerTable (CustomerID, FName, Lname, PhoneNum )
VALUES (6,'Yosif','Albassam',0558832143, 'Bronze');
INSERT INTO customerTable (CustomerID, FName, Lname, PhoneNum )
VALUES (7,'Sara','Alshareef',0530087253, 'Bronze');
CREATE TABLE Employee(
SELLID INT NOT NULL,
SELLNAME VARCHAR(20) NOT NULL,
SELLPASS VARCHAR(20) NOT NULL,
SELLGENDER VARCHAR(20) NOT NULL,
SELLSALARY INT NOT NULL,
SELLMANAGER VARCHAR(20),
SELLJOB VARCHAR(20) NOT NULL,
PRIMARY KEY (SELLID)
);
INSERT INTO Employee (SELLID, SELLNAME, SELLPASS, SELLGENDER, SELLSALARY, SELLMANAGER, SELLJOB)
VALUES (221006, 'Mohammed','Mohammed221','Male',2000,'221005','Cashier');
INSERT INTO Employee (SELLID, SELLNAME, SELLPASS, SELLGENDER, SELLSALARY, SELLMANAGER, SELLJOB)
VALUES (221002, 'Ahmed','Ahm@@ed','Male',2500,'221005','Cashier');
INSERT INTO Employee (SELLID, SELLNAME, SELLPASS, SELLGENDER, SELLSALARY, SELLMANAGER, SELLJOB)
VALUES (221003, 'Sara','S@ra132','Female',1000,'221006','Stock Clerk');
INSERT INTO Employee (SELLID, SELLNAME, SELLPASS, SELLGENDER, SELLSALARY, SELLMANAGER, SELLJOB)
VALUES (221004, 'Layla','Layla#2','Female',1500,'221006','Stock Clerk');
INSERT INTO Employee (SELLID, SELLNAME, SELLPASS, SELLGENDER, SELLSALARY, SELLJOB)
VALUES (221005, 'Nor','Nor#2','Female',3000,'Manager');
INSERT INTO Employee (SELLID, SELLNAME, SELLPASS, SELLGENDER, SELLSALARY, SELLJOB)
VALUES (221001, 'Nora','Nora#&2','Female',3500,'Manager');
create table Bill (
Bill_id int not null primary key,
Custormer_id int not null,
Bill_date date,
total double,
foreign key (Custormer_id) references customer (CustormerID)
);
insert into Bill values
(1,1,'2021-02-03',50);
insert into Bill values
(2,2,'2021-02-04',60);
insert into Bill values
(3,3,'2021-02-06',20);
insert into Bill values
(4,4,'2021-02-11',40);
insert into Bill values
(5,5,'2021-03-01',4);
insert into Bill values
(6,6,'2021-03-02',30.5);
insert into Bill values
(7,7,'2021-03-03',4,4);
insert into Bill values
(8,2,'2021-03-18',33);