Thomas Edison State College
Author Note
This paper was prepared for CIS 311 Database Management taught by Mr. Bob O 'Brien
Abstract
SQL commands are lines of SQL code that ask the SQL application to perform simple tasks with data inside of a database. Often we refer to commands as query statements or scripts; all of these terms are synonymous. Most of the commands and statements are fairly standard and will work across multiple database applications. SQL commands are declarative sentences executed against an SQL database. The typical command is comprised of several different components including clauses, functions, expressions, or objects but the only required components are a SQL Clause and the data object. An SQL clause is the word or phrase that begins each SQL command statement and the single most important component to any SQL command. Looking at the clause of any given SQL command usually tells the SQL programmer what that particular command intends to do to the database. For instance, a SELECT command begins with the SELECT clause and any level of SQL programmer will recognize the SELECT query as a command selecting data from the database. In this paper three commands will be explained. UNION, INTERSECT, and MINUS. We will also take a look at relational join operation.
,
The UNION command combines all rows from two tables, excluding duplicate rows. The tables must have the same attribute characteristics to be used in the UNION. When two or more tables share the same number of columns, and when their corresponding columns share the same domains, they are said to be union-compatible; which means that the number of attributes must be the same and their corresponding data types must be alike. In practice, some RDBMS vendors require the data types to be “compatible” but not necessarily “exactly the same.”
The INTERSECT command yields only the rows that appear in both tables. As was true in the case of UNION,
Cited: Coronel C., Morris S., Rob P. (2011). Database Systems: Design, Implementation,and Management (Ninth Edition). Boston: Cengage Learning