Explain some of the keywords of Select Statement like Distinct Keyword, Top n Keyword with an example for each of them

Explain some of the keywords of Select Statement like Distinct Keyword, Top n Keyword with an example for each of them.

DISTINCT: Distinct clause helps to remove duplicates and returns a result set.

Syntax:
DISTINCT (set_expression)

Example:
Select DISTINCT company_name FROM Company;

TOP N: returns the top ā€œnā€ records from a table.

Syntax :
TOP N

Example:
Select TOP 10 Cust_name from Customer;
Describe the use of Into and From clause with examples
INTO: The INTO keyword inserts data from one table into another. It is commonly used in SELECT statement. It is useful in creating back ups.........
Where, group by and having clause
WHERE: Where clause in a SELECT query is used to retrieve specific records that meet the specified criteria.......
What is SQL Server Identifier?
Everything in a SQL server can have an identifier. Be it server, view, trigger, column etc. any database object name is an identifier. Identifiers may or may not be required for all objects.........
Post your comment