QUESTION 5
The ACCOUNT table contains these columns:
ACCOUNT_ID NUMBER(12)
NEW_BALANCE NUMBER(7,2)
PREV_BALANCE NUMBER(7,2)
FINANCE_CHARGE NUMBER(7,2)
You must create statements to be mailed to all account holders. Each customer's statement must include the account holder's previous balance and finance charge
(0.09 of previous balance) in this format:
Previous Balance: 5000
& Finance Charge: 45
Which SELECT statement will produce these results?
A. |
SELECT Previous Balance: || prev_balance || & Finance Charge: || prev_balance * .009 FROM account; |
|
B. |
SELECT 'Previous Balance:' || prev_balance || ' & Finance Charge:' || prev_balance * .009 FROM account; |
|
C. |
SELECT 'Previous Balance: ' || prev_balance || ' & Finance Charge: ' || prev_balance * .009 FROM account; |
|
D. |
SELECT "Previous Balance: " || prev_balance || " & Finance Charge: " || prev_balance * .009 FROM account; |
2 points
QUESTION 6
The DEPT table contains these columns:
Name Null? Type
--------------------- ---------------- --------------
DEPTNO NOT NULL VARCHAR2(2)
DNAME NOT NULL VARCHAR2(30)
LOC VARCHAR2(30)
With the least amount of efforts, you want to display all of the rows in the DEPT table. Which query should you use?
A. |
SELECT * FROM dept; |
|
B. |
SELECT all FROM dept; |
|
C. |
SELECT any FROM dept; |
|
D. |
SELECT deptno, dname, loc FROM dept; |
2 points
QUESTION 7
The student table contains the following columns:
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
EMAIL VARCHAR2(50)
You are writing a SELECT statement to retrieve the names of
students that do NOT have an e-mail address or e-mail address value
is unknown.
SELECT last_name || ', ' || first_name "Student Name"
FROM student;
Which WHERE clause should you use to complete this statement?
A. |
WHERE email = NULL; |
|
B. |
WHERE email != NULL; |
|
C. |
WHERE email IS NULL; |
|
D. |
WHERE email IS NOT NULL; |
2 points
QUESTION 8
Which SELECT statement should you use if you want to display unique combinations of the POSITION and MANAGER values from the EMPLOYEE table?
A. |
SELECT position, manager DISTINCT FROM employee; |
|
B. |
SELECT position, manager FROM employee; |
|
C. |
SELECT DISTINCT position, manager FROM employee; |
|
D. |
SELECT position, DISTINCT manager FROM employee; |
Question 5:
D.
SELECT "Previous Balance: " || prev_balance || " & Finance Charge: "
|| prev_balance * .009
FROM account;
Strings with spaces can be used with double quotes and concatenation operator ||
option A ,B and C are incorrect as double quotes are not used with strings with spaces.
Question 6:
A.
SELECT *
FROM dept;
Select * is used to display all columns.
Question 7:
C.
WHERE email IS NULL;
IS NULL is the correct option
8.
C.
SELECT DISTINCT position, manager
FROM employee;
Distinct keyword is used to display unique values without repeating.
Do ask if any doubt. Please upvote.
Get Answers For Free
Most questions answered within 1 hours.