membuat database dan menampilkan data tertentu pada my sql!!
persiapan !!
1)install program XAMPP sampai selesai
2)buka command prompt
3)ketikan tulisan seperti di bawah untuk menampilkan hasil dibawahnya pada command prompt
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
(1)
C:\Users\4nz0n>d:
D:\>cd instalan xampp\xampp\mysql\bin
D:\instalan xampp\xampp\mysql\bin>mysql -u root -h localhost -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.33-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
(2)
mysql> create database 8017805TKJ;
Query OK, 1 row affected (0.03 sec)
(3)
mysql> use 8017805TKJ;
Database changed
mysql> create table TabelSiswa(
-> nis varchar(10) not null primary key,
-> nnsiswa varchar(50),
-> tgl_lahir date not null,
-> n_teori decimal(6,2),
-> n_praktek decimal(6,2));
Query OK, 0 rows affected (0.11 sec)
mysql> show tables;
+----------------------+
| Tables_in_8017805tkj |
+----------------------+
| tabelsiswa |
+----------------------+
1 row in set (0.00 sec)
mysql> desc tabelSiswa;
+-----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| nis | varchar(10) | NO | PRI | NULL | |
| nnsiswa | varchar(50) | YES | | NULL | |
| tgl_lahir | date | NO | | NULL | |
| n_teori | decimal(6,2) | YES | | NULL | |
| n_praktek | decimal(6,2) | YES | | NULL | |
+-----------+--------------+------+-----+---------+-------+
5 rows in set (0.01 sec)