Lecture 1 Intro To DBMS and Bigquery
Lecture 1 Intro To DBMS and Bigquery
LECTURE 1
-By Jahanvee Narang
AGENDA
• Schema Design
• RDBMS
• Datawarehouse
• GCP and BigQuery
• Concept of Keys
• Types of Relationships
Presentation title 3
PROBLEM STATEMENT
• Reliance Fresh has recently decided to open big stores where vendors can directly sell their
produce from their stores.
• Your manager reaches out to you and gives you a DB schema of the backend system that
looks like COMPLEX and asks you to derive all the customer and product-related insights
from this schema?
Presentation title 6
DATABASE SCHEMA
7
•What is a DB schema?
1. MySQL: MySQL is an open-source RDBMS that is widely used in web applications. It provides high performance,
reliability, and scalability
2. Oracle: Oracle is a commercial RDBMS that is widely used in large enterprises. It provides advanced features such
as high availability, security, and performance tuning
3. Microsoft SQL Server: Microsoft SQL Server is a commercial RDBMS that is widely used in the Microsoft Windows
environment. It provides support for transaction processing, business intelligence, and data analysis
4. PostgreSQL: PostgreSQL is an open-source RDBMS that supports SQL and provides advanced features such as
support for JSON, XML, and geospatial data
5. SQLite: SQLite is an open-source RDBMS that is widely used in embedded systems and mobile applications. It
provides a lightweight, fast, and reliable way to store and manage data
Presentation title 15
DATABASE SCHEMA
Presentation title 16
DATABASE SCHEMA
Each of this
represents
tables
j1
It also includes
datatype of
each column
Slide 16
j1 https://www.w3schools.com/sql/sql_datatypes.asp
jahanvee, 3/16/2023
WHAT IS DATABASE SCHEMA? 17
• You would need a blueprint that specifies the number of rooms, the layout,
the electrical and plumbing systems, and other details. The blueprint would
provide a guide for the construction workers to follow.
A data warehouse is a large, centralized repository of data that is specifically designed to support business intelligence activities such as
reporting, analysis, and decision-making. Think of it as a massive storage unit for information that has been collected from various sources
within an organization.
Subset of
Datawarehouse to serve
specific business
function or department
LET’S PROCEED
TO GCP
GCP, or Google Cloud Platform, is a cloud computing platform that
provides a wide range of services for building, deploying, and managing
applications and infrastructure in the cloud
It allows users to store and query large amounts of data quickly and
easily using SQL-like queries.
22
Presentation title 23
STRUCTURE IN GCP
KEYS
Keys help you identify any data row in a table.
• Foreign Key: A foreign key is fields in one table that refers to the primary
key of another table. It is used to establish a relationship between two
tables and enforce referential integrity.
Identify the foreign key of each table: Orders table has CustomerID as the foreign
key that refers to the Customers table's CustomerID column. OrderDetails table has
OrderID as the foreign key that refers to the Orders table's OrderID column
-> {Foreign key may have name other primary key and can be null and no
restriction to be unique}
• Unique Key: A unique key is like a license plate number. Just as every car
has a unique license plate number, every record in a table with a unique
key has a unique identifier that distinguishes it from all other records.
-> {Unique key can have multiple unique keys and can contain null values}
RELATIONSHIPS IN SCHEMA
•One-to-One Relationship:
• In such cases only, a unique row in Table A will be related to one
and only one unique row in Table B.
• Example - marriage between husband and wife.
•One-to-Many Relationship:
• In such cases a single unique row in table A is related to only
multiple rows of Table B.
• Example - company gives employment to employees
•Many-to-One Relationship:
• In such cases many rows in table A are related to only one unique
row of Table B.
• Example - many students can enroll in only one single university.
•Many-to-Many Relationship:
• In such cases many rows in table A are related to many rows of
Table B.
• Example - student course enrollment relationship between
students and Courses offered by university. As many students can
enroll for many courses.
28
RELATIONSHIPS IN SCHEMA
One to many
THANK YOU
- Jahanvee Narang