Final Exam - values(1,'JOHN','DOE','CET',3.5) b. insert into

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
David Carothers Capitol College CS-220 Database Management Final Exam 1. SELECT ENAME, HIREDATE FROM EMP WHERE DEPTNO = (SELECT DEPTNO FROM EMP WHERE ENAME = 'BLAKE') AND ENAME != 'BLAKE' 2. SELECT EMPNO, ENAME FROM EMP WHERE SAL > (SELECT AVG(SAL) FROM EMP) Order by SAL desc 3. SELECT EMPNO, ENAME FROM EMP WHERE DEPTNO IN (SELECT DEPTNO FROM EMP WHERE ENAME LIKE '%T%') 4. Select e.ename, e.deptno, d.dname From emp e, dept d Where (e.deptno = d.deptno(+)) AND (D.LOC = 'DALLAS') 5. SELECT ENAME, SAL FROM EMP WHERE MGR = (SELECT EMPNO FROM EMP WHERE ENAME IN('KING')) 6. SELECT DEPTNO, ENAME, JOB FROM EMP WHERE DEPTNO = (SELECT DEPTNO FROM DEPT WHERE DNAME = 'SALES') 7. SELECT EMPNO, ENAME, SAL FROM EMP WHERE (SAL > (SELECT AVG(SAL) FROM EMP)) AND (DEPTNO IN(SELECT DEPTNO FROM EMP WHERE ENAME LIKE '%T%')) 8. create table Student( StudentId varchar2(30), LastName varchar(30), Major varchar(30), GPA number(2,1)) 9. a. insert into Student(studentId,FirstName,LastName,Major,GPA)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: values(1,'JOHN','DOE','CET',3.5) b. insert into Student(studentId,FirstName,LastName,Major,GPA) values(2,'KELLY','SMITH','EET',3.2) c. insert into Student(studentId,FirstName,LastName,Major,GPA) values(3,'DORONNA','LAPEL','EE',3.8) d. insert into Student(studentId,FirstName,LastName,Major,GPA) values(4,'FRANK','WILLIAMS','TET',4.0) e. insert into Student(studentId,FirstName,LastName,Major,GPA) values(5,'TIMOTHY','GRAVES','CS',2.7) 10. a. UPDATE STUDENT SET GPA = 3.5 WHERE GPA = 3.2 b. UPDATE STUDENT SET GPA = 3.7 WHERE FIRSTNAME = 'FRANK' 11. a. DELETE FROM STUDENT WHERE STUDENTID = 3 b. SELECT * FROM STUDENT STUDENTID FIRSTNAME LASTNAME MAJOR GPA---------------------------------------------------------------------------------------1 JOHN DOE CET 3.5 2 KELLY SMITH EET 3.5 4 FRANK WILLIAMS TET 3.7 5 TIMOTHY GRAVES CS 2.7 c. COMMIT...
View Full Document

This note was uploaded on 02/21/2012 for the course COMPUTER CS 220 taught by Professor Idk during the Fall '07 term at Capitol College.

Page1 / 2

Final Exam - values(1,'JOHN','DOE','CET',3.5) b. insert into

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online