Note that there are some explanatory texts on larger screens.

plurals
  1. POmulti select statement inside a stored procedure mysql
    primarykey
    data
    text
    <p>i got these tables in my dbpre_exer5;//mysql wampserver2.2</p> <pre><code>+-----------------------+ | Tables_in_dbpre_exer5 | +-----------------------+ | tblcourse | | tblcutoff | | tblgrades | | tblstud | | tblsub | +-----------------------+ </code></pre> <p>now, i just want to ask how will i be able to get these outputs considering the usage of stored procedure. the output is:</p> <pre><code>+---------+----------------+---------------+-------+ | Gender | With Failure | W/out Failure | Total | +---------+----------------+---------------+-------+ | Male | 1 | 1 | 2 | | Female | 2 | 1 | 3 | +---------+----------------+---------------+-------+ </code></pre> <p>by the way here is the <code>enter code here</code>; **</p> <pre><code>mysql&gt; select * from tblcourse; +-----------+------------------------+ | course_id | course_name | +-----------+------------------------+ | 1 | Information Technology | | 2 | Computer Science | +-----------+------------------------+ 2 rows in set (0.00 sec) mysql&gt; select * from tblgrades; +---------+--------+-------+ | stud_id | sub_id | grade | +---------+--------+-------+ | 1 | 1 | 80 | | 1 | 2 | 78 | | 2 | 2 | 75 | | 2 | 3 | 84 | | 3 | 1 | 81 | | 3 | 3 | 90 | | 4 | 1 | 74 | | 4 | 2 | 77 | | 5 | 2 | 76 | | 5 | 3 | 81 | +---------+--------+-------+ 10 rows in set (0.00 sec) mysql&gt; select * from tblcourse; +-----------+------------------------+ | course_id | course_name | +-----------+------------------------+ | 1 | Information Technology | | 2 | Computer Science | +-----------+------------------------+ 2 rows in set (0.00 sec) mysql&gt; select * from tblcutoff; +-----------+ | passgrade | +-----------+ | 78 | +-----------+ 1 row in set (0.00 sec) mysql&gt; select * from tblgrades; +---------+--------+-------+ | stud_id | sub_id | grade | +---------+--------+-------+ | 1 | 1 | 80 | | 1 | 2 | 78 | | 2 | 2 | 75 | | 2 | 3 | 84 | | 3 | 1 | 81 | | 3 | 3 | 90 | | 4 | 1 | 74 | | 4 | 2 | 77 | | 5 | 2 | 76 | | 5 | 3 | 81 | +---------+--------+-------+ 10 rows in set (0.00 sec) mysql&gt; select * from tblstud; +---------+-------------------+--------+-----------+ | stud_id | stud_name | gender | course_id | +---------+-------------------+--------+-----------+ | 1 | Angelina Jolie | F | 1 | | 2 | Jennifer Garner | F | 1 | | 3 | Liam Neeson | M | 2 | | 4 | Paul Walker | M | 2 | | 5 | Jennifer Lawrence | F | 2 | +---------+-------------------+--------+-----------+ 5 rows in set (0.00 sec) mysql&gt; select * from tblsub; +--------+------------+ | sub_id | sub_name | +--------+------------+ | 1 | Math 1 | | 2 | English 1 | | 3 | Filipino 1 | +--------+------------+ 3 rows in set (0.00 sec) mysql&gt; </code></pre> <p>**</p> <p>my first problem is having the results "Male" and "Female" under gender.. any help? thanks a lot.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload