Understanding the SQL as a Newbie

Nnaemeka Obodozie
Analytics Vidhya
Published in
2 min readJul 26, 2021

Hearing the word SQL (sequel ) to a large group of people still sound intimidating. To some group, it is a common term we hear basically when at work or want to describe a database, but to a layman, SQL is some buzzword that needs detailed explanation.

So what then is SQL?

It is called Structured Query Language. It is a language specially designed for managing data held in a Database.

A database is an organized collection of data, generally stored and processed electronically. An example is a relational database Management System (RDBMS like Mysql, Postgre, SQLite,& SQL server . ) and a NoSQL database system (NoSQL like MongoDB, Redis, Cassandra.)

What types of database do we have? Usually, in a Relational database, the data are stored in a relational table, known as schema. In NoSQL, the data is stored in other data forms like JSON. This has key-value pairs creating the ability of nesting values at any point.

How is SQL downloaded?

The installation of any of the above-listed example is possible for all known computing machines we have currently like Windows, Mac and Linux Os. We will recommend a free and popular relational database management software like MySQL, SQLite, and Microsoft Server. The download steps of My SQL are found Here for all Machines.

Accessing the MySQL server.

After successful installation on your machine. It is advised to use a graphical user interface (GUI) to go into the server. This is possible using the Microsoft server management studio or installing a Postgres server, finally SQLite on your machine. Connecting to the database is also possible using command prompt (CMD) or Terminal (macOS).

Commands in SQL

The commands in SQL includes Data Definition Language(DDL), Data Manipulation Language (DML), and finally Data Control Language(DCL).

The Data Definition Language (DDL) is a language used to define the schema of a database. good example is CREATE, ALTER and DROP.

DROP TABLE IF EXIST customer;CREATE TABLE customer(
customer_id INT ,
execution_time DATETIME,
direction VARCHAR(6),
execution_size FLOAT ,
execution_price FLOAT ,
instrument_id INT
);

Data Manipulation Language (DML) is focused on manipulating the data in the database. They are SELECT, UPDATE and DELETE.

SELECT customer_id, SUM(execution_price * executuion_size) as size from customer group by customer_id order by size desc limit 5;

While Data Control Language(DCL) includes commands that grant rights and other control functions to the database. This includes GRANT AND REVOKE.

This article covers only the introductory part of SQL. the knowledge here is mare foundational. To learn further, a recommendation to further reading listed below.

  1. https://www.w3schools.com/sql/sql_intro.asp
  2. https://www.tutorialrepublic.com/sql-tutorial/
  3. https://www.dataquest.io/blog/sql-basics/

--

--

Nnaemeka Obodozie
Analytics Vidhya

I am passionate about Data science, Artificial intelligence and futuristic Technology. ‘Using this tools to help us humans live efficiently on earth and Mars.’