A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 8, Problem 7CAT
Program Plan Intro
Stored procedures:
- When user expect to running a particular query often, user can expand total performance by saving the query in a file called a stored procedure.
- The stored procedure is located on the server.
- The DBMS compiles the stored procedure and creates an execution plan, which is the well-organized method of finding the results.
- It is a procedure which contains collection of procedural and SQL statements.
Syntax for stored procedure:
CREATE FUNCTION fun_name(argument IN data-type)RETRUN data-type[IS]
BEGIN
PL/SQL statements;
Return (value or expression);
END;
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
This question should be answered in PL/SQL only!
Create a procedure that takes instructor_ID as a parameter. Name it INSTR_SECTIONS. The procedure displays instructor first and last names, and also a list of sections that the instructor is scheduled to teach. Only one instructor per procedure call. You give/pass to a procedure instructor_ID as a parameter, the procedure prints INFO related only to that instructor.
By using this table answer this question in SQL :
Write a SQL query, which shows a list of all employees last name, their department names and their department city where that department is located from the employees table. If an employee does not belong to a department, then their department number and department name should show as “N/A” and their department city should show up as “No City info Found”. MAKE SURE you have all the employees displayed including the employees who do not have a department.
Find the service ID and property ID for each service request whose estimated hours is greater than the number of estimated hours of any service request with category number 5.
in sql in cengage
Chapter 8 Solutions
A Guide to SQL
Ch. 8 - Prob. 1RQCh. 8 - Prob. 2RQCh. 8 - Prob. 3RQCh. 8 - Prob. 4RQCh. 8 - Prob. 5RQCh. 8 - Prob. 6RQCh. 8 - Prob. 7RQCh. 8 - Prob. 8RQCh. 8 - Prob. 9RQCh. 8 - In PL/SQL, how do you assign variables the same...
Ch. 8 - Prob. 11RQCh. 8 - Prob. 12RQCh. 8 - Prob. 13RQCh. 8 - Prob. 14RQCh. 8 - Prob. 15RQCh. 8 - Prob. 16RQCh. 8 - Prob. 17RQCh. 8 - Prob. 18RQCh. 8 - Prob. 19RQCh. 8 - Prob. 20RQCh. 8 - Prob. 21RQCh. 8 - Prob. 22RQCh. 8 - Prob. 1TDCh. 8 - Prob. 2TDCh. 8 - Prob. 3TDCh. 8 - Prob. 4TDCh. 8 - Prob. 5TDCh. 8 - Prob. 6TDCh. 8 - Prob. 7TDCh. 8 - Prob. 8TDCh. 8 - Prob. 9TDCh. 8 - Prob. 10TDCh. 8 - Prob. 1CATCh. 8 - Prob. 2CATCh. 8 - Prob. 3CATCh. 8 - Prob. 4CATCh. 8 - Prob. 5CATCh. 8 - Prob. 6CATCh. 8 - Prob. 7CATCh. 8 - Prob. 9CATCh. 8 - Prob. 1SCGCh. 8 - Prob. 2SCGCh. 8 - Prob. 3SCGCh. 8 - Prob. 4SCGCh. 8 - Prob. 5SCGCh. 8 - Prob. 6SCGCh. 8 - Prob. 7SCGCh. 8 - SQL includes many numerical functions. Two of...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- in pl/sql ,use Cursor to get all the records from table job_history for employee_id 121arrow_forwardWhat use cases are best suited for the CROSS APPLY function in SQL?arrow_forwardInclude both SQL commands and SQL results in your answers: KimTay Pet Supplies is running a promotion that is valid for up to 20 days after an order is placed. List the invoice number, customer ID, customer first and last names, and the promotion date for each invoice. The promotion date is 20 days after the invoice was placed. Write PL/SQL (or MySQL) procedures to accomplish the following task: The procedure accepts the ID of a customer stored in the input variable named I_CUST_ID and displays the name (first name concatenated with last name) and credit limit of for this customer.arrow_forward
- How does the COALESCE function compare with the ISNULL function when handling NULL values in SQL?arrow_forwardWrite the following inserts, deletes, or updates in SQL, using the universityschema. Insert every student whose tot cred attribute is greater than 100 as an instructor in the same department, with a salary of $10,000.arrow_forwardCreate a procedure in PL/SQL takes Department Id and return record data type has maximum salary, minimum salary, and average salaries of the employees in this department. Call this procedure from PL/SQL block by input the department id from the end user.arrow_forward
- What is the use of the GROUP BY clause in SQL?arrow_forwardWrite a stored procedure in MySQL, PL/SQL, or T-SQL that changes the price of an item with a given item ID. How would you use this stored procedure to change the price of item AD72 to $84.99?arrow_forwardPlease help with pl/sql block!arrow_forward
- how to delete department id in pl/sql from department id - 60 otherwise raise an exceptionarrow_forwardPlease help with a setup in PL/SQLarrow_forwardWrite the following queries in SQL: Display the list of all course sections offered in Spring 2018, along with the ID and name of each instructor teaching the section. If a section has more than one instructor, that section should appear as many times in the result as it has instructors. If a section does not have any instructor, it should still appear in the result with the instructor name set to “—”.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr