-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQLQuery5.sql
29 lines (23 loc) · 870 Bytes
/
SQLQuery5.sql
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
create table [dbo].[Booking] (
[booking_id] int IDENTITY(1,1) NOT NULL,
[date] nvarchar(max) NOT NULL,
[time] nvarchar(max) NOT NULL,
[pickup_location] nvarchar(max) NOT NULL,
[dropoff_location] nvarchar(max) NOT NULL,
[isAccepted] nvarchar(max) NOT NULL,
primary key(booking_id),
);
create table [dbo].[CustomerBooking](
[customer_booking_id] int IDENTITY(1,1) NOT NULL,
[userId] nvarchar(128) NOT NULL,
[booking_id] int NOT NULL,
[vehicle_id] int NOT NULL,
primary key(customer_booking_id),
FOREIGN KEY (userId) REFERENCES AspNetUsers(Id),
FOREIGN KEY ([booking_id]) REFERENCES Booking(booking_id),
FOREIGN KEY (vehicle_id) REFERENCES Vehicle(Id)
);
alter table [dbo].[CustomerBooking] add isAccepted nvarchar(max) NOT NULL;
alter table vehicle add vehicle_description nvarchar(max) NULL;
select * from vehicle;
delete from vehicle where id =6;