Clauses & mysql function

 


1. SELECT Clause:Retrieves data from one or more tables.

2. FROM Clause:Specifies the source table(s) for the data retrieval.

3. WHERE Clause:Filters rows based on specified conditions.

4. GROUP BY Clause: Groups rows for aggregate calculations.

5. HAVING Clause: Filters groups based on aggregate values.

6. ORDER BY Clause: Sorts results in ascending or descending order.

7. LIMIT Clause: Limits the number of rows returned in the result set.

8. DISTINCT Clause: Retrieves distinct values from a column.

9. JOIN : Combines data from multiple tables based on specified conditions.

10. INNER JOIN : Retrieves matching rows from both tables.

11. LEFT JOIN : Retrieves all rows from the left table and matching rows from the right table.

12. RIGHT JOIN : Retrieves all rows from the right table and matching rows from the left table.

13. FULL OUTER JOIN : Retrieves all rows from both tables with matching rows where available.

14. UNION : Combines result sets from multiple SELECT statements.

15. INSERT INTO : Adds new rows to a table.

16. UPDATE : Modifies existing rows in a table.

17. DELETE FROM : Removes rows from a table.

18. CASE : Performs conditional operations within SELECT statements.

19. WHEN : Specifies conditions for a CASE expression.

20. THEN : Specifies values to be returned in a CASE expression.

21. ELSE : Specifies a value to be returned if no conditions match in a CASE expression.

22. AS : Renames a column or table in the result set using an alias.

23. ON : Specifies join conditions for JOIN operations.

24. BETWEEN : Checks if a value is within a specified range.

25. LIKE : Searches for a specified pattern in a column.

26. IN : Checks if a value matches any value in a list.

27. IS NULL : Checks for NULL values.

28. IS NOT NULL : Checks for non-NULL values.

29. EXISTS : Checks for the existence of rows in a subquery.

30. NOT EXISTS : Checks for the absence of rows in a subquery.

31. ORDER BY : Sorts the result set based on specified columns.

32. ASC : Specifies ascending order for sorting (default).

33. DESC : Specifies descending order for sorting.

34. COUNT : Calculates the number of rows or non-NULL values.

35. SUM : Calculates the sum of numeric values.

36. AVG : Calculates the average of numeric values.

37. MIN : Retrieves the minimum value from a column.

38. MAX : Retrieves the maximum value from a column.


This list covers many of the commonly used clauses in MySQL queries. Each of these clauses plays a specific role in constructing SQL statements to retrieve, manipulate, and manage data within a database.


Post a Comment

Previous Post Next Post