Wednesday, 4 May 2022

Selection and Projection operations in SQL

Selection operation: The selection operation can be considered as row wise filtering. We can select specific rows using condition.

Syntax:

Select *

from <table-name>

Where condition

Example:

SQL> Select *

          from student

          Where sid=104;

Selection is also know as restrict, this operator yields values for all rows found in a table that satisfies given condition. Select can be used to list all of the row values or it can yield only those rows values that match a specific criteria. Select yields a horizontal subset of a table

Projection operation: The projection operation performs wise filtering. Specific columns are selected in projection operation.

Syntax: 

Select Attribute1, Atribute2

from table-name;

If all the columns of the table are selected, then it cannot be considered as projection.

Example:

 SQL> select name, dob

           from student

         

0 comments :

Post a Comment

Note: only a member of this blog may post a comment.

Machine Learning

More

Advertisement

Java Tutorial

More

UGC NET CS TUTORIAL

MFCS
COA
PL-CG
DBMS
OPERATING SYSTEM
SOFTWARE ENG
DSA
TOC-CD
ARTIFICIAL INT

C Programming

More

Python Tutorial

More

Data Structures

More

computer Organization

More
Top