Chapter 5 (Final) Flashcards
The DROP command deletes rows from a table individually or in groups.
False
If multiple Boolean operators are used in an SQL statement, NOT is evaluated first, then AND, then OR.
True
What will be returned when the following SQL statement is executed?
SELECT driver_no,count(*) as num_deliveries
FROM deliveries
GROUP BY driver_no;
A listing of each driver as well as the number of deliveries that he or she has made
Which of the following finds all groups meeting stated conditions?
HAVING
To eliminate duplicate rows in a query, the ________ qualifier is used in the SQL Select command.
DISTINCT
Given a table named store with 5 fields: store_id, address, city, state, zipcode, why would the following insert command not work?
INSERT INTO store values (‘234 Park Street’)
You must specify the fields to insert if you are only inserting some of the fields.
What does the following SQL statement do?
SELECT * From Customer WHERE Cust_Type = “Best”
Selects all the fields from the Customer table for each row with a customer labeled “Best”
Expressions are mathematical manipulations of data in a table that may be included as part of the SELECT statement.
True
The FROM clause is the first statement processed in an SQL command.
True
Adding the DISTINCT keyword to a query eliminates duplicates.
True
The main concept of relational databases was published in 1970 by:
E.F.Codd.
The DELETE TABLE DDL command is used to remove a table from the database.
False
The views are created by executing a CREATE VIEW SQL command.
True
Applications can be moved from one machine to another when each machine uses SQL.
True
SQL originated from a project called System-S.
False
The SQL command used to populate tables is the INSERT command.
True
In an SQL statement, which of the following parts states the conditions for row selection?
WHERE
The following query totals sales in state= ‘MA’ for each salesperson.
SELECT salesperson_id, sum(sales)
FROM salesperson
GROUP BY salesperson_id
HAVING state = ‘MA’;
False
The WHERE clause is always processed before the GROUP BY clause when both occur in a SELECT statement.
True
Which of the following counts ONLY rows that contain a value?
COUNT
Relational databases are heavily based on the mathematical concept of:
set theory
Which of the following is a purpose of the SQL standard?
To specify syntax and semantics of SQL data definition and manipulation languages
A catalog is the structure that contains object descriptions created by a user.
False
Implementation of a standard can never stifle creativity and innovation.
False
SQL originated from a project called System-S.
False
A single value returned from an SQL query that includes an aggregate function is called a(n):
scalar aggregate.
An INSERT command does not need to have the fields listed.
True
When creating a table, it is not important to consider foreign key–primary key mates.
False
What does the following SQL statement do?
ALTER TABLE Customer_T
ADD (Type Varchar (2));
Alters the Customer_T table by adding a field called “Type”
What result set is returned from the following query?
SELECT Customer_Name, telephone
FROM customers
WHERE city in (‘Boston’,’New York’,’Denver’);
The Customer_Name and telephone of all customers living in either Boston, New York or Denver
What result set will the following query return?
SELECT Item_No, description
FROM item
WHERE weight > 100 and weight < 200;
The Item_No and description for all items weighing between 101 and 199
Which of the following is true of the order in which SQL statements are evaluated?
The SELECT clause is processed before the ORDER BY clause.
The following two SQL statements will produce different results.
SELECT last_name, first_name
FROM customer
WHERE state = ‘MA’ OR state = ‘NY’ OR state = ‘NJ’ OR state = ‘NH’ OR state = ‘CT’;
SELECT last_name, first_name
FROM customer
WHERE state in (‘MA’,’NY’,’NJ’,’NH’,’CT’);
False
INSERT INTO is an example of ________ code.
DML
Indexes are created in most RDBMSs to:
provide rapid random and sequential access to base-table data.
________ is a set of commands used to update and query a database.
DML
The following INSERT command would work fine:
INSERT INTO budget values 121,222,111;
False
A database table is defined using the data definition language (DDL).
True
A referential integrity constraint specifies that the existence of an attribute in one table depends upon the existence of a foreign key in the same or another table.
False
If multiple Boolean operators are used in an SQL statement, NOT is evaluated first, then AND, then OR.
True