Give an expression in SQL for the following relational database schema (NOT Relational Algebra). Note that you will have

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Give an expression in SQL for the following relational database schema (NOT Relational Algebra). Note that you will have

Post by answerhappygod »

Give an expression in SQL for the following relational databaseschema (NOT Relational Algebra). Note that you will have to supplyarbitrary data that will enable you to obtain results for thecommands. Show all tables and data that are used in the problem andthe results.
1. What is the difference between DELETE and DROPstatements?
2. What is subquery in SQL?
3. Write a SQL query to find the names of employees that beginwith ‘B’?
4. Write a SQL query to get the Fourth highest salary of anemployee from any employee_table?
Use the following schemas for the next set of questions.
Employee (employee-id, person_name, street, city)
Works (person_name, company_name, salary)
Company (company_name, city)
Manages(person_name, manager_name)
5. Show the DDL command(s) that could be used to create each ofthe 4 tables.
6. Find the names of all employees whose salary is higher than80000 and live on Broad St.
7. Find the names of all employees that start with ‘Hi’ and endwith ‘n’ and also live on Peachtree Street in Atlanta.
8. Find the names, street address, and cities of residence ofall employees who work for Suntrust and earn less than 100,000 butmore than 60,000 per year.
9. Delete the records of all employees living in Greensboro fromthe Employee table. [No need to show this table]
10. Determine the average salary of the employees who do notlive in Greensboro. Rename the average salary as “Avg_Sal”. [Note:use ‘<>’ or ‘!=’ ]
5 PT BONUS: Find the names of all the managers who manage morethan 10 employees. [Hint: Can use Nested Select OR GroupBy…Having]
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply