Basic SQL Query Syntax
SELECT (attribute list) FROM (table list) [WHERE (condition)] [GROUP BY (grouping attributes)] [HAVING (group condition)] [ORDER BY (attribute list)]
Note: The SELECT and FROM clauses are mandatory.
- The SELECT clause lists the attributes to be retrieved.
- The FROM Clause specifies all tables
- The WHERE clause specifies the conditions for the selection of records from these tables, including joint conditions.
- GROUP BY specifies grouping attributes
- HAVING specifies a condition for the retrieval of groups.
Various COUNT, SUM, MIN, MAX, and AVG can be in conjunction with grouping. ORDER BY specifies an order for displaying the result of a query.
SQL Full Form
SQL stands for Structured Query Language and is used to manage and manipulate relational databases. SQL provides a standardized way to interact with databases, allowing users to create, retrieve, update, and delete data efficiently. SQL commands are used to perform various operations on databases.