Deck 9: Advanced Query Formulation With SQL

Full screen (f)
exit full mode
Question
Outer join problems cannot be formulated in SQL at all using the cross product style.
Use Space or
up arrow
down arrow
to flip the card.
Question
To be union compatible each corresponding column from both temporary tables must have compatible data types.
Question
Using the join operator style,the result set of a one-sided outer join depends on the direction and position of the table names in the query.
Question
The following SQL statement is an example of a Type II nested query:
SELECT StdSSN,StdLastName,StdMajor
FROM Student
WHERE Student.StdSSN IN
(SELECT StdSSN FROM Enrollment
WHERE EnrGrade > 3.5)
Question
A nested query cannot have multiple levels,i.e.you cannot have a nested query inside another nested query.
Question
Nested queries can be used as part of a condition in WHERE or HAVING clauses,but they cannot be used in the FROM clause of a query.
Question
Type II nested queries are very useful for difference problems but should not be used for join problems.
Question
A good table design usually eliminates the use of null values,so their effects on query results is not generally a concern for database developers.
Question
Typically,a full outer join is used to combine two tables that are similar but are not union compatible.
Question
The following SQL statement is an example of a Type II nested query:
SELECT StdSSN,StdFirstName,StdLastName,StdMajor
FROM Student
WHERE EXISTS
(SELECT StdSSN FROM Enrollment
WHERE Student.StdSSN = Enrollment.StdSSN
AND EnrGrade > 3.5)
Question
One-Sided Outer Join: an operator that generates the join result (the nonmatching rows)from one of the input tables.SQL supports the one-sided outer join operator through the LEFT JOIN and RIGHT JOIN keywords.
Question
The following SQL statement would execute in both Access and Oracle 8i:
SELECT FacSSN,FacLastName,StdSSN,StdLastName
FROM Faculty FULL JOIN Student
ON Faculty.SSN = Student.SSN
Question
Using a Type I nested query is the standard way to reference related tables in SQL DELETE statements.
Question
One of the reasons Type II nested queries are not used for join problems is that their repetitive execution makes them inefficient for this purpose.
Question
Type II nested queries should not be used for a join operation when the result table contains any columns from the inner query.
Question
The following SQL statement would return only the non-matching rows of the left table:
SELECT FacSSN,LastName
FROM Faculty LEFT JOIN Student
ON Faculty.SSN = Student.SSN
WHERE Student.StdSSN IS NULL
Question
Type I nested queries can be used like loops and Type II nested queries can be used like procedures in a programming language.
Question
In simple conditions,only rows in which the condition evaluates to false are excluded from the result set.
Question
Type I nested queries are useful for some join problems but should not be used for difference problems.
Question
A full outer join generates a table with the matching rows plus the nonmatching rows from both tables.
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-(ORACLE)SELECT CNAME,DATE_OUT,RTN FROM CUSTOMER,RENTALS
WHERE CUSTOMER.CID = RENTALS.CID
AND BIRTHPLACE IN ('ERIE','CARY')AND EXISTS
(SELECT * FROM RENTCOST
WHERE COST < 40 AND RENTALS.MAKE= RENTCOST.MAKE)
The CNAMEs shown by the execution of this query are:

A) SIMON
B) GREEN, BLACK, SIMON
C) GREEN
D) GREEN, SIMON
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT DISTINCT CNAME FROM CUSTOMER
WHERE CID IN
(SELECT CID FROM RENTALS WHERE RETURN IN
(SELECT BIRTHPLACE FROM CUSTOMER))
What is the meaning of this query?

A) List customers whose rental was returned to their birthplace
B) List customers whose rental was returned to someone else's birthplace
C) List customers whose rental was returned to a city that is also a birthplace
D) None of the above
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT DISTINCT CID,CNAME FROM CUSTOMER
WHERE CID IN
(SELECT CID FROM RENTALS WHERE MAKE IN ('FORD','TOYOTA'))
The CNAMEs shown by the execution of this query are:

A) BLACK
B) BLACK, JONES
C) BLACK, JONES, MARTIN
D) BLACK, JONES, MARTIN, VERNON
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT CID,CNAME FROM CUSTOMER HERE EXISTS
(SELECT CID FROM RENTALS
WHERE CUSTOMER.CID = RENTALS.CID
AND PICKUP = 'CARY')
The execution of this query lists the following CNAMEs:

