Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Parent table
- id married_couple married_at expected_kids
- --------------------------------------
- 1 Bob and Mary 2010-01-01 4
- Child table
- id child_name parent_id date_of_birth
- --------------------------------------
- 1 Eddie 1 2012-01-01
- 2 Frankie 1 2013-01-01
- 3 Robbie 1 2014-01-01
- 4 Duncan 1 2015-01-01
- Expected SQL result
- parent_id half_goal_reached(years)
- --------------------------------------
- 1 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement