CH 2B- Introduction to Structured Query Language Flashcards
techniques for querying data from multiple tables
– The SQL subquery
– The SQL join
SQL subquery
– A nested query
– A query within a query
*only the columns of the top level query can be displayed in the query results!
- Multiple subqueries can be used to process three or even more tables.
- All parts if the SQL SELECT statement syntax can be applied to the table displaying the results of an SQL query using subqueries.
**can only be used to retrieve data from
the “top table.”
SQL join operation
used to combine parts or all of two or more tables.
a) Explicit join ─ the SQL JOIN operator is used as part
of the SQL statement.
b)Implicit join ─ the SQL JOIN operator is not used as
part of the SQL statement.
**can be used to obtain data from any number
of tables, including the “top table” of the subquery.
SQL CROSS JOIN
-combines each row in one table with every row in another table.
Implicit SQL INNER JOIN
-selecting rows by matching by the primary key values
of one table with the foreign key values of a second table.
does not appear in the SQL statement, this is an implicit join.
Explicit SQL INNER JOIN
Selecting rows by matching by the primary key values of one table with the foreign key values of a second table
*does appear in the SQL statement,
this is an explicit join.
SQL ALL Keyword
-wanted the duplicated rows to be displayed in the query output
SQL INTERSECT Operator
-In both
SQL EXCEPT Operator
-Excluding one option