SQL EXISTS - Overview, syntax

          

SQL EXISTS - Overview, syntax


SQL EXISTS - Introduction and syntax

<<Previous  Next>>

SQL - Dec 03, 2008 at 18:00 PM by Rajmeet Ghai

Explain the SQL EXISTS statement. Write SQL syntax for the SQL EXISTS statement along with an example.

SQL EXISTS: If the subquery returns at least one row the EXISTS condition is considered "to be met".

Syntax:
SELECT columns FROM tables WHERE EXISTS ( subquery );

Example:
SELECT * FROM employee WHERE EXISTS (select * from appraisal where employee.employee_id = appraisal.employee_id);


SQL BETWEEN

SQL BETWEEN: The BETWEEN operator is used in a WHERE clause to select a range of data between two values. The values can be numbers, text, or dates..............

SQL CREATE VIEW

SQL CREATE VIEW: A view is a virtual table. A view contains rows and columns, just like a real table..............

SQL IN

The IN operator allows you to specify multiple values in a WHERE clause................

SQL MINUS

SQL MINUS returns all rows in the first query that are not returned in the second query..................

SELECT DISTINCT

SELECT DISTINCT: It is used to select unique records from a table. Some tables may have duplicate values for a column. Distinct will eliminate these duplications...........

<<Previous  Next>>



Write your comment - Share Knowledge and Experience


 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring