Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
MODULE
DAY
DATE
TIME
Module
Lecturer
Supervisor
Room
: EDB1
:
:
:
EDB1
FRN
Exercise 1
[20 points]
Below you will find an example of a form of a car rental company, with rental details of one the many rental
cars from a certain period.
Postcode
4883 KP
4883 KP
1234 AB
3772 BH
Number
6353728
6353728
FD76373
6378282
start
12-02-98
23-02-99
01-04-99
02-05-99
end
31-01-99
31-03-99
01-04-99
10-06-99
days
347
37
1
40
Damage
N
N
N
N
Furthermore:
- "Number" is a passport number or drivers license number.
- the rental price depends on the make of the car, age of the car and state of the car.
- Every make is serviced by one specialized garage.
a)
b)
No sloppy work, no crossed out words, no mess, etcetera: first finish this exercise on a draft
paper!
Exercise 2
[20 points]
Choose the one alternative that best completes the statement or answers the question.
1) A database designed to implement requirements for a reporting application needed by
the Sales department is a database being designed ________.
A) as a new systems development project
B) as a redesign of an existing database
C) from existing non-database data
D) A and B
E) A, B, and C
1) ______
2) ______
3) ______
4) A database records:
A) facts.
B) figures.
C) information.
D) A and B
E) A, B and C
4) ______
5) ______
E) EXISTS
6) In an SQL query, the built-in function COUNT works with columns containing data of
which of the following data types?
A) Integer
B) Char
C) Numeric
D) A and B
E) A, B and C
6) ______
7) A determinant that determines all the other columns in a relation is a(n) ________.
A) record
B) candidate key
C) field
D) surrogate key
E) foreign key
7) ______
8) ______
9) The industry standard supported by all major DBMSs that allows tables to be joined
together is called ________.
A) Structured Query Language (SQL)
B) Sequential Query Language (SQL)
C) Relational Question Language (RQL)
D) Relational Query Language (RQL)
E) Structured Question Language (SQL)
9) ______
10) In an SQL query, which built-in function is used to obtain the largest value of numeric
columns?
A) SUM
B) COUNT
C) MIN
D) AVG
E) MAX
10) _____
11) A combination of two or more columns used to identify particular rows in a relation is
a(n) ________.
A) foreign key
B) surrogate key
C) field
D) record
E) composite key
11) _____
12) _____
TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false.
13) Database design is important, but fortunately it is simple to do.
13) _____
14) In a database processing system, indexes are held by the database management
system (DBMS).
14) _____
15) XML Web services allow database processing to be shared across the Internet.
15) _____
16) All database applications get and put database data by sending SQL statements to the
DBMS.
16) _____
17) _____
18) _____
19) The condition in WHERE clauses can refer to a set of values by using the IN operator.
19) _____
20) _____
21) _____
22) _____
23) The SQL keyword FROM is used to specify the table to be used.
23) _____
24) All relations are tables, but not all tables are relations.
24) _____
25) Data is recorded facts and figures; information is knowledge derived from data.
25) _____
Exercise 3
[30 points]
Write down the following questions in SQL. Use the table descriptions from appendix 1.
a)
Give the details of all teachers who have a salary number smaller than 45.
b)
Give all course names and prices of those courses, of which the course name starts with an
x and the course names and prices have to be shown of those courses that do not start with an x
but do have a price greater than 1100 euro.
c)
Give the teacher# of teachers that have taught the course LOTUS-NOTES.
d)
Give the names of the teachers and their monthly salary of those teachers that were planned (for a
course) after 31-Jan-2003.
f)
Give an overview, ordered by course date, of the teacher#s, with the last course date, for which the
teachers are planned. The last (youngest) date must be the first in the overview.
g)
h)
Give teacher#, teacher name, the average course price and the number of courses for which he/she
is planned, for those teachers from Valkenswaard or Veldhoven and for which the course price is
greater than 300 euro.
i)
Give the average salary of the teachers per place, but not from Eindhoven and only if there are
more than 3 teachers that live in that place.
Exercise 4
[20 points]
The student sports center in Eindhoven has a brochure with information about the activities for this
school year. Below you will find part of an overview of the sports activities.
Activity
Hall
Karate
Size
(m2)
150
Yoga
75
Judo
200
Teacher
Description
Day
Start
End
Duration
K. Mitsubishi
Y. Toyota
K. Mitsubishi
S. Ittight
H. Eadstand
B. Belt
beginners
advanced level
expert level
hata yoga
beginners
Competition
group
beginners
Tue
Mon
Wed
Mon
Wed
Mon
21.00
17.00
19.00
20.00
16.45
20.00
22.00
18.30
20.00
21.30
18.00
21.30
60
90
60
90
75
90
Mon
19.00
20.00
60
G. Belt
a) Is there a repeating group? If so, write down all attributes from this group.
b) Are there process details? If so, write them down.
c) Describe three different dependencies in the schedule above, in the following notation:
A B
Appendix 1
Table description for exercise 2:
CREATE TABLE Salary
{salary details }
(sal#
NUMBER(2)
NOT NULL,
{salary number}
amount
NUMBER(5,2)
NOT NULL,
{monthly salary}
PRIMARY KEY (sal#)
);
CREATE TABLE Teacher
{teacher details}
(teacher#
NUMBER(3)
NOT NULL,
{unique code of the teacher}
name
VARCHAR(20) NOT NULL,
{name of the teacher}
address
VARCHAR(25) NOT NULL,
{address of the teacher}
place
VARCHAR(25) ,
{place of the teacher}
sal#
NUMBER (2)
,
{salary number of the teacher}
PRIMARY KEY (teacher#)
,
FOREIGN KEY (sal#) REFERENCES Salary(sal#)
ON DELETE NULLIFY
);
CREATE TABLE Planning
{planned courses}
(teacher#
NUMBER(3)
NOT NULL,
{teacher number}
date
DATE
NOT NULL,
{planned course date}
c_name
VARCHAR(11) ,
{name of the course}
PRIMARY KEY (teacher#, date)
,
FOREIGN KEY (teacher#) REFERENCES Teacher(teacher#)
FOREIGN KEY (c_name) REFERENCES Course(c_name)
);
CREATE TABLE Course
{course details}
(c_name
VARCHAR(15) NOT NULL,
{name of the course}
descr
VARCHAR(35) NOT NULL,
{description of the course}
price
NUMBER(5,2)
,
{price of the course}
PRIMARY KEY (c_name)
);