EASTERN MEDITERRANEAN UNVERSITY

EASTERN MEDITERRANEAN UNVERSITY
School of Computing and Technology
Department of Information Technology
CSIT/ITEC 313 Database Programming
Student Id:……………….
Student Name: ……………………………...
Signature: …………………
Spring 2007-2008
Duration : 60 minutes
Please answer all questions.
Question 1
Design a conceptual ERD for the Ohio State University scholarship application form shown below. Please use
the last page for your answer.
Please state any additional assumptions you may make.
(8 points)
OHIO STATE UNIVERSITY SCHOLARSHIP APPLICATION FORM
Form Id: …………
Date: ……./…….. /……
(day / month/year)
First Name
Student Id: ……………..
Last Name
Middle Name
Full
Legal
………………….
………………….
Name ………………….
Class during 2008-2009: Choose 1 Campuses I plan to attend : Choose 2
Freshman Sophomore
Colombus
Lima
Junior
Senior
Marion
Mansfield
Work Experience
Start Date
End Date
I received
scholarship
before:
Yes
Description
Assumptions you must make:
1. This form is filled by existing students of the Ohio State University
2. A student may fill in as many scholarship application forms as s/he wishes.
3. Both the list of campuses and classes may change in the future.
4. The applicant may enter as many work experience information as s/he wants.
Please answer question 1 here.
Middlename
Firstname
Received
Lastname
FormDate
FormId
name
id
Student
fills
Application
Form
fills
fills
fills
Campus
enddate
WEno
Work
Experience
Class
name
code
description
code
name
startdate
Assumptions:
1. Received has a check constraint: check (received in ‘yes’, ‘no’)
2. A student may list many work experiences in a form and on each form s/he
may list different work experiences.
3. The WEno attribute starts from 1 (one) for each form.
4. Data type of FormDate is date and date data type contains day,month and
year.
5. Question 2
Write SQL or SQL*Plus commands for the following questions.
Assume user Ayse has the following table and that she has granted all privileges to user Ali.
Course(ccode, title, credits)
(a) Grant insert and select privilege to users Ali and Veli. (1 points)
Grant insert, select on course to ali,veli;
Assume you are user Ali
(b) List all courses that have more than 4 credits. (1 points)
Select *
From ayse.course
Where credits>4;
(c) Create a synonym “clist” for the course table of Ayse. (1 points)
Create synonym clist for ayse.course;
(d) Add a new row to the course table of Ayse using the synonym. All the values must be read from the
keyboard. (1 points)
Insert into clist
Values(&ccode, ‘&title’, &credits);
Question 3
Make appropriate corrections on the ERDs below based on the additional requirements.
(a) Price of products may change a number of times each year. We need to keep track of the price at all
times. (2 points)
Id
Name
Price
Product
Answer:
Id
Name
value
priceno
startdate
Product
has
Price
enddate
Assumptions:
 Priceno of each product starts from 1 (one) and for every price change, it
is incremented.
 Enddate of the latest price is NULL
Please note that price can also be represented as a strong entity
(b) It should be possible to have as many assessment (ex: homework/exam/projects) as needed for each
course. Additionally we need to know the date and percentage of each assessment. (3 points)
Id
Student
Totalmark
Takes
take
st
a
s
Name
Hw1mark
Hw2mark
Title
tc
Finalmark
Course
Coursecode
Midtermmark
Id
Student
Coursecode
Totalmark
st
a
s
Takes
take
tc
Title
Course
Name
Mark
gets
has
AssmtNo
Percentage
Assesment
StartDate
Belongs
to
EndDate
Code
Assesment
Type
Description
Assumptions:
 Assmto of each assesment starts from 1 (one) and for each new assessment
of a course, it is incremented.
 If Enddate of assessment is equal to the startdate then it is an exam. For
homework and project the start date is the announcement date and the
end date is the submission date.
Please note that if the assessment types are fixed, then it could be represented as a
simple attribute with check constraint