You are on page 1of 2

PamelaRugen. ITEC 4242-01.

Discussion_4
Below, please find discussion questions for Week 11 (from 03/19 to 03/25). You need to provide your answers to each of them. Use numerals (1, 2, 3, etc.) to separate your answers. You can post your answers any time before Sunday (03/25), midnight. Discussion 4 is worth 50 points. As a reminder, your performance with respect to commenting on the posts of other students will be graded. The syllabus says that students can earn up to 100 points for their contributions based on the frequency and quality of provided comments to the posts of others. Participation in discussions is worth 100 points which is 10% of the total number of points that determines your course grade. 1. What is a trigger, and how can triggers be used to enhance data integrity? A trigger is a piece of code attached to a single table that is automatically executed as the result of an action to the associated table. Triggers cannot be called upon or manually executed. Triggers are event-driven procedures stored in and managed by the DBMS and occur as a result in the action, INSERT, DELETE, or UPDATE. A trigger cannot be bypassed. Triggers are helpful in that they eliminate the need to remember to schedule or code an activity. Triggers are coded to occur either before or after the event-driving activity. 2. Describe the difference between a check constraint and a rule? A check constraint is a DBMS defined restriction placed on the data values that can be stored in a column or columns of a table. Check constraints consist of a constraint name and check condition. Check constraints allow the ability to enforce business rules without requiring additional logic. They can be implemented without involving staff. They provide better data integrity and promote consistency throughout the system, since once they are implemented, check constraints are always enforced. A check constraint must be explicitly coded within the DDL of every table that must be checked. A rule defines the parameters for data validation whenever data is inserted or updated. Both columns and user defined data types (UDTs) can have rules defined for them. Rules can be more reliable than check constraints because a rule need be created only once, after which it is bound to the appropriate columns and data types. So, if one constraint applies to multiple columns, less work is required with a rule than with a check constraint. 3. What are transition tables (variables), and what benefit do they provide? Triggers are used to implement referential integrity. They can be coded to support any type of referential constraint placed on a database. Transition tables provide a before and after picture of any changes to a table whenever an INSERT, DELETE, or UPDATE occurs. These tables are only accessible from triggers. 4. Name and describe four types of database structural integrity problems that may be encountered by a DBA. Index corruption is one database structural integrity problem experienced by relational databases. DBMS uses internal structures and pointers to maintain database objects. The index is useless if pointers dont point to the correct data. Indexes can become corrupt through improper recovery operations, if the index is not rebuilt after database recovery.

PamelaRugen. ITEC 4242-01.Discussion_4


Another potential problem is in the backup files. If these are not formatted correctly, or if the data is in the wrong location, the DBMS cannot use them for recovery purposes. Media failures, tape degradation, and bugs can cause such problems. It is possible for other pointers to become corrupt. These pointers are used for columns assigned for large objects such as DB2 where data types are stored in a separate file, and the primary file for the table contains a pointer to the physical data location of the large object, to get out of sync with the data, rendering this data inaccessible. Page header corruption is another potential database structural integrity problem. The header is used by the DBMS to easily and rapidly read the page contents. If the header becomes corrupted, the DBMS may not be able to interpret the data stored on the page.

5. What is a user-defined data type, and how can it be used to enhance data integrity? UDTs (user-defined data types) provide a higher level of abstraction to your database design. They are a mechanism for extending the type of data that can be stored in databases and the way that the data is treated, and defines the legal values for a column (for example: a UDT directs that a social security number is entered in a defined format (xxx-xx-xxxx) and therefore the DBMS will automatically ensure that only the correct type of data is stored in that column. Processes that attempt to insert or update the data to the wrong type will be rejected. Another benefit of creating user-defined data types is additional consistency throughout the database.

You might also like