EMP (Employee-no, Dept-no, Employee-name, Salary)
DEPT (Dept-no, Dept-name, Location)
Write an SQL query to:
(a) Find all employee names who work in departments located at "Calcutta" and whose salary is greater than Rs.50,000.
(b) Calculate, for each department number, the number of employees with a salary greater than Rs.1,00,000.
Suppose we have a database consisting of the following three relations.
FREQUENTS (student, parlor) giving the parlors each student visits.
SERVES (parlor, ice-cream) indicating what kind of ice-creams each parlor serves.
LIKES (student, ice-cream) indicating what ice-creams each student likes.
(Assume that each student likes at least one ice-cream and frequents at least one parlor)Express the following in SQL:
Print the students that frequent at least one parlor that serves some ice-cream that they like.
GATE CSE Subjects
Browse all chapters by subject