SlideShare a Scribd company logo
DATABASE CONCEPTS
1
E-CONTENT PREPARATION FOR
CLASS XI
CHAPTER- 7
DATABASE
� A database is a collection of interrelated data.
� It can serve multiple applications.
� It is computer based recordkeeping system.
� It not only allows to store but also allows us
modification of data as per requirements.
2
FILE SYSTEM
� A file can be understood as a container to store
data in a computer. Files can be stored on the
storage device of a computer system. Contents of a
file can be texts, computer program code, comma
separated values (CSV), etc. Likewise, pictures,
audios/videos, web pages are also files.
� Files stored on a computer can be accessed
directly and searched for desired data.
� But one has to write computer programs for efficient
access of data from files.
3
DBMS
� DBMS refers to Database Management System
� It is a software that can be used for creating,
storing, manipulating, maintaining and retrieving
data from database by users or application
programs.
� The DBMS serves as an interface between the
database and end users or application programs.
� Some examples of open source and commercial
DBMS include MySQL, Oracle, PostgreSQL, SQL
Server, Microsoft Access, MongoDB.
4
NEED OF DBMS
File system becomes difficult to handle when number
of files increases and volume of data also grows.
Following are some of the advantages of database:
� Database reduces redundancy
Redundancy means same data are duplicated in
different places (files). It removes redundancy as the
data are stored at one place and all the application
refers to the centrally maintained database.
� Database controls inconsistency
Data inconsistency occurs when same data maintained
in different places do not match. By controlling
redundancy, the inconsistency is also controlled.
� Database facilitates sharing of data
Data stored in the database can be shared among
several users.
5
NEED OF DBMS
� Database ensures security
Data are protected against accidental or intentional
disclosure to unauthorized person or unauthorized
modification.
� Database maintains integrity
It enforces certain integrity rules to ensure the
validity or correctness of data.
� Database enforces standard
Database is maintained in a standard format which
helps data interchange or migration of data
between two systems.
6
KEY CONCEPTS IN DBMS
� Database Schema
▪ Database Schema is the design of a database.
▪ Database schema is also called the visual or logical
architecture as it tells us how the data are organised in
a database.
� Data Constraint
▪ It is certain restrictions or limitations on data to ensure
its validity and consistency.
� Meta-data or Data Dictionary
▪ The database schema along with various constraints on
the data is stored by DBMS in a database catalogue or
dictionary, called meta-data.
▪ A meta-data is data about the data.
7
KEY CONCEPTS IN DBMS
� Database Instance
The state or snapshot of the database at any given time
is the database instance
� Database Query
A query is a request to a database for obtaining
information in a desired way.
� Data Manipulation
▪ Modification of database
▪ It consists of three operations viz. Insertion, Deletion or
Updating.
� Database Engine
▪ Database engine is the underlying component or set of
programs used by a DBMS 8
RELATIONAL DATA MODEL
� In a relational database model, data is organized
into tables (i.e. rows and columns).
� These tables are also known as relations.
� A row in a table represents relationship among a
set of values.
� A column represents the field/attributes related to
relation under which information will be stored.
� For example: If we want to store the details of
students then Roll_No, Class, Section etc. will be
the column/attributes and the collection of all the
column data will become a Row/Attribute. 9
COMPONENTS COMPRISING A TABLE
� Data Item: smallest unit of named data. It represent
one type of information and often referred to as a
field or column information
� Record: collection of data items which represent a
complete unit of information
� Table: collection of all Rows and Columns.
10
COMMONLY USED TERMINOLOGIES IN
RELATIONAL DATA MODEL
The Relational Model was developed by E. F. Codd of
the IBM in 1970 and is the most widely used Database
Model.
� Relation / Table
A Relation/Table is a tabular structure arranged in
rows and columns. It has the following properties:
▪ All items in a column are homogeneous i.e. they are of
the same data type
▪ Each column is assigned a unique name and has an
atomic(indivisible) value.
11
COMMONLY USED TERMINOLOGIES IN RELATIONAL
DATA MODEL
▪ No attribute can have many data values in one
tuple .
▪ All rows of a relation are distinct i.e. no two identical
rows are present in a relation.
▪ Ordering of rows or columns are immaterial.
▪ A special value “NULL” is used to represent values
that are unknown or non-applicable to certain
attributes.
12
COMMONLY USED TERMINOLOGIES IN
RELATIONAL DATA MODEL
� Domain
It is a set of values from which an attribute can take a value in
each row. Usually, a data type is used to specify domain for
an attribute.
� Tuple / Entity / Record
Each row of data in a relation (table) is called a tuple.
� Attribute / Field
The columns of a relation are the attributes which are also
referred as fields.
� Degree
The number of attributes in a relation is called the Degree of
the relation
� Cardinality
The number of tuples in a relation is called the Degree of the
relation 13
DATABASE TABLE/RELATION
ROLL NAME CLASS
01 VIJETHA 12
02 SINDHU 11
03 GAUTHAMI 12
14
STUDENT
Rows
/
Tuples
Table
/
Relation
Data Item
Records
Table/Relation
Name
Columns / Attributes
KEYS IN A RELATIONAL DATABASE
The tuples within a relation must be distinct. It
means no two tuples in a table should have same
value for all attributes. That is, there should be at
least one attribute in which data are distinct
(unique) and not NULL. That way, we can uniquely
distinguish each tuple of a relation. So, relational
data model imposes some restrictions or
constraints on the values of the attributes and how
the contents of one relation be referred through
another relation. These restrictions are specified
through different types of keys.
15
KEYS IN A RELATIONAL DATABASE
� Primary Key
▪ A set of one or more attribute(s) that can uniquely
identify a record in the relation is called Primary
Key.
▪ There can be only one primary key in a table.
▪ A primary key accepts only distinct (non-duplicate)
values and cannot be left blank.
▪ E.g. Student ID No, Student Admission No, Aadhar
Card No etc. qualifies as Primary Key as the values
of all these are unique.
16
KEYS IN A RELATIONAL DATABASE
� Candidate Key
▪ A table can have one or more attributes that takes
distinct values. Any of these attributes can be used
to uniquely identify the tuples in the relation. Such
attributes are called candidate keys.
▪ A Primary Key is one of the candidate keys.
▪ A table may have more than one candidate keys
but definitely has one and only one primary key.
17
KEYS IN A RELATIONAL DATABASE
� Candidate Key
STUDENT
� In the above given table Stud_ID, Roll_No, Email_ID
can uniquely identify a row in the table and hence they
are candidate keys.
18
Stud_ID Roll_No Name Stream Email_ID
200601 01 Nikitha Science nk@gmail.com
200607 03 Srinidhi Commerce ss@gmail.com
200647 18 Sahana Science sk@gmail.com
Candidate Keys
KEYS IN A RELATIONAL DATABASE
� Composite Primary Key
▪ If no single attribute in a relation is able to uniquely
distinguish the tuples, then more than one attribute are
taken together as primary key. Such primary key
consisting of more than one attribute is called
Composite Primary key.
▪ Here a composite Primary Key (CLASS,SECTION) can
be formed together as either of these column in
isolation cannot be used to uniquely identify each row in
the table.
19
CLASS SECTION TOT_STRENGTH
X A 32
XII A 30
XII B 28
KEYS IN A RELATIONAL DATABASE
� Alternate Keys
▪ Only one of the Candidate keys is selected as the
primary key of a table. All other candidate keys are
called Alternate keys.
▪ A Candidate Key which is not a primary key is an
Alternate Key.
▪ Candidate Keys – Primary Key = Alternate Key(s).
▪ E.g. In the table STUDENT mentioned in Page No.
18, if Stud_ID is selected as the Primary Key then
Roll_No and Email_ID will become the Alternate
Keys.
20
KEYS IN A RELATIONAL DATABASE
� Foreign Key
▪ A foreign key is used to represent the relationship
between two tables.
▪ It is a non-key attribute whose value is derived from
the Primary key of another table.
▪ Foreign key column will check for the presence of
value in Primary key of another table, if present then
only entry will be allowed otherwise data will be
rejected.
21
KEYS IN A RELATIONAL DATABASE
▪ In some cases, foreign key can take NULL value if it
is not the part of primary key of the foreign table.
▪ The table containing the foreign key is called the
child table, and the table containing the candidate
key is called the referenced or parent table.
22
KEYS IN A RELATIONAL DATABASE
23
ORDERS
CUSTOMER
▪ From the above given tables we can observe that the CUST_ID column
of ORDERS table is deriving its value from CUST_ID of CUSTOMER
table. So we can say that the CUST_ID of ORDERS table is a foreign key
whose value is dependent upon the Primary key column CUST_ID of
table CUSTOMER.
ORDER_ID ORDER_NO CUST_ID
1 1255 3
2 1690 3
3 1810 2
4 2210 1
CUST_ID NAME ADDRESS
1 HECTOR MADRID
2 MITCHELLE LONDON
3 AUGUSTA COLARADO
Child Table
Parent
Table
REFERENTIAL INTEGRITY
� The property of a relational database which ensures
that no entry in a foreign key column of a table can
be made unless it matches a primary key value in the
corresponding column of the related table is called
referential integrity.
� It also ensures that the user don’t accidentally delete
or change the related data.
� Referential integrity can be applied when:
▪ The master table’s column is a Primary Key or has a
unique index.
▪ The related fields have the same data type.
▪ Both tables must belong to the same database. 24
REFERENTIAL INTEGRITY
� The following rules must be followed if the referential
integrity is enforced using Foreign Key:
▪ We cannot enter a value in Child Table which is not
present in Master Table’s Primary key column.
However, NULL values can be entered in foreign key.
▪ We cannot delete a record from Master Table if
matching record exists in related table/Child Table.
▪ We cannot modify or change the Primary Key value
in Master table if its matching record is present in
related table/Child Table.
25
THANK YOU
26
Ad

More Related Content

What's hot (20)

1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
koolkampus
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
GirdharRatne
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
sunanditaAnand
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
Shishir Aryal
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational Calculus
Kunal Anand
 
Data warehouse architecture
Data warehouse architectureData warehouse architecture
Data warehouse architecture
pcherukumalla
 
File organization and indexing
File organization and indexingFile organization and indexing
File organization and indexing
raveena sharma
 
Dbms Introduction and Basics
Dbms Introduction and BasicsDbms Introduction and Basics
Dbms Introduction and Basics
SHIKHA GAUTAM
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Arun Sharma
 
Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management System
Ajay Jha
 
9. index and index organized table
9. index and index organized table9. index and index organized table
9. index and index organized table
Amrit Kaur
 
Database and types of database
Database and types of databaseDatabase and types of database
Database and types of database
baabtra.com - No. 1 supplier of quality freshers
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
Chirag vasava
 
Database design (conceptual, logical and physical design) unit 2 part 2
Database design (conceptual, logical and physical design)  unit 2 part 2Database design (conceptual, logical and physical design)  unit 2 part 2
Database design (conceptual, logical and physical design) unit 2 part 2
Ram Paliwal
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System Introduction
Smriti Jain
 
Comandos del-ddl-y-del-dml-liz
Comandos del-ddl-y-del-dml-lizComandos del-ddl-y-del-dml-liz
Comandos del-ddl-y-del-dml-liz
Bolivar Castillo
 
Sql fundamentals
Sql fundamentalsSql fundamentals
Sql fundamentals
Ravinder Kamboj
 
Exception handling in plsql
Exception handling in plsqlException handling in plsql
Exception handling in plsql
Arun Sial
 
Database structure
Database structureDatabase structure
Database structure
Forrester High School
 
Previous question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEBPrevious question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEB
Shabeeb Shabi
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
koolkampus
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
GirdharRatne
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
Shishir Aryal
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational Calculus
Kunal Anand
 
Data warehouse architecture
Data warehouse architectureData warehouse architecture
Data warehouse architecture
pcherukumalla
 
File organization and indexing
File organization and indexingFile organization and indexing
File organization and indexing
raveena sharma
 
Dbms Introduction and Basics
Dbms Introduction and BasicsDbms Introduction and Basics
Dbms Introduction and Basics
SHIKHA GAUTAM
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Arun Sharma
 
Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management System
Ajay Jha
 
9. index and index organized table
9. index and index organized table9. index and index organized table
9. index and index organized table
Amrit Kaur
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
Chirag vasava
 
Database design (conceptual, logical and physical design) unit 2 part 2
Database design (conceptual, logical and physical design)  unit 2 part 2Database design (conceptual, logical and physical design)  unit 2 part 2
Database design (conceptual, logical and physical design) unit 2 part 2
Ram Paliwal
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System Introduction
Smriti Jain
 
Comandos del-ddl-y-del-dml-liz
Comandos del-ddl-y-del-dml-lizComandos del-ddl-y-del-dml-liz
Comandos del-ddl-y-del-dml-liz
Bolivar Castillo
 
Exception handling in plsql
Exception handling in plsqlException handling in plsql
Exception handling in plsql
Arun Sial
 
Previous question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEBPrevious question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEB
Shabeeb Shabi
 

Similar to Database Concepts.pptx (20)

DATABASE-1.pptx
DATABASE-1.pptxDATABASE-1.pptx
DATABASE-1.pptx
ManasRanjanRana4
 
Unit 2 DBMS.pptx
Unit 2 DBMS.pptxUnit 2 DBMS.pptx
Unit 2 DBMS.pptx
ssuserc8e1481
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems inc
Muthu Natarajan
 
Database_Concepts_Final.pptx.pdf for class 12
Database_Concepts_Final.pptx.pdf for class 12Database_Concepts_Final.pptx.pdf for class 12
Database_Concepts_Final.pptx.pdf for class 12
pramodcoder1319
 
DEE 431 Database keys and Normalisation Slide 2
DEE 431 Database keys and Normalisation Slide 2DEE 431 Database keys and Normalisation Slide 2
DEE 431 Database keys and Normalisation Slide 2
YOGESH SINGH
 
DBMS-Unit-2.pptx
DBMS-Unit-2.pptxDBMS-Unit-2.pptx
DBMS-Unit-2.pptx
Abhinayacheekati
 
NMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.pptNMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.ppt
IswaryaPurushothaman1
 
Codds rules & keys
Codds rules & keysCodds rules & keys
Codds rules & keys
Balasingham Karthiban
 
PPT_DBMS.pptx
PPT_DBMS.pptxPPT_DBMS.pptx
PPT_DBMS.pptx
traderbear1
 
Database.pptx
Database.pptxDatabase.pptx
Database.pptx
AftabSaeed5
 
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLESDATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
NathRam2
 
database concepts.pptx
database concepts.pptxdatabase concepts.pptx
database concepts.pptx
slavskrillex
 
Relational Database Management System part II
Relational Database Management System part IIRelational Database Management System part II
Relational Database Management System part II
KavithaA19
 
Relational Model in DBMS detail explanation
Relational Model in DBMS detail explanationRelational Model in DBMS detail explanation
Relational Model in DBMS detail explanation
keerthanaparath1
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
AbhishekSrivastava370395
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
AbhishekSrivastava370395
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database
Rc Os
 
Keerty rdbms sql
Keerty rdbms sqlKeerty rdbms sql
Keerty rdbms sql
Keerty Smile
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
Pradnya Saval
 
RDBMS
RDBMSRDBMS
RDBMS
NIVEETHITHAS
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems inc
Muthu Natarajan
 
Database_Concepts_Final.pptx.pdf for class 12
Database_Concepts_Final.pptx.pdf for class 12Database_Concepts_Final.pptx.pdf for class 12
Database_Concepts_Final.pptx.pdf for class 12
pramodcoder1319
 
DEE 431 Database keys and Normalisation Slide 2
DEE 431 Database keys and Normalisation Slide 2DEE 431 Database keys and Normalisation Slide 2
DEE 431 Database keys and Normalisation Slide 2
YOGESH SINGH
 
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLESDATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
NathRam2
 
database concepts.pptx
database concepts.pptxdatabase concepts.pptx
database concepts.pptx
slavskrillex
 
Relational Database Management System part II
Relational Database Management System part IIRelational Database Management System part II
Relational Database Management System part II
KavithaA19
 
Relational Model in DBMS detail explanation
Relational Model in DBMS detail explanationRelational Model in DBMS detail explanation
Relational Model in DBMS detail explanation
keerthanaparath1
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database
Rc Os
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
Pradnya Saval
 
Ad

Recently uploaded (20)

CS-404 COA COURSE FILE JAN JUN 2025.docx
CS-404 COA COURSE FILE JAN JUN 2025.docxCS-404 COA COURSE FILE JAN JUN 2025.docx
CS-404 COA COURSE FILE JAN JUN 2025.docx
nidarizvitit
 
L1_Slides_Foundational Concepts_508.pptx
L1_Slides_Foundational Concepts_508.pptxL1_Slides_Foundational Concepts_508.pptx
L1_Slides_Foundational Concepts_508.pptx
38NoopurPatel
 
Understanding Complex Development Processes
Understanding Complex Development ProcessesUnderstanding Complex Development Processes
Understanding Complex Development Processes
Process mining Evangelist
 
Controlling Financial Processes at a Municipality
Controlling Financial Processes at a MunicipalityControlling Financial Processes at a Municipality
Controlling Financial Processes at a Municipality
Process mining Evangelist
 
Feature Engineering for Electronic Health Record Systems
Feature Engineering for Electronic Health Record SystemsFeature Engineering for Electronic Health Record Systems
Feature Engineering for Electronic Health Record Systems
Process mining Evangelist
 
Process Mining Machine Recoveries to Reduce Downtime
Process Mining Machine Recoveries to Reduce DowntimeProcess Mining Machine Recoveries to Reduce Downtime
Process Mining Machine Recoveries to Reduce Downtime
Process mining Evangelist
 
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfj
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfjOral Malodor.pptx jsjshdhushehsidjjeiejdhfj
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfj
maitripatel5301
 
Time series for yotube_1_data anlysis.pdf
Time series for yotube_1_data anlysis.pdfTime series for yotube_1_data anlysis.pdf
Time series for yotube_1_data anlysis.pdf
asmaamahmoudsaeed
 
HershAggregator (2).pdf musicretaildistribution
HershAggregator (2).pdf musicretaildistributionHershAggregator (2).pdf musicretaildistribution
HershAggregator (2).pdf musicretaildistribution
hershtara1
 
hersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distributionhersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distribution
hershtara1
 
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm     mmmmmfftro.pptxlecture_13 tree in mmmmmmmm     mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
sarajafffri058
 
report (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhsreport (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhs
AngelPinedaTaguinod
 
problem solving.presentation slideshow bsc nursing
problem solving.presentation slideshow bsc nursingproblem solving.presentation slideshow bsc nursing
problem solving.presentation slideshow bsc nursing
vishnudathas123
 
Sets theories and applications that can used to imporve knowledge
Sets theories and applications that can used to imporve knowledgeSets theories and applications that can used to imporve knowledge
Sets theories and applications that can used to imporve knowledge
saumyasl2020
 
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docxAnalysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
hershtara1
 
Dr. Robert Krug - Expert In Artificial Intelligence
Dr. Robert Krug - Expert In Artificial IntelligenceDr. Robert Krug - Expert In Artificial Intelligence
Dr. Robert Krug - Expert In Artificial Intelligence
Dr. Robert Krug
 
50_questions_full.pptxdddddddddddddddddd
50_questions_full.pptxdddddddddddddddddd50_questions_full.pptxdddddddddddddddddd
50_questions_full.pptxdddddddddddddddddd
emir73065
 
real illuminati Uganda agent 0782561496/0756664682
real illuminati Uganda agent 0782561496/0756664682real illuminati Uganda agent 0782561496/0756664682
real illuminati Uganda agent 0782561496/0756664682
way to join real illuminati Agent In Kampala Call/WhatsApp+256782561496/0756664682
 
Lagos School of Programming Final Project Updated.pdf
Lagos School of Programming Final Project Updated.pdfLagos School of Programming Final Project Updated.pdf
Lagos School of Programming Final Project Updated.pdf
benuju2016
 
Ann Naser Nabil- Data Scientist Portfolio.pdf
Ann Naser Nabil- Data Scientist Portfolio.pdfAnn Naser Nabil- Data Scientist Portfolio.pdf
Ann Naser Nabil- Data Scientist Portfolio.pdf
আন্ নাসের নাবিল
 
CS-404 COA COURSE FILE JAN JUN 2025.docx
CS-404 COA COURSE FILE JAN JUN 2025.docxCS-404 COA COURSE FILE JAN JUN 2025.docx
CS-404 COA COURSE FILE JAN JUN 2025.docx
nidarizvitit
 
L1_Slides_Foundational Concepts_508.pptx
L1_Slides_Foundational Concepts_508.pptxL1_Slides_Foundational Concepts_508.pptx
L1_Slides_Foundational Concepts_508.pptx
38NoopurPatel
 
Controlling Financial Processes at a Municipality
Controlling Financial Processes at a MunicipalityControlling Financial Processes at a Municipality
Controlling Financial Processes at a Municipality
Process mining Evangelist
 
Feature Engineering for Electronic Health Record Systems
Feature Engineering for Electronic Health Record SystemsFeature Engineering for Electronic Health Record Systems
Feature Engineering for Electronic Health Record Systems
Process mining Evangelist
 
Process Mining Machine Recoveries to Reduce Downtime
Process Mining Machine Recoveries to Reduce DowntimeProcess Mining Machine Recoveries to Reduce Downtime
Process Mining Machine Recoveries to Reduce Downtime
Process mining Evangelist
 
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfj
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfjOral Malodor.pptx jsjshdhushehsidjjeiejdhfj
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfj
maitripatel5301
 
Time series for yotube_1_data anlysis.pdf
Time series for yotube_1_data anlysis.pdfTime series for yotube_1_data anlysis.pdf
Time series for yotube_1_data anlysis.pdf
asmaamahmoudsaeed
 
HershAggregator (2).pdf musicretaildistribution
HershAggregator (2).pdf musicretaildistributionHershAggregator (2).pdf musicretaildistribution
HershAggregator (2).pdf musicretaildistribution
hershtara1
 
hersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distributionhersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distribution
hershtara1
 
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm     mmmmmfftro.pptxlecture_13 tree in mmmmmmmm     mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
sarajafffri058
 
report (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhsreport (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhs
AngelPinedaTaguinod
 
problem solving.presentation slideshow bsc nursing
problem solving.presentation slideshow bsc nursingproblem solving.presentation slideshow bsc nursing
problem solving.presentation slideshow bsc nursing
vishnudathas123
 
Sets theories and applications that can used to imporve knowledge
Sets theories and applications that can used to imporve knowledgeSets theories and applications that can used to imporve knowledge
Sets theories and applications that can used to imporve knowledge
saumyasl2020
 
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docxAnalysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
hershtara1
 
Dr. Robert Krug - Expert In Artificial Intelligence
Dr. Robert Krug - Expert In Artificial IntelligenceDr. Robert Krug - Expert In Artificial Intelligence
Dr. Robert Krug - Expert In Artificial Intelligence
Dr. Robert Krug
 
50_questions_full.pptxdddddddddddddddddd
50_questions_full.pptxdddddddddddddddddd50_questions_full.pptxdddddddddddddddddd
50_questions_full.pptxdddddddddddddddddd
emir73065
 
Lagos School of Programming Final Project Updated.pdf
Lagos School of Programming Final Project Updated.pdfLagos School of Programming Final Project Updated.pdf
Lagos School of Programming Final Project Updated.pdf
benuju2016
 
Ad

Database Concepts.pptx

  • 2. DATABASE � A database is a collection of interrelated data. � It can serve multiple applications. � It is computer based recordkeeping system. � It not only allows to store but also allows us modification of data as per requirements. 2
  • 3. FILE SYSTEM � A file can be understood as a container to store data in a computer. Files can be stored on the storage device of a computer system. Contents of a file can be texts, computer program code, comma separated values (CSV), etc. Likewise, pictures, audios/videos, web pages are also files. � Files stored on a computer can be accessed directly and searched for desired data. � But one has to write computer programs for efficient access of data from files. 3
  • 4. DBMS � DBMS refers to Database Management System � It is a software that can be used for creating, storing, manipulating, maintaining and retrieving data from database by users or application programs. � The DBMS serves as an interface between the database and end users or application programs. � Some examples of open source and commercial DBMS include MySQL, Oracle, PostgreSQL, SQL Server, Microsoft Access, MongoDB. 4
  • 5. NEED OF DBMS File system becomes difficult to handle when number of files increases and volume of data also grows. Following are some of the advantages of database: � Database reduces redundancy Redundancy means same data are duplicated in different places (files). It removes redundancy as the data are stored at one place and all the application refers to the centrally maintained database. � Database controls inconsistency Data inconsistency occurs when same data maintained in different places do not match. By controlling redundancy, the inconsistency is also controlled. � Database facilitates sharing of data Data stored in the database can be shared among several users. 5
  • 6. NEED OF DBMS � Database ensures security Data are protected against accidental or intentional disclosure to unauthorized person or unauthorized modification. � Database maintains integrity It enforces certain integrity rules to ensure the validity or correctness of data. � Database enforces standard Database is maintained in a standard format which helps data interchange or migration of data between two systems. 6
  • 7. KEY CONCEPTS IN DBMS � Database Schema ▪ Database Schema is the design of a database. ▪ Database schema is also called the visual or logical architecture as it tells us how the data are organised in a database. � Data Constraint ▪ It is certain restrictions or limitations on data to ensure its validity and consistency. � Meta-data or Data Dictionary ▪ The database schema along with various constraints on the data is stored by DBMS in a database catalogue or dictionary, called meta-data. ▪ A meta-data is data about the data. 7
  • 8. KEY CONCEPTS IN DBMS � Database Instance The state or snapshot of the database at any given time is the database instance � Database Query A query is a request to a database for obtaining information in a desired way. � Data Manipulation ▪ Modification of database ▪ It consists of three operations viz. Insertion, Deletion or Updating. � Database Engine ▪ Database engine is the underlying component or set of programs used by a DBMS 8
  • 9. RELATIONAL DATA MODEL � In a relational database model, data is organized into tables (i.e. rows and columns). � These tables are also known as relations. � A row in a table represents relationship among a set of values. � A column represents the field/attributes related to relation under which information will be stored. � For example: If we want to store the details of students then Roll_No, Class, Section etc. will be the column/attributes and the collection of all the column data will become a Row/Attribute. 9
  • 10. COMPONENTS COMPRISING A TABLE � Data Item: smallest unit of named data. It represent one type of information and often referred to as a field or column information � Record: collection of data items which represent a complete unit of information � Table: collection of all Rows and Columns. 10
  • 11. COMMONLY USED TERMINOLOGIES IN RELATIONAL DATA MODEL The Relational Model was developed by E. F. Codd of the IBM in 1970 and is the most widely used Database Model. � Relation / Table A Relation/Table is a tabular structure arranged in rows and columns. It has the following properties: ▪ All items in a column are homogeneous i.e. they are of the same data type ▪ Each column is assigned a unique name and has an atomic(indivisible) value. 11
  • 12. COMMONLY USED TERMINOLOGIES IN RELATIONAL DATA MODEL ▪ No attribute can have many data values in one tuple . ▪ All rows of a relation are distinct i.e. no two identical rows are present in a relation. ▪ Ordering of rows or columns are immaterial. ▪ A special value “NULL” is used to represent values that are unknown or non-applicable to certain attributes. 12
  • 13. COMMONLY USED TERMINOLOGIES IN RELATIONAL DATA MODEL � Domain It is a set of values from which an attribute can take a value in each row. Usually, a data type is used to specify domain for an attribute. � Tuple / Entity / Record Each row of data in a relation (table) is called a tuple. � Attribute / Field The columns of a relation are the attributes which are also referred as fields. � Degree The number of attributes in a relation is called the Degree of the relation � Cardinality The number of tuples in a relation is called the Degree of the relation 13
  • 14. DATABASE TABLE/RELATION ROLL NAME CLASS 01 VIJETHA 12 02 SINDHU 11 03 GAUTHAMI 12 14 STUDENT Rows / Tuples Table / Relation Data Item Records Table/Relation Name Columns / Attributes
  • 15. KEYS IN A RELATIONAL DATABASE The tuples within a relation must be distinct. It means no two tuples in a table should have same value for all attributes. That is, there should be at least one attribute in which data are distinct (unique) and not NULL. That way, we can uniquely distinguish each tuple of a relation. So, relational data model imposes some restrictions or constraints on the values of the attributes and how the contents of one relation be referred through another relation. These restrictions are specified through different types of keys. 15
  • 16. KEYS IN A RELATIONAL DATABASE � Primary Key ▪ A set of one or more attribute(s) that can uniquely identify a record in the relation is called Primary Key. ▪ There can be only one primary key in a table. ▪ A primary key accepts only distinct (non-duplicate) values and cannot be left blank. ▪ E.g. Student ID No, Student Admission No, Aadhar Card No etc. qualifies as Primary Key as the values of all these are unique. 16
  • 17. KEYS IN A RELATIONAL DATABASE � Candidate Key ▪ A table can have one or more attributes that takes distinct values. Any of these attributes can be used to uniquely identify the tuples in the relation. Such attributes are called candidate keys. ▪ A Primary Key is one of the candidate keys. ▪ A table may have more than one candidate keys but definitely has one and only one primary key. 17
  • 18. KEYS IN A RELATIONAL DATABASE � Candidate Key STUDENT � In the above given table Stud_ID, Roll_No, Email_ID can uniquely identify a row in the table and hence they are candidate keys. 18 Stud_ID Roll_No Name Stream Email_ID 200601 01 Nikitha Science nk@gmail.com 200607 03 Srinidhi Commerce ss@gmail.com 200647 18 Sahana Science sk@gmail.com Candidate Keys
  • 19. KEYS IN A RELATIONAL DATABASE � Composite Primary Key ▪ If no single attribute in a relation is able to uniquely distinguish the tuples, then more than one attribute are taken together as primary key. Such primary key consisting of more than one attribute is called Composite Primary key. ▪ Here a composite Primary Key (CLASS,SECTION) can be formed together as either of these column in isolation cannot be used to uniquely identify each row in the table. 19 CLASS SECTION TOT_STRENGTH X A 32 XII A 30 XII B 28
  • 20. KEYS IN A RELATIONAL DATABASE � Alternate Keys ▪ Only one of the Candidate keys is selected as the primary key of a table. All other candidate keys are called Alternate keys. ▪ A Candidate Key which is not a primary key is an Alternate Key. ▪ Candidate Keys – Primary Key = Alternate Key(s). ▪ E.g. In the table STUDENT mentioned in Page No. 18, if Stud_ID is selected as the Primary Key then Roll_No and Email_ID will become the Alternate Keys. 20
  • 21. KEYS IN A RELATIONAL DATABASE � Foreign Key ▪ A foreign key is used to represent the relationship between two tables. ▪ It is a non-key attribute whose value is derived from the Primary key of another table. ▪ Foreign key column will check for the presence of value in Primary key of another table, if present then only entry will be allowed otherwise data will be rejected. 21
  • 22. KEYS IN A RELATIONAL DATABASE ▪ In some cases, foreign key can take NULL value if it is not the part of primary key of the foreign table. ▪ The table containing the foreign key is called the child table, and the table containing the candidate key is called the referenced or parent table. 22
  • 23. KEYS IN A RELATIONAL DATABASE 23 ORDERS CUSTOMER ▪ From the above given tables we can observe that the CUST_ID column of ORDERS table is deriving its value from CUST_ID of CUSTOMER table. So we can say that the CUST_ID of ORDERS table is a foreign key whose value is dependent upon the Primary key column CUST_ID of table CUSTOMER. ORDER_ID ORDER_NO CUST_ID 1 1255 3 2 1690 3 3 1810 2 4 2210 1 CUST_ID NAME ADDRESS 1 HECTOR MADRID 2 MITCHELLE LONDON 3 AUGUSTA COLARADO Child Table Parent Table
  • 24. REFERENTIAL INTEGRITY � The property of a relational database which ensures that no entry in a foreign key column of a table can be made unless it matches a primary key value in the corresponding column of the related table is called referential integrity. � It also ensures that the user don’t accidentally delete or change the related data. � Referential integrity can be applied when: ▪ The master table’s column is a Primary Key or has a unique index. ▪ The related fields have the same data type. ▪ Both tables must belong to the same database. 24
  • 25. REFERENTIAL INTEGRITY � The following rules must be followed if the referential integrity is enforced using Foreign Key: ▪ We cannot enter a value in Child Table which is not present in Master Table’s Primary key column. However, NULL values can be entered in foreign key. ▪ We cannot delete a record from Master Table if matching record exists in related table/Child Table. ▪ We cannot modify or change the Primary Key value in Master table if its matching record is present in related table/Child Table. 25
  翻译: