Mysql 存储结构求助 200分赠送

RobertC 2013-06-24 04:42:51


数据库描述:
数据库名:hitproperty
表名:propertytable
主键:configdate,confighour,configminute,configsecond 确定唯一的一条记录
注意:configdate,confighour 可以唯一确定某个人的某次访问,一次访问可以有多条记录,即record

表属性描述:configvisIdHigh----表示某个人,不同的configvisIdHigh代表不同的人
products ----表示某人购买了商品
events ----表示事件列表,可以理解为许多事件的整合


问题描述:编写一个存储结构,返回访问次数(即不同的(configdate,confighour)数目),条件是访问中购买了商品,而且事件列表中出现200这个事件的记录数大于15个。

下面是表结构,可以复制粘贴保存成.sql文件直接导入Mysql数据库。坐等大神,如果成功,200分赠送。

我如果没说明白,QQ251867499


SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for `propertytable`
-- ----------------------------
DROP TABLE IF EXISTS `propertytable`;
CREATE TABLE `propertytable` (
`configdate` char(16) NOT NULL,
`confighour` char(8) NOT NULL,
`configminute` char(8) NOT NULL,
`configsecond` char(8) NOT NULL,
`configvisIdHigh` char(16) NOT NULL,
`configvisIdLow` char(16) NOT NULL,
`prop1` char(16) NOT NULL,
`prop2` char(16) NOT NULL,
`prop3` char(16) NOT NULL,
`prop4` char(16) NOT NULL,
`prop5` char(16) NOT NULL,
`prop6` char(24) NOT NULL,
`prop7` char(24) NOT NULL,
`prop8` char(24) NOT NULL,
`products` char(40) NOT NULL,
`events` char(192) NOT NULL,
PRIMARY KEY (`configdate`,`confighour`,`configminute`,`configsecond`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of propertytable
-- ----------------------------
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '02', '10', '123', '321', 'NULL', 'ItemX', 'Unregistered', '0 to 10', 'NULL', 'Home page', 'A-Z', 'Basic Necessities', 'Men;Tommy shoes;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203,204,205,206,207,208,209,210,211,212,213');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '03', '10', '123', '321', 'red hat', 'NULL', 'NULL', '0 to 10', 'Sports', 'Error Page', 'Price Low to High', 'One of a Kinds', '', '2,10,11,12,13,14,20,200,201');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '04', '10', '123', '321', 'yellow hat', 'ItemY', 'NULL', '20 to 30', 'Sports', 'Registry page', 'NULL', 'One of a Kinds', 'Women;Accessories;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '05', '10', '123', '321', 'yellow hat', 'ItemQ', 'Unregistered', '20 to 30', 'Formal', 'NULL', 'A-Z', 'NULL', '', '2,10,11,12,13,14,20,200,201,202,203,204,205,206,207');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '06', '10', '123', '321', 'NULL', 'ItemP', 'Unregistered', '0 to 10', 'Lesiure', 'NULL', 'Price Low to High', 'Get the Look', 'Men;Tommy shoes;1;1.00', '1,2');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '07', '10', '123', '321', 'red hat', 'ItemY', 'Unregistered', 'NULL', 'NULL', 'Registry page', 'Price Low to High', 'Basic Necessities', '', '2,10,11,12,13,14,20,200,201,202');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '08', '10', '123', '321', 'yellow hat', 'ItemQ', 'Unregistered', '30 to 40', 'NULL', 'NULL', 'Price Low to High', 'Get the Look', 'Young;Sweater;1;1.00', '1,2,10,11,12,13');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '09', '10', '123', '321', 'red hat', 'NULL', 'Registered', '0 to 10', 'Sports', 'Order Completion', 'A-Z', 'NULL', '', '2,10,11,12,13,14,20,200,201,202');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '10', '10', '123', '321', 'red hat', 'NULL', 'Unregistered', '0 to 10', 'Formal', 'Registry page', 'NULL', 'Runway Highlights', 'Children;toys;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '11', '10', '123', '321', 'yellow hat', 'ItemQ', 'Unregistered', '10 to 20', 'NULL', 'Error Page', 'NULL', 'Runway Highlights', '', '2');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '12', '10', '123', '321', 'white hat', 'ItemX', 'Unregistered', '10 to 20', 'NULL', 'Home page', 'A-Z', 'NULL', 'Men;Tommy shoes;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '13', '10', '123', '321', 'red hat', 'NULL', 'Registered', '0 to 10', 'Sports', 'Registry page', 'Relevance', 'NULL', '', '2,10,11,12,13,14,20,200,201,202,203,204,205,206,207,208,209');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '14', '10', '123', '321', 'NULL', 'ItemX', 'Registered', '30 to 40', 'Sports', 'Home page', 'A-Z', 'NULL', 'Men;Tommy shoes;1;1.00', '1,2,10,11');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '15', '10', '123', '321', 'blue hat', 'ItemQ', 'NULL', '30 to 40', 'Formal', 'NULL', 'Price Low to High', 'One of a Kinds', '', '2,10,11,12,13,14,20,200,201,202,203,204,205,206,207');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '16', '10', '123', '321', 'yellow hat', 'ItemY', 'NULL', '10 to 20', 'NULL', 'Home page', 'Popularity', 'Runway Highlights', 'Men;T-shirt;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203,204,205');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '17', '10', '123', '321', 'blue hat', 'NULL', 'Registered', '10 to 20', 'Cross', 'Order Completion', 'A-Z', 'NULL', '', '2,10,11,12,13,14,20,200,201,202,203,204,205');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '18', '10', '123', '321', 'NULL', 'ItemQ', 'Registered', '30 to 40', 'Sports', 'Registry page', 'NULL', 'One of a Kinds', 'Jewelry;Ring;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203,204,205,206,207,208');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '19', '10', '123', '321', 'blue hat', 'ItemY', 'NULL', '20 to 30', 'Lesiure', 'NULL', 'A-Z', 'One of a Kinds', '', '2,10');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '20', '10', '123', '321', 'blue hat', 'NULL', 'Unregistered', '20 to 30', 'Lesiure', 'Home page', 'NULL', 'One of a Kinds', 'Men;T-shirt;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203,204,205,206,207,208,209');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '21', '10', '123', '321', 'yellow hat', 'ItemP', 'NULL', '30 to 40', 'NULL', 'Order Completion', 'Price Low to High', 'One of a Kinds', '', '2,10,11,12,13,14,20,200,201,202,203,204,205,206');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '22', '10', '123', '321', 'blue hat', 'NULL', 'Registered', 'NULL', 'Cross', 'Error Page', 'Price Low to High', 'One of a Kinds', 'Men;T-shirt;1;1.00', '1,2,10,11');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '23', '10', '123', '321', 'NULL', 'ItemQ', 'Unregistered', '10 to 20', 'Cross', 'Registry page', 'NULL', 'Runway Highlights', '', '2,10,11,12,13,14');
INSERT INTO `propertytable` VALUES ('21/4/2013', '05', '24', '10', '123', '321', 'yellow hat', 'NULL', 'NULL', '20 to 30', 'Lesiure', 'Order Completion', 'A-Z', 'Runway Highlights', 'Men;T-shirt;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203');
INSERT INTO `propertytable` VALUES ('21/4/2013', '06', '00', '10', '123', '321', 'blue hat', 'NULL', 'Unregistered', '0 to 10', 'Cross', 'Home page', 'NULL', 'Basic Necessities', '', '2,10,11');
INSERT INTO `propertytable` VALUES ('21/4/2013', '06', '01', '10', '123', '321', 'white hat', 'ItemX', 'Registered', '30 to 40', 'Lesiure', 'NULL', 'NULL', 'One of a Kinds', 'Children;toys;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219');
INSERT INTO `propertytable` VALUES ('21/4/2013', '06', '02', '10', '123', '321', 'white hat', 'ItemY', 'Registered', 'NULL', 'Lesiure', 'Registry page', 'A-Z', 'NULL', '', '2,10,11,12,13,14,20,200,201,202,203');
INSERT INTO `propertytable` VALUES ('21/4/2013', '06', '03', '10', '123', '321', 'red hat', 'ItemQ', 'Registered', 'NULL', 'Lesiure', 'Error Page', 'NULL', 'Get the Look', 'Jewelry;Ring;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203,204,205,206,207,208,209,210,211');
INSERT INTO `propertytable` VALUES ('21/4/2013', '06', '04', '10', '123', '321', 'white hat', 'NULL', 'Registered', 'NULL', 'Cross', 'Error Page', 'A-Z', 'One of a Kinds', '', '2,10,11,12,13,14,20,200,201');
INSERT INTO `propertytable` VALUES ('21/4/2013', '06', '05', '10', '123', '321', 'red hat', 'ItemY', 'NULL', 'NULL', 'Sports', 'Error Page', 'Popularity', 'One of a Kinds', 'Young;Sweater;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203');
INSERT INTO `propertytable` VALUES ('21/4/2013', '06', '06', '10', '123', '321', 'white hat', 'NULL', 'NULL', '20 to 30', 'Cross', 'Home page', 'Popularity', 'One of a Kinds', '', '2,10,11,12,13,14,20,200,201,202,203,204,205,206,207,208');
INSERT INTO `propertytable` VALUES ('21/4/2013', '06', '07', '10', '123', '321', 'NULL', 'ItemQ', 'Unregistered', 'NULL', 'Formal', 'Registry page', 'Relevance', 'Get the Look', 'Men;Tommy shoes;1;1.00', '1,2');
INSERT INTO `propertytable` VALUES ('21/4/2013', '06', '08', '10', '123', '321', 'NULL', 'ItemX', 'Unregistered', '20 to 30', 'NULL', 'Registry page', 'A-Z', 'Runway Highlights', '', '2');
INSERT INTO `propertytable` VALUES ('21/4/2013', '06', '09', '10', '123', '321', 'NULL', 'ItemQ', 'Registered', '30 to 40', 'NULL', 'Order Completion', 'Popularity', 'One of a Kinds', 'Women;Accessories;1;1.00', '1,2,10,11,12,13,14,20,200,201,202,203');




...全文
150 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
WWWWA 2013-06-26
  • 打赏
  • 举报
回复
引用 6 楼 WWWWA 的回复:
用你上传数据,要求结果是什么
贴出具体要求结果,以便测试
RobertC 2013-06-26
  • 打赏
  • 举报
回复
坐等大神啊
RobertC 2013-06-24
  • 打赏
  • 举报
回复
引用 8 楼 WWWWA 的回复:
要求结果贴出来,以便测试
存储过程中有个参数传出来,这个参数的值就是访问次数。
WWWWA 2013-06-24
  • 打赏
  • 举报
回复
要求结果贴出来,以便测试
RobertC 2013-06-24
  • 打赏
  • 举报
回复
引用 6 楼 WWWWA 的回复:
用你上传数据,要求结果是什么
返回符合条件的访问次数
WWWWA 2013-06-24
  • 打赏
  • 举报
回复
用你上传数据,要求结果是什么
RobertC 2013-06-24
  • 打赏
  • 举报
回复
引用 2 楼 WWWWA 的回复:
用你上述数据,要求结果是什么
返回访问(注意一次访问的定义,不是一条record,而是由configdate,confighour确定)次数(即不同的(configdate,confighour)数目),条件是访问中购买了商品,而且事件列表中出现200这个事件的记录数大于15个。
RobertC 2013-06-24
  • 打赏
  • 举报
回复
引用 3 楼 WWWWA 的回复:
你可以把SQL文件 上传到www.access911.net/csdn ,用WINRAR压缩 条件是访问中购买了商品,而且事件列表中出现200这个事件的记录数大于15个。 购买了商品:什么标准? 事件列表中出现200:1条记录算1次?
文件以上传,文件名是propertytable1.rar,只要在一次访问(注意一次访问的定义,不是一条record,而是由configdate,confighour确定)中有products不等于空的record就行。 每条record中的事件列表值只用包含200就算一次。可以Q聊
WWWWA 2013-06-24
  • 打赏
  • 举报
回复
你可以把SQL文件 上传到www.access911.net/csdn ,用WINRAR压缩 条件是访问中购买了商品,而且事件列表中出现200这个事件的记录数大于15个。 购买了商品:什么标准? 事件列表中出现200:1条记录算1次?
WWWWA 2013-06-24
  • 打赏
  • 举报
回复
用你上述数据,要求结果是什么
RobertC 2013-06-24
  • 打赏
  • 举报
回复
由于论坛数据大小限制,最好Q我,我会提供更多的数据

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