Exam 9: Advanced Query Formulation With SQL

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

A relational algebra operator used to combine rows from two tables is the ______________ operator.

(Short Answer)
4.9/5
(30)

Figuer: VOTE Name votel vote2 Bill 20 15 Mary 10 25 Jill 15 0 Bob 30 -SELECT Vote2,COUNT(*) FROM VOTE GROUP BY Vote2 In SQL2,the execution of this query produces the following number of rows:

(Multiple Choice)
4.7/5
(41)

In outer join queries,non-matched rows in the result table would contain ____________ values in certain columns.

(Short Answer)
4.9/5
(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 In table CUSTOMER, CID is the primary key (Customer ID). RENTALS CID MAKE DATE\_OUT PICKUP RETURN RTN 10 FORD 10-0ct-1994 CARY CARY 1 10 GM 01-Nov-1995 TAMPA CARY 2 10 FORD 01-Jan-1995 ERIE ERIE 3 20 NISSAN 07-Ju1-1994 TAMPA TAMPA 4 30 FORD 01-Jul-1995 CARY ERIE 5 30 GM 01-Aug-1995 ERIE ERIE 6 40 FORD 01-Aug-1994 CARY ERIE 7 50 GM 01-Sep-1995 ERIE CARY 8 70 TOYOTA 02-Sep-1995 RENO RENO 9 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 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 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 1 1 2 3 3 2 4 2 5 4 6 2 7 3 8 1 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:

(Multiple Choice)
4.9/5
(42)

Type II nested queries should not be used for a join operation when the result table contains any columns from the inner query.

(True/False)
4.8/5
(34)

Using a Type I nested query is the standard way to reference related tables in SQL DELETE statements.

(True/False)
4.7/5
(38)

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)

(Short Answer)
4.9/5
(39)

Type I nested queries are useful for some join problems but should not be used for difference problems.

(True/False)
4.9/5
(33)

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)_____________________.

(Short Answer)
4.9/5
(38)

In simple conditions,only rows in which the condition evaluates to false are excluded from the result set.

(True/False)
4.8/5
(40)

Figuer: VOTE Name votel vote2 Bill 20 15 Mary 10 25 Jill 15 0 Bob 30 -SELECT * FROM VOTE WHERE Vote1>10 OR VOTE2 >10 The execution of this query produces the following number of rows:

(Multiple Choice)
4.7/5
(38)

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)

(True/False)
4.7/5
(29)

To be union compatible each corresponding column from both temporary tables must have compatible data types.

(True/False)
4.7/5
(39)

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/False)
4.9/5
(35)
Showing 61 - 74 of 74
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)