Professional Documents
Culture Documents
Which of the following is the correct example of enabling constraint? ALTER TABLE
BOOKS
ENABLE
CONSTRAINT
STUD_ID;
Supposed that table: Workers and Employees is consists of the This will retrieve
following values. the record of
What will be the output if the user uses this PL/SQL. Mortos and
SELECT ID, LASTNAME, DEPARTMENT Santiago
FROM WORKERS
WHERE ID > (SELECT ID FROM EMPLOYEES WHERE STATUS =
‘Probi’);
This is a join clause used when the columns in two or more tables Inner Join
have the same but of different data type.
What will be the output if the user uses this PL/SQL. All Workers
UPDATE WORKERS department will
SET DEPARTMENT = (SELECT DEPARTMENT FROM EMPLOYEES be set to NULL
WHERE DEPARTMENT =’HRD’);
What will be the output if the user uses this PL/SQL. 0 rows are
DELETE FROM WORKERS deleted in
WHERE LASTNAME = (SELECT LASTNAME FROM EMPLOYEES WHERE Workers table
LASTNAME=Cruz’)
Which of the following is the correct query that will create a report SELECT
that will display the following: FIRTSNAME, SALARY with additional FIRSTNAME,
1000 in employees salary, rename this column as BONUS, then get SALARY + 1000
the DEPARTMENT_NAME and DEPARTMENT_ID. Join the table using AS BONUS,
ON condition. DEPARTMENT_N
AME,
DEPARTMENT_I
D
FROM
EMPLOYEES E
JOIN
DEPARTMENTS
D
ON
E.DEPARTMENT_
ID =
D.DEPARTMENT
_ID;
Which of the following is the correct example of create a default CREATE TABLE
constraint. COURSE
(CODE CHAR(4)
PRIMARY KEY,
TITLE
VARCHAR(20),
CONSTRAINT
CODE_df
DEFAULT(CODE
BSIT));
If WITH CHECK OPTION is added on the view (see sample code It restricts the
below) what is/are the restriction? users to add a
CREATE OR REPLACE VIEW VIEW STUD_VIEW (USN_ID, LASTNAME, value where
FIRSTNAME, COURSE) course is equal
AS (SELECT USN_ID, LASTNAME, FIRSTNAME, COURSE to BSCS only
FROM STUDENTS
WHERE COURSE = ‘BSCS’
WITH CHECK OPTION CONSTRAINT STUD_VIEW_CK;
Based on the table EMPLOYEES, DEPARTMENTS and LOCATIONS. 2014
From the given select statement below: What is the address of JABBERWACKY
employee under the department_name IT?
SELECT STREET_ADDRESS, CITY, DEPARTMENT_NAME, LOCATION_ID
FROM DEPARTMENTS
JOIN LOCATIONS
USING (LOCATION_ID);
Which of the following is the correct example of creating a subquery INSERT INTO
that will copy all values from employees table to workers where WORKERS
job_id is equal to ST_CLERK; (SELECT * FROM
EMPLOYEES
WHERE JOB_ID
= ‘ST_CLERK’);
A type of constraint that is used to insert a default value into a Default
column.
Which of the following is the correct example of multiple row SELECT
subquery? EMPLOYEE_ID,
SALARY
FROM
EMPLOYEES
WHERE SALARY
=(SELECT
MIN(SALARY)
FROM
EMPLOYEES;
Which of the following is not part of multiple row subqueries? MAX
A type of constraint that is used to limit the value range that can be Check
placed in a column.
Which of the following is not part of single to subqueries IN
This is used to deactivate an integrity constraint. DISABLE
CONSTRAINT
Which of the following joins are mutually exclusive. Natural Join and
Using clause
SELECT EMPLOYEES.EMPLOYEE_ID, The given
EMPLOYEES.LASTNAME,EMPLOYEES.DEPARTMENT_ID,DEPARTMENTS statement is
.DEPARTMENT_ID,DEPARTMENTS.LOCATION_ID Outer Join
FROM EMPLOYEES JOIN DEPARTMENTS
USING (DEPARTMENT_ID);
What will be the output if the user uses this PL/SQL. 0 rows are
DELETE FROM WORKERS deleted in
WHERE LASTNAME = (SELECT LASTNAME FROM EMPLOYEES WHERE Workers table
LASTNAME=Cruz’)
This is used to quality ambiguous column when joining two or more Table Prefixes
tables.
SELECT EMPLOYEES.EMPLOYEE_ID, The given
EMPLOYEES.LASTNAME,EMPLOYEES.DEPARTMENT_ID,DEPARTMENTS statement is
.DEPARTMENT_ID,DEPARTMENTS.LOCATION_ID Outer Join
FROM EMPLOYEES JOIN DEPARTMENTS
ON( EMPLOYEES.DEPARTMENT_ID (+)=
DEPARTMENTS.DEPARTMENT_ID);
It is the skeleton structure that represents the logical view of the Database
entire database. Schema
A type of transaction that is ends the current transactions by making COMMIT
all pending data changes permanent.
Supposed that a user performs the query as shown below, what will Savepoints are
happen to the data? discarded.
UPDATE EMPLOYEES SET JOB_ID = ‘IT’, SALARY =10000
WHERE MANAGER_ID IS NULL;
SAVEPOINT UPDATE_IT;
SAVEPOINT UPDATE_SECRETARY;
ROLLBACK TO UPDATE_IT;