DBMSregi

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

E1

1. Question 1

Which of the following is not a hardware component of a client/server system?


1. network
2. clien
3. printer
4. server
2. Question 2

The processing that’s done by the DBMS is typically referred to as


1. front-end processing
2. back-end processing
3. the file server
4. the user interface
3. Question 3

The interface between an application program and the DBMS is usually provided by the
1. back end
2. front end
3. data access APIPI
4. programmer
4. Question 4

The SQL statements that work with the data in a database are called
1. data manipulation language
2. data manipulation statements
3. data modification language
4. data modification statements
5. Question 5

Which of the following types of SQL statements is not a DML statement?


1. INSERT
2. UPDATE
3. SELECT
4. CREATE TABLETABLE
6. Question 6

Which of the following types of statements does not modify the data in a table?
1. SELECT
2. INSERT
3. UPDATE
4. DELETE
7. Question 7

Which of the following recommendations won’t improve the readability of your SQL statements?
1. Break long clauses into multiple lines.
2. Use comments to describe what each statement does.hat each statement does.
3. Start each clause on a new line.
4. Indent continued lines
8. Question 8

A database driver is software that lets the


1. data access model communicate with the application program
2. data access model communicate with the database
3. application program communicate with the data access model
4. application program communicate with the database

E2

1. Question 1

To model a database on a real-world system, you typically represent each real-world entity as a
1. column
2. row
3. table
4. cell
2. Question 2

When you identify the data elements in a new database, you typically subdivide data elements into
1. the largest practical components
2. the smallest practical components
3. components that can be easily parsed each time you use them
3. Question 3

If two tables have a one-to-many relationship, which of the following do you typically need to add to
the table on the “many” side?
1. a primary key column
2. a foreign key column
3. an indexed column
4. a linking column
4. Question 4

If two tables have a many-to-many relationship, which of the following do you typically use to relate
their rows?
1. a linking table
2. a master table
3. an index in each table
4. a foreign key column in each table
5. Question 5

Which of the following statements about the primary key for a table is not true?
1. Its values must be unique.
2. Its values can never change.
3. Its values should be short.
4. It can consist of two or more columns.
6. Question 6

What type of constraints do you need to define to use declarative referential integrity?
1. unique
2. not null
3. primary key
4. foreign key
7. Question 7

Which of the following does not violate the referential integrity of a database?
1. inserting a new row into a table with a foreign key that doesn’t match a primary key in the
related table
2. updating a foreign key with a value that doesn’t match a primary key in the related table
3. updating a primary key in a primary key table without also updating the foreign keys for the
related rows in all related tables
4. deleting a row in a foreign key table without deleting the related row in the related
primary key table
8. Question 8

To enforce referential integrity for a delete operation, a MySQL database can (Choose all applied)
1. return an error instead of deleting any rows
2. set the foreign key values in the related rows to null
3. delete the related rows in the foreign key table
9. Question 9

Which of the following is not a good guideline for deciding when to create an index for a column?
1. The column is a foreign key.
2. The column is frequently updated.
3. The column is frequently used in search conditions or joins.
4. The column contains a large number of distinct values.
10. Question 10

To be in the first normal form, each cell in a table must contain


1. a unique value
2. a non-unique value
3. a single, scalar value
4. a non-redundant value
11. Question 11

To apply the second normal form, you move columns that don’t depend on the entire primary key to
another table and establish a relationship between the two tables. This
1. reduces redundancy but makes maintenance more difficult
2. reduces redundancy and makes maintenance easier
3. increases redundancy but makes maintenance easier
4. increases redundancy but makes the data more consistent
12. Question 12

To be in the third normal form,


1. each non-key column must depend only on the primary key
2. each non-key column must not depend on the primary key
3. each non-key column must contain repeating values
4. all of the given options
13. Question 13
Most database designers consider a database structure to be normalized if it’s in which of the
following normal forms?
1. Second
2. third
3. Boyce-Codd
4. sixth
14. Question 14

Before you can normalize a data structure, you must do all but one of the following. Which one is it?
1. identify the data elements
2. identify the tables and assign columns
3. identify the primary and foreign keys
4. identify the indexes
15. Question 15

Which of the following statements is not true about a database that’s normalized to the fifth normal
form?
1. It contains no multivalued dependencies.
2. Fewer joins are required to retrieve data.
3. Data redundancy is minimized or eliminated.

E3

1. Question 1

Which uses the least amount of storage?


1. 'example' stored in a column of type CHAR(20)
2. 'exam' stored in a column of type CHAR(20)
3. 'ex' stored in a column of type CHAR(20)
4. they all use the same amount of storage
2. Question 2

Which uses the least amount of storage?


1. 'example' stored in a column of type VARCHAR2(20)
2. 'exam' stored in a column of type VARCHAR2(20)
3. 'ex' stored in a column of type VARCHAR2(20)
4. they all use the same amount of storage
3. Question 3

Which of the following statements is not true about the CHAR type?
1. It uses the same amount of storage for each value.
2. It includes one byte that indicates the actual length of the string.of the string.
3. When used with the utf8mb4 character set, four bytes must be reserved for each character.
4. It can be used to store numbers that aren’t used in numeric operations.
4. Question 4

Numbers that don’t include a decimal point are known as


1. integers
2. exact numbers
3. real numbers
4. precise numbers
5. Question 5

Numbers that include a decimal point are known as


1. integers
2. exact numbers
3. real numbers
4. precise numbers
6. Question 6

All of the following values can be stored in a column that’s defined as DECIMAL(6,2), except
1. -246
2. 0
3. 2479.95
4. 32492.05
7. Question 7

Which of the following indicates the total number of digits that can be stored in a real number?
1. Size
2. precisionion
3. scale
4. significance
8. Question 8

Which of the following types of real numbers is considered an exact numeric type?
1. DOUBLE
2. FLOAT
3. DECIMALL
4. all of the given options
9. Question 9

The DATE data type can store


1. dates only
2. dates and times
3. times only
4. all of the given options
10. Question 10

Which of the following is the default date format for MySQL?


1. mm/dd/yy
2. yyyy-mm-dd
3. mon-dd-yyyy
4. yy/dd/mm
11. Question 11

Which of the following statements about a TIMESTAMP type is not true?


1. It stores a date and time.
2. MySQL automatically sets the value of a TIMESTAMP column when it inserts a row.
3. MySQL automatically changes the value of a TIMESTAMP column when it updates a row.
4. It requires more storage than a DATETIME type.
12. Question 12
The ENUM data type stores values that are mutually exclusive. Which choice is not appropriate for
the ENUM type?
1. small, medium, large
2. yes, no, maybe
3. mushrooms, sausage, peppersusage, peppers
4. cash, credit, debit
13. Question 13

Which of the following types of data would you not store in a binary large object (BLOB) type?
1. image files
2. text files
3. sound files
4. video files
14. Question 14

Which of the following is not true if you use a string in a numeric expression?
1. If the string contains only numbers, MySQL returns those numbers.
2. If the string starts with a number, MySQL returns that number and each successive number
until it encounters a letter or special character.
3. If the string starts with a letter or special character, MySQL returns a value of zero.
4. If the string doesn’t contain any numbers, an error occurs.
E4a

1. In the collation, utf8_spanish_ci, the ci stands for:


1. alphanumeric-special
2. case-insensitive
3. accent-special
4. accent-sensitive
2. Question 2

In the collation, utf8mb4_0900_as_cs, the as stands for:


1. alphanumeric-special
2. alphanumeric-sensitive
3. accent-special
4. accent-sensitive
3. Question 3

Which feature does the MyISAM storage engine not support?


1. full-text searches
2. foreign keys
3. spatial data types
4. Question 4

Which of the following engines supports foreign keys and transactions and is the default storage
engine for MySQL 5.5 and later.
1. InnoDB
2. MyISAM
3. BLACKHOLE
4. none of the given options
5. Question 5
A character set determines the characters that are used to represent
1. the binary types in a database
2. the character types in a databasee
3. the numeric types in a database
4. all of the given options

E4b

1. Question 1

You use data definition language (DDL) to create, modify, and delete
1. tables only
2. databases and tables only
3. tables and indexes only
4. databases, tables, and indexess
2. Question 2

The CREATE TABLE statement


1. creates a new table in the specified database
2. creates a new table in the current database
3. specifies attributes for an existing table
4. all of the given options
3. Question 3

Which of the following keywords does not define a column constraint?


1. UNIQUE
2. DEFAULT
3. PRIMARY KEY
4. NOT NULL
4. Question 4

Which of the following attributes do you use to generate the values for a column as unique numbers in
sequence?
1. AUTO_NUMBER
2. UNIQUE_NUMBER
3. AUTO_INCREMENT
4. UNIQUE_INCREMENT
5. Question 5

When you code a script for creating a database


1. you can create the tables in whatever sequence you prefer
2. you need to create the referred to tables before you create the tables that refer to
themables that refer to them
3. you need to create the indexes before you create the tables that they apply to
4. you need to code the primary key column first in each table
6. Question 6

Which of the following can you not specify for a column when you create a table using the CREATE
TABLE statement?
1. data type
2. value
3. column name
4. attributes
7. Question 7

Which of the following is true about creating indexes?


1. MySQL automatically creates indexes for primary keys.
2. MySQL automatically creates indexes for foreign keys.
3. You can create an index that’s based on more than one column.
4. All of the given options
8. Question 8

Which of the following statements do you use to delete all data from a table without deleting the
definition for the table?
1. RENAME TABLE
2. TRUNCATE TABLELE
3. CREATE TABLE
4. DROP TABLE
9. Question 9

Which of the following is not true about indexes?


1. They can help speed up insert, update and delete operations on columns that are
updated frequently.
2. MySQL automatically creates an index for unique constraints.
3. They can improve performance when MySQL searches for rows in a table.
4. They can be deleted by using the DROP INDEX statement.
10. Question 10

When you define a column with the DEFAULT attribute


1. a null value is used if another value isn’t specified when a row is added to the database.
2. the default value you specify does not need to correspond with the data type for the column.
3. the default value is used if another value isn’t specified when a row is added to the
database.specified when a row is added to the database.
11. Question 11

Which is true when you define a column as the primary key?


1. The column is forced to be NOT NULL.
2. The column is forced to contain a unique value for each row.
3. An index is automatically created based on the column.
4. All of the given options
12. Question 12

When you code a table-level constraint, the constraint can refer to data in more than one
1. database
2. table
3. column
4. value
13. Question 13

If you omit both NULL and NOT NULL from the list of column attributes in a CREATE TABLE
statement, which is the default setting?
1. NULL
2. NOT NULL
3. This will cause an error
4. none of the given options
14. Question 14

What kind of constraint enforces referential integrity between tables?


1. primary key
2. foreign key
3. unique key
4. all of the given options
15. Question 15

Which statement is used to modify the structure of an existing table?


1. ALTER TABLE
2. CREATE TABLE
3. CHANGE TABLE
4. UPDATE

E5

1. Which of the following statements is true when you use MySQL Workbench to run INSERT,
UPDATE, and DELETE statements?
1. By default, the changes are automatically committed to the database.
2. If autocommit mode is on, you can rollback the changes by clicking on the Rollback button.
3. If autocommit mode is on, you can commit the changes by clicking on the Commit button.
4. By default, the changes are rolled back when you exit MySQL Workbench unless you
commit them.
2. Question 2

Assuming that all of the table and column names are spelled correctly, what’s wrong with the INSERT
statement that follows?
INSERT INTO invoices
(vendor_id, invoice_number, invoice_total, payment_total, credit_total,
terms_id, invoice_date, invoice_due_date)
VALUES
(97, '456789', 8344.50, 0, 0, 1, '2012-08-31')
1. The column names in the column list are in the wrong sequence.
2. All of the values should be enclosed by single quotes.
3. There are too many items in the VALUES list.
4. The number of items in the column list doesn’t match the number in the VALUES list.
match the number in the VALUES list.
3. Question 3

Which of the following statements best describes what this INSERT statement does?
INSERT INTO invoices_copy
SELECT *
FROM invoices
WHERE terms_id = 1
1. Adds one row from the Invoices table to the Invoices_Copy table.
2. Adds all of the rows in the Invoices table that have 1 in the terms_id column to the
Invoices_Copy table.
3. Adds all of the rows in the Invoices table to the Invoices_Copy table and sets the terms_id
column to 1 in each row.
4. Updates all of the rows in the Invoices_Copy table that have 1 in the terms_id column to the
rows in the Invoices table.
4. Question 4

Which of the following statements best describes what this UPDATE statement does?
UPDATE invoices
SET credit_total = invoice_total - payment_total
WHERE vendor_id = 10
AND invoice_total - payment_total - credit_total > 0
1. Updates the credit_total column for all invoices with a balance due so they don’t have a
balance due.
2. Updates the credit_total column for the first invoice with 10 in the vendor_id column and a
balance so it doesn’t have a balance due.
3. Updates the credit_total column for all invoices with 10 in the vendor_id column and
a balance due so they don’t have a balance due.
4. Updates the credit_total column for all invoices with a balance due
5. Question 5

Which of the following statements about creating a table using the CREATE TABLE AS statement
with a SELECT statement is not true?
1. The table must not exist.
2. Each column name in the SELECT clause must be unique.
3. You can include any of the clauses of the SELECT statement.
4. The definitions of primary keys, foreign keys, and indexes are included in the new
table.cluded in the new table.
6. Question 6

Code example 5-1


team_id INT NOT NULL AUTO_INCREMENT,
team_name VARCHAR(50),
team_rank INT NOT NULL DEFAULT 0

(Refer to code example 5-1.) What are the values of the team_id, team_name, and team_rank columns
after the following statement is executed, assuming that the Teams table has one row in it with a
team_id of 1?
INSERT INTO teams
VALUES (DEFAULT, NULL, 3)
1. 0, NULL, 0
2. 2, NULL, 1
3. 0, NULL, 3
4. 2, NULL, 3
7. Question 7

When you use a subquery to insert rows from one table into another table, which of the following
statements is not true?
1. The target table must already exist.
2. You must omit the column list from the INSERT statement.ent.
3. You must omit the VALUES clause from the INSERT statement.
4. You must include a SELECT statement that retrieves the rows to be inserted.
8. Question 8
Which of the following statements would you use to change the invoice_total value in the Invoices
table so it’s 1% less than the current invoice total for every vendor in the state of Arizona?
1. UPDATE invoices
SET invoice_total = invoice_total - (invoice_total * .01)
WHERE vendor_id IN
(SELECT vendor_id
FROM vendors
WHERE vendor_state = 'AZ')UPDATE invoices
2. UPDATE invoices
SET invoice_total = invoice_total * .01
WHERE vendor_id IN
(SELECT vendor_id
FROM vendors
WHERE vendor_state = 'AZ')
3. UPDATE invoices
SET invoice_total = invoice_total - (invoice_total * .01)
WHERE vendor_id =
(SELECT vendor_id
FROM vendors
WHERE vendor_state = 'AZ')
4. UPDATE invoices
SET invoice_total = invoice_total * .01
WHERE vendor_id =
(SELECT vendor_id
FROM vendors
WHERE vendor_state = 'AZ')

9. Question 9

Before you can delete a row that has related rows in another table, you should
1. turn safe mode off
2. change all of the related rows so they point to a row other than the one you want to delete
3. delete the related rows
4. delete the related table

E6

1. Question 1

When you code a SELECT statement, you must code the four main clauses in the following order
1. SELECT, FROM, ORDER BY, WHERE
2. SELECT, ORDER BY, FROM, WHERE
3. SELECT, WHERE, ORDER BY, FROM
4. SELECT, FROM, WHERE, ORDER BY
2. Question 2

Which clause of the SELECT statement specifies the table that contains the data to be retrieved?
1. SELECT
2. FROM
3. WHERE
4. ORDER BY
3. Question 3

Which clause do you use to filter the rows returned by a SELECT statement?
1. SELECT
2. FROM
3. WHERE
4. ORDER BY
4. Question 4

How would you code a SELECT clause so it returns all columns from the base table?
1. SELECT ALL
2. SELECT COLUMNS
3. SELECT *.*
4. SELECT *
5. Question 5

When you code a calculated value in a SELECT clause, the expression for the calculated value can
include
1. arithmetic operators only
2. arithmetic operators and functions onlys only
3. arithmetic operators, comparison operators, and functions only
4. arithmetic operators, comparison operators, logical operators, and functions
6. Question 6

Which of the following is not a valid column alias?


1. Total
2. total sales
3. total_sales
4. "Total Sales"
7. Question 7

Which of the following SELECT clauses could you use to assign an alias to the invoice_total column?
(Choose all applied)
1. SELECT invoice_number, invoice_date, invoice_total total
2. SELECT invoice_number, invoice_date, invoice_total AS total
3. SELECT invoice_number, invoice_date, invoice_total : total
8. Question 8

Which of the following expressions does not compute 10% of the balance due if balance due is the
invoice total minus the credit total minus the payment total?
1. invoice_total - credit_total - payment_total / 10
2. (invoice_total - payment_total - credit_total) / 10
3. (invoice_total - (payment_total + credit_total)) * 0.10
4. ((invoice_total - payment_total) - credit_total) / 10
9. Question 9

Which of the following can you not code in a SELECT clause when you omit the FROM clause from
a SELECT statement?
1. a literal value
2. an arithmetic expression
3. a function
4. a base table columnumn
10. Question 10

Which of the following WHERE clauses will return vendor names from A to C?
1. WHERE vendor_name = D
2. WHERE vendor_name < 'D'
3. WHERE vendor_name = 'D'
4. WHERE vendor_name < 'C'
11. Question 11

When coded in a WHERE clause, which of the following search conditions will not return a result set
that includes all invoices with an invoice_total value of $1000 or less?
1. invoice_total <= 1000
2. NOT (invoice_total > 1000)
3. invoice_total IN (0, 1000)
4. invoice_total BETWEEN 0 AND 1000
12. Question 12

When coded in a WHERE clause, which search condition will return invoices when payment_date
isn’t null and invoice_total is greater than or equal to $500?
1. payment_date IS NULL AND invoice_total > 500
2. payment_date IS NOT NULL OR invoice_total >= 500
3. NOT (payment_date IS NULL AND invoice_total <= 500)
4. payment_date IS NOT NULL AND invoice_total >= 500
13. Question 13

The order of precedence for the logical operators in a WHERE clause is


1. Not, And, Or
2. And, Or, Not
3. Or, And, Not
4. Not, Or, And
14. Question 14

When you code an ORDER BY clause, you can specify a


1. column name or alias only
2. column name or expression only
3. column name, alias, or expression only
4. column name, alias, expression, or column numbermn number
15. Question 15

Which of the following would return a maximum of 7 rows, starting with the 5th row?
1. LIMIT 7, 4
2. LIMIT 4, 7
3. LIMIT 4
4. LIMIT 4, 6
16. Question 16

When coded in a WHERE clause, which of the following would not return rows for vendors in the
cities of San Diego and Santa Ana?
1. vendor_city LIKE 'SAN%'
2. vendor_city REGEXP 'NA$'
3. vendor_city REGEXP '^SA'
17. Question 17

Which of the following statements about sorting the rows in a result set is not true?
1. Null values always appear first in the sort sequence.
2. The sort order is determined by the character set you’re using.
3. A column that’s used for sorting must be included in the SELECT clause.T clause.
4. The rows can be sorted by any number of columns in either ascending or descending
sequence
18. Question 18

Which of the following SELECT statements would you use to prevent duplicate rows from being
returned?
1. SELECT vendor_id DISTINCT
FROM invoices
ORDER BY vendor_id
2. SELECT DISTINCT vendor_id
FROM invoices
ORDER BY vendor_id

3. SELECT vendor_id
FROM DISTINCT invoices
ORDER BY vendor_id
4. SELECT vendor_id
FROM invoices
WHERE DISTINCT
ORDER BY vendor_id

E7

1. Question 1

In a join, column names need to be qualified only


1. in inner joins
2. in outer joins
3. when the code is confusing
4. when the same column names exist in both tablest in both tables
2. Question 2

If you assign an alias to one table in a join, you have to


1. assign them to all of the tables
2. use that alias to refer to the table throughout your query
3. qualify every column name in the query
4. qualify all of the column names for that table
3. Question 3

Which is not true about the USING keyword?


1. you use it to simplify the syntax for joining tables
2. you code a USING clause in addition to the ON clause
3. it can be used with inner or outer joins
4. the join must be an equijoin, meaning the equals operator is used to compare the two columns
4. Question 4

Unlike a join, a union


1. is coded in the ORDER BY clause
2. by default, does not eliminate duplicate rows
3. combines columns from the same table
4. combines the result sets of two or more SELECT statements
5. Question 5

Which of the following is not a reason for using the explicit syntax instead of the implicit syntax for
joins? The explicit syntax
1. is easier to read and understand
2. lets you separate the join and search conditions
3. is an older syntax that works with legacy code
4. lets you combine inner and outer joins
6. Question 6

In a cross join, all of the rows in the first table are joined with all of the
1. distinct rows in the second table
2. matched rows in the second table
3. unmatched columns in the second table
4. rows in the second table
7. Question 7

When you code a union that combines two result sets, which of the following is not true?
1. Each result set must have the same number of columns.
2. The result sets may or may not have any duplicate rows.
3. The corresponding columns in the result sets must have compatible data types.
4. The result sets must be derived from different tables.
8. Question 8

You can simulate a full outer join by using


1. a union
2. the ON clause
3. a left outer join
4. a self join
9. Question 9

A full outer join returns


1. rows in the left table that don’t satisfy the join condition
2. unmatched rows from both the left and right tables
3. rows in the right table that don’t satisfy the join condition
4. the Cartesian product of the two tables
10. Question 10

SELECT vendor_name, invoice_number


FROM invoices LEFT JOIN vendors
ON invoices.vendor_id = vendors.vendor_id
The total number of rows returned by this query must equal
1. the number of rows in the Invoices table
2. the number of rows in the Vendors table
3. the number of rows in the Invoices table plus the number of rows in the Vendors table
4. none of the given options
11. Question 11

Code example 4-1


SELECT vendor_name, invoice_number
FROM invoices LEFT JOIN vendors
ON invoices.vendor_id = vendors.vendor_id
(Refer to code example 4-1.) If the LEFT keyword is replaced with the RIGHT keyword, the total
number of rows that are returned must equal
1. the number of rows in the Invoices table
2. the number of rows in the Vendors table
3. the number of rows in the Invoices table plus the number of rows in the Vendors table
4. None of the given options
12. Question 12

When you use the USING keyword for a join,


1. the join can’t be an outer join
2. the join can’t be done on more than one column
3. the join must be based on a column or columns that have the same name in both
tableshat have the same name in both tables
4. the join must be an inner join
13. Question 13

Which of the following is not true about coding inner joins?


1. The join condition typically compares the primary key of one table to a foreign key of another
table.
2. The join condition must consist of a single comparison.ison.
3. The join can be done between tables in different databases.
4. The join can be done between the same table.
14. Question 14

Which of the following can you not use in a join condition?


1. logical operators
2. comparison operators
3. arithmetic operators
15. Question 15

To join each row from the first table with each row from the second table, you use a
1. cross join
2. natural join
3. left join
4. right join
16. Question 16

When you use the implicit syntax for coding inner joins, the join conditions
1. are coded on the ON clause
2. are coded on the USING clause
3. are coded on the WHERE clause
4. aren’t coded
17. Question 17

To join a table in one database to a table in another database, you must


1. prefix the name of the table in the other database with the name of that database
2. prefix the name of each table with the name of the database that contains it
3. assign an alias to the table in the other database
4. assign an alias to the table in each database
18. Question 18

To use a self join, you must do all but one of the following. Which one is it?
1. assign aliases to the tables
2. qualify each column name with an alias
3. Include the DISTINCT keyword

E8

Question 1

The six clauses of the SELECT statement must be coded in the following order:
1. SELECT, FROM, GROUP BY, HAVING, WHERE, ORDER BY
2. SELECT, FROM, WHERE, ORDER BY, GROUP BY, HAVING
3. SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY
4. SELECT, FROM, ORDER BY, WHERE, GROUP BY, HAVING

Question 2

You can code an expression that results in a date value for all but one of the following aggregate
functions. Which one is it?
1. MIN
2. MAX
3. AVG
4. COUNT

Question 3

Which of the statements below best describes the result set returned by this SELECT statement?
SELECT COUNT(DISTINCT invoice_id) AS 'count',
ROUND(AVG(line_item_amount), 2) AS average_amount
FROM invoice_line_items
5. A single row with a count of the rows in the invoice_line_items table and the average amount of all
the line items
1. A single row with a count of the invoices in the invoice_line_items table and the
average amount of all the line items
2. A row for each of the invoices in the invoice_line_items table with a count of the line items
and the average amount of the line items for that invoice

Question 4

Expressions coded in the HAVING clause


1. can use either aggregate search conditions or non-aggregate search conditions
2. can use aggregate search conditions but can’t use non-aggregate search conditions
3. can use non-aggregate search conditions but can’t use aggregate search conditions
4. can refer to any column in the base tables

Question 5

Expressions coded in the WHERE clause


1. can use either aggregate search conditions or non-aggregate search conditions
2. can use aggregate search conditions but can’t use non-aggregate search conditions

5. 3. can use non-aggregate search conditions but can’t use aggregate search
conditionsconditions
4.must refer to columns in the SELECT clause

Question 6

When a SELECT statement includes a GROUP BY clause, the SELECT clause can include all but one of
the following. Which one is it?
1. columns used for grouping
2. columns that are functionally dependent on a column used for grouping
3. columns that are not functionally dependent on a column used for groupingng
4. aggregate functions

2. Question 7

Which of the statements below best describes the result set returned by this SELECT statement?
SELECT vendor_id,
SUM(invoice_total - payment_total - credit_total) AS column_2
FROM invoices
WHERE invoice_total - payment_total - credit_total > 0
GROUP BY vendor_id
ORDER BY vendor_id
1. The unpaid balance for each invoice
2. The total unpaid balance due for each vendor_id
3. The total amount invoiced by each vendor_id
4. The total of paid invoices for each vendor_id

Question 8

Which of the statements below best describes the result set returned by this SELECT statement?
SELECT vendor_state, COUNT(*) AS column_2
FROM vendors
GROUP BY vendor_state
HAVING COUNT(*) > 1
ORDER BY vendor_state
1.The names of the vendors in each state
2.The duplicate vendors from each state
3. The number of vendors in each state
4. The number of vendors in each state that has more than one vendors more than one as more
than one vendor
Question 9

Code example 6-1


SELECT vendor_state, vendor_city, vendor_name, COUNT(*) AS invoice_qty,
SUM(invoice_total) AS invoice_average
FROM invoices JOIN vendors
ON invoices.vendor_id = vendors.vendor_id
WHERE vendor_state < 'e'
GROUP BY vendor_state, vendor_city, vendor_name
HAVING SUM(invoice_total) > 500
ORDER BY vendor_state, vendor_city, vendor_name

(Please refer to code example 6-1.) When this summary query is executed, the result set will contain
one summary row for
1. each city with invoice totals over $500
2. each vendor with invoice totals over $500
3. each city with invoice average over $500
4. each vendor with invoice average over $500
5. Question 10

Code example 6-1


SELECT vendor_state, vendor_city, vendor_name, COUNT(*) AS invoice_qty,
SUM(invoice_total) AS invoice_average
FROM invoices JOIN vendors
ON invoices.vendor_id = vendors.vendor_id
WHERE vendor_state < 'e'
GROUP BY vendor_state, vendor_city, vendor_name
HAVING SUM(invoice_total) > 500
ORDER BY vendor_state, vendor_city, vendor_name

(Please refer to code example 6-1.) Although this query runs as coded, it contains this logical error:
1. The condition in the WHERE clause should be coded in the HAVING clause.
2. The column name for the fifth column in the result set doesn’t match the data.
3. The three columns in the ORDER BY clause should use the DESC keyword so the city totals
will be in the right sequence.
4. The condition in the HAVING clause should be coded in the WHERE clause.
6. Question 11

All but one of the following is true about the WITH ROLLUP operator. Which one is it?
1. It adds a summary row for each group specified in the GROUP BY clause.
2. It adds a summary row to the end of the result set.
3. It is part of standard SQL.
4. It is coded on the GROUP BY clause.
7. Question 12

What does the GROUPING function do?


1. It evaluates an expression and returns 0 if the expression is null because it’s in a summary
row.
2. It evaluates an expression and returns 1 if the expression is null because it’s in a
summary row.
3. It evaluates an expression and returns 0 if the expression is null because it’s the result of
grouping a column that can contain null values.
4. It evaluates an expression and returns 1 if the expression is null because it’s the result of
grouping a column that can contain null values.
8. Question 13

Which of the following is a common reason for using the IF function with the GROUPING function?
1. To replace the nulls that are generated by WITH ROLLUP with literal values.
2. To replace the nulls in grouped columns with literal values.
3. To add a summary row for each group only if the group has more than one row.
4. To add a summary row for the result set only if the result set has more than one row.
9. Question 14

Code example 6-2


SELECT vendor_id, invoice_date, invoice_total,
SUM(invoice_total) OVER() AS total_invoices
SUM(invoice_total) OVER(PARTITION BY vendor_id
ORDER BY invoice_total) AS vendor_total
FROM invoices

(Refer to code example 6-2.) What rows make up the partitions for the first SUM function?
1. Each row is treated as a separate partition.
2. The rows for each invoice date are treated as a separate partition.
3. The rows for each vendor are treated as a separate partition.
4. All of the rows are treated as a single partition.
10. Question 15

Code example 6-2


SELECT vendor_id, invoice_date, invoice_total,
SUM(invoice_total) OVER() AS total_invoices
SUM(invoice_total) OVER(PARTITION BY vendor_id
ORDER BY invoice_total) AS vendor_total
FROM invoices

(Refer to code example 6-2.) What rows make up the partitions for the second SUM function?
1. Each row is treated as a separate partition.
2. The rows for each invoice date are treated as a separate partition.
3. The rows for each vendor are treated as a separate partition.partition.
4. All of the rows are treated as a single partition.
11. Question 16

Code example 6-2


SELECT vendor_id, invoice_date, invoice_total,
SUM(invoice_total) OVER() AS total_invoices
SUM(invoice_total) OVER(PARTITION BY vendor_id
ORDER BY invoice_total) AS vendor_total
FROM invoices
(Refer to code example 6-2.) What does the ORDER BY clause in the OVER clause for the second
SUM function do?
1. It sorts all rows in the result set by the invoice_total column.
2. It sorts all rows in the result set by the invoice_total column and causes the values in the
invoice_total column to be accumulated from one row to the next.
3. It sorts the rows for each vendor by the invoice_total column and causes the values in the
vendor_id column for each vendor to be accumulated from one row to the next.
4. It sorts the rows for each vendor by the invoice_total column and causes the values
in the vendor_total column for each vendor to be accumulated from one row to the
next.he values in the vendor_total column for each vendor to be accumulated from one row
to the next.
12. Question 17

Which of the following statements is not true about a frame for an aggregate window function?
1. It defines a subset of the current partition.
2. If you don’t specify the ending row for a frame, the ending row is the last row in the
partition.
3. It can be defined as the number of rows before and after the current row.
4. It can be defined as a range of values based on the value of the current row.
13. Question 18

To define peer rows for an aggregate window function, you must include all but one of the following
clauses. Which one is it?
1. PARTITION BY
2. RANGE
3. BETWEEN
4. ORDER BY
14. Question 19

Which of the following is not true about calculating a moving average for an aggregate window
function?
1. The frame must be defined using the ROWS clause.
2. The moving average always includes the current row.
3. The moving average for the first row in a partition can only include the value of the current
row plus the values of any following rows.
4. To calculate the average, you must use both the SUM and AVG functions.
15. Question 20

Which of the following best describes when you should consider using a named window?
1. Any time a SELECT statement includes two or more aggregate window functions.
2. Any time a SELECT statement includes two or more aggregate window functions that use
partitions.
3. Any time a SELECT statement includes two or more aggregate window functions that
use the same partitions.r more aggregate window functions that use the same partitions.
4. Any time you want to be able to add to the definitions of two or more aggregate window
functions.

E9
1. If introduced as follows, the subquery can return which of the values listed below?
WHERE vendor_id NOT IN (subquery)
1. a single value
2. a list of values
3. a table of values
4. a subquery can’t be introduced in this way
2. If introduced as follows, the subquery can return which of the values listed below?
WHERE (subquery)
1. a single value
2. a list of values
3. a table of values
4. a subquery can’t be introduced in this way
3. If introduced as follows, the subquery can return which of the values listed below?
WHERE 2 < (subquery)
1. a single value
2. a list of values
3. a table of values
4. a subquery can’t be introduced in this way
If introduced as follows, the subquery can return which of the values listed below?
WHERE invoice_total > ALL (subquery)
1. a single value
2. a list of values
3. a table of values
4. a subquery can’t be introduced in this way
5. Question 5

If introduced as follows, the subquery can return which of the values listed below?
SELECT (subquery)
1. a single value
2. a list of values
3. a table of values
4. a subquery can’t be introduced in this way
6. Question 6

If introduced as follows, the subquery can return which of the values listed below?
FROM (subquery)
1. a single value
2. a list of values
3. a table of values
4. a subquery can’t be introduced in this way
7. Question 7

Code example 7-1


SELECT vendor_name, COUNT(*) AS number_of_invoices,
MAX(invoice_total - payment_total - credit_total) AS balance_due
FROM vendors v
JOIN invoices i
ON v.vendor_id = i.vendor_id
WHERE invoice_total - payment_total - credit_total >
(SELECT AVG(invoice_total - payment_total - credit_total)
FROM invoices)
GROUP BY vendor_name
ORDER BY balance_due DESC

(Refer to code example 7-1.) When this query is executed, the result set will contain
1. one row for each invoice that has a larger balance due than the average balance due for all
invoices
2. one row for the invoice with the largest balance due for each vendor
3. one row for each invoice for each vendor that has a larger balance due than the average
balance due for all invoices
4. one row for each vendor that shows the largest balance due for any of the vendor’s
invoices, but only if the balance due is larger than the average balance due for all
invoices
8. Question 8

Code example 7-1


SELECT vendor_name, COUNT(*) AS number_of_invoices,
MAX(invoice_total - payment_total - credit_total) AS balance_due
FROM vendors v
JOIN invoices i
ON v.vendor_id = i.vendor_id
WHERE invoice_total - payment_total - credit_total >
(SELECT AVG(invoice_total - payment_total - credit_total)
FROM invoices)
GROUP BY vendor_name
ORDER BY balance_due DESC

(Refer to code example 7-1.) When this query is executed, the number_of_invoices for each row will
show the number
1. 1
2. of invoices in the Invoices table
3. of invoices for each vendor
4. of invoices for each vendor that has a larger balance due than the average balance
due for all invoices
9. Question 9

Code example 7-1


SELECT vendor_name, COUNT(*) AS number_of_invoices,
MAX(invoice_total - payment_total - credit_total) AS balance_due
FROM vendors v
JOIN invoices i
ON v.vendor_id = i.vendor_id
WHERE invoice_total - payment_total - credit_total >
(SELECT AVG(invoice_total - payment_total - credit_total)
FROM invoices)
GROUP BY vendor_name
ORDER BY balance_due DESC

(Refer to code example 7-1.) When this query is executed, the rows will be sorted by
1. invoice_id
2. vendor_id
3. balance_due in descending sequencedescending sequence
4. vendor_id and then by balance_due in descending sequence
10. Question 10

Code example 7-2


SELECT i.vendor_id, MAX(i.invoice_total) AS largest_invoice
FROM invoices i
JOIN
(SELECT vendor_id, AVG(invoice_total) AS average_invoice
FROM invoices
GROUP BY vendor_id
HAVING AVG(invoice_total) > 100) ia
ON i.vendor_id = ia.vendor_id
GROUP BY i.vendor_id
ORDER BY largest_invoice DESC

(Refer to code example 7-2.) When this query is executed, the result table will contain one row for
1. each vendor
2. each vendor in the table named iahe table named ia
3. each invoice
4. each invoice in the table named ia
11. Question 11

Code example 7-2


SELECT i.vendor_id, MAX(i.invoice_total) AS largest_invoice
FROM invoices i
JOIN
(SELECT vendor_id, AVG(invoice_total) AS average_invoice
FROM invoices
GROUP BY vendor_id
HAVING AVG(invoice_total) > 100) ia
ON i.vendor_id = ia.vendor_id
GROUP BY i.vendor_id
ORDER BY largest_invoice DESC

(Refer to code example 7-2.) When this query is executed, each row in the result table will show
1. the largest invoice total related to that row
2. the average invoice total related to that row
3. the largest invoice total related to that row, but only if it’s larger than the average for all
invoices
4. the average invoice total related to that row, but only if it’s greater than 100
12. Question 12

Code example 7-2


SELECT i.vendor_id, MAX(i.invoice_total) AS largest_invoice
FROM invoices i
JOIN
(SELECT vendor_id, AVG(invoice_total) AS average_invoice
FROM invoices
GROUP BY vendor_id
HAVING AVG(invoice_total) > 100) ia
ON i.vendor_id = ia.vendor_id
GROUP BY i.vendor_id
ORDER BY largest_invoice DESC
(Refer to code example 7-2.) When this query is executed, there will be one row
1. for each vendor
2. for each vendor with an average invoice total that’s greater than 100nvoice total that’s
greater than 100
3. for each vendor with a maximum invoice total that’s greater than 100
4. for each invoice with an invoice total that’s greater than the average invoice total for the
vendor and also greater than 100
13. Question 13

In which of the following ways can you not use a subquery in a SELECT statement?
1. In a SELECT clause as a column specification
2. In a FROM clause as a table specification
3. In a WHERE clause as part of a search condition
4. In an ORDER BY clause as a column specification
14. Question 14

A subquery can return


1. a single value only
2. a list of values only
3. a single value or a list of values only
4. a single value, a list of values, or a table of valuese of values
15. Question 15

Which of the following is not an advantage of using subqueries over using joins?
1. You can use a subquery to pass an aggregate value to the main query.
2. A subquery tends to be more intuitive when it uses an existing relationship between
the two tables.
3. Long, complex queries can sometimes be easier to code using subqueries.
16. Question 16

Which of the following statements about a correlated subquery is not true?


1. It is executed once for each row in the main query.
2. It can’t use the same table as the main query.
3. It must refer to a value that’s provided by a column in the main query.
4. It can use a table name or alias to refer to a table in the main query.
17. Question 17

When the following query is executed, the result set will include one row for each invoice with an
invoice total that’s greater than
SELECT vendor_name, invoice_number, invoice_total
FROM vendors JOIN invoices ON vendors.vendor_id = invoices.vendor_id
WHERE invoice_total > ANY
(SELECT invoice_total
FROM invoices
WHERE vendor_state = 'CA')
1. the minimum invoice total for vendors in California
2. the maximum invoice total for vendors in California
3. the minimum invoice total for vendors in states other than California
4. the maximum invoice total for vendors in states other than California
18. Question 18

Which of the following keywords would you use to introduce a subquery if you want to determine if
the subquery returns one or more rows?
1. ANY
2. SOME
3. EXISTS
4. ALL
19. Question 19

You can use a common table expression (CTE) to create a temporary


1. result set
2. expression
3. view
4. none of the given options
20. Question 20

Which of the following statements about common table expressions (CTEs) is not true?
1. A CTE consists of a SELECT statement.
2. A CTE can be used with SELECT, INSERT, UPDATE, and DELETE statements.
3. A CTE can refer to itself
4. A CTE can refer to any other CTE in the same WITH clause.

E10a

1. Question 1

Which of the following is the way to sort a VARCHAR column that contains numbers in numeric
sequence? In the ORDER BY clause
1. use the CAST function to convert the column values to numbers
2. add zeros to the column values using + 0
3. use the LPAD function to pad the numbers with leading zeros
4. all of the given options
2. Question 2

Which of the following statements best describes what this SELECT statement does?
SELECT invoice_number, invoice_date,
CASE
WHEN (SYSDATE() - invoice_date) >= 30 AND (SYSDATE() -
invoice_date) < 60
THEN invoice_total
ELSE 0
END AS "30-60",
CASE
WHEN (SYSDATE() - invoice_date) >= 60 AND (SYSDATE() -
invoice_date) < 90
THEN invoice_total
ELSE 0
END AS "60-90",
CASE
WHEN (SYSDATE() - invoice_date) > 90 THEN invoice_total
ELSE 0
END AS "Over 90"
FROM invoices
1. Displays three columns for each invoice with a value in the third column that indicates how
many days have elapsed between the invoice date and the current date.
2. Displays five columns for each invoice with the invoice total in one of the last three
columns based on how many days have elapsed between the invoice date and the
current date.
3. Displays three columns for each invoice with one of these messages in the third column: 30-
60, 60-90, or Over 90.
4. Displays five columns for each invoice with a message in one of the last three columns based
on how many days have elapsed between the invoice date and the current date.
3. Question 3
Which of the following functions would you use to test an expression and return a value depending on
whether that expression is true or false?
IF
1. REPLACE
2. CASE
3. COALESCE
4. Question 4

Which of the following functions would you use to substitute a non-null value for a null value?
1. IF
2. REPLACE
3. CASE
4. COALESCE

E10c

1. Question 1

If expiration_date contains a value that’s equivalent to November 2, 2018 and the SYSDATE function
returns a value that’s equivalent to December 17, 2018, what will the exp_days column contain when
this code is executed?
expiration_date - SYSDATE() AS exp_days
1. -45
2. -1.5
3. 45
4. 1.5
2. Question 2

Which of the following is not a valid way to avoid search problems when you want to search for rows
that have a specific date in a column that’s defined with the DATETIME data type?
1. use the MONTH, DAYOFMONTH, and YEAR functions in the WHERE clause to search for
just those components
2. search for a range of dates that are greater than or equal to the date you’re looking for, and
less than the date that follows the date you’re looking for
3. use the DATE_FORMAT function in the WHERE clause to return a formatted string that
only contains the month, day, and year
4. use the DATE_ADD function to remove the time values from the dates in each
columnhe dates in each column
3. Question 3

Which code returns the date in the format Friday, April 20th, 2019?
1. DATE_FORMAT('2019-04-20', '%D, %M, %Y')
2. DATE_FORMAT('2019-04-20', '%m/%d/%y')
3. DATE_FORMAT('2019-04-20', '%W, %M %D, %Y'))
4. DATE_FORMAT('2019-04-20', '%e-%b-%y')
4. Question 4

Which of the following functions would you use to add a specified number of date parts to a date?
1. TO_DAYS
2. DAYOFYEAR
3. LAST_DAY
4. DATE_ADD
5. Question 5

If the current date is 2019-02-10, what value is returned by the function that follows?
MONTH(CURDATE())
2
1. Feb
2. February
3. February 2019
6. Question 6

Which of the following statements best describes what this SELECT statement does?
SELECT invoice_number, invoice_date,
CASE
WHEN (SYSDATE() - invoice_date) >= 30 AND (SYSDATE() -
invoice_date) < 60
THEN invoice_total
ELSE 0
END AS "30-60",
CASE
WHEN (SYSDATE() - invoice_date) >= 60 AND (SYSDATE() -
invoice_date) < 90
THEN invoice_total
ELSE 0
END AS "60-90",
CASE
WHEN (SYSDATE() - invoice_date) > 90 THEN invoice_total
ELSE 0
END AS "Over 90"
FROM invoices
1. Displays three columns for each invoice with a value in the third column that indicates how
many days have elapsed between the invoice date and the current date.
2. Displays five columns for each invoice with the invoice total in one of the last three
columns based on how many days have elapsed between the invoice date and the
current date.
3. Displays three columns for each invoice with one of these messages in the third column: 30-
60, 60-90, or Over 90.
4. Displays five columns for each invoice with a message in one of the last three columns based
on how many days have elapsed between the invoice date and the current date.
7. Question 7

