文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>实现查询学生未选课程的sql语句

实现查询学生未选课程的sql语句

时间:2010-08-28  来源:范尼是德鲁伊

表结构

-- ------------------------------ Table structure for class-- ----------------------------CREATE TABLE `class` (  `cname` varchar(30) NOT NULL,  `meets_at` time NOT NULL,  `room` varchar(20) NOT NULL,  `fid` int(11) NOT NULL,  PRIMARY KEY  (`cname`),  KEY `F_fid` (`fid`),  CONSTRAINT `F_fid` FOREIGN KEY (`fid`) REFERENCES `faculty` (`fid`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
-- ------------------------------ Table structure for enrolled-- ----------------------------CREATE TABLE `enrolled` (  `snum` int(11) NOT NULL,  `cname` varchar(30) NOT NULL,  PRIMARY KEY  (`snum`,`cname`),  KEY `F_cname` (`cname`),  CONSTRAINT `F_cname` FOREIGN KEY (`cname`) REFERENCES `class` (`cname`) ON DELETE CASCADE ON UPDATE CASCADE,  CONSTRAINT `F_snum` FOREIGN KEY (`snum`) REFERENCES `student` (`snum`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
-- ------------------------------ Table structure for faculty-- ----------------------------CREATE TABLE `faculty` (  `fid` int(11) NOT NULL,  `fname` varchar(20) NOT NULL,  `deptid` int(11) NOT NULL,  `password` varchar(20) NOT NULL default '123',  PRIMARY KEY  (`fid`)) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
-- ------------------------------ Table structure for student-- ----------------------------CREATE TABLE `student` (  `snum` int(11) NOT NULL,  `sname` varchar(20) NOT NULL,  `major` varchar(20) NOT NULL,  `level` varchar(20) NOT NULL,  `age` int(11) NOT NULL,  `password` varchar(20) NOT NULL default '123',  PRIMARY KEY  (`snum`)) ENGINE=InnoDB DEFAULT CHARSET=gb2312;

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载