Understanding SQL Basics, DBMS, Concepts, and Derived Columns
Conquer SQL: From Zero to Resume — Part 1
SQL = Structured Query Language
Contents
What is SQL
SQL is the language for performing data manipulation on a database.
- Data Manipulation — CRUD
- Create
- Read
- Update
- Delete
What is DBMS
DBMS = DataBase Management System
Through a DataBase Management System, SQL can “automate” and “scale” data operations for CRUD (Create, Read, Update, Delete) on the database.
😸😸😸😸😸😸😸😸😸😸😸😸😸😸😸😸😸😸😸😸😸😸😸😸
- Categories of DBMS:
- RDBMS = Relational DataBase Management System
- NoSQL DBMS = Not only SQL DataBase Management System
- Common RDMS
- Oracle Database
- Microsoft SQL Server
- IBM DB2
- Open source — SQLite
- Open source — MySQL
- Open source — PostgreSQL
The following record of SQL learning progress uses the open-source SQLite.
Get Mini Cactus’s stories in your inbox
Join Medium for free to get updates from this writer.
The data tables stored in a database have a two-dimensional data structure:
- The first dimension is referred to as observations (Rows).
- The second dimension is referred to as variables (Columns).
How to build a concept of SQL
There are four key concepts of SQL:
SELECT … FROM …Select from a table using SELECT and FROM— — or /*……*/Adding comments in SQLASAssigning aliases to columns in query resultsDISTINCTDisplaying unique values in query results
Two ways to Add comments in SQL
- Single-line Comment:
-- comments
- Multi-line Comment:
/*
...comments
...comments
...comments
*/How to make derived calculated columns in SQL
In addition to specifying column positions of data tables after SELECT, commonly used constant types include:
- Integer (INTEGER)
- Floating-point numbers with decimals (REAL)
- Text enclosed in single or double quotes (TEXT)
- Null or missing values (NULL)
Basic Numerical Operators
Numerical Operator: Description
+ : Addition
- : Subtraction
* : Multiplication
/ : Division
% : Modulus(Remainder)
(): Parentheses(Precedence)- Note: When using
/to divide two integers, note that the resulting derived field will still be of integer type. If you want the derived field to be floating-point, add a decimal point to either the numerator or the denominator.
Basic Text Operators
||: Two vertical bars (can be entered using Shift + \) are used to concatenate text.








