Quick review on SQL

This section provides a brief overview of SQL. For a complete course on SQL, please refer to the resources.

* SQL Data Types

* SQL Commands:

  1. SELECT

  2. WHERE

  3. AND, OR, NOT

  4. ORDER BY

  5. CREATE DATABASE

  6. DROP DATABASE

  7. CREATE TABLE

  8. DROP TABLE

  9. INSERT INTO

  10. JOINS

Data Types

Numerous data types are available depending on the software you use. However, we will focus on a few of the commonly used data types in MySQL.

  • VARCHAR(size) : this is used to store character strings of variable length. The "size" parameter specifies the max length of the string that can be stored in the column

  • INTEGER: used to store whole numbers (positive or negative) without decimal points.

  • DATE - used to store date values.

  • BOOLEAN - used to store true/false values.

  • DECIMAL - used to store exact numeric values with decimal points.

  • FLOAT - used to store approximate numeric values with decimal points.

CREATE DATABASE

This command is used to create a new SQL database

DROP DATABASE

This command is used to drop an existing SQL database

CREATE TABLE

This command is used to create a new table within a database

common constraints:

ALTER

DATES

SELECT

This command is used to select any columns from a table within a database

To select all columns

WHERE

This command is used to filter records

AND, OR, NOT

ORDER BY

Last updated