Databases Reference
In-Depth Information
condition is met, then comparing every record of one table to every record of the
other table as in a nested-loop join is unnecessary. The system can simply start at
the top of each table or index, as the case may be, and move downwards, without
ever having to move upwards.
SUMMARY
SQL has become the standard relational database management data definition
and data manipulation language. Data retrieval in SQL is accomplished with the
SELECT command. SELECT commands can be run in a direct query mode or
embedded in higher-level language programs in an embedded mode. The SELECT
command can be used to retrieve one or more rows of a table, one or more columns
of a table, or particular columns of particular rows. There are built-in functions
that can sum and average data, find the minimum and maximum values of a set of
data, and count the number of rows that satisfy a condition. These built-in functions
can also be applied to multiple subsets or groups of rows. The SELECT command
can also integrate data by joining two or more tables. Subqueries can be developed
for certain specific circumstances. There is a strategy for writing SQL commands
successfully.
Performance is an important issue in the retrieval of data from relational
databases. All relational database management systems have a relational query
optimizer, which is software that looks for a good way to solve each relational query
presented to it. While the ways that these query optimizers work are considered
trade secrets, there are several standard concepts and techniques that they generally
incorporate.
KEY TERMS
Access path
AND/OR
Base table
BETWEEN
Built-in functions
Comparisons
Data definition language (DDL)
Data manipulation language (DML)
Declarative
DISTINCT
Embedded mode
Filtering
GROUP BY
HAVING
IN
LIKE
Merge-scan join
ORDER BY
Nested-loop join
Procedural
Query
Relational query optimizer
Search argument
SELECT
Structured Query Language (SQL)
Subquery
QUESTIONS
1. What are the four basic operations that can be
performed on stored data?
2. What is Structured Query Language (SQL)?
3. Name several of the fundamental SQL commands
and discuss the purpose of each.
4. What is the purpose of the SQL SELECT command?
5. How does the SQL SELECT command relate to the
relational Select, Project, and Join concepts?
6. Explain the difference between running SQL in
query mode and in embedded mode.
7. Describe the basic format of the SQL SELECT
command.
Search WWH ::




Custom Search