Intermediate SQL
Here you can access every table used in the course. To access each table, you will need to specify the cinema schema in your queries (e.g., cinema.reviews for the reviews table.
Take Notes
Add notes about the concepts you've learned and SQL cells with queries you want to keep.
So, the first function is
Count
- Count () we write like this select Count ( whatere you want to count) AS ( if you want to add new name) the from ( table name)
So, you can use Count and Distinct at a same time , Like Count (Distint VAlue)
for counting more than two just use 1 select and separate by comma
Filtering
we need to use a new clause called WHERE, which allows us to focus on only the data relevant to our business questions.
Where with string
WHERE and the comparison operator, equals, can also be used with strings. In these cases, we will have to use single quotation marks around the strings we want to filter. For example, here, we want to filter titles where the country is Japan.
1 hidden cell
Filtering
WHERE clause to filter text data. However, so far, we've only been able to filter by specifying the exact text we're interested in.
- Filtering text We'll often want to search for a pattern rather than a specific text string in the real world. We'll be introducing three more SQL keywords into our vocabulary to help us achieve this: LIKE, NOT LIKE, and IN.
In= And in bracket