Dosen Pengajar
nama
AAAA
BBBBB
CCCC
alamat
AAAAAAA
BBBBBBBB
CCCCCCCC
Pengenalan SQL
Kelompok Pernyataan SQL
Pernyataan SQL dapat dikelompokkan menjadi 5 kelompok DDL, DML, DCL, pengendali
transaksi dan pengendali programatik.
DDL ( Data Definition Language )
DDL merupakan kelompok perintah yang berfungsi untuk mendefinisikan atribut-atribut
database, table, atribut (kolom), batasan-batasan terhadap suatu atribut serta hubungan
antar table. Yang termasuk kelompok DDL ini adalah
CREATE untuk menciptakan table ataupun indeks
ALTER untuk mengubah struktur table
DROP untuk menghapus table ataupun indeks
DML ( Data Manipulation Language )
Adalah kelompok perintah yang berfungsi untuk memanipulasi data, misalnya untuk
pengambilan, penyisipan pengubahan dan penghapusan data. Yang termasuk DML adalah
SELECT memilih data
INSERT menambah data
DELETE menghapus data
UPDATE mengubah data
DCL ( Data Control Language )
Berisi perintah-perintah untuk mngendalikan pengaksesan data. Yang termasuk DCL adalah
:
GRANT memberikan kendali pada pengaksesan data.
Pengendali transaksi
Pengendali programatik
Adalah perintah perintah yang berada di level client side untuk menampilkan data kedalam
bentuk informasi yang berguna. Yang termasuk bahasa pemrograman
Base Databyte
Synonyms
Range/Domain
Storage Size
Int
Integer
Whole Numbers
from 2,147
,483,648 to
2,147,483,648
Whole numbers
from 32,768
32,768
Whole number
from 0 -255
0 or 1
Whole or
fractional
numbers from 1038 to 1038
4 Bytes
Smallint
Tinyint
Packet decimal
(exact numeric)
Floating point
(approx
numeric)
Character
(fixed length)
Bit
Decimal (p,s)
Dec numeric
Float(n), where
n is between 8
and 15 double
precision
Float(n) where n
is between 1-7
Character (n)
Character
(variable length)
Varchar(n)
Character
varying(n), char
varying(n)
Unicode
character string
Nchar(n)
National
Character(n)
2 Bytes
1 byte
2 7 bytes
8 Bytes
4 Bytes
1 bit per
character
declared, even if
partially unused
1 bit per
character stored
declared but
unused
character, do
not cunsume
storage
2 bytes per
character
declared
monetary
Date and time
Binary
(flued length)
Nvarchar(n)
National
characte
varifying (n)
Ntext
National text
Money
Smallmoney
datetime
Smalldatetime
Binary(n)
Binary
(variable length)
Varbinary(n)
Long text
numeric
Cursor
Timestamp
Uniqueidentifier
Combine date
and time
representation
(no separate
char)
Any binary
represatation up
to 255 bytes
Any binary
represatation up
to 255 bytes
Reference to a
cursor, can be
use for variable
only
A database wide
unique number
A globaly unique
number
2 bytes per
character
declared but
unused for do
not use
consumed
storage
See text
description
8 bytes
4 bytes
8 bytes
4 bytes
n bytes, even
partially not
used
n bytes, even
partially not
used but unused
for do not use
consumed
storage
If not null 16
bytes pointer is
used for data
storage
8 bytes
16 bytes