Skip to content

Information Technology · Ch 3 — Relational Database Management System

Introduction to MySQL and SQL

6

Introduction to MySQL and SQL

MySQL is a popular, open-source Relational Database Management System. Being open-source means it is free to download and use, which is one reason it is widely used both for learning and in real websites and businesses. MySQL stores data as related tables and is operated using SQL.

SQL (Structured Query Language) is the standard language used to create and work with data in a relational database. Instead of writing a long program, you write short SQL statements that tell the DBMS what you want, and the DBMS does it. SQL is based on an international standard; the version most textbooks (including this course) follow is ANSI SQL-99 — the 1999 standard agreed by the American National Standards Institute (ANSI). Because SQL is a standard, the statements you learn on MySQL work, with only small differences, on Oracle, SQL Server and other relational systems too.

By convention, SQL keywords are written in capital letters, and every statement ends with a semicolon (;). SQL is not case-sensitive for keywords (SELECT and select mean the same), but it is neater to keep to capitals.

The commands of SQL are grouped into sub-languages according to the job they do:

  • DDL (Data Definition Language) — commands that define or change the structure of the database and its tables: CREATE, ALTER, DROP. (For example, creating a table or adding a new column.)
  • DML (Data Manipulation Language) — commands that work with the data inside the tables: INSERT (add data), UPDATE (change data), DELETE (remove data). The SELECT command, used to read data, is also usually studied together with DML as the querying part of the language. …
Definition 1MySQL

A popular open-source (free) Relational Database Management System that stores data as related tables and is …

Definition 2SQL (Structured Query Language)

The standard language used to define, add, change, retrieve and control data in a relational database; the version followe …

Definition 3DDL and DML

DDL (Data Definition Language: CREATE, ALTER, DROP) defines the structure of the database and tables; DML (Data Manipulation Language: INSERT, UPDATE, DELETE, and SELECT for querying) work …