DBS211

Return to Learning Module

Practice with SELECT 

Using the following table, complete the practice questions:

MOVIES
Id Title Director Year Length_minutes
1 Toy Story John Lasseter 1995 81
2 A Bug's Life John Lasseter 1998 95
3 Toy Story 2 John Lasseter 1999 93
4 Monsters, Inc. Pete Docter 2001 92
5 Finding Nemo Andrew Stanton 2003 107
6 The Incredibles Brad Bird 2004 116
7 Cars John Lasseter 2006 117
8 Ratatouille Brad Bird 2007 115

Practice Exercises

  1. Find the titles for all the movies
  2. Find all the directors
  3. Find both the title and director for each movie
  4. Find the director name and which movie they directed (in that order)
  5. Find all data in the movie table

Answers

Question 1

SELECT title
FROM movies;

Question 2

SELECT director
FROM movies;

Question 3

SELECT title, director
FROM movies;

Question 4

SELECT director, title
FROM movies;

Question 5

SELECT *
FROM movies;