Question

Rewrite the query select * from section natural join classroom without using a natural join but...

Rewrite the query select * from section natural join classroom without using a natural join but instead using an inner join with a using condition

select *

from section natural join classroom

Homework Answers

Answer #1

Solution

Answer

With "USING"

SELECT * FROM SECTION
INNER JOIN CLASSROOM
USING(BUILDING,ROOM_NUMBER);

Screenshot

---

Without "USING"

SELECT * FROM SECTION
INNER JOIN CLASSROOM
ON(SECTION.BUILDING = CLASSROOM.BUILDING
AND
SECTION.ROOM_NUMBER = SECTION.ROOM_NUMBER);

Screenshot

Explanation

First we rewrite the sql code

select * from section natural join classroom

with using

--

Second one without using we rewrite the code

---

all the best

Know the answer?
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
Similar Questions
A(n) _____ is a query that is embedded (or nested) inside another query. Select one: a....
A(n) _____ is a query that is embedded (or nested) inside another query. Select one: a. operator b. subquery c. alias d. view If a subquery returns list of values, which operator can be used in the outer query predicate? Select one: a. > b. < c. IN d. = Which query returns a list of all products with a price greater than or equal to the average product price? Select one: a. SELECT P_CODE,MAX(AVG(P_PRICE)) FROM PRODUCT GROUP BY P_CODE;...
Using the STUDENT and PROFESSOR tables, illustrate the difference between a natural join, an equijoin, and...
Using the STUDENT and PROFESSOR tables, illustrate the difference between a natural join, an equijoin, and an outer join.
Subtask 10.2.1 Run the following JOIN of two tables which has two restrictions. Examine the output...
Subtask 10.2.1 Run the following JOIN of two tables which has two restrictions. Examine the output – is this what you expect? Prefix the query with “EXPLAIN EXTENDED” and review the output. SQL EXPLAIN EXTENDED SELECT * FROM Orders NATURAL JOIN Order_Details WHERE QuotedPrice > 1000 AND OrderDate BETWEEN '2012-10-01' AND '2012-10-31'; Examine the query plan output with the help of the column explanations given above. Describe in your own words how the DBMS is fetching the rows. For each...
What would be the Mongodb equivalent of the 2 following SQL queries? SELECT A.Lname FROM Assistant...
What would be the Mongodb equivalent of the 2 following SQL queries? SELECT A.Lname FROM Assistant A INNER JOIN Manager Ma ON A.RefNum = Ma.RefNum GROUP BY A.Lname HAVING COUNT(DISTINCT Ma.Manager) > 1; SELECT G.Cname, R.Snum FROM Game G INNER JOIN Role R ON G.Cnum = R.Cnum WHERE G.level>200;
Lab 5 Queries with Multiple Tables In this lab, we do queries more than one table....
Lab 5 Queries with Multiple Tables In this lab, we do queries more than one table. SQL provides two different techniques for querying data from multiple tables: • The SQL subquery • The SQL join As you will learn, although both work with multiple tables, they are used for slightly different purposes. We used WMCRM database which is what we created in Lab 4. Here is the summary of the database schema (where schema is used in its meaning of...
Write a select query to return the 'InvoiceID' and a field called 'Status' from the invoices...
Write a select query to return the 'InvoiceID' and a field called 'Status' from the invoices table. The status field is either 'Late' or 'Paid' or 'Pending'. The status field will be 'Late' if the InvoiceDueDate is BEFORE 2016-04-30. The status field will be 'Paid' if there is a value in the PaymentDate field. Lastly, if the invoice isn't late or paid, the status will be 'Pending'. Do not sort the results.
Using the CTE named customer_information that you have in the given code below. Add a correlated...
Using the CTE named customer_information that you have in the given code below. Add a correlated subquery that also shows the total value of the order. Using an alias, name this calculated field OrderTotal. Because this is a corelated subquery, it falls into the category of aggregate and does not need to be included in the GROUP BY clause. (Hint: You will have to correlate between oe.orderse.order_id and customer_information.orderid to get SELECT CUST_LAST_NAME, CUST_EMAIL, ORDER_ID, SUM(QUANTITY) AS QTY FROM (SELECT...
I am using Oracle HR. Write a query to display the last name of employees, length...
I am using Oracle HR. Write a query to display the last name of employees, length of the name, and first monday since the hire date. Make the query that the user is prompted to enter a letter that the last name start with by using a substitution variable for the letter. For example, if the user enters "H" or "h" when prompted, the output should show all employees whose start with letter H and make sure that the case...
3. Estimate for yourself, without using the Internet: a) the number of air molecules in a...
3. Estimate for yourself, without using the Internet: a) the number of air molecules in a classroom b) the volume per molecule in the room c) the average distance between molecules in the room (starting from the answer to part b).
4-16 In MySql, using Application MYSQL Workbench and the Chinook database, please write a query to...
4-16 In MySql, using Application MYSQL Workbench and the Chinook database, please write a query to answer this? -- 16. Display the ablumid, the title, and the length of each title for each row in the album table. Number 16 - use LENGTH function I just need to add the Lenghth function to this answer: SELECT ArtistId, SUBSTRING(ArtistName, 1, 5) AS ArtistName FROM Artist;