Question: Using putty (unix) 1. Create file named ps3a.sql . Using the file you just created, write a SQL query that will return the employee number,
Using putty (unix)
1. Create file named ps3a.sql. Using the file you just created, write a SQL query that will return the employee number, employee name, job and salary for all employees in the emp table. Order the table by salary. Create a screen shot of your result set and query and paste it in your assignment.
2. Create a file called ps3b.sql and write a SQL query that will return the empno, employee name, job, sal and department number. To make this query more flexible and useful, add an ampersand substitution variable called jobname to your query so that they user is prompted to enter the job name (such as MANAGER) during the processing of the query.
Create a screen shot of your result set and query and paste it in your assignment.
3a. Modify the SQL query above to use double ampersand substituted column name variable called columName to prompt the user to enter the column name that they want (such as department number or salary) as part of the SQL query. Assume the user knows the column name that they want to use. Run the query using the salary column as the column to appear in the result set.
Create a screen shot of your result set and query and paste it in your assignment.
3b. Use the undefine command to remove the salary column variable value for the SQL query and run the query again using the department number column. Create a screen shot of your result set and query and paste it in your assignment.
4. Create a file named ps3c.sql and write a SQL query that will return the employee number, employee name, job, department number and hire date for all employees from the emp table for all employees hired between today (SYSDATE) and ninety days ago. Create a screen shot of your result set and query and paste it in your assignment.
Thank you!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
