1if exists(select 1 from INFORMATION_SCHEMA.TABLES T
2 where T.TABLE_NAME = 'Bookings')
3begin
4 drop table Bookings
5end
6GO
7
8create table Bookings(
9 FlightID int identity(1, 1) primary key,
10 TicketsMax int not null,
11 TicketsBooked int not null
12)
13GO
14
15insert Bookings(TicketsMax, TicketsBooked) select 1, 0
16insert Bookings(TicketsMax, TicketsBooked) select 2, 2
17insert Bookings(TicketsMax, TicketsBooked) select 3, 1
18GO
19
20select * from Bookings