NIM: 00000083179
Mata Kuliah: Database Systems
Kode: IS341
Kelas: B
Nama Dosen: Suryasari, S.Kom., M.T.
Midterm
1. In database there are DDL, DML, and Controlled access to database. Using your
own words, describe the used of these 3 terms and give the examples for each!
Answer:
DDL atau Data Definition Language merupakan bahasa pemrograman yang
digunakan untuk mendefinisikan suatu struktur dari database. Oleh sebab itu,
DDL dapat digunakan untuk mengelola ataupun mengubah struktur tipe data
sebuah objek pada database. Pada DDL terdapat perintah yang dapat
digunakan, yaitu CREATE TABLE, ALTER TABLE, DROP TABLE,
CREATE INDEX, ALTER INDEX, DROP INDEX.
Contoh penggunaan DDL:
1) CREATE TABLE, digunakan untuk membuat tabel
CREATE TABLE nama_table (
column1 datatype (length),
column2 datatype (length),
column3 datatype (length),
...
);
Contoh:
CREATE TABLE Pekerja (
id INT PRIMARY KEY,
nama_pekerja VARCHAR(50),
alamat VARCHAR(100),
tanggal_lahir DATE
);
3. What is the difference between role and privilege in the context of object and
systems privilege. Give example to support your answer!
Answer:
Jawaban sederhana dari perbedaan role dan privilege, role adalah kelompok user
yang dapat diberikan hak akses tertentu, sedangkan privilege adalah hak khusus
yang diberikan pada role atau user untuk melakukan perintah tertentu (SELECT,
VIEW, CREATE, DELETE, UPDATE, GRANT, REVOKE, ataupun semuanya)
pada objek. Itu semua masih berkaitan dengan Controlled Access.
Contoh dari perbedaan role dan privilege adalah ketika ada high user (biasanya
head manager) memnberikan hak/privilege berupa VIEW kepada pegawai
dibawahnya. Pegawai tersebut disebut dengan role karena diberikan
hak/privilege oleh head manager, pegawai tersebut mendapatkan akses untuk
melihat database dan akses tersebut disebut dengan privilege.
4. Using the table relation above, answer these questions by creating the query:
a. Produce a list that shows StudentID, StudentName, and totalCredits for
each student.
b. Produce a list the shows every class that teach by the lecturer and the
department of the lecturer (CourseID, CourseName, LecturerName,
DepartmentName)
c. Produce a list that shows the number of lecturer (in every department)
that has classes
Answer:
a) Membuat list yang menampilkan StudentID, StudentName, dan totalCredit
untuk setiap mahasiswa