Question

Suppose that a database modification results in the execution of a trigger but that trigger generates...

  1. Suppose that a database modification results in the execution of a trigger but that trigger generates another modification that happens to violate a primary-key constraint. What happens?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the following answer for the given question here.

What is Trigger:

We can use triggers to perform a number of automatic actions to any table data tables when there is changes (like update, insert, delete) in any of the existing tables.

Triggers are automatic and it gets executed once for each SQL statement on modifying the database tables. Its also a special kind of stored procedure which gets executed when there is event in data base.

Syntax:

create trigger [triggerName] [after| before]  
{insert | update | delete}  
on [tableName]  
[for each row in table]  
[body  of the trigger]

Answer:

As we know triggers always ran as part of transaction,

When there is a failure in trigger and if we have "rollback transaction" then complete transaction will be rolled back and no modification/changes are made to the table.

Add a comment
Know the answer?
Add Answer to:
Suppose that a database modification results in the execution of a trigger but that trigger generates...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using the table below, Write 2 simple/short TRIGGER STATEMENTS (WITH GOOD BUSINESS VALUE), After writing the...

    Using the table below, Write 2 simple/short TRIGGER STATEMENTS (WITH GOOD BUSINESS VALUE), After writing the trigger statements, please comment on what the TRIGGER IS DOING. CREATE TABLE STUDENT_TBL ( STU_ID       NUMBER (8) NULL, F_NAME       VARCHAR (20) NULL,   L_NAME       VARCHAR (30) NULL,   STU_MAJOR       VARCHAR (20) NULL,   STU_ADDR        VARCHAR (50) NULL, STU_EMAIL       VARCHAR (30) NULL, CONSTRAINT PKSTU primary key (STU_ID) ); DESCRIBE STUDENT_TBL; CREATE TABLE ENROLL_TBL ( ENR_ID   NUMBER (8), ENR_DATE     DATE (10)...

  • database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED...

    database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED BELOW CREATE TABLE Department ( DECIMAL(5) VARCHAR(30) CHAR(5) DATE NOT NULL NOT NULL NOT NULL * Department number /*Department name * Department manager number */ /Manager start date DNumber DName Manager MSDate CONSTRAINT Department_PK PRIMARY KEY(DNumber) CONSTRAINT Department_CK UNIQUE(DName) CREATE TABLE DeptLocation DECIMAL(5) VARCHAR(50) NOT NULL NOT NULL DNumber * Department number */ * Department location */ Address CONSTRAINT DeptLocation_PK PRIMARY KEY(DNumber, Address) CONSTRAINT...

  • DATABASE SYSTEMS PLEASE HELP ME FOR QUESTIONS 1 THRU 2 SHOW THE QUERY AND THE RESULTS...

    DATABASE SYSTEMS PLEASE HELP ME FOR QUESTIONS 1 THRU 2 SHOW THE QUERY AND THE RESULTS OF THE QUERY (OUTPUT IN TABLE). ALSO, SHOW THE COMMANDS TO CREATE EACH TABLE (DDL COMMANDS) AND THE INSERTION OF THE DATA FOR EACH TABLE (DML COMMANDS). Question 2: SQL (40 points) Use the following database to answer all parts of this question: Table: EMP Primary Key: E NO E NO E NAME E DEPT E RATHE $400.00 $200.00 $150.00 $150.00 S120.00 $100.00 $100.00...

  • Introduction to Database Systems The following is the ỤML class diagram which was discussed in class Students Departments DName 1SName majorsAbbr GradYear enrolls offers Enrollments Sections Courses...

    Introduction to Database Systems The following is the ỤML class diagram which was discussed in class Students Departments DName 1SName majorsAbbr GradYear enrolls offers Enrollments Sections Courses Grade Title Professor OfYearOffered offeredIn A UML diagram for a university Here we assume courses are year long courses The artificial primary keys and foreign keys are added to the UML diagram to get the schemas. The schemas Departments (DId DName, Abbr) Courses (CId, Title, Deptld) Sections (SectId, Professor, YearOffered, Courseld) Students (StudentId,...

  • Consider the following database Relation Schemas: Relation Schemas: Suppliers(SID CHAR(5), Parts(pID VARCHAR(5), type VARCHAR(15), pName VARCHAR(35),...

    Consider the following database Relation Schemas: Relation Schemas: Suppliers(SID CHAR(5), Parts(pID VARCHAR(5), type VARCHAR(15), pName VARCHAR(35), sName VARCHAR(15), address VARCHAR(30, city VARCHAR(20), state CHAR(2), PRIMARY KEY(sID); PRIMARY KEY(pID) Catalog(sID CHAR(5), pID VARCHAR(5), ty SMALLINT, cost FLOAT (10,2), PRIMARY KEY(sid, pid), FOREIGN KEY(sid) REFERENCES Suppliers(SID), FOREIGN KEY (pid) REFERENCES Parts pID) The meaning of these relations is straightforward; for example, the Catalog relation lists the prices charged for parts by Suppliers. Instances of the relations Suppliers sName address SID cit state...

  • QUESTION 1 What is the most common relationship within a relational database? Select the best answer...

    QUESTION 1 What is the most common relationship within a relational database? Select the best answer from the following. One-To-One relationship. o One-To-Many relationship. Many-To-Many relationship. Zero-To-Zero relationship. QUESTION 2 What is an "entity'? Select the best answer from the following. An entity, for our purposes, is the same as a table in the database. An entity represents one of the columns in an individual table. There are no entities in a relational database. Entities are only part of NoSQL...

  • (a) When implementing a relational database schema in SQL, does it matter in which order you crea...

    (a) When implementing a relational database schema in SQL, does it matter in which order you create tables? Hint: suppose that foreign keys exist. (b) Explain the options available for enforcing a foreign key constraint when creating a foreign key, and what effects they have. What is the default option?

  • This is questions of Accounting Information Systems 1) Fo a database. Each row in this spreadsheet...

    This is questions of Accounting Information Systems 1) Fo a database. Each row in this spreadsheet represents a: ur Tet Industries tracks customer information using various Microsoft Excel spreadsheets stored in a. Field b. Record c. File d. Database 2) A d tables is a. What is the correct term for the database field in Table 1? latabase field in Table 1 that serves as a unique identifier in Table 2 and is used to link both of the a....

  • Page 1: 121 3 Question 17(1 point) A stored program that is attached to the database...

    Page 1: 121 3 Question 17(1 point) A stored program that is attached to the database is called a stored procedure 990 Oembedded SQL 10 11 12 a trigger a view 13 14 15 a CHECK constraint 1617 18 Question 18 (1 point) Saved 19 2021 Which of the following statements will remove and eliminate the Vehicles table DELETE FROM VEHICLES: DELETE FROM VEHICLES REMOVE VEHICLES: DROP TABLE VEHICLES; DROP VEHICLES; 22 2324 25 26 27 28 29 30 3132...

  • Answer the following and explain so I can double check my answers If you use the Management Studio to create a database, the Studio will automatically create a database file plus a ________________...

    Answer the following and explain so I can double check my answers If you use the Management Studio to create a database, the Studio will automatically create a database file plus a ______________________ file. 10 points    QUESTION 2 When you use the Management Studio to create a check constraint, you can specify whether you want the constraint enforced for insert or __________________ operations. 10 points    QUESTION 3 When you use the Management Studio to create a database, including its tables...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT