SlideShare a Scribd company logo
1 of 26
B.Tech III Sem ‘A’
DATABASE MANAGEMENT
SYSTEMS
Topics Covered
 Database users
 Database Architecture
 DDL
 DML
Student
Std_ID Name
Addr
Sec
DoB
Std_ID Name Addr Sec DoB
189X1A05XY Sree Sanfransisco A 01/01/1999
189X1A05XZ Sri Germany B+ 01/01/2000
ER Model Relational Model
ER Model Vs. Relational Model
Naive / Prgmers / Sophisticated / DBA
Appl.
interface
s
Appl.
programs
Query
tools
Admin
tools
Query Processor
Object
code
Compiler
DML
Queries
DDL
Interpreter
Query Evaluation Engine
Storage Manager
Buffer
Manager
File
Manager
Authorization &
integrity manager
Transaction
Manager
Data Indice
s
Data
Dictionar
y
Disk Storage
Users
DDL Commands
DDL:
Data Definition
Language
 CREATE
 ALTER
 DROP
 RENAME
DML:
Data Manipulation Language
 INSERT
 UPDATE
 DELETE
 SELECT
DCL:
Data Control Language
 GRANT
 REVOKE
 COMMIT (TCL)
 ROLLBACK (TCL)
DDL: Create
CREATE TABLE
CUSTOMER1(
ID Number(2),
NAME NVARCHAR2 (20),
AGE INT,
ADDRESS NVARCHAR2
(30) ,
SALARY DECIMAL (10, 2)
create table cust_temp as
select id, name from
customer1;
CREATE TABLE STUDENT2
(
ID INT NOT NULL,
NAME VARCHAR(20) NOT
NULL,
AGE INT NOT NULL,
DDL: Alter
 ALTER TABLE table_name ADD column_name
datatype;
 ALTER TABLE table_name DROP COLUMN
column_name;
 ALTER TABLE table_name MODIFY COLUMN
column_name datatype;
 ALTER TABLE table_name MODIFY column_name
datatype NOT NULL;
DDL Command: DROP &
Rename
 Drop table student;
 Rename student1 to student2;
 TRUNCATE TABLE customer1;
DML: Data Manipulation Language
 INSERT
 UPDATE
 DELETE
 SELECT
DML Example: Insert
insert into customer1values(90, 'Codd',60,'San Fransisco',
150000);
insert into customer1 values(&id,
'&name',&age,'&address',&salary);
SELECT * FROM EMPLOYEE
UPDATE Customer1 set ID=18, WHERE Name='henry
korth';DELETE FROM Customer1 WHERE Name='Henry Korth' AND
age=60;
Today’s Topics
 DCL
 Entity Relationship Model
 Basic concepts
 Cardinality of Relationship
 ER Diagram Notations
 ER Diagrams: Examples
DCL: Data Control Language
 GRANT : used to grant or give the privileges.
 REVOKE : used to avoid or object the privileges.
 COMMIT: used to save the data permanently.
 ROLL BACK : Used to revert changes in the
transactions since the last commit or rollback
command was issued
DCL: Commit
DELETE FROM
CUSTOMERS
WHERE AGE = 25;
SQL> COMMIT;
Rollback
 ROLLBACK command is the transactional
command used to undo transactions that have
not already been saved to the database.
 This command can only be used to undo
transactions since the last COMMIT or
ROLLBACK command was issued.
 DELETE FROM CUSTOMERS WHERE AGE =
25;
DCL : Grant & Revoke
create user korth identified by henry
 Connect as system/ora10g
GRANT SELECT, INSERT, UPDATE, DELETE
ON Emp_Det TO korth;
REVOKE DELETE ON Emp_details FROM
Entity Relationship Model
 The ER data model facilitates database design
by allowing specification of an enterprise
schema that represents the overall logical
structure of a database.
 The E-R data model employs three basic
concepts: entity sets, relationship sets, and
attributes
Entity Sets
 Entity: Real-world object distinguishable from other
objects. An entity is described (in DB) using a
set of attributes.
 Entity Set: A collection of similar entities. E.g., all
employees.
 All entities in an entity set have the same set of attributes.
 Each entity set has a key.
 Each attribute has a domain.
Entity Sets
Relationship Sets
 Relationship: Association among two or more
entities.
 A relationship set is a mathematical relation
among n  2 entities, each taken from entity sets
{(e1, e2, … en) | e1  E1, e2  E2, …, en 
En}
where (e1, e2, …, en) is a relationship
Relationship: Depositor
Relationship: Borrower
Attributes
 An entity is represented by a set of
attributes, that is descriptive properties
possessed by all members of an entity
set.Example:
customer = (customer_id, customer_name, customer_street,
customer_city )
loan = (loan_number, amount )
Attribute types
 Simple : Attribute is simple, if its value can not be divided into subparts.
For example Std_ID, GPA.
 Composite : Attribute is composite, if its value can be divided into
subparts. Ex: Name: First Name; Middle Name; Last Name
Address: H.No; street; city; pincode
 Single-valued : Attribute is a single-valued, if it has only one value for a
particular entity
 Multivalued : Attribute is multivalued, if it has a set of values for a
particular entity. Ex: Phone number
 Derived: Attribute is a derived, if its value can be derived from the values
of other related attributes or entities. Ex: Age, given dateofbirth
ER Diagram Notations
 Rectangles represent entity sets
 Ellipses represent attributes
 Diamonds represent relationship sets
 Lines link attributes to entity sets and link entity
sets to relationships sets
Continued…
 ER Diagram Notations
 ER Diagram Examples

More Related Content

What's hot

1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
koolkampus
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
Naresh Kumar
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
koolkampus
 

What's hot (20)

Database language
Database languageDatabase language
Database language
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
Sql commands
Sql commandsSql commands
Sql commands
 
Triggers in SQL | Edureka
Triggers in SQL | EdurekaTriggers in SQL | Edureka
Triggers in SQL | Edureka
 
SQL
SQLSQL
SQL
 
Data models
Data modelsData models
Data models
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentation
 
Integrity constraints in dbms
Integrity constraints in dbmsIntegrity constraints in dbms
Integrity constraints in dbms
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
 
DBMS PPT
DBMS PPTDBMS PPT
DBMS PPT
 
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick LearningOracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
SQL commands
SQL commandsSQL commands
SQL commands
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
Sql and Sql commands
Sql and Sql commandsSql and Sql commands
Sql and Sql commands
 

Similar to DBMS Notes: DDL DML DCL

xml-150211140504-conversion-gate01 (1).pdf
xml-150211140504-conversion-gate01 (1).pdfxml-150211140504-conversion-gate01 (1).pdf
xml-150211140504-conversion-gate01 (1).pdf
ssusere05ec21
 
Sm relationaldatamodel-150423084157-conversion-gate01
Sm relationaldatamodel-150423084157-conversion-gate01Sm relationaldatamodel-150423084157-conversion-gate01
Sm relationaldatamodel-150423084157-conversion-gate01
Ankit Dubey
 
Sm relationaldatamodel-150423084157-conversion-gate01
Sm relationaldatamodel-150423084157-conversion-gate01Sm relationaldatamodel-150423084157-conversion-gate01
Sm relationaldatamodel-150423084157-conversion-gate01
Ankit Dubey
 
Introduction to Csharp (C-Sharp) is a programming language developed by Micro...
Introduction to Csharp (C-Sharp) is a programming language developed by Micro...Introduction to Csharp (C-Sharp) is a programming language developed by Micro...
Introduction to Csharp (C-Sharp) is a programming language developed by Micro...
NALESVPMEngg
 

Similar to DBMS Notes: DDL DML DCL (20)

Dbms ER Model
Dbms ER ModelDbms ER Model
Dbms ER Model
 
6_SQL.pdf
6_SQL.pdf6_SQL.pdf
6_SQL.pdf
 
02.adt
02.adt02.adt
02.adt
 
ER Modeling.ppt
ER Modeling.pptER Modeling.ppt
ER Modeling.ppt
 
Xml
XmlXml
Xml
 
PPT
PPTPPT
PPT
 
ch2
ch2ch2
ch2
 
Chapter 7 (Part I) - User Defined Datatypes.pdf
Chapter 7 (Part I) - User Defined Datatypes.pdfChapter 7 (Part I) - User Defined Datatypes.pdf
Chapter 7 (Part I) - User Defined Datatypes.pdf
 
xml-150211140504-conversion-gate01 (1).pdf
xml-150211140504-conversion-gate01 (1).pdfxml-150211140504-conversion-gate01 (1).pdf
xml-150211140504-conversion-gate01 (1).pdf
 
Unit04 dbms
Unit04 dbmsUnit04 dbms
Unit04 dbms
 
SA Chapter 10
SA Chapter 10SA Chapter 10
SA Chapter 10
 
SQL express course for begginers
   SQL express course for begginers   SQL express course for begginers
SQL express course for begginers
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
Sm relationaldatamodel-150423084157-conversion-gate01
Sm relationaldatamodel-150423084157-conversion-gate01Sm relationaldatamodel-150423084157-conversion-gate01
Sm relationaldatamodel-150423084157-conversion-gate01
 
Sm relationaldatamodel-150423084157-conversion-gate01
Sm relationaldatamodel-150423084157-conversion-gate01Sm relationaldatamodel-150423084157-conversion-gate01
Sm relationaldatamodel-150423084157-conversion-gate01
 
RDBMS
RDBMSRDBMS
RDBMS
 
Introduction-to-Csharp.ppt
Introduction-to-Csharp.pptIntroduction-to-Csharp.ppt
Introduction-to-Csharp.ppt
 
Introduction to-csharp
Introduction to-csharpIntroduction to-csharp
Introduction to-csharp
 
Introduction to Csharp (C-Sharp) is a programming language developed by Micro...
Introduction to Csharp (C-Sharp) is a programming language developed by Micro...Introduction to Csharp (C-Sharp) is a programming language developed by Micro...
Introduction to Csharp (C-Sharp) is a programming language developed by Micro...
 
Introduction-to-Csharp.ppt
Introduction-to-Csharp.pptIntroduction-to-Csharp.ppt
Introduction-to-Csharp.ppt
 

More from Sreedhar Chowdam

More from Sreedhar Chowdam (20)

Design and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture NotesDesign and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture Notes
 
Design and Analysis of Algorithms (Knapsack Problem)
Design and Analysis of Algorithms (Knapsack Problem)Design and Analysis of Algorithms (Knapsack Problem)
Design and Analysis of Algorithms (Knapsack Problem)
 
DCCN Network Layer congestion control TCP
DCCN Network Layer congestion control TCPDCCN Network Layer congestion control TCP
DCCN Network Layer congestion control TCP
 
Data Communication and Computer Networks
Data Communication and Computer NetworksData Communication and Computer Networks
Data Communication and Computer Networks
 
DCCN Unit 1.pdf
DCCN Unit 1.pdfDCCN Unit 1.pdf
DCCN Unit 1.pdf
 
Data Communication & Computer Networks
Data Communication & Computer NetworksData Communication & Computer Networks
Data Communication & Computer Networks
 
PPS Notes Unit 5.pdf
PPS Notes Unit 5.pdfPPS Notes Unit 5.pdf
PPS Notes Unit 5.pdf
 
PPS Arrays Matrix operations
PPS Arrays Matrix operationsPPS Arrays Matrix operations
PPS Arrays Matrix operations
 
Programming for Problem Solving
Programming for Problem SolvingProgramming for Problem Solving
Programming for Problem Solving
 
Big Data Analytics Part2
Big Data Analytics Part2Big Data Analytics Part2
Big Data Analytics Part2
 
Python Programming: Lists, Modules, Exceptions
Python Programming: Lists, Modules, ExceptionsPython Programming: Lists, Modules, Exceptions
Python Programming: Lists, Modules, Exceptions
 
Python Programming by Dr. C. Sreedhar.pdf
Python Programming by Dr. C. Sreedhar.pdfPython Programming by Dr. C. Sreedhar.pdf
Python Programming by Dr. C. Sreedhar.pdf
 
Python Programming Strings
Python Programming StringsPython Programming Strings
Python Programming Strings
 
Python Programming
Python Programming Python Programming
Python Programming
 
Python Programming
Python ProgrammingPython Programming
Python Programming
 
C Recursion, Pointers, Dynamic memory management
C Recursion, Pointers, Dynamic memory managementC Recursion, Pointers, Dynamic memory management
C Recursion, Pointers, Dynamic memory management
 
C Programming Storage classes, Recursion
C Programming Storage classes, RecursionC Programming Storage classes, Recursion
C Programming Storage classes, Recursion
 
Programming For Problem Solving Lecture Notes
Programming For Problem Solving Lecture NotesProgramming For Problem Solving Lecture Notes
Programming For Problem Solving Lecture Notes
 
Big Data Analytics
Big Data AnalyticsBig Data Analytics
Big Data Analytics
 
Data Structures Notes 2021
Data Structures Notes 2021Data Structures Notes 2021
Data Structures Notes 2021
 

Recently uploaded

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
pritamlangde
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 

Recently uploaded (20)

8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information Systems
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth Reinforcement
 

DBMS Notes: DDL DML DCL

  • 1. B.Tech III Sem ‘A’ DATABASE MANAGEMENT SYSTEMS
  • 2. Topics Covered  Database users  Database Architecture  DDL  DML
  • 3. Student Std_ID Name Addr Sec DoB Std_ID Name Addr Sec DoB 189X1A05XY Sree Sanfransisco A 01/01/1999 189X1A05XZ Sri Germany B+ 01/01/2000 ER Model Relational Model ER Model Vs. Relational Model
  • 4. Naive / Prgmers / Sophisticated / DBA Appl. interface s Appl. programs Query tools Admin tools Query Processor Object code Compiler DML Queries DDL Interpreter Query Evaluation Engine Storage Manager Buffer Manager File Manager Authorization & integrity manager Transaction Manager Data Indice s Data Dictionar y Disk Storage Users
  • 5. DDL Commands DDL: Data Definition Language  CREATE  ALTER  DROP  RENAME DML: Data Manipulation Language  INSERT  UPDATE  DELETE  SELECT DCL: Data Control Language  GRANT  REVOKE  COMMIT (TCL)  ROLLBACK (TCL)
  • 6. DDL: Create CREATE TABLE CUSTOMER1( ID Number(2), NAME NVARCHAR2 (20), AGE INT, ADDRESS NVARCHAR2 (30) , SALARY DECIMAL (10, 2) create table cust_temp as select id, name from customer1; CREATE TABLE STUDENT2 ( ID INT NOT NULL, NAME VARCHAR(20) NOT NULL, AGE INT NOT NULL,
  • 7. DDL: Alter  ALTER TABLE table_name ADD column_name datatype;  ALTER TABLE table_name DROP COLUMN column_name;  ALTER TABLE table_name MODIFY COLUMN column_name datatype;  ALTER TABLE table_name MODIFY column_name datatype NOT NULL;
  • 8. DDL Command: DROP & Rename  Drop table student;  Rename student1 to student2;  TRUNCATE TABLE customer1;
  • 9. DML: Data Manipulation Language  INSERT  UPDATE  DELETE  SELECT
  • 10. DML Example: Insert insert into customer1values(90, 'Codd',60,'San Fransisco', 150000); insert into customer1 values(&id, '&name',&age,'&address',&salary); SELECT * FROM EMPLOYEE UPDATE Customer1 set ID=18, WHERE Name='henry korth';DELETE FROM Customer1 WHERE Name='Henry Korth' AND age=60;
  • 11. Today’s Topics  DCL  Entity Relationship Model  Basic concepts  Cardinality of Relationship  ER Diagram Notations  ER Diagrams: Examples
  • 12. DCL: Data Control Language  GRANT : used to grant or give the privileges.  REVOKE : used to avoid or object the privileges.  COMMIT: used to save the data permanently.  ROLL BACK : Used to revert changes in the transactions since the last commit or rollback command was issued
  • 13. DCL: Commit DELETE FROM CUSTOMERS WHERE AGE = 25; SQL> COMMIT;
  • 14. Rollback  ROLLBACK command is the transactional command used to undo transactions that have not already been saved to the database.  This command can only be used to undo transactions since the last COMMIT or ROLLBACK command was issued.  DELETE FROM CUSTOMERS WHERE AGE = 25;
  • 15. DCL : Grant & Revoke create user korth identified by henry  Connect as system/ora10g GRANT SELECT, INSERT, UPDATE, DELETE ON Emp_Det TO korth; REVOKE DELETE ON Emp_details FROM
  • 16. Entity Relationship Model  The ER data model facilitates database design by allowing specification of an enterprise schema that represents the overall logical structure of a database.  The E-R data model employs three basic concepts: entity sets, relationship sets, and attributes
  • 17. Entity Sets  Entity: Real-world object distinguishable from other objects. An entity is described (in DB) using a set of attributes.  Entity Set: A collection of similar entities. E.g., all employees.  All entities in an entity set have the same set of attributes.  Each entity set has a key.  Each attribute has a domain.
  • 19. Relationship Sets  Relationship: Association among two or more entities.  A relationship set is a mathematical relation among n  2 entities, each taken from entity sets {(e1, e2, … en) | e1  E1, e2  E2, …, en  En} where (e1, e2, …, en) is a relationship
  • 22. Attributes  An entity is represented by a set of attributes, that is descriptive properties possessed by all members of an entity set.Example: customer = (customer_id, customer_name, customer_street, customer_city ) loan = (loan_number, amount )
  • 23. Attribute types  Simple : Attribute is simple, if its value can not be divided into subparts. For example Std_ID, GPA.  Composite : Attribute is composite, if its value can be divided into subparts. Ex: Name: First Name; Middle Name; Last Name Address: H.No; street; city; pincode  Single-valued : Attribute is a single-valued, if it has only one value for a particular entity  Multivalued : Attribute is multivalued, if it has a set of values for a particular entity. Ex: Phone number  Derived: Attribute is a derived, if its value can be derived from the values of other related attributes or entities. Ex: Age, given dateofbirth
  • 24.
  • 25. ER Diagram Notations  Rectangles represent entity sets  Ellipses represent attributes  Diamonds represent relationship sets  Lines link attributes to entity sets and link entity sets to relationships sets
  • 26. Continued…  ER Diagram Notations  ER Diagram Examples