GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  General  >  Interests

 Print  |  
Question:  Given two tables Student(SID, Name, Course) and Level(SID, level) write the SQL statement to get the name and SID of the student who are taking course = 3 and at freshman level?

Answer: SELECT Student.name, Student.SID
FROM Student, Level
WHERE Student.SID = Level.SID
AND Level.Level = "freshman"
AND Student.Course = 3;


December 12, 2005 14:57:29 #1
 Behnam   Member Since: Visitor    Total Comments: N/A 

RE: Given two tables Student(SID, Name, Course) and Le...
 

select Name,SID from student

where Course=3 and SID in ( select SID from Level where Level='freshman' )

     

 

Back To Question