Deck 7: Introduction to Structured Query Language Sql

Full screen (f)
exit full mode
Question
The ANSI SQL standards are also accepted by the ISO.
Use Space or
up arrow
down arrow
to flip the card.
Question
If you have not yet used the COMMIT command to store the changes permanently in the database, you can restore the database to its previous condition with the ROLLBACK command.
Question
SQL requires the use of the ADD command to enter data into a table.
Question
Any changes made to the contents of a table are not physically saved on disk until you use the SAVE command.
Question
A database language enables the user to perform complex queries designed to transform the raw data into useful information.
Question
You cannot insert a row containing a null attribute value using SQL.
Question
Only numeric data types can be added and subtracted in SQL.
Question
Although SQL commands can be grouped together on a single line, complex command sequences are best shown on separate lines, with space between the SQL command and the command's components.
Question
The CHECK constraint is used to define a condition for the values that the attribute domain cannot have.
Question
Mathematical operators cannot be used to place restrictions on character-based attributes.
Question
To list the contents of a table, you must use the DISPLAY command.
Question
Entity integrity is enforced automatically when the primary key is specified in the CREATE TABLE command sequence.
Question
All SQL commands must be issued on a single line.
Question
The COMMIT command does not permanently save all changes. In order to do that, you must use SAVE.
Question
A database language enables the user to create database and table structures to perform basic data management chores.
Question
You can select partial table contents by naming the desired fields and by placing restrictions on the rows to be included in the output.
Question
Data type selection is usually dictated by the nature of the data and by the intended use.
Question
The ANSI prescribes a standard SQL-the current fully approved version is known as SQL-07.
Question
Oracle users can use the Access QBE (query by example) query generator.
Question
SQL is considered difficult to learn; its command set has a vocabulary of more than 300 words.
Question
The SQL command that modifies an attribute's values in one or more table's rows is _____.

A) INSERT
B) SELECT
C) COMMIT
D) UPDATE
Question
SQL allows the use of logical restrictions on its inquiries such as OR, AND, and NOT.
Question
An example of a command a user would use when making changes to a PRODUCT table is .

A) CHANGE PRODUCT SET P_INDATE = '18-JAN-2004' WHERE P_CODE = '13-Q2/P2';
B) ROLLBACK PRODUCT SET P_INDATE = '18-JAN-2004' WHERE P_CODE = '13-Q2/P2';
C) EDIT PRODUCT SET P_INDATE = '18-JAN-2004' WHERE P_CODE = '13-Q2/P2';
D) UPDATE PRODUCT SET P_INDATE = '18-JAN-2004' WHERE P_CODE = '13-Q2/P2';
Question
String comparisons are made from left to right.
Question
The SQL command that allows a user to insert rows into a table is .

A) INSERT
B) SELECT
C) COMMIT
D) UPDATE
Question
An alias cannot be used when a table is required to be joined to itself in a recursive query.
Question
UPDATE tablename *****
[WHERE conditionlist];
The command replaces the ***** in the syntax of the UPDATE command, shown above.

A) SET columnname = expression
B) columnname = expression
C) expression = columnname
D) LET columnname = expression
Question
The SQL command that allows a user to permanently save data changes is .

A) INSERT
B) SELECT
C) COMMIT
D) UPDATE
Question
Most SQL implementations yield case-insensitive searches.
Question
The COUNT function is designed to tally the number of non-null "values" of an attribute, and is often used in conjunction with the DISTINCT clause.
Question
Date procedures are often more software-specific than other SQL procedures.
Question
The conditional LIKE must be used in conjunction with wildcard characters.
Question
When joining three or more tables, you need to specify a join condition for one pair of tables.
Question
Some RDBMSs, such as Microsoft Access, automatically make the necessary conversions to eliminate case sensitivity.
Question
In Oracle, the command is used to change the display for a column, for example, to place a $ in front of a numeric value.

A) DISPLAY
B) FORMAT
C) CHAR
D) CONVERT
Question
To list all the contents of the PRODUCT table, a user would use .

A) LIST * FROM PRODUCT
B) SELECT * FROM PRODUCT
C) DISPLAY * FROM PRODUCT
D) SELECT ALL FROM PRODUCT
Question
The SQL command that allows a user to list the contents of a table is .

A) INSERT
B) SELECT
C) COMMIT
D) UPDATE
Question
The current fully approved version of standard SQL prescribed by the ANSI is .

A) SQL-99
B) SQL-2003
C) SQL-4
D) SQL-07
Question
The data format for SQL character is .

A) CHAR and VARCHAR
B) VARCHAR only
C) alphanumeric
D) CHAR only
Question
ANSI-standard SQL allows the use of special operators in conjunction with the WHERE clause.
Question
Which of the following queries will output the table contents when the value of the character field P_CODE is alphabetically less than 1558-QW1?

A) SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE <'1558-QW1';
B) SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE = [1558-QW1];
C) SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE = (1558-QW1);
D) SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE = {1558-QW1};
Question
A(n) is an alternate name given to a column or table in any SQL statement.

A) alias
B) data type
C) stored function
D) trigger
Question
Which of the following queries will list all the rows in which the inventory stock dates occur on or after January 20, 2010?

A) SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDATE >= '20-JAN-2010';
B) SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDATE >= $20-JAN-2010$;
C) SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDATE <= '20-JAN-2010';
D) SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDATE >= {20-JAN-2010};
Question
Which of the following queries will output the table contents when the value of V_CODE is not equal to 21344?

A) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <> 21344;
B) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <= 21344;
C) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344;
D) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE => 21344;
Question
The special operator used to check whether an attribute value is within a range of values is .

A) BETWEEN
B) NULL
C) LIKE
D) IN
Question
The special operator used to check whether a subquery returns any rows is .

A) BETWEEN
B) EXISTS
C) LIKE
D) IN
Question
When a user issues the DELETE FROM tablename command without specifying a WHERE condition, .

A) no rows will be deleted
B) the first row will be deleted
C) the last row will be deleted
D) all rows will be deleted
Question
Which of the following queries will use the given columns and column aliases from the PRODUCT table to determine the total value of inventory held on hand and display the results in a column labeled TOTVALUE?

A) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE AS TOTVALUE FROM PRODUCT;
B) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH=P_PRICE AS TOTVALUE FROM PRODUCT;
C) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH/P_PRICE AS TOTVALUE FROM PRODUCT;
D) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH-P_PRICE AS TOTVALUE FROM PRODUCT;
Question
Which of the following is used to select partial table contents?

A) SELECT FROM BY ;
B) LIST FROM
BY ;
C) SELECT FROM
WHERE ;
D) LIST FROM
WHERE ;
Question
Which of the following queries uses the correct SQL syntax to list the table contents for either V_CODE = 21344 or V_CODE = 24288?

A) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE <= 24288;
B) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE => 24288;
C) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE > 24288;
D) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE = 24288;
Question
The command is used to restore the database to its previous condition.

A) COMMIT; RESTORE;
B) COMMIT; BACKUP;
C) COMMIT; ROLLBACK;
D) ROLLBACK;
Question
The command would be used to delete the table row where the P_CODE is 'BRT-345'.

A) DELETE FROM PRODUCT WHERE P_CODE = 'BRT-345';
B) REMOVE FROM PRODUCT WHERE P_CODE = 'BRT-345';
C) ERASE FROM PRODUCT WHERE P_CODE = 'BRT-345';
D) ROLLBACK FROM PRODUCT WHERE P_CODE = 'BRT-345';
Question
Which of the following queries will output the table contents when the value of V_CODE is equal to 21344?

A) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <> 21344;
B) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <= 21344;
C) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344;
D) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE => 21344;
Question
Which of the following queries will output the table contents when the value of P_PRICE is less than or equal to 10?

A) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE P_PRICE <> 10;
B) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE P_PRICE <= 10;
C) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE P_PRICE => 10;
D) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE P_PRICE = 10;
Question
The special operator is used to check whether an attribute value is null.

A) BETWEEN
B) IS NULL
C) LIKE
D) NOT NULL
Question
The special operator used to check whether an attribute value matches a given string pattern is .

A) BETWEEN
B) IS NULL
C) LIKE
D) IN
Question
A(n) is a query that is embedded (or nested) inside another query.

A) alias
B) operator
C) subquery
D) view
Question
To remove a row from the PRODUCT table, one must use the command.

A) COMMIT
B) DELETE
C) ERASE
D) KILL
Question
Some RDBMSs, such as Oracle, automatically data changes when issuing data definition commands.

A) COMMIT
B) ROLLBACK
C) UNSAVE
D) UPDATE
Question
Which of the following queries will use the given columns and column aliases from the PRODUCT table to determine the total value of inventory held on hand?

A) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH/P_PRICE FROM PRODUCT;
B) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH=P_PRICE FROM PRODUCT;
C) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE FROM PRODUCT;
D) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH-P_PRICE FROM PRODUCT;
Question
A(n) is a logical group of database objects, such as tables and indexes, that are related to each other.
Question
The syntax for creating an index is .

A) CREATE [NOT NULL] INDEX indexname FROM viewname(column1 [, column2]);
B) CREATE [UNIQUE] INDEX indexname ON tablename( column1 [, column2]);
C) CREATE [UNIQUE] INDEX indexname FROM tablename(column1 [, column2]);
D) CREATE [DEFAULT] INDEX indexname ON viewname(column1 [, column2]);
Question
The basic SQL vocabulary has fewer than words.
Question
The query to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and the V_NAME, V_AREACODE, V_PHONE, and V_CONTACT fields from the VENDOR table where the values of V_CODE match is .

A) SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <> VENDOR.V_CODE;
B) SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE;
C) SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <= VENDOR.V_CODE;
D) SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE => VENDOR.V_CODE;
Question
The query used to list the P_CODE, P_DESCRIPT, P_INDATE, and P_PRICE fields from the PRODUCT table in ascending order by P_PRICE is .

A) SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT SEQUENCE BY P_PRICE;
B) SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT LIST BY P_PRICE;
C) SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT ORDER BY P_PRICE;
D) SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT ASCENDING BY P_PRICE;
Question
Which of the following queries is used to list a unique value for V_CODE, where the list will produce only a list of those values that are different from one another?

A) SELECT ONLY V_CODE FROM PRODUCT;
B) SELECT UNIQUE V_CODE FROM PRODUCT;
C) SELECT DIFFERENT V_CODE FROM PRODUCT;
D) SELECT DISTINCT V_CODE FROM PRODUCT;
Question
The SQL data manipulation command HAVING:

A) restricts the selection of rows based on a conditional expression.
B) restricts the selection of grouped rows based on a condition.
C) modifies an attribute's values in one or more table's rows.
D) groups the selected rows based on one or more attributes.
Question
The constraint assigns a value to an attribute when a new row is added to a table.

A) CHECK
B) UNIQUE
C) NOT NULL
D) DEFAULT
Question
The command is used with the ALTER TABLE command to modify the table by deleting a column.

A) DROP
B) REMOVE
C) DELETE
D) ERASE
Question
The SQL aggregate function that gives the number of rows containing non-null values for a given column is

A) COUNT
B) MIN
C) MAX
D) SUM
Question
The query to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and the V_NAME, V_AREACODE, V_PHONE and V_CONTACT fields from the VENDOR table, where the values of V_CODE match and the output is ordered by the price is .

