SQL Exam Review
SQL Exam Review
Option A : PHP
Option B : JAVA
Option C : SQL Developer
Option D : SQL*Plus
3
What does the SQL statement SELECT employee_id, salary * 1.1 AS new_salary FROM employees; do
?
Option A : MODIFY
Option B : UPDATE
Option C : SET
Option D : CHANGE
Option A : MAX
Option B : TRUNCATE
Option C : MIN
Option D : DELETE
6
If you want to display a numeric value with dollar signs and commas, which of the following is the best a
pproach to take?
Option A : INSERT
Option B : SELECT
Option C : UPDATE
Option D : DELETE
10 Which SQL statement will retrieve all columns from the "employees" table?
12 How can you get the employee count grouped by job title?
13
How do you remove all records from the "employees" table without removing the table itself?
15
You need to determine the day of the week for a particular date in the future. Which function will reveal t
his information?
Option A : TO_CHAR
Option B : DAY_OF_WEEK
Option C : TO_DATE
Option D : None of the above
Option A : COUNT(*)
Option B : SUM(*)
Option C : TOTAL(*)
Option D : NUMBER(*)
17 Which SQL statement will update the salary of an employee with ID 101 to 6000?
20
Which SQL statement can be used to get the last name of employees with IDs 101 and 102?
Option A :
SELECT last_name FROM employees WHERE employee_id = 101 OR employee_id = 102;
Option B : SELECT last_name FROM employees WHERE employee_id IN (101, 102);
Option C : SELECT last_name FROM employees WHERE employee_id = (101, 102);
Option D :
SELECT last_name FROM employees WHERE employee_id = 101 AND employee_id = 102;
21 Which SQL statement will add a new employee record to the "employees" table?
Option A : 123.46
Option B : 123.45
Option C : 123
Option D : 123.4
Option A : Show a table’s columns and the data types of those columns
Option B : Show a brief paragraph describing what the table does
Option C : Show a table’s name and who created it
Option D : Show the data that is contained within a table
26
What does the SQL statement ALTER TABLE employees DROP COLUMN middle_name; do?
Option A : DISTINCT
Option B : UNIQUE
Option C : DIFFERENT
Option D : NO_DUPLICATES
29
How can you select all records from the "employees" table where the "department_id" is 10?
Option A : Descending
Option B : Ascending
Option C : Random
Option D : None of the above
34
Which SQL statement will retrieve employees with a salary greater than 5000 and less than 10000?
Option A : SELECT * FROM employees WHERE salary BETWEEN 5000 AND 10000;
Option B : SELECT * FROM employees WHERE salary > 5000 AND salary < 10000;
Option C : SELECT * FROM employees WHERE salary >= 5000 AND salary <= 10000;
Option D : SELECT * FROM employees WHERE salary IN (5000, 10000);
36
What does the SQL statement SELECT * FROM employees WHERE hire_date IS NOT NULL; do?
37 Which SQL command is used to set a primary key on the "employees" table?
38 What SQL statement is used to add a new column "birthdate" to the "employees" table?
39 How do you find employees with salaries between 3000 and 7000?
Option A : SELECT * FROM employees WHERE salary > 3000 AND salary < 7000;
Option B : SELECT * FROM employees WHERE salary BETWEEN 3000 AND 7000;
Option C : SELECT * FROM employees WHERE salary >= 3000 AND salary <= 7000;
Option D : SELECT * FROM employees WHERE salary IN (3000, 7000);
Option A : ADD
Option B : ALTER
Option C : UPDATE
Option D : MODIFY