
Search In
Basically Unique and Distinct both are same means both do the same work , Unique statement was used earlier by the oracle database but Now a days Distinct statement is using by the oracle ( Now it is the official keyword ) , Though Unique statement
Using this SQL Top statement we can select the topmost( first element from top ) element from the table in database . We can also select one or more element from the top in a table . This clause tell how many rows is returned .
Syntax ->
selec
If you want to select first coulmn from a table in database then you can do with first ( ) function . It return the first column from a table .
Syntax ->
select first ( col_name ) from table_name ; // This is valid for Ms Access Database only
It work similar to Last ( ) function but it return the last column from a table in database .
Syntax
select last ( col_name ) from table_name ;
It support in Ms Access Database . But for other database there is different statement for Last ( ) fu
If we want to give temporarily name to a table then we can do easily with " as " statement .
Sometime permanent name of table is very confusing so we need temporary name of table to make easy understanding .
Syntax
select old_col_name as new_col
Joins
Joins in SQL are nothing but a technique to join the two table based on a common field.
OrderID CustomerID OrderDate
10308 2 1996-09-18
10309 37 1996-09-19
10310 77 1996-09-20
CustomerID Cust
In SQL Database " In " is used as a operator. It help user to reduce the " OR " statements, means In operator avoid multiple statements .
It is used withe select , insert , update or delete statements only .
Advantage ->
It reduce the " or " opera
Using Delete statement we can delete the record from a table in database . We can delete single or multiple row from a table in database .
Syntax :
delete from table_name where clause ; // where clause is optional
Example :
Table name : Employee
SQL Cross means cartesian product of the rows of two or more tables . It return all the rows of the table when each row of the first table combined with the each row of the second table . It is also known as cartesian or cross join .
Cross Join can b
SQL Length ( ) function is used to get the length of the string .
In MySQL : Length ( ) ;
In Oracle : Length ( ) ;
In SQL : Len ( ) ;
Syntax :
select len ( column_name ) from table_name ;
Example :
Table name : Employee_Info
Id Employ