A) BLACK, GREEN, JONES, MARTIN, SIMON
B) BLACK, JONES, MARTIN
C) BLACK, GREEN, JONES, MARTIN, SIMON, VERNON
D) BLACK
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-(ACCESS)SELECT CNAME,DATE_OUT FROM CUSTOMER INNER JOIN RENTALS
ON CUSTOMER.CID = RENTALS.CID
WHERE AGE < 40 AND RTN IN
(SELECT RTN FROM RENTLENGTH
WHERE DAYS > 1)
The CNAMEs shown by the execution of this query are:

A) JONES, MARTIN
B) GREEN, JONES, MARTIN
C) BLACK, JONES, MARTIN
D) BLACK, GREEN, JONES, MARTIN
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT DISTINCT CNAME,AGE FROM CUSTOMER,RENTALS
WHERE CUSTOMER.CID <> RENTALS.CID
The execution of this query produces the following number of rows:

A) 0
B) 1
C) 2
D) 6
Question
When null values exist in one of the columns in a simple condition,it is possible that those rows will not appear in the result of either the simple condition or its negation.
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT CID,CNAME FROM CUSTOMER WHERE 0 =
(SELECT COUNT(*)FROM RENTALS
WHERE CUSTOMER.CID = RENTALS.CID)
What is the interpretation of this query?

A) List the customers who do not have rentals
B) List the customers who have one rental
C) List the customers who have 0 or more rentals
D) List the customers who have 1 or more rentals
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-DELETE FROM CUSTOMER WHERE CID IN
(SELECT CID FROM RENTALS WHERE RETURN IN
(SELECT BIRTHPLACE FROM CUSTOMER))
The number of rows deleted from CUSTOMER by the execution of this query is:

A) 6
B) 5
C) 4
D) 3
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT DISTINCT CID,CNAME FROM CUSTOMER
WHERE CID IN
(SELECT CID FROM RENTALS WHERE MAKE IN ('FORD','TOYOTA')
AND RTN IN
(SELECT RTN FROM RENTLENGTH
WHERE DAYS < 3))
The CNAMEs shown by the execution of this query are:

A) BLACK
B) BLACK, JONES
C) BLACK, JONES, MARTIN
D) JONES, MARTIN
Question
When performing a grouping operation,the SQL standard specifies that all rows with null values are grouped together.
Question
Null values affect:

A) simple conditions involving comparison operators
B) compound conditions involving logical operators
C) aggregate calculations and grouping
D) all of the above
Question
Nested queries can be used like a procedure (Type I nested query)in which the nested query is executed one time or like a loop (Type II nested query)in which the nested query is executed repeatedly.

A) Type I nested query, Type III nested query
B) Type I nested query, Type II nested query
C) Type II nested query, Type I nested query
D) None of the above
Question
Select the statement that is correct about the outer join operator:

A) The outer join operator generates the join result (the matching rows).
B) The outer join operator generates the join result (the nonmatching rows).
C) The outer join operator generates the join result (the matching rows) plus the nonmatching rows.
D) The outer join operator generates the join result (the nonmatching rows) but excludes the matching rows.
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-(ACCESS)SELECT CNAME,DATE_OUT,RTN FROM CUSTOMER INNER JOIN RENTALS
ON CUSTOMER.CID = RENTALS.CID
WHERE AGE < 40 AND EXISTS
(SELECT * FROM RENTLENGTH
WHERE RENTALS.RTN = RENTLENGTH.RTN
AND DAYS > 1)
The CNAMEs shown by the execution of this query are:

A) JONES, MARTIN
B) GREEN, JONES, MARTIN
C) BLACK, JONES, MARTIN
D) BLACK, GREEN, JONES, MARTIN
Question
When using the SUM function with two columns,a row containing a null value for either column would produce a null value for that row.
Question
The following two functions will always produce the same value when performed in a SQL statement:
SUM(Column1)+ SUM(Column2)
SUM(Column1 + Column2)
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT CID,CNAME FROM CUSTOMER WHERE CID NOT IN
(SELECT CID FROM RENTALS)
The execution of this query produces the following number of rows:

A) 0
B) 1
C) 2
D) 3
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-(ACCESS)DELETE RENTALS.* FROM RENTALS INNER JOIN CUSTOMER
ON CUSTOMER.CID = RENTALS.CID
AND CNAME IN ('BLACK','SIMON'))
The execution of this query deletes the following number of rows from the table RENTALS:

