SQL - Lecture-2 Table Naming Rules, Create Table with Default Expr, Primary Key, Not Null and Unique

preview_player
Показать описание
This video explains

*) -- is used to make comment
*) SQL is not case sensitive, Data are Case Sensitive.
*) Character and Date always enclosed withing single quotation marks only.
*) Date is format sensitive. Default Date format is DD-MON-RR (i.e. 04-DEC-20)
*) We must need to include NOT NULL columns in INSERT statement
*) We can insert NULL in 2 ways.
1. By skipping the column at the time of insert
2. By explicitely writing NULL as a value
*) If you have defined default expression and if you are skipping the column at time of insert then default value will be inserted.
*) If you have not defined default expression and if you are skipping the column at time of insert then
NULL value will be inserted.

Table and Column Names
*) Must begin with a letter
*) Must be 1-30 characters long
*) Must contains only A-Z, a-z, 0-9, _, $ and #
*) Must not duplicate then name of another object owned by the same user
*) Must not be an oracle server reserved word (FROM, ORDER, DROP, CREATE)

CREATE TABLE table_name(
column_name1 data_type size [DEFAULT expr] [column_level_constraints],
column_name2 data_type size [DEFAULT expr] [column_level_constraints],
column_name3 data_type size [DEFAULT expr] [column_level_constraints],
.
.
column_nameN data_type size [DEFAULT expr] [column_level_constraints],
[table_level_constraint]
)

Following constraints explained in video
1. PRIMARY KEY = UNIQUE + NOT NULL
2. NOT NULL = It never allows NULL value (Always defined at Column Level Only)
3. UNIQUE = It may contains multiple null, There will be no duplication in value.
4. CHECK = To put validation in table column

For Learning More about Programming
Рекомендации по теме
Комментарии
Автор

Thank you so much, Sir, i am happy everyday once you follow your class

ousmanekaba
join shbcf.ru