SQL Foundations I Module 3

Write three queries using outer joins

Only editable by group admins

  • Last updated November 13, 2017 at 4:52 PM
  • Evidence visible to public
Three queries shall use outer joins. Submit a link to show your work.

All posted evidence

Tweaked OUTER JOIN links

Task 3 Query 7

jmfisher About 7 years ago

Task 3 Query 6

jmfisher About 7 years ago

Task 3 Query 5

jmfisher About 7 years ago

Task 3 Outer Joins in Konagora Chapter 3

/*Task 3*/
/*Query 5 - Artists born after 1950 and are they still making movies within last 5 years*/
SELECT first_name, surname, born, UPPER(title) as 'Title' FROM people p LEFT JOIN (SELECT * FROM movies m INNER JOIN credits c ON m.movieid = c.movieid WHERE year_released > 2012) s ON  p.peopleid = s.peopleid WHERE p.born > 1949 ORDER BY p.surname asc;
/*Query 6 - French movies with alternate titles that are less than 20 characters long*/
SELECT UPPER(m.title) as 'Title', a.title as 'Alternate', m.year_released as 'Released'FROM movies m LEFT JOIN (SELECT * FROM alt_titles WHERE LENGTH(title)<20) a ON  m.movieid = a.movieid WHERE m.country="fr" ORDER BY m.title asc;
/*Query 7 - List all artists and if they have directed a movie in the US list the title(s)*/
SELECT first_name, surname, UPPER(title) as 'Title' FROM people p LEFT JOIN (SELECT * FROM movies m INNER JOIN credits c ON m.movieid = c.movieid WHERE country="us" AND c.credited_as="D") s ON  p.peopleid = s.peopleid  ORDER BY p.surname asc;
jmfisher About 7 years ago

Three queries using OUTER JOIN's

Outer Join

LEFT OUTER JOIN to combine information on actors, movies, and countries from 3 different tables.

jaco About 8 years ago

Uses as a LEFT JOIN to combine information from people and credits USING peopleid. Displays name and age of directors who died in 2016.

jaco About 8 years ago

Uses a LEFT OUTER JOIN to create a table with move titles, alt titles, and the lengths of each.

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

Kept it simple and used the Konagora DB http://edu.konagora.com/SQLsandbox.php

Pastebin

SELECT * FROM credits NATURAL JOIN movie_title_ft_index2 WHERE title_wor - Pastebin.com

Pastebin PRO Accounts CHRISTMAS SPECIAL! For a limited time only get 50% discount on a LIFETIME PRO account! Offer Ends Soon!
randyiv About 8 years ago