ex1

advertisement
CSE 5260
Exam #1
Summer 2006
Name:
This test consists of 6 questions, all with multiple parts. Read each question carefully and make sure that your
answer is clear and easily identifiable (failure to satisfy this last requirement will result in loss of credit). Good luck!
1) (20 points) Select the best and most inclusive answer for each of the following.
Which of the following are indicators that a COTS DBMS should be used instead of a custom, file-based system:
(a) large numbers of concurrent users
(b) large amounts of data
(c) extensive security requirements
(d) the need for recovery in the event of system failure
(e) all of the above
(f) none of the above
An individual who is responsible for performing database backup and recovery, managing database userids and
passwords, acting as a liaison with database users, and for installing and managing database software is a:
(a) naïve user
(b) application programmer
(c) data modeler
(d) all of the above
(d) none of the above
Which of the following are components of a DBMS (such as Microsoft SQL Server):
(a) Disk drive
(b) Modem
(c) Main memory (RAM)
(d) all of the above
(e) none of the above
The level of abstraction that specifies details about how data is presented to a user is referred to as the:
(a) view level
(b) logical level
(c) physical level
(d) all of the above
(d) none of the above
A database schema:
(a) defines the over-all structure (design) of a database
(b) specifies the contents (data) in a database
(c) is the same as a DBMS
(d) all of the above
(e) none of the above
1
A “create table” statement is an example of a:
(a) theta join
(b) natural join
(c) DDL statement
(d) DML statement
(e) none of the above
DML stands for:
(a) Database migration logic
(b) Database migration language
(c) Data manipulated logic
(d) Data manipulation language
(e) none of the above
A collection of database operations that are to be treated collectively as a single logical unit, and which either
succeed or fail as a whole, is referred to as a:
(a) transaction
(b) query
(c) schema
(d) index
(e) none of the above
Converting an inheritance hierarchy in an entity-relationship diagram to tables can result in:
(a) a single table with nullable fields
(b) one table for each leaf entity set in the hierarchy
(c) one table for each entity set in the hierarchy (leaf or internal)
(d) any of the above - it is up to the database designer and depends on the specific circumstances
(e) none of the above
Which of the following are part of the six fundamental operations in relational algebra (circle all that apply):
(a) union
(b) intersection
(c) division
(d) theta join
(e) none of the above
2
2) (20 points) Circle T or F for each of the following.
a) The purpose of an entity-relationship diagram is to specify details of how information is to be stored on disk.
T
F
b) A person who accesses a database indirectly through an ATM is an example of what the book calls a “naive
user.”
T
F
c) A commercial, i.e., COTS DBMS is always preferable to a custom developed file system.
T
F
d) An application server is typically used in a two-tiered database system architecture.
T
F
e) A candidate key is also a super key.
T
F
f) Suppose that a many-to-many relationship set R exists between two entity sets E1 and E2. In addition, let K1
and K2 be candidate keys for E1 and E2, respectively. Then the union of K1 and K2 forms a super key for the
relationship set R.
g) The cartesian product operator is identical to the natural join operator.
T
F
T
F
h) The book defines the natural join operator using the following relational algebra operators: projection,
selection, and cartesian product.
T
F
i) A one-to-many relationship may or may not be total, depending on exactly what is being modeled.
T
F
j) When converting an ER diagram to tables, a composite attribute will require an extra table to be added to the
database just to represent the composite attribute.
T
F
3
3) (25 points) Consider a system for tracking FedEx packages. Among other things, the system would be used to
create, modify and delete package information, track the location and status of packages (delivered, en-route, lost,
etc.), and the status of FedEx vehicles (undergoing maintenance or repair, active, etc.).
(a) Name two entity sets that could be part of an entity-relationship model for this enterprise. Note that you must
explain what your entity sets represent.
(b) For each of the entity sets from part (a), list at least three possible attributes. Note that you must define what the
attributes represent.
(c) For each of the entity-sets from part (a), specify which of the attributes from (b) could be used as a primary key.
(d) Give an example of a relationship set that could be part of the entity-relationship model for this enterprise. Note
that you are not required to use the entity sets from part (a). However, be sure to specify all aspects of the
relationship including the mapping cardinality of the relationship set, and to explain what the relationship set
represents.
(e) How many tables would result when the entity sets and relationship set from you answer to part (d) are converted
to tables?
4
4) (12 points) Consider the following relational schemes. Note that attributes forming the primary key for each
relation have been underlined.
student(student-name, street, city)
offering(department, number, section, time, location, population)
titles(department, number, title)
enrollment(student-name, department, number, section)
-- Basic student information.
-- Courses currently offered; for CSE5260
department is “CSE” and number is 5260.
-- Course titles; “CSE5260” is “Database
Systems”
-- Indicates which students are enrolled in
which courses.
Give a relational algebra expression for each of the following.
(a) A list of the titles of all CSE courses.
(b) The department name, course number, section number and title for every course section that has more than 25
students enrolled, i.e., population > 25.
department
CSE
MTH
PSY
PSY
CHM
number
5260
5100
4260
4260
2035
section
1
3
2
3
3
title
Database Systems
Discrete Math
Abnormal Psychology
Abnormal Psychology
Introduction to Chemistry
:
(c) A list of student names along with the titles of those courses they are enrolled in, and the location where the
student takes that course.
student-name
John Smith
Bob Jones
Mary Brown
title
Database Systems
Discrete Math
Abnormal Psychology
:
location
ECE 127
Crawford 220
Link 105
(d) A list of the names of those cities that have at least two student residents.
5
5) (12 points) Now give tuple calculus expressions for each of the queries from question #4.
(a)
(b)
(c)
(d)
6) (10 points) List and define three software components that are part of the database management system
architecture.
6
Download