Professional Documents
Culture Documents
DATABASE SYSTEMS
ENTITY TYPE
WEAK ENTITY TYPE
RELATIONSHIP TYPE
MULTIVALUED ATTRIBUTE
COMPOSITE ATTRIBUTE DERIVED
ATTRIBUTE
E1 R E2 TOTAL PARTICIPATION OF E2 IN R
N
E1 R E2 CARDINALITY RATIO 1:N FOR E1:E 2 IN R
State Zip
Street_address City
Address
11
Copyright © 2015 Ramez Elmasri and Shamkant B.
Navathe
Entity Types, Entity Sets, Attributes,
and Keys
Complex Attributes- Composite and Multivalued attributes
can be nested arbitrarily. Such attributes are called Complex
attributes.
Composite
Example: attribute
Multivalued
attribute
{Address_phone(
{Phone(Area_code,Phone_number)},Address(Street_address
(Number,Street,Apartment_number),City,State,Zip)
Multivalued )}
attribute
Figure 3.7
The CAR entity
type with two key
attributes
(a) (b)
Copyright © 2015 Ramez Elmasri and Shamkant B.
18
Navathe
Relationship Types, Relationship Sets,
Roles, and Structural Constraints
Relationships of the same type are grouped or typed into a
relationship type.
For each STUDENT, the university maintains student Name, student ID, SSN (S ocial
S ecurity Number), Address, Phone, Birthdate, Gender, Level, Major (CS, IS, CNET).
Both Social Security Number and Student Number have unique values for each
student.
Each COURSE has a Course Name, Description, Course Code, Credit Hours, Level,
and Offering Department. The value of Course Code is unique for each course.
Each EMPLOYEE has a SSN, Name, Sex, Department, Address, and Salary. The
value of SSN is unique for each employee, whereas Name, a composite attribute has
Fname, Minit and Lname as a subpart of it.
For each USER, the portal maintains user ID, Name, E-mail. Each user has
a unique ID. Name is a composite attributes with Fname, Midname, Lname.
Each LECTUR has a lecturer Title ID, Duration, and Date. The value of ID
is unique for each lecturer.
1. Key constraints
25
Copyright © 2015 Ramez Elmasri and Shamkant B.
Navathe
Overview
Chapter-2 : Database System Concepts and Architecture
2. Introduction
2.1 Data models, Schemas and Instances
2.1.1 Categories of Data Models
2.1.2 Schemas, Instances, and Database State
2.2 Three schema architecture and data independence
2.2.1 The Three-Schema Architecture
2.2.2 Data Independence
2.3 Database languages and interfaces
2.3.1 DBMS Languages
2.3.2 DBMS Interfaces
2.4 DBMS system environment
2.4.1 DBMS Component Modules
2.4.2 Database System Utilities
2.4.3 Tools, Application Environments
In-Class Exercise & Assignment
26
Copyright © 2015 Ramez Elmasri and Shamkant B.
Navathe
Data Model & Data Abstraction
Data Model:
A data model is a collection of concepts that can
be used to describe the structure of a database-
provides the necessary means to achieve this
abstraction. By structure of a database we mean
the data types, relationships, and constraints
that apply to the data.
Data abstraction:
It generally refers to the hiding of details of data
organization and storage, and the highlighting of
the essential features for an improved
understanding of data.
27
Copyright © 2015 Ramez Elmasri and Shamkant B.
Navathe
Categories of Data Modelsx
High-level or conceptual data models: provide concepts
that are close to the way many users perceive data.
Low-level or physical data models: provide concepts that
describe the details of how data is stored on the computer’s disk.
An access path is a structure that makes the search for particular
database records efficient.
An index is an example of an access path that allows direct access
to data using an index term or a keyword.
Between these two extremes we have,
Representational or implementation data models provide
concepts that may be easily understood by end users but that are
not too far removed from the way data is organized in computer
storage (hard disks). 4
Copyright © 2015 Ramez Elmasri and Shamkant B.
Navathe
Categories of Data Models (Continued)
Conceptual data models use concepts such as
entities, attributes, andrelationships.
Entity represents a real-world object or
concept,suchasan
employee or a project from the mini-world.
Attribute represents some property of interest
entity, further
describes anthat such as the employee's name or salary.
Relationship among two or more entities
representsanamong the entities,
association
Example, a works-on relationship between an employee and a
project. (See chapter-3 : Entity-Relationship model).
Employee works-on Project
11
Copyright © 2015 Ramez Elmasri and Shamkant B.
Navathe
DBMS Languages
Data Definition Language (DDL): Used by the DBA
and database designers to specify the conceptual schema of a
database. In many DBMSs, the DDL is also used to define
internal and external schemas (views). In some DBMSs,
separate Storage Definition Language (SDL) and View
Definition Language (VDL) are used to define internal and
external schemas.
Data Manipulation Language (DML): Used to
specify database retrievals and updates.
DML commands (data sublanguage) can be embedded in a
general-purpose programming language (host language), such
as COBOL, C or an Assembly Language.
17
Copyright © 2015 Ramez Elmasri and Shamkant B. Navathe
Review questions
1. Define the following terms: data model, database schema, database state,
internal schema, conceptual schema, external schema, data independence,
access path, DDL, DML, SDL, VDL, query language, host language, data
sublanguage, database utility etc.
2. List down the main categories of data models.
3. What is the difference between a database schema and a database state?
4. What is the difference between logical data independence and physical data
independence?
5. Draw the diagram of three-schema architecture.
6. What is the difference between procedural and nonprocedural DMLs?
7. List down the different types of user-friendly interfaces.
8. With what other computer system software does a DBMS interact?
9. Discuss the main categories of data models.
10. Explain the three-schema architecture with the help of its diagram.
11. Discuss the different types of user-friendly interfaces and the types of users who
typically use each.
12. Discuss some types of database utilities and tools and their
Copyright © 2015 Ramez Elmasri and Shamkant B.
42
Navathe