From 6dd9bd780cf3849fce2792cc2b3d6d03eabfb681 Mon Sep 17 00:00:00 2001 From: Aarif Hannan <69072800+hannanaarif@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:30:31 +0530 Subject: [PATCH] Update questions.sql --- SQL Deep Dive/Like Operator/questions.sql | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SQL Deep Dive/Like Operator/questions.sql b/SQL Deep Dive/Like Operator/questions.sql index 3d9f0f7..afce05a 100644 --- a/SQL Deep Dive/Like Operator/questions.sql +++ b/SQL Deep Dive/Like Operator/questions.sql @@ -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' + */ @@ -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%' */ @@ -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%' + */