CREATE DATABASE
- CREATE DATABASE
- creates a new database
- CREATE TABLE
- creates a new table
- defines column and constraints
- DROP TABLE
- removes the table
- ALTER TABLE
- changes the table
- ADD: add new column
- DROP COLUMN
- removes the column
- ALTER COLUMN
- changes the column
- PRIMARY KEY
- assigns the column to primary key
- You can assign primary key in GUI
-
PRIMARY KEY
improves the performance of database
- CONSTRAINT
- defines the name of constraint
- it makes easier to remove the contraint
INDEX
-
for regulation, you can use
INDEX
to index data - Clustered
- data is saved by order(ex. alpabet, number, etc.)
- normally, it is primary key
- Non-Clustered
- data is saved by index
- CREATE INDEX
- makes new non-clustered index
- You can make index by several values
- UNIQUE
- defines the column has dintinct values
- DROP
- removes the index
- CLUSTERED
- makes clustered index when there is not primary key in table
JOIN
- JOIN
- join all elements of each table
TRANSACTION
- TRANSACTION
- groups process into units
- You should write
ROLLBACK
orCOMMIT
at the end
- ROLLBACK
- returns the process to before status
- COMMIT
- comfirm the process
- LOCK
- there is not
COMMIT
orROLLBACK
inTRAN
, the process is in lock
- there is not
TRY - CATCH
- TRY - CATCH
- when the process has error or exception, tries
CATCH
- if there is not error or exceiption in
TRY
, then process the process inTRY
- when the process has error or exception, tries
-
@TRANCOUNT
- number of transaction