Computer Science 455
Take-home final exam
Due: 6:00 PM, Friday, May 14(last day of finals)
If you want to turn this exam in between 4:00 PM and 6:00 PM on Friday, May 14, you will need to go to Howarth 112, where I will be giving a CSci 161 final exam.
Ground rules: You may consult the textbooks and course notes, or other textbooks or published papers. It is my intention in writing this exam that you will only require the textbooks and course notes. You may not consult any person about this exam except me. Group efforts or consultations with other individuals on this exam are strictly prohibited.
Exams should be printed (word processor) and stapled. Hand-written answers will not be considered. Each question should start on a new page, and questions should be submitted in order. Points will be deducted for not following these guidelines.
Please work 4 of the following 6 questions. Please do not submit more than 4 answers – I will not look at more than the first 4 in any case.
1.
- In the form of a memorandum to your boss, extol the virtues of a relational database management system. In your memorandum, you should outline some of the benefits of a database management system in general (highlighting and describing such things as data independence, user views, administrative benefits, etc.), and list and describe some of the benefits of the relational model in particular.
b. Your boss has written back to say that he understands that there are other database models other than the relational model, and what about them? Respond with a brief definition (for your boss) of a data model, and briefly describe for your boss the hierarchical and network/codasyl models, comparing them to each other and to the relational model. Be candid about some of the limitations of the relational model.
- In several exercises this term, we have considered an order-invoice problem, and this is a modest extension to those exercises. A customer (cno, cname, address) has a number of orders (ordno, date, total-cost) each of which consists of a number of lines (lineno, item#, description, unit-cost, amt-ordered, cost). The (item#,description, unit-cost) fields come from a catalog. Let us suppose further that for each order a company salesperson (sno, sname) has worked with the customer in developing the order.
- Construct an entity-relationship diagram for the above.
- Sketch (using diagrams) how you would implement this in a hierarchical database. Ignore the role of the salesperson in this design (why?).
- Sketch (again using diagrams) how you would implement this in a network/codasyl database. Include the role of the salesperson if possible.
- Give a relational schema for the database, and follow this by CREATE TABLE statements in SQL, making sure to create integrity constraints to enforce entity and referential integrity.
- Yoyodyne Software Consultants, Inc. work on a number of projects for a number of clients. Each project (PNO,PNAME) is associated with one client (CNO, CNAME), but a client may have several projects going at one time. The employees of Yoyodyne are divided into two groups: managers (ENO, ENAME, SALARY), and programmers. Programmers also have (ENO, ENAME, SALARY) attributes but, in addition have a multi-valued skill code (SC) attribute (i.e., an employee can have several skill codes), and, for programmers, we want to keep track of degrees earned (UnivName, DegreeName, DegreeType, YearEarned). We also keep track of the universities our employees come from, recording (UnivName, City, State) for each of them (i.e., universities are entities in their own right, but we only store information about universities which current employees came from). Finally, projects are supervised by a manager (and only one manager, though one manager may supervise several projects), employees work on a variety of projects (devoting a percentage of their time to each), and projects have a number of employees who work on them.
- Construct an entity-relationship diagram for this situation.
- From the entity-relationship diagram, construct a relational schema. Indicate primary and foreign keys.
- Write the SQL CREATE TABLE statements necessary to implement your relational schema. Include integrity constraints (including primary key, foreign key, and not null) as appropriate.
- Construct at least one appropriate index, and say why it might be appropriate.
- Consider the following form: