Basic SQL syntax (another keywords that accompanies the SELECT command)

On the First tutorial Basic SQL Syntax i have write Generally keywords that accompanies the SELECT command. Here i write another keywords that we can use in SELECT command.

  • LIMIT
    This command is used to limit the results that returned from the SELECT command.
  • LIKE
    This command is used to match the requested value from the database table.

Aggregate Functions :

  • AVG()
    This syntax is used to calculate the average amount of a particular column in a database.
  • COUNT()
    This syntax use to count the number of records in a group of records.
  • MAX()
    This syntax is used to find the greatest value in a particular column in a database.
  • MIN()
    The opposite of MAX, this syntax is used to find the smallest value in a particular column in a database.
  • SUM()
    This syntax is used to calculate the sum of all values that are in a field.

Here for the example :

SELECT * FROM your_table LIMIT 0, 10
//This will SHOW 10 row of your TABLE start FROM row 1 TO 10.
SELECT * FROM your_table LIMIT 10, 10
//This will SHOW 10 row of your TABLE start FROM row 11 TO 20.
SELECT * FROM your_table WHERE your_column LIKE %'value'%
//This will SHOW ALL row FROM your COLUMN that contain the value.
1
2
3
4
5
SELECT AVG(your_column) FROM your_table
SELECT COUNT(your_column) FROM your_table
SELECT MAX(your_column) FROM your_table
SELECT MIN(your_column) FROM your_table
SELECT SUM(your_column) FROM your_table