Question

(Oracle SQL Coding) 1.Display the city (Locations Table), department_name (Departments Table), location_ID (Locations Table), and department_ID...

(Oracle SQL Coding)

1.Display the city (Locations Table), department_name (Departments Table), location_ID (Locations Table), and department_ID (Departments Table) for departments 10, 20, and 30 for the city of Seattle. Use tables Departments and Locations. Use a traditional (proprietary) join.

2.Recreate the query from question 1 to use a Join (ANSI) method of joining.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Below is the code to join tables Locations and Departments to get the result. Both tables are joined on common attributes.

Proprietary Join

SELECT l.city, d.department_name, l.location_ID
FROM Locations AS l, Departments AS d
WHERE d.department_ID IN (10,20,30);

ANSI Join


SELECT l.city, d.department_name, l.location_ID
FROM Locations AS l
INNER JOIN Departments AS d
l.location_ID = d.location_ID
WHERE d.department_ID IN (10,20,30);

Add a comment
Know the answer?
Add Answer to:
(Oracle SQL Coding) 1.Display the city (Locations Table), department_name (Departments Table), location_ID (Locations Table), and department_ID...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (Oracle SQL) Create the dept_detail_view view using all the fields in departments, locations, countries, and regions....

    (Oracle SQL) Create the dept_detail_view view using all the fields in departments, locations, countries, and regions. The view is intended only for quick lookups relating to department site details. Using the dept_detail_view, create a report showing those departments in Europe. Use all the fields in the view without the id fields. Departments department_id department_name manager_id location_id Locations location_id street_address postal_code city state_province country_id Countries country_name country_id region_id Regions region_id region_name

  • 13 Write a query to display each department’s name, location, number of employees, and the average...

    13 Write a query to display each department’s name, location, number of employees, and the average salary for all employees in that department. Label the columns Department , Location, Number of Workers, and Average Salary, respectively. Round the average salary to two decimal places . Tables (Filtered) + COUNTRIES DEPARTMENTS 0 DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID 1 LOCATION_ID 0 EMPLOYEES - EMPLOYEE_ID 1 FIRST_NAME LAST_NAME EMAIL IPHONE_NUMBER HIRE_DATE JOB_ID SALARY 0 COMMISSION_PCT " MANAGER_ID " DEPARTMENT_ID + JOB_GRADES - JOB_HISTORY + JOBS...

  • CIS 411w spring 2017 Problem Set 11    1 Log in to your Oracle ApEx account....

    CIS 411w spring 2017 Problem Set 11    1 Log in to your Oracle ApEx account. 2. Create a new table called email with this command: CREATE table email as (SELECT empno, ename||'.'||SUBSTR(JOB,1,2)||'@apex.com' as "EMAIL" from emp); Click à Run to create this table 3. Write a SQL query that JOINS the three tables emp,dept and email. This SQL query will return the empno, ename, job, sal, loc and email for each employee. Use the newer ANSI JOIN syntax rather...

  • Oracle 12c SQL - Chapter 5: Case Study: City Jail, Part II Note: You are limited...

    Oracle 12c SQL - Chapter 5: Case Study: City Jail, Part II Note: You are limited to using the Oracle Live interface to create solutions for the problems below. SQL Live does not allow as many commands, statements, and symbols as full Oracle SQL. Specifically, the ampersand substitution variable symbol (&) may not be used for any of the solutions below because Oracle Live does not recognize it. Oracle Live is available to use here: https://livesql.oracle.com/apex/f?p=590:1000 Execute the CityJail_5.sql script...

  • Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName,...

    Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName, City ON Employees; O FIND EmployeeName, City ON Employees; SELECT EmployeeName, City FROM Employees; O RETRIEVE EmployeeName, City FROM Employees; Which SQL statement finds the different cities in which national parks reside with no duplicate rows listed? SELECT DISTINCT city FROM natlpark ORDER BY city; O ORDER BY natlpark DISTINCT city; O ORDER BY city FROM natlpark; O SELECT city FROM natlpark ORDER BY...

  • ONLY ODD NUMBERS. YOU MUST USE ORACLE OR MY SQL. THANKS Chapter 3 TAL Distributors Use...

    ONLY ODD NUMBERS. YOU MUST USE ORACLE OR MY SQL. THANKS Chapter 3 TAL Distributors Use SQL to complete the following exercises 1. Create a table named SALES_ REP. The table has the same structure as the REP table shown in Figure 3-11 except the LAST_NAME column should use the VARCHAR data type and the COMMISSION and RATE columns should use the NUMBER data type. Execute the command to describe the layout and characteristics of the SALES_REP table. Add the...

  • Note: Use the City Jail database created with the CityJail_8.sql script that you ran for the...

    Note: Use the City Jail database created with the CityJail_8.sql script that you ran for the Chapter 8 case study. The following list reflects the current data requests from city managers. Provide the SQL statements that satisfy the requests. For each request, include one solution using the traditional method and one using an ANSI JOIN statement. Test the statements and show execution results 4. Create an alphabetical list of all criminals, including criminal ID, name, violent offender status, parole status,...

  • Oracle 12c: SQL   Joan Casteel ISBN: 978-1-305-25103-8 Chapter 12 Case Study: City Jail Make sure you...

    Oracle 12c: SQL   Joan Casteel ISBN: 978-1-305-25103-8 Chapter 12 Case Study: City Jail Make sure you have run the CityJail_8.sql script from Chapter 8. This script makes all database objects available for completing this case study. The city's Crime Analysis unit has submitted the following data requests. Provide the SQL statements using subqueries to satisfy the requests. Test the statements and show execution results. Use a sql sub-query statement to answer the following: (Please provide correct answer for questions 6...

  • HELP DATABASE QU Question 1: Think About the relational database table data as given below, write...

    HELP DATABASE QU Question 1: Think About the relational database table data as given below, write the following queries in Oracle SQL. Company (Cid, Cname, City, Budget, Branch) Department (Deptno, Dname, Building, Cname) Employee (Ename, Deptno, Street, City, Phone, Salary) Works (Ename, Deptno, Hire_date) Location (Cname, Location ) 1. Write Query to Create the Company table, suggest appropriate data type of each attribute, consider that there should be a name for each company. 2. Find employee name/names who live in...

  • I am using oracle sql developer to create some queries to generated reports and it is...

    I am using oracle sql developer to create some queries to generated reports and it is not working. I am not sure how to use count, group by, and order by. Help me fix my query and explain to me how you did, so can do it next time. Also, I have to convert this query to a stored procedure, so can you help me do it too? Here is my query: SELECT COUNT(GUEST.FIRSTNAME), GUEST.FIRSTNAME, GUEST.LASTNAME, GUEST.GUESTTYPE, RESERVATION.RESERVATIONDATE, GUEST.EMAIL, FROM...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT