Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Database Systems - Selecting Rows with WHERE and ORDER BY in a SELECT Statement
Play lesson

Database Systems with SQL - Full Course - Database Systems - Selecting Rows with WHERE and ORDER BY in a SELECT Statement

5.0 (0)
6 learners

What you'll learn

This course includes

  • 4.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

You can use the IS NULL in a WHERE clause to check if a value is NULL, or IS NOT NULL to check if a value is not NULL. Select * FROM Movie Where ReleaseYear IS NULL; You can use the DISTINCT clause to only get unique values in your result set. SELECT DISTINCT Title FROM Movie WHERE language = ‘English’; You can use the IN operator in a WHERE clause to check if a value is within a specific set of values. SELECT * FROM Movie WHERE Rating IN (‘PG’, ’PG-13’, ’G’); You can use the LIKE operator in a WHERE clause to match a VARCHAR column to a text pattern. SELECT * FROM Movie WHERE Title LIKE ‘Ghost%’; SELECT * FROM Movie WHERE Title LIKE ‘G%’; SELECT * FROM Movie WHERE Title LIKE ‘____%’; #4 word movies The % is a wildcard character that can matches any number of characters. ‘Ghost%’ will match to any value that starts with the word Ghost. The _ matches to just one character. For example LIKE ‘d_g’ matches with dog and dig but not dg or drowning. You can use the ORDER BY clause to get your result set in ascending order of whatever columns that you want. You can add a DESC after the column names to get the results in descending order. SELECT * FROM Movie ORDER BY Title; SELECT * FROM Movie ORDER BY Title DESC; Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere