Subscribe to our feed

This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Senin, 11 Oktober 2010

jawaban tugas kedua Perancangan basis data (mysql)

Jawaban tugas ke dua

Nama kelompok : Indra yusuf dan Latif rochman

NPM : 34A87006090288 dan 34A87006090285

3. buat table mata kuliah dan langsung bentuk pknya ?

Jawaban

Create table MataKuliah

(

Kdmk char (9),

Nama mk varchar(50),

Sks int,

Semester Char(2),

Constraint PKMatkul Primery Key(kdmk)

)

5. buat table mengajar dimana PK dengan Alter/

Jawaban

Create table mengajar

(

Nid char (2),

Thn_akademik char(4)

Smt char(2),

Hari Varchar (10),

Jam _ke char (2),

Kdmk char(9),

Waktu Varchar (10),

Kelas varchar(5),

Kode_jur char (2),

)

6. Relasikan table dosen ke mengajar, dimana nama constrain FKnya =dsn?

Jawaban

Alter Table mengajar

Add constraint FKdsn Foreign Key (nid)

References Dosen(nid)

8. Relasikan table jurusan ke mengajar, nama FKnya “jur”?

Jawaban

Alter Table mengajar

Add constraint FKjur Foreign Key (kode_jur )

References jurusan(kode_jur)

Selasa, 05 Oktober 2010

tugas sql

Tugas Kelompok

No. Nama NPM Kelas Jurusan

1 Indra Yusuf 43A87006090288 S1/TI/3B Malam (Shift)

02 Latif Rochman 43A87006090285 S1/TI/3B Malam (Shift)

  1. Create _Database”Bayar SPP”

SP_ Rename Data Base “BayarSPP “, “PembayaranSPP”

  1. Create Tabel Siswa

(

nis char (8)NOT NULL

nama_s varchar (50)NOT NULL

tempat _lhr varchar (40)NULL

tgl_lhr datetime NULL

jkel varchar (10)NULL

alamat varchar(80)NULL

kota varchar (30)NULL

telpon varchar (15)NULL

hp varchar (15)NULL

kelas_id char(5)NOT NULL

)

Alter table siswa

Add constraint PKSis Primary Key ( nis )

  1. Create tabel Kelas

(

kelas_id char(5)NOTNULL

nama_k varchar (50)NULL

kapasitas Decimal(18.0)NULL

Constraint PKkls Primery Key(kelas_Id)

)

  1. Create table bayar SPP

(

bayar_id char(10)NOT NULL

tgl_bayar datetime NULL

bulan varchar (20)NULL

tahun char(4)NULL

nis char(8)NOTNULL

jenisbyr_id char(4)NOT NULL

Constraint PKbyrspp Primery Key ( bayar_id)

)

  1. Create Table Jenis Bayar

(

jenisbyr_id char (4)NOT NULL

kelas char(10)NULL

jml_byr decimal (18.0)NULL

)

Alter table Jenis Bayar

Add constraint PKjbyr Primary Key ( jensbyr_id )

  1. Isi Data Siswa

insert into siswa values (‘0310001’,’Sri lestari’,’Bekasi’,’12/23/1987’,’Wanita’,’_’,’_’,’012-87121978’,’08131111001’,’1AK1’)

Isi Data Kelas

insert into kelas values (‘1AK1’,’Kelas 1 Akuntansi 1 ‘,’40’)

Isi Data BayarSPP

Insert into BayarSPP values (‘1250002’,12/24/2005’,’Desember’,’2005’,’0320001’,’jb03’)

Isi Data JenisBayar

Insert into JenisBayar values (‘jb03’,’3’,’110000’)

  1. Merelasikan table kelas ke siswa dengan nama constrait FKkelas

Alter table Siswa

Add constraint FKKelas foreign Key ( kelas_id )

References Kelas ( kelas_id )

Merelasikan table Siswa ke BayarSPP dengan nama constraint FKSiswabayar

Alter table BayarSPP

Add constraint FKSiswaBayar Foreign Key ( nis )

Referesces Siswa ( nis )

Merelasikan table JenisBayar ke BayarSPP dengan Nama constraint FKBayarJenis

Alter table BayarSPP

Add constraint FKBayarJenis Foreign Key ( jenisbyr_id )

references JenisBayar ( jenisbyr_id )

  1. Menghapus relasi table dari kelas ke siswa

Drop_Foreign Key (‘kelas’,’table Siswa ‘)

Pages