You are on page 1of 16

final rev 3

[٢ ‫]ﻧظري‬

Eng:Mohamed eldawansy
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
DATABASE PART 3 ENG: OMAR AWAIDA

Important Definitions
Entity-Relationship Diagram (ERD) identifies information required by the
business by displaying the relevant entities
and the relationships between them.

Entity the basic object of ER model which is a


thing in real world.

Strong Entity An Entity set that has a primary key.


Weak Entity An entity set that do not have sufficient
attributes to form a primary key
Attributes property or characteristic of an entity
type.

Domain – Value set specifies the set of values that can be assigned to
the attribute.
Key attribute - uniqueness constraint An attribute of an entity type for which each entity
attributes must have a unique value is called a key attribute of
the entity type.
Candidate Key -is a set of attributes that uniquely identify
tuples in a table.

-An entity type may have more than one


key.
Relationship is an association among several entities.
cardinality of a relationship
the number of instances in entity
E1 that can or must be associated
with instances in entity E2.
Recursive Relationships A relationship in which the same entity
participates more than once.
Indentifying Relationship is a relationship between two entities in which an
instance of a child entity is identified through its
association with a parent entity.
Degree of Relationships number of entity types that
participate in a relationship.
Binary between the instances of two
entity types.
Ternary among the instances of three
entity types.

91
an entity depends on its being
related to another entity via the
relationship type.
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY

Mcq

1) _______ is an object modeling methodology.


a) EML b) UML c) OML d) DML
2) _______ diagrams are important part of object modeling methodology.
a) application b) data c) class d) level
3) During the ______ design phase of database design, the properties of data is
given importance, rather than its storage details.
a) conceptual b) logical c) physical
4) ________ is the basic object of ER model which is a thing in real world.
a) relation b) domain c) attribute
5) Entities are described by properties called as _______.
a) attributes b) characteristics c) features
6) Attributes that are not divisible are called _________.
a) composite b) atomic c) complex
7) _______ attributes can have more than one value.
a) composite b) simple c) multi-valued d) single valued
8) When the value of an attribute A is obtained from the value of an attribute B,
then the attribute A is called _______.
a) composite b) stored c) derived d) retrieved

9) The entity types are represented in ER-diagrams by ______.


a) ovals b) rectangles c) double ovals d) diamonds
10) The multivalued attributes are represented in ER-diagrams by ______.
a) ovals b) rectangles c) double ovals d) diamonds
11) ________ attribute values are used to identify each entity uniquely.
a) complex b) unique c) characters d) key
12) An entity type without a key attribute is called _______ entity type.
a) null b) weak c) strong d) single

10

2
DATABASE SECTION
DATABASE PART 13 ENG:MOHAMED ELDAWANSY
ENG: OMAR AWAIDA

13) ________ specifies the set of values that can be assigned to the
attribute.
a) block b) relation c) structure d) domain
14) Multivalued attributes are shown by _______.
a) ( ) b) { } c) < >
15) The relationships are displayed as _______ in ER-diagrams.
a) rectangles b) ovals c) triangles d) diamonds
16) The relationship in which an entity type participates more than once is a
_____ relationship.
a) recursive b) iterative c) enumerated d) implied
17) _______ specifies the maximum number of relationship instances that
an entity can participate.
a) range b) domain c) cardinality d) ceiling
18) In ER diagrams, the total participation is displayed as a _______.
a) oval b) single line c) double line d) arrow

19) A weak entity type normally has a ________ key.


a) partial b) total c) super d) strong
20) A weak entity type always has a ______ participation constraint with
respect to its identifying relationships.
a) partial b) total c) overlap d) disjoint
21) The partial key attribute is underlined with a ______ line.
a) single b) shaded c) dotted d) double
22) constraint specifies the minimum number of relationship instances
that each entity can participate in and is sometimes called the minimum
cardinality constraint.
23) (0,10) means partial participation, and (1,max) means total
participation.

True or False
1. The ER model is high-level conceptual model.
2. The class diagrams in UML specify the operations on objects also.
3. In database design the conceptual design phase comes after logical design phase. 4. Composite attributes
cannot be further subdivided.
5. A multivalued attribute can have lower and upper bounds.
6. An attribute value can be derived from another attribute.
7. The names on entity types and entity sets are different.
8. An entity cannot have more than one key attribute.
9. A relationship type of degree two is called as ternary relationship.
10. Relationship types can also have attributes.
11. The attribute of a relationship type can be added to participating entity types.

12. A weak entity type can have more than one identifying entity type.

113
DATABASE PART 3 ENG: OMAR AWAIDA

DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY

Important Figure
1) designing of a new database

1-requirements specification and analysis.


2-These requirements are documented in detail and
transformed into a conceptual design.
3-then translated to a logical design that can be expressed in a
data model implemented.
4-The final stage is physical design

2) The three-schema architecture.

4
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY

12

5
DATABASE
DATABASESECTION
PART13 ENG:MOHAMED
ENG: OMARELDAWANSY
AWAIDA

In the ER diagram for COMPANY database identify the following:

1. Names of (nonweak) entity types ________________________________________________


2. Names of weak entities _________________________________________________________
3. Key of DEPARTMENT _______________
4. Primary key of EMPLOYEE ____________________
5. Names of partial keys (if any) ____________________________________________________
6. Names of composite attributes ____________________________________________________
7. Names of multivalued attributes ___________________________________________________
8. Names of relationships ___________________________________________________________
9. Names of identifying relationships _________________________________________________
10. Names of derived attributes _______________________________________________________

Answer the following questions based on the ER diagram for COMPANY database:

1. All the EMPLOYEEs must work on some PROJECT. ( T / F )

2. All the EMPLOYEEs should have a DEPENDENT. ( T / F )

3. All the DEPARTMENTs should have a PROJECT. ( T / F )

4. An EMPLOYEE need not be a manager of a DEPARTMENT. ( T / F )

5. A DEPARTMENT need not be managed by an EMPLOYEE. ( T / F )

Answer the following questions based on the ER diagram for COMPANY database:

1. One EMPLOYEE can have many DEPENDENT’s. ( T / F)

2. One EMPLOYEE can work on a single PROJECT. ( T / F)

3. One DEPARTMENT can control many PROJECTs. ( T / F)


4. One PROJECT can belong to only one DEPARTMENT. ( T / F)
5. One EMPLOYEE can work for many DEPARTMENTs. ( T / F)
6. One PROJECT can be done by only one EMPLOYEE. ( T / F)
7. One EMPLOYEE can supervise only one EMPLOYEE. ( T / F)
8. One DEPARTMENT is managed by only one EMPLOYEE. ( T / F)

9. One DEPARTMENT can have many EMPLOYEEs. ( T / F)


10. One EMPLOYEE can manage many DEPARTMENTs. ( T / F)

Answer the following questions based on the ER diagram for COMPANY database:

1. The attribute NumberOFEmployees of DEPARTMENT entity is a _____________ attribute.

a) key b) derived c) composite d) multivalued

2. The attribute Name of EMPLOYEE entity is a ____________ attribute.


a) key b) derived c) composite d) multivalued

3. The attribute Locations of DEPARTMENT entity is a ____________ attribute.


13
6
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY

Database Management System (DBMS)


o It stores data in such a way that it becomes easier to retrieve, manipulate, and
produce information.

DBMS is : a general-purpose software system that facilitates the processes of


defining, constructing, manipulating, and sharing databases among various users
and applications.

DBMS Functionalities :

Traditional file processing Approach


ØIt can be a document, picture, audio or video stream, data library,
application, or other collection of data.
Øeach user defines and implements the files needed for a specific
software application as part of programming the application.

File Based System
ØCollection of application programs that perform services for
the end users (e.g. reports).
ØEach program defines and manages its own data.

7
† File Based System
Ø Collection of application programs that perform services for
theSECTION
DATABASE end users
1 (e.g. reports). ENG:MOHAMED ELDAWANSY
Ø Each program defines and manages its own data.
Limitations
Limitations of File-Based of File-Based Approach
Approach
† Limited Data Sharing
Ø No centralized control of data.
† Data Redundancy (Duplication of data)
Ø Different systems/programs have separate copies of the same
data
Ø When data changes in one file, could cause inconsistencies
† Program Data Dependence
Ø All program maintain meta data for each file they use.
† Separation & Isolation Of data
Ø each user has a copy.
† Incompatible file formats
DATABASE PART 3 ENG: OMAR AWAIDA
16
Ø Programs are written in different languages, and so cannot
easily access each other’s files.
† Lengthy Development Times
† Excessive Program Maintenance

† The Database Approach


Ø Definition of data was embedded in application programs,
rather than being stored separately and independently.
Ø No control over access and manipulation of data.
Guees the result …….??

Characteristics of the Database Approach



1) Self-Describing Nature of a Database System
o The database system contains not only the database itself but
also a complete definition or description of the database
structure and constraints.
8
o This definition is stored in the DBMS cata- log, which contains
information such as the structure of each file, the type and stor-
rather than being stored separately and independently.
Ø No control over access and manipulation of data.
DATABASE SECTION 1 Guees the result …….??
ENG:MOHAMED ELDAWANSY

Characteristics of the Database Approach



1) Self-Describing Nature of a Database System
o The database system contains not only the database itself but
also a complete definition or description of the database
structure and constraints.
o This definition is stored in the DBMS cata- log, which contains
information such as the structure of each file, the type and stor-
age format of each data item, and various constraints on the data.
o The information stored in the catalog is called meta-data, and it
describes the structure of the primary database.
2) Insulation between programs and data
o In traditional file processing, the structure of data files is
embedded in the applica- tion programs, so any changes to the
structure of a file may require changing all pro- grams that access
that file.
o The structure of data files is stored in the DBMS catalog sepa-
rately from the access programs. We call this property program-
data independence.
DATABASE PART 3
o Data Abstraction …. ??? ENG: OMAR AWAIDA

o A DBMS provides users with a conceptual representation of


data that does not include many of the details of how the data is
17
stored or how the operations are implemented.
o Data model is a type of data abstraction that is used to
provide this conceptual representation.

3) Support of multiple views of the data
o A database typically has many types of users, each of
whom may require a different perspective or view of the
database.
o A view may be a subset of the database or it may contain
virtual data that is derived from the database files.

4) Sharing of data and multiuser transaction processing
9
o A multiuser DBMS allows multiple users to access the
stored or how the operations are implemented.
o Data model is a type of data abstraction that is used to
provide this conceptual representation.
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY

3) Support of multiple views of the data
o A database typically has many types of users, each of
whom may require a different perspective or view of the
database.
o A view may be a subset of the database or it may contain
virtual data that is derived from the database files.

4) Sharing of data and multiuser transaction processing
o A multiuser DBMS allows multiple users to access the
database at the same time.
o The DBMS must include concurrency control software
called online transaction processing (OLTP) to ensure
that several users trying to update the same data do so in a
controlled manner so that the result of the updates is
correct.

5) Restricting Unauthorized Access
o A DBMS provides a security and authorization subsystem.
o the DBA uses to create accounts and to specify account
restrictions.
o the DBMS should enforce these restrictions automatically.

6) Controlling Redundancy
o we should have a database design that stores each logical
data item in only one place in the database.
o This is known as data normalization, and it ensures
consistency and saves storage space.

18

10
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY

11
DATABASE
DATABASE SECTION
PART13 ENG:MOHAMED
ENG: OMARELDAWANSY
AWAIDA

7) Providing Multiple User Interfaces



8) Providing Backup and Recovery

9) Representing Complex Relationships among Data

† Transaction
Ø is an executing program or process that includes one or more
database accesses, such as reading or updating of database
records.
Ø each transaction is supposed to execute a logically correct
database access if executed in its entirety without interference
from other transactions.
Ø Properties of Transactions (ACID)
o Atomicity
o Consistency
o Isolation
o Durability

Actors on the Scene (DB & DBMS Users)

† Database Administrators ( DBA )


Ø The DBA is responsible for authorizing access to the database,
coordinating and monitoring its use, and acquiring software and
hardware resources as needed.
Ø The DBA is accountable for problems such as security breaches
and poor system response time.
† Database designers
Ø they are responsible for identifying the data to be stored in the
database and for choosing appropriate structures to represent and
store this data.
Ø they communicate with all prospective database users in order to
understand their requirements and to create a design that meets
these requirements.
12
19
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
DATABASE PART 3 ENG: OMAR AWAIDA

Ø Database designers typically interact with each potential group


of users and develop views of the database that meet the data
and processing requirements of these groups.

† End users
Ø are the people whose jobs require access to the database for
querying, updating, and generating reports.
Ø Database End users are categorized as
o Casual end users
- they may need different information each time.
o Naive or parametric end users
- Their main job function revolves around constantly
querying and updating the database, using standard
types of queries and updates called canned
transactions, that have been carefully programmed and
tested.
§ examples are: Bank tellers , customers, , and
Reservation agents or customers for airlines.
o Sophisticated end users
- include engineers, scientists, business analysts, and
others who thoroughly familiarize themselves with the
facilities of the DBMS in order to implement their
own applications to meet their complex requirements.
o Standalone users
- maintain personal databases by using ready-made
program packages that provide easy-to-use menu-
based or graphics-based interfaces.
† System Analysts and Application Programmers (Software
Engineers)
Ø System Analysts and Application Programmers commonly
referred to as
o software developers or software engineers.
Ø System analysts

13
20
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY
DATABASE PART 3 ENG: OMAR AWAIDA

o determine the requirements of end users, and develop


specifications for standard canned transactions that meet
these requirements.

Ø Application programmers
o implement these specifications as programs; then they test,
debug, document, and maintain these canned transactions.

When Not to Use a DBMS


1) overhead costs of using a DBMS
• High initial investment in hardware, software, and training.
• Overhead for providing security, concurrency control,
recovery, and integrity functions.

2) simple, well-defined database applications that are not expected


to change at all

3) No multiple-user access to data


------------------------------------------------------------------

The End

14
21
DATABASE SECTION 1 ENG:MOHAMED ELDAWANSY

Review Questions

1) Discuss the main characteristics of the database approach and how it


differs from traditional file systems.
2) What are the different types of database end users? Discuss the main activi-
ties of each

3) Discuss the capabilities that should be provided by a DBMS.


4) What are the responsibilities of the DBA and the database designers?
5) Define the following terms: data, database, DBMS, database system,
database catalog, program-data independence, user view, DBA, end user,
canned trans- action, deductive database system, persistent object, meta-
data, and transaction-processing application.

MCQs

1) Duplication of data at several places is called as ___________ .


a) Data Inconsistency
b) Atomicity Problem
c) Data Isolation
d) Data Redundancy

2) Data Redundancy increases the cost of storing and retrieving data.


a) True
b) False
22

15

You might also like