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

Assignment Help:

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


Related Discussions:- Sql select employee from table with at least one department

What are the various properties of relational tables, What are the various ...

What are the various properties of Relational tables? Relational tables have 6 properties: 1. Each row is unique. 2. Column values are of the same kind. 3. Values are

RDBMS, DISADVANTAGES OF RDBMS

DISADVANTAGES OF RDBMS

How can you start mysql server, How can you Start MySQL Server? To star...

How can you Start MySQL Server? To start the mysql program type it is name in the command- line prompt. After starting mysql program just display A welcome letter using the

Decompose the table - 3nf or bcnf, Decompose the table with the following ...

Decompose the table with the following description and functional dependencies into a set of equivalent tables normalized to 3NF or BCNF. A long-standing international treaty am

What is boyce-code normal form, Boyce-Code Normal Form (BCNF) A relatio...

Boyce-Code Normal Form (BCNF) A relationship is said to be in BCNF if it is already in 3NF and the left hand side of each dependency is a candidate key. A relation who is in 3N

Describe the nested-loop join and block-nested loop join, Describe the nest...

Describe the nested-loop join and block-nested loop join.   Ans:   The block nested- loop join algorithm is as described below:     for every block B r of relation R do beg

Balance transfer, Scenario 1: Power goes out after the first instruction. ...

Scenario 1: Power goes out after the first instruction. What happens?

Database models, why are older data models are being replaced by new data m...

why are older data models are being replaced by new data models

Dbms, statical data

statical data

Explain about primary key, Explain about primary key Primary Key: It ...

Explain about primary key Primary Key: It is one of the candidate keys that are taken to be the recognizing key for the entire table. E.g. although there are two candidate ke

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