0
12kviews
write SQL queries

For the following given database, write SQL queries:-

employee(al employee_name, street, city)

works(eid, ad, salary)

company(cla, company name,city)

Manager(dcl, manager_name)

(i)Find the names, street and city of all employees who work for "AZT" and earn more than Rs. 30,000

(ii) Find the narnes of all employees having "K" as the first letter in their names

(iii) Display the annual salary of all employees.

Mumbai University > Computer Engineering > Sem 4 > Database Management System

Marks: 10 M

Year: Dec 2015

1 Answer
2
992views

i. Find the names, street and city of all employees who work for "AZT" and earn more than Rs. 30,000

SELECTemployee_name,street,city
FROM employee e ,works w
WHERE e.eid=w.eid
AND salary>30000 
AND w.cid in 
(SELECTcidFROM companyc WHEREcompany_name=”AZT”)

ii. Find the narnes of all employees having "K" as the first letter in their names

SELECTemployee_name
FROM employee
WHEREemployee_name like ‘K%’;

iii. Display the annual salary of all employees.

SELECT
eid,employee_name,street,city,
(12 * salary)ANNUALSALARY” 
FROM employee e,works w 
WHEREe.eid=w.eid
GROUP BY eid;
Please log in to add an answer.