You are on page 1of 22

Unit 3

Data Modeling and Database Design
What is a Database Management System?
• A database is a collection of logically related information.
• Database Management is the task of maintaining databases so that information is readily
available.
• The software required to perform the task of database management is called a Database
Management ystem !D"M#.
Learning Objectives
$. Differentiate between data modeling and database models
%. &ist e'amples of database models
3. Describe the use of various database models !linked to #7#
(. Model data base systems using the )ntity *elationship !).*# model
5. Describe the various types of database relationshis !one"to"one# one"to"many# many"to"
one# many"to"many$
+. ,overt designs from the )* model to a relational database
7. Discuss the various database models !hierarchical# net%ork# semantic"object model#
relational model$
-. Model data base systems using emantic .b/ect model
0. Transform semantic ob/ects to relational database designs
$1. Describe the types of relationships between entities
$$. &ist and e'plain the properties of relational tables
$%. 2rite tables in standard notation
$3. 3mplement a design using a relational database
$(. )'plain the role of the database administrator


&. Di''erentiate bet%een data modeling and database models
What are Data Models?
3n layman terms4 a data model is (sed to organi)e data. Data models are a logical representation of
the business processes in a organi5ation.
Data Model defines how the business interacts with people4 places4 and things. The data model is used as
a reference point for determining the rules of relationships between entities within an organi5ation.
What is Data modeling?
Data modeling is the process of structuring and organi5ing data.
What are Database Models?
A database model is a theory or specification describing how a database is structured and used.
Several such models have been suggested.

The common models include
Network Model - Any links supporting quick access.
Hierarchical Model - Links but no cycles (hierarchy).
Relational Model - Data Independence.
Object Oriented Model - Entity Abstraction.

Data Model or Database Model
Database Model is the theoretical structure of a database and in which manner data can stored, organized,
and manipulated in a database system. Finally we can
data. In database data are stored in a table. Each table has row and column. Row means record and
column means field.

6undamentally a database should be easy to use and must maintain the integrity of the d
fashion. A strong database model will also enable various ways to manage4 control4 and organi5e the
stored information to effectively e'ecute multiple key tasks. 3n the design phase4 database diagrams will
provide needed documentation of th
"elow is a list of the most common database modeling methods. Do note that4 depending on the type of
data and end user needs when accessing the database4 it7s possible to employ multiple models to create
a more sophisticated database design. .f course4 in either scenario4 the production of database diagrams
would be required to establish and maintain high operational standards. &uckily turn
and design tools like ,reately can make this effort a bree5e.
6rom the below mentioned models the relational model is the most commonly used model for most
database designs. "ut in some special cases other models can be more benef
support all the models.
• *elational Model8 6ounded on mathematical theory4 this database model takes information storage
and retrieval to a new level because it offers a way to find and understand different relationships
between the data. "y looking at how different variables can change the relationship between the data4
new perspectives can be gained as the information7s presentation is altered by focusing on different
attributes or domains. These models can often be found within
databases.
*elational design method4 the most popular database design method
• +rah Model8 9raph model is another model that is gaining popularity. These databases are created
based on the 9raph theory and used nodes
similar to ob/ect oriented applications. 9raph databases are generally easier to scale and usually
perform faster for associative data sets.
• ,ierarchical Model8 Much like the common organi5ational char
database model has the same tree
looking at data efficiency4 this is an ideal model where the data contains nested and sorted
information4 but it can be inefficient when the data does not have an upward link to a main data point
or sub/ect. This model works well for an employee information management system in a company that
seeks to restrict or assign equipment usage to certain individuals and:or departments
Data Model or Database Model
Database Model is the theoretical structure of a database and in which manner data can stored, organized,
and manipulated in a database system. Finally we can say Data model is a process to store and retrieve
data. In database data are stored in a table. Each table has row and column. Row means record and
6undamentally a database should be easy to use and must maintain the integrity of the d
fashion. A strong database model will also enable various ways to manage4 control4 and organi5e the
stored information to effectively e'ecute multiple key tasks. 3n the design phase4 database diagrams will
provide needed documentation of the data links that facilitate database functionality.
"elow is a list of the most common database modeling methods. Do note that4 depending on the type of
data and end user needs when accessing the database4 it7s possible to employ multiple models to create
a more sophisticated database design. .f course4 in either scenario4 the production of database diagrams
would be required to establish and maintain high operational standards. &uckily turn
can make this effort a bree5e.
6rom the below mentioned models the relational model is the most commonly used model for most
database designs. "ut in some special cases other models can be more beneficial. 6ortunately ,reately
8 6ounded on mathematical theory4 this database model takes information storage
and retrieval to a new level because it offers a way to find and understand different relationships
the data. "y looking at how different variables can change the relationship between the data4
new perspectives can be gained as the information7s presentation is altered by focusing on different
attributes or domains. These models can often be found within airline reservation systems or bank
*elational design method4 the most popular database design method
8 9raph model is another model that is gaining popularity. These databases are created
based on the 9raph theory and used nodes and edges to represent data. The structure is somewhat
similar to ob/ect oriented applications. 9raph databases are generally easier to scale and usually
perform faster for associative data sets.
8 Much like the common organi5ational chart used to organi5e companies4 this
database model has the same tree;like appearance and is often used to structure <M& documents. 3n
looking at data efficiency4 this is an ideal model where the data contains nested and sorted
fficient when the data does not have an upward link to a main data point
or sub/ect. This model works well for an employee information management system in a company that
seeks to restrict or assign equipment usage to certain individuals and:or departments
Database Model is the theoretical structure of a database and in which manner data can stored, organized,
say Data model is a process to store and retrieve
data. In database data are stored in a table. Each table has row and column. Row means record and
6undamentally a database should be easy to use and must maintain the integrity of the data in a secure
fashion. A strong database model will also enable various ways to manage4 control4 and organi5e the
stored information to effectively e'ecute multiple key tasks. 3n the design phase4 database diagrams will
e data links that facilitate database functionality.
"elow is a list of the most common database modeling methods. Do note that4 depending on the type of
data and end user needs when accessing the database4 it7s possible to employ multiple models to create
a more sophisticated database design. .f course4 in either scenario4 the production of database diagrams
would be required to establish and maintain high operational standards. &uckily turn;key diagramming
6rom the below mentioned models the relational model is the most commonly used model for most
icial. 6ortunately ,reately
8 6ounded on mathematical theory4 this database model takes information storage
and retrieval to a new level because it offers a way to find and understand different relationships
the data. "y looking at how different variables can change the relationship between the data4
new perspectives can be gained as the information7s presentation is altered by focusing on different
airline reservation systems or bank

