Sql select employee from table with at least one department, Database Management System

Consider employee (e_no, e_name, e_salary, d_code), dept
(d_code, d_name) and dependent (depndt_name, e_no, relation).
Show the names of employees in purchase and accounts departments with at least one dependent.

SELECT e_name FROM employee, dependent, dept
WHERE employee.d_code=dept.d_code
AND employee.e_no=dependant.e_no
AND d_name IN (‘ACCOUNTS', ‘PURCHASE')
GROUP BY e_name
HAVING COUNT (e_no)>=1

Posted Date: 5/11/2013 2:41:03 AM | Location : United States







Related Discussions:- Sql select employee from table with at least one department, Assignment Help, Ask Question on Sql select employee from table with at least one department, Get Answer, Expert's Help, Sql select employee from table with at least one department Discussions

Write discussion on Sql select employee from table with at least one department
Your posts are moderated
Related Questions
Primary index A primary index is a file that has a sorted series of records having two columns: a block address for that key field in the data file; and the ordering key field.

Consider the subsequent relations RENTER(rno, fname, lname, address, tel_no, pref_type, max_rent) VIEWING(rno, pno, date, comment) PROPERTY_FOR_RENT( pno, street, area ,city,

Control Files : The redo and control files logs support the rest of the architecture. Every database must have at least one control file, although you have more than one to guard

What are the disadvantages of relational data ? Disadvantages • Performance - If the number of tables among that relationships to be established are large and the tables t

Define check point and its impact on data base recovery.                  Ans:  There could be hundreds of transactions handled per minute, in a large on-line database system.

Create a new user : CREATE USER IDENTIFIED BY Example: //CREATE USER MCA12 IDENTIFIED BY W123 Grant: It is used to give database access permission to users. It is of

Draw and explain the three level architecture of the database system? A DBMS gives three levels of data is said to follow three-level architecture. The trget of the three-schem

Explain the Relational Completeness Codd described the term relational completeness to consider to a language that is complete with respect to first-order predicate calculus ex

Table_Name( attribute_1, attribute_2, attribute_3, ….. ,attribute_x) Primary Key ( attribute_1, attribute_2) Foreign Key attribute_4 References Table_Name_2 (repeat for each fore

In an organisation various projects are undertaken. Each projects can employ one or more employees. Every employee can work on one or more projects. Each project is undertaken on