Exam 4: Relational Data Retrieval: SQL

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

Placing SQL SELECT commands among the lines of a higher-level language program if referred to as ____.

(Multiple Choice)
5.0/5
(25)

The SQL SELECT HAVING clause limits the output of a GROUP BY operation based on ____.

(Multiple Choice)
4.9/5
(38)

The SQL SELECT built-in function that adds the values of a specified set of attributes is ____.

(Multiple Choice)
4.9/5
(29)

The purpose of the SQL SELECT GROUP BY clause is ____.

(Multiple Choice)
4.8/5
(31)

The SQL SELECT command is used to update, insert, and delete rows in relational tables.

(True/False)
4.8/5
(29)

A GROUP BY clause in an SQL SELECT command groups together columns based on common attribute values.

(True/False)
4.7/5
(27)

The SQL SELECT command is capable of executing relational Select, Project, and Join operations, singly or in combination.

(True/False)
4.9/5
(31)

To retrieve an entire table, an SQL SELECT statement must specify the rows in the WHERE clause.

(True/False)
5.0/5
(33)

The SQL SELECT LIKE operator ____.

(Multiple Choice)
4.9/5
(29)

Consider the following relational database for the Central Zoo. Central Zoo wants to maintain information about its animals, the enclosures in which they live, and its zookeepers and the services they perform for the animals. In addition, Central Zoo has a program by which people can be sponsor of animals. Central Zoo wants to track its sponsors, their dependents, and associated data. Each animal has a unique animal number and each enclosure has a unique enclosure number. An animal can live in only one enclosure. An enclosure can have several animals in it or it can be currently empty. A zookeeper has a unique employee number. Every animal has been cared for by at least one and generally many zookeepers; each zookeeper has cared for at least one and generally many animals. Each time a zookeeper performs a specific, significant service for an animal the service type, date, and time are recorded. A zookeeper may perform a particular service on a particular animal more than once on a given day. A sponsor, who has a unique sponsor number and a unique social security number, sponsors at least one and possibly several animals. An animal may have several sponsors or none. For each animal that a particular sponsor sponsors, the zoo wants to track the annual sponsorship contribution and renewal date. In addition, Central Zoo wants to keep track of each sponsor's dependents. A sponsor may have several dependents or none. A dependent is associated with exactly one sponsor. ENCLNUM TYPE LOCATION SIZE DATEBULT ENCLOSURE Relation ANIMALNUM SPECES ANIMALNAME GENDER COUNTRY WEIGHT ENCLNUM ANIMAL Relation EMPNUM EMPNAME TITLE YERHIRED ZOOKEEPER Relation ANIMALNUM EMPNUM SERVICETYPE DATE TIME CARESFOR Relation SPONSORNUM SOCSECNUM SPONSORNAME ADDRESS PHONE SPONSOR Relation ANIMALNUM SPONSORNUM ANNUALCONT RENEWDATE CONTRIBUTION Relation SPONSORNUM DEPENNAME RELATIONSHIP BIRTHDATE DEPENDENT Relation Write SQL SELECT commands to answer the following queries. a. Find the size of enclosure number 2582. b. List the names and numbers of the female tigers who live in enclosure number 4627. c. List the animal number, species, gender, and weight of all of the lions, tigers, and leopards that weigh between 700 and 900 pounds, from heaviest to lightest. d. Find the average weight of all of the male tigers. e. Find the average weight of the males of each species. f. List the names, addresses, and phone numbers of all of the sponsors of tigers that were born in India. g. How many monkeys live in cages that are less than 400 square feet in size? h. Find the average weight of each species of animal that that live in cages that are less than 400 square feet in size. Only include those species for which the average weight is at least 200 pounds. i. Find the name and number of the heaviest tiger. j. Find the name, number, and species of the animals from China that are at least as heavy as the heaviest female tiger that was born in India.

(Essay)
4.7/5
(40)

All of the following features of a relational query or of the relational database that it accesses are considered by the relational query optimizer, except ____.

(Multiple Choice)
4.8/5
(29)

The BETWEEN operator in the SQL SELECT command WHERE clause requires that a character string must be between two specified character strings.

(True/False)
4.8/5
(41)

The use of a subquery in an SQL SELECT statement is always optional.

(True/False)
4.9/5
(28)

The SQL CREATE TABLE command is capable of doing all of the following, except ____.

(Multiple Choice)
4.7/5
(36)

A relational query optimizer ____.

(Multiple Choice)
4.8/5
(38)

Structured Query Language (SQL) ____.

(Multiple Choice)
4.8/5
(22)

A basic SQL SELECT command is capable of performing a combination of relational Select and Project operations.

(True/False)
4.9/5
(40)

The SQL SELECT DISTINCT operator ____.

(Multiple Choice)
4.7/5
(30)

In an SQL SELECT statement, a subquery can accomplish the same function as a join.

(True/False)
4.8/5
(31)

A relational query optimizer is a separate piece of software that can be called in by the relational DBMS when it has to respond to an especially complex query.

(True/False)
4.9/5
(38)
Showing 41 - 60 of 71
close modal

Filters

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