Question

In: Computer Science

Workshop: SQL Simple Retrieval For this workshop, you are to submit the SQL statements. Do not...

Workshop: SQL Simple Retrieval For this workshop, you are to submit the SQL statements. Do not submit the output produced by running the query. However, you may wish to examine the output to ensure the correctness of the query. When writing a query, do not rely exclusively on the current content of the database. Remember that when working with a real-world company’s database there can be far too many rows to allow you to visually examine the content of a table and validate your query. The following exercises all pertain to the FACULTY table. This table has the following columns: FNO, FNAME, FADDR, FHIRE_DATE, FNUM_DEP, FSALARY, and FDEPT. The table is owned by the user STUDENT.

1. Display the entire FACULTY table.

2. Display all information about any employee whose yearly salary is less than $40000.

3. Display all information about any employee who is employed by the Computer and Information Systems (CIS) Department.

4. Display the department, faculty number, and name of all faculty members.

5. Display the name and date of hire for any faculty member whose department alphabetically precedes THEO.

6. Display the departments to which faculty are assigned. Do not show duplicate values.

7. Display the name and salary of any employee earning less than $36000. Present the result set such that the highest paid employee is listed first, the second highest is listed next, and so on - that is, show the result with salaries in descending sequence.

8. Display the department, employee name, and salary for every employee. The output should be presented such that rows are arranged by salary within department. (Employees assigned to the same department will appear next to each other, but these rows will be sorted by salary.)

Solutions

Expert Solution

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

This demonstration is using SQL Server.

Question 1:

SQL Query :

select * from faculty;

*********************************

Question 2:

SQL Query :

select * from faculty where FSALARY*12 < 40000;

*********************************

Question 3:

SQL Query :

select * from faculty where FDEPT='CIS';

*********************************

Question 4:

SQL Query :

select FDEPT,FNO,FNAME from faculty;

*********************************

Question 5:

SQL Query :

select FNAME,FHIRE_DATE from faculty where FDEPT='EHTO%';

*********************************

Question 6:

SQL Query :

select distinct(f.FDEPT) from faculty f,faculty f1
where
f.FNO=f1.FNO;

*********************************

Question 7:

SQL Query :

select FNAME,FSALARY from faculty where FSALARY <36000 order by FSALARY desc;

*********************************

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.


Related Solutions

Please submit SQL statements as a plain text file (.txt). If blackboard rejects txt file you...
Please submit SQL statements as a plain text file (.txt). If blackboard rejects txt file you can submit a zipped file containing the text file. Word, PDF, or Image format are not accepted. You do not need to show screen shot. Make sure you have tested your SQL statements in Oracle 11g. Problem 1. Please create the following tables for a tool rental database with appropriate primary keys & foreign keys. [30 points] Assumptions: Each tool belongs to a category....
Please submit SQL statements as a plain text file (.txt). If blackboard rejects txt file you...
Please submit SQL statements as a plain text file (.txt). If blackboard rejects txt file you can submit a zipped file containing the text file. Word, PDF, or Image format are not accepted. You do not need to show screen shot. Make sure you have tested your SQL statements in Oracle 11g. The list of tables is: Tables: Cust Table: cid, -- customer id cname, --- customer name cphone, --- customer phone cemail, --- customer email Category table: ctid, ---...
Create one sql script file to complete the following. You cannot run separate SQL statements for...
Create one sql script file to complete the following. You cannot run separate SQL statements for the homework. You will also need to place a semicolon after each SQL statement, a requirement for SQL files containing multiple SQL statements Lesson 3 Write a query to display the current date. Label the column DATE. Display the last name of all employees who have an A and an E in their last name. For each employee, display the employee number, last_name, salary,...
Write a java simple document retrieval program that first asks the user to enter a single...
Write a java simple document retrieval program that first asks the user to enter a single term query, then goes through two docuements named doc1.txt and doc2.txt (provided with assignment7) to find which document is more relevant by calculating the frequency of the query term in each document. Output the conclusion to a file named asmnt7output.txt in the following format (as an example for query “java” and “problem”). The percentages in parenthese are respective supporting frequencies. java: doc1(6.37%) is more...
In this assignment, you are required to write the SQL statements to answer the following queries...
In this assignment, you are required to write the SQL statements to answer the following queries using PostgreSQL system. The SQL statements comprising the DDL for Henry Books Database are given to you in two files. For that database, answer the following queries. Create the files Q1 to Q10 in PostgreSQL. Do follow the restrictions stated for individual queries. 1. List the title of each book published by Penguin USA. You are allowed to use only 1 table in any...
Programming language= In Java and Oracle Sql You are required to develop a simple HR application...
Programming language= In Java and Oracle Sql You are required to develop a simple HR application for a small accounting firm that wishes to keep track of all the employees at the firm; storing details about their salary, phone numbers and Date of Birth. The firm has many departments and there are 5 to 20 employees in each department. The department information includes department name, description and total number of employees in that department. The company also provides vehicles for...
For Assignment 2, submit a word or pdf file with the SQL queries along with screenshots...
For Assignment 2, submit a word or pdf file with the SQL queries along with screenshots of the outputs. (It is ok if the whole problem cannot be answered, if possible, I just would like an idea of how to begin, thanks in advance!) 9. Write a query to count the number of invoices. 10. Write a query to count the number of customers with a balance of more than $500. 11. Generate a listing of all purchases made by...
Management For Engineers You intend to set up an automotive workshop. The workshop provides services such...
Management For Engineers You intend to set up an automotive workshop. The workshop provides services such as general vehicle repairs,servicing,tyre checks and other related works. Describe the steps, procedures, consideration and processes you will take to set up the workshop and to make it an effective enterprise? Format: at least 20 pages, Times New Roman 12
Management for Engineers - You intend to set up an automotive workshop. The workshop provides services...
Management for Engineers - You intend to set up an automotive workshop. The workshop provides services such as general vehicle repairs, tyre checks and other related works. Describe the steps, procedures,considerations and processes you will take to set up the workshop and to make it an effective enterprise? Format: -Times New Roman 12 -At least 20pages -should have the basic things which is introduction, reference and etc
Need SQL Tables Final Project should be included ER, NER, Table diagrams and SQL statements. The...
Need SQL Tables Final Project should be included ER, NER, Table diagrams and SQL statements. The final project is about developing an auction Web site. The details are as follows: BA is an online auction Web site. People can buy and sell items in this Web site. Buyers are people who like to buy items, and sellers are people who like to sell items. •Each seller can sell items. •Each item has a bidding start time, an end time, and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT