Functions in Mysql
Functions in Mysql
Usage Example:
SELECT CURDATE();
2. NOW()
Usage Example:
SELECT NOW();
3. DATE()
Usage Example:
4. YEAR()
Usage Example:
5. MONTH()
Usage Example:
6. DAY()
Usage Example:
I. SUM():
Calculates the total sum of a numeric column.
II. AVG()
IV. MIN()
V. COUNT()
OPERATIONS ON RELATIONS :
1.UNION
In MySQL, the UNION operator is used to combine the result
sets of two or more SELECT queries into a single result set.
This operation is particularly useful when you need to
aggregate results from multiple queries that have similar
structures.
2.INTERSECTION
In MySQL, there is no direct INTERSECT operator to find the
intersection of two result sets. However, you can achieve the same
result using other SQL constructs. Here are some methods to simulate
the INTERSECT operation in MySQL:
You can use INNER JOIN to find the common rows between two
tables based on a shared column.
3.Inner join
The INNER JOIN keyword selects records that have matching
values in both tables.