SQL Basics

Structured Query Language (SQL) is the common scripting language for most relational databases. SQL is different from another computer languages like JavaScript or PHP in two important ways.

  1. SQL has a relatively few commands
  2. SQL is a declarative language

Compared to JavaScript or PHP, SQL is has a very small command base. In fact, most of what SQL needs to do, can be accomplished with only dozen commands. SQL is also a declarative language. Unlike a programming language, like JavaScript and PHP, you do not provide the computer step by step instructions on how to accomplished a task. Instead you tell you computer what you want and the computer will figure out how to best get it.

There are four basic tasks that used when working with databases. These tasks can be remembered with the acronym C.R.U.D, which stands for Create Read Update and Delete. Using SQL you can create or add new data, you can read or view the data, you can update or change the data, and you can delete or remove the data.

In SQL these tasks are accomplished with INSERT, SELECT, UPDATE, and DELETE commands.