Created
June 11, 2020 07:55
-
-
Save velotiotech/61d5cc6ca34ecd98b9b2befde75f1b58 to your computer and use it in GitHub Desktop.
Give FirstNames of People from Minnesota with amount_due more than $100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH basic AS | |
(SELECT id, | |
first_name | |
FROM basic_details | |
WHERE lower(gender) = 'male' ), bill AS | |
(SELECT id | |
FROM bil_details | |
WHERE CAST(amount_due AS INTEGER) > 100 ), contact AS | |
(SELECT contact_details.id | |
FROM contact_details | |
JOIN bill | |
ON contact_details.id = bill.id | |
WHERE state= 'Minnesota' ) | |
SELECT basic.first_name | |
FROM basic | |
JOIN contact | |
ON basic.id = contact.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment