Learn SQL the Hard Way – Exercise 5 Selecting Data

Here is my work for Exercise 5 Selecting Data.

Exercise 5
Exercise 5

In this exercise, we move onto the Read part of CRUD. We make four selections in the exercise code from our database.
Extra Credit

  • Write a query that finds all pets older than 10 years.
  • Write a query to find all people younger than you. Do one that’s older.
  • Write a query that uses more than one test in the WHERE clause using the AND to write it. For example, WHERE first_name = "Zed" AND age > 30.
  • Do another query that searches for rows using 3 columns and uses both AND and OR operators.
    I added the queries below the original exercise.

    Exercise 5 extra credit
    Exercise 5 extra credit
    Extra credit Query results
    Extra credit Query results

    I keep forgetting the semi-colon at the end, a side effect from working through Learn Ruby the Hard Way!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s