Design and create a database for an airline

Assignment Help Database Management System
Reference no: EM131214021

Systems and Database Design Assignment: Database Design & Implementation (Airline)

The assignment consists of two tasks. The first task, Database Design, requires a word processed document in PDF format detailing the design of your database. The second task, Implementation, is a collection of SQL scripts which create and populate the database designed in the first task, and then query the data it contains.  A small amount of marks are dedicated to presentation, notation and formatting.

Task 1 - Database Design

Your first task is to design a database for the scenario detailed on the following pages.  Your final database design should comprise of approximately 10 entities. 

Scenario Details

You are required to design and create a database for an airline. The database must contain details of the airline's planes, flights, flight instances and staff, as well as supporting data as detailed below.

-Details of the planes owned by the airline must be stored.  This must include the registration number of the plane, the year it was built, its first class and economy passenger capacities, and a foreign key identifying the model of the plane.

-Details of plane models must be stored.  This must include the model number, manufacturer name, range (how many kilometres it can travel without refuelling) and cruise speed.  

-Details of flights must be stored.  This must include a flight number, a foreign key identifying the airport the flight departs from, a foreign key identifying the airport the flight arrives at, and the distance between the airports in kilometres.

  • Note: A flight is a route that the airline offers - e.g. Flight QF574 is a Perth to Sydney route offered by Qantas.

-Details of flight instances must be stored.  This must include a flight instance ID, a foreign key identifying the plane making the flight, a foreign key identifying the flight that is being flown, the date/time that the flight leaves, and date/time that the flight arrives.

  • Note: A flight instance is a specific occurrence of a flight - e.g. The 2016-07-04 QF574 flight at 05:30.

 -Details of airports must be stored.  This must include the airport code (e.g. "PER" for Perth), the name of the airport, a contact phone number, its latitude and longitude, and a foreign key identifying the country that the airport is in.

 -A list of countries must be stored.  This must simply contain the two letter country code (e.g. "AU") and the name of the country.

-Details of pilots must be stored.  This must include a pilot ID, their first name, and last name, date of birth and number of hours flown.

-The database must record which models of plane each pilot is qualified to fly.  Each pilot must be qualified to fly at least one model of plane.

-The database must record which pilots are aboard each flight instance.  Each flight instance requires exactly two pilots (a pilot and co-pilot).

-Details of flight attendants must be stored.  This must include an attendant ID, their first name, last name, date of birth and hire date.

-For training purposes, some flight attendants mentor other flight attendants. The database must record each flight attendant's mentor, if they have one.

-The database must record which attendants are aboard each flight instance.  A flight instance can have many attendants on board.

-The database must record which attendant has been designated the flight service manager (FSM) of each flight instance.  Each flight instance must have one FSM.

Task 2 - Implementation

Once your database has been designed, it is time to implement it in a DBMS, populate the database, and then manipulate the data via queries.  The deliverables of this task are three files containing SQL statements.  We will be using Microsoft SQL Server 2008 R2 or above - your SQL scripts must run in the same environment used in the unit/labs.    

Create your scripts as three ".sql" files, with the filenames listed in the following headings.  Templates for the script files are provided with this assignment brief - please use them.  Format your code for readability, and use comments for headings and to provide further detail or information about your code if needed.

Filename:  create.sql

Database Creation & Population Script

Produce a script to create the database you designed in Task 1 (incorporating any changes you have made since then).  Be sure to give your columns the same data types, properties and constraints specified in your data dictionary, and be sure to name tables and columns consistently.  Include any logical and correct default values and any check or unique constraints that you feel are appropriate.

Make sure this script can be run multiple times without resulting in any errors (hint: drop the database if it exists before trying to create it).  You can use/adapt the code at the start of the creation scripts of the sample databases available in the unit materials to implement this.

You will need to follow an appropriate creation order when creating your tables - you cannot create a table with a foreign key constraint that refers to a table which does not yet exist.

Once you have created your database, it is recommended that you use SSMS to create an ER diagram and use this to verify that your implementation matches your design.  This can be done by right clicking on the "Database Diagrams" folder of the database in the Object Explorer in SSMS.

Following the SQL statements to create your database and its tables, you must include statements to populate the database with sufficient test data.  You are only required to populate the database with enough data to make sure that all views and queries return meaningful results.  You can start working on your views and queries and write INSERT statements as needed for testing as you go. 

Filename:  views.sql

Flight Instance View

Create a view which shows the following details of all flight instances:

-All of the columns in the flight instance table.

-The departure airport code, arrival airport code and distance of the flight.

-The full name of the pilot, co-pilot and flight service manager.

  • Concatenate the first name and last name into one column, e.g. "Joe Bloggs".

 -The model number of the plane.

-A column with an alias of "expected_attendants", which will contain the number of  attendants which are expected to be on board based upon the capacity of the plane.

  • The column should calculate this by adding together the plane's first class capacity and economy capacity and dividing the total by 100.

Creating this view will require joining the flight instance table to the flight table, the plane table, the attendant table, and the pilot table (twice) - a total of 5 joins.  This view serves as a very convenient replacement for the flight instance table, as it includes the relevant details from numerous other tables - use this view in queries that need this data!

Filename:  queries.sql

Write SELECT statements to complete the following queries.  If you do not understand or are not sure about exactly what a query requires, contact your lecturer or tutor.

Query 1 - Plane Finder

Write a query that selects the registration number, model number, range, and total passenger capacity (first class plus economy) of all planes which have a total capacity of at least 400 and a range of at least 14000kms.  Order the results by range, in descending order.

Query 2 - Flight Instance Descriptions

Write a query that concatenates various pieces of flight instance information to form a single column that describes all flight instances in the following way: 

"The [departure time] instance of flight [flight number] from [departure airport code] to [arrival airport code] takes [travel time in hours] hours."

Query 3 - Departing Flight Information

Write a query that selects the flight number, arrival airport code, departure time minus one hour and model number of all upcoming flights (departure time in the future).  Give the columns aliases of "Flight Number", "Destination", "Boarding Time" and "Plane".  Order the results by departure time. Using the Flight Instance View in this query is recommended.

Query 4 - Flight Statistics

Write a query that selects the flight number, number of flight instances and total distance travelled of all flights.  Only flight instances that have already occurred (i.e. ones before the current date) should be included, and your results do not need to include flights that have had no instances.  Give all columns appropriate aliases, and order the results by the total distance in descending order. Using the Flight Instance View in this query is recommended.

Query 5 - Attendant Comparison

Write a query that selects the ID number, full name, and number of years worked for all attendants as well as the ID number, full name and number of years worked of their mentor, if they have one. Attendants with no mentor should appear in the results, but will have NULL for the mentor details.  

Query 6 - Pilot Selection

Write a query that selects the pilot ID number and full name of all pilots who are qualified to fly plane used in flight instance 3. Use a subquery to determine the model of plane for flight instance 3.

Query 7 - International Flights

Write a query that selects the flight number, the name of the country that the departure airport is in and the name of the country that the arrival airport is in for all international flights - i.e.  All flights where the departure airport and arrival airport are in a different country.  This will involve multiple joins with the same table (use table aliases to make this possible).

Query 8 - Understaffed Flight Instances

Write a query that selects the flight instance ID, flight number, departure time, expected number of attendants and actual number of attendants for any flight instances where the actual number of attendants is less than the expected number.  See Page 8 (views.sql) for details regarding the expected number of attendants, and use the information in your database to determine the number of attendants actually rostered onto the flight instance. This query will involve using COUNT, GROUP BY and HAVING, and using the Flight Instance View in this query is recommended.

Attachment:- Database Assignment.rar

Reference no: EM131214021

Questions Cloud

