DEV Community

Cover image for GETTING STARTED WITH THE SQL JOURNEY
John Kyalo
John Kyalo

Posted on

GETTING STARTED WITH THE SQL JOURNEY

Structured query language is it, and basically, it is the language for communicating with Relational databases such as MySQL and SQLSERVER.
With its ease syntax it gets no minute into understanding the fundamentals. In the past 2 weeks I have had a look or rather a deep dive into the introduction of SQL and quite a lot has been helpful in the learning.
I installed MySQL and chose Popsicle as the text editor to write the queries...It is actually a cool tool to use. I went from getting to CREATE a database to actually querying every bit of its data. Of course, tables are involved, structured into columns and rows.
Constraints in SQL, got to see how you can specify rules for the data that goes in my tables. Some of the common constraints include:
PRIMARY KEY - unique value that identifies each row in a table
FOREIGN KEY - basically a primary key in another table. You refer to it by the term REFERENCE.
NOT NULL - can't leave an empty value for your columns.
UNIQUE - a different value that doesn't match any other in that particular column.
DEFAULT - set a default value for a column if no value specified.

Moving on I got to interact with a couple SQL Queries. This goes from:
INSERT INTO - feeds data into tables.
SELECT FROM - retrieves data from tables.
UPDATE - modify data in a table.
DROP
DELETE FROM
and so forth
A lot of SQL, from the word jump I have realized it's all about the keywords, understand your tables or rather data then fetch it using the appropriate keyword.
I also got to use most of the keywords which include:
WHERE: a specification
ORDER BY: does sorting whether in ascending or descending order.
GROUP BY: groups rows with the same values into summary rows.
AS: for aliases
DISTINCT: all different values, what actually exits

Functions too especially aggregate functions such as COUNT(), SUM(), AVG(), MAX(), MIN()

Moving to JOINS, UNIONS, NESTED queries this SQL gets more interesting for a fact.

Getting to all of this and even more which I left out was way appealing. Pulling all kind of information, you require from modelled data is actually satisfying.

I now keep it on get hands all dirty on and uncovering more of SQL.

Datanerd

DATA ANALYST

Top comments (0)