Beranda > Materi-Materi > Perancangan Database Bab 1

Perancangan Database Bab 1

Type Data.

Type data yang dimiliki oleh SQL server 2000 :

Integer.

BigInt :

Merupakan bilangan bulat  penuh. Jangkauan yang dimiliki dari -2^63 s/d 2^63-1.

Int:

Merupakan bilangan bulat namun jangkauannya lebih kecil disbanding dengan BigInt. Jangkauan yang dimiliki dari -2^31 s/d 2^31-1.

SmallInt :

Merupakan type bilangan bulat yang jangkauannya lebih kecil dari type Int.

TinyInt :

Type bilangan bulat yang jangkaunnya dari 0  s/d 255.

Bit.

Pada  type bit hanya berisi nilai 0 dan 1.

Decimal dan Numeric

Decimal :

Ketepatan yang dimiliki oleh type bilangan decimal dari 10^38+1  s/d 10^38-1.

Numeric :

Ketepatan yang dimiliki hampir sama dengan Type Decimal.

Money dan SmallMoney.

Money.

Type data Money memiliki jangkauan dari -2^63 s/d 2^63 -1.

SmallMoney.

Type data SmallMoney memiliki jangkauan dari -214,748.3648 s/d +214,748.3647. Lebih kecil disbanding dengan type data Money.

Float dan Real.

Float :

Type data ini memiliki ketepatan nilai dari -1.79E+308 s/d 1.79E+308.

Real :

Type data ini memiliki ketepatan nilai dari -3.40E+38 s/d 3.40 E+38.

Datetime dan Smalldatetme.

Datetime :

Type data ini berupa data waktu dan tanggal dari January 1, 1753 s/d Desember 31, 9999.

SmallDatetime :

Type data ini berupa data waktu dan tanggal/Date dari January 1, 1900 s/d Juni 6, 2079 denga n suatu ketelitian satu menit.

String.

Char :

Type data Char merupakan fixed-length non Unicode yang mempunyai jangkauan maksimum sebesar 8000 karakter.

Varchar :

Type data varchar merupakan Length non Unicode yang mempunyai jangkauan maksimum sebesar 8000 karakter.

Text.

Type data text merupakan variable length non Unicode dengan panjang maksimum 2^31-1 (2,147,483,647) karakter.

Unicode String.

nChar :

Type data nChar merupakan fixed-Length Unicode yang mempunyai jangkauan maksimum sebesar 4000 karakter.

nVarchar :

Type data nVarchar merupakan fixed-Length non Unicode yang mempunyai jangkauan maksimum sebesar 4000 karakter.

nText :

Type data nText merupakan Length non Unicode yang mempunyai jangkauan maksimum sebesar 2^30-1 (1,073,741,823) karakter.

Expresi dan Operator.

Aritmatika.

*             Perkalian

/              Pembagian

–              Pengurangan

+             Penjumlahan

%            Modulus

Karakter.
||           Penggabungan

=             Samadengan

<>           Tidak samadengan

>             Lebih besar dari

<             Lebih Kecil Dari

>=           Lebih besar atau sama dengan

<=           Lebih kecil atau sama dengan

!<            Tidak kurang dari

!>            Tidak lebih dari

!=            Tidak sama dengan

Logika.

NOT

AND

OR

BETWEEN            Akan bernilai true apabila nilai yang dianalisa masih berada didalam jangkauan.

LIKE        Akan bernilai true apabila nilai yang dianalisa menemukan nilai standar.

IN           Akan bernilai true apabila beberapa item yang ditemukan bernilai true.

SOME    Akan bernilai true apabila beberapa item apapun  bernilai true.

ANY       Akan bernilai true apabila beberapa item bernilai true.

ALL         Akan bernilai true apabila semua nilai  bernilai true.

Bitwise.

&             Samadengan operator AND

|              Samadengan operator OR

^             Samadengan operator exclusive OR

Beberapa fungsi yang dapat digunakan dalam SQL Server 2000 :

SUM(), AVG(), MIN(), MAX(), COUNT().

Data Definition Language (DDL).

