Show the names of all students, their majors, their advisor names and advisor department names in the following manner. List only students minoring in ITEC.
Provide the MySQL commands for the following queries. Make sure that your
queries produce the exact output as shown (row order can be different).
[3] Show the names of all students, their majors, their advisor names and advisor
department names in the following manner. List only students minoring in ITEC.
+--------+-----------------+------------------------------+-------------+------------------------------+
| stuId | student | major | advisor | advisor department |
+--------+-----------------+------------------------------+-------------+------------------------------+
| 100002 | David Hawk | Computer Science | Mary Tran | Computer Science |
| 100006 | Lillian Johnson | Computer
+--------+-----------------+------------------------------+-------------+------------------------------+
2 rows in set
3.
SELECT is used to display all(*) or specified column/columns
table_name.column_name , it is used to specify that column_name is of table table_name
AS is used for alias , in simple words it is used to change display name of column
INNER JOIN is used to join two table based on common column
WHERE is used to specify condition.
Step by step
Solved in 2 steps with 1 images