Oracle 12c: SQL
3rd Edition
ISBN: 9781305251038
Author: Joan Casteel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 4, Problem 14MC
Which of the following keywords allows the user to delete a record from a table, even if rows in another table reference the record through a FOREIGN KEY constraint?
- a. CASCADE
- b. CASCADE ON DELETE
- c. DELETE ON CASCADE
- d. DROP
- e. ON DELETE CASCADE
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Which of the following keywords allows the user to delete a record from a table, even if rows in another table reference the record through a FOREIGN KEY constraint? ( refer to the tables in the JustLee Books database). a. CASCADE b. CASCADE ON DELETE c. DELETE ON CASCADE d. DROP e. ON DELETE CASCADE
CREATE TABLE keyvalue ( id SERIAL, key VARCHAR(128) UNIQUE, value VARCHAR(128) UNIQUE, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), PRIMARY KEY(id) );
Add a stored procedure so that every time a record is updated, the updated_at variable is automatically set to the current time
Q7:-
Choose the correct statement:-
Prints the database_information
connection = getDbConnection()
test1 =connection.get_server_info()
cursor = connection.cursor()
cursor.execute("select database();")
test2 = cursor.fetchone()
print(test2)
closeDbConnection(connection)
Prints the records for the selected database
connection = getDbConnection()
test1 = connection.get_server_info()
cursor = connection.cursor()
cursor.execute("select database();")
test2 = cursor.fetchone()
print(test1)
closeDbConnection(connection)
Both
None of these
Chapter 4 Solutions
Oracle 12c: SQL
Ch. 4 - What is the difference between a PRIMARY KEY...Ch. 4 - How can you verify the constraints that exist for...Ch. 4 - A table can have a maximum of how many PRIMARY KEY...Ch. 4 - Which type of constraint can be used to make...Ch. 4 - Which type of constraint should you use to ensure...Ch. 4 - How is adding a NOT NULL constraint to an existing...Ch. 4 - When must you define constraints at the table...Ch. 4 - Prob. 8RQCh. 4 - What is the difference between disabling a...Ch. 4 - Prob. 10RQ
Ch. 4 - Prob. 1MCCh. 4 - Which of the following is not a valid constraint...Ch. 4 - Which of the following SQL statements is invalid...Ch. 4 - What is the maximum number of PRIMARY KEY...Ch. 4 - Prob. 5MCCh. 4 - How many NOT NULL constraints can be created at...Ch. 4 - The FOREIGN KEY constraint should be added to...Ch. 4 - What is the maximum number of columns you can...Ch. 4 - Which of the following commands can you use to...Ch. 4 - Prob. 10MCCh. 4 - In the initial creation of a table, if a UNIQUE...Ch. 4 - Which type of constraint should you use on a...Ch. 4 - Which of the following commands can be used to...Ch. 4 - Which of the following keywords allows the user to...Ch. 4 - Which of the following data dictionary objects...Ch. 4 - Which of the following types of constraints cant...Ch. 4 - Suppose you created a PRIMARY KEY constraint at...Ch. 4 - You’re creating a new table consisting of three...Ch. 4 - Which of the following types of restrictions can...Ch. 4 - Which of the following is the valid syntax for...Ch. 4 - Prob. 1HOACh. 4 - Prob. 2HOACh. 4 - Prob. 3HOACh. 4 - Add a column named Base_salary with a datatype of...Ch. 4 - Create a table named BOOK_STORES to include the...Ch. 4 - Add a constraint to make sure the Rep_ID value...Ch. 4 - Change the constraint created in Assignment #6 so...Ch. 4 - Create a table named REP_CONTRACTS containing the...Ch. 4 - Produce a list of information about all existing...Ch. 4 - Issue the commands to disable and then enable the...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Which of the following is true? All data in a table can be recovered if the table is dropped with the PURGE option. All data in a table can be recovered from the recycle bin if the table is dropped. All data in a table is lost if the table is dropped. All of the above statements are true.arrow_forwardIf you wanted to update another table with new records for every row updated, deleted, or inserted entered into a given table, you'd include the keywords in your trigger creation statement.arrow_forwardusing postgresql: Write a trigger that will be activated when a new customer is added to the Customers table and that verifies that the ID of the new record does not yet exist in the table. If it does, the request shall be rejected. Show what happens when a record with an existing ID is attempted to be added to the Customer table to verify that your trigger is working properly. Customers table columns: id, first name, last name, emailarrow_forward
- plz quickly ?????????????? /*Inserting into patient table*/ INSERT INTO patientVALUES ('1234','Kim Minji','06-05-1994','0557375017'); INSERT INTO patientVALUES ('1334','Han Sohee','06-07-1996','0567374017'); INSERT INTO patientVALUES ('1434','Jeon soyeon','07-10-1998','0537372017'); INSERT INTO patientVALUES ('1646','Lee Taemin','18-06-1993','0501346257'); INSERT INTO patientVALUES ('1645','Yu jimin','11-09-2000','0501846257'); select*from patient; /*Inserting into Doctor table*/INSERT INTO DOCTOR VALUES(2000432, 'khaled' , '05-12-1994' , 0556677880,'Dermatologists'); INSERT INTO DOCTOR VALUES(2000509, 'Ali' , '09-01-2000' , 0559918100, 'Dentistry'); INSERT INTO DOCTOR VALUES(2000389, 'Lewis' ,'21-01-1996' , 0559910000,'Family Physicians'); INSERT INTO DOCTOR VALUES(2000504, 'Saleh' ,'16-06-1998' , 055611500,'Family Physicians'); INSERT INTO DOCTOR VALUES(2000235, 'sara' ,'22-06-1998', 0557745500,'Orthopedics'); select *from doctor; /*Inserting into appointment table*/ INSERT INTO…arrow_forwardWhich of the following statements places a shared lock on at least a portion of a table named HOMEWORK10?a. SELECT * FROM homework10 WHERE col2 IS NULL FOR UPDATE;b. INSERT INTO homework10 (col1, col2, col3) VALUES (‘A’, ‘B’, ‘C’);c. UPDATE homework10 SET col3 = NULL WHERE col1 = ‘A’;d. UPDATE homework10 SET col3 = LOWER (col3) WHERE col1 = ‘A’;e. all of the abovearrow_forwardwhich DML keyword is used to make change to existing records in a table? a) Insert b) Select c) Update d) Deletearrow_forward
- Create a table in your own database using the following statement. CREATE TABLE DateRange (DateID INT IDENTITY, DateValue DATE, DayOfWeek SMALLINT, Week SMALLINT, Month SMALLINT, Quarter SMALLINT, Year SMALLINT ); Write a stored procedure that accepts two parameters: A starting date The number of the consecutive dates beginning with the starting date The stored procedure then inserts data into all columns of the DateRange table according to the two provided parameters.arrow_forwardUsing the film database you have, answer the following queries in your schema thenwrite them down in this paper. Question two:a) Convert the following for-cursor into: open, fetch, close one:DECLARECursor c1 is select table_name from user_tables;BEGINFOR tables IN c1 LOOPDBMS_OUT.PUT_LINE(tables.table_name);END LOOP;END; b) Create a trigger so that when user tries to update category table, new valuewon't take effect and old data will remain in the database. c) Create a function to return if a particular film has more than 10 actors in it ornot.arrow_forwardUsing the film database you have, answer the following queries in your schema thenwrite them down in this paper. Question two:a) Convert the following for-cursor into: open, fetch, close one:DECLARECursor c1 is select table_name from user_tables;BEGINFOR tables IN c1 LOOPDBMS_OUT.PUT_LINE(tables.table_name);END LOOP;END; b) Create a trigger so that when user tries to update category table, new valuewon't take effect and old data will remain in the database. c) Create a function to return if a particular film has more than 10 actors in it ornot.arrow_forward
- A select operation in a relational database decreases the size of a table by removing columns that fulfill certain criteria.Is this statement truthful or false?arrow_forwardTask 2 Stored PL/SQL procedure Implement a stored PL/SQL procedure PARTSUPPLIER that lists information about the supplier key and supplier name supplying parts. The procedure first computes the total number of suppliers supplying the specified part. The procedure then extracts the supplier's information supplying the specified part. The information to be displayed include the part key, part name, the supplier key and the supplier's name. An example of a segment of the output for the list of suppliers supplying a specified part (part 59396) is as follow: part key: 59396, orange cream sandy lavender drab Number of suppliers supplying the part: 4 supplier Key 166 Supplier#000000166 935 Supplier#000000935 1704 Supplier#000001704 2397 Supplier#000002397 supplier Name It is up to you to decide if you want to handle exception in your procedure. Deliverables Submit your spooled file solution2.lst (or solution2.pdf) that contains your SQL script and the output from the execution of the script.…arrow_forward1. Create tblEmp with three columns, namely, EID, Name and Salary 2. Create an anonymous PL/SQL block that will accept user input for the following: 1-INSERT NEW RECORD 2-UPDATE A RECORD 3-DELETE RECORD ENTER OPTION: 1 Note: use bind variable to get the option from the user then perform the transaction based on the chosen option. use bind variables for the appropriate columns in the transaction) Run and copy paste the code here.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
dml in sql with examples; Author: Education 4u;https://www.youtube.com/watch?v=WvOseanUdk4;License: Standard YouTube License, CC-BY