DDL merupakan bagian dari perintah SQL yang berfungsi u/ mendefinisikan data dan objek database. Beberapa perintah dalam DDL:

Alter Table                          Perintah yg digunakan u/ memnipulasi Tabel

Creat e Table                     Perintah yg digunakan untuk menciptakan sebuah Table

Create Index                      Perintah yg digunakan untuk menciptakan sebuah Index

Drop Table                          Perintah yg digunakan untuk  menghapus Tabel.

Drop Index                         Perintah yg digunakan untuk  menghapus Index.

Grand                                   Perintah yg digunakan untuk  memberikan hak akses

Data Manipulation Language (DML).

DML merupakan bagian dari perintah SQL yang berfungsi untuk memanipulasi data di dalam table.

SELECT                  Perintah untuk menampilkan suatu data baik dari table maupun View.

INSERT                  Perintah untuk menyisipkan record baru ke dalam table.

UPDATE               Perintah untuk memanipulasi nilai suatu record dalam table.

DELETE                  Perintah untuk menghapus suatu record dalam  table.

COMMIT              Perintah untuk memanipulasi perintah ke dalam disk.

ROLBACK             Perintah untuk membatalkan perubahan setelah diberikan perintah Commit.

Membuat  Database.

Misalkan akan dibuat database “Bengkel”.

Perintah membuat Database :

Create Database <Nama Database>

Contoh :

  • Sorot Database
  • Masuk kemenu tools
  • Pilih Menu SQL Query Anlyzer
  • Ketik create database Bengkel
  • Pilih menu -> (Execute Query / F5)
  • Pilih Menu Action, lalu pilih Refresh

Atau gunakan Wizard

  • Sorot Database
  • Klik Kanan
  • Pilih New Database
  • Name    : Bengkel

Membuat Table menggunakan Query Analizer.

Syntax :

USE [nama database]

CREATE TABLE  [nama table] (nama_field <type>, …

CONSTRAINT

PRIMARY KEY |UNIQUE (nama primary key)

NULL | NOT NULL )

Contoh :

Use Bengkel

create table Customer (kode_cust char(10) not null,

nama_cust varchar(25) not null,

Alamat_cust varchar (50) not null,

Phone char(12) null,

constraint PK_Customer primary key (kode_cust))

Pilih menu Action – lalu Pilih Refresh.

Buat Tabel Sbb :

  1. Nama table                         : SPK_HEADER

Primary Key                        : NO_SPK

Nama Field                         Type                      Size

NO_SPK                               Varchar                                10

Tgl_Spk                                                Datetime             8

Kode_cust                          Varchar                                10

No_Kend                             Varchar                                12

  1. Nama table                         : SPK_DETAIL

Primary Key                        : –

Nama Field                         Type                      Size

NO_SPK                               Varchar                                10

Kode_Barang                     Varchar                                10

QTY                                        Int                          4

Harga                                    Numeric               8

Ttl_Harga                             Decimal                                9

Buat   table  Barang,  Kuitansi

Buat Diagram

Perintah Insert :

Digunakan untuk memasukkan data ke dalam kolom-kolom yang terdapat pada table/view.

Bentuk Syntax u/ menambah data adalah Sbb:

INSERT INTO <table name>  VALUES ( <expression, … n> )

Conoh :

Insert  into  customer  values (‘120111′,’ADI’,’Jl. Karya bakti No.6′,’021-33368099′)

Atau

use  bengkel

Insert   into customer  (Kode_cust,nama_cust,alamat_cust,phone)  Values (‘134211′,’RINDA’,’Jl.Pemuda No.5′,’021-4561232′)

Perintah Update.

Digunakan untuk melakukan editing pada isi dari kolom yang dipilih.

Bentuk Syntax perintah Update :

UPDATE < table_name >  SET < column_name >  = {expression}, … < Column_name> ..n = {expression} |DEFAULT|NULL FROM <table_source>  WHERE  < condition >

Contoh :

USE bengkel

UPDATE  Customer SET phone =’021-88321087’  WHERE kode_cust =’134211-9’

