-->

Soal dan jawaban Praktikum syntax Praktikum III dan IV Stmik dipanegara


Praktikum III
Create table
Use rio_161296
create table produk_161296(id integer,keterangan char(20),unit char(20),harga float);
create table pelanggan_161296(kode_lgn integer,nama char(5),alamat char(30),tgl_lahir date,telepon char(8));
alter table
alter table pelanggan_161296 add jkl char(8);
alter table pelanggan_161296 modify nama char(20);
insert
Produk_161296
insert into produk_161296 values
(1,'gula','kg',4800),
(2,'susu','liter',5000),
(3,'apel','kg',12000), (3,'apel','kg',12000),
(4,'Buku','dus',9000),
(5,'penghapus','piece',2000);
Pelanggan_161296
insert into pelanggan_161296(kode_lgn,nama,alamat,tgl_lahir,telepon) values
(100,'dougles','St lucia','79-05-20','04103211'),
(200,'barbara','30 barkar av','80-06-18','60107111'),
(300,'alison','ciumbuleuit 151','69-01-12','463756'),
(400,'jason','menteng 35','90-08-15','2000981'),
(500,'stephanie','setiabudi 333','60-03-22','22227783');
Select
select nama,alamat from pelanggan_161296;
select keterangan,harga from produk_161296;
select id,keterangan,unit,harga from produk_161296;
select * from pelanggan_161296;






Praktikum 4
- use rio_161296
Create table pegawai_161296
(nip char(5) not null primary key,nama varchar(20),tglahir date not null,kota varchar(10) default ‘makasar’,depart varchar(10),jkel enum(‘L’,’P’) not null);
Alter table pegawai_161296 add gapok int(7);
Insert into pegawai_161296 values
(‘13501’,’cecep’,’75-10-07’,’bandung’,’produksi’,’L’,1000000),
(‘13502’,’joko’,’70-01-13’,jogjakarta’,’pemasaran’,’L’,750000),
(‘13503’,’dewi’,’81-02-22’,’solo’,’pemasaran’,’P’,800000),
(‘13504’,’beddu’,’80-10-01’,’makasar’,’produksi’.’L’,950000),
(‘13505’,’bambang’,70-12-12’,’jakarta’,’akunting’,’L’,1200000),
(‘13506’,’edhy’,’88-07-07’,’solo’,’produksi’,’L’,825000),
(‘13507’,’annisa’,’88-08-08’,’jakarta’,’pemasaran’,’P’,750000),
(‘13508’,’faiz’,’90-09-04’,’makasar’,’akunting’,’L’,950000),
(‘13509’,’aisyah’,’77-06-12’,’bandung’,’pemasaran’,’P’,8000000),
(‘13510’,’ratih’,’80-01-21’,’jogjakarta’,’produksi’,’P’,860000),
(‘13511’,’syukri’,’81-10-28’,’makasar’,’edp’,’L’,1350000);
select *from pegawai_161296 where nama like 'Y%' or nama like 'K%' or nama like 'm%';
select *from pegawai_161296 where nama like 'b%u%';
select * from pegawai_161296 where month(tglahir)=10;
select * from pegawai_161296 where year(tglahir)>1965;
select nama,depart from pegawai_161296 order by depart;
select depart,count(depart) as jumlah from pegawai_161296 group by depart;
select depart,max(gapok) as gaji_tertinngi from pegawai_161296 group by depart;
select *from pegawai_161296 where year(tglahir) between 1970 and 1980;

0 Response to "Soal dan jawaban Praktikum syntax Praktikum III dan IV Stmik dipanegara"

Posting Komentar

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel