Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 19

#LifeKoKaroLift

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 Science Certification 3


Revision

We have previously covered the following concepts in our study of Database


Management Systems:

● 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

● Semantic constraints are a set of restrictions on the values present in a


column of a database table, which ensure that the data in the table is
accurate and consistent.

● These constraints impose additional limitations on the data values, thus


preventing the entry of incorrect data into the table.

● 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

● SQL is an acronym for Structured Query Language and can be referred to as


a domain-specific language (DSL) in certain applications.

● The language is used to manage and manipulate data in relational database


management systems (RDBMS).

● SQL provides the ability to


○ create,
○ manipulate,
○ delete and
○ share data.
Introduction to SQL

Why should you learn SQL?

● SQL is a language used for managing and manipulating data in a relational


database management system (RDBMS).

● It is supported by many modern database systems, including Oracle, MySQL,


and SQL Server. Learning SQL is beneficial because it is a language-agnostic
and easy-to-understand language.
Introduction to SQL

● RDBMS is a type of database management system that stores data in tables


that are related to each other.

● 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

● Here are the top 10 relational database management systems (RDBMS):

○ Microsoft SQL Server (MS SQL)


○ MySQL
○ Oracle Database
○ IBM Db2
○ PostgreSQL
○ Amazon Aurora
○ Amazon Relational Database Service (RDS)
○ SAP HANA
○ IBM Informix
○ MariaDB
Introduction to SQL

● MySQL was chosen among the list of the most popular RDBMS systems
because

○ it is free and open-source,

○ it provides all the features of an RDBMS and

○ 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.

● Social networking sites: RDBMS is used to maintain relationships between different


entities on social networking sites, which allows platforms like Meta to suggest mutual
friends.

● 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?

A) To make SQL more difficult to learn


B) To store data in a non-relational format
C) To preserve relationships within the data
D) To limit the types of queries that can be run on the database
Key Takeaway

● Semantic Constraints
● Comprehension: ERD
● Introduction to SQL

Data Science Certification 18


#LifeKoKaroLift

Thank You!

19

You might also like