A) SELECT PRODUCT.P_DESCRIPT, PRODUCT.P_PRICE, VENDOR.V_NAME, VENDOR.V_CONTACT, VENDOR.V_AREACODE, VENDOR.V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <> VENDOR.V_CODE; ORDER BY PRODUCT.P_PRICE;
B) SELECT PRODUCT.P_DESCRIPT, PRODUCT.P_PRICE, VENDOR.V_NAME, VENDOR.V_CONTACT, VENDOR.V_AREACODE, VENDOR.V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE => VENDOR.V_CODE; ORDER BY PRODUCT.P_PRICE;
C) SELECT PRODUCT.P_DESCRIPT, PRODUCT.P_PRICE, VENDOR.V_NAME, VENDOR.V_CONTACT, VENDOR.V_AREACODE, VENDOR.V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <= VENDOR.V_CODE; ORDER BY PRODUCT.P_PRICE;
D) SELECT PRODUCT.P_DESCRIPT, PRODUCT.P_PRICE, VENDOR.V_NAME, VENDOR.V_CONTACT, VENDOR.V_AREACODE, VENDOR.V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE; ORDER BY PRODUCT.P_PRICE;
Question
With the exception of the database process, most RDBMS vendors use SQL that deviates little from the ANSI standard SQL.
Question
A table can be deleted from the database by using the command.

A) DROP TABLE
B) DELETE TABLE
C) MODIFY TABLE
D) ERASE TABLE
Question
The SQL aggregate function that gives the arithmetic mean for a specific column is .

A) COUNT
B) AVG
C) MAX
D) SUM
Question
U.S. state abbreviations are always two characters, so (2) is a logical choice for the data type representing a state column.
Question
All changes in a table structure are made using the command, followed by a keyword that produces the specific changes a user wants to make.

A) ALTER TABLE
B) UPDATE TABLE
C) COMMIT TABLE
D) ROLLBACK TABLE
Question
The SQL aggregate function that gives the total of all values for a selected attribute in a given column is? .

A) COUNT
B) MIN
C) MAX
D) SUM
Question
In the SQL environment, the word covers both questions and actions.
Question
According to the rules of precedence, which of the following computations should be completed first?

A) Performing additions and subtractions
B) Performing multiplications and divisions
C) Performing operations within parentheses
D) Performing power operations
Question
The SQL query to output the contents of the EMPLOYEE table sorted by last name, first name, and initial is _____.

A) SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE LIST BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
B) SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE ORDER BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
C) SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE DISPLAY BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
D) SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE SEQUENCE BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/111
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 7: Introduction to Structured Query Language Sql
1
The ANSI SQL standards are also accepted by the ISO.
True
2
If you have not yet used the COMMIT command to store the changes permanently in the database, you can restore the database to its previous condition with the ROLLBACK command.
True
3
SQL requires the use of the ADD command to enter data into a table.
False
4
Any changes made to the contents of a table are not physically saved on disk until you use the SAVE command.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
5
A database language enables the user to perform complex queries designed to transform the raw data into useful information.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
6
You cannot insert a row containing a null attribute value using SQL.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
7
Only numeric data types can be added and subtracted in SQL.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
8
Although SQL commands can be grouped together on a single line, complex command sequences are best shown on separate lines, with space between the SQL command and the command's components.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
9
The CHECK constraint is used to define a condition for the values that the attribute domain cannot have.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
10
Mathematical operators cannot be used to place restrictions on character-based attributes.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
11
To list the contents of a table, you must use the DISPLAY command.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
12
Entity integrity is enforced automatically when the primary key is specified in the CREATE TABLE command sequence.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
13
All SQL commands must be issued on a single line.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
14
The COMMIT command does not permanently save all changes. In order to do that, you must use SAVE.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
15
A database language enables the user to create database and table structures to perform basic data management chores.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
16
You can select partial table contents by naming the desired fields and by placing restrictions on the rows to be included in the output.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
17
Data type selection is usually dictated by the nature of the data and by the intended use.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
18
The ANSI prescribes a standard SQL-the current fully approved version is known as SQL-07.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
19
Oracle users can use the Access QBE (query by example) query generator.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
20
SQL is considered difficult to learn; its command set has a vocabulary of more than 300 words.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
21
The SQL command that modifies an attribute's values in one or more table's rows is _____.

A) INSERT
B) SELECT
C) COMMIT
D) UPDATE
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
22
SQL allows the use of logical restrictions on its inquiries such as OR, AND, and NOT.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
23
An example of a command a user would use when making changes to a PRODUCT table is .

A) CHANGE PRODUCT SET P_INDATE = '18-JAN-2004' WHERE P_CODE = '13-Q2/P2';
B) ROLLBACK PRODUCT SET P_INDATE = '18-JAN-2004' WHERE P_CODE = '13-Q2/P2';
C) EDIT PRODUCT SET P_INDATE = '18-JAN-2004' WHERE P_CODE = '13-Q2/P2';
D) UPDATE PRODUCT SET P_INDATE = '18-JAN-2004' WHERE P_CODE = '13-Q2/P2';
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
24
String comparisons are made from left to right.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
25
The SQL command that allows a user to insert rows into a table is .

A) INSERT
B) SELECT
C) COMMIT
D) UPDATE
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
26
An alias cannot be used when a table is required to be joined to itself in a recursive query.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
27
UPDATE tablename *****
[WHERE conditionlist];
The command replaces the ***** in the syntax of the UPDATE command, shown above.

A) SET columnname = expression
B) columnname = expression
C) expression = columnname
D) LET columnname = expression
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
28
The SQL command that allows a user to permanently save data changes is .

A) INSERT
B) SELECT
C) COMMIT
D) UPDATE
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
29
Most SQL implementations yield case-insensitive searches.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
30
The COUNT function is designed to tally the number of non-null "values" of an attribute, and is often used in conjunction with the DISTINCT clause.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
31
Date procedures are often more software-specific than other SQL procedures.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
32
The conditional LIKE must be used in conjunction with wildcard characters.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
33
When joining three or more tables, you need to specify a join condition for one pair of tables.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
34
Some RDBMSs, such as Microsoft Access, automatically make the necessary conversions to eliminate case sensitivity.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
35
In Oracle, the command is used to change the display for a column, for example, to place a $ in front of a numeric value.

A) DISPLAY
B) FORMAT
C) CHAR
D) CONVERT
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
36
To list all the contents of the PRODUCT table, a user would use .

A) LIST * FROM PRODUCT
B) SELECT * FROM PRODUCT
C) DISPLAY * FROM PRODUCT
D) SELECT ALL FROM PRODUCT
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
37
The SQL command that allows a user to list the contents of a table is .

A) INSERT
B) SELECT
C) COMMIT
D) UPDATE
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
38
The current fully approved version of standard SQL prescribed by the ANSI is .

A) SQL-99
B) SQL-2003
C) SQL-4
D) SQL-07
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
39
The data format for SQL character is .

A) CHAR and VARCHAR
B) VARCHAR only
C) alphanumeric
D) CHAR only
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
40
ANSI-standard SQL allows the use of special operators in conjunction with the WHERE clause.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
41
Which of the following queries will output the table contents when the value of the character field P_CODE is alphabetically less than 1558-QW1?

A) SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE <'1558-QW1';
B) SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE = [1558-QW1];
C) SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE = (1558-QW1);
D) SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE = {1558-QW1};
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
42
A(n) is an alternate name given to a column or table in any SQL statement.

A) alias
B) data type
C) stored function
D) trigger
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
43
Which of the following queries will list all the rows in which the inventory stock dates occur on or after January 20, 2010?

A) SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDATE >= '20-JAN-2010';
B) SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDATE >= $20-JAN-2010$;
C) SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDATE <= '20-JAN-2010';
D) SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDATE >= {20-JAN-2010};
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
44
Which of the following queries will output the table contents when the value of V_CODE is not equal to 21344?

A) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <> 21344;
B) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <= 21344;
C) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344;
D) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE => 21344;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
45
The special operator used to check whether an attribute value is within a range of values is .

A) BETWEEN
B) NULL
C) LIKE
D) IN
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
46
The special operator used to check whether a subquery returns any rows is .

A) BETWEEN
B) EXISTS
C) LIKE
D) IN
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
47
When a user issues the DELETE FROM tablename command without specifying a WHERE condition, .

A) no rows will be deleted
B) the first row will be deleted
C) the last row will be deleted
D) all rows will be deleted
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
48
Which of the following queries will use the given columns and column aliases from the PRODUCT table to determine the total value of inventory held on hand and display the results in a column labeled TOTVALUE?

A) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE AS TOTVALUE FROM PRODUCT;
B) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH=P_PRICE AS TOTVALUE FROM PRODUCT;
C) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH/P_PRICE AS TOTVALUE FROM PRODUCT;
D) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH-P_PRICE AS TOTVALUE FROM PRODUCT;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
49
Which of the following is used to select partial table contents?

A) SELECT FROM BY ;
B) LIST FROM
BY ;
C) SELECT FROM
WHERE ;
D) LIST FROM
WHERE ;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
50
Which of the following queries uses the correct SQL syntax to list the table contents for either V_CODE = 21344 or V_CODE = 24288?

A) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE <= 24288;
B) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE => 24288;
C) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE > 24288;
D) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE = 24288;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
51
The command is used to restore the database to its previous condition.

A) COMMIT; RESTORE;
B) COMMIT; BACKUP;
C) COMMIT; ROLLBACK;
D) ROLLBACK;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
52
The command would be used to delete the table row where the P_CODE is 'BRT-345'.

A) DELETE FROM PRODUCT WHERE P_CODE = 'BRT-345';
B) REMOVE FROM PRODUCT WHERE P_CODE = 'BRT-345';
C) ERASE FROM PRODUCT WHERE P_CODE = 'BRT-345';
D) ROLLBACK FROM PRODUCT WHERE P_CODE = 'BRT-345';
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
53
Which of the following queries will output the table contents when the value of V_CODE is equal to 21344?

A) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <> 21344;
B) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <= 21344;
C) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344;
D) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE => 21344;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
54
Which of the following queries will output the table contents when the value of P_PRICE is less than or equal to 10?

A) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE P_PRICE <> 10;
B) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE P_PRICE <= 10;
C) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE P_PRICE => 10;
D) SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE P_PRICE = 10;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
55
The special operator is used to check whether an attribute value is null.

A) BETWEEN
B) IS NULL
C) LIKE
D) NOT NULL
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
56
The special operator used to check whether an attribute value matches a given string pattern is .

A) BETWEEN
B) IS NULL
C) LIKE
D) IN
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
57
A(n) is a query that is embedded (or nested) inside another query.

A) alias
B) operator
C) subquery
D) view
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
58
To remove a row from the PRODUCT table, one must use the command.

A) COMMIT
B) DELETE
C) ERASE
D) KILL
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
59
Some RDBMSs, such as Oracle, automatically data changes when issuing data definition commands.

A) COMMIT
B) ROLLBACK
C) UNSAVE
D) UPDATE
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
60
Which of the following queries will use the given columns and column aliases from the PRODUCT table to determine the total value of inventory held on hand?

A) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH/P_PRICE FROM PRODUCT;
B) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH=P_PRICE FROM PRODUCT;
C) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE FROM PRODUCT;
D) SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH-P_PRICE FROM PRODUCT;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
61
A(n) is a logical group of database objects, such as tables and indexes, that are related to each other.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
62
The syntax for creating an index is .

A) CREATE [NOT NULL] INDEX indexname FROM viewname(column1 [, column2]);
B) CREATE [UNIQUE] INDEX indexname ON tablename( column1 [, column2]);
C) CREATE [UNIQUE] INDEX indexname FROM tablename(column1 [, column2]);
D) CREATE [DEFAULT] INDEX indexname ON viewname(column1 [, column2]);
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
63
The basic SQL vocabulary has fewer than words.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
64
The query to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and the V_NAME, V_AREACODE, V_PHONE, and V_CONTACT fields from the VENDOR table where the values of V_CODE match is .

A) SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <> VENDOR.V_CODE;
B) SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE;
C) SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <= VENDOR.V_CODE;
D) SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE => VENDOR.V_CODE;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
65
The query used to list the P_CODE, P_DESCRIPT, P_INDATE, and P_PRICE fields from the PRODUCT table in ascending order by P_PRICE is .

A) SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT SEQUENCE BY P_PRICE;
B) SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT LIST BY P_PRICE;
C) SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT ORDER BY P_PRICE;
D) SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT ASCENDING BY P_PRICE;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
66
Which of the following queries is used to list a unique value for V_CODE, where the list will produce only a list of those values that are different from one another?

A) SELECT ONLY V_CODE FROM PRODUCT;
B) SELECT UNIQUE V_CODE FROM PRODUCT;
C) SELECT DIFFERENT V_CODE FROM PRODUCT;
D) SELECT DISTINCT V_CODE FROM PRODUCT;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
67
The SQL data manipulation command HAVING:

A) restricts the selection of rows based on a conditional expression.
B) restricts the selection of grouped rows based on a condition.
C) modifies an attribute's values in one or more table's rows.
D) groups the selected rows based on one or more attributes.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
68
The constraint assigns a value to an attribute when a new row is added to a table.

A) CHECK
B) UNIQUE
C) NOT NULL
D) DEFAULT
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
69
The command is used with the ALTER TABLE command to modify the table by deleting a column.

A) DROP
B) REMOVE
C) DELETE
D) ERASE
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
70
The SQL aggregate function that gives the number of rows containing non-null values for a given column is

A) COUNT
B) MIN
C) MAX
D) SUM
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
71
The query to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and the V_NAME, V_AREACODE, V_PHONE and V_CONTACT fields from the VENDOR table, where the values of V_CODE match and the output is ordered by the price is .

A) SELECT PRODUCT.P_DESCRIPT, PRODUCT.P_PRICE, VENDOR.V_NAME, VENDOR.V_CONTACT, VENDOR.V_AREACODE, VENDOR.V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <> VENDOR.V_CODE; ORDER BY PRODUCT.P_PRICE;
B) SELECT PRODUCT.P_DESCRIPT, PRODUCT.P_PRICE, VENDOR.V_NAME, VENDOR.V_CONTACT, VENDOR.V_AREACODE, VENDOR.V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE => VENDOR.V_CODE; ORDER BY PRODUCT.P_PRICE;
C) SELECT PRODUCT.P_DESCRIPT, PRODUCT.P_PRICE, VENDOR.V_NAME, VENDOR.V_CONTACT, VENDOR.V_AREACODE, VENDOR.V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <= VENDOR.V_CODE; ORDER BY PRODUCT.P_PRICE;
D) SELECT PRODUCT.P_DESCRIPT, PRODUCT.P_PRICE, VENDOR.V_NAME, VENDOR.V_CONTACT, VENDOR.V_AREACODE, VENDOR.V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE; ORDER BY PRODUCT.P_PRICE;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
72
With the exception of the database process, most RDBMS vendors use SQL that deviates little from the ANSI standard SQL.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
73
A table can be deleted from the database by using the command.

A) DROP TABLE
B) DELETE TABLE
C) MODIFY TABLE
D) ERASE TABLE
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
74
The SQL aggregate function that gives the arithmetic mean for a specific column is .

A) COUNT
B) AVG
C) MAX
D) SUM
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
75
U.S. state abbreviations are always two characters, so (2) is a logical choice for the data type representing a state column.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
76
All changes in a table structure are made using the command, followed by a keyword that produces the specific changes a user wants to make.

A) ALTER TABLE
B) UPDATE TABLE
C) COMMIT TABLE
D) ROLLBACK TABLE
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
77
The SQL aggregate function that gives the total of all values for a selected attribute in a given column is? .

A) COUNT
B) MIN
C) MAX
D) SUM
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
78
In the SQL environment, the word covers both questions and actions.
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
79
According to the rules of precedence, which of the following computations should be completed first?

A) Performing additions and subtractions
B) Performing multiplications and divisions
C) Performing operations within parentheses
D) Performing power operations
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
80
The SQL query to output the contents of the EMPLOYEE table sorted by last name, first name, and initial is _____.

A) SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE LIST BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
B) SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE ORDER BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
C) SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE DISPLAY BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
D) SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE SEQUENCE BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
Unlock Deck
Unlock for access to all 111 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 111 flashcards in this deck.