simple query question
am 20.10.2005 10:16:34 von How LoonGreetings,
## Table structure for 3 involved tables
CREATE TABLE IF NOT EXISTS `course` (
`Course_Code` smallint unsigned NOT NULL
auto_increment,
`Course_ID` varchar(15) NOT NULL default '',
`Name` varchar(100) default NULL,
PRIMARY KEY (`Course_Code`),
UNIQUE KEY (`Course_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `trainee` (
`Trainee_Code` mediumint unsigned NOT NULL
auto_increment,
`Trainee_ID` varchar(15) NOT NULL default '',
`Name` varchar(50) default NULL,
PRIMARY KEY (`Trainee_Code`),
UNIQUE KEY (`Trainee_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
### As intermediate table to store the course(s) that
joined by particular trainee
CREATE TABLE IF NOT EXISTS `trainee_course` (
`Trainee_Code` mediumint unsigned NOT NULL default
'0',
`Course_Code` smallint unsigned NOT NULL default
'0',
PRIMARY KEY (`Trainee_Code`,`Course_Code`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
#################################################
Question
========
How to I retrieve course info based on Course_Code for
a PARTICULAR trainee based on Trainee_Code, which do
NOT EXIST in trainee_course ?
In order words, how do I get course info for a
PARTICULAR trainee that he or she has NOT joined (NO
need to show joined course info) ?
Thanks and I'm using MySQL v4.1.14 :-)
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org