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
Fundamentals of Database Management 1. Explain the concept of Foreign Key. How a foreign key differs from a Primary Key? Can the Foreign Key accept nulls? 2. With a necess

What is transaction? Collections of operations that form a single logical unit of work are known as transactions.

#Use the following database schema: 1) Patient—PatientID, Name, DOB 2) Doctor—DoctorID, Name, MedLicenseNumber, Phone 3) Medication—MedicationID, BrandName, GenericName 4) Prescrip

Draw an ER diagram that represents the information described below. Show all entity sets, relationship sets, primary keys, and the mapping cardinality of the relationship sets.

What is a candidate key? Minimal super keys are known as candidate keys.

Java program for horrizontal fragmentation in distributed database

The Internal or Physical Level The collection of files permanently stored on secondary storage devices is called as the physical database. The internal or physical level is t

Using the questions found at the end of Chapter 9 in your textbook, complete this homework activity. Students will submit a Word document answering questions 2, 3, and 4.

various techniques of hashing?

What are the components of storage manager? The storage manager components include a) Authorization and integrity manager b) Transaction manager c) Buffer manager d