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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education