MYSQL - Menghitung Nilai Rata-Rata Mahasiswa

mysql> create database mhs;
mysql> use mhs
mysql> create table data (
 nama varchar (20),
             npm char (8) primary key,
             nilai1 varchar (4),
             nilai2 varchar (4));
mysql> insert into data values ('Sulimah','11108883','80','90');
mysql> insert into data values ('Imah','11108884','70','88');
mysql> insert into data values ('Mhiyuz','11108885','77','87');
mysql> insert into data values ('Mhiyu','11108886','89','60');
mysql> insert into data values ('Irhaz','11108887','80','88');

mysql> select * from data;
mysql> ALTER TABLE data ADD rata2 varchar (6);
mysql> select*from data;
mysql> update data set rata2=((nilai1)+(nilai2))/2;
mysql> select*from data;


Read Users' Comments (1)Comment

1 Response to "MYSQL - Menghitung Nilai Rata-Rata Mahasiswa"

  1. Anonim, on Jumat, Juni 01, 2012 6:32:00 PM said:

    terimakasih ya teh atas ilmunya semoga ALLAH membalasnya amin