

If you anticipate working with Microsoft SQL Server in your career, I recommend you start by learning T-SQL/Microsoft SQL. This syntax will generate identical results in all three database systems. It contains a join, an aggregate function, and a filter. For example, the query below aggregates data from a database of sales information. This means that you can easily translate your skills to other database management systems such as MySQL or SQLite. Despite the overwhelming popularity of MySQL, PostgreSQL may be a better choice because its syntax most closely conforms to Standard SQL. Window functions i.e., OVER(), PARTITION BY()įor students who have little to no experience with SQL and are looking to gain the most broadly applicable skills, I recommend starting with PostgreSQL. No WHERE name = ‘John’ Or WHERE name = ‘john’ are the same Yes WHERE name = ‘John’ Or WHERE name = ‘john’ are not the same The table below highlights some examples of basic differences between SQL platforms. Microsoft SQL Server has the greatest contrast in SQL syntax, as well as a wide variety of functions not available in other platforms. PostgreSQL, MySQL, and SQLite use very similar syntax, with some notable differences highlighted below. This means that if you have a question specific to one of these systems, you’re more likely to find that someone already asked your question. Second in line is Microsoft SQL Server (including T-SQL, the name of Microsoft’s dialect of SQL), which remains a consistently more popular tag than PostgreSQL and SQLite. MySQL has consistently been the most popular version of SQL in Stack Overflow questions. The graph below from Stack Overflow Trends provides a sense of how often each of these platforms is discussed - each line represents the percentage of all Stack Overflow questions about each version of SQL. So where do you begin? Which version of SQL is most helpful to you if you haven’t used it before? In this article, we will focus on four of the most popular database management systems - PostgreSQL, MySQL, SQLite, and SQL Server - and their versions of SQL syntax.

If you have started looking for ways to learn SQL, you may have noticed the many different dialects of SQL available to learn with some clear (and less clear) distinctions between the different dialects. Working with SQL and relational databases is an invaluable skill set for a data analyst, data engineer, or a data scientist.


With SQL, you can query, or ask questions of, the data in a relational database. SQL, or Structured Query Language, is the standard language for interacting with relational databases. As the company grows and records thousands (or millions) of orders, storing data in separate tables helps optimize for space and reduce the size of the database. Both tables contain columns named customer_id, which establishes a relationship between the tables. The diagram below contains information about columns in two tables in an example relational database. A relational database is a set of tables (datasets with rows and columns) that contain information relating to other tables in the database.
