Question: I've been given the following problem. I understand very basic SQL (select, join, etc.) but some of this is over my head. Here are sample

I've been given the following problem. I understand very basic SQL (select, join, etc.) but some of this is over my head.I've been given the following problem. I understand very basic SQL (select,

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. 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!