data modeling and database design

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 System (DBMS). Learning Objectives 1. Differentiate between data modeling and database models 2. List examples of database models 3. Describe the use of various database models (linked to #7) 4. Model data base systems using the Entity Relationship (E.R) model 5. Describe the various types of database relationships (one-to-one, one-to-many, many-to- one, many-to-many) 6. Covert designs from the ER model to a relational database 7. Discuss the various database models (hierarchical, network, semantic-object model, relational model) 8. Model data base systems using Semantic Object model 9. Transform semantic objects to relational database designs 10. Describe the types of relationships between entities 11. List and explain the properties of relational tables 12. Write tables in standard notation 13. Implement a design using a relational database 14. Explain the role of the database administrator 1. Differentiate between data modeling and database models What are Data Models? In layman terms, a data model is used to organize data. Data models are a logical representation of the business processes in a organization. Data Model defines how the business interacts with people, places, and things. The data model is used as a reference point for determining the rules of relationships between entities within an organization. What is Data modeling? Data modeling is the process of structuring and organizing 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.

Upload: stephy-withlotsoflove

Post on 23-Nov-2015

47 views

Category:

Documents


8 download

DESCRIPTION

Describes the different processes associated with data modeling and database design for database systems.

TRANSCRIPT

  • 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 System (DBMS).

    Learning Objectives

    1. Differentiate between data modeling and database models

    2. List examples of database models

    3. Describe the use of various database models (linked to #7) 4. Model data base systems using the Entity Relationship (E.R) model

    5. Describe the various types of database relationships (one-to-one, one-to-many, many-to-one, many-to-many)

    6. Covert designs from the ER model to a relational database

    7. Discuss the various database models (hierarchical, network, semantic-object model, relational model)

    8. Model data base systems using Semantic Object model

    9. Transform semantic objects to relational database designs 10. Describe the types of relationships between entities

    11. List and explain the properties of relational tables

    12. Write tables in standard notation

    13. Implement a design using a relational database 14. Explain the role of the database administrator

    1. Differentiate between data modeling and database models

    What are Data Models?

    In layman terms, a data model is used to organize data. Data models are a logical representation of

    the business processes in a organization.

    Data Model defines how the business interacts with people, places, and things. The data model is used as

    a reference point for determining the rules of relationships between entities within an organization.

    What is Data modeling?

    Data modeling is the process of structuring and organizing 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 ModelDatabase 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.

    Fundamentally 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 manage, control, and organize the

    stored information to effectively execute multiple key tasks. In the design phase, database diagrams will

    provide needed documentation of th

    Below is a list of the most common database modeling methods. Do note that, depending on the type of

    data and end user needs when accessing the database, its possible to employ multiple models to create

    a more sophisticated database design. Of course, in either scenario, the production of database diagrams

    would be required to establish and maintain high operational standards. Luckily turn

    and design tools like Creately can make this effort a breeze.

    From the below mentioned models the relational model is the most commonly used model for most

    database designs. But in some special cases other models can be more benef

    support all the models.

    Relational Model: Founded on mathematical theory, 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. By looking at how different variables can change the relationship between the data,

    new perspectives can be gained as the informations presentation is altered by focusing on different

    attributes or domains. These models can often be found within

    databases.

    Relational design method, the most popular database design method

    Graph Model: Graph model is another model that is gaining popularity. These databases are created

    based on the Graph theory and used nodes

    similar to object oriented applications. Graph databases are generally easier to scale and usually

    perform faster for associative data sets.

    Hierarchical Model: Much like the common organizational char

    database model has the same tree

    looking at data efficiency, this is an ideal model where the data contains nested and sorted

    information, but it can be inefficient when the data does not have an upward link to a main data point

    or subject. 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

    Fundamentally 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 manage, control, and organize the

    stored information to effectively execute multiple key tasks. In the design phase, database diagrams will

    provide needed documentation of the data links that facilitate database functionality.

    Below is a list of the most common database modeling methods. Do note that, depending on the type of

    data and end user needs when accessing the database, its possible to employ multiple models to create

    a more sophisticated database design. Of course, in either scenario, the production of database diagrams

    would be required to establish and maintain high operational standards. Luckily turn

    can make this effort a breeze.

    From the below mentioned models the relational model is the most commonly used model for most

    database designs. But in some special cases other models can be more beneficial. Fortunately Creately

    : Founded on mathematical theory, 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. By looking at how different variables can change the relationship between the data,

    new perspectives can be gained as the informations presentation is altered by focusing on different

    attributes or domains. These models can often be found within airline reservation systems or bank

    Relational design method, the most popular database design method

    : Graph model is another model that is gaining popularity. These databases are created

    based on the Graph theory and used nodes and edges to represent data. The structure is somewhat

    similar to object oriented applications. Graph databases are generally easier to scale and usually

    perform faster for associative data sets.

    : Much like the common organizational chart used to organize companies, this

    database model has the same tree-like appearance and is often used to structure XML documents. In

    looking at data efficiency, 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 subject. 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

    Fundamentally 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 manage, control, and organize the

    stored information to effectively execute multiple key tasks. In the design phase, database diagrams will

    e data links that facilitate database functionality.

    Below is a list of the most common database modeling methods. Do note that, depending on the type of

    data and end user needs when accessing the database, its possible to employ multiple models to create

    a more sophisticated database design. Of course, in either scenario, the production of database diagrams

    would be required to establish and maintain high operational standards. Luckily turn-key diagramming

    From the below mentioned models the relational model is the most commonly used model for most

    icial. Fortunately Creately

    : Founded on mathematical theory, 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. By looking at how different variables can change the relationship between the data,

    new perspectives can be gained as the informations presentation is altered by focusing on different

    airline reservation systems or bank

    Relational design method, the most popular database design method

    : Graph model is another model that is gaining popularity. These databases are created

    and edges to represent data. The structure is somewhat

    similar to object oriented applications. Graph databases are generally easier to scale and usually

    t used to organize companies, this

    like appearance and is often used to structure XML documents. In

    looking at data efficiency, 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 subject. 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.

  • Hierarchical method, the very first database design model

    Network Model: Using records and sets, this model uses a one

    data records. Multiple branches are allocated for lower

    connected by multiple nodes, which represent higherdatabase modeling method provides an efficient way to retrieve information and organize the data so

    that it can be looked at multiple ways, providing a mreaction time. This is a viable model for planning road, train, or utility networks.

    The network model where a node can have multiple parent nodes

    Dimensional Model: 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 size 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 organizations with sales and profit analysis. Object Relational Model: 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 date, object databases still need to be refined to achieve greater

    standardization. Real world applicati

    engineering and molecular biology.

    No matter which database modeling method you choose, its imperative to develop related diagrams to

    visualize 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 expense of actually creating it. Diagrams are also a

    effective communication tool, particular for large teams, as they facilitate clear and quick communication.

    Whether you prefer a desktop software, Google App, or Web

    need to make collaborative diagramming ea

    of any diagram type like flowcharts, mindmaps, wireframes and UML. Creately also provides plug

    popular platforms, including Confluence, JIRA and FogBugz, to expand their capabilities to support the

    development of database diagrams.

    Hierarchical method, the very first database design model

    : Using records and sets, 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 nodes, which represent higher-level structures within the information. This database modeling method provides an efficient way to retrieve information and organize the data so

    that it can be looked at multiple ways, providing a means of increasing business performance and reaction time. This is a viable model for planning road, train, or utility networks.

    The network model where a node can have multiple parent nodes

    : This is an adaptation of the relational model and is often used in conjunction

    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 size 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 organizations with sales and profit analysis.: These models have created an entirely new type of database, which

    combines database design with application program to solve specific technical problems while

    leveraging the best of both worlds. To date, object databases still need to be refined to achieve greater

    standardization. Real world applications of this model often include technical or scientific fields, such as

    engineering and molecular biology.

    No matter which database modeling method you choose, its imperative to develop related diagrams to

    visualize 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 expense of actually creating it. Diagrams are also a

    effective communication tool, particular for large teams, as they facilitate clear and quick communication.

    Whether you prefer a desktop software, Google App, or Web-based application, Creately has what you

    need to make collaborative diagramming easy, including free database diagram templates

    of any diagram type like flowcharts, mindmaps, wireframes and UML. Creately also provides plug

    lar platforms, including Confluence, JIRA and FogBugz, to expand their capabilities to support the

    development of database diagrams.

    Hierarchical method, 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 organize the data so

    eans of increasing business performance and reaction time. This is a viable model for planning road, train, or utility networks.

    The network model where a node can have multiple parent nodes

    l and is often used in conjunction

    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 size 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 organizations with sales and profit analysis. of database, which

    combines database design with application program to solve specific technical problems while

    leveraging the best of both worlds. To date, object databases still need to be refined to achieve greater

    ons of this model often include technical or scientific fields, such as

    No matter which database modeling method you choose, its 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 expense of actually creating it. Diagrams are also a highly

    effective communication tool, particular for large teams, as they facilitate clear and quick communication.

    based application, Creately has what you

    database diagram templates and examples

    of any diagram type like flowcharts, mindmaps, wireframes and UML. Creately also provides plug-ins to

    lar platforms, including Confluence, JIRA and FogBugz, to expand their capabilities to support the

  • 2. List examples of database models Data Models can be classified into two categories:

    1. Object-based logical model focuses on describing the data, the relationship among the

    data, and any constraints defined.

    2. Record-based logical model focuses on describing the data structure and the access

    techniques in the DBMS

    Hierarchical Model

    Network Model

    Relational Model

    Object/Relational Model

    Object-Oriented Model

    Semi structured Model

    Associative Model

    Entity-Attribute-Value (EAV) data model

    Context Model

    There are various object-based models. The most widely used is the Entity-Relationship model (ER

    model).

    3. Describe the use of various database models

    The various database models

    Databases appeared in the late 1960s, at a time when the need for a flexible information management

    system had arisen. There are five models of DBMS, which are distinguished based on how they represent

    the data contained:

    The hierarchical model: The data is sorted hierarchically, using a downward tree. This model uses

    pointers to navigate between stored data. It was the first DBMS model.

    The network model: like the hierarchical model, this model uses pointers toward stored data.

    However, it does not necessarily use a downward tree structure.

    The relational model (RDBMS, Relational database management system): The data is stored in

    two-dimensional tables (rows and columns). The data is manipulated based on the relational theory of

    mathematics.

    The deductive model: Data is represented as a table, but is manipulated using predicate calculus.

  • The object model (ODBMS

    the form of objects, which are structures called

    instances of these classes

    By the late 1990s, relational databases were the most commonly used (comprising about three

    of all databases).

    4. Model data base systems using the Entity Relationship (E.R) model

    What is Object-Based Logical

    Object-based logical model,

    1. Describes the data at the conceptual and view levels.

    2. Provide fairly enough structuring capabilities.

    3. Allow one to specify data constraints

    4. Object based Model provides more than 30 models, including

    o Entity-relationship model.

    o Object-oriented model.

    o Binary model.

    o Functional data model.

    There are various object-based models. The most widely used is the Entity

    model) introduced by Peter Chen.

    Example 1: A sample Entity-Relationship model, where

    Entities: SUPPLIER, PARTS

    Relationship: SHIP (or SHIPMENT)

    Example 2: A detailed Entity-Relationship model

    Entities: CUSTOMER, ACCOUNT

    Relationship: DEPOSIT

    Attributes of Customer (Entity): Customer ID, Name

    Attributes of Account (Entity): Account Number and Balance

    What are Entities in Entity-Relationship

    Chen defined an entity as a thing,

    ODBMS, object-oriented database management system): the data is stored in

    bjects, which are structures called classes that display the data within. The fields are

    By the late 1990s, relational databases were the most commonly used (comprising about three

    systems using the Entity Relationship (E.R) model

    Based Logical Model?

    Describes the data at the conceptual and view levels.

    Provide fairly enough structuring capabilities.

    Allow one to specify data constraints explicitly.

    Object based Model provides more than 30 models, including

    relationship model.

    oriented model.

    Functional data model.

    based models. The most widely used is the Entity-Relationship model (ER

    odel) introduced by Peter Chen. So Now we are going to focus on this model.

    Relationship model, where

    : SHIP (or SHIPMENT)

    Relationship model

    Customer ID, Name, Street, City

    Account Number and Balance

    Relationship model?

    Chen defined an entity as a thing, which can be easily identified.

    ): the data is stored in

    that display the data within. The fields are

    By the late 1990s, relational databases were the most commonly used (comprising about three-quarters

    systems using the Entity Relationship (E.R) model

    Relationship model (ER

  • An entity is any object, place, person, or activity about which data is recorded.

    In the diagramming technique, entities are named and represented inside a box.

    An entity type is a set of things that share common properties

    o STUDENT, COURSE, and GRADE are examples of entity type.

    o An entity type is usually in uppercase.

    What are the Types of Entities?

    1. Dependent entity: Is an entity whose existence depends on the existence of another entity

    and are also called weak entities

    2. Independent entity: Is an entity which does not depend on any other entity for existence and

    are also called regular entities

    Define Relationships in Entity

    Chen defines a relationship as an association among entities. For example, t

    students and instructors represents

    taught by several instructors. This relationship could be named TEACH.

    5. Describe the various types of database relationships to-many, many-to

    Relationships are depicted as a diamond with the name of the relationship type.

    What are Types of Relationships are available in Entity

    1. One-to-One

    2. One-to-Many (or Many-to-One)

    3. Many-to-Many

    Examples:

    One-to-One

    Consider the example of a university. For one DEPARTMENT (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 STUDENT can MAJOR in only one course, but many STUDENTs would have registered for a given

    MAJOR course. This is a many-to

    Many-to-Many

    A STUDENT can take many COURSEs and many STUDENTs can register for a given COURSE. This is a

    many-to-many relationship

    An entity is any object, place, person, or activity about which data is recorded.

    In the diagramming technique, entities are named and represented inside a box.

    An entity type is a set of things that share common properties:

    STUDENT, COURSE, and GRADE are examples of entity type.

    An entity type is usually in uppercase.

    Entities?

    : Is an entity whose existence depends on the existence of another entity

    and are also called weak entities

    : Is an entity which does not depend on any other entity for existence and

    are also called regular entities

    Define Relationships in Entity-Relationship model?

    Chen defines a relationship as an association among entities. For example, 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 TEACH.

    Describe the various types of database relationships (oneto-one, many-to-many)

    Relationships are depicted as a diamond with the name of the relationship type.

    What are Types of Relationships are available in Entity-Relationship (ER) model?

    One)

    Consider the example of a university. For one DEPARTMENT (like the department of social sciences) there

    can be only one department head. This is a one-to-one relationship.

    One)

    in only one course, but many STUDENTs would have registered for a given

    to-one relationship.

    A STUDENT can take many COURSEs and many STUDENTs can register for a given COURSE. This is a

    An entity is any object, place, person, or activity about which data is recorded.

    In the diagramming technique, entities are named and represented inside a box.

    : Is an entity whose existence depends on the existence of another entity

    : Is an entity which does not depend on any other entity for existence and

    he relationship between

    the fact that an instructor teaches several students and a student is

    (one-to-one, one-

    Relationships are depicted as a diamond with the name of the relationship type.

    Relationship (ER) model?

    Consider the example of a university. For one DEPARTMENT (like the department of social sciences) there

    in only one course, but many STUDENTs would have registered for a given

    A STUDENT can take many COURSEs and many STUDENTs can register for a given COURSE. This is a

  • 6. Convert designs from the ER model to a relational database

    Converting an ER model to a relational database schema involves 7 steps. In general, these steps convert entities to relations and ER relationships to relations. For 1:1 and 1:N

    relationships, foreign keys can be used instead of separate relations.

    Handling subclasses and super classes requires an extra conversion step. After conversion is performed, normalization and optimization are often performed to improve the

    relational schema.

    ER Model Example

    Step #1: Convert Strong Entities

    Convert each strong entity to a relation

    Notes:

    Attributes of the entity type become attributes of the relation. Include only simple attributes in relation. For composite attributes, only create attributes in the relation

    for their simple components.

    Multi-valued attributes are handled separately (in step #6). The primary key of the relation is the key attributes for the entity.

    Current Relational Schema - Step #1

    Employee (eno, ename, state, city, street, title, salary)

    Department (dno, dname) Project (pno, pname, budget)

    Step #2: Convert Weak Entities

    Step #2: Convert each weak entity into a relation with foreign keys to its identifying

    relations (entities).

    For each weak entity W with identifying owners E1, E2, , En create a relation R: Identify relations R1, R2, , Rn for entity types E1, E2, , En.

  • The primary key of R consists of the primary keys of R1, R2, , Rn plus the partial key of the weak entity.

    Create a foreign key in R to the primary key of each relation R1, R2, , Rn. Attributes are converted the same as strong entities.

    Convert Weak Entities--Example

    Current Relational Schema- Step #2

    Steps #3-5: Convert Relationships

    Steps 3 to 5 convert binary relationships of cardinality:

    1:1 - Step #3

    1:N - Step #4

    M:N - Step #5

    Note that M:N relationships are the most general case, and the conversion algorithm for these

    relationships can be applied to 1:1 and 1:N as well.

    However, for performance reasons, it is normally more efficient to perform different conversions

    for each relationship type.

    In general, each ER relationship can be mapped to a relation. However, for 1:1 and 1:N

    relationships, it is more efficient to combine the relationship with an existing relation instead of

    creating a new one.

    Relationships that are not binary (if there are any) are handled in step #7.

    Step #3: Convert 1:1 Relationships

  • Step #3: Convert binary 1:1 relationships into a UNIQUE foreign key reference from one relation

    to the other.

    Given a binary 1:1 relationship R between two entities Ei and Ej:

    Identify the corresponding relations Ri and Rj.

    Chose one of the relations, say Ri, and:

    Add the attributes of R to Ri.

    Add the primary key attributes of Rj to Ri, and create a foreign key reference to Rj from Ri.

    Declare these primary key attributes of Rj to be UNIQUE.

    Notes:

    You can select either Ri or Rj. Typically, it is best to select the relation that is guaranteed to always

    participate in the relationship or the one that will participate the most in the relationship.

    Step #4: Convert 1:N Relationships

    Step #4: Convert binary 1:N relationships into a foreign key reference from the N-side relation to

    the 1-side relation.

    Given a binary 1:N relationship R between two entities Ei and Ej:

    Identify the corresponding relations Ri and Rj.

    Let Ri be the N-side of the relation.

    Add the attributes of R to Ri.

    Add the primary key attributes of Rj to Ri, and create a foreign key reference to Rj from Ri.

    Notes:

    Unlike 1:1 relationships, you must select the N-side of the relationship as the relation containing the

    foreign key and relationship attributes.

  • Step #5: Convert M: N Relationships

    Step #5: Convert binary M:N relationships into a new relation with foreign keys to the two

    participating entities.

    Given a binary M:N relationship between entities Ei and Ej:

    Identify the corresponding relations Ri and Rj.

    Create a new relation R representing the relationship where:

    R contains the relationship attributes.

    The primary key of R is a composite key consisting of the primary keys of Ri and Rj.

    Add the primary key attributes of Ri and Rj to R, and create a foreign key reference to Ri from R

    and to Rj from R.

  • Step #6: Convert Multi-Valued Attributes

    Step #6: Convert a multi-valued attribute into a relation with composite primary key consisting of

    the attribute value plus the primary key of the attribute's entity.

    Given a multi-valued attribute A of entity Ei:

    Identify the corresponding relation Ri.

    Create a new relation R representing the attribute where:

    R contains the simple, single-valued attribute A.

    Add the primary key attributes of Ri to R, and create a foreign key reference to Ri from R.

    The primary key of R is a composite key consisting of the primary key of Ri and A.

    Step #6: Convert Multi-Valued Attributes Example

  • Step #7: Convert n-ary Relationships

    Step #7: Convert n-ary relationships by creating a new relation to represent the relationship and

    creating foreign keys that reference the related entities.

    Given an n-ary relationship between entities E1, E2, , En:

    Identify relations R1, R2, , Rn for entity types E1, E2, , En.

    Create a new relation R to represent the relationship.

    The primary key of R consists of the primary keys of R1, R2, , Rn.

    Create a foreign key in R to the primary key of each relation 1, R2, , Rn.

    Attributes of the relationship become attributes of R.

    Converting Generalization Hierarchies

    An additional step is necessary to convert subclasses and superclasses to the relational model.

    In general, we have several different approaches:

    1) Create a separate relation for each superclass and subclass

  • Most general technique that we will use.

    2) Create relations for subclass only.

    Only works if superclass has mandatory participation.

    3) Create a single relation with one type attribute.

    Attribute is used to indicate the type of object (subclass) in the row.

    Works only if the subclasses are disjoint.

    4) Create a single relation with multiple type attributes.

    Have a Boolean valued attribute for each subclass. True if in subclass.

    Works if subclasses may be overlapping.

    Step #8: Convert Subclasses

    Step #8: Convert subclasses and superclasses by creating a relation for each subclass and

    superclass. Link the subclasses to the superclass using foreign key references.

    Given a superclass C and set of subclasses S1, S2, , Sn:

    Create a relation R for C.

    The primary key for R is the primary key of the superclass.

    Create relations R1, R2, , Rn for subclasses S1, S2, , Sn.

    The primary key for each Ri is the primary key of the superclass.

    For each Ri, create a foreign key to R using the primary key attributes.

  • 8... Model data base systems using Semantic Object model

    What is Semantic Data?

    The semantic data model is a software engineering model based on relationships between

    stored symbols and the real world. The data is organized in such a way that it can be interpreted meaningfully without human intervention.

    Semantic data has a history dating back to the 1970's and is currently used in a wide variety of data

    management systems and applications.

    How Does Semantic Data Work?

    Data is organized based on binary models of objects, usually in groups of three parts: two objects and

    their relationship. For example, if one wanted to represent a cup sitting on a table, the data organization might look like this: CUP TABLE. The objects (cup and table) are interpreted with regard to their

    relationship (sitting on). The data is organized linearly, telling the software that since CUP comes first in

    the line, it is the object that acts. In other words, 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.

    History of Semantic Data

    In the 1970's, the US Air Force implemented the Integrated Computer-Aided Manufacturing Program for the purpose of applying technology to increase manufacturing productivity. Out of this program grew an

    interest in semantic data. Methods of data organization were developed, including functional,

    informational and dynamic. Functional models focus on how the data represents objects or activities

    within the environment. Informational models are concerned with the organization and semantics of the

    environmental information. The dynamics model deals with how time affects the conditions within the environment.

    Goals of Semantic Data

    Semantic data systems are designed to represent the real world as accurately as possible within the data set. Data symbols are organized linearly and hierarchically to give certain meanings like the one described

    above. By representing the real world within data sets, semantic data allow machines to interact with

    worldly information without human interpretation.

    Applications of Semantic Data Semantic data is very promising for the enterprise world. Database Management Systems can be

    integrated with one another and compared. For example, since a company's entire infrastructure is

    represented within the data model, the model can be compared to those of the company's vendors to identify areas of inconsistency and possible improvement. This would help streamline the relationship

    between company and vendors, making database sharing and integration much simpler. Environments and systems can also be organized graphically within a database to give a more visually-based

    representation of that system or environment. Recently, a semantic language called Gellish was developed as a formal language to represent data models. Gellish can be interpreted solely by computers

    and needs no human interaction.

    There are various popular, mainstream ways to model data, some of which have emerged later than

    others. Before exploring the benefits of the RDF model, it is best to make a review of some of the

    approaches to modeling data that have already been established.

    Look at the table below which makes an easy comparison between the approaches and highlights some

    of the unique qualities of the semantic data model.

  • Comparing The Popular Data Models

    Comparing the features of the mainstream ways of modeling

    Model Example

    Format Data

    Object

    Serialization

    .NET CLR

    Object

    Serialization

    Object

    Property

    Values

    Relational

    MS SQL,

    Oracle,

    MySQL

    Table Cell

    Values

    Hierarchical XML

    Tag/Attribute

    Values

    Graph RDF/XML,

    Turtle RDF

    Metadata is a term you will come across again and again when harnessing semantic web technologies.

    "Metadata" is not a complex term or concept

    meta- meaning "information"). The table above shows some examples of how you might classify the

    metadata for various different models.

    Why Include Semantics In Data? Knowledge Integration

    There's 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

    knowledge automatically. What do we mean domains of knowledge? Let's illustrate using a simple

    example.

    In our example, two websites are started independently from each other. One site hosts information on

    current and historic Oscar winning films; the other a large database of biographies of Hollywood actors

    and actresses.

    Both contain complementary information in th

    sharing between these sites could happen without the use of semantics. Then, we will describe how the

    same information can be shared between the two sites

    semantics.

    Sharing Without Semantic Modeling

    Comparing The Popular Data Models

    Comparing the features of the mainstream ways of modeling data versus the semantic web

    model

    Data Metadata Identifier Query

    Syntax

    Object

    Property

    Values

    Object

    Property

    Names

    e.g.

    Filename LINQ

    Table Cell

    Values

    Table

    Column

    Definitions

    Primary

    Key (Data

    Column)

    Value

    SQL

    Tag/Attribute

    Values XSD/DTD

    e.g. Unique

    Attribute

    Key Value

    XPath

    RDF RDFS/OWL URI SPARQL

    is a term you will come across again and again when harnessing semantic web technologies.

    "Metadata" is not a complex term or concept - it simply means "data about data" (taken from the greek

    meaning "information"). The table above shows some examples of how you might classify the

    metadata for various different models.

    Why Include Semantics In Data? Knowledge Integration

    There's no point in adding semantics to your data if it does not provide significant benefits. One of the

    primary benefits of adding semantic meaning to your data is that it can be branched across

    automatically. What do we mean domains of knowledge? Let's illustrate using a simple

    ample, two websites are started independently from each other. One site hosts information on

    current and historic Oscar winning films; the other a large database of biographies of Hollywood actors

    Both contain complementary information in their website databases. We will cover firstly how information

    sharing between these sites could happen without the use of semantics. Then, we will describe how the

    same information can be shared between the two sites - and potentially beyond -

    Sharing Without Semantic Modeling

    data versus the semantic web

    Syntax

    Semantics

    (Meaning)

    N/A

    N/A

    N/A

    SPARQL

    Yes, using

    RDFS and

    OWL

    is a term you will come across again and again when harnessing semantic web technologies.

    it simply means "data about data" (taken from the greek

    meaning "information"). The table above shows some examples of how you might classify the

    provide significant benefits. One of the

    primary benefits of adding semantic meaning to your data is that it can be branched across domains of

    automatically. What do we mean domains of knowledge? Let's illustrate using a simple

    ample, two websites are started independently from each other. One site hosts information on

    current and historic Oscar winning films; the other a large database of biographies of Hollywood actors

    eir website databases. We will cover firstly how information

    sharing between these sites could happen without the use of semantics. Then, we will describe how the

    - with the use of

  • Our two sites, one fronting an MS SQL database of all Oscar winning films, and another one fronting a

    MySQL database of Hollywood actors, reside

    at http://www.oscarwinners.fake andhttp://www.actorbiographies2go.fake respectively. The

    two sites were started independently, and do not collaborate.

    The Oscar Winners site lists, as its name suggests, all of the Oscar winning films ever produced and also

    a list of actors and actresses who starred in them. However, it doesn't hold any other actor information

    other than their name and date of birth.

    The Actor Biographies site contains a complete listing of many current and former Hollywood actors,

    including a complete biography, plus a list of movies that they starred in. But, it does not contain any film

    plots, or screenshots of the films.

    Let's look at how these two sites might collaborate under their current, more traditional data model:

    Obviously, the users of http://www.oscarwinners.fake 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 MySQL database

    at http://www.actorbiographies2go.fake.

    Likewise, the users of http://www.actorbiographies2go.fake 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 MS SQL

    database at http://www.oscarwinners.fake.

    Any sharing of data between the two sites cannot be done by joining tables in their databases. Firstly,

    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 synchronized. They would have to be mapped. But secondly,

    they are using different database server systems which are not cross-compatible.

    To collaborate using their current databases, 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 ID scheme of their own invention. They could do this, for example, by creating a

    secure XML endpoint on each of their websites from which they can request information from each other

    on demand. This way, their shared information is always up to date.

    Important Point This sort of information interchange across incompatible, independently designed data

    systems takes time, money and human contextual interpretation of the different datasets. It also is

    restrictive to the data domains of only these two websites, any further additions to their knowledge from

    elsewhere will demand similar efforts. It requires humans to understand the meaning of the data and agree on common formats to collaborate the two databases appropriately.

    With the introduction of RDF and semantics, it is far easier. Let's investigate how this could be achieved

    using RDF and the semantic web - it all happens automatically, not manually.

    Sharing With The Semantic Web Model

    In semantic modeling, the following are important terms you should know:

    Vocabulary - A collection of terms given a well-defined meaning that is consistent across contexts.

    Ontology - Allows you to define contextual relationships behind a defined vocabulary. It is the cornerstone of defining a knowledge domain. A formal syntax for defining ontologies is OWL (Web

    Ontology Language) which is an extension to RDFS (RDF Schema), which we shall formally introduce in

    the next lesson.

  • So how do we model the two site scenario using semantic modeling? Firstly, the two sites need to apply a

    common, standard vocabulary to describe their data that is contextually consistent. For example, the

    term 'film title' should mean the same thing for both sites, as should the term 'actor name' and 'actor

    birthdate'.

    This may be done by the two sites adopting the same base ontology, or a common vocabulary, for

    expressing the meaning behind the data they expose, and publishing that data on a queryable endpoint

    so that the two sites can communicate with each other across the web.

    With this standard vocabulary in place:

    The two sites can now query each other using the same terms.

    The Oscar Winning Movies site can now query the actor names on the Actor Biographies site on-demand

    and gain more detail about a specific actor or actress that has starred in a movie.

    The Actor Biographies site can now query the film plots on the Oscar Winning Movies site on-demand and

    gain more detail about films an actor has starred in.

    With the contextual relationships defined in a formal web ontology, further related information about the

    actors or films, e.g. film locations, other news events happening on the same day of filming or birthdate

    or the actor, or films made by the same director, may be found via the linked standard terminology

    without the user even imagining that information initially existed.

    This happens without the need for transformation, mapping, or contracts being set up between the two

    sites. It all happens through semantics.

    We'll see in the next lesson what the makeup of a semantic web ontology is, how you query a semantic

    database and even perform machine inference on it.

    Point Of Interest The good news is you often won't have to go through the effort of defining and

    sharing your own ontology for your particular domain of knowledge. There are many popular, standard

    ontologies already distributed on the web which you can adopt, and if necessary extend yourself. We will

    introduce some of these in the following section.

    The cross-domain knowledge sharing discussed here need not just apply to websites, but also within the

    knowledge bases built by organizations. Semantic 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 database, the

    benefits for ease of cross-domain integration from across the globe and the time saved and ideas gained

    from doing so are, potentially, highly significant.

    Metadata Initiatives

    Standard vocabularies, or formal ontologies representing terms within a domain of knowledge, are

    already available freely from various organizations dedicated to creating standard vocabularies for a

    range of subjects - for example media terms, or biomedical terms, or scientific terms. Below are some

    examples:

    Dublin Core Metadata Initiative (DCMI) - Creates ontologies for a range of subjects, particularly focusing

    on common, every day terms and terms important in media.

    Friend Of A Friend (FOAF) - focuses on developing a standard vocabulary/ontology for social networking

    purposes.

    OpenCyc - An ontology of everyday, common sense terms.

    You have now completed this lesson. In the next lesson, we will go into more thorough technical detail

    into how ontologies are defined in the semantic web, and how semantic web databases can be queried

    for information.

    10Describe the types of relationships between entities These are described at #4

    11 List and explain the properties of relational tables

    There are six properties for Relational Tables:

    1) Values are atomic.

    2) Column values are of the same kind.

    3) Each row is unique.

  • 4) The sequence of columns is insignificant.

    5) The sequence of rows is insignificant.

    6) Each column must have a unique name.

    12. Write tables in standard notation . Present Design with the Standard Notations The standard notation presents your design of relational database. It provides information of table

    names, data fields of each table, primary key of each table, foreign key of a table if it exists, and

    relationships between tables. The standard notation is an important part of your project report. Refer to Demo_Computer.xls for example of making standard notations.

    5 Implement the Design with Microsoft Access

    You now transfer the tables in the standard notation to the tables in Access database.

    The Make-Table Query of Access helps you split the flat table and delete duplicate records automatically.

    (1) Upload the flat table to Access database a. Create a database

    b. Import the flat table to your database:

    a) Click Table object, Files menu, select Get External Data and then select Import. b) Select Microsoft Excel from Files of Types drop-down menu. Select drive, directory and the

    Excel file for your flat table. Click Import button. c) Check Show Worksheets radio button, select the worksheet for your flat table in the box to

    the left of radio button and then Next button. d) Check First Row Contains Column Headings, and Next button.

    e) Check In a New Table radio button and Next button.

    f) Select No in the Indexed text box and Next.

    g) Check No Primary Key radio button. The primary key will later be assigned by you. Next button.

    h) Type table name (e.g., Flat Table) and Finish button.

    (2) Run Make-Table Query to spilt the flat table

    a. Create a query for creating a new table. For example, create a table Customer in database Demo_Computer with the flat table uploaded. First, create a query in design view (refer to

    Exercise 5 in Handout: Access Skill Set 1), add the flat table to the query and select data fields according to the table Customer presented in the standard notation.

    b. Make the query a Make-Table Query: click Query menu and select Make-Table Query

    command. After Make Table window pops up, type a table name in Table Name text box and OK.

    Right-click on the grey area of design grid and select Properties. After the Query Properties

    window pops up, set Yes for Unique Values box and close the query properties window. Run the query and yes to confirm. Then close the make-table query with no save.

    c. Specify a primary key for this table according to the standard notation. (3) Repeat Step (2) until all tables in the standard notation are created.

    (4) Delete the flat table for Access database after you have made all table in the standard notation.

    13 Implement a design using a relational database

    14 Explain the role of the database administrator The database administrator performs a critical role within an organization and is an important and key

    role in Database Management Systems. The major responsibility of a database administrator is to handle

    the process of developing the database and maintaining the database of an organization. The database

    administrator is responsible for defining the internal layout of the database and ensuring the internal

    layout optimizes system performance.

    The database administrator has full access over all type of important data of an organization. The

  • database administrator decides what data will be stored in the database and how to organize data in

    database so that it can be access easily on requirement or need of an organization. To design the

    database of an organization, the database administrator must have a meeting with users and determine

    their requirements.

    The database administrator is also responsible for preparing documentation, including

    recording the procedures, standards, guidelines, and data descriptions necessary for the

    efficient and continuing use of the database environment. Documents should include materials to

    help end users, database application programmers, the operation staff, and all personnel connected with

    the database management system.

    The database administrator is responsible for monitoring the database environment, such as

    seeing that the database is meeting performance standards, making sure the accuracy,

    integrity, and security of data are maintained.

    The database administrator is also responsible to manage any enhancements into the database

    environment.

    A Database Administrator, Database Analyst or Database Developer is the person responsible for

    managing the information within an organization. As most companies continue to experience inevitable

    growth of their databases, these positions are probably the most solid within the IT industry. In most

    cases, it is not an area that is targeted for layoffs or downsizing. On the downside, however, most

    database departments are often understaffed, requiring administrators to perform a multitude of tasks.

    Depending on the company and the department, this role can either be highly specialized or incredibly

    diverse. The primary role of the Database Administrator is to administer, develop, maintain and

    implement the policies and procedures necessary to ensure the security and integrity of the corporate

    database. Sub roles within the Database Administrator classification may include security, architecture,

    warehousing and/or business analysis. Other primary roles will include:

    Implementation of data models

    Database design

    Database accessibility

    Performance issues

    Capacity 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 Relational Database Model?

    In Relational Database model, data is organized/stored in tables. this model was introduced by E.F.

    Codd in 1970.

    Relational model is an attempt to simplify the database structure.

    It represents all data in the database as simple tables in the row-column format.

    RDBMS can be defined as a DBMS where all data visible to the user is organized strictly as

    tables of data values and where all database operations work on these tables.

    The above picture clearly defines

    The organizing principle in a relational database is the table, a tabular arrangement of data

    values:

    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 Relational Database Management System ?

    A relational database management system (RDBMS) is a database management system (DBMS) that is

    based on the relational model as introduced by E. F. Codd. Most popular commercial and open source

    databases currently in use are based on the relational database model.

    A short definition of an RDBMS may be a DBMS 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 Wikipedia).

    In the example below, Customer ID is the primary key (PK) in one table and the foreign key (FK) 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 order, however, can be initiated by

    one and only one customer.

  • A relational DBMS stores information in a set of tables, each of which has a unique identifier or

    primary key. The tables are then related to one another using foreign keys.

    Today we have, several RDBMS products like:

    Sybase

    Oracle

    Microsoft SQL Server

    DB2

    MYSQL

    What is SQL?:

    SQL is short for Structured Query Language 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 are:

    Select - Fetches data.

    Insert - Inserts one or more rows of data.

    Update - Modifies existing row(s) of data

    Delete - Deletes rows of data.

    There are several ANSI/ISO standards such as ANSI 92, one of the most popular. This defines a minimum

    subset of supported statements. Most compiler vendors support these standards.