Create a table in SQL developer and name it as ‘MyCrush’. The table should consists of only three attributes as follows: Crush_ID which will be the primary key with the number length of .Crush_Name...


Create a table in SQL developer and name it as ‘MyCrush’. The table should consists of only three attributes as follows:Crush_ID which will be the primary key with the number length of .Crush_Name with the maximum character length of 30.Crush_Description with the maximum character length of 10.Insert exactly three records with the above given attributes. Crush_ID values should be 1, 2 and 3 for the three records. Crush_Description should be ‘Present’ for record 1, ‘Past’ for record 2 and ‘Childhood’ for record 3. If you don’t have any crush from your childhood to present, you can insert some random names. Hmm.. Seems Interesting!! It’s time to implement your programming skills using PL/SQL stored procedures and functions. Create another table called ‘MyDetails’ and should contain exactly four attributes as below:Student_ID,Student_Name ,Student_Term ,Student_GPA If you are not a Master’s student, let’s assume you are a student pursuing masters and taking four semesters or terms. Insert exactly four records into the MyDetails table. The four records should be with your SID and your name but Student_Term should be 1, 2, 3 and 4 for the four records. Student_GPA will be some random values ranging from 1.0-4.0. Make sure that the Student_GPA values require two numbers after the decimal point. The key to this table will be a composite key made up of Student_ID and Student_Term.Note: Your student Id and name will remain same for all four records.



  1. Create a procedure to get your crush name. You should get the Crush_Description from the user during run time which will be either ‘Present’, ‘Past’ or ‘Childhood’. Then use the case statement (Switch) and display your crush name based on the Crush_Description. If the value doesn’t match with the Crush_Description then user should display ‘I don’t have crush on anyone’.

  2. Create a procedure to calculate average GPA for the four terms and print the average GPA using MyDetails table.

  3. Create a function to calculate average GPA and also create a new procedure to print the average GPA by calling the existing function from the procedure.

  4. Create a procedure that takes the four term GPA values and calculate the maximum of them and print the result.: You shouldnot use built-in functions like ‘max’. Instead, calculate the maximum GPA manually. You may assume that exactly 4 records exist in the table. Also, you could use ‘IN’ and ‘OUT’ modes. You could also use more than one procedure or function.

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here