[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Query Question


I have a query question I can't figure out on my own. Any help is
appreciated...

I have three tables:

create table courses (
    rec_num int(5) not null default '0' auto_increment,
    name varchar(255),
    description varchar(255),
    class_time varchar(255),
    professor_id int(5),
    units float(4,2),
    location varchar(255),
    quarter varchar(255),
    department_id int (5),
    primary key (rec_num)
);

create table enroll_course (
    rec_num int(5) not null default '0' auto_increment,
    course_id int(5),
    student_id int(5),
    grade varchar(10),
    primary key(rec_num)
);

create table course_prereq (
    rec_num int(5) not null default '0' auto_increment,
    source_course_id int(5),
    pre_req_course_id int(5),
    primary key (rec_num)
);

Basically I want a query that looks at courses, sees if there are any
pre-reqs, if so, checks enroll_course to see if they've been met, and if
not, return a list of the courses that have not been met.

Is this even possible with one query?

Hunter


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread68934@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



This mailing list archive is a service of Copilot Consulting.