Introduction to SQL

SQL (Structured Query Language) is a language used to interact with a database management system (DBMS).

After introducing the most popular conceptsData model,Entity Relationship (ER), And the most popular logical data model (Relational model), it's time to introduce SQL.

SQL (Structured Query Language) is a kind ofDatabase management system(DBMS).

As the name suggests, it is not a programming language, but a query language, which later evolved into an interface that can perform more advanced operations on the database, not just perform queries.

I'm talking about "evolution", but in fact SQL is always evolving. The standard was first published in 1986, then updated in 1989, 1992, 1999, 2003, 2006, 2008, 2011, 2016, and was released in 2019 as the latest version at the time of writing.

SQL has been implemented in many popular DBMSs: PostgreSQL, MySQL, Oracle, SQLite, MicroSoft SQL Server, etc. Each different database implements the standard or specific version, and adds custom functions on top of it to simplify the process of creating queries or adding specific functions.

Unless otherwise stated, whenever I talk about SQL, I talk about the SQL standard, not its specific implementation.

SQL is a huge topic. I will cover many of its topics in different blog posts, including:

  • Create a database
  • Use SQL mode statement to create a table
  • Populate the table with data
  • Modify the table structure
  • Add or remove columns from the table
  • SQL query
  • Use alias
  • Sort data
  • Use quotes in queries
  • Join between multiple tables
  • Use functions to calculate data
  • Convert between different data types
  • Processing date and time
  • Connection string
  • Use UNION to merge results
  • Set (union, intersection, except)
  • Group and summarize data
  • Order data
  • Count data
  • Limit the data you retrieve
  • Use NULL
  • Subqueries
  • Window function
  • Conditional logic
  • SQL transaction
  • Stored procedure
  • Restrictions
  • merge
  • Times watched
  • Metadata
  • Improve performance through indexes

More database tutorials: