exam 1 review dr. bernard chen ph.d. university of central arkansas
TRANSCRIPT
![Page 1: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/1.jpg)
Exam 1 Review
Dr. Bernard Chen Ph.D.University of Central Arkansas
![Page 2: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/2.jpg)
Database System Database:
A collection of related data. Data:
Known facts that can be recorded and have an implicit meaning.
Database Management System (DBMS):A software package/ system to facilitate thecreation and maintenance of a computerizeddatabase.
Database System:DBMS + Database
![Page 3: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/3.jpg)
Database V.S. File In the database approach, a single repository
of data is maintained that is defined once then accessed by various users
The major differences between DB and File are:
1. Self-describing of a DB2. Insulation between programs and data3. Support of multiple views of the data4. Sharing of data and multiuser transaction
processing
![Page 4: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/4.jpg)
Self-describing nature of a database system Database system contains not only the
database itself but also a complete definition of the database structure and constrains
The information stored in the catalog is called Meta-data (data about data), and it describes the structure of the primary database.
![Page 5: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/5.jpg)
Categories of data models High-level or Conceptual data
models:Provide concept that are close to the way
many users perceive data
Low-level or Physical data model:Provide concepts that describe the details
of how data is stored in the computer
![Page 6: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/6.jpg)
Conceptual data models It uses concepts such as entities, attributes
and relationships.
Entity represents a real-world object or concept, such as employee or project
Attribute represents some property of interest that further describes an entity, such as employee’s name or salary
Relation among two or more entities represents an association among two or more entitles
![Page 7: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/7.jpg)
Example of a Database Schema
![Page 8: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/8.jpg)
Schemas and Database State The data in the database at a particular moment in time
is called a database state The distinction between database schema and database
state is very important When we define a new database, we specify its
database schema only to the DBMS
At this point, the corresponding database state is the empty state with no data
We get the initial state of the database when the database is first loaded
From then on, every time an update operation is applied to the database, we get another database state
![Page 9: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/9.jpg)
Three-Schema Architecture Defines DBMS schemas at three levels:
Internal schema at the internal level to describe physical storage structures and access paths (e.g indexes).
Conceptual schema at the conceptual level to describe the structure and constraints for the whole database for a community of users.
External schemas at the external level to describe the various user views.
![Page 10: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/10.jpg)
The three-schema architecture
![Page 11: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/11.jpg)
Centralized DBMS Architecture A centralized DBMS in which all the DBMS functionality,
application program execution, and user interface processing were carried out on a single machine
The client/server architecture was developed to deal with computer environment in which a large number of PCs, workstation, file server…
This is called two-tire architectures because the software components are distributed over two systems: client and server
The emergence of the Web changed the roles of client and server, leading to the three-tier architecture
![Page 12: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/12.jpg)
A Physical Centralized Architecture
![Page 13: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/13.jpg)
Logical two-tier client server architecture
![Page 14: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/14.jpg)
Three-tier client-server architecture
![Page 15: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/15.jpg)
Entities and Attributes The most basic object that the ER model
represents is an entity An entity maybe an object with a
physical existence (a person, a car, house…) or it maybe an object with conceptual existence (a company, a job, or a course)
Each entity has Attributes --- the particular properties that describe it
![Page 16: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/16.jpg)
Attributes
Several types of attribute occur in the ER model Simple vs. Composite Single value vs. Multi-value Stored vs. Derived
![Page 17: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/17.jpg)
Composite vs. Simple Attributes Composite attributes can be divided into
smaller subparts. For example: Address attribute of the EMPLOYEE entity
can be further subdivided into street_address, city, state, zip_code
Simple attributes can not be further divisible For example, street_address can be subdivided into
Number, street, and apt#
The value of composite attribute is the concatenation of the values of its constituent simple attributes
![Page 18: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/18.jpg)
Single value vs. Multi-value Most attributes have a single value for a particular
entity; such attribute are called single-valued
In some cases an attribute can have a set of value for the same entity --- for example, colors attribute for a car, or a college_degree for a person
Such attributes are called multivalued
A multivalued attribute may have lower and upper bonds to constrain the number of values allowed for each entity
![Page 19: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/19.jpg)
Stored vs. Derived In some cases, two (or more)
attribute calues are related --- for example, the Age and Birth_date of a person
The Age attribute is called a derived attribute and is said to be derived from the Birth_date attribute, which is called a stored value
![Page 20: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/20.jpg)
Key Attributes
An important constrain on the entities of an entity type is the KEY on attributes
An attribute of an entity type for which each entity must have a unique value is called a key attribute of the entity type. For example, SSN of EMPLOYEE.
![Page 21: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/21.jpg)
Relationship The initial design is typically not complete Refining the initial design by introducing
relationships ER model has three main concepts:
Entities (and their entity types and entity sets) Attributes (simple, composite, multivalued) Relationships (and their relationship types and
relationship sets)
![Page 22: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/22.jpg)
Recursive Relationship In some cases, the
same entity type participates more than once in a relationship type in different roles
Example Employee and supervised
![Page 23: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/23.jpg)
ER DIAGRAM
![Page 24: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/24.jpg)
Weak Entity Types Entity types do not have key attribute of
their own are called weak entity types In contrast, regular entity types that do
have key attribute are called strong entity types
A weak entity type normally has a partial key, which is the set of attributes that can uniquely identify weak entities that are related to the same owner entity
![Page 25: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/25.jpg)
Weak Entity Type Weak entity types can sometimes be
represented as complex attributes
Complex Attributes: combination of composite and multi-valued attributes
In the example, we could specify a multi-valued attribute Dependents for EMPLOYEE, which is a composite attribute with component attributes Name, Birthday, Sex and Relationship
![Page 26: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/26.jpg)
Subclasses, Superclasses and Inheritance We call each of these subgroupings a subclass of the
EMPLOYEE entity type, and the EMPLOYEE entity type is called the superclass for each of these subclasses.
These are called superclass/subclass (as well as simply class/subclass) relationships:
EMPLOYEE/SECRETARY EMPLOYEE/TECHNICIAN EMPLOYEE/MANAGER …
These are also called IS-A relationships SECRETARY IS-A EMPLOYEE, TECHNICIAN IS-A EMPLOYEE,
….
![Page 27: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/27.jpg)
Subclasses and Superclasses
![Page 28: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/28.jpg)
Subclasses, Superclasses and Inheritance An important concept associated with
subclasses is that of type inheritance
An entity that is member of a subclass inherits All attributes of the entity as a member of
the superclass All relationships of the entity as a member
of the superclass
![Page 29: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/29.jpg)
Constraints on Specialization and Generalization Two basic constraints can apply to a
specialization/generalization: Disjointness Constraint: Specifies that the subclasses of the
specialization must be disjoint: an entity can be a member of at most one of the subclasses of the specialization
Completeness Constraint: If not disjoint, specialization is overlapping
![Page 30: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/30.jpg)
Displaying an attribute-defined specialization in EER diagrams
![Page 31: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/31.jpg)
Example of overlapping total Specialization
![Page 32: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/32.jpg)
Constraints on Specialization and Generalization Completeness Constraint:
Total specifies that every entity in the superclass must be a member of some subclass in the specialization/generalization
Shown in EER diagrams by a double line
Partial allows an entity not to belong to any of the subclasses
Shown in EER diagrams by a single line
In general, a superclass that was identified through the generalization process usually total, because the superclass is derived from the subclasses and hence contains only the entities that are in the subclass
![Page 33: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/33.jpg)
Specialization/Generalization Hierarchies, Lattices A subclass may itself have further subclasses
specified on it
Hierarchy has a constraint that every subclass has only one superclass (called single inheritance); this is basically a tree structure
In a lattice, a subclass can be subclass of more than one superclass (called multiple inheritance)
![Page 34: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/34.jpg)
Union All of the superclass/subclass
relationships we have seen so far origin from a single superclass
Sometimes we may need more than one superclass
In this case, the subclass will represent a collection of objects that is a subset of the UNION of distinct entity types
We call such a subclass a UNION TYPE
![Page 35: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/35.jpg)
UNION Attribute inheritance works more
selectively in the case of UNION.
For example, OWNER entity inherits attributes of a COMPANY, a PERSON OR a BANK
A shared subclass such as ENGINEERING_MANAGER inherits ALL the attributes of its superclasses
![Page 36: Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas](https://reader035.vdocument.in/reader035/viewer/2022070414/5697c0191a28abf838cce3df/html5/thumbnails/36.jpg)
Two categories (UNION types): OWNER, REGISTERED_VEHICLE