A production-grade PostgreSQL relational database modelling Ethiopian domestic airline operations. Fully redesigned from MySQL V1 (10 tables) into a 31-table PostgreSQL V2 system covering flight operations, passenger management, ticketing, Ethiopian payment providers, baggage tracking, crew operations, aircraft maintenance, and administration.
| Feature | V1 MySQL | V2 PostgreSQL |
|---|---|---|
| Tables | 10 | 31 |
| Airlines | 4 mixed countries | 6 Ethiopian only |
| Airports | 7 | 25 Ethiopian |
| Payments | None | 10 Ethiopian providers |
| Ticketing | None | Ticket + Boarding Pass |
| Baggage | None | Full tracking history |
| Maintenance | None | Aircraft maintenance logs |
| Audit logging | None | JSONB audit trail |
| Views | None | 5 reporting views |
| Functions | None | 2 PL/pgSQL functions |
| Triggers | None | 3 automated triggers |
| Phase | Tables |
|---|---|
| 1 β Core Foundation | Airline, Airport, Aircraft, FlightRoute, FlightSchedule, Flights |
| 2 β Passenger System | Student, Passenger, Role, UserAccount |
| 3 β Booking Engine | Bookings, Seat, SeatAssignment |
| 4 β Ticketing | Ticket, BoardingPass |
| 5 β Payments | Discount, PaymentMethod, Payment, Invoice, Refund |
| 6 β Baggage | Baggage, BaggageTracking |
| 7 β Crew Operations | CrewMembers, CrewAssignment, CrewTraining |
| 8 β Maintenance | AircraftMaintenance, MaintenanceSchedule |
| 9 β Flight Monitoring | Terminal, Gate, FlightStatus |
| 10 β Administration | Notification, AuditLog |
6 Ethiopian Airlines: Ethiopian Airlines (ET) Β· Abyssinian Flight Services (AN) Β· Trans Nation Airways (TT) Β· National Airways Ethiopia (9Y) Β· AberdAir (AR) Β· East African Aviation
25 Ethiopian Airports: ADD Β· DIR Β· BJR Β· AWA Β· MQX Β· GDQ Β· JIM Β· AMH Β· LLI Β· AXU Β· JIJ Β· ASO Β· GMB Β· SHC Β· GOB Β· DSE Β· DBM Β· SZE Β· BCO Β· DEM Β· FNH Β· DBT Β· ETE Β· BEI Β· and new Addis Ababa mega-airport (planned)
10 Payment Methods: Telebirr Β· CBE Birr Β· Awash Birr Β· Amole Β· M-Pesa Ethiopia Β· Dashen Super App Β· Visa Β· Mastercard Β· Bank Transfer Β· Cash
Database-Project/
β
βββ sql/
β βββ airlines_v2_full.sql β Full schema + sample data
β βββ queries.sql β Advanced analytical queries
β
βββ docs/
β βββ ERD-v2.png β Entity Relationship Diagram
β βββ Database-Diagram-v2.png
β
βββ screenshots/
β βββ queries.png
β
βββ README.md
Requirements: PostgreSQL 14+
# Clone the repo
git clone https://github.com/gemachistesfaye/Database-Project.git
cd Database-Project
git checkout v2
# Create database
psql -U postgres -c "CREATE DATABASE airlines_db;"
# Run full schema
psql -U postgres -d airlines_db -f sql/airlines_v2_full.sql
# Verify β should show 31 tables
psql -U postgres -d airlines_db -c "\dt"5 Views
SELECT * FROM vw_active_bookings;
SELECT * FROM vw_revenue_by_route;
SELECT * FROM vw_student_discounts;
SELECT * FROM vw_aircraft_utilization;
SELECT * FROM vw_crew_schedule;2 Functions
-- Fare with student discount applied
SELECT calculate_fare(4500.00, '1100/17');
-- Available seats on a flight
SELECT * FROM check_seat_availability(1, 'Economy');3 Triggers
- Auto-create ticket when booking confirmed
- Auto-write audit log on every booking change
- Auto-send notification on new booking
| Version | Database | Tables | Description |
|---|---|---|---|
| v1.0.0 | MySQL | 10 | Academic group project β Haramaya University |
| v2.0.0 | PostgreSQL | 31 | Full redesign β portfolio project |
Gemachis Tesfaye Haramaya University Β· College of Computing and Informatics Department of Information Science