*elational design method4 the most popular database design method
8 9raph model is another model that is gaining popularity. These databases are created
and edges to represent data. The structure is somewhat
similar to ob/ect oriented applications. 9raph databases are generally easier to scale and usually
t used to organi5e companies4 this
like appearance and is often used to structure <M& documents. 3n
looking at data efficiency4 this is an ideal model where the data contains nested and sorted
fficient when the data does not have an upward link to a main data point
or sub/ect. This model works well for an employee information management system in a company that
seeks to restrict or assign equipment usage to certain individuals and:or departments.
=ierarchical method4 the very first database design model
• -et%ork Model8 Using records and sets4 this model uses a one
data records. Multiple branches are allocated for lower
connected by multiple nodes4 which represent higher
database modeling method provides an efficient way to retrieve information and organi5e the data so
that it can be looked at multiple ways4 providing a m
reaction time. This is a viable model for planning road4 train4 or utility networks.
The network model where a node can have multiple parent nodes
• Dimensional Model8 This is an adaptation of the relational mode
with it by adding the >dimension? of fact to the data points. Those facts can be used as measuring
sticks for the other data to determine how a si5e of a group or the timing of a group impacted upon
certain results. This can help a business make more effective strategic decisions and help them get to
know their target audience. These models can be useful to organi5ations with sales and profit analysis.
• Object *elational Model8 These models have created an entirely new type
combines database design with application program to solve specific technical problems while
leveraging the best of both worlds. To date4 ob/ect databases still need to be refined to achieve greater
standardi5ation. *eal world applicati
engineering and molecular biology.
@o matter which database modeling method you choose4 it7s imperative to develop related diagrams to
visuali5e the desired flow and functionality to e
effective way possible. The right diagram will reduce revisions and rework because you can test the
proposed design before putting in the time and e'pense of actually creating it. Diagrams are also a
effective communication tool4 particular for large teams4 as they facilitate clear and quick communication.
2hether you prefer a desktop software4 9oogle App4 or 2eb
need to make collaborative diagramming ea
of any diagram type like flowcharts4 mindmaps4 wireframes and UM&. ,reately also provides plug
popular platforms4 including ,onfluence4 A3*A and 6og"ug54 to e'pand their capabilities to support the
development of database diagrams.





=ierarchical method4 the very first database design model
8 Using records and sets4 this model uses a one;to;many relationship approach for the
data records. Multiple branches are allocated for lower;level structures and branches that are
connected by multiple nodes4 which represent higher;level structures within the information. This
database modeling method provides an efficient way to retrieve information and organi5e the data so
that it can be looked at multiple ways4 providing a means of increasing business performance and
reaction time. This is a viable model for planning road4 train4 or utility networks.
The network model where a node can have multiple parent nodes
8 This is an adaptation of the relational model and is often used in con/unction
with it by adding the >dimension? of fact to the data points. Those facts can be used as measuring
sticks for the other data to determine how a si5e of a group or the timing of a group impacted upon
can help a business make more effective strategic decisions and help them get to
know their target audience. These models can be useful to organi5ations with sales and profit analysis.
8 These models have created an entirely new type of database4 which
combines database design with application program to solve specific technical problems while
leveraging the best of both worlds. To date4 ob/ect databases still need to be refined to achieve greater
standardi5ation. *eal world applications of this model often include technical or scientific fields4 such as
engineering and molecular biology.
@o matter which database modeling method you choose4 it7s imperative to develop related diagrams to
visuali5e the desired flow and functionality to ensure the database is designed in the most efficient and
effective way possible. The right diagram will reduce revisions and rework because you can test the
proposed design before putting in the time and e'pense of actually creating it. Diagrams are also a
effective communication tool4 particular for large teams4 as they facilitate clear and quick communication.
2hether you prefer a desktop software4 9oogle App4 or 2eb;based application4 ,reately has what you
need to make collaborative diagramming easy4 including free database diagram templates
of any diagram type like flowcharts4 mindmaps4 wireframes and UM&. ,reately also provides plug
lar platforms4 including ,onfluence4 A3*A and 6og"ug54 to e'pand their capabilities to support the
development of database diagrams.

=ierarchical method4 the very first database design model
many relationship approach for the
level structures and branches that are then
level structures within the information. This
database modeling method provides an efficient way to retrieve information and organi5e the data so
eans of increasing business performance and
reaction time. This is a viable model for planning road4 train4 or utility networks.

