Lab: AirBnB Postgres Datamodel
Objective
Build a Star Schema based Data Model in Postgres on the AirBnB dataset
Dataset
Dataset consist of 6 different data files in CSV format, listed below:
- calendar.csv
- listings.csv
- listings_details.csv
- neighbourhoods.csv
- reviews.csv
- reviews_details.csv
Data Ingestion
Steps for uploading one csv into a table inside a database
- Create the Database if not created
- Connect to the Database
- Create the Table using the below sql command inside the database server
CREATE TABLE tableName (var1 varType, var2, varType...);
- Insert the data into the Table row by row using the following SQL command
INSERT INTO tableName (var1, var2 ...) values (val1, val2...);
Repeat the above steps for all the 6 files that I have. Below are the row and column counts of two major CSV file
- listings_details.csv ==> 20,000 ROWS and 90 Column
- reviews_details.csv ==> 413,000 ROWS and 8 Columns