Question

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)...

QUESTION 5

  1. 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

  1. 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

  1. 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

  1. 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;

Homework Answers

Answer #1

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.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
You query data from emp2 table with below SQL statement: SQL> SELECT *     FROM  emp2; NAME SSN...
You query data from emp2 table with below SQL statement: SQL> SELECT *     FROM  emp2; NAME SSN ------------- ------------------------ Joe 452852452 Mary 444525962 Fred 445212525 Tom 492525252 Lucy   172826152   Now, you query data from emp2 table with below SQL statement again: SQL> SELECT AVG(LENGTH(name)) AS column1, SUM(INSTR(ssn, '%@',2,2)) AS column2 FROM  emp2 WHERE name = INICAP(name); What will be displayed for the output of column1 and column2? A. The value in column1 will be 3.5 and the value in column2 will be...
1) Add to a relational table DEPARTMENT information about the total number of employees in each...
1) Add to a relational table DEPARTMENT information about the total number of employees in each department. Note, that if a department has not employee then for such a department the total number of employees must be set to zero (0). The total number of employees must be a positive number no more than 999. Use SELECT statement to list the contents of an extended relational table DEPARTMENT in the descending order of the total number of employees. Finally, remove...
1. Write a SELECT statement that answers this question: Which customers have ordered more than one...
1. Write a SELECT statement that answers this question: Which customers have ordered more than one product? Return these columns: The email_address column from the Customers table The count of distinct products from the customer’s orders table Sort the result set in ascending sequence by the email_address column. 2. Use a correlated subquery to return one row per customer, representing the customer’s oldest order (the one with the earliest date). Each row should include these three columns: email_address, order_id, and...
Write a SELECT statement that returns one row for each general ledger account number that contains...
Write a SELECT statement that returns one row for each general ledger account number that contains three columns: The account_description column from the General_Ledger_Accounts table The count of the items in the Invoice_Line_Items table that have the same account_number. The sum of the line_item_amount columns in the Invoice_Line_Items table that have the same account_number Return only those rows where the count of line items is greater than 1. This should return 10 rows. Group the result set by the account_description...
1, The following query is called_________ SQL>select e.empno,e.ename, m.ename, m.empno from emp e, emp m where...
1, The following query is called_________ SQL>select e.empno,e.ename, m.ename, m.empno from emp e, emp m where e.mgr = m.empno; cross join outer join Self join Full join Natural Joins 2. Steve wants to write a query to display the employee last name, department name, location id, and city of all employees who earn a commission. He wrote the following query. is it true or false. SELECT e.last_name, d.department_name, d.location_id, l.city FROM employees e, departments d, locations l WHERE e.department_id =...
Create 2 stored procedures: sp_AddNewUser and sp_AddNewRole. Use the ManyToMany script as your base table structures....
Create 2 stored procedures: sp_AddNewUser and sp_AddNewRole. Use the ManyToMany script as your base table structures. The stored procedure should accept the parameters needed to input the data for each table. NOTE: You do not need to input the UserID or RoleID. These are surrogate keys and the system automatically inserts them when you insert a row in the tables.   On execution, the stored procedure should check the database to see if the user exists, if so, return a message...
Class-In Assignment 3: Chapters 4&5 How to retrieve data from two or more tables Exercises 1....
Class-In Assignment 3: Chapters 4&5 How to retrieve data from two or more tables Exercises 1. Write a SELECT statement that returns all columns from the Vendors table inner-joined with all columns from the Invoices table. 2. Write a SELECT statement that returns four columns: vendor_name vendor_name from the Vendors table invoice_number invoice_number from the Invoices table invoice_date invoice_date from the Invoices table balance_due invoice_total minus payment_total minus credit_total from the Invoices table The result set should have one row...
Which of the following is not to be extended to the statement of financial position columns...
Which of the following is not to be extended to the statement of financial position columns of the worksheet?                Select one: a. Accumulated Depreciation          b. Unearned Income c. Expired insurance premium d. Unused Supplies Which of the following is not an element in the computation of estimated depreciation expense? Select one: a. unpaid balance of the acquisition cost b. Acquisition cost                                c. Estimated useful life       d. Scrap value at the end of the useful life Using the liability method, the...
Space X Bank CREATE TABLE Branch(BranchIDNumber VARCHAR(15) PRIMARY KEY NOT NULL, BranchName VARCHAR(6) NOT NULL, Address...
Space X Bank CREATE TABLE Branch(BranchIDNumber VARCHAR(15) PRIMARY KEY NOT NULL, BranchName VARCHAR(6) NOT NULL, Address VARCHAR(50) NOT NULL, City TEXT NULL, State CHAR(2) NULL, ZipCode INT(11) NOT NULL, OfficeNum VARCHAR(15) NOT NULL, FaxNum VARCHAR(15) NOT NULL); CREATE TABLE Employee(EmployeeIDNumber VARCHAR(15) NOT NULL,FirstName VARCHAR(35) NOT NULL, LastName VARCHAR(35) NOT NULL, Email VARCHAR(100) NOT NULL, BranchIDNumber VARCHAR(11) NOT NULL, FOREIGN KEY(BranchIDNumber) REFERENCES Branch(BranchIDNumber), JobTitle ENUM("Manager","Staff") NOT NULL, Salary DECIMAL(8, 2) NOT NULL, HomeNumber VARCHAR(13) NULL, CellNumber VARCHAR(13) NOT NULL); CREATE TABLE...
For each account of the previous question, compute the Balance, and return a table that shows...
For each account of the previous question, compute the Balance, and return a table that shows the account number, type, and balance for each account (hint: use UNION). The list of customer names that have transactions greater than or equal to one thousand dollars. A) Answer this question using only nested queries (i.e., each select is over only one table). B) Answer this query using joins. Bank.sql is under this statement. DROP DATABASE IF EXISTS Bank; CREATE DATABASE Bank; USE...