DATA with BARAA

SELECT Statement

SQL statement/Query/Command is used to perform tasks such as retrieve data or update data on databases.

The script in our example is SELECT Statement, other call it Query or SELECT command.

.

The most important SQL commands/statements are:

  • SELECT  the first thing you’ll do, you choose the columns you want to be retrieved from the database.
  • FROM  – as next you need to specify at least one table where your data is stored.
  • JOIN – if your data is stored in several tables, then you can join the two or more tables in one SQL statement.
  • WHERE – is used to filter rows, returning only those that meet specified conditions.
  • GROUP BY – It is an aggregation function to group rows together by common column value.
  • HAVING – it is similar to WHERE but it works together with GROUP BY  to filter the aggregated values.
  • ORDER BY – is used to display the result in a specific order.
  • LIMIT – is used to restrict how many rows are returned. In our example, it limits the result to the top two rows.
.
Share it !