The document provides an overview of the database design for Air India. It includes assumptions, initial and final ER diagrams, tables with functional dependencies, and sample SQL queries to demonstrate basic operations on the database. The database design consists of 10 normalized tables to store information about countries, states, contacts, passengers, flight schedules, routes, airfares, aircrafts and transactions. The document describes the tables, relationships between them and provides examples of queries to retrieve flight details, passenger information and perform analytics on bookings and sales.
The system was created using VB .NET in front end and SQL SERVER 2008 as database in backend . Airline Reservations System contain airline schedules, fare tariffs, passenger reservations and ticket records and customer details etc.
ABOUT AIRLINE RESERVATION SYSTEM
FULL DETAILS ABOOUT CODING AND PROCESS
HOW IT WORKS AND WHAT PROBLEMS COMES WHILE ONLINE RESERVATION OF AIR TICKET.
TECHNICAL DETAILS IS ALSO MENTION IN THIS .
TABLE STRUCTURE ALSO GIVING WHERE WE CAN SEE CODING ALSO IN THAT . FULL DETAILS PROCESS HAS BEEN GIVING IN THIS
Assignment 1 of Database (MySQL & Sqlite3) Aey Unthika
● Map your ER diagram to relations
● Create relations in sqlite
● Insert data ( >4GB? )
● Query ( > 30 sec?)
● Use the same data for your selected DBMS
The system was created using VB .NET in front end and SQL SERVER 2008 as database in backend . Airline Reservations System contain airline schedules, fare tariffs, passenger reservations and ticket records and customer details etc.
ABOUT AIRLINE RESERVATION SYSTEM
FULL DETAILS ABOOUT CODING AND PROCESS
HOW IT WORKS AND WHAT PROBLEMS COMES WHILE ONLINE RESERVATION OF AIR TICKET.
TECHNICAL DETAILS IS ALSO MENTION IN THIS .
TABLE STRUCTURE ALSO GIVING WHERE WE CAN SEE CODING ALSO IN THAT . FULL DETAILS PROCESS HAS BEEN GIVING IN THIS
Assignment 1 of Database (MySQL & Sqlite3) Aey Unthika
● Map your ER diagram to relations
● Create relations in sqlite
● Insert data ( >4GB? )
● Query ( > 30 sec?)
● Use the same data for your selected DBMS
The Presentation is about how airline industry has evolved and how systems in airline industry have evolved. The presentation further provided a roadmap on system evolution for airlines
here is the SQL. PLEASE ONLY START FROM # 6 TO #10 AS I DID #1 TO #5.docxhoward4little59962
here is the SQL. PLEASE ONLY START FROM # 6 TO #10 AS I DID #1 TO #5
# Code to create Airlines_2175 database for DATA 620
# Contains updated data line as follows:
# Updated 5/17/2017 by Carrie Beam (rolled forward to 2017)
Drop Database if exists airlines;
CREATE DATABASE Airlines;
USE Airlines;
# USE Airlines ; # this is the old one also
-- A carrier is a commercial company offering flights to the public
CREATE TABLE Carriers (
Carrier_ID INTEGER PRIMARY KEY AUTO_INCREMENT,
Carrier_Name VARCHAR(20)
);
-- One carrier can fly many types of aircraft
CREATE TABLE Aircraft (
Plane_ID INTEGER PRIMARY KEY AUTO_INCREMENT,
Manufacturer VARCHAR(10),
Model_Num VARCHAR(20),
Original_Purchase_Date DATE,
Last_Service DATE,
Carrier_ID INTEGER,
Number_of_Seats INTEGER,
FOREIGN KEY (Carrier_ID) REFERENCES Carriers(Carrier_ID)
);
-- One airport facilitates many flights
CREATE TABLE Airports (
Airport_Code VARCHAR(3) PRIMARY KEY,
Airport_Location VARCHAR(25),
Year_Opened INTEGER,
Num_of_Terminals INTEGER
);
-- Each flight involves many airports
CREATE TABLE Flights (
Flight_ID INTEGER PRIMARY KEY AUTO_INCREMENT,
Plane_ID INTEGER,
Carrier_ID INTEGER,
Airport_Code_Origin VARCHAR(3),
Airport_Code_Destination VARCHAR(3),
Departure_DateTime DATETIME,
Arrival_DateTime DATETIME,
FOREIGN KEY (Plane_ID) REFERENCES Aircraft(Plane_ID),
/* FOREIGN KEY (Carrier_ID) REFERENCES Carriers(Carrier_ID), */
FOREIGN KEY (Airport_Code_Origin) REFERENCES Airports(Airport_Code),
FOREIGN KEY (Airport_Code_Destination) REFERENCES Airports(Airport_Code)
);
-- Adding records to the carriers table
INSERT INTO Carriers (Carrier_Name)
VALUES ('American'),
('Delta'),
('Southwest'),
('United'),
('Virgin Atlantic');
-- Adding records to the aircraft table
INSERT INTO Aircraft (Manufacturer, Model_Num, Original_Purchase_Date, Last_Service, Carrier_ID)
VALUES
('Boeing','787 Dreamliner','2014-10-10','2015-12-17',3),
('Boeing','737-900','2003-03-23','2016-01-26',3),
('Embraer','RJ-45','1999-11-24','2016-01-31',3),
('Embraer','RJ-45','2002-10-02','2016-01-20',1),
('Boeing','737-900','2000-04-16','2015-12-24',2),
('Boeing','747-400','2001-10-25','2016-01-03',3),
('Boeing','737-900','2009-12-02','2016-01-26',3),
('Boeing','747-400','2005-05-14','2016-01-21',2),
('Boeing','737-900','1999-10-20','2015-12-27',5),
('Embraer','RJ-45','2009-05-05','2016-01-20',3),
('Airbus','A300','1999-11-25','2016-01-03',3),
('Embraer','RJ-45','2012-06-12','2016-01-17',2),
('Embraer','RJ-45','2014-12-01','2015-12-29',1),
('Boeing','737-900','2007-11-24','2016-01-07',1),
('Embraer','RJ-45','2000-08-31','2016-01-08',2),
('Airbus','A300','2011-11-11','2016-01-01',1),
('Boeing','747-400','2008-06-27','2015-12-09',1),
('Embraer','RJ-45','2008-11-25','2016-01-27',1),
('Airbus','A330','2013-03-27','2015-12-23',5),
('Embraer','RJ-45','2000-07-15','2016-01-13',3),
('Boeing','747-400','2001-12-05','2015-12-06',2),
('Boeing','737-900','201.
Flight Reservation System
The “flight reservation system” project is an attempt to stimulatethe basic concepts of flight reservation system. The system enables the Passenger to do the things such as find for flight flights for two travel cities on a specified date, choose a flight based on the details, reservation of flight and cancellation of reservation.
The system provide a facility to the flight passenger to find for flights that are available between the two travel cities, namely the “Departure city” and “Arrival city” for a particular departure and arrival dates. The system shows all the flight’s details such as flight number, flight name, flight price and flight duration of journey .System display list of available flights and permit Passenger to choose a particular flight. Then the system checks for the availability of seats on the flight. If the seats are available then the system provides the functionality the passenger to reserve a seat. If seats are not available then it asks the user to choose another flight.
To reserve a flight the system asks the Passenger to enter his details such as name, address, city, state, card number (like credit /debit) and contact number. Then it checks the validity of card and reserved the flight and alters the flight database and user database. The system also permits the Passenger to cancel his/her reservation.
INPUT /Out Put APPLICATION
Proto type for login system:
Proto type for registration:
Prototype for finding flight:
Prototype for flight details:
Prototype for reservation:
Prototype for cancel ticket:
ANALYSIS
2. REQUIREMENT ELICITATION:
Requirement number
Detail
Type
Priority
Requirement-1
The user will be able to find for flights through a Normal screen.
Functional
Require
Requirement-2
Administrator maintains the user details and the flights details in the database.
Non functional
Require
Requirement-3
Through a Normal flight find function the passenger will be able to find one-way, round trip or multi destination flights.
Functional
Require
Requirement-4
The passenger should able to specify the departure, arrival places and date of their flight.
Functional
Require
Requirement-5
By advanced flight find function the passenger will allow the passenger to specify a proffered flight by its number or its name
Functional
Could have
Requirement-6
The user will have the choice to select the either non-stop, single stop or multi-stop flights.
Functional
Require
Requirement-7
The passenger can only find for a flight in the future and with in only one year of current date.
Functional
Require
Requirement-8
Any error in entry of the system will stop the system from processing the find. error message will be
Functional
Require
Requirement-9
The passenger will be able to see the price, duration of travelling, departure time and arrival time.
Functional
Require
Requirement-10
Passenger will able to specify the flight class which will ...
i3QL: Language-Integrated Live Data Views. Ralf Mitschke, Sebastian Erdweg, Mirko Köhler, Mira Mezini, and Guido Salvaneschi. In Proceedings of Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2014.
Abstract:
An incremental computation updates its result based on a change to its input, which is often an order of magnitude faster than a recomputation from scratch. In particular, incrementalization can make expensive computations feasible for settings that require short feedback cycles, such as interactive systems, IDEs, or (soft) real-time systems.
This paper presents i3QL, a general-purpose programming language for specifying incremental computations. i3QL provides a declarative SQL-like syntax and is based on incremental versions of operators from relational algebra, enriched with support for general recursion. We integrated i3QL into Scala as a library, which enables programmers to use regular Scala code for non-incremental subcomputations of an i3QL query and to easily integrate incremental computations into larger software projects. To improve performance, i3QL optimizes user-defined queries by applying algebraic laws and partial evaluation. We describe the design and implementation of i3QL and its optimizations, demonstrate its applicability, and evaluate its performance.
Part I This part is worth 6 points. Create the following tables in yo.pdfambritmobiles
Part I This part is worth 6 points. Create the following tables in your Oracle account: CREATE
TABLE PlaneN (Pnum char(3) primary key, Feature varchar2(20), Ptype varchar2(15));
CREATE TABLE PilotN (Eid char(3) primary key, Ename varchar(10), Salary number(7,2),
Mid char(3), foreign key (Mid) references PilotN); CREATE TABLE FlightN (Fnum char(4)
primary key, Fdate date, Duration number(2), Pnum char(3), foreign key (Pnum) references
PlaneN); CREATE TABLE Implements (Fnum char(4), Eid char(3), primary key( Fnum, Eid),
foreign key (Fnum) references FlightN, foreign key (Eid) references PilotN); Prepare a file and
execute the statements from the file. Use describe command to demonstrate your tables are
created. Part II is worth 20 points Insert the following data into created tables. 1. [2] Use the
INSERT SQL statements to insert data into PlaneN table. Put all your INSERT statements in a
file and execute the statements from the file.
2. [18] Use SQLLOADER utility to insert data into three other tables. Insert the following data
into PilotN table: Insert the following data into FlightN table:
Insert the following data into Implements table: FNUM EID \begin{tabular}{ll} \hline f01 & e02
\\ f01 & e05 \\ f02 & e02 \\ f03 & e02 \\ f03 & e03 \\ f04 & e05 \\ f05 & e05 \\ f05 & e06 \\ f06 &
e08 \\ f06 & e09 \\ f07 & e11 \\ f07 & e12 \\ f08 & e08 \\ f08 & e10 \\ f09 & e11 \\ f10 & e12 \\
f11 & e02 \\ f11 & e06 \\ f12 & e03 \\ f12 & e05 \\ f13 & e06 \\ f13 & e08 \\ f14 & e11 \\ f15 &
e12 \end{tabular} Use SELECT command to show the content of your tables. Part III is worth 74
points. Develop SQL statements for the following queries and execute them on Oracle 11g
hosted by School of ITEC Teaching Server: 1. [10] List names of pilots who implemented flights
on the planes of 'Commuter' type before '01-SEP-22'. 2. [8] Find names of pilots who
implemented more than one flight and have salary less than 40,000 . 3. [6] Find numbers and
features of planes which were not used in any flight so far.
4. [8] For each plane display its plane number, feature, and the total number of hours it spent in
the air. If a plane was not used at all, leave the total number of hours blank (don't show anything
in this column) for the plane. 5. [12] Find the name of the pilot(s) who implemented the longest
flight. 6. [10] Find plane types on which pilots whose manager is Green implemented flights. 7.
[8] Find employee IDs and names of pilots who implemented flights on planes of both types
'Commuter' and 'Normal' 8. [12] Display all pilots (their IDs and names) and the words "Higher
than average" if the pilot implemented more than the average number of flights per pilot or the
words "Lower than average" if the pilot implemented less than the average number of flights per
pilot. For the column holding the words "Higher than average" or "Lower than average" make a
header Performance. Put all your queries in a file and execute the queries from the file. Submit:
1. Cover page indicatin.
This course project focus mainly on Airport operation analysis and design at Chichago O'hare International Airport, which is done by efforts of me and my teammate Xiaoran Li. It includes: departure delay analysis; Pareto capacity diagram; West Terminal Design and Runway 28 Noise Analysis.
PostgreSQL Procedural Languages: Tips, Tricks and GotchasJim Mlodgenski
One of the most powerful features of PostgreSQL is its diversity of procedural languages, but with that diversity comes a lot of options.
Did you ever wonder:
- What all of those options are on the CREATE FUNCTION statement?
- How do they affect my application?
- Does my choice of procedural language affect the performance of my statements?
- Should I create a single trigger with IF statements or several simple triggers?
- How do I debug my code?
- Can I tell which line in my function is taking all of the time?
Advanced MySQL Query Tuning - talk at Percona Live and MySQL Meetup tour.
Tuning Queries and Schema/Indexes can significantly increase performance of your application and decrease response times.
This year I will cover new MySQL 5.6 and 5.7 algorithms that has been designed to improve query performance and simply tuning.
Topics:
1. Group by and order by optimizations
2. MySQL temporary tables and filesort
3. Using covered indexes to optimize your queries
4. Loose and tight index scan in MySQL
5. Using summary tables to optimize your reporting queries
6. New MySQL 5.6 and 5.7 Optimizer features and improvements
In this assignment you will practice creating classes and enumeratio.pdfivylinvaydak64229
In this assignment you will practice creating classes and enumerations in the context of a larger
system. Overall, we are building pieces of an airline flight booking system. The classes that we
are constructing in this assignment will take care of representing the flight data in Java. The final
booking system should be able to searching for flights from a list of commercial airlines (e.g.
American, United, or Delta), and locate various routes between two airports. The output is
somewhat inspired by Google Flights. Don\'t panic! We go will through this system step by step.
For the sake of simplifying the problem, we will make a couple of assumptions: There is only
one timezone. All flights occur in the same day. Already provided for you is a file called
Driver.java. A \"driver\" is a common term for the main program that manages a set of objects,
and manipulates them. It contains the entry point (main) for an entire project. The file you have
been provided contains five static methods that can be called from main. These are testing
methods that will run sample operations on the enumerations and classes you will be
constructing. Initally, they are all commented out. As you implement parts of the assignment,
you should uncomment lines in the test methods, in order to see how your program behaves.
Also attached is the file sample_output.txt. This file contains the sample output for running this
Driver with all of the included tests. You should check the output of your program against the
sample output. Plan to test your files one at a time, for example: make sure to test your Airline
and Airport enumerations before you start on Plane. Don\'t start working on Plane until those two
classes work completely. Time is independent of Airline, Airport, and Plane, but is complicated
enough that you\'ll want the experience of implementing those other questions before you started
it.
Q1: Create an Airline enumeration. This is a datatype that represents airlines in our system.
Include three values: American, United, and Delta. This should be a single file containing the
enum declaration. [2 points]
Q2: Create a smart Airport enumeration. This is a datatype that represents airports in our system,
and has the ability to change from airport code and city name. Include five values: PHX, LAX,
SFO, NRT, and SIN. Also add a static method called getAirportCity. This should be a single file
containing the enum declaration, with the method declaration nested inside. (Hint:
ExampleSmartEnum contains an example of including a method into an enumeration.) [8 points]
getAirportCity(...) will take an Airport enumeration value as a parameter, and return a String
containing the city where that airport is located (e.g., \"Phoenix\", \"Los Angeles\", \"Tokyo\",
\"San Francisco\"). Use a switch statement. Have a default case that returns \"Unknown City\".
Do not implement the switch statement for SIN (Singapore) - we want to test the default case
first.
Q3: Create a Plane clas.
Data warehouse or conventional database: Which is right for you?Data Con LA
Data Con LA 2020
Description
Developers have a plethora of choice for application data stores. In this talk we'll explore the differences between transaction processing systems like MySQL and analytic databases like ClickHouse to help you make the best choice for your application. Confused about when to use a data warehouse vs a traditional relational database? Open source has so many choices! Using MySQL and ClickHouse as examples, we'll work through use cases to see where each shines. Along the way we'll explore key technical differences like:
* row vs. column storage
* indexing and compression
* query parallelization
* concurrency support
* transaction models.
Finally we'll discuss how to handle use cases that require capabilities of both. Listeners will leave with clear criteria and and deeper understanding of database internals that enable them to make the right choice(s) for their own use cases.
Speaker
Robert Hodges, Altinity, Inc, CEO
Machine Learning based Hybrid Recommendation System
• Developed a Hybrid Movie Recommendation System using both Collaborative and Content-based methods
• Used linear regression framework for determining optimal feature weights from collaborative data
• Recommends movie with maximum similarity score of content-based data
Playing Flappy Bird by Deep Reinforcement Learning in Keras, A deep learning library in python and optimizing the network using techniques like Experience Replay.
a simple traffic lights controller and simulator implemented in VHDL
Complete project hosted at Github: https://github.com/abhishekjiitr/traffic-light-controller
A brief report on Client Server Model and Distributed Computing. Problems and Applications are also discussed and Client Server Model in Distributed Systems is also discussed.
A smart wearable device which prevents mobile phone loss.
Project includes:
android app
arduino code
The arduino remains connected to the mobile via bluetooth. Whenever it leaves the range of bluetooth(~10m), both the mobile and arduino start vibrating.
A project made as a part of Srishti 2016.
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesSanjeev Rampal
Talk presented at Kubernetes Community Day, New York, May 2024.
Technical summary of Multi-Cluster Kubernetes Networking architectures with focus on 4 key topics.
1) Key patterns for Multi-cluster architectures
2) Architectural comparison of several OSS/ CNCF projects to address these patterns
3) Evolution trends for the APIs of these projects
4) Some design recommendations & guidelines for adopting/ deploying these solutions.
# Internet Security: Safeguarding Your Digital World
In the contemporary digital age, the internet is a cornerstone of our daily lives. It connects us to vast amounts of information, provides platforms for communication, enables commerce, and offers endless entertainment. However, with these conveniences come significant security challenges. Internet security is essential to protect our digital identities, sensitive data, and overall online experience. This comprehensive guide explores the multifaceted world of internet security, providing insights into its importance, common threats, and effective strategies to safeguard your digital world.
## Understanding Internet Security
Internet security encompasses the measures and protocols used to protect information, devices, and networks from unauthorized access, attacks, and damage. It involves a wide range of practices designed to safeguard data confidentiality, integrity, and availability. Effective internet security is crucial for individuals, businesses, and governments alike, as cyber threats continue to evolve in complexity and scale.
### Key Components of Internet Security
1. **Confidentiality**: Ensuring that information is accessible only to those authorized to access it.
2. **Integrity**: Protecting information from being altered or tampered with by unauthorized parties.
3. **Availability**: Ensuring that authorized users have reliable access to information and resources when needed.
## Common Internet Security Threats
Cyber threats are numerous and constantly evolving. Understanding these threats is the first step in protecting against them. Some of the most common internet security threats include:
### Malware
Malware, or malicious software, is designed to harm, exploit, or otherwise compromise a device, network, or service. Common types of malware include:
- **Viruses**: Programs that attach themselves to legitimate software and replicate, spreading to other programs and files.
- **Worms**: Standalone malware that replicates itself to spread to other computers.
- **Trojan Horses**: Malicious software disguised as legitimate software.
- **Ransomware**: Malware that encrypts a user's files and demands a ransom for the decryption key.
- **Spyware**: Software that secretly monitors and collects user information.
### Phishing
Phishing is a social engineering attack that aims to steal sensitive information such as usernames, passwords, and credit card details. Attackers often masquerade as trusted entities in email or other communication channels, tricking victims into providing their information.
### Man-in-the-Middle (MitM) Attacks
MitM attacks occur when an attacker intercepts and potentially alters communication between two parties without their knowledge. This can lead to the unauthorized acquisition of sensitive information.
### Denial-of-Service (DoS) and Distributed Denial-of-Service (DDoS) Attacks
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC
Ellisha Heppner, Grant Management Lead, presented an update on APNIC Foundation to the PNG DNS Forum held from 6 to 10 May, 2024 in Port Moresby, Papua New Guinea.
1.Wireless Communication System_Wireless communication is a broad term that i...JeyaPerumal1
Wireless communication involves the transmission of information over a distance without the help of wires, cables or any other forms of electrical conductors.
Wireless communication is a broad term that incorporates all procedures and forms of connecting and communicating between two or more devices using a wireless signal through wireless communication technologies and devices.
Features of Wireless Communication
The evolution of wireless technology has brought many advancements with its effective features.
The transmitted distance can be anywhere between a few meters (for example, a television's remote control) and thousands of kilometers (for example, radio communication).
Wireless communication can be used for cellular telephony, wireless access to the internet, wireless home networking, and so on.
This 7-second Brain Wave Ritual Attracts Money To You.!nirahealhty
Discover the power of a simple 7-second brain wave ritual that can attract wealth and abundance into your life. By tapping into specific brain frequencies, this technique helps you manifest financial success effortlessly. Ready to transform your financial future? Try this powerful ritual and start attracting money today!
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBrad Spiegel Macon GA
Brad Spiegel Macon GA’s journey exemplifies the profound impact that one individual can have on their community. Through his unwavering dedication to digital inclusion, he’s not only bridging the gap in Macon but also setting an example for others to follow.
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Airline Database Design
1. Air India Database Design
DBMS (CSN-351)
Group Number - 1
Abhishek Jaisingh 14114002
Amandeep 14114008
Tirth Patel 14114036
Table of Contents
ER Diagram 2
Assumptions 2
Initial Schema Diagram 3
Tables with FDs 4
Final Schema Diagram 8
Basic Operations with SQL queries and results 9
1
2. ER diagram
Assumptions
1. There is a route code table not listed as separate table in our design, which has
information about all the intermediate airports in a journey with specific route code.
2. A person can only book 1 ticket per transaction. A new transaction is required again to
book more tickets.
3. Fare for the each flight in AirFare table is calculated separately using the Route of the
flight.
2
4. Tables with functional dependencies
Country [BCNF]
Primary Key: CtID
CtID → CountryName
CREATE TABLE `Country`
(
`CtID` INT NOT NULL AUTO_INCREMENT,
`CountryName` varchar(32) NOT NULL,
PRIMARY KEY (`CtID`)
);
State [BCNF]
Primary Key: StID
StID → StateName | Country
CREATE TABLE `State`
(
`StID` INT NOT NULL AUTO_INCREMENT UNIQUE,
`StateName` varchar(32) NOT NULL,
`Country` INT NOT NULL,
PRIMARY KEY (`StID`),
FOREIGN KEY (`Country`) REFERENCES `Country`(`CtID`)
);
Contact_Details [BCNF]
Primary Key: CnID
CnID → Email | Mobile | State
CREATE TABLE `Contact_Details`
(
`CnID` INT NOT NULL AUTO_INCREMENT,
`Email` varchar(50) NOT NULL,
`Mobile` varchar(16) NOT NULL,
`State` INT NOT NULL,
PRIMARY KEY (`CnID`),
FOREIGN KEY (`State`) REFERENCES `State`(`StID`)
4
5. );
Passenger [BCNF]
Primary Key: PsID
PsID → Name | Address | Age | Nationality | Contacts
CREATE TABLE `Passenger`
(
`PsID` INT NOT NULL AUTO_INCREMENT,
`Name` varchar(32) NOT NULL,
`Address` varchar(64) NOT NULL,
`Age` INT NOT NULL,
`Nationality` varchar(16) NOT NULL,
`Contacts` INT NOT NULL,
PRIMARY KEY (`PsID`),
FOREIGN KEY (`Contacts`) REFERENCES `Contact_Details`(`CnID`)
);
Transaction [BCNF]
Primary Key: TsID
TsID → BookingDate | Passenger | Flight
CREATE TABLE `Transaction`
(
`TsID` INT NOT NULL AUTO_INCREMENT,
`BookingDate` DATETIME NOT NULL,
`Passenger` INT NOT NULL,
`Flight` INT NOT NULL,
PRIMARY KEY (`TsID`),
FOREIGN KEY (`Passenger`) REFERENCES `Passenger`(`PsID`),
FOREIGN KEY (`Flight`) REFERENCES `Flight_Schedule`(`FlID`)
);
Flight_Schedule [2NF]
Primary Key: FlID
FlID → FlightDate | Departure | Arrival | AirCraft | NetFare
Departure → FlightDate
5
6. CREATE TABLE `Flight_Schedule`
(
`FlID` INT NOT NULL AUTO_INCREMENT,
`FlightDate` DATE NOT NULL,
`Departure` DATETIME NOT NULL,
`Arrival` DATETIME NOT NULL,
`AirCraft` INT NOT NULL,
`NetFare` INT NOT NULL,
PRIMARY KEY (`FlID`),
FOREIGN KEY (`AirCraft`) REFERENCES `AirCraft`(`AcID`),
FOREIGN KEY (`NetFare`) REFERENCES `AirFare`(`AfID`)
);
Note : This table is in 2NF due to the derivation of FlightDate from Departure attribute
which is trivial. Removing this dependency by adding extra table only for FlightDate
enhances the overhead for queries. Keeping it in this form results in very little reduction
in memory efficiency.
AirFare [BCNF]
Primary Key: AfID
AfID → Route | Fare
CREATE TABLE `AirFare`
(
`AfID` INT NOT NULL AUTO_INCREMENT,
`Route` INT NOT NULL,
`Fare` INT NOT NULL,
PRIMARY KEY (`AfID`),
FOREIGN KEY (`Route`) REFERENCES `Route`(`RtID`)
);
Route [BCNF]
Primary Key: RtID
RtID → Airport | Destination | RouteCode
CREATE TABLE `Route`
(
`RtID` INT NOT NULL AUTO_INCREMENT,
`Airport` varchar(32) NOT NULL,
`Destination` varchar(32) NOT NULL,
`RouteCode` varchar(16) NOT NULL UNIQUE,
PRIMARY KEY (`RtID`)
6
7. );
Note : Here RouteCode will be is unique number recognizing the route of the flight
between given 2 airports.
AirCraft [2NF]
Primary Key: AcID
AcID → Ac_Type | Capacity | Mfg_Date
Ac_Type → Capacity
Note : To convert into BCNF, this table is decomposed into 2 new following tables
AirCraft and AirCraft_Type.
AirCraft [BCNF] (from decomposition)
Primary Key: AcID
AcID → Ac_Type | Ac_Type | Mfg_Date
CREATE TABLE `AirCraft`
(
`AcID` INT NOT NULL AUTO_INCREMENT,
`Ac_Type` INT NOT NULL,
`Mfg_Date` DATE NOT NULL,
PRIMARY KEY (`AcID`),
FOREIGN KEY (`Ac_Type`) REFERENCES `AirCraft_Type`(`ActID`)
);
AirCraft_Type [BCNF] (from decomposition)
Primary Key: ActID
ActID → Type | Capacity
CREATE TABLE `AirCraft_Type`
(
`ActID` INT NOT NULL AUTO_INCREMENT,
`Type` varchar(32) NOT NULL,
`Capacity` INT NOT NULL,
PRIMARY KEY (`ActID`)
);
7
8. Final Schema Diagram
This is final schema diagram after decomposition. These 10 tables are made in our Air India
database design.
8
9. Basic Operations
Here are some basic operations listed that our database provides. Each functionality is shown
with corresponding sample SQL query and screenshot.
1. List all the aircrafts older than '2' years (can be used for expiry dates or
maintenance date)
SELECT AcID, Mfg_Date, Type
FROM AirCraft INNER JOIN AirCraft_Type ON (AirCraft.Ac_Type = AirCraft_Type.ActID)
WHERE YEAR(CURDATE()) - YEAR(Mfg_Date) > 2
2. List all the flights in database from airport 'New Delhi' to airport 'Bangalore'
SELECT FlId, FlightDate, Fare, Departure, Arrival
FROM ((Flight_Schedule INNER JOIN AirFare ON (Flight_Schedule.NetFare = AirFare.AfID)))
INNER JOIN Route ON (Route = RtID)
WHERE Airport = 'New Delhi' AND Destination = 'Bangalore'
9
10. 3. List all the passengers for flight no. '5'
SELECT NAME, Age, Mobile
FROM Transaction INNER JOIN Passenger ON (Transaction.Passenger = PsID)
INNER JOIN Contact_Details ON (Contacts = CnID)
WHERE Flight = 5
ORDER BY NAME
4. List all the minor (age less than 18) travelling in flight no. '5'
SELECT Name, Age, Mobile, Address, StateName, CountryName
FROM Transaction INNER JOIN Passenger ON (Transaction.Passenger = PsID)
INNER JOIN Contact_Details ON (Contacts = CnID)
INNER JOIN State ON (State = StID)
INNER JOIN Country ON (CtID = Country)
WHERE Flight = 5 AND Age < 18
ORDER BY NAME, Age
10
11. 5. Total Fare collected from date '2016-10-01' to date '2016-10-20'
SELECT SUM(Fare)
FROM Transaction INNER JOIN Flight_Schedule ON (Flight = FlID)
INNER JOIN AirFare ON (NetFare = AfID)
WHERE DATE (BookingDate) BETWEEN '2016-10-01' AND '2016-10-20'
6. Total number of tickets booked from date '2016-10-10' to date '2016-11-25'
SELECT COUNT(PsID) AS Tickets
FROM Transaction INNER JOIN Passenger ON (Transaction.Passenger = PsID)
INNER JOIN Contact_Details ON (Contacts = CnID)
WHERE DATE (BookingDate) BETWEEN '2016-10-10' AND '2016-11-25';
7. Number of persons travelling airport 'New Delhi' from date '2016-11-1' to date
'2016-11-30'
SELECT COUNT(PsID) AS NUM_CUSTOMERS
FROM Route INNER JOIN AirFare ON (RtID = Route)
INNER JOIN Flight_Schedule ON (AfID = NetFare)
INNER JOIN Transaction ON (Flight = FlID)
INNER JOIN Passenger ON (Transaction.Passenger = PsID)
INNER JOIN Contact_Details ON (Contacts = CnID)
WHERE DATE (FlightDate) BETWEEN '2016-11-1' AND '2016-11-30' AND Airport = 'New Delhi';
11
12. 8. Number of persons reaching at 'New Delhi' from date '2016-11-1' to date
'2016-11-30'
SELECT COUNT(PsID) AS NUM_CUSTOMERS
FROM Route INNER JOIN AirFare ON (RtID = Route)
INNER JOIN Flight_Schedule ON (AfID = NetFare)
INNER JOIN Transaction ON (Flight = FlID)
INNER JOIN Passenger ON (Transaction.Passenger = PsID)
INNER JOIN Contact_Details ON (Contacts = CnID)
WHERE DATE (FlightDate) BETWEEN '2016-11-1' AND '2016-11-30' AND Destination = 'New Delhi';
9. Number of persons with flights from 'New Delhi' to 'Bangalore' from date
'2016-11-1' to date '2016-11-30'
SELECT COUNT(PsID) AS NUM_CUSTOMERS
FROM Route INNER JOIN AirFare ON (RtID = Route)
INNER JOIN Flight_Schedule ON (AfID = NetFare)
INNER JOIN Transaction ON (Flight = FlID)
INNER JOIN Passenger ON (Transaction.Passenger = PsID)
INNER JOIN Contact_Details ON (Contacts = CnID)
WHERE DATE (FlightDate) BETWEEN '2016-11-1' AND '2016-11-30' AND Airport = 'New Delhi'
AND Destination = 'Bangalore';
10. Provide State wise analysis of sales of flight tickets
SELECT StateName, Count(PsID) AS Tickets
FROM Transaction INNER JOIN Passenger ON (Transaction.Passenger = PsID)
INNER JOIN Contact_Details ON (Contacts = CnID)
INNER JOIN State ON (State = StID)
GROUP BY StateName
ORDER BY Count(PsID) DESC;
12