Find names of employees, Database Management System

Assignment Help:

Consider the relations
EMP(ENO,ENAME,AGE,BASIC_SALARY)
WORK_IN(ENO,DNO)
DEPT(DNO,DNAME,CITY)
Express the following queries in SQL
(i) Find names of employees who work in a deptt. in Delhi.
(ii) Get the deptt. number in which more than one employee is working.
(iii) Find name of employee who earns highest salary in ‘HR' department.

(i) select ENAME from EMP, WORK_IN, DEPT where EMP.ENo= WORK_IN.ENO and WORK_IN.DNO= DEPT.DNO and CITY= ‘Delhi';
(ii) select DNO from WORK_IN group by DNO having count(*) >1
(iii) select ENAME from EMP e where BASIC_SALARY >= (select max(BASIC_SALARY) from DEPT,WORK_IN where DNAME = ‘HR' and e.ENO = WORK_IN.ENO and WORK_IN. DNO= DEPT.DNO)


Related Discussions:- Find names of employees

Database manager, Database Manager It is the interface among low-leve...

Database Manager It is the interface among low-level data, queries and application programs. Databases typically need a large amount of storage space. It is kept on disks, as

Er diatgrams, Ask q“A database will be made to store information about pati...

Ask q“A database will be made to store information about patients in a hospital. On arrival, each patient’s personal details (name, address, and telephone number) are recorded wher

Farm management system, draw er diagram using entities crop,employee,depart...

draw er diagram using entities crop,employee,department,plot,cultivation plan,machinery,seed,fertilizer

What is an object id, What is an object ID? Each class-derived table ha...

What is an object ID? Each class-derived table has an ID for primary key, one or more object IDs form primary key for association derived tables. An object ID is equivalent dat

What is hierarchical dbms, What is Hierarchical DBMS In HDBMS, data is ...

What is Hierarchical DBMS In HDBMS, data is structured in a tree like manner. There is a parent-child relationship between data items and the data model is very suitable for re

Define variable-length records arise in database, What are the ways in whic...

What are the ways in which the variable-length records arise in database systems? Storage of many record types in a file. Record types that permit variable lengths for one o

Replicating data, Replicating Data One approach that may support effici...

Replicating Data One approach that may support efficient access to dissimilar applications as above may be to give access to every of the applications from dissimilar replicate

What are stored-procedures, What are stored-procedures? And what are the ad...

What are stored-procedures? And what are the advantages of using them? Stored procedures are database objects that perform a user defined operation. A stored procedure can have

Accounting and external reporting, List the internal controls that should b...

List the internal controls that should be in effect solely because a EDP system is employed, classifing them as (1) Those controls pertaining to input of information and (2) All ot

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd