Font size
WorksheetsAIT 524 SQL Chapter 13
Total questions: 105
Worksheet time: 52mins
Which type of view is created with the following command?
CREATE VIEW inventory
AS SELECT isbn, title, retail price
FROM books
WITH READ ONLY;
simple
complex
derived
inline
Which statement is true about the view created with the following command?
CREATE VIEW inventory AS SELECT isbn, title, retail price
FROM books
WITH READ ONLY;
The command creates a simple view.
DML operations are NOT allowed on the data displayed by the view.
A view named INVENTORY did not previously exist.
all apply
Which statement is not true about the view created with the following command?
CREATE VIEW inventory
AS SELECT isbn, title, retail price
FROM books;
The command creates a simple view.
DML operations are not allowed on the data displayed by the view.
A view named INVENTORY did not previously exist.
all apply
Which type of view is created with the following command?
CREATE VIEW OR REPLACE outstanding
AS SELECT customer#, order#, orderdate, shipdate
FROM orders
WHERE shipdate IS NULL
WITH READ ONLY;
simple
complex
derived
inline
Which statement is true about the view created with the following command?
CREATE OR REPLACE VIEW outstanding
AS SELECT customer#, order#, orderdate, shipdate
FROM orders
WHERE shipdate IS NULL
WITH READ ONLY;
The order# of an order cannot be changed through the view.
The shipping date of an order cannot be changed through the view.
No DML operations are permitted through the view.
all apply
Which statement is true about the view created with the following command?
CREATE OR REPLACE VIEW inventory
AS SELECT isbn, title, retail price
FROM books;
The command creates a complex view.
DML operations are not allowed on the data displayed by the view.
A database object named INVENTORY may already exist.
all apply
Which statement is true about the view created with the following command?
CREATE VIEW outstanding
AS SELECT customer#, order#, orderdate, shipdate
FROM orders
WHERE shipdate IS NULL
WITH CHECK OPTION;
The order# of an order cannot be changed through the view.
The shipping date of an order cannot be changed through the view.
No DML operations are permitted through the view.
none apply
Which type of view is created with the following command?
CREATE VIEW outstanding
AS SELECT customer#, order#, orderdate, shipdate
FROM orders
WHERE shipdate IS NULL
WITH CHECK OPTION;
complex
partial
simple
none apply
Which statement is true about the view created with the following command?
CREATE VIEW OR REPLACE outstanding
AS SELECT customer#, order#, orderdate, shipdate
FROM orders
WHERE shipdate IS NULL;
The order# of an order can be changed through the view.
The shipping date of an order can be changed through the view.
A new order can be added through the view as long as no constraints on the underlying table are violated.
all apply
Which type of view is created by the following command?
CREATE VIEW OR REPLACE outstanding
AS SELECT customer#, order#, orderdate, shipdate
FROM orders
WHERE shipdate IS NULL;
simple
complex
inline
none apply
Which statement about the view created from the following command is correct, assuming no constraints exist on the underlying table?
CREATE VIEW prices
AS SELECT isbn, title, cost, retail, retail-cost profit
FROM books;
The retail price of a book can be changed.
The profit generated by a book can be changed.
The profit generated by a book can be added.
Values for a new book can be added for all five columns displayed by the view.
Which type of view is created from the following command?
CREATE VIEW prices
AS SELECT isbn, title, cost, retail, retail-cost profit
FROM books;
simple
inline
complex
derived
Which SQL statement can be executed based upon the view created from the following command, assuming no constraints exist on the underlying table?
CREATE VIEW prices
AS SELECT isbn, title, cost, retail, retail-cost profit
FROM books;
INSERT INTO prices (title, cost, retail, profit)
VALUES ('A NEW BOOK', 49.99, 69.99, 20);
INSERT INTO prices (title, cost, retail, profit)
VALUES ('A SECOND BOOK', 49.99, 39.99, -10);
INSERT INTO prices (title, cost, retail)
VALUES ('A NEW BOOK', 49.99, 69.99);
none apply
Which type of view is created from the following SQL command?
CREATE OR REPLACE VIEW prices
AS SELECT isbn, title, cost, retail, retail-cost profit, name
FROM books NATURAL JOIN publisher;
complex
simple
inline
none apply
Which statement about the view created from the following SQL command is correct, assuming ISBN from the BOOKS table is the primary key used by the view?
CREATE OR REPLACE VIEW prices
AS SELECT isbn, title, cost, retail, retail-cost profit, name
FROM books NATURAL JOIN publisher;
DML operations can only be performed on the columns belonging to the PUBLISHER table.
No DML operations are allowed.
DML operations are allowed on both the BOOKS and PUBLISHER tables.
DML operations can only be performed on the columns belonging to the BOOKS table.
A(n) ____ table is the table that contains the primary key the view uses to uniquely identify each record being displayed by the view.
non key-preserved
key-preserved
primary
non primary-keyed
A(n) ____ table is a table that does not contain the primary key that a view uses to uniquely identify each record being displayed by the view.
non key-preserved
key-preserved
primary
non primary-keyed
Which of the following statements about performing DML operations on complex views is correct?
DML operations cannot be performed on a non primary key-locked table
DML operations cannot be performed on a non key-preserved table.
DML operations can be performed if a view contains a group function or a GROUP BY clause.
none apply
Which statement about the view created from the following SQL statement is correct?
CREATE VIEW balancedue AS SELECT customer#, order#, SUM(quantity*retail) amtdue
FROM customers NATURAL JOIN orders NATURAL JOIN orderitems NATURAL JOIN books GROUP BY customer#, order#;
No DML operations can be performed through the view.
DML operations can only be performed on the CUSTOMERS table since it is the primary key for the view.
Only rows can be added through the view — no other DML operations are allowed.
none apply
Which type of view is created from the following SQL statement?
CREATE VIEW balancedue
AS SELECT customer#, order#, SUM(quantity*retail) amtdue
FROM customers NATURAL JOIN orders NATURAL JOIN
orderitems NATURAL JOIN books
GROUP BY customer#, order#;
simple
complex
inline
partial
DML operations are not allowed on a view that is created with the ____ keyword.
JOIN
NATURAL JOIN
DISTINCT
REPLACE
DML operations are not allowed on a view that includes the pseudo column ____.
ROWNUMBER
DISTINCTROW
ROWNUM
NUMROW
Which command will delete a view?
ALTER TABLE...DROP VIEW
DROP VIEW
ALTER TABLE...DELETE VIEW
DELETE VIEW
What is the definition of an inline view?
It is a permanent database object that can be referenced by subsequent queries.
It is a view that retrieves data from one or more tables, and can contain functions and grouped data.
It is a temporary data source that exists only while a command is being executed.
It is a temporary pseudo column.
The type of view that actually replicates data is called a(n) ____ view.
simple
complex
inline
materialized
The subquery used to create a(n) ____ view can contain an ORDER BY clause.
simple
complex
derived
inline
