Kumpulan Cerita Sex Dewasa - Procedure isi,tambah,cari dan menghapus data pada CMD -Langsung ajah bro...dari tugas kuliah nie...hehehehe
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Windows_7>cd\
C:\>cd xampp
C:\xampp>cd mysql
C:\xampp\mysql>cd bin
C:\xampp\mysql\bin>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.45-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database AKADEMIK;
Query OK, 1 row affected (0.00 sec)
mysql> use AKADEMIK;
Database changed
mysql> create table mahasiswa(NIM char(3), nama varchar(25), alamat varchar(30),
primary key(NIM));
Query OK, 0 rows affected (0.17 sec)
mysql> delimiter //
mysql> create procedure isidata(a char(3), b varchar(25), c varchar(30))
-> BEGIN
-> insert into mahasiswa (NIM,nama,alamat)
-> values (a,b,c);
-> END
-> //
Query OK, 0 rows affected (0.03 sec)
mysql> delimiter ;
mysql> call isidata('
001','rio','pagaralam');
Query OK, 1 row affected (0.03 sec)
mysql> select *from mahasiswa;
+-----+-------+-----------+
| NIM | nama | alamat |
+-----+-------+-----------+
|
001 | rio | pagaralam |
+-----+-------+-----------+
1 row in set (0.00 sec)
mysql> delimiter //
mysql> create procedure tambahdata(a char(3), b varchar(25), c varchar(30))
-> BEGIN
-> insert into mahasiswa (NIM,nama,alamat)
-> values (a,b,c);
-> END
-> //
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter ;
mysql> call tambahdata('
002','fajar','selapan');
Query OK, 1 row affected (0.00 sec)
mysql> select *from mahasiswa;
+-----+-------+-----------+
| NIM | nama | alamat |
+-----+-------+-----------+
|
001 | rio| pagaralam || 002 | fajar | selapan |
+-----+-------+-----------+
2 rows in set (0.00 sec)
mysql> delimiter //
mysql> create procedure caridata(out a char(3), in b varchar(25))
-> BEGIN
-> select nama into a from mahasiswa where NIM=b;
-> END
-> //
Query OK, 0 rows affected (0.00 sec)
mysql> select @nama//
+-------+
| @nama |
+-------+
| NULL |
+-------+
1 row in set (0.00 sec)
2 rows in set (0.00 sec)
mysql> delimiter //
mysql> create procedure menghapusdata(in NIM char(3))
-> BEGIN
-> delete from mahasiswa where NIM=NIM;
-> END
-> //
Query OK, 0 rows affected (0.00 sec)
mysql> call menghapusdata('
001')//
Query OK, 2 rows affected (0.00 sec)
mysql> delimiter ;
mysql> select *from mahasiswa;
Empty set (0.00 sec)
oke,,yang bertaanda merah silahkan anda ganti terserah anda