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
Fantastic news! We've Found the answer you've been seeking!
Question:
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.
Related Book For
Modern Database Management
ISBN: 978-0133544619
12th edition
Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi
Posted Date: