Skip main navigation

Introduction to SQL

Learn how and why we use SQL to interact with databases.
Structured Query Language (SQL) is the most widely implemented database query language and is supported by many popular relational database systems, including: MS SQL Server, IBM DB2, MySQL, and Microsoft Access. It is primarily used to access data from relational databases.
Since the late 1980s, SQL (pronounced ‘S Q L’ or ‘sequel’) has been a standard for both the International Organization for Standardization (ISO) and the American National Standards Institute (ANSI). Although SQL is considered a standard, database technology providers usually have their own SQL editor and there can be small variations in the syntax depending on how the SQL features are implemented.
In this course you’ll use SQLite3, which implements a database engine and understands most of the standard SQL language. We’ll try to highlight general SQL statements and any specific SQLite implementations. You can also check out the following pages for more information:
To help you learn SQL, we’ll present snippets of SQL. You’ll generally see examples of SQL presented like this:
CREATE TABLE Customers (
CustomerID integer PRIMARY KEY AUTOINCREMENT,
LastName varchar(255),
FirstName varchar(255),
DOB varchar(255),
Mobile integer,
CountryCode char(4)
);
We’ll also show the output of any SQL or SQLite commands as follows
sqlite> SELECT * FROM Artist;
ArtistId Name
---------- ----------
1 AC/DC
2 Accept
3 Aerosmith
...

References

1. What is SQLite? [Internet]. SQLite. Available from: https://sqlite.org/index.html
2. SQL As Understood By SQLite [Internet]. SQLite. Available from: https://sqlite.org/lang.html
3. Quirks, Caveats, and Gotchas In SQLite [Internet]. SQLite. Available from: https://sqlite.org/quirks.html
This article is from the free online

SQL for Data Analysis

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education

close