← SQL

Compare versions

Version 2 → Version 3. Removed · Added. This shows the entry's text as it is written, including its formatting marks.

Version 2 · Version 3 · Version history

Side by side · Together

Version 2Version 3
6 unchanged paragraphs
SQL (Structured Query Language) is the standard language for defining, querying and changing data held in relational databases, where information is kept in tables of rows and columns.
SQL (Structured Query Language) is the standard language for defining, querying and changing data held in relational databases, where information is kept in tables of rows and columns.
![A diagram of a relational table, labelling the relation, its attributes as columns and its tuples as rows.](/m/2026/11/8ajbKdAOX9Zjc7Is.png)
![A diagram of a relational table, labelling the relation, its attributes as columns and its tuples as rows.](/m/2026/11/8ajbKdAOX9Zjc7Is.png)
*Via Wikimedia Commons: [Relational model concepts](https://commons.wikimedia.org/wiki/File:Relational_model_concepts.png) by User:AutumnSnow, [CC BY-SA 3.0](http://creativecommons.org/licenses/by-sa/3.0/).*
*Via Wikimedia Commons: [Relational model concepts](https://commons.wikimedia.org/wiki/File:Relational_model_concepts.png) by User:AutumnSnow, [CC BY-SA 3.0](http://creativecommons.org/licenses/by-sa/3.0/).*
The American national standard that first fixed the language describes it as specifying "the syntax and semantics of interfaces to a database management system for [defining and accessing SQL databases](https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub127.pdf)". It was designed at IBM in the 1970s and became an American standard in 1986.
The American national standard that first fixed the language describes it as specifying "the syntax and semantics of interfaces to a database management system for [defining and accessing SQL databases](https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub127.pdf)". It was designed at IBM in the 1970s and became an American standard in 1986.
## Origins: the relational model
## Origins: the relational model
SQL grew out of a theory. In 1970 Edgar F. Codd, a mathematician at IBM's San Jose Research Laboratory, published "A Relational Model of Data for Large Shared Data Banks", which proposed a way to [store and access information in large databases](https://www.ibm.com/history/relational-database) without imposing a fixed organizational structure on it or recording the exact location of each item. Codd received the Turing Award from the Association for Computing Machinery in 1981, according to [IBM](https://www.ibm.com/history/relational-database).
SQL grew out of a theory. In 1970 Edgar F. Codd, a mathematician at IBM's San Jose Research Laboratory, published "A Relational Model of Data for Large Shared Data Banks", which proposed a way to [store and access information in large databases](https://www.ibm.com/history/relational-database) without imposing a fixed organizational structure on it or recording the exact location of each item. Codd received the Turing Award from the Association for Computing Machinery in 1981, according to [IBM](https://www.ibm.com/history/relational-database).
![A diagram breaking one SQL UPDATE statement into its clauses, expressions and predicate.](/m/2026/11/Zb0RfKcSK3ki4d5O.png)
*Via Wikimedia Commons: [Sql statement anatomy](https://commons.wikimedia.org/wiki/File:Sql_statement_anatomy.png) by SqlPac, [CC BY-SA 3.0](http://creativecommons.org/licenses/by-sa/3.0/).*
17 unchanged paragraphs
Codd's ideas still needed a language that people could use. Donald Chamberlin, then at IBM's laboratory in Yorktown Heights, New York, recalled at a 1995 reunion of the researchers involved that a seminar Codd gave there was ["a conversion experience"](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-Prehisto.html) that made him understand what the relational approach was about. Queries that would have taken pages of program code in the database systems of the day, Codd wrote down as one-liners, such as "Find the employees who earn more than their managers." Chamberlin and his new colleague Raymond Boyce then played what they called the Query Game, looking for ways to express complicated queries, and devised a notation called SQUARE, short for "Specifying Queries as Relational Expressions".
Codd's ideas still needed a language that people could use. Donald Chamberlin, then at IBM's laboratory in Yorktown Heights, New York, recalled at a 1995 reunion of the researchers involved that a seminar Codd gave there was ["a conversion experience"](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-Prehisto.html) that made him understand what the relational approach was about. Queries that would have taken pages of program code in the database systems of the day, Codd wrote down as one-liners, such as "Find the employees who earn more than their managers." Chamberlin and his new colleague Raymond Boyce then played what they called the Query Game, looking for ways to express complicated queries, and devised a notation called SQUARE, short for "Specifying Queries as Relational Expressions".
## SEQUEL and System R
## SEQUEL and System R
In 1973 a group at IBM began System R, an [industrial-strength implementation](https://www.ibm.com/history/relational-database) of the relational model. Chamberlin and Boyce worked on its language. SQUARE, Chamberlin explained at the reunion, could not be [typed on a keyboard](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-System.html) because it used subscripts, so they recast its ideas as English keywords and called the result Structured English Query Language, or SEQUEL. They added features, such as GROUP BY, that had no counterpart in SQUARE, and built a prototype on top of an access method written by Raymond Lorie.
In 1973 a group at IBM began System R, an [industrial-strength implementation](https://www.ibm.com/history/relational-database) of the relational model. Chamberlin and Boyce worked on its language. SQUARE, Chamberlin explained at the reunion, could not be [typed on a keyboard](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-System.html) because it used subscripts, so they recast its ideas as English keywords and called the result Structured English Query Language, or SEQUEL. They added features, such as GROUP BY, that had no counterpart in SQUARE, and built a prototype on top of an access method written by Raymond Lorie.
Chamberlin and Boyce presented the language in a paper, "SEQUEL: A Structured English Query Language", at an ACM workshop on data description, access and control held in Ann Arbor, Michigan, in [May 1974](https://research.ibm.com/publications/sequel-a-struciured-english-query-language). Its abstract describes a set of simple operations on tables that could be used "without resorting to the concepts of bound variables and quantifiers", the notation of formal logic, and says the language was meant both for professional programmers and for occasional users of a database.
Chamberlin and Boyce presented the language in a paper, "SEQUEL: A Structured English Query Language", at an ACM workshop on data description, access and control held in Ann Arbor, Michigan, in [May 1974](https://research.ibm.com/publications/sequel-a-struciured-english-query-language). Its abstract describes a set of simple operations on tables that could be used "without resorting to the concepts of bound variables and quantifiers", the notation of formal logic, and says the language was meant both for professional programmers and for occasional users of a database.
Boyce did not see the language grow. In the spring of 1974 he collapsed at lunchtime from a brain aneurysm, and he died on [Father's Day 1974](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-Ray.html), Chamberlin recalled. Their collaboration had been so close, Chamberlin said, that at the end of a day neither could remember which ideas had been whose.
Boyce did not see the language grow. In the spring of 1974 he collapsed at lunchtime from a brain aneurysm, and he died on [Father's Day 1974](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-Ray.html), Chamberlin recalled. Their collaboration had been so close, Chamberlin said, that at the end of a day neither could remember which ideas had been whose.
The designers' original aim was to let people who were not programmers question a database directly. Looking back in 1995, Chamberlin judged that SQL had instead succeeded in other ways, among them as a common medium between different systems, rather than as a language for occasional users: "the problem that we solved wasn't really the problem that we thought we were [solving at the time](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-System.html)."
The designers' original aim was to let people who were not programmers question a database directly. Looking back in 1995, Chamberlin judged that SQL had instead succeeded in other ways, among them as a common medium between different systems, rather than as a language for occasional users: "the problem that we solved wasn't really the problem that we thought we were [solving at the time](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-System.html)."
The name changed after a legal challenge. Chamberlin recalled that a company, which he believed was the British aircraft maker Hawker Siddeley, claimed SEQUEL as its registered trademark, and that he himself [removed the vowels](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-System.html) to make SQL, following the pattern of three-letter language names ending in L such as APL.
The name changed after a legal challenge. Chamberlin recalled that a company, which he believed was the British aircraft maker Hawker Siddeley, claimed SEQUEL as its registered trademark, and that he himself [removed the vowels](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-System.html) to make SQL, following the pattern of three-letter language names ending in L such as APL.
## Commercial products
## Commercial products
The language reached the market from more than one direction. At the 1995 reunion Roger Bamford, a former IBM engineer who had joined Oracle, said that "IBM invented the language, but [Oracle shipped it first](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-Oracle.html)." Jim Gray suggested the year was 1979, and Bamford noted that the first release was numbered Version 2. Others at the reunion said that Oracle's code did not come from System R, whose code its developers would not have had access to. IBM's own history credits Larry Ellison's company Relational Software, later renamed Oracle, with the [first commercially available relational database](https://www.ibm.com/history/relational-database).
The language reached the market from more than one direction. At the 1995 reunion Roger Bamford, a former IBM engineer who had joined Oracle, said that "IBM invented the language, but [Oracle shipped it first](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-Oracle.html)." Jim Gray suggested the year was 1979, and Bamford noted that the first release was numbered Version 2. Others at the reunion said that Oracle's code did not come from System R, whose code its developers would not have had access to. IBM's own history credits Larry Ellison's company Relational Software, later renamed Oracle, with the [first commercially available relational database](https://www.ibm.com/history/relational-database).
IBM's own database product DB2 was [first shipped in 1983](https://www.ibm.com/history/relational-database) on the MVS mainframe operating system. IBM also credits Patricia Selinger with developing a cost-based optimizer, the part of the system that chooses an efficient way to carry out a query, and Raymond Lorie with a compiler that could save the plans for queries to be used again.
IBM's own database product DB2 was [first shipped in 1983](https://www.ibm.com/history/relational-database) on the MVS mainframe operating system. IBM also credits Patricia Selinger with developing a cost-based optimizer, the part of the system that chooses an efficient way to carry out a query, and Raymond Lorie with a compiler that could save the plans for queries to be used again.
## Standardization
## Standardization
The American National Standards Institute approved American National Standard X3.135-1986, *Database Language SQL*, on [16 October 1986](https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub127.pdf). It was developed by the Technical Committee on Database, X3H2, whose project, as quoted in the standard's foreword, was to standardize the functions "used in defining, querying, and altering relational databases". The United States government adopted it for federal use as Federal Information Processing Standards Publication 127.
The American National Standards Institute approved American National Standard X3.135-1986, *Database Language SQL*, on [16 October 1986](https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub127.pdf). It was developed by the Technical Committee on Database, X3H2, whose project, as quoted in the standard's foreword, was to standardize the functions "used in defining, querying, and altering relational databases". The United States government adopted it for federal use as Federal Information Processing Standards Publication 127.
At the 1995 reunion Chamberlin recalled that the first standard grew from a precise written description of what System R did, prepared by Bob Engles, which the standards committee then adopted: ["They kept all the warts, too."](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-Intergal.html) Jim Gray recalled that the international standards body accepted the American text in return for the addition of its own design for referential integrity, the foreign keys that tie a row in one table to a row in another.
At the 1995 reunion Chamberlin recalled that the first standard grew from a precise written description of what System R did, prepared by Bob Engles, which the standards committee then adopted: ["They kept all the warts, too."](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-Intergal.html) Jim Gray recalled that the international standards body accepted the American text in return for the addition of its own design for referential integrity, the foreign keys that tie a row in one table to a row in another.
The international standard is ISO/IEC 9075. It is revised from time to time, and each version replaces the one before it. As of November 2026 the latest is [SQL:2023](https://www.postgresql.org/docs/current/features.html); earlier versions were SQL:2016, SQL:2011, SQL:2008, SQL:2006, SQL:2003, SQL:1999 and SQL-92. The standard is divided into parts: Part 1 sets out the framework, Part 2, called SQL/Foundation, defines the core of the language, and others cover subjects such as calling SQL from other programming languages, XML, multi-dimensional arrays and, in Part 16, queries over property graphs.
The international standard is ISO/IEC 9075. It is revised from time to time, and each version replaces the one before it. As of November 2026 the latest is [SQL:2023](https://www.postgresql.org/docs/current/features.html); earlier versions were SQL:2016, SQL:2011, SQL:2008, SQL:2006, SQL:2003, SQL:1999 and SQL-92. The standard is divided into parts: Part 1 sets out the framework, Part 2, called SQL/Foundation, defines the core of the language, and others cover subjects such as calling SQL from other programming languages, XML, multi-dimensional arrays and, in Part 16, queries over property graphs.
Conformance to the standard is partial in practice. The PostgreSQL documentation notes that most systems claiming conformance to SQL-92 met only its lowest, Entry level, and that at the time of writing [no current database system](https://www.postgresql.org/docs/current/features.html) claimed full conformance to Core SQL:2023, the set of features every conforming implementation must supply. It reports that PostgreSQL conforms to at least 170 of the 177 mandatory Core features.
Conformance to the standard is partial in practice. The PostgreSQL documentation notes that most systems claiming conformance to SQL-92 met only its lowest, Entry level, and that at the time of writing [no current database system](https://www.postgresql.org/docs/current/features.html) claimed full conformance to Core SQL:2023, the set of features every conforming implementation must supply. It reports that PostgreSQL conforms to at least 170 of the 177 mandatory Core features.
## How it works
## How it works
A query in SQL describes the result that is wanted, and the database system works out the steps for producing it; IBM's history credits Chamberlin and Boyce with developing ["systems for automatically translating high-level queries"](https://www.ibm.com/history/relational-database). A query has a characteristic shape. In the PostgreSQL documentation's terms, a [table expression](https://www.postgresql.org/docs/current/queries-table-expressions.html) has a FROM clause, naming the tables to read, optionally followed by WHERE, GROUP BY and HAVING clauses that act as a pipeline of successive transformations on the rows FROM produces. A SELECT list then names the columns or computed values to return. For example:
A query in SQL describes the result that is wanted, and the database system works out the steps for producing it; IBM's history credits Chamberlin and Boyce with developing ["systems for automatically translating high-level queries"](https://www.ibm.com/history/relational-database). A query has a characteristic shape. In the PostgreSQL documentation's terms, a [table expression](https://www.postgresql.org/docs/current/queries-table-expressions.html) has a FROM clause, naming the tables to read, optionally followed by WHERE, GROUP BY and HAVING clauses that act as a pipeline of successive transformations on the rows FROM produces. A SELECT list then names the columns or computed values to return. For example:
![A diagram breaking one SQL UPDATE statement into its clauses, expressions and predicate.](/m/2026/11/Zb0RfKcSK3ki4d5O.png)
*Via Wikimedia Commons: [Sql statement anatomy](https://commons.wikimedia.org/wiki/File:Sql_statement_anatomy.png) by SqlPac, [CC BY-SA 3.0](http://creativecommons.org/licenses/by-sa/3.0/).*
13 unchanged paragraphs
``` SELECT department, COUNT(*) FROM employees WHERE salary > 50000 GROUP BY department; ```
``` SELECT department, COUNT(*) FROM employees WHERE salary > 50000 GROUP BY department; ```
asks, for each department, how many employees earn more than 50,000.
asks, for each department, how many employees earn more than 50,000.
- **Filtering.** WHERE checks each row against a condition. A row is kept only if the condition is true; if it is false or null, the row is [discarded](https://www.postgresql.org/docs/current/queries-table-expressions.html). - **Joins.** A join combines rows from two tables. In a LEFT OUTER JOIN, every row of the first table appears at least once in the result; a row with no match in the second table is paired with null values in that table's columns. - **Grouping.** GROUP BY gathers rows that share the same values in the listed columns into a single row for each group, typically so that totals, counts or averages can be computed for each. - **Beyond queries.** SQL also covers adding, changing and removing data and defining the structure of a database, the "defining, querying, and altering" of databases that the [1986 standard](https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub127.pdf) set out to standardize.
- **Filtering.** WHERE checks each row against a condition. A row is kept only if the condition is true; if it is false or null, the row is [discarded](https://www.postgresql.org/docs/current/queries-table-expressions.html). - **Joins.** A join combines rows from two tables. In a LEFT OUTER JOIN, every row of the first table appears at least once in the result; a row with no match in the second table is paired with null values in that table's columns. - **Grouping.** GROUP BY gathers rows that share the same values in the listed columns into a single row for each group, typically so that totals, counts or averages can be computed for each. - **Beyond queries.** SQL also covers adding, changing and removing data and defining the structure of a database, the "defining, querying, and altering" of databases that the [1986 standard](https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub127.pdf) set out to standardize.
## NULL and three-valued logic
## NULL and three-valued logic
SQL represents a missing or unknown value with the marker NULL, and much of its reputation for surprising behaviour comes from it. SQL uses a [three-valued logic](https://www.postgresql.org/docs/current/functions-logical.html) of true, false and null, where null means "unknown". So TRUE AND NULL is null, while TRUE OR NULL is true; FALSE AND NULL is false, while FALSE OR NULL is null.
SQL represents a missing or unknown value with the marker NULL, and much of its reputation for surprising behaviour comes from it. SQL uses a [three-valued logic](https://www.postgresql.org/docs/current/functions-logical.html) of true, false and null, where null means "unknown". So TRUE AND NULL is null, while TRUE OR NULL is true; FALSE AND NULL is false, while FALSE OR NULL is null.
Ordinary comparisons follow the same rule. A comparison with null [yields null](https://www.postgresql.org/docs/current/functions-comparison.html) rather than true or false: `7 = NULL` is null, and so is `NULL = NULL`, because it is not known whether two unknown values are equal. A condition such as `WHERE column = NULL` therefore never selects any rows; the test for a missing value is written `IS NULL`. The predicates IS DISTINCT FROM and IS NOT DISTINCT FROM compare values while treating two nulls as equal to each other. PostgreSQL offers a setting that rewrites `x = NULL` as `x IS NULL` for older applications, while recommending that such applications be changed to follow the standard.
Ordinary comparisons follow the same rule. A comparison with null [yields null](https://www.postgresql.org/docs/current/functions-comparison.html) rather than true or false: `7 = NULL` is null, and so is `NULL = NULL`, because it is not known whether two unknown values are equal. A condition such as `WHERE column = NULL` therefore never selects any rows; the test for a missing value is written `IS NULL`. The predicates IS DISTINCT FROM and IS NOT DISTINCT FROM compare values while treating two nulls as equal to each other. PostgreSQL offers a setting that rewrites `x = NULL` as `x IS NULL` for older applications, while recommending that such applications be changed to follow the standard.
Aggregate functions treat nulls in their own way. In PostgreSQL, `COUNT(*)` counts every input row, while `COUNT(column)` counts only the rows in which that column is [not null](https://www.postgresql.org/docs/current/functions-aggregate.html), so the two can give different totals for the same rows.
Aggregate functions treat nulls in their own way. In PostgreSQL, `COUNT(*)` counts every input row, while `COUNT(column)` counts only the rows in which that column is [not null](https://www.postgresql.org/docs/current/functions-aggregate.html), so the two can give different totals for the same rows.
Even database builders have found the rules hard to pin down. The developers of SQLite, describing how they settled their own system's treatment of nulls, wrote that the standard's descriptions ["seem ambiguous"](https://www.sqlite.org/nulls.html), so instead of relying on the documents they had volunteers run a test script on several popular database engines and made SQLite behave like the others.
Even database builders have found the rules hard to pin down. The developers of SQLite, describing how they settled their own system's treatment of nulls, wrote that the standard's descriptions ["seem ambiguous"](https://www.sqlite.org/nulls.html), so instead of relying on the documents they had volunteers run a test script on several popular database engines and made SQLite behave like the others.
## Dialects and criticism
## Dialects and criticism
Database systems depart from the standard in places, and the systems themselves document the gap: PostgreSQL states that it aims to conform to the latest standard [where that does not contradict](https://www.postgresql.org/docs/current/features.html) traditional features or common sense.
Database systems depart from the standard in places, and the systems themselves document the gap: PostgreSQL states that it aims to conform to the latest standard [where that does not contradict](https://www.postgresql.org/docs/current/features.html) traditional features or common sense.
Criticism of the language began with its own creators. Chamberlin's remark that the first standard "kept all the warts" refers to inconsistencies carried over unchanged from IBM's early implementation, and Gray recalled Chamberlin returning from a meeting at IBM's Santa Teresa laboratory to report that it had spent the entire day [deciding how to spell NULL](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-Intergal.html).
Criticism of the language began with its own creators. Chamberlin's remark that the first standard "kept all the warts" refers to inconsistencies carried over unchanged from IBM's early implementation, and Gray recalled Chamberlin returning from a meeting at IBM's Santa Teresa laboratory to report that it had spent the entire day [deciding how to spell NULL](https://mcjones.org/System_R/SQL_Reunion_95/sqlr95-Intergal.html).
## Sources
## Sources
- American National Standard X3.135-1986, *Database Language SQL*, approved 16 October 1986. American National Standards Institute; adopted as FIPS PUB 127, National Bureau of Standards. Scanned copy at NIST. https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub127.pdf - "The relational database". IBM History (read November 2026). https://www.ibm.com/history/relational-database - Donald D. Chamberlin and Raymond F. Boyce, "SEQUEL: A Structured English Query Language", ACM SIGFIDET Workshop, May 1974. Record at IBM Research. https://research.ibm.com/publications/sequel-a-struciured-english-query-language - Paul McJones (ed.), *The 1995 SQL Reunion: People, Projects, and Politics*, 2nd edition, 20 August 1997: sections "Prehistory", "System R", "Ray Boyce", "Oracle" and "Intergalactic dataspeak". https://mcjones.org/System_R/SQL_Reunion_95/sqlr95.html - "SQL Conformance", PostgreSQL 18 Documentation, Appendix D. The PostgreSQL Global Development Group (read November 2026). https://www.postgresql.org/docs/current/features.html - "Table Expressions", PostgreSQL 18 Documentation. https://www.postgresql.org/docs/current/queries-table-expressions.html - "Comparison Functions and Operators", PostgreSQL 18 Documentation. https://www.postgresql.org/docs/current/functions-comparison.html - "Logical Operators", PostgreSQL 18 Documentation. https://www.postgresql.org/docs/current/functions-logical.html - "Aggregate Functions", PostgreSQL 18 Documentation. https://www.postgresql.org/docs/current/functions-aggregate.html - "NULL Handling in SQLite Versus Other Database Engines". SQLite documentation. https://www.sqlite.org/nulls.html
- American National Standard X3.135-1986, *Database Language SQL*, approved 16 October 1986. American National Standards Institute; adopted as FIPS PUB 127, National Bureau of Standards. Scanned copy at NIST. https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub127.pdf - "The relational database". IBM History (read November 2026). https://www.ibm.com/history/relational-database - Donald D. Chamberlin and Raymond F. Boyce, "SEQUEL: A Structured English Query Language", ACM SIGFIDET Workshop, May 1974. Record at IBM Research. https://research.ibm.com/publications/sequel-a-struciured-english-query-language - Paul McJones (ed.), *The 1995 SQL Reunion: People, Projects, and Politics*, 2nd edition, 20 August 1997: sections "Prehistory", "System R", "Ray Boyce", "Oracle" and "Intergalactic dataspeak". https://mcjones.org/System_R/SQL_Reunion_95/sqlr95.html - "SQL Conformance", PostgreSQL 18 Documentation, Appendix D. The PostgreSQL Global Development Group (read November 2026). https://www.postgresql.org/docs/current/features.html - "Table Expressions", PostgreSQL 18 Documentation. https://www.postgresql.org/docs/current/queries-table-expressions.html - "Comparison Functions and Operators", PostgreSQL 18 Documentation. https://www.postgresql.org/docs/current/functions-comparison.html - "Logical Operators", PostgreSQL 18 Documentation. https://www.postgresql.org/docs/current/functions-logical.html - "Aggregate Functions", PostgreSQL 18 Documentation. https://www.postgresql.org/docs/current/functions-aggregate.html - "NULL Handling in SQLite Versus Other Database Engines". SQLite documentation. https://www.sqlite.org/nulls.html