SlideShare une entreprise Scribd logo
1  sur  116
Télécharger pour lire hors ligne
Slide 1-4
Basic Definitions
• Database: A collection of related data.
• Data: Known facts that can be recorded and have an
implicit meaning.
• Database Management System (DBMS): A software
package/ system to facilitate the creation and
maintenance of a computerized database.
• Database System: The DBMS software together with
the data itself. Sometimes, the applications are also
included.
• SQL/SQL+/SQLServer/MySQL
• Database System/ File System
• Applications/ Advantages of DBMS
• Anomalies/ redundancy
• Types of Database
• Architecture:
– Data Abstraction/ Application/ Overall (Components Based)
• Physical/ Logical Independence
• Database Users
• Schema/ Instance
• DDL/DML/DCL
• Procedural/ Non Procedural DML
• DBMS/RDBMS
• Char/varchar/varchar2/nchar/nvarchar
• XML
Difference Between File and DBMS Operations
Difference Between File and DBMS
Database Management System
File Management System
Database management system is used when
security constraints are high.
File System is a general, easy-to-use system to
store general files which require less security
and constraints.
Data Redundancy is less in database management
system.
Data Redundancy is more in file management
system.
Data Inconsistency is less in database management
system.
Data Inconsistency is more in file system.
Centralisation is achieved in Database Management
System.
Centralisation is hard to get when it comes to
File Management System.
In Database Management System, user is unaware
of physical address where data is stored.
User locates the physical address of the files to
access data in File Management System.
Security is high in Database Management System.
Security is low in File Management System.
Database Management System stores structured
data which have well defined constraints and
interrelation.
File Management System stores unstructured
data as isolated data files/entities.
Advantages of DBMS
1. Controlling Redundancy:
2. Integrity can be enforced: Integrity of data means that data in
database is always accurate
3. Inconsistency can be avoided : When the same data is duplicated
and changes are made at one site, which is not propagated to the
other site, it gives rise to inconsistency and the two entries regarding
the same data will not agree.
4. Data can be shared
5. Standards can be enforced
6. Restricting unauthorized access
7. Providing Backup and Recovery
8. Data Model can be developed
9. Concurrency Control
Disadvantages of DBMS
• 1. Complexity
• 2. Size
• 3. Performance
• 4. Higher impact of a failure
• 5. Cost of DBMS
• 6. Additional Hardware costs
Types of Databases
Database Application Architectures
Old Modern
Database Application Architectures
Three-Tier Architecture
• A 3-tier application is an application program that
is organized into three major parts, comprising of
data access layer tier at the bottom, the
application tier (business logic) in the middle and
the client tier (Presentation) at the top and each
tier is distributed to a different place or places in
a network.
1. Presentation Layer (UI)
2. Business Logic Layer
3. Data Access Layer
Three-Tier Architecture
• User (Presentation) Tier − End-users operate on this tier and they
know nothing about any existence of the database beyond this
layer. At this layer, multiple views of the database can be provided
by the application. All views are generated by applications that
reside in the application tier.
• Application (Middle/Business) Tier − At this tier reside the
application server and the programs that access the database. For a
user, this application tier presents an abstracted view of the
database. End-users are unaware of any existence of the database
beyond the application. At the other end, the database tier is not
aware of any other user beyond the application tier. Hence, the
application layer sits in the middle and acts as a mediator between
the end-user and the database.
• Database (Data) Tier − At this tier, the database resides along with
its query processing languages. We also have the relations that
define the data and their constraints at this level.
Three-Tier Architecture
• Presentation Layer (UI)
– This layer presents data to the user and optionally permits data
manipulation and data entry, also this layer requests the data form
Business layer.
– This layer accomplished through use of Dynamic HTML and client-side
data sources and data cursors.
• Business Logic Layer
– The business logic acts as the server for client requests from
workstations.
– It acts according Business rules fetch or insert data through the Data
Layer.
– In turn, it determines what data is needed (and where it is located)
and acts as a client in relation to a third tier of programming that
might be located on a local or mainframe computer.
– Because these middle-tier components are not tied to a specific client,
they can be used by all applications and can be moved to different
locations, as response time and other rules require.
• Data Access Layer
Three-Tier Architecture
• Presentation Layer (UI)
• Business Logic Layer
• Data Access Layer
– The third tier of the 3-tier system is made up of the
DBMS that provides all of the data for the above two
layers.
– This is the actual DBMS access layer.
– Avoiding dependencies on the storage mechanisms
allows for updates or changes without the application
tier clients being affected by or even aware of the
change.
Three Level Architecture of DBMS
20
Three Level Architecture of DBMS
View 1
Item_Name
Price
Conceptual
Item_Number Character (6)
Item_Name Character(30)
Price Numeric(5,2)
Stock Numeric(4)
Physical
Stored_Item Length=50
Item # Type = Byte(6), offset = 0, Index = Ix
Name Type = Byte(30), offset = 6
Price Type = Byte(8), offset = 36
Stock Type = Byte(4), offset = 44
External
(View)
Level
Conceptual
(Logical)
Level
Physical
Level
View 2
Item_Name
Stock
Sales Officer Inventory Controller
Three Level Architecture of DBMS
• Physical Level:
– At physical level, the information about location of
database objects in data store is kept.
– Various users are DBMS are unaware about the locations
of these objects.
• Conceptual (Logical) Level
– Data is represented in the form of various database
tables.
– For Example, STUDENT database may contain STUDENT
and COURSE tables which will be visible to users but
users are unaware about their storage.
• External (View) Level
Three Level Architecture of DBMS
• Physical Level:
• Conceptual (Logical) Level:
• External (View) Level:
– specifies a view of the data in terms of conceptual level
tables.
– Each external level view is used to cater the needs of a
particular category of users.
– For Example, FACULTY of a university is interested in
looking course details of students, STUDENTS are
interested in looking all details related to academics,
accounts, courses and hostel details as well.
– Different views can be generated for different users.
Data Independence
• Data independence means change of data at
one level should not affect another level. Two
types of data independence are required in
this architecture:
– Physical Data Independence:
– Conceptual Data Independence:
Data Independence
• Physical Data Independence:
– Any change in physical location of tables and
indexes should not affect conceptual level or
external view of data.
– This data independence is easy to achieve and
implemented by most of the DBMS.
• Conceptual Data Independence
Data Independence
• Physical Data Independence
• Conceptual Data Independence:
– The data at conceptual level schema and external
level schema must be independent.
– This means, change in conceptual schema should not
affect external schema.
– Adding or deleting attributes of a table should not
affect the user’s view of table.
– But this type of independence is difficult to achieve as
compared to physical data independence because the
changes in conceptual schema are reflected in user’s
view.
Phases of database design
• Database designing for a real world application starts from
capturing the requirements to physical implementation
using DBMS software which consists of following steps
• Conceptual Design: The requirements of database are
captured using high level conceptual data model. For
Example, ER model is used for conceptual design of
database.
• Logical Design: Logical Design represents data in the form
of relational model. ER diagram produced in conceptual
design phase is used to convert the data into Relational
Model.
• Physical Design: In physical design, data in relational model
is implemented using commercial DBMS like Oracle, DB2.
Phases of database design
Overall
System
Structure
What Is a Data Dictionary?
• Contains information about the structures in the
database
• Also called
– System Catalog
• Strictly speaking this is what Oracle has
– Meta Data
• Generic term, for data about data
– Data Repository
• Synonym for Data Dictionary used to imply stand-alone systems
• According to Codd an RDB MUST use tables for its
Data Dictionary
Slide 1-31
Database Users
• Database administrators: responsible for authorizing access
to the database, for co-ordinating and monitoring its use,
acquiring software, and hardware resources, controlling its
use and monitoring efficiency of operations.
• Database Designers: responsible to define the content, the
structure, the constraints, and functions or transactions
against the database. They must communicate with the end-
users and understand their needs.
• End-users: they use the data for queries, reports and some of
them actually update the database content.
– Naïve or Parametric : they make up a large section of the end-user
population. They use previously well-defined functions in the form
of “canned transactions” against the database. Examples are bank-
tellers or reservation clerks who do this activity for an entire shift of
operations.
– Sophisticated : these include business analysts, scientists,
engineers, others thoroughly familiar with the system capabilities.
Many use tools in the form of software packages that work closely
with the stored database.
CSC 240 (Blum) 32
Dr. Codd
12 Rules By Dr. Codd
• Rule 1: Information Rule
– The data stored in a database, may it be user data or metadata,
must be a value of some table cell. Everything in a database
must be stored in a table format.
• Rule 2: Guaranteed Access Rule
– Every single data element (value) is guaranteed to be accessible
logically with a combination of table-name, primary-key (row
value), and attribute-name (column value). No other means,
such as pointers, can be used to access data.
• Rule 3: Systematic Treatment of NULL Values
– The NULL values in a database must be given a systematic and
uniform treatment. This is a very important rule because a NULL
can be interpreted as one the following − data is missing, data is
not known, or data is not applicable.
12 Rules By Dr. Codd
• Rule 4: Active Online Catalog
– The structure description of the entire database must be stored
in an online catalog, known as data dictionary, which can be
accessed by authorized users. Users can use the same query
language to access the catalog which they use to access the
database itself.
• Rule 5: Comprehensive Data Sub-Language Rule
– A database can only be accessed using a language having linear
syntax that supports data definition, data manipulation, and
transaction management operations. This language can be used
directly or by means of some application. If the database allows
access to data without any help of this language, then it is
considered as a violation.
• Rule 6: View Updating Rule
– All the views of a database, which can theoretically be updated,
must also be updatable by the system.
12 Rules By Dr. Codd
• Rule 7: High-Level Insert, Update, and Delete Rule
– A database must support high-level insertion, updation, and
deletion. This must not be limited to a single row, that is, it must
also support union, intersection and minus operations to yield
sets of data records.
• Rule 8: Physical Data Independence
– The data stored in a database must be independent of the
applications that access the database. Any change in the
physical structure of a database must not have any impact on
how the data is being accessed by external applications.
• Rule 9: Logical Data Independence
– The logical data in a database must be independent of its user’s
view (application). Any change in logical data must not affect the
applications using it. For example, if two tables are merged or
one is split into two different tables, there should be no impact
or change on the user application. This is one of the most
difficult rule to apply.
12 Rules By Dr. Codd
• Rule 10: Integrity Independence
– A database must be independent of the application that uses it.
All its integrity constraints can be independently modified
without the need of any change in the application. This rule
makes a database independent of the front-end application and
its interface.
• Rule 11: Distribution Independence
– The end-user must not be able to see that the data is
distributed over various locations. Users should always get the
impression that the data is located at one site only. This rule has
been regarded as the foundation of distributed database
systems.
• Rule 12: Non-Subversion Rule
– If a system has an interface that provides access to low-level
records, then the interface must not be able to subvert the
system and bypass security and integrity constraints.
DBMS Vs RDBMS
37
RDBMS
DBMS
Relationship between two tables or files
can be specified at the time of table
creation
Relationship between two files or tables
maintain programmatically
Supports client/server architecture
Does not support client/server architecture
Supports Distributed Databases
Does not support Distributed database
Multilevel security
1. Logging in at OS level
2. Command level
3. Object level
No security of Data
1. RDBMS usually satisfy more than 7 or 8
rules of E.F. Codd
DBMS may satisfy less than 7 or 8 rules of
E.F. Codd
Slide 1-38
Basic Definitions
• Database: A collection of related data.
• Data: Known facts that can be recorded and have an
implicit meaning.
• Database Management System (DBMS): A software
package/ system to facilitate the creation and
maintenance of a computerized database.
• Database System: The DBMS software together with
the data itself. Sometimes, the applications are also
included.
XML: Extensible Markup Language
• Originally intended as a document markup
language not a database language
• The ability to specify new tags, and to
create nested tag structures made XML a
great way to exchange data, not just
documents
• XML has become the basis for all new
generation data interchange formats.
• A wide variety of tools is available for
parsing, browsing and querying XML
documents/data
Questions for reference.
• What is the concept of data independence and explain its importance in
database environment.
– Explain Physical level and Logical level of abstraction.
• What do you mean by database management system? Explain its
advantages/ disadvantages over file system.
– how is it possible to get more information from the same amount of data by
using a database approach as opposed to a file approach.
• Give the roles of database administrator and data base designer.
• Define Schema and Instance.
• Define redundancy. Can data redundancy be completely eliminated when
database approach is used.
– What is redundancy ? What are the problems associated with redundancy?
– What is data redundancy and which characteristics of the file systems can
lead to it.
• List all the database users. Explain sophisticated users and specialized users.
– Who are sophisticated users? Describe them.
• What is data dictionary?
Entity-Relationship(E-R)
Modeling
ER model
ER Model Stands for Entity Relationship Model
• The Entity-Relationship (ER) model was originally
proposed by Peter in 1976.
• The ER model is a conceptual data model that views
the real world as entities and relationships.
• A graphical technique for understanding and
organizing the data independent of the actual
database implementation
• The basic object that the ER model represents is an
entity.
Definition Entity
Entity - A ‘thing’ or an ‘object’ that is
distinguishable from all the other objects.
Each entity has a set of properties. For
example, each person in an enterprise is an
entity with properties person-id, name, age
etc.
Definition Entity
Entity - is a thing in the real world with an
independent existence and about which we
intend to collect data.
An entity may be an object with a physical
existence (ex a particular person, car, house,
or employee)
It may be an object with a conceptual existence
( a company, a job, or a university course)
Definition Entity Set
Entity Set - Set of entities of the same type that
share the same properties or attributes. For
example, employees of a store. Each
employee of the store share the common
properties such as empid, name, date of
joining, salary etc. This is also known as
Entity type.
Entity instance: a particular member of the
entity type e.g. a particular student
Attributes - Properties/characteristics that
describe entities.
Ex – An EMPLOYEEE entity may be described by
the employee’s name, age, address, salary
and job.
Attributes maybe single or multi-valued, simple
or composite, stored or derived.
Definition Attributes
Relationship – Is an association between
several entities. For example, a car is owned
by a person.
Relationships can be recursive. For example, a
student helps a student. Both belong to the
same entity set of students.
Definition Relationship
Definition of Attribute
Attribute – Attributes are the properties of an
Entity.
For ex- If STUSENT is an Entity set, then Roll,
Name, Gender, Age, Sem are the attributes of
a student.
Represented by ellipses connected to the entity type by straight
lines
Represented by an ellipse from which other ellipses emanate and represent the
component attributes. E.g Address.
Indicated by a double lined ellipse as shown in the figure.
NOTE – DOJ – DATE OF JOINING
YOS – YEAR OF SERVICE
EMPLOYEE
EID ENAME DOJ YOS
Note – Regular Entity is also called Strong Entity
Weak Entity is represented by double rectangle
spouse
E.G If Works-for is the relationship between the Employee entity and
the department entity, then Ram works for Comp.sc department,
shyam works –for electrical department ..etc are relationship instances
of the relationship, works-for
Relationship is represented by a diamond
symbol.
EMPLOYEE DEPT
WORKS
FOR
The relationship above is read as EMPLOYEE WORKS-FOR
DEPARTMENT
A relationship is represented as a diamond between two entity types.
It has a label that explains the relationship. Usually the convention is
to read the ER diagram from top to bottom and from left to right.
So, the relationship name is so chosen as to make sense when read
from left to right.
The relationship above is read as student enrolls-in course
A unary relationship is represented as a diamond which connects
one entity to itself as a loop.
The relationship above means, some instances of Employee
manage other instances of Employee.
A relationship between two entity types.
A relationship connecting three entity types.
Constraints on Relationship Type
Relationship type usually have certain constraints
that limit the possible combinations of entities
that may participate in the corresponding
relationship set.
For ex – if the company has a rule that each
employee must work for exactly one
department, then we would like to describe this
constraint in the schema.
Two main types of relationship constraint –
– Cardinality
– Participation
The minimum and maximum values of this connectivity is called the cardinality of the
relationship
Cardinality – Specifies how many instances of an entity relate to
one instance of another entity
EMPLOYEE DEPT
WORKS
FOR
1 1
1 TO 1
1 TO 1
PERSON CHAIR
SITS ON
1 1
1 TO MANY
ORGANIZATION EMPLOYEE
HAS
1 N
MANY TO 1
EMPLOYEE DEPT
WORKS
FOR
N 1
MANY TO MANY
STUDENT COURSE
ENROLLS
FOR
N N
Participation Constraint
Participation constraint specifies whether the existence of
an entity depends on its being related to another entity
via the relationship type. This specifies the minimum
number of relationship instances that each entity can
participate in.
This is of two types
Total
partial
Ex- If a company policy states that “every employee must
work for a department” then an employee entity
exists only if it participates in at least one WORK-FOR
relationship instance. Thus the participation of
EMPLOYEE in WORKS-FOR is called total participation.
All employees will not be head-of some department. So only few instances of
employee entity participate in the above relationship. But each department will be
headed by some employee. So department entity’s participation is total and
employee entity’s participation is partial in the above relationship.
•All instances of the entity type Employee don’t participate in the relationship, Head-of.
•Every employee doesn’t head a department. So, employee entity type is said to partially
participate in the relationship.
•But, every department would be headed by some employee.
•So, all instances of the entity type Department participate in this relationship. So, we say that
it is total participation from the department side.
EMPLOYEE WORKS
FOR
DEPARTMENT
Total
participation
These attributes best describe the relationship rather
than any individual entity.
The identifying relationship is the one which relates the
weak entity with the strong entity on which it depends.
Class Hierarchies
(Specialization and Generalization)
• Class hierarchies can be viewed in one of two ways:
People
--Students
Graduate
Undergraduate
Part time
Full time
--Employees
Academic
Non-academic
Permanent
Contract
Class Hierarchies
(Specialization and Generalization)
Specialization –
• It is a top-down approach.
• Specialization is the process of identifying the
subsets of a superclass (entity set) that share
some special attributes.
• In our example People entity can be
specialized into Students entity and
Employees.
Specialization –
PEOPLE
STUDENTS EMPLOYEES
IS
A
BIRDS
CROW SPARROW DUCK
IS
A
Generalization-
• It is a Bottom Up Approach
• Generalization is the process of identifying
common characteristics from a collection of
entity sets and creating a new set that
possesses these characteristics.
• In our example Students and Employees can
be generalized into People.
Aggregation
• So far we have seen that, a relationship set is
an association between entity sets.
• Sometimes we have to model a relationship
between a collection of entities and
relationships.
• For this we use the concept of Aggregation
Example of Aggregation
Suppose we have an entity set called Projects and
that each Projects entity is sponsored by one or
more departments. The Sponsors relationship set
captures this information. A department that
sponsors a project might assign employees to
monitor the sponsorship. Intuitively, Monitors
should be a relationship set that associates a
Sponsors relationship with an Employee entity.
For this we need Aggregation. This can be
illustrated with a dashed box around sponsors
used to denote aggregation
EMPLOYEE
EID NAME DID
MONITORS
PROJECTS
PID
START
_DT DID
DEPARTMENTS
EID NAME DID
SPONSORS
SINCE
DID
unit 1.pdf
unit 1.pdf
unit 1.pdf
unit 1.pdf
unit 1.pdf
unit 1.pdf
unit 1.pdf
unit 1.pdf
unit 1.pdf
unit 1.pdf
unit 1.pdf
unit 1.pdf
unit 1.pdf

Contenu connexe

Similaire à unit 1.pdf

9a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc29a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc2Mukund Trivedi
 
Database management system lecture notes
Database management system lecture notesDatabase management system lecture notes
Database management system lecture notesUTSAHSINGH2
 
CP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implementCP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implementflyinimohamed
 
Introduction to DBMS.pptx
Introduction to DBMS.pptxIntroduction to DBMS.pptx
Introduction to DBMS.pptxSreenivas R
 
Adbms 3 main characteristics of the database approach
Adbms 3 main characteristics of the database approachAdbms 3 main characteristics of the database approach
Adbms 3 main characteristics of the database approachVaibhav Khanna
 
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management systemPrerana Bhattarai
 
CHAPTER 1 Database system architecture.pptx
CHAPTER 1 Database system architecture.pptxCHAPTER 1 Database system architecture.pptx
CHAPTER 1 Database system architecture.pptxkashishy2
 
DBMS architecture &; system structure
DBMS architecture &; system  structureDBMS architecture &; system  structure
DBMS architecture &; system structureRUpaliLohar
 
A N S I S P A R C Architecture
A N S I  S P A R C  ArchitectureA N S I  S P A R C  Architecture
A N S I S P A R C ArchitectureSabeeh Ahmed
 
2nd chapter dbms.pptx
2nd chapter dbms.pptx2nd chapter dbms.pptx
2nd chapter dbms.pptxkavitha623544
 

Similaire à unit 1.pdf (20)

9a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc29a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc2
 
Database management system lecture notes
Database management system lecture notesDatabase management system lecture notes
Database management system lecture notes
 
CP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implementCP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implement
 
INTRODUCTION TO DATABASE
INTRODUCTION TO DATABASEINTRODUCTION TO DATABASE
INTRODUCTION TO DATABASE
 
Introduction to RDBMS
Introduction to RDBMSIntroduction to RDBMS
Introduction to RDBMS
 
Introduction to DBMS.pptx
Introduction to DBMS.pptxIntroduction to DBMS.pptx
Introduction to DBMS.pptx
 
Adbms 3 main characteristics of the database approach
Adbms 3 main characteristics of the database approachAdbms 3 main characteristics of the database approach
Adbms 3 main characteristics of the database approach
 
2.pptx
2.pptx2.pptx
2.pptx
 
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management system
 
DBMS-Unit-1.pptx
DBMS-Unit-1.pptxDBMS-Unit-1.pptx
DBMS-Unit-1.pptx
 
Ch1_Intro-95(1).ppt
Ch1_Intro-95(1).pptCh1_Intro-95(1).ppt
Ch1_Intro-95(1).ppt
 
CHAPTER 1 Database system architecture.pptx
CHAPTER 1 Database system architecture.pptxCHAPTER 1 Database system architecture.pptx
CHAPTER 1 Database system architecture.pptx
 
DBMS architecture &; system structure
DBMS architecture &; system  structureDBMS architecture &; system  structure
DBMS architecture &; system structure
 
dbms unit-1
dbms unit-1dbms unit-1
dbms unit-1
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Database Lecture Notes
Database Lecture NotesDatabase Lecture Notes
Database Lecture Notes
 
A N S I S P A R C Architecture
A N S I  S P A R C  ArchitectureA N S I  S P A R C  Architecture
A N S I S P A R C Architecture
 
Unit 2 DATABASE ESSENTIALS.pptx
Unit 2 DATABASE ESSENTIALS.pptxUnit 2 DATABASE ESSENTIALS.pptx
Unit 2 DATABASE ESSENTIALS.pptx
 
2nd chapter dbms.pptx
2nd chapter dbms.pptx2nd chapter dbms.pptx
2nd chapter dbms.pptx
 
Lecture 1 =Unit 1 Part 1.ppt
Lecture 1 =Unit 1 Part 1.pptLecture 1 =Unit 1 Part 1.ppt
Lecture 1 =Unit 1 Part 1.ppt
 

Dernier

Düsseldorf U学位证,杜塞尔多夫大学毕业证书1:1制作
Düsseldorf U学位证,杜塞尔多夫大学毕业证书1:1制作Düsseldorf U学位证,杜塞尔多夫大学毕业证书1:1制作
Düsseldorf U学位证,杜塞尔多夫大学毕业证书1:1制作f3774p8b
 
Slide deck for the IPCC Briefing to Latvian Parliamentarians
Slide deck for the IPCC Briefing to Latvian ParliamentariansSlide deck for the IPCC Briefing to Latvian Parliamentarians
Slide deck for the IPCC Briefing to Latvian Parliamentariansipcc-media
 
BIODIVERSITY QUIZ ELIMINATION ROUND.pptx
BIODIVERSITY QUIZ ELIMINATION ROUND.pptxBIODIVERSITY QUIZ ELIMINATION ROUND.pptx
BIODIVERSITY QUIZ ELIMINATION ROUND.pptxROLANARIBATO3
 
UNIT ONE ppt history of Ethiopia and horn.pptx
UNIT ONE ppt history of Ethiopia and horn.pptxUNIT ONE ppt history of Ethiopia and horn.pptx
UNIT ONE ppt history of Ethiopia and horn.pptxzeyohannesamare
 
Al Jaddaf Housewife Call Girls +971509530047 Al Jaddaf Call Girls
Al Jaddaf Housewife Call Girls +971509530047 Al Jaddaf Call GirlsAl Jaddaf Housewife Call Girls +971509530047 Al Jaddaf Call Girls
Al Jaddaf Housewife Call Girls +971509530047 Al Jaddaf Call Girlstiril72860
 
Gwalior Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Gwalior Call Girls 7001305949 WhatsApp Number 24x7 Best ServicesGwalior Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Gwalior Call Girls 7001305949 WhatsApp Number 24x7 Best Servicesnajka9823
 
Species composition, diversity and community structure of mangroves in Barang...
Species composition, diversity and community structure of mangroves in Barang...Species composition, diversity and community structure of mangroves in Barang...
Species composition, diversity and community structure of mangroves in Barang...Open Access Research Paper
 
9873940964 Full Enjoy 24/7 Call Girls Near Shangri La’s Eros Hotel, New Delhi
9873940964 Full Enjoy 24/7 Call Girls Near Shangri La’s Eros Hotel, New Delhi9873940964 Full Enjoy 24/7 Call Girls Near Shangri La’s Eros Hotel, New Delhi
9873940964 Full Enjoy 24/7 Call Girls Near Shangri La’s Eros Hotel, New Delhidelih Escorts
 
EMP (Environment Management Plan . .pptx
EMP (Environment Management Plan . .pptxEMP (Environment Management Plan . .pptx
EMP (Environment Management Plan . .pptxSarmad Naeem
 
Call Girls Sarovar Portico Naraina Hotel, New Delhi 9873777170
Call Girls Sarovar Portico Naraina Hotel, New Delhi 9873777170Call Girls Sarovar Portico Naraina Hotel, New Delhi 9873777170
Call Girls Sarovar Portico Naraina Hotel, New Delhi 9873777170simranguptaxx69
 
Environmental Management System - ISO 14001:2015-
Environmental Management System      - ISO 14001:2015-Environmental Management System      - ISO 14001:2015-
Environmental Management System - ISO 14001:2015-Kawther MEKNI
 
885MTAMount DMU University Bachelor's Diploma in Education
885MTAMount DMU University Bachelor's Diploma in Education885MTAMount DMU University Bachelor's Diploma in Education
885MTAMount DMU University Bachelor's Diploma in Educationz xss
 
Group 4The Species of the Atlantic Forest.pdf
Group 4The Species of the Atlantic Forest.pdfGroup 4The Species of the Atlantic Forest.pdf
Group 4The Species of the Atlantic Forest.pdfs2015004
 
5 Wondrous Places You Should Visit at Least Once in Your Lifetime (1).pdf
5 Wondrous Places You Should Visit at Least Once in Your Lifetime (1).pdf5 Wondrous Places You Should Visit at Least Once in Your Lifetime (1).pdf
5 Wondrous Places You Should Visit at Least Once in Your Lifetime (1).pdfsrivastavaakshat51
 
办理德州理工大学毕业证书TTU文凭学位证书
办理德州理工大学毕业证书TTU文凭学位证书办理德州理工大学毕业证书TTU文凭学位证书
办理德州理工大学毕业证书TTU文凭学位证书zdzoqco
 
Hi FI Call Girl Ahmedabad 7397865700 Independent Call Girls
Hi FI Call Girl Ahmedabad 7397865700 Independent Call GirlsHi FI Call Girl Ahmedabad 7397865700 Independent Call Girls
Hi FI Call Girl Ahmedabad 7397865700 Independent Call Girlsssuser7cb4ff
 
global trend Chapter 1.presentation power point
global trend Chapter 1.presentation power pointglobal trend Chapter 1.presentation power point
global trend Chapter 1.presentation power pointyohannisyohannis54
 
NO1 Certified Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil...
NO1 Certified Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil...NO1 Certified Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil...
NO1 Certified Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil...Amil baba
 

Dernier (20)

Düsseldorf U学位证,杜塞尔多夫大学毕业证书1:1制作
Düsseldorf U学位证,杜塞尔多夫大学毕业证书1:1制作Düsseldorf U学位证,杜塞尔多夫大学毕业证书1:1制作
Düsseldorf U学位证,杜塞尔多夫大学毕业证书1:1制作
 
Slide deck for the IPCC Briefing to Latvian Parliamentarians
Slide deck for the IPCC Briefing to Latvian ParliamentariansSlide deck for the IPCC Briefing to Latvian Parliamentarians
Slide deck for the IPCC Briefing to Latvian Parliamentarians
 
BIODIVERSITY QUIZ ELIMINATION ROUND.pptx
BIODIVERSITY QUIZ ELIMINATION ROUND.pptxBIODIVERSITY QUIZ ELIMINATION ROUND.pptx
BIODIVERSITY QUIZ ELIMINATION ROUND.pptx
 
UNIT ONE ppt history of Ethiopia and horn.pptx
UNIT ONE ppt history of Ethiopia and horn.pptxUNIT ONE ppt history of Ethiopia and horn.pptx
UNIT ONE ppt history of Ethiopia and horn.pptx
 
Al Jaddaf Housewife Call Girls +971509530047 Al Jaddaf Call Girls
Al Jaddaf Housewife Call Girls +971509530047 Al Jaddaf Call GirlsAl Jaddaf Housewife Call Girls +971509530047 Al Jaddaf Call Girls
Al Jaddaf Housewife Call Girls +971509530047 Al Jaddaf Call Girls
 
Gwalior Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Gwalior Call Girls 7001305949 WhatsApp Number 24x7 Best ServicesGwalior Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Gwalior Call Girls 7001305949 WhatsApp Number 24x7 Best Services
 
Species composition, diversity and community structure of mangroves in Barang...
Species composition, diversity and community structure of mangroves in Barang...Species composition, diversity and community structure of mangroves in Barang...
Species composition, diversity and community structure of mangroves in Barang...
 
9873940964 Full Enjoy 24/7 Call Girls Near Shangri La’s Eros Hotel, New Delhi
9873940964 Full Enjoy 24/7 Call Girls Near Shangri La’s Eros Hotel, New Delhi9873940964 Full Enjoy 24/7 Call Girls Near Shangri La’s Eros Hotel, New Delhi
9873940964 Full Enjoy 24/7 Call Girls Near Shangri La’s Eros Hotel, New Delhi
 
EMP (Environment Management Plan . .pptx
EMP (Environment Management Plan . .pptxEMP (Environment Management Plan . .pptx
EMP (Environment Management Plan . .pptx
 
Call Girls Sarovar Portico Naraina Hotel, New Delhi 9873777170
Call Girls Sarovar Portico Naraina Hotel, New Delhi 9873777170Call Girls Sarovar Portico Naraina Hotel, New Delhi 9873777170
Call Girls Sarovar Portico Naraina Hotel, New Delhi 9873777170
 
Environmental Management System - ISO 14001:2015-
Environmental Management System      - ISO 14001:2015-Environmental Management System      - ISO 14001:2015-
Environmental Management System - ISO 14001:2015-
 
885MTAMount DMU University Bachelor's Diploma in Education
885MTAMount DMU University Bachelor's Diploma in Education885MTAMount DMU University Bachelor's Diploma in Education
885MTAMount DMU University Bachelor's Diploma in Education
 
Group 4The Species of the Atlantic Forest.pdf
Group 4The Species of the Atlantic Forest.pdfGroup 4The Species of the Atlantic Forest.pdf
Group 4The Species of the Atlantic Forest.pdf
 
5 Wondrous Places You Should Visit at Least Once in Your Lifetime (1).pdf
5 Wondrous Places You Should Visit at Least Once in Your Lifetime (1).pdf5 Wondrous Places You Should Visit at Least Once in Your Lifetime (1).pdf
5 Wondrous Places You Should Visit at Least Once in Your Lifetime (1).pdf
 
办理德州理工大学毕业证书TTU文凭学位证书
办理德州理工大学毕业证书TTU文凭学位证书办理德州理工大学毕业证书TTU文凭学位证书
办理德州理工大学毕业证书TTU文凭学位证书
 
PLANTILLAS DE MEMORAMA CIENCIAS NATURALES
PLANTILLAS DE MEMORAMA CIENCIAS NATURALESPLANTILLAS DE MEMORAMA CIENCIAS NATURALES
PLANTILLAS DE MEMORAMA CIENCIAS NATURALES
 
FULL ENJOY Call Girls In kashmiri gate (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In  kashmiri gate (Delhi) Call Us 9953056974FULL ENJOY Call Girls In  kashmiri gate (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In kashmiri gate (Delhi) Call Us 9953056974
 
Hi FI Call Girl Ahmedabad 7397865700 Independent Call Girls
Hi FI Call Girl Ahmedabad 7397865700 Independent Call GirlsHi FI Call Girl Ahmedabad 7397865700 Independent Call Girls
Hi FI Call Girl Ahmedabad 7397865700 Independent Call Girls
 
global trend Chapter 1.presentation power point
global trend Chapter 1.presentation power pointglobal trend Chapter 1.presentation power point
global trend Chapter 1.presentation power point
 
NO1 Certified Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil...
NO1 Certified Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil...NO1 Certified Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil...
NO1 Certified Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil...
 

unit 1.pdf

  • 1.
  • 2.
  • 3.
  • 4. Slide 1-4 Basic Definitions • Database: A collection of related data. • Data: Known facts that can be recorded and have an implicit meaning. • Database Management System (DBMS): A software package/ system to facilitate the creation and maintenance of a computerized database. • Database System: The DBMS software together with the data itself. Sometimes, the applications are also included.
  • 5. • SQL/SQL+/SQLServer/MySQL • Database System/ File System • Applications/ Advantages of DBMS • Anomalies/ redundancy • Types of Database • Architecture: – Data Abstraction/ Application/ Overall (Components Based) • Physical/ Logical Independence • Database Users • Schema/ Instance • DDL/DML/DCL • Procedural/ Non Procedural DML • DBMS/RDBMS • Char/varchar/varchar2/nchar/nvarchar • XML
  • 6. Difference Between File and DBMS Operations
  • 7. Difference Between File and DBMS Database Management System File Management System Database management system is used when security constraints are high. File System is a general, easy-to-use system to store general files which require less security and constraints. Data Redundancy is less in database management system. Data Redundancy is more in file management system. Data Inconsistency is less in database management system. Data Inconsistency is more in file system. Centralisation is achieved in Database Management System. Centralisation is hard to get when it comes to File Management System. In Database Management System, user is unaware of physical address where data is stored. User locates the physical address of the files to access data in File Management System. Security is high in Database Management System. Security is low in File Management System. Database Management System stores structured data which have well defined constraints and interrelation. File Management System stores unstructured data as isolated data files/entities.
  • 8. Advantages of DBMS 1. Controlling Redundancy: 2. Integrity can be enforced: Integrity of data means that data in database is always accurate 3. Inconsistency can be avoided : When the same data is duplicated and changes are made at one site, which is not propagated to the other site, it gives rise to inconsistency and the two entries regarding the same data will not agree. 4. Data can be shared 5. Standards can be enforced 6. Restricting unauthorized access 7. Providing Backup and Recovery 8. Data Model can be developed 9. Concurrency Control
  • 9. Disadvantages of DBMS • 1. Complexity • 2. Size • 3. Performance • 4. Higher impact of a failure • 5. Cost of DBMS • 6. Additional Hardware costs
  • 13.
  • 14.
  • 15. Three-Tier Architecture • A 3-tier application is an application program that is organized into three major parts, comprising of data access layer tier at the bottom, the application tier (business logic) in the middle and the client tier (Presentation) at the top and each tier is distributed to a different place or places in a network. 1. Presentation Layer (UI) 2. Business Logic Layer 3. Data Access Layer
  • 16. Three-Tier Architecture • User (Presentation) Tier − End-users operate on this tier and they know nothing about any existence of the database beyond this layer. At this layer, multiple views of the database can be provided by the application. All views are generated by applications that reside in the application tier. • Application (Middle/Business) Tier − At this tier reside the application server and the programs that access the database. For a user, this application tier presents an abstracted view of the database. End-users are unaware of any existence of the database beyond the application. At the other end, the database tier is not aware of any other user beyond the application tier. Hence, the application layer sits in the middle and acts as a mediator between the end-user and the database. • Database (Data) Tier − At this tier, the database resides along with its query processing languages. We also have the relations that define the data and their constraints at this level.
  • 17. Three-Tier Architecture • Presentation Layer (UI) – This layer presents data to the user and optionally permits data manipulation and data entry, also this layer requests the data form Business layer. – This layer accomplished through use of Dynamic HTML and client-side data sources and data cursors. • Business Logic Layer – The business logic acts as the server for client requests from workstations. – It acts according Business rules fetch or insert data through the Data Layer. – In turn, it determines what data is needed (and where it is located) and acts as a client in relation to a third tier of programming that might be located on a local or mainframe computer. – Because these middle-tier components are not tied to a specific client, they can be used by all applications and can be moved to different locations, as response time and other rules require. • Data Access Layer
  • 18. Three-Tier Architecture • Presentation Layer (UI) • Business Logic Layer • Data Access Layer – The third tier of the 3-tier system is made up of the DBMS that provides all of the data for the above two layers. – This is the actual DBMS access layer. – Avoiding dependencies on the storage mechanisms allows for updates or changes without the application tier clients being affected by or even aware of the change.
  • 20. 20 Three Level Architecture of DBMS View 1 Item_Name Price Conceptual Item_Number Character (6) Item_Name Character(30) Price Numeric(5,2) Stock Numeric(4) Physical Stored_Item Length=50 Item # Type = Byte(6), offset = 0, Index = Ix Name Type = Byte(30), offset = 6 Price Type = Byte(8), offset = 36 Stock Type = Byte(4), offset = 44 External (View) Level Conceptual (Logical) Level Physical Level View 2 Item_Name Stock Sales Officer Inventory Controller
  • 21. Three Level Architecture of DBMS • Physical Level: – At physical level, the information about location of database objects in data store is kept. – Various users are DBMS are unaware about the locations of these objects. • Conceptual (Logical) Level – Data is represented in the form of various database tables. – For Example, STUDENT database may contain STUDENT and COURSE tables which will be visible to users but users are unaware about their storage. • External (View) Level
  • 22. Three Level Architecture of DBMS • Physical Level: • Conceptual (Logical) Level: • External (View) Level: – specifies a view of the data in terms of conceptual level tables. – Each external level view is used to cater the needs of a particular category of users. – For Example, FACULTY of a university is interested in looking course details of students, STUDENTS are interested in looking all details related to academics, accounts, courses and hostel details as well. – Different views can be generated for different users.
  • 23. Data Independence • Data independence means change of data at one level should not affect another level. Two types of data independence are required in this architecture: – Physical Data Independence: – Conceptual Data Independence:
  • 24. Data Independence • Physical Data Independence: – Any change in physical location of tables and indexes should not affect conceptual level or external view of data. – This data independence is easy to achieve and implemented by most of the DBMS. • Conceptual Data Independence
  • 25. Data Independence • Physical Data Independence • Conceptual Data Independence: – The data at conceptual level schema and external level schema must be independent. – This means, change in conceptual schema should not affect external schema. – Adding or deleting attributes of a table should not affect the user’s view of table. – But this type of independence is difficult to achieve as compared to physical data independence because the changes in conceptual schema are reflected in user’s view.
  • 26. Phases of database design • Database designing for a real world application starts from capturing the requirements to physical implementation using DBMS software which consists of following steps • Conceptual Design: The requirements of database are captured using high level conceptual data model. For Example, ER model is used for conceptual design of database. • Logical Design: Logical Design represents data in the form of relational model. ER diagram produced in conceptual design phase is used to convert the data into Relational Model. • Physical Design: In physical design, data in relational model is implemented using commercial DBMS like Oracle, DB2.
  • 28.
  • 30. What Is a Data Dictionary? • Contains information about the structures in the database • Also called – System Catalog • Strictly speaking this is what Oracle has – Meta Data • Generic term, for data about data – Data Repository • Synonym for Data Dictionary used to imply stand-alone systems • According to Codd an RDB MUST use tables for its Data Dictionary
  • 31. Slide 1-31 Database Users • Database administrators: responsible for authorizing access to the database, for co-ordinating and monitoring its use, acquiring software, and hardware resources, controlling its use and monitoring efficiency of operations. • Database Designers: responsible to define the content, the structure, the constraints, and functions or transactions against the database. They must communicate with the end- users and understand their needs. • End-users: they use the data for queries, reports and some of them actually update the database content. – Naïve or Parametric : they make up a large section of the end-user population. They use previously well-defined functions in the form of “canned transactions” against the database. Examples are bank- tellers or reservation clerks who do this activity for an entire shift of operations. – Sophisticated : these include business analysts, scientists, engineers, others thoroughly familiar with the system capabilities. Many use tools in the form of software packages that work closely with the stored database.
  • 32. CSC 240 (Blum) 32 Dr. Codd
  • 33. 12 Rules By Dr. Codd • Rule 1: Information Rule – The data stored in a database, may it be user data or metadata, must be a value of some table cell. Everything in a database must be stored in a table format. • Rule 2: Guaranteed Access Rule – Every single data element (value) is guaranteed to be accessible logically with a combination of table-name, primary-key (row value), and attribute-name (column value). No other means, such as pointers, can be used to access data. • Rule 3: Systematic Treatment of NULL Values – The NULL values in a database must be given a systematic and uniform treatment. This is a very important rule because a NULL can be interpreted as one the following − data is missing, data is not known, or data is not applicable.
  • 34. 12 Rules By Dr. Codd • Rule 4: Active Online Catalog – The structure description of the entire database must be stored in an online catalog, known as data dictionary, which can be accessed by authorized users. Users can use the same query language to access the catalog which they use to access the database itself. • Rule 5: Comprehensive Data Sub-Language Rule – A database can only be accessed using a language having linear syntax that supports data definition, data manipulation, and transaction management operations. This language can be used directly or by means of some application. If the database allows access to data without any help of this language, then it is considered as a violation. • Rule 6: View Updating Rule – All the views of a database, which can theoretically be updated, must also be updatable by the system.
  • 35. 12 Rules By Dr. Codd • Rule 7: High-Level Insert, Update, and Delete Rule – A database must support high-level insertion, updation, and deletion. This must not be limited to a single row, that is, it must also support union, intersection and minus operations to yield sets of data records. • Rule 8: Physical Data Independence – The data stored in a database must be independent of the applications that access the database. Any change in the physical structure of a database must not have any impact on how the data is being accessed by external applications. • Rule 9: Logical Data Independence – The logical data in a database must be independent of its user’s view (application). Any change in logical data must not affect the applications using it. For example, if two tables are merged or one is split into two different tables, there should be no impact or change on the user application. This is one of the most difficult rule to apply.
  • 36. 12 Rules By Dr. Codd • Rule 10: Integrity Independence – A database must be independent of the application that uses it. All its integrity constraints can be independently modified without the need of any change in the application. This rule makes a database independent of the front-end application and its interface. • Rule 11: Distribution Independence – The end-user must not be able to see that the data is distributed over various locations. Users should always get the impression that the data is located at one site only. This rule has been regarded as the foundation of distributed database systems. • Rule 12: Non-Subversion Rule – If a system has an interface that provides access to low-level records, then the interface must not be able to subvert the system and bypass security and integrity constraints.
  • 37. DBMS Vs RDBMS 37 RDBMS DBMS Relationship between two tables or files can be specified at the time of table creation Relationship between two files or tables maintain programmatically Supports client/server architecture Does not support client/server architecture Supports Distributed Databases Does not support Distributed database Multilevel security 1. Logging in at OS level 2. Command level 3. Object level No security of Data 1. RDBMS usually satisfy more than 7 or 8 rules of E.F. Codd DBMS may satisfy less than 7 or 8 rules of E.F. Codd
  • 38. Slide 1-38 Basic Definitions • Database: A collection of related data. • Data: Known facts that can be recorded and have an implicit meaning. • Database Management System (DBMS): A software package/ system to facilitate the creation and maintenance of a computerized database. • Database System: The DBMS software together with the data itself. Sometimes, the applications are also included.
  • 39. XML: Extensible Markup Language • Originally intended as a document markup language not a database language • The ability to specify new tags, and to create nested tag structures made XML a great way to exchange data, not just documents • XML has become the basis for all new generation data interchange formats. • A wide variety of tools is available for parsing, browsing and querying XML documents/data
  • 40. Questions for reference. • What is the concept of data independence and explain its importance in database environment. – Explain Physical level and Logical level of abstraction. • What do you mean by database management system? Explain its advantages/ disadvantages over file system. – how is it possible to get more information from the same amount of data by using a database approach as opposed to a file approach. • Give the roles of database administrator and data base designer. • Define Schema and Instance. • Define redundancy. Can data redundancy be completely eliminated when database approach is used. – What is redundancy ? What are the problems associated with redundancy? – What is data redundancy and which characteristics of the file systems can lead to it. • List all the database users. Explain sophisticated users and specialized users. – Who are sophisticated users? Describe them. • What is data dictionary?
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 50. ER model ER Model Stands for Entity Relationship Model • The Entity-Relationship (ER) model was originally proposed by Peter in 1976. • The ER model is a conceptual data model that views the real world as entities and relationships. • A graphical technique for understanding and organizing the data independent of the actual database implementation • The basic object that the ER model represents is an entity.
  • 51. Definition Entity Entity - A ‘thing’ or an ‘object’ that is distinguishable from all the other objects. Each entity has a set of properties. For example, each person in an enterprise is an entity with properties person-id, name, age etc.
  • 52. Definition Entity Entity - is a thing in the real world with an independent existence and about which we intend to collect data. An entity may be an object with a physical existence (ex a particular person, car, house, or employee) It may be an object with a conceptual existence ( a company, a job, or a university course)
  • 53. Definition Entity Set Entity Set - Set of entities of the same type that share the same properties or attributes. For example, employees of a store. Each employee of the store share the common properties such as empid, name, date of joining, salary etc. This is also known as Entity type. Entity instance: a particular member of the entity type e.g. a particular student
  • 54. Attributes - Properties/characteristics that describe entities. Ex – An EMPLOYEEE entity may be described by the employee’s name, age, address, salary and job. Attributes maybe single or multi-valued, simple or composite, stored or derived. Definition Attributes
  • 55.
  • 56. Relationship – Is an association between several entities. For example, a car is owned by a person. Relationships can be recursive. For example, a student helps a student. Both belong to the same entity set of students. Definition Relationship
  • 57. Definition of Attribute Attribute – Attributes are the properties of an Entity. For ex- If STUSENT is an Entity set, then Roll, Name, Gender, Age, Sem are the attributes of a student.
  • 58.
  • 59. Represented by ellipses connected to the entity type by straight lines
  • 60.
  • 61.
  • 62. Represented by an ellipse from which other ellipses emanate and represent the component attributes. E.g Address.
  • 63.
  • 64. Indicated by a double lined ellipse as shown in the figure.
  • 65.
  • 66. NOTE – DOJ – DATE OF JOINING YOS – YEAR OF SERVICE EMPLOYEE EID ENAME DOJ YOS
  • 67. Note – Regular Entity is also called Strong Entity Weak Entity is represented by double rectangle spouse
  • 68. E.G If Works-for is the relationship between the Employee entity and the department entity, then Ram works for Comp.sc department, shyam works –for electrical department ..etc are relationship instances of the relationship, works-for
  • 69. Relationship is represented by a diamond symbol. EMPLOYEE DEPT WORKS FOR The relationship above is read as EMPLOYEE WORKS-FOR DEPARTMENT
  • 70. A relationship is represented as a diamond between two entity types. It has a label that explains the relationship. Usually the convention is to read the ER diagram from top to bottom and from left to right. So, the relationship name is so chosen as to make sense when read from left to right. The relationship above is read as student enrolls-in course
  • 71.
  • 72. A unary relationship is represented as a diamond which connects one entity to itself as a loop. The relationship above means, some instances of Employee manage other instances of Employee.
  • 73.
  • 74. A relationship between two entity types.
  • 75. A relationship connecting three entity types.
  • 76. Constraints on Relationship Type Relationship type usually have certain constraints that limit the possible combinations of entities that may participate in the corresponding relationship set. For ex – if the company has a rule that each employee must work for exactly one department, then we would like to describe this constraint in the schema. Two main types of relationship constraint – – Cardinality – Participation
  • 77. The minimum and maximum values of this connectivity is called the cardinality of the relationship Cardinality – Specifies how many instances of an entity relate to one instance of another entity
  • 78.
  • 80. 1 TO 1 PERSON CHAIR SITS ON 1 1
  • 81.
  • 82. 1 TO MANY ORGANIZATION EMPLOYEE HAS 1 N
  • 83.
  • 84. MANY TO 1 EMPLOYEE DEPT WORKS FOR N 1
  • 85.
  • 86. MANY TO MANY STUDENT COURSE ENROLLS FOR N N
  • 87. Participation Constraint Participation constraint specifies whether the existence of an entity depends on its being related to another entity via the relationship type. This specifies the minimum number of relationship instances that each entity can participate in. This is of two types Total partial Ex- If a company policy states that “every employee must work for a department” then an employee entity exists only if it participates in at least one WORK-FOR relationship instance. Thus the participation of EMPLOYEE in WORKS-FOR is called total participation.
  • 88. All employees will not be head-of some department. So only few instances of employee entity participate in the above relationship. But each department will be headed by some employee. So department entity’s participation is total and employee entity’s participation is partial in the above relationship.
  • 89. •All instances of the entity type Employee don’t participate in the relationship, Head-of. •Every employee doesn’t head a department. So, employee entity type is said to partially participate in the relationship. •But, every department would be headed by some employee. •So, all instances of the entity type Department participate in this relationship. So, we say that it is total participation from the department side.
  • 91. These attributes best describe the relationship rather than any individual entity.
  • 92. The identifying relationship is the one which relates the weak entity with the strong entity on which it depends.
  • 93.
  • 94.
  • 95. Class Hierarchies (Specialization and Generalization) • Class hierarchies can be viewed in one of two ways: People --Students Graduate Undergraduate Part time Full time --Employees Academic Non-academic Permanent Contract
  • 96. Class Hierarchies (Specialization and Generalization) Specialization – • It is a top-down approach. • Specialization is the process of identifying the subsets of a superclass (entity set) that share some special attributes. • In our example People entity can be specialized into Students entity and Employees.
  • 99. Generalization- • It is a Bottom Up Approach • Generalization is the process of identifying common characteristics from a collection of entity sets and creating a new set that possesses these characteristics. • In our example Students and Employees can be generalized into People.
  • 100.
  • 101. Aggregation • So far we have seen that, a relationship set is an association between entity sets. • Sometimes we have to model a relationship between a collection of entities and relationships. • For this we use the concept of Aggregation
  • 102. Example of Aggregation Suppose we have an entity set called Projects and that each Projects entity is sponsored by one or more departments. The Sponsors relationship set captures this information. A department that sponsors a project might assign employees to monitor the sponsorship. Intuitively, Monitors should be a relationship set that associates a Sponsors relationship with an Employee entity. For this we need Aggregation. This can be illustrated with a dashed box around sponsors used to denote aggregation
  • 103. EMPLOYEE EID NAME DID MONITORS PROJECTS PID START _DT DID DEPARTMENTS EID NAME DID SPONSORS SINCE DID