Consider the following tables:
WORKS(Pname, Cname, Salary)
LIVES(Pname, Street, City)
LOCATED(Cname, City)
MANAGER(Pname, Mname)
Write a query in SQL for the following:
(i) List the names of the people who work for the company Wipro' along with the cities they live in.
(ii) Find the people who work for the company `Infosys' having salary greater than 50,000.
(iii) List the names of the people, along with the street and city addresses.
(iv) Find the persons whose salaries are more than that of all of the 'Oracle' employees.
(v) Find the names of the persons who do not work in `Infosys'.
Make suitable assumptions, if any
Assumption: For the purpose of these queries, I'll assume that the columns `Pname` in the tables `WORKS`, `LIVES`, and `MANAGER` refer to the person's name, `Cname` in the tables `WORKS` and `LOCATED` refer to the company name, and `Mname` in the `MANAGER` table refers to the manager's name.
(i) List the names of the people who work for the company 'Wipro' along with the cities they live in:
`SELECT W.Pname,
___ _____ _____ ____ ___ ___ __________ _____ _________ ___ __________ ________.
_________ ___ __________ _________ _________ _____ _____.
_____ __________ ____ ______ _______ _______ _________ ________.
__________ ______ __________ _________ __________ _____ _______ ____ ___ _____ _________.
________ ____ _________ __________ ____ __________ ___ __________ _______ ____ ________ _________.
_____ ___ _______ _________ _____ __________ _______ ____ ______ ____ ____ ________.
___ _______ ____ _______ ____ __________ __________ ______ _________.
__________ __________ _______ __________ ________ ______.
________ ____ _______ ___ _______ ____ ____ ___ _____.
___ ________ ___ ______ __________ ________ __________ _____ _____ ____.
_______ ____ _____ _________ __________ ___.
_________ _________ _________ _____ _________ _____ ________ _________ _______.
___ _________ ____ ___ _________ ___ _______ ______ ____ __________ ____.
______ ______ _______ _______ ______ ____ ___.
____ ____ _______ ________ __________ ______ ________ _____ __________.
________ _________ _________ _________ ___.
_______ _____ ______ _____ ______ ___ ___.
____ _____ __________ ______ ____ ______ ____.
_____.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
✓ Unlock up to 60% of the answer
✓ No payment required