Popular SQL functions
SQL (Structured Query Language) is a powerful tool for managing and manipulating relational databases. There are many built-in functions available in SQL that allow you to perform various operations on data. Here are some of the popular SQL functions:
1. SELECT : Used to retrieve data from one or more tables.
2. WHERE : Allows you to filter rows based on a specific condition.
3. ORDER BY : Sorts the result set based on one or more columns.
4. GROUP BY : Groups rows based on one or more columns.
5. COUNT() : Counts the number of rows or non-null values in a column.
6. SUM() : Calculates the sum of numeric values in a column.
7. AVG() : Calculates the average of numeric values in a column.
8. MAX() : Retrieves the maximum value from a column.
9. MIN() : Retrieves the minimum value from a column.
10. DISTINCT : Removes duplicates from the result set.
11. JOIN : Combines rows from two or more tables based on a related column.
12. LIKE : Used in conjunction with the % wildcard to perform pattern matching in strings.
13. IN : Tests if a value matches any value in a list.
14. BETWEEN : Checks if a value falls within a range.
Recommended by LinkedIn
15. CASE : Performs conditional logic within a query.
16. COALESCE() : Returns the first non-null value from a list of expressions.
17. NULLIF() : Returns NULL if two expressions are equal; otherwise, returns the first expression.
18. CONCAT() : Concatenates two or more strings together.
19. UPPER() / LOWER() : Converts a string to uppercase or lowercase, respectively.
20. DATE Functions : SQL provides various date functions like DATE(), YEAR(), MONTH(), DAY(), etc., for working with date values.
21. CURDATE() / CURTIME() : Returns the current date or time.
22. GETDATE() / SYSDATETIME() : Retrieve the current date and time in different database systems.
23. DATEDIFF() : Calculates the difference between two dates.
24. DATEADD() : Adds a specified time interval to a date.
25. LEN() / LENGTH() : Returns the length of a string.
26. SUBSTRING() / SUBSTR() : Extracts a portion of a string.
27. ROUND() : Rounds a numeric value to a specified number of decimal places.
28. CAST() / CONVERT() : Converts a data type to another data type.
Please note that the availability of these functions may vary depending on the specific database management system you are using (e.g., MySQL, PostgreSQL, SQL Server, Oracle, etc.). Additionally, some databases may have vendor-specific functions not listed here.