Bahasa SQL adalah sarana yang dibutuhkan untuk mengakses data di dalam database relasional. Menguasai bahasa SQL merupakan langkah yang terpenting dalam memahami database relasional.
1. Jenis-Jenis Deklarasi Pada SQL
Berdasarkan fungsinya perintah SQL dibagi menjadi 2 kategori yakni DDL (Data Definition Language) dan DML (Data Manipulation Language)
Perintah untuk membuat, mengubah dan menghapus tabel dilakukan melalui DDL(Data Definition Language), yakni dengan :
– CREATE TABLE
– ALTER TABLE
– DROP TABLE
Kolom dalam tabel mempunyai nilai yakni sesuai dengan tipe data yang diinginkan.
2. Membuat Tabel Dengan SQL
Untuk membuat tabel baru dalam sebuah tablespace di MS-SQL adalah dengan menggunakan Create Table dengan syntax sebagai berikut :
CREATE TABLE [database_name.[owner].]table_name
({column_name data_type
[[DEFAULT constant_expression]
|[IDENTITY [(seed,increment)
[NOT FOR REPLICATION]]]]
[ROWGUIDCOL] [NULL|NOT NULL]
[<coulumn constraints>]
|[COLUMN_NAME as computed_column_expression]
|[<table_constraint>]}
[,…n])
[ON {<filegroup>|DEFAULT}]
[TEXTIMAGE_ON {<filegroup>|DEFAULT}]
Sedangkan untuk melihat komponen yang ada di dalam suatu database dengan memberikan perintah :
SP_HELP
Contoh :
Buat tabel MHS pada database MAHASISWA dengan field sebagai berikut
Nopeserta Numerik
Nama 15 karakter
Alamat 30 karakter
Kota 20 karakter
Kodepos Numerik
Maka ketik di Query Analyzer :
USE mahasiswa
CREATE TABLE mhs
(Nopeserta INT,
nama CHAR (15),
alamat VARCHAR (30),
kota VARCHAR (20)
kodepos INT)
Great site, and fantastic infos. Recommend this site to make money without investion. http://www.mandura.ws
EDU blogs are always boring, but this is real interesting, can you maybe give us some information on how to start a blog on an .edu domian? Did you use any educational software
Superb Content, Top Notch, and User Friendly are the best way to describe this post, reading this motivates me. Lets exchange links http://mastcell.net
Last week I dropped by this site and as usual great content and ideas. Love the lay out and color scheme. Is it new? Well I really really like it. Email me the theme at joanbm3@gmail.com.
You are a very intelligent person!
You are a very intelligent person!
Reply : thank you
Keep up the great resourse, added to my ie rss.
Keep up the cool article, added to my ie rss.
This will be an extremely enceinte resourcefulness that you are furnishing and you turn over it away for free. I bask seeing websites that view the value of rendering a prime resource for free. I truly enjoyed reading your Wiley Post. Thanks!
great info! I’ve been looking for sth like this for a while now. thanks admin!
I wanted to thank you for this fantastic read!! I definitely enjoying every little bit of it.I have you bookmarked to check out new stuff you post.
Intriguing article. I know I’m a little late in posting my comment but the article was to the point and just the information I was looking for. I can’t say that I agree with all you mentioned but it was emphatically fascinating! BTW…I found your site through a Google search. I’m a frequent visitor to your blog and will return again soon.