Question- For this problem create a table called instructor_course_nums within the university database schema. Write a procedure that accepts an instructor ID as input. The procedure calculates the total number of course sections taught by that instructor, and adds a tuple to the instructor_course_nums table consisting of the instructors ID number, name, and total courses taught - call these attributes: ID, name, and tot_courses. If the instructor already has an entry in the table, then the procedure makes sure the total number of courses taught in the instructor_course_nums table is up-to-date. You must name your procedure: __insCourseNumsProc Where is your last name and is the day of the month you were born. Below is an example of how I named my procedure: Morabito_05__insCourseNumsProc FYI data needs to use while writing procedure from instructor and teaches table that i am providing just for info. no need to create the instructor, teaches table . that is already present in my database. instructor table data: id character varying(5), name character varying(20) , dept_name character varying(20) , salary numeric(8,2) teaches table data attributes : id character varying(5), course_id character varying(8), sec_id character varying(8), semester character varying(6), year numeric(4) i know how to create table need t instructor_course_nums with attribute as per given in question. these are call these attributes: ID, name, and tot_courses , i want procedure.

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter2: Database Design Fundamentals
Section: Chapter Questions
Problem 3TD
icon
Related questions
Question

i need to write procedure for below  question. i asked same question and they gave ddl for schema that is not asked in question.

i am clearing again i want to write procedure in Plpgsql language not in mysql or other language. provide solution that has procedure and language must be plpgsql.

 

Question- For this problem create a table called instructor_course_nums within the university database schema. Write a procedure that accepts an instructor ID as input. The procedure calculates the total number of course sections taught by that instructor, and adds a tuple to the instructor_course_nums table consisting of the instructors ID number, name, and total courses taught - call these attributes: ID, name, and tot_courses. If the instructor already has an entry in the table, then the procedure makes sure the total number of courses taught in the instructor_course_nums table is up-to-date.

You must name your procedure: __insCourseNumsProc Where is your last name and is the day of the month you were born. Below is an example of how I named my procedure: Morabito_05__insCourseNumsProc

FYI data needs to use while writing procedure from instructor and teaches table  that i am providing just for info. no need to create the instructor, teaches table . that is already present in my database.

instructor table data:  id character varying(5), name character varying(20) , dept_name character varying(20) ,                                              salary numeric(8,2)

teaches table data attributes :  id  character varying(5), course_id character varying(8), sec_id character varying(8), semester character varying(6), year numeric(4) 

i know how to create table need t instructor_course_nums with attribute as per given in question. these are call these attributes: ID, name, and tot_courses , i want procedure.

NOTE: language must be PLPGSQL and able to run in pgadmin. 

i checked earlier answers from this site but those won't work. FYI

please explain answer as well so i can understand.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
SQL Query
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning