{"id":26662660,"url":"https://github.com/siddhant2105s/airman-database-system","last_synced_at":"2025-03-25T14:17:37.989Z","repository":{"id":284046534,"uuid":"953651734","full_name":"Siddhant2105s/AirMan-Database-System","owner":"Siddhant2105s","description":"This repository contains the design and implementation of the AirMan System for managing airport operations at London Biggin Hill Airport. It includes an ERD diagram, MySQL scripts for database creation, data insertion, and queries, as well as detailed data definitions and system requirements documentation.","archived":false,"fork":false,"pushed_at":"2025-03-23T20:49:30.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T21:31:25.557Z","etag":null,"topics":["data-analysis","database-design","database-normalization","entity-relationship-diagram","entity-relationship-models","mysql","relational-databases","sql-queries"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Siddhant2105s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-23T20:47:27.000Z","updated_at":"2025-03-23T20:57:00.000Z","dependencies_parsed_at":"2025-03-23T21:31:31.076Z","dependency_job_id":"6b3ad49a-10ab-4f21-8683-5284e5ac17aa","html_url":"https://github.com/Siddhant2105s/AirMan-Database-System","commit_stats":null,"previous_names":["siddhant2105s/airman-database-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Siddhant2105s%2FAirMan-Database-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Siddhant2105s%2FAirMan-Database-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Siddhant2105s%2FAirMan-Database-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Siddhant2105s%2FAirMan-Database-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Siddhant2105s","download_url":"https://codeload.github.com/Siddhant2105s/AirMan-Database-System/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245476718,"owners_count":20621699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","database-design","database-normalization","entity-relationship-diagram","entity-relationship-models","mysql","relational-databases","sql-queries"],"created_at":"2025-03-25T14:17:37.066Z","updated_at":"2025-03-25T14:17:37.968Z","avatar_url":"https://github.com/Siddhant2105s.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# AirMan-Database-System\nThis repository contains the design and implementation of the AirMan System for managing airport operations at London Biggin Hill Airport. It includes an ERD diagram, MySQL scripts for database creation, data insertion, and queries, as well as detailed data definitions and system requirements documentation.\n\n## Background\n\nLondon Biggin Hill Airport is a general aviation airport at Biggin Hill in the London Borough of Bromley, approximately 14 miles south-southeast of Central London. The airfield has been publicly owned by the London Borough of Bromley since 1974 and evolved into a private airfield in 1994 when it was leased by Biggin Hill Airport Ltd. to run it on a commercial basis. It is effectively a public-private partnership. Its commercial potential took a turn for the better when Bombardier announced its European relocation from Amsterdam to London Biggin Hill in 2016. Furthermore, the London Aerospace \u0026 Technology College funding was secured in 2018, as was planning for an Airport Hotel.\n\nThe airport has a Civil Aviation Authority (CAA) Ordinary Licence that allows flights for the public transport of passengers or flying instruction. The airport specializes in general aviation, handling a spectrum of traffic from private aviation to large business jets. It has no scheduled airline service, as flights using the airport are not permitted to carry fare-paying passengers.\n\nThe airport has one runway that can accommodate the take-off and landing of aircraft up to Boeing 737/Airbus A320 size. It is also an Instrument Landing System. Radar air traffic control (ATC) services are provided by Thames Radar at the London Terminal Control Centre. In contrast, procedural approach visual flight rules and air traffic control services are provided by the airport itself.\n\nBiggin Hill is used by many business flights involving business jets and similar-sized aircraft. The airport has a passenger terminal located on the A233 road just south of Leaves Green, which provides facilities for such flights, including departure lounges, a licensed café bar, and customs and immigration facilities.\n\nLondon Biggin Hill Ltd owns and manages the airfield, which operates national and international flights for private, corporate, and commercial aircraft. It also provides an aircraft home base for aircraft owners, aircraft management companies, and industrial customers, such as Formula One base. As with many organizations that grew organically, Biggin Hill Airport’s information needs are met using a variety of ad-hoc, siloed systems that are not fit for purpose. David Winstanley, CEO of London Biggin Hill Airport, commissioned a new project aimed at replacing these disparate systems into a unified, modular design of systems. The core operations and services that support the Airport’s value proposition to customers are:\n\n- General operations such as customer and visitor parking, ground transport, security and UK Border Patrol, Heli-shuttle transit services, private airport lounges, baggage handling, contactless travel (a new Covid-19 measure), and aircraft charter.\n\n- Core operations on the aircraft side include ground handling equipment, maintenance, aircraft cleaning, catering, and hanger facilities are available. Pilot services are also provided. Non-commercial private aircraft are also accommodated and managed.\n\nThe CEO has awarded a tender to Irish software development company AirSoft to develop the first module AirMan.\n\n## Project Approach\n\n### Step 1: Creating the ERD Diagram\n\nThe first step was to identify the key entities and their attributes based on the project requirements. This was documented in the data definition file, which includes detailed data definitions for each entity.\n\n### Step 2: Designing the Database Schema\n\nUsing the identified entities and attributes, an Entity-Relationship Diagram (ERD) was created. The ERD provides a visual representation of the database schema, showing how different entities are related to each other.\n\n![AirMan ERD](./ERD/AirMan_ERD.png)\n\n### Step 3: Implementing the Database in MySQL\n\nWith the ERD as a blueprint, the next step was to implement the database schema in MySQL. This involved creating tables for each entity and defining their relationships.\n\n#### Example Snippet:\n```sql\n-- Creating PERSON table\nCREATE TABLE PERSON (\n  PersonID INT AUTO_INCREMENT PRIMARY KEY,\n  Name VARCHAR(255) NOT NULL,\n  AddressLine1 VARCHAR(255) NOT NULL,\n  AddressLine2 VARCHAR(255),\n  PhoneNumber VARCHAR(15) NOT NULL,\n  Email VARCHAR(255) NOT NULL,\n  SocialInsuranceNumber VARCHAR(15) UNIQUE,\n  Role ENUM('Customer', 'Pilot', 'Employee') NOT NULL\n);\n-- Creating PILOT table that inherits from PERSON\nCREATE TABLE PILOT (\n  PersonID INT,\n  LicenseNumber VARCHAR(255) NOT NULL UNIQUE,\n  MedicalCertificationDate DATE NOT NULL,\n  FlightReviewDate DATE NOT NULL,\n  OperatingLimitations VARCHAR(255),\n  PRIMARY KEY (PersonID),\n  CONSTRAINT fk_pilot_person FOREIGN KEY (PersonID) REFERENCES PERSON(PersonID)\n);\n```\n\n### Step 4: Verifying the Database Schema\nAfter creating the database schema in MySQL, the schema was reverse-engineered to generate an Entity-Relationship Model (ERM). This step verified that the ERD and ERM models match, ensuring the correct database creation.\n\n![AirMan ERD](./ERD/AirManERD_reverse_engineering_ERM.png)\n\n### Step 5: Inserting Data\n\nMock data was inserted into the tables to demonstrate the system's functionality. This data serves as sample records to test and validate the database operations.\n\n#### Example Snippet:\n```sql\n-- Adding PERSON table data\nINSERT INTO PERSON (Name, AddressLine1, PhoneNumber, Email, SocialInsuranceNumber, Role)\nVALUES\n('John Doe', '123 Aviation Way', '555-1234', 'johndoe@example.com', '123-45-6789', 'Customer'),\n('Alice Smith', '234 Skyline Blvd', '555-2345', 'alicesmith@example.com', '987-65-4321', 'Pilot'),\n('Bob Johnson', '345 Jetstream St', '555-3456', 'bobjohnson@example.com', '135-79-2468', 'Employee');\n\n-- Adding PILOT table data\nINSERT INTO PILOT (PersonID, LicenseNumber, MedicalCertificationDate, FlightReviewDate, OperatingLimitations)\nVALUES\n(2, 'PIL123456', '2022-06-15', '2022-06-15', 'None');\n\n-- Adding CUSTOMER table data\nINSERT INTO CUSTOMER (PersonID, CustomerCategory, ContactPerson)\nVALUES\n(1, 'Individual', 'John Doe');\n```\n\nThe dataset can be seen here: [Datasets and Tables](./SQL_scripts/datasets_and_tables.md)\n\n### Step 6: Writing SQL Queries for IT Management\n\nThe IT management team is interested in important analytics to help them understand and manage the airport operations effectively. Below listed questions were posed, and SQL queries were written to answer these questions.\n\n- Calculate the landing, service, fuelling, and parking fees for a customer of your choice in February 2024 and indicate if this customer is a corporation.\n\n- List which pilots who are also customers made the most take-offs and landings at the airport in February 2024 and indicate which aircraft they flew by type and registration number.\n\n- List the employees (by employee number, name, and role) who are qualified service personnel who performed routine services on all aircraft owned by a specific corporation in February 2024.\n\n- From the previous list, list all the parts used in a service per aircraft type, part number and part name.\n\n- List the names of all aircraft by type, model, and registration number that landed and were refuelled and/or parked and/or cleaned in February 2024 and the total revenue per aircraft and the total revenue to Biggin Hill for that month.\n\n\n#### 1. Calculate the landing, service, fuelling, and parking fees for a customer of your choice in February 2024 and indicate if this customer is a corporation.\nThis helps IT management understand the costs associated with a specific customer's aircraft operations during a given period.\n\n```sql\nSELECT \n    C.CustomerID, \n    C.CustomerCategory, \n    SUM(LF.LandingFee) AS TotalLandingFee, \n    SUM(SF.ServiceFee) AS TotalServiceFee, \n    SUM(FF.FuelingFee) AS TotalFuelingFee, \n    SUM(PF.ParkingFee) AS TotalParkingFee,\n    CASE \n        WHEN C.CustomerCategory = 'corporation' THEN 'Yes'\n        ELSE 'No'\n    END AS IsCorporation\nFROM \n    Customer C\nJOIN \n    Flight_Record FR ON C.CustomerID = FR.CustomerID\nJOIN \n    Landing_Fee LF ON FR.FlightRecordID = LF.FlightRecordID\nJOIN \n    Service_Fee SF ON FR.FlightRecordID = SF.FlightRecordID\nJOIN \n    Fueling_Fee FF ON FR.FlightRecordID = FF.FlightRecordID\nJOIN \n    Parking_Fee PF ON FR.FlightRecordID = PF.FlightRecordID\nWHERE \n    FR.TakeOffDate BETWEEN '2024-02-01' AND '2024-02-28'\nGROUP BY \n    C.CustomerID, C.CustomerCategory;\n\n```\n\n\n| CustomerID | CustomerCategory | TotalLandingFee | TotalServiceFee | TotalFuelingFee | TotalParkingFee | IsCorporation |\n|------------|------------------|-----------------|-----------------|-----------------|-----------------|---------------|\n| 1          | corporation      | 1500.00         | 1200.00         | 800.00          | 500.00          | Yes           |\n\n\n#### 2. List which pilots who are also customers made the most take-offs and landings at the airport in February 2024 and indicate which aircraft they flew by type and registration number.\nThis helps identify the most active pilots and the aircraft they use.\n\n```sql\nSELECT \n    P.PilotID, \n    C.CustomerID, \n    A.AircraftType, \n    A.RegistrationNumber, \n    COUNT(FR.FlightRecordID) AS NumberOfFlights\nFROM \n    Pilot P\nJOIN \n    Customer C ON P.PersonID = C.PersonID\nJOIN \n    Flight_Record FR ON P.PilotID = FR.PilotID\nJOIN \n    Aircraft A ON FR.AircraftRegistrationNumber = A.RegistrationNumber\nWHERE \n    FR.TakeOffDate BETWEEN '2024-02-01' AND '2024-02-28'\nGROUP BY \n    P.PilotID, C.CustomerID, A.AircraftType, A.RegistrationNumber\nORDER BY \n    NumberOfFlights DESC;\n```\n\n| PilotID | CustomerID | AircraftType | RegistrationNumber | NumberOfFlights |\n|---------|------------|--------------|--------------------|-----------------|\n| 1       | 1          | Jet          | AB123              | 20              |\n| 2       | 2          | Propeller    | CD456              | 15              |\n\n\n#### 3. List the employees (by employee number, name, and role) who are qualified service personnel who performed routine services on all aircraft owned by a specific corporation in February 2024.\nThis provides information about the maintenance personnel who serviced a corporation's aircraft.\n\n```sql\nSELECT \n    E.EmployeeID, \n    E.Name, \n    E.Role, \n    COUNT(MR.ServiceID) AS ServicesPerformed\nFROM \n    Employee E\nJOIN \n    Maintenance_Service_Record MR ON E.PersonID = MR.PersonID\nJOIN \n    Aircraft A ON MR.AircraftRegistrationID = A.RegistrationNumber\nJOIN \n    Customer C ON A.CustomerID = C.CustomerID\nWHERE \n    C.CustomerCategory = 'corporation'\nAND \n    MR.MaintenanceDate BETWEEN '2024-02-01' AND '2024-02-28'\nGROUP BY \n    E.EmployeeID, E.Name, E.Role\nORDER BY \n    ServicesPerformed DESC;\n```\n\n| EmployeeID | Name       | Role            | ServicesPerformed |\n|------------|------------|-----------------|-------------------|\n| 1          | John Doe   | Technician      | 10                |\n| 2          | Jane Smith | Maintenance Lead| 8                 |\n\n\n#### 4. From the previous list, list all the parts used in a service per aircraft type, part number and part name.\nThis details the parts used during the services performed on the corporation's aircraft.\n\n```sql\nSELECT \n    A.AircraftType, \n    P.PartNumber, \n    P.PartName, \n    SUM(MP.Quantity) AS TotalQuantity\nFROM \n    Maintenance_Parts MP\nJOIN \n    Parts P ON MP.PartID = P.PartID\nJOIN \n    Maintenance_Service_Record MR ON MP.MaintenanceID = MR.ServiceID\nJOIN \n    Aircraft A ON MR.AircraftRegistrationID = A.RegistrationNumber\nJOIN \n    Customer C ON A.CustomerID = C.CustomerID\nWHERE \n    C.CustomerCategory = 'corporation'\nAND \n    MR.MaintenanceDate BETWEEN '2024-02-01' AND '2024-02-28'\nGROUP BY \n    A.AircraftType, P.PartNumber, P.PartName;\n\n```\n\n| AircraftType | PartNumber | PartName       | TotalQuantity |\n|--------------|------------|----------------|---------------|\n| Jet          | PN123      | Hydraulic Pump | 5             |\n| Propeller    | PN456      | Propeller Blade| 10            |\n\n\n#### 5. List the names of all aircraft by type, model, and registration number that landed and were refuelled and/or parked and/or cleaned in February 2024 and the total revenue per aircraft and the total revenue to Biggin Hill for that month.\nThis summarizes the aircraft activities and the generated revenue.\n\n```sql\nSELECT \n    A.AircraftType, \n    A.ModelNumber, \n    A.RegistrationNumber, \n    SUM(CASE WHEN FR.FlightRecordID IS NOT NULL THEN 1 ELSE 0 END) AS Flights,\n    SUM(FR.LandingFee) AS TotalLandingFee, \n    SUM(SR.ServiceFee) AS TotalServiceFee, \n    SUM(FR.FuelingFee) AS TotalFuelingFee, \n    SUM(PR.ParkingFee) AS TotalParkingFee,\n    SUM(FR.LandingFee + SR.ServiceFee + FR.FuelingFee + PR.ParkingFee) AS TotalRevenue\nFROM \n    Aircraft A\nLEFT JOIN \n    Flight_Record FR ON A.RegistrationNumber = FR.AircraftRegistrationNumber\nLEFT JOIN \n    Service_Fee SR ON FR.FlightRecordID = SR.FlightRecordID\nLEFT JOIN \n    Fueling_Fee FRF ON FR.FlightRecordID = FRF.FlightRecordID\nLEFT JOIN \n    Parking_Fee PR ON FR.FlightRecordID = PR.FlightRecordID\nWHERE \n    FR.TakeOffDate BETWEEN '2024-02-01' AND '2024-02-28'\nGROUP BY \n    A.AircraftType, A.ModelNumber, A.RegistrationNumber;\n```\n\n| AircraftType | ModelNumber | RegistrationNumber | Flights | TotalLandingFee | TotalServiceFee | TotalFuelingFee | TotalParkingFee | TotalRevenue |\n|--------------|-------------|--------------------|---------|-----------------|-----------------|-----------------|-----------------|--------------|\n| Jet          | J123        | AB123              | 5       | 500.00          | 300.00          | 200.00          | 100.00          | 1100.00      |\n| Propeller    | P456        | CD456              | 3       | 300.00          | 200.00          | 100.00          | 50.00           | 650.00       |\n\n\n\n### Data Definitions and Normalization\n\nThis document provides detailed data definitions for all entities and explains how the database design adheres to the principles of normalization.\n\n## Conclusion\n\nThis project aims to design and implement a comprehensive system for managing airport operations within Biggin Hill Airport. By following the structured approach of defining the schema, creating the database, and inserting mock data, the project demonstrates how to manage and analyze airport operations effectively. The SQL queries provide valuable insights and analytics for IT management, ensuring that all operations comply with the airport's policies and are efficiently managed.\n\nFor any further information or questions, please refer to the detailed documentation and scripts included in this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddhant2105s%2Fairman-database-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiddhant2105s%2Fairman-database-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddhant2105s%2Fairman-database-system/lists"}