SQL tutorial

SQL Basics

Learn more about SQL, a standard language for interacting with databases and storing, manipulating, and retrieving data from databases.

Go hands-on with SQL in our free interactive SQL tutorial.

SQL stands for Structured Query Language, and is a language specifically for interacting with databases and returning data from databases. It can be helpful to think of each of the letters as in the breakdown below, to remember what SQL is, how it is used, and differs from other languages:

  • Structured: as the language is used to interact with structured data stored in relational database management systems (RDBMS). That is, data that fits into tables with rows and columns, where each row is a record and each column is a data field for each record.
  • Query: SQL is composed of different commands, the most common of which are queries. While these queries can be used to interact with the database in other ways, they are most commonly used to retrieve data from a database and return it to the user through software especially designed for this purpose.
  • Language: SQL is a language and shares many common attributes and syntactical structures with other programming languages. However, unlike other multi-purpose languages (such as python or Java) which can be used for everything from application development to data analysis to building web services, SQL is specifically for querying data and interacting with databases.

How to Use SQL

SQL is used to query and return data from a database. SQL commands are sent to the SQL engine which runs as part of the database application software, which then interprets the code, executes it, and returns the data (and/or result of the operation) to the user. 

The machine running the database and SQL engine is referred to as the SQL server, whereas the machine sending queries to be executed and receiving the results is referred to as the client. 

More generally, this also refers to the software running the database and SQL engine (server) and software which allows a user to send commands to the server to execute (client). The machines running the server and client software may be different (e.g. a user in a large organization executing queries from their laptop to a server machine storing data for the entire company) or the same, if the server and client software are both run locally.

How to Download SQL

To use SQL, you can download a SQL client application to allow you to connect to and execute queries against a server. If you are just getting started with SQL, you would probably download both the SQL server and client software, such that you can work with data locally and execute queries without needing to connect to an externally hosted database. While there are many different variants of SQL which have their own specific client applications, in the BrainStation data analytics certificate and data science bootcamp programs, we recommend using MySQL which is a free, cross-platform application for running a server (database) as well as executing queries and SQL commands through the client application (MySQLWorkbench).

Learn SQL Today

Get hands-on experience writing code with interactive tutorials in our free online learning platform.

  • Free and fun
  • Designed for beginners
  • No downloads or setup required