The network model where a node can have multiple parent nodes
l and is often used in con/unction
with it by adding the >dimension? of fact to the data points. Those facts can be used as measuring
sticks for the other data to determine how a si5e of a group or the timing of a group impacted upon
can help a business make more effective strategic decisions and help them get to
know their target audience. These models can be useful to organi5ations with sales and profit analysis.
of database4 which
combines database design with application program to solve specific technical problems while
leveraging the best of both worlds. To date4 ob/ect databases still need to be refined to achieve greater
ons of this model often include technical or scientific fields4 such as
@o matter which database modeling method you choose4 it7s imperative to develop related diagrams to
nsure the database is designed in the most efficient and
effective way possible. The right diagram will reduce revisions and rework because you can test the
proposed design before putting in the time and e'pense of actually creating it. Diagrams are also a highly
effective communication tool4 particular for large teams4 as they facilitate clear and quick communication.
based application4 ,reately has what you
database diagram templates and e'amples
of any diagram type like flowcharts4 mindmaps4 wireframes and UM&. ,reately also provides plug;ins to
lar platforms4 including ,onfluence4 A3*A and 6og"ug54 to e'pand their capabilities to support the
.. List e/amles o' database models
Data Models can be classified into two categories8
$. Object"based logical model focuses on describing the data4 the relationship among the
data4 and any constraints defined.
%. *ecord"based logical model focuses on describing the data structure and the access
techniques in the D"M
• =ierarchical Model
• @etwork Model
• *elational Model
• .b/ect:*elational Model
• .b/ect;.riented Model
• emi structured Model
• Associative Model
• )ntity;Attribute;Balue !)AB# data model
• ,onte't Model
There are various ob/ect;based models. The most widely used is the )ntity;*elationship model !)*
model#.

0. Describe the (se o' vario(s database models
1he vario(s database models
Databases appeared in the late $0+1s4 at a time when the need for a fle'ible information management
system had arisen. There are five models of D"M4 which are distinguished based on how they represent
the data contained8
• 1he hierarchical model8 The data is sorted hierarchically4 using a downward tree. This model uses
pointers to navigate between stored data. 3t was the first D"M model.

• 1he net%ork model8 like the hierarchical model4 this model uses pointers toward stored data.
=owever4 it does not necessarily use a downward tree structure.

• 1he relational model !*D2MS4 *elational database management system#8 The data is stored in
two;dimensional tables !rows and columns#. The data is manipulated based on the relational theory of
mathematics.

• 1he ded(ctive model8 Data is represented as a table4 but is manipulated using predicate calculus.
• 1he object model !OD2MS
the form of ob/ects4 which are structures called
instances of these classes

"y the late $001s4 relational databases were the most commonly used !comprising about three
of all databases#.

3. Model data base systems (sing the 4ntity *elationshi !4.*$ model

What is Object"2ased Logical
.b/ect;based logical model4
$. Describes the data at the conceptual and view levels.
%. Crovide fairly enough structuring capabilities.
3. Allow one to specify data constraints
(. .b/ect based Model provides more than 31 models4 including
o )ntity;relationship model.
o .b/ect;oriented model.
o "inary model.
o 6unctional data model.
There are various ob/ect;based models. The most widely used is the )ntity
model# introduced by Ceter ,hen.
)'ample $8 A sample )ntity;*elationship model4 where
4ntities8 UCC&3)*4 CA*T
*elationshi8 =3C !or =3CM)@T#

4/amle .5 A detailed )ntity;*elationship model
)ntities8 ,UT.M)*4 A,,.U@T
*elationship8 D)C.3T
Attributes of ,ustomer !)ntity#8 ,ustomer 3D4 @ame
Attributes of Account !)ntity#8 Account @umber and "alance


What are 4ntities in 4ntity"*elationshi
• ,hen defined an entity as >a thing4
OD2MS4 ob/ect;oriented database management system#8 the data is stored in
b/ects4 which are structures called classes that display the data within. The fields are
"y the late $001s4 relational databases were the most commonly used !comprising about three
systems (sing the 4ntity *elationshi !4.*$ model
2ased Logical Model?
Describes the data at the conceptual and view levels.
Crovide fairly enough structuring capabilities.
Allow one to specify data constraints e'plicitly.
.b/ect based Model provides more than 31 models4 including
relationship model.
oriented model.
6unctional data model.
based models. The most widely used is the )ntity;*elationship model !)*
odel# introduced by Ceter ,hen. o @ow we are going to focus on this model.
*elationship model4 where
8 =3C !or =3CM)@T#

*elationship model

,ustomer 3D4 @ame4 treet4 ,ity
Account @umber and "alance

*elationshi model?
,hen defined an entity as >a thing4 which can be easily identified?.
#8 the data is stored in
that display the data within. The fields are
"y the late $001s4 relational databases were the most commonly used !comprising about three;quarters
systems (sing the 4ntity *elationshi !4.*$ model
*elationship model !)*

• An entity is any ob/ect4 place4 person4 or activity about which data is recorded.
• 3n the diagramming technique4 entities are named and represented inside a bo'.
• An entity type is a set of things that share common properties
o TUD)@T4 ,.U*)4 and 9*AD) are e'amples of entity type.
o 6n entity tye is (s(ally in (ercase.

What are the 1yes o' 4ntities?
$. Deendent entity8 3s an entity whose e'istence depends on the e'istence of another entity
and are also called weak entities
%. 7ndeendent entity8 3s an entity which does not depend on any other entity for e'istence and
are also called regular entities

De'ine *elationshis in 4ntity
,hen defines a relationship as >an association among entities?. 6or e'ample4 t
students and instructors represents
taught by several instructors. This relationship could be named T)A,=.

5. Describe the vario(s tyes o' database relationshis
to"many# many"to

*elationshis are deicted as a diamond %ith the name o' the relationshi tye.
What are 1yes o' *elationshis are available in 4ntity
$. .ne;to;.ne
%. .ne;to;Many !or Many;to;.ne#
3. Many;to;Many
)'amples8
One"to"One
,onsider the e'ample of a university. 6or one D)CA*TM)@T !like the department of social sciences# there
can be only one department head. This is a one
One"to"Many !or Many"to"One$
A TUD)@T can MAA.* in only one course4 but many TUD)@Ts would have registered for a given
MAA.* course. This is a many;to
Many"to"Many
A TUD)@T can take many ,.U*)s and many TUD)@Ts can register for a given ,.U*). This is a
many;to;many relationship


An entity is any ob/ect4 place4 person4 or activity about which data is recorded.
3n the diagramming technique4 entities are named and represented inside a bo'.
An entity type is a set of things that share common properties8
TUD)@T4 ,.U*)4 and 9*AD) are e'amples of entity type.
6n entity tye is (s(ally in (ercase.
4ntities?
8 3s an entity whose e'istence depends on the e'istence of another entity
and are also called weak entities
8 3s an entity which does not depend on any other entity for e'istence and
are also called regular entities
De'ine *elationshis in 4ntity"*elationshi model?
,hen defines a relationship as >an association among entities?. 6or e'ample4 the relationship between
represents the fact that an instructor teaches several students and a student is
taught by several instructors. This relationship could be named T)A,=.
Describe the vario(s tyes o' database relationshis !one
to"one# many"to"many$
*elationshis are deicted as a diamond %ith the name o' the relationshi tye.
What are 1yes o' *elationshis are available in 4ntity"*elationshi !4*$ model?
.ne#
,onsider the e'ample of a university. 6or one D)CA*TM)@T !like the department of social sciences# there
can be only one department head. This is a one;to;one relationship.

One$
in only one course4 but many TUD)@Ts would have registered for a given
to;one relationship.

A TUD)@T can take many ,.U*)s and many TUD)@Ts can register for a given ,.U*). This is a

An entity is any ob/ect4 place4 person4 or activity about which data is recorded.
3n the diagramming technique4 entities are named and represented inside a bo'.
8 3s an entity whose e'istence depends on the e'istence of another entity
8 3s an entity which does not depend on any other entity for e'istence and
he relationship between
the fact that an instructor teaches several students and a student is
!one"to"one# one"
*elationshis are deicted as a diamond %ith the name o' the relationshi tye.
*elationshi !4*$ model?
,onsider the e'ample of a university. 6or one D)CA*TM)@T !like the department of social sciences# there
in only one course4 but many TUD)@Ts would have registered for a given
A TUD)@T can take many ,.U*)s and many TUD)@Ts can register for a given ,.U*). This is a
8. 9onvert designs 'rom the 4* model to a relational database

,onverting an )* model to a relational database schema involves D steps.
3n general4 these steps convert entities to relations and )* relationships to relations. 6or $8$ and $8@
relationships4 foreign keys can be used instead of separate relations.
=andling subclasses and super classes requires an e'tra conversion step.
After conversion is performed4 normali5ation and optimi5ation are often performed to improve the
relational schema.

)* Model )'ample


Ste #&5 9onvert Strong 4ntities
,onvert each strong entity to a relation




-otes5
Attributes of the entity type become attributes of the relation.
3nclude only simple attributes in relation. 6or composite attributes4 only create attributes in the relation
for their simple components.
Multi;valued attributes are handled separately !in step E+#.
The primary key of the relation is the key attributes for the entity.

9(rrent *elational Schema " Ste #&
)mployee !eno4 ename4 state4 city4 street4 title4 salary#
Department !dno4 dname#
Cro/ect !pno4 pname4 budget#

Ste #.5 9onvert Weak 4ntities

Ste #.5 9onvert each %eak entity into a relation %ith 'oreign keys to its identi'ying
relations !entities$.
6or each weak entity 2 with identifying owners )$4 )%4 F4 )n create a relation *8
3dentify relations *$4 *%4 F4 *n for entity types )$4 )%4 F4 )n.
The primary key of * consists of the primary keys of *$4 *%4 F4 *n plus the partial key of
the weak entity.
,reate a foreign key in * to the primary key of each relation *$4 *%4 F4 *n.
Attributes are converted the same as strong entities.

9onvert Weak 4ntities""4/amle


9(rrent *elational Schema" Ste #.


Stes #0"55 9onvert *elationshis
teps 3 to G convert binary relationships of cardinality8
1:1 - Step #3
1:N - Step #4
M:N - Step #5
@ote that M8@ relationships are the most general case4 and the conversion algorithm for these
relationships can be applied to $8$ and $8@ as well.
• =owever4 for performance reasons4 it is normally more efficient to perform different conversions
for each relationship type.
• 7n general# each 4* relationshi can be maed to a relation. =owever4 for $8$ and $8@
relationships4 it is more efficient to combine the relationship with an e'isting relation instead of
creating a new one.
• *elationships that are not binary !if there are any# are handled in step ED.
Ste #05 9onvert &5& *elationshis
tep E38 ,onvert binary $8$ relationships into a U@3HU) foreign key reference from one relation
to the other.
9iven a binary $8$ relationship * between two entities )i and )/8
• Identify the corresponding relations Ri and Rj.
• Chose one of the relations, say Ri, and:
• dd the attri!"tes of R to Ri.
• dd the pri#ary $ey attri!"tes of Rj to Ri, and create a foreign $ey reference to Rj fro# Ri.
• %eclare these pri#ary $ey attri!"tes of Rj to !e &NI'&(.

Notes:
)o" can select either Ri or Rj. *ypically, it is !est to select the relation that is g"aranteed to al+ays
participate in the relationship or the one that +ill participate the #ost in the relationship.

Ste #35 9onvert &5- *elationshis
tep E(8 ,onvert binary $8@ relationships into a foreign key reference from the @;side relation to
the $;side relation.
9iven a binary $8@ relationship * between two entities )i and )/8
• Identify the corresponding relations Ri and Rj.
• ,et Ri !e the N-side of the relation.
• dd the attri!"tes of R to Ri.
• dd the pri#ary $ey attri!"tes of Rj to Ri, and create a foreign $ey reference to Rj fro# Ri.
Notes:
&nli$e 1:1 relationships, yo" #"st select the N-side of the relationship as the relation containing the
foreign $ey and relationship attri!"tes.






Ste #55 9onvert M5 - *elationshis
tep EG8 ,onvert binary M8@ relationships into a new relation with foreign keys to the two
participating entities.
9iven a binary M8@ relationship between entities )i and )/8
• Identify the corresponding relations Ri and Rj.
• Create a ne+ relation R representing the relationship +here:
• R contains the relationship attri!"tes.
• *he pri#ary $ey of R is a co#posite $ey consisting of the pri#ary $eys of Ri and Rj.
• dd the pri#ary $ey attri!"tes of Ri and Rj to R, and create a foreign $ey reference to Ri fro# R
and to Rj fro# R.




Ste #85 9onvert M(lti":al(ed 6ttrib(tes
tep E+8 ,onvert a multi;valued attribute into a relation with composite primary key consisting of
the attribute value plus the primary key of the attributeIs entity.
9iven a multi;valued attribute A of entity )i8
• Identify the corresponding relation Ri.
• Create a ne+ relation R representing the attri!"te +here:
• R contains the si#ple, single--al"ed attri!"te A.
• dd the pri#ary $ey attri!"tes of Ri to R, and create a foreign $ey reference to Ri fro# R.
• *he pri#ary $ey of R is a co#posite $ey consisting of the pri#ary $ey of Ri and A.

tep E+8 ,onvert Multi;Balued Attributes )'ample



Ste #75 9onvert n"ary *elationshis
tep ED8 ,onvert n;ary relationships by creating a new relation to represent the relationship and
creating foreign keys that reference the related entities.
9iven an n;ary relationship between entities )$4 )%4 F4 )n8
3dentify relations *$4 *%4 F4 *n for entity types )$4 )%4 F4 )n.
,reate a new relation * to represent the relationship.
The primary key of * consists of the primary keys of *$4 *%4 4 *n.
,reate a foreign key in * to the primary key of each relation $4 *%4 F4 *n.
Attributes of the relationship become attributes of *.

9onverting +enerali)ation ,ierarchies
An additional step is necessary to convert subclasses and superclasses to the relational model.
3n general4 we have several different approaches8
1. Create a separate relation for each s"perclass and s"!class
• Most general techni/"e that +e +ill "se.
0. Create relations for s"!class only.
• 1nly +or$s if s"perclass has #andatory participation.
3. Create a single relation +ith one type attri!"te.
• ttri!"te is "sed to indicate the type of o!2ect 3s"!class. in the ro+.
• 4or$s only if the s"!classes are dis2oint.
4. Create a single relation +ith #"ltiple type attri!"tes.
• 5a-e a 6oolean -al"ed attri!"te for each s"!class. *r"e if in s"!class.
• 4or$s if s"!classes #ay !e o-erlapping.

Ste #;5 9onvert S(bclasses
tep E-8 ,onvert subclasses and superclasses by creating a relation for each subclass and
superclass. &ink the subclasses to the superclass using foreign key references.
9iven a superclass , and set of subclasses $4 %4 F4 n8
• Create a relation R for C.
• *he pri#ary $ey for R is the pri#ary $ey of the s"perclass.
• Create relations R1, R2, …, Rn for s"!classes S1, S2, …, Sn.
• *he pri#ary $ey for each Ri is the pri#ary $ey of the s"perclass.
• 7or each Ri, create a foreign $ey to R "sing the pri#ary $ey attri!"tes.




;... Model data base systems (sing Semantic Object model

What is Semantic Data?

1he semantic data model is a so't%are engineering model based on relationshis bet%een
stored symbols and the real %orld.
The data is organi5ed in such a way that it can be interpreted meaningfully without human intervention.
emantic data has a history dating back to the $0D1Is and is currently used in a wide variety of data
management systems and applications.

,o% Does Semantic Data Work?

Data is organi5ed based on binary models of ob/ects4 usually in groups of three parts8 two ob/ects and
their relationship. 6or e'ample4 if one wanted to represent a cup sitting on a table4 the data organi5ation
might look like this8 ,UC TA"&). The ob/ects !cup and table# are interpreted with regard to their
relationship !sitting on#. The data is organi5ed linearly4 telling the software that since ,UC comes first in
the line4 it is the ob/ect that acts. 3n other words4 the position of the word tells the software that the cup
is on the table and not that the table is sitting on the cup. Databases designed around this concept have
greater applicability and are more easily integrated into other databases.

,istory o' Semantic Data

3n the $0D1Is4 the U Air 6orce implemented the 3ntegrated ,omputer;Aided Manufacturing Crogram for
the purpose of applying technology to increase manufacturing productivity. .ut of this program grew an
interest in semantic data. Methods of data organi5ation were developed4 including functional4
informational and dynamic. 6unctional models focus on how the data represents ob/ects or activities
within the environment. 3nformational models are concerned with the organi5ation and semantics of the
environmental information. The dynamics model deals with how time affects the conditions within the
environment.

+oals o' Semantic Data

emantic data systems are designed to represent the real world as accurately as possible within the data
set. Data symbols are organi5ed linearly and hierarchically to give certain meanings like the one described
above. "y representing the real world within data sets4 semantic data allow machines to interact with
worldly information without human interpretation.


6lications o' Semantic Data

emantic data is very promising for the enterprise world. Database Management ystems can be
integrated with one another and compared. 6or e'ample4 since a companyIs entire infrastructure is
represented within the data model4 the model can be compared to those of the companyIs vendors to
identify areas of inconsistency and possible improvement. This would help streamline the relationship
between company and vendors4 making database sharing and integration much simpler. )nvironments
and systems can also be organi5ed graphically within a database to give a more visually;based
representation of that system or environment. *ecently4 a semantic language called 9ellish was
developed as a formal language to represent data models. 9ellish can be interpreted solely by computers
and needs no human interaction.

There are various popular4 mainstream ways to model data4 some of which have emerged later than
others. "efore e'ploring the benefits of the *D6 model4 it is best to make a review of some of the
approaches to modeling data that have already been established.
&ook at the table below which makes an easy comparison between the approaches and highlights some
of the unique qualities of the semantic data model.


9omaring 1he <o(lar Data Models
,omparing the features of the mainstream ways of modeling
Model
4/amle
=ormat
Data
.b/ect
eriali5ation
.@)T ,&*
.b/ect
eriali5ation
.b/ect
Croperty
Balues
*elational
M H&4
.racle4
MyH&
Table ,ell
Balues
=ierarchical
<M&
Tag:Attribute
Balues
9raph
*D6:<M&4
Turtle
*D6
Metadata is a term you will come across again and again when harnessing semantic web technologies.
JMetadataJ is not a comple' term or concept
meta; meaning JinformationJ#. The table above shows some e'amples of how you might classify the
metadata for various different models.

Why 7ncl(de Semantics 7n Data? >no%ledge 7ntegration

ThereIs no point in adding semantics to your data if it does not
primary benefits of adding semantic meaning to your data is that it can be branched across
kno%ledge automatically. 2hat do we mean domains of knowledgeK &etIs illustrate using a simple
e'ample.
3n our e'ample4 two websites are started independently from each other. .ne site hosts information on
current and historic .scar winning filmsL the other a large database of biographies of =ollywood actors
and actresses.
"oth contain complementary information in th
sharing between these sites could happen without the use of semantics. Then4 we will describe how the
same information can be shared between the two sites
semantics.
haring 2ithout emantic Modeling
9omaring 1he <o(lar Data Models
,omparing the features of the mainstream ways of modeling data versus the semantic web
model
Data Metadata 7denti'ier
?(ery
Synta/
.b/ect
Croperty
Balues
.b/ect
Croperty
@ames
e.g.
6ilename
&3@H
Table ,ell
Balues
Table
,olumn
Definitions
Crimary
Mey !Data
,olumn#
Balue
H&
Tag:Attribute
Balues
<D:DTD
e.g. Unique
Attribute
Mey Balue
<Cath
*D6 *D6:.2& U*3 CA*H&
is a term you will come across again and again when harnessing semantic web technologies.
JMetadataJ is not a comple' term or concept ; it simply means Jdata about dataJ !taken from the greek
meaning JinformationJ#. The table above shows some e'amples of how you might classify the
metadata for various different models.
Why 7ncl(de Semantics 7n Data? >no%ledge 7ntegration
ThereIs no point in adding semantics to your data if it does not provide significant benefits. .ne of the
primary benefits of adding semantic meaning to your data is that it can be branched across
automatically. 2hat do we mean domains of knowledgeK &etIs illustrate using a simple
ample4 two websites are started independently from each other. .ne site hosts information on
current and historic .scar winning filmsL the other a large database of biographies of =ollywood actors
"oth contain complementary information in their website databases. 2e will cover firstly how information
sharing between these sites could happen without the use of semantics. Then4 we will describe how the
same information can be shared between the two sites ; and potentially beyond ;
haring 2ithout emantic Modeling

data versus the semantic web
Synta/
Semantics
!Meaning$
@:A
@:A
@:A
CA*H&
Nes4 using
*D6 and
.2&
is a term you will come across again and again when harnessing semantic web technologies.
it simply means Jdata about dataJ !taken from the greek
meaning JinformationJ#. The table above shows some e'amples of how you might classify the
provide significant benefits. .ne of the
primary benefits of adding semantic meaning to your data is that it can be branched across domains o'
automatically. 2hat do we mean domains of knowledgeK &etIs illustrate using a simple
ample4 two websites are started independently from each other. .ne site hosts information on
current and historic .scar winning filmsL the other a large database of biographies of =ollywood actors
eir website databases. 2e will cover firstly how information
sharing between these sites could happen without the use of semantics. Then4 we will describe how the
; with the use of
.ur two sites4 one fronting an M H& database of all .scar winning films4 and another one fronting a
MyH& database of =ollywood actors4 reside
at htt5@@%%%.oscar%inners.'ake andhtt5@@%%%.actorbiograhies.go.'ake respectively. The
two sites were started independently4 and do not collaborate.
The .scar 2inners site lists4 as its name suggests4 all of the .scar winning films ever produced and also
a list of actors and actresses who starred in them. =owever4 it doesnIt hold any other actor information
other than their name and date of birth.

The Actor "iographies site contains a complete listing of many current and former =ollywood actors4
including a complete biography4 plus a list of movies that they starred in. "ut4 it does not contain any film
plots4 or screenshots of the films.


&etIs look at how these two sites might collaborate under their current4 more traditional data model8
• .bviously4 the users of htt5@@%%%.oscar%inners.'ake would benefit from being able to click on the
name of a starring actor and find out more about them ; this information is stored in the MyH& database
at htt5@@%%%.actorbiograhies.go.'ake.
• &ikewise4 the users of htt5@@%%%.actorbiograhies.go.'ake would benefit from being able to click
on the names of films that the actors starred in and find more information. This is stored in the M H&
database at htt5@@%%%.oscar%inners.'ake.
• Any sharing of data between the two sites cannot be done by /oining tables in their databases. 6irstly4
they have been independently designed in the first place and so their primary keys referring to individual
actors or films in both databases will not be synchroni5ed. They would have to be mapped. "ut secondly4
they are using different database server systems which are not cross;compatible.
• To collaborate using their current databases4 the owners of either site would have to decide on a
common data format by which to share information that they could both understand by using a common
film and actor unique 3D scheme of their own invention. They could do this4 for e'ample4 by creating a
secure <M& endpoint on each of their websites from which they can request information from each other
on demand. This way4 their shared information is always up to date.
7mortant <oint This sort of information interchange across incompatible4 independently designed data
systems takes time4 money and human conte'tual interpretation of the different datasets. 3t also is
restrictive to the data domains of only these two websites4 any further additions to their knowledge from
elsewhere will demand similar efforts. 3t requires humans to understand the meaning of the data and
agree on common formats to collaborate the two databases appropriately.
2ith the introduction of *D6 and semantics4 it is far easier. &etIs investigate how this could be achieved
using *D6 and the semantic web ; it all happens automatically4 not manually.
haring 2ith The emantic 2eb Model
3n semantic modeling4 the following are important terms you should know8
• :ocab(lary ; A collection of terms given a well;defined meaning that is consistent across conte'ts.
• Ontology ; Allows you to define conte'tual relationships behind a defined vocabulary. 3t is the
cornerstone of defining a knowledge domain. A formal synta' for defining ontologies is .2& !2eb
.ntology &anguage# which is an e'tension to *D6 !*D6 chema#4 which we shall formally introduce in
the ne't lesson.

o how do we model the two site scenario using semantic modelingK 6irstly4 the two sites need to apply a
common4 standard vocabulary to describe their data that is conte'tually consistent. 6or e'ample4 the
term Ifilm titleI should mean the same thing for both sites4 as should the term Iactor nameI and Iactor
birthdateI.
This may be done by the two sites adopting the same base ontology4 or a common vocabulary4 for
e'pressing the meaning behind the data they e'pose4 and publishing that data on a queryable endpoint
so that the two sites can communicate with each other across the web.
2ith this standard vocabulary in place8
• The two sites can now query each other using the same terms.
• The .scar 2inning Movies site can now query the actor names on the Actor "iographies site on;demand
and gain more detail about a specific actor or actress that has starred in a movie.
• The Actor "iographies site can now query the film plots on the .scar 2inning Movies site on;demand and
gain more detail about films an actor has starred in.
• 2ith the conte'tual relationships defined in a formal web ontology4 further related information about the
actors or films4 e.g. film locations4 other news events happening on the same day of filming or birthdate
or the actor4 or films made by the same director4 may be found via the linked standard terminology
without the user even imagining that information initially e'isted.
• This happens without the need for transformation4 mapping4 or contracts being set up between the two
sites. 3t all happens through semantics.
2eIll see in the ne't lesson what the makeup of a semantic web ontology is4 how you query a semantic
database and even perform machine inference on it.
<oint O' 7nterest The good news is you often wonIt have to go through the effort of defining and
sharing your own ontology for your particular domain of knowledge. There are many popular4 standard
ontologies already distributed on the web which you can adopt4 and if necessary e'tend yourself. 2e will
introduce some of these in the following section.
The cross;domain knowledge sharing discussed here need not /ust apply to websites4 but also within the
knowledge bases built by organi5ations. emantic web technologies need not be restricted to applications
or information published on the web.
Although there may be a little more groundwork required when first setting up a semantic database4 the
benefits for ease of cross;domain integration from across the globe and the time saved and ideas gained
from doing so are4 potentially4 highly significant.
Metadata 7nitiatives
tandard vocabularies4 or formal ontologies representing terms within a domain of knowledge4 are
already available freely from various organi5ations dedicated to creating standard vocabularies for a
range of sub/ects ; for e'ample media terms4 or biomedical terms4 or scientific terms. "elow are some
e'amples8
• Dublin ,ore Metadata 3nitiative !D,M3# ; ,reates ontologies for a range of sub/ects4 particularly focusing
on common4 every day terms and terms important in media.
• 6riend .f A 6riend !6.A6# ; focuses on developing a standard vocabulary:ontology for social networking
purposes.
• .pen,yc ; An ontology of everyday4 common sense terms.
Nou have now completed this lesson. 3n the ne't lesson4 we will go into more thorough technical detail
into how ontologies are defined in the semantic web4 and how semantic web databases can be queried
for information.

&ABDescribe the tyes o' relationshis bet%een entities
1hese are described at #3


&&B List and e/lain the roerties o' relational tables

There are si' properties for *elational Tables8

$# Balues are atomic.
%# ,olumn values are of the same kind.
3# )ach row is unique.
(# The sequence of columns is insignificant.
G# The sequence of rows is insignificant.
+# )ach column must have a unique name.


&.B. Write tables in standard notation
. <resent Design %ith the Standard -otations
The standard notation presents your design of relational database. 3t provides information of table
names4 data fields of each table4 primary key of each table4 foreign key of a table if it e'ists4 and
relationships between tables. The standard notation is an important part of your pro/ect report.
*efer to DemoC9om(ter./ls for e'ample of making standard notations.

5 7mlement the Design %ith Microso't 6ccess
Nou now transfer the tables in the standard notation to the tables in Access database.
The Make"1able ?(ery of Access helps you split the flat table and delete duplicate records
automatically.
!$# Upload the flat table to Access database
a. ,reate a database
b. 3mport the flat table to your database8
a# ,lick Table ob/ect4 6iles menu4 select 9et )'ternal Data and then select 3mport.
b# elect Microsoft )'cel from 6iles of Types drop;down menu. elect drive4 directory and the
)'cel file for your flat table. ,lick 3mport button.
c# ,heck how 2orksheets radio button4 select the worksheet for your flat table in the bo' to
the left of radio button and then @e't button.
d# ,heck 6irst *ow ,ontains ,olumn =eadings4 and @e't button.
e# ,heck 3n a @ew Table radio button and @e't button.
f# elect >@o? in the 3nde'ed te't bo' and @e't.
g# ,heck -o <rimary >ey radio button. The primary key will later be assigned by you. @e't
button.
h# Type table name !e.g.4 =lat 1able# and 6inish button.
!%# *un Make;Table Huery to spilt the flat table
a. ,reate a query for creating a new table. 6or e'ample4 create a table >,ustomer? in database
>DemoO,omputer? with the flat table uploaded. 6irst4 create a query in design view !refer to
)'ercise G in =andout8 Access kill et $#4 add the flat table to the query and select data fields
according to the table >,ustomer? presented in the standard notation.
b. Make the query a Make;Table Huery8 click ?(ery menu and select Make"1able ?(ery
command. After Make Table window pops up4 type a table name in Table @ame te't bo' and .M.
*ight;click on the grey area of design grid and select <roerties. After the Huery Croperties
window pops up4 set >Des? for EniF(e :al(es bo' and close the query properties window. *(n
the query and >yes? to confirm. Then close the make;table query with >noG save.
c. pecify a primary key for this table according to the standard notation.
!3# *eeat tep !%# until all tables in the standard notation are created.
!(# Delete the flat table for Access database after you have made all table in the standard notation.

&0B 7mlement a design (sing a relational database

&3B 4/lain the role o' the database administrator

The database administrator performs a critical role within an organi5ation and is an important and key
role in Database Management ystems. The ma/or responsibility of a database administrator is to handle
the process of developing the database and maintaining the database of an organi5ation. The database
administrator is responsible for defining the internal layout of the database and ensuring the internal
layout optimi5es system performance.

The database administrator has full access over all type of important data of an organi5ation. The
database administrator decides what data will be stored in the database and how to organi5e data in
database so that it can be access easily on requirement or need of an organi5ation. To design the
database of an organi5ation4 the database administrator must have a meeting with users and determine
their requirements.

1he database administrator is also resonsible 'or rearing doc(mentation# incl(ding
recording the roced(res# standards# g(idelines# and data descritions necessary 'or the
e''icient and contin(ing (se o' the database environment. Documents should include materials to
help end users4 database application programmers4 the operation staff4 and all personnel connected with
the database management system.

The database administrator is resonsible 'or monitoring the database environment# s(ch as
seeing that the database is meeting er'ormance standards# making s(re the acc(racy#
integrity# and sec(rity o' data are maintained.

The database administrator is also responsible to manage any enhancements into the database
environment.
A Database Administrator4 Database Analyst or Database Developer is the person responsible for
managing the information within an organi5ation. As most companies continue to e'perience inevitable
growth of their databases4 these positions are probably the most solid within the 3T industry. 3n most
cases4 it is not an area that is targeted for layoffs or downsi5ing. .n the downside4 however4 most
database departments are often understaffed4 requiring administrators to perform a multitude of tasks.
Depending on the company and the department4 this role can either be highly speciali5ed or incredibly
diverse. The primary role of the Database Administrator is to administer4 develop4 maintain and
implement the policies and procedures necessary to ensure the security and integrity of the corporate
database. ub roles within the Database Administrator classification may include security4 architecture4
warehousing and:or business analysis. .ther primary roles will include8
• 3mplementation of data models
• Database design
• Database accessibility
• Cerformance issues
• ,apacity issues
• Data replication
• Table Maintenance
Database Administrators are often on;call and required to work as needed. This position carries an
enormous amount of responsibility.








What is *elational Database Model?
3n *elational Database model4 data is organi)ed@stored in tables. this model was introduced by ).6.
,odd in $0D1.
• *elational model is an attempt to simplify the database structure.
• 3t represents all data in the database as simple tables in the row;column format.
• *D"M can be defined as a D"M where all data visible to the user is organi5ed strictly as
tables of data values and where all database operations work on these tables.

The above picture clearly defines
• The organi5ing principle in a relational database is the table4 a tabular arrangement of data
values8
o A table is called a relation.
o The row !or record# in the table is called a tuple.
o The column !or field# is called an attribute.
o The number of tuples is called the cardinality
o The number of attributes is called the degree of the table.

What is *elational Database Management System ?
A relational database management system !*D"M# is a database management system !D"M# that is
based on the relational model as introduced by ). 6. ,odd. Most popular commercial and open source
databases currently in use are based on the relational database model.
A short definition of an *D"M may be a D"M in which data is stored in the form of tables and the
relationship among the data is also stored in the form of tables. !Taken from 2ikipedia#.
3n the e'ample below4 >,ustomer 3D? is the primary key !CM# in one table and the foreign key !6M# in
another. The arrow represents a one;to;many relationship between the two tables. The relationship
indicates that one customer can have one or more orders. A given order4 however4 can be initiated by
one and only one customer.

A relational D"M stores information in a set of >tables?4 each of which has a unique identifier or
>primary key?. The tables are then related to one another using >foreign keys?.

Today we have4 several *D"M products like8
• ybase
• .racle
• Microso't S?L Server
• D"%
• MNH&

What is S?L?5
H& is short for tructured Huery &anguage and is a simple language that provides instructions for
building and modifying the structure of databases and for modifying the data stored in the tables. The
main commands used to modify and retrieve data are8
• Select ; 6etches data.
• 7nsert ; 3nserts one or more rows of data.
• Edate ; Modifies e'isting row!s# of data
• Delete ; Deletes rows of data.
There are several A@3:3. standards such as A@3 0%4 one of the most popular. This defines a minimum
subset of supported statements. Most compiler vendors support these standards.