Contoh Soal Kelas A
Contoh Soal Kelas A
Contoh Soal Kelas A
1
Which are DML statements? (Choose all that apply.)
COMMIT
MERGER
UPDATE
DELETE
CREATE
DROP
No. 2
Evaluate the set of SQL statements:
CREATE TABLE dept
(deptno NUMBER(2),
dname VARCHAR2(14),
loc VARCHAR2(13));
ROLLBACK;
DESCRIBE DEPT
What is true about the set?
The DESCRIBE DEPT statement displays the structure of the DEPT table.
The ROLLBACK statement frees the storage space occupied by the DEPT table.
The DESCRIBE DEPT statement returns an error ORA-04043: object DEPT does
not exist.
The DESCRIBE DEPT statement displays the structure of the DEPT table only
if there is a COMMIT statement introduced before the ROLLBACK statement
No. 3
Evaluate this SQL statement:
SELECT ename, sal, 12*sal+100
FROM emp;
The SAL column stores the monthly salary of the employee. Which change must be
made to the above syntax to calculate the annual compensation as "monthly salary
plus a monthly bonus of $100, multiplied by 12"?
No. 4
Examine the SQL statement that creates ORDERS table:
CREATE TABLE orders(
SER_NO
NUMBER UNIQUE,
ORDER_ID
NUMBER,
ORDER_DATE DATE NOT NULL,
STATUS
VARCHAR2(10) CHECK (status IN ('CREDIT', 'CASH')),
PROD_ID
NUMBER REFERENCES PRODUCTS(PRODUCT_ID),
ORD_TOTAL NUMBER,
PRIMARY KEY (order_id, order_date));
For which columns would an index be automatically created when you execute the
above SQL statement? (Choose two.)
SER_NO
ORDER_ID
STATUS
PROD_ID
ORD_TOTAL
composite index on ORDER_ID and ORDER_DATE
No. 5
Evaluate this SQL statement:
SELECT e.EMPLOYEE_ID,e.LAST_NAME,e.DEPARTMENT_ID, d.DEPARTMENT_NAME
FROM EMPLOYEES e, DEPARTMENTS d
WHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID;
In the statement, which capabilities of a SELECT statement are performed?
No. 6
You need to modify the STUDENTS table to add a primary key on the
STUDENT_ID column. The table is currently empty. Which statement accomplishes this
task?
No. 7
Which three are DATETIME data types that can be used when specifying
column definitions? (Choose three.)
TIMESTAMP
INTERVAL MONTH TO DAY
INTERVAL DAY TO SECOND
INTERVAL YEAR TO MONTH
TIMESTAMP WITH DATABASE TIMEZONE
No. 8
Evaluate the SQL statement:
TRUNCATE TABLE DEPT;
Which three are true about the SQL statement? (Choose three.)
No. 9
A subquery can be used to ___.
No. 10
Which two statements about sequences are true? (Choose two.)
You use a NEXTVAL pseudo column to look at the next possible value that would
be generated from a sequence, without actually retrieving the value.
You use a CURRVAL pseudo column to look at the current value just generated
from a sequence, without affecting the further values to be generated from
the sequence.
You use a NEXTVAL pseudo column to obtain the next possible value from a
sequence by actually retrieving the value from the sequence.
You use a CURRVAL pseudo column to generate a value from a sequence that
would be used for a specified database column.
You use a REUSE clause when creating a sequence to restart the sequence once
it generates the maximum value defined for the sequence.
No. 11
What is true of using group functions on columns that contain NULL
values?
No. 12
In which scenario
The indexed
The indexed
The indexed
The indexed
No. 13
Which SELECT statement should you use to extract the year from the
system date and display it in the format "2015"?
SELECT TO_CHAR(SYSDATE,'yyyy')
FROM dual;
SELECT TO_DATE(SYSDATE,'yyyy')
FROM dual;
No. 14
Which two statements complete a transaction? (Choose two.)
DELETE employees;
DESCRIBE employees;
ROLLBACK TO SAVEPOINT C;
GRANT SELECT ON employees TO SCOTT;
ALTER TABLE employees SET UNUSED COLUMN sal;
SELECT MAX(sal) FROM employees WHERE department_id = 20;
No. 15
Which two statements are true about WHERE and HAVING clauses?
(Choose two.)
A
A
A
A
A
A