3 Table Indexes and View
3 Table Indexes and View
Fsoft Academy
03 Demo
1. Table Indexes
2. View
4.
TABLE INDEXES
Late
9 8 7 6
I want bananas …
Result:
1 2 3 4 5
Quick
9 8 7 6
Index
Data
Deleting an Index
VIEWS
view_EmployeeByDpt
SELECT * FROM view_EmployeeByDpt
Example:
view_EmployeeByDpt
Correct:
Incorrect:
Correct:
Incorrect:
Correct:
CREATE TABLE dbo.EmployeeSalary
(
EmployeeSalaryID INT
)
Incorrect:
CREATE TABLE dbo.Employeesalary
(
EmployeesalaryID int
)
09e-BM/DT/FSOFT - @FPT SOFTWARE - FPT Software Academy - Internal Use 19
NAMING CONVENTION AND STYLES
4.Avoid abbreviations and single character names
Correct:
DECLARE @RecordCount int
Incorrect:
DECLARE @Rc int
Correct:
CREATE PROCEDURE dbo.usp_EmployeeSelectAll
Incorrect:
CREATE PROCEDURE dbo.EmployeeSelectRetired –-without preffixed
View
Create, maintain and use view
Naming convention
Demo