Ve Given Following Problem Understand Basic Sql Select Join Etc Head Q43881933
I’ve been given the following problem. I understand very basicSQL (select, join, etc.) but some of this is over my head.
Here are sample rows from 3 tables with data about parents at a preschool. Some parents are gathering names for an after-school parents club. We have two tasks, but first, we need to keep the following in mind: a) If a person’s name appears twice, it’s an accident. Only include the one with the later birth year. b) We don’t want any NULL entries. c) We don’t want to consider any parents from the “no interest” table. Table1: kids Parent | children John | 3 Martha 12 Andrea 11 Susie | 2 Maggie | 5 Table2: ages name | birthyear. Andrea Andrea Susie Maggie John | 1985 1980 1983 1990 NULL Table3: no interest name Susie Joe Linda Tasks: 1. Create a distribution of birth year by percentage of total number of parents. Do not include NULL values in either input or output. 2. Create a table showing the average number of kids per visitor, but only for parents with names starting with the letter J (upper/Lower case doesn’t matter). Within this table we want a column that shows whether the parents have over 2 kids (1=True, O=False). Sort this table by average number of kids in descending order. Show transcribed image text Here are sample rows from 3 tables with data about parents at a preschool. Some parents are gathering names for an after-school parents club. We have two tasks, but first, we need to keep the following in mind: a) If a person’s name appears twice, it’s an accident. Only include the one with the later birth year. b) We don’t want any NULL entries. c) We don’t want to consider any parents from the “no interest” table. Table1: kids Parent | children John | 3 Martha 12 Andrea 11 Susie | 2 Maggie | 5 Table2: ages name | birthyear. Andrea Andrea Susie Maggie John | 1985 1980 1983 1990 NULL Table3: no interest name Susie Joe Linda Tasks: 1. Create a distribution of birth year by percentage of total number of parents. Do not include NULL values in either input or output. 2. Create a table showing the average number of kids per visitor, but only for parents with names starting with the letter J (upper/Lower case doesn’t matter). Within this table we want a column that shows whether the parents have over 2 kids (1=True, O=False). Sort this table by average number of kids in descending order.
Expert Answer
Answer to I’ve been given the following problem. I understand very basic SQL (select, join, etc.) but some of this is over my head…
OR