This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Translate

Pages

Senin, 27 April 2015

membuat table di mysql

1. Buka Control Panel Xampp (Start - All Program- Xampp)
2. Pastikan Apache dan MySQL Running
3. Masuk ke CMD dan Tuliskan Script berikut :
cd ..
cd ..
cd xampp
cd mysql
cd bin
mysql -u root



4. Bila berhasil ada bacaan 'Welcome to MySQL monitor'. Okeh Kita Lanjutkan dengan databasenya
5. Create database penjualan;
6. Use penjualan;


7. Lalu kita membuat Tabel dari database tersebut :
8. Create table barang (
Kode Varchar (5) Not Null,
Nama Varchar (20) Not Null,
Harga Integer Not Null,
Primary key (Kode)
);



9. Kita akan membuat isi dari Tabelnya :
Insert into barang (Kode, Nama, Harga) Values ("001","Indomie Goreng","2000");
10. Bila ingin melihat Hasilnya : Select*From barang;



11. Bila ingin membuat isinya banyak, Ulangi langkan No.10 tetapi 001 diganti menjadi 002 karna tadi kita mengkasi Primary Key di Kode.


TAMBAHAN


*Disini saya sudah membuat 3 isi dari tabel tersebut*


1. Melihat Hasil : Select*From barang;
2. Melihat Tabel : Show Tables;
3. Melihat Struktur Pembuatan : Desc barang;
4. Menambah Field : Alter table barang add Jumlah Integer Not Null;
*Bila ingin mengisi datanya gunakan sama sepertinya No.8*



5. Merubah Nama Field : Alter table barang change Nama Nama_Barang varchar(20) not null;



6. Merubah Isi Field : Update barang set Nama_Barang="Shampo" where kode="001";



7. Menghapus Satu Barisan : Delete from barang where kode="001";



8. Menghapus Table : Drop barang;
9. Menghapus Database : Drop enjualan;

















































Sumber : http://tribaguskartiko.blogspot.com/2013/09/cara-membuat-database-mysql-dengan-cmd.html