SELECT
Add two numbers
SELECT 2+2;
?column? ---------- 4 (1 row)
SELECT Framework
SELECT FROM ;
SELECT points to the required columns
FROM indicates where these columns are located
; indicates that the SQL query needs to be executed
count()
To calculate the number of rows that satisfy a certain condition, you can use count()
Example: determine how many bicycles of the brand Stels are available in the bicycles table
SELECT count(*) FROM bicycles WHERE manufacturer='STELS' and status LIKE '%ACTIVE%';
count ------- 476 (1 row)
Article author: Andrei Olegovich