Database Management System Sample Final 2013

1 Data modeling Micro loans are small loans, which is beginning to gain popularity especially among borrowers in developing countries. The idea is to bring venture lenders together using information technology. Typically, the loans will be used to finance startup or development of the borrower’s company, so that there is a realistic chance for repayment. The money in a loan can, unlike traditional loans, come from many lenders. In this problem, you must create an E-R model that describes the information necessary to manage micro loans. The following information form the basis for creating the model:  Each borrower and lender must be registered with information about name and address.  A loan starts with a loan request, which contains information about when the loan should at latest be granted, The total amount being discussed (US-dollars), and how long the payback period is. Also, a description is included of how the money will be used. The rent on the payment is calculated in the loan amount, which is to say, the full amount is not paid .  Lenders can commit to an optional portion of the total amount of a loan request.  When the commitments for the loan request covers the requested amount, the request is converted to a loan. If not enough commitments can be reached, the loan request is cancelled. A borrower can have more than one request, and more than one loan at a time, but can at most make one request per day.  The loan is paid through an “intermediary”, typically a local department of a charity, who has a name and an address.  The borrower chooses when he or she will make a payment. Every payment must be registered in the database with an amount and a date (at most one payment per loan per day). The lenders share the repayment based on how large a part of the loan they are responsible for.  If the loan is not repaid before the agreed upon deadline, a new date is agreed. The database must not delete the old deadline, but save the history (the deadline can be overridden multiple times).  Each lender can for each burrower save a “trust”, which is a number between 0 and 100 that determines the lender’s evaluation of the risk of lending money to that person. The number must only be saved for the borrowers, for whom there has been made such an evaluation.

Make an E-R model for the data described above. If you make any assumptions about data that doesn’t show from the problem, they must be described. Use the E-R notation from KBL. Put an emphasis on having the model express as many properties about the data as possible, for instance participation constraints. 2 Normalization The following relation schema can be used to register information on the repayments on micro loans (see the text in the problem 1 for the explanation on micro loans, and the example on data about micro loans in problem 1).

Repayment(borrower_id,name,address,loanamount,requestdate,repayment_date,request_amount)

A borrower is identified with an unique borrower_id, and has only one address. Borrowers can have multiple simultaneous loans, but they always have different request dates. The borrower can make multiple repayments on the same day, but not more than one repayment per loan per day. a) State a key (candidate key) for Repayment. b) Make the normalization to 3NF. State for every step in the normalization, which functional dependency that causes it.

3 Design an Entity-Relationship schema for a database of research projects. The database should contain the information about: − projects: name, manager, budget, duration (in years), funding agency; − employees: SSN, name, projects, salary; − funding agencies: name, address. Each project is funded by a single agency. Project names are unique within an agency. An employee can be associated with several projects. Managers are employees. You can make any other additional assumptions that make sense in the real world.

Produce a relational schema in 4NF from the E-R schema obtained in Problem 1. If your approach is guaranteed to produce a schema in 4NF, then you do not have to check whether that condition holds. Identify the keys and foreign keys. Eliminate redundancies.

4 In Figure A, which attribute is multivalued? A) Years_Employed B) Employee_ID C) Skill D) Address

5 In Figure A, which attribute is derived? A) Years_Employed B) Employee_ID C) Skill D) Address

6 The total quiz points for a student for an entire semester is a(n) _____ attribute. A) derived B) mixed C) stored D) addressed

7 Which of the following criteria should be considered when selecting an identifier? A) Choose an identifier that is stable. B) Choose an identifier that will not be null. C) Choose an identifier that doesn’t have large composite attributes. D) All of the above.

8 An attribute that uniquely identifies an entity, and consists of a composite attribute is called a(n): A) composite attribute. B) composite identifier. C) identifying attribute. D) relationship identifier.

9 An entity that associates the instances of one or more entity types and contains attributes specific to the relationships is called a(n): A) associative entity. B) connecting entity. C) intersectional entity. D) all of the above.

10 The number of entity types that participate in a relationship is called the: A) number. B) identifying characteristic. C) degree. D) counter.

11 A relationship where the minimum and maximum cardinality are both one is a(n) _____ relationship. A) optional B) unidirectional C) mandatory link D) mandatory one

12 The ______rule specifies that each entity instance of the supertype must be a member of some subtype in the relation- ship. A) semi-specialization B) total specialization C) partial specialization D) total convergence

13 The _____ rule specifies that an entity instance of a supertype is allowed not to belong to any subtype. A) semi-specialization B) total specialization C) partial specialization D) disjointedness

14 The _____ rule specifies that an entity can be a member of only one subtype at a time. A) exclusion B) disjoint C) removal D) inclusion

15 What will be returned when the following SQL statement is executed?

Select driver_no,count(*) as num_deliveries from deliveries group by driver_no;

A) A listing of all drivers, sorted by driver number B) A listing of each driver as well as the number of deliveries that he or she has made C) A count of all of the deliveries made by all drivers D) None of the above

16 What will be returned when the following SQL query is executed?

Select driver_no, count(*) as num_deliveries from deliveries group by driver_no having count(*) > 2;

A) A listing of all drivers who made more than 2 deliveries as well as a count of the number of deliveries B) A listing of all drivers C) A listing of the number of deliveries greater than 2 D) A listing of all drivers who made more than 2 deliveries

17 Which of the following have affected the way businesses use computing systems to meet the demand of the competitive mar- ketplace? A) GUI evolutions B) Networking advances C) Communication changes D) All of the above.

18 A PC configured to handle user interface with little or no local storage is called a: A) server. B) fat client. C) thin client. D) workstation. 19 Which of the following is true about three-tier architectures? A) Less scalable than two-tier B) Increased risk C) More technological flexibility D) All of the above

20 In the following diagram, which is true?

A) It depicts a unary relationship. B) It depicts a many-to-many relationship. C) There is an associative entity. D) All of the above.

21 A mutually exclusive relationship is one in which: A) an entity instance can participate in many different relationships. B) an entity instance can participate in only one of several alternative relationships. C) an entity instance can not participate in a relationship with another entity instance. D) none of the above.

22 The _____ is the structure that contains descriptions of objects such as tables and views created by users. A) SQL B) schema C) catalog D) master view Figure B

23 In Figure B, which of the following are subtypes of patient? A) Outpatient B) Physician C) Bed D) All of the above

24 In a file server architecture, which of the following is performed by a client? A) Provides significant LAN traffic B) File storage C) User interface processing D) All of the above.

25 A join operation: A) brings together data from two different fields. B) causes two tables with a common domain to be combined into a single table or view. C) causes two disparate tables to be combined into a single table or view. D) is used to combine indexing operations.

26 What is the English meaning of the following SQL. select P.profno, P.profname from Professor P, Section S, Registration R, Registration R1, Section S1, Professor P1 where P.profno = S.profno and S.sectno = R.sectno and R.studno = R1.studno and R1.sectno = S1.sectno and S1.profno = P1.profno and R1.grade = ’A’ and P1.profname = ’Jones’

27 The following query finds a weighted average of seat counts by course, in which a given room’s seatCount enters multiple times in the computation, depending on how many times a section of the course has been taught in the room. Modify the query to give a simple average, in which each room’s seatCount enters just once in the computation, even though the room may have hosted several sections of the course. select C.courseno, C.title, avg(R.seatCount) as AvgSeats from Course C, Section S, Room R where C.courseno = S.courseno and S.roomno = R.roomno group by C.courseno, C.title

28 The following query finds a weighted average of seat counts by course, in which a given room’s seatCount enters multiple times in the computation, depending on how many times a section of the course has been taught in the room. Modify the query to give a simple average, in which each room’s seatCount enters just once in the computation, even though the room may have hosted several sections of the course. select C.courseno, C.title, avg(R.seatCount) as AvgSeats from Course C, Section S, Room R where C.courseno = S.courseno and S.roomno = R.roomno group by C.courseno, C.title

29 List six major steps that you would take in setting up a database for a particular enterprise.