Tugas Basis Data Agus Ddl Dcl Dml

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Tugas Basis Data Agus Ddl Dcl Dml as PDF for free.

More details

  • Words: 224
  • Pages: 3
CONTOH PENGGUNAAN DDL 1. Create Table Siswa NIS

: Char(10)

NOT NULL

Nama_Siswa

: Char(30)

NOT NULL

Tanggal_Lahir

: Date

NOT NULL

Alamat

: Char(20)

NOT NULL

2. Create Table Guru NIP

: Char(10)

NOT NULL

Nama_Siswa

: Char(30)

NOT NULL

Tanggal_Lahir

: Date

NOT NULL

Alamat

: Char(20)

NOT NULL

3. Create Table Pelajaran Kode_Pel

: Char(10)

NOT NULL

Nama_Pel

: Char(30)

NOT NULL

4. Create Table Keterhubungan NIS

: Char(10)

Kode_Pel NIP

NOT NULL

: Char(10) : Char(10)

NOT NULL

NOT NULL

Tanggal_Mulai_Belajar

: Date

NOT NULL

Ruangan

: Char(5)

NOT NULL

5. Create Unique Index Siswaidx On Siswa(NIS) 6. Create Unique Index Guruidx On Guru(NIP) 7. Create Unique Index Pelajaranidx On Pelajaran(Kode_Pel) 8. Create Index Siswadx On Keterhubungan(NIS) 9. Create Index Gurudx On Keterhubungan(NIP) 10. Create Index Pelajarandx On Keterhubungan(Kode_Pel)

1

CONTOH PENGGUNAAN DML. 1. Menambah Record INSERT INTO SISWA VALUES (070805,’Alexandra’,22/12/1980,’Sukabumi’) INSERT INTO SISWA VALUES (070806,’Maria’,2/12/1980,’Sukabumi’) 2. Meng-update Record UPDATE PELAJARAN SET Nama_Pel Weight Where Kode_Pel

= ‘Bahasa Jawa’ = Weight + 5 = A0010

3. Menghapus Record DELETE FROM GURU Where NIP

= G030401

4. Menampilkan Record SELECT * FROM PELAJARAN

2

CONTOH PENGGUNAAN DCL 1. GRANT GRANT SELECT ON PELAJARAN TO PUBLIC GRANT SELECT, INSERT, UPDATE, DELETE ON PELAJARAN TO USER1 2. REVOKE REVOKE INSERT, UPDATE, DELETE ON PELAJARAN FROM USER1 REVOKE ALL ON PELAJARAN FROM PUBLIC

3

Related Documents