0% found this document useful (0 votes)
15 views11 pages

CSE301 Sheet2+Solutions

The document outlines key concepts and definitions related to database systems, including entity types, attributes, and relationships. It also contrasts various terms, provides guidelines for data modeling, and discusses the importance of data modeling in system development. Additionally, it includes tasks for constructing E-R diagrams for various scenarios, emphasizing the application of these concepts in practical database design.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views11 pages

CSE301 Sheet2+Solutions

The document outlines key concepts and definitions related to database systems, including entity types, attributes, and relationships. It also contrasts various terms, provides guidelines for data modeling, and discusses the importance of data modeling in system development. Additionally, it includes tasks for constructing E-R diagrams for various scenarios, emphasizing the application of these concepts in practical database design.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Course Name: Data Base Systems Course Code: CSE 301

Sheet No.: Two Schedule: Wednesday


1. Define each of the following terms
a. Entity type. h. Associative entity.
b. Entity-relationship model. i. Cardinality constraint.
c. Entity instance. j. Weak entity.
d. Attribute. k. Identifying relationships.
e. Relationship type. l. Derived attribute.
f. Identifier. m. Business rule.
g. Multivalued attribute.

2. Contrast the following terms:


a. Stored attribute; derived attribute. d. Entity type; relationship type.
b. Entity type; entity instance. e. Strong entity type; weak entity type.
c. Simple attribute; composite attribute. f. Degree; cardinality.

3. State three reasons why data modeling is the most important part of the system
development process.

4. State six general guidelines for naming data objects in a data model.

5. State Four criteria for selecting identifiers for entities.

6. State three conditions that suggest the designer model a relationship as an


associative entity type

7. State four types of cardinality constraints.

8. Explain the distinctions among the terms primary key, candidate key, and superkey.

1
9. Construct an E-R diagram for a car-insurance company whose customers own one or
more cars each. Each car has associated with it zero to any number of recorded
accidents.
10. Construct an E-R diagram for a hospital with a set of patients and a set of medical
doctors. Associate with each patient a log of the various tests and examinations
conducted.
11. A university registrar’s office maintains data about the following entities: (a) courses,
including number, title, credits, syllabus, and prerequisites; (b) course offerings,
including course number, year, semester, section number, instructor(s), timings, and
classroom; (c) students, including student-id, name, and program; and (d)
instructors, including identification number, name, department, and title. Further,
the enrollment of students in courses and grades awarded to students in each course
they are enrolled for must be appropriately modeled. Construct an E-R diagram for
the registrar’s office. Document all assumptions that you make about the mapping
constraints.
12. Consider a database used to record the marks that students get in different exams of
different course offerings
13. Design an E-R diagram for keeping track of the exploits of your favorite sports team.
You should store the matches played, the scores in each match, the players in each
match and individual player statistics for each match. Summary statistics should be
modeled as derived attributes.
14. Extend the E-R diagram of the previous question to track the same information for
all teams in a league.
15. Define the concept of aggregation. Give two examples of where this concept is useful.

2
Course Name: Data Base Systems Course Code: CSE301

Sheet No.: Two Schedule: Wednesday

1. Define each of the following terms:


a. Entity type. A collection of entities that share common properties or characteristics.
b. Entity-relationship model. A logical representation of the data for an organization or for a
business area.
c. Entity instance. A single occurrence of an entity type.
d. Attribute. A property or characteristic of an entity type that is of interest to the organization.
e. Relationship type. A meaningful association between (or among) entity types.
f. Identifier. An attribute (or combination of attributes) that uniquely identifies individual
instances of an entity type.
g. Multivalued attribute. An attribute that may take on more than one value for a given entity
instance.
h. Associative entity. An entity type that associates the instances of one or more entity types
and contains attributes that are peculiar to the relationship between those entity instances.
i. Cardinality constraint. Specifies the number of instances of one entity that can (or must)
be associated with each instance of another entity.
j. Weak entity. An entity type whose existence depends on some other entity type.
k. Identifying relationships. The relationship between a weak entity type and its owner.
l. Derived attribute. An attribute whose values can be calculated from related attribute values.
m. Business rule: a statement that defines or constrains some aspect of the business.

2. Contrast the following terms:


a. Stored attribute; derived attribute. A stored attribute is one whose values are stored in the
database, while a derived attribute is one whose values can be calculated or derived from
related stored attributes.

3
b. Entity type; entity instance. An entity type is a collection of entities that share common
properties or instances, while an entity instance is a single occurrence of an entity type.
c. Simple attribute; composite attribute. A simple attribute is an attribute that cannot be
broken down into smaller components, while a composite attribute can be broken down
into component parts.
d. Entity type; relationship type. An entity type is a collection of entities that share common
properties or characteristics, while a relationship type is a meaningful association between
(or among) entity types.
e. Strong entity type; weak entity type. A strong entity type is an entity that exists
independently of other entity types, while a weak entity type is an entity type whose
existence depends on some other entity type.
f. Degree; cardinality. The degree (of a relationship) is the number of entity types that
participate in that relationship, while cardinality is a constraint on the number of instances
of one entity that can (or must) be associated with each instance of another entity.

3. Three reasons why data modeling is the most important part of the system
development process:
a. The characteristics of data captured during data modeling are crucial in the design
of databases, programs, and other system components. Facts and rules that are
captured during this process are essential in assuring data integrity in an
information system.
b. Data rather than processes are the most important aspects of many modern
information systems and hence require a central role in structuring system
requirements.
c. Data tend to be more stable than the business processes that use the data. Thus an
information system that is based on a data orientation should have a longer useful
life than one based on a process orientation.

4
4. State six general guidelines for naming data objects in a data model:
a. Data names should relate to business, not technical characteristics.
b. Data names should be meaningful, almost to the point of being self-documenting.
c. Data names should be unique from the name used for every other distinct data
object.
d. Data names should be readable, so the name is structured as the concept would most
naturally be said.
e. Data names should be composed of words taken from an approved list.
f. Data names should be repeatable, meaning that different people or the same person
at different times should develop exactly or almost the same name.

5. Four criteria for selecting identifiers for entities:


a. Choose an identifier that will not change its value over the life of each instance of
the entity type.
b. Choose an identifier such that for each instance of the entity the attribute is
guaranteed to have valid values and not be null (or unknown).
c. Avoid the use of so-called intelligent identifiers (or keys), whose structure indicates
classifications, locations, and so on.
d. Consider substituting single-attribute surrogate identifiers for large composite
identifiers.

6. Three conditions that suggest the designer model a relationship as an associative


entity type:
a. All of the relationships for the participating entity types are “many” relationships.
b. The resulting associative entity type has independent meaning to end users, and
preferably can be identified with a single-attribute identifier.
c. The associative entity has one or more attributes, in addition to the identifier.

5
7. Four types of cardinality constraints:
a. Optional one:

PERSON Owns BICYCLE

b. Mandatory one:

TEAM Has LEADER

c. Optional many:

STUDENT Registers for COURSE

d. Mandatory many:

COURSE Uses TEXTBOOK

8. Explain the distinctions among the terms primary key, candidate key, and superkey.
A superkey is a set of one or more attributes that, taken collectively, allows us to identify uniquely
an entity in the entity set. A superkey may contain extraneous attributes. If K is a superkey, then
so is any superset of K. A superkey for which no proper subset is also a superkey is called a
candidate key. It is possible that several distinct sets of attributes could serve as candidate keys.
The primary key is one of the candidate keys that is chosen by the database designer as the principal
means of identifying entities within an entity set.

6
9. Construct an E-R diagram for a car-insurance company whose customers own one or
more cars each. Each car has associated with it zero to any number of recorded
accidents.

10. Construct an E-R diagram for a hospital with a set of patients and a set of medical
doctors. Associate with each patient a log of the various tests and examinations
conducted.

7
11. A university registrar’s office maintains data about the following entities: (a) courses,
including number, title, credits, syllabus, and prerequisites; (b) course offerings,
including course number, year, semester, section number, instructor(s), timings, and
classroom; (c) students, including student-id, name, and program; and (d)
instructors, including identification number, name, department, and title. Further,
the enrollment of students in courses and grades awarded to students in each course
they are enrolled for must be appropriately modeled. Construct an E-R diagram for
the registrar’s office. Document all assumptions that you make about the mapping
constraints.

In the answer given here, the main entity sets are student, course, course-offering, and instructor.
The entity set course-offering is a weak entity set dependent on course. The assumptions made
are:
a. a class meets only at one particular place and time. This E-R diagram cannot model a class
meeting at different places at different times.
b. There is no guarantee that the database does not have two classes meeting at the same place and
time.

8
12. Consider a database used to record the marks that students get in different exams of
different course offerings.
a. Construct an E-R diagram that models exams as entities, and uses a ternary
relationship, for the above database.
b. Construct an alternative E-R diagram that uses only a binary relationship between
students and course-offerings. Make sure that only one relationship exists between
a particular student and course-offering pair, yet you can represent the marks that a
student gets in different exams of a course offering.

9
13. Design an E-R diagram for keeping track of the exploits of your favorite sports team.
You should store the matches played, the scores in each match, the players in each
match and individual player statistics for each match. Summary statistics should be
modeled as derived attributes.

14. Extend the E-R diagram of the previous question to track the same information for
all teams in a league.
Note that a player can stay in only one team during a season.

10
15. Define the concept of aggregation. Give two examples of where this concept is useful.

Aggregation is an abstraction through which relationships are treated as higher-level entities. Thus
the relationship between entities A and B is treated as if it were an entity C. Some examples of this
are:
a. Employees work for projects. An employee working for a particular project uses various
machinery.
b. Manufacturers have tie-ups with distributors to distribute products. Each tie-up has specified
for it the set of products which are to be distributed.

11

You might also like