MIDTERM
MIDTERM
Midterm Exam
InvoiceNum ProductNum
456352 16110
736378 20114
637368 16110
373743 16110
386383 14001
745745 14001
456473 16051
235677 16051
123465 16110
456457 02104
785674 02105
356463 02104
234546 14001
756757 20114
6. Using the the following Invoice Numbers and item numbers, item numbers are the secondary key, construct a
Circular Linked List with pointers for Item Number.
2. What are the names of salespeople having an order with Vendor, Lewis Construction?
3. What are the city of all Customers having an order with salesperson Jones?
4. What are the ages of sales people having an order with Vendor, Manchester Lumber?
5. Given the following attributes, define a table using the proper notation and include the key.
6. Using the same data from the above question, create a Multi List with ProductNum as the
secondary key.
InvoiceNum ProductNum
456352 16110
736378 20114
637368 16110
373743 16110
386383 14001
745745 14001
456473 16051
235677 16051
123465 16110
456457 02104
785674 02105
356463 02104
234546 14001
756757 20114
Use the following tree structure to answer the following seven questions.
TREE:
A
----------------- --------------
| |
B C
-------- ------- -------- -------
| | | |
D E F G
13. What is the depth of the level that contains the B and C nodes?
14. If you have a tree with an order of 5, how many keys can each node contain?
15. If you have a tree with an order of 9, how many keys will be stored in the entire tree at a
maximum?
16. The following is an ER Model for a law firm. You need to convert the ER Model to a Structured
Entity Chart.
DATABASE MANAGEMENT
Midterm Exam
Multiple Choice 1 point each
1. A technique used to organize the findings of the conceptual design team is called:
a. a relationship model
b. a relationship-design model
c. a entity-relationship model
2. During what phase of the entity consolidation is the semantic synonyms recognized?
a. Aggregation
b. Generalization
c. Identification
3. The weakness in a database management system that may occur when two processes are trying
to access the same record is called:
a. Locking
b. Dead lock
c. two-phase locking
7. Which of the following is used to define the location, length, and format of the data elements, the
position of each element within the data structure, and the security of each data element?
a. View
b. Schema
c. Subschema
d. Data Manipulation Language
7. Which of the following is used to define the location, length, and format of the data elements, the
position of each element within the data structure, and the security of each data element?
a. Data Definition Language
b. Schema
c. Subschema
d. Data Manipulation Language
8. Which of the following is a set of commands to cause data to be stored and retrieved by a DBMS?
a. Data Definition Language
b. Schema
c. Subschema
d. Data Manipulation Language
10. Which of the following describes the application program view of the data?
a. Data Definition Language
b. Schema
c. Subschema
d. Data Manipulation Language
11. Which of the following limits the functions that the program or user can perform?
a.Data Definition Language
b.Schema
c.Subschema
d.Data Manipulation Language
14. To recover the database from a transaction discovered to be erroneous one week after it had
been entered:
a. Apply before images of the transaction to the database.
b. Apply after images of the transaction to the database.
c. Use a differential file.
d. Enter an offsetting transaction.
15. The simplest way to recover the database from the failure of a single transaction is to:
a. Apply all after images of the transaction to the database.
b. Apply all before images of the transaction to the database.
c. Begin with the most recent copy of the database and apply all before images in the log.
d. Begin with the most recent copy of the database and apply all after images in the log.
18. If a user wishes to guarantee that no other users will have access to the data while (s)he is
modifying a database, (s)he would utilize:
a. exclusive access
b. read-only access
c. read/write access
d. password access
e. none of the above
Fill-In-The-Blank:
_________________________. 2 points
2. The terms relation, tuple, and attribute correspond to table, ________________, and
______________ respectively. 2 points
3. The three tables that we talked about that make-up the catalog are
4. For most situations, tables in _______ normal form are usually free from the problems of data
redundancy and abnormalities. 1 point
5. Current efforts in data base design are divided into 3 separate steps: development of the
Short Problems:
2. Given the following attributes, define a table using the proper notation and include the key.
10 points
Using the table that was defined in the above problem, answer the following questions.
3. What are the functional dependencies that exist in this table? If any, state the dependency and list
the dependency type for each. 10 points
5. If the table is not in third normal form, translate the table into third normal form. Use proper table
notation. 10 points
6. Using the following log, assume that the DBMS being used issues locks whenever a READ,
MODIFY, INSERT, or ERASE command is given and releases all locks held by a transaction when a
COMMIT command is executed. Locks occur at the record level. Determine the locks held by each
transaction at each point throughout the session. 15 points
Use the following relational schema to develop relational algebra and relational calculus solutions for
each of the following queries.
5. What are the cities with population under 100,000 and what are their populations?
10 points
Relational Algebra:
A:= Select(City: Population < 100,000)
B:= A[CityName, Population]
Relational Calculus:
{r.city-name, r.population: r IN city and r.population < 100,000}
6. What are the weights of shipments sent by customers with over $1 million in annual revenue?
10 points
Relational Algebra:
A:= Select(Customer: Annual-revenue > 1,000,000)
B:= Join(A, Shipment)
C:= B[Weight]
Relational Calculus:
{r.weight: r IN Shipment and there exists t IN Customer(r.cust_Id = t.cust_Id and Annual-revenue >
1,000,000}
Short Problems:
1. List and briefly describe each of the six steps in the database development life cycle. 7 points
4. If deadlock occurs, why must one transaction be rolled back instead of merely held up and allowed
to continue when the other user is done? 7 points
5. What is the difference between a shared lock and an exclusive lock? 7 points
9. What is the difference between the schema and the subschema of a database? 7 points
11. What are the 2 major functional components of a database management system and what are
the purpose of each of these components? 7 points
12. Given the following attributes, define a table using the proper notation and include the key.
7 points
14. Using your knowledge of a college environment, determine the functional dependencies that exist
in the following relation. After these have been determined, convert this relation to an equivalent
collection of relations that are in 3rd normal form. 9 points
2. The DBMS acts as an interface between what two parts of a system? 2 points
3. List the three tables that we talked about that make-up the catalog. 3 points
11. For most situations, tables in _______ normal form are usually free from the problems of data
redundancy and abnormalities. 5 points
CLASS (class_id, name, section, days, hour, room_id, teacher_id, capacity, enrolled)
Using the conceptual design from above, draw an entity relationship model for a teacher-oriented
relational system. Show only the entities, not the attributes and the relatiionship between the entities.
10 points
8. Using the conceptual design from the previous problem, draw a Semantic Object Model for a
teacher-oriented relational system.
Note: I will use DBMS in this exam to mean Data Base Management System.
10. What are the functional dependencies that exist in this table? If any, state the
dependency and list the dependency type for each.
12. If the table is not in third normal form, translate the table into third normal form. Use
proper table notation.
13. Briefly explain how a file that will allow random access to the data uses indexes to
accomplish this task.
14. Create a doubly linked list on CourseNum. using the following data.
StudentNum CourseNum
456352 16110
736378 20114
637368 16110
373743 16110
386383 14001
745745 14001
456473 16051
235677 16051
123465 16110
456457 02104
785674 02105
356463 02104
234546 14001
756757 20114
Note: I will use DBMS in this exam to mean Data Base Management System.
1. Contrast file-processing systems and database processing systems.
2. Why is data redundancy a big problem in DBMS? List at least 3 situations that
redundant data could compromise the integrity of the data
3. Name the two major functional components of a database system, and briefly explain
the function of each.
4. One of the major functional components of a database system, from the above
question, is broken down into 2 subfunctions. Which is the function that is subdivided
further and what are the 2 subfunctions?
5. Briefly define the purpose of the 2 subfunctions from the above problem.
StudentNum CourseNum
456352 16110
736378 20114
637368 16110
373743 16110
386383 14001
745745 14001
456473 16051
235677 16051
123465 16110
456457 02104
785674 02105
356463 02104
234546 14001
756757 20114
9. Using the same data from the above question, create a Circular Linked List with
CourseNum as the secondary key.
Use the following relational schema to develop relational algebra and relational calculus
solutions for each of the following queries.
17. What are the names of salespeople having an order with Abernathy Construction?
18. What are the city of all Customers having an order with salesperson Jones?
19. What are the ages of sales people having an order with Manchester Lumber?
20. What are the names of all salespeople with the names of customers who have
ordered from them?
2. What type of accesses can be done with each of the above file organizations? Include all
access modes.
3. Using the following formula, determine the relative record number for each of the following
records.
2543
7645
6845
3457
1546
2467
4556
21. List two methods that could be use in the data collection of the design phase.
22. What is the advantage of involving everyone in the design phase of the DataBasee
Management System?
9. Database Design
10. Enterprise Planning
11. Standards and Procedures
12. DBMS Evaluation and Selection
13. Policy Formulation
14. Data Dictionary Management
15. Test/Production Environments
16. Training
17. Top-level Education and Commitment
18. Overall Coordination
19. Database Loading
20. DBMS Support
21. Keep Current with Technology
22. Complications to DBMS Processing
Link list use pointers or links to maintain the logical sequence of the records, instead of physically rearranging
the entire file. Listed below are 10 software names. Using the links listed on the right, place the software in
logical alphabetic order.
Short Answer:
34. A __________________ tree is one in which the height of each node's subtrees differs by at most 1.
35. If we have a B-tree of order 9, the number of keys that can be stored in each node is _________________.
38. Alternative names for a physical record are page and ____________.
39. A randomizing routine is another name for a __________________ function.
40. The use of a _________________ technique for direct organization results in a unique disk address.
41. Construct a Circular linked list with pointers for the following records: 100, 50, 40, 200, 300, 150, 50, 40,
50, 100, 200, 200, 300
42. Breifly explain the difference between Distributed Database and Distributed processing.
This workforce solution is funded in part by the IHUM Consortium which is 100% financed through a $15,000,000 grant from the U.S.
Department of Labor’s Employment and Training Administration.
The product was created by the grantee and does not necessarily reflect the official position of the U.S. Department of Labor. The Department of
Labor makes no guarantees, warranties, or assurances of any kind, express or implied, with respect to such information, including any
information on linked sites and including, but not limited to, accuracy of the information or its completeness, timeliness, usefulness, adequacy,
continued availability, or ownership.
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit
http://creativecommons.org/licenses/by/4.0/.