== Relational Mapping - Relational Schema and DDL == === Notation === 1. Relations are denoted as: `CAPITALIZED LETTERS`(attr₁, attr₂, ..., attrₙ), for a relation with 𝑛 attributes. 2. Primary key attributes are **__underscored and bolded__**. 3. Foreign key attributes have an asterisk * prefixed before them. __Note: Some foreign key attributes have the table they are referencing right after them to clarify this.__ === Relations - Relational Schema === `ACCOUNT`(__**email**__, name, surname, password) `TRANSPORT_ORGANIZER`(__***account_email**__ (`ACCOUNT`), company_name, company_embg) `ADMIN`(__***account_email**__ (`ACCOUNT`)) `STUDENT`(__***account_email**__ (`ACCOUNT`), university, index) `DRIVER`(__***account_email**__ (`ACCOUNT`), years_experience, *company (`TRANSPORT_ORGANIZER`)) `VEHICLE`(__**plate_num**__, model, brand, capacity, year_manuf) `AUTOMOBILE`(__***plate_num**__ (`VEHICLE`)) `TRAIN`(__***plate_num**__ (`VEHICLE`)) `BUS`(__***plate_num**__ (`VEHICLE`)) `VAN`(__***plate_num**__ (`VEHICLE`)) `VEHICLE_OPERATION`(__***driver**__, __***vehicle**__) `TRIP`(__**trid_id**__, __***transport_organizer**__, __***route**__, free_seats, date, status) `DRIVES_ON`(__***driver**__, __***trip**__) `ROUTE`(__**id**__, *transport_organizer, *from_loc (`LOCATION`), *to_loc (`LOCATION`)) `DAY_ACTIVE`(__***route**, __**day**__) `LOCATION`(__**latitude**__, __**longitude**__, __**time**__, name) `TRIP_STOPS`(__***trip**__, __***location**__, at_time) `TICKET`(__**id**__, *for_trip (`TRIP`), *linked_with (`TICKET`), *gets_on_loc (`LOCATION`), *gets_off_loc (`LOCATION`), *payment, *account, *review, date_purchased, time_purchased, price, seat, two_way) `STUDENT_TICKET`(__***ticket_id**__ (`TICKET`), discount) `CHILD_TICKET`(__***ticket_id**__ (`TICKET`), discount, embg, parent_embg) `PAYMENT`(__**payment_id**__, __***by_account**__ (`ACCOUNT`), date, total_price, n_tickets) `FAVORITE`(__***route**__, __***account**__) `REVIEW`(__**review_id**__, __***account**__, *ticket, description, rating) == DDL - Creation and Deletion of Tables == == Relational Schema Diagram ==