Practice2 - Practice 2 - SQL 1. Create a query to display...

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

View Full Document Right Arrow Icon
Practice 2 - SQL 1. Create a query to display the name and salary of employees earning more than $2850. Save your SQL statement to a file named p2q1.sql. Run your query. SQL> select ename, sal 2 from emp 3 where sal>2850; ENAME SAL ---------- ---------- JONES 2975 SCOTT 3000 KING 5000 FORD 3000 File saved 2. Create a query to display the employee name and department number for employee number 7566. SQL> select ename , deptno 2 from emp 3 where empno=7566; ENAME DEPTNO ---------- ---------- JONES 20 3. Modify p2q1.sql to display the name and salary for all employees whose salary is not in the range of $1500 and $2850. Resave your SQL statement to a file name p2q3.sql. rerun your query SQL> edit Wrote file afiedt.buf 1 select ename, sal 2 from emp 3* where sal not between 1500 and 2850 SQL> / ENAME SAL ---------- ---------- SMITH 800 WARD 1250 JONES 2975 MARTIN 1250 SCOTT 3000 KING 5000 ADAMS 1100
Background image of page 1

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

View Full DocumentRight Arrow Icon
JAMES 950 FORD 3000 MILLER 1300 10 rows selected. File saved
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Practice2 - Practice 2 - SQL 1. Create a query to display...

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

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