MySQL上机考试题(习题,答案)

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
-- ----------------------------
-- Records of pro_sal
-- ----------------------------
INSERT INTO `pro_sal` VALUES ('2013-02-06', '0112358', '000061', '120', '5890');
INSERT INTO `pros` VALUES ('0112691', '钢笔', '86.99', '128');
INSERT INTO `pros` VALUES ('0112965', '毛笔', '35.48', '480');
INSERT INTO `pros` VALUES ('0221545', '枕头', '63.68', '520');
INSERT INTO `pro_sal` VALUES ('2013-02-18', '0112690', '037102', '50', '9853');
INSERT INTO `pro_sal` VALUES ('2013-02-04', '0112691', '087412', '15', '1421');
CONSTRAINT `销售商编号` FOREIGN KEY (`销售商编号`) REFERENCES `saler` (`销售商编号`),
CONSTRAINT `产品编号` FOREIGN KEY (`产品编号`) REFERENCES `pros` (`产品编号`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;
`价格` decimal(Baidu Nhomakorabea0,2) NOT NULL,
`库存量` int(11) default NULL,
PRIMARY KEY (`产品编号`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;
-- ----------------------------
-- Records of pros
MySQL上机考试题(答案)
建表详情:
/*
Navicat MySQL Data Transfer
Source Server : root
Source Server Version : 50067
Source Host : localhost:3306
Source Database : product
`产品编号` varchar(20) NOT NULL,
`销售商编号` varchar(20) NOT NULL,
`数量` int(11) NOT NULL,
`销售额` decimal(10,0) NOT NULL,
PRIMARY KEY (`产品编号`,`销售商编号`),
KEY `销售商编号` (`销售商编号`),
-- ----------------------------
INSERT INTO `pros` VALUES ('0001', '风筝', '18.80', '1024');
INSERT INTO `pros` VALUES ('0002', '杯子', '9.90', '800');
INSERT INTO `pros` VALUES ('0003', '帽子', '19.80', '980');
INSERT INTO `pros` VALUES ('0004', '项链', '9868.99', '266');
INSERT INTO `pros` VALUES ('0005', '钻戒', '18999.68', '520');
INSERT INTO `pros` VALUES ('0112358', '洗发露', '20.59', '420');
`销售商名称` varchar(50) NOT NULL,
`地区` varchar(10) NOT NULL COMMENT '销售商所有地',
`负责人` varchar(10) default NULL,
`` varchar(20) default NULL,
INSERT INTO `pros` VALUES ('0112478', '毛巾', '6.50', '210');
INSERT INTO `pros` VALUES ('0112568', '棉被', '200.86', '300');
INSERT INTO `pros` VALUES ('0112690', '墨水', '5.50', '800');
Target Server Type : MYSQL
Target Server Version : 50067
File Encoding : 65001
Date: 2013-02-21 17:22:07
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- ----------------------------
-- Table structure for `saler`
-- ----------------------------
DROP TABLE IF EXISTS `saler`;
CREATE TABLE `saler` (
`销售商编号` varchar(20) NOT NULL,
-- ----------------------------
-- Table structure for `pro_sal`
-- ----------------------------
DROP TABLE IF EXISTS `pro_sal`;
CREATE TABLE `pro_sal` (
`销售日期` date NOT NULL COMMENT '销售产品的日期',
-- Table structure for `pros`
-- ----------------------------
DROP TABLE IF EXISTS `pros`;
CREATE TABLE `pros` (
`产品编号` varchar(20) NOT NULL,
`产品名称` varchar(50) NOT NULL,
相关文档
最新文档