-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2 Order.sql
More file actions
38 lines (24 loc) · 778 Bytes
/
2 Order.sql
File metadata and controls
38 lines (24 loc) · 778 Bytes
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
//CREATE STATEMENT//
create table Salesman
(Salesman_id int(10) primary key,
Name varchar(20),
City varchar(20),
Commission float(10));
create table Customer(
Customer_id int(10) primary key,
Cust_name varchar(20),
City varchar(20),
Grade int(9),
Salesman_id int(10),
foreign key(Salesman_id) references Salesman(salesman_id));
create table Product(Ord_no int(10) primary key,
Purchase_amt float(10),
Ord_date date,
Customer_id int(10),
Salesman_id int(10),
foreign key(Salesman_id) references Salesman(salesman_id),
foreign key(Customer_id) references Customer(Customer_id));
//INSERT STATEMENT//
insert into Salesman values(1,'A','Banglore',1000.23);
insert into Customer values(11,'X','Banglore',5,1);
insert into Product values(911,5000.02,'2022-12-03',11,1);