Sei sulla pagina 1di 6

S228/115

DUBLIN INSTITUTE OF TECHNOLOGY KEVIN STREET, DUBLIN 8.

_____________

BSc Computer Science


Year 1 ______________

SEMESTER 2 EXAMINATIONS 2007


______________

INTRODUCTION TO DATABASES
A. Curley Dr. B. OShea Duration: 1.5 hours

Monday 21st May, 2007 .

9.30am 11.00am

Answer question (1) and any two of questions (2), (3), (4) Question (1) is worth 40 marks. Questions (2), (3), (4) are worth 30 marks each

Page 1 of 6

1. (a) (i)

Define data acquisition. (3 marks)

(ii)

What are the primary methods of data acquisition? Use examples to illustrate your answer (6 marks)

(b) (i)

Leinster Telecommunications is a medium-sized company containing 65 employees and consisting of four departments. The company needs to save the following types of information: employee names, salaries, PPS numbers, department names and department managers. Identify the entities and relevant entity attributes. (9 marks)

(c) (i)

What types of relationships are allowed in a RDBMS?


(3 marks)

(ii) Identify the relationship types for each of the following: A school has one principal Employees are assigned to projects A customer can generate one or more invoices (3 marks)

(d) Provide an example of where databases are used in business today. Provide example tables. (8 marks) (e) (i)
Describe a flat-file database.

(4 marks)

(ii) What advantages does a relational database have over a flat-file database? (4 marks)

Page 2 of 6

2. (a) In relational database design, what is the meaning of the primary key? (3 marks)

(b) What should be taken into consideration when choosing a primary key? (6 marks)

(c) What is the meaning of a foreign key? (5 marks) (d) Identify the primary key in Figure 2.1, providing adequate reasons for your selection. (6 marks)
first_name Anne Michael Mary John Jim last_name Smith O'Brien Murphy Cawte Martin course _id DT228 DT224 DT211 DT249 DT223 student _id 56788 98333 65123 99125 87156

Figure 2.1

(e) Figure 2.2 shows 3 entities and their relevant primary keys (PK = Primary Key) as indicated by the shaded columns. State which tables have a relationship. (4 marks) Identify the foreign keys for each relevant table. (6 marks)

Page 3 of 6

2 (e) (Cont.) Table 1: PK


s_id l_name f_name dob

Table 2:
c_id

PK
trimester manager start_id

Table 3:
s_id trimester c_id grade

Figure 2.2

Page 4 of 6

3. (a) What is SQL? (6 marks) (b)


student_id 56788 98333 65123 99125 87156 first_name Anne Michael Mary John Jim student_details last_name age Smith 17 O'Brien 18 Murphy 18 Cawte 17 Smith 19

course_id DT228 DT224 DT211 DT249 DT228

Figure 3.1 Using the table in Figure 3.1, what will be the output from the following queries? SELECT student_id, course_id FROM student_details;

SELECT course_id, student_id, (age + 4) AS completion_age FROM student_details; SELECT student_id, last_name, course_id FROM student_details ORDER BY last_name DESC; SELECT student_id, course_id FROM student_details WHERE course_id IN (DT228, DT211); (12 marks) (c) Using the table in Figure 3.1, what SQL queries would results in the following output? (i)
last_name Smith O'Brien Murphy Cawte Smith course_id DT228 DT224 DT211 DT249 DT228

Figure 3.2 (ii)


last_name Smith O'Brien Murphy Cawte course_id DT228 DT224 DT211 DT249

Figure 3.3

Page 5 of 6

3 (c) (iii)
last_name Smith O'Brien Murphy Cawte course_id DT228 DT224 DT211 DT249

Figure 3.4 (12 marks)

4. (a) Provide a description of transient data and persistent data. (8 marks)

(b) List the different data structures that are possible for storing data on disk. (6 marks)

(c) What are the advantages of using an index and what are its disadvantages? (6 marks)

(d) Nicola Jones places her bank card into the ATM machine. Nicola successfully logs into the ATM using her personal identification number. She has a number of accounts. She checks the balance of her savings account. She decides to withdraw cash from her current account. She checks her balance first to ensure that she has sufficient funds. She withdraws 400 and gets her card back. She may not withdraw any more cash today as she has reached the daily allowable limit. From this scenario, identify the following: How is the data acquired? How is the data processed during this transaction? Is any of the data stored persistently? Is any of the data stored transiently? How is the data output? (10 marks)

Page 6 of 6

Potrebbero piacerti anche