tailieunhanh - Including Constraints
Name a constraint or the Oracle server generates a name by using the SYS_Cn format. Create a constraint either: At the same time as the table is created, or After the table has been created Define a constraint at the column or table level. View a constraint in the data dictionary. | Including Constraints Schedule: Timing Topic 45 minutes Lecture 25 minutes Practice 70 minutes Total Objectives After completing this lesson, you should be able to do the following: Describe constraints Create and maintain constraints Lesson Aim In this lesson, you learn how to implement business rules by including integrity constraints. What are Constraints? Constraints enforce rules at the table level. Constraints prevent the deletion of a table if there are dependencies. The following constraint types are valid: NOT NULL UNIQUE PRIMARY KEY FOREIGN KEY CHECK Constraints The Oracle Server uses constraints to prevent invalid data entry into tables. You can use constraints to do the following: Enforce rules on the data in a table whenever a row is inserted, updated, or deleted from that table. The constraint must be satisfied for the operation to succeed. Prevent the deletion of a table if there are dependencies from other tables Provide rules for Oracle tools, such as Oracle Developer Data Integrity Constraints For more information, see Oracle9i SQL Reference, “CONSTRAINT.” Constraint Guidelines Name a constraint or the Oracle server generates a name by using the SYS_Cn format. Create a constraint either: At the same time as the table is created, or After the table has been created Define a constraint at the column or table level. View a constraint in the data dictionary. Constraint Guidelines All constraints are stored in the data dictionary. Constraints are easy to reference if you give them a meaningful name. Constraint names must follow the standard object-naming rules. If you do not name your constraint, the Oracle server generates a name with the format SYS_Cn, where n is an integer so that the constraint name is unique. Constraints can be defined at the time of table creation or after the table has been created. You can view the constraints defined for a specific table by looking at the USER_CONSTRAINTS data dictionary table. Defining Constraints CREATE . | Including Constraints Schedule: Timing Topic 45 minutes Lecture 25 minutes Practice 70 minutes Total Objectives After completing this lesson, you should be able to do the following: Describe constraints Create and maintain constraints Lesson Aim In this lesson, you learn how to implement business rules by including integrity constraints. What are Constraints? Constraints enforce rules at the table level. Constraints prevent the deletion of a table if there are dependencies. The following constraint types are valid: NOT NULL UNIQUE PRIMARY KEY FOREIGN KEY CHECK Constraints The Oracle Server uses constraints to prevent invalid data entry into tables. You can use constraints to do the following: Enforce rules on the data in a table whenever a row is inserted, updated, or deleted from that table. The constraint must be satisfied for the operation to succeed. Prevent the deletion of a table if there are dependencies from other tables Provide rules for Oracle tools, such as Oracle Developer
đang nạp các trang xem trước