Home / Learn Secure SQL / SQL Dialects: One Language, Several Accents

SQL Dialects: One Language, Several Accents

SQLite, PostgreSQL, MySQL, SQL Server differences you will meet.

The short versionSQLite, PostgreSQL, MySQL, SQL Server differences you will meet.

Theory in plain words

Same idea, different spellingAUTOINCREMENT(SQLite)SERIAL (Postgres)AUTO_INCREMENT(MySQL)
Same idea, different spelling

Definition

Every database implements the core of SQL similarly but differs in details: string quoting, auto-increment syntax, date functions, and placeholder styles for parameters.

Why you need this

Knowing that dialects differ prevents confusion when an example from one database does not run unchanged on another, and matters directly for the parameter placeholder syntax in the next part of the course.

How it works

Check your specific database's documentation for exact syntax; the concepts in this course (prepared statements, validation, least privilege) apply to all of them equally.

Where you'll see this

  • Web application code review
  • Backend development
  • Database administration
TopicSQLitePostgreSQLMySQL
Auto idINTEGER PRIMARY KEYSERIAL / IDENTITYAUTO_INCREMENT
Placeholder? or :name$1, $2, ... or :name? or :name
String concat'a' || 'b''a' || 'b'CONCAT('a','b')
Booleanstored as 0/1true BOOLEAN typestored as 0/1

Test what you just read

1. Across dialects, what this course teaches...