40 likes | 57 Views
Learn how to perform the JOIN operation, construct product tables, eliminate duplicate columns, and fill in natural join tables in SQL. Explore representing queries, modifying queries, and running queries to retrieve specific information.
E N D
The JOIN operation • Algorithm from the text • Construct the product table. • Select those rows with matching values. • Project to eliminate duplicate columns. • Finish the product table • Fill in the natural join table.
Multiple Table Queries in SQL • How is a multiple table query represented in SQL? • Make a query is Design View to generate sample SQL • Which role did Morgan Freeman play in the movie “The Shawshank Redemption” • Which tables do you need to answer the question?
Why look at SQL? • All queries are expressible in SQL • Not all queries can be expressed in Design View • Representation: just as web pages are all composed of HTML, queries are composed of SQL • To construct dynamic Web pages that retrieve and write information to a database we need SQL
Modifying SQL queries • Change the SQL to find the answer to each of these questions: • What role did Tim Robbins play in the same movie? • Run the query • What role did Eddie Murphy play in “Coming to America”? • Run the query • Which movies have Dracula as a role? • Run the query