-----------------------------------------------------*--------------------------------------------------------------------
CREATE
Yeni bir Veri tabanı ekler.
CREATE DATABASE testDB;
-----------------------------------------------------*--------------------------------------------------------------------
DROP
Mevcut veritabanını siler.
DROP DATABASE testDB;
Mevcut tabloyu siler.
DROP TABLE testTable;
Mevcut Constrainti Siler
ALTER TABLE TableName
DROP CONSTRAINT MyConnstraits
-----------------------------------------------------*--------------------------------------------------------------------
TRUNCATE
Mevcut tablo içerisndeki verileri siler.
TRUNCATE TABLE testDB;
-----------------------------------------------------*--------------------------------------------------------------------
BACKUP
Mevcut veritabanını belirtilen yola yedekler
.
BACKUP DATABASE databasename
TO DISK = 'filepath';
BACKUP DATABASE databasename
TO DISK = 'filepath'
WITH DIFFERENTIAL;
USE MotherShip
BACKUP DATABASE MotherShip
TO DISK ='C:\Users\HABILGUR\Desktop\Cat\MotherShip.bak'
-----------------------------------------------------*--------------------------------------------------------------------
CREATE TABLE
Mevcut Veritabanına tablo ekler.........................
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
CREATE TABLE Customers (
CustomerID int Primary Key Identity(1,1) ,
FirstName nvarchar(40) NOT NULL,
LastName nvarchar(50),
Title varchar(4),
[Last Visit] datetime,
)
-----------------------------------------------------*--------------------------------------------------------------------
ALTER TABLE
Mevcut Tabloya yeni bir kolon eklemek ,değiştirmek yada silmek için kullanılır.
ALTER TABLE table_name
ADD column_name datatype;
ALTER TABLE CUSTOMERS
ADD Email nvarchar(50)
---------
ALTER TABLE table_name
DROP COLUMN column_name;
ALTER TABLE CUSTOMERS
DROP COLUMN Email
--------------------
ALTER TABLE table_name
ALTER COLUMN column_name datatype;
ALTER TABLE CUSTOMERS
ALTER COLUMN Email nvarchar(50)
--------------------
Mevcut Constrainti Siler
ALTER TABLE TableName
DROP CONSTRAINT MyConstraits