0% found this document useful (0 votes)
21 views18 pages

Prog Ni Charles

The document describes an exam review for a first quarter exam that the user completed, receiving 46 out of 50 marks. It lists 14 multiple choice questions from the exam covering topics like SQL commands for querying databases, joining tables, and formatting query output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views18 pages

Prog Ni Charles

The document describes an exam review for a first quarter exam that the user completed, receiving 46 out of 50 marks. It lists 14 multiple choice questions from the exam covering topics like SQL commands for querying databases, joining tables, and formatting query output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

4/15/24, 6:44 PM First Quarter Exam: Attempt review

Home / My courses / BAED-PROG3114-2322S / Quarterly Exam / First Quarter Exam

Started on Monday, 15 April 2024, 4:37 PM


State Finished
Completed on Monday, 15 April 2024, 5:05 PM
Time taken 27 mins 37 secs
Marks 46.00/50.00
Grade 92.00 out of 100.00

Question 1
Correct

Mark 1.00 out of 1.00

John want to know how many employees receiving salary below 10,000.
What SQL command he need to run?

Select one:
a. SELECT COUNT(emp_id) FROM employees WHERE salary <= 10000;
b. SELECT salary FROM COUNT(employees)WHERE salary < 10000;
c. SELECT COUNT(salary) FROM employees WHERE salary < 10,000;
d. SELECT COUNT(*) FROM employees WHERE salary < 10000;

Question 2
Correct

Mark 1.00 out of 1.00

Each row of data in a table can be uniquely identified by a

Select one:
a. foreign key
b. relational key
c. index key
d. primary key
e. local key

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 1/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 3

Correct

Mark 1.00 out of 1.00

You want to display all the job position titles whose salary is salary from 5,000 to 12,000 arrange from highest to lowest

Select one:
a. SELECT job_title FROM jobs WHERE salary >= 5000 AND salary <= 10000
b. SELECT job_title FROM jobs WHERE min_salary >= 5000 AND max_salary<= 10000
c. SELECT job_title FROM employees WHERE salary >= 5000 AND salary <= 10000
d. SELECT employees_id, job_title FROM employees WHERE salary >= 5000 AND salary <= 10000

Question 4

Correct

Mark 1.00 out of 1.00

The DBA will create a new user name sales.


Which of the following SQL command will perform the creation?

Select one:
a. CREATE USERNAME sales SET PASSWORD default
b. CREATE USER FR0M DB_USER SET user=’sales’ password=NULL
c. CREATE sales ACCESS 1234
d. CREATE USER sales IDENTIFIED BY 1234
e. None of the choices

Question 5
Correct

Mark 1.00 out of 1.00

Display employee's name and id whose firstname starts with letter D and job id is IT_PROG.
Sort the output by department.

Select one:
a. SELECT employees FROM employee_id, first_name, last_name WHERE first_name LIKE ‘D%’ and job_id = ‘IT_PROG’ ORDER BY
department_id
b. SELECT employee_id, first_name, last_name FROM employees ORDER BY department_id WHERE first_name LIKE 'D%' and
job_id = 'IT_PROG'
c. SELECT employee_id, first_name, last_name FROM employees WHERE job_id = 'IT_PROG' OR first_name LIKE 'D%' and ORDER
BY department_id
d. SELECT employee_id, first_name, last_name FROM employees WHERE first_name LIKE 'D%' and job_id = 'IT_PROG' ORDER 
BY department_id

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 2/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 6

Correct

Mark 1.00 out of 1.00

You want to display the employee id and the month an employee was hired.
Which SQL statement give the required output?

Required output :

Select one:
a. SELECT employee_id, hire_date, MONTH(hire_date) AS "Hired Month" FROM employees;
b. SELECT employee_id, DATE(hire_date,'Month') AS 'Hired Month'FROM employees;
c. SELECT employee_id, TO_MONTH(hire_date,'Month') AS 'Hired Month'FROM employees;
d. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month" FROM employees;

Question 7

Correct

Mark 1.00 out of 1.00

You want to display the employee's last name whose salary is below 10,000 and whose lastname starts with letter D.
Which SQL statement give the required output format of the salary?

Select one:
a. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10,000
WHERE last_name = ‘D%’
b. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10000 WHERE
last_name LIKE 'D%'
c. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY" FROM employees WHERE salary < 10000 
WHERE last_name IN 'D%'
d. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10,000 WHERE
last_name STARTS 'D%'

Question 8
Correct

Mark 1.00 out of 1.00

Display all the records in the employee table. Arrange the output in by lastname from A-Z order.

Select one:
a. SELECT * FROM employees SORT BY lastname
b. SELECT * FROM employees ORDER BY lastname
c. SELECT * FROM employees ORDER BY lastname AZ
d. SELECT * FROM employees SORT BY lastname ascending

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 3/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 9

Correct

Mark 1.00 out of 1.00

What will be the output of the following SQL?


SELECT * FROM parts WHERE (warehouse = 1 or warehouse = 2) AND class IN ('HW', 'AP') AND (price > 200 AND price < 500);

Select one:
a. 2 rows returned
b. Invalid SQL command
c. 0 rows returned
d. Error
e. 7 rows returned

Question 10

Correct

Mark 1.00 out of 1.00

Display the montly salary of every employee. Round the salary in 2 decimal places.

Select one:
a. SELECT RND( (salary/12),2 ) FROM employees;
b. SELECT ROUND(salary *12 , 2) /12 FROM employees;
c. SELECT (ROUND(salary,2) )/12 FROM employees;
d. SELECT RND(salary,2)/12 FROM employees;
e. SELECT ROUND( (salary/12),2 ) FROM employees;

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 4/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 11

Correct

Mark 1.00 out of 1.00

You want to display the employee's last name whose salary is below 10,000.
Which SQL statement give the required output format of the salary?

Required output :

Select one:
a. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10000
b. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10,000
c. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY" FROM employees WHERE salary < 10000
d. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10,000

Question 12

Correct

Mark 1.00 out of 1.00

You want to display all the employee id and the month an employee was hired.
Which SQL statement give the required output?

Select one:
a. SELECT employee_id, hire_date, TO_DATE(hire_date,'Month') AS "Hired Month", job_id FROM
b. SELECT employee_id, hire_date, MONTH(hire_date,'Month') AS "Hired Month", job_id FROM employees
c. SELECT employee_id, hire_date, TO_CHAR(hire_date,'Month') AS "Hired Month", job_id FROM employees
d. SELECT employee_id, hire_date, TO_MONTH(hire_date,'Month') AS "Hired Month", job_id FROM employees

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 5/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 13

Correct

Mark 1.00 out of 1.00

Display all the records sorted by price from most expensive to the cheapest parts.

Select one:
a. SELECT ALL FROM parts ORDER BY price
b. SELECT ALL FROM price SORT BY parts HIGHETS
c. SELECT * FROM parts SORT BY price DESC
d. SELECT * FROM parts ORDER BY price
e. SELECT * FROM parts ORDER BY price DESC
f. SELECT * FROM parts SORT BY price
g. SELECT ALL FROM parts SORT BY price HIGHEST

Question 14
Correct

Mark 1.00 out of 1.00

SQL command to create a marker in the current transaction.

Select one:
a. INDEX
b. SAVEMORE
c. POINTER
d. SAVEPOINT
e. SAVEMARKER

Question 15
Correct

Mark 1.00 out of 1.00

You want to display the employee's last name and date hired in year 2000 to2006 whose salary is above 5000. Which SQL statement
give the required output?

Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('01-Jan-2000', 'DD-Mon-YYYYY') AND hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-YYYY') AND salary ABOVE
5000;
b. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('2000', 'YYYY') AND hire_date<= TO_DATE('2006', 'YYYY') OR salary > 5000;
c. SELECT last_name, hire_date FROM employees WHERE hire_date>=
TO_DATE('Jan-2000', 'Month-YYYY') AND hire_date<= TO_DATE('Dec-2006', 'Month-‘YYYY') AND salary > 5,000;
d. SELECT last_name, hire_date FROM employees WHERE hire_date>= 
TO_DATE('01-Jan-2006', 'DD-Mon-RR') AND hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-RR') AND salary > 5000;

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 6/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 16

Incorrect

Mark 0.00 out of 1.00

Evaluate the given SQL syntax


INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...)
WHERE condition;

