Guide IV
Chapters 6 8 SQL
6.1 What are the main advantages and disadvantages of SQL?
Advantages
Satisfies ideals for database language
(Relatively) Easy to learn
Disadvantages
Impedance mismatch mixing programming paradigms with embedded access
Lack of orthogonality many different ways to express some queries
6.2 Consider the following relational schema:
Staff (staffNo, name, dept, skillCode)
Skill (skillCode, description, chargeOutRate)
Project (projectNo, startDate, endDate, budget, projectManagerStaffNo)
Booking (staffNo, projectNo, dateWorkedOn, timeWorkedOn)
where: Staff contains staff details and staffNo is the key.
Skill contains descriptions of skill codes (e.g. Programmer, Analyst,
Manager, etc.) and the charge out rate per hour for that skill; the
key is skillCode.
Project contains project details and projectNo is the key.
Booking contains details of the date and the number of hours that a member of
staff worked on a project and the key is staffNo/projectNo.
Formulate the following queries using SQL:
(a) (1) List all skills with a charge out rate greater than 60 per hour, in alphabetical
order of description.