From the course: SQL: Data Reporting and Analysis

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Solution: Query a table

Solution: Query a table

(upbeat music) - [Instructor] For this query, we can interpret each line of our objective into a line of code so we can build the query up line by line. The first part was to return all records from the film table. And that's what happens when we click on the film table anyway, select star from film. So we run that and we have a thousand rows returned. Next, we need to place a filter using the where claws. We can either use rating in brackets with the in key word or we could use the or statement, which I'm not going to show you. Either of these is fine, but if you use the or statement you might need parentheses around part of your where clause. So select star from film where rating in G, PG, and we can run that. Finally, for the second filter, we use the and keyword and a wild card, which is the percent sign in this case. So we're going to say and description like percent drama percent. And let's run that as well.…

Contents