Dbmsunit2 Setop (It)
Dbmsunit2 Setop (It)
● String Functions
● Numeric Functions
● Date and Time Functions
SELECT
LOWER(‘GEEKSFORGEEKS’) AS
LOWER() Returns the argument in
3. “LowerName1”,
/LCASE() lowercase
LOWER(‘Geeks For Geeks’) AS
“LowerName2” ;
1. SELECT SUBSTR(‘ABSDEFG’,
SUBSTRING() Returns the substring as 3, 4) “Subs” ;
4.
, SUBSTR() specified 2. SELECT SUBSTR(‘ABCDEFG’,
-5, 4) “Subs” ;
SELECT UPPER(‘Large’)
UPPER()/UCA “Uppercase” ;
5. Converts to uppercase
SE() or SELECT UCASE(‘Large’)
“Uppercase”;
CURDATE()/
1 CURRENT_DATE()/ Returns the current date. SELECT CURDATE() ;
CURRENT_DATE
o The SQL Union operation is used to combine the result of two or more SQL SELECT
queries.
o In the union operation, all the number of datatype and columns must be same in
both the tables on which UNION operation is being applied.
o The union operation eliminates the duplicate rows from its resultset.
Syntax
1. SELECT column_name FROM table1
2. UNION
3. SELECT column_name FROM table2;
Example:
ADVERTISEMENT
ID NAME
1 Jack
2 Harry
3 Jackson
ID NAME
3 Jackson
4 Stephan
5 David
ID NAME
1 Jack
2 Harry
3 Jackson
4 Stephan
5 David
2. Union All
Union All operation is equal to the Union operation. It returns the set without removing
duplication and sorting the data.
Syntax:
ID NAME
1 Jack
2 Harry
3 Jackson
3 Jackson
4 Stephan
5 David
3. Intersect
o It is used to combine two SELECT statements. The Intersect operation returns the
common rows from both the SELECT statements.
o In the Intersect operation, the number of datatype and columns must be the same.
o It has no duplicates and it arranges the data in ascending order by default.
Syntax
Example: