SQL - Lecture 3 - Default Expression & Check Constraints - Oracle - Practical Demonstrations

Veröffentlicht am: 08 Dezember 2020
auf dem Kanal: Dr. Parag Shukla
1,496
28

This video demonstrates step by step implementation of default expression and check constraints in details.

Lecture Summary

DEFAULT is used to insert the default value.

If default is set into column then we can insert it in 2 ways.
1. Using Default keyword
2. By skipping the column at time of insert.

Check constraint
It is used to put validation on column for each row.

Syntax:
CHECK (condition)

Example
1. CHECK(CITY = 'RAJKOT')
2. CHECK(LENGTH(MOBILE)=10)
3. CHECK(EMAILID LIKE '___%@__%.__%')
4. CHECK(SUBSTR(NAME,1,1) BETWEEN 'A' AND 'P')
5 CHECK (CITY IN ('AHM', 'RJT', 'SURAT'))

Note
CONSTRAINT constraint_name is recommended for each constraints to identify constraints at the time of violations.

Constraint name is unique within the database.

Syntax of table
CREATE TABLE table_name(
col1 data_type [default expr] [ [constraint constraint_name] constraint_type ],

col2 data_type [default expr] [ [constraint constraint_name] constraint_type ],
.
.
colN data_type [default expr] [ [constraint constraint_name] constraint_type ], [table_level_constraint]
)

For Learning More about Programming
Subscribe to My Channel: https://www.youtube.com/c/drparagshuk...


Auf dieser Seite können Sie das Online-Video SQL - Lecture 3 - Default Expression & Check Constraints - Oracle - Practical Demonstrations mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Dr. Parag Shukla 08 Dezember 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,496 Mal angesehen und es wurde von 28 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!