Sql Queries for Employees, Projects, Salary tables

L_lunches table
LUNCH_ID LUNCH_DATE EMPLOYEE_ID DATE_ENTERED
1 16-NOV-05 201 13-OCT-05
2 16-NOV-05 207 13-OCT-05
3 16-NOV-05 203 13-OCT-05
4 16-NOV-05 204 13-OCT-05
6 16-NOV-05 202 13-OCT-05
7 16-NOV-05 210 13-OCT-05
8 25-NOV-05 201 14-OCT-05
9 25-NOV-05 208 14-OCT-05
12 25-NOV-05 204 14-OCT-05
13 25-NOV-05 207 18-OCT-05
15 25-NOV-05 205 21-OCT-05
16 05-DEC-05 201 21-OCT-05
17 05-DEC-05 210 21-OCT-05
20 05-DEC-05 205 24-OCT-05
21 05-DEC-05 203 24-OCT-05
22 05-DEC-05 208 24-OCT-05

L_lunch_items

LUNCH_ID ITEM_NUMBER SUPPLIER_ID PRODUCT_CODE QUANTITY
1 1 Asp Fs 1
1 2 Asp Sw 2
1 3 Jbr Vr 2
2 1 Asp Sw 2
2 2 Frv Ff 1
2 3 Jbr Vr 2
2 4 Vsb As 1
3 1 Asp Fs 1
3 2 Cbc Gs 1
3 3 Frv Ff 1
3 4 Jbr Vr 1
3 5 Jbr As 1
4 1 Asp Sp 2
4 2 Cbc Sw 2
4 3 Frv Ff 1
4 4 Jbr As 2
6 1 Asp Sp 1
6 2 Cbc Gs 1
6 3 Frv Ff 1
6 4 Jbr Vr 2
6 5 Vsb As 1
7 1 Asp Fs 1
7 2 Asp Sp 1
7 3 Cbc Gs 1
7 4 Jbr Vr 1
7 5 Vsb As 1
8 1 Asp Fs 1
8 2 Cbc Gs 1
8 3 Jbr As 1
9 1 Asp Fs 1
9 2 Asp Sp 1
9 3 Cbc Sw 2
9 4 Frv Ff 1
9 5 Jbr Vr 1
9 6 Jbr As 1
12 1 Asp Fs 1
12 2 Cbc Gs 1
12 3 Jbr Vr 2
12 4 Vsb As 1
13 1 Asp Sp 2
13 2 Asp Sw 2
13 3 Frv Ff 1
13 4 Jbr As 1
15 1 Asp Sp 1
15 2 Cbc Gs 1
15 3 Frv Ff 1
15 4 Jbr As 2
16 1 Asp Fs 1
16 2 Asp Sw 1
16 3 Cbc Sw 1
16 4 Jbr Vr 1
16 5 Jbr As 1
17 1 Asp Sp 1
17 2 Cbc Gs 1
17 3 Frv Ff 1
17 4 Jbr Vr 2
17 5 Vsb As 1
20 1 Asp Fs 1
20 2 Asp Sp 1
20 3 Cbc Gs 1
20 4 Frv Ff 1
20 5 Jbr As 1
21 1 Asp Sp 1
21 2 Cbc Gs 1
21 3 Jbr Vr 2
21 4 Vsb As 1
22 1 Asp Fs 1
22 2 Cbc Gs 1
22 3 Frv Ff 1
22 4 Jbr Vr 1
22 5 Jbr As 1

L_suppliers

SUPPLIER_ID SUPPLIER_NAME
Arr Alice & Ray’s Restaurant
Asp A Soup Place
Cbc Certified Beef Company
Frv Frank Reed’s VegeTABLEs
Fsn Frank & Sons
Jbr Just Beverages
Jps Jim Parker’s Shop
Vsb Virginia Street Bakery

1. List all the employees in the emp table. If they work for department Accounting, then add 1200 to their salary. If they work for department Sales, then add 100 to their salary, otherwise add nothing to their salary.

2. List all the suppliers and the foods that they supply from the l_foods table. If supplier_id ASP provides the food, add 1 dollar to his price. If supplier_id, CBC supplies the food, add 2 dollars to his price. Otherwise, just show the price as is.

3. List the employee_id and employee_name of the employees form the l_employees table with the top 4 credit limits.
4. Change your answer from above to list those employees with the bottom 4 credit limits.

5. From the project, project_hours, and employee table, list the all the projects, the hours worked, and the date worked. (You will need this for the project).

6. Using the Lunches database, find the total amount spent on lunches by each employee. Show first_name, last_name, credit_limit, and total_price_spent in your results. Order your answer by total_price_spent in descending order. Only show the employees
who spent more than their credit limit (Modify question 9 from the last homework.)

7. Using the Lunches database, count the number of foods supplied by each supplier. List all the suppliers. Show the supplier_id, supplier_name, and number of foods from each supplier. Sort the rows on the supplier_id. Make sure you count all suppliers, even if they don’t supply foods.

8. Using the Lunches database, count the number of employees who work in each department. List all the departments. Show the department code, department name, and the number of employees. Sort on the dept_code. Make sure you count all employees, regardless of whether they work for departments or not.

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with AssignmentHelpWeb
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Anthropology
Excellent services will definitely come back
Customer 452441, September 23rd, 2022
English 101
Very good job. I actually got an A
Customer 452443, September 25th, 2022
Nursing
The paper was EXCELLENT. Thank you
Customer 452449, September 23rd, 2022
Anthropology
excellent loved the services
Customer 452443, September 23rd, 2022
Architecture, Building and Planning
The assignment was well written and the paper was delivered on time. I really enjoyed your services.
Customer 452441, September 23rd, 2022
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat