Choosing Between SQL Server, PostgreSQL, MySQL, and Oracle
All four major relational databases implement the same relational model and mostly overlapping SQL standard, but they diverge sharply in dialect, tooling, concurrency implementation, and licensing. Choosing between SQL Server, PostgreSQL, MySQL, and Oracle is rarely about raw capability -- all four can run a demanding OLTP workload -- and much more about ecosystem fit: what your team already knows, what your cloud provider charges, and which platform's dialect and tooling match how your application is already built.
Cricket analogy: Choosing SQL Server versus PostgreSQL is like choosing between playing on a green seaming pitch at Headingley or a dry turner in Chennai -- both are cricket, both can produce a great match, but the skills and strategy that win differ.
Dialect and Language Differences
T-SQL, PL/pgSQL, and PL/SQL
SQL Server's procedural dialect is T-SQL (Transact-SQL); PostgreSQL's is PL/pgSQL; Oracle's is PL/SQL; MySQL historically has the thinnest procedural language of the four. Everyday syntax differences trip up migrations constantly: SQL Server uses TOP n and OFFSET/FETCH for pagination while PostgreSQL and MySQL use LIMIT/OFFSET; SQL Server uses IDENTITY columns while PostgreSQL uses SERIAL or GENERATED ALWAYS AS IDENTITY and Oracle traditionally used sequences with triggers before adding native IDENTITY support; string concatenation is + in T-SQL but || in PostgreSQL and Oracle; and SQL Server's ISNULL differs subtly from the ANSI-standard COALESCE that all four support. These aren't cosmetic -- they change how you write every query, and automated migration tools still routinely miss dialect-specific date arithmetic and locking hints.
Cricket analogy: A batter who has to adjust from facing an in-swinging Dukes ball in England to an out-swinging Kookaburra in Australia faces the same kind of subtle-but-critical adjustment a developer faces moving from T-SQL's TOP to PostgreSQL's LIMIT.
-- SQL Server pagination
SELECT CustomerId, CustomerName
FROM Sales.Customers
ORDER BY CustomerName
OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY;
-- Equivalent in PostgreSQL / MySQL
-- SELECT customer_id, customer_name
-- FROM sales.customers
-- ORDER BY customer_name
-- LIMIT 10 OFFSET 20;
-- SQL Server auto-increment
CREATE TABLE dbo.Orders (
OrderId INT IDENTITY(1,1) PRIMARY KEY,
OrderDate DATE NOT NULL DEFAULT (SYSDATETIME())
);Concurrency, Licensing, and Tooling
SQL Server defaults to pessimistic locking with lock-based isolation levels, though READ COMMITTED SNAPSHOT ISOLATION (RCSI) can be enabled to add row versioning similar to PostgreSQL and Oracle's default MVCC (multi-version concurrency control) behavior; MySQL's InnoDB engine also uses MVCC by default. Licensing differs enormously: PostgreSQL and MySQL Community Edition are free and open source, Oracle licensing is famously expensive and CPU-core-based, and SQL Server sits in between with per-core licensing for Standard/Enterprise editions alongside a genuinely capable free Express edition for small workloads. Tooling is another real differentiator -- SQL Server Management Studio (SSMS) and Azure Data Studio give a polished, integrated experience with the Query Store, Extended Events, and Always On Availability Groups, while PostgreSQL and MySQL rely more heavily on a fragmented ecosystem of third-party tools like pgAdmin, DBeaver, or Percona Toolkit.
Cricket analogy: SQL Server's optional RCSI is like a team choosing to bat first on a good batting pitch versus defaulting to bowling first -- both are valid defaults, and the choice changes the whole game's dynamics, just like choosing locking versus row-versioned isolation.
READ COMMITTED SNAPSHOT ISOLATION (RCSI) is not the same as SNAPSHOT isolation. RCSI changes the behavior of the default READ COMMITTED level to use row versioning per-statement, while SNAPSHOT isolation gives an entire transaction one consistent versioned view and must be explicitly requested with SET TRANSACTION ISOLATION LEVEL SNAPSHOT.
- All four major RDBMS platforms implement the relational model but diverge in dialect, tooling, and licensing.
- T-SQL, PL/pgSQL, and PL/SQL differ in pagination syntax, auto-increment mechanisms, and string functions.
- SQL Server defaults to lock-based isolation; PostgreSQL, Oracle, and MySQL's InnoDB default to MVCC.
- RCSI can be enabled in SQL Server to add row-versioning behavior similar to MVCC.
- Licensing ranges from free and open source (PostgreSQL, MySQL) to per-core commercial (SQL Server, Oracle).
- SSMS and Azure Data Studio offer integrated tooling; PostgreSQL/MySQL rely on a broader third-party ecosystem.
- The right platform choice usually depends on team expertise and existing infrastructure more than raw capability.
Practice what you learned
1. Which pagination syntax is native to T-SQL?
2. What concurrency model do PostgreSQL and Oracle use by default?
3. What does enabling RCSI in SQL Server change?
4. Which of these databases is free and open source by default?
5. What string concatenation operator does PostgreSQL and Oracle use, versus SQL Server's +?
Was this page helpful?
You May Also Like
T-SQL Best Practices
Practical, production-tested guidelines for writing T-SQL that is correct, performant, and maintainable in SQL Server.
T-SQL Quick Reference
A fast-lookup reference covering core T-SQL syntax: data types, joins, window functions, string/date functions, and common statements.
SQL Server Interview Questions
Commonly asked SQL Server and T-SQL interview questions with the reasoning behind strong answers, from indexing to isolation levels.
Related Reading
Related Study Notes in Programming
Browse all study notesApache Spark Study Notes
Programming · 30 topics
ProgrammingApache Flink Study Notes
Programming · 30 topics
ProgrammingHadoop Study Notes
Programming · 30 topics
ProgrammingSnowflake Study Notes
Programming · 30 topics
ProgrammingApache Airflow Study Notes
Programming · 30 topics
Programmingdbt (Data Build Tool) Study Notes
Programming · 30 topics