Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Even if there are no real data in each table, write SQL statements by considering the following schema: Employee ( emplov id , employ _

Even if there are no real data in each table, write SQL statements by considering the following schema:
Employee (emplov id, employ_name, email, hire_date, salary, department_id, manager_id, job_id)
Department (department id, department_name, location_id)
Location (location id, address, zipcode, city)
Job (job id, job_title, min_salary, max_salary)
-Write a SQL statement to join the Location and Department tables using the location_id
column. Limit the results to location 1400 only. Display city and department name only.
- Write a SQL statement to display the city, department name, location ID, and department ID
for departments 10,20, and 30 for the city of 'Seattle'.
- Write a SQL statement to display employee name, hire date, job id, job title, and maximum
salary by joining the Employee and Job tables. Limit the query to those employees who are in jobs
that earn more than 12000.
- Write a SQL statement to display manager ID, department ID, department name, and name
for all employees in departments 80,90,110, and 190. Use IN operator.
- Write a SQL statement to display the employee's name and employee number along with the
manager id and manager number. Label the columns: employee name, employee id, manager name,
and manager id, respectively. Use the keyword AS on SELECT clause for alias.
- Write a SQL to display name, and department name for all employees including those
employees not assigned to a department. Use either LEFT or RIGHT OUTER join.
- Write a SQL to display name, and department name for all employees including those
departments that do not have an employee assigned to them and those employees not assigned to
a department. Use Full outer join.
- Write a SQL to display all employees and their managers, even if the employee does not have
a manager. Order the list alphabetically by the name of the employee.
- Write a SQL to display the names and hire dates for all employees who were hired before
their managers, along with their managers' names and hire dates.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions