Assignment 001 - IT6202 - Database Management System 1: Feedback
Assignment 001 - IT6202 - Database Management System 1: Feedback
Assignment 001 - IT6202 - Database Management System 1: Feedback
System 1
Which of the following is the correct example of creating a new table STUDENTS? The column
STUD_ID is set to primary key.
Select one:
Check
Feedback
Which of the following is the correct example of removing a column SALARY from
EMPLOYEES table?
Select one:
a. ALTER EMPLOYEES
DROP SALARY;
c. ALTER EMPLOYEES
DROP SALARY;
Check
Feedback
Which of the following is the correct example of truncating the table EMPLOYEES?
Select one:
a. TRUNCATE EMPLOYEES;
Check
Feedback
Which of the following is the correct example of modifying the column JOB_ID? Change the
datatype size to 10.
Select one:
b. ALTER EMPLOYEES
d. ALTER EMPLOYEES
Check
Feedback
Which of the following is the correct example of renaming the table EMPLOYEES to
WORKERS?
Select one:
Check
Feedback
Which of the following is the correct example of removing a column FIRSTNAME from
EMPLOYEES table?
Select one:
a. ALTER EMPLOYEES
b. ALTER EMPLOYEES
FROM N FIRSTNAME;
DROP FIRSTNAME;
Check
Feedback
Which of the following is the correct example of dropping the table EMPLOYEES?
Select one:
a. DROP EMPLOYEES;
Feedback
Which of the following is the correct example of modifying the column lastname? Change the
datatype size to 20.
Select one:
a. ALTER EMPLOYEES
b. ALTER EMPLOYEES
SETLASTNAME =VARCHAR(20);
Check
Feedback
Which of the following is the correct example of adding a new column ADDRESS
datatypevarchar size 20 to EMPLOYEES table?
Select one:
c. ALTER EMPLOYEES
Check
Feedback
Which of the following is the correct example of adding a new column
CONTACT_NOdatatypeNUMBER size 11 to EMPLOYEES table?
Select one:
b. ALTER EMPLOYEES
Check
Which of the following is the correct example inserting a new value to STUDENTS table that will
only add new data to STUD_ID and LASTNAME? The stud_id is 10 and lastname is ‘CRUZ’
Select one:
VALUES(10,’CRUZ’);
Check
Feedback
Which of the following is the correct example of deleting a student record from STUDENTS
table whose COURSE is equal to NULL;
Select one:
Check
Feedback
Which of the following is the correct example of inserting new values to STUDENTS table where
the course is set to NULL;
Select one:
Check
Feedback
Which of the following is the correct example of updating the LASTNAME to ‘REYES’ of all
students from STUDENTS table whose STUD_ID is equal to 01020564?
Select one:
b. UPDATE STUDENTS
d. UPDATE STUDENTS
Check
Feedback
Which of the following is the correct example of deleting all records in STUDENTS table;
Select one:
Check
Feedback
Which of the following is the correct example of inserting new values to STUDENTS table?
Select one:
Check
Feedback
Which of the following is the correct example of updating the COURSE to ‘N/A’ of all students
from STUDENTS table whose course IS NULL;
Select one:
b. UPDATE STUDENTS
c. UPDATE STUDENTS
Check
Feedback
Which of the following is the correct example updating the student LASTNAME TO ‘SANTOS’
and course to ‘BSCS’ whose STUD_ID is equal to 109?
Select one:
a. UPDATE EMPLOYEES
d. UPDATE EMPLOYEES
Check
Feedback
Which of the following is the correct example inserting a new value to STUDENTS table that will
only add new data to STUD_ID and LASTNAME? The stud_id is 10 and lastname is 'CRUZ' and
the rest of the column is set to NULL.
Select one:
Check
Feedback
Which of the following is the correct example updating all student COURSE to ‘BSIT’ from
STUDENTS table?
Select one:
a. UPDATE STUDENTS
c. UPDATE STUDENTS
Check
Choose the letter of the correct answer based on the given table PARTS as shown below.
Which of the following SELECT statement is the correct PL/SQL that will display all rows and
columns?
Check
Feedback
Choose the letter of the correct answer based on the given table PARTS as shown below.
Which of the following SELECT statement is the correctreport that will rename the column
DESCRIPTION to TITLE, PARTNUM to ID and ONHAND to STOCK?
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column DESCRIPTION, PARTNUM,
CLASS and PRICE of all parts where the description fourth letter starting from the first is equal
to ‘D’.
Which of the following is the correct report that will display the distinct value for CLASS and
WAREHOUSE limit the rows by getting only the parts under WAREHOUSE 3?
Which of the following is the correct report listing only the column DESCRIPTION,
WAREHOUSE, CLASS and PRICE of all parts where the description contains keyword ‘SHE’.
Which of the following is the correct report listing only the column PARTNUM, CLASS and
ONHAND of all parts where partnum is equal to AT94, DR93 and KV29. (Note 1 query only and
do not use logical condition)
Which of the following is the correct report that will merge the column DESCRIPTION and
PRICE put a literal character string of = “ with a price of ” in between the two columns. Limit the
rows returned by getting only the partnum that starts with letter ‘K’.
Which of the following is the correct report listing the column PARTNO, DESCRIPTION and
WAREHOUSE. Get only that description that does not ends with ‘ER’. Note that you have to
merge the said three columns, rename the merge column as “Parts Record”. Below is the
sample output for column.
Parts Record
AT94is the part number ofIRONwhich belong to warehouse3
SELECT (PARTNUM || ‘is the part number of’|| DESCRIPTION || ‘which belongs to’ ||
WAREHOUSE FROM PARTS WHERE PARTNUM NOT LIKE ‘%ER’;
SELECT (PARTNUM || ‘is the part number of’ ||DESCRIPTION || ‘which belongs to’ ||
WAREHOUSE) FROM PARTS WHERE PARTNUM NOT LIKE ‘ER%’;
SELECT (PARTNUM || ‘is the part number of’ ||DESCRIPTION || ‘which belongs to’ ||
WAREHOUSE) FROM PARTS WHERE PARTNUM LIKE ‘%ER’;
Feedback
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column CLASS, DESCRIPTION and
PRICE of all PARTS where price range is between 200 to 500.
SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE BETWEEN 200
AND 500;
SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE BETWEEN 500
AND 500;
SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE BETWEEN =200
AND 500;
SELECT CLASS, DESCRIPTION, PRICE FROM PARTS WHERE PRICE BETWEEN 200
AND BETWEEN 500;
Feedback
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report listing only the column PARTNUM, DESCRIPTION
and PRICE of all PARTS where price is less than 500. Sort the PRICE in ascending order.
SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE < 500;
SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE > 500;
SELECT PARTNUN, DESCRIPTION, PRICE FROM PARTS WHERE PRICE >= 500;
Feedback
Choose the letter of the correct answer based on table PARTS as shown below
Which of the following is the correct report that will display the DESCRIPTION, WAREHOUSE
AND distinct value for CLASS.
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
FROM PARTS
WHERE CLASS = ‘HW’;
FROM PARTS
WHERE CLASS = HW;
FROM PARTS
WHERE ONHAND >=21;
FROM PARTS
WHERE ONHAND IN(50,21,22);
Feedback
Correct
Question 2
Correct
Flag question
Question text
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
Feedback
Correct
Question 3
Correct
Flag question
Question text
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
FROM PARTS
WHERE CLASS IN (‘HW’,’SG’);
b. SELECT DESCRIPTION, ONHAND, CLASS
FROM PARTS
WHERE DESCRIPTION LIKE ‘%L’;
FROM PARTS
WHERE ONHAND >=9;
FROM PARTS
WHERE DESCRIPTION LIKE ‘L%’;
Feedback
Correct
Question 4
Correct
Flag question
Question text
Given the output below. Which of the following is the correct PL/SQL to be used
Select one:
Feedback
Correct
Marks for this submission: 1.00/1.00.
Question 5
Correct
Flag question
Question text
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
a. SELECT DESCRIPTION, PRICE *.5 +PRICE-100 FROM PARTS WHERE PRICE >10000;
b. SELECT DESCRIPTION, (PRICE *.5 )+PRICE-100 FROM PARTS WHERE PRICE >10000;
c. SELECT DESCRIPTION, PRICE *.5 +PRICE-100 FROM PARTS WHERE PRICE <10000;
d. SELECT DESCRIPTION, PRICE *.5 +(PRICE-100) FROM PARTS WHERE PRICE <10000;
Feedback
Correct
Question 6
Correct
Flag question
Question text
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
FROM PARTS
WHERE CLASS = ‘AP’ OR ONHAND BETWEEN 8 AND 12;
FROM PARTS
WHERE CLASS = ‘AP’ AND ONHAND BETWEEN 8 AND 12;
FROM PARTS
WHERE CLASS = ‘AP’ OR DESCRIPTION LIKE ‘%ER’;
FROM PARTS
WHERE CLASS = ‘AP’ AND DESCRIPTION LIKE ‘%ER’;
Feedback
Correct
Marks for this submission: 1.00/1.00. Accounting for previous tries, this gives 0.67/1.00.
Question 7
Correct
Flag question
Question text
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
FROM PARTS
WHERE CLASS = ‘AP’ OR ONHAND BETWEEEN 8 AND 12
FROM PARTS
WHERE CLASS = ‘AP’ AND DESCRIPTION LIKE ‘__S%’;
FROM PARTS
WHERE CLASS = ‘AP’ OR ONHAND >=8;
FROM PARTS
WHERE CLASS = ‘AP’ OR DESCRIPTION LIKE ‘__S%’;
Feedback
Correct
Question 8
Correct
Flag question
Question text
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
Feedback
Correct
Marks for this submission: 1.00/1.00. Accounting for previous tries, this gives 0.67/1.00.
Question 9
Correct
Question text
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
Feedback
Correct
Question 10
Correct
Flag question
Question text
Given the output below. Which of the following is the correct PL/SQL to be used?
Select one:
FROM PARTS
WHERE DESCRIPTION LIKE ‘%R’;
FROM PARTS
WHERE CLASS IN (‘HW’,’AP’);
FROM PARTS
WHERE DESCRIPTION LIKE ‘R%’;
FROM PARTS
WHERE CLASS = ‘AP’ OR CLASS = ‘HW’;
Feedback
Correct
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
SELECT TRIM(‘K’ FROM LASTNAME)AS TRIM, LASTNAME, DEPARTMENT_ID,
MANAGER_ID
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 50
AND MANAGER_ID = 100;
Select one:
b. 500
c. 563.39
d. 563.3
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
SELECT INITCAP(LASTNAME||’,’||FIRSTNAME) AS NAME
FROM EMPLOYEES
WHERE JOB_ID LIKE ’%PR%’;
Select one:
a. KING,STEVEN
HUNOLD,ALEXANDER
ERNST,BRUCE
LORENTZ,DIANA
b. King,Steven
Hunold,Alexander
Ernst,Bruce
Lorentz,Diana
c. king,steven
hunold,alexander
ernst,bruce
lorentz,Diana
d. King’,’Steven
Hunold’,’Alexander
Ernst’,’Bruce
Lorentz’,’Diana
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
SELECT (LASTNAME||FIRSTNAME), JOB_ID
FROM EMPLOYEES
WHERE SUBSTR (JOB_ID,4)=’REP’;
Select one:
a. ABELELLEN SA_REP
TALORJONATHAN SA_REP
GRANTKIMBERLY SA_REP
FAYPAT MK_REP
b. ABELELLEN SA_REP
TALORJONATHAN SA_REP
GRANTKIMBERLY SA_REP
c. ABELELLEN SA_REP
GRANTKIMBERLY SA_REP
FAYPAT MK_REP
d. TALORJONATHAN SA_REP
GRANTKIMBERLY SA_REP
FAYPAT MK_REP
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
SELECT LASTNAME,SALARY, RPAD(SALARY,4,’@’)
FROM EMPLOYEES
WHERE SALARY BETWEEN 4000 AND 9000
LASTNAME LIKE ‘%S’;
Select one:
a.
a. 563.3
b. 563
c. 563.39
d. 500
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
SELECT MOD(SALARY,10) AS “EXCESS SALARY”
FROM EMPLOYEES
WHERE SALARY < 5000;
Select one:
a. 3
3
3
3
3
b. 0
0
0
0
0
c. 3
3
3
3
3
3
d. 0
0
0
0
0
0
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Based on the given SELECT statement below what would be the possible output?
SELECT FIRSTNAME, SALARY, LPAD(SALARY * 0.10 + SALARY – 100, 8, ‘$’) AS BONUS
FROM EMPLOYEES
WHERE DEPARTMENT_ID NOT IN (10, 110, 50
AND SALARY=17000;
Select one:
a. 563.39
b. 563.3
c. 563
d. 500
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order todisplay the firstname and length of firstname rename the
column length of firstname as Number of Character of all employees whose salary is between
4400 and 8300
Select one:
FROM EMPLOYEES
WHERE SALARY BETWEEN 4400 AND 8300;
FROM EMPLOYEES
WHERE SALARY BETWEEN 8300 AND 4400;
FROM EMPLOYEES
WHERE SALARY BETWEEN 4400 AND 8300;
FROM EMPLOYEES
WHERE SALARY BETWEEN 4400 AND 8300;
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order todisplay a report that trim the letter ‘A’ from lastname of all
employees whose department_id between 60 and 90.
Select one:
FROM EMPLOYEES
WHERE DEPARTMENT_ID BETWEEN 60 AND 90;
b. SELECT TRIM(LASTNAME,’A’)
FROM EMPLOYEES
WHERE DEPARTMENT_ID BETWEEN 60 AND 90;
FROM EMPLOYEES
WHERE DEPARTMENT_ID BETWEEN 90 AND 60;
FROM EMPLOYEES
WHERE DEPARTMENT_ID BETWEEN 60 OR 90;
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order to display the employees lastname concatenated to salary.
Format the salary column to 6 character long right padded with ‘*’ as special character for all
employees whose manager_id is null or salary between 4000 and 6000 Rename the column as
employees and their Salaries
Select one:
FROM EMPLOYEES
WHERE MANAGER_ID = NULL
OR SALARY BETWEEN 4000 AND 6000;
b. SELECT (FIRSTNAME||RPAD(SALARY,6,'*')) AS "EMPLOYEES AND THEIR SALARIES"
FROM EMPLOYEES
WHERE MANAGER_ID IS NULL
OR SALARY BETWEEN 4000 OR 6000;
FROM EMPLOYEES
WHERE MANAGER_ID IS NULL
OR SALARY BETWEEN 4000 AND 6000;
FROM EMPLOYEES
WHERE MANAGER_ID IS NULL
OR SALARY BETWEEN 4000 AND 6000;
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order to display the firstname concatenated to salary with
additional column salary that provides a computation of salary * 2. Rename the column as
Increase of all employees whose lastname ends with N.
Select one:
a. SELECT (FIRSTNAME || 'SALARY OF' || SALARY || 'IF MULITPLY BY TWO THEN HE/SHE
WLL GOT A NEW SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE
LASTNAME LIKE 'N%';
b. SELECT (FIRSTNAME || 'SALARY OF' SALARY 'IF MULITPLY BY TWO THEN HE/SHE
WLL GOT A NEW SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE
LASTNAME LIKE 'N%';
c. SELECT (FIRSTNAME || 'SALARY OF' || SALARY || 'IF MULITPLY BY TWO THEN HE/SHE
WLL GOT A NEW SALARY OF' || SALARY * 2)AS INCREASE FROM EMPLOYEES WHERE
LASTNAME LIKE '%N';
FROM EMPLOYEES
WHERE EMPLOYEE_ID = (201,176,144);
FROM EMPLOYEES
WHERE EMPLOYEE_ID IN (201,176,144);
FROM EMPLOYEES
WHERE EMPLOYEE_ID IN (201,176,144);
FROM EMPLOYEES
WHERE EMPLOYEE_ID IN (201,176,144);
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order to display the employees lastname concatenated with
firstname and with a ‘, (comma)’ in between. A rename on the concatenated column as
Complete Name. Note all values in Complete Name column should be in lowercase plus display
the length of employees lastname for all employees whose lastname starts with letter M sort the
lastname in its default order.
Select one:
LENGTH(LASTNAME)
FROM EMPLOYEES
WHERE LASTNAME LIKE 'M%';
LENGTH(LASTNAME)
FROM EMPLOYEES
WHERE LASTNAME LIKE '%M';
LENGTH(LASTNAME)
FROM EMPLOYEES
WHERE LASTNAME LIKE 'M%';
LENGTH(LASTNAME)
FROM EMPLOYEES
WHERE LASTNAME LIKE 'M%';
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order to display the lastname and salary of all employees whose
department_id = 60 or job_id like ‘_T%’. Format the salary to be 15 character long, left padded
with ‘$’ as special character. Label the column Salary.
Select one:
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 60 OR JOB_ID LIKE '_T';
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 60 OR JOB_ID LIKE '_T';
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 60 AND JOB_ID LIKE 'T';
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order todisplay the firstname in capitalized format rename the
column as pangalan whose job_id is equal to ‘SA_REP’.
Select one:
FROM EMPLOYEES
WHERE JOB_ID = 'SA_REP';
FROM EMPLOYEES
WHERE JOB_ID = 'SA_REP';
FROM EMPLOYEES
WHERE JOB_ID IS 'SA_REP';
FROM EMPLOYEES
WHERE JOB_ID = 'SA_REP';
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order toget theSUBSTR function that returns the job_id = ‘REP’.
Select one:
a. SELECT JOB_ID FROM EMPLOYEES
WHERE SUBSTR(JOB_ID,4)='%REP%';
WHERE SUBSTR(JOB_ID,4)='REP';
WHERE SUBSTR='REP';
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
What query should be used in order todisplay the Firstname concatenated to employees original
salary plus concatenate again a new column salary that multiplies the original salary into three.
Rename the column as Dream Salaries.Note sort the salary in descending order.
Select one:
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY;
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY DESC;
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY DESC;
AS "DREAM SALARIES"
FROM EMPLOYEES
ORDER BY SALARY;
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Which of the following is the correct query that displays the minimum lastname?
Select one:
FROM EMPLOYEES
WHERE JOB_ID = ‘ST_CLERK’;
FROM EMPLOYEES
WHERE JOB_ID != ‘ST_CLERK’;
FROM EMPLOYEES
WHERE JOB_ID = ‘ST_CLERK’;
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Which of the following is the correct query that displays the MINIMUM salary of employees per
job_id? Note job_id should be in lowercase.
Select one:
FROM EMPLOYEES;
FROM EMPLOYEES
GROUP BY JOB_ID;
FROM EMPLOYEES;
FROM EMPLOYEES
GROUP BY JOB_ID;
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Which of the following is the correct query that display the Job_id and add the ff: function:
• Count the total number of job_id per distinct values; Compute for the summary of
salary per job_id; and Compute for the average salary per job_id
Select one:
a. SELECT DISTINCT(JOB_ID), COUNT(JOB_ID) AS “NO. OF JOB_ID”, SUM(SALARY) AS
“TOTAL SALARY”, AVG(SALARY) AS “AVERAGE SALARY” FROM EMPLOYEES GROUP BY
JOB_ID;
FROM EMPLOYEES
GROUP BY JOB_ID;
FROM EMPLOYEES;
c. SELECT DISTICT(JOB_ID), COUNT(JOB_ID) AS “TOTAL NUMBER OF JOB_ID”
FROM EMPLOYEES
GROUP BY JOB_ID;
FROM EMPLOYEES
GROUP BY JOB_ID;
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Which of the following is the correct query that displays the lowest salary rename as “LOWEST
SALARY”, maximum salary rename as “HIGHEST SALARY” and department_id concatenated
to job_id?
Select one:
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID;
FROM EMPLOYEES
GROUP BY JOB_ID;
FROM EMPLOYEES
GROUP BY JOB_ID,DEPARTMENT_ID;
FROM EMPLOYEES;
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Which of the following is the correct query that display the maximum lastname concatenated to
firstname and rename the column as “Employees Name”, Job_id and apply the ff. functions:
• Count the Job_id; Apply where condition whose lastname ends with letter ‘N’;
Group the job_id; and Apply having clause of employees having average salary that is
greater than 10000.
Select one:
a. SELECT MAX(LASTNAME||FIRSTNAME) AS "EMPLOYEES NAME", JOB_ID,
COUNT(JOB_ID)
FROM EMPLOYEES
WHERE LASTNAME LIKE '%N'
GROUP BY JOB_ID
HAVING AVG(SALARY)<10000;
FROM EMPLOYEES
WHERE LASTNAME LIKE '%N'
GROUP BY JOB_ID
HAVING AVG(SALARY)>10000;
FROM EMPLOYEES
WHERE LASTNAME LIKE '%N'
GROUP BY JOB_ID
HAVING AVG(SALARY)>10000;
FROM EMPLOYEES
GROUP BY JOB_ID
WHERE LASTNAME LIKE '%N'
HAVING AVG(SALARY)>10000;
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Which of the following is the correct query that display the Minimum firstname concatenated to
lastname? Look for the maximum salary that is less than 10000 per department_id.
Select one:
a. SELECT MIN(FIRSTNAME,LASTNAME)
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID
HAVING MAX(SALARY)<10000;
b. SELECT MIN(FIRSTNAME||LASTNAME)
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID
HAVING MAX(SALARY)<10000;
c. SELECT MIN(FIRSTNAME||LASTNAME)
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID
HAVING MAX(SALARY);
d. SELECT MIN(FIRSTNAME||LASTNAME)
FROM EMPLOYEES
HAVING MAX(SALARY)<10000
GROUP BY DEPARTMENT_ID;
Feedback
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Which of the following is the correct report that display the smallest (minimum) Surname.. and
apply the ff. functions:
• Get the average salary; Group the data per job_id; Get only job_id with a
keyword “REP”; and Apply having clause, which the max salary per job_id is greater
than 5000.
Select one:
a. SELECT CONCAT(DEPARTMENT_ID,JOB_ID),MIN(SALARY), MAX(SALARY)
FROM EMPLOYEES
GROUP BY JOB_ID;
FROM EMPLOYEES
WHERE JOB_ID NOT LIKE ‘%REP%’
GROUP BY JOB_ID
HAVING MAX(SALARY)>500;
FROM EMPLOYEES
GROUP BY JOB_ID
WHERE JOB_ID LIKE ‘%REP%’
HAVING MAX(SALARY)>500;
FROM EMPLOYEES
WHERE JOB_ID LIKE ‘%REP%’
GROUP BY JOB_ID
HAVING MAX(SALARY)>500;
Choose the letter of the correct answer based on the table EMPLOYEES as shown below.
Table 1.0 EMPLOYEES
Question 1
Correct
Flag question
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
a. SELECT COUNT(DISTINCT MANAGER_ID) AS "NO. OF MANAGER_ID" FROM EMPLOYEES;
Feedbac
Question 2
Correct
Flag question
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
Feedbac
Question 3
Correct
Flag question
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
a. SELECT MIN(LASTNAME), JOB_ID, MAX(SALARY)
FROM EMPLOYEES
WHERE JOB_ID LIKE '%REP%';
FROM EMPLOYEES
WHERE JOB_ID LIKE 'REP%'
GROUP BY JOB_ID;
FROM EMPLOYEES
WHERE JOB_ID LIKE '%REP%'
GROUP BY JOB_ID;
FROM EMPLOYEES
WHERE JOB_ID LIKE '%REP%'
GROUP BY JOB_ID;
Feedbac
Question 4
Correct
Flag question
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
FROM EMPLOYEES;
b. SELECT MAX(LASTNAME||','||FIRSTNAME) AS NAME, MIN(SALARY)
FROM EMPLOYEES;
FROM EMPLOYEES;
FROM EMPLOYEES;
Feedback
Question 5
Correct
Flag question
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID
WHERE DEPARTMENT_ID IN(90,50)
HAVING MIN(DEPARTMENT_ID)<=90;
FROM EMPLOYEES
WHERE DEPARTMENT_ID IN(90,50)
GROUP BY DEPARTMENT_ID
HAVING MIN(DEPARTMENT_ID)<=90;
FROM EMPLOYEES
WHERE DEPARTMENT_ID NOT IN(90,50)
GROUP BY DEPARTMENT_ID
HAVING(DEPARTMENT_ID)<=90;
Feedback
Question 6
Correct
Flag question
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
Feedback
Question 7
Correct
Flag question
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
FROM EMPLOYEES
GROUP BY MANAGER_ID
WHERE SALARY BETWEEN 6000 AND 10000
HAVING MIN(SALARY) >= 5000;
FROM EMPLOYEES
WHERE SALARY BETWEEN 6000 AND 10000
GROUP BY MANAGER_ID
HAVING (SALARY) >= 5000;
FROM EMPLOYEES
WHERE SALARY BETWEEN 10000 AND 6000
GROUP BY MANAGER_ID
HAVING MIN(SALARY) >= 5000;
FROM EMPLOYEES
WHERE SALARY BETWEEN 6000 AND 10000
HAVING MIN(SALARY) >= 5000
GROUP BY MANAGER_ID;
Feedback
Question 8
Correct
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
a. SELECT MIN(LASTNAME),MAX(FIRSTNAME),SUM(SALARY),AVG(SALARY)
FROM EMPLOYEES
WHERE JOB_ID LIKE 'ST%';
b. SELECT MIN(LASTNAME),MAX(FIRSTNAME),SUM(SALARY),AVG(SALARY)
FROM EMPLOYEES
WHERE JOB_ID LIKE '%ST%';
c. SELECT MIN(LASTNAME),MAX(FIRSTNAME),SUM(SALARY),AVG(SALARY)
FROM EMPLOYEES
WHERE JOB_ID LIKE '%ST';
d. SELECT MIN(LASTNAME),MAX(FIRSTNAME),SUM(SALARY),AVG(SALARY)
FROM EMPLOYEES
WHERE JOB_ID LIKE = ‘ST’;
Feedback
Question 9
Correct
Flag question
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
a. SELECT MIN(initcap(FIRSTNAME||' surnname is '||LASTNAME)) AS COMPLETE NAME,
MIN(MANAGER_ID) AS "LOWEST MANAGER_ID" FROM EMPLOYEES;
Feedback
Question 10
Correct
Flag question
Question text
Which of the following query is correct which will display the same output as shown below?
Select one:
FROM EMPLOYEES;
FROM EMPLOYEES
GROUP BY JOB_ID;
FROM EMPLOYEES
GROUP BY JOB_ID;
FROM EMPLOYEES
GROUP BY JOB_ID;
It is the term generally used to describe what was done by large mainframe computers from the
late 1940's until the early 1980's.
Data processing
Answer:
Check
Logical schema
Answer:
Check
The overall logical structure schema of a database can be expressed graphically by anAnswer
E-R diagram
.
Check
Feedback
The overall design of the database is called the
Database schema
Answer:
Check
Feedback
Are applied to the table and form the logical schema.
Constraints
Answer:
Check
Feedback
It is collection of data that contains information relevant to an enterprise.
Database
Answer:
Check
Feedback
It is an association among several entities.
relationship
Answer:
Check
Feedback
It is a unit of data – is a symbol or a set of symbols which is used to represent something.
datum
Answer:
Check
Feedback
It is the collection of information stored in the database at a particular moment is called
Check
Feedback
This is a characteristic of database that includes also the protection of the database from
unauthorized access confidentiality and unauthorized changes.
Data integrity
Answer:
Check
Feedback
It is design to manage large bodies of information.
Database system
Answer:
Check
Feedback
Are said to exhibit physical data independence if they do not depend on the physical schema.
Application program
Answer:
Check
Feedback
This describes the database design at the physical level.
Physical schema
Answer:
Check
Feedback
It is an interpreted data – data supplied with semantics.
Information
Answer:
Check
Feedback
It is a bundle of actions which are done within a database to bring it from one consistent state to
a new consistent state.
Transaction
Answer:
Check
Feedba
This is also known as facts that can be recorded and that have implicit meaning.
Data
Answer:
Check
Feedback
It is the collection of basic objects.
Entities
Answer:
Check
a. ROLLBACK
b. COMMIT
c. CREATE
d. SAVEPOINT
Check
Feedback
It is a collection of relations or two-dimensional tables controlled by the Oracle server.
Select one:
a. Database management system
b. Relational database
c. Relational server
d. Relational model
Check
Feedback
Which of the following is not part of data manipulation language?
Select one:
a. merge
b. Insert
c. Alter
d. Update
Check
Feedback
Which of the following is not part of data control language?
Select one:
a. Insert
b. Grant
c. Revoke
Check
Feedback
He proposed the relational model for database systems in 1970.
Select one:
b. DrcL.F Codd
c. Dr. Lee Codd
Check
Suppose that a user wanted to change the datatype of column ADDRESS from Varchar to Char
which of the following is the correct example.
Select one:
b. ALTER STUDENTS
SET ADDRESS VARCHAR(20);
d. ALTER STUDENTS
MODIFY ADDRESS VARCHAR(20);
Check
Feedback
An alter statement that is used to update an existing column datatype or datatype size.
Select one:
a. ADD
b. MODIFY
c. DROP
d. DELETE
Check
Feedback
An alter statement that is used to delete an existing column in the table.
Select one:
a. MODIFY
b. DELETE
c. DROP
d. ADD
Check
Feedback
Suppose that a user wanted to add a new column name as CITY datatype set to char size 10.
Which of the following is the correct sql statement?
Select one:
Check
Feedback
Which of the following datatype is not being used in oracle?
Select one:
a. NUMBER
b. VARCHAR
c. CHAR
d. INT
Check
Feedback
Basic unit of storage composed of rows and columns
Select one:
a. Synonym
b. Table
c. View
d. Index
Check
Feedback
It logically represents subsets of data from one or more table.
Select one:
a. View
b. Synonym
c. Table
d. Index
Check
Feedback
A statement that is use to rename the table or change the existing name of the table.
Select one:
a. Rename
b. Alias
c. Update
d. Name
Check
Feedback
An alter statement that is used to add new column to the table.
Select one:
a. MODIFY
b. DELETE
c. ADD
d. DROP
Check
Feedback
Which of the following is not true about ALTER statement?
Select one:
b. Drop a column
Check
Suppose that a user wanted to insert a new value using the explicit method which of the
following is the correct example.
Select one:
Check
Feedback
Suppose that a user wanted to update the lastname of student to ‘Santos’ and YR_LVL to ‘Irreg’
whose USN_ID is equal to 50, in one select statement which of the following is the correct sql
statement to use.
Select one:
a. UPDATE STUDENTS
SET LASTNAME = ‘SANTOS’, YR_LVL = ‘IRREG’
WHERE USN_ID = 50;
b. UPDATE STUDENTS
SET LASTNAME = ‘SANTOS’, SET YR_LVL = ‘IRREG’;
c. UPDATE STUDENTS
SET LASTNAME = ‘SANTOS’, YR_LVL = ‘IRREG’;
d. UPDATE STUDENTS
SET LASTNAME = ‘SANTOS’, SET YR_LVL = ‘IRREG’
WHERE USN_ID = 50;
Check
Feedback
Consists of a collection of DML statements that form a logical unit of work.
Select one:
a. Select
b. Transaction
c. DDL
d. DML
Check
Feedback
Suppose that a user uses the DELETE statement as shown below: what is/are the possible
output.
Check
Feedback
Suppose that a user wanted to insert a new value using the implicit method which of the
following is the correct example.
Select one:
Check
Feedback
A type of insert statement that specify the NULL keyword in the VALUES clause.
Select one:
a. Explicit
b. included
c. Excluded
d. Implicit
Check
Feedback
A type of insert statement that omit the column from the column list.
Select one:
a. Excluded
b. included
c. Implicit
d. Explicit
Check
Feedback
A type of DML statement that is use to update existing rows in a table.
Select one:
a. UPDATE
b. DELETE
c. INSERT
d. TRUNCATE
Check
Feedback
A type of DML statement that is use to remove existing rows in a table.
Select one:
a. INSERT
b. DELETE
c. UPDATE
d. TRUNCATE
Check
Feedback
A type of DML statement that is use to add new rows in a table.
Select one:
a. DELETE
b. INSERT
c. TRUNCATE
d. UPDATE
Check
This character is used to override the default precedence or to clarify the statement.
Select one:
a. ( )
b. *
c. AS
d. ||
Check
Feedback
Which of the following is not true about writing SQL statements?
Select one:
c. Clauses are usually placed on separate lines for readability and ease of editing.
Check
Feedback
Supposed that the user uses the ff SELECT statement: what will be the possible output.
SELECT GRADE AS STUDENT MARK FROM GRADE_REPORT;
Select one:
Check
Feedback
This is use to create expression with number and date values.
Select one:
a. Arithmetic expression
b. Logical Condition
c. MDAS operator
d. Numerical Values
Check
Feedback
This is used to brings together data that is stored in different tables by specifying the link
between them.
Select one:
a. Projection
b. Joins
c. Inclusion
d. Selection
Check
Feedback
This is used to selects the rows in a table that are returned by a query. Various criteria can be
used to restrict the rows that are retrieved.
Select one:
a. Projection
b. Joins
c. Inclusion
d. Selection
Check
Feedback
It is a value that is unavailable, unassigned, unknown, or inapplicable.
Select one:
a. NULL
b. Blank
c. Space
d. Zero
Check
Feedback
A system used to concatenate one column to another column.
Select one:
a. ||
b. ( )
c. AS
d. *
Check
Feedback
This is use to Selects the columns in a table that are returned by a query. Selects a few or as
many of the columns as required.
Select one:
a. Projection
b. Joins
c. Inclusion
d. Selection
Check
Feedback
It is a character, a number, or a date that is included in the SELECT statement.
Select one:
a. String
b. Alias
c. Literal
d. Table name
Check
True/False. Character strings and date values are enclosed with double quotation marks.
False
Answer:
Feedback
This is used to perform wildcard searches of valid search string values.
Select one:
a. Comparison
b. Between
c. IN
d. Like
Feedback
True/False Character values are format sensitive and date values are case sensitive-sensitive.
False
Answer:
Feedback
This is used to display rows based on a range of values.
Select one:
a. Comparison
b. Like
c. Between
d. IN
Feedback
This is used to test for values in a specified set of values.
Select one:
a. Between
b. IN
c. Like
d. Comparison
Feedback
True/False. A null value means that the value is unavailable, unassigned, unknown, or
inapplicable.
True
Answer:
Feedback
True/False. The != not equal to symbol is also equal to this symbol<>.
True
Answer:
Feedback
This is used to restrict the rows that are returned by a query.
Select one:
a. Select
b. Insert
c. Delete
d. Where
Feedback
True/False. This symbol % denotes zero or many characters.
True
Answer:
Feedback
This is used to in conditions that compare one expression with another value or expression.
Select one:
a. Comparison
b. Add
c. Logical Condition
d. Subtraction
b. Character function
c. Number function
a. Single row
b. Dual table
c. Multiple row
d. Number function
Feedback
This is use to accept character input and can return both character and number values.
Select one:
a. Multiple row function
b. Number function
c. Character function
b. Number function
c. Character function
a. Trim
b. Length
c. INSTR
d. SUBSTR
Feedback
This is use to find the numeric position of a named character starting at character position n.
Select one:
a. INSTR
b. Length
c. SUBSTR
d. Trim
Feedback
It is a table that is owned by the user SYS and can be accessed by all users.
Select one:
a. Authors
b. Parts
c. Dual
d. Employees
Feedback
This is use to return one result per row.
Select one:
a. Dual table
b. Single row
c. Multiple row
d. Number function
Feedback
Extracts a string of determined length.
Select one:
a. Trim
b. Length
c. SUBSTR
d. INSTR
Feedback
What is the return value if the user try to do the following:
SELECT TRUNC (65.73,-2) FROM DUAL;
Select one:
a. 600
b. 0
c. 00
d. 60
True or False
Database Management System is a collection of interrelated data and a set of programs to
access those data.
True
Answer:
Feedback
Suppose that the user wanted to add a new column name as CUST_NAME data type char size
6. What is the correct SQL statement to use?
Select one:
a. ALTER PARTS
SET CUST_NAME = CHAR(6);
d. ALTER PARTS
ADD CUST_NAME CHAR(6);
Feedback
Which of the following is not part of handling data?
Select one:
a. Semi-Computerized
d. Data Processing
Feedback
Which of the following is not part of common Comparison operator?
Select one:
a. >
b. !=
c. <
d. LIKE
Feedback
Refer to table 1.0, suppose that user insert the following values using the statement below what
would be the possible output?
d. Cannot insert the record because of missing values for ORG and POSITION.
Feedback
True or False:
Security is one of the characteristics of the database that includes also the protection of the
database from unauthorized access confidentiality and unauthorized changes.
False
Answer:
Feedback
Refer to table 1.0, suppose that user update the table using the statement below what would be
the possible output?
UPDATE ORGCHART
SET ORG = ‘PCS’
WHERE ORG IS NULL;
Select one:
a. 1 row/s is updated
c. 2 rows/ is updated
d. 0 row/s is updated
Feedback
Which of the following is not part of characteristics of database?
Select one:
a. Data Persistence
b. Transactions
c. Data Integrity
d. Data Processing
Feedback
Refer to table 1.0 Using the SELECT statement below what would be the possible output:
c. 0 rows selected
a. UPDATE
b. DELETE
c. INSERT
d. ALTER
Feedback
Which of the following is not the correct example of entity?
Select one:
a. EMPLOYEES
b. ORDERS
c. STUDENT
d. Phone_no
Feedback
Which of the following is not part of DDL statement?
Select one:
a. DELETE
b. ALTER
c. CREATE
a. UPDATE
b. INSERT
c. MERGER
d. CREATE table
Feedback
Which of the following is not part of disadvantage of database?
Select one:
a. Data integrity
b. Lower Efficiency
c. Costs
d. Qualified Personnel
Feedback
Refer to table 1.0 Using the SELECT statement below what would be the possible output:
b. 0 rows selected
a. Concat
b. Alias
c. Specific Column
d. Logical condition
Feedback
True or False:
Database is the term generally used to describe what was done by large mainframe computers
from the late 1940's until the early 1980's.
False
Answer:
Feedback
Refer to table 1.0 Using the SELECT statement below what would be the possible output:
d. 0 rows selected
Feedback
Refer to table 1.0 Using the SELECT statement below what would be the possible output:
a. <>
b. IS NUL
c. IN
d. Between AND
Feedback
Refer to table 1.0, suppose that user insert the following values using the statement below what
would be the possible output?
c. Cannot insert the record because of missing values for ORG and POSITION
b. Data independence
c. Database instance
A type of function that helps how to group rows in a table into smaller sets and how to specify
search criteria for groups of rows.
Group function
Answer:
Feedback
A type of function that accept numeric input and return numeric values
Number function
Answer:
Feedback
A type of function returns one result per group of row
Multiple-row function
Answer:
Feedback
Base on the given table.
What is the maximum on hand from parts when this SQL statement is executed?
50
SELECT MAX(ONHAND) FROM PARTS; Answer
What is the minimum warehouse from parts when this SQL statement is executed?
1
SELECT MIN(WAREHOUSE) FROM PARTS; Answer
What is the character position of ‘O’ of the description Microware Oven from parts when this
SQL statement is executed?
5
SELECT INSTR(DESCRIPTION,'O') FROM PART; Answer
What is the length of description Cordless Drill from parts when this SQL statement is
executed?
14
SELECT LENGTH(DESCRIPTION) FROM PART; Answer
How many warehouse are there when this SQL statement is executed?
10
SELECT COUNT(WAREHOUSE) FROM PARTS; Answer
How many warehouse are there when this SQL statement is executed?
3
SELECT COUNT(distinct WAREHOUSE) FROM PARTS; Answer
How many warehouse are there when this SQL statement is executed?
10
SELECT COUNT(*) FROM PARTS; Answer
What is the truncated value of 78.90 when this SQL statement is executed?
0
SELECT TRUNC(78.90,-2) FROM DUAL; Answer
What is the round of value of 78.90 when this SQL statement is executed?
100
SELECT ROUND(78.90,-2) FROM DUAL; Answer
What is the round of value of 78.90 when this SQL statement is executed?
78.9
SELECT ROUND(78.90,1) FROM DUAL; Answer
Feedback
A type of function returns one result per row.
Single-row function
Answer:
Feedback
This query returns rows that are common to both queries.
Intersect
Answer:
Feedback
This query returns rows from both queries including all duplications
union all
Answer:
Feedback
It combines the results of two or more component queries into one result.
Set operators
Answer:
Feedback
This query returns rows in the first query that are not present in the second query.
Minus
Answer:
Feedback
This query returns the rows from both queries after eliminating duplications.
Union
Answer:
Feedback
A type of function that accepts character input and can return both character and number
values.
Character function
Answer: