SQL cheat for beginners
- Ruby Ihekweme
- Aug 10, 2022
- 1 min read
Updated: Aug 25, 2023
Here are some SQL cheat that could help beginners understand SQL statements.
Aggregate functions, logical operators and constraint.
Data Query Language
SELECT
Important statements
WHERE, DISTINCT, LIMIT, ORDER BY, DESC, ASC, GROUP BY
Average functions
AVG, COUNT, MAX, MIN, SUM
Logical operators
AND, OR, BETWEEN, ANY
Constraints
NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY
All these are used together to write SQL code. Now give this quick example
select * from actor
This means select all records/column in actor table.[* stands for all records]
select actor_id, name from actor
This means select column actor_id and name in actor table.
These are just words, add them together with the right operators and boom! you have your code running.
If you are new to coding, remember you can't learn all the syntaxes in a day. Start with SELECT and take the next syntax and with time, you can start writing more and more lines of code.
Comments