{"id":21089074,"url":"https://github.com/touradbaba/airbnb_datamart","last_synced_at":"2026-05-19T17:41:11.463Z","repository":{"id":223170702,"uuid":"759502938","full_name":"TouradBaba/AirBnB_DataMart","owner":"TouradBaba","description":"Data Mart designed for an Airbnb-like platform.","archived":false,"fork":false,"pushed_at":"2024-11-16T18:22:23.000Z","size":712,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T00:49:44.397Z","etag":null,"topics":["data-mart","data-modeling","database-design","database-schema","eer-diagram","mysql","relational-databases","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TouradBaba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-02-18T19:07:06.000Z","updated_at":"2024-11-16T18:22:26.000Z","dependencies_parsed_at":"2024-11-16T21:18:24.188Z","dependency_job_id":null,"html_url":"https://github.com/TouradBaba/AirBnB_DataMart","commit_stats":null,"previous_names":["touradbaba/airbnb_datamart"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TouradBaba%2FAirBnB_DataMart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TouradBaba%2FAirBnB_DataMart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TouradBaba%2FAirBnB_DataMart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TouradBaba%2FAirBnB_DataMart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TouradBaba","download_url":"https://codeload.github.com/TouradBaba/AirBnB_DataMart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243532551,"owners_count":20306155,"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-mart","data-modeling","database-design","database-schema","eer-diagram","mysql","relational-databases","sql"],"created_at":"2024-11-19T21:23:01.114Z","updated_at":"2026-05-19T17:41:11.456Z","avatar_url":"https://github.com/TouradBaba.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Airbnb-Like Platform DataMart Project\n\n---\n\n## Abstract\n\nThis document provides an overview of a comprehensive data mart designed for a dynamic platform similar to Airbnb. The system is engineered to enhance user experiences for hosts, guests, and administrators by efficiently managing listings, bookings, payments, reviews, user ratings, and property statistics. Leveraging various database features such as triggers, events, and automation mechanisms, this system streamlines operations, reduces manual data entry, and provides real-time information.\n\n---\n\n## Enhanced Entity-Relationship (EER) Diagram\n\n![EER Diagram](./EER%20Diagram/EER%20Diagram%20(Enhanced%20Entity%20Relationship%20Diagram).png)\n\n- Refer to the included EER diagram files in the `EER Diagram` folder. The folder contains both an image (`EER Diagram (Enhanced Entity Relationship Diagram).png`) and a PDF (`EER Diagram.pdf`) for a visual representation of the database structure. The PDF file provides a clearer resolution compared to the image.\n\n---\n\n## Triggers\n\nThe system incorporates several triggers to respond to specific events, including:\n\n1. **CalculateExpectedIncome Trigger:** Calculates expected income and occupancy rates for properties after creation.\n2. **UpdatePropertyCount Trigger:** Keeps hosts informed about the number of properties they manage.\n3. **CalculateTotalPriceAndCommissions Trigger:** Ensures accurate pricing for bookings by calculating total prices, host commissions, and guest commissions.\n4. **OccupancyRate Trigger:** Dynamically updates property occupancy rates based on booking and availability data.\n5. **UpdateBookingCount Trigger:** Maintains a count of a guest's bookings, facilitating user management.\n6. **PropertyAvailability Trigger:** Ensures properties are marked as 'Booked' for relevant dates in the PropertyAvailability table.\n7. **CalculateTotalAmount Trigger:** Aids in precise financial transactions by calculating the total amount, including guest commissions.\n8. **SetStatus Trigger:** Establishes the payment status of a transaction based on the success of the payment procedure.\n9. **UpdateBookingStatusOnPayment Trigger:** Updates booking statuses to 'Booked' or 'Failed' upon successful or failed payments.\n10. **UpdatePropertyAverageRating Trigger:** Keeps property ratings up-to-date based on user reviews.\n11. **UpdateUserAverageRating Trigger:** Maintains user ratings by calculating the average ratings for each user.\n\n---\n\n## Events\n\nAutomated events further enhance the system's efficiency:\n\n- **automate_host_payments Event:** Processes guest arrivals older than 24 hours and marks bookings as processed every second.\n- **AutoInsertReservations Event:** Inserts reservations for bookings with a 'Booked' status every minute.\n- **UpdatePhoneNumbers Event:** Ensures phone numbers include country codes every minute.\n\n---\n\n## Metadata\n\nThe database comprises 39 tables, covering various aspects of the platform.\n\n---\n\n## Installation Manual\n\n### Prerequisites\n\n- Install [MySQL Workbench](https://www.mysql.com/products/workbench/).\n\n### Database Setup\n\n1. **Create Database:**\n   - Open MySQL Workbench.\n   - Open a Local instance.\n   - Execute the following SQL script:\n\n```sql\nCREATE DATABASE AirBnB_Project;\n```\n\n2. **Run Data Mart Script:**\n   - Run the SQL script named `Data Mart.sql` using MySQL Workbench or any MySQL-compatible tool.\n   - This script includes necessary tables, triggers, events, and initial data for the AirBnB_Project database.\n\n3. **Insert Test Data:**\n   - Utilize the SQL INSERT File `SQL INSERT File.sql` to insert sample rows into tables for testing purposes.\n\n### Note on Compatibility\n\n- The database scripts are optimized for MySQL Workbench. Using other database management systems may require adjustments.\n\n### Uninstallation\n\n- To uninstall the database, use the following query:\n\n```sql\nDROP DATABASE AirBnB_Project;\n```\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftouradbaba%2Fairbnb_datamart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftouradbaba%2Fairbnb_datamart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftouradbaba%2Fairbnb_datamart/lists"}