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. 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’. Create a procedure to calculate average GPA for the four terms and print the average GPA using MyDetails table. 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. Create a procedure that takes the four term GPA values and calculate the maximum of them and print the result.   : You should not 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.

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter8: Working With Advanced Functions
Section: Chapter Questions
Problem 2.7CP
icon
Related questions
Question

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 should not 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.
Expert Solution
steps

Step by step

Solved in 7 steps with 6 images

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
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning