Professional Documents
Culture Documents
Objectives
In this lesson, you will learn to: Create rules Create defaults Maintain data in a table by using
INSERT statement
UPDATE statement DELETE statement
Truncate a table
SQL/Lesson 6/Slide 1 of 50
SQL/Lesson 6/Slide 2 of 50
SQL/Lesson 6/Slide 3 of 50
SQL/Lesson 6/Slide 4 of 50
SQL/Lesson 6/Slide 6 of 50
SQL/Lesson 6/Slide 7 of 50
SQL/Lesson 6/Slide 9 of 50
Result The row would not be inserted, as the zip code is not in the valid format The row would be inserted, as the zip code is in the valid format
34563-5678
SQL/Lesson 6/Slide 10 of 50
SQL/Lesson 6/Slide 11 of 50
SQL/Lesson 6/Slide 12 of 50
SQL/Lesson 6/Slide 13 of 50
SQL/Lesson 6/Slide 14 of 50
SQL/Lesson 6/Slide 16 of 50
SQL/Lesson 6/Slide 17 of 50
SQL/Lesson 6/Slide 19 of 50
Delete Rows
SQL/Lesson 6/Slide 21 of 50
SQL/Lesson 6/Slide 22 of 50
SQL/Lesson 6/Slide 23 of 50
SQL/Lesson 6/Slide 24 of 50
SQL/Lesson 6/Slide 26 of 50
Street','Cleveland', 'Ohio','441675943','(440)345-8872','(440)3458943',7,1000)
SQL/Lesson 6/Slide 27 of 50
SQL/Lesson 6/Slide 28 of 50
SQL/Lesson 6/Slide 29 of 50
SQL/Lesson 6/Slide 30 of 50
SQL/Lesson 6/Slide 31 of 50
SQL/Lesson 6/Slide 34 of 50
SQL/Lesson 6/Slide 35 of 50
SQL/Lesson 6/Slide 36 of 50
SQL/Lesson 6/Slide 37 of 50
SQL/Lesson 6/Slide 38 of 50
SQL/Lesson 6/Slide 39 of 50
SQL/Lesson 6/Slide 41 of 50
SQL/Lesson 6/Slide 42 of 50
SQL/Lesson 6/Slide 43 of 50
SQL/Lesson 6/Slide 44 of 50
SQL/Lesson 6/Slide 45 of 50
SQL/Lesson 6/Slide 46 of 50
SQL/Lesson 6/Slide 47 of 50
Syntax
SQL/Lesson 6/Slide 48 of 50
A rule is created using the CREATE RULE statement, and bound to the column and user-defined datatypes using the sp_bindrule procedure
A rule is unbound using the sp_unbindrule procedure
A default is created using the CREATE DEFAULT statement, and bound to the column and user-defined datatypes using the sp_bindefault procedure
SQL/Lesson 6/Slide 49 of 50
You can delete a row from a table by using the DELETE statement
You use the TRUNCATE TABLE statement to remove all the rows from a table
SQL/Lesson 6/Slide 50 of 50