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
Question 1 Explain the functions of the following Storage Manager Buffer Manager Transaction Manager 2 Discuss about system catalog in a relational DBMS 3

What is a primary index? A primary index is an index whose search key also explains the sequential order of the file.

1.Why we need data mining? Give an example to illustrate your answer. 2. Why data mining is considered as "misleading name"? 3. Distinguish the difference between database an

What are the uses of the information in the Data dictionary? The following information is directly taken from the Data dictionary: Information on fields displayed with

i would like to ask if you will do assignment of database number of words 1500 and how much

The users who use easy-to-use menu are called ? The users who use easy to use menu are called as Naïve users.

We require an advanced system for a Sports Centre, you are concerned only with representing the data discussed below about bookings and members. (The complete system may contain ot

Differentiate between a unique key and a primary key. - By default, clustered index on column are created by primary key while nonclustered index are created by unique key.


Cardinality of Relationship One-to-One Only one entity of the first set is linked to only one entity of the second set. E.g. A teacher teaches a student. Only one teacher