Professional Documents
Culture Documents
Database Design and Introduction To MySQL Day - 2
Database Design and Introduction To MySQL Day - 2
AI-ML
1
Module Name: Database
Design and Introduction to
MySQL
Course : DBMS
Edit Master text styles
Lecture On : Database
Design and Introduction to
MySQL - Day - 2
Instructor :
2
Today’s Agenda
● Revision
● Semantic Constraints
● Comprehension: ERD
● Introduction to SQL
● Key Takeaways
● Data Warehousing
● ERD (Entity Relationship Diagram)
● Star and Snowflake Schemas
● OLAP (Online Analytical Processing) vs OLTP (Online Transactional
Processing)
● Entity Constraints
● Referential Constraints
Semantic Constraints
● Imagine that you work for Tata Motors and have been tasked with analyzing
data on car model prices, with the acceptable range being between ₹2 lakh
and ₹12 lakh for middle-class households.
● However, you come across a car model priced at one crore, which could
negatively impact your analysis and lead to misleading insights.
● To prevent such outliers from affecting your data, what can you do to
ensure that they are eliminated from your analysis?
Semantic Constraints
● For instance,
○ If a column is intended to store phone numbers with a country code, a
semantic constraint may be applied to ensure that all phone numbers
in the column have the required number of digits after the country
code.
Comprehension – ERD
● Suppose you're working with a dataset from a college that includes four
main tables:
● Student: This table contains data on students, including their student ID,
name, exam scores, graduation year, and branch ID.
Comprehension – ERD
● Branch: This table lists the various branches offered by the college, such as
electrical, civil, mechanical, chemical, computer science, etc., along with their
respective branch IDs.
● HoD: This table provides information on the HoDs of the different branches. The
information includes the HoD's name, length of service as an HoD, the branch ID of
the branch where they are/were serving as an HoD, and their contact information.
Comprehension – ERD
● Marks: This table shows the range of grades corresponding to the assigned
grades.
Comprehension – ERD
● The following entries can be used as examples for each of the table formats
mentioned above.
Introduction to SQL
● This model follows a relational structure that maintains the relationships within
the data.
● By using RDBMS, we can store and access data in an organized way, which
can be useful in cases where the data is interlinked.
Introduction to SQL
● MySQL was chosen among the list of the most popular RDBMS systems
because
○ has a wide user community that can provide guidance and support.
Introduction to SQL
● RDBMS finds its applications in several industries, such as:
● Banking sector: The ACID properties of RDBMS make it ideal for managing complex
transactional operations in the banking sector.
● E-commerce websites: Companies like Amazon and Flipkart use RDBMS to store and
manage product data and relations, which helps with operations such as product
categorization and association rule mining.
● To perform SQL queries, you will need to download MySQL workbench and server,
which are freely available and supported by a wide user community. Installation guide is
also available on the platform to assist with the installation process.
Poll Question
Q. What is the purpose of an RDBMS in SQL?
● Semantic Constraints
● Comprehension: ERD
● Introduction to SQL
Thank You!
19