What is the probability that first is red and second blue : What is the probability of selecting a white ball on the second draw if the first ball is replaced before the second is selected?
Bank that provides online banking services : 1. Why is it advantageous to conduct your business with a bank that provides online banking services? 2. Why is it best to select a bank with convenient ATMs?
Find the probability of the sum is 7 : Two six-sided (balanced) dice are thrown. Find the probabilities of a= 5 does not occur on either throw;and the sum is 7;
Money for your two dream vacations : You want to save some money for your two dream vacations as well as have some money available during your retirement years. Today is your 35th birthday.
Design and create a database for an airline : CSG1207/CSI5135 Systems and Database Design. You are required to design and create a database for an airline. The database must contain details of the airline's planes, flights, flight instances and staff, as well as supporting data as detailed bel..
Find probability of only 2 or 3 or 4 appear on both dice : Two six-sided (balanced) dice are thrown. Find the probabilities of only 2, 3, or 4 appear on both dice; - the value of the second roll subtracted from the value of the first roll is 2;
Two inventive arrangements distinguished : Write a paper of more than 6 pages to incorporate the accompanying components Select a suggestion from the two inventive arrangements distinguished in Week 4 for tackling the issue.
Barchester city council operates seven car parks in the : Barchester City Council operates seven car parks in the centre of Barchester.  The Council has a requirement for a new system to control its car parks.  This system must provide for the day-to-day operation of each car park-issuing tickets, handling ..
Evaluate the potential remedies for breach of contract : Explain the legal issues addressed by your selected topic/clause and how your contract clause can be applied within a business managerial setting. Summarize the potential legal defenses available to contract formation.

Reviews

len1214021

9/20/2016 6:57:33 AM

Assignment Work with following details. Subject : database...sql server2008 r2 management studio. This is an easy assignment please check and tell me update please. In this essay assignment diagram accurately depicts the scenario and includes all elements specified in the brief. Accurately depicts the scenario and is a correct translation of the logical ER diagram. A small amount of marks are awarded for presentation, notation and formatting. This includes: Presentation and appearance of word processed PDF document for Task 1, Appropriateness and consistency of notation used for diagrams/data dictionary in Task 1 and Appropriate commenting and formatting of scripts in Task 2.

Write a Review

Database Management System Questions & Answers

  Design relational database using entity-relationship diagram

Design a Relational Database using Entity-Relationship Diagram (ER-D) and design a Relational Database by Mapping Entity-Relationship Diagram (ER-D) into Relational Models.

  What is difference between physical and logical data model

What is the difference between a conceptual, a logical, and a physical data model? Where do relationship diagrams (RDs) and entity/relationship diagrams (ERDs) fit in?

  Write an sql query

Write an SQL query to get the author of the book "The Alchemist"

  How many different orders are possible

How many different orders are possible if a customer can order at most one hamburger, one fish sandwich, and one beverage but can order less?

  Clustered versus unclustered indexes

Choice of search key for the index. What is a composite search key, and what considerations are made in choosing composite search keys? What are index-only plans, and what is the in?uence of potential index-only evaluation plans on the choice of sear..

  Create website for fashion designer who wants a unique page

There are many creative uses for tables. Imagine that you have been hired to create a Website for a fashion designer who wants a unique page that stands out. Describe how you could use tables to meet this goal.

  What are the candidate keys of r

Suppose you have a relation schema about teaching classes that has the following attributes: Class, Instructor, Time and Room.

  Create a fully attributed loagical data model diagram

Create Conceptual Schema Diagram. Create a fully attributed Loagical Data Model Diagram. Create the SQL script that will generate atleast 4 tables in the data model that you have created.

  When you add a calculated field to a query it creates a new

When you add a calculated field to a query it creates a new

  Implementation of an application that stores data in a mysql

The purpose of the assignment is the implementation of an application that stores data in a MySQL database.

  Draw an ER diagram for your proposed database

Describe the situation. Your description should be brief and relatively informal. If there are any unique or particularly difficult aspects of your proposed application

  Q1 explain what a relational database is and explain why

you are the trainer for a major technology firm. one of the problems your firm has is hiring new technologists who have

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd