0 ratings 0% found this document useful (0 votes) 5 views 11 pages 3.relational Data Model
The relational data model, developed in the 1970s, has become the dominant database model, replacing older models like hierarchical and network models. It is based on set theory and predicate logic, consisting of structural components, manipulative components, and integrity constraints to ensure data accuracy and consistency. The model represents data through relations, which include schemas and instances, and employs various integrity constraints to maintain the correctness of the database.
AI-enhanced title and description
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
the relational data model in 1970. At that time
‘two older data models (hierarchical model and netwo
ed the database field and largely supplanted these e
model is by far the dominant data model and is the foundation for the lead
els, including IBM's DB2 family, Informix, Oracle, Sybase, Microsofts Access and SC
r, Fox Base, and Paradox. Relational database systems are ubiquitous in the marketplace
present a multibillion dollar industry. The first such relational database system (notably
GRES and System/R) was developed in 1970s.
"Relational model is based on branch of mathematics called set theory and predicate logic and
jncludes three components: structural components (Data structures), manipulative components (data
manipulation), and integrity constraints. Entity types and relationships between them are included
structural component. Manipulative component consists of set operations that are performed
“onttables or group of tables. Integrity constraints are a Sét of rules that governs entity types and
fonships and hence helps in maintaining correctness of database. Data is represented in.
model by using concepts of theory and reasoning is done by using two-valued
(true/false) or three-valued (true/false/ null) predicate logic. ekg eee
3.2Structure of Relational Databases
Therelational model represents both data and the relationships among those data
using relation. A relatiomis used to represent information about any entity (such as book,
| piblisher, author, etc.) and its relationship with other entities in the form of (or fie
© columns) and tuples’ (or rows). A relation comprises of a relation schema.
‘A relation schema (also termed as relation intension) depicts the at
tion instance (also termed as relation extension) is a two-dimensional
jarying set of tuples.
schema consists of a relation name R and a set of attributes (or fields) At, Aa)»
ited by R (Ar, Az ww Asjand is used to describe a relationR. A
AR Re} together with a set of integrity constraints:
relational database schema. For example, the relational
schemas: Book, Publisher, Author, Written-By, and
Scanned with CamScannerrelational database schema'S =(Ri, Roy
‘each relation instance ris a state of co
instance must satisfy the integrity
For example, a relational database
Arelational database instance s of
relation instances (ti, t ..» Talsuch that
-relation schema Rj. In addition, each relation
specified in the relational database schema.
corresponding to the Book schema is shown below:
Book
ee
Category
(CH Programming Text Book
Numerical Methods Text Book
Java Programming RefBook | 725__| 567 2013
Data Structures RefBook | 350__| 258 2010
Bhaya Drama 70 2 1967.
Ecommerce Ref Book | 450 __| 460 2011
DBMS RefBook | 400__| 480 2011
Pagal Manchhe Novel 60 210 1988
Ghumauro Novel m10__| 254 2006
’ Phrahari Bhai Nibandh
Pyne
Hometown Email
Kanchanpur | Chandani arjunsaud@edesiteduunp.
‘A02 | DilliP Sharma | Baglung | Payupata dillisharma@[Link]
A03_| Bikram Bohara | Darchula | Sarmoli | bbikram@[Link]
Ao4 | Biplav Neupane [Dang | Ghorahi | nbiplav@[Link]
A05 | SaimalSingh Saud | Kailali | Tarana | ssaimal@[Link]
| Kanchanpur _ | Tribeni | anishabst@[Link]
A07 | Bimala Giri [ Dharan | Bhedet.
Publisher
| bimalagiri@[Link]
kicpub@[Link]
| Kathmandu sajhapub@[Link]
| Kathmandu himalyapub@[Link]
Api [ Dipayal apipub@[Link]
Khaptad [ Dhangadhi khaptadpub@[Link]
Pokhara bidhipub@ [Link]
Scanned with CamScanner‘ensures that the data in the database is consistent, accurate, correct, and vi
to the set of zules defined by the database administrator and
the invalid information into. database. Data integrity is of four types: domain
Gtegrity, entity integrity, referential integrity, and semantic integrity. Generally, domain integrity 15 .
applied on the attrigute; entity integrity is applied on the tuple; referential integrity is applied
4 PRR
‘onthe relation; and semantic integrity ensures logical data in the database. 2
" 3.3.1Entity Integrity 4s
entity integrity constraint states that no primary key (nor any part of the
| Balue can be null. This is because the primary key value is used to identify individi
; oon Having null value for the primary key implies that we cannot identify some tuples:
also specifies that there may not be any duplicate entries in primary key column.
2Referential Integrity ar Perea
referential integrity constraint is specified between two relations and is used to,
istency among tuples in the two relations. Informally, the referential
that a tuple in one relation that refers to another relation must refer to any
elation. It is a rule that maintains consistency among the rows of th
amples of Referential integrity constraint in the Customer/Order database:
(custid, custname) :
ID, custid, OrderDate)
that there are no orphan records, we need to enforce
‘one whose foreign key value is not found in the
Scanned with CamScannerraint specification language may have to be used to express
nd assertions to allow for some of these.
a Diagram
tion of database schema where different tables
diagram is a visual representat
hips are shown clearly. It also shows all primary Keys, foreign keys and
‘applied to attributes of relations. In schema diagram many to many relation
~ are also shown by using relations or tables. Schema diagrams are close to
"implementation of database in relation database management system. Consider the dat
‘schema given below:.
Book (ISBN, Title, Category, Price, Pages, Year, Pid)
Publisher (Pid, Prame, City, Email)
Author (Aid, Aname, District, Hometown, Email)
Written-By (Aid, ISBN)
Reviewed-By (Rid, ISBN, Rating)
‘Schema diagram of above database schema is given in the figure below:
Scanned with CamScannerto the reason that both the models represent the real world logically and
principles. This section shows the steps to translate an E-R database
ction of relation schema. on pene
pping Strong Entity Sets
set is mapped to a relation in a straightforward way: Each simple
set becomes an attribute (column) of the table and primary key of the entity s
Scanned with CamScannerMapping Composite and Muti-valued Attributes a
a attribute (column) is created for
ponent attributes of the composite
ted with primary key of the entity s
If an entity has composite attributes, no separate
attribute itself rather columns are created for comy
For a multivalued attribute, separate relation is creat
Step 3:Representing Weak Entity Sets
A weak entity set does not have its own primary key and always participates in one-to-mar
relationship with owner entity set and has total participation. For a weak entity set ereate
relation that contains all simple attributes (or simple components of composite attributes).
addition, relation for weak entity set contains primary Key of the owner entity set as foreign
and its primary key is formed by combining partial key (discriminator) and primary key,
owner entity set.
Scanned with CamScanner[etn Coe eee
ep 5: Representing One-to-Many/Many-to-One Relationships
binary one-to-many relationship include primary key of one side entity set into.
y set 2 key. Separate relation is created for the relationship set o
ip set has its own attributes.
Scanned with CamScannerA nae Cres
Step 7: Representing N-ary Relationships
For each n-ary relationship set for n>2, a new relation is created. Primary
Participating entity sets are included in the relation as foreign key attributes,
simple attributes of the n-ary relationship set (or simple components of eo
are included as attributes of the relation.
ae
Scanned with CamScannereen)
ssenting Specialization/Generalization
ther approach is to create relations only for lower level entity sets. H
entity set includes all attributes of superclass entity set
is possible only when subclasses are disjoint and co
Scanned with CamScannerScanned with CamScannermodel is based on the branches of .....
Scanned with CamScanner