Multiple column queries-syntax, Database Management System

Multiple column Queries:

Syntax:

SELECT COLUMN1, COL2,......

FROM TABLE

WHERE (COLUMN1, COL2, ...) IN

(SELECT COLUMN1, COL2,....

 FROM TABLE

WHERE );

Example: Find the department number, name, job title and salary of those people who have the similar job title and salary as those are in department 10.

SELECT DEPTNO,ENAME, JOB, SAL

FROM EMP

WHERE (JOB, SAL) IN (         SELECT JOB, SAL

                                                 FROM EMP

                                                 WHERE DEPTNO=10);

OUTPUT:

DEPTNO

ENAME

JOB

SAL

10

Nirmal

MANAGER

2975

10

Kailash

ANALYST

3000

20

Ashwin

ANALYST

3000

Posted Date: 3/11/2013 4:01:33 AM | Location : United States







Related Discussions:- Multiple column queries-syntax, Assignment Help, Ask Question on Multiple column queries-syntax, Get Answer, Expert's Help, Multiple column queries-syntax Discussions

Write discussion on Multiple column queries-syntax
Your posts are moderated
Related Questions
Explain entity integrity and referential integrity rules within relational model. Show how these are realized in SQL? Entity Integrity Rule - No primary key value could be nu

A database administrator''s responsibilities and data contents

create an er diagram for production management in film industry

What is a data dictionary?  A data dictionary is a data structure which keeps Meta data about the structure of the database i.e.  the schema of the database.

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

What is DML compiler? DML Compiler: Translates DML statements in a query language within low level instructions understandable through the query evaluation engine. Attempts to

Q.   With the help of a suitable diagram gives module wise explanation of system architecture of DBMS. Sol. A Database management is a collection of interrelated data and col

Define Assertions in SQL a. An assertion is a predicate that is expressing a condition we wish the database to always satisfy.  b. Domain constraints, functional dependency

10A.53 Code an Oracle Database trigger to enforce the constraint that an employee can never change his or her department. 10A.54 Code an Oracle Database trigger to allow the

Mappings between Levels and Data Independence The 3 levels of abstraction in the database do not exist separately of each other. There must be some correspondence, or mapping