blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
133
path
stringlengths
3
276
src_encoding
stringclasses
33 values
length_bytes
int64
23
9.61M
score
float64
2.52
5.28
int_score
int64
3
5
detected_licenses
listlengths
0
44
license_type
stringclasses
2 values
text
stringlengths
23
9.43M
download_success
bool
1 class
c1adee1c99c0d04a08c1e0d653b7a2f492f21d56
SQL
weibanggang/schoolsystem
/学校管理系统/学校系统数据录入.sql
GB18030
43,823
2.609375
3
[]
no_license
--1¥ insert into Dormitory values('ܽ԰',200,'ͼƬ·','ʦ',50,5,500,600), ('ܰ԰',300,'ͼƬ·','ʦ',50,5,500,600), ('Է',300,'ͼƬ·','ʦ',40,5,450,600), ('ϧԷ',300,'ͼƬ·','ʦ',40,5,500,600), ('ܰԷ',400,'ͼƬ·','ʦ',40,5,500,600), ('˺԰',200,'ͼƬ·','ʦ',60,5,500,600), ('԰',200,'ͼƬ·','ʦ',60,5,500,600), ('Է',200,'ͼƬ·','ʦ',60,5,500,600), ('Է',300,'ͼƬ·','ʦ',30,5,500,600), ('',300,'ͼƬ·','ʦ',30,5,500,600), ('Է',300,'ͼƬ·','ʦ',30,5,500,600), ('Է',300,'ͼƬ·','ʦ',30,5,500,600), ('幬',300,'ͼƬ·','ʦ',30,5,500,600) --2 insert into tb_Dormitory values (1,101,8,50,120), (2,102,8,50,120), (3,103,8,50,120), (4,104,8,50,130), (5,105,8,50,130), (6,106,8,50,130), (7,107,8,50,130), (7,108,8,50,130), (8,109,8,50,140), (9,110,8,50,140), (9,201,8,50,140), (6,202,8,50,140), (101,1,8,50,100) --3Ϣ insert into Dormitory_information values (2,'֣',2017-06-24,'15007031871',1,1), (2,'Խ',2017-06-26,'13687560615',2,1), (2,'',2017-06-26,'150870263708',3,1), (2,'',2017-06-26,'13692191383',4,1), (2,'⽡',2017-06-26,'13481297235',5,1), (2,'',2017-06-27,'13437536684',6,1), (2,'',2017-06-27,'15113839219',7,1), (2,'ƴ',2017-06-27,'13671462632',8,1), (2,'',2017-06-28,'15875932802',1,1), (2,'һ',2017-06-28,'13926901506',2,1), (2,'μ',2017-06-29,'13192191383',3,1), (2,'ΰ',2017-06-29,'12138467236',4,1), (2,'Զ',2017-06-29,'13192191383',5,1), (2,'Τ',2017-06-26,'15192191383',2,1), (2,'',2017-06-26,'13092191383',3,1), (2,'',2017-06-26,'13692191383',4,1), (2,'ŷƽ',2017-06-26,'13418389219',5,1), (2,'Τ',2017-06-27,'13592191383',6,1), (2,'',2017-06-27,'18992191383',7,1), (2,'÷',2017-06-27,'1310559876',8,1), (2,'Τ',2017-06-28,'1288327473',1,1), (2,'׿',2017-06-28,'1231726387',2,1), (2,'Ȩ',2017-06-29,'13192191383',3,1), (2,'',2017-06-29,'12138467236',4,1), (2,'ƼѺ',2017-06-29,'13192191383',5,1), (2,'',2017-06-26,'15192191383',2,1), (2,'',2017-06-26,'13092191383',3,1), (2,'',2017-06-26,'13692191383',4,1), (2,'С',2017-06-26,'13418389219',5,1), (2,'',2017-06-27,'13592191383',6,1), (2,'첨',2017-06-27,'18992191383',7,1), (2,'Ҷ',2017-06-27,'1310559876',8,1), (2,'',2017-06-28,'1288327473',1,1), (2,'',2017-06-28,'1231726387',2,1), (2,'Τӽ',2017-06-29,'18176345589',3,1), (2,'ͬ',2017-06-29,'14796260692',4,1), (2,'ŷһ',2017-06-26,'17807825776',4,1), (2,'ʤ',2017-06-26,'13005768719',5,1), (2,'Ϊ',2017-06-27,'1827827132',6,1), (2,'',2017-06-27,'13085803052',7,1), (2,'',2017-06-27,'18720791859',8,1), (2,'ŷ',2017-06-28,'13016369289',1,1), (2,'Զǿ',2017-06-28,'18377519770',2,1), (2,'ž',2017-06-29,'13005274329',3,1), (2,'',2017-06-29,'18170782574',4,1), (2,'',2017-06-29,'17322964417',5,1), (2,'',2017-06-29,'15986040383',5,1), (2,'Ŷ',2017-06-29,'15768812162',5,1), (2,'¼Һ',2017-06-29,'15073034644',5,1), (2,'־',2017-06-29,'13103961499',5,1), (2,'ΰ',2017-06-29,'13826114950',5,1), (2,'ı',2017-06-29,'13085803052',5,1) --4ˮ insert into shuifei values (101,2016,100,150), (102,2016,110,154), (103,2016,120,150), (104,2016,120,155), (105,2016,121,156), (106,2016,123,150), (107,2016,112,130), (108,2016,113,150), (109,2016,110,150), (110,2016,115,140), (111,2016,121,150), (112,2016,121,128), (113,2016,123,145) --5꼶 insert into Grade values('һѧ'), ('ѧ'), ('ѧ') --6༶ insert into Class values ('141',1), ('143',1), ('143',1), ('145',1), ('146',1), ('147',1), ('148',1), ('131',3), ('132',3), ('133',3), ('134',3) --7 insert into CollegeType values(''), (''), (''), (''), ('赸'), ('鷨'), ('ë'), ('ƹ'), ('Ӱ') --8ְλ insert into CollegePosition values('糤'), ('糤'), ('ͨԱ') --9ųԱϢ insert into CEmplnfo values(1,'',1,1,'2017-09-10','Ů'), (2,'',1,1,'2017-09-10','Ů'), (1,'',1,1,'2017-09-11',''), (3,'',1,1,'2017-09-12',''), (3,'',1,1,'2017-09-10','Ů'), (4,'',1,1,'2017-09-10','Ů'), (1,'ŷ',1,1,'2017-09-10',''), (3,'',1,1,'2016-09-10',''), (3,'',1,1,'2016-09-10','Ů') --10 insert into CollegeCount values (8,20), (8,20), (8,23), (8,13), (8,21), (8,15) insert into StuPosition values('೤','123456'),('೤','123456') ,('ѧϰίԱ','123456'),('ίԱ','123456'),('ίԱ','123456') ,('༶Ա','123456'),('֯ίԱ','123456') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('Τ','14301','',6,3,'123456','ϰ','13152624559','','13152624559','452226199811022115','ʡƽ','1998-11-02','Ա','18776203778','2017-07-01','׳','761273133','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('⽡','14302','',6,3,'123456','ϰ','18675195667','','18675195667','452226199909022115','ʡյͬίɽ','1999-09-02','Ա','13481297235','2017-07-01','׳','2361928131','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14303','',6,2,'123456','ϰ','13481964460','','13481964460','452226199704032115','ʡͨί7692','1997-04-03','Ա','18878254325','2017-07-01','׳','2539039829','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('־','14304','',6,2,'123456','ϰ','13923533128','','13923533128','45222619960311211X','㶫ʡƤӳβֵ','1997-03-11','Ա','13103961499','2017-07-01','׳','193660821','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('ı','14305','',6,1,'123456','ϰ','13790436396','','13790436396','452226199709172115','㶫ʡг','1997-09-17','Ա','13075699576','2017-07-01','׳','964947876','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('ΰ','14306','',6,1,'123456','ϰ','13824132245','','13824132245','452226199711172115','麣нɽ԰','1997-11-17','Ա','13826114950','2017-07-01','׳','','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('¼Ѻ','14307','',6,2,'123456','ϰ','13532229162','','13532229162','452226199712152115','麣нɽ԰','1997-12-15','Ա','15073034644','2017-07-01','׳','','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('Ŷ','14308','',1,2,'123456','ϰ','15986033428','','15986033428','452226199711112115','麣ǰɽ÷Ϫ82','1997-11-11','Ա','15768812162','2017-07-01','׳','1920098158','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14309','',2,3,'123456','ϰ','15322777511','','15322777511','452226199709212115','㶫ʡϽϳ','1997-09-21','Ա','15986040383','2017-07-01','׳','1293434420','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14310','',6,2,'123456','ϰ','15170746497','','15170746497','452226199706272115','㶫ʡϽϳ·9','1997-06-27','Ա','17322964417','2017-07-01','׳','2671626752','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14311','',6,3,'123456','ϰ','13979748040','','13979748040','452226199707302115','ʡɸѰ','1997-07-30','Ա','18170782574','2017-07-01','׳','1171332001','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('ž','14312','',6,1,'123456','ϰ','13602169073','','13602169073','452226199701132115','ʡɸѰķڱ','1997-01-13','Ա','13005274329','2017-07-01','׳','563918504','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('Զǿ','14313','',6,1,'123456','ϰ','18278578248','','18278578248','452226199702182115','㶫ʡɳֵƽ1194','1997-02-18','Ա','18377519770','2017-07-01','׳','1454854695','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('ŷ','14314','',6,1,'123456','ϰ','13677722156','','13677722156','452226199703132115','ʡƽɽɽ20','1997-03-13','Ա','13016369289','2017-07-01','׳','404344656','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14315','',6,2,'123456','ϰ','13979794335','','13979794335','452226199706162115','г','1997-06-16','Ա','18879578325','2017-07-01','׳','1013084720','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14316','',4,2,'123456','ϰ','15978096593','','15978096593','452226199709302115','ʡʯٽ·ϻ','1997-09-30','Ա','18720791859','2017-07-01','׳','1650441540','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('Ϊ','14317','',6,2,'123456','ϰ','13737207873','','13737207873','452226199707252115','ҵƽ','1997-07-25','Ա','13085803052','2017-07-01','׳','1440203176','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('ʤ','14318','',6,3,'123456','ϰ','18177622976','','18177622976','452226199703282115','ʡ˺ˮկί118','1997-03-28','Ա','1827827132','2017-07-01','׳','2517778384','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('ŷһ','14319','',6,3,'123456','ϰ','13660804719','','13660804719','452226199711222115','º¾','1997-11-22','Ա','13005768719','2017-07-01','׳','2668697130','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('ͬ','14320','',6,3,'123456','ϰ','18777927469','','18777927469','452226199712252115','ʡ˱ɽǷίŷ36-1','1997-12-25','Ա','17807825776','2017-07-01','׳','2862519348','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('Τӽ','14321','',6,3,'123456','ϰ','13481785008','','13481785008','452226199702242115','׳кʯ9','1997-02-24','Ա','14796260692','2017-07-01','׳','1152615589','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('շǷ','14322','',6,3,'123456','ϰ','15070491309','','15070491309','452226199710282115','ʡشкͽ9-2','1997-10-28','Ա','18176345589','2017-07-01','׳','1403264271','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14323','',6,3,'123456','ϰ','13928389292','','13928389292','452226199701272115','Ϫ','1997-01-27','Ա','18379484289','2017-07-01','׳','435524709','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14324','',7,3,'123456','ϰ','15777463501','','15777463501','452226199710262115','㶫ʡեɽ34','1997-10-26','Ա','13126326565','2017-07-01','׳','1561172137','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('Ҷ','14325','',6,3,'123456','ϰ','13737218672','','13737218672','452226199712292115','ƽж򿪷83','1997-12-29','Ա','13075670798','2017-07-01','׳','570375827','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14326','',6,3,'123456','ϰ','13686711810','','13686711810','452226199711222115','ʡԣˮ˼','1997-11-22','Ա','13005782563','2017-07-01','׳','937643274','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14327','',6,3,'123456','ϰ','18289720867','','18289720867','452226199701132115','㶫ʡб','1997-01-13','Ա','18218071181','2017-07-01','׳','1662666486','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('С','14328','',6,3,'123456','ϰ','18379708359','','18379708359','452226199702182115','ʡҴ','1997-02-18','Ա','17763827328','2017-07-01','׳','1303322464','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14329','',6,3,'123456','ϰ','13724771756','','13724771756','452226199709162115','ʡڶ޽','1997-09-16','Ա','13192287851','2017-07-01','׳','3269983308','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14330','',6,1,'123456','ϰ','13724771756','','13724771756','452226199707082115','Ϫز','1997-07-08','Ա','18170675139','2017-07-01','׳','649689087','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14331','',6,4,'123456','ϰ','13507775423','','13507775423','452226199705052115','ʡɽط̶','1997-05-05','Ա','18312727657','2017-07-01','׳','450983626','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('ƼѺ','14332','',6,2,'123456','ϰ','13724485802','','13724485802','45222619970103115','㶫ʡпƽˮ1311','1997-01-03','Ա','18777769585','2017-07-01','׳','2861688468','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('','14333','',6,2,'123456','ϰ','13267046414','','13267046414','452226199702022115','ʡҩ·511Ԫ301','1997-02-02','Ա','17674023936','2017-07-01','׳','2585881917','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('Ȩ','14334','',6,3,'123456','ϰ','13977587770','','13977587770','452226199709072115','㶫ʡƽ´1','1997-09-07','Ա','13075681729','2017-07-01','׳','1319272035','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('׿','14335','',6,3,'123456','ϰ','13977587770','','13977587770','452226199708062115','ʡֱ','1997-08-06','Ա','13192720350','2017-07-01','׳','949861884','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('Τ','14336','',6,3,'123456','ϰ','13481812271','','13481812271','452226199706092115','ӳзɽźŪʴ','1997-06-09','Ա','15278320521','2017-07-01','׳','2913923936','','й') insert into Stulnfo(SStudentName,TeacherID,StudentSex,Pid,Cid,SPwd,SFName,SFPhone,SMName,SMPhone,[SID],SHome,SCS,SFace,SPhone,STimeRZ,SNation,SQQMailbox,SRemarks,SJG) values('÷','14337','',6,3,'123456','ϰ','15398852223','','15398852223','452226199703012115','㶫ʡƸض˳˳39','1997-03-01','Ա','18775814709','2017-07-01','׳','1147562174','','й') insert into BorrowBook values('1','2017-09-10','1','2017-09-20','14301','J001') ,('1','2017-10-02','1','2017-10-12','14302','J003') ,('1','2017-09-10','1','2017-09-20','14303','J002') ,('1','2017-09-12','1','2017-09-23','14301','J003') ,('1','2017-08-20','1','2017-09-02','14302','J002') ,('1','2017-10-10','1','2017-10-20','14303','J001') ,('1','2017-08-10','1','2017-08-20','14302','J001') insert into TeaType values('ʦ'),(''),(''),('Ӵ') insert into TeaPosition values(''),('ѧʦ'),('ʦ'),('Ӣʦ'),('רҵʦ'),('ʦ'),('Ա'),('Ա'),('Ӵʦ') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','Ů','123456','123456',1,1,'452226198512032115','㶫麣','1985-12-03','Ա','15247453733','2013-10-03','','','13457356342','׳','3334634234','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','2345678','123456',1,5,'452226198510282115','㶫麣','1985-10-28','Ա','15236728463','2013-06-01','','','15374847692','׳','242412312','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('Juli','Ů','3456721','123456',1,4,'452226198704122125','㶫麣','1987-04-12','Ա','15378374363','2013-11-02','','','13734635268','׳','522342342','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('⽡','','124345','123545',2,4,'452226198605072125','㶫ɽ','1986-05-07','ǵԱ','13481297235','2015-12-03','','','14684704544','׳','64335324','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('Τ','','345645','454342',1,3,'452226198212162115','','1982-12-16','ǵԱ','15236346454','2016-09-13','','','14545456734','׳','12344534','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','123434','343534',3,1,'452226198509172125','','1985-09-17','ǵԱ','13367745755','2015-10-03','','','13566445352','׳','4353434','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','123435','3143345',2,2,'452226199307232125','','1993-08-23','Ա','14563267356','2008-04-03','','','13623252784','׳','1231442','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','Ů','125435','3133345',2,3,'452226199203132125','㶫麣','1992-03-13','Ա','13523267356','2012-02-13','','','13623532784','׳','1232432','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('־','','623435','3143125',2,4,'452226199602262125','㶫','1996-02-26','ǵԱ','13566227356','2011-07-21','','','13623652184','׳','1221432','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','354235','3323345',2,2,'452226199411252125','','1994-11-25','Ա','15366267356','2013-03-28','','','13675452784','׳','1235242','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('κǿ','','123436','2146345',3,4,'452226199201272125','','1992-01-27','Ա','15623269356','2009-12-27','','','13623572784','׳','1237492','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','126135','3243545',2,5,'452226199107222125','','1991-07-22','ǵԱ','15823267356','2015-01-20','','','13643652724','׳','1281463','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('κ˧','','153735','3153345',1,2,'452226198912182125','','1989-12-18','Ա','13729567356','2001-12-29','','','13676352784','׳','1273742','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','186235','3197245',4,5,'452226199302282125','','1993-02-28','Ա','18563253656','2012-01-29','','','13623201784','׳','1239752','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('˹','Ů','145435','3193345',2,4,'452226198703222125','','1987-03-22','Ա','18374267356','2016-01-04','','','13636473784','׳','1295242','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('ŷһ','','142435','3142845',2,3,'452226199402132125','','1994-02-13','Ա','14663267356','2008-06-15','','','13625275784','׳','1293042','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('ͬ','','125235','3142835',1,2,'452226198503172125','','1985-03-17','Ա','14574963356','2008-02-18','','','13629676784','׳','1201442','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('Τӽ','','127235','3143745',2,6,'452226199209122125','Ĵ','1992-09-12','Ա','14568592356','2008-06-18','','','13629563784','׳','1205842','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('շǷ','','127135','3143845',2,3,'452226198205212125','㶫','1982-05-21','Ա','14560573356','2012-03-14','','','13629265784','׳','1205842','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','128435','3143925',2,3,'452226198507272125','ӱ','1985-07-27','Ա','14565037356','2008-11-17','','','13620957784','׳','1209242','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('',' Ů','127235','3143925',1,3,'452226199405292125','','1994-05-29','Ա','14565930356','2010-06-13','','','13620363784','׳','1280242','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('Ҷ','','128235','3143955',4,2,'452226199102232125','','1991-02-23','Ա','14568572356','2009-05-27','','','13620269784','׳','1202642','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','127335','3143925',4,1,'452226199401262125','㶫ݸ','1994-01-26','Ա','14569687356','2011-09-29','','','13628360784','׳','1285242','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','128335','3143425',2,3,'452226199604272125','㶫','1996-04-27','Ա','14560684356','2010-12-23','','','13628503784','׳','1295642','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('С','','122135','3143535',2,5,'452226199809262125','','1998-09-26','Ա','14560683356','2014-11-23','','','13629470784','׳','1295242','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','123555','3142345',2,2,'452226199406282125','','1994-06-28','Ա','14560634556','2014-06-24','','','13628403784','׳','1205642','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','128435','3143245',3,1,'452226199406282125','Ͼ','1983-07-27','Ա','14569075356','2012-07-26','','','13629092784','׳','1283542','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','126235','3152345',4,2,'452226198205212125','','1982-05-21','Ա','14560083556','2010-02-26','','','13625482784','׳','1285542','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('ƼѺ','','126335','3195245',3,2,'452226199510222125','','1995-10-22','Ա','14560687356','2011-07-23','','','13629573784','׳','1287642','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('','','126235','3148545',1,2,'452226199711272125','','1997-11-27','Ա','14569856356','2012-04-22','','','13628280784','׳','1282642','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('Ȩ','','128235','3158345',1,2,'452226198712232125','','1987-12-23','Ա','14563027556','2008-02-04','','','13629476784','׳','1257342','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('׿','','127335','3152445',2,2,'452226198309282125','','1983-09-28','Ա','14563956356','2008-10-13','','','13629573784','׳','1229542','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('Τ','Ů','127235','3195345',3,2,'452226198207182125','','1982-07-18','Ա','14560753656','2008-11-10','','','13620587784','׳','1295642','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('÷','','128335','3149245',1,2,'452226199401182125','㶫麣','1994-01-18','Ա','14563905756','2014-08-20','','','13620683784','׳','1292742','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('ı','','129335','3140345',4,2,'452226190402192125','㶫麣','1904-02-19','Ա','14563057356','2011-07-29','','','13620743784','׳','1572442','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('ΰ','','123835','3140545',3,2,'452226197304102125','','1973-04-10','Ա','14563057856','2010-06-21','','','13620573784','׳','1582442','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('¼Ѻ','','128765','3140645',3,2,'452226198407162125','','1984-07-16','Ա','14563095756','2009-02-22','','','13629573784','׳','1231846','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('Ŷ','','123265','3147245',1,2,'452226198804112125','㶫ɽ','1988-04-11','Ա','14563957356','2008-01-31','','','13629673784','׳','1231843','','й') insert into TeaInfo(TName,TSex,TUid,TPwd,[Type],Position,TID,THoome,TCS,TFace,TPhone,TTimeRZ,TTimeLZ,TLZReason,TJTPhone,TNation,TQQMailbox,TRemarks,TJG) values('ʤ','','126245','3149545',1,6,'452226199102172125','','1991-02-17','Ա','14563095756','2010-04-30','','','13620967784','׳','1268242','','й') insert into EmpType values('Ա'),('²'),(''),('߲') insert into EmpPosition values('³'),('ܾ'),('ܾ'),('鳤'),('Ա') insert into EmpInfo(EUid,EPwd,EName,ESet,EBirthday,Tid,Pid,EmpNation,EmpFace,EmpIDT,EmpEducate,EWedding,ETell,EPhone,EIDAd,EJG,TRemarks) values('1001','123456','','','1992-01-20',4,1,'׳','Ա','452226199201202115','ѧҵ','δ','15235557242','12464745343','㶫ɽ','й',''), ('1002','123456','','','1993-10-20',4,2,'׳','Ա','452226199310202115','ѧҵ','ѻ','15747836353','15366332843','','й',''), ('1003','123456','','','1994-05-13',4,2,'׳','Ա','452226199405132115','ѧҵ','ѻ','14683675573','15366764457','㶫麣','й',''), ('1004','123456','άŵ','','1994-05-13',4,2,'׳','Ա','452226199405132115','ѧҵ','δ','14680184573','15367443457','㶫ݸ','й',''), ('1005','123456','Ҷ','','1994-07-23',4,2,'׳','Ա','452226199405132115','ѧҵ','δ','14685927573','15366631457','㶫','й',''), ('1006','123456','','','1992-04-12',4,2,'','Ա','452226199204122115','ѧҵ','δ','14680543573','15368743457','㶫','й',''), ('1007','123456','Τ','Ů','1993-05-12',4,2,'','Ա','452226199305122115','ѧҵ','δ','14680583573','15368321457','㶫麣','й',''), ('1008','123456','Ӿ','','1989-07-11',1,5,'','Ա','452226198907112115','ѧҵ','ѻ','14686938573','15368323457','','й',''), ('1009','123456','±','','1994-08-16',1,5,'','Ա','452226199408162115','ѧҵ','δ','14680583573','15369422457','','й',''), ('1010','123456','','','1996-01-13',1,5,'','Ա','452226199601132115','ѧҵ','ѻ','14680285573','15368442457','','й',''), ('1011','123456','','Ů','1991-04-13',1,5,'׳','Ա','452226199104132115','ѧҵ','ѻ','14683053573','15365217457','','й',''), ('1012','123456','','Ů','1995-07-13',1,5,'׳','Ա','452226199507132115','ѧҵ','δ','14683927473','15366246457','','й',''), ('1013','123456','','','1998-09-13',1,5,'','ǵԱ','452226199809132115','ѧҵ','δ','14683853773','15366267457','㶫麣','й',''), ('1014','123456','','','1996-03-16',1,5,'','Ա','452226199603162115','ѧҵ','δ','14683675373','15364563457','㶫麣','й',''), ('1015','123456','ٻޱ','Ů','1994-01-25',1,5,'','ǵԱ','452226199401252115','ѧҵ','ѻ','14683578473','15364446457','㶫麣','й',''), ('1016','123456','','Ů','1992-02-28',1,5,'','ǵԱ','452226199202282115','ѧҵ','δ','14680573573','15363336457','','й',''), ('1017','123456','̷޺','Ů','1993-11-29',1,5,'׳','Ա','452226199311292115','ѧҵ','ѻ','14682745573','15366642457','Ĵ','й',''), ('1018','123456','֣','','1991-10-23',1,5,'׳','Ա','452226199110232115','ѧҵ','ѻ','14685037573','15367778457','Ĵ','й',''), ('1019','123456','־','','1987-12-18',1,5,'','Ա','452226198712182115','ѧҵ','ѻ','14684201573','15367774457','','й',''), ('1020','123456','','','1988-09-19',1,5,'׳','ǵԱ','452226198809192115','ѧҵ','δ','14681038573','15363456457','','й',''), ('1021','123456','볬','','1986-07-10',1,5,'׳','Ա','452226198607102115','ѧҵ','ѻ','14681480573','15362573457','','й',''), ('1022','123456',' ','','1985-08-11',1,5,'׳','ǵԱ','452226198508112115','ѧҵ','ѻ','14683185573','15366466457','','й',''), ('1023','123456','','','1984-04-12',1,5,'','Ա','452226198404122115','ѧҵ','ѻ','14682184573','15367488457','㶫ɽ','й',''), ('1024','123456','쳿','','1983-03-15',1,5,'','Ա','452226198303152115','ѧҵ','δ','14683914573','15367738457','㶫ɽ','й',''), ('1025','123456','ξ','Ů','1987-06-10',1,5,'׳','ǵԱ','452226198706102115','ѧҵ','δ','14680174573','15368890457','㶫麣','й',''), ('1026','123456','','','1990-01-19',1,5,'','ǵԱ','452226199001192115','ѧҵ','δ','14683947573','15360654457','㶫麣','й',''), ('1027','123456',' ','Ů','1994-09-18',1,5,'','ǵԱ','452226199409182115','ѧҵ','ѻ','14685826573','15369794457','㶫ݸ','й',''), ('1028','123456','Ѧ','Ů','1992-10-17',1,4,'׳','Ա','452226199210172115','ѧҵ','ѻ','14685965573','15360734457','㶫','й',''), ('1029','123456','','','1996-11-17',1,4,'׳','ǵԱ','452226199611172115','ѧҵ','ѻ','14680917573','15368990457','','й',''), ('1030','123456','','','1997-12-12',1,4,'׳','Ա','452226199712122115','ѧҵ','ѻ','14685737573','15365788457','','й',''), ('1031','123456','','','1998-12-11',1,4,'׳','ǵԱ','452226199812112115','ѧҵ','δ','14689472573','15363689457','','й',''), ('1032','123456','','','1994-11-10',4,4,'','Ա','452226199411102115','ѧҵ','δ','14684038573','15369707457','','й',''), ('1033','123456','','','1996-04-20',4,4,'','ǵԱ','452226199604202115','ѧҵ','ѻ','14689012573','15360084457','','й',''), ('1034','123456','־','','1993-03-31',4,5,'׳','Ա','452226199303312115','ѧҵ','ѻ','14683802573','15360854457','㶫麣','й',''), ('1035','123456','Ȼ','','1990-11-30',2,5,'׳','ǵԱ','452226199011302115','ѧҵ','ѻ','14683482573','15369702457','㶫麣','й',''), ('1036','123456','','Ů','1991-12-30',2,5,'׳','Ա','452226199112302115','ѧҵ','ѻ','14683598573','15360285457','㶫麣','й',''), ('1037','123456','Ȼ','Ů','1993-09-21',2,5,'','Ա','452226199309212115','ѧҵ','δ','14685937573','15360683457','㶫麣','й',''), ('1038','123456','','','1997-07-29',2,5,'׳','ǵԱ','452226199707292115','ѧҵ','δ','14685038573','15360862457','','й',''), ('1039','123456',' ¬һ','','1994-06-28',2,5,'׳','Ա','452226199406282115','ѧҵ','δ','14683084573','15360482457','','й',''), ('1040','123456','','','1992-05-21',2,5,'׳','Ա','452226199205212115','ѧҵ','δ','14683648773','15369524457','','й',''), ('1041','123456',' ','','1991-07-25',2,5,'','Ա','452226199107252115','ѧҵ','ѻ','14683603573','15367489457','Ĵ','й',''), ('1042','123456','ܿ','Ů','1989-04-27',2,5,'','Ա','452226198904272115','ѧҵ','ѻ','14683065873','15360275457','','й',''), ('1043','123456','ﺣ','Ů','1988-02-25',2,5,'','Ա','452226198802252115','ѧҵ','ѻ','14683585573','15360227457','','й',''), ('1044','123456','','Ů','1987-01-22',2,5,'','ǵԱ','452226198701222115','ѧҵ','δ','14685937573','15366693457','','й',''), ('1045','123456','','','1986-01-23',2,5,'','ǵԱ','452226198601232115','ѧҵ','ѻ','14687038573','15366865457','㶫麣','й',''), ('1046','123456','','','1984-02-14',2,5,'׳','Ա','452226198402142115','ѧҵ','δ','14680582573','15364479457','㶫麣','й',''), ('1047','123456','ܹ','','1986-03-21',4,2,'׳','Ա','452226198603212115','ѧҵ','ѻ','14685038573','15362689457','㶫麣','й','') insert into AdminInfo values('Τ','','1234567','123456',1), ('Τ','ͼ','1234567','123456',1), ('','ͼ','1234567','123456',1), ('½ѻ','ʦ','1234567','123456',1), ('','','1234567','123456',1), ('ﺣ','','1234567','123456',1), ('Ʒ','','1234567','123456',1), ('Ⱥ','','1234567','123456',1), ('','','1234567','123456',1), ('','','1234567','123456',1), ('','','1234567','123456',1), ('볬','','1234567','123456',1), ('','','1234567','123456',1), ('','','1234567','123456',1), ('Ѧ','','1234567','123456',1), ('','','1234567','123456',1), ('ٻޱ','','1234567','123456',1), ('','','1234567','123456',1), ('άŵ','','1234567','123456',1), ('־','','1234567','123456',1), ('','','1234567','123456',1), ('','','1234567','123456',1), ('֣','','1234567','123456',1), ('','','1234567','123456',1), ('','','1234567','123456',1), ('ܿ','','1234567','123456',1), ('Ȼ','','1234567','123456',1), ('Ȼ','','1234567','123456',1)
true
1f0f3483c048f19824a14dff7e371d27b6e917f4
SQL
Nattawipa/Database-Systems
/week 2/assignment/U6188089_Schema01.sql
UTF-8
2,427
3.390625
3
[]
no_license
CREATE TABLE Student ( Student_ID int NOT NULL PRIMARY KEY, Student_Firstname varchar(50) NOT NULL, Student_Lastname varchar(50) NOT NULL, Student_Address varchar(100), Student_Birthday date, Student_Email varchar(50) NOT NULL DEFAULT '@student.mahidol.ac.th', Student_Phone varchar(10) NOT NULL, Student_UserID varchar(10) NOT NULL, Student_Password varchar(10) NOT NULL, ); CREATE TABLE Instructor ( Instructor_ID int NOT NULL PRIMARY KEY, Instructor_Firstname varchar(50) NOT NULL, Instructor_Lastname varchar(50) NOT NULL, Instructor_Address varchar(100), Instructor_Birthday date, Instructor_Email varchar(50) NOT NULL DEFAULT '@mahidol.ac.th', Instructor_Phone varchar(10) NOT NULL, Instructor_UserID varchar(10) NOT NULL, Instructor_Password varchar(10) NOT NULL ); CREATE TABLE Student_Transaction ( Transaction_ID int NOT NULL PRIMARY KEY, Amount int ); CREATE TABLE Payment ( Student_ID int FOREIGN KEY REFERENCES Student(Student_ID), Transaction_ID int FOREIGN KEY REFERENCES Student_Transaction(Transaction_ID) ); CREATE TABLE Course ( Course_ID int NOT NULL PRIMARY KEY, Instructor_ID int FOREIGN KEY REFERENCES Instructor(Instructor_ID), Course_Name varchar(50), Course_Amount int ); CREATE TABLE ElearningVideo ( Course_ID int FOREIGN KEY REFERENCES Course(Course_ID), Lesson varchar(50), Details varchar(100) ); CREATE TABLE BookStocking ( Book_ID int NOT NULL PRIMARY KEY, Course_ID int FOREIGN KEY REFERENCES Course(Course_ID), BookName varchar(50), Author varchar(50), Remaining int, Price float ); CREATE TABLE Seat ( Seat_ID int NOT NULL PRIMARY KEY, Course_ID int FOREIGN KEY REFERENCES Course(Course_ID), Student_ID int FOREIGN KEY REFERENCES Student(Student_ID), Seat_Row varchar(10), Seat_Number int ); CREATE TABLE EnrollCourse ( Student_ID int FOREIGN KEY REFERENCES Student(Student_ID), Course_ID int FOREIGN KEY REFERENCES Course(Course_ID) ); CREATE TABLE ExamScore ( Exam_ID int NOT NULL PRIMARY KEY, Score float ); CREATE TABLE PracticeExam ( Student_ID int FOREIGN KEY REFERENCES Student(Student_ID), Exam_ID int FOREIGN KEY REFERENCES ExamScore(Exam_ID), ); CREATE TABLE CheckAttendance ( Student_ID int FOREIGN KEY REFERENCES Student(Student_ID), Week_Number int, Attendance_Day date, Attendance_Status varchar(50) );
true
21abe02e5436255382649e1a6efa597b141441b0
SQL
mroseweir/python-sql-assessment
/sql-skills.sql
UTF-8
2,157
4.40625
4
[]
no_license
-- Artist Table -- Add 3 new artists to the artist table using INSERT. (It’s already created.) INSERT INTO artist ( name ) Values ('ODESZA'), ('Illenium'), ('GRiZ'); -- Select 5 artists in alphabetical order. SELECT * FROM artist LIMIT 5; -- Employee Table -- List all employee first and last names only that live in Calgary. SELECT first_name, last_name, city FROM employee WHERE city = 'Calgary'; -- Find everyone that reports to Nancy Edwards (Use the ReportsTo column). You will need to query the employee table to find the Id for Nancy Edwards SELECT * FROM employee WHERE reports_to = 2; -- Count how many people live in Lethbridge. SELECT COUNT(*) FROM employee WHERE city = 'Lethbridge'; -- Invoice Table -- Count how many orders were made from the USA. SELECT SUM(total) FROM invoice WHERE billing_country = 'USA'; -- Find the largest order total amount. SELECT MAX(total) FROM invoice; -- Find the smallest order total amount. SELECT MIN(total) FROM invoice; -- Find all orders bigger than $5. SELECT * FROM invoice WHERE total > 5; -- Count how many orders were smaller than $5. SELECT * FROM invoice WHERE total < 5; -- Get the total sum of the orders. SELECT SUM(total) FROM invoice; -- JOIN Queries (Various tables) -- Get all invoices where the unit_price on the invoice_line is greater than $0.99. SELECT * FROM invoice JOIN invoice_line ON invoice_line.invoice_id = invoice.invoice_id WHERE unit_price > 0.99; -- Get the invoice_date, customer first_name and last_name, and total from all invoices. SELECT invoice_date, customer.first_name, customer.last_name, total FROM invoice JOIN customer ON customer.customer_id = invoice.invoice_id; -- Get the customer first_name and last_name and the support rep’s first_name and last_name from all customers. Note that support reps are on the employee table. SELECT customer.first_name, customer.last_name, employee.first_name, employee.last_name FROM customer JOIN employee ON customer.customer_id = employee.employee_id; -- Get the album title and the artist name from all albums. SELECT title, artist.name FROM album JOIN artist ON album.artist_id = artist.artist_id;
true
b327644fe496238bd488767ac5621cf99acc3974
SQL
paljinderSingh13/rolepermisson
/ocrm_global_sub_modules (2).sql
UTF-8
11,524
2.609375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.6 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Sep 23, 2017 at 09:22 AM -- Server version: 10.1.24-MariaDB -- PHP Version: 7.0.17 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `oxo_adminpi` -- -- -------------------------------------------------------- -- -- Table structure for table `ocrm_global_sub_modules` -- CREATE TABLE `ocrm_global_sub_modules` ( `id` int(10) UNSIGNED NOT NULL, `module_id` bigint(20) DEFAULT NULL, `sub_module_route` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `js` text COLLATE utf8mb4_unicode_ci NOT NULL, `css` text COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL, `icon` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL, `status` int(11) NOT NULL DEFAULT '1', `orderBy` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `ocrm_global_sub_modules` -- INSERT INTO `ocrm_global_sub_modules` (`id`, `module_id`, `sub_module_route`, `name`, `js`, `css`, `color`, `icon`, `status`, `orderBy`, `created_at`, `updated_at`) VALUES (97, 22, 'crm/clients', 'Customers', '', '', '', '', 1, 0, '2017-07-07 00:48:37', '2017-08-16 22:38:48'), (100, 24, 'cms/pages', 'Pages', '', '', '', '', 1, 0, '2017-07-07 01:08:52', '2017-08-16 22:38:48'), (101, 24, 'cms/media', 'Media', '', '', '', '', 1, 0, '2017-07-07 01:08:52', '2017-08-30 07:05:06'), (158, 21, 'account/profile', 'Profile', 'helllo js hello some testing data', 'hello vss hello osme testig', 'rgba(0, 0, 0, 0)', 'fa-address-card', 1, 3, '2017-07-07 06:52:38', '2017-09-19 06:51:18'), (159, 21, 'account/activities', 'Activities', '', '', '', '', 1, 3, '2017-07-07 06:52:38', '2017-09-19 06:51:18'), (160, 21, 'account/attendance', 'Attendence', '', '', '', '', 1, 6, '2017-07-07 06:52:38', '2017-09-19 06:51:03'), (161, 21, 'account/performance', 'Performance', '', '', '', '', 1, 5, '2017-07-07 06:52:38', '2017-09-19 06:51:06'), (162, 21, 'account/emails', 'Emails', '', '', '', '', 1, 3, '2017-07-07 06:52:38', '2017-09-19 06:51:18'), (164, 21, 'account/chat', 'Chat', '', '', '', '', 1, 9, '2017-07-07 06:52:38', '2017-09-19 06:50:46'), (165, 21, 'account/discussion', 'Discussion', '', '', '', '', 1, 7, '2017-07-07 06:52:38', '2017-09-19 06:50:59'), (166, 21, 'account/leaves', 'Leaves', '', '', '', '', 1, 10, '2017-07-07 06:52:38', '2017-09-19 06:50:37'), (167, 21, 'holiday/list', 'Holidays', '', '', '', '', 1, 11, '2017-07-07 06:52:38', '2017-09-19 06:50:34'), (168, 21, 'account/todo', 'To Do', '', '', '', '', 1, 12, '2017-07-07 06:52:38', '2017-09-19 06:50:30'), (169, 21, 'account/tasks', 'Tasks', '', '', '', '', 1, 14, '2017-07-07 06:52:38', '2017-09-19 06:50:20'), (170, 21, 'account/notes', 'Notes', '', '', '', '', 1, 13, '2017-07-07 06:52:38', '2017-09-19 06:50:26'), (218, 19, 'hrm/employees', 'Employees', '', '', '', '', 1, 0, '2017-07-11 00:35:08', '2017-08-16 22:38:48'), (219, 19, 'hrm/attendance', 'Attendance', '', '', '', '', 1, 0, '2017-07-11 00:35:08', '2017-08-16 22:38:48'), (221, 19, 'hrm/designations', 'Designations', '', '', '', '', 1, 6, '2017-07-11 00:35:08', '2017-09-19 06:51:03'), (222, 19, 'hrm/departments', 'Departments', '', '', '', '', 1, 6, '2017-07-11 00:35:08', '2017-09-19 06:51:03'), (223, 19, 'hrm/leaves', 'Leaves', '', '', '', '', 1, 6, '2017-07-11 00:35:08', '2017-09-19 06:51:03'), (224, 19, 'hrm/leave-categories', 'Leave Categories', '', '', '', '', 1, 7, '2017-07-11 00:35:08', '2017-09-19 06:50:59'), (225, 19, 'hrm/shifts', 'Shifts', '', '', '', '', 1, 9, '2017-07-11 00:35:08', '2017-09-19 06:50:46'), (226, 19, 'hrm/holidays', 'Holidays', '', '', '', '', 1, 9, '2017-07-11 00:35:08', '2017-09-19 06:50:46'), (243, 25, 'users', 'Users', '', '', '', '', 1, 0, '2017-07-11 03:03:54', '2017-08-16 22:38:48'), (244, 25, 'hrm/roles', 'Roles', '', '', '', '', 1, 0, '2017-07-11 03:03:54', '2017-08-16 22:38:48'), (250, 23, 'projects', 'Projects', '', '', '', '', 1, 0, '2017-07-11 06:07:18', '2017-08-16 22:38:48'), (258, 23, 'project/tasks', 'Tasks', '', '', '', '', 1, 0, '2017-07-17 00:10:06', '2017-08-16 22:38:48'), (259, 23, 'teams', 'Teams', '', '', '', '', 1, 6, '2017-07-17 00:22:44', '2017-09-19 06:51:03'), (260, 23, 'project/categories', 'Project Categories', '', '', '', '', 1, 6, '2017-07-17 00:24:07', '2017-09-19 06:51:03'), (261, 24, 'cms/categories', 'Categories', '', '', '', '', 1, 6, '2017-07-17 06:13:24', '2017-09-19 06:51:03'), (263, 24, 'cms/posts', 'Posts', '', '', '', '', 1, 6, '2017-07-17 06:14:46', '2017-09-19 06:51:03'), (264, 29, 'datasets', 'Datasets', '', '', '', '', 1, 0, '2017-07-17 06:30:05', '2017-08-16 22:38:48'), (265, 29, 'dataset/import', 'Import Dataset', '', '', '', '', 1, 0, '2017-07-17 06:30:05', '2017-08-16 22:38:48'), (266, 32, 'hrm/leaves', 'employee dumy', '', '', '', '', 1, 0, '2017-07-18 01:00:51', '2017-08-16 22:38:48'), (267, 32, 'hrm/role/delete', 'Dumy client', '', '', '', '', 1, 0, '2017-07-18 01:03:19', '2017-08-16 22:38:48'), (268, 33, 'create/visualization', 'Visualizations', '', '', '', '', 1, 0, '2017-07-18 01:28:29', '2017-09-15 07:54:45'), (269, 19, 'hrm/openings', 'Job Openings', '', '', '', '', 1, 10, '2017-07-19 22:55:26', '2017-09-19 06:50:37'), (270, 19, 'hrm/applicants', 'Applicants', '', '', '', '', 1, 11, '2017-07-20 00:37:59', '2017-09-19 06:50:34'), (271, 21, 'account/projects', 'Projects', '', '', '', '', 1, 15, '2017-07-26 06:17:37', '2017-09-19 06:50:11'), (272, NULL, NULL, '', '', '', '', '', 1, 0, '2017-07-27 04:05:58', '2017-07-27 04:05:58'), (273, NULL, NULL, '', '', '', '', '', 1, 0, '2017-07-27 04:06:58', '2017-07-27 04:06:58'), (274, NULL, NULL, '', 'hello js', 'hello css', '#6338bd', 'fa-anchor', 1, 0, '2017-07-27 04:10:37', '2017-07-27 04:10:37'), (275, 35, 'emails', 'Email', '', '', '', '', 1, 0, '2017-07-28 03:47:48', '2017-08-16 22:38:48'), (276, 36, 'emails', 'Email', '', '', '', '', 1, 0, '2017-07-28 22:38:40', '2017-08-16 22:38:48'), (277, 37, 'email', 'Emails', '', '', '', '', 1, 0, '2017-07-29 06:07:47', '2017-08-16 22:38:48'), (278, 37, 'email/templates', 'Email Templates', '', '', '', '', 1, 0, '2017-07-29 06:07:47', '2017-08-16 22:38:48'), (279, 37, 'email/layouts', 'Email Layouts', '', '', '', '', 1, 6, '2017-07-29 06:07:47', '2017-09-19 06:51:03'), (280, 38, 'documents', 'Documents', '', '', '', '', 1, 0, '2017-07-29 06:37:20', '2017-08-16 22:38:48'), (281, 38, 'document/templates', 'Document Templates', '', '', '', '', 1, 0, '2017-07-29 06:37:20', '2017-08-16 22:38:48'), (282, 38, 'document/layouts', 'Document Layouts', '', '', '', '', 1, 6, '2017-07-29 06:37:20', '2017-09-19 06:51:03'), (285, 22, 'crm/products', 'Products', '', '', '', '', 1, 0, '2017-07-31 06:56:45', '2017-08-16 22:38:48'), (286, 22, 'crm/services', 'Services', '', '', '', '', 1, 6, '2017-07-31 07:06:17', '2017-09-19 06:51:03'), (287, 22, 'crm/invoices', 'Invoices', '', '', '', '', 1, 6, '2017-07-31 07:12:10', '2017-09-19 06:51:03'), (288, 22, 'crm/payment-methods', 'Payment-Methods', '', '', '', '', 1, 6, '2017-07-31 07:18:52', '2017-09-19 06:51:03'), (290, 22, 'crm/product/category', 'Product Categories', '', '', '', '', 1, 7, '2017-08-01 06:27:46', '2017-09-19 06:50:59'), (291, 22, 'crm/service/category', 'Service Categories', '', '', '', '', 1, 9, '2017-08-01 06:27:46', '2017-09-19 06:50:46'), (292, 40, 'custom-maps/{type?}', 'Custom Maps', '', '', '', '', 1, 0, '2017-08-05 01:37:15', '2017-08-16 22:38:48'), (294, 41, 'tools', 'Tools', '', '', '', '', 1, 0, '2017-08-07 02:56:35', '2017-08-07 03:30:32'), (295, 19, 'hrm/payscale', 'Pay Scale', '', '', '', '', 1, 11, '2017-08-09 23:03:39', '2017-09-19 06:50:34'), (296, 19, 'hrm/applications', 'Applications', '', '', '', '', 1, 11, '2017-08-10 00:59:12', '2017-09-19 06:50:34'), (297, 22, 'crm/contacts', 'Contacts', 'hello js', 'hello css', 'rgba(226, 181, 181, 0)', 'fa-adjust', 1, 9, '2017-08-12 06:11:11', '2017-09-19 06:50:46'), (305, 52, 'forms/list', 'Forms', '', '', '', '', 1, 3, '2017-08-16 22:47:09', '2017-09-19 06:51:18'), (306, 52, 'forms/create', 'Add Form', '', '', '', '', 1, 4, '2017-08-16 22:48:12', '2017-09-19 06:51:14'), (314, 19, 'hrm/salary', 'Salary', '', '', '', '', 1, 12, '2017-08-17 23:48:57', '2017-09-19 06:50:30'), (315, 67, 'surveys', 'Surveys', '', '', '', '', 1, 1, '2017-08-19 05:24:49', '2017-08-19 05:26:22'), (316, 67, 'survey/add', 'Add Survey', '', '', '', '', 1, 3, '2017-08-19 05:26:02', '2017-09-19 06:51:18'), (321, 21, 'account/bookmarks', 'Bookmarks', '', '', '', '', 1, 16, '2017-08-23 23:01:30', '2017-09-19 06:50:06'), (322, 69, NULL, 'Support Ticket', '', '', '', '', 1, 1, '2017-08-28 00:15:04', '2017-08-28 00:15:04'), (323, 69, NULL, 'Knowledge base', '', '', '', '', 1, 3, '2017-08-28 00:15:33', '2017-09-19 06:51:18'), (324, 69, NULL, 'FAQ', '', '', '', '', 1, 4, '2017-08-28 00:15:42', '2017-09-19 06:51:14'), (325, 69, 'support/list/feedback', 'Feedback', '', '', 'rgba(22, 141, 197, 0)', 'fa-feed', 1, 5, '2017-08-28 00:15:54', '2017-09-19 06:51:06'), (326, 24, 'cms/menus', 'Menus', '', '', '', '', 1, 7, '2017-09-08 00:58:21', '2017-09-19 06:50:59'), (327, 24, 'cms/design-settings', 'Design Settings', '', '', '', '', 1, 8, '2017-09-08 00:58:29', '2017-09-19 06:50:54'), (328, 27, 'settings/organization', 'Basic', '', '', '', '', 1, 1, '2017-09-11 07:06:51', '2017-09-11 07:09:04'), (329, 27, 'settings/emp', 'Employee', '', '', '', '', 1, 3, '2017-09-11 07:07:06', '2017-09-19 06:51:18'), (330, 27, 'settings/hrm', 'HRM', '', '', '', '', 1, 4, '2017-09-11 07:07:15', '2017-09-19 06:51:14'), (331, 27, 'settings/user', 'User', '', '', '', '', 1, 5, '2017-09-11 07:07:24', '2017-09-19 06:51:06'), (332, 27, 'settings/role', 'Roles', '', '', '', '', 1, 6, '2017-09-11 07:07:34', '2017-09-19 06:51:03'), (333, 27, 'settings/leaves', 'Leave', '', '', '', '', 1, 7, '2017-09-11 07:07:43', '2017-09-19 06:50:59'), (334, 33, 'custom-maps/g', 'Global Maps', '', '', '', '', 1, 1, '2017-09-15 07:55:02', '2017-09-16 00:29:49'), (335, 33, 'custom-maps/u', 'User Maps', '', '', '', '', 1, 3, '2017-09-15 07:55:11', '2017-09-19 06:51:18'), (336, 70, 'widgets', 'Widgets', '', '', '', '', 1, 1, '2017-09-17 23:14:09', '2017-09-17 23:25:21'), (337, 70, 'widget/create', 'Add widgets', '', '', '', '', 1, 3, '2017-09-17 23:14:17', '2017-09-19 06:51:18'), (338, 21, 'account/view', 'View', '', '', '', '', 1, 2, '2017-09-19 06:10:45', '2017-09-19 22:54:53'), (339, 21, 'account/document', 'Document', '', '', '', '', 1, 17, '2017-09-21 00:27:51', '2017-09-21 00:38:25'); -- -- Indexes for dumped tables -- -- -- Indexes for table `ocrm_global_sub_modules` -- ALTER TABLE `ocrm_global_sub_modules` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `ocrm_global_sub_modules` -- ALTER TABLE `ocrm_global_sub_modules` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=340; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
76aab70c0892273d14b8f1c387cb5a89f1f8d48a
SQL
SushilChelsea/cypher-graph-database
/assign.sql
UTF-8
4,180
4.03125
4
[]
no_license
-- Author: Sushil Pun -- Loading club.csv file LOAD CSV WITH HEADERS FROM ("file:///club.csv") AS row create(n:Club {name:'row.club'}; --Loading result.csv file and making relationship between home and away club LOAD CSV WITH HEADERS FROM ("file:///result.csv") AS row match(a:Club{name:row.home}),(b:Club{name:row.away}) Merge (a)-[r:played_with]->(b); --Loading attributes to relation LOAD CSV WITH HEADERS FROM ("file:///result.csv") AS row match(a:Club{name:row.home})-[r:played_with]-(b:Club{name:row.away}) set r+={status:row.status,home:row.home, away:row.away,score:[row.score__001, row.score__002], time:row.time, id:row.id, link:row.link }; -------------- Queires ----------------------- -- Display total number of matches played. ---- match(a:Club)-[r:played_with{status:'played'}]->(b:Club) return count(r) AS Total_Match_Played; -- Display details of all matches involved “Arsenal FC” ------ match(a:Club{name:'Arsenal FC'})-[r:played_with{status:'played'}]-(b:Club) return r AS Arsenal_FC_MATCHES; -- Display the number of matches “Liverpool FC” has lost. --- match(a:Club{name:'Liverpool FC'})-[r:played_with]->(b:Club) WHERE r.score[0]<r.score[1] return r as result UNION match(a:Club)-[r:played_with]->(b:Club{name:'Liverpool FC'}) WHERE r.score[0]>r.score[1] return r as result ---- Club name with the Home score match(a:Club)-[r:played_with]->(b:Club) return a.name AS Club, sum(toInteger(head(r.score))) AS Home_Score --- Club name with the Away score match(a:Club)<-[r:played_with]-(b:Club) return a.name AS Club, sum(toInteger(last(r.score))) AS Away_Score ---- Display top five teams that have best scoring power. -- LOAD CSV WITH HEADERS FROM ("file:///club.csv") AS row match(a:Club{name:row.club})-[r:played_with]->(b:Club) WITH a,sum(toInteger(head(r.score))) AS Home_score OPTIONAL MATCH (a)<-[r:played_with]-(b:Club) WITH a,Home_score, sum(toInteger(last(r.score))) AS Away_score RETURN a.name, Home_score+Away_score AS Total_Score ORDER BY Total_Score DESC LIMIT 5 --- Display top five teams that have poorest defending. LOAD CSV WITH HEADERS FROM ("file:///club.csv") AS row match(a:Club{name:row.club})-[r:played_with]->(b:Club) WITH a,sum(toInteger(last(r.score))) AS Home_concede OPTIONAL MATCH (a)<-[r:played_with]-(b:Club) WITH a,Home_concede, sum(toInteger(head(r.score))) AS Away_concede RETURN a.name, Home_concede+Away_concede AS Total_concede ORDER BY Total_concede DESC LIMIT 5 -- Display top five teams that have best winning records. LOAD CSV WITH HEADERS FROM ("file:///club.csv") AS row match(a:Club{name:row.club})-[r:played_with]->(b:Club) WHERE r.score[0]>r.score[1] WITH a, count(r) as result1 match(a:Club)<-[r:played_with]-(b:Club) WHERE r.score[0]<r.score[1] WITH a,result1, count(r) as result2 return a.name AS CLUB, result1+result2 AS WINNING_RECORDS ORDER BY WINNING_RECORDS DESC LIMIT 5; -- Display top five teams with best home winning records. LOAD CSV WITH HEADERS FROM ("file:///club.csv") AS row match(a:Club{name:row.club})-[r:played_with]->(b:Club) WHERE r.score[0]>r.score[1] RETURN a.name, count(r) AS HOME_WINNIG_RECORDS ORDER BY HOME_WINNIG_RECORDS DESC LIMIT 5; -- Display top five teams with worst home losing recording. LOAD CSV WITH HEADERS FROM ("file:///club.csv") AS row match(a:Club{name:row.club})-[r:played_with]->(b:Club) WHERE r.score[0]<r.score[1] RETURN a.name, count(r) AS WORST_HOME_RECORD ORDER BY WORST_HOME_RECORD DESC LIMIT 5; -- Which teams had most “draw”? LOAD CSV WITH HEADERS FROM ("file:///club.csv") AS row match(a:Club{name:row.club})-[r:played_with]->(b:Club) WHERE r.score[0]=r.score[1] return a.name AS CLUB, count(r) AS DRAWS ORDER BY DRAWS DESC ; -- 10) display the team with most consecutive “wins”. MATCH (a:Club {name:'Arsenal FC'})-[r:played_with]-(:Club) WITH ((CASE a.name WHEN r.home THEN 1 ELSE -1 END) * (TOINT(r.score[0]) - TOINT(r.score[1]))) > 0 AS win, r ORDER BY TOINT(r.time) RETURN REDUCE(s = {max: 0, curr: 0}, w IN COLLECT(win) | CASE WHEN w THEN { max: CASE WHEN s.max < s.curr + 1 THEN s.curr + 1 ELSE s.max END, curr: s.curr + 1} ELSE {max: s.max, curr: 0} END ).max AS result;
true
45ac73dc7271d1da7672807d1c6c2444f8d0ca0b
SQL
ProgHazem/Template-16-php3
/books.sql
UTF-8
1,485
3.09375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Apr 08, 2018 at 12:06 AM -- Server version: 5.7.19 -- PHP Version: 5.6.31 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `books` -- -- -------------------------------------------------------- -- -- Table structure for table `books` -- DROP TABLE IF EXISTS `books`; CREATE TABLE IF NOT EXISTS `books` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `TITLE` varchar(40) DEFAULT NULL, `AUTHOR` varchar(40) DEFAULT NULL, `ACTIVE` bit(1) DEFAULT NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1; -- -- Dumping data for table `books` -- INSERT INTO `books` (`ID`, `TITLE`, `AUTHOR`, `ACTIVE`) VALUES (1, 'DOT.NET', 'MICROSOFT1', b'0'), (2, 'ASP.NET4', 'MICROSOFT', b'1'), (3, 'PHP4', 'ZEND', b'0'), (4, 'PHP5', 'ZEND', b'0'), (5, 'HTML5', 'W3S', b'0'), (6, 'JAVASCRIPT', 'W3S', b'0'), (7, 'BOOTSTRAP3', 'TWITTER', b'0'); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
63568bd037a6ff306e5525cd10c553117004c65d
SQL
CassioRubens-CR/projects-developed-in-trybe
/Projects_Back_End/sd-06-mysql-one-for-all/desafio6.sql
UTF-8
1,416
3.921875
4
[]
no_license
-- Tendo como base o valor dos planos e o plano que cada pessoa usuária cadastrada possui no banco, queremos algumas informações sobre o faturamento da empresa. -- Crie uma VIEW chamada faturamento_atual que deve exibir quatro dados: -- A primeira coluna deve ter o alias "faturamento_minimo" e exibir o menor valor de plano existente para uma pessoa usuária. -- A segunda coluna deve ter o alias "faturamento_maximo" e exibir o maior valor de plano existente para uma pessoa usuária. -- A terceira coluna deve ter o alias "faturamento_medio" e exibir o valor médio dos planos possuídos por pessoas usuárias até o momento. -- Por fim, a quarta coluna deve ter o alias "faturamento_total" e exibir o valor total obtido com os planos possuídos por pessuas usuárias. -- Para cada um desses dados, por se tratarem de valores monetários, deve-se arredondar o faturamento usando apenas duas casas decimais. -- USE SpotifyClone; -- DROP DATABASE IF EXISTS faturamento_atual; CREATE VIEW `faturamento_atual` AS SELECT ROUND(MIN(SpotifyClone.plano.plano_valor), 2) AS faturamento_minimo, ROUND(MAX(SpotifyClone.plano.plano_valor), 2) AS faturamento_maximo, ROUND(AVG(SpotifyClone.plano.plano_valor), 2) AS faturamento_medio, ROUND(SUM(SpotifyClone.plano.plano_valor), 2) AS faturamento_total FROM SpotifyClone.usuario INNER JOIN SpotifyClone.plano ON SpotifyClone.plano.plano_id = SpotifyClone.usuario.plano_id;
true
49d4c4630e6f0dc485e99c55463ac4c864af83b3
SQL
aichouramine/openclassrooms-concevez-votre-site-web-avec-php-et-mysql
/tp-un-mini-chat/openclassrooms_concevez_votre_site_web_avec_php_et_mysql.sql
UTF-8
1,780
2.921875
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Apr 26, 2017 at 07:55 -- Server version: 10.1.21-MariaDB -- PHP Version: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `openclassrooms_concevez_votre_site_web_avec_php_et_mysql` -- -- -------------------------------------------------------- -- -- Table structure for table `minichat` -- CREATE TABLE `minichat` ( `id` int(11) NOT NULL, `pseudo` varchar(255) NOT NULL, `message` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `minichat` -- INSERT INTO `minichat` (`id`, `pseudo`, `message`) VALUES (3, 'M@teo21', 'Bonjour tout le monde !'), (4, 'M@teo21', 'Mon script marche bien, n\'est-ce pas ? :o)'), (5, 'Tom', 'Ouais, c\'est génial on va pouvoir discuter !'), (6, 'M@teo21', 'Qu\'en pense-tu John ?'), (7, 'John', 'C\'est pas mal du tout, c\'est toi qui l\'a fait ?'), (8, 'Tom', 'Oui, il a appris ça sur www.siteduzero.com -p'); -- -- Indexes for dumped tables -- -- -- Indexes for table `minichat` -- ALTER TABLE `minichat` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `minichat` -- ALTER TABLE `minichat` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
258d0f874d0746dca34aea78abe8ec1bc847124f
SQL
khj809/khjlji-wedding-invitation
/hasura/migrations/default/1659880280375_init/up.sql
UTF-8
1,854
3.421875
3
[]
no_license
SET check_function_bodies = false; CREATE TABLE public."Comments" ( id text DEFAULT gen_random_uuid() NOT NULL, text text NOT NULL, "userId" text NOT NULL, "createdAt" timestamp with time zone DEFAULT now() NOT NULL ); CREATE TABLE public."Gifts" ( id text DEFAULT gen_random_uuid() NOT NULL, name text NOT NULL, image text NOT NULL, link text NOT NULL ); CREATE TABLE public."Reservations" ( id text DEFAULT gen_random_uuid() NOT NULL, "giftId" text NOT NULL, "userId" text NOT NULL, text text NOT NULL, "createdAt" timestamp with time zone DEFAULT now() ); CREATE TABLE public."Users" ( id text DEFAULT gen_random_uuid() NOT NULL, name text NOT NULL, provider text NOT NULL, key text NOT NULL ); ALTER TABLE ONLY public."Comments" ADD CONSTRAINT "Comments_pkey" PRIMARY KEY (id); ALTER TABLE ONLY public."Gifts" ADD CONSTRAINT "Gifts_pkey" PRIMARY KEY (id); ALTER TABLE ONLY public."Reservations" ADD CONSTRAINT "Reservations_pkey" PRIMARY KEY (id); ALTER TABLE ONLY public."Reservations" ADD CONSTRAINT "Reservations_userId_giftId_key" UNIQUE ("userId", "giftId"); ALTER TABLE ONLY public."Users" ADD CONSTRAINT "Users_pkey" PRIMARY KEY (id); ALTER TABLE ONLY public."Users" ADD CONSTRAINT "Users_provider_key_key" UNIQUE (provider, key); ALTER TABLE ONLY public."Comments" ADD CONSTRAINT "Comments_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."Users"(id) ON UPDATE CASCADE ON DELETE RESTRICT; ALTER TABLE ONLY public."Reservations" ADD CONSTRAINT "Reservations_giftId_fkey" FOREIGN KEY ("giftId") REFERENCES public."Gifts"(id) ON UPDATE CASCADE ON DELETE RESTRICT; ALTER TABLE ONLY public."Reservations" ADD CONSTRAINT "Reservations_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."Users"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
true
9bf620c0980ebf57f13fb2c915d020a0a66dfec7
SQL
spicerg1978/orapy
/sql/tablespaces.sql
UTF-8
1,886
3.40625
3
[]
no_license
REM Script to list all tablespaces and its characteristics REM Version 9i REM REM Gareth Spicer REM SET VERIFY OFF ECHO OFF PAGES 999 LINES 80 FEEDBACK OFF TTITLE "ALL TABLESPACES INFORMATION" COL TABLESPACE_NAME FORMAT A25 COL EXT_SIZE FORMAT A17 HEADING "EXT_SIZE I/N/M" COL EXT_LIMITS FORMAT A18 HEADING "EXT_LIMITS N/X/P" COL STATUS FORMAT A1 HEADING S COL CONTENTS FORMAT A1 HEADING T COL LOGGING FORMAT A1 HEADING L COL EXTENT_MANAGEMENT FORMAT A1 HEADING M COL PLUGGED_IN FORMAT A1 HEADING P COL ALLOCATION_TYPE FORMAT A1 HEADING A SPOOL c:/sqlscripts/spool/tablespaces.lst SELECT TABLESPACE_NAME , (INITIAL_EXTENT/1024 ||' /' || NEXT_EXTENT/1024 || ' /' || MIN_EXTLEN/1024) EXT_SIZE, (MIN_EXTENTS || ' /' || DECODE(MAX_EXTENTS,2147483645,'UNL',MAX_EXTENTS) || ' /' || PCT_INCREASE) EXT_LIMITS, DECODE(STATUS, 'ONLINE','O', 'OFFLINE','F', 'READ ONLY','R','U') STATUS, DECODE(CONTENTS, 'PERMANENT','P', 'TEMPORARY','T', 'O') CONTENTS, DECODE(LOGGING, 'LOGGING','Y','N') LOGGING, SUBSTR(EXTENT_MANAGEMENT, 1,1) EXTENT_MANAGEMENT, DECODE(ALLOCATION_TYPE, 'USER','U', 'SYSTEM','S', 'UNIFORM','F', 'O') ALLOCATION_TYPE, SUBSTR(PLUGGED_IN, 1,1) PLUGGED_IN FROM DBA_TABLESPACES ORDER BY TABLESPACE_NAME; PROMPT PROMPT EXT_SIZE => I-INITIAL, N-NEXT, M-MINIMUM_EXTENT PROMPT EXT_LIMITS => N-MIN, X-MAX, P-PCTINCREASE PROMPT S: STATUS => O-ONLINE, F-OFFLINE, R-READ ONLY, U-UNKNOWN PROMPT T: CONTENTS => T-TEMPORARY, P-PERMANENT, O-OTHER PROMPT L: LOGGING => Y-YES, N-NO PROMPT M: MANAGEMENT => L-LOCAL, D-DICTIONARY PROMPT A: ALLOCATION => U-USER, S-SYSTEM, F-UNIFORM PROMPT P: PLUGGED IN => Y-YES, N-NO SPOOL OFF PROMPT PROMPT Output saved at c:/sqlscripts/spool/tablespaces.lst SET VERIFY ON ECHO OFF PAGES 24 LINES 80 FEEDBACK ON TTITLE OFF
true
08fe3fe71a449032cb234d8d35f9deb5bffd1702
SQL
SaloValdez/POO_VENT_MODAL
/Extras/DatabaseCode.sql
UTF-8
611
2.984375
3
[ "Apache-2.0" ]
permissive
create table if not exists profiles( idProfile INT unsigned not null auto_increment, profName VARCHAR(50) character set utf8 collate utf8_spanish_ci, primary key(idProfile) )engine=myisam character set utf8 collate utf8_spanish_ci; create table if not exists users( idUser INT unsigned not null auto_increment, logUser VARCHAR(25) character set utf8 collate utf8_spanish_ci, pasUser VARCHAR(25) character set utf8 collate utf8_spanish_ci, idProf INT not null, primary key(idUser), constraint fk1 foreign key(idProf) references profiles(idProfile) )engine=myisam character set utf8 collate utf8_spanish_ci;
true
d0770bc3982497a3e582badeb82ba179761f5a22
SQL
MmahdiM79/tutiter
/SQL queries/unfollow_procedure.sql
UTF-8
858
3.328125
3
[]
no_license
DELIMITER // CREATE PROCEDURE `unfollow`(IN `username` VARCHAR(20), OUT res BOOL) `scope`: BEGIN -- check given username IF NOT usernameEXIST(username) THEN SELECT 'given username does not exist!' as `status`; SELECT FALSE INTO res; LEAVE scope; END IF; SET @`doer` = getDOERid(); -- find the doer of this procedure -- check doer following list IF userID(username) NOT IN (SELECT user2 FROM follow WHERE user1 = @doer) THEN SELECT 'given username is not in your following list' as `status`; SELECT FALSE INTO res; LEAVE scope; END IF; -- unfollow given username DELETE FROM follow WHERE user1 = @doer AND userID(username); -- set resualt SELECT 'given username unfollowed successfully!' as `status`; SELECT TRUE INTO res; END;
true
63fc77fee2fe4a30ff730b1be779e637cac75ed2
SQL
Pulvex24/Minsa
/db/db.sql
UTF-8
4,517
3.609375
4
[ "MIT" ]
permissive
CREATE DATABASE MINSA; use MINSA; CREATE TABLE SECCIONES ( ID_SECCION int NOT NULL AUTO_INCREMENT PRIMARY KEY, SECCION varchar(40) NOT NULL, FECHA_CREACION DATE ); CREATE TABLE ROLES ( ID_ROL int NOT NULL AUTO_INCREMENT PRIMARY KEY, ID_SECCION int NOT NULL, ROL varchar(25) NOT NULL, FECHA_CREACION DATE, FOREIGN KEY (ID_SECCION) REFERENCES SECCIONES(ID_SECCION) ); CREATE TABLE PERMISOS ( ID_PERMISO int NOT NULL AUTO_INCREMENT PRIMARY KEY, ID_ROL int NOT NULL, P_CONSULTAR VARCHAR(1), P_AGREGAR VARCHAR(1), P_MODIFICAR VARCHAR(1), P_ELIMINAR VARCHAR(1), P_TODO VARCHAR(1), FOREIGN KEY (ID_ROL) REFERENCES ROLES(ID_ROL) ); CREATE TABLE MEDICOS ( ID_MEDICO int NOT NULL AUTO_INCREMENT PRIMARY KEY, NOMBRE1 VARCHAR(20) NOT NULL, NOMBRE2 VARCHAR(20), APELLIDO1 VARCHAR(20) NOT NULL, APELLIDO2 VARCHAR(20), ESPECIALIDAD1 VARCHAR(40), ESPECIALIDAD2 VARCHAR(40), ESPECIALIDAD3 VARCHAR(40), OTRAS TEXT, IDONEIDAD VARCHAR(40) NOT NULL, CEDULA VARCHAR(40) NOT NULL, SEXO VARCHAR (1) NOT NULL, TELEFONO VARCHAR (20), CORREO VARCHAR(40) ); CREATE TABLE ENFERMERAS ( ID_MEDICO int NOT NULL AUTO_INCREMENT PRIMARY KEY, NOMBRE1 VARCHAR(20) NOT NULL, NOMBRE2 VARCHAR(20), APELLIDO1 VARCHAR(20) NOT NULL, APELLIDO2 VARCHAR(20), ESPECIALIDAD VARCHAR(40), OTRAS TEXT, IDONEIDAD VARCHAR(40) NOT NULL, CEDULA VARCHAR(40) NOT NULL, SEXO VARCHAR (1) NOT NULL, TELEFONO VARCHAR (20), CORREO VARCHAR(40) ); CREATE TABLE USUARIOS ( ID_USUARIO int NOT NULL AUTO_INCREMENT PRIMARY KEY, ID_ROL int NOT NULL, NOMBRE VARCHAR(20) NOT NULL, APELLIDO VARCHAR(20) NOT NULL, CORREO VARCHAR(40), NICK VARCHAR(25) NOT NULL, PASS VARCHAR(25) NOT NULL, FOREIGN KEY (ID_ROL) REFERENCES ROLES(ID_ROL) ); CREATE TABLE CUARTOS ( ID_CUARTO int NOT NULL AUTO_INCREMENT PRIMARY KEY, CUARTO varchar(40) NOT NULL, ESTADO INT DEFAULT 0 ); CREATE TABLE AREAS ( ID_AREA int NOT NULL AUTO_INCREMENT PRIMARY KEY, AREA varchar(40) NOT NULL, CUARTOS INT, CAMAS INT ); CREATE TABLE PROVINCIAS ( ID_PROVINCIA int NOT NULL AUTO_INCREMENT PRIMARY KEY, PROVINCIA VARCHAR(40) ); CREATE TABLE DISTRITOS ( ID_DISTRITO int NOT NULL AUTO_INCREMENT PRIMARY KEY, ID_PROVINCIA int NOT NULL, DISTRITO VARCHAR(40), FOREIGN KEY (ID_PROVINCIA) REFERENCES PROVINCIAS(ID_PROVINCIA) ); CREATE TABLE CORREGIMIENTOS ( ID_CORREGIMIENTO int NOT NULL AUTO_INCREMENT PRIMARY KEY, ID_PROVINCIA int NOT NULL, ID_DISTRITO int NOT NULL, CORREGIMIENTO VARCHAR(40), FOREIGN KEY (ID_PROVINCIA) REFERENCES PROVINCIAS(ID_PROVINCIA), FOREIGN KEY (ID_DISTRITO) REFERENCES DISTRITOS(ID_DISTRITO) ); CREATE TABLE PACIENTES ( ID_PACIENTE int NOT NULL AUTO_INCREMENT PRIMARY KEY, ID_AREA int NOT NULL, ID_PROVINCIA int NOT NULL, ID_DISTRITO int NOT NULL, ID_CORREGIMIENTO int NOT NULL, NOMBRE1 VARCHAR(20) NOT NULL, NOMBRE2 VARCHAR(20), APELLIDO1 VARCHAR(20) NOT NULL, APELLIDO2 VARCHAR(20), DIAGNOSTICO TEXT, PROCEDENCIA VARCHAR(40), SEGURO VARCHAR(40), RESPONSABLES TEXT, EDAD int NOT NULL, FECHA_NAC DATE NOT NULL, CEDULA VARCHAR(40) NOT NULL, SEXO VARCHAR (1) NOT NULL, TIPAJE VARCHAR (10) NOT NULL, TELEFONO VARCHAR (20), RELIGION VARCHAR(40), BARRIO VARCHAR (40), CALLE VARCHAR (20), NUMCASA int, ESTADO INT DEFAULT 0, FECHA DATE, ID_CUARTO int NOT NULL, ID_CAMA int NOT NULL, FOREIGN KEY (ID_AREA) REFERENCES AREAS(ID_AREA), FOREIGN KEY (ID_CUARTO) REFERENCES CUARTOS(ID_CUARTO), FOREIGN KEY (ID_CAMA) REFERENCES CAMAS(ID_CAMA), FOREIGN KEY (ID_PROVINCIA) REFERENCES PROVINCIAS(ID_PROVINCIA), FOREIGN KEY (ID_DISTRITO) REFERENCES DISTRITOS(ID_DISTRITO), FOREIGN KEY (ID_CORREGIMIENTO) REFERENCES CORREGIMIENTOS(ID_CORREGIMIENTO) ); CREATE TABLE ENFERMERIAS ( ID_ENFERMERIA int NOT NULL AUTO_INCREMENT PRIMARY KEY, ID_PACIENTE int NOT NULL, ID_MEDICO int NOT NULL, DIAGNOSTICO TEXT, PROCEDENCIA VARCHAR(40), SEGURO VARCHAR(40), RESPONSABLES TEXT, SVITALES VARCHAR(20), FLLEGADA VARCHAR(20), CONDICION VARCHAR(20), GLASGOWVERVAL INT, GLASGOWVOJOS INT, GLASGOWMOTOR INT, FECHA DATE, TURNO VARCHAR (20), OBSERVACION TEXT, FOREIGN KEY (ID_PACIENTE) REFERENCES PACIENTES(ID_PACIENTE), FOREIGN KEY (ID_MEDICO) REFERENCES MEDICOS(ID_MEDICO) ); CREATE TABLE HMEDI ( ID_HMEDICAM int NOT NULL AUTO_INCREMENT PRIMARY KEY, ID_PACIENTE int NOT NULL, FECHA DATE, FOREIGN KEY (ID_PACIENTE) REFERENCES PACIENTES(ID_PACIENTE) ); CREATE TABLE DIETAS ( ID_DIETA int NOT NULL AUTO_INCREMENT PRIMARY KEY, ID_PACIENTE int NOT NULL, FECHA DATE, DIETA VARCHAR (20), NOTA TEXT, FOREIGN KEY (ID_PACIENTE) REFERENCES PACIENTES(ID_PACIENTE) );
true
8892f8a36b0616173af31e94966d09e0737bdc66
SQL
etassone1974/sql-challenge
/EmployeeSQL/query.sql
UTF-8
2,427
4.78125
5
[]
no_license
-- Data Analysis -- 1. List the following details of each employee: employee number, last name, first name, sex, and salary SELECT e.emp_no, e.last_name, e.first_name, e.sex, s.salary FROM employees as e INNER JOIN salaries as s ON e.emp_no = s.emp_no ORDER BY e.emp_no; -- 2. List first name, last name, and hire date for employees who were hired in 1986 SELECT e.emp_no, e.last_name, e.hire_date FROM employees as e WHERE e.hire_date >= '1986-01-01' AND e.hire_date <= '1986-12-31'; -- 3. List the manager of each department with the following information: department number, department name, the manager's employee number, last name, first name SELECT d1.dept_no as "Dept No", d1.dept_name AS "Dept Name", e.emp_no AS "Manager Emp No", e.last_name as "Manager Last Name", e.first_name as "Manager First Name" FROM departments as d1 INNER JOIN dept_manager as dm ON d1.dept_no = dm.dept_no INNER JOIN employees as e ON dm.emp_no = e.emp_no; -- 4. List the department of each employee with the following information: employee number, last name, first name, and department name SELECT e.emp_no, e.last_name, e.first_name, d1.dept_name FROM employees as e INNER JOIN dept_emp as de ON e.emp_no = de.emp_no INNER JOIN departments as d1 ON de.dept_no = d1.dept_no; -- 5. List first name, last name, and sex for employees whose first name is "Hercules" and last names begin with "B" SELECT e.first_name, e.last_name, e.sex FROM employees as e WHERE e.last_name LIKE 'B%' AND e.first_name = 'Hercules'; -- Create view for use in queries 6 and 7 CREATE VIEW employee_depts AS SELECT e.emp_no, e.last_name, e.first_name, d1.dept_name FROM employees as e INNER JOIN dept_emp as de ON e.emp_no = de.emp_no INNER JOIN departments as d1 ON de.dept_no = d1.dept_no; -- 6. List all employees in the Sales department, including their employee number, last name, first name, and department name SELECT * FROM employee_depts WHERE dept_name = 'Sales'; -- 7. List all employees in the Sales and Development departments, including their employee number, last name, first name, and department name SELECT * FROM employee_depts WHERE dept_name IN ('Sales', 'Development'); -- 8. In descending order, list the frequency count of employee last names, i.e., how many employees share each last name SELECT last_name AS "Last Name", COUNT(last_name) AS "Last Name Count" FROM employees GROUP BY "Last Name" ORDER BY "Last Name Count" DESC;
true
a39b2f730f292d0eefc5f82635eba15fd8629ce0
SQL
Shuttle/Shuttle.Esb.Sql.Subscription
/Shuttle.Esb.Sql.Subscription/.scripts/Npgsql/SubscriptionManagerCreate.sql
UTF-8
337
2.609375
3
[ "BSD-3-Clause" ]
permissive
CREATE TABLE public.subscriber_message_type ( message_type character varying(250) NOT NULL, inbox_work_queue_uri character varying(130) NOT NULL, CONSTRAINT pk_subscriber_message_type PRIMARY KEY (message_type, inbox_work_queue_uri) ) WITH ( OIDS=FALSE ); ALTER TABLE public.subscriber_message_type OWNER TO postgres;
true
4282487996f6f74ab0ebec4cf86d20e7b2cf39e1
SQL
atuinsh/atuin
/atuin-client/migrations/20210422143411_create_history.sql
UTF-8
440
2.984375
3
[ "MIT" ]
permissive
-- Add migration script here create table if not exists history ( id text primary key, timestamp integer not null, duration integer not null, exit integer not null, command text not null, cwd text not null, session text not null, hostname text not null, unique(timestamp, cwd, command) ); create index if not exists idx_history_timestamp on history(timestamp); create index if not exists idx_history_command on history(command);
true
890ac9ff34406bd3a9b89b61e7291269a26487b6
SQL
gurpreet19/ec198392_wht
/Database/configuration/03_02_headless_tool/Delta_WST/SourceViewDefinitions/V_TRANS_CONFIG.sql
UTF-8
1,913
3.171875
3
[]
no_license
CREATE OR REPLACE FORCE EDITIONABLE VIEW "V_TRANS_CONFIG" ("MAPPING_NO", "TEMPLATE_NO", "TEMPLATE_CODE", "SOURCE_ID", "TAG_ID", "FROM_UNIT", "TO_UNIT", "DATA_CLASS", "ATTRIBUTE", "PK_ATTR_1", "PK_VAL_1", "PK_ATTR_2", "PK_VAL_2", "PK_ATTR_3", "PK_VAL_3", "PK_ATTR_4", "PK_VAL_4", "PK_ATTR_5", "PK_VAL_5", "PK_ATTR_6", "PK_VAL_6", "PK_ATTR_7", "PK_VAL_7", "PK_ATTR_8", "PK_VAL_8", "PK_ATTR_9", "PK_VAL_9", "PK_ATTR_10", "PK_VAL_10", "ACTIVE", "DESCRIPTION", "LAST_TRANSFER", "LAST_TRANSFER_WRITE", "RECORD_STATUS", "CREATED_BY", "CREATED_DATE", "LAST_UPDATED_BY", "LAST_UPDATED_DATE", "REV_NO", "REV_TEXT", "FROM_TIME", "TO_TIME") AS ( ------------------------------------------------------------------------------------ -- v_trans_config -- -- $Revision: 1.2 $ -- -- Purpose: -- Note: -- -- When Who Why -- ---------- --- -------- SELECT M.MAPPING_NO, M.TEMPLATE_NO, (SELECT TEMPLATE_CODE FROM TRANS_TEMPLATE T WHERE T.TEMPLATE_NO = M.TEMPLATE_NO) TEMPLATE_CODE, M.SOURCE_ID, M.TAG_ID, M.FROM_UNIT, M.TO_UNIT, M.DATA_CLASS, M.ATTRIBUTE, M.PK_ATTR_1, M.PK_VAL_1, M.PK_ATTR_2, M.PK_VAL_2, M.PK_ATTR_3, M.PK_VAL_3, M.PK_ATTR_4, M.PK_VAL_4, M.PK_ATTR_5, M.PK_VAL_5, M.PK_ATTR_6, M.PK_VAL_6, M.PK_ATTR_7, M.PK_VAL_7, M.PK_ATTR_8, M.PK_VAL_8, M.PK_ATTR_9, M.PK_VAL_9, M.PK_ATTR_10, M.PK_VAL_10, M.ACTIVE, M.DESCRIPTION, TI.LAST_TRANSFER, TI.LAST_TRANSFER_WRITE, M.RECORD_STATUS, M.CREATED_BY, M.CREATED_DATE, M.LAST_UPDATED_BY, M.LAST_UPDATED_DATE, M.REV_NO, M.REV_TEXT, M.FROM_TIME, M.TO_TIME FROM TRANS_MAPPING M, TRANS_TARGET_TIME TI WHERE M.TAG_ID = TI.TARGET_TAGID AND TI.TARGET_SOURCEID = M.SOURCE_ID )
true
2406693ad958737f9e884f46b813d2fd8d817357
SQL
KAI10/Database-for-Restaurant-Management
/PL_SQL/LOGSFOOD.sql
UTF-8
931
3.078125
3
[]
no_license
CREATE or REPLACE TRIGGER LOGSFOOD before INSERT OR DELETE OR UPDATE OF "food_id", "food_price" ON "rFoodItem" FOR each ROW DECLARE V_ChangeType CHAR(1); v_id NUMBER; old_price NUMBER; new_price NUMBER; BEGIN IF INSERTING THEN V_ChangeType := 'I'; v_id := :new."food_id"; INSERT into "rLogs"("changed_by", "change_type", "time", "food_id") VALUES (USER, V_ChangeType, sysdate, v_id); ELSIF UPDATING THEN V_ChangeType := 'U'; old_price := :old."food_price"; new_price := :new."food_price"; INSERT into "rLogs"("changed_by", "change_type", "time", "old_food_price", "new_food_price") VALUES (USER, V_ChangeType, sysdate, old_price, new_price); ELSE V_ChangeType := 'D'; v_id := :old."food_id"; INSERT into "rLogs"("changed_by", "change_type", "time", "food_id") VALUES (USER, V_ChangeType, sysdate, v_id); END IF; END LOGSEMPLOYEE; /
true
6dc8705590a3d0efcb967a79cf72048565ae4637
SQL
ChanRong/job-plus
/data/sql/task_manage.sql
UTF-8
12,451
3.359375
3
[ "Apache-2.0" ]
permissive
/* Navicat Premium Data Transfer Source Server : localhost_3306 Source Server Type : MySQL Source Server Version : 50726 Source Host : localhost:3306 Source Schema : task_manage Target Server Type : MySQL Target Server Version : 50726 File Encoding : 65001 Date: 02/07/2020 17:12:50 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for t_menu -- ---------------------------- DROP TABLE IF EXISTS `t_menu`; CREATE TABLE `t_menu` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '菜单ID', `menu_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '菜单名称', `menu_url` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'Controller路径', `menu_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '菜单编码', `parent_id` int(8) DEFAULT NULL COMMENT '父菜单ID', `menu_type` int(1) DEFAULT 0 COMMENT '菜单类型:0-菜单1-按钮', `order_num` int(4) DEFAULT 99 COMMENT '显示序号', `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人', `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间', `updator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人', `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间', `deleted` int(1) DEFAULT 0 COMMENT '删除状态:0-存在1-已删除', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_menu -- ---------------------------- INSERT INTO `t_menu` VALUES (1, '跳转任务列表页面', '/index', NULL, 0, 0, 99, NULL, NULL, NULL, NULL, 0); INSERT INTO `t_menu` VALUES (2, '跳转执行记录页面', '/taskrecords', NULL, 0, 0, 99, NULL, NULL, NULL, NULL, 0); INSERT INTO `t_menu` VALUES (3, '跳转报错日志页面', '/taskerrors', NULL, 0, 0, 0, NULL, NULL, NULL, NULL, 0); INSERT INTO `t_menu` VALUES (4, '跳转新增任务页面', '/addtask', NULL, 0, 1, 99, NULL, NULL, NULL, NULL, 0); INSERT INTO `t_menu` VALUES (5, '跳转编辑任务页面', '/updatetask', NULL, 0, 1, 99, NULL, NULL, NULL, NULL, 0); INSERT INTO `t_menu` VALUES (6, 'mian', '/main', NULL, 0, 0, 99, NULL, NULL, NULL, NULL, 0); -- ---------------------------- -- Table structure for t_role -- ---------------------------- DROP TABLE IF EXISTS `t_role`; CREATE TABLE `t_role` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '角色id', `role_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '角色名称', `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人', `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间', `updator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人', `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_role -- ---------------------------- INSERT INTO `t_role` VALUES (1, 'ROLE_ADMIN', NULL, NULL, NULL, NULL); INSERT INTO `t_role` VALUES (2, 'ROLE_DEV', NULL, NULL, NULL, NULL); INSERT INTO `t_role` VALUES (3, 'ROLE_USER', NULL, NULL, NULL, NULL); -- ---------------------------- -- Table structure for t_role_menus -- ---------------------------- DROP TABLE IF EXISTS `t_role_menus`; CREATE TABLE `t_role_menus` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '角色菜单id', `role_id` int(8) DEFAULT NULL COMMENT '角色id', `menu_id` int(8) DEFAULT NULL COMMENT '菜单id', `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人', `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间', `updator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人', `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_role_menus -- ---------------------------- INSERT INTO `t_role_menus` VALUES (1, 1, 1, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (2, 1, 2, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (3, 1, 3, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (4, 1, 4, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (5, 1, 5, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (6, 1, 6, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (7, 2, 1, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (8, 2, 2, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (9, 2, 3, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (10, 2, 4, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (11, 2, 5, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (12, 2, 6, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (13, 3, 1, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (14, 3, 2, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (15, 3, 4, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (16, 3, 5, NULL, NULL, NULL, NULL); INSERT INTO `t_role_menus` VALUES (17, 3, 6, NULL, NULL, NULL, NULL); -- ---------------------------- -- Table structure for t_task_details -- ---------------------------- DROP TABLE IF EXISTS `t_task_details`; CREATE TABLE `t_task_details` ( `id` int(11) NOT NULL AUTO_INCREMENT, `task_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务编号', `task_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务名称', `group_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '分组编号', `group_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '分组名称', `task_desc` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '任务描述', `corn_rule` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'CRON表达式', `send_type` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '请求方式', `send_url` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '请求地址', `send_param` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '请求参数', `status` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '任务状态', `next_execute_time` datetime(0) NOT NULL COMMENT '下次执行时间', `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人', `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间', `updator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人', `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE, INDEX `TaskAndGroupIndex`(`task_name`, `group_name`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务信息表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_task_details -- ---------------------------- INSERT INTO `t_task_details` VALUES (20200705, 'T-9f690d82-6276-43a0-a928-ed9030f10f38', 'local-test', 'G-2493d162-c845-4768-9f6e-3f1f09d405fb', 'task-manage', '获取定时任务信息', '0 0/5 * * * ? ', 'GET', '127.0.0.1:8080/tTaskDetails/get/2', '', '1', '2020-07-02 17:15:00', NULL, '2020-07-02 06:50:22', NULL, '2020-07-02 17:12:19'); -- ---------------------------- -- Table structure for t_task_errors -- ---------------------------- DROP TABLE IF EXISTS `t_task_errors`; CREATE TABLE `t_task_errors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `taskExecuteRecordId` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务执行记录Id', `errorKey` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '信息关键字', `errorValue` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '信息内容', `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人', `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间', `updator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人', `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务出错现场信息表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for t_task_records -- ---------------------------- DROP TABLE IF EXISTS `t_task_records`; CREATE TABLE `t_task_records` ( `id` int(11) NOT NULL AUTO_INCREMENT, `task_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务名称', `group_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '分组名称', `send_type` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '请求方式', `send_url` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '请求地址', `send_param` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '请求参数', `return_info` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '返回信息', `execute_time` datetime(0) DEFAULT NULL COMMENT '执行时间', `task_status` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '任务状态', `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人', `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间', `updator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人', `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务执行情况记录表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for t_user -- ---------------------------- DROP TABLE IF EXISTS `t_user`; CREATE TABLE `t_user` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户id', `username` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '用户名', `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '密码', `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人', `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间', `updator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人', `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_user -- ---------------------------- INSERT INTO `t_user` VALUES (1, 'user', '$2a$10$D5E9lza7z8uea6fP/oNOJeuRq/a/y8RXQWslTDONsqxQTPlgW7Hr6', NULL, NULL, NULL, NULL); INSERT INTO `t_user` VALUES (2, 'admin', '$2a$10$on7jUGJN.4CyjPZzyroZce0ugjCQFzA6dRuOTcEFTBLLhe3oYe5Gu', NULL, NULL, NULL, NULL); -- ---------------------------- -- Table structure for t_user_roles -- ---------------------------- DROP TABLE IF EXISTS `t_user_roles`; CREATE TABLE `t_user_roles` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户角色对照ID', `user_id` int(8) DEFAULT NULL COMMENT '用户ID', `role_id` int(8) DEFAULT NULL COMMENT '角色ID', `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人', `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间', `updator` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人', `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_user_roles -- ---------------------------- INSERT INTO `t_user_roles` VALUES (1, 2, 1, NULL, NULL, NULL, NULL); INSERT INTO `t_user_roles` VALUES (2, 1, 3, NULL, NULL, NULL, NULL); SET FOREIGN_KEY_CHECKS = 1;
true
ef279090848fbdcae34476e3101b155f778eeed9
SQL
mullerpaul/DBAstuff
/warehouse/resources/migration/iqprodm/2018Q1/iqn-39246_curr_conv_dim_seq.sql
UTF-8
590
3.296875
3
[]
no_license
/* The purpose of this script is to drop and recreate the sequence, curr_conv_dim_seq, which is used for DM_CURRENCY_CONVERSION_RATES. Doing this because the sequence is out of sync with the table. */ DECLARE v_last_seq_id PLS_INTEGER; BEGIN EXECUTE IMMEDIATE 'DROP SEQUENCE curr_conv_dim_seq'; SELECT MAX(curr_conv_dim_id) + 1 INTO v_last_seq_id FROM dm_currency_conversion_rates; EXECUTE IMMEDIATE 'CREATE SEQUENCE curr_conv_dim_seq MINVALUE 1 INCREMENT BY 1 START WITH '||v_last_seq_id; END; /
true
a80063244a323dce8e5f0087f53ee4bc2c7a3899
SQL
NetCrackerGroup/ProjectFolkTaxi
/src/main/resources/db/migration/V1.0__init_schema.sql
UTF-8
9,572
3.40625
3
[]
no_license
CREATE TABLE public.Passenger_Rating ( User_ID BIGINT NOT NULL, Average_Mark NUMERIC, CONSTRAINT passenger_rating_pk PRIMARY KEY (User_ID) ); CREATE TABLE public.Moderator ( Moderator_ID BIGINT NOT NULL, FIO VARCHAR NOT NULL, CONSTRAINT moderator_pk PRIMARY KEY (Moderator_ID) ); CREATE TABLE public.Driver_Rating ( User_ID BIGINT NOT NULL, Average_Mark NUMERIC DEFAULT 0 NOT NULL, CONSTRAINT driver_rating_pk PRIMARY KEY (User_ID) ); CREATE SEQUENCE group_id_seq; CREATE TABLE public.Group_1 ( Group_ID BIGINT NOT NULL default nextval('group_id_seq'), Group_Name VARCHAR NOT NULL, Link VARCHAR NOT NULL, CONSTRAINT group_1_pk PRIMARY KEY (Group_ID) ); CREATE SEQUENCE city_id_seq; CREATE TABLE public.City ( City_ID BIGINT NOT NULL default nextval('city_id_seq'), City_Name VARCHAR NOT NULL, City_Map VARCHAR NOT NULL, CONSTRAINT city_pk PRIMARY KEY (City_ID) ); CREATE SEQUENCE user_id_seq start with 7; CREATE TYPE Role_names AS ENUM ( 'ROLE_ADMIN', 'ROLE_USER'); CREATE TABLE public.User_1 ( User_ID BIGINT NOT NULL default nextval('user_id_seq'), City_ID BIGINT NOT NULL, Role_name VARCHAR NOT NULL, FIO VARCHAR NOT NULL, Driver_Rating DOUBLE PRECISION, Passenger_Rating DOUBLE PRECISION, Email VARCHAR, Phone_Number VARCHAR, Password VARCHAR, CONSTRAINT user_id PRIMARY KEY (User_ID) ); CREATE SEQUENCE review_id_seq; CREATE TABLE public.Review ( Review_ID BIGINT NOT NULL default nextval('review_id_seq'), Is_passenger BOOLEAN NOT NULL, Mark INTEGER NOT NULL, Additional_Text VARCHAR, User_ID BIGINT NOT NULL, CONSTRAINT review_pk PRIMARY KEY (Review_ID) ); CREATE SEQUENCE notification_id_seq; CREATE TABLE public.Notification ( Notification_ID BIGINT NOT NULL default nextval('notification_id_seq'), Text VARCHAR NOT NULL, Delivery_Channel VARCHAR NOT NULL, Was_Watched BOOLEAN NOT NULL, User_ID BIGINT NOT NULL, CONSTRAINT notification_pk PRIMARY KEY (Notification_ID) ); CREATE SEQUENCE report_id_seq; CREATE TABLE public.Report ( Report_ID BIGINT NOT NULL default nextval('report_id_seq'), Report_Text VARCHAR, Report_Reason VARCHAR NOT NULL, Was_Considered BOOLEAN NOT NULL, Moderator_ID BIGINT, User_ID BIGINT NOT NULL, CONSTRAINT report_pk PRIMARY KEY (Report_ID) ); CREATE TABLE public.User_In_Group ( Group_ID BIGINT NOT NULL, User_ID BIGINT NOT NULL, CONSTRAINT user_in_group_pk PRIMARY KEY (Group_ID, User_ID) ); CREATE TABLE public.Group_Moderator ( User_ID BIGINT NOT NULL, Group_ID BIGINT NOT NULL, FIO VARCHAR NOT NULL, CONSTRAINT group_moderator_pk PRIMARY KEY (User_ID) ); CREATE SEQUENCE route_id_seq start with 1007; CREATE TABLE public.Route ( Route_ID BIGINT NOT NULL default nextval('route_id_seq'), City_ID BIGINT NOT NULL, Route_Begin geography NOT NULL, Route_End geography NOT NULL, Price NUMERIC, Driver_ID BIGINT NOT NULL, Group_ID BIGINT, CONSTRAINT route_pk PRIMARY KEY (Route_ID) ); CREATE SEQUENCE schedule_id_seq start with 1000; CREATE TABLE public.Schedule ( Schedule_ID BIGINT NOT NULL default nextval('schedule_id_seq'), Route_ID BIGINT NOT NULL, Time_Of_Journey TIME, CONSTRAINT schedule_pk PRIMARY KEY (Schedule_ID) ); CREATE SEQUENCE chat_id_seq start with 3; CREATE TABLE public.Chat ( Chat_ID BIGINT NOT NULL default nextval('chat_id_seq'), Route_ID BIGINT, Group_ID BIGINT, CONSTRAINT chat_pk PRIMARY KEY (Chat_ID) ); CREATE SEQUENCE message_id_seq start with 15; CREATE TABLE public.Message ( Message_ID BIGINT NOT NULL default nextval('message_id_seq'), Text VARCHAR, Date_Of_Sending TIMESTAMP NOT NULL, Chat_ID BIGINT NOT NULL, User_Message_ID BIGINT NOT NULL, CONSTRAINT message_pk PRIMARY KEY (Message_ID) ); CREATE SEQUENCE journey_id_seq; CREATE TABLE public.Journey ( Journey_ID BIGINT NOT NULL default nextval('journey_id_seq'), Route_ID BIGINT NOT NULL, Date_Of_Journey DATE NOT NULL, Driver_ID BIGINT NOT NULL, CONSTRAINT journey_pk PRIMARY KEY (Journey_ID) ); CREATE TABLE public.Passenger_in_Journey ( Journey_ID BIGINT NOT NULL, User_ID BIGINT NOT NULL, CONSTRAINT passenger_in_journey_pk PRIMARY KEY (Journey_ID, User_ID) ); CREATE TABLE public.Passenger_In_Route ( Route_ID BIGINT NOT NULL, User_ID BIGINT NOT NULL, CONSTRAINT passenger_in_route_pk PRIMARY KEY (Route_ID, User_ID) ); ALTER TABLE public.Driver_Rating ADD CONSTRAINT user_driver_rating_pk FOREIGN KEY (User_ID) REFERENCES public.User_1 (User_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Report ADD CONSTRAINT moderator_report_fk FOREIGN KEY (Moderator_ID) REFERENCES public.Moderator (Moderator_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Group_Moderator ADD CONSTRAINT group_group_moderator_fk FOREIGN KEY (Group_ID) REFERENCES public.Group_1 (Group_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Chat ADD CONSTRAINT group_chat_fk FOREIGN KEY (Group_ID) REFERENCES public.Group_1 (Group_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.User_In_Group ADD CONSTRAINT group_user_in_group_fk FOREIGN KEY (Group_ID) REFERENCES public.Group_1 (Group_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Route ADD CONSTRAINT ______________fk FOREIGN KEY (City_ID) REFERENCES public.City (City_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.User_1 ADD CONSTRAINT city_user_fk FOREIGN KEY (City_ID) REFERENCES public.City (City_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Group_Moderator ADD CONSTRAINT user_group_moderator_fk FOREIGN KEY (User_ID) REFERENCES public.User_1 (User_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.User_In_Group ADD CONSTRAINT user_user_in_group_fk FOREIGN KEY (User_ID) REFERENCES public.User_1 (User_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Report ADD CONSTRAINT user_report_fk FOREIGN KEY (User_ID) REFERENCES public.User_1 (User_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Notification ADD CONSTRAINT user_notification_fk FOREIGN KEY (User_ID) REFERENCES public.User_1 (User_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Passenger_in_Journey ADD CONSTRAINT user_passenger_in_journey_fk FOREIGN KEY (User_ID) REFERENCES public.User_1 (User_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Journey ADD CONSTRAINT user_journey_fk FOREIGN KEY (Driver_ID) REFERENCES public.User_1 (User_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Route ADD CONSTRAINT user_route_fk FOREIGN KEY (Driver_ID) REFERENCES public.User_1 (User_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Passenger_In_Route ADD CONSTRAINT user_passenger_in_route_fk FOREIGN KEY (User_ID) REFERENCES public.User_1 (User_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Passenger_In_Route ADD CONSTRAINT ____________________________________fk FOREIGN KEY (Route_ID) REFERENCES public.Route (Route_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Journey ADD CONSTRAINT route_journey_fk FOREIGN KEY (Route_ID) REFERENCES public.Route (Route_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Chat ADD CONSTRAINT route_chat_fk FOREIGN KEY (Route_ID) REFERENCES public.Route (Route_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Schedule ADD CONSTRAINT route_schedule_fk FOREIGN KEY (Route_ID) REFERENCES public.Route (Route_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Passenger_in_Journey ADD CONSTRAINT journey_passenger_in_journey_fk FOREIGN KEY (Journey_ID) REFERENCES public.Journey (Journey_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Message ADD CONSTRAINT user_message_fk FOREIGN KEY (User_Message_ID) REFERENCES public.User_1 (User_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; ALTER TABLE public.Route ADD CONSTRAINT route_group_id_fk FOREIGN KEY (Group_ID) REFERENCES public.Group_1 (Group_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE;
true
ecdfd7a47acc029725e4459cf9b60645ef9f0bf0
SQL
Dabendang/book
/src/main/docs/bookshop.sql
UTF-8
11,933
3.203125
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50718 Source Host : localhost:3306 Source Database : bookshop Target Server Type : MYSQL Target Server Version : 50718 File Encoding : 65001 Date: 2018-04-11 09:11:27 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for bs_admin -- ---------------------------- DROP TABLE IF EXISTS `bs_admin`; CREATE TABLE `bs_admin` ( `id` int(20) NOT NULL COMMENT '库存编号', `username` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `nickName` varchar(255) NOT NULL COMMENT '昵称', `create_time` datetime NOT NULL, `update_time` datetime NOT NULL, PRIMARY KEY (`username`), UNIQUE KEY `admin_id_unique` (`username`) USING BTREE, KEY `admin_key` (`username`,`password`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of bs_admin -- ---------------------------- INSERT INTO `bs_admin` VALUES ('1', 'lql', 'C9188E49F774883922596F6E3CD0C492', '林秋亮', '2018-03-18 10:01:14', '2018-03-18 10:01:18'); -- ---------------------------- -- Table structure for bs_book -- ---------------------------- DROP TABLE IF EXISTS `bs_book`; CREATE TABLE `bs_book` ( `bookIsbn` varchar(60) NOT NULL COMMENT '图书编号,主键,自增长', `bookName` varchar(50) NOT NULL COMMENT '书名', `author` varchar(20) NOT NULL COMMENT '作者', `publisher` varchar(100) NOT NULL COMMENT '出版商', `pubilshdata` datetime NOT NULL COMMENT '出版日期', `price` decimal(6,2) NOT NULL COMMENT '单价', `stocknum` int(11) NOT NULL COMMENT '库存量', `categoryId` int(11) NOT NULL COMMENT '外键,分类ID', `description` tinytext COMMENT '描述 备注', `img` varchar(100) DEFAULT '', PRIMARY KEY (`bookIsbn`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of bs_book -- ---------------------------- INSERT INTO `bs_book` VALUES ('1214124124122', '人物自传', '刘小小', '六六出版社', '2018-04-04 00:00:00', '19.10', '2', '4', '各种人物各种扯11', ''); INSERT INTO `bs_book` VALUES ('1325457676782', '深入理解java虚拟机', '耿浩', '机械工业出版社', '2014-03-06 00:00:00', '24.00', '1', '1', 'java', ''); INSERT INTO `bs_book` VALUES ('2134124512311', '深入理解JavaScript', '邱勇伟', '清华大学出版社', '2018-03-06 00:00:00', '25.00', '10', '1', '理解JavaScript好教材', ''); INSERT INTO `bs_book` VALUES ('2432543263634', 'C++编程理念', '张文斌', '人民邮电出版社34', '2014-03-05 00:00:00', '26.00', '3', '1', 'C++', ''); INSERT INTO `bs_book` VALUES ('3213213125429', '操作系统', '里弗斯', '北京出版社', '2014-03-19 00:00:00', '23.00', '10', '4', '操作系统的相关信息', ''); INSERT INTO `bs_book` VALUES ('3214312532541', '中华上下五千年', '李军', '机械工业出版社', '2014-03-14 11:24:18', '26.50', '2', '2', '历史的眼泪', ''); INSERT INTO `bs_book` VALUES ('4413252362342', '精通Http协议', 'Craig Walls', '机械工业出版社', '2014-03-08 11:27:14', '28.50', '1', '4', '网络服务', ''); INSERT INTO `bs_book` VALUES ('6124123532554', '英语四级全解读', '孙向阳', '机械工业出版社', '2014-03-26 21:24:46', '26.50', '4', '8', '英语四级的辅助教材', ''); INSERT INTO `bs_book` VALUES ('7213213213213', '标准日本语学习', '张敏', '人民教育出版社', '2014-03-29 10:03:20', '50.00', '4', '9', '日本语言的基本学习教材', ''); INSERT INTO `bs_book` VALUES ('9837306011248', '龙族', '江南', '长江出版社', '2016-02-02 00:00:00', '59.60', '100', '3', '讲述一个小男孩成长为强者的故事', ''); -- ---------------------------- -- Table structure for bs_category -- ---------------------------- DROP TABLE IF EXISTS `bs_category`; CREATE TABLE `bs_category` ( `categoryId` int(11) NOT NULL AUTO_INCREMENT, `categoryName` varchar(40) NOT NULL COMMENT '分类名', `inventory` bigint(20) NOT NULL COMMENT '该类图书总库存量', `salesVolume` bigint(20) NOT NULL COMMENT '该类图书总销售量', PRIMARY KEY (`categoryId`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of bs_category -- ---------------------------- INSERT INTO `bs_category` VALUES ('1', '教材', '1', '1'); INSERT INTO `bs_category` VALUES ('2', '外语', '1', '2'); INSERT INTO `bs_category` VALUES ('3', '小说', '101', '0'); INSERT INTO `bs_category` VALUES ('4', '文学', '1', '0'); INSERT INTO `bs_category` VALUES ('5', '历史', '2', '0'); INSERT INTO `bs_category` VALUES ('7', '生活', '1', '0'); INSERT INTO `bs_category` VALUES ('8', '科技', '1', '0'); INSERT INTO `bs_category` VALUES ('9', '玄幻', '1', '3'); INSERT INTO `bs_category` VALUES ('10', '经济', '0', '0'); INSERT INTO `bs_category` VALUES ('13', '恐怖', '0', '0'); -- ---------------------------- -- Table structure for bs_order -- ---------------------------- DROP TABLE IF EXISTS `bs_order`; CREATE TABLE `bs_order` ( `orderId` varchar(60) NOT NULL COMMENT '订单编号', `userName` varchar(20) NOT NULL COMMENT '购买者账号', `bookName` varchar(60) NOT NULL, `buyData` datetime NOT NULL, `buyNumber` int(8) NOT NULL COMMENT '购买数量', `buyPrice` decimal(12,2) NOT NULL COMMENT '总金额', `buyAddress` varchar(50) NOT NULL COMMENT '收获地址', `status` int(2) NOT NULL COMMENT '状态,0-未支付;1-已支付;2-已取消;3-已发货;4-已收货', PRIMARY KEY (`orderId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of bs_order -- ---------------------------- INSERT INTO `bs_order` VALUES ('1231231234124513412', '林秋亮', '人物自传', '2017-06-28 22:04:42', '2', '86.00', '福建省泉州市xxxxx', '2'); INSERT INTO `bs_order` VALUES ('1241242356346345564', '林秋亮', '中华上下五千年', '2017-06-27 23:30:06', '1', '166.00', '福建省泉州市xxxxx', '2'); INSERT INTO `bs_order` VALUES ('2131245134321432425', '林秋亮', '中华上下五千年', '2017-06-28 11:03:05', '1', '36.00', '福建省莆田市xxxxx', '2'); INSERT INTO `bs_order` VALUES ('2341565677787876867', '林秋亮', '操作系统', '2017-06-27 18:28:56', '1', '66.00', '福建省泉州市xxxxx', '2'); INSERT INTO `bs_order` VALUES ('3125432645875656668', '林秋亮', '标准日本语学习', '2017-06-29 09:56:01', '2', '99.00', '福建省莆田市xxxxx', '2'); INSERT INTO `bs_order` VALUES ('3542342342342354235', '林秋亮', '中华上下五千年', '2017-06-27 21:37:36', '1', '66.00', '福建省泉州市xxxxx', '1'); INSERT INTO `bs_order` VALUES ('4124123412341241246', '胡一菲', '人物自传', '2017-06-28 21:32:31', '2', '22.00', '福建省莆田市xxxxx', '4'); -- ---------------------------- -- Table structure for bs_shopcart -- ---------------------------- DROP TABLE IF EXISTS `bs_shopcart`; CREATE TABLE `bs_shopcart` ( `scid` int(4) NOT NULL AUTO_INCREMENT COMMENT '购物车编号', `username` varchar(50) NOT NULL, `bookName` varchar(60) NOT NULL, `bookNum` int(8) NOT NULL COMMENT '昵称', `bookPrice` decimal(6,2) NOT NULL, `totalPrice` decimal(12,2) NOT NULL, PRIMARY KEY (`scid`), UNIQUE KEY `shopcart_id_unique` (`scid`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of bs_shopcart -- ---------------------------- INSERT INTO `bs_shopcart` VALUES ('1', '林秋亮', '人物自传', '2', '22.00', '222.00'); INSERT INTO `bs_shopcart` VALUES ('3', '林秋亮', 'C++编程理念', '2', '222.00', '22222.00'); INSERT INTO `bs_shopcart` VALUES ('7', '林秋亮', '深入理解JavaScript', '3', '25.00', '75.00'); -- ---------------------------- -- Table structure for bs_stock -- ---------------------------- DROP TABLE IF EXISTS `bs_stock`; CREATE TABLE `bs_stock` ( `stockId` int(11) NOT NULL, `stockNum` bigint(20) NOT NULL COMMENT '馆藏数', `totalCategory` int(6) NOT NULL COMMENT '库存分类总数', PRIMARY KEY (`stockId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of bs_stock -- ---------------------------- INSERT INTO `bs_stock` VALUES ('1', '145', '10'); -- ---------------------------- -- Table structure for bs_user -- ---------------------------- DROP TABLE IF EXISTS `bs_user`; CREATE TABLE `bs_user` ( `userId` varchar(40) NOT NULL COMMENT '用户账号', `logPassword` varchar(40) NOT NULL COMMENT '登陆密码', `payPassword` varchar(40) NOT NULL COMMENT '支付密码', `userName` varchar(20) NOT NULL COMMENT '用户姓名', `sex` varchar(4) NOT NULL COMMENT '用户性别:0-女;1-男', `livePlace` varchar(40) NOT NULL COMMENT '居住地', `create_time` datetime NOT NULL, `update_time` datetime NOT NULL, `balance` decimal(12,2) NOT NULL COMMENT '余额,2位小数', `status` char(1) NOT NULL COMMENT '用户状态:N-非会员;Y-会员', PRIMARY KEY (`userId`), UNIQUE KEY `userName_UNIQUE` (`userName`) USING BTREE, KEY `user_key` (`userName`,`logPassword`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- ---------------------------- -- Records of bs_user -- ---------------------------- INSERT INTO `bs_user` VALUES ('11226534665', 'E65F00D5351D96B1B27C2047580169BF', 'E65F00D5351D96B1B27C2047580169BF', '张伟', '男', '福建省泉州市xxxxx', '2018-03-15 23:21:42', '2018-03-15 23:21:42', '0.00', 'N'); INSERT INTO `bs_user` VALUES ('12314235436', 'E65F00D5351D96B1B27C2047580169BF', 'E65F00D5351D96B1B27C2047580169BF', '林婉瑜', '女', '福建省福州市xxxxx', '2018-03-26 23:23:52', '2018-03-26 23:23:52', '0.00', 'N'); INSERT INTO `bs_user` VALUES ('12345678901', 'C9188E49F774883922596F6E3CD0C492', 'C9188E49F774883922596F6E3CD0C492', '林秋亮', '女', '福建省莆田市仙游县', '2018-03-29 09:54:58', '2018-03-29 09:54:58', '3067.00', 'N'); INSERT INTO `bs_user` VALUES ('12356598789', 'E65F00D5351D96B1B27C2047580169BF', 'E65F00D5351D96B1B27C2047580169BF', '胡一菲', '女', '福建省厦门市xxxxx', '2018-03-15 23:51:38', '2018-03-15 23:51:38', '0.00', 'Y'); INSERT INTO `bs_user` VALUES ('12412334443', 'E65F00D5351D96B1B27C2047580169BF', 'E65F00D5351D96B1B27C2047580169BF', '曾小贤', '男', '福建省福州市xxxxx', '2018-03-15 23:27:13', '2018-03-15 23:27:13', '0.00', 'N'); INSERT INTO `bs_user` VALUES ('12412431233', 'E65F00D5351D96B1B27C2047580169BF', 'E65F00D5351D96B1B27C2047580169BF', '关谷神奇', '男', '福建省漳州市xxxxx', '2018-03-22 00:30:47', '2018-03-22 00:30:47', '0.00', 'N'); INSERT INTO `bs_user` VALUES ('12431412412', 'E65F00D5351D96B1B27C2047580169BF', 'E65F00D5351D96B1B27C2047580169BF', '吕子乔', '男', '福建省莆田市xxxxx', '2018-03-15 23:54:25', '2018-03-15 23:54:25', '0.00', 'Y'); INSERT INTO `bs_user` VALUES ('13659780897', '617D41B3AB24FE2FEEAC55EDA41BEC31', 'E65F00D5351D96B1B27C2047580169BF', '陆展博', '男', '福建省厦门市xxxxx', '2018-03-29 10:23:22', '2018-03-29 10:23:22', '0.00', 'N'); INSERT INTO `bs_user` VALUES ('16400811966', '032F3875548F3FF92406A444387DD8C3', 'C9188E49F774883922596F6E3CD0C492', '哇哈哈', '女', '福建省厦门', '2018-03-31 19:53:17', '2018-03-31 19:53:17', '0.00', 'Y'); INSERT INTO `bs_user` VALUES ('18234782163', 'E65F00D5351D96B1B27C2047580169BF', 'E65F00D5351D96B1B27C2047580169BF', '林伟', '男', '福建省厦门市xxxxx', '2018-03-15 21:17:21', '2018-03-15 21:17:24', '70.00', 'N'); INSERT INTO `bs_user` VALUES ('18245937698', '0A41F3EAEB1F77DD8DB0E7BD84A04A48', 'E65F00D5351D96B1B27C2047580169BF', '陈美嘉', '女', '福建省泉州市xxxxx', '2018-03-29 10:36:34', '2018-03-29 10:36:34', '0.00', 'Y'); INSERT INTO `bs_user` VALUES ('87642941654', '032F3875548F3FF92406A444387DD8C3', 'C9188E49F774883922596F6E3CD0C492', '胡适', '男', '福建省仙游县', '2018-03-31 18:41:08', '2018-03-31 18:41:08', '0.00', 'N');
true
d32d34102455e5c1364de6021bc1b96549292264
SQL
JoLuMTavares/Videothek
/material/videothek4_dml.sql
UTF-8
679
3.296875
3
[]
no_license
-- Diese INSERT ist fuer die regisseur_filme Tabelle. Wenn ein film mit der Richtig regisseur findet, dann kopiert beide Schluessel (von filmen und regisseure Tabellen) INSERT INTO `regisseur_filme` (regisseur_id, filme_id) SELECT regisseur.id, filmen.id FROM `regisseur` JOIN filmen WHERE regisseur.name LIKE CONCAT('%', filmen.regisseure ,'%'); -- Diese INSERT ist fuer die filme_genre Tabelle. Wenn ein film mit der Richtig genre findet, dann kopiert beide Schluessel (von filmen und genres Tabellen) INSERT INTO `filme_genre` ( filme_id, genre_id) SELECT filmen.id, genres.id FROM `filmen` JOIN genres WHERE filmen.genres LIKE CONCAT('%', genres.genre ,'%');
true
2269a45dd83dcc4756f617e040303f68f3456bc9
SQL
tarim/Tarim.Api
/Sql files/database/add_name_pro.sql
UTF-8
568
2.84375
3
[]
no_license
CREATE DEFINER=`root`@`localhost` PROCEDURE `ADD_NAME`(IN name_ug_in VARCHAR(64),IN name_latin_in VARCHAR(64),IN origin_in ENUM('Uyghur', 'Arabic', 'Persian', 'Other'), IN gender_in ENUM('male', 'female', 'unisex'),IN related_name_in VARCHAR(64),IN is_surname_in TINYINT,IN description_in VARCHAR(256), OUT id_out INT) BEGIN INSERT INTO tbl_uyghur_name(name_ug,name_latin,origin,gender,related_name,is_surname,`description`) values(name_ug_in,name_latin_in,origin_in,gender_in,related_name_in,is_surname_in,description_in); SET id_out=(SELECT LAST_INSERT_ID()); END
true
238a0c7c6a2eaffdc6c7ff6ad82c3a5ddaf9fd5d
SQL
esau817/software_seguro
/Captcha/progra_Script.sql
UTF-8
422
2.765625
3
[]
no_license
drop database if exists db_proyecto; create database db_proyecto; use db_proyecto; -- Creación de tabla usuario, que será para todos los usuarios deudores drop table if exists my_user; create table my_user (id int not null auto_increment, username varchar(25), password_1 varchar(25), fName varchar(50), pNumber varchar(50), primary key(id)); insert into my_user values (1, "user", "user", "Esau Ruiz", 3121685861);
true
5bf12f8b3a22aac3f76ccc66918b72c44522926c
SQL
Mahamudul-Hasan-Rafi/MathMaster
/SITE/TEST_START.sql
UTF-8
5,552
3.671875
4
[]
no_license
SET SERVEROUTPUT ON; SET VERIFY OFF; DROP TABLE TEMP_MEMORY; CREATE TABLE TEMP_MEMORY( QUESTION_NO NUMBER, ANSWERED VARCHAR2(15), CORRECT_ANS VARCHAR2(15), LEVEL_Q VARCHAR2(6), QTP VARCHAR2(30), MARKS NUMBER ); CREATE OR REPLACE PACKAGE QA_PACKAGE AS PROCEDURE DISPLAY_QUESTIONS(TP IN VARCHAR); FUNCTION MARKS_OBTAINED(CA OUT NUMBER) RETURN NUMBER; PROCEDURE SHOW_REPORT; END QA_PACKAGE; / CREATE OR REPLACE PACKAGE BODY QA_PACKAGE AS PROCEDURE DISPLAY_QUESTIONS(TP IN VARCHAR) IS CNT NUMBER; ANS VARCHAR2(30); C_ANSWER VARCHAR2(30); MRK NUMBER; BEGIN CNT:=1; IF TP='MATHEMATICAL COMPUTATION' OR TP='PERMUTATION AND COMBINATION' OR TP='TRIGONOMETRIC' OR TP='GEOMETRY' THEN FOR R IN (SELECT * FROM QUESTIONS@server1 WHERE Q_TYPE=TP) LOOP DBMS_OUTPUT.PUT_LINE('QUESTION '||CNT); ---QUESTION PRINTING DBMS_OUTPUT.PUT_LINE('------------------------------------'); DBMS_OUTPUT.PUT_LINE(R.QUESTION); DBMS_OUTPUT.PUT_LINE('DIFFICULTY: '||R.DIFFICULTY); DBMS_OUTPUT.PUT_LINE('Q_TYPE: '||R.Q_TYPE); SELECT ANSWER INTO C_ANSWER FROM ANSWERS@server1 WHERE QID=R.QID; ---AUTOMATIC ANSWER TAKING FROM SERVER IF CNT>0 THEN ANS:=C_ANSWER; ---ANSWER BINDING ELSE ANS:='0'; ---ANSWER BINDING END IF; DBMS_OUTPUT.PUT_LINE('ANSWER: '||ANS); ---ANSWER PRINTING DBMS_OUTPUT.PUT_LINE('------------------------------------'); DBMS_OUTPUT.PUT_LINE(CHR(10)); IF R.DIFFICULTY='EASY' THEN MRK:=2; ELSIF R.DIFFICULTY='MEDIUM' THEN MRK:=5; ELSE MRK:=10; END IF; INSERT INTO TEMP_MEMORY VALUES(CNT,ANS,C_ANSWER,R.DIFFICULTY,R.Q_TYPE,MRK); ---STORING IN A TEMPORARY TABLE CNT:=CNT+1; COMMIT; END LOOP; ELSE FOR R IN (SELECT * FROM QUESTIONS@server1) LOOP DBMS_OUTPUT.PUT_LINE('QUESTION '||CNT); ---QUESTION PRINTING DBMS_OUTPUT.PUT_LINE('------------------------------------'); DBMS_OUTPUT.PUT_LINE(R.QUESTION); DBMS_OUTPUT.PUT_LINE('DIFFICULTY: '||R.DIFFICULTY); DBMS_OUTPUT.PUT_LINE('Q_TYPE: '||R.Q_TYPE); SELECT ANSWER INTO C_ANSWER FROM ANSWERS@server1 WHERE QID=R.QID; ---AUTOMATIC ANSWER TAKING FROM SERVER IF CNT>1 THEN ANS:=C_ANSWER; ---ANSWER BINDING ELSE ANS:='0'; ---ANSWER BINDING END IF; DBMS_OUTPUT.PUT_LINE('ANSWER: '||ANS); ---ANSWER PRINTING DBMS_OUTPUT.PUT_LINE('------------------------------------'); DBMS_OUTPUT.PUT_LINE(CHR(10)); IF R.DIFFICULTY='EASY' THEN MRK:=2; ELSIF R.DIFFICULTY='MEDIUM' THEN MRK:=5; ELSE MRK:=10; END IF; INSERT INTO TEMP_MEMORY VALUES(CNT,ANS,C_ANSWER,R.DIFFICULTY,R.Q_TYPE,MRK); ---STORING IN A TEMPORARY TABLE CNT:=CNT+1; DBMS_OUTPUT.PUT_LINE('CNT: '||CNT); COMMIT; END LOOP; END IF; END DISPLAY_QUESTIONS; FUNCTION MARKS_OBTAINED(CA OUT NUMBER) ---MARKS CALCULATING RETURN NUMBER IS MK NUMBER:=0; BEGIN CA:=0; FOR R IN (SELECT * FROM TEMP_MEMORY) LOOP IF R.ANSWERED=R.CORRECT_ANS THEN MK:=MK+R.MARKS; CA:=CA+1; END IF; END LOOP; RETURN MK; END MARKS_OBTAINED; PROCEDURE SHOW_REPORT ---REPORT GENERATING IS BEGIN DBMS_OUTPUT.PUT_LINE('QNO '||'ANSWERED '||'CORRECT '); DBMS_OUTPUT.PUT_LINE('---- '||'------- '||'------- '); FOR R IN (SELECT * FROM TEMP_MEMORY) LOOP DBMS_OUTPUT.PUT_LINE(R.QUESTION_NO||' '||R.ANSWERED||' '||R.CORRECT_ANS); END LOOP; END SHOW_REPORT; END QA_PACKAGE; / CREATE OR REPLACE PROCEDURE TEST_SKILL(TYP_ IN NUMBER) IS INVALID EXCEPTION; TOT_MARKS NUMBER; ATTAINED_MARKS NUMBER; TOT_Q NUMBER; CORRECTLY_ANSWERED NUMBER; SID NUMBER; SNAME VARCHAR(15); QUES_TYPE VARCHAR2(30); BEGIN DBMS_OUTPUT.PUT_LINE(CHR(10)); DBMS_OUTPUT.PUT_LINE('HARD: 10'||CHR(10)||'MEDIUM: 5'||CHR(10)||'EASY: 2'); DBMS_OUTPUT.PUT_LINE(CHR(10)); DBMS_OUTPUT.PUT_LINE('QUESTIONS: '); DBMS_OUTPUT.PUT_LINE('+++++++++++++++++'); DBMS_OUTPUT.PUT_LINE(CHR(10)); CASE TYP_ WHEN 1 THEN QA_PACKAGE.DISPLAY_QUESTIONS('MATHEMATICAL COMPUTATION'); WHEN 2 THEN QA_PACKAGE.DISPLAY_QUESTIONS('PERMUTATION AND COMBINATION'); WHEN 3 THEN QA_PACKAGE.DISPLAY_QUESTIONS('TRIGONOMETRIC'); WHEN 4 THEN QA_PACKAGE.DISPLAY_QUESTIONS('GEOMETRY'); WHEN 5 THEN QA_PACKAGE.DISPLAY_QUESTIONS(NULL); ELSE RAISE INVALID; END CASE; SELECT COUNT(QUESTION_NO) INTO TOT_Q FROM TEMP_MEMORY; SELECT SUM(MARKS) INTO TOT_MARKS FROM TEMP_MEMORY; ATTAINED_MARKS:=QA_PACKAGE.MARKS_OBTAINED(CORRECTLY_ANSWERED); DBMS_OUTPUT.PUT_LINE(CHR(10)); DBMS_OUTPUT.PUT_LINE('REPORT OF TEST: '); DBMS_OUTPUT.PUT_LINE('**************'); QA_PACKAGE.SHOW_REPORT; DBMS_OUTPUT.PUT_LINE(CHR(10)); DBMS_OUTPUT.PUT_LINE('TOT_Q: '||TOT_Q||' TOT_MARKS: '||TOT_MARKS); DBMS_OUTPUT.PUT_LINE('CQ: '||CORRECTLY_ANSWERED||' ATTAINED_MARKS: '||ATTAINED_MARKS); DBMS_OUTPUT.PUT_LINE(CHR(10)); SELECT ID,NAME INTO SID,SNAME FROM CURRENT_RECORD; --DBMS_OUTPUT.PUT_LINE(SID||' '||SNAME); SELECT QTP INTO QUES_TYPE FROM TEMP_MEMORY WHERE QUESTION_NO=1; --DBMS_OUTPUT.PUT_LINE('QUES TYPE: '||QUES_TYPE); SAVE_RECORD(SID,SNAME,QUES_TYPE,TOT_Q,CORRECTLY_ANSWERED,ATTAINED_MARKS,TOT_MARKS,SYSDATE); ---SAVING THE TEST REPORT EXCEPTION WHEN INVALID THEN DBMS_OUTPUT.PUT_LINE('INVALID INPUT!!'); END; /
true
c04d92029b4df94c27147d968eb4dc6fa637bfb2
SQL
jwittbold/euro_cup_2016_mini_project
/sql_q13_sol.sql
UTF-8
292
3.671875
4
[]
no_license
# 13. Find all the defenders who scored a goal for their teams SELECT player_name, posi_to_play AS position, COUNT(posi_to_play) AS goals_scored FROM player_mast AS pm INNER JOIN goal_details AS gd ON pm.player_id = gd.player_id WHERE posi_to_play = 'DF' GROUP BY player_name, posi_to_play
true
1008bb1ed63ccdd39769f9d5c5e3bd7be5d92f6f
SQL
selectSIFISO/SQL-Server-Management-Studio
/admin_via_dw.sql
UTF-8
2,386
4
4
[]
no_license
SELECT 'Administration' [Basket Entries] ,us.[Surname] + ', ' + us.[FirstName] [User] ,ce.Id AS ClaimEventId ,ce.EventDate ,ce.NextContactDate ,il.FirstName AS InsuredLifeFirstName ,il.Surname AS InsuredLifeSurname ,ce.ClaimEventReferenceNumber_Number AS ReferenceNumber FROM [DIM].[Claims_ClaimEvent] ce INNER JOIN [DIM].[Claims_InsuredLife] il ON ce.[Claims_InsuredLifeKey] = il.[Claims_InsuredLifeKey] inner join [DIM].[Claims_ClaimsUser] us on ce.AssignedToAdministratorUserId = us.[Id] WHERE ce.AssignedToAdministratorUserId in ('58477B34-5D66-C244-F4FD-08CF5D2E4840','F8BC3324-C13F-C7C6-4BB7-08CF5D2E493B','4FF77F04-6E8C-C57E-72C5-08CF5D2E4942','5F2DA56A-CC7E-C060-DC53-08CF5D2E48A9','0EED4D73-140C-CB5E-435D-08D036326934') AND ce.AssignedToAssessorUserId IS NULL AND ce.[Claims_ClaimantKey] IS NOT NULL AND ce.[Claims_ClaimEventStatusTypeKey] NOT IN (2,11,12) AND 0 = (SELECT COUNT(Id) FROM [CG_D_DB_DATEDW].[DIM].[Claims_Claim] c WHERE [Claims_ClaimEventKey] = ce.[Claims_ClaimEventKey] AND c.[Claims_ClaimStatusTypeKey] = 3) -- New AND 0 = (SELECT COUNT(r.Id) FROM [CG_D_DB_DATEDW].[DIM].[Claims_Requirement] r INNER JOIN [CG_D_DB_DATEDW].[DIM].[Claims_Document] d ON d.[Claims_RequirementKey] = r.[Claims_RequirementKey] WHERE r.[Claims_ClaimEventKey] = ce.[Claims_ClaimEventKey] AND d.[Claims_DocumentStatusTypeKey] = 2 -- New AND (r.Claims_RequirementStatusTypeKey <> 3 -- Complete OR ce.[Claims_ClaimEventStatusTypeKey] <> 10)) -- Complete AND (ce.NextContactDate > GETDATE() OR ce.NextContactDate IS NULL) AND ce.AssignedToAssessorUserId IS NULL AND 0 < (SELECT COUNT(Id) FROM [CG_D_DB_DATEDW].[DIM].[Claims_Requirement] r WHERE r.[Claims_ClaimEventKey] = ce.[Claims_ClaimEventKey] AND r.Claims_RequirementStatusTypeKey <> 3) -- Complete AND 0 = (SELECT COUNT(Id) FROM [CG_D_DB_DATEDW].[DIM].[Claims_Claim] c WHERE c.[Claims_ClaimEventKey] = ce.[Claims_ClaimEventKey] AND [Claims_ClaimTypeKey] IN (26,27,34,35,49,50)) AND 0 < (SELECT COUNT(Id) FROM [CG_D_DB_DATEDW].[DIM].[Claims_Claim] c WHERE c.[Claims_ClaimEventKey] = ce.[Claims_ClaimEventKey] AND c.[Claims_ClaimStatusTypeKey] = 4) --Administration AND 0 < (SELECT COUNT(Id) FROM [CG_D_DB_DATEDW].[DIM].[Claims_Requirement] r WHERE r.[Claims_ClaimEventKey] = ce.[Claims_ClaimEventKey] AND r.Claims_RequirementStatusTypeKey IN (1,2,4))
true
e4dc044782fa6b40cb54e3af82c008ee54be88e1
SQL
sanan1986/baseapplication
/src/src/database/db_build.sql
UTF-8
138,895
3.25
3
[]
no_license
--**************************************************************** --*************************************************************** --****************** DROP TABLES ************************* --************************************************************** --************************************************************** --================================================================== --====================== BATTLES ============================= --================================================================== DROP TABLE battles cascade; --================================================================== --====================== QUESTIONS ============================= --================================================================== DROP TABLE questions_attempts cascade; DROP TABLE questions cascade; --================================================================== --====================== GAMES ============================= --================================================================== DROP TABLE games_attempts cascade; DROP TABLE games_instance cascade; DROP TABLE games cascade; --================================================================== --====================== LEVELS ============================= --================================================================== DROP TABLE levels_standards_clusters_domains_grades cascade; DROP TABLE levels_transactions cascade; DROP TABLE levels cascade; --================================================================== --====================== PEOPLE ============================= --================================================================== DROP TABLE permissions_users cascade; DROP TABLE permissions cascade; DROP TABLE rooms cascade; DROP TABLE teachers cascade; DROP TABLE students cascade; DROP TABLE users cascade; DROP TABLE schools cascade; --================================================================== --=========================== CORE CURRICULUM ======================== --================================================================== DROP TABLE standards_clusters_domains_grades cascade; DROP TABLE standards cascade; DROP TABLE clusters_domains_grades cascade; DROP TABLE clusters cascade; DROP TABLE domains_grades cascade; DROP TABLE domains_subjects cascade; DROP TABLE domains cascade; DROP TABLE grades cascade; DROP TABLE subjects cascade; --================================================================== --=========================== HELPER ======================== --================================================================== DROP TABLE passwords cascade; DROP TABLE error_log cascade; --**************************************************************** --*************************************************************** --****************** POSTGRESQL SETTINGS ************************* --************************************************************** --************************************************************** SET statement_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; SET search_path = public, pg_catalog; SET default_tablespace = ''; SET default_with_oids = false; --**************************************************************** --*************************************************************** --****************** CREATE TABLES ************************* --************************************************************** --************************************************************** --================================================================== --=========================== HELPER ======================== --================================================================== --ERROR_LOG CREATE TABLE error_log ( id integer NOT NULL, error text, error_time timestamp, username text ); --PASSWORDS CREATE TABLE passwords ( id integer NOT NULL, password text UNIQUE ); --================================================================== --================= PEOPLE ==================================== --================================================================== --SCHOOLS CREATE TABLE schools ( id integer NOT NULL, school_name text NOT NULL UNIQUE ); --USERS CREATE TABLE users ( id integer NOT NULL, username text, password text, first_name text, middle_name1 text, middle_name2 text, middle_name3 text, last_name text, school_id integer NOT NULL ); --TEACHERS CREATE TABLE teachers ( id integer NOT NULL, room_id integer ); --STUDENTS CREATE TABLE students ( id integer NOT NULL, teacher_id integer ); --ROOMS CREATE TABLE rooms ( id integer NOT NULL, room text NOT NULL, school_id integer NOT NULL ); --PERMISSIONS CREATE TABLE permissions ( id integer NOT NULL, permission text NOT NULL UNIQUE ); --PERMISSIONS_USERS CREATE TABLE permissions_users ( permission_id integer NOT NULL, user_id integer NOT NULL ); --================================================================== --==================== CORE CURRICULUM ======================== --================================================================== --************************* --GRADE CREATE TABLE grades ( id integer NOT NULL, grade text ); --************************* --SUBJECTS CREATE TABLE subjects ( id integer NOT NULL, subject text NOT NULL ); --************************* --DOMAINS CREATE TABLE domains ( id integer NOT NULL, domain text NOT NULL ); --DOMAINS_SUBJECTS CREATE TABLE domains_subjects ( domain_id integer, subject_id integer ); --DOMAINS_GRADES CREATE TABLE domains_grades ( id integer NOT NULL, domain_id integer, grade_id integer ); --************************* --CLUSTERS CREATE TABLE clusters ( id integer NOT NULL, cluster text NOT NULL -- Know number names and the count sequence. | Key ideas and details ); --CLUSTERS_DOMAINS_GRADES CREATE TABLE clusters_domains_grades ( id integer NOT NULL, cluster_id integer NOT NULL, domain_grade_id integer NOT NULL ); --************************* --STANDARDS CREATE TABLE standards ( id integer NOT NULL, standard text NOT NULL ); --STANDARDS_CLUSTERS_DOMAINS_GRADES CREATE TABLE standards_clusters_domains_grades ( id integer NOT NULL, standard_id integer NOT NULL, cluster_domain_grade_id integer NOT NULL ); --================================================================== --====================== LEVELS ============================= --================================================================== --LEVELS CREATE TABLE levels ( id double precision NOT NULL UNIQUE, description text NOT NULL ); --LEVELS_TRANSACTIONS CREATE TABLE levels_transactions ( id integer NOT NULL, advancement_time timestamp, level_id double precision NOT NULL, user_id integer NOT NULL ); --LEVELS_STANDARDS_CLUSTERS_DOMAINS_GRADES CREATE TABLE levels_standards_clusters_domains_grades ( level_id double precision NOT NULL, standard_cluster_domain_grade_id integer NOT NULL ); --================================================================== --===================== GAMES ===================================== --================================================================== --GAMES such as partido... CREATE TABLE games ( id integer NOT NULL, game text NOT NULL UNIQUE, url text NOT NULL, picture_open text NOT NULL, picture_closed text NOT NULL ); --GAMES_INSTANCE an instance of partido or another game CREATE TABLE games_instance ( id integer NOT NULL, game_instance_time_start timestamp, game_instance_time_end timestamp, game_id integer NOT NULL ); --GAMES_ATTEMPTS a user attempt at a game... CREATE TABLE games_attempts ( id integer NOT NULL, game_attempt_time_start timestamp, game_attempt_time_end timestamp, game_instance_id integer NOT NULL, user_id integer NOT NULL --level_id double precision NOT NULL --should this be standard_id? --score integer DEFAULT 0 NOT NULL, --time_warning boolean DEFAULT false NOT NULL ); --================================================================== --===================== QUESTIONS ===================================== --================================================================== --QUESTIONS CREATE TABLE questions ( id integer NOT NULL, question text NOT NULL, answer text NOT NULL, level_id double precision NOT NULL ); --need to change the way you gain levels..... --threshold for pass. 100 correct attempts with timestamp --your level is basically whatever question you have passed --you are judged on your last 100 attempts at a level.... --so...if you do not get 100 attempts that where successful and average under 300 seconds than you are not passed that level.... --so you are eligible to be asked the lowest level question you have not mastered plus an algorithm of mastered questions. with a greater percent coming from high levels then obviously lowest percent from low levels... --take number_of_mastered_levels = 10; -- so if you have none mastered you get ma1 --mastered = 0 --live_unmastered =1; --un_mastered === rest; --QUESTIONS_ATTEMPTS CREATE TABLE questions_attempts ( id integer NOT NULL, question_id integer NOT NULL, answer text, answer_attempt_time timestamp default current_timestamp, answer_time integer NOT NULL, user_id integer NOT NULL ); --battles last 30 seconds... we ask only 15 questions on average.. --so 30 seconds --have x amount of questions ready -- winner is determined by time/questions * correct --even better... --send a question to both combatants..whoever gets the right answer first wins. if they are both --wrong nobody gets a hit. --advantages of this system are that you get more of a heads up draw. --this also allows for 10 questions no matter what... -- then if opponent answers before you you just go onto next? no you get a chance up to 5 seconds...then we move on..or we could just have you for now get wiped out....if you get wiped out we could after battle so you need time to recover? --i think you must wait for an answer then show each user the correct answer, then have another round of battle. so after 10 seconds we could time out round. and just show answer for 5 seconds then move on. --shoiuld for now just do everything in db... --================================================================== --================= BATTLES ==================================== --================================================================== --BATTLE an instance of battle class? do i calc winner from other tables or just put it here? CREATE TABLE battles ( id integer NOT NULL, battle_start_time timestamp, battle_end_time timestamp, home_score integer, away_score integer, home_user_id integer, away_user_id integer ); --================================================================== --================= ENVIRONMENT ==================================== --================================================================== --BROWSERS --CREATE TABLE browsers ( -- id integer NOT NULL, -- browser text NOT NULL UNIQUE --); --Modenizr should help make stuff compatible but we still need webistie to hide certain games. -- Lets go step by step -- you have to goto abcandyou.com...when you do... --i think for now this should be left alone till needed. --DROP TABLE os cascade; --win98,win2000,winxp,win7,vista,win8,debian3,ubuntu,redhat,fedora,android,mac,etc --DROP TABLE browser cascade; --ie6,ie7,ie8,ie9,ie10,opera9,opera10,firefox8,firefox9 --DROP TABLE engine cascade; --ogre,torque,javascript,2d_brengine,jmonkey --i am thinking to show all? --**************************************************************** --*************************************************************** --****************** CREATE SEQUENCES ************************* --************************************************************** --************************************************************** --================================================================== --================= HELPER ==================================== --================================================================== --ERROR_LOG CREATE SEQUENCE error_log_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --PASSWORDS CREATE SEQUENCE passwords_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --================================================================== --================= PEOPLE ==================================== --================================================================== --USERS CREATE SEQUENCE users_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --SCHOOLS CREATE SEQUENCE schools_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --STUDENTS --TEACHERS --ROOMS CREATE SEQUENCE rooms_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --PERMISSIONS CREATE SEQUENCE permissions_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --PERMISSIONS_USERS --================================================================== --================= CORE CURRICULUM ==================================== --================================================================== --SUBJECTS CREATE SEQUENCE subjects_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --DOMAINS_GRADES CREATE SEQUENCE domains_grades_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --DOMAINS CREATE SEQUENCE domains_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --CLUSTERS CREATE SEQUENCE clusters_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --CLUSTERS_DOMAINS_GRADES CREATE SEQUENCE clusters_domains_grades_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --STANDARDS CREATE SEQUENCE standards_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --STANDARDS_CLUSTERS_DOMAINS_GRADES CREATE SEQUENCE standards_clusters_domains_grades_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --GRADES CREATE SEQUENCE grades_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --================================================================== --================= LEVELS ==================================== --================================================================== --LEVELS_TRANSACTIONS CREATE SEQUENCE levels_transactions_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --================================================================== --================================================================== --================= GAMES ==================================== --================================================================== --GAMES CREATE SEQUENCE games_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --GAMES_INSTANCE CREATE SEQUENCE games_instance_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --GAMES_ATTEMPTS CREATE SEQUENCE games_attempts_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --================================================================== --================================================================== --================= QUESTIONS ==================================== --================================================================== --QUESTIONS_ATTEMPTS CREATE SEQUENCE questions_attempts_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --QUESTIONS CREATE SEQUENCE questions_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --================================================================== --================================================================== --================= BATTLES ==================================== --================================================================== --BATTLES CREATE SEQUENCE battles_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; --**************************************************************** --*************************************************************** --****************** ALTER OWNER ************************* --************************************************************** --************************************************************** --================================================================== --================= HELPER ==================================== --================================================================== --PASSWORDS ALTER TABLE public.passwords OWNER TO postgres; --ERROR_LOG ALTER TABLE public.error_log OWNER TO postgres; --================================================================== --================= PEOPLE ==================================== --================================================================== --USERS ALTER TABLE public.users OWNER TO postgres; --SCHOOLS ALTER TABLE public.schools OWNER TO postgres; --STUDENTS ALTER TABLE public.students OWNER TO postgres; --TEACHERS ALTER TABLE public.teachers OWNER TO postgres; --ROOMS ALTER TABLE public.rooms OWNER TO postgres; --PERMISSIONS ALTER TABLE public.permissions OWNER TO postgres; --PERMISSIONS_USERS ALTER TABLE public.permissions_users OWNER TO postgres; --================================================================== --================= CORE CURRICULUM ==================================== --================================================================== --SUBJECTS ALTER TABLE public.subjects OWNER TO postgres; --GRADES ALTER TABLE public.grades OWNER TO postgres; --DOMAINS ALTER TABLE public.domains OWNER TO postgres; --DOMAINS_SUBJECTS ALTER TABLE public.domains_subjects OWNER TO postgres; --DOMAINS_GRADES ALTER TABLE public.domains_grades OWNER TO postgres; --CLUSTERS ALTER TABLE public.clusters OWNER TO postgres; --CLUSTERS_DOMAINS_GRADES ALTER TABLE public.clusters_domains_grades OWNER TO postgres; --STANDARDS ALTER TABLE public.standards OWNER TO postgres; --STANDARDS_CLUSTERS_DOMAINS_GRADES ALTER TABLE public.standards_clusters_domains_grades OWNER TO postgres; --================================================================== --================= LEVELS ==================================== --================================================================== --LEVELS ALTER TABLE public.levels OWNER TO postgres; --LEVELS_TRANSACTIONS ALTER TABLE public.levels_transactions OWNER TO postgres; --LEVELS_STANDARDS_CLUSTERS_DOMAINS_GRADES ALTER TABLE public.levels_standards_clusters_domains_grades OWNER TO postgres; --================================================================== --================= GAMES ==================================== --================================================================== --GAMES ALTER TABLE public.games OWNER TO postgres; --GAMES_INSTANCE ALTER TABLE public.games_instance OWNER TO postgres; --GAMES_ATTEMPTS ALTER TABLE public.games_attempts OWNER TO postgres; --================================================================== --================= QUESTIONS ==================================== --================================================================== --QUESTIONS_ATTEMPTS ALTER TABLE public.questions_attempts OWNER TO postgres; --QUESTIONS ALTER TABLE public.questions OWNER TO postgres; --================================================================== --================= BATTLES ==================================== --================================================================== --BATTLES ALTER TABLE public.battles OWNER TO postgres; --**************************************************************** --*************************************************************** --****************** ALTER SEQUENCE ************************* --************************************************************** --************************************************************** --================================================================== --================= HELPER ==================================== --================================================================== --ERROR_LOG ALTER TABLE public.error_log_id_seq OWNER TO postgres; ALTER SEQUENCE error_log_id_seq OWNED BY error_log.id; ALTER TABLE ONLY error_log ALTER COLUMN id SET DEFAULT nextval('error_log_id_seq'::regclass); --PASSWORDS ALTER TABLE public.passwords_id_seq OWNER TO postgres; ALTER SEQUENCE passwords_id_seq OWNED BY passwords.id; ALTER TABLE ONLY passwords ALTER COLUMN id SET DEFAULT nextval('passwords_id_seq'::regclass); --================================================================== --================= PEOPLE ==================================== --================================================================== --USERS ALTER TABLE public.users_id_seq OWNER TO postgres; ALTER SEQUENCE users_id_seq OWNED BY users.id; ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass); --SCHOOLS ALTER TABLE public.schools_id_seq OWNER TO postgres; ALTER SEQUENCE schools_id_seq OWNED BY schools.id; ALTER TABLE ONLY schools ALTER COLUMN id SET DEFAULT nextval('schools_id_seq'::regclass); --STUDENTS --TEACHERS --ROOMS ALTER TABLE public.rooms_id_seq OWNER TO postgres; ALTER SEQUENCE rooms_id_seq OWNED BY rooms.id; ALTER TABLE ONLY rooms ALTER COLUMN id SET DEFAULT nextval('rooms_id_seq'::regclass); --PERMISSIONS ALTER TABLE public.permissions_id_seq OWNER TO postgres; ALTER SEQUENCE permissions_id_seq OWNED BY permissions.id; ALTER TABLE ONLY permissions ALTER COLUMN id SET DEFAULT nextval('permissions_id_seq'::regclass); --PERMISSIONS_USERS --================================================================== --================= CORE CURRICULUM ==================================== --================================================================== --GRADES ALTER TABLE public.grades_id_seq OWNER TO postgres; ALTER SEQUENCE grades_id_seq OWNED BY grades.id; ALTER TABLE ONLY grades ALTER COLUMN id SET DEFAULT nextval('grades_id_seq'::regclass); --SUBJECTS ALTER TABLE public.subjects_id_seq OWNER TO postgres; ALTER SEQUENCE subjects_id_seq OWNED BY subjects.id; ALTER TABLE ONLY subjects ALTER COLUMN id SET DEFAULT nextval('subjects_id_seq'::regclass); --DOMAINS_GRADES ALTER TABLE public.domains_grades_id_seq OWNER TO postgres; ALTER SEQUENCE domains_grades_id_seq OWNED BY domains_grades.id; ALTER TABLE ONLY domains_grades ALTER COLUMN id SET DEFAULT nextval('domains_grades_id_seq'::regclass); --DOMAINS ALTER TABLE public.domains_id_seq OWNER TO postgres; ALTER SEQUENCE domains_id_seq OWNED BY domains.id; ALTER TABLE ONLY domains ALTER COLUMN id SET DEFAULT nextval('domains_id_seq'::regclass); --CLUSTERS ALTER TABLE public.clusters_id_seq OWNER TO postgres; ALTER SEQUENCE clusters_id_seq OWNED BY clusters.id; ALTER TABLE ONLY clusters ALTER COLUMN id SET DEFAULT nextval('clusters_id_seq'::regclass); --CLUSTERS_DOMAINS_GRADES ALTER TABLE public.clusters_domains_grades_id_seq OWNER TO postgres; ALTER SEQUENCE clusters_domains_grades_id_seq OWNED BY clusters_domains_grades.id; ALTER TABLE ONLY clusters_domains_grades ALTER COLUMN id SET DEFAULT nextval('clusters_domains_grades_id_seq'::regclass); --STANDARDS ALTER TABLE public.standards_id_seq OWNER TO postgres; ALTER SEQUENCE standards_id_seq OWNED BY standards.id; ALTER TABLE ONLY standards ALTER COLUMN id SET DEFAULT nextval('standards_id_seq'::regclass); --STANDARDS_CLUSTERS_DOMAINS_GRADES ALTER TABLE public.standards_clusters_domains_grades_id_seq OWNER TO postgres; ALTER SEQUENCE standards_clusters_domains_grades_id_seq OWNED BY standards_clusters_domains_grades.id; ALTER TABLE ONLY standards_clusters_domains_grades ALTER COLUMN id SET DEFAULT nextval('standards_clusters_domains_grades_id_seq'::regclass); --================================================================== --================= LEVELS ==================================== --================================================================== --LEVELS_TRANSACTIONS ALTER TABLE public.levels_transactions_id_seq OWNER TO postgres; ALTER SEQUENCE levels_transactions_id_seq OWNED BY levels_transactions.id; ALTER TABLE ONLY levels_transactions ALTER COLUMN id SET DEFAULT nextval('levels_transactions_id_seq'::regclass); --================================================================== --================= GAMES ==================================== --================================================================== --GAMES ALTER TABLE public.games_id_seq OWNER TO postgres; ALTER SEQUENCE games_id_seq OWNED BY games.id; ALTER TABLE ONLY games ALTER COLUMN id SET DEFAULT nextval('games_id_seq'::regclass); --GAMES_INSTANCE ALTER TABLE public.games_instance_id_seq OWNER TO postgres; ALTER SEQUENCE games_instance_id_seq OWNED BY games_instance.id; ALTER TABLE ONLY games_instance ALTER COLUMN id SET DEFAULT nextval('games_instance_id_seq'::regclass); --GAMES_ATTEMPTS ALTER TABLE public.games_attempts_id_seq OWNER TO postgres; ALTER SEQUENCE games_attempts_id_seq OWNED BY games_attempts.id; ALTER TABLE ONLY games_attempts ALTER COLUMN id SET DEFAULT nextval('games_attempts_id_seq'::regclass); --================================================================== --================= QUESTIONS ==================================== --================================================================== --QUESTIONS_ATTEMPTS ALTER TABLE public.questions_attempts_id_seq OWNER TO postgres; ALTER SEQUENCE questions_attempts_id_seq OWNED BY questions_attempts.id; ALTER TABLE ONLY questions_attempts ALTER COLUMN id SET DEFAULT nextval('questions_attempts_id_seq'::regclass); --QUESTIONS ALTER TABLE public.questions_id_seq OWNER TO postgres; ALTER SEQUENCE questions_id_seq OWNED BY questions.id; ALTER TABLE ONLY questions ALTER COLUMN id SET DEFAULT nextval('questions_id_seq'::regclass); --================================================================== --================= BATTLES ==================================== --================================================================== --BATTLES ALTER TABLE public.battles_id_seq OWNER TO postgres; ALTER SEQUENCE battles_id_seq OWNED BY battles.id; ALTER TABLE ONLY battles ALTER COLUMN id SET DEFAULT nextval('battles_id_seq'::regclass); --**************************************************************** --*************************************************************** --****************** PRIMARY KEY ************************* --************************************************************** --************************************************************** --**************************************************************** --*************************************************************** --****************** PRIMARY KEY ************************* --************************************************************** --************************************************************** --================================================================== --================= HELPER ==================================== --================================================================== --PASSWORDS ALTER TABLE passwords ADD PRIMARY KEY (password); --ERROR_LOG ALTER TABLE error_log ADD PRIMARY KEY (id); --================================================================== --================= PEOPLE ==================================== --================================================================== --USERS ALTER TABLE users ADD PRIMARY KEY (id); --SCHOOLS ALTER TABLE schools ADD PRIMARY KEY (id); --STUDENTS ALTER TABLE students ADD PRIMARY KEY (id); --TEACHERS ALTER TABLE teachers ADD PRIMARY KEY (id); --ROOMS ALTER TABLE rooms ADD PRIMARY KEY (id); --PERMISSIONS ALTER TABLE permissions ADD PRIMARY KEY (id); --PERMISSIONS_USERS ALTER TABLE permissions_users ADD PRIMARY KEY (permission_id,user_id); --================================================================== --================= CORE CURRICULUM ==================================== --================================================================== --SUBJECTS ALTER TABLE subjects ADD PRIMARY KEY (id); --GRADES ALTER TABLE grades ADD PRIMARY KEY (id); --DOMAINS ALTER TABLE domains ADD PRIMARY KEY (id); --DOMAINS_SUBJECTS ALTER TABLE domains_subjects ADD PRIMARY KEY (domain_id, subject_id); --DOMAINS_GRADES ALTER TABLE domains_grades ADD PRIMARY KEY (id); --CLUSTERS ALTER TABLE clusters ADD PRIMARY KEY (id); --CLUSTERS_DOMAINS_GRADES ALTER TABLE clusters_domains_grades ADD PRIMARY KEY (id); --STANDARDS ALTER TABLE standards ADD PRIMARY KEY (id); --STANDARDS_CLUSTERS_DOMAINS_GRADES ALTER TABLE standards_clusters_domains_grades ADD PRIMARY KEY (id); --================================================================== --================= LEVELS ==================================== --================================================================== --LEVELS ALTER TABLE levels ADD PRIMARY KEY (id); --LEVELS_TRANSACTIONS ALTER TABLE levels_transactions ADD PRIMARY KEY (id); --LEVELS_STANDARDS_CLUSTERS_DOMAINS_GRADES ALTER TABLE levels_standards_clusters_domains_grades ADD PRIMARY KEY (level_id, standard_cluster_domain_grade_id); --================================================================== --================= GAMES ==================================== --================================================================== --GAMES ALTER TABLE games ADD PRIMARY KEY (id); --GAMES_INSTANCE ALTER TABLE games_instance ADD PRIMARY KEY (id); --GAMES_ATTEMPTS ALTER TABLE games_attempts ADD PRIMARY KEY (id); --================================================================== --================= QUESTIONS ==================================== --================================================================== --QUESTIONS_ATTEMPTS ALTER TABLE questions_attempts ADD PRIMARY KEY (id); --QUESTIONS ALTER TABLE questions ADD PRIMARY KEY (id); --================================================================== --================= BATTLES ==================================== --================================================================== --BATTLES ALTER TABLE battles ADD PRIMARY KEY (id); --**************************************************************** --*************************************************************** --****************** FOREIGN KEY ************************* --************************************************************** --************************************************************** --================================================================== --================= HELPER ==================================== --================================================================== --PASSWORDS --NO FOREIGN KEY --ERROR_LOG --NO FOREIGN KEY --================================================================== --================= PEOPLE ==================================== --================================================================== --USERS ALTER TABLE users ADD FOREIGN KEY (school_id) REFERENCES schools(id); --SCHOOLS --STUDENTS ALTER TABLE students ADD FOREIGN KEY (id) REFERENCES users(id); --TEACHERS ALTER TABLE teachers ADD FOREIGN KEY (id) REFERENCES users(id); --ROOMS ALTER TABLE rooms ADD FOREIGN KEY (school_id) REFERENCES schools(id); ALTER TABLE rooms ADD UNIQUE (school_id,room); --PERMISSIONS --PERMISSIONS_USERS ALTER TABLE permissions_users ADD FOREIGN KEY (permission_id) REFERENCES permissions(id); ALTER TABLE permissions_users ADD FOREIGN KEY (user_id) REFERENCES users(id); --================================================================== --================= CORE CURRICULUM ==================================== --================================================================== --GRADES --SUBJECTS --DOMAINS --DOMAINS_SUBJECTS ALTER TABLE domains_subjects ADD FOREIGN KEY (domain_id) REFERENCES domains(id); ALTER TABLE domains_subjects ADD FOREIGN KEY (subject_id) REFERENCES subjects(id); --DOMAINS_GRADES ALTER TABLE domains_grades ADD FOREIGN KEY (domain_id) REFERENCES domains(id); ALTER TABLE domains_grades ADD FOREIGN KEY (grade_id) REFERENCES grades(id); --CLUSTERS_DOMAINS_GRADES ALTER TABLE clusters_domains_grades ADD FOREIGN KEY (cluster_id) REFERENCES clusters(id); ALTER TABLE clusters_domains_grades ADD FOREIGN KEY (domain_grade_id) REFERENCES domains_grades(id); --STANDARDS_CLUSTERS_DOMAINS_GRADES ALTER TABLE standards_clusters_domains_grades ADD FOREIGN KEY (standard_id) REFERENCES standards(id); ALTER TABLE standards_clusters_domains_grades ADD FOREIGN KEY (cluster_domain_grade_id) REFERENCES clusters_domains_grades(id); --================================================================== --================= LEVELS ==================================== --================================================================== --LEVELS --LEVELS_TRANSACTIONS ALTER TABLE levels_transactions ADD FOREIGN KEY (user_id) REFERENCES users(id); ALTER TABLE levels_transactions ADD FOREIGN KEY (level_id) REFERENCES levels(id); --LEVELS_STANDARDS_CLUSTERS_DOMAINS_GRADES ALTER TABLE levels_standards_clusters_domains_grades ADD FOREIGN KEY (level_id) REFERENCES levels(id); ALTER TABLE levels_standards_clusters_domains_grades ADD FOREIGN KEY (standard_cluster_domain_grade_id) REFERENCES standards_clusters_domains_grades(id); --================================================================== --================= GAMES ==================================== --================================================================== --GAMES --GAMES_INSTANCE ALTER TABLE games_instance ADD FOREIGN KEY (game_id) REFERENCES games(id); --GAMES_ATTEMPTS ALTER TABLE games_attempts ADD FOREIGN KEY (game_instance_id) REFERENCES games(id); ALTER TABLE games_attempts ADD FOREIGN KEY (user_id) REFERENCES users(id); --================================================================== --================= QUESTIONS ==================================== --================================================================== --QUESTIONS_ATTEMPTS ALTER TABLE questions_attempts ADD FOREIGN KEY (question_id) REFERENCES questions(id); --QUESTIONS ALTER TABLE questions ADD FOREIGN KEY (level_id) REFERENCES levels(id); --================================================================== --================= BATTLES ==================================== --================================================================== --BATTLES ALTER TABLE battles ADD FOREIGN KEY (home_user_id) REFERENCES users(id); ALTER TABLE battles ADD FOREIGN KEY (away_user_id) REFERENCES users(id); --**************************************************************** --*************************************************************** --****************** UNIQUE CONSTRAINT ************************* --************************************************************** --************************************************************** --================================================================== --================= HELPER ==================================== --================================================================== --PASSWORDS --ERROR_LOG --================================================================== --================= PEOPLE ==================================== --================================================================== --USERS ALTER TABLE users ADD UNIQUE (username,school_id); --SCHOOLS --STUDENTS --TEACHERS --ROOMS ALTER TABLE rooms ADD UNIQUE (school_id,room); --PERMISSIONS --PERMISSIONS_USERS --================================================================== --================= CORE CURRICULUM ==================================== --================================================================== --GRADES ALTER TABLE rooms ADD UNIQUE (school_id,room); --SUBJECTS --DOMAINS --DOMAINS_SUBJECTS --DOMAINS_GRADES ALTER TABLE domains_grades ADD UNIQUE (domain_id, grade_id); --ROOMS ALTER TABLE rooms ADD UNIQUE (school_id,room); --CLUSTERS --STANDARDS ALTER TABLE standards_clusters_domains_grades ADD UNIQUE (standard_id, cluster_domain_grade_id); --================================================================== --================= LEVELS ==================================== --================================================================== --LEVELS --LEVELS_TRANSACTIONS --LEVELS_STANDARDS --COUNTING --ADDITION --SUBTRACTION --================================================================== --================= GAMES ==================================== --================================================================== --GAMES --GAMES_LEVELS --GAMES_ATTEMPTS --**************************************************************** --*************************************************************** --****************** INSERTS ************************* --************************************************************** --************************************************************** --================================================================== --================= HELPER ==================================== --================================================================== --PASSWORDS !!!!!!!!!!!! LISTED BELOW BECAUSE THEY ARE HUGE !!!!!!!!! --ERROR_LOG --================================================================== --================= PEOPLE ==================================== --================================================================== --SCHOOLS --USERS --TEACHERS --STUDENTS --PERMISSIONS insert into permissions(permission) values ('INSERT'); --PERMISSIONS_USERS --================================================================== --================= CORE CURRICULUM ==================================== --================================================================== --**************************************** -- GAMES --**************************************** --**************************************** -- LEVELS --**************************************** --&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& -- KINDERGARTEN --&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& insert into grades (grade) values ('K'); --^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- MATH --^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ insert into subjects (subject) values ('Math'); --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- Counting and Cardinality -- K.CC --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% insert into domains (domain) values ('Counting and Cardinality'); insert into domains_subjects (domain_id, subject_id) values (1,1); insert into domains_grades (domain_id, grade_id) values (1,1); --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Know number names and the count sequence. --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ insert into clusters (cluster) values ('Know number names and the count sequence.'); insert into clusters_domains_grades (cluster_id, domain_grade_id) values (1,1); ---------------------------------------------------------------------------- -- 1. Count to 100 by ones and by tens. ---------------------------------------------------------------------------- insert into standards (standard) values ('Count to 100 by ones and by tens.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (1,1); -- LEVEL_ID: 0 insert into levels(id,description) values (0,'Start of Journey'); -- LEVEL_ID: .100 --insert into levels(id,description) values (.1,'Identify 0'); --insert into questions (level_id,question,answer) values (.1,'0','0'); -- LEVEL_ID: .101 insert into levels(id,description) values (.101,'Identify 1'); --insert into questions (level_id,question,answer) values (.101,'1','1'); -- LEVEL_ID: .102 insert into levels(id,description) values (.102,'Identify 2'); --insert into questions (level_id,question,answer) values (.102,'2','2'); -- LEVEL_ID: .103 insert into levels(id,description) values (.103,'Identify 3'); --insert into questions (level_id,question,answer) values (.103,'3','3'); -- LEVEL_ID: .104 insert into levels(id,description) values (.104,'Identify 4'); --insert into questions (level_id,question,answer) values (.104,'4','4'); -- LEVEL_ID: .105 insert into levels(id,description) values (.105,'Identify 5'); --insert into questions (level_id,question,answer) values (.105,'5','5'); -- LEVEL_ID: .106 insert into levels(id,description) values (.106,'Identify 6'); --insert into questions (level_id,question,answer) values (.106,'6','6'); -- LEVEL_ID: .107 insert into levels(id,description) values (.107,'Identify 7'); --insert into questions (level_id,question,answer) values (.107,'7','7'); -- LEVEL_ID: .108 insert into levels(id,description) values (.108,'Identify 8'); --insert into questions (level_id,question,answer) values (.108,'8','8'); -- LEVEL_ID: .109 insert into levels(id,description) values (.109,'Identify 9'); --insert into questions (level_id,question,answer) values (.109,'9','9'); -- LEVEL_ID: .110 insert into levels(id,description) values (.110,'Identify 10'); --insert into questions (level_id,question,answer) values (.110,'10','10'); -- LEVEL_ID: 1 insert into levels(id,description) values (1,'Count from 0 to 1'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1,1); -- QUESTIONS: --insert into questions (level_id,question,answer) values (1,'Count from 0 to 1:','0 1'); -- LEVEL_ID: 1.01 insert into levels(id,description) values (1.01,'Count from 0 to 2'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.01,1); -- QUESTIONS: --insert into questions (level_id,question,answer) values (1.01,'Count from 0 to 2:','0 1 2'); -- LEVEL_ID: 1.02 insert into levels(id,description) values (1.02,'Count from 0 to 3'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.02,1); -- QUESTIONS: -- LEVEL_ID: 1.03 insert into levels(id,description) values (1.03,'Count from 0 to 4'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.03,1); -- QUESTIONS: -- LEVEL_ID: 1.04 insert into levels(id,description) values (1.04,'Count from 0 to 5'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.04,1); -- QUESTIONS: -- LEVEL_ID: 1.05 insert into levels(id,description) values (1.05,'Count from 0 to 6'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.05,1); -- QUESTIONS: -- LEVEL_ID: 1.06 insert into levels(id,description) values (1.06,'Count from 0 to 7'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.06,1); -- QUESTIONS: -- LEVEL_ID: 1.07 insert into levels(id,description) values (1.07,'Count from 0 to 8'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.07,1); -- QUESTIONS: -- LEVEL_ID: 1.08 insert into levels(id,description) values (1.08,'Count from 0 to 9'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.08,1); -- QUESTIONS: -- LEVEL_ID: 1.09 insert into levels(id,description) values (1.09,'Count from 0 to 10'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.09,1); -- QUESTIONS: -- LEVEL_ID: 1.10 insert into levels(id,description) values (1.10,'Count from 10 to 11'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.10,1); -- QUESTIONS: -- LEVEL_ID: 1.11 insert into levels(id,description) values (1.11,'Count from 10 to 12'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.11,1); -- QUESTIONS: -- LEVEL_ID: 1.12 insert into levels(id,description) values (1.12,'Count from 10 to 13'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.12,1); -- QUESTIONS: -- LEVEL_ID: 1.13 insert into levels(id,description) values (1.13,'Count from 10 to 14'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.13,1); -- QUESTIONS: -- LEVEL_ID: 1.14 insert into levels(id,description) values (1.14,'Count from 10 to 15'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.14,1); -- QUESTIONS: -- LEVEL_ID: 1.50 insert into levels(id,description) values (1.90,'Count to 100 by tens'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (1.90,1); -- QUESTIONS: -------------------------------------------------------------------------------- -- 2. Count forward beginning from a given number within the known -- sequence (instead of having to begin at 1). -------------------------------------------------------------------------------- insert into standards (standard) values ('Count forward beginning from a given number within the known sequence (instead of having to begin at 1).'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (2,1); -- LEVEL_ID: 2 insert into levels(id,description) values (2,'Count from 87 to 97'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (2,2); -- QUESTIONS: -- LEVEL_ID: 2.1 insert into levels(id,description) values (2.1,'Count from 23 to 33'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (2.1,2); -- QUESTIONS: -- LEVEL_ID: 2.2 insert into levels(id,description) values (2.2,'Count from 55 to 65'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (2.2,2); -- QUESTIONS: -- LEVEL_ID: 2.3 insert into levels(id,description) values (2.3,'Count from 4 to 14'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (2.3,2); -- QUESTIONS: -------------------------------------------------------------------------------- -- 3. Write numbers from 0 to 20. Represent a number of objects with a -- written numeral 0-20 (with 0 representing a count of no objects). -------------------------------------------------------------------------------- insert into standards (standard) values ('Write numbers from 0 to 20. Represent a number of objects with a written numeral 0-20 (with 0 representing a count of no objects.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (3,1); -- LEVEL_ID: 3 insert into levels(id,description) values (3,'Write numbers from 0 to 5'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (3,3); -- QUESTIONS: -- LEVEL_ID: 3.1 insert into levels(id,description) values (3.1,'Write numbers from 5 to 10'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (3.1,3); -- QUESTIONS: -- LEVEL_ID: 3.2 insert into levels(id,description) values (3.2,'Write numbers from 10 to 15'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (3.2,3); -- QUESTIONS: -- LEVEL_ID: 3.3 insert into levels(id,description) values (3.3,'Write numbers from 15 to 20'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (3.3,3); -- QUESTIONS: --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Count to tell the number of objects. --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ insert into clusters (cluster) values ('Count to tell the number of objects.'); insert into clusters_domains_grades (cluster_id, domain_grade_id) values (2,1); -------------------------------------------------------------------------------- -- 4. Understand the relationship between numbers and quantities; connect -- counting to cardinality. -------------------------------------------------------------------------------- --Skip this as it is not a standard but a heading posing as a standard. -------------------------------------------------------------------------------- -- a. When counting objects, say the number names in the standard -- order, pairing each object with one and only one number name -- and each number name with one and only one object. -------------------------------------------------------------------------------- insert into standards (standard) values ('When counting objects, say the number names in the standard order, pairing each object with one and only one number name and each number name with one and only one object.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (4,2); -- LEVEL_ID: 4 insert into levels(id,description) values (4,'Count objects from 0 to 20'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (4,4); -- QUESTIONS: -- LEVEL_ID: 4 insert into levels(id,description) values (4.1,'Count objects from 0 to 20'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (4.1,4); -- QUESTIONS: -- LEVEL_ID: 4.2 insert into levels(id,description) values (4.2,'Count objects in standard order using names. 0-10'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (4.2,4); -- QUESTIONS: -- LEVEL_ID: 4.3 insert into levels(id,description) values (4.3,'Count objects in standard order using names. 10-20'); insert into levels_standards_clusters_domains_grades(level_id, standard_cluster_domain_grade_id) values (4.3,4); -- QUESTIONS: -------------------------------------------------------------------------------- -- b. Understand that the last number name said tells the number of -- objects counted. The number of objects is the same regardless of -- their arrangement or the order in which they were counted. -------------------------------------------------------------------------------- insert into standards (standard) values ('Understand that the last number name said tells the number of objects counted. The number of objects is the same regardless of their arrangement or the order in which they were counted.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (5,2); -------------------------------------------------------------------------------- -- c. Understand that each successive number name refers to a quantity -- that is one larger. -------------------------------------------------------------------------------- insert into standards (standard) values (' Understand that each successive number name refers to a quantity that is one larger.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (6,2); -------------------------------------------------------------------------------- -- 5. Count to answer “how many?” questions about as many as 20 things -- arranged in a line, a rectangular array, or a circle, or as many as 10 -- things in a scattered configuration; given a number from 1–20, count -- out that many objects. -------------------------------------------------------------------------------- insert into standards (standard) values ('Count to answer “how many?” questions about as many as 20 things arranged in a line, a rectangular array, or a circle, or as many as 10 things in a scattered configuration; given a number from 1–20, count out that many objects.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (7,2); --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Compare numbers. --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ insert into clusters (cluster) values ('Compare numbers.'); insert into clusters_domains_grades (cluster_id, domain_grade_id) values (3,1); -------------------------------------------------------------------------------- -- 6. Identify whether the number of objects in one group is greater than, -- less than, or equal to the number of objects in another group, e.g., by -- using matching and counting strategies. -------------------------------------------------------------------------------- insert into standards (standard) values ('Identify whether the number of objects in one group is greater than, less than, or equal to the number of objects in another group, e.g., by using matching and counting strategies. Includes groups with up to ten objects.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (8,3); -------------------------------------------------------------------------------- -- 7. Compare two numbers between 1 and 10 presented as written -- numerals. -------------------------------------------------------------------------------- insert into standards (standard) values ('Compare two numbers between 1 and 10 presented as written numerals.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (9,3); --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- Operations and Algebraic Thinking -- K.OA --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% insert into domains (domain) values ('Operations and Algebraic Thinking'); insert into domains_subjects (domain_id, subject_id) values (2,1); insert into domains_grades (domain_id, grade_id) values (2,1); --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Understand addition as putting together and adding to, and under- -- stand subtraction as taking apart and taking from. --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ insert into clusters (cluster) values ('Understand addition as putting together and adding to, and understand subtraction as taking apart and taking from.'); insert into clusters_domains_grades (cluster_id, domain_grade_id) values (4,1); ----------------------------------------------------------------------------- -- 1. Represent addition and subtraction with objects, fingers, mental -- images, drawings2, sounds (e.g., claps), acting out situations, verbal -- explanations, expressions, or equations. ----------------------------------------------------------------------------- insert into standards (standard) values ('Compare two numbers between 1 and 10 presented as written numerals.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (10,4); ----------------------------------------------------------------------------- -- 2. Solve addition and subtraction word problems, and add and subtract -- within 10, e.g., by using objects or drawings to represent the problem. ----------------------------------------------------------------------------- insert into standards (standard) values ('Solve addition and subtraction word problems, and add and subtract within 10, e.g., by using objects or drawings to represent the problem.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (11,4); ----------------------------------------------------------------------------- -- 3. Decompose numbers less than or equal to 10 into pairs in more -- than one way, e.g., by using objects or drawings, and record each -- decomposition by a drawing or equation (e.g., 5 = 2 + 3 and 5 = 4 + 1). ----------------------------------------------------------------------------- insert into standards (standard) values ('Decompose numbers less than or equal to 10 into pairs in more than one way, e.g., by using objects or drawings, and record each decomposition by a drawing or equation (e.g., 5 = 2 + 3 and 5 = 4 + 1.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (12,4); ----------------------------------------------------------------------------- -- 4. For any number from 1 to 9, find the number that makes 10 when -- added to the given number, e.g., by using objects or drawings, and -- record the answer with a drawing or equation. ----------------------------------------------------------------------------- insert into standards (standard) values ('For any number from 1 to 9, find the number that makes 10 when added to the given number, e.g., by using objects or drawings, and record the answer with a drawing or equation.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (13,4); ----------------------------------------------------------------------------- -- 5. Fluently add and subtract within 5. ----------------------------------------------------------------------------- insert into standards (standard) values ('Fluently add and subtract within 5.'); insert into standards_clusters_domains_grades (standard_id, cluster_domain_grade_id) values (14,4); -- LEVEL_ID: 14 insert into levels(id,description) values (14,'Addition addends 0 to 1'); -- QUESTIONS: -- LEVEL_ID: 14.01 insert into levels(id,description) values (14.01,'Addition addends 0 to 2'); -- QUESTIONS: -- LEVEL_ID: 14.02 insert into levels(id,description) values (14.02,'Addition addends 0 to 3'); -- QUESTIONS: -- LEVEL_ID: 14.03 insert into levels(id,description) values (14.03,'Addition addends 0 to 4'); -- QUESTIONS: -- LEVEL_ID: 14.04 insert into levels(id,description) values (14.04,'Addition addends 0 to 5'); -- QUESTIONS: -- LEVEL_ID: 14.05 insert into levels(id,description) values (14.05,'Addition addends 0 to 6'); -- QUESTIONS: -- LEVEL_ID: 14.06 insert into levels(id,description) values (14.06,'Addition addends 0 to 7'); -- QUESTIONS: -- LEVEL_ID: 14.07 insert into levels(id,description) values (14.07,'Addition addends 0 to 8'); -- QUESTIONS: -- LEVEL_ID: 14.08 insert into levels(id,description) values (14.08,'Addition addends 0 to 9'); -- QUESTIONS: -- LEVEL_ID: 14.09 insert into levels(id,description) values (14.09,'Addition addends 0 to 10'); -- QUESTIONS: --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- Number and Operations in Base Ten -- K.NBT --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% insert into domains (domain) values ('Number and Operations in Base Ten'); insert into domains_subjects (domain_id, subject_id) values (3,1); insert into domains_grades (domain_id, grade_id) values (3,1); --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Work with numbers 11–19 to gain foundations for place value. --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ insert into clusters (cluster) values ('Work with numbers 11-19 to gain foundations for place value'); ----------------------------------------------------------------------------- -- 1. Compose and decompose numbers from 11 to 19 into ten ones and -- some further ones, e.g., by using objects or drawings, and record each -- composition or decomposition by a drawing or equation (e.g., 18 = 10 + -- 8); understand that these numbers are composed of ten ones and one, -- two, three, four, five, six, seven, eight, or nine ones. ----------------------------------------------------------------------------- --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- Measurement and Data -- K.MD --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% insert into domains (domain) values ('Measurement and Data'); insert into domains_subjects (domain_id, subject_id) values (4,1); insert into domains_grades (domain_id, grade_id) values (4,1); --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Describe and compare measurable attributes. --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ insert into clusters (cluster) values ('Describe and compare measurable attributes'); ----------------------------------------------------------------------------- -- 1. Describe measurable attributes of objects, such as length or weight. -- Describe several measurable attributes of a single object. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- -- 2. Directly compare two objects with a measurable attribute in common, -- to see which object has “more of”/“less of” the attribute, and describe -- the difference. For example, directly compare the heights of two -- children and describe one child as taller/shorter. ----------------------------------------------------------------------------- --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Classify objects and count the number of objects in each category. --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ insert into clusters (cluster) values ('Classify objects and count the number of objects in each category.'); ----------------------------------------------------------------------------- -- 3. Classify objects into given categories; count the numbers of objects in -- each category and sort the categories by count.3 ----------------------------------------------------------------------------- --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- Geometry -- K.G --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% insert into domains (domain) values ('Geometry'); insert into domains_subjects (domain_id, subject_id) values (5,1); insert into domains_grades (domain_id, grade_id) values (5,1); --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Identify and describe shapes (squares, circles, triangles, rectangles, -- hexagons, cubes, cones, cylinders, and spheres). --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ insert into clusters (cluster) values ('Identify and describe shapes (squares, circles, triangles, rectangles, hexagons, cubes, cones, cylinders, and spheres).'); ----------------------------------------------------------------------------- -- 1. Describe objects in the environment using names of shapes, and -- describe the relative positions of these objects using terms such as -- above, below, beside, in front of, behind, and next to. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- -- 2. Correctly name shapes regardless of their orientations or overall size. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- -- 3. Identify shapes as two-dimensional (lying in a plane, “flat”) or three- -- dimensional (“solid”). ----------------------------------------------------------------------------- --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Analyze, compare, create, and compose shapes. --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ insert into clusters (cluster) values ('Analyze, compare, create, and compose shapes.'); ----------------------------------------------------------------------------- -- 4. Analyze and compare two- and three-dimensional shapes, in -- different sizes and orientations, using informal language to describe -- their similarities, differences, parts (e.g., number of sides and -- vertices/“corners”) and other attributes (e.g., having sides of equal -- length). ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- -- 5. Model shapes in the world by building shapes from components (e.g., -- sticks and clay balls) and drawing shapes. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- -- 6. Compose simple shapes to form larger shapes. For example, “Can you -- join these two triangles with full sides touching to make a rectangle?” ----------------------------------------------------------------------------- ----*****-----%%%%%%-----&&&&&&------######-------@@@@@ SKIP AHEAD SECTION FOR LEVELS ------------------------SUBTRACTION---------------------------------------- -- LEVEL_ID: 500 insert into levels(id,description) values (500,'Subtraction min 0 max 1'); -- QUESTIONS: -- LEVEL_ID: 500.01 insert into levels(id,description) values (500.01,'Subtraction min 0 max 2'); -- QUESTIONS: -- LEVEL_ID: 500.02 insert into levels(id,description) values (500.02,'Subtraction min 0 max 3'); -- QUESTIONS: -- LEVEL_ID: 500.03 insert into levels(id,description) values (500.03,'Subtraction min 0 max 4'); -- QUESTIONS: -- LEVEL_ID: 500.04 insert into levels(id,description) values (500.04,'Subtraction min 0 max 5'); -- QUESTIONS: -- LEVEL_ID: 500.05 insert into levels(id,description) values (500.05,'Subtraction min 0 max 6'); -- QUESTIONS: -- LEVEL_ID: 500.06 insert into levels(id,description) values (500.06,'Subtraction min 0 max 7'); -- QUESTIONS: -- LEVEL_ID: 500.07 insert into levels(id,description) values (500.07,'Subtraction min 0 max 8'); -- QUESTIONS: -- LEVEL_ID: 500.08 insert into levels(id,description) values (500.08,'Subtraction min 0 max 9'); -- QUESTIONS: -- LEVEL_ID: 500.09 insert into levels(id,description) values (500.09,'Subtraction min 0 max 10'); -- QUESTIONS: ----XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-MULTIPLICATION XXXXXXXXXXXXXXXXX -- 0 times table -- LEVEL_ID: 600 insert into levels(id,description) values (600,'0 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600,'0 X 0','0'); -- LEVEL_ID: 600.01 insert into levels(id,description) values (600.01,'0 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.01,'0 X 1','0'); -- LEVEL_ID: 600.02 insert into levels(id,description) values (600.02,'1 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.02,'1 X 0','0'); -- LEVEL_ID: 600.03 insert into levels(id,description) values (600.03,'0 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.03,'0 X 2','0'); -- LEVEL_ID: 600.04 insert into levels(id,description) values (600.04,'2 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.04,'2 X 0','0'); -- LEVEL_ID: 600.05 insert into levels(id,description) values (600.05,'0 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.05,'0 X 3','0'); -- LEVEL_ID: 600.06 insert into levels(id,description) values (600.06,'3 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.06,'3 X 0','0'); -- LEVEL_ID: 600.07 insert into levels(id,description) values (600.07,'0 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.07,'4 X 0','0'); -- LEVEL_ID: 600.08 insert into levels(id,description) values (600.08,'4 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.08,'0 X 4','0'); -- LEVEL_ID: 600.09 insert into levels(id,description) values (600.09,'0 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.09,'0 X 5','0'); -- LEVEL_ID: 600.10 insert into levels(id,description) values (600.10,'5 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.10,'5 X 0','0'); -- LEVEL_ID: 600.11 insert into levels(id,description) values (600.11,'0 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.11,'0 X 6','0'); -- LEVEL_ID: 600.12 insert into levels(id,description) values (600.12,'6 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.12,'6 X 0','0'); -- LEVEL_ID: 600.13 insert into levels(id,description) values (600.13,'0 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.13,'0 X 7','0'); -- LEVEL_ID: 600.14 insert into levels(id,description) values (600.14,'7 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.14,'7 X 0','0'); -- LEVEL_ID: 600.15 insert into levels(id,description) values (600.15,'0 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.15,'0 X 8','0'); -- LEVEL_ID: 600.16 insert into levels(id,description) values (600.16,'8 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.16,'8 X 0','0'); -- LEVEL_ID: 600.17 insert into levels(id,description) values (600.17,'0 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.17,'0 X 9','0'); -- LEVEL_ID: 600.18 insert into levels(id,description) values (600.18,'9 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.18,'9 X 0','0'); -- LEVEL_ID: 600.19 insert into levels(id,description) values (600.19,'0 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.19,'0 X 10','0'); -- LEVEL_ID: 600.20 insert into levels(id,description) values (600.20,'10 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.20,'10 X 0','0'); -- LEVEL_ID: 600.21 insert into levels(id,description) values (600.21,'0 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.21,'0 X 11','0'); -- LEVEL_ID: 600.22 insert into levels(id,description) values (600.22,'11 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.22,'11 X 0','0'); -- LEVEL_ID: 600.23 insert into levels(id,description) values (600.23,'0 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.23,'0 X 12','0'); -- LEVEL_ID: 600.24 insert into levels(id,description) values (600.24,'12 X 0'); -- QUESTIONS: insert into questions (level_id,question,answer) values (600.24,'12 X 0','0'); -- 1 times table -- LEVEL_ID: 601 insert into levels(id,description) values (601,'1 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601,'1 X 1','1'); -- LEVEL_ID: 601.01 insert into levels(id,description) values (601.01,'1 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.01,'1 X 2','2'); -- LEVEL_ID: 601.02 insert into levels(id,description) values (601.02,'2 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.02,'2 X 1','2'); -- LEVEL_ID: 601.03 insert into levels(id,description) values (601.03,'1 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.03,'1 X 3','3'); -- LEVEL_ID: 601.04 insert into levels(id,description) values (601.04,'3 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.04,'3 X 1','3'); -- LEVEL_ID: 601.05 insert into levels(id,description) values (601.05,'1 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.05,'1 X 4','4'); -- LEVEL_ID: 601.06 insert into levels(id,description) values (601.06,'4 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.06,'4 X 1','4'); -- LEVEL_ID: 601.07 insert into levels(id,description) values (601.07,'1 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.07,'1 X 5','5'); -- LEVEL_ID: 601.08 insert into levels(id,description) values (601.08,'5 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.08,'5 X 1','5'); -- LEVEL_ID: 601.09 insert into levels(id,description) values (601.09,'1 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.09,'1 X 6','6'); -- LEVEL_ID: 601.10 insert into levels(id,description) values (601.10,'6 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.10,'6 X 1','6'); -- LEVEL_ID: 601.11 insert into levels(id,description) values (601.11,'1 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.11,'1 X 7','7'); -- LEVEL_ID: 601.12 insert into levels(id,description) values (601.12,'7 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.12,'7 X 1','7'); -- LEVEL_ID: 601.13 insert into levels(id,description) values (601.13,'1 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.13,'1 X 8','8'); -- LEVEL_ID: 601.14 insert into levels(id,description) values (601.14,'8 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.14,'8 X 1','8'); -- LEVEL_ID: 601.15 insert into levels(id,description) values (601.15,'1 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.15,'1 X 9','9'); -- LEVEL_ID: 601.16 insert into levels(id,description) values (601.16,'9 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.16,'9 X 1','9'); -- LEVEL_ID: 601.17 insert into levels(id,description) values (601.17,'1 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.17,'1 X 10','10'); -- LEVEL_ID: 601.18 insert into levels(id,description) values (601.18,'10 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.18,'10 X 1','10'); -- LEVEL_ID: 601.19 insert into levels(id,description) values (601.19,'1 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.19,'1 X 11','11'); -- LEVEL_ID: 601.20 insert into levels(id,description) values (601.20,'11 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.20,'11 X 1','11'); -- LEVEL_ID: 601.21 insert into levels(id,description) values (601.21,'1 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.21,'1 X 12','12'); -- LEVEL_ID: 601.22 insert into levels(id,description) values (601.22,'12 X 1'); -- QUESTIONS: insert into questions (level_id,question,answer) values (601.22,'12 X 1','12'); -- 2 times table -- LEVEL_ID: 602 insert into levels(id,description) values (602,'2 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602,'2 X 2','4'); -- LEVEL_ID: 602.01 insert into levels(id,description) values (602.01,'2 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.01,'2 X 3','6'); -- LEVEL_ID: 602.02 insert into levels(id,description) values (602.02,'3 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.02,'3 X 2','6'); -- LEVEL_ID: 602.03 insert into levels(id,description) values (602.03,'2 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.03,'2 X 4','8'); -- LEVEL_ID: 602.04 insert into levels(id,description) values (602.04,'4 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.04,'4 X 2','8'); -- LEVEL_ID: 602.05 insert into levels(id,description) values (602.05,'2 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.05,'2 X 5','10'); -- LEVEL_ID: 602.06 insert into levels(id,description) values (602.06,'5 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.06,'5 X 2','10'); -- LEVEL_ID: 602.07 insert into levels(id,description) values (602.07,'2 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.07,'2 X 6','12'); -- LEVEL_ID: 602.08 insert into levels(id,description) values (602.08,'6 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.08,'6 X 2','12'); -- LEVEL_ID: 602.09 insert into levels(id,description) values (602.09,'2 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.09,'2 X 7','14'); -- LEVEL_ID: 602.10 insert into levels(id,description) values (602.10,'7 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.10,'7 X 2','14'); -- LEVEL_ID: 602.11 insert into levels(id,description) values (602.11,'2 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.11,'2 X 8','16'); -- LEVEL_ID: 602.12 insert into levels(id,description) values (602.12,'8 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.12,'8 X 2','16'); -- LEVEL_ID: 602.13 insert into levels(id,description) values (602.13,'2 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.13,'2 X 9','18'); -- LEVEL_ID: 602.14 insert into levels(id,description) values (602.14,'9 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.14,'9 X 2','18'); -- LEVEL_ID: 602.15 insert into levels(id,description) values (602.15,'2 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.15,'2 X 10','20'); -- LEVEL_ID: 602.16 insert into levels(id,description) values (602.16,'10 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.16,'10 X 2','20'); -- LEVEL_ID: 602.17 insert into levels(id,description) values (602.17,'2 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.17,'2 X 11','22'); -- LEVEL_ID: 602.18 insert into levels(id,description) values (602.18,'11 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.18,'11 X 2','22'); -- LEVEL_ID: 602.19 insert into levels(id,description) values (602.19,'2 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.19,'2 X 12','24'); -- LEVEL_ID: 602.20 insert into levels(id,description) values (602.20,'12 X 2'); -- QUESTIONS: insert into questions (level_id,question,answer) values (602.20,'12 X 2','24'); -- 3 times table -- LEVEL_ID: 603 insert into levels(id,description) values (603,'3 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603,'3 X 3','9'); -- LEVEL_ID: 603.01 insert into levels(id,description) values (603.01,'3 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.01,'3 X 4','12'); -- LEVEL_ID: 603.02 insert into levels(id,description) values (603.02,'4 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.02,'4 X 3','12'); -- LEVEL_ID: 603.03 insert into levels(id,description) values (603.03,'3 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.03,'3 X 5','15'); -- LEVEL_ID: 603.04 insert into levels(id,description) values (603.04,'5 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.04,'5 X 3','15'); -- LEVEL_ID: 603.05 insert into levels(id,description) values (603.05,'3 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.05,'3 X 6','18'); -- LEVEL_ID: 603.06 insert into levels(id,description) values (603.06,'6 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.06,'6 X 3','18'); -- LEVEL_ID: 603.07 insert into levels(id,description) values (603.07,'3 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.07,'3 X 7','21'); -- LEVEL_ID: 603.08 insert into levels(id,description) values (603.08,'7 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.08,'7 X 3','21'); -- LEVEL_ID: 603.09 insert into levels(id,description) values (603.09,'3 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.09,'3 X 8','24'); -- LEVEL_ID: 603.10 insert into levels(id,description) values (603.10,'8 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.10,'8 X 3','24'); -- LEVEL_ID: 603.11 insert into levels(id,description) values (603.11,'3 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.11,'3 X 9','27'); -- LEVEL_ID: 603.12 insert into levels(id,description) values (603.12,'9 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.12,'9 X 3','27'); -- LEVEL_ID: 603.13 insert into levels(id,description) values (603.13,'3 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.13,'3 X 10','30'); -- LEVEL_ID: 603.14 insert into levels(id,description) values (603.14,'10 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.14,'10 X 3','30'); -- LEVEL_ID: 603.15 insert into levels(id,description) values (603.15,'3 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.15,'3 X 11','33'); -- LEVEL_ID: 603.16 insert into levels(id,description) values (603.16,'11 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.16,'11 X 3','33'); -- LEVEL_ID: 603.17 insert into levels(id,description) values (603.17,'3 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.17,'3 X 12','36'); -- LEVEL_ID: 603.18 insert into levels(id,description) values (603.18,'12 X 3'); -- QUESTIONS: insert into questions (level_id,question,answer) values (603.18,'12 X 3','36'); -- 4 times table -- LEVEL_ID: 604 insert into levels(id,description) values (604,'4 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604,'4 X 4','16'); -- LEVEL_ID: 604.01 insert into levels(id,description) values (604.01,'4 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.01,'4 X 5','20'); -- LEVEL_ID: 604.02 insert into levels(id,description) values (604.02,'5 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.02,'5 X 4','20'); -- LEVEL_ID: 604.03 insert into levels(id,description) values (604.03,'4 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.03,'4 X 6','24'); -- LEVEL_ID: 604.04 insert into levels(id,description) values (604.04,'6 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.04,'6 X 4','24'); -- LEVEL_ID: 604.05 insert into levels(id,description) values (604.05,'4 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.05,'4 X 7','28'); -- LEVEL_ID: 604.06 insert into levels(id,description) values (604.06,'7 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.06,'7 X 4','28'); -- LEVEL_ID: 604.07 insert into levels(id,description) values (604.07,'4 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.07,'4 X 8','32'); -- LEVEL_ID: 604.08 insert into levels(id,description) values (604.08,'8 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.08,'8 X 4','32'); -- LEVEL_ID: 604.09 insert into levels(id,description) values (604.09,'4 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.09,'4 X 9','36'); -- LEVEL_ID: 604.10 insert into levels(id,description) values (604.10,'9 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.10,'9 X 4','36'); -- LEVEL_ID: 604.11 insert into levels(id,description) values (604.11,'4 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.11,'4 X 10','40'); -- LEVEL_ID: 604.12 insert into levels(id,description) values (604.12,'10 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.12,'10 X 4','40'); -- LEVEL_ID: 604.13 insert into levels(id,description) values (604.13,'4 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.13,'4 X 11','44'); -- LEVEL_ID: 604.14 insert into levels(id,description) values (604.14,'11 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.14,'11 X 4','44'); -- LEVEL_ID: 604.15 insert into levels(id,description) values (604.15,'4 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.15,'4 X 12','48'); -- LEVEL_ID: 604.16 insert into levels(id,description) values (604.16,'12 X 4'); -- QUESTIONS: insert into questions (level_id,question,answer) values (604.16,'12 X 4','48'); -- 5 times table -- LEVEL_ID: 605 insert into levels(id,description) values (605,'5 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605,'5 X 5','25'); -- LEVEL_ID: 605.01 insert into levels(id,description) values (605.01,'5 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.01,'5 X 6','30'); -- LEVEL_ID: 605.02 insert into levels(id,description) values (605.02,'6 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.02,'6 X 5','30'); -- LEVEL_ID: 605.03 insert into levels(id,description) values (605.03,'5 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.03,'5 X 7','35'); -- LEVEL_ID: 605.04 insert into levels(id,description) values (605.04,'7 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.04,'7 X 5','35'); -- LEVEL_ID: 605.05 insert into levels(id,description) values (605.05,'5 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.05,'5 X 8','40'); -- LEVEL_ID: 605.06 insert into levels(id,description) values (605.06,'8 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.06,'8 X 5','40'); -- LEVEL_ID: 605.07 insert into levels(id,description) values (605.07,'5 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.07,'5 X 9','45'); -- LEVEL_ID: 605.08 insert into levels(id,description) values (605.08,'9 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.08,'9 X 5','45'); -- LEVEL_ID: 605.09 insert into levels(id,description) values (605.09,'5 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.09,'5 X 10','50'); -- LEVEL_ID: 605.10 insert into levels(id,description) values (605.10,'10 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.10,'10 X 5','50'); -- LEVEL_ID: 605.11 insert into levels(id,description) values (605.11,'5 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.11,'5 X 11','55'); -- LEVEL_ID: 605.12 insert into levels(id,description) values (605.12,'11 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.12,'11 X 5','55'); -- LEVEL_ID: 605.13 insert into levels(id,description) values (605.13,'5 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.13,'5 X 12','60'); -- LEVEL_ID: 605.14 insert into levels(id,description) values (605.14,'12 X 5'); -- QUESTIONS: insert into questions (level_id,question,answer) values (605.14,'12 X 5','60'); -- 6 times table -- LEVEL_ID: 606 insert into levels(id,description) values (606,'6 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606,'6 X 6','36'); -- LEVEL_ID: 606.01 insert into levels(id,description) values (606.01,'6 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.01,'6 X 7','42'); -- LEVEL_ID: 606.02 insert into levels(id,description) values (606.02,'7 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.02,'7 X 6','42'); -- LEVEL_ID: 606.03 insert into levels(id,description) values (606.03,'6 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.03,'6 X 8','48'); -- LEVEL_ID: 606.04 insert into levels(id,description) values (606.04,'8 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.04,'8 X 6','48'); -- LEVEL_ID: 606.05 insert into levels(id,description) values (606.05,'6 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.05,'6 X 9','54'); -- LEVEL_ID: 606.06 insert into levels(id,description) values (606.06,'9 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.06,'9 X 6','54'); -- LEVEL_ID: 606.07 insert into levels(id,description) values (606.07,'6 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.07,'6 X 10','60'); -- LEVEL_ID: 606.08 insert into levels(id,description) values (606.08,'10 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.08,'10 X 6','60'); -- LEVEL_ID: 606.09 insert into levels(id,description) values (606.09,'6 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.09,'6 X 11','66'); -- LEVEL_ID: 606.10 insert into levels(id,description) values (606.10,'11 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.10,'11 X 6','66'); -- LEVEL_ID: 606.11 insert into levels(id,description) values (606.11,'6 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.11,'6 X 12','72'); -- LEVEL_ID: 606.12 insert into levels(id,description) values (606.12,'12 X 6'); -- QUESTIONS: insert into questions (level_id,question,answer) values (606.12,'12 X 6','72'); -- 7 times table -- LEVEL_ID: 607 insert into levels(id,description) values (607,'7 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607,'7 X 7','49'); -- LEVEL_ID: 607.01 insert into levels(id,description) values (607.01,'7 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607.01,'7 X 8','56'); -- LEVEL_ID: 607.02 insert into levels(id,description) values (607.02,'8 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607.02,'8 X 7','56'); -- LEVEL_ID: 607.03 insert into levels(id,description) values (607.03,'7 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607.03,'7 X 9','63'); -- LEVEL_ID: 607.04 insert into levels(id,description) values (607.04,'9 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607.04,'9 X 7','63'); -- LEVEL_ID: 607.05 insert into levels(id,description) values (607.05,'7 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607.05,'7 X 10','70'); -- LEVEL_ID: 607.06 insert into levels(id,description) values (607.06,'10 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607.06,'10 X 7','70'); -- LEVEL_ID: 607.07 insert into levels(id,description) values (607.07,'7 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607.07,'7 X 11','77'); -- LEVEL_ID: 607.08 insert into levels(id,description) values (607.08,'11 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607.08,'11 X 7','77'); -- LEVEL_ID: 607.09 insert into levels(id,description) values (607.09,'7 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607.09,'7 X 12','84'); -- LEVEL_ID: 607.10 insert into levels(id,description) values (607.10,'12 X 7'); -- QUESTIONS: insert into questions (level_id,question,answer) values (607.10,'12 X 7','84'); -- 8 times table -- LEVEL_ID: 608 insert into levels(id,description) values (608,'8 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (608,'8 X 8','64'); -- LEVEL_ID: 608.01 insert into levels(id,description) values (608.01,'8 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (608.01,'8 X 9','72'); -- LEVEL_ID: 608.02 insert into levels(id,description) values (608.02,'9 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (608.02,'9 X 8','72'); -- LEVEL_ID: 608.03 insert into levels(id,description) values (608.03,'8 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (608.03,'8 X 10','80'); -- LEVEL_ID: 608.04 insert into levels(id,description) values (608.04,'10 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (608.04,'10 X 8','80'); -- LEVEL_ID: 608.05 insert into levels(id,description) values (608.05,'8 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (608.05,'8 X 11','88'); -- LEVEL_ID: 608.06 insert into levels(id,description) values (608.06,'11 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (608.06,'11 X 8','88'); -- LEVEL_ID: 608.07 insert into levels(id,description) values (608.07,'8 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (608.07,'8 X 12','96'); -- LEVEL_ID: 608.08 insert into levels(id,description) values (608.08,'12 X 8'); -- QUESTIONS: insert into questions (level_id,question,answer) values (608.08,'12 X 8','96'); -- 9 times table -- LEVEL_ID: 609 insert into levels(id,description) values (609,'9 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (609,'9 X 9','81'); -- LEVEL_ID: 609.01 insert into levels(id,description) values (609.01,'9 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (609.01,'9 X 10','90'); -- LEVEL_ID: 609.02 insert into levels(id,description) values (609.02,'10 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (609.02,'10 X 9','90'); -- LEVEL_ID: 609.03 insert into levels(id,description) values (609.03,'9 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (609.03,'9 X 11','99'); -- LEVEL_ID: 609.04 insert into levels(id,description) values (609.04,'11 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (609.04,'11 X 9','99'); -- LEVEL_ID: 609.05 insert into levels(id,description) values (609.05,'9 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (609.05,'9 X 12','108'); -- LEVEL_ID: 609.06 insert into levels(id,description) values (609.06,'12 X 9'); -- QUESTIONS: insert into questions (level_id,question,answer) values (609.06,'12 X 9','108'); -- 10 times table -- LEVEL_ID: 610 insert into levels(id,description) values (610,'10 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (610,'10 X 10','100'); -- LEVEL_ID: 610.01 insert into levels(id,description) values (610.01,'10 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (610.01,'10 X 11','110'); -- LEVEL_ID: 610.02 insert into levels(id,description) values (610.02,'11 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (610.02,'11 X 10','110'); -- LEVEL_ID: 610.03 insert into levels(id,description) values (610.03,'10 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (610.03,'10 X 12','120'); -- LEVEL_ID: 610.04 insert into levels(id,description) values (610.04,'12 X 10'); -- QUESTIONS: insert into questions (level_id,question,answer) values (610.04,'12 X 10','120'); -- 11 times table -- LEVEL_ID: 611 insert into levels(id,description) values (611,'11 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (611,'11 X 11','122'); -- LEVEL_ID: 611.01 insert into levels(id,description) values (611.01,'11 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (611.01,'11 X 12','132'); -- LEVEL_ID: 611.02 insert into levels(id,description) values (611.02,'12 X 11'); -- QUESTIONS: insert into questions (level_id,question,answer) values (611.02,'12 X 11','132'); -- 12 times table -- LEVEL_ID: 612 insert into levels(id,description) values (612,'12 X 12'); -- QUESTIONS: insert into questions (level_id,question,answer) values (612,'12 X 12','144'); -----////////////////////-DIVISION-/////////////////////////////////////// -- LEVEL_ID: 700 insert into levels(id,description) values (700,'Division factors 0 to 1'); -- QUESTIONS: --GAMES_ATTEMPTS --(CONTINUED PASSWORDS)....... --PASSWORDS --3 letter easy words insert into passwords (password) values ('ahh'); insert into passwords (password) values ('abs'); insert into passwords (password) values ('ace'); insert into passwords (password) values ('add'); insert into passwords (password) values ('aft'); insert into passwords (password) values ('ape'); insert into passwords (password) values ('and'); insert into passwords (password) values ('aim'); insert into passwords (password) values ('aid'); insert into passwords (password) values ('air'); insert into passwords (password) values ('all'); insert into passwords (password) values ('amp'); insert into passwords (password) values ('ant'); insert into passwords (password) values ('app'); insert into passwords (password) values ('apt'); insert into passwords (password) values ('arc'); insert into passwords (password) values ('arf'); insert into passwords (password) values ('ark'); insert into passwords (password) values ('arm'); insert into passwords (password) values ('art'); insert into passwords (password) values ('ash'); insert into passwords (password) values ('ask'); insert into passwords (password) values ('ate'); insert into passwords (password) values ('ave'); insert into passwords (password) values ('awe'); insert into passwords (password) values ('axe'); insert into passwords (password) values ('aye'); insert into passwords (password) values ('ays'); /* insert into passwords (password) values ('baa'); insert into passwords (password) values ('bad'); insert into passwords (password) values ('bag'); insert into passwords (password) values ('bam'); insert into passwords (password) values ('ban'); insert into passwords (password) values ('bap'); insert into passwords (password) values ('bar'); insert into passwords (password) values ('bat'); insert into passwords (password) values ('bay'); insert into passwords (password) values ('bed'); insert into passwords (password) values ('bee'); insert into passwords (password) values ('beg'); insert into passwords (password) values ('ben'); insert into passwords (password) values ('bet'); insert into passwords (password) values ('bib'); insert into passwords (password) values ('bid'); insert into passwords (password) values ('big'); insert into passwords (password) values ('bin'); insert into passwords (password) values ('bio'); insert into passwords (password) values ('bit'); insert into passwords (password) values ('biz'); insert into passwords (password) values ('boa'); insert into passwords (password) values ('bob'); insert into passwords (password) values ('bod'); insert into passwords (password) values ('bog'); insert into passwords (password) values ('boo'); insert into passwords (password) values ('bop'); insert into passwords (password) values ('bot'); insert into passwords (password) values ('bow'); insert into passwords (password) values ('box'); insert into passwords (password) values ('boy'); insert into passwords (password) values ('bro'); insert into passwords (password) values ('brr'); insert into passwords (password) values ('bub'); insert into passwords (password) values ('bud'); insert into passwords (password) values ('bug'); insert into passwords (password) values ('bum'); insert into passwords (password) values ('bun'); insert into passwords (password) values ('bur'); insert into passwords (password) values ('bus'); insert into passwords (password) values ('but'); insert into passwords (password) values ('buy'); insert into passwords (password) values ('cab'); insert into passwords (password) values ('cad'); insert into passwords (password) values ('cam'); insert into passwords (password) values ('can'); insert into passwords (password) values ('cap'); insert into passwords (password) values ('car'); insert into passwords (password) values ('cat'); insert into passwords (password) values ('caw'); insert into passwords (password) values ('cee'); insert into passwords (password) values ('cob'); insert into passwords (password) values ('cod'); insert into passwords (password) values ('cog'); insert into passwords (password) values ('col'); insert into passwords (password) values ('con'); insert into passwords (password) values ('coo'); insert into passwords (password) values ('cop'); insert into passwords (password) values ('cor'); insert into passwords (password) values ('cos'); insert into passwords (password) values ('cot'); insert into passwords (password) values ('cow'); insert into passwords (password) values ('coy'); insert into passwords (password) values ('coz'); insert into passwords (password) values ('cry'); insert into passwords (password) values ('cub'); insert into passwords (password) values ('cud'); insert into passwords (password) values ('cue'); insert into passwords (password) values ('cup'); insert into passwords (password) values ('cut'); insert into passwords (password) values ('dab'); insert into passwords (password) values ('dad'); insert into passwords (password) values ('dag'); insert into passwords (password) values ('dah'); insert into passwords (password) values ('dak'); insert into passwords (password) values ('dal'); insert into passwords (password) values ('dam'); insert into passwords (password) values ('dan'); insert into passwords (password) values ('dap'); insert into passwords (password) values ('daw'); insert into passwords (password) values ('day'); insert into passwords (password) values ('deb'); insert into passwords (password) values ('dee'); insert into passwords (password) values ('def'); insert into passwords (password) values ('del'); insert into passwords (password) values ('den'); insert into passwords (password) values ('dev'); insert into passwords (password) values ('dew'); insert into passwords (password) values ('dex'); insert into passwords (password) values ('dey'); insert into passwords (password) values ('dib'); insert into passwords (password) values ('did'); insert into passwords (password) values ('die'); insert into passwords (password) values ('dif'); insert into passwords (password) values ('dig'); insert into passwords (password) values ('dim'); insert into passwords (password) values ('din'); insert into passwords (password) values ('dip'); insert into passwords (password) values ('dis'); insert into passwords (password) values ('dit'); insert into passwords (password) values ('doc'); insert into passwords (password) values ('doe'); insert into passwords (password) values ('dog'); insert into passwords (password) values ('dol'); insert into passwords (password) values ('dom'); insert into passwords (password) values ('don'); insert into passwords (password) values ('dor'); insert into passwords (password) values ('dos'); insert into passwords (password) values ('dot'); insert into passwords (password) values ('dow'); insert into passwords (password) values ('dry'); insert into passwords (password) values ('dub'); insert into passwords (password) values ('dud'); insert into passwords (password) values ('due'); insert into passwords (password) values ('dug'); insert into passwords (password) values ('duh'); insert into passwords (password) values ('dun'); insert into passwords (password) values ('duo'); insert into passwords (password) values ('dup'); insert into passwords (password) values ('dye'); insert into passwords (password) values ('ear'); insert into passwords (password) values ('eat'); insert into passwords (password) values ('ebb'); insert into passwords (password) values ('eds'); insert into passwords (password) values ('eek'); insert into passwords (password) values ('eel'); insert into passwords (password) values ('egg'); insert into passwords (password) values ('ego'); insert into passwords (password) values ('eke'); insert into passwords (password) values ('eld'); insert into passwords (password) values ('elf'); insert into passwords (password) values ('elk'); insert into passwords (password) values ('ell'); insert into passwords (password) values ('elm'); insert into passwords (password) values ('end'); insert into passwords (password) values ('eon'); insert into passwords (password) values ('era'); insert into passwords (password) values ('ere'); insert into passwords (password) values ('err'); insert into passwords (password) values ('eve'); insert into passwords (password) values ('eye'); insert into passwords (password) values ('fab'); insert into passwords (password) values ('fad'); insert into passwords (password) values ('fan'); insert into passwords (password) values ('far'); insert into passwords (password) values ('fat'); insert into passwords (password) values ('fax'); insert into passwords (password) values ('fay'); insert into passwords (password) values ('fed'); insert into passwords (password) values ('fee'); insert into passwords (password) values ('fen'); insert into passwords (password) values ('fer'); insert into passwords (password) values ('fes'); insert into passwords (password) values ('fet'); insert into passwords (password) values ('few'); insert into passwords (password) values ('fey'); insert into passwords (password) values ('fez'); insert into passwords (password) values ('fib'); insert into passwords (password) values ('fid'); insert into passwords (password) values ('fie'); insert into passwords (password) values ('fig'); insert into passwords (password) values ('fin'); insert into passwords (password) values ('fir'); insert into passwords (password) values ('fit'); insert into passwords (password) values ('fix'); insert into passwords (password) values ('fiz'); insert into passwords (password) values ('flu'); insert into passwords (password) values ('fly'); insert into passwords (password) values ('fob'); insert into passwords (password) values ('foe'); insert into passwords (password) values ('fog'); insert into passwords (password) values ('foh'); insert into passwords (password) values ('fon'); insert into passwords (password) values ('fop'); insert into passwords (password) values ('for'); insert into passwords (password) values ('fox'); insert into passwords (password) values ('foy'); insert into passwords (password) values ('fro'); insert into passwords (password) values ('fry'); insert into passwords (password) values ('fub'); insert into passwords (password) values ('fud'); insert into passwords (password) values ('fun'); insert into passwords (password) values ('fur'); insert into passwords (password) values ('gab'); insert into passwords (password) values ('gad'); insert into passwords (password) values ('gag'); insert into passwords (password) values ('gal'); insert into passwords (password) values ('gam'); insert into passwords (password) values ('gan'); insert into passwords (password) values ('gap'); insert into passwords (password) values ('gar'); insert into passwords (password) values ('gas'); insert into passwords (password) values ('gat'); insert into passwords (password) values ('ged'); insert into passwords (password) values ('gee'); insert into passwords (password) values ('gel'); insert into passwords (password) values ('gem'); insert into passwords (password) values ('gen'); insert into passwords (password) values ('get'); insert into passwords (password) values ('gey'); insert into passwords (password) values ('gib'); insert into passwords (password) values ('gid'); insert into passwords (password) values ('gie'); insert into passwords (password) values ('gig'); insert into passwords (password) values ('gin'); insert into passwords (password) values ('gip'); insert into passwords (password) values ('git'); insert into passwords (password) values ('gnu'); insert into passwords (password) values ('goa'); insert into passwords (password) values ('gob'); insert into passwords (password) values ('god'); insert into passwords (password) values ('goo'); insert into passwords (password) values ('gor'); insert into passwords (password) values ('gos'); insert into passwords (password) values ('got'); insert into passwords (password) values ('gox'); insert into passwords (password) values ('goy'); insert into passwords (password) values ('gul'); insert into passwords (password) values ('gum'); insert into passwords (password) values ('gun'); insert into passwords (password) values ('gut'); insert into passwords (password) values ('guv'); insert into passwords (password) values ('guy'); insert into passwords (password) values ('gym'); insert into passwords (password) values ('gyp'); insert into passwords (password) values ('had'); insert into passwords (password) values ('hag'); insert into passwords (password) values ('hah'); insert into passwords (password) values ('ham'); insert into passwords (password) values ('hap'); insert into passwords (password) values ('has'); insert into passwords (password) values ('hat'); insert into passwords (password) values ('haw'); insert into passwords (password) values ('hay'); insert into passwords (password) values ('heh'); insert into passwords (password) values ('hem'); insert into passwords (password) values ('hen'); insert into passwords (password) values ('hep'); insert into passwords (password) values ('her'); insert into passwords (password) values ('hes'); insert into passwords (password) values ('hew'); insert into passwords (password) values ('hex'); insert into passwords (password) values ('hey'); insert into passwords (password) values ('hic'); insert into passwords (password) values ('hid'); insert into passwords (password) values ('hie'); insert into passwords (password) values ('him'); insert into passwords (password) values ('hin'); insert into passwords (password) values ('hip'); insert into passwords (password) values ('his'); insert into passwords (password) values ('hit'); insert into passwords (password) values ('hmm'); insert into passwords (password) values ('hob'); insert into passwords (password) values ('hod'); insert into passwords (password) values ('hoe'); insert into passwords (password) values ('hog'); insert into passwords (password) values ('hon'); insert into passwords (password) values ('hop'); insert into passwords (password) values ('hot'); insert into passwords (password) values ('how'); insert into passwords (password) values ('hoy'); insert into passwords (password) values ('hub'); insert into passwords (password) values ('hue'); insert into passwords (password) values ('hug'); insert into passwords (password) values ('huh'); insert into passwords (password) values ('hun'); insert into passwords (password) values ('hup'); insert into passwords (password) values ('hut'); insert into passwords (password) values ('hyp'); insert into passwords (password) values ('ice'); insert into passwords (password) values ('ich'); insert into passwords (password) values ('ick'); insert into passwords (password) values ('icy'); insert into passwords (password) values ('ids'); insert into passwords (password) values ('iff'); insert into passwords (password) values ('ifs'); insert into passwords (password) values ('igg'); insert into passwords (password) values ('ilk'); insert into passwords (password) values ('ill'); insert into passwords (password) values ('imp'); insert into passwords (password) values ('ink'); insert into passwords (password) values ('inn'); insert into passwords (password) values ('ins'); insert into passwords (password) values ('ion'); insert into passwords (password) values ('ire'); insert into passwords (password) values ('irk'); insert into passwords (password) values ('ism'); insert into passwords (password) values ('its'); insert into passwords (password) values ('ivy'); insert into passwords (password) values ('jab'); insert into passwords (password) values ('jag'); insert into passwords (password) values ('jam'); insert into passwords (password) values ('jar'); insert into passwords (password) values ('jaw'); insert into passwords (password) values ('jay'); insert into passwords (password) values ('jee'); insert into passwords (password) values ('jet'); insert into passwords (password) values ('jib'); insert into passwords (password) values ('jig'); insert into passwords (password) values ('jin'); insert into passwords (password) values ('job'); insert into passwords (password) values ('joe'); insert into passwords (password) values ('jog'); insert into passwords (password) values ('jot'); insert into passwords (password) values ('jow'); insert into passwords (password) values ('joy'); insert into passwords (password) values ('jug'); insert into passwords (password) values ('jun'); insert into passwords (password) values ('jus'); insert into passwords (password) values ('jut'); insert into passwords (password) values ('kab'); insert into passwords (password) values ('kae'); insert into passwords (password) values ('kaf'); insert into passwords (password) values ('kas'); insert into passwords (password) values ('kat'); insert into passwords (password) values ('kea'); insert into passwords (password) values ('keg'); insert into passwords (password) values ('ken'); insert into passwords (password) values ('kep'); insert into passwords (password) values ('kex'); insert into passwords (password) values ('key'); insert into passwords (password) values ('kid'); insert into passwords (password) values ('kin'); insert into passwords (password) values ('kip'); insert into passwords (password) values ('kis'); insert into passwords (password) values ('kit'); insert into passwords (password) values ('koa'); insert into passwords (password) values ('kob'); insert into passwords (password) values ('koi'); insert into passwords (password) values ('kop'); insert into passwords (password) values ('kor'); insert into passwords (password) values ('kos'); insert into passwords (password) values ('lab'); insert into passwords (password) values ('lad'); insert into passwords (password) values ('lag'); insert into passwords (password) values ('lam'); insert into passwords (password) values ('lap'); insert into passwords (password) values ('lar'); insert into passwords (password) values ('las'); insert into passwords (password) values ('lat'); insert into passwords (password) values ('lav'); insert into passwords (password) values ('law'); insert into passwords (password) values ('lax'); insert into passwords (password) values ('lay'); insert into passwords (password) values ('lea'); insert into passwords (password) values ('led'); insert into passwords (password) values ('lee'); insert into passwords (password) values ('leg'); insert into passwords (password) values ('lei'); insert into passwords (password) values ('lek'); insert into passwords (password) values ('let'); insert into passwords (password) values ('lex'); insert into passwords (password) values ('ley'); insert into passwords (password) values ('lib'); insert into passwords (password) values ('lid'); insert into passwords (password) values ('lie'); insert into passwords (password) values ('lin'); insert into passwords (password) values ('lip'); insert into passwords (password) values ('lit'); insert into passwords (password) values ('lob'); insert into passwords (password) values ('log'); insert into passwords (password) values ('loo'); insert into passwords (password) values ('lop'); insert into passwords (password) values ('lot'); insert into passwords (password) values ('low'); insert into passwords (password) values ('lox'); insert into passwords (password) values ('lug'); insert into passwords (password) values ('lum'); insert into passwords (password) values ('luv'); insert into passwords (password) values ('lux'); insert into passwords (password) values ('lye'); insert into passwords (password) values ('mac'); insert into passwords (password) values ('mad'); insert into passwords (password) values ('mae'); insert into passwords (password) values ('mag'); insert into passwords (password) values ('man'); insert into passwords (password) values ('map'); insert into passwords (password) values ('mar'); insert into passwords (password) values ('mas'); insert into passwords (password) values ('mat'); insert into passwords (password) values ('maw'); insert into passwords (password) values ('max'); insert into passwords (password) values ('may'); insert into passwords (password) values ('med'); insert into passwords (password) values ('mel'); insert into passwords (password) values ('men'); insert into passwords (password) values ('met'); insert into passwords (password) values ('mew'); insert into passwords (password) values ('mib'); insert into passwords (password) values ('mic'); insert into passwords (password) values ('mid'); insert into passwords (password) values ('mig'); insert into passwords (password) values ('mil'); insert into passwords (password) values ('mim'); insert into passwords (password) values ('mir'); insert into passwords (password) values ('mis'); insert into passwords (password) values ('mix'); insert into passwords (password) values ('moa'); insert into passwords (password) values ('mob'); insert into passwords (password) values ('moc'); insert into passwords (password) values ('mod'); insert into passwords (password) values ('mog'); insert into passwords (password) values ('mol'); insert into passwords (password) values ('mom'); insert into passwords (password) values ('mon'); insert into passwords (password) values ('moo'); insert into passwords (password) values ('mop'); insert into passwords (password) values ('mor'); insert into passwords (password) values ('mos'); insert into passwords (password) values ('mot'); insert into passwords (password) values ('mow'); insert into passwords (password) values ('mud'); insert into passwords (password) values ('mug'); insert into passwords (password) values ('mum'); insert into passwords (password) values ('mun'); insert into passwords (password) values ('mut'); insert into passwords (password) values ('nab'); insert into passwords (password) values ('nag'); insert into passwords (password) values ('nah'); insert into passwords (password) values ('nam'); insert into passwords (password) values ('nan'); insert into passwords (password) values ('nap'); insert into passwords (password) values ('naw'); insert into passwords (password) values ('nay'); insert into passwords (password) values ('neb'); insert into passwords (password) values ('nee'); insert into passwords (password) values ('neg'); insert into passwords (password) values ('net'); insert into passwords (password) values ('new'); insert into passwords (password) values ('nib'); insert into passwords (password) values ('nil'); insert into passwords (password) values ('nim'); insert into passwords (password) values ('nip'); insert into passwords (password) values ('nit'); insert into passwords (password) values ('nix'); insert into passwords (password) values ('nob'); insert into passwords (password) values ('nod'); insert into passwords (password) values ('nog'); insert into passwords (password) values ('nom'); insert into passwords (password) values ('noo'); insert into passwords (password) values ('nor'); insert into passwords (password) values ('nos'); insert into passwords (password) values ('not'); insert into passwords (password) values ('now'); insert into passwords (password) values ('nub'); insert into passwords (password) values ('nun'); insert into passwords (password) values ('nut'); insert into passwords (password) values ('oaf'); insert into passwords (password) values ('oak'); insert into passwords (password) values ('oar'); insert into passwords (password) values ('oat'); insert into passwords (password) values ('obe'); insert into passwords (password) values ('odd'); insert into passwords (password) values ('off'); insert into passwords (password) values ('oil'); insert into passwords (password) values ('old'); insert into passwords (password) values ('one'); insert into passwords (password) values ('ono'); insert into passwords (password) values ('opt'); insert into passwords (password) values ('orc'); insert into passwords (password) values ('ore'); insert into passwords (password) values ('our'); insert into passwords (password) values ('out'); insert into passwords (password) values ('owe'); insert into passwords (password) values ('owl'); insert into passwords (password) values ('own'); insert into passwords (password) values ('oxy'); insert into passwords (password) values ('pac'); insert into passwords (password) values ('pad'); insert into passwords (password) values ('pal'); insert into passwords (password) values ('pam'); insert into passwords (password) values ('pan'); insert into passwords (password) values ('pap'); insert into passwords (password) values ('par'); insert into passwords (password) values ('pas'); insert into passwords (password) values ('pat'); insert into passwords (password) values ('paw'); insert into passwords (password) values ('pax'); insert into passwords (password) values ('pay'); insert into passwords (password) values ('pec'); insert into passwords (password) values ('ped'); insert into passwords (password) values ('peg'); insert into passwords (password) values ('pen'); insert into passwords (password) values ('pep'); insert into passwords (password) values ('per'); insert into passwords (password) values ('pes'); insert into passwords (password) values ('pet'); insert into passwords (password) values ('pew'); insert into passwords (password) values ('pic'); insert into passwords (password) values ('pie'); insert into passwords (password) values ('pig'); insert into passwords (password) values ('pin'); insert into passwords (password) values ('pip'); insert into passwords (password) values ('pit'); insert into passwords (password) values ('ply'); insert into passwords (password) values ('pod'); insert into passwords (password) values ('pol'); insert into passwords (password) values ('pom'); insert into passwords (password) values ('pop'); insert into passwords (password) values ('pot'); insert into passwords (password) values ('pow'); insert into passwords (password) values ('pox'); insert into passwords (password) values ('pro'); insert into passwords (password) values ('pry'); insert into passwords (password) values ('pug'); insert into passwords (password) values ('pun'); insert into passwords (password) values ('pup'); insert into passwords (password) values ('pur'); insert into passwords (password) values ('put'); insert into passwords (password) values ('rad'); insert into passwords (password) values ('rag'); insert into passwords (password) values ('rah'); insert into passwords (password) values ('raj'); insert into passwords (password) values ('ram'); insert into passwords (password) values ('ran'); insert into passwords (password) values ('rap'); insert into passwords (password) values ('rat'); insert into passwords (password) values ('raw'); insert into passwords (password) values ('rax'); insert into passwords (password) values ('ray'); insert into passwords (password) values ('reb'); insert into passwords (password) values ('rec'); insert into passwords (password) values ('red'); insert into passwords (password) values ('ref'); insert into passwords (password) values ('reg'); insert into passwords (password) values ('rem'); insert into passwords (password) values ('rep'); insert into passwords (password) values ('res'); insert into passwords (password) values ('ret'); insert into passwords (password) values ('rev'); insert into passwords (password) values ('rex'); insert into passwords (password) values ('rib'); insert into passwords (password) values ('rid'); insert into passwords (password) values ('rif'); insert into passwords (password) values ('rig'); insert into passwords (password) values ('rim'); insert into passwords (password) values ('rin'); insert into passwords (password) values ('rip'); insert into passwords (password) values ('rob'); insert into passwords (password) values ('roc'); insert into passwords (password) values ('rod'); insert into passwords (password) values ('rom'); insert into passwords (password) values ('rot'); insert into passwords (password) values ('row'); insert into passwords (password) values ('rub'); insert into passwords (password) values ('rue'); insert into passwords (password) values ('rug'); insert into passwords (password) values ('run'); insert into passwords (password) values ('rut'); insert into passwords (password) values ('rye'); insert into passwords (password) values ('sab'); insert into passwords (password) values ('sac'); insert into passwords (password) values ('sad'); insert into passwords (password) values ('sag'); insert into passwords (password) values ('sal'); insert into passwords (password) values ('sap'); insert into passwords (password) values ('sat'); insert into passwords (password) values ('saw'); insert into passwords (password) values ('sax'); insert into passwords (password) values ('say'); insert into passwords (password) values ('sea'); insert into passwords (password) values ('sec'); insert into passwords (password) values ('see'); insert into passwords (password) values ('set'); insert into passwords (password) values ('sew'); insert into passwords (password) values ('she'); insert into passwords (password) values ('shy'); insert into passwords (password) values ('sib'); insert into passwords (password) values ('sic'); insert into passwords (password) values ('sim'); insert into passwords (password) values ('sin'); insert into passwords (password) values ('sip'); insert into passwords (password) values ('sir'); insert into passwords (password) values ('sis'); insert into passwords (password) values ('sit'); insert into passwords (password) values ('six'); insert into passwords (password) values ('ska'); insert into passwords (password) values ('ski'); insert into passwords (password) values ('sky'); insert into passwords (password) values ('sly'); insert into passwords (password) values ('sob'); insert into passwords (password) values ('sod'); insert into passwords (password) values ('sol'); insert into passwords (password) values ('son'); insert into passwords (password) values ('sop'); insert into passwords (password) values ('sos'); insert into passwords (password) values ('sow'); insert into passwords (password) values ('sox'); insert into passwords (password) values ('soy'); insert into passwords (password) values ('spa'); insert into passwords (password) values ('spy'); insert into passwords (password) values ('sub'); insert into passwords (password) values ('sue'); insert into passwords (password) values ('sum'); insert into passwords (password) values ('sun'); insert into passwords (password) values ('sup'); insert into passwords (password) values ('syn'); insert into passwords (password) values ('tab'); insert into passwords (password) values ('tad'); insert into passwords (password) values ('tag'); insert into passwords (password) values ('taj'); insert into passwords (password) values ('tam'); insert into passwords (password) values ('tan'); insert into passwords (password) values ('tao'); insert into passwords (password) values ('tap'); insert into passwords (password) values ('tar'); insert into passwords (password) values ('tat'); insert into passwords (password) values ('taw'); insert into passwords (password) values ('tax'); insert into passwords (password) values ('tea'); insert into passwords (password) values ('ted'); insert into passwords (password) values ('tee'); insert into passwords (password) values ('teg'); insert into passwords (password) values ('tel'); insert into passwords (password) values ('ten'); insert into passwords (password) values ('the'); insert into passwords (password) values ('thy'); insert into passwords (password) values ('tic'); insert into passwords (password) values ('tie'); insert into passwords (password) values ('til'); insert into passwords (password) values ('tin'); insert into passwords (password) values ('tip'); insert into passwords (password) values ('tis'); insert into passwords (password) values ('tod'); insert into passwords (password) values ('toe'); insert into passwords (password) values ('tog'); insert into passwords (password) values ('tom'); insert into passwords (password) values ('ton'); insert into passwords (password) values ('too'); insert into passwords (password) values ('top'); insert into passwords (password) values ('tor'); insert into passwords (password) values ('tot'); insert into passwords (password) values ('tow'); insert into passwords (password) values ('toy'); insert into passwords (password) values ('try'); insert into passwords (password) values ('tub'); insert into passwords (password) values ('tug'); insert into passwords (password) values ('tun'); insert into passwords (password) values ('tup'); insert into passwords (password) values ('tut'); insert into passwords (password) values ('tux'); insert into passwords (password) values ('two'); insert into passwords (password) values ('tye'); insert into passwords (password) values ('ugh'); insert into passwords (password) values ('uke'); insert into passwords (password) values ('ulu'); insert into passwords (password) values ('umm'); insert into passwords (password) values ('ump'); insert into passwords (password) values ('upo'); insert into passwords (password) values ('use'); insert into passwords (password) values ('vac'); insert into passwords (password) values ('van'); insert into passwords (password) values ('var'); insert into passwords (password) values ('vas'); insert into passwords (password) values ('vat'); insert into passwords (password) values ('veg'); insert into passwords (password) values ('vet'); insert into passwords (password) values ('vex'); insert into passwords (password) values ('via'); insert into passwords (password) values ('vid'); insert into passwords (password) values ('vie'); insert into passwords (password) values ('vim'); insert into passwords (password) values ('vis'); insert into passwords (password) values ('voe'); insert into passwords (password) values ('vow'); insert into passwords (password) values ('vox'); insert into passwords (password) values ('vug'); insert into passwords (password) values ('vum'); insert into passwords (password) values ('wab'); insert into passwords (password) values ('wad'); insert into passwords (password) values ('wag'); insert into passwords (password) values ('wan'); insert into passwords (password) values ('wap'); insert into passwords (password) values ('war'); insert into passwords (password) values ('was'); insert into passwords (password) values ('wat'); insert into passwords (password) values ('wax'); insert into passwords (password) values ('way'); insert into passwords (password) values ('web'); insert into passwords (password) values ('wed'); insert into passwords (password) values ('wee'); insert into passwords (password) values ('wet'); insert into passwords (password) values ('wha'); insert into passwords (password) values ('who'); insert into passwords (password) values ('why'); insert into passwords (password) values ('wig'); insert into passwords (password) values ('win'); insert into passwords (password) values ('wis'); insert into passwords (password) values ('wit'); insert into passwords (password) values ('wiz'); insert into passwords (password) values ('woe'); insert into passwords (password) values ('wok'); insert into passwords (password) values ('won'); insert into passwords (password) values ('woo'); insert into passwords (password) values ('wot'); insert into passwords (password) values ('wow'); insert into passwords (password) values ('wry'); insert into passwords (password) values ('wud'); insert into passwords (password) values ('wyn'); insert into passwords (password) values ('yag'); insert into passwords (password) values ('yah'); insert into passwords (password) values ('yak'); insert into passwords (password) values ('yam'); insert into passwords (password) values ('yap'); insert into passwords (password) values ('yar'); insert into passwords (password) values ('yaw'); insert into passwords (password) values ('yay'); insert into passwords (password) values ('yea'); insert into passwords (password) values ('yen'); insert into passwords (password) values ('yep'); insert into passwords (password) values ('yes'); insert into passwords (password) values ('yet'); insert into passwords (password) values ('yew'); insert into passwords (password) values ('yin'); insert into passwords (password) values ('yip'); insert into passwords (password) values ('yob'); insert into passwords (password) values ('yok'); insert into passwords (password) values ('yom'); insert into passwords (password) values ('yon'); insert into passwords (password) values ('you'); insert into passwords (password) values ('yow'); insert into passwords (password) values ('yuk'); insert into passwords (password) values ('yum'); insert into passwords (password) values ('yup'); insert into passwords (password) values ('zag'); insert into passwords (password) values ('zap'); insert into passwords (password) values ('zas'); insert into passwords (password) values ('zax'); insert into passwords (password) values ('zed'); insert into passwords (password) values ('zee'); insert into passwords (password) values ('zek'); insert into passwords (password) values ('zep'); insert into passwords (password) values ('zig'); insert into passwords (password) values ('zin'); insert into passwords (password) values ('zip'); insert into passwords (password) values ('zoa'); insert into passwords (password) values ('zuz'); insert into passwords (password) values ('zzz'); */ --------------------REVOKE AND GRANT--------------------------------------- REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC; -- -- PostgreSQL database dump complete -- --select * from clusters; --select students.id, users.username, users.password, users.first_name, users.last_name from students join users on students.id = users.id where users.school_id = --select clusters_domains.cluster_id from clusters_domains join clusters_grades on clusters_domains.cluster_id = clusters_grades.cluster_id where clusters_domains.domain_id = 1; --select clusters_domains.cluster_id from clusters_domains join clusters_grades on clusters_domains.cluster_id = clusters_grades.cluster_id where clusters_domains.domain_id = 2; --select standards_clusters.standard_id, standards_clusters.cluster_id from standards_clusters, clusters_grades, clusters_domains where standards_clusters.cluster_id = clusters_grades.cluster_id and clusters_grades.cluster_id = clusters_domains.cluster_id and clusters_grades.grade_id = 1 and clusters_domains.domain_id = 1; --select standards_clusters.standard_id, standards_clusters.cluster_id from standards_clusters, clusters_grades, clusters_domains where standards_clusters.cluster_id = clusters_grades.cluster_id and clusters_grades.cluster_id = clusters_domains.cluster_id and clusters_grades.grade_id = 1 and clusters_domains.domain_id = 1; --add standards_grades standards_domains. --select standards.standard from clusters_domains join clusters_grades on clusters_domains.cluster_id = clusters_grades.cluster_id where clusters_grades.grade_id = 1; --select standards_clusters.standard_id, standards_clusters.cluster_id from standards_clusters, clusters_grades, clusters_domains where standards_clusters.cluster_id = clusters_grades.cluster_id and clusters_grades.cluster_id = clusters_domains.cluster_id and clusters_grades.grade_id = 1 and clusters_domains.domain_id = 1;
true
77169b852e2cad2386320094fa9ef43fc7d60c01
SQL
SCloves/regras_associacao
/script_regras.sql
UTF-8
3,667
3.8125
4
[]
no_license
SELECT * FROM pizzaria.pedidos; ALTER TABLE pizzaria.pedidos DROP numero; ALTER TABLE pizzaria.pedidos DROP cliente; ALTER TABLE pizzaria.pedidos DROP telefone; ALTER TABLE pizzaria.pedidos DROP endereco; ALTER TABLE pizzaria.pedidos DROP valor_pizza; ALTER TABLE pizzaria.pedidos DROP valor_entrega; ALTER TABLE pizzaria.pedidos DROP hora_entrega; SELECT MIN(data_pedido), MAX(data_pedido) from pizzaria.pedidos; DELETE FROM pedidos WHERE YEAR(data_pedido) >= 2015; SELECT DAYNAME(data_pedido) from pedidos SELECT @@lc_time_names set lc_time_names = 'pt_BR' delimiter $$ CREATE FUNCTION GetDiaSemana(data_pedido date) RETURNS VARCHAR(10) BEGIN RETURN DAYNAME(data_pedido); END delimiter $$ ; SELECT data_pedido, GetDiaSemana(data_pedido) from pedidos; SELECT max(hora_pedido), min(hora_pedido) from pedidos DELIMITER $$ CREATE FUNCTION GetPeriodoVenda(hora_pedido time) RETURNS VARCHAR(10) BEGIN DECLARE periodo VARCHAR(10); IF (hora_pedido < '20:00:00') THEN set periodo = 'Inicio'; ELSEIF (hora_pedido >= '20:00:00' AND hora_pedido < '22:00:00') THEN set periodo = 'Pico'; ELSE set periodo = 'Final'; END IF; RETURN periodo; END DELIMITER $$; SELECT hora_pedido, GetPeriodoVenda(hora_pedido) from pedidos; SELECT valor_borda, valor_refrigerante from pedidos; DELIMITER $$ CREATE FUNCTION GetBorda(valor_borda FLOAT) RETURNS VARCHAR(10) BEGIN DECLARE borda VARCHAR(10); IF (valor_borda > 0) THEN SET borda = 'Borda sim'; ELSE SET borda = 'Borda não'; END IF; RETURN borda; END DELIMITER $$ DELIMITER $$ CREATE FUNCTION GetRefrigerante(valor_refrigerante FLOAT) RETURNS VARCHAR(20) BEGIN DECLARE refrigerante VARCHAR(20); IF (valor_refrigerante > 0) THEN SET refrigerante = 'Refrigerante sim'; ELSE SET refrigerante = 'Refrigerante não'; END IF; RETURN refrigerante; END DELIMITER $$ SELECT valor_borda, GetBorda(valor_borda), valor_refrigerante, GetRefrigerante(valor_refrigerante) from pedidos; SELECT valor_total from pedidos; delimiter $$ create function GetFaixaValor(valor_total float) returns varchar (10) begin declare faixa varchar(10); if (valor_total >= 10 and valor_total < 14) then set faixa = '10-14'; elseif (valor_total >= 14 and valor_total < 18) then set faixa = '14-18'; elseif (valor_total >= 18 and valor_total < 22) then set faixa = '18-22'; elseif (valor_total >= 22 and valor_total < 26) then set faixa = '22-26'; elseif (valor_total >= 26 and valor_total < 30) then set faixa = '26-30'; elseif (valor_total >= 30 and valor_total < 34) then set faixa = '30-34'; elseif (valor_total >= 34 and valor_total < 38) then set faixa = '34-38'; elseif (valor_total >= 38 and valor_total < 42) then set faixa = '38-42'; elseif (valor_total >= 42 and valor_total < 46) then set faixa = '42-46'; elseif (valor_total >= 46 and valor_total <= 50) then set faixa = '46-50'; end if; return faixa; end delimiter $$; SELECT count(valor_total), GetFaixaValor(valor_total) from pedidos GROUP BY GetFaixaValor(valor_total); SELECT MAX(tempo), min(tempo) from pedidos SELECT MINUTE(tempo) from pedidos delimiter $$ create function GetFaixaTempo(minutos float) returns varchar (10) begin declare faixa varchar(10); if (minutos >= 10 and minutos < 22) then set faixa = '10-22'; elseif (minutos >= 22 and minutos < 33) then set faixa = '22-33'; elseif (minutos >= 33 and minutos < 44) then set faixa = '33-44'; elseif (minutos >= 44 and minutos <= 55) then set faixa = '44-55'; end if; return faixa; end delimiter $$; SELECT tempo, GetFaixaTempo(MINUTE(tempo)) from pedidos;
true
24483b7c2374f8c6524ae17239785ee375eb86da
SQL
berezin31/apex-flowsforapex
/src/views/flow_instance_gateways_lov.sql
UTF-8
400
3.0625
3
[ "MIT", "LicenseRef-scancode-bpmn-io" ]
permissive
create or replace view flow_instance_gateways_lov as select obj.objt_id , obj.objt_bpmn_id , coalesce(obj.objt_name, obj.objt_bpmn_id) objt_name , ins.prcs_id from flow_instances_vw ins join flow_objects obj on obj.objt_dgrm_id = ins.dgrm_id where obj.objt_tag_name in ('bpmn:exclusiveGateway', 'bpmn:inclusiveGateway', 'bpmn:parallelGateway') with read only;
true
e702d1db9c15ff74f4a97794888bc666c34a96c5
SQL
JanSwasthyaSahyog/jss-exports
/src/main/resources/sql/billed_and_paid_amount.sql
UTF-8
544
3.84375
4
[]
no_license
select billed_amount.sum as billed_amount, paid_amount.sum paid_amount from (select sum(amount_total) sum from sale_order INNER JOIN res_partner on sale_order.partner_id = res_partner.id and res_partner.ref = :patient_id where date(datetime_order) BETWEEN :start_date and :end_date) billed_amount, (select sum(amount) sum from account_voucher INNER JOIN res_partner on account_voucher.partner_id = res_partner.id and res_partner.ref = :patient_id where date(account_voucher.date) BETWEEN :start_date and :end_date) paid_amount;
true
af09afcb38e09075dd3bb61b6ef2be210d4c7b5a
SQL
kiyoshikondo/funkyjam.com
/public_html/mori/sql/mori_login_user.sql
UTF-8
225
2.78125
3
[]
no_license
select m.*,od.payment from mori_user as m inner join "order" as o on m.order_no = o.order_no inner join "order_desc" as od on m.order_desc_no = od.order_desc_no where m.account_no = '{$login_id}' and m.delete_flg = '0';
true
e28e3493dacaf3ce9d3057478eaa8866c3c54d1c
SQL
ggelsinon/nodejsmysql
/bamazon.sql
UTF-8
384
3.421875
3
[]
no_license
DROP DATABASE IF EXISTS bamazon; CREATE DATABASE bamazon; USE bamazon; CREATE TABLE products ( id INT NOT NULL AUTO_INCREMENT, item_name VARCHAR(45) NULL, price DECIMAL(10,2) NULL, qty INT NULL, PRIMARY KEY (id) ); SELECT * FROM products; INSERT INTO products (item_name, price, qty) VALUES ("happiness", 100.15, 1000), ("love", 550.27, 300), ("security", 700.04, 400);
true
1625fee4283b656f4c6f5461a9abff2910baf483
SQL
mattyschell/stratum
/src/main/sql/definition/postgresql/schema-taxmap_read.sql
UTF-8
9,215
2.921875
3
[ "CC0-1.0" ]
permissive
-- tax_lot_polygon -- dropping community_district -- may want to ditch more that are not maintained create or replace view tax_lot_polygon as select objectid ,boro ,block ,lot ,bbl ,regular_lot_indicator ,number_lot_sides ,condo_flag ,reuc_flag ,air_rights_flag ,subterranean_flag ,easement_flag ,section_number ,volume_number ,page_number ,nycmap_bldg_flag ,missing_rpad_flag ,conversion_exception_flag ,value_reflected_out_flag ,created_date ,last_modified_date ,av_change ,bw_change ,bill_bbl_flag ,shape from taxmap_blue.tax_lot_polygon; grant select on tax_lot_polygon to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'tax_lot_polygon' ,current_schema ,'tax_lot_polygon' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- condo create or replace view condo as select objectid ,condo_boro ,condo_key ,condo_name ,condo_base_bbl ,condo_billing_bbl ,condo_base_bbl_key ,air_rights_condo_flag ,billing_lot_not_in_cogis ,created_date ,last_modified_date ,condo_number from taxmap_blue.condo; grant select on condo to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'condo' ,current_schema ,'condo' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- air_rights_condos create or replace view air_rights_condos as select objectid ,condo_key ,condo_base_bbl ,condo_base_bbl_key ,air_rights_bbl from taxmap_blue.air_rights_condos; grant select on air_rights_condos to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'air_rights_condos' ,current_schema ,'air_rights_condos' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- air_rights_holders create or replace view air_rights_holders as select objectid ,air_rights_bbl ,holding_bbl ,created_date ,last_modified_date from taxmap_blue.air_rights_holders; grant select on air_rights_holders to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'air_rights_holders' ,current_schema ,'air_rights_holders' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- air_rights_lots create or replace view air_rights_lots as select objectid ,donating_boro ,donating_block ,donating_lot ,donating_bbl ,effective_tax_year ,air_rights_lot_number from taxmap_blue.air_rights_lots; grant select on air_rights_lots to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'air_rights_lots' ,current_schema ,'air_rights_lots' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- boundary create or replace view boundary as select objectid ,boundary_type ,type ,id_number ,description ,length ,modifier ,effective_tax_year shape from taxmap_blue.boundary; grant select on boundary to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'boundary' ,current_schema ,'boundary' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- condo_units create or replace view condo_units as select objectid ,condo_boro ,condo_number ,condo_key ,condo_base_boro ,condo_base_block ,condo_base_lot ,condo_base_bbl ,condo_base_bbl_key ,unit_boro ,unit_block ,unit_lot ,unit_bbl ,effective_tax_year ,unit_designation from taxmap_blue.condo_units; grant select on condo_units to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'condo_units' ,current_schema ,'condo_units' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- lot_face_possession_hooks create or replace view lot_face_possession_hooks as select objectid ,lot_face_possession_hook_type ,rotation ,shape from taxmap_blue.lot_face_possession_hooks; grant select on lot_face_possession_hooks to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'lot_face_possession_hooks' ,current_schema ,'lot_face_possession_hooks' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- misc_text create or replace view misc_text as select objectid ,misc_text ,rotation ,shape from taxmap_blue.misc_text; grant select on misc_text to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'misc_text' ,current_schema ,'misc_text' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- possession_hooks create or replace view possession_hooks as select objectid ,hook_type ,rotation ,shape from taxmap_blue.possession_hooks; grant select on possession_hooks to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'possession_hooks' ,current_schema ,'possession_hooks' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- reuc_lots create or replace view reuc_lots as select objectid ,appurtenant_boro ,appurtenant_block ,appurtenant_lot ,appurtenant_bbl ,reuc_number ,deleted_flag ,av_change ,bw_change ,effective_tax_year from taxmap_blue.reuc_lots; grant select on reuc_lots to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'reuc_lots' ,current_schema ,'reuc_lots' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- reuc_lots create or replace view subterranean_lots as select objectid ,appurtenant_boro ,appurtenant_block ,appurtenant_lot ,appurtenant_bbl ,subterranean_lot_number ,av_change ,bw_change ,effective_tax_year from taxmap_blue.subterranean_lots; grant select on subterranean_lots to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'subterranean_lots' ,current_schema ,'subterranean_lots' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- tax_block_polygon create or replace view tax_block_polygon as select objectid ,boro ,block ,eop_overlap_flag ,jagged_st_flag ,created_date ,last_modified_date ,section_number ,volume_number ,shape from taxmap_blue.tax_block_polygon; grant select on tax_block_polygon to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'tax_block_polygon' ,current_schema ,'tax_block_polygon' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() ); -- tax_lot_face create or replace view tax_lot_face as select objectid ,tax_lot_face_type ,boro ,block ,lot ,bbl ,lot_face_length ,source ,block_face_flag ,lot_face_length_error ,created_date ,last_modified_date ,av_change ,bw_change ,approx_length_flag ,shape from taxmap_blue.tax_lot_face; grant select on tax_lot_face to public; insert into stratum_catalog.st_catalog ( dataset_name ,dataset_schema ,storage_name ,storage_schema ,dataset_updated ,source_agency ,spatial_reference ,table_created) values ( 'tax_lot_face' ,current_schema ,'tax_lot_face' ,'taxmap_blue' ,null ,'NYC Dept. of Finance' ,null ,now() );
true
f035d298241e956d89cd9eacb762d20823f9b713
SQL
Bvillevo/magazijnbeheer
/--SQL--/magazijn final.sql
UTF-8
11,103
2.921875
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Gegenereerd op: 14 jun 2018 om 12:04 -- Serverversie: 10.1.26-MariaDB -- PHP-versie: 7.1.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `magazijn` -- -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `app_users` -- CREATE TABLE `app_users` ( `id` int(11) NOT NULL, `username` varchar(25) DEFAULT NULL, `voornaam` varchar(255) DEFAULT NULL, `achternaam` varchar(255) DEFAULT NULL, `functie` varchar(255) NOT NULL, `password` varchar(64) NOT NULL, `isActive` tinyint(1) NOT NULL, `roles` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Gegevens worden geëxporteerd voor tabel `app_users` -- INSERT INTO `app_users` (`id`, `username`, `voornaam`, `achternaam`, `functie`, `password`, `isActive`, `roles`) VALUES (29, 'Youssef', 'Youssef', 'Zekhnini', 'Admin', '$2y$12$jrf.LTZOadV48aIL.x1YfuiGcjccjO23s4zbX8WtXwbRYx2h5t64C', 0, 'a:1:{i:0;s:10:\"ROLE_ADMIN\";}'), (30, 'Halit', 'Halit', 'Ozdogru', 'Inkoper', '$2y$13$gtoOef4GNlafNab8nRK43O0.FNgl9ikskdqJrIJrXlE5pAYcdYV/G', 0, 'a:1:{i:0;s:12:\"ROLE_INKOPER\";}'), (31, 'Luca', 'Luca', 'van Beek', 'Magazijnmeester', '$2y$13$2Zql5pTYkcvm5Lv8OfkMbOp00cgsqX7L3gmA1jowkliN.AIBCJj46', 0, 'a:1:{i:0;s:20:\"ROLE_MAGAZIJNMEESTER\";}'), (32, 'Hassan', 'Hassan Hassan', 'Mohammed', 'Inkoper', '$2y$13$ohFHJb0nXhyXvzNFJ.geVehHV5htOV7dNLg/FlDPp1FR5dxBIQEbS', 0, 'a:1:{i:0;s:12:\"ROLE_INKOPER\";}'), (33, 'Bas', 'Bas', 'Villevoy', 'Verkoper', '$2y$13$YWSP5JiN14InTvwWViIXW.fphRZMWGj8TURkozmdcAZQILdptu7Ja', 0, 'a:1:{i:0;s:13:\"ROLE_VERKOPER\";}'); -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `artikel` -- CREATE TABLE `artikel` ( `artikelnr` int(10) NOT NULL, `omschrijving` varchar(255) NOT NULL, `technischeSpecificaties` varchar(255) DEFAULT NULL, `magazijnlocatie` varchar(100) DEFAULT NULL, `inkoopprijs` decimal(10,2) NOT NULL, `minimumVoorraad` int(20) NOT NULL, `voorraadInAantal` int(20) NOT NULL, `verkopen` int(10) DEFAULT NULL, `gereserveerdeVoorraad` int(10) DEFAULT NULL, `vrijeVoorraad` int(10) DEFAULT NULL, `bestelserie` int(20) NOT NULL, `bestelregels` int(11) DEFAULT NULL, `CVA` int(10) DEFAULT NULL, `status` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Gegevens worden geëxporteerd voor tabel `artikel` -- INSERT INTO `artikel` (`artikelnr`, `omschrijving`, `technischeSpecificaties`, `magazijnlocatie`, `inkoopprijs`, `minimumVoorraad`, `voorraadInAantal`, `verkopen`, `gereserveerdeVoorraad`, `vrijeVoorraad`, `bestelserie`, `bestelregels`, `CVA`, `status`) VALUES (1000000017, 'Samsung galaxy s7', '128gb', '04/A06', '450.00', 15, 300, 7, 200, NULL, 0, 895686, 1000000017, 1), (1000000018, 'Samsung Galaxy S8', '32gb', '02/A01', '800.00', 150, 100, NULL, NULL, NULL, 50, 89273, 1000000017, 1), (1000000546, 'Iphone X', '32gb', '02/C03', '1150.00', 10, 0, NULL, NULL, NULL, 10, 89273, 1000000017, 1), (1000000875, 'Bosch WAB7I089', 'A+++ Energie', '04/D06', '333.00', 25, 20, 20, NULL, NULL, 5, 895686, 1000000017, 1), (1000020017, 'Usb Handverwarmer', 'USB 3.0', '03/G02', '20.00', 15, 23, NULL, NULL, NULL, 0, 895686, NULL, 1), (1000300018, 'Dell D40', '1080p, 4gb Ram', '02/B01', '600.00', 5, 8, 2, NULL, NULL, 0, 89273, NULL, 1), (1000350018, 'hp-hd1092d', '1080p', '06/H05', '790.00', 5, 6, 4, NULL, NULL, 0, 89273, NULL, 1), (1010110110, 'Laptop oplader', '1000 Watt', '03/G06', '10.10', 50, 20, NULL, NULL, NULL, 30, NULL, 1181028374, 1), (1010293847, 'hy782 samsung', '1080p', '07/F09', '726.00', 13, 18, NULL, NULL, NULL, 0, 76432, NULL, 1), (1020020017, 'Apple iMac 2015', '1080p', '03/J03', '1300.00', 15, 25, NULL, NULL, NULL, 0, 895686, NULL, 1), (1029384765, 'AA battereijen', '', '09/N02', '5.00', 13, 17, NULL, NULL, NULL, 0, 76432, NULL, 1), (1050020017, 'goed voor in de woonkamer', '1080p', '02/R04', '67.00', 15, 17, NULL, NULL, NULL, 0, 895686, NULL, 1), (1181028374, 'AAA batterijen', '', '05/H01', '5.00', 15, 19, NULL, NULL, NULL, 0, 895686, 1029384765, 1), (1234567890, 'MSI GL62 6QF', 'GTX 960M', '02/D01', '700.00', 20, 10, NULL, NULL, NULL, 10, NULL, 1020020017, 1), (1239478263, 'mp4 speler hp 4gb', '1080p', '08/S02', '34.00', 13, 16, NULL, NULL, NULL, 0, 76432, NULL, 1), (1246426482, 'JBL GO 2', 'waterdicht', '04/B03', '98.00', 4, 8, NULL, NULL, NULL, 0, 65765, NULL, 1), (1247492649, '1968D sony', 'extra bass', '03/N04', '560.00', 2, 3, 500, NULL, NULL, 0, 1253263, NULL, 1), (1273917394, 'hp pabilon 4500', 'usb 3.0', '04/A09', '670.00', 20, 13, NULL, NULL, NULL, 7, 87653645, NULL, 1), (1287492864, 'mp4 speler', '1080p', '08/K06', '34.00', 13, 7, NULL, NULL, NULL, 5, 76432, NULL, 1), (1298765432, 'HG678 Sony', '7.1 surround sound', '02/A01', '230.00', 5, 2, NULL, NULL, NULL, 3, 89273, NULL, 1), (1309876543, 'logitech c520', 'full hd', '01/A09', '67.00', 15, 5, NULL, NULL, NULL, 10, 895686, NULL, 1), (1412345678, 'logitech g789', '16000dpi', '02/A03', '80.00', 5, 2, NULL, NULL, NULL, 3, 89273, NULL, 1), (1512345678, 'logitech k95', 'RGB', '06/H01', '120.00', 5, 2, NULL, NULL, NULL, 3, 89273, NULL, 1), (1676128364, 'JBL FLIP 4', 'shock resistant', '01/L02', '250.00', 5, 2, NULL, NULL, NULL, 3, 89273, NULL, 1), (1738945629, 'macbook 2018', '2300p', '04/C01', '3400.00', 13, 7, NULL, NULL, NULL, 5, 76432, NULL, 1), (1782736183, 'philpis Blacklight ', 'Blacklight 30x5', '01/A01', '67.00', 15, 5, NULL, NULL, NULL, 10, 895686, NULL, 1), (1782937462, 'mp4 spler hp 32 gb', '1080p', '02/A01', '34.00', 13, 7, NULL, NULL, NULL, 5, 76432, NULL, 1), (1792015792, 'HP 1100', 'GTX 750M', '06/B03', '300.00', 200, 19, NULL, 10, NULL, 181, NULL, 1000000017, 1), (1792015793, 'Sony 1200', '4K Ultra HD', '07/R04', '1000.00', 30, 15, NULL, NULL, NULL, 15, NULL, 1247492649, 1), (1792015794, 'Intel i5 - 4e generatie', '2.4GHZ', '07/R02', '200.00', 30, 15, 6, NULL, NULL, 15, NULL, 1000300018, 1), (1792015795, 'Intel i5 - 8e generatie', '3.2GHZ', '07/R03', '250.00', 30, 15, NULL, NULL, NULL, 15, NULL, 1000300018, 1), (1792015796, 'Intel i7 - 5e generatie', '3.2GHZ', '06/R01', '250.00', 30, 15, NULL, NULL, NULL, 15, NULL, 1000300018, 1), (1792015797, 'Intel i7 - 8e generatie', '3.8GHZ', '06/R02', '350.00', 30, 15, NULL, NULL, NULL, 15, NULL, 1000300018, 1), (1792015798, 'Intel i3 - 6e generatie', '2.1GHZ', '06/B04', '100.00', 30, 15, 10, NULL, NULL, 15, NULL, 1000300018, 1), (1792015799, 'Philips 49PUS6561/12', '4K Ultra HD', '03/G02', '600.00', 20, 15, NULL, NULL, NULL, 5, NULL, 1247492649, 1), (1792015800, 'LG OLED55E7N', '4K Ultra HD', '03/G03', '2000.00', 20, 15, NULL, NULL, NULL, 5, NULL, 1247492649, 1), (1792015801, 'Samsung QE49Q7FAMLXXM', '4K Ultra HD', '01/G04', '1200.00', 20, 15, NULL, NULL, NULL, 5, NULL, 1247492649, 1), (1923654728, 'mp4 spler samsung 8mb', '1080p', '03/G03', '50.00', 13, 7, 4, NULL, NULL, 6, 76432, 1000000017, 1); -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `bestelopdracht` -- CREATE TABLE `bestelopdracht` ( `leverancier` varchar(20) NOT NULL, `bestelordernummer` int(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Gegevens worden geëxporteerd voor tabel `bestelopdracht` -- INSERT INTO `bestelopdracht` (`leverancier`, `bestelordernummer`) VALUES ('Logitech', 110), ('Sony', 118), ('Samsung', 120), ('Apple', 121), ('HP', 122), ('Philips', 130), ('JBL', 140), ('Intel', 160), ('Makro', 161), ('Bosch', 162); -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `bestelregel` -- CREATE TABLE `bestelregel` ( `id` int(11) NOT NULL, `bestellingid` int(11) DEFAULT NULL, `artikelnr` int(11) NOT NULL, `hoeveelheid` int(11) NOT NULL, `ontvangstdatum` date DEFAULT NULL, `keuringseis` int(4) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Gegevens worden geëxporteerd voor tabel `bestelregel` -- INSERT INTO `bestelregel` (`id`, `bestellingid`, `artikelnr`, `hoeveelheid`, `ontvangstdatum`, `keuringseis`) VALUES (18, 121, 1000000546, 6, '2013-01-01', 1000), (19, 140, 1246426482, 6, '2013-01-01', 1024), (20, 120, 1000000018, 13, '2013-01-01', 5568), (21, 118, 1247492649, 21, '2013-01-01', 5016); -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `ontvangengoederen` -- CREATE TABLE `ontvangengoederen` ( `id` int(11) NOT NULL, `datum` date DEFAULT NULL, `leverancier` varchar(20) NOT NULL, `ordernummer` int(11) NOT NULL, `artikelnummer` int(11) NOT NULL, `omschrijving` varchar(20) NOT NULL, `hoeveelheid` int(11) NOT NULL, `kwaliteit` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexen voor geëxporteerde tabellen -- -- -- Indexen voor tabel `app_users` -- ALTER TABLE `app_users` ADD PRIMARY KEY (`id`); -- -- Indexen voor tabel `artikel` -- ALTER TABLE `artikel` ADD PRIMARY KEY (`artikelnr`), ADD KEY `CVA` (`CVA`); -- -- Indexen voor tabel `bestelopdracht` -- ALTER TABLE `bestelopdracht` ADD PRIMARY KEY (`bestelordernummer`); -- -- Indexen voor tabel `bestelregel` -- ALTER TABLE `bestelregel` ADD PRIMARY KEY (`id`), ADD KEY `artikelnr` (`artikelnr`), ADD KEY `bestellingid` (`bestellingid`); -- -- Indexen voor tabel `ontvangengoederen` -- ALTER TABLE `ontvangengoederen` ADD PRIMARY KEY (`id`), ADD KEY `ordernummer` (`ordernummer`); -- -- AUTO_INCREMENT voor geëxporteerde tabellen -- -- -- AUTO_INCREMENT voor een tabel `app_users` -- ALTER TABLE `app_users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34; -- -- AUTO_INCREMENT voor een tabel `bestelopdracht` -- ALTER TABLE `bestelopdracht` MODIFY `bestelordernummer` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=180; -- -- AUTO_INCREMENT voor een tabel `bestelregel` -- ALTER TABLE `bestelregel` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- Beperkingen voor geëxporteerde tabellen -- -- -- Beperkingen voor tabel `artikel` -- ALTER TABLE `artikel` ADD CONSTRAINT `artikel_ibfk_1` FOREIGN KEY (`CVA`) REFERENCES `artikel` (`artikelnr`); -- -- Beperkingen voor tabel `bestelregel` -- ALTER TABLE `bestelregel` ADD CONSTRAINT `bestelregel_ibfk_3` FOREIGN KEY (`artikelnr`) REFERENCES `artikel` (`artikelnr`), ADD CONSTRAINT `bestelregel_ibfk_4` FOREIGN KEY (`bestellingid`) REFERENCES `bestelopdracht` (`bestelordernummer`); -- -- Beperkingen voor tabel `ontvangengoederen` -- ALTER TABLE `ontvangengoederen` ADD CONSTRAINT `ontvangengoederen_ibfk_1` FOREIGN KEY (`ordernummer`) REFERENCES `bestelopdracht` (`bestelordernummer`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
1d7f3ef5ed182f4501c8242f23381e0d15b149f1
SQL
jjordan00/NextGen
/NextGen SQL Scripts/Meaningful Use/MU pack.sql
UTF-8
1,481
3.453125
3
[]
no_license
select pe.enc_timestamp AS ENC_DATE,pe.enc_id, p.last_name, p.first_name, pd.create_timestamp AS DATE_ON_MU, convert(datetime, co.txt_fintime) AS DATE_SHOULD_BE, pm.description, co.modify_timestamp from patient_encounter pe INNER JOIN person p on pe.person_id = p.person_id INNER JOIN provider_mstr pm on pe.rendering_provider_id = pm.provider_id INNER JOIN patient_documents pd on pe.enc_id = pd.enc_id LEFT OUTER JOIN agg_co_xf_ co on pe.enc_id = co.enc_id where pd.create_timestamp > '2013-11-10 23:12:49.033' and pd.create_timestamp < '2013-11-12 00:00:00.033' and txt_fintime is not null and txt_fintime <'20131111' --and description like '%rhodes%' order by txt_fintime, p.last_name--, create_timestamp update patient_documents set create_timestamp = co.modify_timestamp from patient_encounter pe INNER JOIN person p on pe.person_id = p.person_id INNER JOIN provider_mstr pm on pe.rendering_provider_id = pm.provider_id INNER JOIN patient_documents pd on pe.enc_id = pd.enc_id LEFT OUTER JOIN agg_co_xf_ co on pe.enc_id = co.enc_id where pd.create_timestamp > '2013-11-10 23:12:49.033' and pd.create_timestamp < '2013-11-12 00:00:00.033' and txt_fintime is not null and txt_fintime <'20131111' --and description like '%rhodes%' select * from patient_documents where enc_id = '2EF2404D-EFBA-407A-8D8B-33D6EDD5B4A1' select * from person where person_id = 'C7B48CC4-88FE-4250-85E1-C530814C06C9'
true
0b8f5fe853c5c575637533cdf662b802d0d948f5
SQL
harenas/meetup-ms2
/mysql/gt-credito.sql
UTF-8
2,804
3.109375
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.7.12, for osx10.11 (x86_64) -- -- Host: localhost Database: gt-credito -- ------------------------------------------------------ -- Server version 5.7.12 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `cuentas_ctes` -- DROP TABLE IF EXISTS `cuentas_ctes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cuentas_ctes` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `rut` int(11) DEFAULT NULL, `cupo_total` int(11) DEFAULT NULL, `cupo_utilizado` int(11) DEFAULT NULL, `estado` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `cuentas_ctes` -- LOCK TABLES `cuentas_ctes` WRITE; /*!40000 ALTER TABLE `cuentas_ctes` DISABLE KEYS */; INSERT INTO `cuentas_ctes` VALUES (1,11111111,500000,490000,2),(2,22222222,300000,0,1); /*!40000 ALTER TABLE `cuentas_ctes` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `estado` -- DROP TABLE IF EXISTS `estado`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `estado` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `descripcion` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `estado` -- LOCK TABLES `estado` WRITE; /*!40000 ALTER TABLE `estado` DISABLE KEYS */; INSERT INTO `estado` VALUES (1,'AL DÍA'),(2,'CUOTA VENCIDA'),(3,'BLOQUEADO'),(4,'DESACTIVADO'); /*!40000 ALTER TABLE `estado` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2017-10-13 16:36:06
true
bf6ef4f6c3fa6e2a6189c40e764e574e10868001
SQL
rjcjunior/TrabPBDUFF
/Exercicio 12.sql
UTF-8
490
3
3
[]
no_license
update escola set escola.codpessoa = (select p.codpessoa from professor p where p.codpessoa = 29) where escola.codpessoa = 25 and not exists(select p.codpessoa from professor p where p.codpessoa not in (escola.codpessoa) and p.codpessoa = escola.codpessoa); Delete from ministra_turma where codpessoa = 25; Delete from ministra where codpessoa = 25; Delete from pessoa where codpessoa = 25;
true
e3385abf47dfb2a11a24c7cb7585e6d6def9c212
SQL
TanYiXun/SQL-Server
/practicals/populate.sql
WINDOWS-1252
18,755
3.078125
3
[]
no_license
SELECT * FROM Area SELECT * FROM Branch SELECT * FROM Choice SELECT * FROM Item SELECT * FROM Member SELECT * FROM "Order" SELECT * FROM OrderItem SELECT * FROM OrderStatus SELECT * FROM PizzaCrust SELECT * FROM PizzaPrice SELECT * FROM PizzaSize SELECT * FROM PromoLine SELECT * FROM PromoLineItem SELECT * FROM Promotion /* DELETE FROM Area DELETE FROM Branch DELETE FROM Choice DELETE FROM Item DELETE FROM Member DELETE FROM "Order" DELETE FROM OrderItem DELETE FROM OrderStatus DELETE FROM PizzaCrust DELETE FROM PizzaPrice DELETE FROM PizzaSize DELETE FROM PromoLine DELETE FROM PromoLineItem DELETE FROM Promotion */ INSERT INTO Area VALUES ('A001','West') INSERT INTO Area VALUES ('A002','Central') INSERT INTO Area VALUES ('A003','East') INSERT INTO Area VALUES ('A004','North') INSERT INTO Area VALUES ('A005','South') INSERT INTO Branch Values ('BR000001','Pizza Hut Tampines','4 TAMPINES CENTRAL 5, #02-02, TAMPINES MALL, SINGAPORE 529510','A003') INSERT INTO Branch Values ('BR000002','Pizza Hut Raffles Place','6 RAFFLES BOULEVARD, #03-211, MARINA SQUARE, SINGAPORE 039594','A002') INSERT INTO Branch Values ('BR000003','Pizza Hut Jurong West','1 JURONG WEST CENTRAL 2, #01-33, JURONG POINT, SINGAPORE 648886','A001') INSERT INTO Branch Values ('BR000004','Pizza Hut Harbourfront','1 MARITIME SQUARE, #01-69, HARBOURFRONT CENTRE, SINGAPORE 099253','A005') INSERT INTO Branch Values ('BR000005','Pizza Hut Woodlands','1 WOODLANDS SQUARE, #B1-25, CAUSEWAY POINT, SINGAPORE 738099','A004') INSERT INTO Choice VALUES ('OR000001','I0000001','PM000001',2) INSERT INTO Choice VALUES ('OR000002','I0000002','PM000001',2) INSERT INTO Choice VALUES ('OR000003','I0000003','PM000001',3) INSERT INTO Choice VALUES ('OR000004','I0000001','PM000002',3) INSERT INTO Choice VALUES ('OR000005','I0000002','PM000002',4) INSERT INTO Choice VALUES ('OR000005','I0000003','PM000002',5) INSERT INTO Item VALUES ('I0000001','Hawaiian','An all-time favourite. Tender chicken ham combined with sweet and succulent pineapple chunks for a taste of the good ol'' days.','Pizza',null) INSERT INTO Item VALUES ('I0000002','Chicken Supreme','Sink your teeth into a generous spread of savoury chicken ham, spicy chicken chunks, roasted chicken, topped with onions, capsicums and mushrooms.','Pizza',null) INSERT INTO Item VALUES ('I0000003','Super Supreme','Always a house favourite, combining juicy ground beef, smoky cabanossi sausages, beef pepperoni, chicken ham, and a luscious mix of capsicums, onions, olives, mushrooms and pineapple chunks.','Pizza',null) INSERT INTO Item VALUES ('I0000004','Pepperoni','Combining the aromatic flavour of beef pepperoni and 100% mozzarella cheese, this is one classic treat thats always a great choice.','Pizza',null) INSERT INTO Item VALUES ('I0000005','Veggie Lover''s','A delightful combination of garden fresh onions, olives, capsicums and mushrooms, sweetened with pineapple chunks and diced tomatoes.','Pizza',null) INSERT INTO Item VALUES ('I0000006','Curry Chicken','Italian classic meets local favourite. Spicy chicken chunk, potatoes, onions and diced tomatoes come together for an authentic flavour of rich spices.','Pizza',null) INSERT INTO Item VALUES ('I0000007','Meat Galore','The perfect meat-lover''s choice. Chicken ham, pepperoni, minced beef and cabanossi sausages, with a tomato mozzarella melt.','Pizza',null) INSERT INTO Item VALUES ('I0000008','Chicken Pepperoni','A mouth-watering combination of savoury chicken pepperoni, chopped basil and 100% mozzarella cheese. Always a treat!','Pizza',null) INSERT INTO Item VALUES ('I0000009','BBQ Chicken','Spicy chicken chunks, chicken ham, luscious pineapple chunks with fresh capsicums, baked on a sweet and smoky BBQ sauce.','Pizza',null) INSERT INTO Item VALUES ('I0000010','The Four Cheese','Send your tastebuds into a cheesy frenzy with a divine combination of 4 cheeses - mozzarella, parmesan, cheddar and cream cheese.','Pizza',null) INSERT INTO Item VALUES ('I0000011','Soup of the Day','Check with the chef','Soup',4.00) INSERT INTO Item VALUES ('I0000012','Chicken Pomodoro','Linguine, spicy chicken chunks, onions and fresh button mushrooms, tossed in a tangy tomato sauce.','Pasta',4.00) INSERT INTO Item VALUES ('I0000013','Beef Lasagne','A classic favourite. Generous minced beef in creamy tomato sauce layered between sheets of fresh pasta, topped with a mozzarella melt.','Pasta',13.50) INSERT INTO Item VALUES ('I0000014','Prawn Aglio Olio','A mild spicy dish with a bite. Fresh, succulent prawns lightly tossed in olive oil, crushed garlic and sliced chili padi.','Pasta',11.00) INSERT INTO Item VALUES ('I0000015','Chicken Royale Baked Pasta','Roast chicken and chunky honey chicken ham, combined with mushrooms and roasted onions in a cheesy penne bake.','Pasta',15.50) INSERT INTO Item VALUES ('I0000016','Turkey Bacon Aglio Olio','Garlic and black pepper tossed pasta with sauted button mushrooms and savoury turkey bacon.','Pasta',9.50) INSERT INTO Item VALUES ('I0000017','Traditional Bolognaise','A classic recipe made more indulgent with juicy ground beef and chunky beef balls in a tangy bolognaise sauce.','Pasta',10.00) INSERT INTO Item VALUES ('I0000018','Curry Zazzle Baked Rice','Spicy chicken chunks, potato cubes and curry sauce with pilaf rice.','Baked Rice',10.00) INSERT INTO Item VALUES ('I0000019','Country Pie','A combination of roasted chicken and turkey bacon, complemented by onions, mushrooms and tomato sauce, covered in velvety mash and parmesan cheese.','Backed Rice',10.50) INSERT INTO Item VALUES ('I0000020','Magnificent Appetizer Pack','Enjoy 4 different appetizers in our new Magnificent Appetizer Pack. Includes 4pcs Mozzarella Sticks, Honey Roasted Wings, Chicken Tenders and Battered Chicken with Cheese Sauce','Sides',20.50) INSERT INTO Item VALUES ('I0000021','Hersheys''s Chocolate Chip Cookie','A soft and chewy cookie laden with crunchy chocolate chips, served warm.','Sides',5.50) INSERT INTO Item VALUES ('I0000022','4Pcs Chicken Tenders','Breaded chicken fillets fried to a golden brown perfection.','Sides',null) INSERT INTO Item VALUES ('I0000023','Pepsi','1.5 Litre Bottle','Beverages',3.00) INSERT INTO Item VALUES ('I0000024','Pokka Green Tea','1.5 Litre Bottle','Beverages',3.00) INSERT INTO Member VALUES ('kimjongun@pyongyang.com','nukesaregreat','Kim Jong Un','Ave 2, Potong Pasir',null,null,null,'350145','93827308') INSERT INTO Member VALUES ('donaldtrump@whitehouse.gov','soundsgoodoesntwork','Donald John Trump','16a, Bali Lane',null,null,null,'189852','92837491') INSERT INTO Member VALUES ('vladimirputin@kgb.ru','cykablyat','Vladimir Vladimirovich Putin','72 bukit tinggi road',null,null,null,'289760','89473625') INSERT INTO Member VALUES ('xijingping@communism.cn','nihao','Xi Jinping','110 Turf Club Road',null,null,null,'288000','91837462') INSERT INTO Member VALUES ('tonytan@gmail.com','sgisbest','Tony Tan Keng Yam','1 Kaki Bukit View #05-11 Techview',null,null,null,'415941','92038475') INSERT INTO "Order" VALUES ('OR000001','2017-04-20','23:20:20','Ave 2, Potong Pasir','93827308','350145','OS01','BR000001','kimjongun@pyongyang.com') INSERT INTO "Order" VALUES ('OR000002','2017-05-21','11:00:00','16a, Bali Lane','92837491','189852','OS02','BR000002','donaldtrump@whitehouse.gov') INSERT INTO "Order" VALUES ('OR000003','2017-06-22','08:20:40','72 bukit tinggi road','89473625','289760','OS03','BR000003','vladimirputin@kgb.ru') INSERT INTO "Order" VALUES ('OR000004','2017-07-23','12:50:50','110 Turf Club Road','91837462','288000','OS04','BR000004','xijingping@communism.cn') INSERT INTO "Order" VALUES ('OR000005','2017-08-24','17:00:20','1 Kaki Bukit View #05-11 Techview','92038475','415941','OS05','BR000005','tonytan@gmail.com') INSERT INTO "Order" VALUES ('OR000006','2017-04-20','23:20:20','Ave 2, Potong Pasir','93827308','350145','OS01','BR000001','kimjongun@pyongyang.com') INSERT INTO "Order" VALUES ('OR000007','2017-05-21','11:00:00','16a, Bali Lane','92837491','189852','OS02','BR000002','donaldtrump@whitehouse.gov') INSERT INTO "Order" VALUES ('OR000008','2017-06-22','08:20:40','72 bukit tinggi road','89473625','289760','OS03','BR000003','vladimirputin@kgb.ru') INSERT INTO "Order" VALUES ('OR000009','2017-07-23','12:50:50','110 Turf Club Road','91837462','288000','OS04','BR000004','xijingping@communism.cn') INSERT INTO "Order" VALUES ('OR000010','2017-08-24','17:00:20','1 Kaki Bukit View #05-11 Techview','92038475','415941','OS05','BR000005','tonytan@gmail.com') INSERT INTO "Order" VALUES ('OR000011','2017-04-20','23:20:20','Ave 2, Potong Pasir','93827308','350145','OS01','BR000001','kimjongun@pyongyang.com') INSERT INTO "Order" VALUES ('OR000012','2017-05-21','11:00:00','16a, Bali Lane','92837491','189852','OS02','BR000002','donaldtrump@whitehouse.gov') INSERT INTO OrderItem VALUES ('OR000006','I0000006','C0000003',5,'L') INSERT INTO OrderItem VALUES ('OR000007','I0000012',null,2,null) INSERT INTO OrderItem VALUES ('OR000008','I0000013',null,3,null) INSERT INTO OrderItem VALUES ('OR000009','I0000014',null,4,null) INSERT INTO OrderItem VALUES ('OR000010','I0000015',null,5,null) INSERT INTO OrderItem VALUES ('OR000011','I0000016',null,6,null) INSERT INTO OrderItem VALUES ('OR000012','I0000017',null,7,null) INSERT INTO OrderItem VALUES ('OR000001','I0000001','C0000001',2,'P') INSERT INTO OrderItem VALUES ('OR000002','I0000002','C0000001',3,'P') INSERT INTO OrderItem VALUES ('OR000003','I0000003','C0000002',3,'R') INSERT INTO OrderItem VALUES ('OR000004','I0000004','C0000002',4,'R') INSERT INTO OrderItem VALUES ('OR000005','I0000005','C0000003',4,'L') INSERT INTO OrderItem VALUES ('OR000006','I0000006','C0000003',5,'L') INSERT INTO OrderItem VALUES ('OR000007','I0000012',null,2,null) INSERT INTO OrderItem VALUES ('OR000008','I0000013',null,3,null) INSERT INTO OrderItem VALUES ('OR000009','I0000014',null,4,null) INSERT INTO OrderItem VALUES ('OR000010','I0000015',null,5,null) INSERT INTO OrderItem VALUES ('OR000011','I0000016',null,6,null) INSERT INTO OrderItem VALUES ('OR000012','I0000017',null,7,null) INSERT INTO OrderStatus VALUES ('OS01','confirmed ordered') INSERT INTO OrderStatus VALUES ('OS02','on preparation') INSERT INTO OrderStatus VALUES ('OS03','on delivering') INSERT INTO OrderStatus VALUES ('OS04','delivered') INSERT INTO OrderStatus VALUES ('OS05','pending payment') INSERT INTO OrderStatus VALUES ('OS06','delivered and payment confirmed') INSERT INTO PizzaCrust VALUES ('C0000001','Pan Pizza') INSERT INTO PizzaCrust VALUES ('C0000002','Chessy Stuffed Crust') INSERT INTO PizzaCrust VALUES ('C0000003','Hand Stretched Thin') INSERT INTO PizzaPrice VALUES ('I0000001','P','C0000001',10.00) INSERT INTO PizzaPrice VALUES ('I0000001','P','C0000002',11.00) INSERT INTO PizzaPrice VALUES ('I0000001','R','C0000001',15.00) INSERT INTO PizzaPrice VALUES ('I0000001','R','C0000002',16.00) INSERT INTO PizzaPrice VALUES ('I0000001','R','C0000003',17.00) INSERT INTO PizzaPrice VALUES ('I0000001','L','C0000001',20.00) INSERT INTO PizzaPrice VALUES ('I0000001','L','C0000002',21.00) INSERT INTO PizzaPrice VALUES ('I0000001','L','C0000003',22.00) INSERT INTO PizzaPrice VALUES ('I0000002','P','C0000001',10.00) INSERT INTO PizzaPrice VALUES ('I0000002','P','C0000002',11.00) INSERT INTO PizzaPrice VALUES ('I0000002','R','C0000001',15.00) INSERT INTO PizzaPrice VALUES ('I0000002','R','C0000002',16.00) INSERT INTO PizzaPrice VALUES ('I0000002','R','C0000003',17.00) INSERT INTO PizzaPrice VALUES ('I0000002','L','C0000001',20.00) INSERT INTO PizzaPrice VALUES ('I0000002','L','C0000002',21.00) INSERT INTO PizzaPrice VALUES ('I0000002','L','C0000003',22.00) INSERT INTO PizzaPrice VALUES ('I0000003','P','C0000001',10.00) INSERT INTO PizzaPrice VALUES ('I0000003','P','C0000002',11.00) INSERT INTO PizzaPrice VALUES ('I0000003','R','C0000001',15.00) INSERT INTO PizzaPrice VALUES ('I0000003','R','C0000002',16.00) INSERT INTO PizzaPrice VALUES ('I0000003','R','C0000003',17.00) INSERT INTO PizzaPrice VALUES ('I0000003','L','C0000001',20.00) INSERT INTO PizzaPrice VALUES ('I0000003','L','C0000002',21.00) INSERT INTO PizzaPrice VALUES ('I0000003','L','C0000003',22.00) INSERT INTO PizzaPrice VALUES ('I0000004','P','C0000001',10.00) INSERT INTO PizzaPrice VALUES ('I0000004','P','C0000002',11.00) INSERT INTO PizzaPrice VALUES ('I0000004','R','C0000001',15.00) INSERT INTO PizzaPrice VALUES ('I0000004','R','C0000002',16.00) INSERT INTO PizzaPrice VALUES ('I0000004','R','C0000003',17.00) INSERT INTO PizzaPrice VALUES ('I0000004','L','C0000001',20.00) INSERT INTO PizzaPrice VALUES ('I0000004','L','C0000002',21.00) INSERT INTO PizzaPrice VALUES ('I0000004','L','C0000003',22.00) INSERT INTO PizzaPrice VALUES ('I0000005','P','C0000001',10.00) INSERT INTO PizzaPrice VALUES ('I0000005','P','C0000002',11.00) INSERT INTO PizzaPrice VALUES ('I0000005','R','C0000001',15.00) INSERT INTO PizzaPrice VALUES ('I0000005','R','C0000002',16.00) INSERT INTO PizzaPrice VALUES ('I0000005','R','C0000003',17.00) INSERT INTO PizzaPrice VALUES ('I0000005','L','C0000001',20.00) INSERT INTO PizzaPrice VALUES ('I0000005','L','C0000002',21.00) INSERT INTO PizzaPrice VALUES ('I0000005','L','C0000003',22.00) INSERT INTO PizzaPrice VALUES ('I0000006','P','C0000001',10.00) INSERT INTO PizzaPrice VALUES ('I0000006','P','C0000002',11.00) INSERT INTO PizzaPrice VALUES ('I0000006','R','C0000001',15.00) INSERT INTO PizzaPrice VALUES ('I0000006','R','C0000002',16.00) INSERT INTO PizzaPrice VALUES ('I0000006','R','C0000003',17.00) INSERT INTO PizzaPrice VALUES ('I0000006','L','C0000001',20.00) INSERT INTO PizzaPrice VALUES ('I0000006','L','C0000002',21.00) INSERT INTO PizzaPrice VALUES ('I0000006','L','C0000003',22.00) INSERT INTO PizzaPrice VALUES ('I0000007','P','C0000001',10.00) INSERT INTO PizzaPrice VALUES ('I0000007','P','C0000002',11.00) INSERT INTO PizzaPrice VALUES ('I0000007','R','C0000001',15.00) INSERT INTO PizzaPrice VALUES ('I0000007','R','C0000002',16.00) INSERT INTO PizzaPrice VALUES ('I0000007','R','C0000003',17.00) INSERT INTO PizzaPrice VALUES ('I0000007','L','C0000001',20.00) INSERT INTO PizzaPrice VALUES ('I0000007','L','C0000002',21.00) INSERT INTO PizzaPrice VALUES ('I0000007','L','C0000003',22.00) INSERT INTO PizzaPrice VALUES ('I0000008','P','C0000001',10.00) INSERT INTO PizzaPrice VALUES ('I0000008','P','C0000002',11.00) INSERT INTO PizzaPrice VALUES ('I0000008','R','C0000001',15.00) INSERT INTO PizzaPrice VALUES ('I0000008','R','C0000002',16.00) INSERT INTO PizzaPrice VALUES ('I0000008','R','C0000003',17.00) INSERT INTO PizzaPrice VALUES ('I0000008','L','C0000001',20.00) INSERT INTO PizzaPrice VALUES ('I0000008','L','C0000002',21.00) INSERT INTO PizzaPrice VALUES ('I0000008','L','C0000003',22.00) INSERT INTO PizzaPrice VALUES ('I0000009','P','C0000001',10.00) INSERT INTO PizzaPrice VALUES ('I0000009','P','C0000002',11.00) INSERT INTO PizzaPrice VALUES ('I0000009','R','C0000001',15.00) INSERT INTO PizzaPrice VALUES ('I0000009','R','C0000002',16.00) INSERT INTO PizzaPrice VALUES ('I0000009','R','C0000003',17.00) INSERT INTO PizzaPrice VALUES ('I0000009','L','C0000001',20.00) INSERT INTO PizzaPrice VALUES ('I0000009','L','C0000002',21.00) INSERT INTO PizzaPrice VALUES ('I0000009','L','C0000003',22.00) INSERT INTO PizzaPrice VALUES ('I0000010','P','C0000001',10.00) INSERT INTO PizzaPrice VALUES ('I0000010','P','C0000002',11.00) INSERT INTO PizzaPrice VALUES ('I0000010','R','C0000001',15.00) INSERT INTO PizzaPrice VALUES ('I0000010','R','C0000002',16.00) INSERT INTO PizzaPrice VALUES ('I0000010','R','C0000003',17.00) INSERT INTO PizzaPrice VALUES ('I0000010','L','C0000001',20.00) INSERT INTO PizzaPrice VALUES ('I0000010','L','C0000002',21.00) INSERT INTO PizzaPrice VALUES ('I0000010','L','C0000003',22.00) INSERT INTO PizzaSize VALUES ('P',1) INSERT INTO PizzaSize VALUES ('R',2) INSERT INTO PizzaSize VALUES ('L',3) INSERT INTO PromoLine VALUES ('PML00001','PM000001','P',1,'Dine-In') INSERT INTO PromoLine VALUES ('PML00002','PM000001','P',1,'Dine-In') INSERT INTO PromoLine VALUES ('PML00003','PM000001','P',1,'Dine-In') INSERT INTO PromoLine VALUES ('PML00004','PM000001','P',1,'Dine-In') INSERT INTO PromoLine VALUES ('PML00005','PM000001','P',1,'Dine-In') INSERT INTO PromoLine VALUES ('PML00006','PM000001',null,1,'Dine-In') INSERT INTO PromoLine VALUES ('PML00007','PM000001',null,1,'Dine-In') INSERT INTO PromoLine VALUES ('PML00008','PM000001',null,1,'Dine-In') INSERT INTO PromoLine VALUES ('PML00009','PM000001',null,1,'Dine-In') INSERT INTO PromoLine VALUES ('PML00010','PM000001',null,1,'Dine-In') INSERT INTO PromoLine VALUES ('PML00011','PM000001',null,1,'Dine-In') --same table INSERT INTO PromoLine VALUES ('PML00001','PM000002','R',2,'Dine-In') INSERT INTO PromoLine VALUES ('PML00002','PM000002','R',2,'Dine-In') INSERT INTO PromoLine VALUES ('PML00003','PM000002','R',2,'Dine-In') INSERT INTO PromoLine VALUES ('PML00004','PM000002','R',2,'Dine-In') INSERT INTO PromoLine VALUES ('PML00005','PM000002','R',2,'Dine-In') INSERT INTO PromoLine VALUES ('PML00006','PM000002','R',2,'Dine-In') INSERT INTO PromoLine VALUES ('PML00007','PM000002',null,4,'Dine-In') INSERT INTO PromoLine VALUES ('PML00008','PM000002',null,4,'Dine-In') INSERT INTO PromoLine VALUES ('PML00009','PM000002',null,4,'Dine-In') INSERT INTO PromoLineItem VALUES ('PML00001','PM000001','I0000001')--Hawaiian INSERT INTO PromoLineItem VALUES ('PML00002','PM000001','I0000005')--Veggie Lover's INSERT INTO PromoLineItem VALUES ('PML00003','PM000001','I0000004')--Pepperoni INSERT INTO PromoLineItem VALUES ('PML00004','PM000001','I0000009')--BBQ Chicken INSERT INTO PromoLineItem VALUES ('PML00005','PM000001','I0000010')--The Four Cheese INSERT INTO PromoLineItem VALUES ('PML00006','PM000001','I0000012')--Chicken Pomodoro INSERT INTO PromoLineItem VALUES ('PML00007','PM000001','I0000017')--Traditional Bolognaise INSERT INTO PromoLineItem VALUES ('PML00008','PM000001','I0000014')--Prawn Aglio Olio INSERT INTO PromoLineItem VALUES ('PML00009','PM000001','I0000018')--Curry Zazzle INSERT INTO PromoLineItem VALUES ('PML00010','PM000001','I0000023')--Pepsi INSERT INTO PromoLineItem VALUES ('PML00011','PM000001','I0000024')--Pokka Green Tea --same table INSERT INTO PromoLineItem VALUES ('PML00001','PM000002','I0000001')--Pizza INSERT INTO PromoLineItem VALUES ('PML00002','PM000002','I0000002')--Pizza INSERT INTO PromoLineItem VALUES ('PML00003','PM000002','I0000003')--Pizza INSERT INTO PromoLineItem VALUES ('PML00004','PM000002','I0000004')--Pizza INSERT INTO PromoLineItem VALUES ('PML00005','PM000002','I0000005')--Pizza INSERT INTO PromoLineItem VALUES ('PML00006','PM000002','I0000006')--Pizza INSERT INTO PromoLineItem VALUES ('PML00007','PM000002','I0000011')--Soup of day INSERT INTO PromoLineItem VALUES ('PML00008','PM000002','I0000023')--Soft Drink INSERT INTO PromoLineItem VALUES ('PML00009','PM000002','I0000024')--Soft Drink INSERT INTO Promotion VALUES ('PM000001','Student Happy Hour','13:30:00','17:00:00',5.50,'Monday','Friday') INSERT INTO Promotion VALUES ('PM000002','Hut''s Feast',null,null,49.90,null,null)
true
6d0bda345b91ada580e92f8fa2dd0337d0a59f3a
SQL
jaksonlima/Java-Spring-Boot-Ws-Back-End
/src/main/resources/data.sql
UTF-8
448
2.625
3
[]
no_license
DROP TABLE IF EXISTS WS_PEDIDO_ITEM; DROP TABLE IF EXISTS WS_PEDIDO; CREATE TABLE WS_PEDIDO ( ID INT AUTO_INCREMENT PRIMARY KEY, DH_CRIACAO TIMESTAMP, RAZAO_SOCIAL VARCHAR(250), CNPJ VARCHAR(250), TELEFONE VARCHAR(250), EMAIL VARCHAR(250) ); CREATE TABLE WS_PEDIDO_ITEM ( ID INT AUTO_INCREMENT PRIMARY KEY, PRODUTO VARCHAR(250), QUANTIDADE NUMBER, PRECO NUMBER, TOTAL NUMBER, DH_CRIACAO TIMESTAMP, ID_PEDIDO NUMBER );
true
85ff01e3a0aedca0e989f8714c371df4b67a689f
SQL
Sultenhest/adventureXP
/src/sql/adventureXP-w-data.sql
UTF-8
3,039
3.421875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.4 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Mar 17, 2017 at 10:39 AM -- Server version: 5.6.33 -- PHP Version: 5.6.27 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database: `adventureXP` -- -- -------------------------------------------------------- -- -- Table structure for table `activity` -- CREATE TABLE `activity` ( `act_id` int(11) NOT NULL, `act_name` varchar(45) DEFAULT NULL, `act_min_age` int(11) DEFAULT NULL, `act_min_height` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `activity` -- INSERT INTO `activity` (`act_id`, `act_name`, `act_min_age`, `act_min_height`) VALUES (1, 'Gokart', 18, 150), (2, 'Hockey', 0, 100); -- -------------------------------------------------------- -- -- Table structure for table `equipment` -- CREATE TABLE `equipment` ( `equ_id` int(11) NOT NULL, `fk_act_id` int(11) NOT NULL, `equ_name` varchar(45) DEFAULT NULL, `fk_equ_sta_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `equipment` -- INSERT INTO `equipment` (`equ_id`, `fk_act_id`, `equ_name`, `fk_equ_sta_id`) VALUES (1, 1, 'Gokart #1', 1), (2, 1, 'Gokart #2', 2); -- -------------------------------------------------------- -- -- Table structure for table `equipment_status` -- CREATE TABLE `equipment_status` ( `equ_sta_id` int(11) NOT NULL, `equ_sta_name` varchar(45) DEFAULT NULL, `equ_sta_usable` tinyint(1) DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `equipment_status` -- INSERT INTO `equipment_status` (`equ_sta_id`, `equ_sta_name`, `equ_sta_usable`) VALUES (1, 'Funktionel', 1), (2, 'Ødelagt', 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `activity` -- ALTER TABLE `activity` ADD PRIMARY KEY (`act_id`); -- -- Indexes for table `equipment` -- ALTER TABLE `equipment` ADD PRIMARY KEY (`equ_id`), ADD KEY `act_id_idx` (`fk_act_id`), ADD KEY `fk_equ_sta_id_idx` (`fk_equ_sta_id`); -- -- Indexes for table `equipment_status` -- ALTER TABLE `equipment_status` ADD PRIMARY KEY (`equ_sta_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `activity` -- ALTER TABLE `activity` MODIFY `act_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `equipment` -- ALTER TABLE `equipment` MODIFY `equ_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `equipment_status` -- ALTER TABLE `equipment_status` MODIFY `equ_sta_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- Constraints for dumped tables -- -- -- Constraints for table `equipment` -- ALTER TABLE `equipment` ADD CONSTRAINT `act_id` FOREIGN KEY (`fk_act_id`) REFERENCES `activity` (`act_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `equ_sta_id` FOREIGN KEY (`fk_equ_sta_id`) REFERENCES `equipment_status` (`equ_sta_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
true
25ae1aea0b62cef5c2f9e6f311e4b9d7102e934e
SQL
sergeymong/SQL
/MySQL/Learning SQL/8. Outer joins.sql
UTF-8
6,012
4.40625
4
[]
no_license
# chapter 10 USE bank; SELECT account_id, cust_id FROM account; SELECT a.account_id, c.cust_id FROM account a INNER JOIN customer c on a.cust_id = c.cust_id; SELECT a.account_id, b.cust_id, b.name FROM account a INNER JOIN business b ON a.cust_id = b.cust_id; SELECT a.account_id, a.cust_id, b.name FROM account a LEFT JOIN business b ON a.cust_id = b.cust_id; # left join means, that left table responsible for number of rows SELECT a.account_id, a.cust_id, CONCAT(i.fname, ' ', i.lname) name FROM account a LEFT JOIN individual i ON a.cust_id = i.cust_id; # so, right join means, that right table responsible for number of rows SELECT a.account_id, a.cust_id, CONCAT(i.fname, ' ', i.lname) name FROM account a RIGHT JOIN individual i ON a.cust_id = i.cust_id; # full join SELECT a.account_id, a.product_cd, CONCAT(i.fname, ' ', i.lname) person_name, b.name business_name FROM account a LEFT JOIN individual i ON a.cust_id = i.cust_id LEFT JOIN business b ON a.cust_id = b.cust_id; # the same with subqueries SELECT account_ind.account_id, account_ind.product_cd, account_ind.person_name, b.name business_name FROM (SELECT a.account_id, a.product_cd, a.cust_id, CONCAT(i.fname, ' ', i.lname) person_name FROM account a LEFT JOIN individual i ON a.cust_id = i.cust_id) account_ind LEFT JOIN business b ON account_ind.cust_id = b.cust_id; # recursive joins # all employees and their bosses SELECT e.fname, e.lname, e_mgr.fname mgr_name, e_mgr.lname mgr_lname FROM employee e LEFT JOIN employee e_mgr ON e.superior_emp_id = e_mgr.emp_id; # cross-joins SELECT pt.name, p.product_cd, p.name FROM product p CROSS JOIN product_type pt; # with cross-join we can create sequence SELECT DATE_ADD('2004-01-01', INTERVAL (ones.num + tens.num + hundreds.num) DAY) dt FROM (SELECT 0 num UNION ALL SELECT 1 num UNION ALL SELECT 2 num UNION ALL SELECT 3 num UNION ALL SELECT 4 num UNION ALL SELECT 5 num UNION ALL SELECT 6 num UNION ALL SELECT 7 num UNION ALL SELECT 8 num UNION ALL SELECT 9 num) ones CROSS JOIN (SELECT 0 num UNION ALL SELECT 10 num UNION ALL SELECT 20 num UNION ALL SELECT 30 num UNION ALL SELECT 40 num UNION ALL SELECT 50 num UNION ALL SELECT 60 num UNION ALL SELECT 70 num UNION ALL SELECT 80 num UNION ALL SELECT 90 num) tens CROSS JOIN (SELECT 0 num UNION ALL SELECT 100 num UNION ALL SELECT 200 num UNION ALL SELECT 300 num UNION ALL SELECT 400 num UNION ALL SELECT 500 num UNION ALL SELECT 600 num UNION ALL SELECT 700 num UNION ALL SELECT 800 num UNION ALL SELECT 900 num) hundreds WHERE DATE_ADD('2004-01-01', INTERVAL (ones.num + tens.num + hundreds.num) DAY) < '2005-01-01'; # how many accounts have been opened each day SELECT days.dt, COUNT(a.account_id) FROM account a RIGHT JOIN (SELECT DATE_ADD('2004-01-01', INTERVAL (ones.num + tens.num + hundreds.num) DAY) dt FROM (SELECT 0 num UNION ALL SELECT 1 num UNION ALL SELECT 2 num UNION ALL SELECT 3 num UNION ALL SELECT 4 num UNION ALL SELECT 5 num UNION ALL SELECT 6 num UNION ALL SELECT 7 num UNION ALL SELECT 8 num UNION ALL SELECT 9 num) ones CROSS JOIN (SELECT 0 num UNION ALL SELECT 10 num UNION ALL SELECT 20 num UNION ALL SELECT 30 num UNION ALL SELECT 40 num UNION ALL SELECT 50 num UNION ALL SELECT 60 num UNION ALL SELECT 70 num UNION ALL SELECT 80 num UNION ALL SELECT 90 num) tens CROSS JOIN (SELECT 0 num UNION ALL SELECT 100 num UNION ALL SELECT 200 num UNION ALL SELECT 300 num) hundreds WHERE DATE_ADD('2004-01-01', INTERVAL (ones.num + tens.num + hundreds.num) DAY) < '2005-01-01') days ON days.dt = a.open_date GROUP BY days.dt; # natural join. automatically search ON. NOT RECOMMEND SELECT a.account_id, a.cust_id, c.cust_type_cd, c.fed_id FROM account a NATURAL JOIN customer c; # Homework # 10.1 https://cl.ly/df8654021470 SELECT a.account_id, p.product_cd, a.avail_balance, a.cust_id FROM account a RIGHT JOIN product p on a.product_cd = p.product_cd; # 10.2 https://cl.ly/e1f910a6453a SELECT p.product_cd, a.account_id, a.avail_balance, a.cust_id FROM product p LEFT JOIN account a on a.product_cd = p.product_cd; # 10.3 https://cl.ly/3dbee8850a4b SELECT a.account_id, a.product_cd, i.fname, i.lname, b.name FROM account a LEFT JOIN individual i ON i.cust_id = a.cust_id LEFT JOIN business b ON b.cust_id = a.cust_id; # or SELECT a.account_id, a.product_cd, CASE WHEN EXISTS (SELECT 1 FROM customer c WHERE c.cust_id = a.cust_id AND c.cust_type_cd = 'B') THEN (SELECT name FROM business b WHERE a.cust_id = b.cust_id) ELSE (SELECT CONCAT(i.fname, ' ', i.lname) FROM individual i WHERE a.cust_id = i.cust_id) END name FROM account a; # 10.4 https://cl.ly/702ca838a2ad SELECT nums FROM( SELECT ones.num + tens.num + hund.num nums FROM (SELECT 0 num UNION ALL SELECT 1 num UNION ALL SELECT 2 num UNION ALL SELECT 3 num UNION ALL SELECT 4 num UNION ALL SELECT 5 num UNION ALL SELECT 6 num UNION ALL SELECT 7 num UNION ALL SELECT 8 num UNION ALL SELECT 9 num) ones CROSS JOIN (SELECT 0 num UNION ALL SELECT 10 num UNION ALL SELECT 20 num UNION ALL SELECT 30 num UNION ALL SELECT 40 num UNION ALL SELECT 50 num UNION ALL SELECT 60 num UNION ALL SELECT 70 num UNION ALL SELECT 80 num UNION ALL SELECT 90 num) tens CROSS JOIN (SELECT 0 num UNION ALL SELECT 100 num) hund) res WHERE nums BETWEEN 1 AND 100 ORDER BY nums;
true
6f5309716d8dcee999b5bec75693e5dbfbb630db
SQL
JMPennington/Capstone
/com.WanderingTurtle/com.WanderingTurtle.EventDatabase/dbo/Stored Procedures/spSelectBookingNumbers.sql
UTF-8
244
3.3125
3
[]
no_license
CREATE PROCEDURE spSelectBookingNumbers @ItemListID int AS BEGIN select FirstName, LastName, Room, Quantity from HotelGuest join Booking on HotelGuest.HotelGuestID = Booking.GuestID where ItemListID = @ItemListID AND Booking.Active = 1 END
true
1e0c4e57d77fff9b0336271e8e8ae68e984e722d
SQL
elizabeth1331/BD_GH
/s-15-fx-genera_csv.sql
UTF-8
1,586
3.1875
3
[]
no_license
--@Autor: Jeremy García Meneses, MENDOZA DE LA VEGA DULCE ELIZABETH --@Fecha creación: 03/02/2021 --@Descripción: FUNCIONES connect gm_proy_admin/mg create or replace function genera_csv( p_directorio varchar2, p_nombre_archivo varchar2, p_usuario_id usuario.usuario_id%type, p_nombre_usuario usuario.nombre_usuario%type, p_email usuario.email%type, p_contasena usuario.contrasena%type, p_tarjeta_id tarjeta_credito.tarjeta_id%type, p_num_seguridad tarjeta_credito.num_seguridad%type, p_num_tarjeta tarjeta_credito.anio_exp%type, p_anio_exp tarjeta_credito.mes_exp%type, p_mes_exp tarjeta_credito.mes_exp%type ) return number is --Paquete UTL_FILE leer y escribir archivos de texto en el sistema operativo. --fopen(ubicacion,nombre_archivo) regresa el tipo de archivo v_file utl_file.file_type; begin --Abrimos el archivo en modo de lectura. v_file := utl_file.fopen(p_directorio,p_nombre_archivo,'A'); utl_file.put(v_file, p_usuario_id || ','); utl_file.put(v_file, p_nombre_usuario || ','); utl_file.put(v_file, p_email || ','); utl_file.put(v_file, p_contasena || ','); utl_file.put(v_file, p_tarjeta_id || ','); utl_file.put(v_file, p_num_seguridad || ','); utl_file.put(v_file, p_num_tarjeta || ','); utl_file.put(v_file, p_anio_exp || ','); utl_file.put(v_file, p_mes_exp); --Hacemos un salto de linea en el archivo utl_file.new_line(v_file); --Cerramos el archivo utl_file.fclose(v_file); return 0; end; / show errors
true
1d4a860a485535d7c32e0ddf96e15e8f70ae80f1
SQL
amexaCree/storefront-backend-udacity
/migrations/sqls/20210930070901-order-products-table-up.sql
UTF-8
183
2.96875
3
[ "MIT" ]
permissive
CREATE TABLE order_products ( id SERIAL PRIMARY KEY, quantity integer, order_id integer REFERENCES orders(id) NOT NULL, product_id integer REFERENCES products(id) NOT NULL );
true
47aa7de4227cf0955e5ae22f14c7d070d7b2ab2e
SQL
appgit/ibook-uyunshi
/uyunshi_mysql.sql
UTF-8
64,726
2.796875
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : zhan-database Source Server Version : 50616 Source Host : localhost:3306 Source Database : uyunshi_mysql Target Server Type : MYSQL Target Server Version : 50616 File Encoding : 65001 Date: 2015-05-23 22:14:58 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for t_admin -- ---------------------------- DROP TABLE IF EXISTS `t_admin`; CREATE TABLE `t_admin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` char(25) NOT NULL, `passwd` char(65) NOT NULL, `permission` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_admin -- ---------------------------- INSERT INTO `t_admin` VALUES ('1', 'billowtonadmin', '6dc860a07661194735f25bd9d7262e91', '3'); INSERT INTO `t_admin` VALUES ('2', 'zmjadmin', 'cf754a24bd1c129b16a906b2618b3f14', '2'); INSERT INTO `t_admin` VALUES ('3', 'zyjadmin', 'e10adc3949ba59abbe56e057f20f883e', '1'); -- ---------------------------- -- Table structure for t_autologin -- ---------------------------- DROP TABLE IF EXISTS `t_autologin`; CREATE TABLE `t_autologin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userid` int(11) NOT NULL, `token_exptime` int(11) NOT NULL, `verify` char(32) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_autologin -- ---------------------------- INSERT INTO `t_autologin` VALUES ('1', '23', '1401802051', '49163355da569b5673492882ac1208d6'); INSERT INTO `t_autologin` VALUES ('2', '20', '1401888945', '633ec8dad3a25bf212f4e2bcb1c93d3d'); INSERT INTO `t_autologin` VALUES ('3', '36', '1401967534', 'be313999512bc5e31368bb5873acfe2f'); INSERT INTO `t_autologin` VALUES ('4', '37', '1401968865', '7c4f1a393a170efbd2d298479fabb5a3'); INSERT INTO `t_autologin` VALUES ('5', '38', '1401969306', '9f27543f1bcc9ee7589ce2c8ed27ff82'); INSERT INTO `t_autologin` VALUES ('6', '49', '1403014706', 'd66a2101c70b42d272b005ca4b3cddd9'); INSERT INTO `t_autologin` VALUES ('7', '50', '1403106996', 'e1f71b762e184260961444c988c77fcb'); INSERT INTO `t_autologin` VALUES ('8', '51', '1403165383', '25dd6885ae5747a43d70ca8eb694c953'); INSERT INTO `t_autologin` VALUES ('12', '84', '1405673019', 'cd0698faf1db416179bb78fc1c01b22f'); INSERT INTO `t_autologin` VALUES ('13', '87', '1405825247', '1de846f5180cb64f243f7c8aa99a9fa7'); -- ---------------------------- -- Table structure for t_avatar -- ---------------------------- DROP TABLE IF EXISTS `t_avatar`; CREATE TABLE `t_avatar` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL, `path` varchar(70) NOT NULL DEFAULT 'public/images/home/avatar/default_64_auto.jpg', `create_time` int(11) NOT NULL, `status` int(11) NOT NULL, `is_temp` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=75 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_avatar -- ---------------------------- INSERT INTO `t_avatar` VALUES ('4', '19', 'uploads/avatar/2015-05-14/55545f4a9b5b1.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('5', '20', 'uploads/avatar/2014-06-23/53a7c7e120f58.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('6', '21', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('7', '22', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('8', '23', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('9', '24', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('10', '25', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('11', '26', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('12', '27', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('13', '28', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('14', '29', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('15', '30', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('16', '31', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('17', '32', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('18', '33', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('19', '34', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('20', '35', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('21', '36', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('22', '37', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('23', '38', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('24', '39', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('25', '40', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('26', '41', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('27', '42', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('28', '43', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('29', '44', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('30', '45', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('31', '46', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('32', '47', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('33', '48', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('34', '49', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('35', '50', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('36', '51', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('37', '52', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('38', '53', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('41', '56', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('42', '57', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('45', '66', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('44', '65', 'uploads/avatar/2014-07-04/53b65e369e2a3.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('46', '67', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('47', '68', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('48', '69', 'uploads/avatar/2014-08-03/53dde723b9881.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('49', '70', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('50', '71', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('51', '72', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('52', '73', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('53', '74', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('54', '75', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('55', '76', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('56', '77', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('57', '78', 'uploads/avatar/2014-07-07/53ba3fc13474b.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('58', '79', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('59', '80', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('60', '81', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('61', '82', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('62', '83', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('63', '84', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('64', '85', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('65', '86', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('66', '87', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('67', '88', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('68', '89', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('70', '92', 'uploads/avatar/2014-08-03/53dde7f697dbb.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('71', '93', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('72', '94', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('73', '95', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); INSERT INTO `t_avatar` VALUES ('74', '96', 'public/images/home/avatar/default_64_auto.jpg', '0', '0', '0'); -- ---------------------------- -- Table structure for t_btype -- ---------------------------- DROP TABLE IF EXISTS `t_btype`; CREATE TABLE `t_btype` ( `id` int(10) NOT NULL AUTO_INCREMENT, `note` char(50) NOT NULL DEFAULT '0', `sptypeid` int(10) NOT NULL, PRIMARY KEY (`id`), KEY `sptypeid` (`sptypeid`), CONSTRAINT `t_btype_ibfk_1` FOREIGN KEY (`sptypeid`) REFERENCES `t_sptype` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8 COMMENT='????'; -- ---------------------------- -- Records of t_btype -- ---------------------------- INSERT INTO `t_btype` VALUES ('25', '书籍杂志', '1'); INSERT INTO `t_btype` VALUES ('26', '自行车代步', '2'); INSERT INTO `t_btype` VALUES ('27', '体育用品', '2'); INSERT INTO `t_btype` VALUES ('28', '电脑手机', '3'); INSERT INTO `t_btype` VALUES ('29', '数码配件', '3'); INSERT INTO `t_btype` VALUES ('30', '小家电', '3'); INSERT INTO `t_btype` VALUES ('31', '配饰', '4'); INSERT INTO `t_btype` VALUES ('32', '服装', '4'); INSERT INTO `t_btype` VALUES ('36', '个护化妆', '5'); INSERT INTO `t_btype` VALUES ('37', ' 生活日用', '5'); INSERT INTO `t_btype` VALUES ('38', '家纺', '5'); INSERT INTO `t_btype` VALUES ('39', '休闲食品', '6'); INSERT INTO `t_btype` VALUES ('40', '进口水果', '7'); INSERT INTO `t_btype` VALUES ('42', '小家电', '9'); INSERT INTO `t_btype` VALUES ('49', '时鲜水果', '7'); INSERT INTO `t_btype` VALUES ('50', '电子资源', '1'); INSERT INTO `t_btype` VALUES ('51', '电脑手机', '9'); INSERT INTO `t_btype` VALUES ('52', '孕妇服饰', '11'); INSERT INTO `t_btype` VALUES ('53', '钟表类', '10'); -- ---------------------------- -- Table structure for t_helporder -- ---------------------------- DROP TABLE IF EXISTS `t_helporder`; CREATE TABLE `t_helporder` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` char(25) NOT NULL COMMENT '?????', `userid` int(11) NOT NULL COMMENT '???', `publishdate` int(50) NOT NULL COMMENT '????????', `description` varchar(255) NOT NULL COMMENT '????', ` duedate` int(11) NOT NULL COMMENT '????????', `view` tinyint(5) DEFAULT '0' COMMENT '浏览次数', `publictel` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否公开联系电话', PRIMARY KEY (`id`), KEY `userid` (`userid`), CONSTRAINT `t_helporder_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `t_userinfo` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_helporder -- ---------------------------- INSERT INTO `t_helporder` VALUES ('1', '小伙伴们来发求助吧 :-)', '19', '1401350032', '无', '0', '57', '0'); INSERT INTO `t_helporder` VALUES ('2', '高数书下册', '20', '1401355887', '我需要一本高数书下册的,有的可以联系我哈,最好便宜点', '0', '48', '1'); INSERT INTO `t_helporder` VALUES ('5', '二手电瓶车', '45', '1402315485', '需要一台二手电瓶车,请尽快联系', '0', '69', '0'); INSERT INTO `t_helporder` VALUES ('8', '求吉他', '69', '1404655538', '有木有二手的吉他的。。太贵了买不起', '0', '44', '0'); INSERT INTO `t_helporder` VALUES ('9', 'hhh', '19', '1414983436', 'hhgk', '0', '12', '1'); -- ---------------------------- -- Table structure for t_notice -- ---------------------------- DROP TABLE IF EXISTS `t_notice`; CREATE TABLE `t_notice` ( `id` int(11) NOT NULL AUTO_INCREMENT, `note` varchar(255) NOT NULL, `publishdate` int(50) NOT NULL, `iseffective` tinyint(255) NOT NULL DEFAULT '1' COMMENT '???????', `adminname` char(20) NOT NULL DEFAULT '' COMMENT '??????', `effectivedays` int(255) NOT NULL DEFAULT '10' COMMENT '??????', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_notice -- ---------------------------- -- ---------------------------- -- Table structure for t_orders -- ---------------------------- DROP TABLE IF EXISTS `t_orders`; CREATE TABLE `t_orders` ( `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键', `uid` int(10) NOT NULL COMMENT 'userid买家id', `sid` int(11) NOT NULL COMMENT 'sellid卖家id', `spid` int(11) NOT NULL COMMENT 'shangpinid商品id', `isread` tinyint(1) DEFAULT '0' COMMENT '订单是否已读', `createtime` int(11) NOT NULL COMMENT '下单时间', `description` varchar(255) CHARACTER SET utf8 DEFAULT '无', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1 COMMENT='订单'; -- ---------------------------- -- Records of t_orders -- ---------------------------- INSERT INTO `t_orders` VALUES ('3', '22', '21', '3', '1', '1401181689', '无'); INSERT INTO `t_orders` VALUES ('4', '22', '21', '10', '1', '1401181714', '无'); INSERT INTO `t_orders` VALUES ('5', '21', '19', '12', '1', '1401182474', '无'); INSERT INTO `t_orders` VALUES ('14', '39', '19', '81', '1', '1401559819', '无'); INSERT INTO `t_orders` VALUES ('15', '39', '19', '82', '1', '1401561034', '无'); INSERT INTO `t_orders` VALUES ('16', '39', '19', '83', '1', '1401694471', '你好'); INSERT INTO `t_orders` VALUES ('17', '39', '19', '83', '1', '1401694529', '无'); INSERT INTO `t_orders` VALUES ('18', '39', '19', '83', '1', '1401694563', '圣达菲'); INSERT INTO `t_orders` VALUES ('19', '19', '38', '75', '1', '1403358753', '无'); INSERT INTO `t_orders` VALUES ('21', '39', '19', '94', '1', '1403798162', '无'); INSERT INTO `t_orders` VALUES ('23', '19', '38', '72', '1', '1404719624', '无'); INSERT INTO `t_orders` VALUES ('24', '82', '38', '77', '0', '1404803149', '广告费'); INSERT INTO `t_orders` VALUES ('25', '39', '19', '101', '1', '1408765594', '无'); INSERT INTO `t_orders` VALUES ('26', '39', '19', '88', '1', '1411114050', 's'); INSERT INTO `t_orders` VALUES ('27', '39', '19', '101', '1', '1416712917', '你好'); INSERT INTO `t_orders` VALUES ('28', '39', '19', '110', '1', '1431351273', 'hi~'); INSERT INTO `t_orders` VALUES ('29', '39', '19', '88', '0', '1431592280', '无'); -- ---------------------------- -- Table structure for t_qqlogin -- ---------------------------- DROP TABLE IF EXISTS `t_qqlogin`; CREATE TABLE `t_qqlogin` ( `id` int(10) NOT NULL AUTO_INCREMENT, `openid` varchar(255) NOT NULL, `acesstoken` varchar(255) NOT NULL, `userid` int(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COMMENT='QQ登录信息表'; -- ---------------------------- -- Records of t_qqlogin -- ---------------------------- INSERT INTO `t_qqlogin` VALUES ('6', 'DA23CA1700EAC88E11B92BE8598F7932', 'EC74C1993D7086EF26F58B3C1BEF59F7', '69'); INSERT INTO `t_qqlogin` VALUES ('9', 'C368664F8876C16176B2A061A38570E1', '82B9ED3CD1E9534010B6671035C5A690', '72'); INSERT INTO `t_qqlogin` VALUES ('10', 'D558FBCCA873A7D62841CE32D77809ED', 'AF16A1A55F5A54D5CB313F7F96C9FB4F', '73'); INSERT INTO `t_qqlogin` VALUES ('11', '1002327EA6AA6C0A447A665B97E444C6', 'F3BD1D24D02C263FC4CC1BC840BAB2BA', '74'); INSERT INTO `t_qqlogin` VALUES ('12', '9AB96688EF6DC603E35C76C674BDD118', '9DB39CB79FFE584A8018A72D7E4CDBA2', '75'); INSERT INTO `t_qqlogin` VALUES ('15', 'B47A876EE37D124A88ABDE44BF633697', '3C51063FEA063976D776962C8DB87474', '78'); INSERT INTO `t_qqlogin` VALUES ('16', 'C7AA28A72C5CEE61069F13261644C9FB', 'E4D42114F001762EBDF0C23394BCA42F', '80'); INSERT INTO `t_qqlogin` VALUES ('17', 'CFD02044D0AF84B39252D076ED72730D', 'BADD0253712C8377379734D05B4A5AB6', '86'); INSERT INTO `t_qqlogin` VALUES ('18', 'E6B20940C233CE46AF7D6B008630AC0C', 'E59416925B5F8DA742C05779BAC8C659', '88'); INSERT INTO `t_qqlogin` VALUES ('19', '36D6DCF768C84D9DEB56336BA164BF4D', 'ED672269F630741FE2B478F0B159C9E7', '89'); INSERT INTO `t_qqlogin` VALUES ('20', 'B0ECF9537C02C6FE3AA10E8A6C830133', '7D773544EFAEC87ABB25B976B7F956D2', '90'); INSERT INTO `t_qqlogin` VALUES ('21', '459CC97917AF7E24D452365BCCD088CD', '944FA02453ED579F210D386EF9773296', '94'); INSERT INTO `t_qqlogin` VALUES ('22', '61042DF57F1B062C5BB08D8C02E4B811', '693D4F0268EF572EA6D23742427E0C2E', '95'); INSERT INTO `t_qqlogin` VALUES ('23', '8BE71AEBC389C40D71EA72D578105E89', 'DAFEE349C7FB28BCF9B858B88FA14691', '96'); -- ---------------------------- -- Table structure for t_resetpasswd -- ---------------------------- DROP TABLE IF EXISTS `t_resetpasswd`; CREATE TABLE `t_resetpasswd` ( `id` int(11) NOT NULL AUTO_INCREMENT, `error` tinyint(4) NOT NULL DEFAULT '0' COMMENT '1?????????0????', `token` varchar(128) NOT NULL, `token_exptime` int(11) NOT NULL, `userinfoid` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `userid` (`userinfoid`), CONSTRAINT `t_resetpasswd_ibfk_1` FOREIGN KEY (`userinfoid`) REFERENCES `t_userinfo` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_resetpasswd -- ---------------------------- INSERT INTO `t_resetpasswd` VALUES ('2', '1', '888fcae2069ca942a8197403f20c5fef', '1401262798', '19'); INSERT INTO `t_resetpasswd` VALUES ('3', '0', '56a6925a45f119514fb2634cdd861e8a', '1401533657', '20'); INSERT INTO `t_resetpasswd` VALUES ('4', '1', '777166a774b46b5c66688493182fa73d', '1403843861', '19'); INSERT INTO `t_resetpasswd` VALUES ('5', '0', 'a3ebc572690405eda4f55e6759127259', '1403964183', '21'); INSERT INTO `t_resetpasswd` VALUES ('6', '1', '02354152ad56cdd3c3838f65b0c192ad', '1404196586', '20'); INSERT INTO `t_resetpasswd` VALUES ('7', '1', 'a25bc3e77eb2f76fe84234be4ae00d08', '1406708267', '85'); -- ---------------------------- -- Table structure for t_shangpin -- ---------------------------- DROP TABLE IF EXISTS `t_shangpin`; CREATE TABLE `t_shangpin` ( `id` int(255) NOT NULL AUTO_INCREMENT, `userid` int(255) NOT NULL COMMENT '用户id', `chatcount` int(10) NOT NULL DEFAULT '0' COMMENT '约谈次数', `publishdate` int(30) NOT NULL COMMENT '发布时间', `ishandled` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否已经处理', `description` varchar(255) NOT NULL COMMENT '描述', `status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '状态0', `stypeid` int(11) NOT NULL, `name` varchar(255) NOT NULL, `costprice` float NOT NULL DEFAULT '0' COMMENT '原价', `duedate` int(50) NOT NULL COMMENT '过期时间', `image` varchar(255) NOT NULL DEFAULT '', `price` float NOT NULL DEFAULT '0' COMMENT '现价', `isnew` tinyint(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `user` (`userid`), KEY `stype` (`stypeid`), CONSTRAINT `t_shangpin_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `t_userinfo` (`id`) ON DELETE CASCADE, CONSTRAINT `t_shangpin_ibfk_2` FOREIGN KEY (`stypeid`) REFERENCES `t_stype` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=134 DEFAULT CHARSET=utf8 COMMENT='?????'; -- ---------------------------- -- Records of t_shangpin -- ---------------------------- INSERT INTO `t_shangpin` VALUES ('20', '20', '1', '1401200717', '1', '<pre><p>高数课本A上册,,便宜大甩卖</p></pre>', '1', '48', '《高等数学A上》', '34', '1416925517', '/test/2014-05-27/5384a04d2e176.jpg', '5', '0'); INSERT INTO `t_shangpin` VALUES ('21', '20', '0', '1401200842', '1', '<pre><p>高数下册便宜甩卖</p></pre>', '1', '48', '《高等数学A下》', '29', '1416925642', '/test/2014-05-27/5384a0ca0bf97.jpg', '3', '0'); INSERT INTO `t_shangpin` VALUES ('24', '20', '1', '1401201582', '1', '<pre><p>8成新,便宜送,非诚勿扰</p></pre>', '1', '48', '《新编大学英语3》 ', '42', '1416926382', '/test/2014-05-27/5384a3ae84108.jpg', '2', '0'); INSERT INTO `t_shangpin` VALUES ('25', '23', '0', '1401205844', '1', '<pre><p>高数上下册都有 笔记不多 6成新 上下册都要的10元两本</p></pre>', '1', '48', '高等数学 下 同济大学', '29.4', '1416930644', '/test/2014-05-27/5384b454c34c0.jpg', '6', '0'); INSERT INTO `t_shangpin` VALUES ('26', '23', '1', '1401205986', '1', '<pre><p>同济大学版高等教育出版社 5成新 略有笔记 上下册都有 同时要10元两本</p></pre>', '1', '48', '高等数学 上 同济大学版', '34.4', '1416930786', '/test/2014-05-27/5384b4e22ec51.jpg', '6', '0'); INSERT INTO `t_shangpin` VALUES ('27', '23', '1', '1401206140', '1', '<pre><p>高等教育出版社 何钦铭 颜辉主编 7成新 有程序笔记</p></pre>', '1', '49', 'C语言程序设计 何钦铭主编', '26', '1416930940', '/test/2014-05-27/5384b57c32d33.jpg', '8', '0'); INSERT INTO `t_shangpin` VALUES ('28', '23', '0', '1401206305', '1', '<pre><p>这门课相当坑爹但又蛮重要的 我是没听懂 so基本没有笔记::&gt;_&lt;::</p></pre>', '1', '49', '数据结构(C语言版)', '35', '1416931105', '/test/2014-05-27/5384b6210554d.jpg', '10', '0'); INSERT INTO `t_shangpin` VALUES ('31', '20', '1', '1401241737', '1', '<pre><p>便宜甩卖了</p></pre>', '1', '48', '《新编大学英语4》', '40', '1416966537', '/test/2014-05-28/538540899d75b.jpg', '2.5', '0'); INSERT INTO `t_shangpin` VALUES ('33', '20', '1', '1401249514', '1', '<pre><p>40*50*60cm \r\n8成新,只有10只欲购从速</p></pre>', '1', '112', '纸箱', '6', '1416974314', '/test/2014-05-28/53855eea236e8.jpg', '3', '0'); INSERT INTO `t_shangpin` VALUES ('35', '23', '1', '1401255650', '1', '<pre><p>高等教育出版社 2010年修订版 跟最新版本基本一样,8成新 无笔记</p></pre>', '1', '48', '中国近代史纲要', '19.5', '1416980450', '/test/2014-05-28/538576e219fd1.jpg', '3', '0'); INSERT INTO `t_shangpin` VALUES ('36', '23', '0', '1401255829', '1', '<pre><p>高等教育出版社 苏德矿主编 购书可附赠答案电子版 8成新 重点处有笔记</p></pre>', '1', '48', '概率论与数理统计', '22.8', '1416980629', '/test/2014-05-28/53857795ab822.jpg', '5', '0'); INSERT INTO `t_shangpin` VALUES ('37', '23', '0', '1401256175', '1', '<pre><p>高等教育出版社 苏德矿主编 7成新 重点处有笔记 附赠电子版题库</p></pre>', '1', '48', '线性代数', '17.9', '1416980975', '/test/2014-05-28/538578ef58de2.jpg', '3', '0'); INSERT INTO `t_shangpin` VALUES ('38', '23', '1', '1401256694', '1', '<pre><p>8成新 略有笔记 上下册一起买有优惠 附赠【大学物理实验 张晓波主编】</p></pre>', '1', '49', '普通物理学上册', '42.9', '1416981494', '/test/2014-05-28/53857af60aabd.jpg', '12', '0'); INSERT INTO `t_shangpin` VALUES ('39', '23', '0', '1401256826', '1', '<pre><p>9成新 无笔记 上下册一起买有优惠 附赠上册电子版题库 【大学物理实验 张晓波主编】(只买下册不赠送的喔)</p></pre>', '1', '48', '普通物理学 下册', '32.1', '1416981626', '/test/2014-05-28/53857b7acda2c.jpg', '10', '0'); INSERT INTO `t_shangpin` VALUES ('40', '23', '0', '1401257094', '1', '<pre><p>9成新 无笔记 附赠【视听说教程第三版】上听力课配套用的,也9成新无笔记定价为38 光盘都在。 英语4一起买有优惠同样附赠上述配套东西。</p></pre>', '1', '48', '新编大学英语3', '43.9', '1416981894', '/test/2014-05-28/53857c860bf23.jpg', '15', '0'); INSERT INTO `t_shangpin` VALUES ('41', '23', '0', '1401257255', '1', '<pre><p>8成新 基本无笔记 附赠【视听说教程4第三版】(上听力课配套使用 也是9成新无笔记 定价38元) 和英语3一起买有优惠喔</p></pre>', '1', '48', '新编大学英语4', '42.9', '1416982055', '/test/2014-05-28/53857d27d6a18.jpg', '15', '0'); INSERT INTO `t_shangpin` VALUES ('43', '36', '0', '1401362955', '1', '<pre><p>欢迎采购</p></pre>', '1', '58', '马克思课本九成新', '20.999', '1417087755', '/test/2014-05-29/53871a0b8d51b.jpg', '4.9999', '0'); INSERT INTO `t_shangpin` VALUES ('45', '38', '0', '1401366290', '1', '<pre><p>尺码齐全,三色,深蓝,枣红,浅蓝</p></pre>', '1', '117', '特价春季新款韩版板鞋男鞋子英伦风时尚休闲潮流行男鞋透气休闲鞋', '128', '1417091090', '/test/2014-05-29/53872712e589c.jpg', '68', '1'); INSERT INTO `t_shangpin` VALUES ('46', '38', '0', '1401366690', '1', '<pre><p>尺码齐全,三色,红色,蓝色,黑色</p></pre>', '1', '117', '春夏季低帮透气男士帆布鞋男鞋子休闲鞋韩版潮懒人鞋系带运动板鞋', '118', '1417091490', '/test/2014-05-29/538728a2c0150.jpg', '60', '1'); INSERT INTO `t_shangpin` VALUES ('47', '38', '0', '1401366773', '1', '<pre><p>尺码齐全,三色,墨绿色,蓝色,绿色</p></pre>', '1', '117', '2014最新款休闲时尚潮流韩版学生懒人脚套一脚蹬懒人男鞋驾车鞋', '120', '1417091573', '/test/2014-05-29/538728f5de033.png', '65', '1'); INSERT INTO `t_shangpin` VALUES ('48', '38', '0', '1401366868', '1', '<pre><p>尺码齐全,三色,绿色,蓝色,灰色</p></pre>', '1', '117', '2014春夏新款帆布鞋学生鞋男韩版潮一脚蹬懒人鞋板鞋子休闲鞋', '128', '1417091668', '/test/2014-05-29/53872954766cb.png', '68', '1'); INSERT INTO `t_shangpin` VALUES ('50', '38', '0', '1401367072', '1', '<pre><p>尺码齐全,四色,浅灰色,蓝色,橘黄色,月蓝色</p></pre>', '1', '117', '2014春男鞋休闲鞋夏季透气网鞋运动休闲板鞋网布鞋一脚蹬懒人鞋子', '96', '1417091872', '/test/2014-05-29/53872a200e27c.png', '48', '1'); INSERT INTO `t_shangpin` VALUES ('51', '38', '0', '1401367152', '1', '<pre><p>尺码齐全,三色,白色,蓝色,棕色</p></pre>', '1', '117', '2014夏季黑白色低帮系带男式帆布鞋英伦风日韩透气一脚蹬男士板鞋', '128', '1417091952', '/test/2014-05-29/53872a70285b9.png', '75', '1'); INSERT INTO `t_shangpin` VALUES ('52', '38', '0', '1401367242', '1', '<pre><p>尺码齐全,三色,白色,蓝色,天蓝色</p></pre>', '1', '117', '2014新款男鞋韩版时尚休闲潮流豆豆鞋英伦风驾车懒人鞋学生帆船鞋', '120', '1417092042', '/test/2014-05-29/53872acac4319.png', '65', '1'); INSERT INTO `t_shangpin` VALUES ('53', '38', '0', '1401367431', '1', '<pre><p>尺码齐全,四色,深灰色,蓝色,深卡其色,浅灰色</p></pre>', '1', '117', '夏天新款透气日常休闲鞋男鞋子韩版潮懒人系带运动低帮板鞋男生鞋', '108', '1417092231', '/test/2014-05-29/53872b8739d6b.png', '58', '1'); INSERT INTO `t_shangpin` VALUES ('54', '38', '0', '1401367552', '1', '<pre><p>尺码齐全,三色,深卡其布色,蓝色,黑色</p></pre>', '1', '117', '2014春透气时尚潮流英伦风男鞋子男士休闲鞋平底板鞋懒人鞋单鞋潮', '160', '1417092352', '/test/2014-05-29/53872c00727da.png', '89', '1'); INSERT INTO `t_shangpin` VALUES ('55', '38', '0', '1401367623', '1', '<pre><p>尺码齐全,三色,米色,灰色,黄色</p></pre>', '1', '117', '2014最新款潮流时尚透气鞋休闲鞋韩版春季新款豆豆男鞋懒人驾车鞋', '120', '1417092423', '/test/2014-05-29/53872c47cdb58.png', '65', '1'); INSERT INTO `t_shangpin` VALUES ('56', '38', '0', '1401367686', '1', '<pre><p>尺码齐全,三色,红色,蓝色,湖绿色</p></pre>', '1', '117', '春夏原创潮人款休闲鞋韩版透气男鞋子英伦风套脚懒人鞋豆豆鞋男潮', '120', '1417092486', '/test/2014-05-29/53872c86ebd0a.png', '65', '1'); INSERT INTO `t_shangpin` VALUES ('57', '38', '0', '1401367764', '1', '<pre><p>尺码齐全,三色,墨绿色,蓝色,卡其色</p></pre>', '1', '117', '2014最新款潮流韩版英伦风时尚休闲男鞋舒适商务低帮鞋子板鞋', '128', '1417092564', '/test/2014-05-29/53872cd484365.jpg', '68', '1'); INSERT INTO `t_shangpin` VALUES ('58', '38', '0', '1401367829', '1', '<pre><p>尺码齐全,三色,黑色,深蓝色,卡其色</p></pre>', '1', '117', '2014春夏四季款新款男士鞋韩版时尚休闲板鞋学生鞋青少年帆布男鞋', '128', '1417092629', '/test/2014-05-29/53872d15c48d5.jpg', '65', '1'); INSERT INTO `t_shangpin` VALUES ('59', '38', '0', '1401367887', '1', '<pre><p>尺码齐全,三色,卡其色,浅灰色,黑色</p></pre>', '1', '117', '2014四季款春款男式鞋时尚韩版反绒皮板鞋帆布时尚平底休闲鞋单鞋', '128', '1417092687', '/test/2014-05-29/53872d4fa1c49.jpg', '68', '1'); INSERT INTO `t_shangpin` VALUES ('60', '38', '0', '1401367949', '1', '<pre><p>尺码齐全,三色,橘色,天蓝色,黑色</p></pre>', '1', '117', '2014新款流行男鞋潮韩版时尚豆豆鞋男士超纤牛绒皮低帮单鞋驾车鞋', '128', '1417092749', '/test/2014-05-29/53872d8d45c1f.jpg', '68', '1'); INSERT INTO `t_shangpin` VALUES ('61', '38', '0', '1401368007', '1', '<pre><p>尺码齐全,三色,绿色,蓝色,浅灰色</p></pre>', '1', '117', '2014春夏秋季布鞋男士帆布鞋男韩版潮时尚男生板鞋休闲鞋平底男鞋', '120', '1417092807', '/test/2014-05-29/53872dc700bb7.jpg', '65', '1'); INSERT INTO `t_shangpin` VALUES ('62', '38', '0', '1401368107', '1', '<pre><p>尺码齐全,三色,卡其布色,蓝色,黑色</p></pre>', '1', '117', '2014春款新款时尚休闲鞋韩版水洗帆布男士阿甘鞋男式鞋低帮跑步鞋', '128', '1417092907', '/test/2014-05-29/53872e2b16feb.jpg', '68', '1'); INSERT INTO `t_shangpin` VALUES ('63', '38', '0', '1401368165', '1', '<pre><p>尺码齐全,三色,红色,蓝色,黑色</p></pre>', '1', '117', '春季新款潮流豆豆鞋 男士透气韩版帆布鞋套脚懒人鞋驾车鞋英伦风', '108', '1417092965', '/test/2014-05-29/53872e6525e40.jpg', '58', '1'); INSERT INTO `t_shangpin` VALUES ('64', '38', '0', '1401368249', '1', '<pre><p>尺码齐全,三色,灰色,蓝色,黑色</p></pre>', '1', '117', '2014春季帆布鞋男韩版低帮休闲潮流男式鞋子透气时尚百搭男板鞋', '120', '1417093049', '/test/2014-05-29/53872eb9d105d.jpg', '65', '1'); INSERT INTO `t_shangpin` VALUES ('65', '38', '0', '1401368315', '1', '<pre><p>尺码齐全,三色,灰色,蓝色,黑色</p></pre>', '1', '117', '夏季透气休闲鞋男士洞洞鞋英伦潮流凉网鞋男镂空鞋休闲凉鞋男鞋子', '100', '1417093115', '/test/2014-05-29/53872efb8bf28.jpg', '45', '1'); INSERT INTO `t_shangpin` VALUES ('66', '38', '0', '1401368453', '1', '<pre><p>尺码齐全,两色,蓝色,黑色</p></pre>', '1', '117', '春夏季男士休闲鞋韩版潮流透气帆布鞋低帮布鞋潮鞋板鞋豆豆男鞋子', '120', '1417093253', '/test/2014-05-29/53872f855d4f4.jpg', '65', '1'); INSERT INTO `t_shangpin` VALUES ('67', '38', '0', '1401368520', '1', '<pre><p>尺码齐全,三色,绿色,蓝色,白色</p></pre>', '1', '117', '新品低帮男鞋春秋季男士帆布鞋 男 韩版潮流男款时尚懒人驾车鞋潮', '120', '1417093320', '/test/2014-05-29/53872fc860b4a.jpg', '65', '1'); INSERT INTO `t_shangpin` VALUES ('68', '38', '0', '1401368614', '1', '<pre><p>尺码齐全,六色,红色,蓝色,黑色,灰色,浅蓝色,米白色</p></pre>', '1', '117', '2014春夏日韩托马斯男鞋一脚蹬轻质懒人驾车鞋时尚手绘低帮帆布鞋', '118', '1417093414', '/test/2014-05-29/5387302623026.jpg', '60', '1'); INSERT INTO `t_shangpin` VALUES ('69', '38', '0', '1401368713', '1', '<pre><p>尺码齐全,三色,绿色,蓝色,灰色</p></pre>', '1', '117', '夏季新款男士凉拖鞋子网布潮流洞洞鞋日韩版时尚休闲半拖鞋男潮拖', '118', '1417093513', '/test/2014-05-29/53873089391f9.jpg', '60', '1'); INSERT INTO `t_shangpin` VALUES ('70', '38', '0', '1401368815', '1', '<pre><p>尺码齐全,三色,白色,深蓝色,浅蓝色</p></pre>', '1', '117', '2014春夏新款英伦风 潮流时尚休闲 商务男士PU皮鞋子懒人驾车', '120', '1417093615', '/test/2014-05-29/538730ef93e05.jpg', '60', '1'); INSERT INTO `t_shangpin` VALUES ('71', '38', '0', '1401368876', '1', '<pre><p>尺码齐全,三色,白色,深蓝色,浅蓝色</p></pre>', '1', '117', '2014夏季新款男士透气休闲鞋 驾车懒人鞋一脚蹬韩版英伦风帆布鞋', '108', '1417093676', '/test/2014-05-29/5387312c6d51f.jpg', '58', '1'); INSERT INTO `t_shangpin` VALUES ('72', '38', '1', '1401369002', '1', '<pre><p>尺码齐全,三色,红色,深蓝色,米白色</p></pre>', '1', '117', '欧美潮流休闲时尚流行斑马托马斯男士鞋子拼色一脚蹬懒人脚套鞋', '118', '1417093802', '/test/2014-05-29/538731aa4e041.jpg', '60', '1'); INSERT INTO `t_shangpin` VALUES ('73', '38', '0', '1401369121', '1', '<pre><p>尺码齐全,四色,红色,蓝色,深卡其色,浅灰色</p></pre>', '1', '117', '2014夏季新款英伦风时尚休闲帆布鞋潮流驾车懒人鞋男鞋布鞋学生鞋', '118', '1417093921', '/test/2014-05-29/53873221c3865.jpg', '65', '1'); INSERT INTO `t_shangpin` VALUES ('74', '38', '0', '1401369215', '1', '<pre><p>尺码齐全,两色,深灰色,深蓝色</p></pre>', '1', '117', '2014夏季新款透气帆布男鞋子男士休闲鞋韩版 时尚板鞋 潮低帮鞋', '120', '1417094015', '/test/2014-05-29/5387327f0bd62.jpg', '68', '1'); INSERT INTO `t_shangpin` VALUES ('75', '38', '1', '1401369309', '1', '<pre><p>尺码齐全,三色,浅灰色,深蓝色,浅蓝色</p></pre>', '1', '117', '2014夏季流行男鞋春夏季透气板鞋男士休闲鞋 韩版潮男低帮帆布鞋', '120', '1417094109', '/test/2014-05-29/538732dd53b9f.jpg', '65', '1'); INSERT INTO `t_shangpin` VALUES ('76', '38', '0', '1401369387', '1', '<pre><p>尺码齐全,三色,黑白色,蓝白色,灰白色</p></pre>', '1', '117', '2014夏季新款时尚休闲套脚豆豆男鞋舒适布鞋韩版克罗心驾车懒人鞋', '120', '1417094187', '/test/2014-05-29/5387332b6df0e.jpg', '65', '1'); INSERT INTO `t_shangpin` VALUES ('77', '38', '1', '1401369458', '1', '<pre><p>尺码齐全,三色,白色,蓝色,灰色</p></pre>', '1', '117', '2014男士帆布N字鞋阿甘鞋夏季韩版男布鞋休闲鞋透气林弯弯板鞋潮', '140', '1417094258', '/test/2014-05-29/5387337211f5a.jpg', '89', '1'); INSERT INTO `t_shangpin` VALUES ('85', '46', '0', '1402322397', '1', '<pre><p>强推的!超级好用!! 最近自己新购的mascara玛思卡华洗发套装 !!真的是洗一次就有效果的噢会越洗越好的! 真的我自己在用拉啦头发实在是 300ml活性碳洗发水+300ml胶原蛋白护发素 ❶多功能修复,对于头发,❷烫染后损伤 ❸静电 ❹无营养 ❺脱发 ❻出油等有明显修复作用 针对打结 毛躁 分岔等等噢跑理发店护理水疗什么的也不敌它噢!!</p></pre>', '1', '104', 'mascara玛思卡华洗发套装', '160', '1418047197', '/test/2014-06-09/5395bddd544c5.jpg', '120', '1'); INSERT INTO `t_shangpin` VALUES ('86', '46', '0', '1402322594', '1', '<pre><p>台湾za美白焕颜两用粉饼 自用款!! 遮瑕控油都很 没有粉质感哦! 粉饼加za15周年限量粉盒!! za的彩妆效果都是很棒的啦啦 因为价格也很实惠噢!!</p></pre>', '1', '105', '台湾za美白焕颜两用粉饼', '180', '1418047394', '/test/2014-06-09/5395bea2a8d69.jpg', '160', '1'); INSERT INTO `t_shangpin` VALUES ('87', '50', '0', '1402502441', '1', '<pre><p>九成新</p></pre>', '1', '86', '卷发棒', '100', '1418227241', '/test/2014-06-12/53987d2946983.jpg', '60', '0'); INSERT INTO `t_shangpin` VALUES ('88', '19', '4', '1403701150', '1', '<pre><p>测试</p></pre>', '1', '101', 'test', '12', '1419425950', '/test/2014-06-25/53aac79ef32f3.jpg', '123', '0'); INSERT INTO `t_shangpin` VALUES ('89', '19', '0', '1403701519', '1', '<pre><p>该数据为测试数据\r\n 该数据为测试数据\r\n\r\n *_*</p></pre>', '1', '111', '该数据为测试数据', '2', '1419426319', '/test/2014-06-25/53aac90f7a4a6.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('90', '19', '0', '1403701546', '1', '<pre><p>该数据为测试数据\r\n 该数据为测试数据\r\n\r\n *_*</p></pre>', '1', '111', '该数据为测试数据 该数据为测试数据 *_*', '12', '1419426346', '/test/2014-06-25/53aac92a0bbf5.jpg', '123', '1'); INSERT INTO `t_shangpin` VALUES ('91', '19', '0', '1403701569', '1', '<pre><p>该数据为测试数据\r\n 该数据为测试数据\r\n\r\n *_*</p></pre>', '1', '111', '该数据为测试数据 该数据为测试数据 *_*', '12', '1419426369', '/test/2014-06-25/53aac941d6003.jpg', '123', '1'); INSERT INTO `t_shangpin` VALUES ('92', '19', '0', '1403701587', '1', '<pre><p>该数据为测试数据\r\n 该数据为测试数据\r\n\r\n *_*</p></pre>', '1', '111', '该数据为测试数据 该数据为测试数据 *_*', '12', '1419426387', '/test/2014-06-25/53aac95339a70.jpg', '123', '1'); INSERT INTO `t_shangpin` VALUES ('93', '19', '0', '1403701620', '1', '<pre><p>该数据为测试数据\r\n 该数据为测试数据\r\n\r\n *_*</p></pre>', '1', '111', '该数据为测试数据 该数据为测试数据 *_*', '23', '1419426420', '/test/2014-06-25/53aac974d6290.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('95', '19', '0', '1403701697', '1', '<pre><p>该数据为测试数据\r\n 该数据为测试数据\r\n\r\n *_*</p></pre>', '1', '111', '该数据为测试数据 该数据为测试数据 *_*', '2', '1419426497', '/test/2014-06-25/53aac9c195934.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('96', '19', '0', '1403701710', '1', '<pre><p>该数据为测试数据\r\n 该数据为测试数据\r\n\r\n *_*</p></pre>', '1', '111', '该数据为测试数据 该数据为测试数据 *_*', '3', '1419426510', '/test/2014-06-25/53aac9cee98a4.jpg', '34', '1'); INSERT INTO `t_shangpin` VALUES ('97', '19', '0', '1403701877', '1', '<pre><p>该数据为测试数据\r\n 该数据为测试数据\r\n\r\n *_*</p></pre>', '1', '106', '该数据为测试数据 该数据为测试数据 *_*', '12', '1419426677', '/test/2014-06-25/53aaca75ede07.jpg', '123', '0'); INSERT INTO `t_shangpin` VALUES ('98', '19', '0', '1403701893', '1', '<pre><p>该数据为测试数据\r\n 该数据为测试数据\r\n\r\n *_*</p></pre>', '1', '104', '该数据为测试数据 该数据为测试数据 *_*', '12', '1419426693', '/test/2014-06-25/53aaca850cdb5.jpg', '123', '1'); INSERT INTO `t_shangpin` VALUES ('99', '19', '0', '1403701983', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '105', '该数据为测试数据,与真实类目不符', '2', '1419426783', '/test/2014-06-25/53aacadf240af.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('100', '19', '0', '1403701992', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '107', '该数据为测试数据,与真实类目不符', '2', '1419426792', '/test/2014-06-25/53aacae8cbef5.jpeg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('101', '19', '2', '1403702003', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '108', '该数据为测试数据,与真实类目不符', '22', '1419426803', '/test/2014-06-25/53aacaf34e195.jpg', '122', '1'); INSERT INTO `t_shangpin` VALUES ('102', '19', '0', '1403702011', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '110', '该数据为测试数据,与真实类目不符', '22', '1419426811', '/test/2014-06-25/53aacafbb8f33.jpg', '122', '1'); INSERT INTO `t_shangpin` VALUES ('103', '19', '0', '1403702035', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '109', '该数据为测试数据,与真实类目不符', '454', '1419426835', '/test/2014-06-25/53aacb131ca83.jpg', '1', '1'); INSERT INTO `t_shangpin` VALUES ('104', '19', '0', '1403702153', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '99', '该数据为测试数据,与真实类目不符', '22', '1419426953', '/test/2014-06-25/53aacb890281b.jpg', '1222', '1'); INSERT INTO `t_shangpin` VALUES ('105', '19', '0', '1403702159', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '99', '该数据为测试数据,与真实类目不符', '22', '1419426959', '/test/2014-06-25/53aacb8fa691f.jpg', '122', '1'); INSERT INTO `t_shangpin` VALUES ('106', '19', '0', '1403702169', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '99', '该数据为测试数据,与真实类目不符', '22', '1419426969', '/test/2014-06-25/53aacb995a525.jpg', '122', '1'); INSERT INTO `t_shangpin` VALUES ('107', '19', '0', '1403702177', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '99', '该数据为测试数据,与真实类目不符', '22', '1419426977', '/test/2014-06-25/53aacba1b5e9d.jpg', '122', '1'); INSERT INTO `t_shangpin` VALUES ('108', '19', '0', '1403702270', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '99', '该数据为测试数据,与真实类目不符', '22', '1419427070', '/test/2014-06-25/53aacbfe97d4d.jpg', '122', '1'); INSERT INTO `t_shangpin` VALUES ('109', '19', '0', '1403702281', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '99', '该数据为测试数据,与真实类目不符', '22', '1419427081', '/test/2014-06-25/53aacc09293dc.jpg', '122', '1'); INSERT INTO `t_shangpin` VALUES ('110', '19', '1', '1403702329', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '99', '该数据为测试数据,与真实类目不符', '2', '1419427129', '/test/2014-06-25/53aacc3925939.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('111', '19', '0', '1403702341', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '99', '该数据为测试数据,与真实类目不符', '2', '1419427141', '/test/2014-06-25/53aacc45efcba.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('112', '19', '0', '1403702348', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '99', '该数据为测试数据,与真实类目不符', '2', '1419427148', '/test/2014-06-25/53aacc4c38b5a.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('113', '19', '0', '1403702562', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '71', '该数据为测试数据,与真实类目不符', '2', '1419427362', '/test/2014-06-25/53aacd2298bf4.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('114', '19', '0', '1403702577', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '67', '该数据为测试数据,与真实类目不符', '2', '1419427377', '/test/2014-06-25/53aacd31a06c6.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('115', '19', '0', '1403702590', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '64', '该数据为测试数据,与真实类目不符', '2', '1419427390', '/test/2014-06-25/53aacd3e2664f.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('117', '19', '0', '1403702614', '1', '<pre><p>该数据为测试数据,与真实类目不符\r\n网站正式推广后会删除所有测试数据\r\n ^_^</p></pre>', '1', '68', '该数据为测试数据,与真实类目不符', '2', '1419427414', '/test/2014-06-25/53aacd56638b1.jpg', '12', '1'); INSERT INTO `t_shangpin` VALUES ('132', '96', '0', '1407724551', '0', '<pre><p>123123</p></pre>', '0', '64', '123213', '123123', '1423449351', '/test/2014-08-11/53e82c070f695.jpg', '123213', '0'); INSERT INTO `t_shangpin` VALUES ('133', '19', '0', '1427040574', '0', '<pre><p>ss</p></pre>', '0', '65', 'd', '23', '1442765374', '/test/2015-03-23/550ee93e73ee4.jpg', '12', '0'); -- ---------------------------- -- Table structure for t_sptype -- ---------------------------- DROP TABLE IF EXISTS `t_sptype`; CREATE TABLE `t_sptype` ( `id` int(11) NOT NULL AUTO_INCREMENT, `note` char(255) NOT NULL, `isnew` tinyint(10) NOT NULL DEFAULT '0', `icon` char(255) NOT NULL COMMENT '前缀图标', `image` char(255) NOT NULL COMMENT '背景图片', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_sptype -- ---------------------------- INSERT INTO `t_sptype` VALUES ('1', '文化书籍', '0', '1.gif', 'bg1.jpg'); INSERT INTO `t_sptype` VALUES ('2', '户外运动', '0', '2.gif', 'bg2.jpg'); INSERT INTO `t_sptype` VALUES ('3', '数码家电', '0', '3.gif', 'bg3.jpg'); INSERT INTO `t_sptype` VALUES ('4', '衣装配饰', '1', '4.gif', 'bg4.jpg'); INSERT INTO `t_sptype` VALUES ('5', '家居日用', '1', '5.gif', 'bg5.jpg'); INSERT INTO `t_sptype` VALUES ('6', '零食特产', '1', '6.gif', 'bg6.jpg'); INSERT INTO `t_sptype` VALUES ('7', '缤纷水果', '1', '7.gif', 'bg7.jpg'); INSERT INTO `t_sptype` VALUES ('9', '数码家电', '1', '3.gif', 'bg3.jpg'); INSERT INTO `t_sptype` VALUES ('10', '珠宝收藏', '0', '4.gif', 'bg4.jpg'); INSERT INTO `t_sptype` VALUES ('11', '闲置母婴', '0', '5.gif', 'bg5.jpg'); -- ---------------------------- -- Table structure for t_stype -- ---------------------------- DROP TABLE IF EXISTS `t_stype`; CREATE TABLE `t_stype` ( `id` int(10) NOT NULL AUTO_INCREMENT, `note` char(50) NOT NULL DEFAULT '0' COMMENT '小类名称', `btypeid` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `btype` (`btypeid`), KEY `btypeid` (`btypeid`), CONSTRAINT `FK_t_stype_btypeid` FOREIGN KEY (`btypeid`) REFERENCES `t_btype` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `t_stype_ibfk_1` FOREIGN KEY (`btypeid`) REFERENCES `t_btype` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_stype -- ---------------------------- INSERT INTO `t_stype` VALUES ('48', '通识课程类', '25'); INSERT INTO `t_stype` VALUES ('49', '电子信息类(有)', '25'); INSERT INTO `t_stype` VALUES ('50', '工业技术类', '25'); INSERT INTO `t_stype` VALUES ('51', '材纺服装类', '25'); INSERT INTO `t_stype` VALUES ('52', '自然科学类', '25'); INSERT INTO `t_stype` VALUES ('53', '建筑工程类', '25'); INSERT INTO `t_stype` VALUES ('54', '文化教育类', '25'); INSERT INTO `t_stype` VALUES ('55', '语言文学类', '25'); INSERT INTO `t_stype` VALUES ('56', '外语类', '25'); INSERT INTO `t_stype` VALUES ('57', '财经管理类', '25'); INSERT INTO `t_stype` VALUES ('58', '政治法律类', '25'); INSERT INTO `t_stype` VALUES ('59', '哲学类', '25'); INSERT INTO `t_stype` VALUES ('60', '杂志小说', '25'); INSERT INTO `t_stype` VALUES ('62', '自行车', '26'); INSERT INTO `t_stype` VALUES ('63', '山地车', '26'); INSERT INTO `t_stype` VALUES ('64', '电动车', '26'); INSERT INTO `t_stype` VALUES ('65', '羽毛球', '27'); INSERT INTO `t_stype` VALUES ('66', '乒乓球', '27'); INSERT INTO `t_stype` VALUES ('67', '篮球', '27'); INSERT INTO `t_stype` VALUES ('68', '足球', '27'); INSERT INTO `t_stype` VALUES ('69', '排球', '27'); INSERT INTO `t_stype` VALUES ('70', '网球(拍)', '27'); INSERT INTO `t_stype` VALUES ('71', '杠哑铃', '27'); INSERT INTO `t_stype` VALUES ('72', '其他', '27'); INSERT INTO `t_stype` VALUES ('74', '笔记本', '28'); INSERT INTO `t_stype` VALUES ('75', 'iphone', '28'); INSERT INTO `t_stype` VALUES ('76', 'ipad', '28'); INSERT INTO `t_stype` VALUES ('77', '小米', '28'); INSERT INTO `t_stype` VALUES ('78', '其他', '28'); INSERT INTO `t_stype` VALUES ('85', '电风扇', '30'); INSERT INTO `t_stype` VALUES ('86', '电吹风', '30'); INSERT INTO `t_stype` VALUES ('87', '台灯', '30'); INSERT INTO `t_stype` VALUES ('88', '其他', '30'); INSERT INTO `t_stype` VALUES ('89', '移动硬盘', '29'); INSERT INTO `t_stype` VALUES ('90', '音响', '29'); INSERT INTO `t_stype` VALUES ('91', '鼠标', '29'); INSERT INTO `t_stype` VALUES ('92', 'U盘', '29'); INSERT INTO `t_stype` VALUES ('93', '耳机', '29'); INSERT INTO `t_stype` VALUES ('94', '三星', '28'); INSERT INTO `t_stype` VALUES ('95', '其他', '25'); INSERT INTO `t_stype` VALUES ('99', '水果', '49'); INSERT INTO `t_stype` VALUES ('100', '创意DIY', '31'); INSERT INTO `t_stype` VALUES ('101', '项链/吊坠', '31'); INSERT INTO `t_stype` VALUES ('102', '手镯/手链/脚链', '31'); INSERT INTO `t_stype` VALUES ('103', '袜子', '32'); INSERT INTO `t_stype` VALUES ('104', '洗发露', '36'); INSERT INTO `t_stype` VALUES ('105', '洁面乳', '36'); INSERT INTO `t_stype` VALUES ('106', '沐浴露', '36'); INSERT INTO `t_stype` VALUES ('107', '纸巾', '37'); INSERT INTO `t_stype` VALUES ('108', '水杯', '37'); INSERT INTO `t_stype` VALUES ('109', '床单/被套', '38'); INSERT INTO `t_stype` VALUES ('110', '枕头', '38'); INSERT INTO `t_stype` VALUES ('111', '巧克力', '39'); INSERT INTO `t_stype` VALUES ('112', '纸箱', '37'); INSERT INTO `t_stype` VALUES ('113', '实验报告', '50'); INSERT INTO `t_stype` VALUES ('114', '包', '32'); INSERT INTO `t_stype` VALUES ('117', '男鞋', '32'); INSERT INTO `t_stype` VALUES ('118', '平板电脑', '51'); INSERT INTO `t_stype` VALUES ('119', '电子书籍', '50'); INSERT INTO `t_stype` VALUES ('120', '学习资料', '50'); INSERT INTO `t_stype` VALUES ('122', '短上衣', '52'); INSERT INTO `t_stype` VALUES ('123', '劳伦斯钟表', '53'); -- ---------------------------- -- Table structure for t_userinfo -- ---------------------------- DROP TABLE IF EXISTS `t_userinfo`; CREATE TABLE `t_userinfo` ( `id` int(255) NOT NULL AUTO_INCREMENT, `isqq` tinyint(5) DEFAULT '0', `username` char(20) NOT NULL COMMENT '用户名', `passwd` char(255) NOT NULL COMMENT '密码', `tel` char(20) NOT NULL COMMENT '电话话吗', `email` char(50) NOT NULL COMMENT 'email', `regdate` int(50) NOT NULL COMMENT '注册日期', `addr` varchar(100) NOT NULL COMMENT '地址', `number` char(20) DEFAULT NULL COMMENT 'qq号码', `vip` tinyint(4) DEFAULT '0' COMMENT '是否vip', `isseller` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否卖家', `truename` varchar(255) NOT NULL DEFAULT '', `status` tinyint(4) NOT NULL, `token` varchar(255) NOT NULL, `token_exptime` int(11) NOT NULL, `lastlogindate` int(15) NOT NULL DEFAULT '0', `maxsell` int(10) NOT NULL DEFAULT '20', `signupdate` int(11) NOT NULL COMMENT '签到日期', `coin` int(8) NOT NULL DEFAULT '0' COMMENT 'ǩ', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_userinfo -- ---------------------------- INSERT INTO `t_userinfo` VALUES ('19', '0', 'zhan', '96e79218965eb72c92a549dd5a330112', '611111', 'htmlgit@163.com', '1401172539', 'zstu', '553676333', '0', '1', '占榆杰', '1', 'a69578aaf87fd4109d92f4149b235f5f', '1401258939', '1432390437', '1000', '0', '0'); INSERT INTO `t_userinfo` VALUES ('20', '0', 'billowton', '6d81e1c4ed4c8341fbb039ec453dcc6e', '615983', '851616601@qq.com', '1401178827', '浙江理工大学', '1915699835', '0', '1', '汪涛涛', '1', '3b1c0a39f079ef538abf411f0b866e18', '1401265227', '1407137638', '100', '0', '0'); INSERT INTO `t_userinfo` VALUES ('21', '0', 'zhaomingjie', '96e79218965eb72c92a549dd5a330112', '15757126264', 'zhao523520704@163.com', '1401180234', '浙江理工大学生活三区B1E526寝室', '523520704', '0', '1', '赵明杰', '1', 'c8661ab13d144ea628a503190eb1236b', '1401266634', '1401198232', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('23', '0', '种蘑菇的小提莫', '96e79218965eb72c92a549dd5a330112', '567027', '523520704@qq.com', '1401197206', '浙江理工大学生活三区B1E526寝室', '523520704', '0', '1', '赵明杰', '1', '839a74b178b5a77f6892861849839c5b', '1401283606', '1404624050', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('24', '0', '1209985002', '6d66fd5a85b8451da38c92e5d0846b77', '15757126257', '1209985002@qq.com', '1401202201', '理工三区', null, '0', '0', '', '1', 'dc3c91e3df5460b99a3b79777e261505', '1401288601', '1401202251', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('25', '0', 'friendship', '55504f0e17c00bfa4fbad580d04fa32d', '15757126164', '1064890298@qq.com', '1401202427', '理工生活二区一号楼512', '1064890298', '0', '1', '钟嘉烽', '1', '50c1256a251beb11a65dc84ecc4ead9c', '1401288827', '1402055985', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('26', '0', '921103zmm', '89b3975e222552f58bc2ea2fdb07d63f', '18814886794', '582104438@qq.com', '1401243565', '理工生活3区3E219', null, '0', '0', '', '1', 'fcc0f11ea9df770b273f3f3f6d96314e', '1401329965', '1402463129', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('32', '0', 'cll', 'e2c6d672eed83709e51562020d859e78', '18258225234', '1041869769@qq.com', '1401266195', '浙江传媒', '1041869769', '0', '1', '蔡琳琳', '1', '277dcc97852d6a43632fccd153916184', '1401352595', '1401266279', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('33', '0', 'wym_01', '9a1f364a6f9e443433414d47ee048ecc', '13616551322', '765744240@qq.com', '1401280161', '二区6S', '765744240', '0', '1', '王毓铭', '1', '2d41ecd63255c0b5f433a07ae4ed55b4', '1401366561', '1401280221', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('35', '0', 'fannie', 'ccdf1161522ef26cb04ceda7afc7cf42', '18768124865', 'fannie@uyunshi.com', '1401284091', '一区4s622', null, '0', '0', '', '1', 'fde43bb9319c9ba1d3053f70ed1f0448', '1401370491', '1401364764', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('36', '0', '哈哈哈哈哈哈哈哈哈哈哈', '02c75fb22c75b23dc963c7eb91a062cc', '611942', '1971773087@qq.com', '1401362672', '619', '1971773087', '0', '1', '哈哈哈', '1', '03f255acedebb47b897c8d1588c55186', '1401449072', '1401362734', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('37', '0', 'xyfuil', 'f3e7cb0a7b19269683535e8d0a4c5556', '611947', 'xyfuil@qq.com', '1401363978', '理工4号南楼619室', null, '0', '0', '', '1', 'd5bec2c68035843e4b26c60ec5e7b939', '1401450378', '1401364065', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('38', '0', '小东东潮鞋店', '6477b5f1acf96876feea55dc8d3fae2b', '18658887475', '747782795@qq.com', '1401364483', '浙江省温州市瓯海区梧田街道德绣苑7幢', '2011046539', '0', '1', '吴东', '1', 'd298fad9d5198fe230b6af6366adca5e', '1401450883', '1404719681', '40', '0', '0'); INSERT INTO `t_userinfo` VALUES ('39', '0', 'zhan2', '96e79218965eb72c92a549dd5a330112', '611122', '553676333@qq.com', '1401370377', 'zstu', null, '0', '0', '', '1', '894a79a01c7e23404b5bba4f1647f8d1', '1401456777', '1431592519', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('40', '0', '123', 'e10adc3949ba59abbe56e057f20f883e', '12345678901', '1225733380@qq.com', '1401426636', '123', null, '0', '0', '', '1', '15a38ab8a29db190f7f3205ed180e6a3', '1401513036', '1401426683', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('44', '0', '小猪猪', 'e462234837c1ba0c0a39cc79011d63d2', '18768428144', 'jerry1224@qq.com', '1402186835', '杭州滨江区滨兴西苑', '1574978515', '0', '1', '陈文婷', '1', '2a5c540b8afea4632d0c44c6adf8b429', '1402273235', '1402405574', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('45', '0', '勤vIc', '991793afe7a34c8e412599e4060125d5', '18768194775', '370128846@qq.com', '1402315375', '学林街656-5', '370128846', '0', '1', '陈伟勤', '1', 'af009c8f766f997b13cdc5446b6610c7', '1402401775', '1402315432', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('46', '0', 'lwzhy', '00a5f1e772a201ffafb2d26c9d8ae699', '18658005022', '584291616@qq.com', '1402322059', '浙江理工大学', '584291616', '0', '1', '张虹雨', '1', '9384a3289e72ba3ca83dca2bc726a965', '1402408459', '1403868539', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('49', '0', '年七sred', 'e93cbb1afa7b33d1a82eef364257bd1d', '18067978472', '791649229@qq.com', '1402409877', '浙理工', null, '0', '0', '', '1', '585fd332cf7763316da50eb3a5632a12', '1402496277', '1402409906', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('50', '0', 'liumengxin', 'b09feda5658ca5050586d1a9b01bb3f3', '15757160714', '542560574@qq.com', '1402502138', '杭州下沙东城大厦', '542560574', '0', '1', '刘梦欣', '1', '7231b7ae7ad686c61f3d3dd9e81deff1', '1402588538', '1402502196', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('51', '0', 'DebenChou', 'b265a31e29affd9fb0a5d782468727b7', '15858189575', '992462202@qq.com', '1402560529', '理工二区六南', null, '0', '0', '', '1', 'f207a1aadedad75b3b9521f5c7babeb8', '1402646929', '1402560583', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('52', '0', '伊若影雪', '4a48c51593dc26ebba154b9ed1b83ef0', '611932', '919043324@qq.com', '1402754135', '浙江理工大学', null, '0', '0', '', '1', '93d9f752c1398e6e7f962a2757b770dd', '1402840535', '1402754182', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('53', '0', 'variya', 'e1a8d7f527418ae77b167096e37df6bf', '18612312312', '24252463@qq.com', '1402815595', 'dalian', null, '0', '0', '', '1', 'c84a5b777126afc0f5e0fbe8d0b08188', '1402901995', '1402815629', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('56', '0', 'zigawei', '22b8fc94db903b76409507dbd990aa78', '18668158901', '1254621296@qq.com', '1403940100', '二区', '1254621296', '0', '1', '朱嘉伟', '1', 'd87c7377ba2bc86bacdf7c8408e8386d', '1404026500', '1404033725', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('67', '0', 'a188', '67c04e88926b781ad6726ba134c4e760', '611803', '1813907195@qq.com', '1404552817', '123456', null, '0', '0', '', '1', '3160cfd686152d805dc0511668ea4eec', '1404639217', '1406366936', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('69', '1', 'dsfdsfs', 'uyunshi', '18888888888', 'sfdf@dfdsf.com', '1404566497', '请自行修改地址', '1915699835', '0', '1', '汪涛涛', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('74', '1', '优云网', 'uyunshi', '615983', '1915699835@qq.com', '1404644448', '未填写地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('75', '1', 'a1881', 'uyunshi', '18888888888', 'asd@asd.com', '1404654687', '未填写地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('78', '1', 'zhan_qq', 'uyunshi', '18888888888', '5536763333@qq.com', '1404657065', '未填写地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('79', '0', '木子新春', '3a2382ba632efded1da0a910778c51c3', '18814887160', '1937291090@qq.com', '1404663430', '4S617', null, '0', '0', '', '1', '69715554a0700aa90091bd0c4b92497c', '1404749830', '1404663470', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('80', '1', '王毓铭', 'uyunshi', '18888888888', '765744240@qq.com', '1404688538', '未填写地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('81', '0', '杜娟Summer', '2b312fe5343296df7ea5b85b66786f8f', '18814887363', 'lovecuckoodj@163.com', '1404723472', '杭州', null, '0', '0', '', '1', '43355f79cfa0cb272dfd0a0230cfa321', '1404809872', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('82', '0', 'stronger11', 'b628382c97124173dd283bf7b83f1eec', '15708455524', '1025465224@qq.com', '1404802960', '成都', null, '0', '0', '', '1', '5b72f643eb9c309199267d2d5aacafc2', '1404889360', '1404802989', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('83', '0', 'test_', '96e79218965eb72c92a549dd5a330112', '1111111', 'sdfkljadsjfljxjldftest@163.com', '1404804619', '1123', null, '0', '0', '', '0', 'ea96658660efe0a37ca59e1d49ac8b2e', '1404891019', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('84', '0', '艾艾艾', '9c32d6523556378b8b1632720f7ab1e1', '15019419567', '563486809@qq.com', '1405068177', '深圳', null, '0', '0', '', '1', 'b841867b180338441c182d635da07d5f', '1405154577', '1405068219', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('85', '0', 'dandan', '25d55ad283aa400af464c76d713c07ad', '15757126010', '2273713586@qq.com', '1405175077', '三区', null, '0', '0', '', '1', '5135349827f1545297c1eb448a64293f', '1405261477', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('86', '1', '廖绪雄', 'uyunshi', '18888888888', '1459902482@qq.com', '1405187669', '未填写地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('87', '0', '苍茫游客', 'efe3cebe7eaaad63635a3ad50a963b30', '15757124981', '997410501@qq.com', '1405220362', '浙江理工大学', null, '0', '0', '', '1', '7420b02ea230aa98c14a3125e58689c5', '1405306762', '1407833889', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('88', '1', '汪葆乐', 'uyunshi', '18888888888', '745164744@qq.com', '1405320133', '未填写地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('89', '1', '小优云', 'uyunshi', '18888888888', 'qimaixian@qq.com', '1406709768', '未填写地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('90', '1', '1407049566uyun', 'uyunshi', '18888888888', 'uyunshi@uyunshi.com', '1407049566', '未填写地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('92', '2', 'billowton1407051750', 'uyunshi', '18888888888', '1915699835@qq.com', '1407051750', '请自行修改地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('93', '2', 'zhan1407431071', 'uyunshi', '18888888888', 'htmlgit@163.com', '1407431071', '请自行修改地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('95', '1', '1407660224uyun', 'uyunshi', '18888888888', 'uyunshi@uyunshi.com', '1407660224', '未填写地址', null, '0', '0', '', '1', '', '0', '0', '20', '0', '0'); INSERT INTO `t_userinfo` VALUES ('96', '1', 'asdasd', 'uyunshi', '18888888888', 'asdasd@13.com', '1407724471', '未填写地址', 'a12312312312', '0', '1', 'asdsd', '1', '', '0', '0', '20', '0', '0'); -- ---------------------------- -- Table structure for t_uyunshilogin -- ---------------------------- DROP TABLE IF EXISTS `t_uyunshilogin`; CREATE TABLE `t_uyunshilogin` ( `id` int(10) NOT NULL AUTO_INCREMENT, `openid` varchar(255) NOT NULL, `acesstoken` varchar(255) NOT NULL, `userid` int(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='QQ登录信息表'; -- ---------------------------- -- Records of t_uyunshilogin -- ---------------------------- INSERT INTO `t_uyunshilogin` VALUES ('2', 'cc8fcf5fd7703cce814ca7394b1b28dd', 'uyunshilogin', '92'); INSERT INTO `t_uyunshilogin` VALUES ('3', '0c107d12f934ed983248f29d8929bb42', 'uyunshilogin', '93');
true
dfb613ffc4255dcf33636e4973e1726cde6d56ca
SQL
hudas/sys_arch_lab1
/src/main/resources/h2database/createdb.sql
UTF-8
552
3.578125
4
[]
no_license
CREATE TABLE IF NOT EXISTS client ( id INTEGER NOT NULL IDENTITY, name VARCHAR(50), PRIMARY KEY (ID) ); CREATE SEQUENCE IF NOT EXISTS client_sequence; CREATE TABLE IF NOT EXISTS service ( id INTEGER NOT NULL IDENTITY, price BIGINT, client_id BIGINT REFERENCES client(id), PRIMARY KEY (id) ); CREATE SEQUENCE IF NOT EXISTS service_sequence; CREATE TABLE IF NOT EXISTS equipment ( id INTEGER NOT NULL IDENTITY, model VARCHAR(20), PRIMARY KEY (id), ); CREATE SEQUENCE IF NOT EXISTS equipment_sequence;
true
f22f446b78d56993ecf7d5a3dcc0f51f3a3f0f9f
SQL
Raimovanberkel/Kalender
/database/crud_system_sql.sql
UTF-8
598
3.25
3
[]
no_license
SELECT DISTINCT birthdays.id, person, dag, tblmaand.maand as maand, jaar, maandoms FROM birthdays RIGHT JOIN tblmaand ON birthdays.maand=tblmaand.maand WHERE birthdays.id = 99 Order by maand, dag, person ASC; Update birthdays set person="Raimo" where id = 99 ; INSERT INTO birthdays (id,person, dag, maand, jaar) VALUES (999,"Alfred",9,9,1999) ; SELECT DISTINCT birthdays.id, person, dag, tblmaand.maand as maand, jaar, maandoms FROM birthdays RIGHT JOIN tblmaand ON birthdays.maand=tblmaand.maand WHERE birthdays.id = 999 Order by maand, dag, person ASC; DELETE FROM birthdays WHERE id=999
true
1f00ef37eb0bcae6ca5c4c95a8aa455fffd70a1b
SQL
yeqingyang/wishweb
/sqldoc/t_group.sql
GB18030
499
2.671875
3
[]
no_license
CREATE TABLE IF NOT EXISTS `t_group` ( `gid` int(10) unsigned not null auto_increment comment 'id', `gname` varchar(50) not null comment '', `uid` int(10) unsigned not null comment 'uid', `create_time` int(10) unsigned not null comment 'ʱ', `status` int(10) unsigned not null default 0 comment '״̬0 1ɾ', `va_user` blob not null comment 'members', primary key(`gid`) ) auto_increment=1000 default charset utf8 engine = InnoDb;
true
5e2aeae3e8f3bba9bf8db673fd60cd839561ef6f
SQL
uzbekdev1/podbaby
/migrations/0014_add_user_triggers.down.sql
UTF-8
483
3.40625
3
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
ALTER TABLE bookmarks DROP CONSTRAINT bookmarks_user_id_fkey; ALTER TABLE bookmarks ADD CONSTRAINT bookmarks_user_id_fkey FOREIGN KEY (user_id) REFERENCES users (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION; ALTER TABLE subscriptions DROP CONSTRAINT subscriptions_user_id_fkey; ALTER TABLE subscriptions ADD CONSTRAINT subscriptions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION;
true
f308359c77a601c2aed94b9325e8a807a59740d7
SQL
thedemodev/project-manager
/server/db/setup_scripts/project_members.join_table.sql
UTF-8
206
3.171875
3
[]
no_license
-- Table that joins the project and it's members CREATE TABLE project_members ( project_id INTEGER REFERENCES project(id) ON DELETE CASCADE, user_id INTEGER REFERENCES users(id) ON DELETE CASCADE );
true
43d18b040a587db623c18fd4d9cc00dabe61dbee
SQL
regeldso/hrank
/SQL/Advanced Join/Projects.sql
UTF-8
2,362
4.5625
5
[ "MIT" ]
permissive
--Select Only Dates, Ordered by Datefiff, StartDate SELECT StartDate, EndDate FROM ( -- Get DateDiff of Alone Nodes (SELECT StartDate, EndDate, ABS(DateDiff(day,StartDate, EndDate)) as DD FROM ( --SELECT Alone Nodes with JOIN SELECT t1.Start_Date as StartDate, t1.End_Date as EndDate, t1.Task_ID as ID, CASE WHEN t3.Task_ID IS NULL AND t2.Task_ID IS NULL THEN 'NODE' ELSE NULL END Type1 FROM Projects t1 LEFT JOIN Projects t2 ON t2.Start_Date = t1.End_Date LEFT JOIN Projects t3 ON t3.End_Date = t1.Start_Date) AloneNodes WHERE AloneNodes.Type1 = 'NODE') --Union Begin & End Dates of Trees And Alone Nodes UNION ALL ( -- Join Only Begin and End of Trees By Rank SELECT RnkByBegins.StartDate, RnkByEnds.EndDate, ABS(DateDiff(day,RnkByBegins.StartDate, RnkByEnds.EndDate)) as DD FROM --Rank by Begin (SELECT BeginOfNodes.StartDate, RANK() OVER (PARTITION BY BeginOfNodes.Type1 ORDER BY StartDate) AS Rank FROM --SELECT Begin of Nodes with JOIN (SELECT t1.Start_Date as StartDate, t1.End_Date as EndDate, t1.Task_ID as ID, CASE WHEN t2.Task_ID IS NOT NULL AND t3.Task_ID IS NULL THEN 'BEGIN' ELSE NULL END Type1 FROM Projects t1 LEFT JOIN Projects t2 ON t2.Start_Date = t1.End_Date LEFT JOIN Projects t3 ON t3.End_Date = t1.Start_Date) BeginOfNodes WHERE BeginOfNodes.Type1 = 'BEGIN') RnkByBegins JOIN --Rank by Ends (SELECT EndsOfNodes.EndDate as EndDate, RANK() OVER (PARTITION BY Type1 ORDER BY EndDate ASC) AS Rank FROM --SELECT End of Nodes with JOIN (SELECT t1.Start_Date as StartDate, t1.End_Date as EndDate, t1.Task_ID as ID, CASE WHEN t3.Task_ID IS NOT NULL AND t2.Task_ID IS NULL THEN 'END' ELSE NULL END Type1 FROM Projects t1 LEFT JOIN Projects t2 ON t2.Start_Date = t1.End_Date LEFT JOIN Projects t3 ON t3.End_Date = t1.Start_Date) EndsOfNodes WHERE EndsOfNodes.Type1 = 'END') RnkByEnds ON RnkByBegins.Rank = RnkByEnds.Rank ) ) FinalTable ORDER BY DD, StartDate
true
038b63029d46c8e7815126739a6c8302f7ee9af6
SQL
eupherein/Bamazon-sql
/data.sql
UTF-8
744
2.921875
3
[]
no_license
DROP DATABASE IF EXISTS bamazon_db; CREATE DATABASE bamazon_db; USE bamazon_db; CREATE TABLE items( id INTEGER (11) AUTO_INCREMENT NOT NULL, Name VARCHAR (45) NOT NULL, Department VARCHAR (45) NOT NULL, Price INTEGER (11) NOT NULL, In_Stock INTEGER (11) NOT NULL, PRIMARY KEY (id) ); INSERT INTO items (Name, Department, Price, In_Stock) VALUES ("shoe", "clothing", 2, 5); INSERT INTO items (Name, Department, Price, In_Stock) VALUES ("shirt", "clothing", 12, 7); INSERT INTO items (Name, Department, Price, In_Stock) VALUES ("sock", "clothing", 2, 19); INSERT INTO items (Name, Department, Price, In_Stock) VALUES ("foot", "parts", 199, 2); INSERT INTO items (Name, Department, Price, In_Stock) VALUES ("pant", "clothing", 4, 37);
true
c47b8ecd3655fc9aa315cbf5e18e85e3336d5792
SQL
hmanasi/toprecipe
/schema/ddl_h2.sql
UTF-8
2,803
3.34375
3
[]
no_license
alter table category drop constraint FK_81thrbnb8c08gua7tvqj7xdqk; alter table category_food_item drop constraint FK_pjc47hvpkirbrjg8fv5hj6i53; alter table category_food_item drop constraint FK_57cujwjie5pbw98s9ub9ibmr3; alter table food_item drop constraint FK_g2t49cbwowqs6wppdtbuceuhr; alter table recipe drop constraint FK_5erw19wu4k1mu350u80omax3s; drop table category if exists; drop table category_food_item if exists; drop table food_item if exists; drop table recipe if exists; drop table user if exists; drop sequence category_seq; drop sequence food_item_seq; drop sequence recipe_seq; drop sequence user_seq; create table category ( id bigint not null, title varchar(255) not null, parent_id bigint, primary key (id) ); create table category_food_item ( category_id bigint not null, food_item_id bigint not null ); create table food_item ( id bigint not null, title varchar(255) not null, vegetarian boolean not null, top_recipe_id bigint, primary key (id) ); create table recipe ( id bigint not null, flash_video varchar(255), image varchar(255), source_url varchar(255), title varchar(255) not null, you_tube_video varchar(255), food_item_id bigint, primary key (id) ); create table user ( id bigint not null, disabled boolean not null, email varchar(255) not null, passwordHash varchar(255) not null, primary key (id) ); alter table category add constraint category_u1 unique (parent_id, title); alter table food_item add constraint food_item_u1 unique (title); alter table user add constraint user_u1 unique (email); alter table category add constraint FK_81thrbnb8c08gua7tvqj7xdqk foreign key (parent_id) references category; alter table category_food_item add constraint FK_pjc47hvpkirbrjg8fv5hj6i53 foreign key (food_item_id) references food_item; alter table category_food_item add constraint FK_57cujwjie5pbw98s9ub9ibmr3 foreign key (category_id) references category; alter table food_item add constraint FK_g2t49cbwowqs6wppdtbuceuhr foreign key (top_recipe_id) references recipe; alter table recipe add constraint FK_5erw19wu4k1mu350u80omax3s foreign key (food_item_id) references food_item; create sequence category_seq; create sequence food_item_seq; create sequence recipe_seq; create sequence user_seq;
true
eb85a74ac791554cb9ef3c4923400edbb541b5db
SQL
aaiche/42-piscine_php
/piscine.a/day05/ex17/ex17.sql
UTF-8
161
2.703125
3
[]
no_license
SELECT COUNT(*) AS 'nb_abo', FLOOR(AVG(db_aaiche.abonnement.prix)) AS 'moy_abo', (SUM(db_aaiche.abonnement.duree_abo) MOD 42) AS 'ft' FROM db_aaiche.abonnement;
true
4f91b0d1384b604b3f082452826bbddf9b08bf0e
SQL
natyrrr/NYC-Restaurant-Analysis
/covid_restaurant_data/eater/eater_csv_data_schema.sql
UTF-8
10,317
2.796875
3
[]
no_license
CREATE TABLE closed_restaurants ( Restaurant_id INT PRIMARY KEY, Name VARCHAR(150), Neighborhood VARCHAR(150), Borough VARCHAR(150), Zip_Code BIGINT, Closed_As_Of_Date VARCHAR(100) ); INSERT INTO closed_restaurants (Restaurant_id,Name,Neighborhood,Borough,Zip_Code,Closed_As_Of_Date) VALUES (1,'Awkward Scone','Bushwick','Brooklyn',11216,'2020-08-06'), (2,'Kharian Deli','Chelsea','Manhattan',10011,'2020-08-06'), (3,'Zauo','Chelsea','Manhattan',10011,'2020-08-06'), (4,'Camp','Cobble Hill','Brooklyn',11201,'2020-08-06'), (5,'Bunsmith','Crown Heights','Brooklyn',11238,'2020-08-06'), (6,'Bali Kitchen','East Village','Manhattan',10003,'2020-08-06'), (7,'Fonda','East Village','Manhattan',10009,'2020-08-06'), (8,'Oda House','East Village','Manhattan',10009,'2020-08-06'), (9,'Porsena','East Village','Manhattan',10003,'2020-08-06'), (10,'Bennie Thai Cafe','Financial District','Manhattan',10038,'2020-08-06'), (11,'Punch Restaurant','Flat Iron','Manhattan',10010,'2020-08-06'), (12,'Minnie’s','Lower East Side','Manhattan',10002,'2020-08-06'), (13,'Bouchon Bakery','Midtown','Manhattan',10020,'2020-08-06'), (14,'Rose’s','Prospect Heights','Brooklyn',11217,'2020-08-06'), (15,'Jay and Lloyd’s Kosher Deli', 'Sheepshead Bay', 'Brooklyn',11229,'2020-08-06'), (16,'Holy Ground','Tribeca','Manhattan',10013,'2020-08-06'), (17,'Angkor Cambodian Bistro','Upper East Side','Manhattan',10065,'2020-08-06'), (18,'Pearl’s','Williamsburg','Brooklyn',11211,'2020-08-06'), (19,'Rossopomodoro','West Village','Manhattan',10011,'2020-08-06'), (20,'Gaia Italian Cafe','East Village','Manhattan',10002,'2020-07-30'), (21,'O Ramen and Dim Sum M','East Village','Manhattan',10003,'2020-07-30'), (22,'Augustine','Financial District','Manhattan',10038,'2020-07-30'), (23,'Pequena','Fort Greene','Brooklyn',11217,'2020-07-30'), (24,'Bouley at Home','Flat Iron','Manhattan',10010,'2020-07-30'), (25,'Fluffy’s','Hell’s Kitchen','Manhattan',10019,'2020-07-30'), (26,'An Choi','Lower East Side','Manhattan',10002,'2020-07-30'), (27,'Cafe Phin','Lower East Side','Manhattan',10002,'2020-07-30'), (28,'Rosario’s Pizza','Lower East Side','Manhattan',10002,'2020-07-30'), (29,'The Gansevoort Market Food Hall','Meatpacking District','Manhattan',10014,'2020-07-30'), (30,'By Name Cafe','NoHo','Manhattan',10012,'2020-07-30'), (31,'Quality Eats','Nomad','Manhattan',10016,'2020-07-30'), (32,'El Coqui Bar and Billiards','Ridgewood','Queens',11385,'2020-07-30'), (33,'Dairy Queen','Union Square','Manhattan',10011,'2020-07-30'), (34,'Agra Restaurant','Upper East Side','Manhattan',10065,'2020-07-30'), (35,'Sarabeth’s','Upper East Side','Manhattan',10128,'2020-07-30'), (36,'La Caridad 78','Upper West Side','Manhattan',10024,'2020-07-30'), (37,'Oath Pizza','Upper West Side','Manhattan',10024,'2020-07-30'), (38,'Recolte','Upper West Side','Manhattan',10023,'2020-07-30'), (39,'Xi’an Famous Foods','Upper West Side','Manhattan',10025,'2020-07-30'), (40,'Rusty Knot','West Village','Manhattan',10014,'2020-07-30'), (41,'Gotan','Williamsburg','Brooklyn',11249,'2020-07-30'), (42,'Extra Fancy','Williamsburg','Brooklyn',11211,'2020-07-30'), (43,'Always and Forever Cafe','Bed Stuy','Brooklyn',11238,'2020-07-23'), (44,'Let’s Makan','Chinatown','Manhattan',10013,'2020-07-23'), (45,'Bad Seed','Crown Heights','Brooklyn',11238,'2020-07-23'), (46,'Alameda','Greenpoint','Brooklyn',11222,'2020-07-23'), (47,'Kinfolk','Greenpoint','Brooklyn',11249,'2020-07-23'), (48,'Bluestockings','Lower East Side','Manhattan',10002,'2020-07-23'), (49,'Spoon Table and Bar','Midtown East','Manhattan',10016,'2020-07-23'), (50,'Hunger Pang NYC','Prospect Park South','Brooklyn',11218,'2020-07-23'), (51,'Saint Austere','Williamsburg','Brooklyn',11211,'2020-07-23'), (52,'Viva Toro','Williamsburg','Brooklyn',11211,'2020-07-23'), (53,'Violet’s Bake Shoppe','Forest Hills','Queens',11375,'2020-07-16'), (54,'Dutch Kills Centraal','Long Island City','Queens',11101,'2020-07-16'), (55,'Abigael’s','Midtown','Manhattan',10018,'2020-07-16'), (56,'Ali Baba','Upper West Side','Manhattan',10024,'2020-07-16'), (57,'Amsterdam Gourmet Deli','Upper West Side','Manhattan',10024,'2020-07-16'), (58,'the Beacon Bar','Upper West Side','Manhattan',10023,'2020-07-16'), (59,'The Ellington','Upper West Side','Manhattan',10025,'2020-07-16'), (60,'Floating Mountain Tea House','Upper West Side','Manhattan',10023,'2020-07-16'), (61,'Grill 212','Upper West Side','Manhattan',10024,'2020-07-16'), (62,'Lenwich','Upper West Side','Manhattan',10025,'2020-07-16'), (63,'Nanoosh','Upper West Side','Manhattan',10023,'2020-07-16'), (64,'New Wave Cafe','Upper West Side','Manhattan',10024,'2020-07-16'), (65,'Pasta Franco','Upper West Side','Manhattan',10024,'2020-07-16'), (66,'Vaucluse','Upper East Side','Manhattan',10065,'2020-07-16'), (67,'Cote Soleil','Sunnyside','Queens',11377,'2020-07-16'), (68,'Jimmy’s Diner','Williamsburg','Brooklyn',11211,'2020-07-16'), (69,'Cranberry’s','Brooklyn Heights','Brooklyn',11201,'2020-07-16'), (70,'Crispo','Chelsea','Manhattan',10011,'2020-07-16'), (71,'Professor Thoms','East Village','Manhattan',10003,'2020-07-16'), (72,'China Chalet','Financial District','Manhattan',10006,'2020-07-16'), (73,'Mullanes','Fort Greene','Brooklyn',11217,'2020-07-16'), (74,'Beverly’s','Lower East Side','Manhattan',10002,'2020-07-16'), (75,'Pokebab','Upper West Side','Manhattan',10023,'2020-07-16'), (76,'Fish Restaurant','West Village','Manhattan',10014,'2020-07-16'), (77,'Sushi West','West Village','Manhattan',10014,'2020-07-16'), (78,'Sweet Corner','Greenwich Village','Manhattan',10014,'2020-07-16'), (79,'JJ Noodle','Chinatown','Manhattan',10002,'2020-07-02'), (80,'Glady’s','Crown Heights','Brooklyn',11238,'2020-07-02'), (81,'Nolita Pizza','East Village','Manhattan',10003,'2020-07-02'), (82,'the Pokespot','East Village','Manhattan',10003,'2020-07-02'), (83,'Cocoa Bar','Lower East Side','Manhattan',10002,'2020-07-02'), (84,'Padoca','Upper East Side','Manhattan',10065,'2020-07-02'), (85,'Aria','West Village','Manhattan',10014,'2020-07-02'), (86,'Snacky','Williamsburg','Brooklyn',11211,'2020-07-02'), (87,'Crown Fried Chicken','Bed Stuy','Brooklyn',11233,'2020-06-26'), (88,'Aureole','Bryant Park','Manhattan',10036,'2020-06-26'), (89,'Aux Epices','Chinatown','Manhattan',10013,'2020-06-26'), (90,'Mee Li Fruits and Vegetables','Chinatown','Manhattan',10013,'2020-06-26'), (91,'the Finch','Clinton Hill','Brooklyn',11238,'2020-06-26'), (92,'First Lamb Shabu','East Village','Manhattan',10003,'2020-06-26'), (93,'Chubby Princess','Financial District','Manhattan',10038,'2020-06-26'), (94,'Xi’an Famous Foods','Greenpoint','Brooklyn',11222,'2020-06-26'), (95,'Bonsai Kakigori','Lower East Side','Manhattan',10002,'2020-06-26'), (96,'The Way Station','Prospect Heights','Brooklyn',11238,'2020-06-26'), (97,'Cocotte','SoHo','Manhattan',10012,'2020-06-26'), (98,'The Cupping Room Cafe','SoHo','Manhattan',10013,'2020-06-26'), (99,'McDonald’s','Times Square','Manhattan',10036,'2020-06-26'), (100,'Bedford Cheese Shop','Williamsburg','Brooklyn',11211,'2020-06-26'), (101,'Brooklyn Cider House','Bushwick','Brooklyn',11237,'2020-06-18'), (102,'Gohan-Ya','Chinatown','Manhattan',10002,'2020-06-18'), (103,'Urban Vintage','Clinton Hill','Brooklyn',11238,'2020-06-18'), (104,'Violet','East Village','Manhattan',10009,'2020-06-18'), (105,'the Trading Post','Financial District','Manhattan',10038,'2020-06-18'), (106,'Nix','Greenwich Village','Manhattan',10003,'2020-06-18'), (107,'Raviolo','Greenwich Village','Manhattan',10014,'2020-06-18'), (108,'Sugar Factory American Brasserie','Meatpacking District','Manhattan',10014,'2020-06-18'), (109,'Aquagrill','SoHo','Manhattan',10012,'2020-06-18'), (110,'Peri Ela','Upper East Side','Manhattan',10128,'2020-06-18'), (111,'Oxbow Tavern','Upper West Side','Manhattan',10023,'2020-06-18'), (112,'Hudson Cafe','West Village','Manhattan',10014,'2020-06-18'), (113,'Zagara','Chelsea','Manhattan',10011,'2020-06-05'), (114,'The Forest Hills Diner','Forest Hills','Queens',11375,'2020-06-05'), (115,'Jack and Nellie’s','Forest Hills','Queens',11375,'2020-06-05'), (116,'RDV','Harlem','Manhattan',10026,'2020-06-05'), (117,'Hakata Tonton','West Village','Manhattan',10014,'2020-06-05'), (118,'Highlands','West Village','Manhattan',10014,'2020-06-05'), (119,'Copacabana','Midtown','Manhattan',10036,'2020-05-29'), (120,'Terrace Restaurant','Times Square','Manhattan',10036,'2020-05-29'), (121,'the Outdoor Gardens','Times Square','Manhattan',10036,'2020-05-29'), (122,'701West','Times Square','Manhattan',10036,'2020-05-29'), (123,'Vietspot','Tribeca','Manhattan',10013,'2020-05-29'), (124,'Takashi','West Village','Manhattan',10014,'2020-05-29'), (125,'Blenheim','West Village','Manhattan',10014,'2020-05-29'), (126,'Schnippers','Tribeca','Manhattan',10007,'2020-05-22'), (127,'Bistro Cassis','Upper West Side','Manhattan',10023,'2020-05-22'), (128,'Effy’s','Upper West Side','Manhattan',10025,'2020-05-22'), (129,'Toro NYC','Chelsea','Manhattan',10011,'2020-05-15'), (130,'Jewel Bako','East Village','Manhattan',10003,'2020-05-15'), (131,'Wolf and Lamb Steakhouse','Flatbush','Brooklyn',11230,'2020-05-15'), (132,'Greene Grape Annex','Fort Greene','Brooklyn',11217,'2020-05-15'), (133,'Cherry Point','Greenpoint','Brooklyn',11222,'2020-05-15'), (134,'Dig','Hudson Square','Manhattan',10014,'2020-05-15'), (135,'Blue Ribbon Fried Chicken','Park Slope','Brooklyn',11215,'2020-05-15'), (136,'Beyoglu','Upper East Side','Manhattan',10028,'2020-05-15'), (137,'Coogan’s','Washington Heights','Manhattan',10032,'2020-05-15'), (138,'the Aviary','Columbus Circle','Manhattan',10023,'2020-05-08'), (139,'the Office','Columbus Circle','Manhattan',10023,'2020-05-08'), (140,'Gem Spa','East Village','Manhattan',10003,'2020-05-08'), (141,'the Paris Cafe','Financial District','Manhattan',10038,'2020-05-08'), (142,'The Irish Cottage','Forest Hills','Queens',11375,'2020-05-08'), (143,'Gotham Bar and Grill','Greenwich Village','Manhattan',10003,'2020-05-08'), (144,'Randall’s','Lower East Side','Manhattan',10002,'2020-05-08'), (145,'Woodhaven House','Rego Park','Queens',11374,'2020-05-08'), (146,'Lucky Strike','SoHo','Manhattan',10013,'2020-05-08'), (147,'Pegu Club','SoHo','Manhattan',10012,'2020-05-08'), (148,'Daddy-O','West Village','Manhattan',10014,'2020-05-08'), (149,'Gimme Coffee','Williamsburg','Brooklyn',11211,'2020-05-08'), (150,'Gimme Coffee','Nolita','Manhattan',10012,'2020-05-08');
true
ba555bcfa2ec5eb0f38ecf8a51a004e7519ee1b8
SQL
vsolv/BigFin
/Bigflow/DB/SPS/FA/sp_FALocation_Set.sql
UTF-8
4,389
3.109375
3
[]
no_license
CREATE DEFINER=`developer`@`%` PROCEDURE `sp_FALocation_Set`(IN `ls_Action` varchar(32),IN `ls_Type` varchar(32), IN `ls_Sub_Type` varchar(32),IN `lj_Details` json,IN `lj_Classification` json, IN `ls_Createby` varchar(32),OUT `Message` varchar(1024)) sp_FALocation_Set:BEGIN #### Bala Oct 15 2019 declare Query_Insert varchar(9000); declare Query_Update varchar(9000); Declare errno int; Declare msg varchar(1000); declare countRow int; Declare i int; DECLARE EXIT HANDLER FOR SQLEXCEPTION,sqlwarning BEGIN GET CURRENT DIAGNOSTICS CONDITION 1 errno = MYSQL_ERRNO, msg = MESSAGE_TEXT; set Message = concat(errno , msg); ROLLBACK; END; if ls_Action='INSERT' and ls_Type = 'FA_LOCATION' and ls_Sub_Type = 'FA_LOCATION' then select JSON_LENGTH(lj_Details,'$') into @li_Detailjson_count; if @li_Detailjson_count is null or @li_Detailjson_count = 0 then set Message = 'No Data In Json - FA Location.'; leave sp_FALocation_Set; end if; select JSON_UNQUOTE(JSON_EXTRACT(lj_Details, CONCAT('$.Ref_Gid'))) into @Ref_Gid; select JSON_UNQUOTE(JSON_EXTRACT(lj_Details, CONCAT('$.RefTable_Gid'))) into @RefTable_Gid; select JSON_UNQUOTE(JSON_EXTRACT(lj_Details, CONCAT('$.Location_Name'))) into @Location_Name; select JSON_UNQUOTE(JSON_EXTRACT(lj_Details, CONCAT('$.Location_Floor'))) into @Location_Floor; select JSON_UNQUOTE(JSON_EXTRACT(lj_Details, CONCAT('$.Remarks'))) into @Remarks; select JSON_UNQUOTE(JSON_EXTRACT(lj_Classification, CONCAT('$.Entity_Gid'))) into @Entity_Gid; set @Duplicate_Location=''; SELECT EXISTS(select assetlocation_refgid from fa_mst_tassetloaction where assetlocation_refgid=@Ref_Gid and assetlocation_reftablegid=@RefTable_Gid and assetlocation_name=@Location_Name and assetlocation_floor=@Location_Floor and assetlocation_remarks=@Remarks) into @Duplicate_Location; if @Duplicate_Location=1 then set Message = 'This "Location" Is Already Exist'; leave sp_FALocation_Set; End if; if @Entity_Gid is null or @Entity_Gid = 0 or @Entity_Gid = '' then set Message = 'Entity Gid Is Needed.'; leave sp_FALocation_Set; End if; if @Ref_Gid is null or @Ref_Gid = '' then set Message = 'Ref_Gid Is Needed.'; leave sp_FALocation_Set; End if; if @RefTable_Gid is null or @RefTable_Gid = '' then set Message = 'RefTable_Gid Is Needed.'; leave sp_FALocation_Set; End if; if @Location_Name is null or @Location_Name = '' then set Message = 'Location_Name Is Needed.'; leave sp_FALocation_Set; End if; if @Location_Floor is null or @Location_Floor = '' then set Message = 'Location_Floor Is Needed.'; leave sp_FALocation_Set; End if; if @Remarks is null or @Remarks = '' then set Message = 'Remarks Is Needed.'; leave sp_FALocation_Set; End if; set Query_Insert = ''; set Query_Insert = concat('INSERT INTO fa_mst_tassetloaction (assetlocation_refgid,assetlocation_reftablegid, assetlocation_name,assetlocation_floor, assetlocation_remarks,entity_gid,create_by ) VALUES (''',@Ref_Gid,''', ''',@RefTable_Gid,''', ''',@Location_Name,''', ''',@Location_Floor,''', ''',@Remarks,''',''',@Entity_Gid,''',''',ls_Createby,''')'); set @Insert_query = Query_Insert; #SELECT @Insert_query; PREPARE stmt FROM @Insert_query; EXECUTE stmt; set countRow = (select ROW_COUNT()); DEALLOCATE PREPARE stmt; if countRow > 0 then select LAST_INSERT_ID() into @Loaction_Maxgid ; set Message = 'SUCCESS'; else set Message = 'FAIL'; End if; End if; END
true
ac0f3ac9a605c9676d8a8cffecb73373c776753e
SQL
Artyonnn/Lab6
/BDLAB6/scrip3.sql
UTF-8
2,272
3.09375
3
[]
no_license
create or replace procedure deporeti( p_cod_sucursal transadeporeti.COD_SUCURSAL%type, p_id_transadeporeti transadeporeti.id_transadeporeti%type, p_id_c transadeporeti.id_C%type, p_tipo_de_ahorro transadeporeti.tipo_de_ahorro%type, p_tipo_de_transaccion transadeporeti.tipo_de_transaccion%type, p_monto_deposito_retiro transadeporeti.monto_deposito_retiro%type, P_mensaje out varchar2)as begin p_mensaje:='Proceso ejecutado con exito'; INSERT INTO transadeporeti(cod_sucursal,id_transadeporeti,id_C,tipo_de_ahorro,fecha_transaccion,tipo_de_transaccion,monto_deposito_retiro,fecha_insercion,usuario) VALUES(p_cod_sucursal,p_id_transadeporeti,p_ID_C,p_tipo_de_ahorro,sysdate,p_tipo_de_transaccion,p_monto_deposito_retiro,sysdate,user); EXCEPTION WHEN dup_val_on_index THEN p_mensaje:='Este valor ya estaba'; WHEN others THEN p_mensaje:='No se ha creado el registro...'; COMMIT; end deporeti; / /* bloque anonimo problema 3*/ SET serveroutput ON declare v_cod_sucursal number:=1; v_id_transadeporeti number:=2; v_id_c number:=1; v_tipo_de_ahorro number:=1; v_tipo_de_transaccion number:=1; v_monto_deposito_retiro number:=50; v_mensaje varchar2(50); Begin deporeti(v_cod_sucursal,v_id_transadeporeti,v_id_c,v_tipo_de_ahorro,v_tipo_de_transaccion,v_monto_deposito_retiro,v_mensaje); DBMS_output.put_line(v_mensaje); end; / /* bloque anonimo problema 3*/ SET serveroutput ON declare v_cod_sucursal number:=2; v_id_transadeporeti number:=3; v_id_c number:=2; v_tipo_de_ahorro number:=2; v_tipo_de_transaccion number:=1; v_monto_deposito_retiro number:=50; v_mensaje varchar2(50); Begin deporeti(v_cod_sucursal,v_id_transadeporeti,v_id_c,v_tipo_de_ahorro,v_tipo_de_transaccion,v_monto_deposito_retiro,v_mensaje); DBMS_output.put_line(v_mensaje); end; / /* bloque anonimo problema 3*/ SET serveroutput ON declare v_cod_sucursal number:=2; v_id_transadeporeti number:=1; v_id_c number:=3; v_tipo_de_ahorro number:=3; v_tipo_de_transaccion number:=1; v_monto_deposito_retiro number:=50; v_mensaje varchar2(50); Begin deporeti(v_cod_sucursal,v_id_transadeporeti,v_id_c,v_tipo_de_ahorro,v_tipo_de_transaccion,v_monto_deposito_retiro,v_mensaje); DBMS_output.put_line(v_mensaje); end; /
true
5dfc077c91fdaab4c806ee11c2b37cb41224f36b
SQL
Macslack/record_shop
/db/record_shop.sql
UTF-8
360
3.1875
3
[]
no_license
DROP TABLE albums; DROP TABLE artists; CREATE TABLE artists ( id SERIAL8 primary key, name VARCHAR(255) not null ); CREATE TABLE albums ( id SERIAL8 primary key, name VARCHAR(255) not null, quantity INT8, artist_id INT8 references artists(id) ON DELETE CASCADE, buy_price INT8, sell_price INT8, url VARCHAR(255), genre VARCHAR(255) );
true
a63ea3429fa043443549b3d5cf4666a1919dc7e3
SQL
angusho321/Azure-test
/GroupPay/dbupdate.20190426.sql
UTF-8
699
3.109375
3
[]
no_license
drop table if exists `commission_ratio`; create table `commission_ratio` ( `lbound` int not null, `ubound` int not null, `ratio` double not null, constraint `pk_commission_ratio` primary key (`lbound`, `ubound`) ) engine=InnoDB default charset=utf8mb4; drop table if exists `agency_commission`; create table `agency_commission` ( `user_id` bigint not null, `week` int not null, `revenue` double not null, `commission` double not null, `cashed` bit not null default 0, `cash_time` bigint null, constraint `pk_agency_commission` primary key (`week`, `user_id`), index `idx_agency_commission_uid` (`user_id`) ) engine=InnoDB default charset=utf8mb4;
true
37dc666ec46e3e08f4420f1b40fa815ed5f8dc37
SQL
HaekyungPark/SQL
/SQL/natural_outerJoin.sql
UTF-8
1,006
4.375
4
[]
no_license
-- ANSI Join SQL문 (1991 Syntax) --natural join 테이블의 칼럼 이름이 같으면 자동으로 조인이 걸린다. --조인 대상 테이블에 같은 칼럼이 있는 경우 select * from employees a natural join departments b; -- on a.department_id = b.department_id -- and a.manager_id = b.mamager_id --natural join 은 위 두 문장 생략 select count(*) from employees a join departments b using (department_id); --inner join 표준 SQL문( equi join 표준 SQL문) select count(*) from employees a join departments b on a.DEPARTMENT_ID = b.DEPARTMENT_ID; --equi조인과 동일 --outer join select count(*)--nvl(a.FIRST_NAME,'소속직원이 없음'), b.department_name FROM EMPLOYEES a right join DEPARTMENTS b on a.DEPARTMENT_ID = b.DEPARTMENT_ID; select count(*)--a.FIRST_NAME, nvl(b.department_name, '부서가 없음') FROM EMPLOYEES a left join DEPARTMENTS b on a.DEPARTMENT_ID = b.DEPARTMENT_ID;
true
47df60195c26e7437a6fd8c3c8801f4357ebbbdb
SQL
nsky1618/safeLogin
/sql/users.sql
UTF-8
2,371
3.234375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Nov 21, 2020 at 02:06 PM -- Server version: 10.4.13-MariaDB -- PHP Version: 7.4.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `wp_login` -- -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(25) NOT NULL, `userId` varchar(50) NOT NULL, `token` varchar(70) NOT NULL, `confirmation` varchar(1) NOT NULL DEFAULT '0', `fname` varchar(50) NOT NULL, `lname` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `username` varchar(50) NOT NULL, `password` varchar(100) NOT NULL, `registerDate` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `userId`, `token`, `confirmation`, `fname`, `lname`, `email`, `username`, `password`, `registerDate`) VALUES (27, 'user17050', '76db511ae1cb29746fb2cf9cf098d436', '1', 'ff', 'ff', 'f@f.com', 'ff', '$2y$12$M47an/DF70fFN153AfwHfeUcyIDbRXYGMjScPY516n3ixIiRJ83bC', '2020-11-09'), (28, 'user51495', 'ac4671c92e6d1ba3591e26209a34e508', '0', 'tt', 'tt', 't@t.com', 'tt', '$2y$12$vQXdd0wS1/kEbM2vKWpqNebQbUySQJ/yUXsP8AEWRMMnL/DvaSpWy', '2020-11-13'), (29, 'user99349', '771680071227e02839893ea622d63987', '1', 'r', 'r', 'r@r.com', 'rr', '$2y$12$KT8TrkRRQ//vYECNq2ppGuycRp4hOW/mYrpqTQneyCY8MAXYR.9tS', '2020-11-20'), (30, 'user78952', '9c9ee1a5054851660dd00d6d0271a652', '0', 'yy', 'y', 'y@y.com', 'yy', '$2y$12$moGLMTNxWKloXngNTi45IeI7uWPInp43QqZOKAYQGgDLjf9Lj5QTO', '2020-11-21'); -- -- Indexes for dumped tables -- -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(25) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
d4d407402306d8416c0a9382c18f8e3b3a083de0
SQL
tommy8137/importwsdepro
/backEnd/db-migrate/migrates/sqls/20200529020547-metal-dt-aio-voip-server-painting-up.sql
UTF-8
122,708
3.5
4
[]
no_license
CREATE TABLE if not exists formula.metal_paint_color ( id uuid not null DEFAULT uuid_generate_v1(), color_name varchar(200) not null, remark varchar(400) null, create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_color_pk PRIMARY KEY (id), CONSTRAINT metal_paint_color_un UNIQUE (color_name) ); CREATE TABLE if not exists formula.metal_paint_type ( id uuid not null DEFAULT uuid_generate_v1(), type_name varchar(200) not null, remark varchar(400) null, create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_type_pk PRIMARY KEY (id), CONSTRAINT metal_paint_type_un UNIQUE (type_name) ); CREATE TABLE if not exists formula.metal_paint_machine ( id uuid not null DEFAULT uuid_generate_v1(), machine_name varchar(200) not null, remark varchar(400) null, create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_machine_pk PRIMARY KEY (id), CONSTRAINT metal_paint_machine_un UNIQUE (machine_name) ); CREATE TABLE if not exists formula.metal_paint_bottom_top ( id uuid not null DEFAULT uuid_generate_v1(), bottom_top_name varchar(200) not null, remark varchar(400) null, create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_bottom_top_pk PRIMARY KEY (id), CONSTRAINT metal_paint_bottom_top_un UNIQUE (bottom_top_name) ); CREATE TABLE if not exists formula.metal_paint_vendor ( id uuid not null DEFAULT uuid_generate_v1(), vendor_name varchar(200) not null, remark varchar(400) null, create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_vendor_pk PRIMARY KEY (id), CONSTRAINT metal_paint_vendor_un UNIQUE (vendor_name) ); CREATE TABLE if not exists formula.metal_paint_type_color ( id uuid not null DEFAULT uuid_generate_v1(), paint_color_id uuid not null, paint_type_id uuid not null, create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_type_color_pk PRIMARY KEY (id), CONSTRAINT metal_paint_type_color_un UNIQUE (paint_color_id,paint_type_id), CONSTRAINT metal_paint_type_color_fk FOREIGN KEY (paint_color_id) REFERENCES formula.metal_paint_color(id), CONSTRAINT metal_paint_type_color_fk1 FOREIGN KEY (paint_type_id) REFERENCES formula.metal_paint_type(id) ); CREATE TABLE if not exists formula.metal_paint_type_color_bottom_top ( id uuid not null DEFAULT uuid_generate_v1(), paint_type_color_id uuid not null, paint_bottom_top_id uuid not null, create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_type_color_bottom_top_pk PRIMARY KEY (id), CONSTRAINT metal_paint_type_color_bottom_top_un UNIQUE (paint_type_color_id,paint_bottom_top_id), CONSTRAINT metal_paint_type_color_bottom_top_fk FOREIGN KEY (paint_type_color_id) REFERENCES formula.metal_paint_type_color(id), CONSTRAINT metal_paint_type_color_bottom_top_fk1 FOREIGN KEY (paint_bottom_top_id) REFERENCES formula.metal_paint_bottom_top(id) ); CREATE TABLE if not exists formula.metal_paint_vendor_type_color_bottom_top ( id uuid not null DEFAULT uuid_generate_v1(), type_color_bottom_top_id uuid not null, paint_vendor_id uuid not null, create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_vendor_type_color_bottom_top_pk PRIMARY KEY (id), CONSTRAINT metal_paint_vendor_type_color_bottom_top_un UNIQUE (type_color_bottom_top_id,paint_vendor_id), CONSTRAINT metal_paint_vendor_type_color_bottom_top_fk FOREIGN KEY (type_color_bottom_top_id) REFERENCES formula.metal_paint_type_color_bottom_top(id), CONSTRAINT metal_paint_vendor_type_color_bottom_top_fk1 FOREIGN KEY (paint_vendor_id) REFERENCES formula.metal_paint_vendor(id) ); CREATE TABLE if not exists formula.metal_paint_formula_type ( id uuid NOT NULL DEFAULT uuid_generate_v1(), label varchar(200) NOT NULL, label_name varchar(200) NULL, field_type varchar(200) NULL, data_type varchar(200) NULL, create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_formula_type_pk PRIMARY KEY (id), CONSTRAINT metal_paint_formula_type_un UNIQUE (label) ); CREATE TABLE if not exists formula.metal_paint_formula ( id uuid NOT NULL DEFAULT uuid_generate_v1(), type_id uuid NOT NULL, paint_id uuid NOT NULL, create_time timestamptz NOT NULL DEFAULT now(), CONSTRAINT metal_paint_formula_pk PRIMARY KEY (id), CONSTRAINT metal_paint_formula_un UNIQUE (type_id, paint_id), CONSTRAINT metal_paint_formula_fk_paint FOREIGN KEY (paint_id) REFERENCES formula.metal_paint_vendor_type_color_bottom_top(id), CONSTRAINT metal_paint_formula_fk_type FOREIGN KEY (type_id) REFERENCES formula.metal_paint_formula_type(id) ); CREATE TABLE if not exists formula.metal_paint_man_power ( id uuid not null DEFAULT uuid_generate_v1(), product_type_id int4 not null, category_name varchar(200) not null, create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_man_power_pk PRIMARY KEY (id), CONSTRAINT metal_paint_man_power_un UNIQUE (product_type_id,category_name), CONSTRAINT metal_paint_type_product_type_fk FOREIGN KEY (product_type_id) REFERENCES formula.product_type(id) ); CREATE TABLE if not exists formula.metal_paint_info ( id uuid not null DEFAULT uuid_generate_v1(), product_type_id int4 not null, usd_min uuid not null DEFAULT uuid_generate_v1(), man_hour uuid not null DEFAULT uuid_generate_v1(), create_time timestamptz NOT NULL DEFAULT now(), disable_time timestamptz NULL, CONSTRAINT metal_paint_info_pk PRIMARY KEY (id), CONSTRAINT metal_paint_info_un UNIQUE (product_type_id), CONSTRAINT metal_paint_info_fk FOREIGN KEY (product_type_id) REFERENCES formula.product_type(id) ); INSERT INTO formula.metal_paint_color (color_name) VALUES('一般或霧面(黑/灰/銀)'),('彩色或高光(金/紅/藍)'),('Soft Touch'),('N/A'),('粉烤砂紋漆'),('粉烤平光漆'),('粉烤消光漆'); INSERT INTO formula.metal_paint_type (type_name) VALUES('PU_painting'),('Rubber_painting'),('NCVM'),('UV_painting'),('Powder coating'); INSERT INTO formula.metal_paint_bottom_top (bottom_top_name) VALUES('底漆'),('面漆'); INSERT INTO formula.metal_paint_vendor (vendor_name) VALUES('Akzo'),('歐歷'),('東瑞'),('協承昌'),('新政豐'),('台贏'),('皇冠'),('PPG'),('Others'); INSERT INTO formula.metal_paint_machine (machine_name) VALUES('往復機'),('SPINDLE'),('ABB_ROBOT'),('蒸鍍'),('N/A'); -- metal_paint_machine parameter value INSERT INTO formula.parameter_value(parameter_id, activate_date_id, value, value_type, source_table) select mpm.id, sch.id, '0.1484', 'number', 'metal_paint_machine' from formula.metal_paint_machine as mpm inner join formula.schedule_date as sch on sch.formula_type_id = (SELECT id FROM formula.formula_type WHERE name= 'housing_metal') and sch.product_type_id is null where mpm.machine_name = '往復機' ON conflict do nothing; INSERT INTO formula.parameter_value(parameter_id, activate_date_id, value, value_type, source_table) select mpm.id, sch.id, '0.2077', 'number', 'metal_paint_machine' from formula.metal_paint_machine as mpm inner join formula.schedule_date as sch on sch.formula_type_id = (SELECT id FROM formula.formula_type WHERE name= 'housing_metal') and sch.product_type_id is null where mpm.machine_name = 'SPINDLE' ON conflict do nothing; INSERT INTO formula.parameter_value(parameter_id, activate_date_id, value, value_type, source_table) select mpm.id, sch.id, '0.2077', 'number', 'metal_paint_machine' from formula.metal_paint_machine as mpm inner join formula.schedule_date as sch on sch.formula_type_id = (SELECT id FROM formula.formula_type WHERE name= 'housing_metal') and sch.product_type_id is null where mpm.machine_name = 'ABB_ROBOT' ON conflict do nothing; INSERT INTO formula.parameter_value(parameter_id, activate_date_id, value, value_type, source_table) select mpm.id, sch.id, '0.09', 'number', 'metal_paint_machine' from formula.metal_paint_machine as mpm inner join formula.schedule_date as sch on sch.formula_type_id = (SELECT id FROM formula.formula_type WHERE name= 'housing_metal') and sch.product_type_id is null where mpm.machine_name = '蒸鍍' ON conflict do nothing; INSERT INTO formula.parameter_value(parameter_id, activate_date_id, value_type, source_table) select mpm.id, sch.id, 'number', 'metal_paint_machine' from formula.metal_paint_machine as mpm inner join formula.schedule_date as sch on sch.formula_type_id = (SELECT id FROM formula.formula_type WHERE name= 'housing_metal') and sch.product_type_id is null where mpm.machine_name = 'N/A' ON conflict do nothing; -- init metal_paint_type_color INSERT INTO formula.metal_paint_type_color (paint_color_id, paint_type_id) VALUES((select id from formula.metal_paint_color where color_name = '一般或霧面(黑/灰/銀)'),(select id from formula.metal_paint_type where type_name = 'UV_painting' )), ((select id from formula.metal_paint_color where color_name = '彩色或高光(金/紅/藍)'),(select id from formula.metal_paint_type where type_name = 'UV_painting' )), ((select id from formula.metal_paint_color where color_name = 'Soft Touch'),(select id from formula.metal_paint_type where type_name = 'UV_painting')), ((select id from formula.metal_paint_color where color_name = 'N/A'),(select id from formula.metal_paint_type where type_name = 'UV_painting')), ((select id from formula.metal_paint_color where color_name = 'N/A'),(select id from formula.metal_paint_type where type_name = 'PU_painting')), ((select id from formula.metal_paint_color where color_name = 'N/A'),(select id from formula.metal_paint_type where type_name = 'Rubber_painting')), ((select id from formula.metal_paint_color where color_name = 'N/A'),(select id from formula.metal_paint_type where type_name = 'NCVM')), ((select id from formula.metal_paint_color where color_name = 'N/A'),(select id from formula.metal_paint_type where type_name = 'Powder coating')), ((select id from formula.metal_paint_color where color_name = '粉烤砂紋漆'),(select id from formula.metal_paint_type where type_name = 'Powder coating')), ((select id from formula.metal_paint_color where color_name = '粉烤平光漆'),(select id from formula.metal_paint_type where type_name = 'Powder coating')), ((select id from formula.metal_paint_color where color_name = '粉烤消光漆'),(select id from formula.metal_paint_type where type_name = 'Powder coating')); -- init metal_paint_type_color_bottom_top INSERT INTO formula.metal_paint_type_color_bottom_top (paint_type_color_id, paint_bottom_top_id) select mptc.id, mpbt.id from formula.metal_paint_type_color as mptc inner join formula.metal_paint_bottom_top as mpbt on mpbt.bottom_top_name = '底漆' where mptc.paint_type_id =(select id from formula.metal_paint_type where type_name = 'Rubber_painting') on conflict do nothing; INSERT INTO formula.metal_paint_type_color_bottom_top (paint_type_color_id, paint_bottom_top_id) select mptc.id, mpbt.id from formula.metal_paint_type_color as mptc inner join formula.metal_paint_bottom_top as mpbt on mpbt.bottom_top_name = '面漆' where mptc.paint_type_id =(select id from formula.metal_paint_type where type_name = 'Rubber_painting') on conflict do nothing; INSERT INTO formula.metal_paint_type_color_bottom_top (paint_type_color_id, paint_bottom_top_id) select mptc.id, mpbt.id from formula.metal_paint_type_color as mptc inner join formula.metal_paint_bottom_top as mpbt on mpbt.bottom_top_name = '底漆' where mptc.paint_type_id =(select id from formula.metal_paint_type where type_name = 'PU_painting') on conflict do nothing; INSERT INTO formula.metal_paint_type_color_bottom_top (paint_type_color_id, paint_bottom_top_id) select mptc.id, mpbt.id from formula.metal_paint_type_color as mptc inner join formula.metal_paint_bottom_top as mpbt on mpbt.bottom_top_name = '面漆' where mptc.paint_type_id =(select id from formula.metal_paint_type where type_name = 'PU_painting') on conflict do nothing; INSERT INTO formula.metal_paint_type_color_bottom_top (paint_type_color_id, paint_bottom_top_id) select mptc.id, mpbt.id from formula.metal_paint_type_color as mptc inner join formula.metal_paint_bottom_top as mpbt on mpbt.bottom_top_name = '底漆' where mptc.paint_type_id =(select id from formula.metal_paint_type where type_name = 'NCVM') on conflict do nothing; INSERT INTO formula.metal_paint_type_color_bottom_top (paint_type_color_id, paint_bottom_top_id) select mptc.id, mpbt.id from formula.metal_paint_type_color as mptc inner join formula.metal_paint_bottom_top as mpbt on mpbt.bottom_top_name = '面漆' where mptc.paint_type_id =(select id from formula.metal_paint_type where type_name = 'NCVM') on conflict do nothing; INSERT INTO formula.metal_paint_type_color_bottom_top (paint_type_color_id, paint_bottom_top_id) select mptc.id, mpbt.id from formula.metal_paint_type_color as mptc inner join formula.metal_paint_bottom_top as mpbt on mpbt.bottom_top_name = '底漆' where mptc.paint_type_id =(select id from formula.metal_paint_type where type_name = 'UV_painting') on conflict do nothing; INSERT INTO formula.metal_paint_type_color_bottom_top (paint_type_color_id, paint_bottom_top_id) select mptc.id, mpbt.id from formula.metal_paint_type_color as mptc inner join formula.metal_paint_bottom_top as mpbt on mpbt.bottom_top_name = '面漆' where mptc.paint_type_id =(select id from formula.metal_paint_type where type_name = 'UV_painting') on conflict do nothing; INSERT INTO formula.metal_paint_type_color_bottom_top (paint_type_color_id, paint_bottom_top_id) select mptc.id, mpbt.id from formula.metal_paint_type_color as mptc inner join formula.metal_paint_bottom_top as mpbt on mpbt.bottom_top_name = '底漆' where mptc.paint_type_id =(select id from formula.metal_paint_type where type_name = 'Powder coating') on conflict do nothing; INSERT INTO formula.metal_paint_type_color_bottom_top (paint_type_color_id, paint_bottom_top_id) select mptc.id, mpbt.id from formula.metal_paint_type_color as mptc inner join formula.metal_paint_bottom_top as mpbt on mpbt.bottom_top_name = '面漆' where mptc.paint_type_id =(select id from formula.metal_paint_type where type_name = 'Powder coating') on conflict do nothing; -- 噴漆總成 metal_paint_vendor_type_color_bottom_top -- PU_painting 底漆 INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- Rubber painting 底漆 INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- NCVM 底漆 INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '底漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- PU_painting 面漆 INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='PU_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- Rubber_painting 面漆 INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Rubber_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- NCVM 面漆 INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='NCVM') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- UV_painting 面漆 INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '一般或霧面(黑/灰/銀)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '一般或霧面(黑/灰/銀)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '一般或霧面(黑/灰/銀)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '一般或霧面(黑/灰/銀)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '一般或霧面(黑/灰/銀)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '一般或霧面(黑/灰/銀)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '一般或霧面(黑/灰/銀)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '一般或霧面(黑/灰/銀)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '一般或霧面(黑/灰/銀)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- UV_painting 面漆 彩色或高光(金/紅/藍) INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '彩色或高光(金/紅/藍)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '彩色或高光(金/紅/藍)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '彩色或高光(金/紅/藍)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '彩色或高光(金/紅/藍)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '彩色或高光(金/紅/藍)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '彩色或高光(金/紅/藍)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '彩色或高光(金/紅/藍)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '彩色或高光(金/紅/藍)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '彩色或高光(金/紅/藍)') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- UV_painting 面漆 Soft Touch INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'Soft Touch') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'Soft Touch') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'Soft Touch') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'Soft Touch') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'Soft Touch') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'Soft Touch') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'Soft Touch') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'Soft Touch') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'Soft Touch') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- UV_painting 面漆 N/A INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='UV_painting') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- Powder coating 面漆 N/A INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = 'N/A') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- Powder coating 面漆 N/A INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤砂紋漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤砂紋漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤砂紋漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤砂紋漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤砂紋漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤砂紋漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤砂紋漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤砂紋漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤砂紋漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- Powder coating 面漆 N/A INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤平光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤平光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤平光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤平光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤平光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤平光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤平光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤平光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤平光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- Powder coating 面漆 N/A INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤消光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Akzo')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤消光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '歐歷')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤消光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '東瑞')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤消光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '協承昌')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤消光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '新政豐')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤消光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '台贏')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤消光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = '皇冠')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤消光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'PPG')); INSERT INTO formula.metal_paint_vendor_type_color_bottom_top (type_color_bottom_top_id, paint_vendor_id) VALUES((select id from formula.metal_paint_type_color_bottom_top where paint_bottom_top_id = (select id from formula.metal_paint_bottom_top where bottom_top_name = '面漆') and paint_type_color_id = (select id from formula.metal_paint_type_color where paint_color_id =(select id from formula.metal_paint_color where color_name = '粉烤消光漆') and paint_type_id = (select id from formula.metal_paint_type where type_name ='Powder coating') ) ),(select id from formula.metal_paint_vendor where vendor_name = 'Others')); -- 噴漆組成 insert into formula.metal_paint_formula_type (label, label_name, field_type, data_type) values ( 'main_unit_price', '主劑單價(USD/Kg)', 'input', 'float'), ( 'main_amount', '主劑比例', 'input', 'float'), ( 'hardener_unit_price', '硬化劑/固化劑單價(USD/Kg)', 'input', 'float'), ( 'hardener_amount', '硬化劑/固化劑比例', 'input', 'float'), ( 'solvent_unit_price', '溶劑/稀釋劑單價(USD/Kg)', 'input', 'float'), ( 'solvent_amount', '溶劑/稀釋劑比例', 'input', 'float') on conflict do nothing; insert into formula.metal_paint_formula (type_id, paint_id) select mpft.id, paint.id from formula.metal_paint_formula_type mpft, formula.metal_paint_vendor_type_color_bottom_top paint; -- 噴漆膜厚 INSERT INTO formula.me_spec (spec_category, spec_name, spec_value) VALUES ('metal_paint_thickness', '0', '0'), ('metal_paint_thickness', '10', '10'), ('metal_paint_thickness', '11', '11'), ('metal_paint_thickness', '12', '12'), ('metal_paint_thickness', '13', '13'), ('metal_paint_thickness', '14', '14'), ('metal_paint_thickness', '15', '15'), ('metal_paint_thickness', '16', '16'), ('metal_paint_thickness', '17', '17'), ('metal_paint_thickness', '18', '18'), ('metal_paint_thickness', '19', '19'), ('metal_paint_thickness', '20', '20'), ('metal_paint_thickness', '21', '21'), ('metal_paint_thickness', '22', '22'), ('metal_paint_thickness', '23', '23'), ('metal_paint_thickness', '24', '24'), ('metal_paint_thickness', '25', '25'), ('metal_paint_thickness', '80', '80'); -- man power INSERT INTO formula.metal_paint_man_power (product_type_id, category_name) select id, 'Metal' from formula.product_type pt where pt.type_name in ('DT', 'AIO', 'Server', 'VoIP'); INSERT INTO formula.metal_paint_man_power (product_type_id, category_name) select id, 'Aluminum' from formula.product_type pt where pt.type_name in ('DT', 'AIO', 'Server', 'VoIP'); INSERT INTO formula.parameter_value (parameter_id, activate_date_id, value, value_type, source_table) select a.id, b.id, '12', 'number', 'metal_paint_man_power' from (select id from formula.metal_paint_man_power pmp where pmp.category_name = 'Metal') a, (select id from formula.schedule_date sd where sd.formula_type_id= (SELECT id FROM formula.formula_type WHERE name ='housing_metal') and sd.product_type_id is null) b; INSERT INTO formula.parameter_value (parameter_id, activate_date_id, value, value_type, source_table) select a.id, b.id, '12', 'number', 'metal_paint_man_power' from (select id from formula.metal_paint_man_power pmp where pmp.category_name = 'Aluminum') a, (select id from formula.schedule_date sd where sd.formula_type_id= (SELECT id FROM formula.formula_type WHERE name ='housing_metal') and sd.product_type_id is null) b; -- paint info INSERT INTO formula.metal_paint_info (product_type_id) select pt.id from formula.product_type pt where pt.type_name in ('DT','AIO','Server','VoIP'); -- usd_min INSERT INTO formula.parameter_value (parameter_id, activate_date_id, value, value_type, source_table) select mpi.usd_min, sch.id, '0.06', 'number', 'metal_paint_info' from formula.metal_paint_info as mpi inner join formula.schedule_date as sch on sch.formula_type_id= (SELECT id FROM formula.formula_type WHERE name ='housing_metal') and sch.product_type_id is null where mpi.product_type_id = (select id from formula.product_type where type_name = 'DT' ); INSERT INTO formula.parameter_value (parameter_id, activate_date_id, value, value_type, source_table) select mpi.usd_min, sch.id, '0.06', 'number', 'metal_paint_info' from formula.metal_paint_info as mpi inner join formula.schedule_date as sch on sch.formula_type_id= (SELECT id FROM formula.formula_type WHERE name ='housing_metal') and sch.product_type_id is null where mpi.product_type_id = (select id from formula.product_type where type_name = 'AIO' ); INSERT INTO formula.parameter_value (parameter_id, activate_date_id, value, value_type, source_table) select mpi.usd_min, sch.id, '0.06', 'number', 'metal_paint_info' from formula.metal_paint_info as mpi inner join formula.schedule_date as sch on sch.formula_type_id= (SELECT id FROM formula.formula_type WHERE name ='housing_metal') and sch.product_type_id is null where mpi.product_type_id = (select id from formula.product_type where type_name = 'Server' ); INSERT INTO formula.parameter_value (parameter_id, activate_date_id, value, value_type, source_table) select mpi.usd_min, sch.id, '0.06', 'number', 'metal_paint_info' from formula.metal_paint_info as mpi inner join formula.schedule_date as sch on sch.formula_type_id= (SELECT id FROM formula.formula_type WHERE name ='housing_metal') and sch.product_type_id is null where mpi.product_type_id = (select id from formula.product_type where type_name = 'VoIP' ); --man_hour INSERT INTO formula.parameter_value (parameter_id, activate_date_id, value, value_type, source_table) select mpi.man_hour, sch.id, '8', 'number', 'metal_paint_info' from formula.metal_paint_info as mpi inner join formula.schedule_date as sch on sch.formula_type_id= (SELECT id FROM formula.formula_type WHERE name ='housing_metal') and sch.product_type_id is null where mpi.product_type_id = (select id from formula.product_type where type_name = 'DT' ); INSERT INTO formula.parameter_value (parameter_id, activate_date_id, value, value_type, source_table) select mpi.man_hour, sch.id, '8', 'number', 'metal_paint_info' from formula.metal_paint_info as mpi inner join formula.schedule_date as sch on sch.formula_type_id= (SELECT id FROM formula.formula_type WHERE name ='housing_metal') and sch.product_type_id is null where mpi.product_type_id = (select id from formula.product_type where type_name = 'AIO' ); INSERT INTO formula.parameter_value (parameter_id, activate_date_id, value, value_type, source_table) select mpi.man_hour, sch.id, '8', 'number', 'metal_paint_info' from formula.metal_paint_info as mpi inner join formula.schedule_date as sch on sch.formula_type_id= (SELECT id FROM formula.formula_type WHERE name ='housing_metal') and sch.product_type_id is null where mpi.product_type_id = (select id from formula.product_type where type_name = 'Server' ); INSERT INTO formula.parameter_value (parameter_id, activate_date_id, value, value_type, source_table) select mpi.man_hour, sch.id, '8', 'number', 'metal_paint_info' from formula.metal_paint_info as mpi inner join formula.schedule_date as sch on sch.formula_type_id= (SELECT id FROM formula.formula_type WHERE name ='housing_metal') and sch.product_type_id is null where mpi.product_type_id = (select id from formula.product_type where type_name = 'VoIP' ); DROP TABLE IF EXISTS formula.tmp_metal_paint_price; CREATE TABLE if not exists formula.tmp_metal_paint_price ( paint_type varchar(200), bottom_top varchar(200), color varchar(200), vendor varchar(200), main_un varchar (100), main_am varchar (100), hardener_un varchar (100), hardener_am varchar (100), solvent_un varchar (100), solvent_am varchar (100), total_price varchar (100) ); -- 底漆 面漆 -- N/A 一般或霧面(黑/灰/銀) 彩色或高光(金/紅/藍) Soft Touch 粉烤砂紋漆 粉烤平光漆 粉烤消光漆 -- Akzo 歐歷 東瑞 協承昌 新政豐 台贏 皇冠 PPG Others insert into formula.tmp_metal_paint_price (paint_type, bottom_top, color, vendor, main_am, main_un, hardener_am, hardener_un, solvent_am, solvent_un, total_price) values -- ('PU_painting', '底漆', 'N/A', '', '', '', '', '', '', '', ''), ('PU_painting', '底漆', 'N/A', 'Akzo', '100', '14.3077', '5', '20.00', '100', '4.6154', '9.7186'), ('PU_painting', '底漆', 'N/A', '歐歷', '5', '16.7692', '1', '18.4615', '3', '5.3846', '13.1624'), ('PU_painting', '底漆', 'N/A', '東瑞', '7', '10.7692', '1', '18.4616', '7', '3.8462', '8.0513'), ('PU_painting', '底漆', 'N/A', '協承昌', '5', '10.0000', '1', '13.8462', '6', '4.0000', '7.3205'), ('PU_painting', '底漆', 'N/A', '新政豐', '4', '10.9231', '1', '16.9231', '4', '3.3846', '8.2393'), ('PU_painting', '底漆', 'N/A', '台贏', '8', '11.8462', '1', '16.4369', '7', '3.8462', '8.6331'), --('PU_painting', '底漆', 'N/A', '皇冠', '', '', '', '', '', '', ''), --('PU_painting', '底漆', 'N/A', 'PPG', '', '', '', '', '', '', ''), ('PU_painting', '底漆', 'N/A', 'Others', '100', '25.0000', '0', '0', '0', '0', '25.0000'), -- ('Rubber_painting', '底漆', 'N/A', '', '', '', '', '', '', '', ''), ('Rubber_painting', '底漆', 'N/A', 'Akzo', '100', '34.4615', '30', '20.0000', '60', '4.6154', '22.7530'), ('Rubber_painting', '底漆', 'N/A', '歐歷', '10', '10.7692', '1', '18.4615', '15', '5.3846', '7.9586'), ('Rubber_painting', '底漆', 'N/A', '東瑞', '7', '11.5385', '1', '18.4615', '5', '3.8462', '9.1124'), ('Rubber_painting', '底漆', 'N/A', '協承昌', '5', '11.5385', '1', '13.8462', '6', '4.0000', '7.9615'), ('Rubber_painting', '底漆', 'N/A', '新政豐', '1', '9.8462', '0', '0', '1.3', '3.3846', '6.1940'), ('Rubber_painting', '底漆', 'N/A', '台贏', '8', '11.5385', '1', '16.4369', '4', '3.8462', '9.5484'), ('Rubber_painting', '底漆', 'N/A', '皇冠', '10', '9.6923', '1', '14.9231', '11', '4.1538', '7.1608'), --('Rubber_painting', '底漆', 'N/A', 'PPG', '', '', '', '', '', '', ''), ('Rubber_painting', '底漆', 'N/A', 'Others', '100', '35.0000', '0', '0', '0', '0', '35.0000'), -- ('NCVM', '底漆', 'N/A', '', '', '', '', '', '', '', ''), ('NCVM', '底漆', 'N/A', 'Akzo', '100', '14.3077', '5', '20.0000', '100', '4.6154', '9.7186'), ('NCVM', '底漆', 'N/A', '歐歷', '5', '16.7692', '1', '18.4615', '3', '5.3846', '13.1624'), --('NCVM', '底漆', 'N/A', '東瑞', '', '', '', '', '', '', ''), --('NCVM', '底漆', 'N/A', '協承昌', '', '', '', '', '', '', ''), --('NCVM', '底漆', 'N/A', '新政豐', '', '', '', '', '', '', ''), --('NCVM', '底漆', 'N/A', '台贏', '', '', '', '', '', '', ''), --('NCVM', '底漆', 'N/A', '皇冠', '', '', '', '', '', '', ''), --('NCVM', '底漆', 'N/A', 'PPG', '', '', '', '', '', '', ''), ('NCVM', '底漆', 'N/A', 'Others', '100', '25.0000', '0', '0', '0', '0', '25.0000'), -- ('PU_painting', '面漆', 'N/A', '', '', '', '', '', '', '', ''), ('PU_painting', '面漆', 'N/A', 'Akzo', '100', '20.7692', '5', '20.00', '50', '4.6154', '15.5335'), ('PU_painting', '面漆', 'N/A', '歐歷', '5', '16.7692', '1', '18.4615', '3', '5.3846', '13.1624'), ('PU_painting', '面漆', 'N/A', '東瑞', '5', '11.3846', '1', '18.4615', '5', '3.8462', '8.6014'), ('PU_painting', '面漆', 'N/A', '協承昌', '5', '13.8462', '1', '13.8462', '6', '4.0000', '8.9231'), ('PU_painting', '面漆', 'N/A', '新政豐', '4', '10.9231', '1', '16.9231', '4', '3.3846', '8.2393'), ('PU_painting', '面漆', 'N/A', '台贏', '6', '13.0769', '1', '16.4369', '6', '3.8462', '9.0750'), --('PU_painting', '面漆', 'N/A', '皇冠', '', '', '', '', '', '', ''), --('PU_painting', '面漆', 'N/A', 'PPG', '', '', '', '', '', '', ''), ('PU_painting', '面漆', 'N/A', 'Others', '100', '30.0000', '0', '0', '0', '0', '30.0000'), -- ('Rubber_painting', '面漆', 'N/A', '', '', '', '', '', '', '', ''), ('Rubber_painting', '面漆', 'N/A', 'Akzo', '100', '34.4615', '30', '20.0000', '60', '4.6154', '22.7530'), ('Rubber_painting', '面漆', 'N/A', '歐歷', '6', '18.4615', '1', '21.5385', '2', '5.3846', '15.8974'), ('Rubber_painting', '面漆', 'N/A', '東瑞', '5', '18.4615', '1', '18.4615', '3', '3.8462', '13.5897'), ('Rubber_painting', '面漆', 'N/A', '協承昌', '6', '14.7692', '1', '15.3846', '6', '4.0000', '9.8462'), ('Rubber_painting', '面漆', 'N/A', '新政豐', '10', '16.1538', '1.5', '17.6923', '2', '3.3846', '14.4330'), ('Rubber_painting', '面漆', 'N/A', '台贏', '4', '24.4615', '1', '16.4369', '1.5', '3.8462', '18.4696'), ('Rubber_painting', '面漆', 'N/A', '皇冠', '5', '15.8462', '1', '20.6154', '1.5', '4.0000', '14.1128'), --('Rubber_painting', '面漆', 'N/A', 'PPG', '', '', '', '', '', '', ''), ('Rubber_painting', '面漆', 'N/A', 'Others', '100', '35.0000', '0', '0', '0', '0', '35.0000'), -- ('NCVM', '面漆', 'N/A', '', '', '', '', '', '', '', ''), ('NCVM', '面漆', 'N/A', 'Akzo', '100', '20.7692', '5', '20.0000', '50', '4.6154', '15.5335'), ('NCVM', '面漆', 'N/A', '歐歷', '5', '16.7692', '1', '18.4615', '3', '5.3846', '13.1624'), --('NCVM', '面漆', 'N/A', '東瑞', '', '', '', '', '', '', ''), --('NCVM', '面漆', 'N/A', '協承昌', '', '', '', '', '', '', ''), --('NCVM', '面漆', 'N/A', '新政豐', '', '', '', '', '', '', ''), --('NCVM', '面漆', 'N/A', '台贏', '', '', '', '', '', '', ''), --('NCVM', '面漆', 'N/A', '皇冠', '', '', '', '', '', '', ''), --('NCVM', '面漆', 'N/A', 'PPG', '', '', '', '', '', '', ''), ('NCVM', '面漆', 'N/A', 'Others', '100', '30.0000', '0', '0', '0', '0', '30.0000'), -- ('UV_painting', '面漆', '一般或霧面(黑/灰/銀)', '', '', '', '', '', '', '', ''), ('UV_painting', '面漆', '一般或霧面(黑/灰/銀)', 'Akzo', '100', '13.0435', '0', '0', '30', '5.0725', '11.2040'), ('UV_painting', '面漆', '一般或霧面(黑/灰/銀)', '歐歷', '100', '16.4014', '0', '0', '66', '4.5400', '11.6855'), --('UV_painting', '面漆', '一般或霧面(黑/灰/銀)', '東瑞', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '一般或霧面(黑/灰/銀)', '協承昌', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '一般或霧面(黑/灰/銀)', '新政豐', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '一般或霧面(黑/灰/銀)', '台贏', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '一般或霧面(黑/灰/銀)', '皇冠', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '一般或霧面(黑/灰/銀)', 'PPG', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '一般或霧面(黑/灰/銀)', 'Others', '', '', '', '', '', '', ''), -- ('UV_painting', '面漆', '彩色或高光(金/紅/藍)', '', '', '', '', '', '', '', ''), ('UV_painting', '面漆', '彩色或高光(金/紅/藍)', 'Akzo', '100', '28.9855', '0', '0', '30', '5.0725', '23.4671'), ('UV_painting', '面漆', '彩色或高光(金/紅/藍)', '歐歷', '100', '20.2899', '0', '0', '66', '4.5400', '14.0279'), --('UV_painting', '面漆', '彩色或高光(金/紅/藍)', '東瑞', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '彩色或高光(金/紅/藍)', '協承昌', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '彩色或高光(金/紅/藍)', '新政豐', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '彩色或高光(金/紅/藍)', '台贏', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '彩色或高光(金/紅/藍)', '皇冠', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '彩色或高光(金/紅/藍)', 'PPG', '', '', '', '', '', '', ''), --('UV_painting', '面漆', '彩色或高光(金/紅/藍)', 'Others', '', '', '', '', '', '', ''), -- ('UV_painting', '面漆', 'Soft Touch', '', '', '', '', '', '', '', ''), ('UV_painting', '面漆', 'Soft Touch', 'Akzo', '100', '21.7391', '0', '0', '30', '5.0725', '17.8930'), ('UV_painting', '面漆', 'Soft Touch', '歐歷', '100', '26.0870', '0', '0', '66', '4.5400', '17.5201'), --('UV_painting', '面漆', 'Soft Touch', '東瑞', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'Soft Touch', '協承昌', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'Soft Touch', '新政豐', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'Soft Touch', '台贏', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'Soft Touch', '皇冠', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'Soft Touch', 'PPG', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'Soft Touch', 'Others', '', '', '', '', '', '', ''), -- ('UV_painting', '面漆', 'N/A', '', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'N/A', 'Akzo', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'N/A', '歐歷', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'N/A', '東瑞', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'N/A', '協承昌', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'N/A', '新政豐', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'N/A', '台贏', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'N/A', '皇冠', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'N/A', 'PPG', '', '', '', '', '', '', ''), --('UV_painting', '面漆', 'N/A', 'Others', '', '', '', '', '', '', ''), -- ('Powder coating', '面漆', '粉烤砂紋漆', '', '', '', '', '', '', '', ''), ('Powder coating', '面漆', '粉烤砂紋漆', 'Akzo', '100', '5.1500', '0', '0', '0', '0', '5.1500'), --('Powder coating', '面漆', '粉烤砂紋漆', '歐歷', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤砂紋漆', '東瑞', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤砂紋漆', '協承昌', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤砂紋漆', '新政豐', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤砂紋漆', '台贏', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤砂紋漆', '皇冠', '', '', '', '', '', '', ''), ('Powder coating', '面漆', '粉烤砂紋漆', 'PPG', '100', '5.1500', '0', '0', '0', '0', '5.1500'), --('Powder coating', '面漆', '粉烤砂紋漆', 'Others', '', '', '', '', '', '', ''), -- ('Powder coating', '面漆', '粉烤平光漆', '', '', '', '', '', '', '', ''), ('Powder coating', '面漆', '粉烤平光漆', 'Akzo', '100', '5.3500', '0', '0', '0', '0', '5.3500'), --('Powder coating', '面漆', '粉烤平光漆', '歐歷', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤平光漆', '東瑞', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤平光漆', '協承昌', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤平光漆', '新政豐', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤平光漆', '台贏', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤平光漆', '皇冠', '', '', '', '', '', '', ''), ('Powder coating', '面漆', '粉烤平光漆', 'PPG', '100', '5.3500', '0', '0', '0', '0', '5.3500'), --('Powder coating', '面漆', '粉烤平光漆', 'Others', '', '', '', '', '', '', ''), -- ('Powder coating', '面漆', '粉烤消光漆', '', '', '', '', '', '', '', ''), ('Powder coating', '面漆', '粉烤消光漆', 'Akzo', '100', '8.3100', '0', '0', '0', '0', '8.3100'), --('Powder coating', '面漆', '粉烤消光漆', '歐歷', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤消光漆', '東瑞', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤消光漆', '協承昌', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤消光漆', '新政豐', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤消光漆', '台贏', '', '', '', '', '', '', ''), --('Powder coating', '面漆', '粉烤消光漆', '皇冠', '', '', '', '', '', '', ''), ('Powder coating', '面漆', '粉烤消光漆', 'PPG', '100', '8.3100', '0', '0', '0', '0', '8.3100'); --('Powder coating', '面漆', '粉烤消光漆', 'Others', '', '', '', '', '', '', ''), -- ('Powder coating', '面漆', 'N/A', '', '', '', '', '', '', '', ''), --('Powder coating', '面漆', 'N/A', 'Akzo', '', '', '', '', '', '', ''), --('Powder coating', '面漆', 'N/A', '歐歷', '', '', '', '', '', '', ''), --('Powder coating', '面漆', 'N/A', '東瑞', '', '', '', '', '', '', ''), --('Powder coating', '面漆', 'N/A', '協承昌', '', '', '', '', '', '', ''), --('Powder coating', '面漆', 'N/A', '新政豐', '', '', '', '', '', '', ''), --('Powder coating', '面漆', 'N/A', '台贏', '', '', '', '', '', '', ''), --('Powder coating', '面漆', 'N/A', '皇冠', '', '', '', '', '', '', ''), --('Powder coating', '面漆', 'N/A', 'PPG', '', '', '', '', '', '', ''), --('Powder coating', '面漆', 'N/A', 'Others', '', '', '', '', '', '', ''), -- views CREATE OR REPLACE VIEW formula.v_metal_painting_vendor_type_color_bottom_top AS SELECT all_link.id, type.id AS paint_type_id, type.type_name AS paint_type_name, color.id AS paint_color_id, color.color_name AS paint_color_name, level.id AS paint_bottom_top_id, level.bottom_top_name AS paint_bottom_top_name, all_link.paint_vendor_id, vendor.vendor_name AS paint_vendor_name, all_link.disable_time AS link_disable_time FROM formula.metal_paint_vendor_type_color_bottom_top all_link LEFT JOIN formula.metal_paint_vendor vendor ON vendor.id = all_link.paint_vendor_id LEFT JOIN formula.metal_paint_type_color_bottom_top cb_link ON all_link.type_color_bottom_top_id = cb_link.id LEFT JOIN formula.metal_paint_bottom_top level ON cb_link.paint_bottom_top_id = level.id LEFT JOIN formula.metal_paint_type_color tc_link ON tc_link.id = cb_link.paint_type_color_id LEFT JOIN formula.metal_paint_color color ON color.id = tc_link.paint_color_id LEFT JOIN formula.metal_paint_type type ON type.id = tc_link.paint_type_id ORDER BY type.type_name, color.color_name, level.bottom_top_name, vendor.vendor_name; -- Permissions ALTER TABLE formula.v_metal_painting_vendor_type_color_bottom_top OWNER TO "swpc-user"; GRANT ALL ON TABLE formula.v_metal_painting_vendor_type_color_bottom_top TO "swpc-user"; GRANT SELECT ON TABLE formula.v_metal_painting_vendor_type_color_bottom_top TO emdm; CREATE OR REPLACE VIEW formula.v_metal_painting_vendor_v2 AS SELECT DISTINCT link.paint_type_id, link.paint_type_name, link.paint_color_id, link.paint_color_name, CASE WHEN (( SELECT count(link_b.id) AS count FROM formula.v_metal_painting_vendor_type_color_bottom_top link_b WHERE link_b.paint_color_id = link.paint_color_id AND link_b.paint_type_id = link.paint_type_id AND link_b.paint_bottom_top_name::text = '底漆'::text AND link_b.link_disable_time IS NULL)) > 0 THEN true ELSE false END AS bottom, CASE WHEN (( SELECT count(link_t.id) AS count FROM formula.v_metal_painting_vendor_type_color_bottom_top link_t WHERE link_t.paint_color_id = link.paint_color_id AND link_t.paint_type_id = link.paint_type_id AND link_t.paint_bottom_top_name::text = '面漆'::text AND link_t.link_disable_time IS NULL)) > 0 THEN true ELSE false END AS top, link.paint_vendor_id, link.paint_vendor_name FROM formula.v_metal_painting_vendor_type_color_bottom_top link LEFT JOIN formula.parameter_value pv ON link.id = pv.parameter_id LEFT JOIN formula.schedule_date sd ON sd.id = pv.activate_date_id WHERE pv.value IS NOT NULL AND sd.id = (( SELECT max(sd2.id) AS id FROM formula.schedule_date sd2 WHERE sd2.activate_date < now() AND sd2.product_type_id IS NULL AND sd2.formula_type_id = (( SELECT ft.id FROM formula.formula_type ft WHERE ft.name::text = 'housing_metal'::text)))); -- Permissions ALTER TABLE formula.v_metal_painting_vendor_v2 OWNER TO "swpc-user"; GRANT ALL ON TABLE formula.v_metal_painting_vendor_v2 TO "swpc-user"; GRANT SELECT ON TABLE formula.v_metal_painting_vendor_v2 TO emdm; CREATE OR REPLACE VIEW formula.v_metal_painting_color AS SELECT ppc.id, ppc.color_name AS name, pptc.disable_time, pptc.paint_type_id FROM formula.metal_paint_color ppc, formula.metal_paint_type_color pptc WHERE pptc.paint_color_id = ppc.id; -- Permissions ALTER TABLE formula.v_metal_painting_color OWNER TO "swpc-user"; GRANT ALL ON TABLE formula.v_metal_painting_color TO "swpc-user"; GRANT SELECT ON TABLE formula.v_metal_painting_color TO emdm; CREATE OR REPLACE VIEW formula.v_metal_painting_type AS SELECT ppt.id, ppt.type_name AS name, ppt.disable_time FROM formula.metal_paint_type ppt; -- Permissions ALTER TABLE formula.v_metal_painting_type OWNER TO "swpc-user"; GRANT ALL ON TABLE formula.v_metal_painting_type TO "swpc-user"; GRANT SELECT ON TABLE formula.v_metal_painting_type TO emdm; CREATE OR REPLACE VIEW formula.v_metal_painting_type_v2 AS SELECT tp.id, tp.type_name AS name, CASE WHEN (( SELECT count(link.id) AS count FROM formula.v_metal_painting_vendor_type_color_bottom_top link WHERE link.paint_type_id = tp.id AND link.paint_bottom_top_name::text = '底漆'::text AND link.link_disable_time IS NULL)) > 0 THEN true ELSE false END AS bottom, CASE WHEN (( SELECT count(link.id) AS count FROM formula.v_metal_painting_vendor_type_color_bottom_top link WHERE link.paint_type_id = tp.id AND link.paint_bottom_top_name::text = '面漆'::text AND link.link_disable_time IS NULL)) > 0 THEN true ELSE false END AS top, tp.disable_time FROM formula.metal_paint_type tp; -- Permissions ALTER TABLE formula.v_metal_painting_type_v2 OWNER TO "swpc-user"; GRANT ALL ON TABLE formula.v_metal_painting_type_v2 TO "swpc-user"; GRANT SELECT ON TABLE formula.v_metal_painting_type_v2 TO emdm; CREATE OR REPLACE VIEW formula.v_metal_painting_machine AS SELECT ppm.id, ppm.machine_name AS name, ppm.disable_time FROM formula.metal_paint_machine ppm; -- Permissions ALTER TABLE formula.v_metal_painting_machine OWNER TO "swpc-user"; GRANT ALL ON TABLE formula.v_metal_painting_machine TO "swpc-user"; GRANT SELECT ON TABLE formula.v_metal_painting_machine TO emdm; CREATE OR REPLACE VIEW formula.v_metal_painting_thickness AS SELECT ms.id, ms.spec_name AS name, ms.disable_time FROM formula.me_spec ms WHERE ms.spec_category::text = 'metal_paint_thickness'::text; -- Permissions ALTER TABLE formula.v_metal_painting_thickness OWNER TO "swpc-user"; GRANT ALL ON TABLE formula.v_metal_painting_thickness TO "swpc-user"; GRANT SELECT ON TABLE formula.v_metal_painting_thickness TO emdm; insert into formula.parameter_value (parameter_id, value , value_type, source_table, activate_date_id) select a.id, a.total_price, 'number', 'metal_paint_vendor_type_color_bottom_top', b.id from (select link.id, tp.* from formula.tmp_metal_paint_price tp left join formula.v_metal_painting_vendor_type_color_bottom_top link on tp.paint_type = link.paint_type_name and tp.color = link.paint_color_name and tp.bottom_top = link.paint_bottom_top_name and tp.vendor = link.paint_vendor_name ) a, (select id from formula.schedule_date sd where sd.formula_type_id = (select id from formula.formula_type where "name" = 'housing_metal') and sd.product_type_id is null ) b; insert into formula.parameter_value (parameter_id, value , value_type, source_table, activate_date_id) select pf.id, ( case when pt."label" = 'main_unit_price' then a.main_un when pt."label" = 'main_amount' then a.main_am when pt."label" = 'hardener_unit_price' then a.hardener_un when pt."label" = 'hardener_amount' then a.hardener_am when pt."label" = 'solvent_unit_price' then a.solvent_un when pt."label" = 'solvent_amount' then a.solvent_am else '0' end ) , 'number', 'metal_paint_formula', b.id from (select id from formula.schedule_date sd where sd.formula_type_id = (select id from formula.formula_type where "name" = 'housing_metal') and sd.product_type_id is null ) b, ( select link.id, tp.* from formula.tmp_metal_paint_price tp left join formula.v_metal_painting_vendor_type_color_bottom_top link on tp.paint_type = link.paint_type_name and tp.color = link.paint_color_name and tp.bottom_top = link.paint_bottom_top_name and tp.vendor = link.paint_vendor_name ) a left join formula.metal_paint_formula pf on pf.paint_id = a.id left join formula.metal_paint_formula_type pt on pt.id = pf.type_id; DROP TABLE IF EXISTS formula.tmp_metal_paint_price;
true
3432ee11f52932cc3c4a21ea3eb2f53a93fd6c94
SQL
andreaczhang/mimic
/Johnson2017/queryJcode/cohort-aki/cohort_aki.sql
UTF-8
811
3.640625
4
[]
no_license
-- CELI AKI -- inclusion_only_mimicii -- inclusion_over_18 -- inclusion_aki_icd9 -- hospital_expire_flag SELECT co.subject_id, co.hadm_id, co.icustay_id , ceil(extract(epoch FROM (co.outtime - co.intime))/60.0/60.0) as dischtime_hours , ceil(extract(epoch FROM (adm.deathtime - co.intime))/60.0/60.0) as deathtime_hours , CASE WHEN adm.deathtime is null then 0 else 1 end as death FROM mp_cohort_1 -- REPLACE co INNER JOIN admissions adm on co.hadm_id = adm.hadm_id WHERE co.excluded = 0 and icustay_id IN ( SELECT icustay_id FROM final_cohort_1 AS fc -- REPLACE WHERE fc.inclusion_only_mimicii = 1 AND fc.inclusion_over_18 =1 AND fc.inclusion_aki_icd9 = 1 AND fc.hospital_expire_flag = 1 ) ORDER BY icustay_id ;
true
ed844e85635fc488098f607e3a9fc60188f386c5
SQL
FreddieAbad/100-Days-Of-Code
/Dia 16/crud-mysql/src/database/db.sql
UTF-8
324
3.0625
3
[]
no_license
-- creating db CREATE DATABASE crudnodejsmysql; --using db use crudnodejsmysql; --tables create table customer( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50) NOT NULL, address VARCHAR(100) NOT NULL, phone VARCHAR(15) ); --SHOW TABLES SHOW TABLES; --TO DESCRIBE TABLE DESCRIBE CUSTOMER;
true
0eb3cc2ae0c25d21b189f494a52ff6080a7e8f2a
SQL
feleHaile/Data-Warehousing-for-Business-Intelligence-Specialization
/Course 1 Database Management Essentials/Course1Module04Assignment/additional probl/OrderProbl.sql
UTF-8
870
4.15625
4
[]
no_license
SELECT CustNo, CustFirstName, CustLastName, CustBal -- 1 FROM Customer; SELECT CustNo, CustFirstName, CustLastName, CustBal -- 2 FROM Customer WHERE CustState = 'CO'; SELECT * -- 3 FROM Product WHERE ProdPrice > 50 ORDER BY ProdMfg, ProdName; SELECT CustNo, CustFirstName, CustLastName, CustCity, CustBal -- 4 FROM Customer WHERE (CustCity = 'Denver' AND CustBal > 150) OR (CustCity = 'Seattle' AND CustBal > 300) ; SELECT OrdNo, OrdDate, OrderTbl.CustNo, CustFirstName, CustLastName -- 5 FROM OrderTbl, Customer WHERE (OrderTbl.CustNo = Customer.CustNo) AND (OrdDate BETWEEN '2017-01-01' AND '2017-01-31') AND CustCity = 'Colorado' ; SELECT CustCity, AVG(CustBal) AS AvgBal FROM Customer WHERE CustState = 'WA' GROUP BY CustCity ; SELECT CustCity, AVG(CustBal) AS AvgBal, COUNT(*) FROM Customer WHERE CustState = 'WA' GROUP BY CustCity HAVING COUNT(*) >= 2 ;
true
c600bc2d793b48a0bda67537f8a8d131cf43cacd
SQL
rajaram-parab/OracleTutorial
/CollectionMethodPRiorAndNext_tut63.sql
UTF-8
541
2.703125
3
[]
no_license
DECLARE TYPE nested_table is table of varchar2(20); var_nt nested_table := nested_table(9,18,27,36,45,54,63,72,81,90); BEGIN DBMS_OUTPUT.PUT_LINE('Value before 3rd Index '|| var_nt.PRIOR(3)); DBMS_OUTPUT.PUT_LINE('Value before 3rd Index '|| var_nt(var_nt.PRIOR(3))); END; DECLARE TYPE nested_table is table of varchar2(20); var_nt nested_table := nested_table(9,18,27,36,45,54,63,72,81,90); BEGIN DBMS_OUTPUT.PUT_LINE('Value after 3rd Index '|| var_nt.NEXT(3)); DBMS_OUTPUT.PUT_LINE('Value after 3rd Index '|| var_nt(var_nt.NEXT(3)));
true
543691e0121077ad9ca4ef8ec4fc0566c50699f5
SQL
klayne1129/MVC-persistent
/queries.sql
UTF-8
241
2.765625
3
[]
no_license
## Part 1: Test it with SQL SELECT * FROM job ## Part 2: Test it with SQL SELECT location FROM employer WHERE location="St. Louis" ## Part 3: Test it with SQL DELETE FROM job WHERE id=5; ## Part 4: Test it with SQL
true
80982153fd76d87d0644196287a42ec6bfd25fd2
SQL
kamshory/Point-Of-Sale
/database/point-of-sale.sql
UTF-8
15,801
3.59375
4
[]
no_license
-- MySQL Script generated by MySQL Workbench -- Sun Mar 29 16:18:08 2020 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Schema point_of_sale -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema point_of_sale -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `point_of_sale` DEFAULT CHARACTER SET utf8 ; USE `point_of_sale` ; -- ----------------------------------------------------- -- Table `point_of_sale`.`manufacturer` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`manufacturer` ( `manufacturer_id` BIGINT NOT NULL AUTO_INCREMENT, `name` VARCHAR(100) NULL, `logo` TEXT NULL, `phone` VARCHAR(20) NULL, `email` VARCHAR(100) NULL, `address` VARCHAR(100) NULL, `website` VARCHAR(100) NULL, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`manufacturer_id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`brand` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`brand` ( `brand_id` BIGINT NOT NULL AUTO_INCREMENT, `manufacturer_id` BIGINT NULL, `name` VARCHAR(100) NULL, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`brand_id`), INDEX `brand_manufacturer_id_idx` (`manufacturer_id` ASC), CONSTRAINT `brand_manufacturer_id` FOREIGN KEY (`manufacturer_id`) REFERENCES `point_of_sale`.`manufacturer` (`manufacturer_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`item` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`item` ( `item_id` BIGINT NOT NULL AUTO_INCREMENT, `barcode` VARCHAR(40) NULL, `name` VARCHAR(100) NULL, `description` TEXT NULL, `brand_id` BIGINT NULL, `type` VARCHAR(100) NULL, `model` VARCHAR(100) NULL, `size` VARCHAR(100) NULL, `weight` VARCHAR(100) NULL, `color` VARCHAR(100) NULL, `price` DOUBLE NULL, `discount` DOUBLE NULL, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`item_id`), INDEX `item_brand_id_idx` (`brand_id` ASC), CONSTRAINT `item_brand_id` FOREIGN KEY (`brand_id`) REFERENCES `point_of_sale`.`brand` (`brand_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`customer` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`customer` ( `customer_id` BIGINT NOT NULL AUTO_INCREMENT, `name` VARCHAR(100) NULL, `customer_type_id` VARCHAR(5) NULL, `gender` CHAR(1) NULL, `birth_day` DATE NULL, `phone` VARCHAR(20) NULL, `email` VARCHAR(100) NULL, `address` VARCHAR(100) NULL, `website` VARCHAR(100) NULL, `public` TINYINT(1) NULL DEFAULT 0, `default_data` TINYINT(1) NULL DEFAULT 0, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`customer_id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`payment_method` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`payment_method` ( `payment_method_id` CHAR(2) NOT NULL, `name` VARCHAR(100) NULL, `sort_order` INT NULL, `default_data` TINYINT(1) NULL DEFAULT 0, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`payment_method_id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`store` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`store` ( `store_id` BIGINT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NULL, `phone` VARCHAR(20) NULL, `email` VARCHAR(100) NULL, `address` VARCHAR(100) NULL, `website` VARCHAR(100) NULL, `public` TINYINT(1) NULL DEFAULT 0, `default_data` TINYINT(1) NULL DEFAULT 0, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`store_id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`sales` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`sales` ( `sales_id` BIGINT NOT NULL AUTO_INCREMENT, `store_id` BIGINT NULL, `customer_id` BIGINT NULL, `invoice` VARCHAR(32) NULL, `subtotal` DOUBLE NULL, `discount` DOUBLE NULL, `grand_total` DOUBLE NULL, `payment_method_id` CHAR(2) NULL, `payment_cash` DOUBLE NULL, `payment_change` VARCHAR(45) NULL, `time_create` DATETIME NULL, `seller_create` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`sales_id`), INDEX `sales_customer_id_idx` (`customer_id` ASC), INDEX `sales_sales_idx` (`payment_method_id` ASC), INDEX `sales_store_id_idx` (`store_id` ASC), CONSTRAINT `sales_customer_id` FOREIGN KEY (`customer_id`) REFERENCES `point_of_sale`.`customer` (`customer_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `sales_payment_method_id` FOREIGN KEY (`payment_method_id`) REFERENCES `point_of_sale`.`payment_method` (`payment_method_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `sales_store_id` FOREIGN KEY (`store_id`) REFERENCES `point_of_sale`.`store` (`store_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`sales_detail` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`sales_detail` ( `sales_detail_id` BIGINT NOT NULL AUTO_INCREMENT, `store_id` BIGINT NULL, `sales_id` BIGINT NULL, `customer_id` BIGINT NULL, `item_id` BIGINT NULL, `quantity` INT NULL, `price` DOUBLE NULL, `discount` DOUBLE NULL, `subtotal` DOUBLE NULL, `time_create` DATETIME NULL, `seller_create` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`sales_detail_id`), INDEX `sales_item_id_idx` (`item_id` ASC), INDEX `sales_customer_id_idx` (`customer_id` ASC), INDEX `sales_detail_sales_id_idx` (`sales_id` ASC), INDEX `sales_detail_store_id_idx` (`store_id` ASC), CONSTRAINT `sales_detail_item_id` FOREIGN KEY (`item_id`) REFERENCES `point_of_sale`.`item` (`item_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `sales_detail_customer_id` FOREIGN KEY (`customer_id`) REFERENCES `point_of_sale`.`customer` (`customer_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `sales_detail_sales_id` FOREIGN KEY (`sales_id`) REFERENCES `point_of_sale`.`sales` (`sales_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `sales_detail_store_id` FOREIGN KEY (`store_id`) REFERENCES `point_of_sale`.`store` (`store_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`item_circulation` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`item_circulation` ( `item_circulation_id` BIGINT NOT NULL AUTO_INCREMENT, `store_id` BIGINT NULL, `item_id` BIGINT NULL, `ready_stock_in` INT NULL, `ready_stock_out` INT NULL, `warehouse_stock_in` INT NULL, `warehouse_stock_out` INT NULL, `description` TEXT NULL, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL, PRIMARY KEY (`item_circulation_id`), INDEX `item_circulation_item_id_idx` (`item_id` ASC), INDEX `item_circulation_store_id_idx` (`store_id` ASC), CONSTRAINT `item_circulation_item_id` FOREIGN KEY (`item_id`) REFERENCES `point_of_sale`.`item` (`item_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `item_circulation_store_id` FOREIGN KEY (`store_id`) REFERENCES `point_of_sale`.`store` (`store_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`supplier` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`supplier` ( `supplier_id` BIGINT NOT NULL AUTO_INCREMENT, `name` VARCHAR(100) NULL, `supplier_type_id` VARCHAR(5) NULL, `gender` CHAR(1) NULL, `birth_day` DATE NULL, `phone` VARCHAR(20) NULL, `email` VARCHAR(100) NULL, `address` VARCHAR(100) NULL, `website` VARCHAR(100) NULL, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`supplier_id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`purchase_status` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`purchase_status` ( `purchase_status` CHAR(3) NOT NULL, `name` VARCHAR(100) NULL, `icon_sm` VARCHAR(100) NULL, `icon_md` VARCHAR(100) NULL, `icon_lg` VARCHAR(100) NULL, `icon_xl` VARCHAR(100) NULL, `sort_order` INT NULL, `default_data` TINYINT(1) NULL DEFAULT 0, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`purchase_status`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`purchase` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`purchase` ( `purchase_id` BIGINT NOT NULL AUTO_INCREMENT, `store_id` BIGINT NULL, `item_id` BIGINT NULL, `supplier_id` BIGINT NULL, `price` DOUBLE NULL, `discount` DOUBLE NULL, `purchase_status_id` CHAR(3) NULL, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, `quantity` INT NULL, PRIMARY KEY (`purchase_id`), INDEX `purchase_item_id_idx` (`item_id` ASC), INDEX `purchase_supplier_id_idx` (`supplier_id` ASC), INDEX `purchase_purchase_status_id_idx` (`purchase_status_id` ASC), INDEX `purchase_store_id_idx` (`store_id` ASC), CONSTRAINT `purchase_item_id` FOREIGN KEY (`item_id`) REFERENCES `point_of_sale`.`item` (`item_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `purchase_supplier_id` FOREIGN KEY (`supplier_id`) REFERENCES `point_of_sale`.`supplier` (`supplier_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `purchase_purchase_status_id` FOREIGN KEY (`purchase_status_id`) REFERENCES `point_of_sale`.`purchase_status` (`purchase_status`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `purchase_store_id` FOREIGN KEY (`store_id`) REFERENCES `point_of_sale`.`store` (`store_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`admin` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`admin` ( `admin_id` BIGINT NOT NULL AUTO_INCREMENT, `store_id` BIGINT NULL, `name` VARCHAR(100) NULL, `level_id` BIGINT NULL, `gender` CHAR(1) NULL, `birth_day` DATE NULL, `phone` VARCHAR(20) NULL, `email` VARCHAR(100) NULL, `address` VARCHAR(100) NULL, `website` VARCHAR(100) NULL, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`admin_id`), INDEX `admin_store_id_idx` (`store_id` ASC), CONSTRAINT `admin_store_id` FOREIGN KEY (`store_id`) REFERENCES `point_of_sale`.`store` (`store_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`seller` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`seller` ( `seller_id` BIGINT NOT NULL AUTO_INCREMENT, `store_id` BIGINT NULL, `name` VARCHAR(100) NULL, `level_id` BIGINT NULL, `gender` CHAR(1) NULL, `birth_day` DATE NULL, `phone` VARCHAR(20) NULL, `email` VARCHAR(100) NULL, `address` VARCHAR(100) NULL, `website` VARCHAR(100) NULL, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`seller_id`), INDEX `seller_store_id_idx` (`store_id` ASC), CONSTRAINT `seller_store_id` FOREIGN KEY (`store_id`) REFERENCES `point_of_sale`.`store` (`store_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `point_of_sale`.`stock` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `point_of_sale`.`stock` ( `stock_id` BIGINT NOT NULL AUTO_INCREMENT, `store_id` BIGINT NULL, `item_id` BIGINT NULL, `ready_stock` INT NULL, `warehouse_stock` INT NULL, `time_create` DATETIME NULL, `time_edit` DATETIME NULL, `admin_create` BIGINT NULL, `admin_edit` BIGINT NULL, `ip_create` VARCHAR(48) NULL, `ip_edit` VARCHAR(48) NULL, `active` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`stock_id`), INDEX `stock_store_id_idx` (`store_id` ASC), INDEX `stock_item_id_idx` (`item_id` ASC), CONSTRAINT `stock_store_id` FOREIGN KEY (`store_id`) REFERENCES `point_of_sale`.`store` (`store_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `stock_item_id` FOREIGN KEY (`item_id`) REFERENCES `point_of_sale`.`item` (`item_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
true
d2e21349acfdc2f80cd2a08864786d5827c6281b
SQL
JorgePaladines/SampleMovie
/samplemovie.sql
UTF-8
15,416
2.8125
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 17, 2019 at 11:51 PM -- Server version: 5.7.24-0ubuntu0.16.04.1 -- PHP Version: 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `samplemovie` -- -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2019_01_08_031712_create_movies_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `movies` -- CREATE TABLE `movies` ( `id` int(10) UNSIGNED NOT NULL, `titulo` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `director` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `reparto` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `plan` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `movies` -- INSERT INTO `movies` (`id`, `titulo`, `director`, `reparto`, `plan`, `created_at`, `updated_at`) VALUES (1, 'El padrino', 'Francis Ford Coppola', 'M. Brando, Al Pacino', 'premium', '2019-01-09 05:00:00', '2019-01-09 05:00:00'), (2, 'Cadena Perpetua', 'F. Darabont', 'T. Robbins, M. Freeman', 'basico', '2019-01-09 05:00:00', '2019-01-09 05:00:00'), (3, 'La lista de Schindler', 'S. Spielberg', 'L. Neeson, R. Fiennes', 'premium', '2019-01-09 05:00:00', '2019-01-09 05:00:00'), (4, 'Toro Salvaje', 'M. Scorsese', 'R. De Niro, C. Moriarty', 'estandar', '2019-01-09 05:00:00', '2019-01-09 05:00:00'), (5, 'Casablanca', 'M. Curtiz', 'H. Bogart, I. Bergman', 'basico', '2019-01-09 05:00:00', '2019-01-09 05:00:00'), (6, 'Ciudadano Kane', 'O. Welles', 'O. Welles, J. Cotten', 'estandar', '2019-01-09 05:00:00', '2019-01-09 05:00:00'), (7, 'Lo que el viento se llevo', 'Victor Fleming, George Cukor, Sam Wood ', 'Clark Gable, Vivien Leigh, Thomas Mitchell, Barbara O\'Neil', 'basico', '2019-01-09 05:00:00', '2019-01-09 05:00:00'), (8, ' El mago de Oz ', ' Victor Fleming, George Cukor, Mervyn LeRoy, Norman Taurog, King Vidor', 'Judy Garland, Frank Morgan, Ray Bolger, Bert Lahr', 'estandar', '2019-01-09 05:00:00', '2019-01-09 05:00:00'), (9, 'Alguien voló sobre el nido del cuco ', ' Milos Forman ', 'Jack Nicholson, Louise Fletcher, Will Sampson, Michael Berryman', 'premium', '2019-01-09 05:00:00', '2019-01-09 05:00:00'), (10, ' Lawrence de Arabia ', 'David Lean', 'Peter O\'Toole, Alec Guinness, Anthony Quinn, Jack Hawkins', 'basico', '2019-01-09 05:00:00', '2019-01-09 05:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `nombre` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `fnacimiento` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `plan` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `ciudad` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `pais` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `nombre`, `fnacimiento`, `plan`, `ciudad`, `pais`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'User1', '200-100-11', 'basico', 'cuidad1', 'pais1', 'email1', '2019-01-09 05:00:00', '123', NULL, '2019-01-09 05:00:00', '2019-01-09 05:00:00'), (2, ' Senaida Burell ', '1986-06-12', 'basico', 'Tulsa ', 'USA', 'isaacson@comcast.net', '2019-01-08 05:00:00', '12345', 'candidate', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (3, ' Taneka Lindenberg ', '1989-02-21', 'premium', 'Jacksonville ', 'USA', 'leslie@aol.com', '2019-01-08 05:00:00', '12345', 'technology', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (4, ' Zonia Pugh ', '\r\n1992-06-08', 'estandar', 'Jacksonville ', 'USA', 'aukjan@live.com', '2019-01-08 05:00:00', '12345', 'tea', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (5, ' Tiffaney Swank ', '1997-05-24', 'basico', 'Oklahoma City ', 'USA', 'tmccarth@optonline.net', '2019-01-08 05:00:00', '12345', 'weakness', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (6, ' Paul Weisel ', '1998-12-27', 'estandar', 'Denver ', 'USA', 'willg@mac.com', '2019-01-08 05:00:00', '12345', 'month', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (7, 'Beverlee Fryman ', '1982-10-02', 'estandar', 'Arlington ', 'USA', 'kourai@yahoo.com', '2019-01-08 05:00:00', '12345', 'grocery', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (8, 'Toney Kimbro ', ' 1983-11-08', 'basico', 'San Antonio ', 'USA', 'doche@sbcglobal.net', '2019-01-08 05:00:00', '12345', 'system', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (9, ' Ivy Heiss ', ' 1995-09-27', 'premium', 'Chesapeake ', 'USA', 'maradine@icloud.com', '2019-01-08 05:00:00', '12345', 'tension', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (10, ' Frances Dunneback ', ' 1996-11-09', 'basico', 'Scottsdale ', 'USA', 'rkobes@sbcglobal.net', '2019-01-08 05:00:00', '12345', 'power', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (11, ' Joetta Nevels ', ' 1996-12-29', 'premium', 'Buffalo ', 'USA', 'glenz@optonline.net', NULL, '12345', 'indication', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (12, ' Dwayne Amos ', '1984-02-20', 'premium', 'Huntington ', 'USA', 'mxiao@me.com', '2019-01-08 05:00:00', '12345', 'winner', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (13, ' Colton Blatter ', ' 1985-02-09', 'estandar', 'Virginia Beach ', 'USA', 'jginspace@msn.com', '2019-01-08 05:00:00', '12345', 'requirement', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (14, ' Dee Galvin ', ' 1985-02-28', 'estandar', 'Charlotte ', 'USA', 'parkes@optonline.net', '2019-01-08 05:00:00', '12345', 'effort', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (15, ' Modesto Casares ', ' 1990-09-05', 'premium', 'Las Vegas ', 'USA', 'pavel@mac.com', '2019-01-08 05:00:00', '12345', 'politics', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (16, ' Darwin Colpitts ', ' 1998-08-04', 'basico', 'Washington ', 'USA', 'hoyer@live.com', '2019-01-08 05:00:00', '12345', 'dealer', '2019-01-08 05:00:00', '2019-01-08 05:00:00'), (17, 'asdfadf', NULL, NULL, NULL, NULL, 'aaaa@gmail.com', NULL, '$2y$10$5e75Ge2B6eQxSZDTReUVj.bJO/gxHlNiBlfXpnWvdp4lI9vRyjp5C', 'poZoZqkSjW9BDyYQHa5Knb9xAUjpJNseOmWAJ8MOA52WegXUIZGi5AtQIHKG', '2019-01-16 20:18:34', '2019-01-16 20:18:34'), (18, '123', NULL, NULL, NULL, NULL, '123@123.com', NULL, '$2y$10$TzK4vJxiuucrwCe/e1oi8.jsuDkjiksfpwAQ9u12T5ogWbZEVrdQy', 'NSv2H6VHVpWzmMFneG4wt5PA3kSIHABAEK0S4Ze8lSjHuEXXAW85IRF52ovr', '2019-01-18 07:01:01', '2019-01-18 07:01:01'); -- -------------------------------------------------------- -- -- Table structure for table `visitas` -- CREATE TABLE `visitas` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED DEFAULT NULL, `movie_id` int(10) UNSIGNED DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `visitas` int(6) DEFAULT '0', `calificacion` smallint(6) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `visitas` -- INSERT INTO `visitas` (`id`, `user_id`, `movie_id`, `created_at`, `updated_at`, `visitas`, `calificacion`) VALUES (1, 1, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', 1, 4), (2, 2, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, 1), (3, 3, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (4, 4, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (5, 5, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (6, 6, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (7, 7, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (8, 8, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (9, 9, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (10, 10, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (11, 11, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (12, 12, 1, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (13, 1, 2, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (14, 2, 2, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (15, 3, 2, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (16, 4, 2, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (17, 5, 2, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (18, 6, 2, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (19, 7, 2, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (20, 12, 2, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (21, 1, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (22, 2, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (23, 3, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (24, 4, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (25, 5, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (26, 6, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', 2, 2), (27, 16, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (28, 15, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (29, 14, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (30, 13, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (31, 11, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (32, 12, 3, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (33, 1, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (34, 2, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (35, 3, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (36, 4, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (37, 5, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (38, 6, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (39, 7, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (40, 8, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (41, 9, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (42, 10, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (43, 11, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (44, 12, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (45, 13, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (46, 14, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (47, 15, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (48, 16, 4, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (49, 6, 5, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (50, 7, 5, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (51, 8, 5, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (52, 9, 5, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (53, 10, 5, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (54, 11, 5, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (55, 12, 5, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (56, 13, 5, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (57, 14, 5, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (58, 15, 5, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (59, 11, 6, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (60, 12, 6, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (61, 13, 6, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (62, 14, 6, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (63, 15, 6, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (64, 16, 6, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (65, 4, 7, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (66, 5, 7, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (67, 6, 7, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (68, 7, 7, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (69, 11, 8, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (70, 12, 8, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (71, 13, 8, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (72, 14, 8, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (73, 15, 8, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (74, 5, 9, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (75, 6, 9, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (76, 9, 10, '2019-01-10 05:00:00', '2019-01-10 05:00:00', NULL, NULL), (77, 18, 1, '2019-01-17 05:00:00', '2019-01-17 05:00:00', 3, 3); -- -- Indexes for dumped tables -- -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `movies` -- ALTER TABLE `movies` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- Indexes for table `visitas` -- ALTER TABLE `visitas` ADD PRIMARY KEY (`id`), ADD KEY `movies_id` (`movie_id`), ADD KEY `users_id` (`user_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `movies` -- ALTER TABLE `movies` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; -- -- AUTO_INCREMENT for table `visitas` -- ALTER TABLE `visitas` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=78; -- -- Constraints for dumped tables -- -- -- Constraints for table `visitas` -- ALTER TABLE `visitas` ADD CONSTRAINT `movies_id` FOREIGN KEY (`movie_id`) REFERENCES `movies` (`id`), ADD CONSTRAINT `users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
79d330f5071b6242f74a29b2f57f0eed2def17af
SQL
matthew-giannola/Database-3630-Project
/DBProjectSQLFiles/DBProject.sql
UTF-8
17,071
3.46875
3
[]
no_license
-- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; -- ----------------------------------------------------- -- Schema final -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema final -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `final` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ; USE `final` ; -- ----------------------------------------------------- -- Table `final`.`vendor` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`vendor` ( `id` INT NOT NULL, `name` VARCHAR(20) NOT NULL, `address` VARCHAR(50) NOT NULL, `phone_number` VARCHAR(15) NULL DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`stock` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`stock` ( `id` INT NOT NULL, `cost` INT NOT NULL, `num_stock` INT NOT NULL, `vendor` INT NOT NULL, PRIMARY KEY (`id`), INDEX `vendor_stock_idx` (`vendor` ASC) VISIBLE, CONSTRAINT `vendor_stock` FOREIGN KEY (`vendor`) REFERENCES `final`.`vendor` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`drinks` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`drinks` ( `id` INT NOT NULL, `name` VARCHAR(20) NOT NULL, `drink_size` VARCHAR(10) NOT NULL, `stock_id` INT NOT NULL, PRIMARY KEY (`id`, `stock_id`), INDEX `fk_drinks_stock1_idx` (`stock_id` ASC) VISIBLE, CONSTRAINT `fk_drinks_stock1` FOREIGN KEY (`stock_id`) REFERENCES `final`.`stock` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`food` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`food` ( `id` INT NOT NULL, `food` VARCHAR(255) NOT NULL, `stock_id` INT NOT NULL, PRIMARY KEY (`id`, `stock_id`), INDEX `ingrediants_stock_idx` (`stock_id` ASC) INVISIBLE, CONSTRAINT `ingrediants_stock` FOREIGN KEY (`stock_id`) REFERENCES `final`.`stock` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`combos` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`combos` ( `id` INT NOT NULL, `drink` INT NOT NULL, `food` INT NOT NULL, `combos_name` VARCHAR(45) NOT NULL, `combo_cost` DOUBLE NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `unigue_combo` (`drink` ASC, `food` ASC) VISIBLE, INDEX `drinks_combos_fk_idx` (`drink` ASC) VISIBLE, INDEX `ingrediatns_comdos_fk_idx` (`food` ASC) VISIBLE, CONSTRAINT `drinks_combos_fk` FOREIGN KEY (`drink`) REFERENCES `final`.`drinks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ingrediatns_comdos_fk` FOREIGN KEY (`food`) REFERENCES `final`.`food` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`customers` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`customers` ( `id` INT NOT NULL, `name` VARCHAR(45) NOT NULL, `payment_type` VARCHAR(45) NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`orders` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`orders` ( `id` INT NOT NULL, `total_cost` DOUBLE NOT NULL DEFAULT '0', `customer_id` INT NOT NULL, `combo_quantity` INT NOT NULL, PRIMARY KEY (`id`), INDEX `customer_order_idx` (`customer_id` ASC) VISIBLE, CONSTRAINT `customer_order` FOREIGN KEY (`customer_id`) REFERENCES `final`.`customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`combos_has_orders` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`combos_has_orders` ( `combos_id` INT NOT NULL, `orders_id` INT NOT NULL, PRIMARY KEY (`combos_id`, `orders_id`), INDEX `fk_combos_has_orders_orders1_idx` (`orders_id` ASC) VISIBLE, INDEX `fk_combos_has_orders_combos1_idx` (`combos_id` ASC) VISIBLE, CONSTRAINT `fk_combos_has_orders_combos1` FOREIGN KEY (`combos_id`) REFERENCES `final`.`combos` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_combos_has_orders_orders1` FOREIGN KEY (`orders_id`) REFERENCES `final`.`orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`employee_ranks` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`employee_ranks` ( `id` INT NOT NULL, `employee_rank` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = ' '; -- ----------------------------------------------------- -- Table `final`.`employment_history` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`employment_history` ( `id` INT NOT NULL, `start_time` DATETIME NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`salaries` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`salaries` ( `id` INT NOT NULL, `Salary` INT NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`schedules` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`schedules` ( `id` INT NOT NULL, `next_shift_start` VARCHAR(15) NOT NULL, `next_shift_end` VARCHAR(15) NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`employees` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`employees` ( `id` INT NOT NULL, `salary` INT NOT NULL, `employee_rank` INT NOT NULL, `employee_schedule` INT NOT NULL, `employee_history` INT NOT NULL, `employee_name` VARCHAR(45) NOT NULL, PRIMARY KEY (`id`), INDEX `rank_employee_fk_idx` (`employee_rank` ASC) VISIBLE, INDEX `salary_employee_idx` (`salary` ASC) VISIBLE, INDEX `scedules_employee_idx` (`employee_schedule` ASC) VISIBLE, INDEX `history_employees_fk_idx` (`employee_history` ASC) VISIBLE, CONSTRAINT `history_employees_fk` FOREIGN KEY (`employee_history`) REFERENCES `final`.`employment_history` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `rank_employee_fk` FOREIGN KEY (`employee_rank`) REFERENCES `final`.`employee_ranks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `salary_employee` FOREIGN KEY (`salary`) REFERENCES `final`.`salaries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `scedules_employee` FOREIGN KEY (`employee_schedule`) REFERENCES `final`.`schedules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `final`.`employees_has_orders` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `final`.`employees_has_orders` ( `employees_id` INT NOT NULL, `orders_id` INT NOT NULL, PRIMARY KEY (`employees_id`, `orders_id`), INDEX `fk_employees_has_orders_orders1_idx` (`orders_id` ASC) VISIBLE, INDEX `fk_employees_has_orders_employees1_idx` (`employees_id` ASC) VISIBLE, CONSTRAINT `fk_employees_has_orders_employees1` FOREIGN KEY (`employees_id`) REFERENCES `final`.`employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_employees_has_orders_orders1` FOREIGN KEY (`orders_id`) REFERENCES `final`.`orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; -- ----------------------------------------------------- -- Data for table `final`.`vendor` -- ----------------------------------------------------- START TRANSACTION; USE `final`; INSERT INTO `final`.`vendor` (`id`, `name`, `address`, `phone_number`) VALUES (id, 'name', 'address', 'phone_number'); INSERT INTO `final`.`vendor` (`id`, `name`, `address`, `phone_number`) VALUES (1, 'Pepsi', '3453 Jackson St, Dubuque, IA 52001', '608 245 3348'); INSERT INTO `final`.`vendor` (`id`, `name`, `address`, `phone_number`) VALUES (2, 'Tyson', '5218 Elm St, Dubuque, IA 52001', '608 445 9821'); INSERT INTO `final`.`vendor` (`id`, `name`, `address`, `phone_number`) VALUES (3, 'General Mills', '3453 45 St, Dubuque, IA 52001', '608 342 1776'); COMMIT; -- ----------------------------------------------------- -- Data for table `final`.`stock` -- ----------------------------------------------------- START TRANSACTION; USE `final`; INSERT INTO `final`.`stock` (`id`, `cost`, `num_stock`, `vendor`) VALUES (id, cost, num_stock, vendor); INSERT INTO `final`.`stock` (`id`, `cost`, `num_stock`, `vendor`) VALUES (1, 2, 14, 1); INSERT INTO `final`.`stock` (`id`, `cost`, `num_stock`, `vendor`) VALUES (3, 2, 10, 1); INSERT INTO `final`.`stock` (`id`, `cost`, `num_stock`, `vendor`) VALUES (5, 2, 8, 1); INSERT INTO `final`.`stock` (`id`, `cost`, `num_stock`, `vendor`) VALUES (2, 4, 50, 2); INSERT INTO `final`.`stock` (`id`, `cost`, `num_stock`, `vendor`) VALUES (4, 5, 45, 2); INSERT INTO `final`.`stock` (`id`, `cost`, `num_stock`, `vendor`) VALUES (6, 6, 35, 3); INSERT INTO `final`.`stock` (`id`, `cost`, `num_stock`, `vendor`) VALUES (8, 3, 25, 3); COMMIT; -- ----------------------------------------------------- -- Data for table `final`.`drinks` -- ----------------------------------------------------- START TRANSACTION; USE `final`; INSERT INTO `final`.`drinks` (`id`, `name`, `drink_size`, `stock_id`) VALUES (id, 'name', 'drink_size', stock_id); INSERT INTO `final`.`drinks` (`id`, `name`, `drink_size`, `stock_id`) VALUES (1, 'Coke', 'Small', 1); INSERT INTO `final`.`drinks` (`id`, `name`, `drink_size`, `stock_id`) VALUES (2, 'Coke', 'Large', 1); INSERT INTO `final`.`drinks` (`id`, `name`, `drink_size`, `stock_id`) VALUES (3, 'Sprite', 'Small', 3); INSERT INTO `final`.`drinks` (`id`, `name`, `drink_size`, `stock_id`) VALUES (4, 'Sprite', 'Large', 3); INSERT INTO `final`.`drinks` (`id`, `name`, `drink_size`, `stock_id`) VALUES (5, 'Water', 'Small', 5); INSERT INTO `final`.`drinks` (`id`, `name`, `drink_size`, `stock_id`) VALUES (6, 'Water', 'Large', 5); COMMIT; -- ----------------------------------------------------- -- Data for table `final`.`food` -- ----------------------------------------------------- START TRANSACTION; USE `final`; INSERT INTO `final`.`food` (`id`, `food`, `stock_id`) VALUES (id, 'food', stock_id); INSERT INTO `final`.`food` (`id`, `food`, `stock_id`) VALUES (1, 'Burger', 2); INSERT INTO `final`.`food` (`id`, `food`, `stock_id`) VALUES (2, 'Chicken Strips', 4); INSERT INTO `final`.`food` (`id`, `food`, `stock_id`) VALUES (3, 'Burrito', 6); INSERT INTO `final`.`food` (`id`, `food`, `stock_id`) VALUES (4, 'Pancakes', 8); COMMIT; -- ----------------------------------------------------- -- Data for table `final`.`combos` -- ----------------------------------------------------- START TRANSACTION; USE `final`; INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (id, drink, food, 'combos_name', combo_cost); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (1, 1, 1, 'Burger w/ Small Coke', 5); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (2, 2, 1, 'Burger w/ Large Coke', 6); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (3, 3, 1, 'Burger w/ Small Sprite', 5); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (4, 4, 1, 'Burger w/ Large Sprite', 6); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (5, 5, 1, 'Burger w/ Small Water', 5); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (6, 6, 1, 'Burger w/ Large Water', 6); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (7, 1, 2, 'Chicken Strips w/ Small Coke', 6); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (8, 2, 2, 'Chicken Strips w/ Large Coke', 7); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (9, 3, 2, 'Chicken Strips w/ Small Sprite', 6); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (10, 4, 2, 'Chicken Strips w/ Large Sprite', 7); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (11, 5, 2, 'Chicken Strips w/ Small Water', 6); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (12, 6, 2, 'Chicken Strips w/ Large Water', 7); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (13, 1, 3, 'Burrito w/ Small Coke', 7); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (14, 2, 3, 'Burrito w/ Large Coke', 8); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (15, 3, 3, 'Burrito w/ Small Sprite', 7); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (16, 4, 3, 'Burrito w/ Large SPrite', 8); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (17, 5, 3, 'Burrito w/ Small Water', 7); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (18, 6, 3, 'Burrito w/ Large Water', 8); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (19, 1, 4, 'Pancakes w/ Small Coke', 4); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (20, 2, 4, 'Pancakes w/ Large Coke', 5); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (21, 3, 4, 'Pancakes w/ Small Sprite', 4); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (22, 4, 4, 'Pancakes w/ Large Coke', 5); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (23, 5, 4, 'Pancakes w/ Small Water', 4); INSERT INTO `final`.`combos` (`id`, `drink`, `food`, `combos_name`, `combo_cost`) VALUES (24, 6, 4, 'Pancakes w/ Large Water', 5); COMMIT; -- ----------------------------------------------------- -- Data for table `final`.`employee_ranks` -- ----------------------------------------------------- START TRANSACTION; USE `final`; INSERT INTO `final`.`employee_ranks` (`id`, `employee_rank`) VALUES (1, 'Manager'); INSERT INTO `final`.`employee_ranks` (`id`, `employee_rank`) VALUES (2, 'Cook'); INSERT INTO `final`.`employee_ranks` (`id`, `employee_rank`) VALUES (3, 'Cashier'); INSERT INTO `final`.`employee_ranks` (`id`, `employee_rank`) VALUES (4, 'Server'); COMMIT;
true
beb639f32d05eecce88a51e91e11da6c6093b060
SQL
n-dusan/wroom
/agent-monolith/src/main/resources/data.sql
UTF-8
14,897
3.09375
3
[ "MIT" ]
permissive
-- Baza nije create-drop (znaci jednom kada nesto insertujete ovde, ostaje u bazi cak i po ponovnom pokretanju aplikacije) -- U create-drop rezimu, ukoliko sql skripta ponovo insertuje već unete vrednosti (MySQL ume da ne dropuje i redove unutar tabela) -- onda dodajte delete na tabelu koju želite da očistite, time se brišu svi redovi iz te tabele -------------------------------- -- delete from rent_request_ads; -- delete from users; -- delete from user_roles; -- delete from permission; -- delete from roles; -- delete from role_permissions; -- delete from ad; -- delete from location; -- delete from rent_request; -- delete from vehicle; -- delete from model_type; -- delete from brand_type; -- delete from gearbox_type; -- delete from fuel_type; -- delete from body_type; -- delete from rate; ------------- ROLE ----------------- insert into roles(id, name) values (1, 'ROLE_USER'); insert into roles(id, name) values (2, 'ROLE_AGENT'); insert into roles(id, name) values (3, 'ROLE_ADMIN'); insert into roles(id, name) values (4, 'ROLE_CRUD_VEHICLE'); insert into roles(id, name) values (5, 'ROLE_CRUD_AD'); insert into roles(id, name) values (6, 'ROLE_CHATTING_USER'); insert into roles(id, name) values (7, 'ROLE_RENTING_USER'); insert into roles(id, name) values (8, 'ROLE_RATING_COMMENTING_USER'); insert into roles(id, name) values (9, 'ROLE_PHYSICALLY_RESERVE'); ----------- PERMISIJE ---------------- insert into permission(id, name) values (1, 'RENT'); insert into permission(id, name) values (2, 'CHAT'); insert into permission(id, name) values (3, 'RATE'); insert into permission(id, name) values (4, 'RENT_HISTORY'); insert into permission(id, name) values (5, 'CRUD_AD_LIMITED'); insert into permission(id, name) values (6, 'SEND_RENT_REQUESTS'); insert into permission(id, name) values (7, 'CRUD_VEHICLE'); insert into permission(id, name) values (8, 'POST_PRICELISTS'); insert into permission(id, name) values (9, 'MANAGE_RENT_REQUESTS'); insert into permission(id, name) values (10, 'PHYSICALLY_RESERVE_VEHICLE'); insert into permission(id, name) values (11, 'COMPLETE_ACCESS'); insert into permission(id, name) values (12, 'REGISTER_AGENCY'); insert into permission(id, name) values (13, 'MANAGE_USERS'); insert into permission(id, name) values (14, 'MANAGE_USER_PRIVILEGES'); insert into permission(id, name) values (15, 'SEND_LOCATION'); insert into permission(id, name) values (16, 'MANAGE_RATES_AND_COMMENTS'); insert into permission(id, name) values (17, 'CRUD_AD'); insert into permission(id, name) values (18, 'UPLOAD_IMAGES'); insert into permission(id, name) values (19, 'READ_RATES'); insert into permission(id, name) values (20, 'COMMENT'); insert into permission(id, name) values (21, 'WRITE_REPORT'); insert into permission(id, name) values (22, 'REQUEST_STATISTICS'); insert into permission(id, name) values (23, 'TRACK_VEHICLES'); insert into permission(id, name) values (24, 'MANAGE_VEHICLE_FEATURES'); insert into permission(id, name) values (25, 'MANAGE_COMMENTS'); ------- Permisije obicnog korisnika ------- insert into role_permissions(role_id, permission_id) values (1, 4); --RENT_HISTORY insert into role_permissions(role_id, permission_id) values (1, 5); --CRUD_AD_LIMITED insert into role_permissions(role_id, permission_id) values (1, 7); --CRUD_VEHICLE insert into role_permissions(role_id, permission_id) values (1, 10); --PHYSICALLY_RESERVE_VEHICLE insert into role_permissions(role_id, permission_id) values (1, 8); --POST_PRICELISTS -- permisije za "pod-role" obicnog usera -- ROLE_RENTING_USER - obican user koji sme da rentira (dobija pri registraciji, gubi kad rentira - sve dok ne plati) insert into role_permissions(role_id, permission_id) values (7, 1); --RENT -- ROLE_CHATTING_USER - obican user koji sme da razmenjuje poruke (dobija kad mu se odobri request) insert into role_permissions(role_id, permission_id) values (6, 2); --CHAT -- ROLE_RATING_COMMENTING_USER - obican user koji sme da ocenjuje i komentarise (dobija kad se zavrsi period rentiranja) insert into role_permissions(role_id, permission_id) values (8, 20); --COMMENT insert into role_permissions(role_id, permission_id) values (8, 3); --RATE ------------------------------------------ ------------- Permisije agenta ----------- insert into role_permissions(role_id, permission_id) values (2, 17); --CRUD_AD insert into role_permissions(role_id, permission_id) values (2, 2); --CHAT insert into role_permissions(role_id, permission_id) values (2, 7); --CRUD_VEHICLE insert into role_permissions(role_id, permission_id) values (2, 8); --POST_PRICELISTS insert into role_permissions(role_id, permission_id) values (2, 9); --MANAGE_RENT_REQUESTS insert into role_permissions(role_id, permission_id) values (2, 10); --PHYSICALLY_RESERVE_VEHICLE insert into role_permissions(role_id, permission_id) values (2, 18); --UPLOAD_IMAGES insert into role_permissions(role_id, permission_id) values (2, 19); --READ_RATES insert into role_permissions(role_id, permission_id) values (2, 20); --COMMENT insert into role_permissions(role_id, permission_id) values (2, 21); --WRITE_REPORT insert into role_permissions(role_id, permission_id) values (2, 22); --REQUEST_STATISTICS insert into role_permissions(role_id, permission_id) values (2, 23); --TRACK_VEHICLES ------------------------------------------ ------------ Permisije admina ------------ insert into role_permissions(role_id, permission_id) values (3, 11); --COMPLETE_ACCESS insert into role_permissions(role_id, permission_id) values (3, 12); --REGISTER_AGENCY insert into role_permissions(role_id, permission_id) values (3, 13); --MANAGE_USERS insert into role_permissions(role_id, permission_id) values (3, 14); --MANAGE_USER_PRIVILEGES insert into role_permissions(role_id, permission_id) values (3, 16); --MANAGE_RATES_AND_COMMENTS insert into role_permissions(role_id, permission_id) values (3, 24); --MANAGE_VEHICLE_FEATURES ------------------ KORISNICI --------------------- -- sifre svih usera su <<user>>123, npr mila123 insert into users(id, email, name, password, surname, enabled, non_locked) values (1, 'mila@maildrop.cc', 'Mila', '$2a$10$5EIPh4FLRCczl/.mnQhHP.8GmBJT2tL8kgBS1qDALVaybk6hh5o5.', 'Stojakovic', 1, 1); insert into users(id, email, name, password, surname, enabled, non_locked) values (2, 'zika@maildrop.cc', 'Zivorad', '$2a$10$ZECdbx5MAPP.a7YbmWBowOrub/B2r7FZlq9tvr3BTMInSuhnApUpy', 'Stamenkovic', 1, 1); insert into users(id, email, name, password, surname, enabled, non_locked) values (3, 'grga@maildrop.cc', 'Svetislav', '$2a$10$JOsaxc.iuu8Pw.Wlbdfci.dl7xP93fa7/i0tib6zjnEv.OLrIRP1i', 'Grgur', 1, 1); -- mila user insert into user_roles(user_id, role_id) values (1, 1); insert into user_roles(user_id, role_id) values (1, 4); insert into user_roles(user_id, role_id) values (1, 5); insert into user_roles(user_id, role_id) values (1, 6); insert into user_roles(user_id, role_id) values (1, 7); insert into user_roles(user_id, role_id) values (1, 8); insert into user_roles(user_id, role_id) values (1, 9); --zika agent insert into user_roles(user_id, role_id) values (2, 2); insert into user_roles(user_id, role_id) values (2, 4); insert into user_roles(user_id, role_id) values (2, 5); insert into user_roles(user_id, role_id) values (2, 6); insert into user_roles(user_id, role_id) values (2, 7); insert into user_roles(user_id, role_id) values (2, 8); insert into user_roles(user_id, role_id) values (2, 9); --grga admin insert into user_roles(user_id, role_id) values (3, 3); insert into user_roles(user_id, role_id) values (3, 4); insert into user_roles(user_id, role_id) values (3, 5); insert into user_roles(user_id, role_id) values (3, 6); insert into user_roles(user_id, role_id) values (3, 7); insert into user_roles(user_id, role_id) values (3, 8); insert into user_roles(user_id, role_id) values (3, 9); ---------------Vehicle features------------- insert into brand_type(id, deleted, name) values (1, false, 'Audi'); insert into brand_type(id, deleted, name) values (2, false, 'Škoda'); insert into brand_type(id, deleted, name) values (3, false, 'Opel'); insert into brand_type(id, deleted, name) values (4, false, 'Volkswagen'); insert into model_type(id, deleted, name, brand_type_id) values (1, false, 'R8', 1); insert into model_type(id, deleted, name, brand_type_id) values (2, false, 'Octavia', 2); insert into model_type(id, deleted, name, brand_type_id) values (3, false, 'Astra', 3); insert into model_type(id, deleted, name, brand_type_id) values (4, false, 'Passat', 4); insert into body_type(id, deleted, name) values (1, false, 'Sedan'); insert into body_type(id, deleted, name) values (2, false, 'Wagon'); insert into body_type(id, deleted, name) values (3, false, 'Hatchback'); insert into body_type(id, deleted, name) values (4, false, 'Coupe'); insert into body_type(id, deleted, name) values (5, false, 'Pickup'); insert into body_type(id, deleted, name) values (6, false, 'Van'); insert into fuel_type(id, deleted, name) values (1, false, 'Diesel'); insert into fuel_type(id, deleted, name) values (2, false, 'Gasoline'); insert into fuel_type(id, deleted, name) values (3, false, 'Petrol'); insert into gearbox_type(id, deleted, name) values (1, false, 'Manual'); insert into gearbox_type(id, deleted, name) values (2, false, 'Automatic'); -------------------------------------------- -- Location insert into location(id, country, city) values (1, 'Arizona', 'Phoenix'); insert into location(id, country, city) values (2, 'China', 'Wuhan'); insert into location(id, country, city) values (3, 'Spain', 'Madrid'); insert into location(id, country, city) values (4, 'Italy', 'Rome'); -- Price list insert into price_list(id, deleted, discount, pricecdw, price_per_day, price_per_mile) values(1, false, 20, 642, 23, 3); insert into price_list(id, deleted, discount, pricecdw, price_per_day, price_per_mile) values(2, false, 10, 435, 30, 5); insert into price_list(id, deleted, discount, pricecdw, price_per_day, price_per_mile) values(3, false, 25, 500, 35, 7); -- Vehicle insert into vehicle(id, cdw, child_seats, deleted, mileage, body_type_id, fuel_type_id, gearbox_type_id, model_type_id, owner_id) values (1, 1, 0, 0, 50000, 4, 3, 1, 2, 2); insert into vehicle(id, cdw, child_seats, deleted, mileage, body_type_id, fuel_type_id, gearbox_type_id, model_type_id, owner_id) values (2, 0, 0, 0, 70000, 3, 3, 1, 3, 2); insert into vehicle(id, cdw, child_seats, deleted, mileage, body_type_id, fuel_type_id, gearbox_type_id, model_type_id, owner_id) values (3, 1, 3, 0, 100000, 1, 2, 2, 4, 1); insert into vehicle(id, cdw, child_seats, deleted, mileage, body_type_id, fuel_type_id, gearbox_type_id, model_type_id, owner_id) values (4, 0, 4, 0, 90000, 1, 3, 1, 3, 1); -- Ads insert into ad (id, address, available_from, available_to, deleted, gps, mile_limit, mile_limit_enabled, publish_date, location_id, price_list_id, vehicle_id) values(1, 'Via del Corso 15', '2020-05-29 00:00:00.000000', '2020-07-16 00:00:00.000000', 0, 1, 30, 0, '2020-05-28 17:20:12.039000', 4, 1, 1); insert into ad (id, address, available_from, available_to, deleted, gps, mile_limit, mile_limit_enabled, publish_date, location_id, price_list_id, vehicle_id) values(2, 'Via del Corso 156', '2020-05-15 00:00:00.000000', '2020-07-25 00:00:00.000000', 0, 1, null, 0, '2020-05-28 17:20:12.039000', 4, 2, 2); insert into ad (id, address, available_from, available_to, deleted, gps, mile_limit, mile_limit_enabled, publish_date, location_id, price_list_id, vehicle_id) values(3, 'Calle de Toledo 101', '2020-05-29 00:00:00.000000', '2020-07-25 00:00:00.000000', 0, 1, null, 0, '2020-04-28 17:20:12.039000', 2, 2, 3); insert into ad (id, address, available_from, available_to, deleted, gps, mile_limit, mile_limit_enabled, publish_date, location_id, price_list_id, vehicle_id) values(4, 'Calle de Toledo 101', '2020-05-29 00:00:00.000000', '2020-08-15 00:00:00.000000', 0, 1, null, 0, '2020-05-15 17:20:12.039000', 2, 3, 4); --Rent Report -- insert into rent_report(id, date_report, note, traveled_miles, user_id) -- values(1, '2020-06-29 00:00:00.000000', 'Ovo je izvestaj', 60000, 1); -- Rent Requests --insert into rent_request(id, from_date, status, to_date, rent_report_id, requested_user_id, ad_id) --values(1, '2020-06-05 00:00:00.000000', 'PAID', '2020-06-07 00:00:00.000000', null, 1, 1); --Opel Astra iz Wuhana -- insert into rent_request(id, from_date, status, to_date, rent_report_id, requested_user_id, ad_id) -- values(1, '2020-06-23 00:00:00.000000', 'COMPLETED', '2020-06-23 00:00:00.000000', null, 1, 1); -- insert into rent_request(id, from_date, requested_user_id, status, to_date, ad_id, bundle_id, rent_report_id) -- values (2, '2020-06-04 00:00:00.000000', 1, 'RESERVED', '2020-06-15 00:00:00.000000', 1, null, null); -- insert into rent_request(id, from_date, requested_user_id, status, to_date, ad_id, bundle_id, rent_report_id) -- values (3, '2020-05-29 00:00:00.000000', 1, 'COMPLETED', '2020-06-01 00:00:00.000000', 1, null, null); --insert into rent_request(id, from_date, requested_user_id, status, to_date, ad_id, bundle_id, rent_report_id) --values (1, '2020-06-01 00:00:00.000000', 1, 'COMPLETED', '2020-06-03 00:00:00.000000', 1, null, null); -- insert into rent_request(id, from_date, requested_user_id, status, to_date, ad_id, bundle_id, rent_report_id) -- values (5, '2020-06-29 00:00:00.000000', 1, 'PENDING', '2020-06-30 00:00:00.000000', 1, null, null); -- insert into rent_request(id, from_date, requested_user_id, status, to_date, ad_id, bundle_id, rent_report_id) -- values (6, '2020-06-27 00:00:00.000000', 1, 'PENDING', '2020-06-28 00:00:00.000000', 1, null, null); -- Messages --insert into message(id, content, date, rent_request_id, title, from_user, to_user_id) --values(1, 'Hello Monolith, how are you doing?', '2020-06-05 10:00:00.000000', 1, 'Hello', 'zika@maildrop.cc', 1); --insert into message(id, content, date, rent_request_id, title, to_user, from_user_id) --values(2, 'Hello Ziko, good.', '2020-06-05 11:00:00.000000', 1, 'Hello-Reply', 'zika@maildrop.cc', 1); -- Comments -- insert into comment(id, approved, content, comment_date, deleted, rate, title, ad_id, client_id, reply_id, reply, client_username) -- values(1, true, 'This vehicle is great', '2020-06-05 11:00:00.000000', false, 9, 'Nice', 1, 1, 3, false, 'mila@maildrop.cc'); -- insert into comment(id, approved, content, comment_date, deleted, rate, title, ad_id, client_id, reply, client_username) -- values(2, true, 'Great service', '2020-06-08 12:00:00.000000', false, 8, 'OK', 1, 2, false, 'mila@maildrop.cc'); -- insert into comment(id, content, approved, comment_date, deleted, ad_id, client_id, reply, client_username) -- values(3, 'Thank you very much' ,true, '2020-06-08 10:00:00.000000', false, 1, 2, true, 'zika@maildrop.cc'); -- insert into comment(id, approved, content, comment_date, deleted, rate, title, ad_id, client_id, reply_id, reply, client_username) -- values(4, true, 'Not happy', '2020-06-04 12:00:00.000000', false, 8, 'As an admin im offended', 2, 3, null, false, 'grga@maildrop.cc');
true
e1ea817ae261d805d546eac601c9a1c0caea64ef
SQL
marwan1023/Udacity-Data-foundation-Nanodegree
/project 3/chinook-preetikrp-master/chinook-preetikrp-master/line_item_track_artist.sql
UTF-8
219
3.03125
3
[]
no_license
select track.name, track.composer, invoiceLine.invoiceLineId, invoiceLine.invoiceId, InvoiceLine.TrackId, InvoiceLine.UnitPrice, InvoiceLine.Quantity from track, invoiceLine where track.trackId = invoiceLine.trackId
true
8b8a123625364ee06e20c1f5dcc8df56ff2a9f7b
SQL
HenintsoaAdri/SMORL
/script.sql
UTF-8
2,794
3.921875
4
[]
no_license
CREATE VIEW CONGRESDETAILVIEW AS SELECT C.IDCONGRES, C.NOMCONGRES, C.DATECONGRES, D.* FROM CONGRES C LEFT JOIN LISTDETAILCONGRES D ON C.IDCONGRES = D.IDCONGRES; CREATE VIEW SOMMEPAYECOTISATION AS SELECT M.*, C.*, SUM(P.MONTANT) AS MONTANTPAYE FROM COTISATION C JOIN PAIEMENTCOTISATION P ON P.IDCOTISATION = C.IDCOTISATION JOIN MEMBRE M ON M.IDMEMBRE = P.IDMEMBRE GROUP BY C.IDCOTISATION, M.IDMEMBRE; CREATE VIEW SOMMEPAYECONGRES AS SELECT M.*, C.IDCONGRES, C.NOMCONGRES, C.IDDETAILCONGRES,C.DESIGNATION, C.MONTANT, SUM(P.MONTANT) AS MONTANTPAYE FROM CONGRESDETAILVIEW C JOIN PAIEMENTCONGRES P ON P.IDDETAILCONGRES = C.IDDETAILCONGRES JOIN MEMBRE M ON M.IDMEMBRE = P.IDMEMBRE GROUP BY C.IDCONGRES,C.NOMCONGRES,C.IDDETAILCONGRES, C.DESIGNATION, C.MONTANT, M.IDMEMBRE; CREATE VIEW DETAILPAIEMENTCOTISATION AS SELECT M.*, C.*, P.IDPAIEMENTCOTISATION,P.DATEPAIEMENT,P.MONTANT AS MONTANTPAYE FROM COTISATION C LEFT JOIN PAIEMENTCOTISATION P ON P.IDCOTISATION = C.IDCOTISATION LEFT JOIN MEMBRE M ON M.IDMEMBRE = P.IDMEMBRE; CREATE VIEW DETAILPAIEMENTCONGRES AS SELECT M.*, C.IDCONGRES, C.NOMCONGRES, C.IDDETAILCONGRES,C.DESIGNATION, C.MONTANT, P.IDPAIEMENTCONGRES,P.DATEPAIEMENT,P.MONTANT AS MONTANTPAYE FROM CONGRESDETAILVIEW C LEFT JOIN PAIEMENTCONGRES P ON P.IDDETAILCONGRES = C.IDDETAILCONGRES LEFT JOIN MEMBRE M ON M.IDMEMBRE = P.IDMEMBRE; CREATE VIEW LISTCOTISATION AS SELECT COUNT(DISTINCT M.IDMEMBRE) AS CONTRIBUABLE, C.*, SUM(P.MONTANT) AS MONTANTPAYE FROM COTISATION C LEFT JOIN PAIEMENTCOTISATION P ON P.IDCOTISATION = C.IDCOTISATION LEFT JOIN MEMBRE M ON M.IDMEMBRE = P.IDMEMBRE GROUP BY C.ANNEECOTISATION, C.MONTANT, C.IDCOTISATION; CREATE VIEW LISTDETAILCONGRES AS SELECT COUNT(DISTINCT M.IDMEMBRE) AS CONTRIBUABLE, CD.NOMCONGRES, CD.DATECONGRES, CD.IDDETAILCONGRES, CD.IDCONGRES, CD.DESIGNATION,CD.MONTANT, SUM(P.MONTANT) AS MONTANTPAYE FROM CONGRESDETAILVIEW CD LEFT JOIN PAIEMENTCONGRES P ON P.IDDETAILCONGRES = CD.IDDETAILCONGRES LEFT JOIN MEMBRE M ON M.IDMEMBRE = P.IDMEMBRE GROUP BY CD.IDCONGRES, CD.DESIGNATION,CD.MONTANT, CD.NOMCONGRES, CD.DATECONGRES,CD.IDDETAILCONGRES,CD.DESIGNATION,CD.MONTANT; CREATE VIEW LISTEMEMBRENONCONTRIBUABLE AS SELECT * FROM MEMBRE M WHERE NOT EXISTS (SELECT * FROM SOMMEPAYECOTISATION S WHERE M.IDMEMBRE = S.IDMEMBRE) CREATE VIEW LISTDETAILCONGRES AS SELECT COUNT(DISTINCT M.IDMEMBRE) AS CONTRIBUABLE, C.*, SUM(P.MONTANT) AS MONTANTPAYE FROM DETAILCONGRES C LEFT JOIN PAIEMENTCONGRES P ON P.IDDETAILCONGRES = C.IDDETAILCONGRES LEFT JOIN MEMBRE M ON M.IDMEMBRE = P.IDMEMBRE GROUP BY C.IDDETAILCONGRES,C.DESIGNATION,C.MONTANT; SELECT IDMEMBRE,IDCOTISATION,SUM(MONTANT),extract(year from DATEPAIEMENT) FROM PAIEMENTCOTISATION GROUP BY IDCOTISATION, IDMEMBRE, extract(year from DATEPAIEMENT)
true
16408b00a08f9097ee3e7039bc9503235151bd71
SQL
JosepLajara/Personal
/Base datos/B5A8/10.sql
UTF-8
171
3.375
3
[]
no_license
select equipo.nombre, avg(jugador.salario) as Media_salario from equipo join jugador on equipo.id_equipo=jugador.equipo group by jugador.equipo having Media_salario>50000
true
9f8bd0642a7501a44adfdd4d7aabbc57ca9bc8c7
SQL
williamPozo/cp_WilliamPozo
/tempro20_conpdt.sql
UTF-8
3,880
2.78125
3
[]
no_license
CREATE DATABASE IF NOT EXISTS `tempro20` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `tempro20`; -- MySQL dump 10.13 Distrib 5.5.16, for Win32 (x86) -- -- Host: 192.168.1.210 Database: tempro20 -- ------------------------------------------------------ -- Server version 5.5.62-0ubuntu0.14.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `conpdt` -- DROP TABLE IF EXISTS `conpdt`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `conpdt` ( `pdtcod` char(30) NOT NULL, `pdtact` char(8) NOT NULL, `pdtcodfec` char(10) NOT NULL, `pdtcdc` char(8) NOT NULL, `pdtcdm` char(2) NOT NULL, `pdtpre` char(30) NOT NULL, `pdttdd` char(2) NOT NULL, `pdtnum` char(8) NOT NULL, `pdtdet` char(60) NOT NULL, `pdtmon` decimal(18,0) DEFAULT '2', `pdttdt` char(2) NOT NULL, `pdtcom` char(8) NOT NULL, `pdtfec` date DEFAULT NULL, `pdtcli` char(13) NOT NULL, `pdtven` char(5) NOT NULL, `pdtzon` char(5) NOT NULL, `pdtemi` date DEFAULT NULL, `pdtvec` date DEFAULT NULL, `pdtimp1` decimal(15,0) DEFAULT '2', `pdtimp2` decimal(15,0) DEFAULT '2', `pdtimp3` decimal(15,0) DEFAULT '2', `pdtimp4` decimal(15,0) DEFAULT '2', `pdtfac` char(8) NOT NULL, `pdtben` char(30) NOT NULL, `pdtruc` char(13) NOT NULL, `pdtcret1` char(3) NOT NULL, `pdtcret2` char(3) NOT NULL, `pdtcret3` char(3) NOT NULL, `pdtcret4` char(3) NOT NULL, `pdtgra1` decimal(15,0) DEFAULT '2', `pdtgra2` decimal(15,0) DEFAULT '2', `pdtgra3` decimal(15,0) DEFAULT '2', `pdtgra4` decimal(15,0) DEFAULT '2', `pdtret1` decimal(6,0) DEFAULT '2', `pdtret2` decimal(6,0) DEFAULT '2', `pdtret3` decimal(6,0) DEFAULT '2', `pdtret4` decimal(6,0) DEFAULT '2', `pdtret` char(8) NOT NULL, `pdttdc` char(1) NOT NULL, `pdtndc` char(8) NOT NULL, `pdtmonto` decimal(18,0) DEFAULT '2', `pdtcom1` char(80) NOT NULL, `pdtcom2` char(80) NOT NULL, `pdtcom3` char(80) NOT NULL, `pdtcom4` char(80) NOT NULL, `pdtdir` char(40) NOT NULL, `pdtfrm` decimal(2,0) DEFAULT '0', `pdtusui` char(30) NOT NULL, `pdtfbioi` date DEFAULT NULL, `pdthbioi` char(8) NOT NULL, `pdtusum` char(30) NOT NULL, `pdtfbiom` date DEFAULT NULL, `pdthbiom` char(8) NOT NULL, `pdt_cam2` decimal(18,0) DEFAULT '6', `pdt_cam3` decimal(18,0) DEFAULT '6', `pdt_cam4` decimal(18,0) DEFAULT '6', `pdt_cam5` decimal(18,0) DEFAULT '6', `pdt_modulo` decimal(2,0) DEFAULT '0', `pdtiva` char(8) NOT NULL, PRIMARY KEY (`pdtcod`,`pdtact`,`pdtcodfec`,`pdtcdc`,`pdtcdm`,`pdtcom`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `conpdt` -- LOCK TABLES `conpdt` WRITE; /*!40000 ALTER TABLE `conpdt` DISABLE KEYS */; /*!40000 ALTER TABLE `conpdt` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-10-30 17:39:25
true
6101a499a4d7e8008faccab0ddcfb4699a387be0
SQL
Shelog/ddarchiv
/ext_tables.sql
UTF-8
5,518
3
3
[]
no_license
# # Table structure for table 'tx_ddarchiv_domain_model_bestand' # CREATE TABLE tx_ddarchiv_domain_model_bestand ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, description text NOT NULL, provenience text NOT NULL, year_from int(4) DEFAULT '0' NOT NULL, year_to int(4) DEFAULT '0' NOT NULL, loc varchar(255) DEFAULT '' NOT NULL, longitude double(11,2) DEFAULT '0.00' NOT NULL, latitude double(11,2) DEFAULT '0.00' NOT NULL, image text NOT NULL, documents varchar(255) DEFAULT '' NOT NULL, persons varchar(255) DEFAULT '' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, t3ver_oid int(11) DEFAULT '0' NOT NULL, t3ver_id int(11) DEFAULT '0' NOT NULL, t3ver_wsid int(11) DEFAULT '0' NOT NULL, t3ver_label varchar(255) DEFAULT '' NOT NULL, t3ver_state tinyint(4) DEFAULT '0' NOT NULL, t3ver_stage int(11) DEFAULT '0' NOT NULL, t3ver_count int(11) DEFAULT '0' NOT NULL, t3ver_tstamp int(11) DEFAULT '0' NOT NULL, t3ver_move_id int(11) DEFAULT '0' NOT NULL, t3_origuid int(11) DEFAULT '0' NOT NULL, sys_language_uid int(11) DEFAULT '0' NOT NULL, l10n_parent int(11) DEFAULT '0' NOT NULL, l10n_diffsource mediumblob, PRIMARY KEY (uid), KEY parent (pid), KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY language (l10n_parent,sys_language_uid) ); # # Table structure for table 'tx_ddarchiv_domain_model_document' # CREATE TABLE tx_ddarchiv_domain_model_document ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, bestand_uid int(11) DEFAULT '0' NOT NULL, bestand_table tinytext NOT NULL, title varchar(255) DEFAULT '' NOT NULL, description varchar(255) DEFAULT '' NOT NULL, loc text NOT NULL, doc_date int(11) DEFAULT '0' NOT NULL, longitude double(11,2) DEFAULT '0.00' NOT NULL, latitude double(11,2) DEFAULT '0.00' NOT NULL, image text NOT NULL, persons varchar(255) DEFAULT '' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, t3ver_oid int(11) DEFAULT '0' NOT NULL, t3ver_id int(11) DEFAULT '0' NOT NULL, t3ver_wsid int(11) DEFAULT '0' NOT NULL, t3ver_label varchar(255) DEFAULT '' NOT NULL, t3ver_state tinyint(4) DEFAULT '0' NOT NULL, t3ver_stage int(11) DEFAULT '0' NOT NULL, t3ver_count int(11) DEFAULT '0' NOT NULL, t3ver_tstamp int(11) DEFAULT '0' NOT NULL, t3ver_move_id int(11) DEFAULT '0' NOT NULL, t3_origuid int(11) DEFAULT '0' NOT NULL, sys_language_uid int(11) DEFAULT '0' NOT NULL, l10n_parent int(11) DEFAULT '0' NOT NULL, l10n_diffsource mediumblob, PRIMARY KEY (uid), KEY parent (pid), KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY language (l10n_parent,sys_language_uid) ); # # Table structure for table 'tx_ddarchiv_domain_model_person' # CREATE TABLE tx_ddarchiv_domain_model_person ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, bestands varchar(255) DEFAULT '' NOT NULL, bestands varchar(255) DEFAULT '' NOT NULL, title varchar(255) DEFAULT '' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, firstname varchar(255) DEFAULT '' NOT NULL, birth_year int(11) DEFAULT '0' NOT NULL, birth_date int(11) DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, t3ver_oid int(11) DEFAULT '0' NOT NULL, t3ver_id int(11) DEFAULT '0' NOT NULL, t3ver_wsid int(11) DEFAULT '0' NOT NULL, t3ver_label varchar(255) DEFAULT '' NOT NULL, t3ver_state tinyint(4) DEFAULT '0' NOT NULL, t3ver_stage int(11) DEFAULT '0' NOT NULL, t3ver_count int(11) DEFAULT '0' NOT NULL, t3ver_tstamp int(11) DEFAULT '0' NOT NULL, t3ver_move_id int(11) DEFAULT '0' NOT NULL, t3_origuid int(11) DEFAULT '0' NOT NULL, sys_language_uid int(11) DEFAULT '0' NOT NULL, l10n_parent int(11) DEFAULT '0' NOT NULL, l10n_diffsource mediumblob, PRIMARY KEY (uid), KEY parent (pid), KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY language (l10n_parent,sys_language_uid) ); # # Table structure for table 'tx_ddarchiv_bestand_person_mm' # CREATE TABLE tx_ddarchiv_bestand_person_mm ( uid_local int(11) unsigned DEFAULT '0' NOT NULL, uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, sorting int(11) unsigned DEFAULT '0' NOT NULL, sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL, KEY uid_local (uid_local), KEY uid_foreign (uid_foreign) ); # # Table structure for table 'tx_ddarchiv_document_person_mm' # CREATE TABLE tx_ddarchiv_document_person_mm ( uid_local int(11) unsigned DEFAULT '0' NOT NULL, uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, sorting int(11) unsigned DEFAULT '0' NOT NULL, sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL, KEY uid_local (uid_local), KEY uid_foreign (uid_foreign) );
true
272c3fa18be1c6e0b755104177eb0be44129a3a7
SQL
IulioCesars/TwickyTube
/DB - Dumps/ObtenerVideosPopulares.sql
UTF-8
237
2.515625
3
[]
no_license
drop procedure if exists ObtenerVideosPopulares; delimiter $% CREATE DEFINER=`twickytube`@`%` PROCEDURE `ObtenerVideosPopulares`( in top int ) BEGIN select * from video where id_video > 0 order by vistas desc limit top; END $%
true
56a577f08bd63d83bc64f376a98a5917c8d8063c
SQL
RagunathanMV/Testdata
/oracle/default/TS21/TS21_01.sql
UTF-8
526
3.59375
4
[]
no_license
CREATE TABLE TS21_01.SUPPLIERS7 ( SUPPLIER_ID NUMBER(10), SUPPLIER_NAME VARCHAR2(20), SUPPLIER_ADDRESS VARCHAR2(20) ); CREATE TABLE TS21_01.ORDERS2 ( ORDER_NUMBER NUMBER(10), SUPPLIER_ID NUMBER(10), CITY VARCHAR2(20) ); CREATE OR REPLACE PROCEDURE TS21_01.CREATE_TAB_SUP_ORD_LEFT IS BEGIN CREATE TABLE TS21_01.SUP_ORD_LEFT AS SELECT SUPPLIERS7.SUPPLIER_ID, SUPPLIERS7.SUPPLIER_NAME, ORDERS2.ORDER_NUMBER FROM TS21_01.SUPPLIERS7 LEFT OUTER JOIN TS21_01.ORDERS2 ON SUPPLIERS7.SUPPLIER_ID = ORDERS2.SUPPLIER_ID; END; /
true
6492e1c46a9734d6066373a232382ccc2f2ad0af
SQL
ervinpepic/citrus_system
/db_citrus_system.sql
UTF-8
2,674
3.296875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost:8889 -- Generation Time: Mar 11, 2020 at 12:31 AM -- Server version: 5.7.26 -- PHP Version: 7.3.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database: `citrus_system` -- -- -------------------------------------------------------- -- -- Table structure for table `comments` -- CREATE TABLE `comments` ( `id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `email` varchar(50) NOT NULL, `comment_text` varchar(50) NOT NULL, `full_name` varchar(25) NOT NULL, `comment_status` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `comments` -- INSERT INTO `comments` (`id`, `product_id`, `email`, `comment_text`, `full_name`, `comment_status`) VALUES (1, 1, 'p@p.com', 'adsfdsaf', 'eee', 'unapproved'), (2, 6, 'pepic_ervin@ervin.de', 'lorem ipsum', 'Ervin Pepic', 'unapproved'), (3, 6, 'pepic_ervin@ervin.de', 'lorem ipsum', 'Ervin Pepic', 'approved'), (4, 6, 'e@e.com', 'lksdf;kdafjlda;s', 'eras', 'approved'), (5, 6, 'pppp@ppp.com', 'lksjhfkljadsf', 'N=Emel', 'approved'), (6, 2, 'name@example.com', 'Hello World Comment', 'John Doe', 'approved'), (7, 2, 'email@email.com', 'Hello', 'Another name', 'approved'); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` int(5) NOT NULL, `product_title` varchar(25) NOT NULL, `short_product_description` varchar(50) NOT NULL, `product_image` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `product_title`, `short_product_description`, `product_image`) VALUES (1, 'Ervin Pepic', 'Lorem Ipsum is simply dummy text', 'images/citrus.png'), (2, 'Emel Pepic', 'Grahovo', 'images/citrus.png'), (3, 'Erna Pepic', 'Bosna', 'images/citrus.png'), (4, 'Erna Pepic', 'Bosna', 'images/citrus.png'), (5, 'Mati Brdjanin', 'Rozaje', 'images/citrus.png'), (6, 'Neko', 'nesto', 'images/citrus.png'), (7, 'heheh', 'okoko', 'images/citrus.png'), (8, 'adsfsadf', 'asdfdsf', 'images/citrus.png'), (9, 'lkjlkjj', 'ijnhjk', 'images/citrus.png'); -- -- Indexes for dumped tables -- -- -- Indexes for table `comments` -- ALTER TABLE `comments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `comments` -- ALTER TABLE `comments` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
true
78b4ab7ab1f4ec52ae0c9e6458920dfe042f34d9
SQL
khalilAlsulaimani/MySql_practical
/hotel edits.sql
UTF-8
671
3.265625
3
[]
no_license
select * from hotel where hotel_id='ch01'; alter table hotel add COLUMN hotel_manager varchar(20); select * from hotel; alter table hotel drop column hotel_manager; select * from hotel; alter table hotel add column receptionist varchar(20); UPDATE `hoteldb`.`hotel` SET `receptionist` = 'mark' WHERE (`hotel_id` = 'ch01'); UPDATE `hoteldb`.`hotel` SET `receptionist` = 'king' WHERE (`hotel_id` = 'ch02'); UPDATE `hoteldb`.`hotel` SET `receptionist` = 'kyle' WHERE (`hotel_id` = 'ch03'); #ALTER TABLE table_name # RENAME TO new_table_name; create table Test( test varchar(3) ); select * from test1; alter table test rename to test1; drop table test1;
true
adc82ed5cc3708e1f7834a43c29ee0c5d32652d2
SQL
mbilalbark/degirmen-api
/degirmen.sql
UTF-8
5,820
3.015625
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Anamakine: 127.0.0.1 -- Üretim Zamanı: 05 Tem 2018, 00:43:12 -- Sunucu sürümü: 5.7.17 -- PHP Sürümü: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Veritabanı: `degirmen` -- -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `hesap` -- CREATE TABLE `hesap` ( `Id` int(11) NOT NULL, `musteriId` int(11) NOT NULL, `acıklama` varchar(250) COLLATE utf8mb4_turkish_ci NOT NULL, `borc` double NOT NULL, `kdv` double NOT NULL, `alacak` double NOT NULL, `bakiye` double NOT NULL, `tarih` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci; -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `log` -- CREATE TABLE `log` ( `Id` int(11) NOT NULL, `acıklama` varchar(250) COLLATE utf8mb4_turkish_ci NOT NULL, `tarih` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci; -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `musteri` -- CREATE TABLE `musteri` ( `Id` int(11) NOT NULL, `sirketAdi` varchar(100) COLLATE utf8mb4_turkish_ci NOT NULL, `bankaAdi` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL, `hesapNo` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL, `telefon` varchar(15) COLLATE utf8mb4_turkish_ci NOT NULL, `faks` varchar(15) COLLATE utf8mb4_turkish_ci NOT NULL, `vergiDairesi` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL, `adres` varchar(100) COLLATE utf8mb4_turkish_ci NOT NULL, `bakiye` double NOT NULL, `deletedAt` date NOT NULL DEFAULT '0000-00-00' ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci; -- -- Tablo döküm verisi `musteri` -- INSERT INTO `musteri` (`Id`, `sirketAdi`, `bankaAdi`, `hesapNo`, `telefon`, `faks`, `vergiDairesi`, `adres`, `bakiye`, `deletedAt`) VALUES (1, 'Karaaslan Un San', 'banka adi', '580580301', '0312 338 87 33', '0312 540 45 45', 'vergi dairesi', 'baÄŸlarbaşı mah vezir çifliÄŸi', 0, '0000-00-00'), (5, 'asd', 'banka adı', 'banka adı', '', '654654', 'zxczxc', 'qweasd', 0.3, '2018-06-29'), (6, 'bilal bakr ÅŸirketleri', 'banka adı', 'banka adı', '0312 0312 1231', '505 123 123123', '555 555 55', 'baÄŸlarbaşı mah', 0, '2018-06-29'), (7, 'asd', 'asd', 'asd', 'asd', 'asd', 'asd', 'asd', 0, '0000-00-00'), (8, 'asd', 'asd', 'asd', 'asd', 'asd', 'asd', 'asd', 0, '0000-00-00'), (9, 'ÅŸirket adı', 'banka adı', 'banka adı', 'telefon', 'faks', 'vergi dairesi', 'adres', 0, '0000-00-00'), (10, 'qwe', '123', '123', 'qwe', 'qwe', 'qwe', 'qwe', 0, '0000-00-00'), (11, 'bilal', 'asdasd', 'asdasd', 'asd', 'q231', 'asd', 'asd', 0, '2018-06-29'), (12, 'qwe', 'qwe', 'qwe', 'qwe', 'qwe', 'qwe', 'qwe', 0, '0000-00-00'); -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `urun` -- CREATE TABLE `urun` ( `Id` int(11) NOT NULL, `cinsi` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL, `kg` double NOT NULL, `fiyat` double NOT NULL, `kdv` double NOT NULL, `deletedAt` date NOT NULL DEFAULT '0000-00-00' ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci; -- -- Tablo döküm verisi `urun` -- INSERT INTO `urun` (`Id`, `cinsi`, `kg`, `fiyat`, `kdv`, `deletedAt`) VALUES (1, 'Kırmızı un', 50, 50, 8, '0000-00-00'), (2, 'Mavi Un', 8, 8, 8, '0000-00-00'), (3, 'Kepek', 50, 50, 0, '0000-00-00'), (4, 'Buğday', 1, 1, 0.8, '0000-00-00'); -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `yonetici` -- CREATE TABLE `yonetici` ( `Id` int(11) NOT NULL, `adSoy` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL, `sifre` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL, `email` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci; -- -- Tablo döküm verisi `yonetici` -- INSERT INTO `yonetici` (`Id`, `adSoy`, `sifre`, `email`) VALUES (1, 'bilal', 'asd', 1); -- -- Dökümü yapılmış tablolar için indeksler -- -- -- Tablo için indeksler `hesap` -- ALTER TABLE `hesap` ADD PRIMARY KEY (`Id`); -- -- Tablo için indeksler `log` -- ALTER TABLE `log` ADD PRIMARY KEY (`Id`); -- -- Tablo için indeksler `musteri` -- ALTER TABLE `musteri` ADD PRIMARY KEY (`Id`); -- -- Tablo için indeksler `urun` -- ALTER TABLE `urun` ADD PRIMARY KEY (`Id`); -- -- Tablo için indeksler `yonetici` -- ALTER TABLE `yonetici` ADD PRIMARY KEY (`Id`); -- -- Dökümü yapılmış tablolar için AUTO_INCREMENT değeri -- -- -- Tablo için AUTO_INCREMENT değeri `hesap` -- ALTER TABLE `hesap` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; -- -- Tablo için AUTO_INCREMENT değeri `log` -- ALTER TABLE `log` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; -- -- Tablo için AUTO_INCREMENT değeri `musteri` -- ALTER TABLE `musteri` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- Tablo için AUTO_INCREMENT değeri `urun` -- ALTER TABLE `urun` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- Tablo için AUTO_INCREMENT değeri `yonetici` -- ALTER TABLE `yonetici` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
17d6b63d4e89f2f77c9c18395826ddf00ed17266
SQL
annaymj/SQL
/TripsAndUsers.sql
UTF-8
3,693
4.40625
4
[]
no_license
The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at the Users table. Status is an ENUM type of (‘completed’, ‘cancelled_by_driver’, ‘cancelled_by_client’). +----+-----------+-----------+---------+--------------------+----------+ | Id | Client_Id | Driver_Id | City_Id | Status |Request_at| +----+-----------+-----------+---------+--------------------+----------+ | 1 | 1 | 10 | 1 | completed |2013-10-01| | 2 | 2 | 11 | 1 | cancelled_by_driver|2013-10-01| | 3 | 3 | 12 | 6 | completed |2013-10-01| | 4 | 4 | 13 | 6 | cancelled_by_client|2013-10-01| | 5 | 1 | 10 | 1 | completed |2013-10-02| | 6 | 2 | 11 | 6 | completed |2013-10-02| | 7 | 3 | 12 | 6 | completed |2013-10-02| | 8 | 2 | 12 | 12 | completed |2013-10-03| | 9 | 3 | 10 | 12 | completed |2013-10-03| | 10 | 4 | 13 | 12 | cancelled_by_driver|2013-10-03| +----+-----------+-----------+---------+--------------------+----------+ The Users table holds all users. Each user has an unique Users_Id, and Role is an ENUM type of (‘client’, ‘driver’, ‘partner’). +----------+--------+--------+ | Users_Id | Banned | Role | +----------+--------+--------+ | 1 | No | client | | 2 | Yes | client | | 3 | No | client | | 4 | No | client | | 10 | No | driver | | 11 | No | driver | | 12 | No | driver | | 13 | No | driver | +----------+--------+--------+ Write a SQL query to find the cancellation rate of requests made by unbanned users (both client and driver must be unbanned) between Oct 1, 2013 and Oct 3, 2013. The cancellation rate is computed by dividing the number of canceled (by client or driver) requests made by unbanned users by the total number of requests made by unbanned users. For the above tables, your SQL query should return the following rows with the cancellation rate being rounded to two decimal places. +------------+-------------------+ | Day | Cancellation Rate | +------------+-------------------+ | 2013-10-01 | 0.33 | | 2013-10-02 | 0.00 | | 2013-10-03 | 0.50 | +------------+-------------------+ /* 1. First filtered out valid client_ID and Driver_ID, and date between Oct 1, 2013 and Oct 3, 2013 2. count the number of cancelled rides, and count the number the total rides, take division and get cancellation rate, round to 2 digits 3. group by date */ # Write your MySQL query statement below /* select Request_at as "Day", round(sum(case when Status = 'completed' then 0 else 1 end)/count(*),2) as "Cancellation Rate" from Trips where Client_ID in (select Users_Id as client_ID from Users where banned = "No" and Role = "client") and Driver_Id in (select Users_Id as Driver_Id from Users where banned = "No" and Role = "driver") and Request_at between '2013-10-01' and '2013-10-03' group by Request_at */ select Request_at as "Day", round(sum(if(Status = 'completed',0,1))/count(*),2) as "Cancellation Rate" from Trips where Client_ID in (select Users_Id as client_ID from Users where banned = "No" and Role = "client") and Driver_Id in (select Users_Id as Driver_Id from Users where banned = "No" and Role = "driver") and Request_at between '2013-10-01' and '2013-10-03' group by Request_at
true
b3302bd1ef57e705235522be7aab2bd3cbff2296
SQL
HeenaSisodia/SDETtraining
/SQL/SQLQueries_tillActivity6.sql
UTF-8
1,956
4.0625
4
[]
no_license
use employees; create database sdet4_heena; use sdet4_heena; CREATE TABLE salesman ( salesman_id int primary key, name varchar(20), city varchar(20), comission int ); describe salesman; Insert into salesman values (5001, 'James Hoog', 'New York', 15); Select * from salesman; Insert into salesman values (5002, 'Nail Knite', 'Paris', 13), (5005, 'Pit Alex', 'London', 11), (5006, 'McLyon', 'Paris', 14), (5007, 'Paul Adam', 'Rome', 13), (5003, 'Lauson Hen', 'San Jose', 12); Select salesman_id, city from salesman; Select * from salesman where city='Paris'; Select salesman_id, comission from salesman where name='Paul Adam'; Select salesman_id, comission from salesman where name='paul adam'; Alter table salesman add grade int; Update salesman set grade=200 where city ='Rome' ; Update salesman set grade=300 where name ='James Hoog' ; Update salesman set name='Pierre' where name ='McLyon' ; create table orders( order_no int primary key, purchase_amount float, order_date date, customer_id int, salesman_id int); -- Add values to the table insert into orders values (70001, 150.5, '2012-10-05', 3005, 5002), (70009, 270.65, '2012-09-10', 3001, 5005), (70002, 65.26, '2012-10-05', 3002, 5001), (70004, 110.5, '2012-08-17', 3009, 5003), (70007, 948.5, '2012-09-10', 3005, 5002), (70005, 2400.6, '2012-07-27', 3007, 5001), (70008, 5760, '2012-08-15', 3002, 5001), (70010, 1983.43, '2012-10-10', 3004, 5006), (70003, 2480.4, '2012-10-10', 3009, 5003), (70012, 250.45, '2012-06-27', 3008, 5002), (70011, 75.29, '2012-08-17', 3003, 5007), (70013, 3045.6, '2012-04-25', 3002, 5001); Select distinct salesman_id from orders; Select order_no, order_date from orders order by order_date; Select order_no, purchase_amount from orders order by purchase_amount desc; Select * from orders where purchase_amount<500; Select * from orders where purchase_amount BETWEEN 1000 and 2000;
true
71613c36a1e0f095c018ef9bf404e892e89aa2ac
SQL
hillangat/Hunter
/src/main/webapp/resources/dms/GET_RGN_LVL_NMS_FOR_CNTIES.sql
UTF-8
3,273
3.34375
3
[]
no_license
create or replace PROCEDURE GET_RGN_LVL_NMS_FOR_CNTIES ( COUNTRY_NAM IN VARCHAR2 DEFAULT null , CMM_SPRTD_CNTIS IN VARCHAR2 DEFAULT null, OUTPUT_REGION_NAME OUT VARCHAR2 ) AS l_count binary_integer; l_array dbms_utility.lname_array; curr_county cnty.CNTY_NAM%TYPE := null; curr_constituency CNSTTNCY.CNSTTNCY_NAM%TYPE := null; curr_constituency_wrd CNSTTNCY_WRD.WRD_NAM%TYPE := null; total_name varchar2(4000) := ''; total_cons varchar2(2000) := ''; total_cons_wrd varchar2(2000) := ''; CURSOR cons_nams_cursor IS SELECT cns.CNSTTNCY_NAM, cns.CNSTTNCY_ID, cns.CNTY_ID, cn.CNTY_NAM FROM CNSTTNCY cns, CNTRY cntry, cnty cn WHERE cns.CNTY_ID = cn.CNTY_ID AND cn.CNTRY_ID = cntry.CNTRY_ID and cntry.CNTRY_NAM = COUNTRY_NAM order by cn.CNTY_NAM, cns.CNSTTNCY_NAM asc; CURSOR cons_wrds_nams_cursor IS SELECT cns.CNTY_ID, cn.CNTY_NAM,wrd.WRD_ID, cns.CNSTTNCY_NAM, cns.CNSTTNCY_ID, wrd.WRD_NAM FROM CNSTTNCY cns, CNTRY cntry, cnty cn, CNSTTNCY_WRD wrd WHERE wrd.CNSTTNCY_ID = cns.CNSTTNCY_ID AND cns.CNTY_ID = cn.CNTY_ID AND cn.CNTRY_ID = cntry.CNTRY_ID and cntry.CNTRY_NAM = COUNTRY_NAM order by cn.CNTY_NAM, cns.CNSTTNCY_NAM, wrd.WRD_NAM asc; BEGIN dbms_utility.comma_to_table( list => regexp_replace(CMM_SPRTD_CNTIS,'(^|,)','\1x'), tablen => l_count, tab => l_array); dbms_output.put_line('Number of counties passed in >> ' || l_count); for i in 1 .. l_count loop curr_county := substr(l_array(i),2); dbms_output.put_line('>>>>>>>>> ' || curr_county); FOR consRcrd IN cons_nams_cursor LOOP IF(consRcrd.CNTY_NAM = curr_county) THEN if(curr_constituency is null)then curr_constituency := consRcrd.CNSTTNCY_NAM; end if; IF(curr_constituency != consRcrd.CNSTTNCY_NAM) THEN dbms_output.put_line(consRcrd.CNSTTNCY_NAM); total_cons := total_cons || ',' || consRcrd.CNSTTNCY_NAM; curr_constituency := consRcrd.CNSTTNCY_NAM; FOR consWrdRcrd IN cons_wrds_nams_cursor LOOP IF(consWrdRcrd.CNSTTNCY_ID = consRcrd.CNSTTNCY_ID ) THEN IF(curr_constituency_wrd is null) THEN curr_constituency_wrd := consWrdRcrd.WRD_NAM; END IF; IF(curr_constituency_wrd != consWrdRcrd.WRD_NAM)THEN curr_constituency_wrd := consWrdRcrd.WRD_NAM; dbms_output.put_line('==' || curr_constituency_wrd); total_cons_wrd := total_cons_wrd || ',' || curr_constituency_wrd; ELSE --dbms_output.put_line(consWrdRcrd.WRD_NAM || '*'); NULL; END IF; END IF; END LOOP; ELSE null; END IF; END IF; END LOOP; end loop; dbms_output.put_line('All counties >> ' || CMM_SPRTD_CNTIS); dbms_output.put_line('All cons >> ' || total_cons); dbms_output.put_line('All cons wards >> ' || total_cons_wrd); OUTPUT_REGION_NAME := CMM_SPRTD_CNTIS || total_cons || total_cons_wrd; dbms_output.put_line('Final OUTPUT_REGION_NAME >>>>>> ' || OUTPUT_REGION_NAME); END GET_RGN_LVL_NMS_FOR_CNTIES;
true
c42885e376bbc0d9273ea1e4396845f3de89710e
SQL
siposalex24/eCabgine
/app/sql/ecabgine1.sql
UTF-8
12,563
3.03125
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Feb 24, 2021 at 08:24 PM -- Server version: 5.7.31 -- PHP Version: 7.3.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `ecabgine1` -- -- -------------------------------------------------------- -- -- Table structure for table `analysis` -- DROP TABLE IF EXISTS `analysis`; CREATE TABLE IF NOT EXISTS `analysis` ( `id_analysis` int(4) NOT NULL AUTO_INCREMENT, `analysis_name` varchar(50) NOT NULL, PRIMARY KEY (`id_analysis`), KEY `analysis_name` (`analysis_name`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `analysis` -- INSERT INTO `analysis` (`id_analysis`, `analysis_name`) VALUES (4, 'Acid Uric'), (3, 'ASAT, ALAT, Bilirubina'), (8, 'Examen sumar de urina'), (2, 'Glicemie'), (6, 'Hemoleucograma+trombociti'), (5, 'Ionograma'), (7, 'IP, INR, TQ, APTT'), (9, 'Test de toleranta la glucoza p'), (1, 'Uree, creatinina'); -- -------------------------------------------------------- -- -- Table structure for table `cabinet` -- DROP TABLE IF EXISTS `cabinet`; CREATE TABLE IF NOT EXISTS `cabinet` ( `id_cabinet` int(4) NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL, `address` varchar(50) NOT NULL, `telephone` varchar(10) NOT NULL, `email` varchar(20) NOT NULL, `tax_identification_code` varchar(10) NOT NULL, `trade_register_number` varchar(15) NOT NULL, `IBAN` varchar(13) NOT NULL, PRIMARY KEY (`id_cabinet`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `cabinet` -- INSERT INTO `cabinet` (`id_cabinet`, `name`, `address`, `telephone`, `email`, `tax_identification_code`, `trade_register_number`, `IBAN`) VALUES (1, 'Gine3', 'str. Short Martin no. 18', '0364812623', 'gine3@office.com', 'Ro123456', 'J12/123456/2000', 'RO4231BCR1781'); -- -------------------------------------------------------- -- -- Table structure for table `city` -- DROP TABLE IF EXISTS `city`; CREATE TABLE IF NOT EXISTS `city` ( `id_city` int(4) NOT NULL AUTO_INCREMENT, `id_county` int(4) NOT NULL, `city` varchar(50) NOT NULL, PRIMARY KEY (`id_city`), KEY `id_judet` (`id_county`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `city` -- INSERT INTO `city` (`id_city`, `id_county`, `city`) VALUES (1, 1, 'Cluj-Napoca'), (2, 2, 'Alba-Iulia'); -- -------------------------------------------------------- -- -- Table structure for table `consult` -- DROP TABLE IF EXISTS `consult`; CREATE TABLE IF NOT EXISTS `consult` ( `id_consult` int(4) NOT NULL AUTO_INCREMENT, `id_user` int(4) NOT NULL, `id_patient` int(4) NOT NULL, `date` datetime NOT NULL, `last_period` date NOT NULL, `climax` tinyint(4) NOT NULL, `menstrual_cycle` text NOT NULL, `births` int(2) NOT NULL, `abortions` int(2) NOT NULL, `antecedents` text NOT NULL, `consult_reason` varchar(100) DEFAULT NULL, `observations` text, `id_exam` int(4) NOT NULL, `diagnostic` varchar(100) NOT NULL, `recommendations` text, `id_anal` int(4) NOT NULL, `treatment` text NOT NULL, PRIMARY KEY (`id_consult`), KEY `id_user` (`id_user`), KEY `id_patient` (`id_patient`), KEY `id_exam` (`id_exam`), KEY `id_anal` (`id_anal`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `consult` -- INSERT INTO `consult` (`id_consult`, `id_user`, `id_patient`, `date`, `last_period`, `climax`, `menstrual_cycle`, `births`, `abortions`, `antecedents`, `consult_reason`, `observations`, `id_exam`, `diagnostic`, `recommendations`, `id_anal`, `treatment`) VALUES (1, 1, 1, '2021-01-13 00:10:22', '2021-01-09', 1, 'no', 1, 0, 'No', 'edad', 'dada', 0, '', 'da', 0, ''); -- -------------------------------------------------------- -- -- Table structure for table `consult_analysis` -- DROP TABLE IF EXISTS `consult_analysis`; CREATE TABLE IF NOT EXISTS `consult_analysis` ( `id_anal` int(4) NOT NULL AUTO_INCREMENT, `id_analyses` int(4) NOT NULL, `id_consult` int(11) NOT NULL, PRIMARY KEY (`id_anal`), UNIQUE KEY `id_analysis` (`id_analyses`), KEY `id_alalysis` (`id_analyses`), KEY `id_consult` (`id_consult`), KEY `id_analysis_2` (`id_analyses`), KEY `id_analysis_3` (`id_analyses`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `consult_analysis` -- INSERT INTO `consult_analysis` (`id_anal`, `id_analyses`, `id_consult`) VALUES (1, 1, 1), (3, 2, 1), (4, 3, 1), (5, 4, 1), (6, 5, 1), (7, 6, 1), (8, 7, 1), (9, 8, 1), (10, 9, 1); -- -------------------------------------------------------- -- -- Table structure for table `consult_examinations` -- DROP TABLE IF EXISTS `consult_examinations`; CREATE TABLE IF NOT EXISTS `consult_examinations` ( `id_exam` int(4) NOT NULL AUTO_INCREMENT, `id_examination` int(4) NOT NULL, `id_consult` int(4) NOT NULL, `price` int(5) NOT NULL, PRIMARY KEY (`id_exam`), KEY `id_examination` (`id_examination`), KEY `id_analysis` (`id_consult`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `county` -- DROP TABLE IF EXISTS `county`; CREATE TABLE IF NOT EXISTS `county` ( `id_county` int(4) NOT NULL AUTO_INCREMENT, `county` varchar(30) NOT NULL, PRIMARY KEY (`id_county`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `county` -- INSERT INTO `county` (`id_county`, `county`) VALUES (1, 'Cluj'), (2, 'Alba'); -- -------------------------------------------------------- -- -- Table structure for table `examinations` -- DROP TABLE IF EXISTS `examinations`; CREATE TABLE IF NOT EXISTS `examinations` ( `id_examination` int(4) NOT NULL AUTO_INCREMENT, `examination_name` varchar(30) NOT NULL, `price` int(5) NOT NULL, PRIMARY KEY (`id_examination`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `invoices` -- DROP TABLE IF EXISTS `invoices`; CREATE TABLE IF NOT EXISTS `invoices` ( `id_invoice` int(4) NOT NULL, `series` varchar(3) NOT NULL, `number` int(5) NOT NULL, `date` date NOT NULL, `id_cabinet` int(4) NOT NULL, `id_patient` int(4) NOT NULL, `id_consult` int(4) NOT NULL, `id_exam` int(4) NOT NULL, PRIMARY KEY (`id_invoice`), KEY `id_cabinet` (`id_cabinet`), KEY `id_consult` (`id_consult`), KEY `id_patient` (`id_patient`), KEY `id_exam` (`id_exam`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `medical_letter` -- DROP TABLE IF EXISTS `medical_letter`; CREATE TABLE IF NOT EXISTS `medical_letter` ( `id_letter` int(4) NOT NULL AUTO_INCREMENT, `id_patient` int(4) NOT NULL, `id_consult` int(4) NOT NULL, `id_user` int(4) NOT NULL, `id_cabinet` int(4) NOT NULL, PRIMARY KEY (`id_letter`), KEY `id_patient` (`id_patient`), KEY `id_consult` (`id_consult`), KEY `id_user` (`id_user`), KEY `id_cabinet` (`id_cabinet`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `patients` -- DROP TABLE IF EXISTS `patients`; CREATE TABLE IF NOT EXISTS `patients` ( `id_patient` int(4) NOT NULL AUTO_INCREMENT, `first_name` varchar(30) NOT NULL, `last_name` varchar(30) NOT NULL, `identification_number` varchar(13) NOT NULL, `date_of_birth` date NOT NULL, `id_county` int(4) DEFAULT NULL, `id_city` int(4) DEFAULT NULL, `address` varchar(100) DEFAULT NULL, `ocuppation` varchar(20) DEFAULT NULL, `job` varchar(30) DEFAULT NULL, `telephone` varchar(10) DEFAULT NULL, `email` varchar(50) DEFAULT NULL, `civil_status` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id_patient`), KEY `id_county` (`id_county`) USING BTREE, KEY `id_city` (`id_city`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `patients` -- INSERT INTO `patients` (`id_patient`, `first_name`, `last_name`, `identification_number`, `date_of_birth`, `id_county`, `id_city`, `address`, `ocuppation`, `job`, `telephone`, `email`, `civil_status`) VALUES (1, 'Maria', 'Pop', '2751123192128', '1975-11-23', 1, 1, 'str. lalelelor nr 2. ap. 12', 'seller', 'seller', '0364812623', 'mariapop@yahoo.com', 1), (2, 'Lazar', 'Marian', '1234567891234', '1992-02-03', 1, 1, 'Strada Ciresilor Nr. 1', 'Muncitor', 'Portar', '0748989898', 'lazar.marian@yahoo.com', 1), (3, 'Jason', 'Medeiros', '9876543210123', '1975-10-20', 2, 2, 'Strada Berii Nr. 6', 'Muncitor', 'Inginer', '0743757575', 'mrjmedeiros@gmail.com', 1), (5, 'alexandru', 'vasilache', '1925524603121', '2021-02-17', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (6, 'fafafafada', 'gsagfagfs', '123456789123', '2021-02-12', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (7, 'sfsfs', 'fsfsfs', '2342424242424', '2021-02-10', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (8, 'dadada', 'dadadadada', '2131312313213', '2021-02-05', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (9, 'ahahaha', 'afewqdfwda', '213131313132', '2021-05-07', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (10, 'hr5thetherwertw', 'hweterfeffre', '1231313131313', '2021-05-06', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (20, 'sgsfsfsfsgs', 'fsfsfsfsf', '2424242426345', '0000-00-00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (21, 'dgdgdegdgs', 'hdgdgsfs', '4525252542525', '0000-00-00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; CREATE TABLE IF NOT EXISTS `users` ( `id` int(4) NOT NULL AUTO_INCREMENT, `email` varchar(30) NOT NULL, `password` varchar(200) NOT NULL, `firstname` varchar(30) NOT NULL, `lastname` varchar(30) NOT NULL, `title` varchar(15) NOT NULL, `signature` blob, `is_admin` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `email`, `password`, `firstname`, `lastname`, `title`, `signature`, `is_admin`) VALUES (1, 'doctor@gmail.com', '$2y$10$w.0LrU7Jcemf4rktajdJuOJtgKen0nUxcyecYbOGFOQru87IQrWKK', 'Ion', 'Pop', 'Dr', '', NULL); -- -- Constraints for dumped tables -- -- -- Constraints for table `city` -- ALTER TABLE `city` ADD CONSTRAINT `city_ibfk_1` FOREIGN KEY (`id_county`) REFERENCES `county` (`id_county`); -- -- Constraints for table `consult_analysis` -- ALTER TABLE `consult_analysis` ADD CONSTRAINT `consult_analysis_ibfk_3` FOREIGN KEY (`id_consult`) REFERENCES `consult` (`id_consult`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `consult_analysis_ibfk_4` FOREIGN KEY (`id_analyses`) REFERENCES `analysis` (`id_analysis`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `consult_examinations` -- ALTER TABLE `consult_examinations` ADD CONSTRAINT `consult_examinations_ibfk_1` FOREIGN KEY (`id_examination`) REFERENCES `examinations` (`id_examination`), ADD CONSTRAINT `consult_examinations_ibfk_2` FOREIGN KEY (`id_consult`) REFERENCES `consult` (`id_consult`); -- -- Constraints for table `invoices` -- ALTER TABLE `invoices` ADD CONSTRAINT `invoices_ibfk_2` FOREIGN KEY (`id_cabinet`) REFERENCES `cabinet` (`id_cabinet`), ADD CONSTRAINT `invoices_ibfk_3` FOREIGN KEY (`id_consult`) REFERENCES `consult` (`id_consult`); -- -- Constraints for table `medical_letter` -- ALTER TABLE `medical_letter` ADD CONSTRAINT `medical_letter_ibfk_2` FOREIGN KEY (`id_patient`) REFERENCES `patients` (`id_patient`), ADD CONSTRAINT `medical_letter_ibfk_3` FOREIGN KEY (`id_cabinet`) REFERENCES `cabinet` (`id_cabinet`), ADD CONSTRAINT `medical_letter_ibfk_4` FOREIGN KEY (`id_consult`) REFERENCES `consult` (`id_consult`); -- -- Constraints for table `patients` -- ALTER TABLE `patients` ADD CONSTRAINT `patients_ibfk_2` FOREIGN KEY (`id_city`) REFERENCES `city` (`id_city`), ADD CONSTRAINT `patients_ibfk_3` FOREIGN KEY (`id_county`) REFERENCES `county` (`id_county`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
5df51e3668125b977ee7514d1ffdc6f51031cd12
SQL
FishMage/Postgres
/q2.sql
UTF-8
743
3.203125
3
[]
no_license
--q2a ALTER TABLE inproceedings Add column Area text; --q2b --database update inproceedings set Area = 'Database' where booktitle = 'SIGMOD Conference' or booktitle = 'VLDB' or booktitle = 'ICDE' or booktitle = 'PODS'; --Theory update inproceedings set Area = 'Theory' where booktitle = 'STOC' or booktitle = 'SODA' or booktitle = 'ICALP' or booktitle = 'FOCS'; --Systems update inproceedings set Area = 'Systems' where booktitle = 'SIGCOMM' or booktitle = 'ISCA' or booktitle = 'HPCA' or booktitle = 'PLDI'; --ML-AI update inproceedings set Area = 'ML-AI' where booktitle = 'ICML' or booktitle = 'NIPS' or booktitle = 'AAAI' or booktitle = 'IJCAI'; --Set other to UNKOWN update inproceedings set AREA = 'UNKNOWN' where Area is NULL;
true
f887fbda34bd4064232378e97a36879eadc67f71
SQL
tantiancai/php-handwriting
/资料/数据库.sql
UTF-8
4,637
3.40625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.2.0.1 -- http://www.phpmyadmin.net -- -- 主机: localhost -- 生成日期: 2009 年 10 月 08 日 04:19 -- 服务器版本: 5.1.36 -- PHP 版本: 5.3.0 SET character_set_connection=latin1, character_set_results=latin1, character_set_client=binary; SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- 数据库: `hdwg` -- CREATE DATABASE IF NOT EXISTS `hdwg` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; use `hdwg`; -- -------------------------------------------------------- -- -- 表的结构 `tomoe_character` -- DROP TABLE IF EXISTS `tomoe_character`; CREATE TABLE IF NOT EXISTS `tomoe_character` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键,自增', `character` varchar(6) COLLATE utf8_bin DEFAULT NULL COMMENT '字符名称', `src` varchar(500) COLLATE utf8_bin DEFAULT NULL COMMENT '汉字解释的路径', `original_char` varchar(6) COLLATE utf8_bin DEFAULT NULL COMMENT '对应的正字', `feature` longtext COLLATE utf8_bin DEFAULT NULL COMMENT '特征值', `first_stroke_type` int(3) NOT NULL DEFAULT '0' COMMENT '首笔类型(横竖撇点折,可能有多种首笔),以二进制方式存储', `min_n_strokes` int(11) NOT NULL DEFAULT '-1' COMMENT '只有写满这么多笔画才会显示该字,为了减小数据库负荷,请慎重设置', `max_n_strokes` int(11) NOT NULL DEFAULT '-1' COMMENT '超过这个数字时,不会显示该字', `rank` int(11) DEFAULT '0' COMMENT '级别,未分类:0,3500常用字:1,GB2312:2,Ext-A:3,Ext-B:4,Ext-C:5', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='汉字信息表' AUTO_INCREMENT=1 ; -- ALTER TABLE `tomoe_character` CHANGE `img_src` `img_src` varchar( 500 ) COLLATE utf8_bin DEFAULT NULL COMMENT '汉字图片的路径'; -- ALTER TABLE `tomoe_character` CHANGE `src` `src` varchar( 500 ) COLLATE utf8_bin DEFAULT NULL COMMENT '汉字解释的路径'; -- ALTER TABLE `tomoe_character` ADD `thumb_src` varchar( 500 ) COLLATE utf8_bin DEFAULT NULL COMMENT '缩略图路径' AFTER `character`; -- ALTER TABLE `tomoe_character` ADD `feature` longtext COLLATE utf8_bin DEFAULT NULL COMMENT '特征值' AFTER `original_char`; -- -------------------------------------------------------- -- INSERT INTO `tomoe_character` (`character`,`src`, `original_char`, `feature`, `first_stroke_type`, `min_n_strokes`, `max_n_strokes`, `rank`) VALUES -- ( '谈', 'http://www.zdic.net/zd/zi/ZdicE8ZdicB0Zdic88.htm', '谈', NULL, 0, -1, -1, 0), -- ( '𪚥', 'http://www.zdic.net/zd/zi3/ZdicF0ZdicAAZdic9AZdicA5.htm', '谈', NULL, 0, -1, -1, 0); DROP TABLE IF EXISTS `tomoe_char_img`; CREATE TABLE IF NOT EXISTS `tomoe_char_img` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT COMMENT '主键,自增', `char_id` INT( 11 ) NOT NULL COMMENT '字符ID', `description` VARCHAR( 500 ) COLLATE utf8_bin DEFAULT NULL COMMENT '描述', `img_src` VARCHAR( 500 ) COLLATE utf8_bin DEFAULT NULL COMMENT '汉字图片的路径', `thumbnail_src` VARCHAR( 500 ) DEFAULT NULL COMMENT '缩略图路径', PRIMARY KEY ( `id` ) ) ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT = '汉字图片表' AUTO_INCREMENT=1 ; -- INSERT INTO `tomoe_char_img` (`char_id`, `img_src`, `thumbnail_src`) VALUES -- ( 1, 'http://www.zdic.net/pic/1b/8C08.gif', 'http://www.zdic.net/zd/2s/46B1.gif' ), -- ( 2, 'http://www.zdic.net/pic/3b/2A6A5.gif', 'http://www.zdic.net/zd/3s/2A6A5.gif' ); -- -- 表的结构 `tomoe_writing` -- DROP TABLE IF EXISTS `tomoe_writing`; CREATE TABLE IF NOT EXISTS `tomoe_writing` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键,自增', `char_id` int(11) NOT NULL COMMENT '字符名称', `writing` longtext COLLATE utf8_bin NOT NULL COMMENT '笔迹', `user_id` int(11) DEFAULT NULL COMMENT '用户ID', `add_date` datetime DEFAULT NULL COMMENT '添加时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='笔迹表' AUTO_INCREMENT=1; -- -- 转存表中的数据 `tomoe_writing` -- -- -------------------------------------------------------- -- -- 表的结构 `user_info` -- DROP TABLE IF EXISTS `user_info`; CREATE TABLE IF NOT EXISTS `user_info` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键,自增', `user_id` int(11) DEFAULT NULL COMMENT '用户ID', `user_name` varchar(200) DEFAULT NULL COMMENT '用户名', `password` varchar(200) DEFAULT NULL COMMENT '密码', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='用户信息表' AUTO_INCREMENT=1;
true
b0ac89c1d3ee976570ebf049e73d36ee0362c19b
SQL
ClickHouse/ClickHouse
/tests/queries/0_stateless/01354_tuple_low_cardinality_array_mapped_bug.sql
UTF-8
440
3.28125
3
[ "Apache-2.0", "BSL-1.0" ]
permissive
SELECT arrayExists(x -> ((x.1) = 'pattern'), cast([tuple('a', 1)] as Array(Tuple(LowCardinality(String), UInt8)))); DROP TABLE IF EXISTS table; CREATE TABLE table (id Int32, values Array(Tuple(LowCardinality(String), Int32)), date Date) ENGINE MergeTree() PARTITION BY toYYYYMM(date) ORDER BY (id, date); SELECT count(*) FROM table WHERE (arrayExists(x -> ((x.1) = toLowCardinality('pattern')), values) = 1); DROP TABLE IF EXISTS table;
true
b81940b50ab08c0de3afac0e75d175d8caf49372
SQL
GerichoJB/Stuff
/Database Exercise/transactions.sql
UTF-8
381
2.65625
3
[]
no_license
CREATE TABLE IF NOT EXISTS `Qgiv`.`transactions` ( `idtransactions` INT(11) NOT NULL AUTO_INCREMENT, `amount` VARCHAR(45) NOT NULL, `status` VARCHAR(45) NOT NULL, `payment_type` VARCHAR(45) NOT NULL, `user_email` VARCHAR(45) NOT NULL, `timestamp` VARCHAR(45) NOT NULL, PRIMARY KEY (`idtransactions`)) ENGINE = InnoDB AUTO_INCREMENT = 6 DEFAULT CHARACTER SET = latin1
true
506b0e311a7bf42bc308e50b2d7ee792c446c505
SQL
leonards-ar/LaborGuru_SPM
/docs/design/mysql-initial-data.sql
UTF-8
5,655
3.078125
3
[]
no_license
-- Creation --create database spm; --GRANT ALL ON spm.* TO 'spm'@'localhost' IDENTIFIED BY 'java1234'; --GRANT ALL ON spm.* TO 'spm'@'%' IDENTIFIED BY 'java1234'; --FLUSH PRIVILEGES; -- Delete delete from tbl_profiles_permissions; delete from tbl_users_profiles; delete from tbl_profiles; delete from tbl_menu_items; delete from tbl_permissions; delete from tbl_users; delete from tbl_positions; delete from tbl_stores; delete from tbl_offices; -- Profiles insert into tbl_profiles (profile_id, name, description) values (1, 'ROLE_USER', 'Profile Desc'); insert into tbl_profiles (profile_id, name, description) values (2, 'ROLE_FAKE', 'Profile Desc'); -- Office insert into tbl_offices (office_id, name, type, parent_office_id) values (1,'Mac Donalds', 'A', null); -- Users insert into tbl_users (creation_date, email, user_id, last_update_date, login_count, name, password, status, surname, username) values (now(), 'mcapurro@gmail.com', 1, null, 0, 'Mariano', '1234', 0, 'Capurro', 'mcapurro'); insert into tbl_users (creation_date, email, user_id, last_update_date, login_count, name, password, status, surname, username) values (now(), 'cnunezre@gmail.com', 2, null, 0, 'Cristian', '1234', 0, 'Nuñez Rebolledo', 'cnunezre'); insert into tbl_users (creation_date, email, user_id, last_update_date, login_count, name, password, status, surname, username) values (now(), 'fbarrera@gmail.com', 3, null, 0, 'Federico', '1234', 0, 'Barrera Oro', 'fbarrera'); insert into tbl_users (creation_date, email, user_id, last_update_date, login_count, name, password, status, surname, username) values (now(), 'ignacio@laborguru.com', 4, null, 0, 'Ignacio', '1234', 0, 'Goris', 'igoris'); insert into tbl_users (creation_date, email, user_id, last_update_date, login_count, name, password, status, surname, username) values (now(), 'fake@fake.com', 5, null, 0, 'Fake', '1234', 0, 'User', 'fake'); insert into tbl_users_profiles (profile_id, user_id) values (1, 1); insert into tbl_users_profiles (profile_id, user_id) values (1, 2); insert into tbl_users_profiles (profile_id, user_id) values (1, 3); insert into tbl_users_profiles (profile_id, user_id) values (1, 4); insert into tbl_users_profiles (profile_id, user_id) values (2, 5); -- Permissions insert into tbl_permissions (permission_id, name, description) values (1, 'FREE_ACCESS', 'Dummy permission that all profiles should have'); insert into tbl_permissions (permission_id, name, description) values (2, 'VIEW_EMPLOYEE', 'View and query employees of the own store'); insert into tbl_permissions (permission_id, name, description) values (3, 'EDIT_EMPLOYEE', 'Edit existing employees of the own store'); insert into tbl_permissions (permission_id, name, description) values (4, 'CREATE_EMPLOYEE', 'Create new employees in the own store'); insert into tbl_permissions (permission_id, name, description) values (5, 'VIEW_STORE', 'View and query stores'); insert into tbl_permissions (permission_id, name, description) values (6, 'EDIT_STORE', 'Edit existing stores'); insert into tbl_permissions (permission_id, name, description) values (7, 'CREATE_STORE', 'Create new stores'); insert into tbl_profiles_permissions (permission_id, profile_id) values (1, 1); insert into tbl_profiles_permissions (permission_id, profile_id) values (2, 1); insert into tbl_profiles_permissions (permission_id, profile_id) values (3, 1); insert into tbl_profiles_permissions (permission_id, profile_id) values (4, 1); insert into tbl_profiles_permissions (permission_id, profile_id) values (5, 1); insert into tbl_profiles_permissions (permission_id, profile_id) values (6, 1); insert into tbl_profiles_permissions (permission_id, profile_id) values (7, 1); insert into tbl_profiles_permissions (permission_id, profile_id) values (1, 2); -- Menu Items insert into tbl_menu_items (menu_item_id, label_key, help_key, parent_id, permission_id, position, target) values (1, 'home.menu.label', 'HOME_MENU_HELP', null, 1, 0, '/home/home.action'); insert into tbl_menu_items (menu_item_id, label_key, help_key, parent_id, permission_id, position, target) values (2, 'employee.menu.label', 'EMPLOYEE_MENU_HELP', null, 2, 0, '/employee/employee_list.action'); insert into tbl_menu_items (menu_item_id, label_key, help_key, parent_id, permission_id, position, target) values (3, 'employee.submenu.list', 'EMPLOYEE_LIST_HELP', 2, 3, 1, '/employee/employee_list.action'); insert into tbl_menu_items (menu_item_id, label_key, help_key, parent_id, permission_id, position, target) values (4, 'employee.submenu.create', 'EMPLOYEE_ADD_HELP', 2, 4, 0, '/employee/employee_add.action'); insert into tbl_menu_items (menu_item_id, label_key, help_key, parent_id, permission_id, position, target) values (5, 'store.menu.label', 'STORE_MENU_HELP', null, 5, 0, '/store/store_list.action'); insert into tbl_menu_items (menu_item_id, label_key, help_key, parent_id, permission_id, position, target) values (6, 'store.submenu.list', 'STORE_LIST_HELP', 5, 6, 1, '/store/store_list.action'); insert into tbl_menu_items (menu_item_id, label_key, help_key, parent_id, permission_id, position, target) values (7, 'store.submenu.create', 'STORE_ADD_HELP', 5, 7, 0, '/store/store_add.action'); -- Store insert into tbl_stores (store_id, name, office_id) values (1,'microcentro', 1); -- Positions insert into tbl_positions (position_id, name, store_id) values (1, 'chef',1); insert into tbl_positions (position_id, name, store_id) values (2, 'waiter',1); insert into tbl_positions (position_id, name, store_id) values (3, 'cook',1); insert into tbl_positions (position_id, name, store_id) values (4, 'porter',1); commit;
true
e8a9bc65c050106d02032ac09151ced3b91d49a6
SQL
go2suresh1979/MyRepo
/Personal/Solaris/main/mgmt_sv/oracle/sql/old/createTomfClientConfig.sql
UTF-8
1,093
2.921875
3
[]
no_license
/* **---------------------------------------------------------------------------# ** ** Component: $Id: //ovo/main/mgmt_sv/oracle/sql/createTomfClientConfig.sql#1 $ ** Author: Tze Ken Soh ** Copyright: Totality Corporation, 2005. All Rights Reserved. ** Description: This script add TOMF client config table for OV ** **---------------------------------------------------------------------------# */ set echo on spool createTomfClientConfig.log prompt create Tomf_Client_Config table CREATE TABLE TOMF_CLIENT_CONFIG ( CLIENT VARCHAR2(30) NOT NULL, PARENT VARCHAR2(30), DATA_DIRECTORY VARCHAR2(255) NOT NULL, REMOTE_USER_NAME VARCHAR2(36) NOT NULL, REMOTE_HOST_NAME VARCHAR2(255) NOT NULL, REMOTE_SSH_PORT NUMBER NOT NULL, REMOTE_DATA_DIRECTORY VARCHAR2(255) NOT NULL ) PCTFREE 10 PCTUSED 40 TABLESPACE OPC_5 STORAGE ( MAXEXTENTS 999999999 ) ; ALTER TABLE TOMF_CLIENT_CONFIG ADD CONSTRAINT TOMF_CLIENT_CONFIG_PK PRIMARY KEY (CLIENT) spool off;
true
f4c7c9ee590034f36487bf7681378f485d35d9af
SQL
C-E-Campbell/sql-2-mini
/mini.sql
UTF-8
2,710
4.28125
4
[]
no_license
CREATE TABLE movie( movie_id SERIAL PRIMARY KEY, title TEXT NOT NULL, media_type_id INTEGER FOREIGN KEY(media_type_id) REFRENCES media_type(media_type_id) ) -- shortcut CREATE TABLE movie( movie_id SERIAL PRIMARY KEY, title TEXT NOT NULL, media_type_id INTEGER REFERENCES media_type(media_type_id) ) INSERT INTO movie(title, media_type_id) VALUES("Everyone died on tuesday", 3) ALTER TABLE movie ADD COLUMN genre_id INTEGER REFERENCES genre(genre_id) SELECT * from movie SELECT * FROM track WHERE genre_id IN (SELECT genre_id FROM genre WHERE name = 'Jazz' OR name = 'Blues') UPDATE employee SET phone = NULL WHERE EmployeeId = 1 SELECT * FROM customer WHERE company IS NULL; SELECT artst.name COUNT(*) FROM artist JOIN album ON(artist.artist_id = album.artist_id) GROUP BY artist.artist_id; SELECT artist.name, COUNT(*) FROM artist JOIN album ON(artist.artist_id = album.artist_id) GROUP BY artist.artist_id ORDER BY COUNT DESC; SELECT ar.artist_id, ar.name, COUNT(*) FROM artist ar JOIN album a ON ar.artist_id = a.artist_id GROUP BY ar.artist_id; -- JOINS SELECT * FROM invoice JOIN invoice_line ON invoice_line.invoice_id = invoice.invoice_id WHERE invoice_line.unit_price > 0.99; SELECT invoice.invoice_date, customer.first_name, customer.last_name, invoice.total FROM invoice JOIN customer ON customer.customer_id = invoice.customer_id SELECT customer.first_name, customer.last_name, customer.support_rep_id, employee.employee_id, employee.first_name, employee.last_name FROM customer JOIN employee ON customer.support_rep_id = employee.employee_id; SELECT album.title, artist.artist_id FROM album JOIN artist ON album.artist_id = artist.artist_id SELECT playlist.name, playlist_track.playlist_track_id FROM playlist JOIN playlist_track ON playlist_track.playlist_id = playlist.playlist_id WHERE playlist.name = 'Music' SELECT track.name FROM track JOIN playlist_track ON playlist_track.track_id = track.track_id WHERE playlist_track.playlist_id = 5 -- nested queries SELECT * FROM invoice WHERE invoice_id IN ( SELECT invoice_id FROM invoice_line WHERE unit_price > 0.99 ); SELECT * FROM playlist_track WHERE playlist_id IN(SELECT playlist_id FROM playlist WHERE name = 'Music') SELECT name FROM track WHERE track_id IN ( SELECT track_id FROM playlist_track WHERE playlist_id = 5 ); SELECT * FROM track WHERE genre_id IN ( SELECT genre_id FROM genre WHERE name = 'Comedy' ); SELECT * FROM track WHERE album_id IN ( SELECT album_id FROM album WHERE title = 'Fireball' ); -- Practicing updating Rows UPDATE customer SET phone = NULL WHERE fax IS NOT NULL UPDATE customer SET company = 'Self' WHERE company = NULL
true
e9b9426fe9dc4ec441cb1bb6f1b738c29b0c41ee
SQL
aleksei-khitev/knowledge_base
/1. Tech Skills/1. Языки программирования/2. Java Frameworks/1. Spring/examples/spring/src/main/resources/spring/transaction/ships.sql
UTF-8
22,346
2.578125
3
[]
no_license
insert into ship(id, type, ship_class, producer, cost, autonomy, link) values(1, 'Корвет', 'СР90 Убийца', 'Corellian Engineering Corporation', 2500000, 365, 'http://starforge.info/rebellion-ships/cr90-corellian-corvette/'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(1, 140, 59, 17); insert into ship_crew(ship_id, minimal, normal) values(1, 60, 84); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(1, 60, 950, 2, 8); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(1, 120, 880, 15, 138); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(1, 1, 6); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(1, 2, 2); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(1, 3, 1); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(1, 8, 1); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(1, 2, 6); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(1, 1, 60); insert into ship(id, type, ship_class, producer, cost, autonomy, link, comment) values(2, 'Фрегат', 'Пиканосец', 'Kuat Drive Yards', 4760000, 7, 'http://starforge.info/galactic-empire-ships/lancer-class-frigate/', '20 орудий ПВО-направленности. Может входить и биться в атмосфере'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(2, 250, null, null); insert into ship_crew(ship_id, minimal, normal) values(2, 375, 850); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(2, 40, null, 2, 15); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(2, 125, 800, 15, 138); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(2, 5, 20); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(2, 1, 2); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(2, 1, 40); insert into ship(id, type, ship_class, producer, cost, autonomy, link, comment) values(3, 'Эскортный фрегат', 'Небулон-Б II', 'Kuat Drive Yards', null, 1095, 'http://starforge.info/galactic-empire-ships/nebulon-b2-escort-frigate/', '40+ орудий включая турболазеры. 24 истребителя. Может входить и биться в атмосфере'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(3, 250, null, null); insert into ship_crew(ship_id, minimal, normal) values(3, 420, 1120); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(3, 40, 800, 2, 12); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(3, 130, 900, 20, 900); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(3, 6, 18); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(3, 7, 22); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(3, 8, 4); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(3, 1, 6); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(3, 2, 24); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(3, 1, 150); insert into ship(id, type, ship_class, producer, cost, autonomy, link, comment) values(4, 'Патрульный крейсер', 'Тартан', 'Damorian Manufacturing Corporation', 4200000, 365, 'http://starforge.info/galactic-empire-ships/tartan-class-patrol-cruiser/', 'Защита слабее, чем у каракки. Видимо, не входит в атмосферу'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(4, 250, null, null); insert into ship_crew(ship_id, minimal, normal) values(4, null, 70); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(4, 80, null, 2, 12); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(4, 90, 870, 15, 135); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(4, 9, 20); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(4, 1, 50); insert into ship(id, type, ship_class, producer, cost, autonomy, link, comment) values(5, 'Лёгкий крейсер', 'Каракка', 'Damorian Manufacturing Corporation', 19148000, 365, 'http://starforge.info/galactic-empire-ships/carrack-class-light-cruiser/', 'Скорость. Может входить и биться в атмосфере. 30+ различных орудий'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(5, 350, 72, 75); insert into ship_crew(ship_id, minimal, normal) values(5, 2, 1092); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(5, 80, 1050, 1, 12); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(5, 130, 1000, 15, 140); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(5, 10, 10); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(5, 8, 5); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(5, 11, 20); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(5, 1, 142); insert into ship(id, type, ship_class, producer, cost, autonomy, link, comment) values(6, 'Лёгкий зенитный крейсер', 'Каракка (Зен)', 'Damorian Manufacturing Corporation', 19148000, 365, 'http://starforge.info/galactic-empire-ships/carrack-class-light-cruiser/', 'Скорость. Может входить и биться в атмосфере. 30 различных орудий'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(6, 350, 72, 75); insert into ship_crew(ship_id, minimal, normal) values(6, 2, 1092); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(6, 80, 1050, 1, 12); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(6, 130, 1000, 15, 140); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(6, 10, 10); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(6, 7, 20); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(6, 11, 20); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(6, 1, 142); insert into ship(id, type, ship_class, producer, cost, autonomy, link) values(7, 'Тяжёлый крейсер', 'Дредноут v1', 'Rendili StarDrive', 35555000, 730, 'http://starforge.info/galactic-empire-ships/dreadnaught-class-heavy-cruiser/'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(7, 600, 117, 129); insert into ship_crew(ship_id, minimal, normal) values(7, 9000, 16000); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(7, 40, null, 2, 18); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(7, 115, 1680, 20, 253); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(7, 12, 10); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(7, 13, 20); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(7, 14, 10); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(7, 1, 1); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(7, 2, 12); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(7, 1, 3000); insert into ship(id, type, ship_class, producer, cost, autonomy, link) values(8, 'Тяжёлый крейсер', 'Дредноут v2', 'Rendili StarDrive', 35555000, 730, 'http://starforge.info/galactic-empire-ships/dreadnaught-class-heavy-cruiser/'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(8, 600, 117, 129); insert into ship_crew(ship_id, minimal, normal) values(8, 9000, 16000); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(8, 40, null, 2, 18); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(8, 115, 1680, 20, 253); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(8, 12, 15); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(8, 15, 15); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(8, 16, 20); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(8, 1, 1); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(8, 2, 12); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(8, 1, 3000); insert into ship(id, type, ship_class, producer, cost, autonomy, link, comment) values(9, 'Тяжёлый крейсер', 'Мститель', 'Sienar Fleet Systems', 43000000, 547, 'http://starforge.info/galactic-empire-ships/vindicator-class-heavy-cruiser/', 'Самодостаточный. Может выполнять задачи в одиночку. Эффективен и против малых судов'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(9, 600, null, null); insert into ship_crew(ship_id, minimal, normal) values(9, null, 2551); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(9, 40, null, 2, 8); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(9, 150, 1800, 20, 254); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(9, 14, 25); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(9, 16, 20); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(9, 17, 20); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(9, 11, 25); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(9, 8, 3); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(9, 1, 4); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(9, 2, 24); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(9, 1, 400); insert into ship(id, type, ship_class, producer, cost, autonomy, link, comment) values(10, 'Тяжёлый крейсер', 'Воспрещающий', 'Sienar Fleet Systems', 52240000, 365, 'http://starforge.info/galactic-empire-ships/interdictor-class-heavy-cruiser/', 'Колодцы'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(10, 600, 300, 100); insert into ship_crew(ship_id, minimal, normal) values(10, 1500, 2807); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(10, 60, null, 2, 8); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(10, 150, 1500, 20, 252); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(10, 18, 20); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(10, 19, 4); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(10, 1, 4); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(10, 2, 24); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(10, 1, 80); insert into ship(id, type, ship_class, producer, cost, autonomy, link, comment) values(11, 'Линейный крейсер/Авианосец', 'Секутор', 'Kuat Drive Yards', 200000000, 730, 'http://starforge.info/galactic-empire-ships/secutor-class-star-destroyer/', '144 истребителя. Многочисленные челноки, десантные баржи и вспомогательные малые суда'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(11, 2200, null, null); insert into ship_crew(ship_id, minimal, normal) values(11, null, 40000); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(11, null, null, 2, 14); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(11, null, null, null, null); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(11, 20, 15); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(11, 14, 15); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(11, 21, 15); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(11, 11, 16); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(11, 8, 12); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(11, 2, 144); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(11, 1, 14000); insert into ship(id, type, ship_class, producer, cost, autonomy, link) values(12, 'Штурмовой корабль', 'Аккламатор-II', 'Rothana Heavy Engineering', null, 730, 'http://starforge.info/old-republic-ships/acclamator-class-cruisers/'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(12, 752, 460, 183); insert into ship_crew(ship_id, minimal, normal) values(12, null, 2014); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(12, 40, 1200, 0.75, null); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(12, 120, 960, 20, 248); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(12, 15, 24); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(12, 22, 2); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(12, 3, 16); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(12, 1, 3200); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(12, 2, 10); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(12, 3, 8); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(12, 4, 64); insert into ship(id, type, ship_class, producer, cost, autonomy, link) values(13, 'Звездный Разрушитель', 'Победа-II', 'Rendili StarDrive ', 50000000, 1460, 'http://starforge.info/galactic-empire-ships/victory-ii-class-star-destroyer/'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(13, 900, 564, 289); insert into ship_crew(ship_id, minimal, normal) values(13, 2100, 6107); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(13, 60, null, 1, 15); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(13, 150, 1380, 20, 216); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(13, 15, 20); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(13, 1, 20); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(13, 11, 10); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(13, 4, 10); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(13, 1, 4); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(13, 2, 24); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(13, 4, 6); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(12, 1, 1600); insert into ship(id, type, ship_class, producer, cost, autonomy, link) values(14, 'Звездный Разрушитель', 'Император-I', 'Kuat Drive Yards ', 130000000, 2190, 'http://starforge.info/galactic-empire-ships/imperator-i-class-star-destroyer/'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(14, 1600, null, null); insert into ship_crew(ship_id, minimal, normal) values(14, 5600 , 37085); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(14, 60, null, 2, 8); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(14, 150, 2100, 20, 256); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(14, 12, 60); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(14, 23, 60); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(14, 4, 10); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(14, 1, 8); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(14, 2, 72); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(14, 4, 12); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(14, 5, 15); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(14, 6, 12); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(14, 7, 4); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(14, 5, 9700); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(14, 6, 20); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(14, 7, 30); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(14, 8, 1); insert into ship(id, type, ship_class, producer, cost, autonomy, link) values(15, 'Звездный Разрушитель', 'Император-II', 'Kuat Drive Yards ', 147000000, 2190, 'http://starforge.info/galactic-empire-ships/imperator-ii-class-star-destroyer/'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(15, 1600, null, null); insert into ship_crew(ship_id, minimal, normal) values(15, 5000 , 37085); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(15, 60, null, 2, 8); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(15, 150, 2100, 20, 256); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(15, 24, 50); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(15, 12, 50); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(15, 11, 20); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(15, 8, 10); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(15, 2, 72); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(15, 5, 9700); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(15, 6, 20); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(15, 7, 30); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(15, 8, 1); insert into ship(id, type, ship_class, producer, cost, autonomy, link) values(16, 'Линейный корабль', 'Палач', 'Kuat Drive Yards ', 1143350000, 2190, 'http://starforge.info/galactic-empire-ships/executor-class-star-destroyer/'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(16, 19000, null, null); insert into ship_crew(ship_id, minimal, normal) values(16, null , 280734); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(16, 40, null, 2, 10); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(16, 400, 3000, 20, 574); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(16, 25, 250); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(16, 12, 250); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(16, 23, 250); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(16, 3, 250); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(16, 8, 40); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(16, 26, 500); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(16, 2, 144); insert into ship_hanger(ship_id, small_aircraft_id, small_aircraft_count) values(16, 4, 200); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(16, 1, 38000); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(16, 8, 3); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(16, 6, 30); insert into ship_landing_deck(ship_id, land_force_id, landing_deck_count) values(16, 7, 50); insert into ship(id, type, ship_class, producer, cost, autonomy, link) values(17, 'Осадный корабль', 'Торпедная Сфера', 'Loronar Corporation ', 327830000, 2190, 'http://starforge.info/space-station/torpedo-sphere/'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(17, 1900, 1900, 1900); insert into ship_crew(ship_id, minimal, normal) values(17, 20415 , 63275); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(17, 20, null, 3, 18); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(17, 100, 3000, 20, 512); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(17, 12, 10); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(17, 3, 500); insert into ship(id, type, ship_class, producer, cost, autonomy, link) values(18, 'Корвет', 'Крестоносец', 'Mandal Hypernautics', 5200000, 365, 'http://starforge.info/other-ships/crusader-class-corvette/'); insert into ship_size(ship_id, ship_length, ship_width, ship_height) values(18, 150, null, null); insert into ship_crew(ship_id, minimal, normal) values(18, null , 80); insert into ship_speed(ship_id, space_speed, atmosphere_speed, main_hyper_drive_class, backup_hyper_drive_class) values(18, 80, null, 1, 12); insert into ship_defence(ship_id, shields, hp, dr, damage_threshold) values(18, 120, 950, 15, 136); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(18, 17, 10); insert into ship_weapon(ship_id, weapon_id, weapon_count) values(18, 27, 2);
true
ae96251a9bc26693468601775f9f4292ac011362
SQL
ItaloRamillys/SpotPer
/Criacao SpotPer.sql
UTF-8
4,053
3.71875
4
[]
no_license
--create database SpotPer /* SpotPer Logico: */ --USE SpotPer CREATE TABLE GRAVADORA ( CODIGO_GRAVADORA INTEGER not null, CONSTRAINT PK_COD_GRAV PRIMARY KEY (CODIGO_GRAVADORA), NOME VARCHAR(30) not null, PAIS VARCHAR(30) NOT NULL, ESTADO VARCHAR(30) NOT NULL, CIDADE VARCHAR(30) NOT NULL, RUA VARCHAR(30) NOT NULL, NUM_RUA INT, HOME_PAGE VARCHAR(30) ); CREATE TABLE TEL_GRAV( TEL_GRAV BIGINT NOT NULL, COD_GRAV INTEGER, CONSTRAINT PK_TEL_GRAV PRIMARY KEY(TEL_GRAV, COD_GRAV), CONSTRAINT FK_COD_GRAV FOREIGN KEY(COD_GRAV) REFERENCES GRAVADORA ON DELETE NO ACTION ON UPDATE NO ACTION ); CREATE TABLE ALBUM ( ID_ALBUM INTEGER PRIMARY KEY not null, NOME_ALBUM VARCHAR(30) NOT NULL, DESCRICAO_ALBUM VARCHAR(30), PRECO_COMPRA FLOAT not null, DATA_GRAVACAO DATE not null, DATA_COMPRA DATE not null, TIPO_COMPRA SMALLINT not null, COD_GRAVADORA INTEGER, CONSTRAINT FK_COD_GRAV_IN_ALBUM FOREIGN KEY(COD_GRAVADORA) REFERENCES GRAVADORA ON DELETE NO ACTION ON UPDATE CASCADE ); CREATE TABLE COMPOSICAO ( NOME_COMPO VARCHAR(30) not null, DESCRICAO VARCHAR(30), COD_COMPOSICAO INTEGER, CONSTRAINT PK_COD_COMPOSICAO PRIMARY KEY(COD_COMPOSICAO) ); CREATE TABLE INTERPRETE ( NOME VARCHAR(30) not null, TIPO VARCHAR(30) not null, CODIGO_INTERPRETE INTEGER, CONSTRAINT PK_COD_INTERP PRIMARY KEY(CODIGO_INTERPRETE) ); CREATE TABLE PERIODO_MUSICAL ( CODIGO_PERIODO INTEGER not null, DESCRICAO_PERIODO VARCHAR(30) not null, DATA_INICIO DATE NOT NULL, DATA_FIM DATE, CONSTRAINT PK_COD_PER_MUS PRIMARY KEY(CODIGO_PERIODO) ); CREATE TABLE COMPOSITOR ( CODIGO_COMPOSITOR INTEGER not null, NOME_COMPOSITOR VARCHAR(30) not null, DATA_MORTE DATE, DATA_NASCIMENTO DATE not null, COD_PERIODO_MUSICAL INTEGER NOT NULL, END_PAIS VARCHAR(30) NOT NULL, END_CIDADE VARCHAR(30) NOT NULL, CONSTRAINT PK_COD_COMPOSITOR PRIMARY KEY(CODIGO_COMPOSITOR), CONSTRAINT FK_PERDIODO FOREIGN KEY (COD_PERIODO_MUSICAL) REFERENCES PERIODO_MUSICAL ON DELETE NO ACTION ON UPDATE CASCADE ); CREATE TABLE FAIXA ( COD_ALBUM INTEGER not null, NUM_FAIXA INTEGER not null, NOME_FAIXA VARCHAR(30) NOT NULL, constraint pk_faixa_album primary key (COD_ALBUM , NUM_FAIXA), TEMPO_EXECUCAO TIME not null, TIPO_GRAVACAO SMALLINT ); CREATE TABLE FAIXA_COMPOSITOR ( NUM_FAIXA INTEGER not null, COD_ALBUM INTEGER NOT NULL, COD_COMPOSITOR INTEGER NOT NULL, CONSTRAINT PK_TBL_FAIXA_COMPOSITOR PRIMARY KEY(NUM_FAIXA, COD_ALBUM, COD_COMPOSITOR), CONSTRAINT FK_FAIXA_IN_F_COMPOSITOR FOREIGN KEY(NUM_FAIXA, COD_ALBUM) REFERENCES FAIXA, CONSTRAINT FK_COMPOSITOR_IN_F_COMPOSITOR FOREIGN KEY(COD_COMPOSITOR) REFERENCES COMPOSITOR ); CREATE TABLE FAIXA_INTERPRETE ( NUM_FAIXA INTEGER not null, COD_ALBUM INTEGER NOT NULL, COD_INTERPRETE INTEGER NOT NULL, CONSTRAINT PK_TBL_FAIXA_INTERPRETE PRIMARY KEY(NUM_FAIXA, COD_ALBUM, COD_INTERPRETE), CONSTRAINT FK_FAIXA_IN_F_INTERPRETE FOREIGN KEY(NUM_FAIXA, COD_ALBUM) REFERENCES FAIXA, CONSTRAINT FK_COMPOSITOR_IN_F_INTERPRETE FOREIGN KEY(COD_INTERPRETE) REFERENCES INTERPRETE ); CREATE TABLE PLAYLIST ( CODIGO_PLAYLIST INTEGER not null, NOME_PLAYLIST VARCHAR(30) not null, TEMPO_TOTAL_EXEC TIME, DATA_CRIACAO DATE CONSTRAINT PK_PLAYLIST PRIMARY KEY (CODIGO_PLAYLIST) ); CREATE TABLE FAIXA_PLAYLIST ( COD_PLAYLIST INTEGER not null, NUM_FAIXA INTEGER not null, COD_ALBUM INTEGER NOT NULL, CONSTRAINT PK_TBL_FAIXA_PLAYLIST PRIMARY KEY(NUM_FAIXA, COD_ALBUM, COD_PLAYLIST), CONSTRAINT FK_FAIXA_IN_F_PLAYLIST FOREIGN KEY(NUM_FAIXA, COD_ALBUM) REFERENCES FAIXA, CONSTRAINT FK_PALYLIST_IN_F_PLAYLIST FOREIGN KEY(COD_PLAYLIST) REFERENCES PLAYLIST ); CREATE TABLE ALBUM_PLAYLIST ( COD_PLAYLIST INTEGER not null, COD_ALBUM INTEGER NOT NULL, CONSTRAINT PK_TBL_ALBUM_PLAYLIST PRIMARY KEY(COD_ALBUM, COD_PLAYLIST), CONSTRAINT FK_ALBUM_PLAYLIST FOREIGN KEY(COD_PLAYLIST) REFERENCES PLAYLIST, CONSTRAINT FK_ALBUM_IN_A_PLAYLIST FOREIGN KEY(COD_ALBUM) REFERENCES ALBUM );
true
92d04fc0cd5f6ccaa581b597ba278e07b3024482
SQL
orlinwilliams/loginSession
/data/data.sql
UTF-8
619
2.6875
3
[]
no_license
create or replace database DBUser; use DBUser; create table User ( idUser int auto_increment primary key, nameUser varchar(45) not null, passwordUser text not null, idUserTypeFk int not null ); create table UserType( idUserType int auto_increment primary key, typeUser varchar(45) not null ); insert into UserType(typeUser) values("administrador"); insert into UserType(typeUser) values("usuario"); insert into User(nameUser, passwordUser,idUserTypeFk) values("orlin@gmail.com","orlin",1); insert into User(nameUser, passwordUser,idUserTypeFk) values("michi@gmail.com","michi",2);
true
1c4b1ca4735d2ab406e6d0eca1c320fe156c7487
SQL
hungds99/Fahasa-Clone
/petdb.sql
UTF-8
5,676
3.734375
4
[]
no_license
CREATE SCHEMA `petdb` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; USE `petdb`; -- Category CREATE TABLE `category` ( id INT AUTO_INCREMENT, category_name NVARCHAR(100), title NVARCHAR(100), category_breadcrumb NVARCHAR(255), keyword NVARCHAR(255), descriptions NVARCHAR(255), parent_id INT NULL, PRIMARY KEY (id) ); -- Insert Category data INSERT INTO `category` (id, category_breadcrumb, category_name, descriptions, keyword, parent_id, title) VALUES (1,'>>', 'Sách Trong Nước', 'sách hay', 'hay nhat', 0, 'Tổng hợp sách hay nhất'), (2,'>>', 'Văn học', 'sách hay', 'hay nhat', 1, 'Tổng hợp sách nhất'); -- Discount CREATE TABLE `discount` ( id INT AUTO_INCREMENT, discount_name NVARCHAR(100), discount_value INT, discount_type NVARCHAR(100), discount_code VARCHAR(10), detail NVARCHAR(100), PRIMARY KEY (id) ); -- Promotion CREATE TABLE `promotion` ( id INT AUTO_INCREMENT, promotion_name NVARCHAR(100), promotion_value INT, promotion_type NVARCHAR(100), promotion_code VARCHAR(10), promotion_rule NVARCHAR(255), used_valid BOOLEAN, created_date DATE, begin_date DATE, end_date DATE, PRIMARY KEY (id) ); -- Customer CREATE TABLE `customer` ( id INT AUTO_INCREMENT, name NVARCHAR(100), address NVARCHAR(100), gender CHAR(1), birthday DATE, phone INT, email VARCHAR(45), username VARCHAR(45), password VARCHAR(100), PRIMARY KEY (id) ); -- Product CREATE TABLE `product` ( id INT AUTO_INCREMENT, product_name NVARCHAR(100), product_price DOUBLE, product_finalprice DOUBLE, product_code INT, created_date DATE, product_amount INT, product_status INT, product_content TEXT, highlight BOOLEAN, isshowed BOOLEAN, discount_id INT, promotion_id INT, category_id INT, PRIMARY KEY (id) ); -- Foreign Key ALTER TABLE `product` ADD CONSTRAINT fk_product_discount_id FOREIGN KEY (discount_id) REFERENCES `discount` (id); ALTER TABLE `product` ADD CONSTRAINT fk_product_promotion_id FOREIGN KEY (promotion_id) REFERENCES `promotion` (id); ALTER TABLE `product` ADD CONSTRAINT fk_product_category_id FOREIGN KEY (category_id) REFERENCES `category` (id); CREATE TABLE `image` ( id INT AUTO_INCREMENT, image_url VARCHAR(255), image_alt NVARCHAR(255), display_order INT, product_id INT, promotion_id INT, PRIMARY KEY (id) ); -- Foreign Key ALTER TABLE `image` ADD CONSTRAINT fk_image_product_id FOREIGN KEY (product_id) REFERENCES `product` (id); ALTER TABLE `image` ADD CONSTRAINT fk_image_promotion_id FOREIGN KEY (promotion_id) REFERENCES `promotion` (id); -- Author CREATE TABLE `author` ( id INT AUTO_INCREMENT, author_age INT, author_name NVARCHAR(100), author_info TEXT, author_image NVARCHAR(100), PRIMARY KEY (id) ); -- Publisher CREATE TABLE `publisher` ( id INT AUTO_INCREMENT, publisher_name NVARCHAR(100), publisher_image NVARCHAR(100), publisher_info NVARCHAR(255), PRIMARY KEY (id) ); -- Supplier CREATE TABLE `supplier` ( id INT AUTO_INCREMENT, supplier_name NVARCHAR(100), supplier_image NVARCHAR(100), PRIMARY KEY (id) ); -- Product Attribute CREATE TABLE `product_attribute` ( id INT AUTO_INCREMENT, attr_code INT, attr_language VARCHAR(45), attr_age INT, attr_layout NVARCHAR(100), attr_page INT, attr_weight DOUBLE, attr_size VARCHAR(100), publish_year INT, author_id INT, publisher_id INT, supplier_id INT, product_id INT, PRIMARY KEY (id) ); ALTER TABLE `product_attribute` ADD CONSTRAINT fk_product_attribute_author_id FOREIGN KEY (author_id) REFERENCES `author` (id); ALTER TABLE `product_attribute` ADD CONSTRAINT fk_product_attribute_publisher_id FOREIGN KEY (publisher_id) REFERENCES `publisher` (id); ALTER TABLE `product_attribute` ADD CONSTRAINT fk_product_attribute_supplier_id FOREIGN KEY (supplier_id) REFERENCES `supplier` (id); -- Comment CREATE TABLE `comment` ( id INT AUTO_INCREMENT, content TEXT, rate INT, created_date DATE, product_id INT, customer_id INT, PRIMARY KEY (id) ); -- Foreign Key ALTER TABLE `comment` ADD CONSTRAINT fk_comment_product_id FOREIGN KEY (product_id) REFERENCES `product` (id); ALTER TABLE `comment` ADD CONSTRAINT fk_comment_customer_id FOREIGN KEY (customer_id) REFERENCES `customer` (id); -- Order CREATE TABLE `order` ( id INT AUTO_INCREMENT, order_status VARCHAR(100), created_date DATE, paymethod VARCHAR(100), customer_id INT, PRIMARY KEY (id) ); ALTER TABLE `order` ADD CONSTRAINT fk_order_customer_id FOREIGN KEY (customer_id) REFERENCES `customer` (id); -- Order Detail CREATE TABLE `order_detail` ( id INT AUTO_INCREMENT, order_price DOUBLE, order_amount INT, product_id INT, order_id INT, PRIMARY KEY (id) ); -- Foreign Key ALTER TABLE `order_detail` ADD CONSTRAINT fk_order_detail_product_id FOREIGN KEY (product_id) REFERENCES `product` (id); ALTER TABLE `order_detail` ADD CONSTRAINT fk_order_detail_order_id FOREIGN KEY (order_id) REFERENCES `order` (id); -- User Admin CREATE TABLE `user` ( id INT AUTO_INCREMENT, username VARCHAR(100), email VARCHAR(100), password VARCHAR(100), PRIMARY KEY (id) ); CREATE TABLE `role` ( id INT AUTO_INCREMENT, role VARCHAR(100), user_id INT, PRIMARY KEY (id) ); ALTER TABLE `role` ADD CONSTRAINT fk_role_user_id FOREIGN KEY (user_id) REFERENCES `user` (id);
true
417017ec0a8f955147d7819a441173cdf503efc7
SQL
kevinsqi/graphql-postgres-express-demo
/setup_database.sql
UTF-8
943
3.40625
3
[]
no_license
DROP DATABASE IF EXISTS graphql_postgres_express_demo; CREATE DATABASE graphql_postgres_express_demo; \c graphql_postgres_express_demo; CREATE TABLE posts ( id INTEGER PRIMARY KEY, title TEXT ); CREATE TABLE comments ( id SERIAL PRIMARY KEY, post_id INTEGER, user_id INTEGER, text TEXT ); CREATE TABLE users ( id INTEGER PRIMARY KEY, username TEXT ); INSERT INTO users (id, username) VALUES (1, 'heisenberg'), (2, 'kelvin'), (3, 'frog man'); INSERT INTO posts (id, title) VALUES (1, 'One easy trick to learn graphql'), (2, '10 ways to shock your friends with ReactJS'); INSERT INTO comments (post_id, user_id, text) VALUES (1, 3, 'are you the illuminati'), (1, 2, 'you have been coaxed into a snafu'), (1, 3, 'is this web scale?'), (2, 1, 'pranked by the tricky trickster'), (2, 2, 'you just got tricked!');
true
cc8a64e6a194d7ec6c9574285b50446c69647e9f
SQL
sunnynewlife/mamiwin
/db/magtadmin_myadmin_user.sql
UTF-8
3,156
3.140625
3
[]
no_license
CREATE DATABASE IF NOT EXISTS `magtadmin` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `magtadmin`; -- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64) -- -- Host: localhost Database: magtadmin -- ------------------------------------------------------ -- Server version 5.7.17-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `myadmin_user` -- DROP TABLE IF EXISTS `myadmin_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `myadmin_user` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `user_name` varchar(50) NOT NULL, `password` varchar(255) NOT NULL, `real_name` varchar(255) NOT NULL, `mobile` varchar(20) NOT NULL, `email` varchar(255) NOT NULL, `user_desc` varchar(255) DEFAULT NULL, `login_time` int(11) DEFAULT NULL COMMENT '登录时间', `status` tinyint(4) NOT NULL DEFAULT '1', `login_ip` varchar(32) DEFAULT NULL, `user_group` int(11) NOT NULL, `template` varchar(32) NOT NULL DEFAULT 'default' COMMENT '主题模板', `shortcuts` text COMMENT '快捷菜单', `show_quicknote` int(11) NOT NULL DEFAULT '1' COMMENT '是否显示quicknote', PRIMARY KEY (`user_id`) USING BTREE, UNIQUE KEY `user_name` (`user_name`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8 AVG_ROW_LENGTH=1820 COMMENT='后台用户; InnoDB free: 7168 kB'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `myadmin_user` -- LOCK TABLES `myadmin_user` WRITE; /*!40000 ALTER TABLE `myadmin_user` DISABLE KEYS */; INSERT INTO `myadmin_user` VALUES (1,'admin','e10adc3949ba59abbe56e057f20f883e','Admin','13916354020','neilxu@msn.com','Init Administrator',1401955710,1,'127.0.0.1',1,'default','11,13,14,18,21,24,101,22',1),(42,'neil','10a7735edb0cde35bba25d21f7b76cbe','徐龙','13916354020','neilxu@msn.com','Administrator',1489319830,1,NULL,1,'default',',2,11,270',1),(47,'yangenrui','e6b0165b2c1742ff4f5a1e9dfb84ffbe','杨恩睿','13001234567','sunnynewlife@qq.com','Administrator',1438065698,1,NULL,1,'default',',301',1); /*!40000 ALTER TABLE `myadmin_user` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2017-03-12 19:58:36
true