Created
May 6, 2024 05:45
-
-
Save yurijserrano/06845ffe8f92748cd92ac00156d88303 to your computer and use it in GitHub Desktop.
Challenges - Second Exercise Solution
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
UPDATE vehicles SET registration_date = CURRENT_DATE - INTERVAL '11 months' WHERE id = 1; | |
UPDATE vehicles SET registration_date = CURRENT_DATE - INTERVAL '12 months' WHERE id = 2; | |
UPDATE vehicles SET registration_date = CURRENT_DATE - INTERVAL '18 months' WHERE id = 3; | |
UPDATE vehicles SET registration_date = CURRENT_DATE - INTERVAL '20 months' WHERE id = 4; | |
SELECT d.first_name, d.last_name, v.make, v.model, v.registration_date | |
FROM drivers d | |
JOIN vehicles v ON d.id = v.driver_id | |
WHERE v.registration_date = CURRENT_DATE - INTERVAL '11 months'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment