BUSLOG REVIEWER
BUSLOG REVIEWER
retrieve.
-An alternate name for a table or column.
-FROM: Identifies the table where the
AS columns exist.
-Used to assign an alternate name to a column
or table. Comparison operators
ASC -Used to perform comparisons among
-Used to sort column values in ascending expressions.
order. Expression
Clause -Any data type that returns a value.
-A segment of an SQL statement that assists in Logical operators
the selection and manipulation of data.
-Used to test for the truth of some
Concatenation condition.
-Merging values or columns together. WHERE clause
DESC -Used to filter retrieved records.
-Used to sort column values in descending Wildcard characters
order.
-Special characters used to match parts
DISTINCT of a value.
-Used to display unique values in a column.
DISTINCT ROW
-Used to exclude records based on the
entire duplicate records, not just duplicate
fields.
ORDER BY
-Used to sort retrieved records in descending
or ascending order.
Query Aggregate functions
-A question or command posed to the -Used to return a single value based on
database. calculations on values stored in a column.
Arithmetic operators
Query Design view -Used to perform mathematical
-Enables you to create queries by selecting calculations.
table and column names and specifying Date and time functions
conditions on the data you want to retrieve.
-Used to manipulate values based on
Result set the time and date.
-Records retrieved from the database. String functions
SELECT statement -Used to manipulate strings of character(s).
-Used to retrieve records from the
database.
TOP
-Used to display records that fall at the top or
bottom of a range that is specified by an
ORDER BY clause.
TOP PERCENT
-Used to display a percentage of records that
fall at the top or bottom of a range that is
specified by an ORDER BY clause.
SECOND () Used to return an integer
from 0 to 59
Function Description
DATEPART
(Cont.)
Quiz 6
3. True or False. Table aliases are created just
2. Will the following query work? like column aliases.
SELECT DATE () AS TodaysDate -TRUE – Table aliases are created similarly to
FROM Transactions column aliases, often using the AS
GROUP BY CustomerID; keyword.
-It will not work. DATE() is typically a MySQL
function that returns the current date. This 4. True or False. The UNION ALL keyword is
query asks for a single value (DATE()) without used to combine records from two queries
any aggregation or a column to group by, while
which conflicts with the GROUP BY clause. excluding duplicate records.
GROUP BY Clause Rules: When you use -FALSE – The UNION ALL keyword includes
GROUP BY, every column in the SELECT duplicate records; it is UNION that
clause must either. Be part of the GROUP BY excludes duplicates.
clause, or Use an aggregate function (e.g.,
SUM(), COUNT()). Since DATE() is constant 5. True or False. A left outer join is used to
(returns the same value for all rows), it doesn't select every record from the table specified to
make sense to group by CustomerID because the left
no other columns are being aggregated. of the LEFT JOIN keywords.
-TRUE – A left outer join includes all records
3. True or False. When using the GROUP BY from the table on the left and the
clause with a WHERE clause, the GROUP BY matched records from the right table.
clause must appear before the WHERE clause.
- FALSE. Whenever you use the GROUP BY Quiz 9
clause with a WHERE clause, the GROUP 1. True or False. A correlated subquery
BY clause must appear after the WHERE executes once for each record a referenced
clause. query returns.
*TRUE A correlated subquery executes once
4. True or False. The GROUP BY clause must for each record returned by the outer
appear before the ORDER BY clause. query.
- FALSE. The GROUP BY clause must appear
before the ORDER BY clause. 2. True or False. The NOT operator is used to
instruct Microsoft Access to match any
5. True or False. The HAVING clause filters condition
rows before any data is grouped. opposite of the one defined.
-FALSE. The WHERE clause can be used with *TRUE The NOT operator is used to match
the HAVING clause since the WHERE clause conditions opposite to those defined.
filters rows before any data is grouped and the
HAVING clause filters rows after data is 3. True or False. The IN predicate is often used
grouped. with the following comparison operators:
*FALSE The IN predicate is typically used with
Quiz 8 lists of values, not comparison
1. True or False. A join enables you to use a operators like =, <, >, <=, >=.
single SELECT statement to query two or more
tables simultaneously. 4. True or False. A subquery linked by the IN
-TRUE A join enables querying two or more predicate can return two columns.
tables simultaneously in a single *FALSE A subquery linked by the IN predicate
SELECT statement. must return a single column.
2. True or False. The following shows the 5. True or False. Subqueries nested within
correct syntax to qualify a table and column other queries are processed first, working
name: outward.
Tablename,Columnname. *TRUE Subqueries are processed starting from
-FALSE The correct syntax for qualifying a the innermost query outward.
table and column name is
Tablename,Columnname (not a comma).