100 Days of SQL


Day 48 – SQL Keywords

SQL keywords are reserved words that have a specific meaning in the SQL language and cannot be used for other purposes, such as column or table names. Some common SQL keywords include:

  • SELECT: used to retrieve data from one or more tables
  • FROM: used to specify the table(s) from which data is being retrieved
  • WHERE: used to filter data based on specified criteria
  • JOIN: used to combine data from two or more tables based on a common column(s)
  • INSERT: used to insert new data into a table
  • UPDATE: used to update existing data in a table
  • DELETE: used to delete data from a table
  • GROUP BY: used to group data based on one or more columns
  • ORDER BY: used to sort data based on one or more columns
  • HAVING: used to filter data based on specified criteria after a GROUP BY clause

In addition to these keywords, each SQL implementation may have its own set of additional keywords and syntax rules. For example, MySQL has additional keywords such as LIMIT and OFFSET for limiting the number of results returned, while SQL Server has keywords such as TOP for achieving the same functionality.

It is important to use SQL keywords correctly in order to write valid and efficient SQL queries. Some common mistakes when using SQL keywords include using reserved words as column or table names, misspelling keywords, and using keywords in the wrong order or context.