DOC PREVIEW
UT Dallas CS 6385 - homeworksix

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Homework SixCS325 Database Management SystemsSpring 2009Date Assigned: 3-5-2009Problem One:Consider the database shown above.Specify the following queries on the relational schema shown above using SQL DML. Describe INENGLISH, how the query works. Also show the result of each query as it would apply to the databaseshown above.a) Retrieve the names of all senior students majoring in ‘CS’ (Computer Science)b) Retrieve the names of all courses taught by Professor King in 1998 and 1999.c) For each section taught by Professor King, retrieve the course number, semester, year, and number ofstudents who took the section.d) Retrieve the name and transcript of each senior student (Class = 5) majoring in CS. A transcript includescourse name, course number, credit hours, semester, year, and grade for each course completed by thestudent.e) Retrieve the names and major departments of all straight-A students (students who have a grade of A in allof their courses).f) Retrieve the names and major departments of all students who do not have a grade of A in any of theircourses.Grading Criteria:Each sub-problem receives a maximum of 5 points. Maximum grade for problem is 30 points. Each problem isgraded differently with the cost of an error weighted by the underlying principle of the problem.Problem Two:Consider the relational database shown above.Specify the following queries on the relational schema shown above using SQL DML. Describe INENGLISH, how the query works. Also show the result of each query as it would apply to the databaseshown above.a) Retrieve the department number, number of employees, combined salary, and average salary for eachdepartment.b) Retrieve the department number and number of employees for each department with a combined salaryover $100,000.c) Retrieve the department number and average salary for any department with more employees thandepartment 4.d) Consider the following view, DEPT_SUMMARY, defined on the COMPANY database:CREATE VIEW DEPT_SUMMARY(DNO, COUNT, SUM_SALARY, AVERAGE_SALARY)AS SELECT DNO, COUNT(*), SUM(SALARY), AVG(SALARY)FROM EMPLOYEEGROUP BY DNO;Is the following UPDATE possible? Why or why not?UPDATE DEPT_SUMMARYSET DNO = 3WHERE DNO = 4;e) Consider the view from problem (d).Is the following DELETE possible? Why or why not?DELETEFROM DEPT_SUMMARYWHERE COUNT > 4;Grading Criteria:Each sub-problem receives a maximum of 5 points. Maximum grade for problem is 30 points. Each problem isgraded differently with the cost of an error weighted by the underlying principle of the


View Full Document

UT Dallas CS 6385 - homeworksix

Documents in this Course
assn1

assn1

2 pages

38rel2

38rel2

5 pages

Report

Report

3 pages

networks

networks

18 pages

lp2

lp2

44 pages

lp2 (2)

lp2 (2)

27 pages

lp1(1)

lp1(1)

21 pages

integer1

integer1

50 pages

FrankR2

FrankR2

3 pages

duality

duality

28 pages

CMST

CMST

44 pages

hw4

hw4

3 pages

for 1

for 1

11 pages

ENCh02

ENCh02

33 pages

pree

pree

2 pages

new  3

new 3

2 pages

new  2

new 2

2 pages

hw4a

hw4a

2 pages

T2_Sol

T2_Sol

4 pages

ISM3

ISM3

8 pages

hw4_sol

hw4_sol

6 pages

Elm04_06

Elm04_06

11 pages

atn proj2

atn proj2

20 pages

12CUT1

12CUT1

8 pages

09Ford

09Ford

23 pages

08FLOW

08FLOW

6 pages

03LP_su

03LP_su

6 pages

40REL40

40REL40

5 pages

39rel3

39rel3

5 pages

38arel2

38arel2

5 pages

37REL1

37REL1

3 pages

24TABU

24TABU

3 pages

22DYNPR

22DYNPR

3 pages

21B&C

21B&C

2 pages

20BBEX0

20BBEX0

3 pages

19BB

19BB

5 pages

14CAPBUD0

14CAPBUD0

11 pages

35BRXCH

35BRXCH

2 pages

34COMB

34COMB

4 pages

32CAPAS

32CAPAS

4 pages

31QUEUE

31QUEUE

3 pages

Load more
Download homeworksix
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view homeworksix and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view homeworksix 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?