From the course: Intermediate SQL: Data Reporting and Analysis

Unlock the full course today

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

Wildcards and aliases

Wildcards and aliases

- [Instructor] Now we start to make our queries more flexible. Wild cards let you place filters that are similar to but not exactly the same as your filter term. And table or column aliases can help to simplify more complex queries. Let's compare two queries. Select star from film where description is drama. Now we get zero results, an empty results set. Let's just have a quick look if we go back and look at all of the results. Here is an example of the description field. A epic drama of a feminist. Okay, so it's compared that to the word film and found nothing. Now, what if we say select star from film where description like drama? Now, it's found 106 results. The percent sign here is a wild card. It's like a joker in a pack of cards. It can stand for any number of other characters. SQL uses two wild cards; the percent sign and the underscore. The percent sign is more accommodating than the underscore. Let's just…

Contents