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 (a) Give two advantages of using Linked List as compared to arrays. (b) (i) You are working as programmer at the Orange Mauritius branch. You have been asked to cre

Define the terms i) Entity set ii) Relationship set Entity set: The set of all entities of the similar type is termed as an entity set. Relationship set: The set of all rela

explain in detail about time stamp orderting/

Types of Locks There are two necessary types of locks: Binary lock : This locking mechanism has two states for to a data item: locked or unlocked Multiple-mode loc

Consider the relations EMP(ENO,ENAME,AGE,BASIC_SALARY) WORK_IN(ENO,DNO) DEPT(DNO,DNAME,CITY) Express the following queries in SQL (i) Find names of employees who work in a dep

What is the use of group by clause?  Group  by  clause  is  used to apply  aggregate  functions  to a  set  of  tuples. The attributes given in the group by clause are used to

The JOIN operation is applied on two relations. When we want to choose related tuples from two given relation join is used. The join operation need that both the joined relations m

The database application project (DAP) for this assignment consists of the creation of a fully functional Microsoft Access database application for a real client. I recommend you s

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

Structure Of Distributed Database: A distributed database system haves of a collection of sites, each of which keeps a local databases system. Every site is able to process local