0% found this document useful (0 votes)
44 views2 pages

Airline Database

This document outlines the creation of tables for an airline database including flights, aircraft, employees, certified pilots, and flight assignments. Tables are created with the proper fields and primary/foreign keys. Data is then inserted into each table with multiple entries including flight numbers, origins and destinations, times, costs; aircraft IDs and capabilities; employee IDs, names, salaries; pilot certifications; and assigned flights and pilots.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views2 pages

Airline Database

This document outlines the creation of tables for an airline database including flights, aircraft, employees, certified pilots, and flight assignments. Tables are created with the proper fields and primary/foreign keys. Data is then inserted into each table with multiple entries including flight numbers, origins and destinations, times, costs; aircraft IDs and capabilities; employee IDs, names, salaries; pilot certifications; and assigned flights and pilots.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

AIRLINE DATABASE

CREATE ALL THE TABLES

FLIGHTS TABLE

AIRCRAFT TABLE
CREATE TABLE AIRCRAFT (AID INT PRIMARY KEY, ANAME VARCHAR(10),
CRUISINGRANGE INT);

EMPLOYEES TABLE
CREATE TABLE EMPLOYEES (EID INT PRIMARY KEY, ENAME VARCHAR(15),SALARY FLOAT);

CERTIFIED TABLE
CREATE TABLE certified (EID INT PRIMARY KEY, ENAME VARCHAR(15), SALARY FLOAT);

FLYS TABLE
CREATE TABLE FLYS(FNO INT, EID INT, PRIMARY KEY(FNO,EID), FOREIGN KEY (FNO)
REFERENCES FLIGHTS(FNO) ON DELETE CASCADE, FOREIGN KEY(EID) REFERENCES
EMPLOYEES(EID) ON DELETE CASCADE);

INSERT INTO TABLES


INSERT INTO FLIGHTS VALUES
(111,’BENGALURU’,’FRANKFURT’,7000,’21:30’,’07:30’,70000);
INSERT INTO FLIGHTS VALUES
(112,’BENGALURU’,’NEWDELHI’,2000,’06:00’,’08:30’,9000);
INSERT INTO FLIGHTS VALUES
(113,’BENGALURU’,’MUMBAI’,1000,’07:05’,’07:55’,8000);
INSERT INTO FLIGHTS VALUES
(114,’MUMBAI’,’NEWDELHI’,1000,’19:30’,’21:00’,7000);
INSERT INTO FLIGHTS VALUES
(115,’BENGALURU’,’NEWDELHI’,2000,’08:00’,’09:15’,4000);
INSERT INTO FLIGHTS VALUES
(116,’BENGALURU’,’PUNE’,800,’08:00’,’09:25’,5000);
INSERT INTO FLIGHTS VALUES
(117,’BENGALURU’,’FRANKFURT’,7000,’07:30’,’21:30’,70500);
INSERT INTO FLIGHTS VALUES (118,'NEWDELHI','LASVEGAS',5000,'22:00',
'20:00',65000);
INSERT INTO AIRCRAFT VALUES (11,’BOEING’,8000);
INSERT INTO AIRCRAFT VALUES (12,’AIRBUS’,6000);
INSERT INTO AIRCRAFT VALUES (13,’AIRINDIA’,5000);
INSERT INTO AIRCRAFT VALUES (14,’INDIGO’,900);
INSERT INTO AIRCRAFT VALUES (15,’SPICEJET’,800);

INSERT INTO EMPLOYEES VALUES (100,’ARJUN’,200000);


INSERT INTO EMPLOYEES VALUES (200,’NISHA’,150000);
INSERT INTO EMPLOYEES VALUES (300,’KAVYA’,200000);
INSERT INTO EMPLOYEES VALUES (400,’AKHILESH’,80000);
INSERT INTO EMPLOYEES VALUES (500,’PRIYA’,10000);
INSERT INTO EMPLOYEES VALUES (600,’RAJ’,200000);
INSERT INTO EMPLOYEES VALUES(700,'GIRISH',30000);
INSERT INTO EMPLOYEES VALUES(800,'DEEPIKA',50000);
INSERT INTO EMPLOYEES VALUES(900,'MITHUN',90000);

INSERT INTO CERTIFIED VALUES (100, 11);


INSERT INTO CERTIFIED VALUES (100, 12);
INSERT INTO CERTIFIED VALUES (100, 13);
INSERT INTO CERTIFIED VALUES (200, 14);
INSERT INTO CERTIFIED VALUES (200, 15);
INSERT INTO CERTIFIED VALUES (200, 11);
INSERT INTO CERTIFIED VALUES (100, 15);
INSERT INTO CERTIFIED VALUES (400, 12);
INSERT INTO CERTIFIED VALUES (500, 14);
INSERT INTO CERTIFIED VALUES (600, 15);

INSERT INTO FLYS VALUES(111,100);


INSERT INTO FLYS VALUES(111,200);
INSERT INTO FLYS VALUES(111,300);
INSERT INTO FLYS VALUES(112,400);
INSERT INTO FLYS VALUES(113,500);
INSERT INTO FLYS VALUES(113,600);
INSERT INTO FLYS VALUES(114,700);
INSERT INTO FLYS VALUES(114,800);
INSERT INTO FLYS VALUES(115,900);

You might also like