Question

You query data from emp2 table with below SQL statement: SQL> SELECT *     FROM  emp2; NAME SSN...

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

    B.

    The value in column1 will be 3.6 and the value in column2 will be 19

    C.

    The value in column1 will be 3.5 and the value in column2 will be 26

    D.

    The value in column1 will be 3.6 and the value in column2 will be 26

    E.

    None of above will be displayed for the output

2 points   

QUESTION 2

  1. REVIEW the structure and the roes in the emp50 table

    SQL> desc emp50

    Name Null? Type

    -------------- -------- -------------

    ID NUMBER

    NAME VARCHAR2(15)

    JOB_TITLE VARCHAR2(15)

    JOB_CODE NUMBER(2)

    SQL> SELECT *

    FROM emp50;

    ID NAME JOB_TITLE JOB_CODE

    ------ ---------------------- ---------------------- ---------------

    50 William Ford Programmer 6

    51 Wilbur Wright Jr Programmer 6

    52   Wyona Judd Programmer A 4   

    52   Wyona Judd Programmer B 12

    55 Wyatt Programmer A 12

    56   WoWo Smith Maintenance Eng 5

    The user issues the following statements:

    SQL> SELECT REPLACE(SUBSTR(name,1,6),'W','b')    

    FROM emp50

    WHERE LENGTH(name) BETWEEN job_code AND LENGTH(LOWER(job_title));

    What will be the outcome of executing the above SELECT statement?

    A.

    The SELECT statement will fail because of the wrong number of arguments in the SUBSTR function.

    B.

    The SELECT statement will return three rows, namely:

    bilbur

    byona

    bobo S

    C.

    The SELECT statement will fail due to a mismatch in the number of parenthesises.

    D.

    The SELECT statement will fail because you cannot perform the LENGTH of the LOWER of job_title.

Which functions below is single_valued NUMBER functions?

A.

CONCAT

LENGTH

TRIM

B.

REPLACE

INSTR

LPAD

C.

ROUND

SIGN

ABS

D.

NVL

NVL2

ISNULL

he student table contains below columns:

ID NUMBER(9)

LAST_NAME VARCHAR2(25)

FIRST_NAME VARCHAR2(25)

ENROLL_DATE DATE

Evaluate below two SQL statements:

Statement 1:

SELECT CONCAT(INITCAP(first_name), INITCAP(last_name))

FROM student

WHERE enroll_date < '31-DEC-2007';

Statement 2:

SELECT INITCAP(first_name) || INITCAP(last_name)

FROM student

WHERE enroll_date < '31-DEC-2007';

Which of the following statements is TRUE?

A.

Both statements will display the same data.

B.

Both statements will NOT display the same data.

C.

One of the statements will fail because of it contains a syntax error.

D.

Both statements will retrieve the same data, but the display format of the returned values will differ.

Homework Answers

Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Question 1:

Answer :E.None of above will be displayed for the output

Explanation :Note that in the SQL Statement its a INITCAP()

Below screen shows the output

**********************************

Question 2:

Answer :B.

The SELECT statement will return three rows, namely:

bilbur

byona

bobo S

Explanation :Below screen shows the output in Oracle Live SQL

**********************************

Question 3:

Answer :C.

ROUND

SIGN

ABS

Explanation :Single valued number functions are ROUND ,SIGN and  ABS

**********************************

Question 4:

Answer :A.Both statements will display the same data.

Explanation :Both the sql statements will concatenate first name and last name.

**********************************

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

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
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 =...
1. Complete below SQL statement to find count of records from Customers table. SELECT Country, State,...
1. Complete below SQL statement to find count of records from Customers table. SELECT Country, State, City, Count(*) AS Count FROM Customers 2. Add FK on child_table (column1) refrencing from parent_table (column1). ALTER TABLE child_table
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 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:'...
EMPLOYEE Field Name EMP_ID EMP_LNAME EMP_MI EMP_FNAME EMP_SEX EMP_AGE EMP_SALARY EMP_HIREDATE DEPT_CODE Table: DEPARTMENT DEPT_CODE BIOL...
EMPLOYEE Field Name EMP_ID EMP_LNAME EMP_MI EMP_FNAME EMP_SEX EMP_AGE EMP_SALARY EMP_HIREDATE DEPT_CODE Table: DEPARTMENT DEPT_CODE BIOL CPTR HIST MATH RELB Data Type Text Text Text Text Text Number Currency Date/Time Text DEPT_TITLE Biology Computer Science History Mathematics Religion    Field Name DEPT_CODE DEPT_TITLE Data Type Text Text INSTRUCTIONS Use SQL commands to create the tables and enter the data shown above using MS Access. Write the following SQL statement given below: 1. 2. 3. 4. 5. 6. 7. 8. 9....
Save your select statements as a script. Place the semicolon at the end of each SQL...
Save your select statements as a script. Place the semicolon at the end of each SQL statement. Please number your select statements from 1 to 8 in your script and comment out each number. Include your name and student number as a comment at the top of your script. The name of the script has to be Assignment1_JohnSmith. Instead of JohnSmith use your First Name and Last Name. Upload your script trough Blackboard. Use SQL Developer to create the My...
Using JAVA Resource: "Starter Code to Access Tables via JDBC" text file ******** PASTED BELOW ****************...
Using JAVA Resource: "Starter Code to Access Tables via JDBC" text file ******** PASTED BELOW **************** For this assignment, you will create Java™ code that accesses a relational database, requests data, and then analyzes and displays a portion of that data. Imagine that a MySQL relational database schema named COMPANY_DB containing two tables, employee_table and payroll_table, such that the records in each of the tables is as follows: ·        employee_table: Emp id FName   LNname Addr City State Zip 100 Jack...
In SQL working with data types 1. Write a SELECT statement that returns these columns from...
In SQL working with data types 1. Write a SELECT statement that returns these columns from the Instructors table: a. The monthly salary (the AnnualSalary column divided by 12) b. A column that uses the CAST function to return the monthly salary with 1 digit to the right of the decimal point c. A column that uses the CONVERT function to return the monthly salary as an integer d. A column that uses the CAST function to return the monthly...
Consider the following data. (It is not necessary to run the code and upload the output)                           &nbsp
Consider the following data. (It is not necessary to run the code and upload the output)                                                                                                                [10 Marks] STUDENT StudentID SName Gender Age ClubID 3234 Alfred Smith Male 20 BSK 2244 McJohnson Robert Male 22 2389 Jessica Low Female 20 JPA 4211 Roland Devingo Male 24 4383 Jane Usa Khan Female 21 BKY 4450 Elaine Fong Female 20 JPA CLUB ClubID CName Founded Budget BKY Bakery Club 2010 2546 PDC Photomedia and Design 2005 1345 JPA Japanese Anime 2009 3453...
Use the Donor database attached to the assignment answer the following: Question 1: Create a block...
Use the Donor database attached to the assignment answer the following: Question 1: Create a block to retrieve and display pledge and payment information for a specific donor. For each pledge payment from the donor, display the pledge ID, pledge amount, number of monthly payments, payment date, and payment amount. The list should be sorted by pledge ID and then by payment date. For the first payment made for each pledge, display “first payment” on that output row. 2 marks...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in Lab 2 to obtain a diameter value from the user and compute the volume of a sphere (we assumed that to be the shape of a balloon) in a new program, and implement the following restriction on the user’s input: the user should enter a value for the diameter which is at least 8 inches but not larger than 60 inches. Using an if-else...