Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
The course I'm taking is
I need help with part A and B please. I am using APEX Oracle compiler.
I have attached the employee table.
Part A - Implement a procedure in PL/SQL to check if employee is eligible to a salary
increment depending on his period of service. If he had served for 6 months or
more he is eligible for an increment. Use an if-else statement and print if he is
eligible for increment or not .
Hint: add_months(hiredate, 6) function will give you the date after 6 months of
hiredate.
sysdate is used in oracle instead of the curdate() function in SQL to get the current
date.
Part B - Write a procedure to add 2 numbers and display the result
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 4 steps
Knowledge Booster
Similar questions
- Write a program that queries the world database to determine in which country the residents have the greatest life expectancy. Research how to accomplish a JOIN on two tables. Then write a program that queries the world database to list the population of the capitol city for any country in Asia.arrow_forward1) Assume the EMPLOYEE table has the following rowsID DEPT SALARY NAME100 SALES 40000 Smith101 RD 38000 Terry102 HR 60000 David103 SALES 58000 Ellie104 RD 70000 Judya) Provide the complete PL/SQL code to implement a Virtual Private Database suchthat an employee could only view the records for employees in the samedepartment while masking coworkers’ salary with NULL.b) Based on the Virtual Private Database you implemented in step a), would anemployee be able to insert, update or delete a record for another employee whoworks in another department? If yes, what might be the potential security risk andhow would you fix the problem by setting up the VPD appropriately?arrow_forwardRefer to the film and inventory tables of the Sakila database. The tables in this lab have the same columns and data types but fewer rows. Write a query that lists the titles of films with the fewest rows in the inventory table. This query requires a subquery that computes the minimum of counts by film_id: SELECT MIN(count_film_id) FROM ( SELECT COUNT(film_id) AS count_film_id FROM inventory GROUP BY film_id ) AS temp_table; This subquery is provided in the template.arrow_forward
- Third normal form says: a. No nonkey columns depend on another nonkey column. b. Every column that's not part of the primary key is fully dependent on the primary key. c. Eliminate repeated fields. d. None of the above.arrow_forwardDevelop a PL/SQL block that would go through all the employees from EMPLOYEES table who work in department id= 90 (there is suppose to be 3 employee who work in Department 90)- IN BEGIN END END SECTION; Execute 3 separate of SELECT statement one after the other. Each SELECT will pull first name. salary of each employee and store them in local variables.+ SELECT LOAD INTO v_firstname1, v_salarxlWHERE emrlexee.id=100 Then second WHERE emploxee.id3101+ SELECT first_name, salary INTO v_firstname2, v_salary2 Then third + SELECTSELECTI tirst.name, salary INTO v_firstname3, v_salary3 iin WHERE emploxee id=102 ..... You must now have 6 local variables. DECLARE all of them accordingly in DECLARE section and use them in BEGIN and END.+ Then add another SELECT statement in BEGIN-END to find company average salary SELECT xa(salary) INTO aKasal FROM EMPLOYEES; !!! Do not forget to create y avgsal local variable in DECLARE section.arrow_forwardLet's wa(k through a review of basic SQL syntax, using as an example the database that was mentionedearlier. This database has the following simple structure(* indicates a primary key):Courses: CourseID*, CourseName, TeacherIDTeachers: TeacherID*, TeacherNameStudents; StudentID*, StudentNameStudentCourses: CourseID*, StudentID*Using the above table, implement the following queries.Query 1: Student Enrollment Query 2: Teacher Class Sizearrow_forward
- In Oracle database, if we have any field such as Job_Title field in any of our table then we can use DECODE function to sort the result based on our own numerical value. This can be done by including the following in ORDER BY clause: 1: ORDER BY DECODE(job-title,'Manager',3,Assistant',2,'Sales Rep', 1) DESC II: ORDER BY DECODE(job-title,'Manager', 3,'Assistant',2, Sales Rep', 1) ASC III I and II are correct IV I and II are incorrect ||| IV || 1arrow_forwardMy other instruction for SQL says: Create and test a stored procedure called checkin_transaction that processes a “checkin” transaction. When a book is checked in, the corresponding CHECKOUT record is updated to show the date it was checked in, and the Pat_ID attribute in the BOOK table is updated to NULL. The entire transaction (starting with START TRANSACTION; and ending with COMMIT;) should be in between the BEGIN and END statements of the stored procedure. You should be able to call the procedure with a statement like this, passing the values of the Book_Num, Pat_ID, and Check_In_Date to the procedure: CALL checkin_transaction(5243, 1170, ‘2017-04-30’) Do you guys know how?arrow_forwardThis is for SQL Give me a list of all of our vendors (by their name) and, if they have an invoice, give me the total number of invoices we have from them and the invoice date of their first invoice. The invoice date results should be provided in a way that shows the date only in the following format: mm/dd/yyyy (e.g. 10/04/2021)arrow_forward
- A simple Oracle function may determine the number of years since your birth by comparing today's date with your birthday.arrow_forwardI NEED HELP WITH THIS QUESTION FOR MY DATABASE MANAGEMENT CLASS FOR SQL DEVELOPER 5. Now compute Average GPA in each class. Display class_code, Class_GPA. Assume all courses are 3 credit courses. A general formula for GPA would be sum(gradepoints x Hrs)/sum(Hrs). Here you can just take an average of gradepoints as the credit hours are same for all courses.arrow_forwardHello! I was given those tables(no data) and I am supossed to write sql code for the following. But I looks like I have a syntax error or there is something I have wrote wrong. (see images) (1) Create a trigger “insert_inventory” on table “Inventory”. The trigger is fired after a row is inserted in table “Inventory”. After a row is inserted in table “inventory”, the “itemid”, the insertion time, and the action is inserted in table “Inventory_history”. The action is set to ‘add an item’. The oldprice is set to null. Test your trigger by inserting a row into Inventory and displaying the contents of Inventory_history. (3) Create a trigger “change_price” on table “Inventory”. The trigger is fired before a change is made to the “Inventory” table. Before the price of an item is changed, the “itemid”, the item’s old price, the action, and the time of change are inserted into the table “Inventory_history”. The action is set to “price change”. Test your trigger by updating a row in Inventory…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY