Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Database I Lab 3 Due Date: On or Before Thursday February 25, 2021 Objective(s) Target CLO(s) Reference To practice the INSERT , UPDATE , DELETE

Database I

Lab 3

Due Date: On or Before Thursday February 25, 2021

Objective(s)

Target CLO(s)

Reference

To practice the INSERT, UPDATE, DELETE, and SELECT commands of SQL DML.

6

Chapter 6

Instructions:

Log in to Oracle SQL Developer and answer the following questions.

  1. Using SQLs INSERT command, insert a new employee using the following data: (2 points)

Fname=Richard; Minit=K;Lname=Marini;SSN= 653298653;Bdate=12-DEC-63;Address=98 Oak forest, Katy, TX;Sex=M;Salary=37000;Super_ssn=987654321; Dno=1

Hand in the INSERT command and show the updated content of the EMPLOYEE table to ensure that the employee was inserted successfully.

  1. Using SQLs UPDATE command, write a single UPDATE command to decrease the number of hours of all employees who work on project number 1 or project number 10 by 2 hours. (2 points)

Hand in the UPDATE command and show the updated content of the WORKS_ON table to ensure that the update was done successfully.

  1. Use SQLs DELETE command to delete all entries in the WORKS_ON table with Pno=30. (2 points)

Hand in the DELETE command and show the updated content of the WORKS_ON table to ensure that the entries were deleted successfully.

  1. Write an SQL query that uses a LEFT OUTER JOIN to show the first name of the employee and the name of the department he/she manages. (2 points)

Hand in the query command and the output to make sure that, in addition to mangers, non-managers are also listed.

  1. Write an SQL query that uses GROUP BY to show the social security number of the employee and the number of dependents he/she has ordered by the number of dependents in ascending order. That is, the query should produce the following output: (2 points)

SOCIAL_SECURITY_NUMBER NUMBER_OF_DEPENDENTS

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

987654321 1

123456789 3

333445555 3

Hand in the query command and the output to make sure that it produces the above output.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

6. Is all Internet training the same? Explain.

Answered: 1 week ago

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago