SlideShare a Scribd company logo
Important terms
DATA: Representationof facts,concepts,Instructions
Field: To representaspecificdataelement
Record: collectionof fields
Information: Processeddata
Redundancy: Repetitionof data
DataSemantics.
C I A
DBMS:
Is a collectionof Interrelateddataanda setof procedurestoaccessthat data.
Advantagesof DBMS
 Control of data redundancy
 Data consistency
 More informationfromsame amountof data
 Sharingof data
 Searchcapabilities
 Improveddataintegrity
 Privacyand security
 Economyof scale
 Improvedbackupandrecovery
 Standardscan be maintained(formats)
Instance,SchemaandDatabase state.
 The collectionof informationstoredindatabase ata particularinstantof time iscalledan
instance of database.
 The data in the database at a particulartime iscalledasdatabase state
 Database Schema
A database schema is the skeleton structure that represents the logical view of the
entire database. It defines how the data is organized and how the relations among
them are associated.
DBMS 3- TierArchitecture
It has Three Levels
1. External Schema (User View)
2. Conceptual Schema (Whatdata is storedandthe relationamong thatdata)
3. Internal Schema (How data is storedinthe database)
MappingConstraints:
1. One to One Relationship
2. One to manyFunctions
3. Many to One Relationship
4. Many to many relationship
MCQ
1. The DBMS acts as an interface between what two components of an enterprise-class
database system?
A.Database application and the database
B.Data and the database
C.The user and the database application
D.Database application and SQL
A
The following are components of a database except ________ .
A.user data
B.metadata
C.reports
D.indexes
c
An application where only one user accesses the database at a given time is an example of
a(n) ________ .
A.single-user database application
B.multiuser database application
C.e-commerce database application
D.data mining database application
a
An on-line commercial site such as Amazon.com is an example of a(n) ________ .
A.single-user database application
B.multiuser database application
C.e-commerce database application
D.data mining database application
c
SQL stands for ________ .
A.Structured Query Language
B.Sequential Query Language
C.Structured Question Language
D.Sequential Question Language
a
The following are functions of a DBMS except ________ .
A.creating and processing forms
B.creating databases
C.processing data
D.administrating databases
a
Helping people keep track of things is the purpose of a(n) ________ .
A.database
B.table
C.instance
D.Relationship
a
Data Independence:
The abilitytomodifyaschema definitioninone levelwithoutaffectingaschemadefinitioninthe
nexthigherleveliscalledasdata independence.
Physical Dataindependence:
(Changesinphysical schemawithoutcausingapp.Programstobe rewritten.)
Logical Data Independence:
Changesto conceptual schema,suchaadditionof entryor deletionof new entriesshouldbe
possible withoutaffectingexistingexternalschema.
Data Models:
• Underlyingthe structure of a database isthe Data Model:
A collectionof conceptual toolsfor describingdata,data relationshipsandconsistency
constraints.
• A data model providesawaytodescribe the designof adatabase at the physical,logical and
viewlevel.
The data modelscan be classifiedin4differentcategories:
1. Relational Model
2. The Entity-RelationshipModel
3. Object-BasedDataModel
4. Semi-structuredDataModel
Entity
An entity can be a real-world object, either animate or inanimate, that can be easily
identifiable. For example, in a school database, students, teachers, classes, and courses
offered can be considered as entities. All these entities have some attributes or properties that
give them their identity.
Attributes
Entities are represented by means of their properties, called attributes. All attributes have
values. For example, a student entity may have name, class, and age as attributes.
Types of Attributes
 Simple attribute − Simple attributes are atomic values, which cannot be divided
further. For example, a student's phone number is an atomic value of 10 digits.
 Composite attribute − Composite attributes are made of more than one simple
attribute. For example, a student's complete name may have first_name and
last_name.
 Derived attribute − Derived attributes are the attributes that do not exist in the
physical database, but their values are derived from other attributes present in the
database. For example, average_salary in a department should not be saved directly in
the database, instead it can be derived. For another example, age can be derived from
data_of_birth.
 Single-value attribute − Single-value attributes contain single value. For example −
Social_Security_Number.
 Multi-value attribute − Multi-value attributes may contain more than one values.
For example, a person can have more than one phone number, email_address, etc.
Relationship
The association among entities is called a relationship. For example, an employee works_at a
department, a student enrolls in a course. Here, Works_at and Enrolls are called
relationships.
Entity
Entities are represented by means of rectangles. Rectangles are named with the entity set they
represent.
Imp terms
1. Composite
2. Multivalued (doubleeclipse)
3. Derived (dottedeclipse)
4. DependentEntity
5. WeakEntity
Generalization
Specialization
ER Diagrams
EXAMPLES
Driverdrivesacar
Studentina College:
Studentsina Class:
ConsumerandSupplier
People/Employee inacompany:
CardinalityRatio:
Number of relationship instances in which the entity can participate is defined as Cardinality
Ratio. The possible cardinality ratios are as follows. For the explanation let us consider, there
are two entity sets A and B. :
1. One to one Relationship (1:1) : An entity in A can have relationship with atmost one
entity in B and vice versa. For example, a principal can manage one school and a
school can be managed by just one principal.
2. One to Many Relationship (1:M) : An entity in A can have relationship with zero or
more entities in B while an entity of B can have relationship with only one entity of
A. For example, A batch can have more than one student while a student can be
present in only one batch.
3. Many to One Relationship (M:M) : An entity in A can have relationship with any no
of entities in B and vice versa. For example, An employee can work on more than one
projects and a project can be handles by more than one employee.
Degree:
The degree of relationship (also known as cardinality) is the number of occurrences in one
entity which are associated (or linked) to the number of occurrences in another.
There are three degrees of relationship, known as:
1. one-to-one (1:1)
2. one-to-many (1:M)
3. many-to-many (M:N)
One-to-one (1:1)
This is where one occurrence of an entity relates to only one occurrence in another entity.
A one-to-one relationship rarely exists in practice, but it can. However, you may consider
combining them into one entity.
For example, an employee is allocated a company car, which can only be driven by that
employee.
Therefore, there is a one-to-one relationship between employee and company car.
One-to-Many (1:M)
Is where one occurrence in an entity relates to many occurrences in another entity.
For example, taking the employee and department entities shown on the previous page, an
employee works in one department but a department has many employees.
Therefore, there is a one-to-many relationship between department and employee.
Many-to-Many (M:N)
This is where many occurrences in an entity relate to many occurrences in another entity.
The normalisation process discussed earlier would prevent any such relationships but the
definition is included here for completeness.
As with one-to-one relationships, many-to-many relationships rarely exist. Normally they
occur because an entity has been missed.
For example, an employee may work on several projects at the same time and a project has a
team of many employees.
Therefore, there is a many-to-many relationship between employee and project.
SQL Components:DDLand DML commands
What are database Sub languages?
A data sublanguage mainly has two parts:
 Data Definition Language (DDL) and
 Data Manipulation Language (DML).
Data Definition Language
Data Definition Language (DDL) statements are used to classify the database structure or
schema. It is a type of language that allows the DBA or user to depict and name those
entities, attributes, and relationships that are required for the application along with any
associated integrity and security constraints. Here are the lists of tasks that come under DDL:
 CREATE - used to create objects in the database
 ALTER - used to alters the structure of the database
 DROP - used to delete objects from the database
 TRUNCATE - used to remove all records from a table, including all spaces allocated
for the records are removed
 COMMENT - used to add comments to the data dictionary
 RENAME - used to rename an object
Data Manipulation Language
A language that offers a set of operations to support the fundamental data manipulation
operations on the data held in the database. Data Manipulation Language (DML) statements
are used to manage data within schema objects. Here are the lists of tasks that come under
DML:
 SELECT - It retrieves data from a database
 INSERT - It inserts data into a table
 UPDATE - It updates existing data within a table
 DELETE - It deletes all records from a table, the space for the records remain
 MERGE - UPSERT operation (insert or update)
 CALL - It calls a PL/SQL or Java subprogram
 EXPLAIN PLAN - It explains access path to data
 LOCK TABLE - It controls concurrency
Data Control Language
There are another two forms of database sub-languages. The Data Control Language (DCL)
is used to control privilege in Database. To perform any operation in the database, such as for
creating tables, sequences or views we need privileges. Privileges are of two types,
 System - creating a session, table, etc. are all types of system privilege.
 Object - any command or query to work on tables comes under object privilege. DCL
is used to define two commands. These are:
 Grant - It gives user access privileges to a database.
 Revoke - It takes back permissions from the user.
Transaction Control Language (TCL)
Transaction Control statements are used to run the changes made by DML statements. It
allows statements to be grouped into logical transactions.
 COMMIT - It saves the work done
 SAVEPOINT - It identifies a point in a transaction to which you can later roll back
 ROLLBACK - It restores the database to original since the last COMMIT
 SET TRANSACTION - It changes the transaction options like isolation level and
what rollback segment to use
Types of key:
2. Candidate key
In the EMPLOYEE table, id is best suited for the primary key. Rest of the attributes like
SSN, Passport_Number, and License_Number, etc. are considered as a candidate key.
. Super Key
Super key is a set of an attribute which can uniquely identify a tuple. Super key is a superset
of a candidate key.
For example: In the above EMPLOYEE table, for(EMPLOEE_ID, EMPLOYEE_NAME)
the name of two employees can be the same, but their EMPLYEE_ID can't be the same.
Hence, this combination can also be a key.
The super key would be EMPLOYEE-ID, (EMPLOYEE_ID, EMPLOYEE-NAME), etc.
4. Foreign key
 Foreignkeysare the columnof the table whichisusedto pointto the primarykeyof another
table.
Various Keys in Database Management System (DBMS)
1. Super key
2. Candidate key
3. Primary key
4. Composite key
5. Secondary or Alternative key
6. Prime attribute
7. Non- prime attribute
Types of Integrity Constraint
. Domain constraints
 Domainconstraintscan be definedasthe definitionof avalidsetof valuesforan attribute.
 The data type of domainincludesstring,character,integer,time,date,currency,etc.The
value of the attribute mustbe available inthe correspondingdomain.
Example:
2. Entity integrity constraints
 The entityintegrityconstraintstatesthatprimarykeyvalue can'tbe null.
 Thisis because the primarykeyvalue isusedtoidentifyindividual rowsinrelationandif the
primarykeyhas a null value,thenwe can'tidentifythose rows.
 A table can containa null value otherthanthe primarykeyfield.
Example:
3. Referential Integrity Constraints
 A referential integrityconstraintisspecifiedbetweentwotables.
 In the Referential integrityconstraints,if a foreignkeyinTable 1refersto the PrimaryKeyof
Table 2, theneveryvalue of the ForeignKeyinTable 1 must be null orbe available inTable
2.
Example:
4. Key constraints
 Keysare the entitysetthatisusedto identifyanentitywithinits entitysetuniquely.
 An entitysetcanhave multiple keys,butoutof whichone keywill be the primarykey.A
primarykeycan containa unique andnull value inthe relational table.
Example:
TYPES OF INTEGRITY CONSTRAINTS
Various types of integrity constraints are-
1. Domain Integrity
2. Entity Integrity Constraint
3. Referential Integrity Constraint
4. Key Constraints
1. Domain Integrity-
Domain integrity means the definition of a valid set of values for an attribute. You define
data type, length or size, is null value allowed , is the value unique or not for an attribute ,the
default value, the range (values in between) and/or specific values for the attribute.
2. Entity Integrity Constraint-
This rule states that in any database relation value of attribute of a primary key can't be null.
EXAMPLE- Consider a relation "STUDENT" Where "Stu_id" is a primary key and it must
not contain any null value whereas other attributes may contain null value e.g "Branch" in the
following relation contains one null value.
3.Referential Integrity Constraint-
It states that if a foreign key exists in a relation then either the foreign key value must match a
primary key value of some tuple in its home relation or the foreign key value must be null.
The rules are:
1. You can't delete a record from a primary table if matching records exist in a related
table.
2. You can't change a primary key value in the primary table if that record has related
records.
3. You can't enter a value in the foreign key field of the related table that doesn't exist in
the primary key of the primary table.
4. However, you can enter a Null value in the foreign key, specifying that the records are
unrelated.
EXAMPLE-
Consider 2 relations "stu" and "stu_1" Where "Stu_id " is the primary key in the "stu" relation
and foreign key in the "stu_1" relation.
Relation "stu"
Stu_id Name Branch
11255234 Aman CSE
11255369 Kapil EcE
11255324 Ajay ME
11255237 Raman CSE
Stu_id Name Branch
11255678 Aastha ECE
Relation "stu_1"
Stu_id Duration
11255234 B TECH 4 years
11255369 B TECH 4 years
11255324 B TECH 4 years
11255237 B TECH 4 years
11255678 B TECH 4 years
4.Key Constraints-
A Key Constraint is a statement that a certain minimal subset of the fields of a relation is a
unique identifier for a tuple.

More Related Content

What's hot

Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbms
Anjaan Gajendra
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
Archit Saxena
 
RDBMS_Unit 01
RDBMS_Unit 01RDBMS_Unit 01
RDBMS_Unit 01
Prashanth Shivakumar
 
ICS Part 2 Computer Science Short Notes
ICS Part 2 Computer Science Short NotesICS Part 2 Computer Science Short Notes
ICS Part 2 Computer Science Short Notes
Abdul Haseeb
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management systememailharmeet
 
Normalization
NormalizationNormalization
Normalization
ochesing
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database languageJafar Nesargi
 
OODM-object oriented data model
OODM-object oriented data modelOODM-object oriented data model
OODM-object oriented data model
AnilPokhrel7
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
Nishant Munjal
 
Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...
Mobarok Hossen
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER Diagrams
Adri Jovin
 
The three level of data modeling
The three level of data modelingThe three level of data modeling
The three level of data modelingsharmila_yusof
 
Introduction to Data Science With R Notes
Introduction to Data Science With R NotesIntroduction to Data Science With R Notes
Introduction to Data Science With R Notes
LakshmiSarvani6
 
Relational model
Relational modelRelational model
Relational model
WBUTTUTORIALS
 
DBMS - Relational Model
DBMS - Relational ModelDBMS - Relational Model
DBMS - Relational Model
Ovais Imtiaz
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbmsNaresh Kumar
 
Data Mining And Data Warehousing Laboratory File Manual
Data Mining And Data Warehousing Laboratory File ManualData Mining And Data Warehousing Laboratory File Manual
Data Mining And Data Warehousing Laboratory File Manual
Nitin Bhasin
 

What's hot (20)

Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbms
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
RDBMS_Unit 01
RDBMS_Unit 01RDBMS_Unit 01
RDBMS_Unit 01
 
ICS Part 2 Computer Science Short Notes
ICS Part 2 Computer Science Short NotesICS Part 2 Computer Science Short Notes
ICS Part 2 Computer Science Short Notes
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management system
 
Normalization
NormalizationNormalization
Normalization
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database language
 
09.01 normalization
09.01 normalization09.01 normalization
09.01 normalization
 
OODM-object oriented data model
OODM-object oriented data modelOODM-object oriented data model
OODM-object oriented data model
 
Rdbms
RdbmsRdbms
Rdbms
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER Diagrams
 
The three level of data modeling
The three level of data modelingThe three level of data modeling
The three level of data modeling
 
Data models
Data modelsData models
Data models
 
Introduction to Data Science With R Notes
Introduction to Data Science With R NotesIntroduction to Data Science With R Notes
Introduction to Data Science With R Notes
 
Relational model
Relational modelRelational model
Relational model
 
DBMS - Relational Model
DBMS - Relational ModelDBMS - Relational Model
DBMS - Relational Model
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
 
Data Mining And Data Warehousing Laboratory File Manual
Data Mining And Data Warehousing Laboratory File ManualData Mining And Data Warehousing Laboratory File Manual
Data Mining And Data Warehousing Laboratory File Manual
 

Similar to introduction of database in DBMS

Unit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptxUnit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptx
nirajsharmapuneiat
 
Database System Concepts AND architecture [Autosaved].pptx
Database System Concepts AND architecture [Autosaved].pptxDatabase System Concepts AND architecture [Autosaved].pptx
Database System Concepts AND architecture [Autosaved].pptx
Koteswari Kasireddy
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
SURBHI SAROHA
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
SURBHI SAROHA
 
Data models
Data modelsData models
Data models
Samuel Igbanogu
 
Database management systems
Database management systemsDatabase management systems
Database management systems
Ravindra Singh Gohil
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbms
Anjaan Gajendra
 
Database Concepts & SQL(1).pdf
Database Concepts & SQL(1).pdfDatabase Concepts & SQL(1).pdf
Database Concepts & SQL(1).pdf
rsujeet169
 
Week 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data ModelingWeek 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data Modeling
oudesign
 
ITB - UNIT 3.pdf
ITB - UNIT 3.pdfITB - UNIT 3.pdf
ITB - UNIT 3.pdf
SOMASUNDARAM T
 
Ch1- Introduction to dbms
Ch1- Introduction to dbmsCh1- Introduction to dbms
Ch1- Introduction to dbms
Shakila Mahjabin
 
Database Management System, Lecture-1
Database Management System, Lecture-1Database Management System, Lecture-1
Database Management System, Lecture-1
Sonia Mim
 
database concepts pdf :BEMIT
database concepts pdf :BEMITdatabase concepts pdf :BEMIT
database concepts pdf :BEMIT
Usman Mchinja
 
DBMS Part 1.pptx
DBMS Part 1.pptxDBMS Part 1.pptx
DBMS Part 1.pptx
Shivammittal880395
 
2. Chapter Two.pdf
2. Chapter Two.pdf2. Chapter Two.pdf
2. Chapter Two.pdf
fikadumola
 
Database Concepts
Database ConceptsDatabase Concepts
Database Concepts
Upendra Reddy Vuyyuru
 

Similar to introduction of database in DBMS (20)

Unit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptxUnit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptx
 
Database System Concepts AND architecture [Autosaved].pptx
Database System Concepts AND architecture [Autosaved].pptxDatabase System Concepts AND architecture [Autosaved].pptx
Database System Concepts AND architecture [Autosaved].pptx
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
 
Data models
Data modelsData models
Data models
 
Data models
Data modelsData models
Data models
 
Database management systems
Database management systemsDatabase management systems
Database management systems
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbms
 
Database Concepts & SQL(1).pdf
Database Concepts & SQL(1).pdfDatabase Concepts & SQL(1).pdf
Database Concepts & SQL(1).pdf
 
Week 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data ModelingWeek 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data Modeling
 
ITB - UNIT 3.pdf
ITB - UNIT 3.pdfITB - UNIT 3.pdf
ITB - UNIT 3.pdf
 
Ch1- Introduction to dbms
Ch1- Introduction to dbmsCh1- Introduction to dbms
Ch1- Introduction to dbms
 
Database Management System, Lecture-1
Database Management System, Lecture-1Database Management System, Lecture-1
Database Management System, Lecture-1
 
database concepts pdf :BEMIT
database concepts pdf :BEMITdatabase concepts pdf :BEMIT
database concepts pdf :BEMIT
 
Database model
Database modelDatabase model
Database model
 
Hw fdb(2)
Hw fdb(2)Hw fdb(2)
Hw fdb(2)
 
Hw fdb(2)
Hw fdb(2)Hw fdb(2)
Hw fdb(2)
 
DBMS Part 1.pptx
DBMS Part 1.pptxDBMS Part 1.pptx
DBMS Part 1.pptx
 
2. Chapter Two.pdf
2. Chapter Two.pdf2. Chapter Two.pdf
2. Chapter Two.pdf
 
Database Concepts
Database ConceptsDatabase Concepts
Database Concepts
 

Recently uploaded

The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 

Recently uploaded (20)

The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 

introduction of database in DBMS

  • 1. Important terms DATA: Representationof facts,concepts,Instructions Field: To representaspecificdataelement Record: collectionof fields Information: Processeddata Redundancy: Repetitionof data DataSemantics. C I A DBMS: Is a collectionof Interrelateddataanda setof procedurestoaccessthat data. Advantagesof DBMS  Control of data redundancy  Data consistency  More informationfromsame amountof data  Sharingof data  Searchcapabilities  Improveddataintegrity  Privacyand security  Economyof scale  Improvedbackupandrecovery  Standardscan be maintained(formats) Instance,SchemaandDatabase state.  The collectionof informationstoredindatabase ata particularinstantof time iscalledan instance of database.  The data in the database at a particulartime iscalledasdatabase state
  • 2.  Database Schema A database schema is the skeleton structure that represents the logical view of the entire database. It defines how the data is organized and how the relations among them are associated. DBMS 3- TierArchitecture It has Three Levels 1. External Schema (User View) 2. Conceptual Schema (Whatdata is storedandthe relationamong thatdata) 3. Internal Schema (How data is storedinthe database)
  • 3. MappingConstraints: 1. One to One Relationship 2. One to manyFunctions 3. Many to One Relationship 4. Many to many relationship MCQ 1. The DBMS acts as an interface between what two components of an enterprise-class database system? A.Database application and the database B.Data and the database C.The user and the database application D.Database application and SQL A The following are components of a database except ________ . A.user data B.metadata C.reports D.indexes c An application where only one user accesses the database at a given time is an example of a(n) ________ . A.single-user database application B.multiuser database application C.e-commerce database application D.data mining database application a
  • 4. An on-line commercial site such as Amazon.com is an example of a(n) ________ . A.single-user database application B.multiuser database application C.e-commerce database application D.data mining database application c SQL stands for ________ . A.Structured Query Language B.Sequential Query Language C.Structured Question Language D.Sequential Question Language a The following are functions of a DBMS except ________ . A.creating and processing forms B.creating databases C.processing data D.administrating databases a Helping people keep track of things is the purpose of a(n) ________ . A.database B.table C.instance D.Relationship a
  • 5. Data Independence: The abilitytomodifyaschema definitioninone levelwithoutaffectingaschemadefinitioninthe nexthigherleveliscalledasdata independence. Physical Dataindependence: (Changesinphysical schemawithoutcausingapp.Programstobe rewritten.) Logical Data Independence: Changesto conceptual schema,suchaadditionof entryor deletionof new entriesshouldbe possible withoutaffectingexistingexternalschema. Data Models: • Underlyingthe structure of a database isthe Data Model: A collectionof conceptual toolsfor describingdata,data relationshipsandconsistency constraints. • A data model providesawaytodescribe the designof adatabase at the physical,logical and viewlevel.
  • 6. The data modelscan be classifiedin4differentcategories: 1. Relational Model 2. The Entity-RelationshipModel 3. Object-BasedDataModel 4. Semi-structuredDataModel Entity An entity can be a real-world object, either animate or inanimate, that can be easily identifiable. For example, in a school database, students, teachers, classes, and courses offered can be considered as entities. All these entities have some attributes or properties that give them their identity. Attributes Entities are represented by means of their properties, called attributes. All attributes have values. For example, a student entity may have name, class, and age as attributes. Types of Attributes  Simple attribute − Simple attributes are atomic values, which cannot be divided further. For example, a student's phone number is an atomic value of 10 digits.  Composite attribute − Composite attributes are made of more than one simple attribute. For example, a student's complete name may have first_name and last_name.  Derived attribute − Derived attributes are the attributes that do not exist in the physical database, but their values are derived from other attributes present in the database. For example, average_salary in a department should not be saved directly in the database, instead it can be derived. For another example, age can be derived from data_of_birth.  Single-value attribute − Single-value attributes contain single value. For example − Social_Security_Number.  Multi-value attribute − Multi-value attributes may contain more than one values. For example, a person can have more than one phone number, email_address, etc.
  • 7. Relationship The association among entities is called a relationship. For example, an employee works_at a department, a student enrolls in a course. Here, Works_at and Enrolls are called relationships. Entity Entities are represented by means of rectangles. Rectangles are named with the entity set they represent. Imp terms 1. Composite 2. Multivalued (doubleeclipse) 3. Derived (dottedeclipse) 4. DependentEntity 5. WeakEntity Generalization
  • 9.
  • 13. CardinalityRatio: Number of relationship instances in which the entity can participate is defined as Cardinality Ratio. The possible cardinality ratios are as follows. For the explanation let us consider, there are two entity sets A and B. : 1. One to one Relationship (1:1) : An entity in A can have relationship with atmost one entity in B and vice versa. For example, a principal can manage one school and a school can be managed by just one principal. 2. One to Many Relationship (1:M) : An entity in A can have relationship with zero or more entities in B while an entity of B can have relationship with only one entity of A. For example, A batch can have more than one student while a student can be present in only one batch. 3. Many to One Relationship (M:M) : An entity in A can have relationship with any no of entities in B and vice versa. For example, An employee can work on more than one projects and a project can be handles by more than one employee. Degree: The degree of relationship (also known as cardinality) is the number of occurrences in one entity which are associated (or linked) to the number of occurrences in another. There are three degrees of relationship, known as: 1. one-to-one (1:1) 2. one-to-many (1:M) 3. many-to-many (M:N)
  • 14. One-to-one (1:1) This is where one occurrence of an entity relates to only one occurrence in another entity. A one-to-one relationship rarely exists in practice, but it can. However, you may consider combining them into one entity. For example, an employee is allocated a company car, which can only be driven by that employee. Therefore, there is a one-to-one relationship between employee and company car. One-to-Many (1:M) Is where one occurrence in an entity relates to many occurrences in another entity. For example, taking the employee and department entities shown on the previous page, an employee works in one department but a department has many employees. Therefore, there is a one-to-many relationship between department and employee.
  • 15. Many-to-Many (M:N) This is where many occurrences in an entity relate to many occurrences in another entity. The normalisation process discussed earlier would prevent any such relationships but the definition is included here for completeness. As with one-to-one relationships, many-to-many relationships rarely exist. Normally they occur because an entity has been missed. For example, an employee may work on several projects at the same time and a project has a team of many employees. Therefore, there is a many-to-many relationship between employee and project. SQL Components:DDLand DML commands What are database Sub languages? A data sublanguage mainly has two parts:  Data Definition Language (DDL) and  Data Manipulation Language (DML). Data Definition Language Data Definition Language (DDL) statements are used to classify the database structure or schema. It is a type of language that allows the DBA or user to depict and name those
  • 16. entities, attributes, and relationships that are required for the application along with any associated integrity and security constraints. Here are the lists of tasks that come under DDL:  CREATE - used to create objects in the database  ALTER - used to alters the structure of the database  DROP - used to delete objects from the database  TRUNCATE - used to remove all records from a table, including all spaces allocated for the records are removed  COMMENT - used to add comments to the data dictionary  RENAME - used to rename an object Data Manipulation Language A language that offers a set of operations to support the fundamental data manipulation operations on the data held in the database. Data Manipulation Language (DML) statements are used to manage data within schema objects. Here are the lists of tasks that come under DML:  SELECT - It retrieves data from a database  INSERT - It inserts data into a table  UPDATE - It updates existing data within a table  DELETE - It deletes all records from a table, the space for the records remain  MERGE - UPSERT operation (insert or update)  CALL - It calls a PL/SQL or Java subprogram  EXPLAIN PLAN - It explains access path to data  LOCK TABLE - It controls concurrency Data Control Language There are another two forms of database sub-languages. The Data Control Language (DCL) is used to control privilege in Database. To perform any operation in the database, such as for creating tables, sequences or views we need privileges. Privileges are of two types,  System - creating a session, table, etc. are all types of system privilege.  Object - any command or query to work on tables comes under object privilege. DCL is used to define two commands. These are:  Grant - It gives user access privileges to a database.  Revoke - It takes back permissions from the user.
  • 17. Transaction Control Language (TCL) Transaction Control statements are used to run the changes made by DML statements. It allows statements to be grouped into logical transactions.  COMMIT - It saves the work done  SAVEPOINT - It identifies a point in a transaction to which you can later roll back  ROLLBACK - It restores the database to original since the last COMMIT  SET TRANSACTION - It changes the transaction options like isolation level and what rollback segment to use Types of key:
  • 18. 2. Candidate key In the EMPLOYEE table, id is best suited for the primary key. Rest of the attributes like SSN, Passport_Number, and License_Number, etc. are considered as a candidate key.
  • 19. . Super Key Super key is a set of an attribute which can uniquely identify a tuple. Super key is a superset of a candidate key. For example: In the above EMPLOYEE table, for(EMPLOEE_ID, EMPLOYEE_NAME) the name of two employees can be the same, but their EMPLYEE_ID can't be the same. Hence, this combination can also be a key. The super key would be EMPLOYEE-ID, (EMPLOYEE_ID, EMPLOYEE-NAME), etc. 4. Foreign key  Foreignkeysare the columnof the table whichisusedto pointto the primarykeyof another table. Various Keys in Database Management System (DBMS) 1. Super key 2. Candidate key 3. Primary key 4. Composite key 5. Secondary or Alternative key 6. Prime attribute
  • 20. 7. Non- prime attribute Types of Integrity Constraint . Domain constraints  Domainconstraintscan be definedasthe definitionof avalidsetof valuesforan attribute.
  • 21.  The data type of domainincludesstring,character,integer,time,date,currency,etc.The value of the attribute mustbe available inthe correspondingdomain. Example: 2. Entity integrity constraints  The entityintegrityconstraintstatesthatprimarykeyvalue can'tbe null.  Thisis because the primarykeyvalue isusedtoidentifyindividual rowsinrelationandif the primarykeyhas a null value,thenwe can'tidentifythose rows.  A table can containa null value otherthanthe primarykeyfield. Example: 3. Referential Integrity Constraints  A referential integrityconstraintisspecifiedbetweentwotables.  In the Referential integrityconstraints,if a foreignkeyinTable 1refersto the PrimaryKeyof Table 2, theneveryvalue of the ForeignKeyinTable 1 must be null orbe available inTable 2. Example:
  • 22. 4. Key constraints  Keysare the entitysetthatisusedto identifyanentitywithinits entitysetuniquely.  An entitysetcanhave multiple keys,butoutof whichone keywill be the primarykey.A primarykeycan containa unique andnull value inthe relational table. Example: TYPES OF INTEGRITY CONSTRAINTS Various types of integrity constraints are- 1. Domain Integrity 2. Entity Integrity Constraint 3. Referential Integrity Constraint 4. Key Constraints
  • 23. 1. Domain Integrity- Domain integrity means the definition of a valid set of values for an attribute. You define data type, length or size, is null value allowed , is the value unique or not for an attribute ,the default value, the range (values in between) and/or specific values for the attribute. 2. Entity Integrity Constraint- This rule states that in any database relation value of attribute of a primary key can't be null. EXAMPLE- Consider a relation "STUDENT" Where "Stu_id" is a primary key and it must not contain any null value whereas other attributes may contain null value e.g "Branch" in the following relation contains one null value. 3.Referential Integrity Constraint- It states that if a foreign key exists in a relation then either the foreign key value must match a primary key value of some tuple in its home relation or the foreign key value must be null. The rules are: 1. You can't delete a record from a primary table if matching records exist in a related table. 2. You can't change a primary key value in the primary table if that record has related records. 3. You can't enter a value in the foreign key field of the related table that doesn't exist in the primary key of the primary table. 4. However, you can enter a Null value in the foreign key, specifying that the records are unrelated. EXAMPLE- Consider 2 relations "stu" and "stu_1" Where "Stu_id " is the primary key in the "stu" relation and foreign key in the "stu_1" relation. Relation "stu" Stu_id Name Branch 11255234 Aman CSE 11255369 Kapil EcE 11255324 Ajay ME 11255237 Raman CSE
  • 24. Stu_id Name Branch 11255678 Aastha ECE Relation "stu_1" Stu_id Duration 11255234 B TECH 4 years 11255369 B TECH 4 years 11255324 B TECH 4 years 11255237 B TECH 4 years 11255678 B TECH 4 years 4.Key Constraints- A Key Constraint is a statement that a certain minimal subset of the fields of a relation is a unique identifier for a tuple.