DBMs
DBMs
by E. F. Codd. Most popular commercial and open source databases currently in use are based on the relational database model. A short definition of an RDBMS may be a DBMS in which data is stored in the form of tables and the relationship among the data is also stored in the form of tables.
Contents
[hide]
1 Historical usage of the term 2 Market structure 3 See also 4 External links
presented the data to the user as relations (a presentation in tabular form, i.e. as a collection of tables with each table consisting of a set of rows and columns, can satisfy this property) provided relational operators to manipulate the data in tabular form
The first systems that were relatively faithful implementations of the relational model were from the University of Michigan; Micro DBMS (1969) and from IBM UK Scientific Centre at Peterlee; IS1 (197072) and its followon PRTV (197379). The first system sold as an RDBMS was Multics Relational Data Store, first sold in 1978. Others have been Berkeley Ingres QUEL and IBM BS12. The most popular definition of an RDBMS is a product that presents a view of data as a collection of rows and columns, even if it is not based strictly upon relational theory. By this definition, RDBMS products typically implement some but not all of Codd's 12 rules. A second, theory-based school of thought argues that if a database does not implement all of Codd's rules (or the current understanding on the relational model, as expressed by Christopher J Date, Hugh Darwen and others), it is not relational. This view, shared by many theorists and other strict adherents to Codd's principles, would disqualify most DBMSs as not relational. For clarification, they often refer to some RDBMSs as Truly-Relational Database Management
Systems (TRDBMS), naming others Pseudo-Relational Database Management Systems (PRDBMS). As of 2009, most commercial relational DBMSes employ SQL as their query language. Alternative query languages have been proposed and implemented, notably the pre-1996 implementation of Berkeley Ingres QUEL.
SQL
From Wikipedia, the free encyclopedia (Redirected from Structured Query Language) Jump to: navigation, search This article is about the database language. For the airport with IATA code SQL, see San Carlos Airport.
SQL
Paradigm Appeared in Designed by Developer Stable release Typing discipline Major implementations Dialects Influenced by Influenced OS Multi-paradigm 1974 Donald D. Chamberlin Raymond F. Boyce IBM SQL:2008 (2008) Static, strong Many SQL-86, SQL-89, SQL-92, SQL:1999, SQL:2003, SQL:2008 Datalog Agena, CQL, LINQ, Windows PowerShell Cross-platform
SQL
Filename extension
.sql
SQL (officially pronounced /skjul/ like "S-Q-L" but often pronounced /sikwl/ like "sequel"),[1] often referred to as Structured Query Language[2][3] (however, there is some debate about its expansion[4]), is a database computer language designed for managing data in relational database management systems (RDBMS), and originally based upon relational algebra. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control. SQL was one of the first languages for Edgar F. Codd's relational model in his influential 1970 paper, "A Relational Model of Data for Large Shared Data Banks"[5] and became the most widely used language for relational databases.[2][6]
Contents
[hide]
1 History 2 Language elements o 2.1 Queries 2.1.1 Null and three-valued logic (3VL) o 2.2 Data manipulation o 2.3 Transaction controls o 2.4 Data definition o 2.5 Data types 2.5.1 Character strings 2.5.2 Bit strings 2.5.3 Numbers 2.5.4 Date and time o 2.6 Data control o 2.7 Procedural extensions 3 Criticisms of SQL o 3.1 Cross-vendor portability 4 Standardization o 4.1 Standard structure 5 Alternatives to SQL 6 See also 7 References 8 External links
[edit] History
SQL was developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s. This version, initially called SEQUEL (Structured English Query Language), was designed to manipulate and retrieve data stored in IBM's original relational database management system, System R, which a group at IBM San Jose Research Laboratory had developed during the 1970s.[7] The acronym SEQUEL was later changed to SQL because "SEQUEL" was a trademark of the UKbased Hawker Siddeley aircraft company.[8] The first Relational Database Management System (RDBMS) was RDMS, developed at MIT in the early 1970s, soon followed by Ingres, developed in 1974 at U.C. Berkeley. Ingres implemented a query language known as QUEL, which was later supplanted in the marketplace by SQL.[8] In the late 1970s, Relational Software, Inc. (now Oracle Corporation) saw the potential of the concepts described by Codd, Chamberlin, and Boyce and developed their own SQL-based RDBMS with aspirations of selling it to the U.S. Navy, Central Intelligence Agency, and other U.S. government agencies. In June of 1979, Relational Software, Inc. introduced the first commercially available implementation of SQL, Oracle V2 (Version2) for VAX computers. Oracle V2 beat IBM's August release of the System/38 RDBMS to market by a few weeks.[citation
needed]
After testing SQL at customer test sites to determine the usefulness and practicality of the system, IBM began developing commercial products based on their System R prototype including System/38, SQL/DS, and DB2, which were commercially available in 1979, 1981, and 1983, respectively.[9]
This chart shows several of the SQL language elements that compose a single statement. The SQL language is sub-divided into several language elements, including:
Clauses, which are in some cases optional, constituent components of statements and queries.[10] Expressions which can produce either scalar values or tables consisting of columns and rows of data. Predicates which specify conditions that can be evaluated to SQL three-valued logic (3VL) or Boolean (true/false/unknown) truth values and which are used to limit the effects of statements and queries, or to change program flow. Queries which retrieve data based on specific criteria.
Statements which may have a persistent effect on schemas and data, or which may control transactions, program flow, connections, sessions, or diagnostics. o SQL statements also include the semicolon (";") statement terminator. Though not required on every platform, it is defined as a standard part of the SQL grammar. Insignificant whitespace is generally ignored in SQL statements and queries, making it easier to format SQL code for readability.
[edit] Queries The most common operation in SQL is the query, which is performed with the declarative SELECT statement. SELECT retrieves data from one or more tables, or expressions. Standard SELECT statements have no persistent effects on the database. Some non-standard implementations of SELECT can have persistent effects, such as the SELECT INTO syntax that exists in some databases.
[11]
Queries allow the user to describe desired data, leaving the database management system (DBMS) responsible for planning, optimizing, and performing the physical operations necessary to produce that result as it chooses. A query includes a list of columns to be included in the final result immediately following the SELECT keyword. An asterisk ("*") can also be used to specify that the query should return all columns of the queried tables. SELECT is the most complex statement in SQL, with optional keywords and clauses that include:
The FROM clause which indicates the table(s) from which data is to be retrieved. The FROM clause can include optional JOIN subclauses to specify the rules for joining tables. The WHERE clause includes a comparison predicate, which restricts the rows returned by the query. The WHERE clause eliminates all rows from the result set for which the comparison predicate does not evaluate to True. The GROUP BY clause is used to project rows having common values into a smaller set of rows. GROUP BY is often used in conjunction with SQL aggregation functions or to eliminate duplicate rows from a result set. The WHERE clause is applied before the GROUP BY clause. The HAVING clause includes a predicate used to filter rows resulting from the GROUP BY clause. Because it acts on the results of the GROUP BY clause, aggregation functions can be used in the HAVING clause predicate. The ORDER BY clause identifies which columns are used to sort the resulting data, and in which direction they should be sorted (options are ascending or descending). Without an ORDER BY clause, the order of rows returned by an SQL query is undefined.
The following is an example of a SELECT query that returns a list of expensive books. The query retrieves all rows from the Book table in which the price column contains a value greater than 100.00. The result is sorted in ascending order by title. The asterisk (*) in the select list indicates that all columns of the Book table should be included in the result set.
SELECT *
The example below demonstrates a query of multiple tables, grouping, and aggregation, by returning a list of books and the number of authors associated with each book.
SELECT Book.title, count(*) AS Authors FROM Book JOIN Book_author ON Book.isbn = Book_author.isbn GROUP BY Book.title;
Under the precondition that isbn is the only common column name of the two tables and that a column named title only exists in the Books table, the above query could be rewritten in the following form:
SELECT title, count(*) AS Authors FROM Book NATURAL JOIN Book_author GROUP BY title;
However, many vendors either do not support this approach, or require certain column naming conventions in order for natural joins to work effectively. SQL includes operators and functions for calculating values on stored values. SQL allows the use of expressions in the select list to project data, as in the following example which returns a list of books that cost more than 100.00 with an additional sales_tax column containing a sales tax figure calculated at 6% of the price.
SELECT isbn, title, price, price * 0.06 AS sales_tax FROM Book WHERE price > 100.00 ORDER BY title;
[edit] Null and three-valued logic (3VL) The idea of Null was introduced into SQL to handle missing information in the relational model. The introduction of Null (or Unknown) along with True and False is the foundation of three-valued
logic. Null does not have a value (and is not a member of any data domain) but is rather a placeholder or mark for missing information. Therefore comparisons with Null can never result in either True or False but always in the third logical result,[12] SQL uses Null to handle missing information. It supports three-valued logic (3VL) and the rules governing SQL three-valued logic (3VL) are shown below (p and q represent logical states).[13] The word NULL is also a reserved keyword in SQL, used to identify the Null special marker. Additionally, since SQL operators return Unknown when comparing anything with Null, SQL provides two Null-specific comparison predicates: The IS NULL and IS NOT NULL test whether data is or is not Null.[12] Note that SQL returns only results for which the WHERE clause returns a value of True. I.e., it excludes results with values of False, but also those whose value is Unknown. p p p OR q True False Unknown True False True True False Unknown True True True q False False False False q False True False Unknown Unknown False Unknown Unknown True Unknown p NOT p p p=q True False True False Unknown False True True True False Unknown Unknown Unknown q False False True Unknown Unknown Unknown Unknown Unknown p AND q
Universal quantification is not explicitly supported by SQL, and must be worked out as a negated existential quantification.[14][15][16] There is also the "<row value expression> IS DISTINCT FROM <row value expression>" infixed comparison operator which returns TRUE unless both operands are equal or both are NULL. Likewise, IS NOT DISTINCT FROM is defined as "NOT (<row value expression> IS DISTINCT FROM <row value expression>") [edit] Data manipulation The Data Manipulation Language (DML) is the subset of SQL used to add, update and delete data:
INSERT
INSERT INTO My_table (field1, field2, field3) VALUES ('test', 'N', NULL); UPDATE
UPDATE My_table SET field1 = 'updated value' WHERE field2 = 'N'; DELETE
is used to combine the data of multiple tables. It combines the INSERT and UPDATE elements. It is defined in the SQL:2003 standard; prior to that, some databases provided similar functionality via different syntax, sometimes called "upsert".
MERGE
(or BEGIN WORK, or BEGIN TRANSACTION, depending on SQL dialect) mark the start of a database transaction, which either completes entirely or not at all. SAVE TRANSACTION (or SAVEPOINT ) save the state of the database at the current point in transaction
START TRANSACTION
CREATE TABLE tbl_1(id int); INSERT INTO tbl_1(id) value(1); INSERT INTO tbl_1(id) value(2); COMMIT; UPDATE tbl_1 SET id=200 WHERE id=1; SAVEPOINT id_1upd; UPDATE tbl_1 SET id=1000 WHERE id=2; ROLLBACK TO id_1upd; SELECT id FROM tbl_1; COMMIT causes all data changes in a transaction to be made permanent. ROLLBACK causes all data changes since the last COMMIT or ROLLBACK to be discarded,
leaving the state of the data as it was prior to those changes. Once the COMMIT statement completes, the transaction's changes cannot be rolled back.
COMMIT and ROLLBACK terminate the current transaction and release data locks. In the absence of a START TRANSACTION or similar statement, the semantics of SQL are implementation-dependent.
[edit] Data definition The Data Definition Language (DDL) manages table and index structure. The most basic items of DDL are the CREATE, ALTER, RENAME, DROP and TRUNCATE statements:
CREATE
CREATE TABLE My_table( my_field1 INT, my_field2 VARCHAR(50), my_field3 DATE NOT NULL, PRIMARY KEY (my_field1, my_field2) );
modifies the structure of an existing object in various ways, for example, adding a column to an existing table or a constraint, e.g.,:
ALTER
deletes all data from a table in a very fast way, deleting the data inside the table and not the table itself. It usually implies a subsequent COMMIT operation, i.e., it cannot be rolled back.
TRUNCATE
deletes an object in the database, usually irretrievably, i.e., it cannot be rolled back,
e.g.,:
DROP TABLE My_table;
[edit] Data types Each column in an SQL table declares the type(s) that column may contain. ANSI SQL includes the following datatypes.[17] [edit] Character strings
CHARACTER(n)
or CHAR(n) fixed-width n-character string, padded with spaces as or VARCHAR(n) variable-width string with a maximum size of or NCHAR(n) fixed width string supporting an international or NVARCHAR(n) variable-width NCHAR string
needed
CHARACTER VARYING(n)
n characters
NATIONAL CHARACTER(n)
character set
NATIONAL CHARACTER VARYING(n)
an array of n bits
BIT VARYING(n)
an array of up to n bits
[edit] Numbers
INTEGER and SMALLINT FLOAT, REAL and DOUBLE PRECISION NUMERIC(precision, scale) or DECIMAL(precision, scale)
SQL provides a function to round numerics or dates, called TRUNC (in Informix, DB2, PostgreSQL, Oracle and MySQL) or ROUND (in Informix, Sybase, Oracle, PostgreSQL and Microsoft SQL Server)[18] [edit] Date and time
for date values (e.g., 2010-05-30) for time values (e.g., 14:55:37). The granularity of the time value is usually a tick (100 nanoseconds). TIME WITH TIME ZONE or TIMESTAMP the same as TIME, but including details about the time zone in question. TIMESTAMP This is a DATE and a TIME put together in one variable (e.g., 2010-05-30 14:55:37). TIMESTAMP WITH TIME ZONE or TIMESTAMPTZ the same as TIMESTAMP, but including details about the time zone in question.
DATE TIME
SQL provides several functions for generating a date / time variable out of a date / time string (TO_DATE, TO_TIME, TO_TIMESTAMP), as well as for extracting the respective members (seconds, for instance) of such variables. The current system date / time of the database server can be called by using functions like NOW. [edit] Data control The Data Control Language (DCL) authorizes users and groups of users to access and manipulate data. Its two main statements are:
GRANT
authorizes one or more users to perform an operation or a set of operations on an eliminates a grant, which may be the default grant.
object.
REVOKE
Example:
GRANT SELECT, UPDATE ON My_table TO some_user, another_user; REVOKE SELECT, UPDATE ON My_table FROM some_user, another_user;
[edit] Procedural extensions SQL is designed for a specific purpose: to query data contained in a relational database. SQL is a set-based, declarative query language, not an imperative language such as C or BASIC. However, there are extensions to Standard SQL which add procedural programming language functionality, such as control-of-flow constructs. These are: Source ANSI/ISO Standard Interbase/ Firebird IBM Microsoft/ Sybase Mimer SQL MySQL Oracle PostgreSQL PostgreSQL Common Name Full Name
SQL PL SQL Procedural Language (implements SQL/PSM) T-SQL Transact-SQL SQL/PSM SQL/Persistent Stored Module (implements SQL/PSM) SQL/PSM SQL/Persistent Stored Module (implements SQL/PSM) PL/SQL Procedural Language/SQL (based on Ada) Procedural Language/PostgreSQL Structured Query Language (based PL/pgSQL on Oracle PL/SQL) Procedural Language/Persistent Stored Modules (implements PL/PSM SQL/PSM)
In addition to the standard SQL/PSM extensions and proprietary SQL extensions, procedural and object-oriented programmability is available on many SQL platforms via DBMS integration with other languages. The SQL standard defines SQL/JRT extensions (SQL Routines and Types for the Java Programming Language) to support Java code in SQL databases. SQL Server 2005 uses the SQLCLR (SQL Server Common Language Runtime) to host managed .NET assemblies in the database, while prior versions of SQL Server were restricted to using unmanaged extended stored procedures which were primarily written in C. Other database platforms, like MySQL and Postgres, allow functions to be written in a wide variety of languages including Perl, Python, Tcl, and C.
Implementations are inconsistent and, usually, incompatible between vendors. In particular date and time syntax, string concatenation, nulls, and comparison case sensitivity vary from vendor to vendor. The language makes it too easy to do a Cartesian join (joining all possible combinations), which results in "run-away" result sets when WHERE clauses are mistyped. Cartesian joins are so rarely used in practice that requiring an explicit CARTESIAN keyword may be warranted. (SQL 1992 introduced the CROSS JOIN keyword that allows the user to make clear that a Cartesian join is intended, but the shorthand "comma-join" with no predicate is still acceptable syntax, which still invites the same mistake.) It is also possible to misconstruct a WHERE on an update or delete, thereby affecting more rows in a table than desired. (A work-around is to use transactions or habitually type in the WHERE clause first, then fill in the rest later.) The grammar of SQL is perhaps unnecessarily complex, borrowing a COBOL-like keyword approach, when a function-influenced syntax could result in more re-use of fewer grammar and syntax rules.
[edit] Cross-vendor portability Popular implementations of SQL commonly omit support for basic features of Standard SQL, such as the DATE or TIME data types. As a result, SQL code can rarely be ported between database systems without modifications. There are several reasons for this lack of portability between database systems:
The complexity and size of the SQL standard means that most implementors do not support the entire standard. The standard does not specify database behavior in several important areas (e.g., indexes, file storage...), leaving implementations to decide how to behave. The SQL standard precisely specifies the syntax that a conforming database system must implement. However, the standard's specification of the semantics of language constructs is less well-defined, leading to ambiguity. Many database vendors have large existing customer bases; where the SQL standard conflicts with the prior behavior of the vendor's database, the vendor may be unwilling to break backward compatibility. Software vendors often desire to create incompatibilities with other products, as it provides a strong incentive for their existing users to remain loyal (see vendor lock-in).
[edit] Standardization
SQL was adopted as a standard by the American National Standards Institute (ANSI) in 1986 as SQL-86[19] and International Organization for Standardization (ISO) in 1987. The original SQL standard declared that the official pronunciation for SQL is "es queue el".[2] Many Englishspeaking database professionals still use the nonstandard[20] pronunciation /sikwl/ (like the word "sequel").
Until 1996, the National Institute of Standards and Technology (NIST) data management standards program certified SQL DBMS compliance with the SQL standard. Vendors now self-certify the compliance of their products.[21] The SQL standard has gone through a number of revisions, as shown below: Year Name 1986 SQL-86 1989 SQL-89 1992 SQL-92 1999 SQL:1999 Alias Comments SQL-87 First formalized by ANSI. FIPS 127-1 Minor revision, adopted as FIPS 127-1. SQL2, FIPS 127-2 Major revision (ISO 9075), Entry Level SQL-92 adopted as FIPS 127-2. SQL3 Added regular expression matching, recursive queries, triggers, support for procedural and control-of-flow statements, non-scalar types, and some object-oriented features. Introduced XML-related features, window functions, standardized sequences, and columns with auto-generated values (including identity-columns). ISO/IEC 9075-14:2006 defines ways in which SQL can be used in conjunction with XML. It defines ways of importing and storing XML data in an SQL database, manipulating it within the database and publishing both XML and conventional SQL-data in XML form. In addition, it enables applications to integrate into their SQL code the use of XQuery, the XML Query Language published by the World Wide Web Consortium (W3C), to concurrently access ordinary SQL-data and XML documents. Legalizes ORDER BY outside cursor definitions. Adds INSTEAD OF triggers. Adds the TRUNCATE statement.[22]
2008 SQL:2008
Interested parties may purchase SQL standards documents from ISO or ANSI. A draft of SQL:2008 is freely available as a zip archive.[23] [edit] Standard structure The SQL standard is divided into several parts, including: SQL Framework, provides logical concept SQL/Foundation, defined in ISO/IEC 9075, Part 2. This part of the standard contains the most central elements of the language. It consists of both mandatory and optional features. The SQL/Bindings, specifies how SQL is to be bound to variable host languages, excluding Java.
The SQL/CLI, or Call-Level Interface, part is defined in ISO/IEC 9075, Part 3. SQL/CLI defines common interfacing components (structures and procedures) that can be used to execute SQL statements from applications written in other programming languages. SQL/CLI is defined in such a way that SQL statements and SQL/CLI procedure calls are treated as separate from the calling application's source code. Open Database Connectivity is a well-known superset of SQL/CLI. This part of the standard consists solely of mandatory features. The SQL/PSM, or Persistent Stored Modules, part is defined by ISO/IEC 9075, Part 4. SQL/PSM standardizes procedural extensions for SQL, including flow of control, condition handling, statement condition signals and resignals, cursors and local variables, and assignment of expressions to variables and parameters. In addition, SQL/PSM formalizes declaration and maintenance of persistent database language routines (e.g., "stored procedures"). This part of the standard consists solely of optional features. The SQL/MED, or Management of External Data, part is defined by ISO/IEC 9075, Part 9. SQL/MED provides extensions to SQL that define foreign-data wrappers and datalink types to allow SQL to manage external data. External data is data that is accessible to, but not managed by, an SQL-based DBMS. This part of the standard consists solely of optional features. The SQL/OLB, or Object Language Bindings, part is defined by ISO/IEC 9075, Part 10. SQL/OLB defines the syntax and symantics of SQLJ, which is SQL embedded in Java. The standard also describes mechanisms to ensure binary portability of SQLJ applications, and specifies various Java packages and their contained classes. This part of the standard consists solely of optional features. The SQL/MM (Multimedia), This extends SQL to deal intelligently with large, complex and sometimes streaming items of data, such as video, audio and spatial data. The SQL/Schemata, or Information and Definition Schemas, part is defined by ISO/IEC 9075, Part 11. SQL/Schemata defines the Information Schema and Definition Schema, providing a common set of tools to make SQL databases and objects self-describing. These tools include the SQL object identifier, structure and integrity constraints, security and authorization specifications, features and packages of ISO/IEC 9075, support of features provided by SQL-based DBMS implementations, SQL-based DBMS implementation information and sizing items, and the values supported by the DBMS implementations.[24] This part of the standard contains both mandatory and optional features. The SQL/JRT, or SQL Routines and Types for the Java Programming Language, part is defined by ISO/IEC 9075, Part 13. SQL/JRT specifies the ability to invoke static Java methods as routines from within SQL applications. It also calls for the ability to use Java classes as SQL structured user-defined types. This part of the standard consists solely of optional features. The SQL/XML, or XML-Related Specifications, part is defined by ISO/IEC 9075, Part 14. SQL/XML specifies SQL-based extensions for using XML in conjunction with SQL. The XML data type is introduced, as well as several routines, functions, and XML-to-SQL data type
mappings to support manipulation and storage of XML in an SQL database. This part of the standard consists solely of optional features.
.QL - object-oriented Datalog 4D Query Language (4D QL) Datalog Hibernate Query Language (HQL) - A Java-based tool that uses modified SQL HTSQL - URL based query method IBM Business System 12 (IBM BS12) - one of the first fully relational database management systems, introduced in 1982 ISBL Java Persistence Query Language (JPQL) - The query language used by the Java Persistence API in Java EE5 LINQ Object Query Language QBE (Query By Example) created by Mosh Zloof, IBM 1977 Quel introduced in 1974 by the U.C. Berkeley Ingres project. Tutorial D XQuery
List of "hello world" programs ALGOL 58's influence on ALGOL 60 ALGOL 60: Comparisons with other languages Comparison of ALGOL 68 and C++ ALGOL 68: Comparisons with other languages Compatibility of C and C++ Comparison of Pascal and Borland Delphi Comparison of Pascal and C Comparison of Java and C++ Comparison of C# and Java Comparison of C# and Visual Basic .NET
This box: view talk edit
The following tables compare general and technical information for a number of relational database management systems. Please see the individual products' articles for further information. This article is not all-inclusive or necessarily up-to-date. Unless otherwise specified in footnotes, comparisons are based on the stable versions without any add-ons, extensions or external programs.
Contents
[hide]
1 General information 2 Operating system support 3 Fundamental features 4 Limits 5 Tables and views 6 Indexes 7 Database capabilities 8 Data types 9 Other objects 10 Partitioning 11 Access control 12 Databases vs schemas (terminology) 13 See also 14 References 15 External links
ADABAS Software AG 1970 Adaptive Server Enterprise Sybase 1987 Advantage Database Server (ADS) Sybase 1992 Altibase Altibase Corp. July 2000 Apache Derby Datacom CUBRID DB2 Drizzle Empress Embedded Database FileMaker Firebird FrontBase HSQLDB H2 Informix Dynamic Server Ingres InterBase Linter SQL RDBMS LucidDB
Proprietary Proprietary June 2010 Proprietary Proprietary 2010-05Apache Apache 2004 10.6.1.0 19 License CA, Inc. ? 11.2 Proprietary NHN November, CUBRID October 4, GPL v2 Corporation 2008 3.0 2010 22 Apr IBM 1983 9.7 Proprietary 2009 Build BSD, GPL Brian Aker Mid-2008 1126 v2 Empress March 1979 10.20 Proprietary Software Inc 2010 FileMaker 1984 11.0 Mar 2010 Proprietary Firebird July 25, October 4, IPL and 2.5 project 2000 2010 IDPL FrontBase, January 1996 5.1.2 Proprietary Inc 2010 HSQL Development 2001 2.0.0 June 2010 BSD Group EPL and 2010-07H2 Software 2005 1.2.139 modified 25 MPL October IBM 1980 11.70.xC1 Proprietary 2010 Ingres 2008-12- GPL and Ingres Corp. 1974 Database 09 Proprietary 9.2 InterBase 2009-08Embarcadero 1984 Proprietary SMP 2009 10 RELEX 1990 6.1 Proprietary Group The January 0.9.3 GPL v2
Eigenbase Project MaxDB Microsoft Access Microsoft Visual Foxpro Microsoft SQL Server Microsoft SQL Server Compact (Embedded Database) MonetDB mSQL MySQL SAP AG Microsoft Microsoft Microsoft Microsoft
2007 ? 1992 ? 1989 2000 7.6 14 (2010) 9 (2005) 2008 R2 (v10.5) 2010 (v3.5 SP2) January 2008 Proprietary Proprietary Proprietary Proprietary Proprietary MonetDB June 2008 Public License v1.1 2006-06Proprietary 09 2010-12GPL or 15 Proprietary 2010-05Proprietary 08 Proprietary May 2008 Proprietary Proprietary September Proprietary 2009 Proprietary Proprietary September GPL or 2010 Proprietary 2003 Proprietary
Nexusdb HP NonStop SQL Omnis Studio OpenBase SQL Oracle Oracle Rdb OpenEdge OpenLink Virtuoso Paradox Pervasive PSQL Polyhedra DBMS
The MonetDB Developer 2004 5.6 Team Hughes 1994 3.8 [1] Technologies Sun Microsystems November 5.5.8 (now Oracle 1995 Corporation) Nexus Database September 3.04 Systems Pty 2003 Ltd HewlettSQL/MX 1987 Packard 2.3 4.3.1 TigerLogic July 1982 Release Inc 1no OpenBase 1991 11.0.0 International Oracle November 11g Corporation 1979 Release 2 Oracle 1984 7.2 Corporation Progress Software 1984 10.2B Corporation OpenLink 1998 6.2 Software Corel 1985 11 Corporation Pervasive 1982 11 Software ENEA AB 1993 8.3
2010 PostgreSQL PostgreSQL Global June 1989 Development Group R:BASE Technologies Birdstep Technology Birdstep Technology Scimore SmallSQL Sybase Unify Corp. 1982 1984 1990 2005 April 16, 2005 1992 1982 9.0.0 [2] PostgreSQL licence 2010-09(Free and 20 Open Source) Proprietary Proprietary Proprietary March Proprietary 2008 December LGPL 2008 July 9, Proprietary 2010 November Proprietary 2008 6 January Public 2010 domain Proprietary Proprietary Jan 2010 Proprietary
R:Base RDM Embedded RDM Server ScimoreDB SmallSQL SQL Anywhere SQLBase SQLite Superbase Teradata UniVerse
7.6 8.1 8.0 3.0 0.20 12.0 11.5 3.6.22 Scientific (2004) V12 10.3.6
D. Richard August 17, Hipp 2000 Superbase Teradata Rocket Software 1984 1984 1992
4th Dimension ADABAS Adaptive Server Enterprise Advantage Database Server Altibase Apache Derby 2 CUBRID Drizzle
DB2 5 Empress Embedded Database Firebird HSQLDB 2 H2 2 FileMaker Informix Dynamic Server Ingres InterBase Linter SQL RDBMS 6 LucidDB MaxDB Microsoft Access Microsoft Visual Foxpro Microsoft SQL Server Microsoft SQL Server Compact (Embedded Database) MonetDB MySQL 8 Omnis Studio OpenBase SQL Oracle 4 Oracle Rdb 3 OpenEdge OpenLink Virtuoso Pervasive PSQL Polyhedra 7 PostgreSQL R:Base RDM Embedded RDM Server
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes
Yes (Express Yes C) Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No No No No No Yes Yes Yes Yes Yes No No Yes Yes (OEM only) No Yes No Yes Yes
No
No No No No No No No No No No No No No No No No No Yes No No No No No No No No No No No No
No No No No No No No No No No No No No No No No No Yes No No No No No No No No No No No No
Yes No Maybe Yes Yes No Yes Partial No No No Maybe No No No No No Yes No No Yes No Yes No No No No No No
Yes Yes Yes Yes Yes Yes Yes Yes No No Yes Yes Yes Yes Yes
Yes Yes No (Solaris) Yes6 No Yes No No No No Yes Yes No Yes Yes No Yes Yes No Yes Yes No Yes Yes
Yes No Yes Yes Yes No Yes Yes Yes No No No Yes No Yes Yes Yes No
No No No No Yes Yes No No
No No No No Yes No No No
No Yes No No Maybe No No No
Note (1): Open source databases listed as UNIX-compatible will likely compile and run under z/OS's built-in UNIX System Services (USS) subsystem. Most databases listed as Linuxcompatible can run alongside z/OS on the same server using Linux on zSeries. Note (2): The database availability depends on Java Virtual Machine not on the operating system Note (3): Oracle Rdb was originally developed by DEC, and runs on OpenVMS Note (4): Oracle database 11g also runs on OpenVMS, HP/UX and AIX. Mac OS X is limited to 10gR2. 10g also supported BS2000/OSD and z/OS (31-bit), but that support has been discontinued in 11g. Earlier versions than 10g were available on a wide variety of platforms. Note (5): DB2 is also available for i5/OS, z/VM, z/VSE. Previous versions were also available for OS/2. Note (6): Linter SQL RDBMS also runs on OpenVMS, Solaris, QNX, OS9000 and OS9. Note (7): Polyhedra also runs on AIX, OSE, Solaris, LynxOS and VxWorks. Previous versions also ran on Ultrix, VMS and pSOS. Source code kits allow customers to port to other platforms. Note (8): MySQL also runs on Solaris, Opensolaris, and can be made from source on other platforms as well. Note (9): Binaries are not yet available for Mac OS X and BSD.
Adaptive Server Enterprise Advantage Database Server Altibase Apache Derby CUBRID Drizzle DB2 Empress Embedded Database Firebird HSQLDB H2 Informix Dynamic Server Ingres InterBase Linter SQL RDBMS LucidDB MaxDB Microsoft Access Microsoft Visual FoxPro Microsoft SQL Server Microsoft SQL Server Compact (Embedded Database) MonetDB MySQL OpenBase SQL Oracle Oracle Rdb OpenLink Virtuoso Polyhedra DBMS PostgreSQL RDM Embedded RDM Server ScimoreDB SQL Anywhere SQLBase SQLite Teradata
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes 2 Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes 2 Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes 2 Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Yes Yes 3 ? Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes
SQL API & SQL SQL SQL GUI & SQL SQL GUI & SQL API & SQL SQL SQL SQL SQL SQL & QUEL SQL GUI & SQL SQL SQL GUI & SQL GUI & SQL GUI & SQL GUI & SQL
Yes ? Yes SQL Yes GUI & SQL Yes API & GUI & SQL Yes SQL Yes [API]] & GUI & SQL Yes SQL Yes GUI & SQL Yes SQL & API Yes SQL & API Partial SQL Yes SQL Yes API & GUI & SQL [3] Optional SQL Yes SQL
UniVerse
Yes
Multiple Interface
Note (1): Currently only supports read uncommited transaction isolation. Version 1.9 adds serializable isolation and version 2.0 will be fully ACID compliant. Note (2): MySQL supports multiple storage engines, some of which are not fully ACID compliant. See MyISAM and InnoDB for details. Note (3): Support for Unicode is new in version 10.0.
[edit] Limits
Information about data size limits. Max Max Max DB table row size size size 4th limite Dimen d sion Max Max Max Max Max Min DAT colum Max columns per NUM Blob/Cl CHAR DATE E n row BER ob size size value value name size size 200 GB 200 GB (2 GiB (2 GiB 65135 64 bits ? ? ? Unicode Unicod ) e) ? 64 bits ? ? 128
Advan tage 16 EB 65135/ Unlim 65530 4 GB (4 Databa (16 (10+AverageFieldNa ited B GiB) se EiB) meLength) Server
254 Apach 2,147,48 Unlim Unlim Unlim (VARC e 1012 (5000 in views) 3,647 ? ited ited ited HAR: Derby chars 32672) 1 GB (GLO CUBR 2 EB 2 EB ? 6400 type 1 GB 64 bits ID supporte d) 4 GB (longtext Unlim 64 KB Drizzle 64TB 8KB 1000 , 64 bits ited (text) longblob ) DB2 512 512 32,67 1012 2 GB 32 KB 64 bits
0001
9999
254
0001 0001
9999 9999
64 128
TB (512 TiB) Empre ss Embed Unlim ded ited Databa se Firebir Unlim d ited 1 HSQL 64 TB DB H2 64 TB
TB
7B
(32 KiB)
32,767
2 GB
2 GB 64 bits
32
2 GB 64 TB 7 64 TB 7
32,767 64 bits 100 B Unlimit Unlim 0001ed 8 ited 8 01-01 Unlimit 64 bits 999999 ed 8 99
32768
31
32765 Inform bytes ix (exclu ~128P ~128P Dynam sive of B B ic large Server object s) Unlim Unlim 256 Ingres ited ited KB InterB Unlim ~32 65,53 ase ited 1 TB 6B 64KB (w/o Linter BLOB SQL Unlim 2^30 s), RDBM ited rows 4GB S (BLO B) Micros oft 2 GB 2 GB Access
32765
4TB
32765 10^32
2 GB 2 GB
32 31
250
4GB
4KB 64 bits
16 MB
255
64 KB (memo field), 1 255 B GB (text 32 bits 0100 ("OLE field) Object" field) 2 GB 16 MB 32 bits 0001
9999
255
9999
524,2 58 TB (32,76 Micros 7 files oft 524,2 Unlim * 16 SQL 58 TB ited TB Server max file size) Micros oft SQL Server Compa 8060 4 GB 4 GB ct Bytes (Embe dded Databa se) MyIS AM storag e limits: 256T MySQ Unlim 64 B; L5 ited KB 3 Innod b storag e limits: 64TB 4 GB Unlim * ited (4 block GB * size block Oracle (with 8KB size BIGFI per LE tables tables pace) pace) Polyhe Limite 232 Unlim dra d only rows ited by availa ble
30000
2 GB
2 GB 6
126 bits 2
0001
9999
128
1024
500 MB 4000
126 bits 2
0001
9999
128
4096 4
9999
64
1000
-4712 9999
30
65536
4 GB 4 GB 32 bits 0001- 8000- 255 (subject (subject 01-01 12-31 to RAM) to RAM)
RAM, addres s space 1 GB (text, bytea) stored 250-1600 depending inline or Unlim 58748 1 GB -4713 on type 2 GB ited 97 (stored in pg_large object)
63
Scimor Unlim 8050 16 EB 255 16 TB 8000 B 64 bits ? ? ? eDB ited B 104 TB (13 files, Limite Limite SQL each d by d by 0001- 9999Anywh file up 45000 2 GB 2 GB 64 bits ? file file 01-01 12-31 ere to 8 size size TB (32k pages) ) 32 TB (230 pages No No * 32 SQLite ? ? 32767 1 GB 1 GB 64 bits DATE DATE ? KB type9 type9 max page size) 64 KB 9999wo/lo 12-31 Terada Unlim Unlim bs (64 Select 2048 2 GB 10,000 64 bits ? 30 ta ited ited GB 80991 w/lobs 231 ) (date); UniVe Unlim Unlim Unlim Unlimite Unlimit Unlim Unlimit Unlim Unlim Unlimited rse ited ited ited d ed ited ed ited ited Max Max Max Max columns per Max Max Max Min Max Max DB table row row Blob/Cl CHAR NUM DATE DAT colum size size size ob size size BER value E n
size
value
name size
Note (1): Firebird 2.x maximum database size is effectively unlimited with the largest known database size >980GB [4]. Firebird 1.5.x maximum database size: 32 TB. Note (2): limit is 1038using DECIMAL datatype [5] Note (3): InnoDB is limited to 8000 bytes (excluding VARBINARY, VARCHAR, BLOB, or TEXT columns) [6] Note (4): InnoDB is limited to 1000 columns [7] Note (6): Using VARCHAR(MAX) in SQL 2005 and later Note (7): When using a page size of 32 KB, and when BLOB/CLOB data is stored in the database file. Note (8): Java array size limit of 2,147,483,648 (2^31) objects per array applies. This limit applies to: number of characters in names, rows per table, columns per table, and characters per CHAR/VARCHAR. Note (9): Despite the lack of a date datatype, SQLite does include date and time functions, which work for timestamps between 0000-01-01 00:00:00 and 5352-11-01 10:52:47. Note (10): Informix DATETIME type has adjustable range from YEAR only through 1/10000th second. DATETIME date range is 0001-01-01 00:00:00.00000 through 9999-12-31 23:59:59.99999.
4th Dimension ADABAS Adaptive Server Enterprise Advantage Database Server Altibase Apache Derby CUBRID
Drizzle DB2 Empress Embedded Database Firebird HSQLDB H2 Informix Dynamic Server Ingres InterBase Linter SQL RDBMS LucidDB MaxDB Microsoft Access Microsoft Visual Foxpro Microsoft SQL Server Microsoft SQL Server Compact (Embedded Database) MonetDB MySQL OpenBase SQL Oracle Oracle Rdb OpenLink Virtuoso Polyhedra DBMS PostgreSQL SQL Anywhere ScimoreDB SQLite Teradata UniVerse
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes No Yes Yes Yes
No 4 Yes Yes No (only common views) No No No 2 Planned for inclusion in next major release No No No No No Yes Yes 3 No No No 4 Yes Yes Yes Yes No (only common views) Planned for inclusion in 9.1 5 Yes No No Yes No
Note (1): Server provides tempdb, which can be used for public and private (for the session) temp tables.[8] Note (2): Materialized views are not supported in Informix; the term is used in IBM's documentation to refer to a temporary table created to run the view's query when it is too complex, but you cannot for example define the way it is refreshed or build an index on it. The term is defined in the Informix Performance Guide [9].
Note (3): Query optimizer support only in Developer and Enterprise Editions. In other versions, a direct reference to materialized view and a query hint are required. [10]. Note (4): Materialized views can be emulated using stored procedures and triggers.[11]. Note (5): Materialized views can be emulated with stored procedures and triggers using PL/pgSQL, PL/Perl, PL/Python, or other procedural languages.[12].
[edit] Indexes
Information about what indexes (other than basic B-/B+ tree indexes) are supported natively. R-/R+ tree 4th Dimension ADABAS Adaptive Server Enterprise Advantage Database Server Apache Derby CUBRID Drizzle DB2 Empress Embedded Database Firebird HSQLDB H2 Informix Dynamic Server Ingres InterBase Linter SQL RDBMS 10 LucidDB ? ? No No No No No No Yes No No No Yes Yes No No No Hash Cluster ? No No No No No ? No No No Yes Yes Yes No No No Expressio Partia Revers Bitma GiS GI n l e p T N ? ? No Yes No No No Yes No Yes No No Yes ? ? No No No No No No Yes No No No Yes ? ? Yes Yes No Yes No Yes No Yes 1 No No Yes No No No No ? ? No Yes No No No Yes Yes No No No Yes ? ? ? ? Fulltext ? ? Yes Yes No[4] ? No Yes[5] No No[6] No Yes[7] Yes No No Yes[8] No Spatial ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
No No No No No No No No No No No No No No No No No No No No Yes Yes
Ingres v10 No No No No No No No
MaxDB Microsoft Access Microsoft Visual Foxpro Microsoft SQL Server Microsoft SQL Server Compact (Embedde d Database) MonetDB MySQL
No No No ?
No No Yes Yes 3
No No Yes Yes 4
No No Yes 2 No 3
No No Yes No
No No No No No No
No No[9] No
? ? ? Yes[11]
No No Yes[10]
No
No
No
No
No
No
No No
No[12]
Oracle Oracle Rdb OpenLink Virtuoso Polyhedra DBMS PostgreSQ L ScimoreD B SQL Anywhere SQLite Teradata UniVerse
Yes MEMORY MyISA , Cluster M tables (NDB), only InnoDB,5 tables only Cluster Yes 11 Tables No Yes No Yes No No Yes No Yes R-/R+ tree Yes Cluster Yes Yes No No No Yes Yes Hash
No
No No[13]
No No
No No
No No
No No
? ?
Yes 6 No No No Yes No No No
Yes ? Yes No
Yes Yes No Yes No No 3 3 3 Yes Yes Yes No No No Expressio Partia Revers Bitma GiS GI n l e p T N
? ? Spatial
Note (1): The users need to use a function from freeAdhocUDF library or similar. [13]
Note (2): Can be implemented for most data types using expression-based indexes. Note (3): Can be emulated by indexing a computed column (doesn't easily update) or by using an "Indexed View" (proper name not just any view works[23]) Note (4): Can be implemented by using an indexed view. [14] Note (5): InnoDB automatically generates adaptive hash index entries as needed. Note (6): Can be implemented using Function-based Indexes in Oracle 8i and higher, but the function needs to be used in the sql for the index to be used. Note (7): A PostgreSQL functional index can be used to reverse the order of a field. Note (8): PostgreSQL will likely support on-disk bitmap indexes in a future version. Version 8.2 supports a related technique known as "in-memory bitmap scans". Note (10): B+ tree and full-text only for now. Note (11): R-Tree indexing available in base edition with Locator but some functionality requires Personal Edition or Enterprise Edition with Spatial option
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Database Firebird HSQLDB H2 Informix Dynamic Server Ingres InterBase Linter SQL RDBMS LucidDB MaxDB Microsoft Access Microsoft Visual Foxpro Microsoft SQL Server Microsoft SQL Server Compact (Embedde d Database) MonetDB MySQL OpenBase SQL Oracle
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Yes Yes Yes Yes Yes ? Yes Yes Yes Yes Yes
Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes
? No Yes ? No ? Yes ? ? No ?
? No ? Yes ? ? ? ? ? ? ?
Yes Yes (2005 (2005 Yes and Yes Yes and beyond beyond) )
Yes
Yes
Yes
Yes
Yes
Yes[25]
Yes
No
No
Yes Yes
No
Yes
No
No
? Yes No Yes
? No No Yes
? No No
? No[26] ? Yes. Recursive CTEs introduced in 11gR2 supersedes similar construct called
? No ? Yes
? No[27] ? Yes[28]
CONNEC T BY Oracle Rdb OpenLink Virtuoso Polyhedra DBMS PostgreSQ L ScimoreD B SmallSQL SQL Anywhere SQLite Teradata UniVerse Yes Yes Yes Yes Yes ? Yes Yes Yes Yes ? ? Yes Yes ? ? Yes Yes Yes Yes ? ? Yes Yes ? ? Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes ? Yes Yes ? ? Yes Yes ? Yes ? Yes Yes Yes Yes Yes Yes Yes ? Yes Yes ? ? ? Yes ? ? Yes No ? ? ? Yes ? ? Yes No ? ? ? No[29] ? ? ? ?
Yes ? Yes ? No No No ? Blob Common Inne Oute Inner Merg Windowin Paralle Unio Intersec s and Table Except r r select e g l n t Clob Expressio joins joins s joins Functions Query s ns
GLO
MONETAR Y, BIT, BIT DATE, VARYING, DATETIM TABLE, E, TIME, N/A SET, TIMESTA MULTISET MP , SEQUENC E DATETIM E, DATE, TIMESTA MP ENUM, SERIAL
BINARY, INT (32- DOUBLE VARCH [ Drizzle bit), (aka DECIM AR, Static 31] BIGINT REAL) AL VARBIN (64-bit) (64-bit) ARY, TEXT,
BLOB
CHARA CTER, ECHAR ACTER, TINYIN CHARA T, CTER SQL_TI VARYIN NYINT G, or NATION INTEGE AL R8 REAL, DECIM CHARA SQL_RE AL, DATE, CTER, SMALLI AL or DEC, NATION NT, FLOAT32 NUMER AL EDATE, SQL_SM IC, Empres CHARA BINARY TIME, ALLINT DOUBLE SQL_DE CTER LARGE ETIME, s or PRECISI CIMAL VARYIN OBJECT EPOCH_T Embed Static INTEGE ON, or ded G and or BLOB IME, R16 SQL_DO SQL_N NLSCHA Databa TIMESTA INTEGE UBLE or UMERI RACTER BULK se MP, R, INT, FLOAT64 C MICROTI SQL_IN FLOAT or MESTAM CHARA TEGER SQL_FLO DOLLA CTER P or AT R LARGE INTEGE EFLOAT OBJECT, R32 TEXT, BIGINT, NATION SQL_BI AL GINT or CHARA INTEGE CTER R64 LARGE OBJECT, and NLSTEX T TINYIN T (8-bit), SMALLI CHAR, BINARY, DATE, NT (16DECIM VARCH VARBINA TIME, HSQL bit), DOUBLE AL, AR, RY, TIMESTA Static DB[32] INTEGE (64-bit) NUMER LONGV LONGVA MP, R (32IC ARCHA RBINARY INTERVA bit), R, CLOB , BLOB L BIGINT (64-bit)
SMALLI NT (16Informi bit), INT x (32-bit), Dynam INT8 Static ic (64-bit Server[3 proprieta 3] ry), BIGINT (64-bit) TINYIN T (8-bit), SMALLI NT (16Ingres[3 bit), Static 4] INTEGE R (32bit), BIGINT (64-bit)
DECIM SMALLF AL (32 LOAT digits (32-bit), float/fixe FLOAT d), (64-bit) MONEY
CHAR, VARCH AR, NCHAR, NVARC HAR, LVARC HAR, CLOB, TEXT C, CHAR, VARCH AR, LONG VARCH AR, NCHAR, NVARC HAR, LONG NVARC HAR, TEXT
SET, LIST, MULTISET DATE, , ROW, DATETIM BOO TIMESERI E, LEA ES, INTERVA N SPATIAL, L USER DEFINED TYPES
DATE, MONEY, ANSIDAT OBJECT_K E, EY, INGRESD TABLE_K ATE, N/A EY, USERTIME, DEFINED TIMESTA DATA MP, TYPES (via INTERVA OME) L
NUMER IC, Micros TINYIN DECIM oft T, FLOAT, AL, SQL Static SMALLI REAL SMALL Server[3 NT, INT, MONEY 5] BIGINT , MONEY
CURSOR, DATE, TIMESTA CHAR, DATETIM MP, VARCH BINARY, EOFFSET, HIERARC AR, VARBINA DATETIM HYID, TEXT, RY, E2, BIT UNIQUEID NCHAR, IMAGE, SMALLD ENTIFIER, NVARC FILESTRE ATETIME, SQL_VARI HAR, AM DATETIM ANT, NTEXT E, TIME XML, TABLE
Micros TIMESTA oft MP, SQL TINYIN NUMER ROWVERS Server NCHAR, BINARY, T, IC, ION, Compa FLOAT, NVARC VARBINA DATETIM Static SMALLI DECIM BIT UNIQUEID ct REAL HAR, RY, E NT, INT, AL, ENTIFIER, (Embe NTEXT IMAGE BIGINT MONEY IDENTITY, dded ROWGUID Databa COL se)[36] MySQ Static TINYIN FLOAT DECIM CHAR, TINYBLO DATETIM BOO ENUM,
L[37]
T (8-bit), SMALLI NT (16bit), MEDIU MINT (24-bit), INT (32bit), BIGINT (64-bit)
AL
BINARY, VARCH AR, VARBIN ARY, TEXT TINYTE XT, TEXT, MEDIU MTEXT, LONGTE XT
Static CHAR, + VARCH Dyna BINARY AR2, mic _FLOAT, Oracle[ NUMBE NUMBE CLOB, (throu BINARY 38] R R NCLOB, gh _DOUBL NVARC ANY E HAR2, DAT NCHAR A) INTEGE VARCH R8 (8AR, FLOAT32 bit), LARGE (32-bit), INTEGE VARCH Polyhe FLOAT Static R(16N/A AR (aka dra (aka bit), CHARA REAL; INTEGE CTER 64-bit) R (32LARGE bit) OBJECT) Postgre Static SMALLI REAL DECIM CHAR, SQL[39] NT (16- (32-bit), AL, VARCH bit), DOUBLE NUMER AR, INTEGE PRECISI IC TEXT R (32- ON (64bit), bit) BIGINT (64-bit)
SET, GIS data types (Geometry, Point, LEA Curve, N LineString, (aka Surface, E, DATE, BOO Polygon, TIMESTA L) = GeometryC MP, synon ollection, YEAR ym MultiPoint, for MultiCurve, TINY MultiLineSt INT ring, MultiSurfac e, MultiPolyg on) DATE, TIMESTA SPATIAL, MP IMAGE, (with/with AUDIO, out N/A VIDEO, TIMEZON DICOM, E), XMLType INTERVA L
LARGE BINARY BOO (aka DATETIM LEA BINARY E N LARGE OBJECT) BYTEA
N/A
DATE, BOO ENUM, TIME LEA POINT, (with/with N LINE, out LSEG, TIMEZON BOX, E), PATH, TIMESTA POLYGON MP , CIRCLE, (with/with CIDR, out INET,
TIMEZON E), INTERVA L REAL TEXT INTEGE (aka SQLite[ Dyna (aka R (64- FLOAT, N/A 40] mic CHAR, bit) DOUBLE CLOB) ) (64-bit) UniVer Dyna N/A N/A N/A N/A se mic Type Floating syste Integer Decimal String point m
BLOB
N/A
N/A Binary
N/A Date/Time
N/A Boole an
N/A Other
InterBase Linter SQL RDBMS LucidDB MaxDB Microsoft Access Microsoft Visual Foxpro Microsoft SQL Server Microsoft SQL Server Compact (Embedded Database) MonetDB MySQL OpenBase SQL Oracle Oracle Rdb OpenLink Virtuoso Polyhedra DBMS PostgreSQL ScimoreDB SQL Anywhere SQLite Teradata UniVerse
Yes No No Yes Yes No Yes (2000 and beyond) No No No 3 Yes Yes Yes Yes No Yes No Yes No No Yes
Yes Yes Yes Yes No Yes Yes Yes No Yes Yes Yes Yes Yes No Yes No Yes No Yes Yes
Yes Yes No Yes No Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes
Yes Yes Yes 2 Yes No Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes
Yes Yes Yes 2 Yes No Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes External Data Domain Cursor Trigger Function 1 Procedure 1 routine 1
Note (1): Both function and procedure refer to internal routines written in SQL and/or procedural language like PL/SQL. External routine refers to the one written in the host languages, such as C, Java, Cobol, etc. "Stored procedure" is a commonly used term for these routine types. However, its definition varies between different database vendors. Note (2): In Derby, H2, and LucidDB, users code functions and procedures in Java. Note (3): ENUM datatype exist. CHECK clause is parsed, but not enforced in runtime. Note (4): In Drizzle the user codes functions and procedures in C++.
[edit] Partitioning
Information about what partitioning methods are supported natively.
Range Hash 4th Dimension ADABAS Adaptive Server Enterprise Advantage Database Server Apache Derby CUBRID IBM DB2 Empress Embedded Database Firebird HSQLDB H2 Informix Dynamic Server Ingres InterBase Linter SQL RDBMS MaxDB Microsoft Access Microsoft Visual Foxpro Microsoft SQL Server Microsoft SQL Server Compact (Embedded Database) MonetDB MySQL OpenBase SQL Oracle Oracle Rdb OpenLink Virtuoso Polyhedra DBMS PostgreSQL ScimoreDB SQL Anywhere SQLite Teradata UniVerse ? ? Yes No No Yes Yes No No No No Yes Yes No No No No No Yes No Yes (M5) Yes ? Yes Yes Yes No Yes 1 No No No Yes Yes ? ? Yes No No Yes Yes No No No No Yes Yes No No No No No No No Yes (M5) Yes ? Yes Yes No No Yes 1 Yes No No Yes Yes
Native Composite List Shadow Replication (Range+Hash) API ? ? ? ? ? ? ? ? No Yes ? ? No No No Yes No No ? ? No Yes No ? Yes Yes ? ? No No No Yes No No Yes No No No No No No No No No Yes Yes ? Yes Yes Yes No No No No Yes Yes No No No No No No ? ? No No No No No No No No No No ? ? No Yes (M5) Yes ? Yes ? No No Yes 1 No No No Yes Yes No No Yes ? Yes ? No No Yes 1 No No No Yes Yes No ? ? ? ? ? ? No ? No ? ? ? ? Yes ?
? ? ? ? ? No ? Yes ? ? ? Yes Native Composite Range Hash List Shadow Replication (Range+Hash) API
Note (1): PostgreSQL 8.1 provides partitioning support through check constraints. Range, List and Hash methods can be emulated with PL/pgSQL or other procedural languages. [15]
Yes
No
No
Yes
No
No
Yes
? Yes (EAL4+ 6 )
Yes
Yes
Yes
Yes Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
No
Firebird
No
No
Yes
No
No
No 7
No No ?
10
No ?
No Yes
No No ?
Yes Yes
Linter Yes SQL (with RDBMS SSL) Yes MySQL (SSL with 4.0) OpenBa se SQL Microso ft SQL Server Microso ft SQL Server Compac t (Embed ded Databas e) Oracle
Yes
No
Yes
Yes Yes
Yes
Yes
No
No
No
Yes
?8
No
Yes
No
? Yes (EAL1+ 1 )
Yes
Yes
Yes
Yes
Yes
No (not relevant, No (not No (not No (not only file relevan relevant) relevant) permissi t) ons)
Yes
No
Yes
Yes
Yes
Yes
Yes Yes
Postgre SQL
Yes
No
Yes (as of Yes 9.0 with (LDAP, Yes passwordc Kerberos, [19] heck ... 9) module)
Yes
No
Yes
No
Yes
Yes (Kerberos)
Yes
Yes
Yes
No
Yes
No (not No (not No (not No (not Partial Yes (file Yes Yes relevant, relevan relevant) relevant) (no access) only file t) securit permissi y
No
ons)
Yes (optional ? )
Yes
page) [20] Partial (need to registe r; depen d on which produ ct) [21]
Yes
Yes Yes
Yes
Yes (EAL4+ 1 )
Note (1): Network traffic could be transmitted in a secure way (not clear-text, en general SSL encryption). Precise if option is default, included option or an extra modules to buy. Note (2): Options are present to set a minimum size for password, respect complexity like presence of numbers or special characters. Note (3): How do you get security updates? Is it free access, do you need a login or to pay? Is there easy access through a Web/FTP portal or RSS feed or only through offline access (mail CD-ROM, phone). Note (4): Does database process run as root/administrator or unprivileged user? What is default configuration? Note (5): Is there a separate user to manage special operation like backup (only dump/restore permissions), security officer (audit), administrator (add user/create database), etc.? Is it default or optional? Note (6): Common Criteria certified product list Note (7): FirebirdSQL seems to only have SYSDBA user and DB owner. There is no separate roles for backup operator and security administrator. Note (8): User can define a dedicated backup user but nothing particular in default install [22] Note (9): See manual Authentication methods Note (10): Informix Dynamic Server supports PAM and other configurable authentication. By default uses OS authentication.
This section may contain original research. Please improve it by verifying the claims made and adding references. Statements consisting only of original research may be removed. More details may be available on the talk page. (June 2010) The SQL specification makes clear what an "SQL schema" is; however, different databases implement it incorrectly. To compound this confusion the functionality can, when incorrectly implemented, overlap with that of the parent-database. An SQL schema is simply a namespace within a database, things within this namespace are addressed using the member operator dot ".". This seems to be a universal amongst all of the implementations. A true fully (database, schema, and table) qualified query is exemplified as such: SELECT * FROM
database.schema.table
Now, the issue, both a schema and a database can be used to isolate one table, "foo" from another like named table "foo". The following is pseudo code:
SELECT * FROM db1.foo
vs. SELECT * FROM db2.foo (no explicit schema between db vs. SELECT * FROM [db1.]alternate.foo (no
and table)
SELECT * FROM [db1.]default.foo
explicit db prefix) The problem that arises is that former MySQL users will create multiple databases for one project. In this context MySQL databases are analogous in function to Postgres-schemas, insomuch as Postgres lacks off-the-shelf cross-database functionality that MySQL has. Conversely, PostgreSQL has applied more of the specification implementing cross-table, cross-schema, and then left room for future cross-database functionality. MySQL aliases behind the scenes, schema with database, such that CREATE SCHEMA, and CREATE DATABASE are analogs. It can be said that MySQL therefore, has implemented cross-table functionality, skipped schema functionality entirely and provided similar functionality into their implementation of a database. In summary, Postgres fully supports schemas but lacks some functionality MySQL has with databases, while MySQL doesn't even attempt to support true schemas. Oracle has its own spin where creating a user is synonymous with creating a schema. Thus a database administrator can create a user called PROJECT and then create a table PROJECT.TABLE. Users can exist without schema objects, but an object is always associated with an owner (though that owner may not have privileges to connect to the database). With the Oracle 'shared-everything' RAC architecture, the same database can be opened by multiple servers concurrently. This is independent of replication, which can also be used, whereby the data is copied for use by different server. In the Oracle view, the 'database' is a set of files which contains the data while the 'instance' is a set of processes (and memory) through which a database is accessed. The end result is confusion between the database factions. The Postgres and Oracle communities maintain that generally one database is all that is needed for one project. MySQL proponents
maintain that schemas have no legitimate purpose when the functionality can be achieved with databases. Postgres adheres to more of the SQL specification, in a more intuitive fashion (bottomup), while MySQL's pragmatic counterargument allows their users to get the job done without any major drawback.