Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use the RelaX website: https://dbis-uibk.github.io/relax/calc/gist/c8e9a3660d48301c6c213a9f0f85c6e6 (Links to an external site.) Your task is to write SQL queries to solve the problems below. Copy all queries
Use the RelaX website: https://dbis-uibk.github.io/relax/calc/gist/c8e9a3660d48301c6c213a9f0f85c6e6 (Links to an external site.)
Your task is to write SQL queries to solve the problems below. Copy all queries to a single text file (make sure encoding is set to Unicode) and submit it once you are done.
- Compute a new table by selecting only the persons with an income between 20 and 30, and adding an attribute that has, for every tuple, the same value as income.
- Generate a new table by selecting only the persons with income lower than 30, projecting the data (income) on the attribute salary, and adding an attribute that has, for every tuple, twice the value of the attribute salary (call it ‘doubleSalary’).
- Retrieve the fathers of persons who earn more than 20.
- Retrieve the father and mother of every single person.
- Retrieve persons that earn more than their father, showing the person’s name and income, and income of the father.
- Using an Explicit Join, retrieve name, income, and the income of the father of all persons that earn more than their father.
- For each group of adult persons who have the same age, return the maximum income for every group and show the age.
- Retrieve the fathers whose children under age 30 have an average income greater than 20.
Step by Step Solution
★★★★★
3.40 Rating (162 Votes )
There are 3 Steps involved in it
Step: 1
1 select name age income as alsoincome from Person where income 20 and inc...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started