DOC PREVIEW
UT Dallas CS 6385 - new 3

This preview shows page 1 out of 2 pages.

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

Unformatted text preview:

1.a)SELECT Name FROM student WHERE Major = 'CS';b)SELECT c.Course_name FROM section s JOIN course c ON s.Course_number = c.Course_numberWHERE s.Instructor = 'King' AND (s.Year = '08' OR s.Year = '07');c)SELECT s.course_number, s.semester , s.year, count(g.student_number) from section s JOIN grade_report g ON s.section_identifier = g.section_identifier where s.instructor = 'KING';d)SELECT st.name, c.Course_name, c.Course_number, c.Credit_hours, s.Semester, s.Year, g.Grade FROM course cINNER JOIN section s ON c.Course_number = s.Course_number INNER JOIN grade_report g ON s.Section_identifier = g.Section_identifierINNER JOIN student st ON g.Student_number = st.Student_number WHERE st.Class = '2';2.a.If ON DELETE CASCADE is executed, when the record with Lname = 'Borg' is deleted, the rows corresponding to the employees with super_ssn who have same value of ssn as Borg will also deleted (Records with Lname Wong and Wallace willget deleted)b.It is always better to SET NULL, When we delete an employee, it is not necessaryfor people reporting under him to be deleted. 3.a.select d.dname, count(e.fname) from employee e join department d on e.dno = d.dnumber group by e.dno having avg(e.salary)>30000;b.select d.dname ,count(e.fname) from department d join employee e on e.dno = d.dnumber where e.salary>30000 and sex='M' group by d.dnumber ;4.a.select s.name, s.major from student s join grade_report g on s.student_number=g.student_numberwhere g.grade = 'A' group by g.student_number having count(g.student_number) = (select count(student_number) from grade_report where student_number = g.student_number);b.select s.name, s.major from student s join grade_report g on s.student_number=g.student_numberwhere g.grade <> 'A' group by g.student_number having count(g.student_number) = (select count(student_number) from grade_report where student_number = g.student_number);5.a.select e.fname, e.minit,e.lname from employee e where e.dno=(select dno from employee where salary=(select max(salary) from employee));b.select e.fname, e.minit,e.lname from employee e, employee s where e.super_ssn=s.SSN and s.super_ssn=888665555;6.a.create view Dept_Manager_View asselect d.dname , e.fname as employee_Fname, e.minit as employee_Mname,e.lname asemployee_Lname, e.salaryfrom department d,employee ewhere d.mgr_ssn=e.ssn ;b.create view Research_Employee_View asselect e.fname as employee_Fname, e.minit as employee_Mname,e.lname as employee_Lname,s.fname as supervisor_Fname, s.minit as supervisor_Mname,s.lname as supervisor_Lname,e.salary from employee e,employee s,department dwhere d.dnumber=e.dno and d.Dname='Research' and e.super_ssn=s.SSN;c.create view proj_hours_view asselect p.pname as Project , d.dname as Department, sum(h.hours) as Total_Hours, count(h.essn) as Emp_Countfrom project p join works_on h on p.pnumber = h.pno join department d on p.dnum = d.dnumbergroup by p.pnumberd.create view proj_hours_view_emp_gt1 asselect p.pname as Project , d.dname as Department, sum(h.hours) as Total_Hours, count(h.essn) as Emp_Countfrom project p join works_on h on p.pnumber = h.pno join department d on p.dnum = d.dnumbergroup by p.pnumber having


View Full Document

UT Dallas CS 6385 - new 3

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  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 new 3
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 new 3 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 new 3 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?