![](https://static.wixstatic.com/media/ac6ac8_1a4dc8a777104b779ab9335f0935468b~mv2.jpeg/v1/fill/w_980,h_680,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/ac6ac8_1a4dc8a777104b779ab9335f0935468b~mv2.jpeg)
Reverse Engineering a SQL Database
This project involves the reverse engineering of a database from a business problem about a hotel revenue management system.
Introduction
This project requires the identification of entities, their relationships, cardinalities, and attributes from the provided text. Solutions proposed must include assumptions made, and an E-R diagram of the relationships and their flows for each pair must be created. The SQL DDL will be used to set up the database's data types and key constraints, and a set of scenarios must be provided where SQL queries satisfy the business goals.
Overview
In creating the logical design for the Hotel chain problem, we started by creating an entity for the hotels. We focused on making sure the database complied with the normalization forms, especially the first one, by creating a granular database with atomic values. We also respected the second normal form by creating entities with only one primary key and avoiding partial dependencies. Test data was added to each table using insert statements, and NULL and NOT NULL constraints were specified to avoid insert anomalies. An E-R diagram of the database is also provided.
The physical database was created in R Studio using the package RSQLite. The full project containing all of our reporting can be seen on my GitHub.
Project Gallery
![](https://static.wixstatic.com/media/ac6ac8_1fe98ae7dbda4b23929d484609e95e02~mv2.png/v1/fill/w_450,h_450,q_90/ac6ac8_1fe98ae7dbda4b23929d484609e95e02~mv2.png)
![](https://static.wixstatic.com/media/ac6ac8_ebb120b89aea414cba5c763d08ba3221~mv2.png/v1/fill/w_450,h_204,q_90/ac6ac8_ebb120b89aea414cba5c763d08ba3221~mv2.png)
![](https://static.wixstatic.com/media/ac6ac8_b7204f231d8c4efaba6a994ca60e9eea~mv2.jpg/v1/fill/w_450,h_450,q_90/ac6ac8_b7204f231d8c4efaba6a994ca60e9eea~mv2.jpg)