KEMBAR78
Mysql File | PDF | Division (Mathematics) | String (Computer Science)
0% found this document useful (0 votes)
21 views16 pages

Mysql File

My SQL file Class 12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views16 pages

Mysql File

My SQL file Class 12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

A) POWER( )

SYNTAX : SELECT POW (m,n) ;


OR
SELECT POWER (m,n) ;
HERE m is the number and n is power raised to number m .

EXAMPLE :

b) ROUND ( )
SYNTAX : SELECT ROUND (x,d) ;
HERE x is the number to be rounded off and d is number of decimals to be returned .

EXAMPLE :
c) TRUNCATE( )
SYNTAX : SELECT TRUNCATE (x,d) ;
HERE x is the number to be truncated and d is number of decimals to be returned .

EXAMPLE :

d) MOD( )
SYNTAX : SELECT MOD (dividend, divisor) ;
HERE dividend is expression to divide by divisor

EXAMPLE :

e) SQRT( )
SYNTAX : SELECT SQRT (value) ;
EXAMPLE :

f) ABS( )
SYNTAX : SELECT ABS (value) ;
EXAMPLE :

a) ASCII ( )
SYNTAX : SELECT ASCII (character) ;
EXAMPLE :
b) LOWER( ) / LCASE( )
SYNTAX : SELECT LOWER (String) ;
OR
SELECT LCASE (string) ;
EXAMPLE :

c) UPPER( ) / UCASE( )
SYNTAX : SELECT UPPER (String) ;
OR
SELECT UCASE (string) ;
EXAMPLE :

d) LENGTH( )
SYNTAX : SELECT LENGTH (String) ;
EXAMPLE :

e) REPLACE( )
SYNTAX : SELECT REPLACE (‘String1’,‘String2’,‘String3’);
HERE String1 is original string in which we want replacements string2 which we
want to search in string1 , string3 with which we replace string 2

EXAMPLE :
f) LEFT( )
SYNTAX : SELECT LEFT (String , Integer);
EXAMPLE :

g) RIGHT( )
SYNTAX : SELECT RIGHT (String , Integer);
EXAMPLE :

h) LTRIM( )
SYNTAX : SELECT LTRIM (String);
EXAMPLE :

i) RTRIM( )
SYNTAX : SELECT RTRIM (String);
EXAMPLE :

j) TRIM( )
SYNTAX : SELECT TRIM (String);
EXAMPLE :
k) REVERSE( )
SYNTAX : SELECT REVERSE (String);
EXAMPLE :

l) REPEAT( )
SYNTAX : SELECT REPEAT (String, Integer);
EXAMPLE :

m) SUBSTRING( ) / MID( ) / SUBSTR( )


SYNTAX : SELECT SUBSTRING (String, start_index ,length); OR
SELECT SUBSTR (String, start_index ,length); OR
SELECT MID(String, start_index ,length);

n) INSTR( )
SYNTAX : SELECT INSTR (String , Substring);
EXAMPLE :

SYNTAX : SELECT CONCAT (String1 , String2…String n);


EXAMPLE :

a) CURDATE( ) / CURRENT_DATE( )
SYNTAX : SELECT CURDATE (); OR SELECT CURRENT_DATE ();
EXAMPLE :

b) NOW( )
SYNTAX : SELECT NOW();
EXAMPLE :

c) SYSDATE( )
SYNTAX : SELECT SYSDATE();
EXAMPLE :

d) DATE( )
SYNTAX : SELECT DATE(date-time expression);
EXAMPLE :
e) MONTH( )
SYNTAX : SELECT MONTH(date-time expression);
EXAMPLE :

f) YEAR( )
SYNTAX : SELECT YEAR(date-time expression);
EXAMPLE :

g) DAYNAME( )
SYNTAX : SELECT DAYNAME(date-time expression);
EXAMPLE :

h) DAYOFMONTH( )
SYNTAX : SELECT DAYOFMONTH(date-time expression);
EXAMPLE :

i) DAYOFWEEK( )
SYNTAX : SELECT DAYOFWEEK(date-time expression);
EXAMPLE :
j) DAYOFYEAR( )
SYNTAX : SELECT DAYOFYEAR(date-time expression);
EXAMPLE :

k) MONTHNAME( )
SYNTAX : SELECT MONTHNAME(date-time expression);
EXAMPLE :
SYNTAX : SELECT COUNT (COLUMN_NAME) FROM <TABLE_NAME>;

SYNTAX : SELECT COUNT(DISTINCT column_name) FROM <table_name>;


SYNTAX : SELECT <column-list> FROM <table_name> [where <condition>]
ORDER BY <column_name> [ASC | DESC];

SYNTAX : SELECT <column1, column2,…column_n>,


<aggregate_function (expression)> FROM <table>
where <conditions>
GROUP BY <column1>,<column2>,….<column_n>;

SYNTAX : SELECT <column1, column2,…column_n>,


<aggregate_function (expression)> FROM <tables>
where <conditions>
GROUP BY [<column1>,<column2>,….<column_n>]
HAVING [<condition1….condition_n>];
TABLE :STUDENTS TABLE:TECHNOGROUP

i) UNION ( U )
SYNTAX :SELECT * FROM <table1> UNION SELECT * FROM <table2> ;

ii) INTERSECTION ( )
SYNTAX :SELECT * FROM <table1> INTERSECT SELECT * FROM <table2> ;

iii) SET DIFFERENCE / MINUS (-)


SYNTAX :SELECT * FROM <table1> EXCEPT SELECT * FROM <table2>
a) CARTESIAN PRODUCT (CROSS JOIN)
SYNTAX : SELECT * FROM <table1> CROSS JOIN <table2>; OR
SELECT * FROM <table1> , <table2>;

b) EQUI JOIN
SYNTAX : SELECT <column1>,<column2>,…* FROM <table1> , <table2>
Where <table1.Primary key column> = <table2.foreign

key column>;

c) RIGHT OUTER JOIN


d) NATURAL JOIN
SYNTAX : SELECT * FROM <table1> NATURAL JOIN <table2>;

e) INNER JOIN
• NAME – AYUSH RAJ
• CLASS – XII NON-MED
• ROLL NO – 4
• SUBJECT – INFORMATICS
PRACTICES
• SUBMITTED TO – MRS MONIKA
MEHRA

You might also like