0% found this document useful (0 votes)
78 views5 pages

Database Akademik

The document describes the database structure for an academic database with 5 tables - Dosen, Matakuliah, Prodi, Mahasiswa, and Nilai. It includes diagrams of the relationships between the tables and descriptions of the fields, data types, constraints, and keys for each table. It also provides the SQL commands that can be used to create each of the 5 tables.

Uploaded by

putri amelya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views5 pages

Database Akademik

The document describes the database structure for an academic database with 5 tables - Dosen, Matakuliah, Prodi, Mahasiswa, and Nilai. It includes diagrams of the relationships between the tables and descriptions of the fields, data types, constraints, and keys for each table. It also provides the SQL commands that can be used to create each of the 5 tables.

Uploaded by

putri amelya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Database Akademik

1. Gambar Relasi Antar ke 5 Tabel

Dosen Nilai Prodi


NID
NamaDsn KdMk
Jenkel NamaMk KdProdi
TglLahir NIM NamaProdi
NamaMK NamaMhs
KdMk Sks
NilaiAngka
NilaiHuruf

Matakuliah Mahasiswa

KdMk NIM
NamaMk NamaMhs
NID Jenkel
NamaMhs KdProdi
Sks TglLahir
2. Struktur Data ke 5 Tabel

Dosen

Field Type(size) Constraint Keterangan

NID Char (10) PRIMARY KEY


NamaDsn Varchar2 (50) NOT NULL
Jenkel Char (1) CHECK IN ‘L’,’P’
TglLahir Date
NamaMk Varchar2 (30)
KdMk Char (10) FOREIGN KEY

Matakuliah

Field Type(size) Constraint Keterangan

KdMk Char (10) PRIMARY KEY


NamaMk Varchar2 (30)
NID Char (10) FOREIGN KEY
NamaMhs Varchar2 (30) NOT NULL
Sks Number (1) CHECK 1 sampai 6

Prodi

Field Type(size) Constraint Keterangan

KdProdi Varchar2 (2) PRIMARY KEY


NamaProdi Varchar2 (30)
Mahasiswa

Field Type(size) Constraint Keterangan


NIM Number (10) PRIMARY KEY
NamaMhs Varchar2 (30) NOT NULL
Jenkel Char (1) CHECK IN ‘L’,’P’
KdProdi Varchar2 (2) FOREIGN KEY
TglLahir Date

Nilai

Field Type(size) Constraint Keterangan

KdMK Char (10) FOREIGN KEY

NamaMk Varchar2 (30)

NIM Number (10) FOREIGN KEY

NamaMhs Varchar2 (30) NOT NULL

SKS Number (1) CHECK 1 sampai 6

NilaiAngka Number (3) CHECK 0 sampai 100

NilaiHuruf Varchar2 (2) CHAR

3. Perintah Untuk Membuat Tabel

 Tabel Dosen
 CREATE TABLE DOSEN
 (NID CHAR (10) PRIMARY KEY, NAMADSN VARCHAR2 (50)
NOT NULL, JENKEL CHECK (IN ‘L’,’P’), TGLLAHIR DATE,
NAMAMK VARCHAR (30), KDMK CHAR (10) FOREIGN
KEY));
 Tabel Matakuliah
 CREATE TABLE MATAKULIAH
 KDMK CHAR (10) PRIMARY KEY, NAMAMK VARCHAR (20),
NID CHAR (10) FOREIGN KEY, NAMAMHS VARCHAR2 (30)
NOT NULL, SKS NUMBER (1) CHECK (SKS BETWEEN 1 AND
6));

 Tabel Prodi
 CREATE TABLE PRODI
 KDPRODI VARCHAR2 (2) PRIMARY KEY, NAMAPRODI
VARCHAR (20)));

 Tabel Mahasiswa
 CREATE TABLE MAHASISWA
 NIM NUMBER (10) PRIMARY KEY, NAMAMHS VARCHAR2
(30) NOT NULL, JENKEL CHECK (IN ‘L’’,’P’), KDPRODI
VARCHAR2 (2) FOREIGN KEY, TGLLAHIR DATE));

 Tabel Nilai
 CREATE TABLE NILAI
 KDMK CHAR (10) FOREIGN KEY, NAMAMK VARCHAR2 (30),
NIM NUMBER (10) FOREIGN KEY, NAMAMHS VARCHAR2
(30) NOT NULL, SKS NUMBER (1) CHECK (SKS BETWEEN 1
AND 6), NILAIANGKA NUMBER (3) CHECK (NILAIANGKA
BETWEEN 0 AND 100), NILAIHURUF VARCHAR2 (2) CHAR));

You might also like