sql CANDYBAR_CONSUMPTION_DATA

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql CANDYBAR_CONSUMPTION_DATA相关的知识,希望对你有一定的参考价值。

CREATE TABLE CANDYBAR_CONSUMPTION_DATA
   (  "SI" NUMBER(*,0), 
  "CONSUMER_ID" NUMBER(*,0), 
  "CANDYBAR_NAME" VARCHAR2(50 BYTE), 
  "SURVEY_YEAR" VARCHAR2(50 BYTE), 
  "GENDER" VARCHAR2(1 BYTE), 
  "OVERALL_RATING" VARCHAR2(2 BYTE), 
  "NUMBER_BARS_CONSUMED" VARCHAR2(50 BYTE)
   ) ;

Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (1,1,'MARS BAR','2009','M','10','252');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (3,1,'MARS BAR','2010','M','10','352');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (4,1,'MARS BAR','2011','M','10','452');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (5,1,'TWIX BAR','2009','M','10','6');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (6,1,'TWIX BAR','2010','M','7','60');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (7,1,'TWIX BAR','2011','M','8','600');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (8,3,'TWIX BAR','2009','M','7','6');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (9,3,'TWIX BAR','2010','M','8','60');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (10,3,'TWIX BAR','2011','M','9','600');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (11,4,'HERSHEY BAR','2009','F','7','20');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (12,4,'HERSHEY BAR','2010','F','7','30');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (13,4,'HERSHEY BAR','2011','F','7','10');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (14,2,'HERSHEY BAR','2009','F','5','2');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (15,2,'HERSHEY BAR','2010','F','5','3');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (16,2,'HERSHEY BAR','2011','F','5','1');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (17,2,'MARS BAR','2009','F','8','25');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (18,2,'MARS BAR','2010','F','8','12');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (19,2,'MARS BAR','2011','F','8','13');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (20,3,'MARS BAR','2009','m','8','25');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (21,3,'MARS BAR','2010','m','7','12');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (22,3,'MARS BAR','2011','M','8','13');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (23,3,'TWIX BAR','2009','M','7','6');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (24,3,'TWIX BAR','2010','M','8','60');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (25,3,'TWIX BAR','2011','M','9','600');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (26,3,'TWIX BAR','2009','F','7','20');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (27,3,'TWIX BAR','2010','F','8','30');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (28,3,'TWIX BAR','2011','F','9','10');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (29,3,'TWIX BAR','2010','M','9','85');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (30,3,'TWIX BAR','2011','M','9','95');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (31,4,'TWIX BAR','2009','F','7','20');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (32,4,'TWIX BAR','2010','F','8','30');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (33,4,'TWIX BAR','2011','F','9','10');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (34,4,'TWIX BAR','2010','M','9','85');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (35,4,'TWIX BAR','2011','M','9','95');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (36,4,'MARS BAR','2009','F','7','25');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (37,4,'MARS BAR','2010','F','7','35');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (38,4,'MARS BAR','2011','F','7','15');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (42,5,'HARSHEY BAR','2009','M','8','15');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (43,5,'HARSHEY BAR','2010','M','8','15');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (44,5,'HARSHEY BAR','2011','M','6','5');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (45,5,'SNICKERS BAR','2009','M','8','55');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (46,5,'SNICKERS BAR','2010','M','8','65');
Insert into CANDYBAR_CONSUMPTION_DATA (SI,CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,OVERALL_RATING,NUMBER_BARS_CONSUMED) values (47,5,'SNICKERS BAR','2011','M','8','75');


commit ;

以上是关于sql CANDYBAR_CONSUMPTION_DATA的主要内容,如果未能解决你的问题,请参考以下文章

sql sql__substring.sql

sql sql__foreign_key.sql

sql sql__repear_table.sql

sql sql__count_distinct.sql

sql sql__get_next.sql

SQL 数据层次结构