Está en la página 1de 1

DATABASE LABORATORY

SHIRAZ UNIVERSITY

SPRING 2013

Session 3
Required Tasks
1. Use the given DDL le to recreate all the tables. 2. Populate some data in tables. 3. Write a proper SELECT statement for each following questions: a. Find the titles of all courses presented by CS department. b. Find the titles of all courses taught by professor Kim in the second semester of 2010. c. Find the names and IDs of all students attended a class presented by Comp. Eng. department at class number 303 located in Engineering building. d. Find the names and section information of all courses taught and located in a class with capacity of 30 or more, and sort them in decreasing order. e. Find the number of courses each professor teaches, and sort them by salary of their instructor in decreasing order. f. Find the names and student numbers of all the students whom their advisor taught more that four courses in the last three years. (Order matters!!) g. Find the names and total number of students each instructor advises plus the total number of courses he/she teaches, and sort them in increasing order. h. Check if there is a department which its budget is lower than the sum of all salaries of its instructors. Find the name of the department and the lack amount of budget. Good luck! ;)

Attention
1. Dont try to cheat or to copy your classmates answers. I am also a student just like you, except with more experience in cheating, so I can easily understand it. Those who cheat will get zero. SELECT select_list FROM table_list [ WHERE search_conditions ] [ GROUP BY group_by_list ] [ HAVING search_conditions ] [ ORDER BY order_list [ ASC | DESC ] ]

PAGE 1 OF 1

Arash Pourhabibi Zarandi

SESSION 3

También podría gustarte