
Your data, our passion.
Snack-Sized Data Basics
SQL - Getting Started
A database can be installed directly on a computer, although the steps vary between Windows and Mac operating systems. Since installation can sometimes be tricky, let's start with an online database for now. We'll cover local installation at a later time.
We're going to use PostgreSQL via sqliteonline.com.

We will not be creating a database on sqlliteonline since it's already been created for us, but let's still go over a database creation query. We will, however, create tables in one of our next lessons.
​
The following query can be used to create a database.
CREATE DATABASE name_of_database;
​​​
​Let's break it down.
​
-
CREATE DATABASE is the SQL keyword required to create a database. I personally prefer to capitalize SQL keywords in my queries to distinguish them from user defined names. This is not required though, you can also use create database. Some systems may automatically capitalize or color keywords for better readability.​
​
-
​name_of_database is user defined. This can be whatever you'd like to call your database. It must not contain any spaces. You can use an underscore to join words, such as ​name_of_database, or capitalize the first letter of each word such as ​NameOfDatabase.
​
-
; the semi colon is not always required, but it serves as a statement terminator. If you're running a single query, you can get away without using it. However, it's a good practice to use it for consistency and to avoid errors.
To delete a database, simply use the query below. Be extremely careful when deleting a database and only use it when you're 5000% sure about deleting the entire database.
DROP DATABASE name_of_database;