Dowload : Perancangan Database P1

Kategori:Materi-Materi
  1. 23 Oktober 2015 pukul 3:14 pm

    Especially, the central is sometimes hit by typhoon with strong wind and
    heavy rain. Beautifully designed and finished
    with finest fitting-out and facilities, the Apartment is perfect elegance to relax after a hard day.
    He is said to have built an altar to exorcise the spirit on this site.

  2. 16 Oktober 2015 pukul 11:47 pm

    Thanks to my father who informed me concerning this blog, this blog is in fact amazing.

  3. 12 September 2015 pukul 12:27 pm

    Each and linked to fashionable film streaming sites reminiscent of
    and The remainder of the domains look like linked to gross sales of counterfeit items.

  4. car
    23 Maret 2015 pukul 2:08 pm

    An intriguing discussion is definitely worth comment.
    I believe that you should publish more about this subject matter, it might not be a taboo matter but generally folks don’t talk about such issues.
    To the next! Cheers!!

  5. 24 November 2014 pukul 8:27 am

    What’s up to every single one, it’s genuinely a pleasant for me
    to visit this web page, it includes precious Information.

  6. 24 September 2014 pukul 4:36 pm

    Yesterday, while I was at work, my cousin stole my apple ipad and tested to
    see if it can survive a 30 foot drop, just so she can be a
    youtube sensation. My apple ipad is now destroyed and she has
    83 views. I know this is totally off topic but
    I had to share it with someone!

  7. 15 September 2014 pukul 8:10 pm

    First of all I want to say fantastic blog!
    I had a quick question in which I’d like to ask if
    you don’t mind. I was interested to find out how
    you center yourself and clear your mind prior to writing.
    I have had difficulty clearing my mind in getting my thoughts out there.
    I truly do enjoy writing however it just seems like the first 10 to 15
    minutes are lost just trying to figure out how to begin. Any ideas or hints?
    Kudos!

  8. 26 Agustus 2014 pukul 7:17 am

    Hey just wanted to give you a brief heads up and let you know a
    few of the images aren’t loading properly. I’m not sure why but
    I think its a linking issue. I’ve tried it in two different
    internet browsers and both show the same results.

  9. 23 Agustus 2014 pukul 5:31 pm

    Thanks you.🙂

  10. 23 Agustus 2014 pukul 4:05 pm

    fantastic publish, very informative. I ponder why the opposite experts of
    this sector don’t realize this. You must proceed your writing.
    I am sure, you have a huge readers’ base already!

  11. 22 Agustus 2014 pukul 6:57 am

    Oke

  12. 22 Agustus 2014 pukul 6:56 am

    Thanks

  13. 22 Agustus 2014 pukul 6:53 am

    If some one wants to be updated with newest technologies therefore he must be pay a quick visit this web site and be up to date every day.

  14. 22 Agustus 2014 pukul 6:48 am

    This is really interesting, You are an excessively skilled blogger.
    I have joined your feed and look ahead to searching for extra of your excellent post.

    Also, I’ve shared your website in my social networks

  15. 19 Agustus 2014 pukul 8:28 pm

    I like the valuable information you provide in your articles.
    I will bookmark your blog and check again here regularly. I am quite sure I will
    learn many new stuff right here! Good luck for the next!

  16. 19 Agustus 2014 pukul 9:19 am

    Hi there, I do think your site may be having web browser compatibility problems.
    Whenever I take a look at your web site in Safari, it looks fine but when opening
    in I.E., it’s got some overlapping issues. I merely wanted to give you a quick heads up!

    Apart from that, excellent website!

  17. 18 Agustus 2014 pukul 6:23 pm

    Pretty! This has been a really wonderful post. Thanks for providing these details.

  18. 4 Juli 2014 pukul 11:16 am

    Wonderful article! We will be linking to this great
    content on our website. Keep up the great writing.

  19. 14 Mei 2014 pukul 7:09 pm

    When someone writes an article he/she keeps the
    idea of a user in his/her mind that how a user can understand it.
    Therefore that’s why this piece of writing is perfect.

    Thanks!

  20. 16 Oktober 2013 pukul 3:47 pm

    Our quality standards are among the highest of all jewelers.
    At Dita Diamonds, shopping is risk-free because you’ve come directly
    to the finest loose diamonds and jewelry available.
    We use only the finest materials to create jewelry with exceptional
    craftsmanship. We’re confident that you won’t find a better diamond
    or piece of jewelry for the price.

    This combination of exceptional quality and extraordinary value has drawn thousands of couples
    to Dita Diamonds.

    Highest Diamond Quality
    As the largest online diamond retailer, Dita Diamonds offers the largest
    collection of the world’s finest cut diamonds. Pre-selected for
    exceptional quality, the cut, color, and clarity
    of our loose diamonds are evaluated based on a standardized grading scale.
    Also, each loose diamond is accompanied by a grading report from either
    GIA or AGSL, independent diamond grading labs with the most
    stringent grading scales of all labs.

    Diamond Jewelry
    For exceptional quality, the diamonds set in our diamond jewelry meet strict minimum
    quality standards. Each diamond is colorless to near-colorless (D–I grade color) with exceptional clarity
    (FL–SI grade clarity). This standard of quality applies to all our diamond jewelry — even pieces with the smallest diamonds.

    Black diamond fashion jewelry is crafted using natural diamonds that have been treated to create the unique black color
    with a high luster. It is common for black diamonds to reveal minor surface imperfections without magnification “mlm”,”multilevel Marketing”,”affiliate”,”referral”,”earning”,”opportunity”,”business opportunity”,”abusiness offer”,”business proposal”,”home based business”,”Earn Dollars”,”MLM”,

  21. 23 September 2013 pukul 6:46 am

    Grsat information. Lucky me I recently found your blogg by chance
    (stumbleupon). I have book-marked it for later!

  22. 14 September 2013 pukul 8:10 pm

    Needed to put you a tiny observation to help give thanks over again
    about the pleasing suggestions you’ve discussed here.

    This is so open-handed of you in giving publicly all that a few
    individuals could have supplied as an ebook in
    order to make some money for their own end, precisely since you might have done it in the
    event you decided. These things additionally worked as a great way to realize that many people have the identical passion like mine
    to understand very much more with regards to this
    matter. I believe there are lots of more pleasurable periods in the future for people who read
    carefully your blog.

  23. 21 Agustus 2013 pukul 11:30 pm

    What’s Going down i am new to this, I stumbled upon this I’ve discovered
    It absolutely useful and it has helped me out loads.
    I’m hoping to contribute & assist different customers like its aided me. Great job.

  24. 5 Agustus 2013 pukul 9:41 pm

    Heya i am for the first time here. I came across this board and I find It truly useful & it helped me out a lot.
    I hope to give something back and help others like you helped
    me.

  25. 18 Juli 2013 pukul 2:57 am

    I do not even know how I ended up right here, however I assumed this submit was once great.
    I don’t realize who you’re however certainly you’re going to a well-known blogger if you happen to aren’t already.

    Cheers!

  26. 17 Juli 2013 pukul 9:26 pm

    What’s up to every one, it’s in fact a good for me to pay a visit this web
    page, it includes helpful Information.

  27. 13 Juli 2013 pukul 11:36 am

    Les service de rencontre en ligne se trouve a être
    un parmi des plus célèbres sites web de rencontre présente aujourd’hui sur le l’internet.
    Grâce plus de 23, 000,000 membres, cette plateforme de rencontre
    a une forte présence aux 4 coins du monde. Le but central Les bon sites de rencontre s’avère d’aider les usages a retrouver
    le ou la candidate de rêve en vue de bâtir une relation
    concrète à l’extérieur du Les sites rencontres. Malgré tout, plusieurs membres font la visitent ce site dans le but d’élargir leur
    cercle de copains. Afin de allègé le travail des usagées en ce qui est a
    trait de la mise en relation, Les sites de rencontres propose une variété d’apport intéressant dans le but d’élever l’ensemble des occasions heureuses de perpetrer la bonne rencontre dans le moindre temps concevable.

  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: