Class 12 SQL Notes Detailed
Class 12 SQL Notes Detailed
1. Math Functions
1.2 ROUND(x, d): Rounds the number x to d decimal places. Useful for formatting results.
1.3 MOD(x, y): Returns the remainder of x divided by y. Used for divisibility or alternating rows.
2. Text/String Functions
2.3 MID(text, start, length) / SUBSTRING(text, start, length): Extracts part of a string from a given position.
2.5 LEFT(text, n): Returns first n characters from the left side.
Class 12 SQL Notes - Full Topic Guide
2.6 RIGHT(text, n): Returns last n characters from the right side.
3. Date Functions
Date functions are used to manipulate and extract information from date values.
4. Aggregate Functions
Aggregate functions are used to calculate a single value from a group of rows.
Example: MAX(marks)
Example: MIN(marks)
Example: AVG(marks)
Example: SUM(marks)
Example: COUNT(name)
Example: COUNT(*)
Example:
Example:
SELECT city, COUNT(*) FROM students GROUP BY city HAVING COUNT(*) > 2;
Example:
Equi-Join is used to retrieve data from two or more tables using a common column.
Example:
Query: