Question: Repeat Exercise 10.7, but write a function in SQL/PSM. Exercise 10.7 Consider the database shown in Figure 1.2, whose schema is shown in Figure 2.1.

Repeat Exercise 10.7, but write a function in SQL/PSM.


Exercise 10.7

Consider the database shown in Figure 1.2, whose schema is shown in Figure 2.1. Write a program segment to read a student’s name and print his or her grade point average, assuming that A = 4, B = 3, C = 2, and D = 1 points. Use embedded SQL with C as the host language.


Figure 1.2

STUDENT Name Student_number Class Major COURSE Course_name Course_number Credit_hours Department PREREQUISITE Course_number


Figure 2.1

Prerequisite_number SECTION Section_identifier Course_number Semester Year Instructor GRADE_REPORT Student_number Section_identifier Grade

STUDENT Name Student_number Class Major COURSE Course_name Course_number Credit_hours Department PREREQUISITE Course_number Prerequisite_number SECTION Section_identifier Course_number Semester Year Instructor GRADE_REPORT Student_number Section_identifier Grade

Step by Step Solution

3.25 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

This code uses the MySQL C API to connect to a MySQL database prepare and execute SQL queries and retrieve the results It takes in a students name as ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Fundamentals Of Database Systems Questions!