Structured Query  Language (SQL)

N5 SQL Cheat Sheet

SQL Cheat Sheet.pdf

What is SQL?

Structured Query Language (SQL) is a language that is used to interrogate a database. All this means is that you use SQL to perform operations on the database.

If you have used programs such as Microsoft Access these can be known as a Relational Database Management System and they are simply a front end that generates SQL behind the scenes. In this book we will be using the SQL syntax from MySQL.

SQL Operations

At National 5 you are expected you to be able to write and explain SQL commands to perform the following operations.

Searching and Sorting 

Editing a database is when new details are added to the database or existing details are changed. 

Searching a database simply involves finding a particular set of information from the database, for example everyone whose surname is Smith. It is possible that a search will return zero results.

Sorting a database is the act of organising the database into another order, for example in ascending alphabetical order by surname from A to Z or in descending order by age from oldest learner to the youngest learner.

Select Statements - Quick Tutorials

1 Sorting.mp4

Sorting Tutorial

Covers basic sorting of a table. 

Select Statements - 1 Table and 2 Tables

2 SQL SELECT 1 TABLE.mp4

SELECT Statements - 1 Table

This video covers the user of SELECT statements to return data from a single table. For more info see below:

3 SQL SELECT JOINS.mp4

SELECT Statements - 2 Tables 

This covers how to use a SELECT statement when using more than one table. For more info see below:

Insert Statements

4 INSERT Statements.mp4

SQL Insert Statements

This video will cover how to INSERT new rows into a table.

For more info see below:

Update and Delete Statements

5 SQL UPDATE.mp4

SQL Update Statements

This video will cover how to use an UPDATE statement to change existing rows within a table.

For more info see below:

6 SQL DELETE.mp4

SQL Delete Statements

This video will demonstrate how to use a DELETE query to remove rows from a table.

For more info see below: