Answered step by step
Verified Expert Solution
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 employname, email, hiredate, salary, departmentid managerid jobid
Department department id departmentname, locationid
Location location id address, zipcode, city
Job job id jobtitle, minsalary, maxsalary
Write a SQL statement to join the Location and Department tables using the locationid
column. Limit the results to location only. Display city and department name only.
Write a SQL statement to display the city, department name, location ID and department ID
for departments and 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
Write a SQL statement to display manager ID department ID department name, and name
for all employees in departments and 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started