Constraints, SQL Exam 2: Chap 3, 5, 10, 11, 12 HANDS-ON

¡Supera tus tareas y exámenes ahora con Quizwiz!

Only one ____ constraint can exist for each table.​

PRIMARY KEY

Which of the following types of constraints will not allow NULL values?​

PRIMARY KEY

If a FOREIGN KEY constraint is displayed in the USER_CONSTRAINTS view, the constraint type will have the letter ____________________ displayed.​

R

In the USER_CONSTRAINTS view, the value displayed in the CONSTRAINT_TYPE column will be a(n) ____ for a FOREIGN KEY constraint.​

R

Ch. 3-6. Rename the EMPLOYEES table as JL_EMPS.

RENAME employees TO jl_emps;

*Ch. 5-10. Execute a command that undoes the previous deletion.

ROLLBACK;

*Ch. 5-8. Execute a command that undoes the change in Step 7.

ROLLBACK;

Ch. 11-6. Determine the average profit generated by orders in the ORDERS table. Note: The total profit by order must be calculated before finding the average profit.

SELECT AVG(SUM((retail-cost)*quantity)) FROM orders JOIN orderitems USING(order#) JOIN books USING(isbn) GROUP BY order#;

*Ch. 11-1. Determine how many books are in the Cooking category.

SELECT COUNT(*) FROM books WHERE category = 'COOKING';

*Ch. 11-2. Display the number of books with a retail price of more than $30.00.

SELECT COUNT(*) FROM books WHERE retail > 30;

Ch. 12-9. Determine the number of different customers who have placed an order for books written or co-written by James Austin.

SELECT COUNT(DISTINCT customers#) FROM orders JOIN orderitems USING(order#) WHERE isbn IN (SELECT isbn FROM orderitems JOIN bookauthor USING(isbn) JOIN author USING(authorid) WHERE lname= 'AUSTIN' AND fname = 'JAMES');

Ch. 10-7. Determine the length of data stored in the ISBN field of the BOOKS table. Make sure each different length value is displayed only once (not once for each book).

SELECT DISTINCT LENGTH(isbn) FROM books;

Ch. 11-9. List the customers living in Georgia or Florida who have recently placed an order totaling more than $80.

SELECT DISTINCT firstname, lastname FROM customers JOIN orders USING(customer#) JOIN orderitems USING(order#) JOIN books USING(isbn) WHERE (state = 'FL' or state = 'GA') GROUP BY order#, firstname, lastname HAVING SUM(retail*quantity)>80;

Ch. 10- 1. Produce a list of all customers names in which the first letter of the first and last names is in uppercase and the rest are in lowercase.

SELECT INITCAP (firstname), INITCAP(lastname) FROM customers;

*Ch. 11-3. Display the most recent publication date of all books sold by JustLee Books.

SELECT MAX(pubdate) FROM books;

*Ch. 11-10. What's the retail price of the most expensive book written by Lisa White?

SELECT MAX(retail) FROM books JOIN bookauthor USING(isbn) JOIN author USING(authorid) WHERE lname = 'WHITE' AND fname = 'LISA';

Ch. 11-5. List the retail price of the least expensive book in the Computer category.

SELECT MIN(retail) FROM books WHERE category = 'COMPUTER';

Ch. 10-9. Determine the calendar date of the next occurrence of Wednesday, based on today's date.

SELECT NEXT_DAY(SYSDATE, 'WEDNESDAY') FROM dual;

Ch. 11-4. Determine the total profit generated by sales to customer 1017. Note: Quantity should be reflected in the total profit calculation.

SELECT SUM((retail-cost)*quantity) FROM orders JOIN orderitems USING(order#) JOIN books USING(isbn) WHERE customer# = 1017;

Ch. 10-5. Display the current day of the week, hour, minutes, and seconds of the current date setting on the computer you're using.

SELECT TO_CHAR(CURRENT_DATE, 'DAY, HH:MI:SS') FROM dual;

Ch. 12-2. Determine which books cost less than the average cost of other books in the same category.

SELECT a.title, b.category, a.cost FROM books a, (SELECT category, AVG(cost) averagecost FROM books GROUP BY category) b WHERE a.category = b.category AND a.cost < b.averagecost;

Ch. 12-8. Determine which customers placed orders for the least expensive book (in terms of regular retail price) carried by JustLee Books.

SELECT customer# FROM customers JOIN orders USING(customer#) JOIN orderitems USING(order#) JOIN books USING(isbn) WHERE retail = (SELECT MIN(retail) FROM books);

*Ch. 11-7. Determine how many orders have been placed by each customer. Do not include in the results any customer who hasn't recently placed an order with JustLee Books.

SELECT customer#, COUNT(*) FROM orders GROUP BY customer#;

Ch. 10-10. Produce a list of each customer number and the third and fourth digits of his or her zip code. The query should also display the position of the first occurrence of a 3 in the customer number, if it exists.

SELECT customer#, SUBSTR(zip, 3, 2), INSTR(customer#, 3) FROM customers;

Ch. 10-2. Create a list of all customer numbers along with text indicating whether the customer has been referred by another customer. Display the text "NOT REFERRED" if the customer wasn't referred to JustLee Books by another customer or "REFERRED" if the customer was referred.

SELECT firstname, lastname, NVL2(referrred, 'REFERRED', 'NOT REFERRED') FROM customers;

*Ch. 12-5. Determine which author or authors wrote the books most frequently purchased by customers of JustLee Books.

SELECT lname, fname FROM bookauthor JOIN author USING(authorid) WHERE isbn IN (SELECT isbn FROM orderitems GROUP BY isbn HAVING SUM(quantity) = (SELECT MAX(COUNT(*)) FROM orderitems GROUP BY isbn));

Ch. 11-8. Determine the average retail price of books by publisher name and category. Include only the categories Children and Computer and the group with an average retail price greater than $50.

SELECT name, category, AVG(retail) FROM books JOIN publisher USING(pubid) WHERE category IN('COMPUTER', 'CHILDREN') GROUP BY name, category;

*Ch. 12-3. Determine which orders were shipped to the same state as order 1014.

SELECT order# FROM orders WHERE shipstate = (SELECT shipstate FROM orders WHERE order# = 1014);

Ch. 12-4. Determine which orders has a higher total amount due than order 1008.

SELECT order#, SUM(quantity * paideach) FROM orderitems GROUP BY order# HAVING SUM(quantity * paideach) > (SELECT SUM(quantity * paideach) FROM orderitems WHERE order# = 1008);

*Ch. 12-7. List the shipping city and state for the order that had the longest shipping delay.

SELECT shipcity, shipstate FROM orders WHERE shipdate-orderdate = (SELECT MAX(shipdate-orderdate) FROM orders);

Ch. 12-6. List the title of all books in the same category as books previously purchased by customer 1007. Don't include books this customer has already purchased.

SELECT title FROM books WHERE category IN (SELECT DISTINCT category FROM books JOIN orderitems USING(isbn) JOIN orders USING(order#) WHERE customers# = 1007) AND isbn NOT IN (SELECT isbn FROM orders JOIN orderitems USING(order#) WHERE customer# = 1007);

*Ch. 12-10. Determine which books were published by the publisher of The Wok Way to Cook.

SELECT title FROM books WHERE pubid = (SELECT pubid FROM books WHERE title = 'THE WOK WAY TO COOK');

Ch. 10-6. Create a list of all book titles and costs. Precede each book's cost with asterisks so that the width of the displayed Cost field is 12.

SELECT title, LPAD(cost, 12, '*') FROM books;

Ch. 10-4. Display a list of all book titles and the percentage of markup for each book. The percentage of markup should be displayed as a whole number (that is, multiplies by 100) with no decimal position, followed by a percent sign (for example, .2793 = 28%). (The percentage of markup should reflect the difference between the retail and cost amount as a percent of the cost.)

SELECT title, ROUND((retail-cost)/cost*100,0)||'%' FROM books;

Ch. 10- 3. Determine the amount of total profit generated by the book purchased on order 1002. Display the book title and profit. The profit should be formatted to display a dollar sign and two decimal places. Take into account that the customer might not pay the full retail price, and each item ordered can involve multiple copies.

SELECT title, TO_CHAR(quantity*(paideach-cost), '$999.99') FROM books JOIN orderitems USING(isbn) WHERE order# = 1002;

Ch. 10-8. Using today's date, determine the age (in months) of each book that JustLee sells. Make sure only whole months are displayed; ignore any portions of months. Display the book title, publication date, current date, and age.

SELECT title, pubdate, SYSDATE, TRUNC(MONTHS_BETWEEN(SYSDATE, pubdate),0)Age FROM books;

*Ch. 12-1. List the book title and retail price for all books with a retail price lower than the average retail price of all books sold by JustLee Books.

SELECT title, retail FROM books WHERE retail > (SELECT AVG(retail) FROM books);

If the Oracle 12c server assigns a name to a constraint, it will use the format ____________________ for the constraint name.​

SYS_Cn

What is the syntax for the default constraint name provided by the Oracle 12c server?​

SYS_Cn

Any type of constraint for a single column can be created at the column level. _________________________​

TRUE

The default name for a constraint is SYS Cn where n consists of a number that will make the name unique within the database. _________________________​

TRUE

Ch. 3-9. Truncate the BOOK_PRICING table, and then verify that the table still exists but no loner contains any data.

TRUNCATE TABLE book_pricing; SELECT * FROM books_pricing;

A(n) ____________________ constraint requires that, if an entry is made into the column, the data value must be unique.​

UNIQUE

If a(n) ____________________ constraint is being dropped, then only the type of constraint and the column name need to be included in the DROP clause of the ALTER TABLE command.​

UNIQUE

The purpose of the ____ constraint is to ensure that two records do not have the same value stored in the same column. However, it can contain NULL values.​

UNIQUE

Unless a PRIMARY KEY or a(n) ____________________ constraint is being dropped, the actual name assigned to the constraint must be included in the ALTER TABLE command.​

UNIQUE

Ch. 5-6. Create a script using a substitution variables that allows a user to set a new cost amount for a book based on the ISBN;

UPDATE books SET cost = &cost WHERE isbn = '&isbn';

Ch. 5-2. Modify the zip code on order 1017 to 33222.

UPDATE orders SET shipzip = '33222' WHERE order# = 1017;

The ____________________ view can be used to list the names of the constraints that exist for all tables owned by the user.​

USER_CONSTRAINTS

*Ch. 5-7. Execute the script and set the following values: isbn = 1059831198 and cost = $20.00.

Use START or @ on client SQL*Plus client tool or Load script in internet SQL*Plus interface.

When a constraint is created at the ____ level with the CREATE TABLE command, the constraint definition is simply included as part of the column definition.​

column

A PRIMARY KEY that consists of more than one column is called a(n) ____ key.​

composite

A(n) ____________________ is a rule imposed on data stored in a database in order to ensure its integrity of the data.​

constraint

Which of the following are used to enforce business rules?​

constraints

A Datatype is a rule used to ensure the accuracy of data stored in a database. _________________________​

false

A FOREIGN KEY constraint will not allow a row containing a NULL value in the foreign key column to be added to the table.​

false

A NOT NULL constraint can only be created at the table level. _________________________​

false

A NOT NULL constraint is a special FOREIGN KEY constraint.​

false

A constraint can be added to a table after the table has been populated with data even if the existing data violates the constraint.​

false

A constraint can be renamed using the ALTER TABLE command.​

false

A constraint name can consist of up to 25 characters and numbers. _________________________​

false

A foreign key constraint can only be created at the column level.​

false

Any constraint can be created at the table or the column level.​

false

Each column can only be included in one constraint.​

false

If a(n) FOREIGN KEY constraint has been created for a table, it means the data values in that column must be unique and cannot contain NULL values. _________________________​

false

In the USER_CONSTRAINTS view, the constraint type for a NOT NULL constraint will be listed as N. _________________________​

false

In the USER_CONSTRAINTS view, the constraint type for a PRIMARY KEY constraint will be listed as PK.​

false

The FOREIGN KEY constraint is usually placed on the "one" side of a one-to-many relationship. _________________________​

false

The MODIFY clause is used with the ALTER TABLE command to add a PRIMARY KEY constraint to an existing table.​

false

The SYSDATE can be used as a condition in a CHECK constraint.​

false

The table level approach can be used to create any constraint, except a CHECK constraint.​

false

When a FOREIGN KEY constraint is being created, the REFERENTIAL keyword is used to indicate the table being referenced. _________________________​

false

When dropping a constraint, the user is always required to specify the name of the constraint being dropped.​

false

​ Which of the following is the standard abbreviation for the constraint FOREIGN KEY?

fk

​ Where does the Oracle 12c server store information about objects in the database, including information about constraints?

in the data dictionary

Referential ____________________ means that the user is referring to something that actually exists in the referenced table.​

integrity

A referential integrity constraint is usually placed on the ____________________ side of a one-to-many relationship.​

many

Which of the following is the standard abbreviation for the constraint NOT NULL?​

nn

A FOREIGN KEY constraint can only reference a column in another table that has been assigned a(n) ____ constraint.​

none of the above

Structure of the ORDERITEMS table Based on the structure of the ORDERITEMS table, which of the following commands will add a NOT NULL constraint to the ISBN column?​

none of the above

​Structure of the ORDERITEMS table Based on the structure of the ORDERITEMS table, which of the following commands will add a NOT NULL constraint to the ISBN column?​

none of the above

If a(n) ____________________ constraint is being dropped, then only the type of constraint needs to be identified in the ALTER TABLE because there can only be one such constraint for each table.​

primary key

If a constraint applies to more than one column, the constraint must be created at the ____ level.​

table

A CHECK constraint requires that a data value meet a certain condition before the record is added to the database table.​

true

A FOREIGN KEY constraint can be added to the column of a table to ensure that the referenced data value actually exists in the other table.​

true

A NOT NULL constraint can only be created at the column level.​

true

A UNIQUE constraint is the same as a PRIMARY KEY constraint, except that it will accept NULL values.​

true

A constraint for a composite primary key must be created at the table level.​

true

A constraint is always enforced at the table level.​

true

A primary key is usually given the abbreviation _pk in the constraint name if the name is assigned by the user.​

true

A(n) FOREIGN KEY constraint can only reference a column in the parent table that has been designated as the primary key for that table. _________________________​

true

A(n) NOT NULL constraint is a special CHECK constraint with the condition of IS NOT NULL. _________________________​

true

A(n) UNIQUE constraint will allow NULL values to be stored in the designated column. _________________________​

true

A(n) constraint can be created during the creation of a database table or added to a table afterwards. _________________________​

true

Constraints are used to ensure the accuracy and integrity of the data contained in the database.​

true

If a FOREIGN KEY constraint exists, then a record cannot be deleted from the parent table if that row is referenced by an entry in the child table.​

true

If a data value violates a(n) constraint, the entire row is prevented from being added to the table. _________________________​

true

Only one PRIMARY KEY constraint can exist for each table.​

true

The ADD clause of the ALTER TABLE command is used to add a PRIMARY KEY constraint to an existing table. _________________________​

true

The ALTER TABLE command can be used to delete an existing constraint. _________________________​

true

The ALTER TABLE command can be used to disable a constraint.​

true

The ALTER TABLE command with the ENABLE clause can be used to enable a constraint.​

true

The CONSTRAINT keyword is required if the user is going to assign a name to a constraint.​

true

When dropping a(n) PRIMARY KEY constraint, the name of the column does not need to be included in the ALTER TABLE command. _________________________​

true

With the exception of the NOT NULL constraint, constraints can be added to a table using the ADD clause of the ALTER TABLE command.​

true

​Structure of the ORDERITEMS table Based on the structure of the ORDERITEMS table, which of the following commands was most likely used to create the table?​

​ CREATE TABLE orderitems (order# NUMBER (4), item# NUMBER(2), isbn VARCHAR2(10), qty NUMBER(3), PRIMARY KEY(order#, item#));

A maximum of ____________________ PRIMARY KEY constraints can exist for each database table.​

1 or one

A PRIMARY KEY constraint can be added to an existing table by using the ____ clause of the ALTER TABLE command.​

ADD

The ____________________ clause of the ALTER TABLE command is used to add a PRIMARY KEY constraint to an existing table.​

ADD

The ____________________ TABLE command is used to add a PRIMARY KEY constraint to an existing table.​

ALTER

Ch. 3-8. Mark the Category column of the BOOK_PRICING table as unused. Verify that the column is no longer available.

ALTER TABLE book_pricing SET UNUSED(category); SELECT * FROM book_pricing;

Which of the following statements about creating constraints is incorrect?​

​ If you do not provide a name for a constraint, the Oracle 12c server will issue an error message.

Which of the following statements about a PRIMARY KEY is incorrect?​

​ It can be NULL, as long as the FOREIGN KEY contains a value.

​ Which of the following statements about creating constraints is incorrect?​

​ The NOT NULL constraint can be created at either the column level or the table level.

The UNIQUE constraint differs from the PRIMARY KEY constraint in what way?​

​ The UNIQUE constraint allows NULL values.

Which view will display the names of all the constraints that you own?​

​ USER_CONSTRAINTS

Ch. 3-3. Add two columns to the EMPLOYEES table. One column, named EmpDate, contains the date of employment for each employee, and its default value should be the systemdate, The second column, named EndDate, contains employees' date of termination.

ALTER TABLE employees ADD (empdate DATE DEFAULT SYSDATE, enddate DATE);

Ch. 3-5. Delete the EndDate column from the EMPLOYEES table.

ALTER TABLE employees DROP column enddate;

Ch. 3-4. Modify the Job_class column of the EMPLOYEES table so that it allows storing a maximum width of two characters.

ALTER TABLE employees MODIFY job_class VARCHAR2(2);

​Structure of the ORDERITEMS table Based on the structure of the ORDERITEMS table, which of the following commands will make certain that the ISBN entered actually exists in the ISBN column of the BOOKS table?​

ALTER TABLE orderitems ADD FOREIGN KEY (isbn) REFERENCES books(isbn);

Structure of the ORDERITEMS table If a PRIMARY KEY constraint, named ORDERITEMS_PK, exists for the ORDER# and ITEM# columns of the ORDERITEMS table, which of the following commands will disable the constraint?​

ALTER TABLE orderitems DISABLE CONSTRAINT orderitems_pk;

​Structure of the ORDERITEMS table If a PRIMARY KEY constraint, named ORDERITEMS_PK, exists for the ORDER# and ITEM# columns of the ORDERITEMS table, which of the following commands will disable the constraint?​

ALTER TABLE orderitems DISABLE CONSTRAINT orderitems_pk;

​Structure of the ORDERITEMS table If a PRIMARY KEY constraint, named ORDERITEMS_PK, exists for the ORDER# and ITEM# columns of the ORDERITEMS table, which of the following commands will drop the constraint?​

ALTER TABLE orderitems DROP PRIMARY KEY;

​Structure of the ORDERITEMS table If the constraints on the ORDER# and ITEM# columns of the ORDERITEMS table were created as a PRIMARY constraint, and the actual constraint name is not known, which of the following commands can be used to delete the constraint?​

ALTER TABLE orderitems DROP PRIMARY KEY;

​Structure of the ORDERITEMS table If a PRIMARY KEY constraint, named ORDERITEMS_PK, for the ORDER# and ITEM# columns of the ORDERITEMS table have been disabled, which of the following commands will enable the constraint?​

ALTER TABLE orderitems ENABLE CONSTRAINT orderitems_pk;

Structure of the PROMOTION table Which of the following commands will add a UNIQUE constraint to the MINRETAIL column of the PROMOTION table?​

ALTER TABLE promotion ADD CONSTRAINT orderitems_minretail_uk UNIQUE (minretail);

​Structure of the PROMOTION table Which of the following commands will add a UNIQUE constraint to the MINRETAIL column of the PROMOTION table?

ALTER TABLE promotion ADD CONSTRAINT orderitems_minretail_uk UNIQUE (minretail);

​Structure of the PROMOTION table Which of the following commands will add a UNIQUE constraint to the MINRETAIL column of the PROMOTION table?​

ALTER TABLE promotion ADD CONSTRAINT orderitems_minretail_uk UNIQUE (minretail);

​Structure of the PROMOTION table Based on the structure of the PROMOTION table, which of the following commands will add a PRIMARY KEY constraint to the GIFT column?​

ALTER TABLE promotion ADD PRIMARY KEY(gift);

The ____ constraint requires that a specific condition be met before a record can be added to a table.​

CHECK

Ch. 5-3. Save the changes permanently to the database.

COMMIT;

If a user is going to assign a name to a constraint, the ____________________ keyword must be included in the command.​

CONSTRAINT

If the ____ keyword is included when a constraint is created, a constraint name must be provided by the user.​

CONSTRAINT

Ch. 3-7. Create a new table containing these four columns from the existing BOOKS table: ISBN, Cost, Retail, and Category. The name of the ISBN column should be ID, and the other columns should keep their original names. Name the new table BOOK_PRICING.

CREATE TABLE book_pricing (id, cost, retail, category) AS (SELECT isbn,cost, retail, category FROM books);

Ch. 3-1. Create a new table containing the category code and description for the categories of books sold by JustLee Books. The table should be called CATEGORY, and the columns should be CatCode and CatDesc. The CatCode column should store a maximum of 2 characters, and the CatDesc column should store a maximum of 10 characters.

CREATE TABLE category (catcode VARCHAR2(2), catdesc VARCHAR2(10));

Ch. 3-2. Create a new table containing these four columns: Emp#, Lastname, Firstname, and Job_class. The table name should be EMPLOYEES. THE Job_class column should be able to store character strings up to a maximum length of four, but the column values shouldn't be padded if the value has less than four characters. The Emp# column contains a numeric ID and should allow five-digit number. Use column sizes you consider suitable for the Firstname and Lastname columns.

CREATE TABLE employees (emp# NUMBER(5), lastname VARCHAR2(15), fistname VARCHAR2(10), job_class VARCHAR2(4));

​Structure of the ORDERITEMS table Based on the structure of the ORDERITEMS table, which of the following commands was most likely used to create the table?​

CREATE TABLE orderitems (order# NUMBER (4), item# NUMBER(2), isbn VARCHAR2(10), qty NUMBER(3), PRIMARY KEY(order#, item#));

Ch. 5-9. Delete Order# 1005. You need to address both the master order record and the related detail records.

DELETE FROM orderitems WHERE order# = 1005;

A quick way to determine whether a column can contain a NULL value is to issue the ____________________ command, followed by the table name.​

DESC

Which command can be used to determine whether or not a column is allowed to contain a NULL value?​

DESCRIBE

Which clause will allow you to disable a constraint?​

DISABLE

The ____________________ clause of the ALTER TABLE command must be used to drop an existing constraint.​

DROP

Which clause will allow you to delete a constraint?​

DROP

Ch. 3-10. Delete the BOOK_PRICING tale permanently so that it isn't moved to the recycle bin. Delete the JL_EMPS table so that it can be restored. Restore the JL_EMPS table and verify that it's available again.

DROP TABLE book_pricing PURGE; DROP TABLE jl_emps; FLASHBACK TABLE jl_emps TO BEFORE DROP; SELECT * FROM jl_emps;

The ALTER TABLE command with the MODIFY clause can be used to disable a constraint. _________________________​

FALSE

The REFERENCE constraint is used to ensure that a data value meets a specified condition before a record is added to a table. _________________________​

FALSE

In a "one-to-many" relationship, which constraint is usually added to the "many" table?​

FOREIGN KEY

Which keywords identify a column that, if it contains a value, it must match data contained in another table?​

FOREIGN KEY

Which of the following types of constraints is used to enforce referential integrity?​

FOREIGN KEY

Ch. 5-1. Add a new row in the ORDERS table with the following data: Order# = 1021, Customer# = 1009, and Order date = July 20, 2009

INSERT INTO orders (order#, customer#, orderdate) VALUES (1021, 1009, '20-JUL-05');

Ch. 5-4. Add a new row in the ORDERS table with the following data: Order# = 1022, Customer# = 2000, and Order date = August 6, 2009. Describe the error raised and what caused the error.

INSERT INTO orders (order#, customer#, orderdate) VALUES (1022, 2000, '06-AUG-05'); **Foreign key error due to customer 2000 not existing in customers table

*Ch. 5-5. Add a new row in the ORDERS table with the following data: Order# = 1023 and Customer# = 1009. Describe the error raised and what caused the error.

INSERT INTO orders (order#, customer#, orderdate) VALUES (1023, 1009); **Constraint error due to orderdate having a NOT NULL constraint

A NOT NULL constraint will display the search condition of ____________________ in the USER_CONSTRAINTS view.​

IS NOT NULL

A NOT NULL constraint can be added to an existing table using the ALTER TABLE command with the ____________________ clause.​

MODIFY

A(n) ____________________ constraint is a special CHECK constraint with the condition of IS NOT NULL.​

NOT NULL

The ____ constraint prevents the user from adding a NULL value in the specified column.​

NOT NULL

Which of the following constraints cannot be added to an existing table with the ADD clause of the ALTER TABLE command?​

NOT NULL

The ____________________ keywords can be added to the end of the command that creates a FOREIGN KEY constraint to indicate that when a row is deleted from the parent table that is referenced by entries in the child table, the rows in the child table should also be deleted.​

ON DELETE CASCADE

Which of the following keywords must have been included during the creation of a FOREIGN KEY constraint to allow a row from the parent table to be deleted, even if it is referenced by a row in the child table?​

ON DELETE CASCADE

When a constraint is created at the table level, the constraint definition is provided ____ the column definition list.​

after

The ____________________ command can be used to enable or disable a constraint.​

alter table

In the USER_CONSTRAINTS view, the value displayed in the CONSTRAINT_TYPE column will be a(n) ____ for a CHECK constraint.​

c

Any type of constraint can be created at the ____________________ level, unless the constraint is being defined for more than one column.​

column

The NOT NULL constraint can only be created at the ____ level.​

column


Conjuntos de estudio relacionados

Adobe Photoshop Certification Exam 3

View Set

Chapter 4: Activity-Based Costing SmartBook

View Set

HVAC, Module 2, Temperature and Pressure

View Set

Week 13: Microbiology- Immunisation

View Set

ESB - Domain#2 / Lesson #2/ Pop Quiz

View Set

Sociology Chapter 10- Social Class in the United States

View Set