Which of the following statements best describes what the following SELECT statement does?
SELECT MONTH(invoice_date) AS month, vendor_name, invoice_total,
FIRST_VALUE(vendor_name) OVER (PARTITION BY MONTH(invoice_date)
ORDER BY invoice_total DESC) AS 'first_value'
FROM invoices JOIN vendors ON invoices.vendor_id = vendors.vendor_id
1. Sorts the invoices by invoice total in descending sequence within each month and displays the
name of the vendor with the smallest invoice total for each row of that month.
2. Sorts the invoices by invoice total in descending sequence within each month and
displays the name of the vendor with the largest invoice total for each row of that
month.
3. Sorts the invoices by invoice total in descending sequence within vendor name and displays
the value of the smallest invoice for each vendor and month.
4. Sorts the invoices by invoice total in descending sequence within vendor name and displays
the value of the largest invoice for each vendor and month.
E10d

1. Question 1

What is the result of the function that follows?


TRUNCATE(17.87,1)
1. 10
2. 17.8
3. 17.9
4. 17
2. Question 2

Which of the following functions returns the smallest integer that is greater than or equal to the
number?
1. FLOOR
2. TRUNCATE
3. SIGN
4. CEILING
5. CEILING
3. Question 3

If the column named float_value is a DOUBLE type, which of the following queries will not return
values that are approximately equal to 5?
1. SELECT float_value
FROM float_sample
WHERE float_value BETWEEN 4.99 AND 5.01
SELECT float_value
FROM float_sample
WHERE float_value = 5

2. SELECT float_value
FROM float_sample
WHERE ROUND(float_value, 2) = 5.00

4. Question 4

What is the result of the function that follows?


ROUND(2857.83457, -2)
1. 2857.834
2. 2857.83
3. 2900.83457
4. 2900
E10e

1. Question 1
Which of the following is not typically used to parse a string into its individual components?
1. SUBSTRING
2. SUBSTRING_INDEX
3. LENGTH
4. LOCATE
2. Question 2

Which of the following functions would you use to find a character in a string?
1. SUBSTRING
2. SUBSTRING_INDEX
3. ENGTH
4. LOCATE
3. Question 3

What happens when the function that follows is executed?


TRIM(' Joel Murach ')
1. All of the spaces at the beginning of the string are removed.
2. All of the spaces at the end of the string are removed.
3. All of the spaces at the beginning and end of the string are removed.eginning and end
of the string are removed.
4. All of the spaces are removed.
4. Question 4

What is the result of the function that follows?


REGEXP_SUBSTR('TR1-268-468R', '[1-9]-[1-9]*[A-Z]')
1. 268-468R
2. 8-468R68R
3. 1-268-
4. 1-268-468R
5. Question 5

If first_name contains Edward and last_name contains Williams, what will the solution column
contain when this code is executed?
CONCAT(LOWER(LEFT('Edward',1)), LOWER(LEFT('Williams',7))) AS solution
1. EWilliams
2. EWilliam
3. Ewilliams
4. ewiliam
6. Question 6

What is the result of the function that follows?


REGEXP_INSTR('TR1-268-468R', '8-4')
1. 0
2. 1
3. 6
4. 7
7. Question 7

Which function concatenates a string with the specified separator string added in between?
1. LTRIM
2. CONCAT
3. CONCAT_WS
4. SUBSTRING_INDEX

E11

1. Question 1

Which of the following statements is used to define a view?


SELECT
1. UPDATE
2. INSERT
3. DELETE
2. Question 2

A table that stores the data for a view is called a


1. view table
2. base table
3. temporary table
4. virtual table
3. Question 3

Each of the following is a benefit provided by using views except for one. Which one is it?
1. Views can be used to update multiple tables with a single statement.
2. You can use views to restrict access to the tables in your database to certain rows.
3. Views can be used to hide the complexity of retrieval operations.
4. You can code views that join tables.
4. Question 4

Which statement do most programmers typically use to alter a view?


1. MODIFY VIEW
2. CREATE OR REPLACE VIEWACE VIEW
3. UPDATE VIEW
4. MODIFY VIEW or CREATE OR REPLACE VIEW
5. Question 5

Which of the following can be used with an updatable view?


1. a DISTINCT clause
2. a join
3. an aggregate function
4. the UNION operator
6. Question 6

The WITH CHECK OPTION clause of the CREATE VIEW statement


1. prevents users from using the view without the appropriate authorization
2. prevents an update from being performed through the view if it causes a row to be
excluded from the view
3. prevents rows from being deleted through the view
4. prevents rows from being inserted through the view
7. Question 7
The statement
CREATE VIEW example_1
AS
SELECT vendor_name, SUM(invoice_total) AS sum_of_invoices
FROM vendors JOIN invoices ON vendors.vendor_id = invoices.vendor_id
GROUP BY vendor_name
ORDER BY vendor_name
1. will fail because the GROUP BY clause isn’t allowed
2. will fail because SUM function isn’t allowed
3. will fail because the ORDER BY clause isn’t allowed
4. will succeed
8. Question 8

In the view that follows, which field can’t be updated


CREATE VIEW example_2
AS
SELECT invoice_number, invoice_date, invoice_total, payment_total,
invoice_total - payment_total - credit_total AS balance_due,
SYSDATE() - invoice_date AS days_old
FROM invoices
1. invoice_total
2. balance_due
3. invoice_date
4. all the given options
9. Question 9

The statement
CREATE VIEW example_3
AS
SELECT *
FROM invoices
WHERE invoice_total - payment_total - credit_total > 0
1. will create an updatable view
2. will create a read-only view
3. will fail because the * operator isn’t allowed
4. will create a view through which you can delete rows, but not insert or update rows
10. Question 10

You usually don’t insert rows into a table through a view because
1. due to table constraints, using a view to insert rows often results in errors
2. the view would have to include all of the required columns for the base table that require a
value
3. if the view names more than one base table, the INSERT statement can insert data into only
one of those tables
4. All of the given options
11. Question 11

You can code views that:


1. join tables
2. summarize data
3. use subqueries and functions
4. all of the given options
12. Question 12

By default,
1. columns from different tables with the same name do not have to be renamed
2. columns in a view are given the same names as the columns in the base tables
3. calculated columns do not need to be named in the SELECT statement
4. all of the given options
13. Question 13

One of the best reasons for using views is that they can limit the exposure of the tables in your
database to external
1. users only
2. applications only
3. users and applications only
4. users, applications, and databases
14. Question 14

A view that is not updatable is called


1. a non-updatable view
2. an unchangeable view
3. a read-only view
4. a fixed view
15. Question 15

A view that’s based on another view rather than a table is called


1. a nested view
2. a hierarchical view
3. a structured view
4. a layered view

You might also like