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.
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
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.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps