SQL Foundations I Module 3

Write an INNER JOIN query, with USING and ON

Only editable by group admins

  • Last updated November 13, 2017 at 4:52 PM
  • Evidence visible to public
Three queries shall use an inner join, with a mix of USING and ON clauses. Submit a link to show your work.

All posted evidence

Results for Query #4

jmfisher About 7 years ago

Results for Query #2

jmfisher About 7 years ago

Inner Joins with USING and ON

/*Task 2*/
/*Query 2 - Join Signs and Materials tables to show Material name along with other info*/
SELECT quantity as 'Quantity', CONCAT(hor_dimens, ' ft x ', vert_dimens, ' ft') as 'Dimensions', UPPER(Materials.name) as 'Material' FROM Signs INNER JOIN Materials USING (mat_id) WHERE id < 10 ORDER BY hor_dimens asc
/*Query 3 - Round Costs to nearest whole dollar*/
SELECT CONCAT(Signs.hor_dimens, ' ft x ', Signs.vert_dimens, ' ft') as 'Dimensions', Materials.name as 'Material', Finishes.name as 'Finish', Signs.quantity as 'Quantity', ROUND(Signs.cost) as 'Cost'
FROM Signs 
INNER JOIN Materials ON Signs.mat_id=Materials.mat_id
INNER JOIN Finishes ON Signs.finish_id=Finishes.finish_id
WHERE 1 ORDER BY cost DESC;
/*Query 4 - Show Number of signs for each type of material*/
SELECT  Materials.name as 'Material', SUM(Signs.quantity) as 'Total'
FROM Signs 
INNER JOIN Materials ON Signs.mat_id=Materials.mat_id
GROUP BY Signs.mat_id HAVING COUNT(*)>0 ORDER BY SUM(Signs.quantity);
jmfisher About 7 years ago

Three queries using INNER JOIN's

Results for Query #3

jmfisher About 7 years ago

(missing third query) SELECT * FROM credits INNER JOIN people USING (peopleid) ORDER BY peopleid;

INNER JOIN with USING and ON

Utilizes an INNER JOIN and ON to display extra information from the countries table along with the count of movies from the movies table.

jaco About 8 years ago

A quick INNER JOIN to merge movies and alt_titles USING movieid.

jaco About 8 years ago

Statement uses INNER JOIN to combine information from credits, people, and movies tables USING their respective IDs.

jaco About 8 years ago

I didn't finish all of them, but I did my best! This is a link to all of them.

Google Docs

MODULE 3 :: TASK 1

Task 1 >> NATURAL JOIN SELECT * FROM Customers NATURAL JOIN Orders; --Task 2 >> INNER JOINS SELECT * FROM Orders INNER JOIN Products USING (ItemNumber); SELECT Orders.OrderNumber, Customers.Address, ItemNumber, ItemDescription, ItemLocation FROM Products INNER JOIN Orders USING (ItemNumber)...
slewis52 About 8 years ago
Konagora

Konagora Educational Resources - SQL sandbox

A Free SQL sandbox to practice SQL exercises from the \
franciscocruz11 About 8 years ago