This module discussed various techniques for selecting data from your database.
This module covered many important topics that you will use very often in SQL Server.
Having completed this module, you should be able to:
- Construct inner and outer joins
- Alias your table and column names
- Construct union queries
- Write subqueries and understand when they are used
- Write aggregated queries
Apply additional keywords that can be used in your queries
This module introduced you to the following terms:
Alias: An alternative name for a database object that makes referring to that object easier.
For example, if you construct a query by specifying the fully-qualified name of the database (including server name, database name, owner, and table), it is easier to alias this long string of objects so that you do not have to specify it
every time you access it's objects. Note, however, that an alias is useful only within a single Transact-SQL statement.
- Aggregate: A query or part of a query that performs mathematical summing on one or more columns. Aggregates are used in conjunction with the GROUP BY clause.
- Union: A query that combines the results of multiple queries into a single result set.
- Subquery: A query within a query.
- Inner join: A link between tables in a database that displays only the rows with a match (true value of the join condition) for both join tables. An inner join does not guarantee the return of every row of data that you expect will be returned.
- Outer join: A link between tables that guarantees the return of every row of data that you expect will be returned, but that also can require more resources in order to execute. Includes the left outer join, right outer join, and full outer join.
- GROUP BY: Specifies how a query should break, based on values that change in the columns represented after the GROUP BY keywords.
- ORDER BY: SQL keywords that specify the order in which the data returned from a query will be returned.
- Distributed query: A database query that accesses more than one data source. These data sources can be located on one or more servers, in one or more databases.
- OLE DB provider: A low-level software interface that is written for a specific type of data source, such as a text file, or SQL Server. This interface is necessary so that database-specific implementations can be isolated from higher-level components.
- Heterogeneous: Queries that are constructed across one or more SQL Servers. A heterogeneous query can include data from other sources, such as text files, Oracle, or Informix.
In the next module, learn about inserting data into your SQL Server 7 tables.