From the course: SQL: Data Reporting and Analysis
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Challenge: Query a table - SQL Tutorial
From the course: SQL: Data Reporting and Analysis
Challenge: Query a table
(upbeat music) - As you already know, the Sakila Demo Database is for a movie rental store. That's an old-fashioned shop that you go into and you hire a DVD from. For our first challenge, I want you to imagine you work at such a store and a customer has asked for your advice to find a film that's either rated, PG parental guidance, or G, generally suitable for all. The only description they give is that they are looking for a drama. And for this challenge, I want you to confine your search to the film table. Next, I'm going to give you the same challenge in more query-like terms. If you like, you can pause the video now and try to build the query, or you can wait for a few more clues. So in other words, to help your customer, I want you to return all the records from the film table where the rating is either G or PG and the description field contains the word drama. There's more than one correct solution here. And…
Contents
-
-
-
-
Retrieve data with SELECT5m 31s
-
(Locked)
Filter results with the WHERE clause5m 4s
-
(Locked)
Use LIKE, IN, and wildcards with WHERE5m 39s
-
(Locked)
Sort SQL results with ORDER BY1m 42s
-
(Locked)
Use string functions on your data6m 41s
-
(Locked)
More advanced string functions8m 35s
-
(Locked)
Change report headings with an alias2m 28s
-
(Locked)
Use date functions with WHERE8m 50s
-
(Locked)
Challenge: Query a table1m 7s
-
(Locked)
Solution: Query a table1m 23s
-
(Locked)
Challenge: Convert case50s
-
(Locked)
Solution: Convert case2m 30s
-
-
-
-
-