Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Posts
    18

    Unanswered: juniors enrolled in a class taught by I.teach (was "SQL queries....please help...")



    schema:
    student(snum:int,sname:string,major:string,level:s tring,age:int)
    class(name:string,meet_at:time,room:string,fid:int )
    enrolled(snum:int,cname:string)
    faculty(fid:int,fname:string,deptid:int)

    1:find the names of all juniors (level = JR ) who are enrolled in a class taught byb I.teach.

    Sol:select snum,snames from student s , where in (select snum from enrolled e , student s ,faculty f where s.snum = e.snum and s.level = " JR" and c.fid = f.fid and fname = "I.Teach");

    Is this right???

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    is it right? no, it's not, you have at least one syntax error, the comma after the s

    don't you have a system to test on? is this a paper homework assignment?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2006
    Posts
    18

    sql queries...pleease help

    schema:
    student(snum:int,sname:string,major:string,level:s tring,age:int)
    class(name:string,meet_at:time,room:string,fid:int )
    enrolled(snum:int,cname:string)
    faculty(fid:int,fname:string,deptid:int)


    2:Find the age of the oldest student who is either HISTORY MAJOR OR IS ENROLLED IN A COURSE TAUGHT BY I.tEACH.

    Sol : select s.age from student s where s.age > = ALL (select s.age from student s1 ,enrolled e , faculty f where s.major = “ history” or f.fid = c.fid and e.cname = “ I.Teach”);

  4. #4
    Join Date
    Feb 2006
    Posts
    18

    hi

    NOOOOOOO this is not an class assignment ...i am preparing for the finals...and I NEED HELP!!!!!!!!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •