Question
Write 6 statements based on the following information: 1. Write a SQL statement which joins the faculty_department table with the department table. This query should
Write 6 statements based on the following information:
1. Write a SQL statement which joins the faculty_department table with the department table. This query should return the faculty_id and the department_id columns from the faculty_department table, and the name column from the department table. The join between the two tables should be a an inner join.
2. Write a SQL statement which joins the faculty_department table with the department table. This query should return the faculty_id and the department_id columns from the faculty_department table, and the name column from the department table. The join between the two tables should be an outer join. The query should return all rows from the faculty_department table whether or not they have a corresponding row (a joined row, a row with the same department_id) in the department table.
3. Write a SQL statement which joins the faculty_department table with the department table. This query should return the faculty_id and the department_id columns from the faculty_department table, and the name column from the department table. The join between the two tables should be an outer join. The query should return all rows from the department table whether or not they have a corresponding row (a joined row, a row with the same department_id) in the faculty_department table.
4. Write a SQL statement which joins the faculty_department table with the faculty table. Select the first_name and last_name from the faculty table and the department_id from the faculty_department table. This should be an inner join.
5. Write a query which joins the faculty table with the faculty_department table with the department table. The query should return the first_name and last_name from the faculty table, and the name column from the department table. This should be an inner join.
6. Write a query which identifies both the faculty who have been assigned to a department, and the faculty who have NOT been assigned to a department (no corresponding records in the faculty_department table). The query should return the faculty first name and last name and the name of the department. This query should use an outer join.
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