Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PL/SQL For each question, you must use a cursor, a while loop and an if-then-else. 1. Create an anonymous block that will count the number

PL/SQL

For each question, you must use a cursor, a while loop and an if-then-else.

1. Create an anonymous block that will count the number of students whose gr_t1 grade is higher than the average on gr_t1 and display that number.

2. Create an anonymous block that will give display the name of student if the average of his gr_t1 and gr_t2 is greater than the average of his gr_hw and gr_pr.

3. Create an anonymous block that will give display the name of student of the female students.

image text in transcribed

SQL Plus SQL> select from grade; STD CODE STD FNAME STD_LNAME GR T1 GR T2 GR HW GR PR GR AVG GR LG S01 S02 S03 Michael Charles Magic Serena Jordan Barkley Johnson Williams Duncan Graff Navratilova Federer Williams Laver 87 B 80 B 95 A 92 A 93 A 80 B 91 A 91 A 88 B 100 A 100 100 S05 S06 S07 S08 S09 S10 1m Steffi Martina Roger Venus Rod 84 84 100 100 100 100 10 rows selected. SQL> select from student; STD CODE STD FNAME STD LNAME STD GEND MAJ CODE STD DOB S01 S02 S03 Michael Charles Jordan Barkley Johnson Williams Duncan Graff Navratilova Federer Williams Laver FINC ACCT ISAM ISAM CSCI ACCT ISAM HIST CSCI 10-MAR-62 12-SEP-64 13-SEP-60 23-OCT-80 07-AUG-72 30-APR-62 18-DEC-72 18-AUG-82 11-JUN-80 18-DEC-42 Serena S05 Steffi Martina Roger Venus S07 S08 S10 10 rows selected

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Dunlop Limited has identified new machine

Answered: 1 week ago