Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions SQL Deep Dive/Like Operator/questions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ SELECT ..., EXTRACT (YEAR FROM AGE(birth_date)) as "age" FROM employees;
* Table: employees
* Question: How many people's name start with A and end with R?
* Expected output: 1846
SELECT * FROM employees
WHERE first_name ILIKE 'A%R'

*/


Expand All @@ -21,6 +24,8 @@ SELECT ..., EXTRACT (YEAR FROM AGE(birth_date)) as "age" FROM employees;
* Table: customers
* Question: How many people's zipcode have a 2 in it?.
* Expected output: 4211
SELECT * FROM customers
WHERE zip::Text LIKE '%2%'
*/


Expand All @@ -30,6 +35,9 @@ SELECT ..., EXTRACT (YEAR FROM AGE(birth_date)) as "age" FROM employees;
* Table: customers
* Question: How many people's zipcode start with 2 with the 3rd character being a 1.
* Expected output: 109
SELECT * FROM customers
WHERE zip::Text LIKE '2_1%'

*/


Expand Down