A) 1
B) 2
C) 3
D) 4
Question
The COUNT(*)function always returns the same value as the COUNT(column)function.
Question
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT * FROM VOTE WHERE Vote2 >=10
The execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Question
In outer join queries,non-matched rows in the result table would contain ____________ values in certain columns.
Question
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT * FROM VOTE WHERE Vote1>10 OR VOTE2 >10
The execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Question
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT * FROM VOTE WHERE Vote2 <10
The execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Question
The SQL keyword(s)____________ in a SELECT query generate a result table that contains the matching rows and the non-matching rows of both of the input tables.
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT MAKE FROM RENTALS,CUSTOMER
WHERE RENTALS.CID = CUSTOMER.CID
AND RESID_CITY = 'HEMET'
GROUP BY MAKE
HAVING COUNT (DISTINCT RENTALS.CID)=
(SELECT COUNT(*)FROM CUSTOMER
WHERE RESID_CITY = 'HEMET')
The execution of this query produces the following number of rows:

A) 0
B) 1
C) 2
D) 3
Question
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT * FROM VOTE WHERE Vote2 >=10
UNION
SELECT * FROM VOTE
WHERE Vote2 <10
The execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Question
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT * FROM VOTE WHERE Vote1>10 AND VOTE2 >10
The execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Question
The SQL keyword(s)____________ in a SELECT query generate a result table that contains the matching rows and the non-matching rows of the left table.
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT CID FROM RENTALS GROUP BY CID
HAVING COUNT (DISTINCT MAKE)= (SELECT COUNT(*)FROM RENTCOST)
The operation performed by this query is:

A) A difference
B) A division
C) A union
D) A join
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT MAKE FROM RENTALS,CUSTOMER
WHERE RENTALS.CID = CUSTOMER.CID
AND RESID_CITY = 'HEMET '
GROUP BY MAKE
HAVING COUNT (DISTINCT RENTALS.CID)=
(SELECT COUNT(*)FROM CUSTOMER
WHERE RESID_CITY = 'HEMET')
The meaning of this query is the following:

A) List all makes of cars rented to customers residing in Hemet
B) List all makes of cars rented to at least one customer residing in Hemet
C) List all makes of cars rented to all customers residing in Hemet
D) None of the above
Question
An operator that generates a result table that contains the matching rows of both tables plus the non-matching rows of both of the input tables is a(n)_____________________.
Question
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT DISTINCT CNAME,AGE FROM CUSTOMER WHERE CID NOT IN
(SELECT CID FROM RENTALS)
This query is NOT equivalent (order ignored)to the following query:

A) SELECT DISTINCT CNAME, AGE FROM CUSTOMER, RENTALS WHERE CUSTOMER.CID <> RENTALS.CID
B) SELECT DISTINCT CNAME, AGE FROM CUSTOMER WHERE 0 IN (SELECT COUNT(*) FROM RENTALS
C) SELECT DISTINCT CNAME, AGE FROM CUSTOMER WHERE 0 = (SELECT COUNT(*) FROM RENTALS
WHERE CUSTOMER.CID = RENTALS.CID)
D) SELECT DISTINCT CNAME, AGE FROM CUSTOMER WHERE NOT EXISTS (SELECT CID FROM RENTALS
Question
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT SUM(VOTE1)AS S1,SUM(VOTE2)AS S2, SUM(VOTE1)-SUM(VOTE2)AS S3,SUM(VOTE1-VOTE2)AS S4
FROM VOTE
The execution of this query produces the following result (shown in order of occurrence in the query):

A) 75 40 35 35
B) 75 40 75 35
C) 75 40 35 5
D) 75 40 40 40
Question
The SQL keyword(s)____________ in a SELECT query generate a result table that contains the matching rows and the non-matching rows of the right table.
Question
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT COUNT(*)AS Nrows,COUNT(VOTE2)AS NVOTE2 FROM VOTE
The execution of this query produces the following result (Nrows shown before NVOTE2):

A) 4, 4
B) 3, 3
C) 4, 3
D) 4, null
Question
An operator that generates a result table that contains the matching rows of both tables plus the non-matching rows of one of the input tables is a(n)_____________________.
Question
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT Vote2,COUNT(*) FROM VOTE
GROUP BY Vote2
In SQL2,the execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Question
A SELECT statement that appears inside another query is called a(n)___________________.
Question
A nested query in which the inner query does not reference any tables in the outer query is a(n)__________________.
Question
In Access,a nested query in the FROM clause would be used to overcome the inability of using the keyword ____________ inside aggregate functions.
Question
In a difference problem using a Type II nested query,a NOT EXISTS condition in a WHERE clause would evaluate to ________ if the nested query returned zero rows.
Question
The following SQL statement could not be executed because what column is included in the SELECT? _____________
SELECT StdSSN,StdLastName,StdMajor,EnrGrade
FROM Student
WHERE Student.StdSSN IN
(SELECT StdSSN FROM Enrollment
WHERE EnrGrade > 3.5)
Question
When a problem narrative statement contains the word "not" in it,this is usually an indication that the problem requires the use of a(n)_______________ operation.
Question
A(n)_______________ nested query executes one time for each row in the outer query.
Question
If a problem narrative specifies a requirement to list the values of one column that match any of the values in another column,this problem would require the use of a(n)_________________ operation.
Question
In the following SQL statement,which column would be blank if null values were present in one or more of the rows? _______________
SELECT FacSSN,COUNT(*)AS NumRows
FROM Offering
GROUP BY FacSSN
Question
__________________ nested queries are also known as correlated queries because they reference columns in the outer queries.
Question
A relational algebra operator used to combine rows from two tables is the ______________ operator.
Question
A(n)_________________ nested query executes one time and produces a result table.
Question
To evaluate the result of a compound condition,SQL:1999 uses _________________,which show how combinations of the values true,false and null combine with Boolean operators.
Question
In SQL statements,________________ conditions involve one or more simple conditions connected by a Boolean operator.
Question
If a problem narrative specifies a requirement to list the values of one column that match all of the values in another column,this problem would require the use of a(n)_________________ operation.
Question
In SQL statements,________________ conditions involve a column or column expression,a comparison operator,and another column,column expression or constant.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/74
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 9: Advanced Query Formulation With SQL
1
Outer join problems cannot be formulated in SQL at all using the cross product style.
False
Explanation: Outer join problems can be formulated using the cross product style with proprietary SQL extensions.
2
To be union compatible each corresponding column from both temporary tables must have compatible data types.
True
3
Using the join operator style,the result set of a one-sided outer join depends on the direction and position of the table names in the query.
True
4
The following SQL statement is an example of a Type II nested query:
SELECT StdSSN,StdLastName,StdMajor
FROM Student
WHERE Student.StdSSN IN
(SELECT StdSSN FROM Enrollment
WHERE EnrGrade > 3.5)
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
5
A nested query cannot have multiple levels,i.e.you cannot have a nested query inside another nested query.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
6
Nested queries can be used as part of a condition in WHERE or HAVING clauses,but they cannot be used in the FROM clause of a query.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
7
Type II nested queries are very useful for difference problems but should not be used for join problems.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
8
A good table design usually eliminates the use of null values,so their effects on query results is not generally a concern for database developers.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
9
Typically,a full outer join is used to combine two tables that are similar but are not union compatible.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
10
The following SQL statement is an example of a Type II nested query:
SELECT StdSSN,StdFirstName,StdLastName,StdMajor
FROM Student
WHERE EXISTS
(SELECT StdSSN FROM Enrollment
WHERE Student.StdSSN = Enrollment.StdSSN
AND EnrGrade > 3.5)
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
11
One-Sided Outer Join: an operator that generates the join result (the nonmatching rows)from one of the input tables.SQL supports the one-sided outer join operator through the LEFT JOIN and RIGHT JOIN keywords.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
12
The following SQL statement would execute in both Access and Oracle 8i:
SELECT FacSSN,FacLastName,StdSSN,StdLastName
FROM Faculty FULL JOIN Student
ON Faculty.SSN = Student.SSN
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
13
Using a Type I nested query is the standard way to reference related tables in SQL DELETE statements.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
14
One of the reasons Type II nested queries are not used for join problems is that their repetitive execution makes them inefficient for this purpose.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
15
Type II nested queries should not be used for a join operation when the result table contains any columns from the inner query.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
16
The following SQL statement would return only the non-matching rows of the left table:
SELECT FacSSN,LastName
FROM Faculty LEFT JOIN Student
ON Faculty.SSN = Student.SSN
WHERE Student.StdSSN IS NULL
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
17
Type I nested queries can be used like loops and Type II nested queries can be used like procedures in a programming language.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
18
In simple conditions,only rows in which the condition evaluates to false are excluded from the result set.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
19
Type I nested queries are useful for some join problems but should not be used for difference problems.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
20
A full outer join generates a table with the matching rows plus the nonmatching rows from both tables.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
21
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-(ORACLE)SELECT CNAME,DATE_OUT,RTN FROM CUSTOMER,RENTALS
WHERE CUSTOMER.CID = RENTALS.CID
AND BIRTHPLACE IN ('ERIE','CARY')AND EXISTS
(SELECT * FROM RENTCOST
WHERE COST < 40 AND RENTALS.MAKE= RENTCOST.MAKE)
The CNAMEs shown by the execution of this query are:

