
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
How to get the most out of the course
Exactly what databases and SQL are, and how they are related
Is it pronounced ess-q-el or sequel?
An introduction to the software we'll use on the course
How to install the server and CLI on Windows
How to install the Workbench GUI client on Windows
How to install the server and CLI on macOS
Additional options for running the CLI program on macOS
How to install the Workbench GUI client on macOS
How to install all the required software on Ubuntu Linux
List all databases, create new ones, and best practices for naming
Delete individual databases
Select the currently-active database
Create a table, choosing the appropriate data type for each column
What NULL values mean, and how to configure a column to accept null values. Also what the default value of a column is if we don't specify one when inserting data
How to alter a table to add more columns; the difference between signed and unsigned integers, and adding columns in specific positions using the FIRST and AFTER keywords.
How to modify existing columns, including renaming them and changing attributes like defaults
How to remove one or more columns from a table
How to rename or delete a table; avoiding errors if a table doesn't exist when removing it using IF EXISTS, how to view the details of a warning message
How to view all databases, create new ones, and delete existing ones
Using the GUI table wizard to generate the SQL to create new tables; also making sure the table is created in the correct database by setting the default schema
Editing a table name; adding and removing columns; editing columns; changing column order; deleting tables
What scripts are and how to run them in MySQL Workbench
What comments are and two ways to add them to an SQL script
Using MySQL Workbench to rename a database
Using the command-line client to rename a database
How to run a script in MySQL Workbench
Two ways to run a script in the CLI client
How to insert data into a table
Inserting records while specifying which columns to insert the data into, and how default values are used
How to insert values into a DATE column, the correct format to use, and the default if the century isn't specified
How to default a column to the current date when a record is inserted
How to default a column to the current date and time, and how to format literal time values
How to insert characters like single quotes and newline characters using escape sequences
How the database maintains data integrity by enforcing strict data types, and how some values are converted automatically when possible
How NULL defaults are handled if the column is configured not to accept NULL values
How unique constraints enforce unique values in a column. How to add and remove these constraints, optionally specifying the constraint name
Adding and removing CHECK constraints to limit the range of values in a column
How to specify constraints when creating a table, including constraints that act on multiple columns
How to specify CHECK constraints in MySQL Workbench
An example of how to run the attached script to set up the database for the rest of the lectures in this section
How to select specific columns when retrieving data, where the column names come from in the result set, and how to rename them
How to select data using MySQL Workbench
How to limit the number of rows in the result set by filtering them with a WHERE clause
How to use a WHERE clause with NULL values
How to combine multiple WHERE clauses with different operators
How to filter results comparing columns to a pattern instead of a literal value
How to use a regular expression in a WHERE clause
How to remove duplicate entries in the result set
How to include literal values and the results of expressions and functions in the resultset
How to use functions on numeric, string and date values
Using the CASE expression to return different values based on conditions
How one query can be used inside another
Using subqueries to create new tables and insert data into an existing table
Updating one or more columns of existing records, with optional filters using WHERE clauses
Automatically setting a column to the current date and time when a record is updated
Deleting one or more records from a table, filtering with a WHERE clause
Two methods to delete all the records from a table
The basics of how transactions work to allow actions to be undone
How to make sure all operations in a group run or none of them do (ACID: Atomicity, Consistency, Isolation, and Durability)
Learn the fundamentals of databases and SQL, from scratch, step-by-step. In this hands-on course, you’ll learn everything from the basics of SQL syntax to advanced query techniques. You'll do this with practical examples, quizzes, and coding exercises.
Learn and Master SQL Fundamentals Quickly Using One of the World's Most Popular Database Management Systems
What you'll learn:
Set up and configure MySQL on your computer
Understand core database concepts
Create and manage databases
Write SQL to insert, edit and delete data
Create simple queries to extract data from a database
Write complex queries using JOINs, GROUP BY, and subqueries
Optimise your queries for better performance
Learn SQL fundamentals from scratch using MySQL
SQL is one of the most in-demand skills you could learn. In this hands-on course, you'll learn the basics of databases and SQL syntax, through to advanced query techniques. You'll do this quickly by learning with practical examples, and reinforcing them with quizzes and in-browser coding exercises. We'll do this using MySQL - one of the world's most popular and database systems.
Starting from first principles, you'll learn what databases are and how they are used.
Then you'll learn what SQL is, and how it's used to interact with relational databases like MySQL.
At all stages practical examples are used, which you're encouraged to experiment with yourself.
You'll learn how to create and manage databases, at all times using best practices for doing so.
Then you'll learn the SQL to manage data inside databases - inserting new data and editing and deleting existing data.
Following this you'll learn the basics of how to get data from a database, then more advanced queries, including best practices and how to optimise them.
Why Take This Course?
No prior experience required - perfect for beginners
Clear, step-by-step lessons with practical examples
Build real skills you can use at work or in freelance projects
Lifetime access to course materials
Hands-on content and downloadable resources
Certificate of Completion to showcase your new skills