0% found this document useful (0 votes)
17 views3 pages

Ringkasan Kuis Bapa

The document outlines SQL commands for creating and modifying database tables, including the creation of a 'JURUSAN_012' table and various data definition and manipulation statements. It also includes commands for backing up data, managing access rights, and additional queries for aggregating employee salary data. Key operations include inserting, updating, and deleting records, as well as granting and revoking permissions for users and roles.

Uploaded by

Rifqi Download
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)
17 views3 pages

Ringkasan Kuis Bapa

The document outlines SQL commands for creating and modifying database tables, including the creation of a 'JURUSAN_012' table and various data definition and manipulation statements. It also includes commands for backing up data, managing access rights, and additional queries for aggregating employee salary data. Key operations include inserting, updating, and deleting records, as well as granting and revoking permissions for users and roles.

Uploaded by

Rifqi Download
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/ 3

1.

Insert tabel

CREATE TABLE JURUSAN_012(

ID_JURUSAN SMALLINT NOT NULL,

ID_FAKULTAS SMALLINT REFERENCES FAKULTAS_012 (ID_FAKULTAS),

JURUSAN VARCHAR(60),

PRIMARY KEY(ID_JURUSAN)

);

2. Data definition languange

- ALTER TABLE namatable

ADD fieldbaru tipenya;

- alter table dbmahasiswa


modify (nama_mahasiswa char(45));

- DROP TABLE nametape


- DROP DATABASE namatabel

3. Data manipulation languange

- INSERT INTO account (branch-name, account-number,balance) values


(“Perryridge”,”A-9732”,1200)

- UPDATE account
SET balance = balance *1.06
WHERE balance >10000

- delete from account


where branch-name = ‘Perryridge’

- SELECT EMPNO, FIRSTNME, LASTNAME, YEAR(current date - BIRTHDATE)


as "USIA", DAY(current date - HIREDATE) as "lama hari kerja",
MONTH(current date - HIREDATE) as "lama bulan kerja", year(current
date - HIREDATE) as " lama tahun kerja" FROM EMPLOYEE;

- select LASTNAME, DEPTNAME, PROJNAME


from EMPLOYEE E, DEPARTMENT D, PROJECT P
WHERE E.WORKDEPT = D.DEPTNO
AND D.DEPTNO = P.DEPTNO
AND JOB = 'MANAGER';

- select EMPNO, FIRSTNME, LASTNAME, DEPTNAME


from EMPLOYEE join DEPARTMENT

on WORKDEPT = DEPTNO;

- SELECT AVG(gaji)
From Karyawan

4. Backup

5. Hak akes

- Revoke select on table project from user praktikan012


- Create role walaa
- Drop role wala
6. Tambahan
- SELECT JOB,SUM(SALARY)
FROM EMPLOYEE
WHERE JOB NOT LIKE '%MAN%'
GROUP BY JOB
HAVING SUM(SALARY) > 13000
ORDER BY SUM(SALARY)

- Selecrt connet execute update alter


- Create role mahasiswa012
- Grant role to user tampan
- Grant select on table horee to role mahasiswa012
-

You might also like