Question: Let consider the given tables:
WORKS (Pname, Cname, salary)
LIVES (Pname, Street, City)
LOCATED (Cname,City)
MANAGER (Pname, Mname)
Write down a query in the SQL for the given:
a) List all the names of people who work for the company Wipro all along with the cities they live in.
b) Find out the people who work for the company ‘Infosys’ having salary more than Rs. 50000/-.
c) List all the names of people, all along with the street and city addresses.
d) Find out the persons whose salaries are more than that of all of the ‘oracle’ employees.
e) Find out the name of the persons who don’t work in ‘infosys’.
f) Find out the average salary of the employee in company named ‘accenture’.
g) Make a table for the above relations by using SQL-DDL
h) Make a view comprising of the person name all along with their manager name and company name.