CIS 143

CI

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

S

1

4

3

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Introduction to SQL Quiz 2

Student

Nam

e

________________________________________ Section ___ Date _______

Part I – MULTIPLE CHOICE AND SHO

R

T ANSWER PORTION

1. The following is the correct code to create a view:

a. CREATE VIEW kljview AS b. CREATE OR REPLACE VIEW kljview

c. CREATE kljview d. REPLACE VIEW kljview

2. Which of the following is/are correct to give an alias for a column? Use the table Dual to check your answer!

a. SELECT sysdate ”Bach” s’ ” Home”

b. SELECT sysdate ‘Beethoven’s Home’

c. SELECT sysdate ”Brahms”s Home”

d. SELECT sysdate ‘Mozart’ Home’

e. SELECT sysdate ”Katherine’s Home”

3. Choose which letter accurately describes the relationship of the following entities

Patient

Doctor

a. 0:0 b. 1:0 c. 1:1 d. 1:M e. M:M

4. The SQL code: SELECT &last_name, &first_name from employees;

a. involve substitution variables

b. asks for direct user input

c. will be ignored by the server

d. a and b

e. b and c

5. Marge enters the following date in RR format for the employee’s date of birth: 25-Dec-25

Marge enters this information on September 26th, 2051. What is the year of birth as recognized by Oracle? [be careful on this one! Do your research!!]

a. 2025 b. 2

005

c. 1925 d. 1905 e. 2125

6. Only primary and foreign keys have the constraint NULL.

a. True b. False

7. The column heading is used to customize what the reader will see for the name of the column field.

a. True b. False

8. To determine the total of all the employees of department_id = 90 using the table called employees, the SQL code is

SELECT TOTAL(last_NAME) FROM employees WHERE department_id=90;

a. True b. False

9. What does the following query yield?

SELECT last_name, first_name, Oracle_test_score, date_test

FROM students

Where Oracle_test_score > (SELECT AVG(Oracle_test_score) from students)

10. Concatenate the result returned by the following number functions. Be sure to show the sql code, along with the query results!

ROUND(222.199,-2), TRUNC(222.199,-2)

11. What are the number of days to reach the day after December 1st, 2021? Be sure to show the sql code, along with the query results!

12. What is the proper code to format a column that contains numbers to represent currency? Once you have determined the format, use the code to format the number 500 to represent currency to the second decimal.

13. Give the code to concatenate the following two fields: Book_ID, Book_Desc

14. Name at least two reasons to construct a View.

15. Give two examples of using the CHECK constraint, one example of using the NULL constraint, and one example using the UNIQUE constraint.

Y

ou may construct a table to show these constraints assigned to any fields for the table.

Part II – Payroll Problem!

Create a Payroll table for the ORACO Company that will contain the following field schema as of 10/31/2011, and populate the table [note the last row is to include your name and today’s date]. You may name the table payroll. BY THE WAY, THE TABLE HAS BEEN CREATED FOR YOU AND IS FOUND IN THE E

X

AM FOLDER!!

14.56

80

Katherine Papademas

Joe Smith

80

Frank
Coole

R

Betty
Davis

S

80

Katherine Papademas

Name

Emp_id

Dep

Hourly_Rate

BiWeekly_Cur_Hours

Hire_ Date

Manager

Katherine

Papademas

007

X

54.56

135

2/3/09

Betty

Davis

005 Y

14.56

80

1/21/10

Katherine Papademas

Joe Smith

003

Z

1/11/20

Frank

Coole

001

Z

13.30

82

3/14/05

Thomas

Crown

143

S

12.40

84

09/25/07

Frank
Coole

Sam

Honan

730

R

11.11

4/5/08

Mary

Nam

006

43.43

46

1/6/11

Diane

Baker

004

R3

44.50

110

1/2/15

Sam
Honan

Your Name

111

15.00

Today’s date

Run the following reports for Oraco Company. Include titles, Today’s date, page number, column headings/formats where applicable on the report. Check the “Designing a Report in Oracle” document in the Lecture Folder to help you with the code.

1>Creating a self join or a subquery (your choice):

Show which employees work for Katherine Papademas and Frank Coole.

2>Creating the bi-weekly Gross Pay payroll report for period ending 04/30/2016:

Show the following calculations on your report:

· Gross Pay per Person-

Note-Gross Pay = (Hourly_Rate * Hours+OT) where OT is for hours over 40 and at 1.5 the normal rate [note: 80 hours is considered regular time for two weeks]

· OT is to be shown as a separate column

Further note that Hourly_Rate column should be understood to have an implied decimal (of two decimal places to the left) of the field value put in for calculation purposes only!!!)

Format the Gross Pay column and OT column as currency style.

Further assume all employees are paid on a “by-weekly” basis, that is every 2 weeks.

3>Creating a Report of New Hires:

Include a report of all new hires (include any dates for the year 2005 and after)

Entitle the Report as “New Hires”

4>Create a report using Dates:

Find employees hired between 1995 January 1, and December 5th, 1999.

5>Create a report on departments:

Show the minimum salary per Department in descending Department order.

6>Create a report on departments:

Show a report that displays employees by Department. Break on the department column. Also display the total gross pay for ALL departments.

7>Create a report using Dates:

Find employees hired the last 900 days

8>Create a report off the payroll table

Show the employees who annual salaries are in the ranges of $20000 to $100,000. If the salary is for a manager display a message in a column stating “Management”.

9> Write the select statement to show the current day of the week given the date you finish the quiz.

10> Create a view for Frank Coole and a view for Katherine Papademas. The view is to contain all data related to people who work for both managers.

4

© Copyright 2021 by P.E.P.

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
4.9
Sitejabber
4.6
Trustpilot
4.8
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.

Order your essay today and save 30% with the discount code ESSAYHELP