Basic+Joins+Assignment

//Be prepared to show me the SQL statements that will achieve the results for the following (either in Word or in your notes).//

1. Create a cross-join that displays the last name and department name from the employees and departments tables.

2. Create a query that uses a natural join to join the departments table and the locations table by the location_id column. Display the department id and name, location id, and city.

3. Create a query that uses a natural join to join the departments table by the location_id column. Restrict the output to only department IDs of 20 and 50. Display the department id and name, location id, and city.

4. Join the Oracle database locations and departments table using the location_id column. Limit the results to location 1400 only. 5. Join DJ on Demand d_play_list_items, d_track_listings, and d_cds tables with the JOIN USING syntax. Include the song ID, CD number, title, and comments in the output.

6. Display the city, department name, location ID, and department ID for departments 10, 20, and 30 for the city of Seattle.

7. Display country name, region ID and region name for Americas.

8. Display job title, employee first name, last name, and email for all employees that are stock clerks.

9. Write a statement that displays the employee ID, first name, last name, manager ID, manager first name, and manager last name for every employee in the employees table. Hint: this is a self-join.

10. Use JOIN ON syntax to query and display the location ID, city and department name for all Canadian locations.

11. Query and display manager ID, department ID, department name, first name, and last name for all employees in departments 80, 90, 110, and 190.

12. Display employee ID, last name, department ID, department name, and hire date for those employees whose hire date was June 7, 1994.