Who Uses Database Languages
Database administrators use database languages to manage data descriptions — tables, attributes, constraints — for the entire organization. In cooperation with data architects, system administrators ensure that description data stays consistent, up to date, and aligned with enterprise-wide data architecture. Database specialists define, install, and monitor databases using system tables built for that purpose.
Application programmers use database languages to run analyses and apply changes programmatically. The final user group includes infrequent users and, most importantly, data analysts and data scientists who rely on these languages for everyday analysis requirements.
Union Compatibility
Two relations are union-compatible if they have the same number of attributes and the data formats of corresponding attribute categories are identical. This property allows set operations like union, intersection, and difference to combine or compare relations meaningfully.
Set Operations
Two union-compatible relations R and S can be combined by a set union R ∪ S, where all entries from R and all entries from S appear in the resulting table. Set intersection is defined as R ∩ S = R \ (R \ S), extracting only tuples that belong to both relations. Set difference R \ S returns tuples in R that are not in S.
Select Operator
The select operator σ in an expression σF(R) extracts a selection of tuples from relation R based on formula F. F consists of attribute names and value constants connected by relational operators like less than, greater than, or equals, or by logical operators such as AND, OR, and NOT. The result σF(R) includes all tuples from R that satisfy condition F.
Join Operators
Join operators merge two relations into a single one. The join predicate contains one attribute from R and one from S, correlated by a relational operator to combine the relations. When the join predicate uses the equals operator, the result is called an equi-join — the most common form of join in practice.
Division Operator
A division of relation R by relation S is only possible if S is contained within R as a subrelation. The divide operator R ÷ S calculates a subrelation R′ from R such that all possible combinations of tuples r′ from R′ with tuples s from S are part of R. In other words, the Cartesian product R′ × S must be contained within R.
Relational Completeness
Languages are relationally complete if they are at least equivalent to relational algebra — meaning all operations executable with relational algebra must also be supported. SQL and QBE are equally as powerful as relational algebra and are therefore considered relationally complete. A database language achieves relational completeness if it can represent the operators of relational algebra: at minimum, set union, set difference, Cartesian product, projection, and selection.
Practical Requirements
To be practically useful, relationally complete languages need additional functions beyond pure algebra. They must allow defining tables and attributes, support insert, change, and delete operations, and include aggregate functions like addition, maximum and minimum determination, and average calculation. Formatting and printing tables by various criteria — including sorting orders and control breaks — must be possible.
Languages for relational databases must include elements for assigning user permissions and protecting databases. Arithmetic expressions and calculations should be supported, multi-user access should be enabled, and commands for data security must be included to handle concurrent operations and prevent unauthorized access.
SEQUEL and SQL
The concept behind SEQUEL was to create a relationally complete query language based on English words like select, from, where, count, and group by, rather than mathematical symbols. This approach made the language more accessible to non-mathematicians and became the foundation for modern SQL.
Query by Example
Query by Example, or QBE, is a database language that allows users to create and execute queries directly within the table using interactive examples. Instead of writing text-based commands, users fill in example values and conditions in a grid, making it easier for those less familiar with formal query syntax to retrieve and manipulate data.