Advanced Database – Structured Query Language (SQL)

Structured Query Language (SQL) is used to manage data within a database.

It uses relational algebra to create commands that retrieve or maintain the data.

Some examples of commands are CREATE – to create tables, RENAME – to rename tables, SELECT – to select data records, INSERT – to insert data records and DELETE – to delete data records.

2 SQL Con

To see examples of SQL code, open the database ‘Company Employees’ (created in module 1 or available for download).

Right click on one of the queries, and select ‘Edit in SQL mode’

This brings up a new window displaying the SQL code for that query, with the commands highlighted in blue text.

The main use for SQL is in querying databases to retrieve information.

All queries created in LibreOffice Base use SQL, even ones created in design mode.

The average user won’t need to use SQL code, it’s mainly used when dealing with highly complex queries or to write entire systems.

It’s useful to know about it, but you don’t need deep understanding for this module.