A) SIMON
B) GREEN, BLACK, SIMON
C) GREEN
D) GREEN, SIMON
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
22
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT DISTINCT CNAME FROM CUSTOMER
WHERE CID IN
(SELECT CID FROM RENTALS WHERE RETURN IN
(SELECT BIRTHPLACE FROM CUSTOMER))
What is the meaning of this query?

A) List customers whose rental was returned to their birthplace
B) List customers whose rental was returned to someone else's birthplace
C) List customers whose rental was returned to a city that is also a birthplace
D) None of the above
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
23
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT DISTINCT CID,CNAME FROM CUSTOMER
WHERE CID IN
(SELECT CID FROM RENTALS WHERE MAKE IN ('FORD','TOYOTA'))
The CNAMEs shown by the execution of this query are:

A) BLACK
B) BLACK, JONES
C) BLACK, JONES, MARTIN
D) BLACK, JONES, MARTIN, VERNON
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
24
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT CID,CNAME FROM CUSTOMER HERE EXISTS
(SELECT CID FROM RENTALS
WHERE CUSTOMER.CID = RENTALS.CID
AND PICKUP = 'CARY')
The execution of this query lists the following CNAMEs:

A) BLACK, GREEN, JONES, MARTIN, SIMON
B) BLACK, JONES, MARTIN
C) BLACK, GREEN, JONES, MARTIN, SIMON, VERNON
D) BLACK
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
25
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-(ACCESS)SELECT CNAME,DATE_OUT FROM CUSTOMER INNER JOIN RENTALS
ON CUSTOMER.CID = RENTALS.CID
WHERE AGE < 40 AND RTN IN
(SELECT RTN FROM RENTLENGTH
WHERE DAYS > 1)
The CNAMEs shown by the execution of this query are:

A) JONES, MARTIN
B) GREEN, JONES, MARTIN
C) BLACK, JONES, MARTIN
D) BLACK, GREEN, JONES, MARTIN
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
26
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT DISTINCT CNAME,AGE FROM CUSTOMER,RENTALS
WHERE CUSTOMER.CID <> RENTALS.CID
The execution of this query produces the following number of rows:

A) 0
B) 1
C) 2
D) 6
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
27
When null values exist in one of the columns in a simple condition,it is possible that those rows will not appear in the result of either the simple condition or its negation.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
28
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT CID,CNAME FROM CUSTOMER WHERE 0 =
(SELECT COUNT(*)FROM RENTALS
WHERE CUSTOMER.CID = RENTALS.CID)
What is the interpretation of this query?

A) List the customers who do not have rentals
B) List the customers who have one rental
C) List the customers who have 0 or more rentals
D) List the customers who have 1 or more rentals
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
29
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-DELETE FROM CUSTOMER WHERE CID IN
(SELECT CID FROM RENTALS WHERE RETURN IN
(SELECT BIRTHPLACE FROM CUSTOMER))
The number of rows deleted from CUSTOMER by the execution of this query is:

A) 6
B) 5
C) 4
D) 3
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
30
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT DISTINCT CID,CNAME FROM CUSTOMER
WHERE CID IN
(SELECT CID FROM RENTALS WHERE MAKE IN ('FORD','TOYOTA')
AND RTN IN
(SELECT RTN FROM RENTLENGTH
WHERE DAYS < 3))
The CNAMEs shown by the execution of this query are:

A) BLACK
B) BLACK, JONES
C) BLACK, JONES, MARTIN
D) JONES, MARTIN
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
31
When performing a grouping operation,the SQL standard specifies that all rows with null values are grouped together.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
32
Null values affect:

A) simple conditions involving comparison operators
B) compound conditions involving logical operators
C) aggregate calculations and grouping
D) all of the above
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
33
Nested queries can be used like a procedure (Type I nested query)in which the nested query is executed one time or like a loop (Type II nested query)in which the nested query is executed repeatedly.

A) Type I nested query, Type III nested query
B) Type I nested query, Type II nested query
C) Type II nested query, Type I nested query
D) None of the above
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
34
Select the statement that is correct about the outer join operator:

A) The outer join operator generates the join result (the matching rows).
B) The outer join operator generates the join result (the nonmatching rows).
C) The outer join operator generates the join result (the matching rows) plus the nonmatching rows.
D) The outer join operator generates the join result (the nonmatching rows) but excludes the matching rows.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
35
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-(ACCESS)SELECT CNAME,DATE_OUT,RTN FROM CUSTOMER INNER JOIN RENTALS
ON CUSTOMER.CID = RENTALS.CID
WHERE AGE < 40 AND EXISTS
(SELECT * FROM RENTLENGTH
WHERE RENTALS.RTN = RENTLENGTH.RTN
AND DAYS > 1)
The CNAMEs shown by the execution of this query are:

A) JONES, MARTIN
B) GREEN, JONES, MARTIN
C) BLACK, JONES, MARTIN
D) BLACK, GREEN, JONES, MARTIN
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
36
When using the SUM function with two columns,a row containing a null value for either column would produce a null value for that row.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
37
The following two functions will always produce the same value when performed in a SQL statement:
SUM(Column1)+ SUM(Column2)
SUM(Column1 + Column2)
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
38
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT CID,CNAME FROM CUSTOMER WHERE CID NOT IN
(SELECT CID FROM RENTALS)
The execution of this query produces the following number of rows:

A) 0
B) 1
C) 2
D) 3
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
39
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-(ACCESS)DELETE RENTALS.* FROM RENTALS INNER JOIN CUSTOMER
ON CUSTOMER.CID = RENTALS.CID
AND CNAME IN ('BLACK','SIMON'))
The execution of this query deletes the following number of rows from the table RENTALS:

A) 1
B) 2
C) 3
D) 4
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
40
The COUNT(*)function always returns the same value as the COUNT(column)function.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
41
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT * FROM VOTE WHERE Vote2 >=10
The execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
42
In outer join queries,non-matched rows in the result table would contain ____________ values in certain columns.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
43
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT * FROM VOTE WHERE Vote1>10 OR VOTE2 >10
The execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
44
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT * FROM VOTE WHERE Vote2 <10
The execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
45
The SQL keyword(s)____________ in a SELECT query generate a result table that contains the matching rows and the non-matching rows of both of the input tables.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
46
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT MAKE FROM RENTALS,CUSTOMER
WHERE RENTALS.CID = CUSTOMER.CID
AND RESID_CITY = 'HEMET'
GROUP BY MAKE
HAVING COUNT (DISTINCT RENTALS.CID)=
(SELECT COUNT(*)FROM CUSTOMER
WHERE RESID_CITY = 'HEMET')
The execution of this query produces the following number of rows:

A) 0
B) 1
C) 2
D) 3
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
47
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT * FROM VOTE WHERE Vote2 >=10
UNION
SELECT * FROM VOTE
WHERE Vote2 <10
The execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
48
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT * FROM VOTE WHERE Vote1>10 AND VOTE2 >10
The execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
49
The SQL keyword(s)____________ in a SELECT query generate a result table that contains the matching rows and the non-matching rows of the left table.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
50
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT CID FROM RENTALS GROUP BY CID
HAVING COUNT (DISTINCT MAKE)= (SELECT COUNT(*)FROM RENTCOST)
The operation performed by this query is:

A) A difference
B) A division
C) A union
D) A join
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
51
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT MAKE FROM RENTALS,CUSTOMER
WHERE RENTALS.CID = CUSTOMER.CID
AND RESID_CITY = 'HEMET '
GROUP BY MAKE
HAVING COUNT (DISTINCT RENTALS.CID)=
(SELECT COUNT(*)FROM CUSTOMER
WHERE RESID_CITY = 'HEMET')
The meaning of this query is the following:

A) List all makes of cars rented to customers residing in Hemet
B) List all makes of cars rented to at least one customer residing in Hemet
C) List all makes of cars rented to all customers residing in Hemet
D) None of the above
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
52
An operator that generates a result table that contains the matching rows of both tables plus the non-matching rows of both of the input tables is a(n)_____________________.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
53
Figuer:
CUSTOMER  CID  CNAME  AGE  RESID_CITY  BIRTHPLACE 10 BLACK 40 ERIE  TAMPA 20 GREEN 25 CARY  ERIE 30 JONES 30 HEMET  TAMPA 40 MARTIN 35 HEMET  TAMPA 50 SIMON 22 ERIE  ERIE 60 VERNON 60 CARY  CARY \begin{array} { | l | l | l | l | l | } \hline \text { CID } & \text { CNAME } & \text { AGE } & \text { RESID\_CITY } & \text { BIRTHPLACE } \\\hline 10 & \text { BLACK } & 40 & \text { ERIE } & \text { TAMPA } \\\hline 20 & \text { GREEN } & 25 & \text { CARY } & \text { ERIE } \\\hline 30 & \text { JONES } & 30 & \text { HEMET } & \text { TAMPA } \\\hline 40 & \text { MARTIN } & 35 & \text { HEMET } & \text { TAMPA } \\\hline 50 & \text { SIMON } & 22 & \text { ERIE } & \text { ERIE } \\\hline 60 & \text { VERNON } & 60 & \text { CARY } & \text { CARY } \\\hline\end{array} In table CUSTOMER, CID is the primary key (Customer ID).
RENTALS  CID  MAKE  DATE_OUT  PICKUP  RETURN  RTN 10 FORD 100ct1994 CARY  CARY 110 GM 01Nov1995 TAMPA  CARY 210 FORD 01Jan1995 ERIE  ERIE 320 NISSAN 07Ju11994 TAMPA  TAMPA 430 FORD 01Jul1995 CARY  ERIE 530 GM 01Aug1995 ERIE  ERIE 640 FORD 01Aug1994 CARY  ERIE 750 GM 01Sep1995 ERIE  CARY 870 TOYOTA 02Sep1995 RENO  RENO 9\begin{array} { | l | l | l | l | l | l | } \hline \text { CID } & \text { MAKE } & \text { DATE\_OUT } & \text { PICKUP } & \text { RETURN } & \text { RTN } \\\hline 10 & \text { FORD } & 10 - 0 c t - 1994 & \text { CARY } & \text { CARY } & 1 \\\hline 10 & \text { GM } & 01 - N o v - 1995 & \text { TAMPA } & \text { CARY } & 2 \\\hline 10 & \text { FORD } & 01 - J a n - 1995 & \text { ERIE } & \text { ERIE } & 3 \\\hline 20 & \text { NISSAN } & 07 - J u 1 - 1994 & \text { TAMPA } & \text { TAMPA } & 4 \\\hline 30 & \text { FORD } & 01 - J u l - 1995 & \text { CARY } & \text { ERIE } & 5 \\\hline 30 & \text { GM } & 01 - A u g - 1995 & \text { ERIE } & \text { ERIE } & 6 \\\hline 40 & \text { FORD } & 01 - A u g - 1994 & \text { CARY } & \text { ERIE } & 7 \\\hline 50 & \text { GM } & 01 - S e p - 19 95 & \text { ERIE } & \text { CARY } & 8 \\\hline 70 & \text { TOYOTA } & 02 - S e p - 1995 & \text { RENO } & \text { RENO } & 9 \\\hline\end{array} In the table RENTALS, RTN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned.
RENTCOST  MAKE  COST  FORD 30 GM 40 NISSAN 30 TOYOTA 20 VOLVO 50\begin{array} { | l | l | } \hline \text { MAKE } & \text { COST } \\\hline \text { FORD } & 30 \\\hline \text { GM } & 40 \\\hline \text { NISSAN } & 30 \\\hline \text { TOYOTA } & 20 \\\hline \text { VOLVO } & 50 \\\hline\end{array} RENTCOST shows the base cost of renting a given MAKE for one day.
CITYADJ  CITY  FACTOR  CARY 1 ERIE 1.1 RENO 0.9 TAMPA 0.8\begin{array} { | l | l | } \hline \text { CITY } & \text { FACTOR } \\\hline \text { CARY } & 1 \\\hline \text { ERIE } & 1.1 \\\hline \text { RENO } & 0.9 \\\hline \text { TAMPA } & 0.8 \\\hline\end{array} If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below.
RENTLENGTH  RTN  DAYS 1123324254627381\begin{array} { | l | l | } \hline \text { RTN } & \text { DAYS } \\\hline 1 & 1 \\\hline 2 & 3 \\\hline 3 & 2 \\\hline 4 & 2 \\\hline 5 & 4 \\\hline 6 & 2 \\\hline 7 & 3 \\\hline 8 & 1 \\\hline\end{array} RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table.

-SELECT DISTINCT CNAME,AGE FROM CUSTOMER WHERE CID NOT IN
(SELECT CID FROM RENTALS)
This query is NOT equivalent (order ignored)to the following query:

A) SELECT DISTINCT CNAME, AGE FROM CUSTOMER, RENTALS WHERE CUSTOMER.CID <> RENTALS.CID
B) SELECT DISTINCT CNAME, AGE FROM CUSTOMER WHERE 0 IN (SELECT COUNT(*) FROM RENTALS
C) SELECT DISTINCT CNAME, AGE FROM CUSTOMER WHERE 0 = (SELECT COUNT(*) FROM RENTALS
WHERE CUSTOMER.CID = RENTALS.CID)
D) SELECT DISTINCT CNAME, AGE FROM CUSTOMER WHERE NOT EXISTS (SELECT CID FROM RENTALS
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
54
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT SUM(VOTE1)AS S1,SUM(VOTE2)AS S2, SUM(VOTE1)-SUM(VOTE2)AS S3,SUM(VOTE1-VOTE2)AS S4
FROM VOTE
The execution of this query produces the following result (shown in order of occurrence in the query):

A) 75 40 35 35
B) 75 40 75 35
C) 75 40 35 5
D) 75 40 40 40
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
55
The SQL keyword(s)____________ in a SELECT query generate a result table that contains the matching rows and the non-matching rows of the right table.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
56
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT COUNT(*)AS Nrows,COUNT(VOTE2)AS NVOTE2 FROM VOTE
The execution of this query produces the following result (Nrows shown before NVOTE2):

A) 4, 4
B) 3, 3
C) 4, 3
D) 4, null
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
57
An operator that generates a result table that contains the matching rows of both tables plus the non-matching rows of one of the input tables is a(n)_____________________.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
58
Figuer:
VOTE  Name  votel  vote2  Bill 2015 Mary 1025 Jill 150 Bob 30\begin{array} { | l | l | l | } \hline \text { Name } & \text { votel } & \text { vote2 } \\\hline \text { Bill } & 20 & 15 \\\hline \text { Mary } & 10 & 25 \\\hline \text { Jill } & 15 & 0 \\\hline \text { Bob } & 30 & \\\hline\end{array}

-SELECT Vote2,COUNT(*) FROM VOTE
GROUP BY Vote2
In SQL2,the execution of this query produces the following number of rows:

A) 1
B) 2
C) 3
D) 4
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
59
A SELECT statement that appears inside another query is called a(n)___________________.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
60
A nested query in which the inner query does not reference any tables in the outer query is a(n)__________________.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
61
In Access,a nested query in the FROM clause would be used to overcome the inability of using the keyword ____________ inside aggregate functions.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
62
In a difference problem using a Type II nested query,a NOT EXISTS condition in a WHERE clause would evaluate to ________ if the nested query returned zero rows.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
63
The following SQL statement could not be executed because what column is included in the SELECT? _____________
SELECT StdSSN,StdLastName,StdMajor,EnrGrade
FROM Student
WHERE Student.StdSSN IN
(SELECT StdSSN FROM Enrollment
WHERE EnrGrade > 3.5)
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
64
When a problem narrative statement contains the word "not" in it,this is usually an indication that the problem requires the use of a(n)_______________ operation.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
65
A(n)_______________ nested query executes one time for each row in the outer query.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
66
If a problem narrative specifies a requirement to list the values of one column that match any of the values in another column,this problem would require the use of a(n)_________________ operation.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
67
In the following SQL statement,which column would be blank if null values were present in one or more of the rows? _______________
SELECT FacSSN,COUNT(*)AS NumRows
FROM Offering
GROUP BY FacSSN
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
68
__________________ nested queries are also known as correlated queries because they reference columns in the outer queries.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
69
A relational algebra operator used to combine rows from two tables is the ______________ operator.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
70
A(n)_________________ nested query executes one time and produces a result table.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
71
To evaluate the result of a compound condition,SQL:1999 uses _________________,which show how combinations of the values true,false and null combine with Boolean operators.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
72
In SQL statements,________________ conditions involve one or more simple conditions connected by a Boolean operator.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
73
If a problem narrative specifies a requirement to list the values of one column that match all of the values in another column,this problem would require the use of a(n)_________________ operation.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
74
In SQL statements,________________ conditions involve a column or column expression,a comparison operator,and another column,column expression or constant.
Unlock Deck
Unlock for access to all 74 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 74 flashcards in this deck.