Chapter 2 Data Management - Applications – D427 UPDATED ACTUAL
Questions and CORRECT Answers
A. Cities where the population is at least 2
1) What does the pattern 'A%' match when used with the
LIKE operator?
A. Languages starting with 'A' and ending with 'n'
B. Languages starting with 'A' followed by any number of
characters
C. Languages starting with 'A' and exactly one character
after
D. Languages containing 'A' anywhere in the word;
2) When joining tables with columns of the same name,
what is used to distinguish between them?
A. Table prefixes
B. Column suflxes
C. Table aliases
D. Subqueries
3) Which join combines two tables without comparing
columns, resulting in all possible combinations of rows?
A. Inner join
B. Cross join
C. Left join
D. Equijoin
4) What does the following SQL query return?
SELECT CountryCode, District, COUNT(*)
FROM City
GROUP BY CountryCode, District
HAVING COUNT(*) >= 2;
,B. Languages starting with 'A' followed by any number
ofcharacters
A. Table prefixes
B. Cross join
B. Countries and districts that have at least 2 cities
, B. Countries and districts that have at least 2 cities
C. Districts with at least 2 countries
D. Total number of cities in each country
5) Which SQL clause is used to combine rows from two or
more tables, based on a related column between them?
A. SELECT B. JOIN
B. JOIN
C. WHERE
D. GROUP BY
6) Which of the following statements about aggregate
functions and NULL values is true?
A. Aggregate functions consider NULL values as zero
B. Aggregate functions ignore NULL values
B. Aggregate functions ignore NULL values
C. Aggregate functions return NULL if any value is NULL
D. Aggregate functions cannot be used on columns with
NULL values
7) Which of the following is NOT an advantage of using
views?
A. Protecting sensitive data by hiding certain columns C. Improving performance by always storing view data
B. Saving complex queries for reuse
C. Improving performance by always storing view data
D. Saving optimized queries for consistent performance
8) Which of the following is a valid use of the GROUP BY
clause?
C. To group rows that have the same values in specified
A. To filter rows based on an aggregate function columns
B. To sort the result set
C. To group rows that have the same values in specified
, columns
D. To limit the number of returned rows
9) The BETWEEN operator is equivalent to which of the
following expressions?
A. value > minValue AND value < maxValue B. value >= minValue AND value <= maxValue
B. value >= minValue AND value <= maxValue
C. value >= minValue OR value <= maxValue
D. value BETWEEN minValue OR maxValue
10) Which clause in SQL is used to sort the result-set in
ascending or descending order?
A. GROUP BY B. ORDER BY
B. ORDER BY
C. HAVING
D. WHERE
11) What is the correct order of clauses in an SQL SELECT
statement?
A. SELECT, WHERE, GROUP BY, HAVING, ORDER BY A. SELECT, WHERE, GROUP BY, HAVING, ORDER BY
B. SELECT, GROUP BY, WHERE, HAVING, ORDER BY
C. SELECT, WHERE, HAVING, GROUP BY, ORDER BY
D. SELECT, HAVING, WHERE, GROUP BY, ORDER BY
12) In the expression `Name BETWEEN 'Anele' AND 'Jose'`,
which data type must the Name column have for this
expression to be valid?
C. VARCHAR
A. INT
B. DATE
C. VARCHAR
D. BOOLEAN
Questions and CORRECT Answers
A. Cities where the population is at least 2
1) What does the pattern 'A%' match when used with the
LIKE operator?
A. Languages starting with 'A' and ending with 'n'
B. Languages starting with 'A' followed by any number of
characters
C. Languages starting with 'A' and exactly one character
after
D. Languages containing 'A' anywhere in the word;
2) When joining tables with columns of the same name,
what is used to distinguish between them?
A. Table prefixes
B. Column suflxes
C. Table aliases
D. Subqueries
3) Which join combines two tables without comparing
columns, resulting in all possible combinations of rows?
A. Inner join
B. Cross join
C. Left join
D. Equijoin
4) What does the following SQL query return?
SELECT CountryCode, District, COUNT(*)
FROM City
GROUP BY CountryCode, District
HAVING COUNT(*) >= 2;
,B. Languages starting with 'A' followed by any number
ofcharacters
A. Table prefixes
B. Cross join
B. Countries and districts that have at least 2 cities
, B. Countries and districts that have at least 2 cities
C. Districts with at least 2 countries
D. Total number of cities in each country
5) Which SQL clause is used to combine rows from two or
more tables, based on a related column between them?
A. SELECT B. JOIN
B. JOIN
C. WHERE
D. GROUP BY
6) Which of the following statements about aggregate
functions and NULL values is true?
A. Aggregate functions consider NULL values as zero
B. Aggregate functions ignore NULL values
B. Aggregate functions ignore NULL values
C. Aggregate functions return NULL if any value is NULL
D. Aggregate functions cannot be used on columns with
NULL values
7) Which of the following is NOT an advantage of using
views?
A. Protecting sensitive data by hiding certain columns C. Improving performance by always storing view data
B. Saving complex queries for reuse
C. Improving performance by always storing view data
D. Saving optimized queries for consistent performance
8) Which of the following is a valid use of the GROUP BY
clause?
C. To group rows that have the same values in specified
A. To filter rows based on an aggregate function columns
B. To sort the result set
C. To group rows that have the same values in specified
, columns
D. To limit the number of returned rows
9) The BETWEEN operator is equivalent to which of the
following expressions?
A. value > minValue AND value < maxValue B. value >= minValue AND value <= maxValue
B. value >= minValue AND value <= maxValue
C. value >= minValue OR value <= maxValue
D. value BETWEEN minValue OR maxValue
10) Which clause in SQL is used to sort the result-set in
ascending or descending order?
A. GROUP BY B. ORDER BY
B. ORDER BY
C. HAVING
D. WHERE
11) What is the correct order of clauses in an SQL SELECT
statement?
A. SELECT, WHERE, GROUP BY, HAVING, ORDER BY A. SELECT, WHERE, GROUP BY, HAVING, ORDER BY
B. SELECT, GROUP BY, WHERE, HAVING, ORDER BY
C. SELECT, WHERE, HAVING, GROUP BY, ORDER BY
D. SELECT, HAVING, WHERE, GROUP BY, ORDER BY
12) In the expression `Name BETWEEN 'Anele' AND 'Jose'`,
which data type must the Name column have for this
expression to be valid?
C. VARCHAR
A. INT
B. DATE
C. VARCHAR
D. BOOLEAN