Question: Write the SQL that will retrieve the following results: STUID FNAME LNAME ADVISORFNAME ADVISORLNAME 2001 Tanisha Blake Jake Plummer 2003 Jonathan Wu Kelly Christensen 2004

Write the SQL that will retrieve the following results:

STUIDFNAMELNAMEADVISORFNAMEADVISORLNAME
2001TanishaBlakeJakePlummer
2003JonathanWuKellyChristensen
2004AlvinKleinJakePlummer
2005JohnJenkinsMichelleKwon


The STUDENT table is as follows:

STUIDFNAMELNAMEADVISOR_ID
2001TanishaBlake2
2002JessGoldwasserNULL
2003JonathanWu3
2004AlvinKlein2
2005JohnJenkins1

 

The ADVISOR table is as follows:

ADVISOR_IDADVISORFNAMEADVISORLNAME
1MichelleKwon
2JakePlummer
3KellyChristensen
4NickJonas

Step by Step Solution

3.55 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

You can achieve this by using a SQL query that involves joining the STUDENT and ADVISOR tables based on the ADVISORID Heres the SQL query SELECT sSTUID sFNAME sLNAME aADVISORFNAME aADVISORLNAME FROM STUDENT s JOIN ADVISOR a ON sADVISORID aADVISORID This query selects the desired columns from the STUDENT table and joins it with the ADVISOR table ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!