Relational databases consist of tables and relationships between them to retrieve data. A query that takes parts of data from different tables and performs a transformation on the result is called an SQL query.
- Tables in the database (Access/PostgreSQL/Oracle) can be created not only by the program editor, but also using the structured query language SQL
- SQL has little in common with object-oriented programming languages, but is more akin to Python, as it has many mathematical functions
- It's used only in databases, it will be difficult to just hone it on tasks "from the top of your head", a simulator is desirable
I learned SQL myself without teachers at university. You can use open sources to learn it!
There are entire reviews about which SQL trainer is more convenient, but I recommend sqlbolt
. About 20 topics with theory and about 80 tasks for consolidation, without which the program will not let you go further. Very thoughtful!
SELECT column, another_column,
FROM mytable
WHERE condition(s)
ORDER BY column ASC/DESC;
Simple code with data filtering and ascending/descending sorting. As in Python, use Tab
and Enter
to navigate through parts of the code, SQL likes structured writing.
SELECT *
FROM mytable
WHERE condition(s)
ORDER BY column ASC/DESC
LIMIT num_limit OFFSET num_offset;
Additional limitation - the number of records is less than the Limit
. Often used for large data, with the number of records >100. I provide simple test examples to understand the structure of the language.
The simplest SQL at the first stage contains the usual mathematical logic and aggregate functions (SUM
, COUNT
, others). Similar to Excel in essence, but there are pleasant difficulties in taking into account all the selection conditions and "pitfalls" of working with different types of data in the table.
Top comments (0)