Tugas 7 Database
PRAKTIKUM 7
create database kampus
use kampus
create table jurusan ( kdjur char
(3) not null primary key,
namajur varchar (20))
insert into jurusan values
('301',' mi')
insert into jurusan values
('302',' ka')
create table kelas (kdkls char (3)
not null primary key,
namakls varchar (10))
insert into kelas values ('311','
ka 12_04')
insert into kelas values ('312','
mi 12_11')
insert into kelas values ('k01','
ka 12_06')
insert into kelas values ('k02','
ka 12_05')
create table mahasiswa (nim char
(12) not null primary key,
nama
varchar (15),
jnsklmn
char (1),
alamat
varchar (15),
agama
varchar (10),
kdjurusan
char (3) references jurusan (kdjur),
kdkelas
char (3) references kelas (kdkls))
insert into mahasiswa values ('20120103218','ocha','p','islam','jln.medan','301','312')
insert into mahasiswa values
('20120103220','tasya','p','jln.langkat','islam','302','311')
insert into mahasiswa values
('20120103219','doni','L','jln.kartini','kristen','301','k01')
insert into mahasiswa values
('20120103222','chacha','p','jln.melangir','islam','301','311')
select nama from mahasiswa where nama like 'A%'
select* from jurusan
select * from kelas
select * from mahasiswa
Komentar
Posting Komentar