SQL 1: Terminology
Database, Structured Query Language, Relational vs Non Relational Database, SQL Queries, etc.
“If you don’t know SQL, no sane company will hire you” - Mike West. Congrats, by reading this post, you now know more about SQL than most people enrolled in BootCamps. You’re on your path to actually having a real shot at getting hired.
Unless you work in the data engineering side of things, you will focus on how to manipulate data using SQL. That’s what the beginner section will focus on.
If you are completely new to SQL, you can use a simple tool such as Online SQL Compiler. It’s nice because it’ll color in some of the clauses for you, and fill in some code for you.
If you are comfortable in your SQL skills, you can use the SQLDF library in R. In here, the variables you create are tables, and you can execute simple sql code, and just get some nice practice in.
Table of Contents
Database
Structured Query Language
Relational vs Non-Relational Databases
SQL Queries
Transactions
Statements
DDL, DML, TLC
Data Definition Language
Data Manipulation Language
Transaction Language Control
Exercises
Let’s begin.
1 - Database
In simple English, a database can be anything that gathers, and consolidates data.
In the real world, when someone is referring to a Database, they usually mean a Relational DataBase Management System (RDBMS). RDMS is a database, that stores 1 or more tables. Here is a simple image of how SQL communicates with a RDBMS.
2 - Structured Query Language
To communicate with the database, we need to use a simple language that it understands. Structured Query Language (SQL) is a popular language that is used to communicate with several RDBMS.
SQL lets a user create some code. Then use this to query the database, and it lets you pull the entries that you were after.
You can think of this as a simple file cabinet:
Database = File Cabinet
Drawer = Table
Folders = Rows (Entries)
Of course, we also have queries you can send to the file cabinet to create more folders (rows), and drawers (tables).
Keep reading with a 7-day free trial
Subscribe to Data Science & Machine Learning 101 to keep reading this post and get 7 days of free access to the full post archives.