2.1 DDL Command Basics|Naming rules for table|Datatypes
in SQL| Difference varchar &varchar2
SQL Primary Objects and their Naming Rules
In SQL, primary objects include:
ables
T
Views
Indexes
Stored Procedures
Functions
Triggers
Naming Rules for SQL Primary Objects
● se a meaningful and descriptive name for each object
U
● Names should not be exceed 128 characters
● Names must begin with a letter, underscore, or a dollar sign
● Names can contain letters, numbers, underscores, and dollar
signs
● Names are case-insensitive in SQL, but using uppercase for
keywords and lowercase for object names is a common
convention to improve readability
● Avoid using reserved keywords as object names
● Use the appropriate prefix for each type of object:
● Tables: tab_
● Views: vw_
● Indexes: idx_
● Stored Procedures:
sp_
● Functions: fn_
● Triggers:
tr_
, Examples:
● ab_employees
t
● vw_top_selling_products
● idx_product_id
● sp_add_customer
● fn_calculate_tax
● tr_update_salary
in SQL| Difference varchar &varchar2
SQL Primary Objects and their Naming Rules
In SQL, primary objects include:
ables
T
Views
Indexes
Stored Procedures
Functions
Triggers
Naming Rules for SQL Primary Objects
● se a meaningful and descriptive name for each object
U
● Names should not be exceed 128 characters
● Names must begin with a letter, underscore, or a dollar sign
● Names can contain letters, numbers, underscores, and dollar
signs
● Names are case-insensitive in SQL, but using uppercase for
keywords and lowercase for object names is a common
convention to improve readability
● Avoid using reserved keywords as object names
● Use the appropriate prefix for each type of object:
● Tables: tab_
● Views: vw_
● Indexes: idx_
● Stored Procedures:
sp_
● Functions: fn_
● Triggers:
tr_
, Examples:
● ab_employees
t
● vw_top_selling_products
● idx_product_id
● sp_add_customer
● fn_calculate_tax
● tr_update_salary