Select one:
a. Wrong placement of WHERE and VALUES
b. INSERT should be UPDATE command
c. Correct syntax. 
d. This will produce an error.

Question 17

Correct

Mark 1.00 out of 1.00

Evaluate the following SQL command


SELECT employee_id, min_salary, max_salary FROM employees, departments WHERE
salary>= 10000 && salary <= 20000

Select one:
a. The SQL command will produce an error.
b. The SQL will produce Cartesian Product
c. The SQL will display the employee id, department id and the minimum and maximum salary whose salary is between 10000
and 20000.
d. The SQL command will give an incorrect output.

Question 18
Correct

Mark 1.00 out of 1.00

Evaluate the following SQL command


SELECT employee_id, hire_date, department_name FROM employees, departments
WHERE departments.department_id = employees.department_id

Select one:
a. The SQL command will produce a correct output.
b. The SQL command will produce an error.
c. The SQL command should have ALIAS for the table to produce a correct output.
d. The SQL command will give an incorrect output.

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 7/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 19

Correct

Mark 1.00 out of 1.00

You what to generate the average salary of all employees whose job function is FI_ACCOUNT.
Which of the following SQL command will produce the output.

Select one:
a. SELECT AVERAGE(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
b. SELECT AVG(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
c. SELECT COUNT AVG(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';
d. SELECT AVE(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';

Question 20
Correct

Mark 1.00 out of 1.00

Aldrin wants to know the outstanding total balance on hand on every class per warehouse.

Select one:
a. SELECT warehouse, class, onhand FROM parts GROUP BY warehouse, class
b. SELECT warehouse, class, onhand FROM parts GROUP BYsum(warehouse), sum(class);
c. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse, class
d. SELECT TOTAL(warehouse), TOTAL(class), TOTAL(onhand) FROM parts GROUP BY warehouse, class

Question 21
Correct

Mark 1.00 out of 1.00

What will be the SQL command if every employee will be given a productivity bonus which is equivalent to 3% of the monthly salary?
Display the employee id, salary and the productivity bonus.

Select one:
a. SELECT employee_id, salary, salary + (salary .03) FROM employees
b. SELECT employee_id, salary, salary * 1.03 FROM employees
c. SELECT employee_id, salary, salary * .30 FROM employees
d. SELECT employee_id, salary, salary * .03 FROM employees
e. SELECT employee_id, salary FROM employees WHERE salary)

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 8/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 22

Correct

Mark 1.00 out of 1.00

Evaluate the following SQL command


SELECT * FROM jobs WHERE job_title LIKE 'Manager%'

Select one:
a. The SQL command will display all records in the database
b. The SQL command will produce an error.
c. No records will be displayed
d. The SQL command will display all employees with Manager position

Question 23
Correct

Mark 1.00 out of 1.00

You want to display the employee's last name and date hired in year 2002 whose salary is above 5000.
Which SQL statement give the required output?

Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('01-Jan-2002', 'DD-Mon-RR') AND 
hire_date <= TO_DATE('31-Dec-2002', 'DD-Mon-RR') AND salary > 5000;
b. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('Jan-2000', 'Month-YYYY') AND hire_date <=
TO_DATE('Dec-2002', 'Month-‘YYYY') AND salary > 5,000;
c. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('01-Jan-2000', 'DD-Mon-YYYYY') AND
hire_date <= TO_DATE('31-Dec-2002', 'DD-Mon-YYYY')AND salary ABOVE 5000;
d. SELECT last_name, hire_date FROM employees WHERE hire_date >= TO_DATE('2000', 'YYYY') AND hire_date <=
TO_DATE('2002', 'YYYY') OR salary > 5000;

Question 24

Correct

Mark 1.00 out of 1.00

Angelica is the Oracle Database Administrator. She was been assigned to create an access for the newly hired employee named Matt
to the Oracle Database.
Which of the following SQL command Angelica will execute?

Select one:
a. CREATE matt ACCESS 1234
b. None of the choices
c. CREATE USERNAME matt PASSWORD 1234
d. CREATE USER matt IDENTIFIED BY 1234
e. CREATE USER FR0M DB_USER SET user

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 9/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 25

Correct

Mark 1.00 out of 1.00

Which of the following is an Oracle Proprietary Commands

Select one:
a. SQL
b. SQL *Plus
c. ANSI SQL
d. MySQL Plus

Question 26

Correct

Mark 1.00 out of 1.00

Display the employee's name, job title, job_id and the department name of employees with department id of 100.

Select one:
a. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM employees E
JOIN department D ON E.job_id = J.job_id
JOIN jobs J ON E.department_id = D.department_id
WHERE E.department_id = 100
b. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM jobs J
INNER JOIN department D ON E.job_id = J.job_id
INNER JOIN employees EON E.department_id = D.department_id
WHERE E.department_id = 100
c. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM employees E
JOIN jobs J ON E.job_id = J.job_id
JOIN departments D ON E.department_id = D.department_id
WHERE E.department_id = 100
d. SELECT E.employee_id, J.job_title, e.job_id, D.department_name
FROM jobs J
NATURAL JOIN department D ON E.job_id = J.job_id
NATURAL JOIN employees E ON E.department_id = D.department_id
WHERE E.department_id = 100

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 10/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 27

Correct

Mark 1.00 out of 1.00

True or False. The AND, OR, NOT are comparison operators.

Select one:
True

False 

Question 28
Correct

Mark 1.00 out of 1.00

Ronnie is the stockman in the warehouse of ATR Corporation. The General Manager wants to know the parts whose price is above
10000 and above. Which of the following SQL command that Ronnie will run to generate the list.

Select one:
a. SELECT ALL FROM parts WHERE price < 10000;
b. SELECT * FROM parts WHERE price > 10000;
c. SELECT ALL FROM parts WHERE price > ‘10000’;
d. SELECT * FROM parts WHERE price >= 10000;
e. SELECT parts FROM price WHERE price >= 10000;
f. SELECT * FROM parts WHERE price <= 10000;

Question 29
Correct

Mark 1.00 out of 1.00

In creating Joins,the NATURALJOIN and USING clauses are____________

Select one:
a. Mutually Inclusive
b. Mutually Exclusive
c. Opposite
d. Limited to 2 relational tables

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 11/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 30

Correct

Mark 1.00 out of 1.00

You want to display the employee’s last name whose salary is below 10,000 and whose lastname starts with letter K.
Which SQL statement give the required output format of the salary?

Select one:
a. SELECT last_name, TO_INT(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 10,000 WHERE
last_name STARTS 'K%'
b. SELECT last_name, TO_CHAR(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary < 
10000WHERE last_name LIKE ‘K%’
c. SELECT last_name, TO_NUMBER(salary, '$999,999.99') AS "MONTHLY SALARY" FROM employees WHERE salary <
10,000WHERE last_name = ‘K%’
d. SELECT last_name, TO_INTEGER(salary, $999,999.99) AS "MONTHLY SALARY" FROM employees WHERE salary < 10000
WHERE last_name IN 'K%'

Question 31
Correct

Mark 1.00 out of 1.00

Display all location id between 1000 to 2000.

Select one:
a. SELECT location_id FROM departments WHERE location_id IN 1000 AND 2000
b. SELECT location_id FROM departments WHERE location_id BETWEEN 1000 AND 2000
c. DISPLAY location_id FROM departments WHERE location_id BETWEEN 1000 TO 2000
d. DISPLAY location_id FROM departments WHERE location_id LING 1000 UP TO 2000

Question 32
Correct

Mark 1.00 out of 1.00

A _______________ consists of a collection of DML statements that form a logical unit of work.

Select one:
a. Transaction
b. SQL command
c. All of the choices
d. Database

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 12/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 33

Incorrect

Mark 0.00 out of 1.00

Which of the following SELECT statement is the correctreport that will combine the column PARTNUM and DESCRIPTION put a literal
character string "belongs to" in between the two columns then rename the column as "NUMBER TITLE". Note put space before and
after the character literal string to avoid no spaces in the report.

Select one:
a. SELECT (PARTNUM||' THAT BELONGS TO '||DESCRIPTION) AS NUMBER TITLE FROM PARTS;
b. SELECT (;PARTNUM'||' THAT BELONGS TO '||'DESCRIPTION;) AS "NUMBER TITLE" FROM PARTS;
c. SELECT (PARTNUM|| THAT BELONGS TO ||DESCRIPTION) AS "NUMBER TITLE" FROM PARTS; 
d. SELECT (PARTNUM||' THAT BELONGS TO '||DESCRIPTION) AS "NUMBER TITLE" FROM PARTS;

Question 34
Correct

Mark 1.00 out of 1.00

You want to display the employee's last name hired from year 2000 to 2002.
Which SQL statement give the required output?

Select one:
a. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('Jan-2000', 'Month-YYYY') AND hire_date<=
TO_DATE('Dec-2002', 'Month-‘YYYY')
b. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('2000', 'YYYY') AND hire_date<=
TO_DATE('2002', 'YYYY')
c. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-Jan-2000', 'DD-Mon-YYYYY') AND
hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-YYYY')
d. SELECT last_name, hire_date FROM employees WHERE hire_date>= TO_DATE('01-Jan-2000', 'DD-Mon-RR') AND 
hire_date<= TO_DATE('31-Dec-2002', 'DD-Mon-RR')

Question 35
Correct

Mark 1.00 out of 1.00

John want to know how many employees receiving salary below 10,000. What SQL command he need to run?

Select one:
a. SELECT COUNT(salary) FROM employees WHERE salary < 10,000;
b. SELECT salary FROM COUNT(employees)WHERE salary < 10000;
c. SELECT COUNT(*) FROM employees WHERE salary < 10000;
d. SELECT COUNT(emp_id) FROM employees WHERE salary <= 10000;

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 13/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 36

Correct

Mark 1.00 out of 1.00

Display the employee id, salary, number of years and the hiring date of every employee in the company.

Select one:
a. SELECT employee_id,salary, hire_date, hire_date- SYSDATE /365 FROM employees;
b. SELECT employee_id, salary, hire_date, hire_date /365 FROM employees;
c. SELECT employee_id, salary, hire_date, ROUND((SYSDATE - hire_date) /365,0) FROM employees;

Question 37
Correct

Mark 1.00 out of 1.00

Create an SQL command to display the name of the parts, warehouse number, price and the available stock on hand whose price is
below 500. Arrange the list by warehouse number and by class.

Select one:
a. SELECT partnum, description, warehouse, onhand, price FROM parts WHERE price < 500 ORDER BY warehouse, class;
b. SELECT partnum, description, warehouse, onhand, price WHERE price < 500 ORDER BY warehouse, class FROM parts
c. SELECT partnum, description, warehouse, onhand, price FROM parts ORDER BY warehouse, class WHERE 500 < price;
d. SELECT partnum, description, warehouse, onhand, price FROM parts ORDER BY warehouse, class WHERE price < 500;
e. SELECT partnum, description, warehouse, onhand, price ORDER BY warehouse, class ORDER BY warehouse, class FROM parts
WHERE price < 500

Question 38
Correct

Mark 1.00 out of 1.00

What is the SQL command to count the number of records in the employees table?

Select one:
a. SELECT COUNT(*) FROM employees
b. SELECT SUM(*) FROM employees;
c. SELECT * FROM employees;
d. SELECT ALL FROM employees

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 14/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 39

Correct

Mark 1.00 out of 1.00

TRUE OR FALSE.
A FOREIGN KEY is a field in one table that refers to the PRIMARY KEY in another table.

Select one:
True 

False

Question 40
Correct

Mark 1.00 out of 1.00

Austin David was transferred to Purchasing Department. You are assigned to update the database.
Which of the following SQL command will satisfy the requirements?

Select one:
a. UPDATE employees SET department_id = 30 WHERE first_name = ‘David’ AND last_name = ‘Austin’
b. UPDATE first_name = ‘David’ AND last_name = ‘Austin’ FROM employees SET department_id = 30
c. UPDATE department_id = 30 WHERE first_name = ‘David’ AND last_name = ‘Austin’
d. UPDATE employees WHERE department_id = 30 SET first_name = ‘David’ AND last_name = ‘Austin’

Question 41
Incorrect

Mark 0.00 out of 1.00

Display the first 5 letter in the surname of all the employees whose firstname starts with letter 'N'

Select one:
a. SELECT SUBSTR(last_name,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) IN 'N' 
b. SELECT SUBSTR(surname,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) IN 'N'
c. SELECT SUBSTR(last_name,1,5), first_name FROM employees WHERE SUBSTR(first_name,1,1) = 'N'
d. SELECT SUBSTR(surname,1,5), first_name FROM employees WHERE first_name = 'N'
e. SELECT SUBSTR(last_name,1,5), first_name FROM employees WHERE first_name IN 'N'

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 15/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 42

Correct

Mark 1.00 out of 1.00

John want to know how many part items are there in warehouse number 3.
What SQL command he need to run?

Select one:
a. SELECT partnum FROM COUNT(parts)WHERE warehouse = 3;
b. SELECT * FROM COUNT(parts) WHERE warehouse = 3;
c. SELECT COUNT(*) FROM parts WHERE warehouse = 3;
d. SELECT ALL FROM COUNT(parts) WHERE warehouse = 3;

Question 43
Correct

Mark 1.00 out of 1.00

What is the SQL command to display the date of the first employee that was hired?

Select one:
a. SELECT MIN(hire_date) FROM employees;
b. SELECT hire_date FROM employees WHERE FIRST(hire_date );
c. SELECT hire_date FROM employees WHERE TO_CHAR(hire_date) = ‘FIRST’;
d. SELECT FIRST(hire_date) FROM employees;

Question 44
Correct

Mark 1.00 out of 1.00

List all employees except for IT_PROG job id.

Select one:
a. SELECT *FROM employees WHERE JOB_ID <> 'IT_PROG'
b. SELECT *FROM employees EXCEPT JOB_ID != 'IT_PROG'
c. SELECT *FROM employees WHERE JOB_ID NOT IN ('IT_PROG')
d. All of the choices

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 16/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 45

Correct

Mark 1.00 out of 1.00

Which of the following SELECT statement is the correct PL/SQL that will display eliminate the duplicate rows for column class and
warehouse.

Select one:
a. SELECT DISTINCT CLASS, WAREHOUSE FROM PARTS;
b. SELECT DISTINCT CLASS, DISTINCT WAREHOUSE FROM PARTS;
c. SELECT DISTINCT CLASS AND WAREHOUSE FROM PARTS;
d. SELECT DISTINCT CLASS AND DISTINCT WAREHOUSE FROM PARTS;

Question 46
Correct

Mark 1.00 out of 1.00

Which of the following will erase all records in the departments table

Select one:
a. DELETE FROM departments
b. TRUNCATE FROM TABLE departments
c. DELETE * FROM departments
d. TRUNCATE TABLE departments

Question 47
Correct

Mark 1.00 out of 1.00

A Database Administrator can create and remove users and tables.

Select one:
a. The statement is correct
b. The statement is incorrect. Only users of the database can be created by the Database Administrator.
c. The information is insufficient.
d. The statement is incorrect. DBA can only create users and tables. Removal of users and tables will be done by the higher
authority of the database.

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 17/18
4/15/24, 6:44 PM First Quarter Exam: Attempt review

Question 48

Correct

Mark 1.00 out of 1.00

Display all the records whose stock is below 20 and in warehouse number 3.

Select one:
a. SELECT * FROM parts WHERE onhand< 20 OR warehouse = 3;
b. SELECT ALL FROM parts WHERE onhand<= 20 AND warehouse = 3;
c. SELECT * FROM parts WHERE onhand<= 20 AND warehouse = 3;
d. SELECT * FROM parts WHERE onhand> 20 OR warehouse = 3;
e. SELECT * FROM parts WHERE onhand< 20 AND warehouse = 3;
f. SELECT ALL FROM parts WHERE onhand< 20 AND warehouse = 3;

Question 49

Correct

Mark 1.00 out of 1.00

TRUE OR FALSE.
The INSERT statement can add multiple rows.

Select one:
True

False 

Question 50
Not answered

Marked out of 1.00

Display the last day of the month and the hiring date when the employees are hired in the company.

Select one:
a. SELECT LAST_DAY(hire_date), hire_date FROM employees;
b. SELECT LAST(hire_date), hire_date FROM employees;
c. SELECT LASTDAY(hire_date), hire_date FROM employees;
d. SELECT LDAY(hire_date), hire_date FROM employees;

◄ Announcements

Jump to...

Second Quarter Exam ►

https://shsexam.amaesonline.com/2322/mod/quiz/review.php?attempt=1362&cmid=414 18/18

You might also like