Select Query

Select statement can perform two types of job

1. Selection
2. Projection --> It can be possible in two different manners
    i.  Column wise projection
    ii. Row  wise projection

1. Selection
It means select all data from table and not apply any clause.

Ex:
SELECT * FROM student;
2. Projection
i. Column wise Projection
   Column restriction is a concept through which those many attributes are displayed which are mentioned in the select statement
Ex:
SELECT Name, Mobile
FROM student;

ii. Row wise Projection
    Row restriction is a concept through which those many records are displayed where condition is satisfied.

Ex:
SELECT Name, Mobile
FROM student
WHERE ID = 5

Column Alias:
Column alias is concept through which user can provide duplicate name to an existing column.
It can be given using three different methods

Type-1
SELECT Name Name, Mobile Mobile
FROM student
 

 

Type-2
SELECT Name 'Name', Mobile 'Name'
FROM student

Type-3
SELECT Name as 'Student Name', Mobile as 'Mobile Name'
FROM student

Column Concatenation:
Column concatenation is concept through which user can concatenation two or more ten two column to get a customized output.

Ex:
SELECT 'Name : '+ name+' Mobile number : '+mobile as Student from student

Distinct: 
Distinct keyword is used in conjunction with Select statement to eliminate all the duplicate records.
It retrieve only unique records from table.

Ex:
SELECT DISTINCT * FROM student