0% found this document useful (0 votes)
24 views

Update SET Case

The document creates a database and table called "iseng" with fields id, nama, alamat, and tanggal. It inserts sample records, updates a record's name and address, deletes a record, and performs various select queries on the table filtering by field values and ordering results. It also alters the table, changing the data type of the "nama" field.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Update SET Case

The document creates a database and table called "iseng" with fields id, nama, alamat, and tanggal. It inserts sample records, updates a record's name and address, deletes a record, and performs various select queries on the table filtering by field values and ordering results. It also alters the table, changing the data type of the "nama" field.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Create database iseng; Use iseng; create table iseng( id int(15) not null auto_increment, nama varchar(50) not

null, alamat varchar(100) not null, tanggal date not null, primary key(id) ); Drop table latihan; insert into iseng (id,nama,alamat,tanggal) values ('null', 'hoho', 'asasa', '2013-08-06'); desc iseng; menampilkan table alter table customer add usia varchar(2) not null after nama; insert into iseng (id,nama,alamat,tanggal) values ('null', 'arissa', 'bogor', '2013-08-06'), ('null', 'chaud', 'kedaung', '2013-08-06'), ('null', 'budi', 'pamulang', '2013-08-06'); update iseng set nama='dwi', alamat='pamulang' where id='3'; delete from iseng where id=3; select nama, alamat from iseng; select * from iseng where alamat='pamulang'; select * from iseng where alamat='pamulang' and pendidikan=diploma; select * from iseng where alamat='pamulang' or alamat=ciputat; select * from iseng where alamat='pamulang' and (pendidikan=diploma or pendidikan=smu); select nama,jk,jenis from customer where no='3'; select*from customer order by nama asc; select*from matakuliah where sks=3 order by nama asc; UPDATE customer SET jk = CASE no WHEN 1 THEN 'L' WHEN 2 THEN 'P' WHEN 3 THEN 'L' WHEN 4 THEN 'L' END WHERE no IN ( 1, 2, 3, 4 ) Alter table iseng change nama nama varchar(100) not null

You might also like