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
134506e849c66476d2441cc121c7960937f45102
SQL
hikerqing/Covid-19-database
/create_database.sql
UTF-8
3,668
3.71875
4
[ "MIT" ]
permissive
/* create Covid-19 database */ CREATE TABLE drug ( drug_id int, drug_name varchar(50), drug_status varchar(25), drug_type varchar(25), primary key (drug_id) ); CREATE TABLE clinical_trial ( trial_id int, title varchar(50), trial_type varchar(25), trial_stage varchar(25), trial_status varchar(25), record_date date, start_date date, end_date date, bid_institution date, trial_institution date, primary key (trial_id) ); CREATE TABLE trial_drug ( trial_id int, drug_id int, primary key(trial_id), foreign key(trial_id) references clinical_trial(trial_id), foreign key(drug_id) references drug(drug_id) ); create table researcher ( researcher_id int, first_name varchar(25), last_name varchar(25), position varchar(25), email varchar(25), phonenumber varchar(25), department varchar(25), primary key (researcher_id) ); create table institution ( institution_id int, institution_location varchar(50), instituiton_money int, institution_email varchar(25), institution_phone varchar(25), primary key (institution_id) ); create table institution_researcher ( researcher_id int, institution_id int, primary key (researcher_id), foreign key(researcher_id) references researcher(researcher_id), foreign key(institution_id) references institution(institution_id) ); create table experiment ( trial_id int, batch_id int, experiment_description varchar(100), start_date date, end_date date, dose float, result varchar(20), adverse_reaction varchar(20), more_details varchar(50), primary key (trial_id, batch_id), foreign key (trial_id) references clinical_trial(trial_id) ); create table researcher_experiment ( researcher_id int, trial_id int, batch_id int, division varchar(20), primary key(researcher_id), foreign key(researcher_id) references researcher(researcher_id), foreign key(trial_id,batch_id) references experiment(trial_id,batch_id) ); CREATE TABLE volunteer ( volunteer_id INT, first_name VARCHAR(20), last_name VARCHAR(20), gender VARCHAR(5), age INT, blood_type VARCHAR(5), country VARCHAR(10), PRIMARY KEY (volunteer_id) ); CREATE TABLE volunteer_experiment ( volunteer_id int, trial_id int, batch_id int, PRIMARY KEY (volunteer_id), FOREIGN KEY (volunteer_id) REFERENCES volunteer(volunteer_id), FOREIGN KEY (trial_id, batch_id) REFERENCES experiment(trial_id, batch_id) ); CREATE TABLE SITE ( site_id int, country VARCHAR(20), province VARCHAR(20), city VARCHAR(20), other_details VARCHAR(20), PRIMARY KEY (site_id) ); CREATE TABLE hospital ( hospital_id int, site_id int, hospital_name VARCHAR(20), PRIMARY KEY (hospital_id, site_id), FOREIGN KEY (site_id) REFERENCES SITE(site_id) ); CREATE TABLE doctor ( doctor_id int, hospital_id int, site_id INT, first_name VARCHAR(20), last_name VARCHAR(20), department VARCHAR(20), gender VARCHAR(5), age INT, PRIMARY KEY (doctor_id,site_id ,hospital_id), FOREIGN KEY (hospital_id, site_id) REFERENCES hospital(hospital_id, site_id) ); CREATE TABLE cases ( case_id int, site_id int, first_name varchar(20), last_name varchar(20), gender varchar(5), age int, job varchar(20), reason VARCHAR(20), situation varchar(20), suspected_date date, confirmed_date date, live BOOLEAN, left_date date, PRIMARY KEY (case_id, site_id), FOREIGN KEY (site_id) REFERENCES SITE(site_id) );
true
bb7c34e4a236ccc97850818a8bfd69579c4f66ac
SQL
pm2kjiagm/bbsmax
/bbsmax5_src/MaxLabs.bbsMax.Project/Database/MsSql/Procedures/bx_SendMessage.sql
UTF-8
2,095
3.640625
4
[]
no_license
--发送短消息 CREATE PROCEDURE [bx_SendMessage] @UserID int ,@MessageID int ,@RelatedUserIDs varchar(500) ,@SenderIP varchar(50) ,@ParentID int ,@ContentType tinyint ,@Content ntext ,@ContentReverter nvarchar(1000) AS BEGIN SET NOCOUNT ON; BEGIN TRANSACTION --每个RelatedUsers里面的用户均接收一条数据 INSERT INTO [bx_Messages]( [IsRead] , [Type] , [ContentType] , [UserID] , [RelatedUserIDs] , [ParentID] , [SenderIP] , [Content] , [ContentReverter] , [PostDate] ) SELECT 0 --新消息都是未读的 , 1 --收件箱类型 , @ContentType , item AS RelatedUsers --RelatedUsers每个ID对应一个用户ID,都会接收一条新消息在收件箱中 , @UserID , @ParentID , @SenderIP , @Content , @ContentReverter , GETDATE() FROM bx_GetIntTable(@RelatedUserIDs, ','); IF(@@error<>0) GOTO Cleanup; --如果ID参数不为零,表示为编辑草稿后发送消息,需要删除掉原草稿消息 IF (@MessageID <> 0) BEGIN DELETE FROM [bx_Messages] WHERE [MessageID] = @MessageID AND [UserID] = @UserID; END --发件人的发件箱添加一条数据 INSERT INTO [bx_Messages]( [IsRead] , [Type] , [ContentType] , [UserID] , [RelatedUserIDs] , [ParentID] , [SenderIP] , [Content] , [ContentReverter] , [PostDate] ) VALUES( 1 --发件箱都标记为已读 , 2 --发件箱类型 , @ContentType , @UserID , @RelatedUserIDs , @ParentID , @SenderIP , @Content , @ContentReverter , GETDATE() ) ; IF(@@error<>0) GOTO Cleanup; ELSE BEGIN GOTO CommitTrans; END CommitTrans: BEGIN COMMIT TRANSACTION RETURN (0); END Cleanup: BEGIN ROLLBACK TRANSACTION RETURN (-1) END END
true
f76d2cae13747dd261f5634791dd01c5ed331370
SQL
ScorpionProgramming/scorpionprogramming.github.io
/database.sql
UTF-8
2,913
3.390625
3
[]
no_license
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server Version: 10.1.30-MariaDB - mariadb.org binary distribution -- Server Betriebssystem: Win32 -- HeidiSQL Version: 9.5.0.5196 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!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' */; -- Exportiere Datenbank Struktur für planer CREATE DATABASE IF NOT EXISTS `planer` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `planer`; -- Exportiere Struktur von Tabelle planer.faecher CREATE TABLE IF NOT EXISTS `faecher` ( `id` int(11) NOT NULL, `bezeichnung` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Daten Export vom Benutzer nicht ausgewählt -- Exportiere Struktur von Tabelle planer.kurs CREATE TABLE IF NOT EXISTS `kurs` ( `id` int(11) NOT NULL, `bezeichnung` varchar(50) NOT NULL, `lehrerID` int(11) NOT NULL, `fachID` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `bezeichnung` (`bezeichnung`), UNIQUE KEY `fachID` (`fachID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Daten Export vom Benutzer nicht ausgewählt -- Exportiere Struktur von Tabelle planer.lehrer CREATE TABLE IF NOT EXISTS `lehrer` ( `id` int(11) NOT NULL, `name` varchar(50) NOT NULL, `vorname` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `passwort` varchar(150) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Daten Export vom Benutzer nicht ausgewählt -- Exportiere Struktur von Tabelle planer.lehrer_faecher CREATE TABLE IF NOT EXISTS `lehrer_faecher` ( `lehrer` int(11) NOT NULL, `fach` int(11) NOT NULL, PRIMARY KEY (`lehrer`,`fach`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Daten Export vom Benutzer nicht ausgewählt -- Exportiere Struktur von Tabelle planer.schueler CREATE TABLE IF NOT EXISTS `schueler` ( `id` int(11) NOT NULL, `nachname` varchar(50) NOT NULL, `vorname` varchar(50) NOT NULL, `email` varchar(50) DEFAULT NULL, `geburtstag` date DEFAULT NULL, UNIQUE KEY `unique ind` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Daten Export vom Benutzer nicht ausgewählt -- Exportiere Struktur von Tabelle planer.schueler_klasse CREATE TABLE IF NOT EXISTS `schueler_klasse` ( `schueler` int(11) NOT NULL, `klasse` int(11) NOT NULL, PRIMARY KEY (`schueler`,`klasse`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Daten Export vom Benutzer nicht ausgewählt /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
true
4175408bebfeac290ec12214aa52f992e64012cd
SQL
tunix/docker_izmir_keynote
/dapi/src/main/resources/schema-mysql.sql
UTF-8
553
3.515625
4
[]
no_license
create table message ( id bigint not null, created_at tinyblob not null, message longtext, user_id bigint, primary key (id) ); create table user ( id bigint not null, created_at tinyblob not null, first_name varchar(255), language_code varchar(255), last_name varchar(255), username varchar(255), primary key (id) ); alter table user add constraint UK_sb8bbouer5wak8vyiiy4pf2bx unique (username); alter table message add constraint FKb3y6etti1cfougkdr0qiiemgv foreign key (user_id) references user (id);
true
7ca1641dc04ca6ed8438d6ca50a658dbafa5cc34
SQL
thanhhungchu95/FISJAVA
/SQL/Meeting.sql
UTF-8
468
4.09375
4
[]
no_license
SELECT MeetingEmployee.MeetingID AS ID, Meeting.name AS Name, Meeting.time AS Time, Meeting.duration AS Duration, GROUP_CONCAT( Employee.name, '(', IF(Depart.name IS NULL, 'NULL', Depart.name), ')') AS Party FROM Employee LEFT JOIN Depart ON Employee.DepartID = Depart.ID JOIN MeetingEmployee ON MeetingEmployee.EmployeeID = Employee.ID JOIN Meeting ON MeetingEmployee.MeetingID = Meeting.ID GROUP BY MeetingEmployee.MeetingID;
true
863de46eef390962955153d268953cfe3ad03390
SQL
Malagutte/training-back-base
/dbs/transactions/files/sql/transaction-manager/h2/upgrade_2_10_4_to_2_11_0/transaction-manager.sql
UTF-8
170
2.671875
3
[]
no_license
ALTER TABLE fin_txn ADD credit_debit_amount DECIMAL(15, 3) NOT NULL; ALTER TABLE fin_txn ADD notes VARCHAR2(4000); CREATE INDEX ix_arrangement ON fin_txn(arrangement_id);
true
a720c76e6c496e2c3e5f5107b1ce89531722dce4
SQL
Melissa-Elizabeth/weekend-challenge-4
/database.sql
UTF-8
293
2.984375
3
[]
no_license
CREATE TABLE task ( id SERIAL PRIMARY KEY, name VARCHAR(80) NOT NULL, completed BOOLEAN NOT NULL DEFAULT FALSE ); -- CREATE TABLE completed_tasks ( -- id SERIAL PRIMARY KEY, -- completed_name VARCHAR(80) NOT NULL -- -- ); // Created a completed_tasks table but it didn't work as planned
true
9090b7603be099629f0c08f9c18eb4f5d3324ee4
SQL
ReemKish/SQL-REMASTERED
/examples/example1.sql
UTF-8
415
3.484375
3
[]
no_license
-- some simple example using small amount of data drop table if exists movies; create table if not exists movies (title varchar, year int, duration int, score float); load data infile "movies2.csv" into table movies; select year, avg(duration) from movies group by year order by year desc; select year, avg(duration) as avg_d from movies group by year order by avg_d; select * from movies where year is NULL;
true
de02694bb2db92f5e379f4faa951dbbc1030fa63
SQL
yuanfangljy/blsq-upms
/data/sys_blsq.sql
UTF-8
27,468
3.078125
3
[]
no_license
/* SQLyog Ultimate v12.4.1 (64 bit) MySQL - 5.7.17-log : Database - blsq ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!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 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`sys_blsq` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; USE `sys_blsq`; /*Table structure for table `sys_dept` */ DROP TABLE IF EXISTS `sys_dept`; CREATE TABLE `sys_dept` ( `dept_id` int(20) NOT NULL AUTO_INCREMENT, `org_id` int(11) DEFAULT NULL COMMENT '组织Id', `user_id` int(11) DEFAULT NULL COMMENT '创建人Id', `name` varchar(50) DEFAULT NULL COMMENT '部门名称', `sort` int(11) DEFAULT NULL COMMENT '排序', `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `del_flag` char(1) DEFAULT '0' COMMENT '是否删除 1:已删除 0:正常', `parent_id` int(11) DEFAULT '0' COMMENT '父类Id', `tenant_id` int(11) DEFAULT NULL, `version` int(11) DEFAULT '0', PRIMARY KEY (`dept_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='部门管理'; /*Data for the table `sys_dept` */ insert into `sys_dept`(`dept_id`,`org_id`,`user_id`,`name`,`sort`,`create_time`,`update_time`,`del_flag`,`parent_id`,`tenant_id`,`version`) values (1,NULL,NULL,'山东农信',NULL,'2018-01-22 19:00:23','2018-09-13 01:46:29','0',0,1,NULL), (2,NULL,NULL,'沙县国际',NULL,'2018-01-22 19:00:38','2018-09-13 01:46:30','0',0,1,NULL), (3,NULL,NULL,'潍坊农信',NULL,'2018-01-22 19:00:44','2018-09-13 01:46:31','0',1,1,NULL), (4,NULL,NULL,'高新农信',NULL,'2018-01-22 19:00:52','2018-10-06 10:41:52','0',3,1,NULL), (5,NULL,NULL,'院校农信',NULL,'2018-01-22 19:00:57','2018-10-06 10:42:51','0',4,1,NULL), (6,NULL,NULL,'潍院农信',NULL,'2018-01-22 19:01:06','2019-01-09 10:58:18','1',5,1,NULL), (7,NULL,NULL,'山东沙县',NULL,'2018-01-22 19:01:57','2018-09-13 01:46:42','0',2,1,NULL), (8,NULL,NULL,'潍坊沙县',NULL,'2018-01-22 19:02:03','2018-09-13 01:46:43','0',7,1,NULL), (9,NULL,NULL,'高新沙县',NULL,'2018-01-22 19:02:14','2018-09-13 01:46:44','1',8,1,NULL), (10,NULL,NULL,'租户2',NULL,'2018-11-18 13:27:11','2018-11-18 13:42:19','0',0,2,NULL), (11,NULL,NULL,'院校沙县',NULL,'2018-12-10 21:19:26','2019-04-24 15:55:09','1',8,1,NULL), (12,NULL,NULL,'nihao11',12312,'2019-04-25 14:50:11','2019-05-28 23:16:54','0',12312,12312,NULL), (13,NULL,NULL,'liujaiyi',1,'2019-04-25 14:51:51',NULL,'0',12,12312,NULL), (14,NULL,NULL,'liujaiyi',1,'2019-05-28 23:16:47',NULL,'0',12,12312,NULL); /*Table structure for table `sys_dept_house` */ DROP TABLE IF EXISTS `sys_dept_house`; CREATE TABLE `sys_dept_house` ( `dept_id` int(11) NOT NULL COMMENT '部门Id', `house_id` int(11) NOT NULL COMMENT '小区Id', PRIMARY KEY (`dept_id`,`house_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*Data for the table `sys_dept_house` */ /*Table structure for table `sys_dept_relation` */ DROP TABLE IF EXISTS `sys_dept_relation`; CREATE TABLE `sys_dept_relation` ( `ancestor` int(11) NOT NULL COMMENT '祖先节点', `descendant` int(11) NOT NULL COMMENT '后代节点', PRIMARY KEY (`ancestor`,`descendant`) USING BTREE, KEY `idx1` (`ancestor`) USING BTREE, KEY `idx2` (`descendant`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC COMMENT='部门关系表'; /*Data for the table `sys_dept_relation` */ insert into `sys_dept_relation`(`ancestor`,`descendant`) values (1,1), (1,3), (1,4), (1,5), (2,2), (2,7), (2,8), (3,3), (3,4), (3,5), (4,4), (4,5), (5,5), (7,7), (7,8), (8,8), (10,10), (12,12), (12,13), (12,14), (13,13), (14,14); /*Table structure for table `sys_menu` */ DROP TABLE IF EXISTS `sys_menu`; CREATE TABLE `sys_menu` ( `menu_id` int(11) NOT NULL COMMENT '菜单ID', `name` varchar(32) NOT NULL COMMENT '菜单名称', `description` varchar(128) DEFAULT NULL COMMENT '描述', `permission` varchar(32) DEFAULT NULL COMMENT '菜单权限标识', `url` varchar(60) DEFAULT '' COMMENT '请求url', `path` varchar(128) DEFAULT NULL COMMENT '前端URL', `parent_id` int(11) DEFAULT NULL COMMENT '父菜单ID', `icon` varchar(32) DEFAULT NULL COMMENT '图标', `component` varchar(64) DEFAULT NULL COMMENT 'VUE页面', `sort` int(11) DEFAULT '1' COMMENT '排序值', `keep_alive` char(1) DEFAULT '0' COMMENT '0-开启,1- 关闭', `type` char(1) DEFAULT NULL COMMENT '菜单类型 (0菜单 1按钮)', `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `del_flag` char(1) DEFAULT '0' COMMENT '逻辑删除标记(0--正常 1--删除)', PRIMARY KEY (`menu_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='菜单权限表'; /*Data for the table `sys_menu` */ insert into `sys_menu`(`menu_id`,`name`,`description`,`permission`,`url`,`path`,`parent_id`,`icon`,`component`,`sort`,`keep_alive`,`type`,`create_time`,`update_time`,`del_flag`) values (100,'运营管理','',NULL,'','',-1,'x-fa fa-university',NULL,1,'0','0','2019-06-01 15:58:13',NULL,'0'), (200,'系统管理','',NULL,'','',-1,'x-fa fa-cog',NULL,2,'0','0','2019-06-01 16:01:54','2019-06-01 17:07:04','0'), (10001,'小区管理','',NULL,'','housePlotGrid',100,'x-fa fa-building',NULL,1,'0','0','2019-06-01 15:58:45','2019-06-01 15:59:29','0'), (10002,'房屋信息管理','',NULL,'','houseUnitPanel.houseBuildingGrid',100,'x-fa fa-h-square',NULL,1,'0','0','2019-06-01 15:59:23',NULL,'0'), (10003,'住户管理','',NULL,'','houseUnitPanel.houseUserGrid',100,'x-fa fa-square',NULL,1,'0','0','2019-06-01 15:59:54',NULL,'0'), (10004,'缴费管理','',NULL,'','houseUnitPanel.feePayGrid',100,'x-fa fa-gavel',NULL,1,'0','0','2019-06-01 16:00:16',NULL,'0'), (10005,'意见反馈管理','',NULL,'','housePlotPanel.feedbackOpinionGrid',100,'x-fa fa-at',NULL,1,'0','0','2019-06-01 16:00:37',NULL,'0'), (10006,'故障报修管理','',NULL,'','houseUnitPanel.feedbackFaultGrid',100,'x-fa fa-book',NULL,1,'0','0','2019-06-01 16:00:59',NULL,'0'), (10007,'公告管理','',NULL,'','housePlotPanel.messageNoticeGrid',100,'x-fa fa-comment',NULL,1,'0','0','2019-06-01 16:01:21',NULL,'0'), (20001,'字典管理','',NULL,'','systemDictionaryPanel',200,'x-fa fa-list',NULL,1,'0','0','2019-06-01 16:02:16',NULL,'0'), (20002,'菜单管理','',NULL,'','systemMenuPanel.systemMenuEdit',200,'x-fa fa-list',NULL,1,'0','0','2019-06-01 16:02:45',NULL,'0'), (20003,'权限管理','',NULL,'','systemMenuPanel.systemPermissionsGrid',200,'x-fa fa-list',NULL,1,'0','0','2019-06-01 16:03:05',NULL,'0'), (20004,'角色管理','',NULL,'','systemRoleGrid',200,'x-fa fa-reddit',NULL,1,'0','0','2019-06-01 16:03:23',NULL,'0'), (20005,'组织管理','',NULL,'','purviewPanel.tissueEdit',200,'x-fa fa-building',NULL,1,'0','0','2019-06-01 16:03:44',NULL,'0'), (20006,'账号管理','',NULL,'','purviewPanel.purviewAccountGrid',200,'x-fa fa-user',NULL,1,'0','0','2019-06-01 16:04:09',NULL,'0'), (100011,'新增',NULL,'add','',NULL,10001,NULL,NULL,1,'0','1','2019-06-01 16:07:15',NULL,'0'), (100012,'编辑',NULL,'edit','',NULL,10001,NULL,NULL,1,'0','1','2019-06-01 16:07:36',NULL,'0'), (100013,'删除',NULL,'delete','',NULL,10001,NULL,NULL,1,'0','1','2019-06-01 16:07:55',NULL,'0'), (100014,'启用/禁用',NULL,'state','',NULL,10001,NULL,NULL,1,'0','1','2019-06-01 16:08:35',NULL,'0'), (100015,'详情',NULL,'info','',NULL,10001,NULL,NULL,1,'0','1','2019-06-01 16:08:48',NULL,'0'), (100021,'新增',NULL,'add','',NULL,10002,NULL,NULL,1,'0','1','2019-06-01 16:09:03',NULL,'0'), (100022,'编辑',NULL,'edit','',NULL,10002,NULL,NULL,1,'0','1','2019-06-01 16:09:15',NULL,'0'), (100023,'删除',NULL,'delete','',NULL,10002,NULL,NULL,1,'0','1','2019-06-01 16:09:25',NULL,'0'), (100031,'新增',NULL,'add','',NULL,10003,NULL,NULL,1,'0','1','2019-06-01 16:09:37',NULL,'0'), (100032,'编辑',NULL,'edit','',NULL,10003,NULL,NULL,1,'0','1','2019-06-01 16:09:50',NULL,'0'), (100033,'删除',NULL,'delete','',NULL,10003,NULL,NULL,1,'0','1','2019-06-01 16:10:04',NULL,'0'), (100041,'查看详情',NULL,'info','',NULL,10004,NULL,NULL,1,'0','1','2019-06-01 16:11:47',NULL,'0'), (100042,'缴费设置',NULL,'site','',NULL,10004,NULL,NULL,1,'0','1','2019-06-01 16:12:06',NULL,'0'), (100051,'导出',NULL,'export','',NULL,10005,NULL,NULL,1,'0','1','2019-06-01 16:12:20',NULL,'0'), (100061,'导出',NULL,'export','',NULL,10006,NULL,NULL,1,'0','1','2019-06-01 16:12:31',NULL,'0'), (100062,'处理',NULL,'dispose','',NULL,10006,NULL,NULL,1,'0','1','2019-06-01 16:13:13',NULL,'0'), (100071,'新增',NULL,'add','',NULL,10007,NULL,NULL,1,'0','1','2019-06-01 16:13:27',NULL,'0'), (100072,'编辑',NULL,'edit','',NULL,10007,NULL,NULL,1,'0','1','2019-06-01 16:13:39',NULL,'0'), (100073,'删除',NULL,'delete','',NULL,10007,NULL,NULL,1,'0','1','2019-06-01 16:13:51',NULL,'0'), (200011,'新增',NULL,'add','',NULL,20001,NULL,NULL,1,'0','1','2019-06-01 16:14:15',NULL,'0'), (200012,'编辑',NULL,'edit','',NULL,20001,NULL,NULL,1,'0','1','2019-06-01 16:14:25',NULL,'0'), (200013,'删除',NULL,'delete','',NULL,20001,NULL,NULL,1,'0','1','2019-06-01 16:14:39',NULL,'0'), (200021,'新增',NULL,'add','',NULL,20002,NULL,NULL,1,'0','1','2019-06-01 16:14:59',NULL,'0'), (200022,'编辑',NULL,'edit','',NULL,20002,NULL,NULL,1,'0','1','2019-06-01 16:15:09',NULL,'0'), (200023,'删除',NULL,'delete','',NULL,20002,NULL,NULL,1,'0','1','2019-06-01 16:15:20',NULL,'0'), (200031,'删除',NULL,'delete','',NULL,20003,NULL,NULL,1,'0','1','2019-06-01 16:15:36',NULL,'0'), (200032,'编辑',NULL,'edit','',NULL,20003,NULL,NULL,1,'0','1','2019-06-01 16:15:47',NULL,'0'), (200033,'新增',NULL,'add','',NULL,20003,NULL,NULL,1,'0','1','2019-06-01 16:16:04',NULL,'0'), (200041,'新增',NULL,'add','',NULL,20004,NULL,NULL,1,'0','1','2019-06-01 16:16:15',NULL,'0'), (200042,'编辑',NULL,'edit','',NULL,20004,NULL,NULL,1,'0','1','2019-06-01 16:16:32',NULL,'0'), (200043,'删除',NULL,'delete','',NULL,20004,NULL,NULL,1,'0','1','2019-06-01 16:16:43',NULL,'0'), (200044,'权限设置',NULL,'permissions','',NULL,20004,NULL,NULL,1,'0','1','2019-06-01 16:16:58',NULL,'0'), (200051,'新增',NULL,'add','',NULL,20005,NULL,NULL,1,'0','1','2019-06-01 16:17:09',NULL,'0'), (200052,'编辑',NULL,'edit','',NULL,20005,NULL,NULL,1,'0','1','2019-06-01 16:17:23',NULL,'0'), (200053,'删除',NULL,'delete','',NULL,20005,NULL,NULL,1,'0','1','2019-06-01 16:17:36',NULL,'0'), (200061,'新增',NULL,'add','',NULL,20006,NULL,NULL,1,'0','1','2019-06-01 16:17:49',NULL,'0'), (200062,'编辑',NULL,'edit','',NULL,20006,NULL,NULL,1,'0','1','2019-06-01 16:18:02',NULL,'0'), (200063,'删除',NULL,'delete','',NULL,20006,NULL,NULL,1,'0','1','2019-06-01 16:18:12',NULL,'0'); /*Table structure for table `sys_org` */ DROP TABLE IF EXISTS `sys_org`; CREATE TABLE `sys_org` ( `org_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '组织Id', `user_id` int(11) DEFAULT NULL COMMENT '创建人Id', `org_name` varchar(200) DEFAULT NULL COMMENT '组织名称', `org_code` varchar(200) DEFAULT NULL COMMENT '组织编码', `sort` int(11) DEFAULT NULL COMMENT '排序', `parent_id` int(11) DEFAULT NULL COMMENT '父类Id', `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `del_flag` char(1) DEFAULT '0' COMMENT '删除标识(0-正常,1-删除)', `tenant_id` int(11) DEFAULT NULL COMMENT '所属租户', `version` int(11) DEFAULT '0' COMMENT '版本号', PRIMARY KEY (`org_id`) ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COMMENT='组织'; /*Data for the table `sys_org` */ insert into `sys_org`(`org_id`,`user_id`,`org_name`,`org_code`,`sort`,`parent_id`,`create_time`,`update_time`,`del_flag`,`tenant_id`,`version`) values (1,1,'组织-1','org-1',0,0,'2019-05-31 14:01:46','2019-05-31 14:02:00','0',NULL,0), (16,1,'组织-1-1','org-1-1',0,1,'2019-05-31 14:08:11',NULL,'0',NULL,0), (20,1,'组织-1-1','org-1-1',0,1,'2019-05-31 15:31:43',NULL,'0',NULL,0), (21,1,'组织-1-1','org-1-1',0,1,'2019-05-31 15:31:52',NULL,'0',NULL,0), (22,1,'组织-1-1','org-1-1',0,1,'2019-05-31 15:31:53','2019-06-01 19:05:28','1',NULL,0), (23,1,'组织-1-1','org-1-1',0,16,'2019-05-31 15:32:26',NULL,'0',NULL,0), (24,1,'组织-1-1','org-1-1',0,16,'2019-06-01 12:00:32','2019-06-01 19:05:39','1',NULL,0), (25,1,'11','11',11,23,'2019-06-01 19:06:16',NULL,'0',NULL,0), (26,1,'33','33',33,25,'2019-06-01 19:06:44',NULL,'0',NULL,0), (27,1,'1','11',11,20,'2019-06-01 19:08:43',NULL,'0',NULL,0), (28,1,'1','1',1,21,'2019-06-01 19:11:27','2019-06-01 19:12:15','1',NULL,0), (29,1,'1','1',1,21,'2019-06-01 19:12:30','2019-06-01 19:23:50','1',NULL,0), (30,1,'1','1',1,26,'2019-06-01 19:18:52','2019-06-01 19:20:13','1',NULL,0), (31,1,'1','1',11,25,'2019-06-01 19:20:02',NULL,'0',NULL,0), (32,1,'1','1',1,26,'2019-06-01 19:20:21',NULL,'0',NULL,0), (33,1,'1','1',1,25,'2019-06-01 19:21:28',NULL,'0',NULL,0), (34,1,'1','1',1,20,'2019-06-01 19:22:07',NULL,'0',NULL,0), (35,1,'1','1',1,21,'2019-06-01 19:23:41','2019-06-01 19:23:53','1',NULL,0); /*Table structure for table `sys_org_house` */ DROP TABLE IF EXISTS `sys_org_house`; CREATE TABLE `sys_org_house` ( `org_id` int(11) NOT NULL COMMENT '组织Id', `house_id` varchar(36) NOT NULL COMMENT '小区Id', PRIMARY KEY (`org_id`,`house_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*Data for the table `sys_org_house` */ insert into `sys_org_house`(`org_id`,`house_id`) values (1,'0c3c99de645803de79a8eb2d3a65ac33'), (1,'0ccfb8bd75661be58be3f9594979cc34'), (1,'2200d85ce941524b6f90a8976ab8eba2'), (1,'3a1a75b3aa8f186b8bc2e39e99e8278c'), (1,'4aab518106074dc34a394f4b42bae293'), (1,'573411a6484042739f99b476922de723'), (1,'8b4a0aff-332c-11e9-aaaf-0242ac110004'), (1,'b76aefe3d25841f6bf07055dcbb0b273'), (1,'c5929858abafb16191a07c79ee9269a6'), (1,'e264226ab64eae8335e4ee0bf865bc84'), (1,'eb17c87b4538eb553a628ce36ec7d6ae'), (16,'312'), (16,'eb17c87b4538eb553a628ce36ec7d6ae'), (20,'123'), (20,'312'), (21,'123'), (21,'312'), (23,'123'), (23,'312'), (25,'0c3c99de645803de79a8eb2d3a65ac33'), (25,'0ccfb8bd75661be58be3f9594979cc34'), (25,'2200d85ce941524b6f90a8976ab8eba2'), (25,'3a1a75b3aa8f186b8bc2e39e99e8278c'), (25,'4aab518106074dc34a394f4b42bae293'), (25,'573411a6484042739f99b476922de723'), (25,'8b4a0aff-332c-11e9-aaaf-0242ac110004'), (25,'b76aefe3d25841f6bf07055dcbb0b273'), (25,'c5929858abafb16191a07c79ee9269a6'), (25,'e264226ab64eae8335e4ee0bf865bc84'), (25,'eb17c87b4538eb553a628ce36ec7d6ae'), (26,'0c3c99de645803de79a8eb2d3a65ac33'), (26,'0ccfb8bd75661be58be3f9594979cc34'), (26,'2200d85ce941524b6f90a8976ab8eba2'), (26,'3a1a75b3aa8f186b8bc2e39e99e8278c'), (26,'4aab518106074dc34a394f4b42bae293'), (26,'573411a6484042739f99b476922de723'), (26,'8b4a0aff-332c-11e9-aaaf-0242ac110004'), (26,'b76aefe3d25841f6bf07055dcbb0b273'), (26,'c5929858abafb16191a07c79ee9269a6'), (26,'e264226ab64eae8335e4ee0bf865bc84'), (26,'eb17c87b4538eb553a628ce36ec7d6ae'), (27,'0c3c99de645803de79a8eb2d3a65ac33'), (27,'0ccfb8bd75661be58be3f9594979cc34'), (27,'2200d85ce941524b6f90a8976ab8eba2'), (27,'3a1a75b3aa8f186b8bc2e39e99e8278c'), (27,'4aab518106074dc34a394f4b42bae293'), (27,'573411a6484042739f99b476922de723'), (27,'8b4a0aff-332c-11e9-aaaf-0242ac110004'), (27,'b76aefe3d25841f6bf07055dcbb0b273'), (27,'c5929858abafb16191a07c79ee9269a6'), (27,'e264226ab64eae8335e4ee0bf865bc84'), (27,'eb17c87b4538eb553a628ce36ec7d6ae'), (31,'0c3c99de645803de79a8eb2d3a65ac33'), (31,'0ccfb8bd75661be58be3f9594979cc34'), (31,'2200d85ce941524b6f90a8976ab8eba2'), (31,'3a1a75b3aa8f186b8bc2e39e99e8278c'), (31,'4aab518106074dc34a394f4b42bae293'), (31,'573411a6484042739f99b476922de723'), (31,'8b4a0aff-332c-11e9-aaaf-0242ac110004'), (31,'b76aefe3d25841f6bf07055dcbb0b273'), (31,'c5929858abafb16191a07c79ee9269a6'), (31,'e264226ab64eae8335e4ee0bf865bc84'), (31,'eb17c87b4538eb553a628ce36ec7d6ae'), (32,'0c3c99de645803de79a8eb2d3a65ac33'), (32,'0ccfb8bd75661be58be3f9594979cc34'), (32,'2200d85ce941524b6f90a8976ab8eba2'), (32,'3a1a75b3aa8f186b8bc2e39e99e8278c'), (32,'4aab518106074dc34a394f4b42bae293'), (32,'573411a6484042739f99b476922de723'), (32,'8b4a0aff-332c-11e9-aaaf-0242ac110004'), (32,'b76aefe3d25841f6bf07055dcbb0b273'), (32,'c5929858abafb16191a07c79ee9269a6'), (32,'e264226ab64eae8335e4ee0bf865bc84'), (32,'eb17c87b4538eb553a628ce36ec7d6ae'), (33,'0c3c99de645803de79a8eb2d3a65ac33'), (33,'0ccfb8bd75661be58be3f9594979cc34'), (33,'2200d85ce941524b6f90a8976ab8eba2'), (33,'3a1a75b3aa8f186b8bc2e39e99e8278c'), (33,'4aab518106074dc34a394f4b42bae293'), (33,'573411a6484042739f99b476922de723'), (33,'8b4a0aff-332c-11e9-aaaf-0242ac110004'), (33,'b76aefe3d25841f6bf07055dcbb0b273'), (33,'c5929858abafb16191a07c79ee9269a6'), (33,'e264226ab64eae8335e4ee0bf865bc84'), (33,'eb17c87b4538eb553a628ce36ec7d6ae'), (34,'0c3c99de645803de79a8eb2d3a65ac33'), (34,'0ccfb8bd75661be58be3f9594979cc34'), (34,'2200d85ce941524b6f90a8976ab8eba2'), (34,'3a1a75b3aa8f186b8bc2e39e99e8278c'), (34,'4aab518106074dc34a394f4b42bae293'), (34,'573411a6484042739f99b476922de723'), (34,'8b4a0aff-332c-11e9-aaaf-0242ac110004'), (34,'b76aefe3d25841f6bf07055dcbb0b273'), (34,'c5929858abafb16191a07c79ee9269a6'), (34,'e264226ab64eae8335e4ee0bf865bc84'), (34,'eb17c87b4538eb553a628ce36ec7d6ae'); /*Table structure for table `sys_org_relation` */ DROP TABLE IF EXISTS `sys_org_relation`; CREATE TABLE `sys_org_relation` ( `ancestor` int(11) NOT NULL COMMENT '祖先节点', `descendant` int(11) NOT NULL COMMENT '后代节点', PRIMARY KEY (`ancestor`,`descendant`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*Data for the table `sys_org_relation` */ insert into `sys_org_relation`(`ancestor`,`descendant`) values (1,1), (1,16), (1,20), (1,21), (1,23), (1,25), (1,26), (1,27), (1,31), (1,32), (1,33), (1,34), (16,16), (16,23), (16,25), (16,26), (16,31), (16,32), (16,33), (20,20), (20,27), (20,34), (21,21), (23,23), (23,25), (23,26), (23,31), (23,32), (23,33), (25,25), (25,26), (25,31), (25,32), (25,33), (26,26), (26,32), (27,27), (31,31), (32,32), (33,33), (34,34); /*Table structure for table `sys_org_role` */ DROP TABLE IF EXISTS `sys_org_role`; CREATE TABLE `sys_org_role` ( `org_id` int(11) NOT NULL COMMENT '组织ID', `role_id` int(11) NOT NULL COMMENT '角色ID', PRIMARY KEY (`org_id`,`role_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*Data for the table `sys_org_role` */ insert into `sys_org_role`(`org_id`,`role_id`) values (1,1), (11,2), (11,3), (12,1), (12,2), (13,1), (13,2), (14,1), (14,2), (15,1), (15,2), (16,1), (16,2), (20,1), (20,2), (21,1), (21,2), (25,1), (25,2), (25,4), (26,1), (26,2), (26,4), (27,1), (31,1), (32,1), (33,1), (34,1); /*Table structure for table `sys_role` */ DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( `role_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '角色Id', `role_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '角色名称', `role_code` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '角色编码', `role_desc` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '角色描述', `ds_type` char(1) COLLATE utf8mb4_bin NOT NULL DEFAULT '2' COMMENT '数据权限类型', `ds_scope` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '数据权限范围(自定义的)', `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `del_flag` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '删除标识(0-正常,1-删除)', `tenant_id` int(11) DEFAULT NULL COMMENT '所属租户', `version` int(11) DEFAULT '0' COMMENT '版本号', PRIMARY KEY (`role_id`) USING BTREE, UNIQUE KEY `role_idx1_role_code` (`role_code`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='系统角色表'; /*Data for the table `sys_role` */ insert into `sys_role`(`role_id`,`role_name`,`role_code`,`role_desc`,`ds_type`,`ds_scope`,`create_time`,`update_time`,`del_flag`,`tenant_id`,`version`) values (1,'管理员','ROLE_ADMIN','管理员','3','4','2017-10-29 15:45:51','2019-04-25 09:16:00','0',1,0), (2,'ROLE_CQQ','ROLE_CQQ','ROLE_CQQ','0',NULL,'2018-11-11 19:42:26','2018-12-26 14:09:07','0',2,0), (4,'刘家111','nihaao','123112','2',NULL,'2019-04-22 17:51:46','2019-04-22 17:52:17','0',NULL,0); /*Table structure for table `sys_role_menu` */ DROP TABLE IF EXISTS `sys_role_menu`; CREATE TABLE `sys_role_menu` ( `role_id` int(11) NOT NULL COMMENT '角色ID', `menu_id` int(11) NOT NULL COMMENT '菜单ID', PRIMARY KEY (`role_id`,`menu_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色菜单表'; /*Data for the table `sys_role_menu` */ insert into `sys_role_menu`(`role_id`,`menu_id`) values (1,100), (1,200), (1,10001), (1,10002), (1,10003), (1,10004), (1,10005), (1,10006), (1,10007), (1,20001), (1,20002), (1,20003), (1,20004), (1,20005), (1,20006), (1,100011), (1,100012), (1,100013), (1,100014), (1,100015), (1,100021), (1,100022), (1,100023), (1,100031), (1,100032), (1,100033), (1,100041), (1,100042), (1,100051), (1,100061), (1,100062), (1,100071), (1,100072), (1,100073), (1,200011), (1,200012), (1,200013), (1,200021), (1,200022), (1,200023), (1,200031), (1,200032), (1,200033), (1,200041), (1,200042), (1,200043), (1,200044), (1,200051), (1,200052), (1,200053), (1,200061), (1,200062), (1,200063), (2,100), (2,200), (2,10001), (2,10002), (2,10003), (2,10004), (2,10005), (2,10006), (2,10007), (2,20001), (2,20002), (2,20003), (2,20004), (2,20005), (2,20006), (2,100011), (2,100012), (2,100013), (2,100014), (2,100015), (2,100021), (2,100022), (2,100023), (2,100031), (2,100032), (2,100033), (2,100041), (2,100042), (2,100051), (2,100061), (2,100062), (2,100071), (2,100072), (2,100073), (2,200011), (2,200012), (2,200013), (2,200021), (2,200022), (2,200023), (2,200031), (2,200032), (2,200033), (2,200041), (2,200042), (2,200043), (2,200044), (2,200051), (2,200052), (2,200053), (2,200061), (2,200062), (2,200063), (4,100), (4,200), (4,10001), (4,10002), (4,10003), (4,10004), (4,10005), (4,10006), (4,10007), (4,20001), (4,20002), (4,20003), (4,20004), (4,20005), (4,20006), (4,100011), (4,100012), (4,100013), (4,100014), (4,100015), (4,100021), (4,100022), (4,100023), (4,100031), (4,100032), (4,100033), (4,100041), (4,100042), (4,100051), (4,100061), (4,100062), (4,100071), (4,100072), (4,100073), (4,200011), (4,200012), (4,200013), (4,200021), (4,200022), (4,200023), (4,200031), (4,200032), (4,200033), (4,200041), (4,200042), (4,200043), (4,200044), (4,200051), (4,200052), (4,200053), (4,200061), (4,200062), (4,200063); /*Table structure for table `sys_user` */ DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `user_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID', `create_user_id` int(11) DEFAULT NULL COMMENT '创建用户Id', `realname` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '真实名字', `username` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '用户名', `password` varchar(255) COLLATE utf8mb4_bin NOT NULL, `salt` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '随机盐', `phone` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '电话', `identity_card` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '身份证', `mailbox` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '邮箱', `avatar` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '头像', `org_id` int(11) DEFAULT NULL COMMENT '组织ID', `dept_id` int(11) DEFAULT NULL COMMENT '部门ID', `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `lock_flag` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '0-正常,9-锁定', `del_flag` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '0-正常,1-删除', `wx_openid` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '微信openid', `qq_openid` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'QQ openid', `tenant_id` int(11) NOT NULL DEFAULT '0' COMMENT '所属租户', `version` int(11) DEFAULT '0' COMMENT '版本号', PRIMARY KEY (`user_id`), KEY `user_wx_openid` (`wx_openid`) USING BTREE, KEY `user_qq_openid` (`qq_openid`) USING BTREE, KEY `user_idx1_username` (`username`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='用户表'; /*Data for the table `sys_user` */ insert into `sys_user`(`user_id`,`create_user_id`,`realname`,`username`,`password`,`salt`,`phone`,`identity_card`,`mailbox`,`avatar`,`org_id`,`dept_id`,`create_time`,`update_time`,`lock_flag`,`del_flag`,`wx_openid`,`qq_openid`,`tenant_id`,`version`) values (1,NULL,'yuanfang','admin','$2a$10$a6qU.9rS2k.BeAwA8cx6wu0PXU/2wapTiLa2hUFTtR5jFOApHehP.','string','17608422904',NULL,NULL,NULL,NULL,NULL,'2019-06-01 15:55:41','2019-06-01 15:56:33','0','0',NULL,NULL,0,0), (2,1,'12','admin1','$2a$10$RpFJjxYiXdEsAGnWp/8fsOetMuOON96Ntk/Ym2M/RKRyU0GZseaDC',NULL,'17034642887',NULL,NULL,NULL,NULL,3,'2018-04-20 07:15:18','2019-05-29 22:13:06','0','0','o_0FT0uyg_H1vVy2H0JpSwlVGhWQ',NULL,2,0), (5,1,'12','liujiayi','$2a$10$7b0nSDIm35Qk1fB01fSU1efy3WsHjxfbvOCMzzmHpOktj5QTHNrde','666668','155232984121',NULL,NULL,'1',NULL,1,'2019-04-24 16:19:09','2019-05-29 22:13:13','0','0',NULL,NULL,1,1), (6,NULL,'yuan','yuan','$2a$10$gbFpllVzz068MB/St2ZSO.B8q1MpiwCuKYIxI1YQN3n4W3tKa1wYS',NULL,'1234567890',NULL,NULL,NULL,NULL,NULL,'2019-05-30 11:06:28',NULL,'0','0',NULL,NULL,0,0), (7,NULL,'string','string','$2a$10$FoRTd7RZVws4xsvXeeOof.7qZaeKvuS8UQMeoGz/ZsZPxBQK6s7qe','string','12312312',NULL,NULL,NULL,0,NULL,'2019-05-30 18:49:46','2019-05-30 18:51:33','0','0',NULL,NULL,0,0), (8,NULL,'string','string','$2a$10$fo8zr.9uDe5Q8HErJ5LYjestdlxtqrCKdKxUk/.oEwZtwCUhFzA56','string','string',NULL,NULL,NULL,0,NULL,'2019-05-30 18:52:00',NULL,'0','0',NULL,NULL,0,0), (9,NULL,'string','string','$2a$10$xCOIq4A1j/VVV07BBv8UPegIQdrjfqg7CIxYzTFCv1fRFqKg3v4ry','string','string',NULL,NULL,NULL,0,NULL,'2019-05-30 18:52:45',NULL,'0','0',NULL,NULL,0,0), (13,NULL,'csdds','admin2323','$2a$10$Q/F6o2IrHueo2fRfCmNUw.Q1jZAjJEFtNEbN0zuGUP/VC3lm25qhS',NULL,'18666665555',NULL,NULL,'/images/20190601144501/4.jpg',NULL,NULL,'2019-06-01 14:45:22',NULL,'0','0',NULL,NULL,0,0); /*Table structure for table `sys_user_dept` */ DROP TABLE IF EXISTS `sys_user_dept`; CREATE TABLE `sys_user_dept` ( `user_id` int(11) NOT NULL COMMENT '用户Id', `dept_id` int(11) NOT NULL COMMENT '部门Id', PRIMARY KEY (`user_id`,`dept_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*Data for the table `sys_user_dept` */ /*Table structure for table `sys_user_org` */ DROP TABLE IF EXISTS `sys_user_org`; CREATE TABLE `sys_user_org` ( `user_id` int(11) NOT NULL COMMENT '用户ID', `org_id` int(11) NOT NULL COMMENT '组织ID', PRIMARY KEY (`user_id`,`org_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*Data for the table `sys_user_org` */ insert into `sys_user_org`(`user_id`,`org_id`) values (1,1), (2,16), (5,20), (6,21), (7,22), (13,-1), (14,0), (15,0), (16,0); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
true
463bbb25861afd247383edfc7fce11f0ac96508d
SQL
abby-lee/SPM-IS212-G1T6
/database/lms_database.sql
UTF-8
12,625
3.375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Sept 21, 2021 at 09:48 AM -- Server version: 8.0.18 -- PHP Version: 7.4.0 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+08:00"; -- Database: `spm_G1T6lms` -- CREATE DATABASE IF NOT EXISTS `lms_database` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `lms_database`; -- -------------------------------------------------------- -- -- Table structure for table `admins` -- DROP TABLE IF EXISTS `admins`; CREATE TABLE IF NOT EXISTS `admins` ( `admins_eid` int(11) NOT NULL AUTO_INCREMENT, `admins_name` char(26) NOT NULL, `admins_email` varchar(1000) NOT NULL, PRIMARY KEY (`admins_eid`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- -- Dumping data for table `admins` -- INSERT INTO `admins` (`admins_eid`, `admins_name`, `admins_email`) VALUES (1, 'Ding Zheng Xun', 'ding.zheng.xun@gmail.com'), (2, 'Zeng Xin Ling', 'zeng.xin.ling@gmail.com'), (3, 'Serena Lim', 'serena.lim@gmail.com'), (4, 'Rachel Soh', 'rachel.soh@gmail.com'), (5, 'Lee Jun Wei', 'lee.jun.wei@gmail.com'), (6, 'Christopher Low', 'chris.low@gmail.com'), (7, 'Rayn Lee', 'rayn.lee@gmail.com'), (8, 'Taufik Bautisah', 'taufik.bautisah@gmail.com'), (9, 'Linda Quek', 'linda.quek@gmail.com'), (10, 'Xia Xue', 'xia.xue@gmail.com'); -- -------------------------------------------------------- -- -- Table structure for table `courses` -- DROP TABLE IF EXISTS `courses`; CREATE TABLE IF NOT EXISTS `courses` ( `course_code` int(11) NOT NULL AUTO_INCREMENT, `course_title` varchar(1000) NOT NULL, `description` varchar(1000) NOT NULL, `prerequisites` varchar(1000) NULL, PRIMARY KEY (`course_code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- -- Dumping data for table `courses` -- INSERT INTO `courses` (`course_code`,`course_title`,`description`,`prerequisites`) VALUES (1001, 'All About Maintenance', 'Basics about how to check and ensure all components of the copier is working well',''), (1002, 'Customer Service:Soft Skills Fundamentals', 'Learning to communicate well with customers', ''), (1003, 'Customer Service Mastery: Delight Every Customer', 'Making every customer happy and satisfied with service provided', ''), (1004, 'Foundations of Copier Repair', 'Basics about repairing copiers', 'Foundations of how Copiers work'), (1005, 'Basics of Hardware Repair', 'Basics about how to check and repair hardware that is faulty', ''), (1006, 'Basics of Software Repair', 'Basics about how to check and repair software that is faulty', ''), (1007, 'Printer Repair: Learn how to test Printer Components', 'Basics about printer components and how to test them to track issues that occur', ''), (1008, 'Identification & Resolution of Client Equipment & Systems (Beginner)', 'Learning to find issues in customer systems and solve them ', ''), (1009, 'Identification & Resolution of Client Equipment & Systems (Intermediate)', 'Learning to find issues in customer systems and solve them ', 'Identification & Resolution of Client Equipment & Systems (Beginner)'), (1010, 'Identification & Resolution of Client Equipment & Systems (Advanced)', 'Learning to find issues in customer systems and solve them ', 'Identification & Resolution of Client Equipment & Systems (Intermediate)'), (1011, 'Conduct of Maintenance for Printers/Copiers', 'Basics about how to check and ensure all components of the copier is working well', ''), (1012, 'Conduct of Maintenance for Printers/Copiers', 'Basics about how to check and ensure all components of the copier is working well', ''), (1013, 'Sensors, Instrumentation & Control', 'Basics about how to check and ensure all components of the copier is working well', ''), (1014, 'Foundations of Printer Repairs', 'Basics about how to check and ensure all components of the copier is working well', ''), (1015, 'Learning to Deal with Difficult Customers', 'Learning how customers think and how to speak with angry customers and appease them', ''), (1016, 'Introduction to Printing Solutions', 'Learning how to solve problems with printers', ''), (1017, 'Introduction to Service Management', 'Learning how to provide Excellent Service', ''), (1018, 'Maintenance Planning & Scheduling', 'Basics of maintenance planning so that engineers are able to schedule timely maintenance before systems are faulty', ''), (1019, 'Foundations of how Copiers work', 'Basics of how copiers work', ''); -- -------------------------------------------------------- -- -- Table structure for table `trainers` -- DROP TABLE IF EXISTS `trainers`; CREATE TABLE IF NOT EXISTS `trainers` ( `trainers_eid` int(11) NOT NULL AUTO_INCREMENT, `trainers_name` char(26) NOT NULL, `trainers_email` varchar(1000) NOT NULL, `qualifications` varchar(1000) NOT NULL, `specialisation` varchar(1000) NOT NULL, PRIMARY KEY (`trainers_eid`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- -- Dumping data for table `trainers` -- INSERT INTO `trainers` (`trainers_eid`, `trainers_name`, `trainers_email`, `qualifications`,`specialisation`) VALUES (1, 'Laura Valdez', 'Laura.Valdez@gmail.com', "Bachelor's Degree in Technology Management", 'Foundations of Copier Repair, Customer Service:Soft Skills Fundamentals'), (2, 'Diana Cummings', 'Diana.Cummings@gmail.com', "Bachelor's Degree in Engineering Technology", 'Basics of Hardware Repair, Basics of Software Repair'), (3, 'Camilla Parker','Camilla.Parker@gmail.com', "Bachelor's Degree in Information Systems",'Introduction to Printing Solutions'), (4, 'Christian Manwaring' ,'Christian.Manwaring@gmail.com', "Bachelor's Degree in Customer Relationship Management",'Customer Service Mastery: Delight Every Customer, Introduction to Service Management'), (5, 'Maxwell Simonds', 'Maxwell.Simonds@gmail.com', "Bachelor's Degree in Computer Engineering", 'Printer Repair: Learn how to test Printer Components'), (6, 'Francis Rowe', 'Francis.Rowe@gmail.com', "Bachelor's Degree in Electrical Engineering with a Minor in Field Studies", 'Identification & Resolution of Client Equipment & Systems (Beginner), Identification & Resolution of Client Equipment & Systems (Intermediate), Identification & Resolution of Client Equipment & Systems (Advanced)'), (7, 'Shane Poe', 'Shane.Poe@gmail.com', "Bachelor's Degree in Maintenance Engineering", 'Maintenance Management, Conduct of Maintenance for Printers/Copiers'), (8, 'Kelsey Carlson','Kelsey.Carlson@gmail.com', "Bachelor's Degree in Computer Science",'Foundations of Printer Repairs'), (9, 'Faye Park','Faye.Park@gmail.com', "Bachelor's Degree in Maintenance Engineering",'Introduction to Printing Solutions'), (10, 'Betty Craig', 'Betty.Craig@gmail.com', "Bachelor's Degree in Customer Service",'Learning to Deal with Difficult Customers'); -- -------------------------------------------------------- -- -- Table structure for table `section` -- DROP TABLE IF EXISTS `sections`; CREATE TABLE IF NOT EXISTS `sections` ( `class_section` varchar(2) NOT NULL, `course_code` int(11) NOT NULL, `class_size` int(11) NOT NULL, `duration` int(11) NOT NULL, `trainers_eid` int(11) DEFAULT NULL, `vacancies` int(11) NOT NULL, PRIMARY KEY (`class_section`, `course_code`), CONSTRAINT `section_ibfk_1` FOREIGN KEY (`trainers_eid`) REFERENCES `trainers` (`trainers_eid`), CONSTRAINT `section_ibfk_2` FOREIGN KEY (`course_code`) REFERENCES `courses` (`course_code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- -- Dumping data for table `section` -- INSERT INTO `sections` (`class_section`, `course_code`, `class_size`, `duration`, `trainers_eid`, `vacancies`) VALUES ('G1', 1008, 40, 3, 1, 40), ('G1', 1009, 40, 3, 1, 40), ('G2', 1003, 40, 3, 2, 40), ('G3', 1005, 40, 3, 3, 40); -- -------------------------------------------------------- -- -- Table structure for table `learners` -- -- CHANGE: Remove course_code and class_section so that one learner can take up multiple courses DROP TABLE IF EXISTS `learners`; CREATE TABLE IF NOT EXISTS `learners` ( `learners_eid` int(11) NOT NULL AUTO_INCREMENT, `learners_name` char(26) NOT NULL, `learners_email` varchar(1000) NOT NULL, `learners_qualifications` varchar(1000) NOT NULL, `courses_completed` varchar(1000) DEFAULT NULL, PRIMARY KEY (`learners_eid`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- -- Dumping data for table `learners` -- INSERT INTO `learners` (`learners_eid`, `learners_name`, `learners_email`, `learners_qualifications`, `courses_completed`) VALUES (1, 'Marcus Foo', 'Marcus.Foo@gmail.com', "Bachelor's Degree in Customer Relationship Management", 'Customer Service:Soft Skills Fundamentals'), (2, 'Alan Chan', 'Alan.Chan@gmail.com', "Bachelor's Degree in Information Systems", 'Introduction to Printing Solutions'), (3, 'Hong Seng', 'Hong.Seng@gmail.com', "Bachelor's Degree in Maintenance Engineering", ''), (4, 'Jennifer Lawrence', 'Jennifer.Lawrence@gmail.com', "Bachelor's Degree in Maintenance Engineering",'Conduct of Maintenance for Printers/Copiers'), (5, 'June Chow', 'June.Chow@gmail.com',"Bachelor's Degree in Technology Management", ''), (6, 'Phil Lee', 'Phil.Lee@gmail.com', "Bachelor's Degree in Customer Service",'Maintenance Planning & Scheduling'), (7, 'Jacob Tok', 'Jacob.Tok@gmail.com', "Bachelor's Degree in Computer Engineering",'Foundations of Printer Repairs'), (8, 'Yong Hao Koh', 'Yong Hao.Koh@gmail.com', "Bachelor's Degree in Electrical Engineering with a Minor in Field Studies",''), (9, 'Jones Low', 'Jones.Low@gmail.com', "Bachelor's Degree in Electrical Engineering", 'Foundations of how Copiers work'), (10, 'Linda Teng', 'Linda.Teng@gmail.com', "Bachelor's Degree in Engineering Technology",''); -- -------------------------------------------------------- -- -- Table structure for table `progress` -- -- CHANGE: Rename enroling table to progress & added chapter_completed column to track if learners completed a lesson before accessing the materials for another lesson DROP TABLE IF EXISTS `progress`; CREATE TABLE IF NOT EXISTS `progress` ( `learners_eid` int(11) NOT NULL, `course_code` int(11) NOT NULL, `class_section` varchar(2) NOT NULL, `chapter_completed` int(100) NOT NULL, PRIMARY KEY (`learners_eid`, `course_code`, `class_section`), CONSTRAINT `enroling_ibfk_1` FOREIGN KEY (`learners_eid`) REFERENCES `learners` (`learners_eid`), CONSTRAINT `enroling_ibfk_2` FOREIGN KEY (`course_code`) REFERENCES `courses` (`course_code`), CONSTRAINT `enroling_ibfk_3` FOREIGN KEY (`class_section`) REFERENCES `sections` (`class_section`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `quizzes` -- DROP TABLE IF EXISTS `quizzes`; CREATE TABLE IF NOT EXISTS `quizzes` ( `quizid` int(11) NOT NULL AUTO_INCREMENT, `course_code` int(11) NOT NULL, `class_section` varchar(2) NOT NULL, `time` int(11) NOT NULL, `graded` varchar(1) NOT NULL, PRIMARY KEY (`quizid`, `course_code`, `class_section`), CONSTRAINT `quizzes_ibfk_1` FOREIGN KEY (`course_code`) REFERENCES `courses` (`course_code`), CONSTRAINT `quizzes_ibfk_2` FOREIGN KEY (`class_section`) REFERENCES `sections` (`class_section`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `quizquestions` -- DROP TABLE IF EXISTS `quizquestions`; CREATE TABLE IF NOT EXISTS `quizquestions` ( `questionid` int(11) NOT NULL AUTO_INCREMENT, `course_code` int(11) NOT NULL, `class_section` varchar(2) NOT NULL, `quizid` int(11) NOT NULL, `questiontext` varchar(1000) NOT NULL, `questiontype` varchar(4) NOT NULL, `questionoptions` varchar(1000) NOT NULL, `answertext` varchar(1000) NOT NULL, PRIMARY KEY (`questionid`,`course_code`, `class_section`, `quizid`), CONSTRAINT `quizquestions_ibfk_1` FOREIGN KEY (`course_code`) REFERENCES `courses` (`course_code`), CONSTRAINT `quizquestions_ibfk_2` FOREIGN KEY (`class_section`) REFERENCES `sections` (`class_section`), CONSTRAINT `quizquestions_ibfk_3` FOREIGN KEY (`quizid`) REFERENCES `quizzes` (`quizid`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `materials` -- -- CHANGE: Added material_chapter column to link the materials to a lesson (there may be several materials under one lesson) DROP TABLE IF EXISTS `materials`; CREATE TABLE IF NOT EXISTS `materials` ( `material_id` int(11) NOT NULL AUTO_INCREMENT, `course_code` int(11) NOT NULL, `class_section` varchar(2) NOT NULL, `material_name` varchar(100) NOT NULL, `material_type` varchar(100) NOT NULL, `material_link` varchar(1000) NOT NULL, `material_chapter` int(100) NOT NULL, PRIMARY KEY (`material_id`, `course_code`, `class_section`), CONSTRAINT `materials_ibfk_1` FOREIGN KEY (`course_code`) REFERENCES `courses` (`course_code`), CONSTRAINT `materials_ibfk_2` FOREIGN KEY (`class_section`) REFERENCES `sections` (`class_section`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
true
3c618ea9f7c9e71cf2f4095b255dc2d9a3cd9e6a
SQL
MirelaMileva/Databases-MSSQL-SoftUni-Homework
/SubqueriesAndJOINsExercise/17.HighestPeakAndLongestRiverByCountry.sql
UTF-8
500
4.09375
4
[ "MIT" ]
permissive
SELECT TOP(5) CountryName, MAX(p.Elevation) AS HighestPeakElevation, MAX(r.Length) AS LongestRiverLength FROM Countries AS c LEFT JOIN MountainsCountries AS mc ON mc.CountryCode = c.CountryCode LEFT JOIN Mountains AS m ON m.Id = mc.MountainId LEFT JOIN Peaks AS p ON p.MountainId = m.Id LEFT JOIN CountriesRivers AS cr ON cr.CountryCode = c.CountryCode LEFT JOIN Rivers AS r ON r.Id = cr.RiverId GROUP BY CountryName ORDER BY HighestPeakElevation DESC, LongestRiverLength DESC, CountryName
true
708066bb62cce673c8ff02e3eb9c9aa73e68a970
SQL
VinothSelvaraju/SQL-Engine
/sqlfile/pi7.sql
UTF-8
190
2.953125
3
[]
no_license
CREATE TABLE personInfo(id int, first_name string, last_name string, Gender string, age int, State string) SELECT gender, State, avg(age) from personInfo where age<60 group by gender, State
true
af87cd2e05444f43a49e50fd7a91e106f1f6dd9c
SQL
transcom/mymove
/migrations/app/schema/20230504214413_adjust_contract_years.up.sql
UTF-8
197
2.5625
3
[ "MIT", "LicenseRef-scancode-public-domain" ]
permissive
ALTER TABLE re_contract_years DROP CONSTRAINT re_contract_years_daterange_excl, ADD CONSTRAINT re_contract_years_daterange_excl EXCLUDE USING gist(DATERANGE(start_date, end_date, '[]') WITH &&);
true
e7417e89cd7e049e3893c22401708500775abce1
SQL
vincenteichhorn/praystorm-beamer-backend
/database/praystorm_alt_20-03-21.sql
UTF-8
15,977
3.265625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Erstellungszeit: 21. Mrz 2020 um 18:52 -- Server-Version: 10.1.19-MariaDB -- PHP-Version: 7.0.13 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 */; -- -- Datenbank: `praystorm` -- -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `events` -- CREATE TABLE `events` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `description` varchar(255) DEFAULT NULL, `date` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Daten für Tabelle `events` -- INSERT INTO `events` (`id`, `name`, `description`, `date`) VALUES (1, 'praystorm', 'Ablauf praystorm Lobpreisabend', '2020-04-04'), (3, 'Jugengottesdienst', 'Ablauf Jugengottesdiens', '2020-04-04'); -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `parts` -- CREATE TABLE `parts` ( `id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `type` enum('SONG','INSERT') NOT NULL, `author` varchar(255) DEFAULT NULL, `album` varchar(255) DEFAULT NULL, `copyright` varchar(255) DEFAULT NULL, `indivSeq` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Daten für Tabelle `parts` -- INSERT INTO `parts` (`id`, `title`, `type`, `author`, `album`, `copyright`, `indivSeq`) VALUES (1, 'One Way', 'SONG', 'Hillsong Worship', 'Ultimate Worship Vol 1', 'Hillsong Music 2006\nWords & Music by Joel Houston and Jonathon Douglass', NULL), (15, 'Der Mond ist aufgegangen\r\n', 'SONG', NULL, NULL, 'CCLI-Liednummer 4335292\r\nMatthias Claudius\r\nPublic Domain \r\nNutzung ausschließlich im Rahmen der SongSelect®-Nutzungsbedingungen. Alle Rechte vorbehalten. www.ccli.com\r\n', NULL), (22, 'Von guten Mächten treu und still umgeben\r\n', 'SONG', NULL, NULL, 'CCLI-Liednummer 4891516\r\nDietrich Bonhoeffer\r\nPublic Domain \r\nNutzung ausschließlich im Rahmen der SongSelect®-Nutzungsbedingungen. Alle Rechte vorbehalten. www.ccli.com\r\n', NULL), (23, 'Macht hoch die Tür die Tor macht weit\r\n', 'SONG', NULL, NULL, 'CCLI-Liednummer 5588206\r\nGeorg Weissel | Johann Anastasius Freylinghausen\r\n© Words: Public Domain \r\nMusic: Public Domain \r\n', NULL); -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `parts_to_event` -- CREATE TABLE `parts_to_event` ( `id` int(11) NOT NULL, `eventID` int(11) NOT NULL, `partID` int(11) NOT NULL, `position` int(3) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Daten für Tabelle `parts_to_event` -- INSERT INTO `parts_to_event` (`id`, `eventID`, `partID`, `position`) VALUES (1, 1, 1, 0), (2, 1, 15, 0), (7, 3, 22, 2), (8, 3, 23, 1); -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `slides` -- CREATE TABLE `slides` ( `id` int(11) NOT NULL, `partID` int(11) NOT NULL, `title` varchar(255) NOT NULL, `shorthand` varchar(255) DEFAULT NULL, `position` int(11) NOT NULL, `type` enum('SONGPART','IMAGE','VIDEO','TEXT') NOT NULL, `data` longtext NOT NULL, `numOfLang` int(1) NOT NULL DEFAULT '1', `styleID` int(2) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Daten für Tabelle `slides` -- INSERT INTO `slides` (`id`, `partID`, `title`, `shorthand`, `position`, `type`, `data`, `numOfLang`, `styleID`) VALUES (1, 1, 'Vers 1', 'V1', 0, 'SONGPART', '{\n "lyrics": [\n "I lay my life down at Your feet",\n "You''re the only One I need","I turn to You and You are always there",\n "In troubled times it''s all I need",\n "I humble all I am all to You"\n ], \n "image": "http://localhost/praystorm-beamer-backend/images/test.jpg",\n "video": "http://localhost/praystorm-beamer-backend/images/video.mp4"\n }', 1, 1), (2, 1, 'Chorus', 'C', 1, 'SONGPART', '{\r\n "lyrics": [\r\n "One way, Jesus!",\r\n"You''re the only one that I could live for",\r\n"One Way, Jesus!",\r\n"You''re the only one that I could live for"\r\n ], \r\n "image": "http://localhost/praystorm-beamer-backend/images/test.jpg",\r\n "video": "http://localhost/praystorm-beamer-backend/images/video.mp4"\r\n }', 1, 1), (3, 1, 'Vers 2', 'V2', 2, 'SONGPART', '{\r\n "lyrics": [\r\n "I lay my life down at Your feet",\r\n "You''re the only One I need","I turn to You and You are always there",\r\n "In troubled times it''s all I need",\r\n "I humble all I am all to You"\r\n ], \r\n "image": "http://localhost/praystorm-beamer-backend/images/test.jpg",\r\n "video": "http://localhost/praystorm-beamer-backend/images/video.mp4"\r\n }', 1, 1), (4, 1, 'Bridge', 'B', 3, 'SONGPART', '{\r\n "lyrics": [\r\n "I lay my life down at Your feet",\r\n "You''re the only One I need","I turn to You and You are always there",\r\n "In troubled times it''s all I need",\r\n "I humble all I am all to You"\r\n ], \r\n "image": "http://localhost/praystorm-beamer-backend/images/test.jpg",\r\n "video": "http://localhost/praystorm-beamer-backend/images/video.mp4"\r\n }', 1, 1), (38, 15, 'Vers 1', 'V1', 0, 'SONGPART', '{\r\n "lyrics": [\r\n "I lay my life down at Your feet",\r\n "You''re the only One I need","I turn to You and You are always there",\r\n "In troubled times it''s all I need",\r\n "I humble all I am all to You"\r\n ], \r\n "image": "http://localhost/praystorm-beamer-backend/images/test.jpg",\r\n "video": "http://localhost/praystorm-beamer-backend/images/video.mp4",\r\n "text": "<h1>Das ist ein Text mit echtem HTML</h1>"\r\n }', 1, 1), (39, 15, 'Chorus', 'C', 1, 'SONGPART', '{\r\n "lyrics": [\r\n "I lay my life down at Your feet",\r\n "You''re the only One I need","I turn to You and You are always there",\r\n "In troubled times it''s all I need",\r\n "I humble all I am all to You"\r\n ], \r\n "image": "http://localhost/praystorm-beamer-backend/images/test.jpg",\r\n "video": "http://localhost/praystorm-beamer-backend/images/video.mp4",\r\n "text": "<h1>Das ist ein Text mit echtem HTML</h1>"\r\n }', 1, 1), (40, 15, 'Vers 2', 'V2', 2, 'SONGPART', '{\r\n "lyrics": [\r\n "I lay my life down at Your feet",\r\n "You''re the only One I need","I turn to You and You are always there",\r\n "In troubled times it''s all I need",\r\n "I humble all I am all to You"\r\n ], \r\n "image": "http://localhost/praystorm-beamer-backend/images/test.jpg",\r\n "video": "http://localhost/praystorm-beamer-backend/images/video.mp4",\r\n "text": "<h1>Das ist ein Text mit echtem HTML</h1>"\r\n }', 1, 1), (41, 15, 'Bridge', 'B', 3, 'SONGPART', '{\r\n "lyrics": [\r\n "I lay my life down at Your feet",\r\n "You''re the only One I need","I turn to You and You are always there",\r\n "In troubled times it''s all I need",\r\n "I humble all I am all to You"\r\n ], \r\n "image": "http://localhost/praystorm-beamer-backend/images/test.jpg",\r\n "video": "http://localhost/praystorm-beamer-backend/images/video.mp4",\r\n "text": "<h1>Das ist ein Text mit echtem HTML</h1>"\r\n }', 1, 1), (60, 22, 'Vers 1\r\n', 'V1\r\n', 0, 'SONGPART', '{"lyrics":["Von guten M\\u00e4chten treu und still umgeben,","beh\\u00fctet und getr\\u00f6stet wunderbar.","So will ich diese Tage mit euch leben","und mit euch gehen in ein neues Jahr."],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (61, 22, 'Chorus\r\n', 'C', 1, 'SONGPART', '{"lyrics":["Von guten M\\u00e4chten wunderbar geborgen,","erwarten wir getrost, was kommen mag.","Gott ist bei uns am Abend und am Morgen","und ganz gewiss an jedem neuen Tag."],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (62, 22, 'Vers 2\r\n', 'V2\r\n', 2, 'SONGPART', '{"lyrics":["Noch will das alte unsre Herzen qu\\u00e4len,","noch dr\\u00fcckt uns b\\u00f6ser Tage schwere Last.","Ach, Herr, gib unsern aufgeschreckten Seelen","das Heil, f\\u00fcr das du uns geschaffen hast."],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (63, 22, 'Vers 3\r\n', 'V3\r\n', 3, 'SONGPART', '{"lyrics":["Und reichst du uns den schweren Kelch, den bittern","des Leids, gef\\u00fcllt bis an den h\\u00f6chsten Rand,","So nehmen wir ihn dankbar ohne Zittern","aus deiner guten und geliebten Hand."],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (64, 22, 'Vers 4\r\n', 'V4\r\n', 4, 'SONGPART', '{"lyrics":["Doch willst du uns noch einmal Freude schenken","an dieser Welt und ihrer Sonne Glanz,","Dann wolln wir des Vergangenen gedenken","und dann geh\\u00f6rt dir unser Leben ganz."],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (65, 22, 'Vers 5\r\n', 'V5\r\n', 5, 'SONGPART', '{"lyrics":["Lass warm und hell die Kerzen heute flammen,","die du in unsre Dunkelheit gebracht.","F\\u00fchr, wenn es sein kann, wieder uns zusammen.","Wir wissen es, dein Licht scheint in der Nacht."],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (66, 22, 'Vers 6\r\n', 'V6\r\n', 6, 'SONGPART', '{"lyrics":["Wenn sich die Stille nun tief um uns breitet,","So lass uns h\\u00f6ren jenen vollen Klang","Der Welt, die unsichtbar sich um uns weitet,","All deiner Kinder hohen Lobgesang."],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (67, 23, 'Vers 1\r\n', 'V1\r\n', 0, 'SONGPART', '{"lyrics":["Macht hoch die T\\u00fcr, die Tor macht weit;","es kommt der Herr der Herrlichkeit,","ein K\\u00f6nig aller K\\u00f6nigreich,","ein Heiland aller Welt zugleich,","der Heil und Leben mit sich bringt;","derhalben jauchzt, mit Freuden singt:","Gelobet sei mein Gott,","mein Sch\\u00f6pfer reich an Rat!"],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (68, 23, 'Vers 2\r\n', 'V2\r\n', 1, 'SONGPART', '{"lyrics":["Er ist gerecht, ein Helfer wert;","Sanftm\\u00fctigkeit ist sein Gef\\u00e4hrt,","sein K\\u00f6nigskron ist Heiligkeit,","sein Zepter ist Barmherzigkeit;","all unsre Not zum End er bringt,","derhalben jauchzt, mit Freuden singt:","Gelobet sei mein Gott,","mein Heiland gro\\u00df von Tat!"],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (69, 23, 'Vers 3\r\n', 'V3\r\n', 2, 'SONGPART', '{"lyrics":["O wohl dem Land, o wohl der Stadt,","so diesen K\\u00f6nig bei sich hat!","Wohl allen Herzen insgemein,","da dieser K\\u00f6nig ziehet ein!","Er ist die rechte Freudensonn,","bringt mit sich lauter Freud und Wonn.","Gelobet sei mein Gott,","mein Tr\\u00f6ster fr\\u00fch und spat!"],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (70, 23, 'Vers 4\r\n', 'V4\r\n', 3, 'SONGPART', '{"lyrics":["Macht hoch die T\\u00fcr, die Tor macht weit!","Eur Herz zum Tempel zubereit''.","Die Zweiglein der Gottseligkeit","steckt auf mit Andacht, Lust und Freud;","so kommt der K\\u00f6nig auch zu euch,","ja, Heil und Leben mit zugleich.","Gelobet sei mein Gott,","voll Rat, voll Tat, voll Gnad!"],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1), (71, 23, 'Vers 5\r\n', 'V5\r\n', 4, 'SONGPART', '{"lyrics":["Komm, o mein Heiland Jesu Christ,","meins Herzens T\\u00fcr dir offen ist.","Ach zieh mit deiner Gnade ein;","dein Freundlichkeit auch uns erschein.","Dein Heilger Geist uns f\\u00fchr und leit","den Weg zur ewgen Seligkeit.","Dem Namen dein, o Herr,","sei ewig Preis und Ehr!"],"image":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/test.jpg","video":"http:\\/\\/localhost\\/praystorm-beamer-backend\\/images\\/video.mp4"}', 1, 1); -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `slidestyle` -- CREATE TABLE `slidestyle` ( `id` int(11) NOT NULL, `backgroundImage` varchar(100) NOT NULL, `backgroundColor` varchar(7) NOT NULL, `verseFontSize` int(2) NOT NULL, `verseSpacing` int(2) NOT NULL, `copyrightFontSize` int(2) NOT NULL, `copyrightColor` varchar(7) NOT NULL, `verseColor` varchar(7) NOT NULL, `additive` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Daten für Tabelle `slidestyle` -- INSERT INTO `slidestyle` (`id`, `backgroundImage`, `backgroundColor`, `verseFontSize`, `verseSpacing`, `copyrightFontSize`, `copyrightColor`, `verseColor`, `additive`) VALUES (1, '/media/home/presenter-card.jpg', 'black', 48, 20, 12, 'orange', 'white', ''); -- -- Indizes der exportierten Tabellen -- -- -- Indizes für die Tabelle `events` -- ALTER TABLE `events` ADD PRIMARY KEY (`id`); -- -- Indizes für die Tabelle `parts` -- ALTER TABLE `parts` ADD PRIMARY KEY (`id`); -- -- Indizes für die Tabelle `parts_to_event` -- ALTER TABLE `parts_to_event` ADD PRIMARY KEY (`id`), ADD KEY `eventID` (`eventID`), ADD KEY `partID` (`partID`); -- -- Indizes für die Tabelle `slides` -- ALTER TABLE `slides` ADD PRIMARY KEY (`id`), ADD KEY `part_id` (`partID`), ADD KEY `styleID` (`styleID`); -- -- Indizes für die Tabelle `slidestyle` -- ALTER TABLE `slidestyle` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT für exportierte Tabellen -- -- -- AUTO_INCREMENT für Tabelle `events` -- ALTER TABLE `events` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT für Tabelle `parts` -- ALTER TABLE `parts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT für Tabelle `parts_to_event` -- ALTER TABLE `parts_to_event` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT für Tabelle `slides` -- ALTER TABLE `slides` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=72; -- -- AUTO_INCREMENT für Tabelle `slidestyle` -- ALTER TABLE `slidestyle` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- Constraints der exportierten Tabellen -- -- -- Constraints der Tabelle `parts_to_event` -- ALTER TABLE `parts_to_event` ADD CONSTRAINT `parts_to_event_ibfk_1` FOREIGN KEY (`eventID`) REFERENCES `events` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `parts_to_event_ibfk_2` FOREIGN KEY (`partID`) REFERENCES `parts` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints der Tabelle `slides` -- ALTER TABLE `slides` ADD CONSTRAINT `slides_ibfk_1` FOREIGN KEY (`partID`) REFERENCES `parts` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION, ADD CONSTRAINT `slides_ibfk_2` FOREIGN KEY (`styleID`) REFERENCES `slidestyle` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; /*!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
ad4599dafac2840f0a44bb4f59a0fe5b3a68b706
SQL
redrurm/bbdd-
/PR2 consulta 4.sql
UTF-8
1,421
3.71875
4
[]
no_license
--PENDIENTE DE PRUEBA /* Crea un procedimiento DATOS_CLIENTES que recorra todos los Clientes con un FOR y muestre todos sus datos junto con la suma de importe total de todos sus pedidos. Finalmente se mostrará la suma total de los importes de todos los pedidos de todos los clientes. */ create or replace PROCEDURE DATOS_CLIENTES AS v_ImporteClientes NUMBER(8,2); v_ImporteTotal NUMBER(8,2); v_DNI clientes.DNI%TYPE; CURSOR cl IS SELECT DISTINCT clientes.DNI, clientes.NOMBRE, clientes.APELLIDO, clientes.CALLE, clientes.NUMERO, clientes.PISO, clientes.LOCALIDAD, clientes.CODIGO_POSTAL, clientes.TELEFONO, clientes.USUARIO, clientes. CONTRASENIA FROM CLIENTES, PEDIDOS WHERE clientes.DNI = pedidos.CLIENTE; BEGIN v_ImporteClientes := 0; FOR curCliente in cl LOOP v_DNI := curCliente.DNI; SELECT SUM (importeTotal) into v_ImporteTotal FROM PEDIDOS WHERE Pedidos.Cliente = v_DNI GROUP BY Pedidos.Cliente; DBMS_OUTPUT.PUT_LINE (curCliente.DNI || ', ' || curCliente.nombre || ', ' || curCliente.apellido || ',' || curCliente.calle ||',' || curCliente.numero || ', ' || curCliente.piso || ',' || curCliente.localidad || ',' || curCliente.telefono || ', ' || curCliente.usuario || ', ' || v_ImporteTotal); v_ImporteClientes:= v_ImporteClientes + v_ImporteTotal; END LOOP; DBMS_OUTPUT.PUT_LINE(' Importe total clientes :' || v_importeTotalClientes ); END;
true
d07239254717b79e7b70dbfc02d8e23ace6a0d51
SQL
LynxDevelopment/SDMWeb
/SDMWeb/script_db/oracle/core/create/02_references.sql
UTF-8
3,130
3.28125
3
[]
no_license
ALTER TABLE TB_EVENTS ADD CONSTRAINT FK_TB_EVENTS FOREIGN KEY (TYPE_ID) REFERENCES TB_EVENT_TYPE ON DELETE CASCADE; ALTER TABLE TB_FUNCTION_GROUPS ADD CONSTRAINT FK_TR_GROUPS_FUNCTIONS FOREIGN KEY (GROUP_ID) REFERENCES TB_GROUPS ON DELETE CASCADE; ALTER TABLE TB_FUNCTION_GROUPS ADD CONSTRAINT FK_TB_FUNCTIONS FOREIGN KEY (FUNCTION_ID, MODULE_ID) REFERENCES TB_FUNCTIONS ON DELETE CASCADE; ALTER TABLE TB_FUNCTIONS ADD CONSTRAINT FK_TB_MODULES FOREIGN KEY (MODULE_ID) REFERENCES TB_MODULES ON DELETE CASCADE; ALTER TABLE TB_GROUPS ADD CONSTRAINT FK_TB_GROUP_TYPES FOREIGN KEY (GROUP_TYPE) REFERENCES TB_GROUP_TYPES ON DELETE CASCADE; ALTER TABLE TB_MENU_ITEM_GROUP ADD CONSTRAINT FK_GROUP_ITEM FOREIGN KEY (MENU_ITEM_ID) REFERENCES TB_MENU_ITEMS (MENU_ITEM_ID) ON DELETE CASCADE; ALTER TABLE TB_MENU_ITEM_GROUP ADD CONSTRAINT FK_ITEM_GROUP FOREIGN KEY (GROUP_ID) REFERENCES TB_GROUPS ON DELETE CASCADE; ALTER TABLE TB_MENU_ITEMS ADD CONSTRAINT FK_PARENT_CHECK FOREIGN KEY (PARENT) REFERENCES TB_MENU_ITEMS (MENU_ITEM_ID); ALTER TABLE TB_MODULES ADD CONSTRAINT FK_MODULES_TYPES FOREIGN KEY (MODULE_TYPE) REFERENCES TB_MODULE_TYPES ON DELETE CASCADE; ALTER TABLE TB_PAGES ADD CONSTRAINT FK_PAGES_TRACKING FOREIGN KEY (TRACKING_ID) REFERENCES TB_TRACKING ON DELETE CASCADE; ALTER TABLE TB_USER_GROUP ADD CONSTRAINT FK_TB_USER_PROFILES FOREIGN KEY (USER_ID) REFERENCES TB_USER_PROFILES ON DELETE CASCADE; ALTER TABLE TB_USER_GROUP ADD CONSTRAINT FK_TB_GROUP_ID FOREIGN KEY (GROUP_ID) REFERENCES TB_GROUPS ON DELETE CASCADE; ALTER TABLE TB_USER_PROFILES ADD CONSTRAINT FK_USER_TYPE FOREIGN KEY (USER_TYPE) REFERENCES TB_USER_TYPE; ALTER TABLE TB_USER_PROFILES ADD CONSTRAINT FK_TB_USER_STATUS FOREIGN KEY (ID_USER_STATUS) REFERENCES TB_USER_STATUS; ALTER TABLE TB_SPECIAL_DATES ADD CONSTRAINT FK_SPEC_DATES_REF_CALS FOREIGN KEY (CALENDAR_ID) REFERENCES TB_CALENDARS (CALENDAR_ID) ON DELETE CASCADE; ALTER TABLE TB_SECURITY_CONSTRAINT ADD CONSTRAINT FK_TB_RESOURCE_COLLECTION FOREIGN KEY (COLLECTION_NAME) REFERENCES TB_RESOURCE_COLLECTION ON DELETE CASCADE; ALTER TABLE TB_SECURITY_CONSTRAINT ADD CONSTRAINT FK_TB_CONSTRAINT_GROUP FOREIGN KEY (GROUP_ID) REFERENCES TB_GROUPS ON DELETE CASCADE;
true
3d936846436e51c9e042b6a50f4e521e1492c8d6
SQL
guitar1999/blackosprey
/avaricosa/find_nearest_stream_to_point.sql
UTF-8
1,395
3.921875
4
[]
no_license
WITH index_query AS ( SELECT st_distance(n.geom, a.geom) AS distance, ap_id, gnis_name, n.reachcode FROM avaricosa_point a, nhd.nhd_flowline_nh n WHERE state = 'nh' ORDER BY st_distance(n.geom, a.geom) ), closest_streams AS ( SELECT DISTINCT ON (ap_id) ap_id, gnis_name, distance, reachcode FROM index_query ORDER BY ap_id, distance ) UPDATE avaricosa_point SET waterway = CASE WHEN avaricosa_point.waterway IS NULL THEN closest_streams.gnis_name ELSE avaricosa_point.waterway END, reachcode = CASE WHEN avaricosa_point.reachcode IS NULL THEN closest_streams.reachcode ELSE avaricosa_point.reachcode END FROM closest_streams WHERE closest_streams.ap_id=avaricosa_point.ap_id AND avaricosa_point.state = 'nh' AND ( avaricosa_point.waterway IS NULL OR avaricosa_point.reachcode IS NULL ) RETURNING avaricosa_point.waterway, avaricosa_point.reachcode, avaricosa_point.ap_id, avaricosa_point.state;
true
025c3dbb07ed7a680291472ebd386e4c8626a14c
SQL
SimonFans/SQL
/L 601 Human Traffic of Stadium.sql
UTF-8
1,362
4.1875
4
[]
no_license
X city built a new stadium, each day many people visit it and the stats are saved as these columns: id, date, people Please write a query to display the records which have 3 or more consecutive rows and the amount of people more than 100(inclusive). For example, the table stadium: +------+------------+-----------+ | id | date | people | +------+------------+-----------+ | 1 | 2017-01-01 | 10 | | 2 | 2017-01-02 | 109 | | 3 | 2017-01-03 | 150 | | 4 | 2017-01-04 | 99 | | 5 | 2017-01-05 | 145 | | 6 | 2017-01-06 | 1455 | | 7 | 2017-01-07 | 199 | | 8 | 2017-01-08 | 188 | +------+------------+-----------+ For the sample data above, the output is: +------+------------+-----------+ | id | date | people | +------+------------+-----------+ | 5 | 2017-01-05 | 145 | | 6 | 2017-01-06 | 1455 | | 7 | 2017-01-07 | 199 | | 8 | 2017-01-08 | 188 | +------+------------+-----------+ - solution: select distinct s1.id, s1.visit_date, s1.people from stadium as s1, stadium as s2, stadium as s3 where ((s1.id+1=s2.id and s1.id+2=s3.id) or (s1.id-1=s2.id and s1.id+1=s3.id) or (s1.id-1=s2.id and s1.id-2=s3.id)) and s1.people>=100 and s2.people>=100 and s3.people>=100 ORDER by s1.id
true
5daaf357ba94ef7be257031eba7ac42569e524ad
SQL
joao-lusa/Ulbra
/2020_2/FBD/primeiro.sql
UTF-8
1,179
3.53125
4
[]
no_license
-- DDL -- CREAT ** -- ALTER -- DROP /* aqui nós vamos fazer nosso primeiro creare */ /* padorões de nomenclatura pascal case -tudo é inicial maiúscula. -quanto tem nome completo, use-se o segundo nome inicial maiúscula -nome -bomeDoCLiente camelCase -nome -nomeDoCliente no SQL qual pradrão? -comando base(reservados) - UPPERCASE -comandos de estruturas tudo lowe_case */ --criar um esquema (banco de dados) CREATE DATABASE teste_ddl; -- OU CREATE SCHEMA teste_ddl; USE teste_ddl; /* no relacional temos departamentos(id ) */ CREATE TABLE departamentos ( -- nome tipo restrição id INT NOT null PRIMARY KEY, nome VARCHAR(70) NOT null, valor_orcamento DECIMAL(12,2). ); CREATE TABLE empregados ( id INT auto_increment NOT NULL, matricula VARCHAR(50) not null, cpf VARCHAR(14), nome VARCHAR(50) not null, cargo VARCHAR(30) not null, salario decimal(18,2) default 0, sigla char(2), data_nascimento DATE, id_departamento INT not null, PRIMARY KEY(id), CONSTRAINT esta_alocado FOREIGN KAY id_departamento REFERENCES depatamento(id) )
true
a04d31f62bcf9e3166e2f66f517ec7b8530c09c2
SQL
irawanalkarim/simple-money-management
/improved.sql
UTF-8
1,468
2.953125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Dec 13, 2019 at 05:20 AM -- Server version: 10.4.8-MariaDB -- PHP Version: 7.2.24 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: `improved` -- -- -------------------------------------------------------- -- -- Table structure for table `penjualan` -- CREATE TABLE `penjualan` ( `id` int(11) NOT NULL, `bahan` int(11) NOT NULL, `sablon` int(11) NOT NULL, `jahit` int(11) NOT NULL, `label` int(11) NOT NULL, `laba` int(11) NOT NULL, `qty` int(11) NOT NULL, `tanggal` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `penjualan` -- ALTER TABLE `penjualan` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `penjualan` -- ALTER TABLE `penjualan` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=69; 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
0e3fd8f197bd04697ba7b176ba5c3d258c2ed27e
SQL
twocngdagz/TestApp
/dump.sql
UTF-8
6,575
3
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.5.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jun 07, 2013 at 10:06 PM -- Server version: 5.5.24-log -- PHP Version: 5.3.13 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 utf8 */; -- -- Database: `testapp` -- -- -------------------------------------------------------- -- -- Table structure for table `customer` -- DROP TABLE IF EXISTS `customer`; CREATE TABLE IF NOT EXISTS `customer` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `country` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=120 ; -- -- Dumping data for table `customer` -- INSERT INTO `customer` (`id`, `name`, `email`, `country`) VALUES (1, 'Mederic Roy F. Beldia', 'twocngdagz@yahoo.com', 'USA'), (2, 'Rex Bengil', 'rex.bengil@focusincgroup.com', 'Philippines'), (4, 'Lloyd Alcasid', 'lloyd@focusincgroup.com', 'USA'), (5, 'Michael Jordan', 'mike@yahoo.com', 'USA'), (6, 'James Lebron', 'james@gmail.com', 'USA'), (7, 'Usain Bolt', 'bolt@yahoo.com', 'Jamaica'), (8, 'Manny Pacquiao', 'manny@gmail.com', 'Philippines'), (9, 'Bobby Garcia', 'bobby@grouphug.com', 'Spain'), (10, 'Leon Cardinal', 'leon@yahoo.com', 'France'), (11, 'Luke Mijares', 'luke@gmail.com', 'Mexico'), (12, 'Floyd Mayweather', 'floyd@gmail.com', 'USA'), (13, 'Juan Barrera', 'antonio@gmail.com', 'Mexico'), (14, 'Rudy Duterte', 'rudy@focuscamera.com', 'Cuba'), (15, 'Juan Manuel Marquez', 'juan.m@yahoo.com', 'Mexico'), (16, 'Juan Manuel Marquez', 'juan.m@yahoo.com', 'Mexico'), (18, 'Juan Manuel Marquez', 'juan.m@yahoo.com', 'Mexico'), (20, 'Audrey Cardenas', 'et@dolor.com', 'United States'), (21, 'Michelle Allen', 'ridiculus.mus.Proin@gravida.org', 'Eritrea'), (22, 'Jacqueline Patel', 'nibh.lacinia.orci@nuncsit.com', 'Myanmar'), (23, 'Grace Rodriguez', 'mi.Duis.risus@egestas.com', 'Gambia'), (24, 'Kirsten Mclean', 'ante.ipsum.primis@tristiquesenectuset.net', 'Liechtenstein'), (25, 'Aubrey Huber', 'Morbi.vehicula.Pellentesque@utmolestie.ca', 'Nauru'), (26, 'Ulla Durham', 'Proin@sapien.edu', 'Kenya'), (27, 'Hollee Cantrell', 'Proin.non@idnunc.co.uk', 'Aruba'), (28, 'Hollee Rios', 'elit.Nulla.facilisi@faucibusutnulla.net', 'Turkey'), (29, 'Tasha Madden', 'Cum@posuerecubiliaCurae;.edu', 'Palau'), (30, 'Zephr House', 'fringilla@feugiat.ca', 'Hong Kong'), (31, 'Kirsten Alvarado', 'pede@commodoipsumSuspendisse.edu', 'Burundi'), (32, 'Odette Stark', 'sed.turpis@odio.org', 'Cuba'), (33, 'Mary Moss', 'Nulla.aliquet.Proin@Proinultrices.edu', 'Guyana'), (34, 'Geraldine Foreman', 'semper.et@iaculisodioNam.net', 'Cook Islands'), (35, 'Bertha Ray', 'Nulla@rutrumloremac.edu', 'India'), (36, 'Danielle Hall', 'nulla.ante.iaculis@laoreetlectus.net', 'Belgium'), (37, 'Audra King', 'accumsan.convallis@egetnisi.co.uk', 'Palestinian Territory, Occupied'), (38, 'Sierra Gill', 'eleifend@Phasellusfermentum.net', 'Macedonia'), (39, 'Kirsten Alford', 'dui.nec@sedleo.ca', 'Monaco'), (40, 'Rhonda Mcfadden', 'posuere@mollis.com', 'Benin'), (41, 'Ima Santiago', 'erat.eget@aliquetProin.org', 'Czech Republic'), (42, 'Patricia Hyde', 'sagittis.Duis.gravida@nisl.net', 'Saint Pierre and Miquelon'), (43, 'Kylynn Blake', 'at.libero.Morbi@justoProin.org', 'Falkland Islands (Malvinas)'), (44, 'Cleo Mcknight', 'suscipit.nonummy@Namnulla.com', 'Tanzania, United Republic of'), (45, 'Myra Stewart', 'orci.lobortis@egestas.com', 'Algeria'), (46, 'Kyra Beach', 'fermentum@malesuadafames.ca', 'Bosnia and Herzegovina'), (47, 'Velma Knowles', 'in@ornare.net', 'Gambia'), (48, 'Basia Dawson', 'ante.Nunc@magna.org', 'Saint Vincent and The Grenadines'), (49, 'Paula Boyle', 'urna.et.arcu@non.edu', 'Paraguay'), (50, 'Cara Collins', 'ante.ipsum@libero.co.uk', 'Viet Nam'), (51, 'Kerry Simpson', 'malesuada.vel@Naminterdum.co.uk', 'Ireland'), (52, 'Georgia Kelly', 'tincidunt@duiFusce.com', 'Belize'), (53, 'Lee Wolf', 'In@fringilla.org', 'Cyprus'), (54, 'Georgia Swanson', 'risus.Morbi.metus@tellussemmollis.com', 'Honduras'), (55, 'Maya Patel', 'aliquet@gravidamaurisut.org', 'Bhutan'), (56, 'Josephine Hensley', 'velit.eu@Curabiturvellectus.co.uk', 'Jamaica'), (57, 'Meredith Alvarez', 'erat@hendrerit.co.uk', 'Kazakhstan'), (58, 'Julie Valencia', 'lorem.ac.risus@anteVivamusnon.net', 'Greenland'), (59, 'Serina Richardson', 'vel@congueturpisIn.net', 'Comoros'), (60, 'Buffy Dillon', 'urna@miacmattis.org', 'Mexico'), (61, 'Wanda Mcpherson', 'aliquam@imperdiet.ca', 'Norfolk Island'), (62, 'Cheyenne Gill', 'et@sagittisNullam.com', 'French Guiana'), (63, 'Kitra Malone', 'sociosqu.ad.litora@lorem.org', 'India'), (64, 'Tatum Jordan', 'eleifend.egestas@volutpatNulla.org', 'Guadeloupe'), (65, 'Karly Pate', 'vel.lectus@miAliquamgravida.org', 'Cayman Islands'), (66, 'Gay Glenn', 'ligula@lectus.edu', 'Netherlands Antilles'), (67, 'Sierra Alford', 'Integer.vitae.nibh@acrisusMorbi.ca', 'Moldova'), (68, 'Serina Wilkinson', 'vitae.posuere@fringillamilacinia.ca', 'Ghana'), (69, 'Kerry Ballard', 'hendrerit@rhoncus.ca', 'French Southern Territories'), (70, 'Nayda Paul', 'et@sodales.org', 'Syrian Arab Republic'), (71, 'Charde Franco', 'et@blanditmattis.org', 'Liberia'), (72, 'Kyla Shaffer', 'Vivamus.molestie.dapibus@necligula.net', 'Bulgaria'), (73, 'Hyacinth Pena', 'molestie.dapibus@Donec.net', 'Rwanda'), (74, 'Zenaida Rivas', 'Lorem.ipsum@acfeugiatnon.co.uk', 'Bosnia and Herzegovina'), (75, 'Doris Stein', 'Quisque.ornare.tortor@malesuadafringilla.org', 'Uzbekistan'), (76, 'Daphne Carter', 'Nullam@semperrutrum.co.uk', 'Syrian Arab Republic'), (77, 'Quemby Merritt', 'at@antedictummi.ca', 'Timor-leste'), (78, 'Noelani Boone', 'quis.pede.Praesent@Suspendisse.net', 'Faroe Islands'), (79, 'Martena Perez', 'mauris@ante.edu', 'Ghana'), (80, 'Rachel Gilbert', 'molestie@malesuadaut.edu', 'British Indian Ocean Territory'), (81, 'Rose Green', 'euismod.est.arcu@est.ca', 'Yemen'), (82, 'Lillian Joyner', 'nulla.Donec@Quisque.co.uk', 'Taiwan, Province of China'), (83, 'Blaine Bray', 'eu.elit.Nulla@necanteMaecenas.ca', 'Kuwait'), (84, 'Emerald Potts', 'natoque.penatibus.et@netusetmalesuada.net', 'Reunion'), (85, 'Courtney Payne', 'ac.tellus@tincidunt.org', 'Saudi Arabia'), (86, 'Kiayada Burks', 'mauris.erat@nonsapien.ca', 'Namibia'), (87, 'Iliana Lucas', 'orci.Donec.nibh@tristiqueac.ca', 'Saint Kitts and Nevis'), (88, 'Blaine Flynn', 'rutrum.magna@consequat.net', 'Guam'), (89, 'Susan Coleman', 'odio.Nam.interdum@sodales.co.uk', 'Reunion'), (90, 'Julie Drake', 'Duis.risus@nonegestas.ca', 'Turkmenistan'), (91, 'Mercedes Hays', 'dictum@Namligulaelit.co.uk', 'Tajikistan'), (92, 'Stacy Farmer', 'malesuada.id.erat@magnaSuspendisse.org', 'Georgia'), (93, 'Shaine Diaz', 'eu.accumsan@Pellentesquetincidunt.net', 'Aruba'), (94, 'Kyla Erickson', 'morbi@leoin.co.uk', 'Antigua and Barbuda'), (95, 'Adena Workman', 'tortor@Phaselluslibero.ca', 'Jamaica'), (96, 'Guinevere Lynn', 'dictum.eu@eu.edu', 'Argentina'), (97, 'Audrey Landry', 'viverra@adipiscingenimmi.net', 'Gambia'), (98, 'Carol Potts', 'nibh.vulputate@auctorquis.ca', 'Greenland'), (99, 'Heidi Powell', 'ornare@Donecluctusaliquet.org', 'Bouvet Island'), (100, 'Giselle Scott', 'nisl.Quisque.fringilla@ametconsectetueradipiscing.', 'Saint Helena'), (101, 'Kiona Nguyen', 'nec.diam@Donecfringilla.ca', 'Philippines'), (102, 'Signe Armstrong', 'auctor@lacusQuisque.ca', 'Rwanda'), (103, 'Lacy Nicholson', 'magnis.dis.parturient@vehicularisus.org', 'Saint Vincent and The Grenadines'), (104, 'Sigourney Golden', 'molestie@nequesed.com', 'Taiwan, Province of China'), (105, 'Kirsten Oneil', 'neque@Inatpede.net', 'Oman'), (106, 'Serena Alvarado', 'eget.lacus.Mauris@sedleoCras.co.uk', 'Guadeloupe'), (107, 'Aurora Miles', 'montes.nascetur.ridiculus@dictumsapien.com', 'Macedonia'), (108, 'Karina Mays', 'eu@etmagnis.net', 'Vanuatu'), (109, 'Ainsley Suarez', 'mauris@risusatfringilla.org', 'Malawi'), (110, 'Sasha Grimes', 'pede.Praesent.eu@acorciUt.co.uk', 'Switzerland'), (111, 'Hadley Olson', 'enim.nisl@ultriciessemmagna.ca', 'French Guiana'), (112, 'Diana Martinez', 'Donec@elementumloremut.ca', 'Tunisia'), (113, 'Olympia Norton', 'in.magna.Phasellus@ornareFusce.co.uk', 'French Southern Territories'), (114, 'Madison Pacheco', 'egestas.ligula.Nullam@duiFusce.com', 'Rwanda'), (115, 'May Miranda', 'odio.a.purus@pellentesque.net', 'Marshall Islands'), (116, 'Samantha Taylor', 'Nunc@Suspendissecommodotincidunt.ca', 'Kazakhstan'), (117, 'Laurel Green', 'quam.elementum.at@Pellentesqueut.org', 'Colombia'), (118, 'Kimberley Fox', 'Aliquam.tincidunt@Sed.ca', 'Togo'), (119, 'Joan Hawkins', 'nec.tempus@duiCras.com', 'Korea'); -- -------------------------------------------------------- -- -- Table structure for table `sales` -- DROP TABLE IF EXISTS `sales`; CREATE TABLE IF NOT EXISTS `sales` ( `id` int(11) NOT NULL AUTO_INCREMENT, `customer_id` int(11) NOT NULL, `item` varchar(50) NOT NULL, `amount` decimal(10,2) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Dumping data for table `sales` -- INSERT INTO `sales` (`id`, `customer_id`, `item`, `amount`) VALUES (2, 1, 'Balisong', '500.50'); /*!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
eecd6c9da86791ae87ab19d3da1f98cb200f46b8
SQL
peguy2n/feelthelearn
/Day3.sql
UTF-8
518
2.703125
3
[]
no_license
UPDATE Customers SET CustomerName = "peguy" WHERE city="London"; UPDATE Customers SET ContactName ="German Jerry" WHERE Country="Germany" AND City IN("Berlin","Brandenburg"); UPDATE Customers SET city ="Berlin" WHERE CustomerID >10; UPDATE OrderDetails SET quantity =34 WHERE OrderDetailID =7; UPDATE Products SET ProductName="Sesane" WHERE Price <= 21.35; UPDATE Shippers SET phone ="(503) 564-9654" WHERE Phone ="(503) 555-9831"; UPDATE Products SET productName ="Anton" WHERE productName ="Chef Anton's Gumbo Mix";
true
6413a72472b8f72821dcd8230141cf017fd6fe1b
SQL
MikeTimo/CarShop
/src/main/resources/employee.sql
UTF-8
1,169
3.359375
3
[]
no_license
CREATE DATABASE IF NOT EXISTS carshop COLLATE utf8_general_ci; USE carshop; DROP TABLE IF EXISTS employee; CREATE TABLE employee ( id BIGINT(20) PRIMARY KEY NOT NULL AUTO_INCREMENT, name VARCHAR(50) NULL, surname VARCHAR(50) NULL, dob date NULL, sex VARCHAR(50) NULL, salary DOUBLE NULL, department VARCHAR(50) NULL, position VARCHAR(50) NULL ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; insert into employee(name, surname, dob, sex, salary, department, position) values ('Ivan', 'Korznev', '1988-01-027', 'MALE', '4000', 'SALES', 'Lead') , ('Sonya', 'Smirnova', '1998-05-12', 'FEMALE', '3500', 'HR', 'Senior') , ('Nikita', 'Semenov', '1994-10-10', 'MALE', '4100', 'LEGAL', 'Lead') , ('Olga', 'Harrison', '1983-02-20', 'FEMALE', '5100', 'ACCOUNTING', 'Senior') , ('Ivan', 'Akimov', '1997-09-12', 'MALE', '3500', 'SALES', 'Junior') , ('Dmitriy', 'Gurkin', '1991-11-05', 'MALE', '4000', 'SALES', 'Senior') , ('Alina', 'Ketsu', '1990-06-02', 'FEMALE', '4200', 'LEGAL', 'Lead');
true
16742d1057fbedc81ae96feef88d76d0ade692c9
SQL
abdulchakam/CRUD-CI
/database/penjualan (2).sql
UTF-8
12,005
3.09375
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 06 Apr 2020 pada 07.39 -- Versi server: 10.4.10-MariaDB-log -- Versi PHP: 7.3.12 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: `penjualan` -- -- -------------------------------------------------------- -- -- Struktur dari tabel `barang` -- CREATE TABLE `barang` ( `kd_brg` char(6) NOT NULL, `nm_brg` varchar(30) DEFAULT NULL, `satuan` varchar(10) DEFAULT NULL, `harga` double DEFAULT NULL, `harga_beli` double DEFAULT NULL, `stok` int(4) DEFAULT NULL, `stok_min` int(4) DEFAULT NULL, `gambar` varchar(40) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data untuk tabel `barang` -- INSERT INTO `barang` (`kd_brg`, `nm_brg`, `satuan`, `harga`, `harga_beli`, `stok`, `stok_min`, `gambar`) VALUES ('B-0001', 'buku tulis putih item', 'Buah', 1000, 900, 193, 5, '1.jpg'), ('B-0002', 'Gethuk magelang enak tenan', 'Box', 1500, 2000, 211, 10, '2.jpg'), ('B-0003', 'Pensil Lancip tenan', 'Buah', 3000, 2500, 93, 5, '3.jpg'), ('B-0004', 'Gethuk Lindri', 'Buah', 5000, 4000, 100, 5, '4.jpg'), ('B-0005', 'Mangga', 'Buah', 10000, 9000, 0, 10, '5.jpg'), ('B-0006', 'Wingko', 'Buah', 10000, 9000, 100, 10, '6.jpg'); -- -------------------------------------------------------- -- -- Struktur dari tabel `berita` -- CREATE TABLE `berita` ( `id_berita` int(5) UNSIGNED NOT NULL, `id_kategori` int(3) UNSIGNED NOT NULL DEFAULT 0, `judul` varchar(100) NOT NULL DEFAULT '', `headline` text NOT NULL, `isi` text NOT NULL, `pengirim` varchar(15) NOT NULL DEFAULT '', `tanggal` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data untuk tabel `berita` -- INSERT INTO `berita` (`id_berita`, `id_kategori`, `judul`, `headline`, `isi`, `pengirim`, `tanggal`) VALUES (1, 1, 'Arsenal 1 vs Everton 1', 'Arsenal 1 vs Everton 1', 'Arsenal 1 vs Everton 1, yoooooooooooooooo', 'admin', '2013-12-09 15:38:22'), (2, 3, 'IT Joss', 'IT trend 2014', 'IT trend 2014IT trend 2014IT trend 2014IT trend 2014 IT trend 2014IT trend 2014IT trend 2014IT trend 2014IT trend 2014 IT trend 2014IT trend 2014IT trend 2014 yoyoyoyoyo yoyoyyoo', 'paijo', '2013-12-09 16:16:06'), (3, 2, 'ZOO', 'Sidang MKD kayak kebun binatang', 'Sidang MKD kayak kebun binatang, hiii gilani\r\n', 'paijo', '2015-12-08 11:00:50'); -- -------------------------------------------------------- -- -- Struktur dari tabel `bukutamu` -- CREATE TABLE `bukutamu` ( `id` int(10) UNSIGNED NOT NULL, `nama` varchar(15) NOT NULL, `situs` varchar(50) NOT NULL, `email` varchar(30) NOT NULL, `pesan` text NOT NULL, `waktu` datetime NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data untuk tabel `bukutamu` -- INSERT INTO `bukutamu` (`id`, `nama`, `situs`, `email`, `pesan`, `waktu`) VALUES (2, 'ajib', 'http://ajibsusanto.blogspot.com', 'ajibsusanto@gmail.com', 'josss gandosssss', '2013-12-23 15:55:47'), (3, 'AHMAD AULIA WIG', 'http://ok.com', 'aulia@gmail.com', 'ok brooo', '2013-12-23 17:07:56'), (4, 'Ajib Susanto', 'http://ajibsusanto.net', 'ajibsusanto@gmail.com', 'mohon info lebih lanjut bro', '2018-12-17 07:32:32'); -- -------------------------------------------------------- -- -- Struktur dari tabel `invoices` -- CREATE TABLE `invoices` ( `id` int(11) NOT NULL, `date` datetime NOT NULL, `due_date` datetime NOT NULL, `status` varchar(12) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `invoices` -- INSERT INTO `invoices` (`id`, `date`, `due_date`, `status`) VALUES (1, '2020-04-06 05:46:58', '2020-04-07 05:46:58', 'unpaid'), (2, '2020-04-06 05:49:22', '2020-04-07 05:49:22', 'unpaid'), (3, '2020-04-06 06:20:29', '2020-04-07 06:20:29', 'unpaid'); -- -------------------------------------------------------- -- -- Struktur dari tabel `kategori` -- CREATE TABLE `kategori` ( `id_kategori` int(3) UNSIGNED NOT NULL, `nm_kategori` varchar(30) NOT NULL DEFAULT '', `deskripsi` varchar(200) NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data untuk tabel `kategori` -- INSERT INTO `kategori` (`id_kategori`, `nm_kategori`, `deskripsi`) VALUES (1, 'Olah Raga', 'Olah Raga'), (2, 'Politik', 'Politik'), (3, 'IT', 'IT'); -- -------------------------------------------------------- -- -- Struktur dari tabel `konsumen` -- -- Kesalahan membaca struktur untuk tabel penjualan.konsumen: #1932 - Table 'penjualan.konsumen' doesn't exist in engine -- Kesalahan membaca data untuk tabel penjualan.konsumen: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM `penjualan`.`konsumen`' at line 1 -- -------------------------------------------------------- -- -- Struktur dari tabel `kota` -- CREATE TABLE `kota` ( `IdKota` varchar(10) NOT NULL, `NamaKota` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `kota` -- INSERT INTO `kota` (`IdKota`, `NamaKota`) VALUES ('SMG', 'Semarang'), ('KDS', 'Kudus'), ('DMK', 'Demak'), ('KDL', 'Kendal'), ('BTG', 'Batang'), ('PKL', 'Pekalongan'); -- -------------------------------------------------------- -- -- Struktur dari tabel `orders` -- CREATE TABLE `orders` ( `invoice_id` varchar(10) NOT NULL, `produk_id` varchar(10) NOT NULL, `produk_nama` varchar(30) NOT NULL, `produk_harga` double NOT NULL, `quantity` int(3) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `orders` -- INSERT INTO `orders` (`invoice_id`, `produk_id`, `produk_nama`, `produk_harga`, `quantity`) VALUES ('1', '2', 'Hp Samsung Galaxy A51', 4399000, 2), ('1', '1', 'Hp Oppo R17', 8999000, 1), ('2', '6', 'Hp Oppo A9', 3430000, 1), ('2', '5', 'Hp Realme XT', 4399000, 1), ('3', '4', 'Hp Samsung Galaxy A20S', 2399000, 1), ('3', '6', 'Hp Oppo A9', 3430000, 2); -- -------------------------------------------------------- -- -- Struktur dari tabel `produk` -- CREATE TABLE `produk` ( `produk_id` int(11) NOT NULL, `produk_nama` varchar(100) NOT NULL, `produk_harga` double NOT NULL, `produk_image` varchar(50) NOT NULL, `produk_deskripsi` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `produk` -- INSERT INTO `produk` (`produk_id`, `produk_nama`, `produk_harga`, `produk_image`, `produk_deskripsi`) VALUES (1, 'Hp Oppo R17', 8999000, '1.jpg', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'), (2, 'Hp Samsung Galaxy A51', 4399000, '2.jpg', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'), (3, 'Hp Asus Max M11', 4790000, '3.jpg', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'), (4, 'Hp Samsung Galaxy A20S', 2399000, '4.jpg', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'), (5, 'Hp Realme XT', 4399000, '5.jpg', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'), (6, 'Hp Oppo A9', 3430000, '6.jpg', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'); -- -------------------------------------------------------- -- -- Struktur dari tabel `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `username` varchar(30) NOT NULL, `email` varchar(20) NOT NULL, `password` varchar(32) NOT NULL, `hak_akses` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `users` -- INSERT INTO `users` (`id`, `username`, `email`, `password`, `hak_akses`) VALUES (1, 'admin', 'admin@gmail.com', '21232f297a57a5a743894a0e4a801fc3', 1), (2147483647, 'abdulchakam', 'abdulchakam@gmail.co', '0cc175b9c0f1b6a831c399e269772661', 2); -- -- Indexes for dumped tables -- -- -- Indeks untuk tabel `barang` -- ALTER TABLE `barang` ADD PRIMARY KEY (`kd_brg`); -- -- Indeks untuk tabel `berita` -- ALTER TABLE `berita` ADD PRIMARY KEY (`id_berita`); -- -- Indeks untuk tabel `bukutamu` -- ALTER TABLE `bukutamu` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`), ADD KEY `id_2` (`id`); -- -- Indeks untuk tabel `invoices` -- ALTER TABLE `invoices` ADD PRIMARY KEY (`id`); -- -- Indeks untuk tabel `kategori` -- ALTER TABLE `kategori` ADD PRIMARY KEY (`id_kategori`); -- -- Indeks untuk tabel `produk` -- ALTER TABLE `produk` ADD PRIMARY KEY (`produk_id`); -- -- Indeks untuk tabel `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT untuk tabel yang dibuang -- -- -- AUTO_INCREMENT untuk tabel `berita` -- ALTER TABLE `berita` MODIFY `id_berita` int(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT untuk tabel `bukutamu` -- ALTER TABLE `bukutamu` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT untuk tabel `invoices` -- ALTER TABLE `invoices` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT untuk tabel `kategori` -- ALTER TABLE `kategori` MODIFY `id_kategori` int(3) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT untuk tabel `produk` -- ALTER TABLE `produk` MODIFY `produk_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=50000002; -- -- AUTO_INCREMENT untuk tabel `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2147483648; 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
3ef7974fbcaaf8b63dc28dac9eccf74f6e74be18
SQL
Zenuna/BD_TP1
/script.sql
UTF-8
1,377
3.109375
3
[]
no_license
use BD5B6TP1_KoumaJouanique DROP TABLE Invite; DROP TABLE ReservationChambre; DROP TABLE Client; DROP TABLE Chambre; DROP TABLE TypeChambre; CREATE TABLE TypeChambre( NoTypeChambre int not null, Description varchar(50), PrixHaut Numeric(7,2), PrixBas Numeric(7,2), PrixMoyen Numeric(7,2), CONSTRAINT PK_NoTypeChambre PRIMARY KEY(NoTypeChambre) ) CREATE TABLE Chambre( NoChambre int not null, Emplacement varchar(50), Decorations varchar(50), NoTypeChambre int not null, CONSTRAINT PK_NoChambre PRIMARY KEY(NoChambre), CONSTRAINT FK_NoTypeChambre FOREIGN KEY (NoTypeChambre) REFERENCES TypeChambre(NoTypeChambre) ) CREATE TABLE Client( NoClient int not null, Nom varchar(20), Prenom varchar(20), Ville varchar(30), Pays varchar(20), Adresse varchar(50), CodePostal varchar(7), DateInscription DATETIME, CONSTRAINT PK_NoClient PRIMARY KEY (NoClient) ) CREATE TABLE ReservationChambre( NoClient int not null, NoChambre int not null, DateArrivee DATETIME, DateDepart DATETIME, NbPersonnes int, CONSTRAINT PK_Reservation PRIMARY KEY(NoClient + NoChambre + DateArrivee), CONSTRAINT FK_NoClient FOREIGN KEY (NoClient) REFERENCES Client(NoClient), CONSTRAINT FK_NoChambre FOREIGN KEY (NoChambre) REFERENCES Chambre(NoChambre) ) CREATE TABLE Invite( NoInvite int not null, NomPrenom varchar(50), )
true
eef042c831e01f19b3ccfcf357b94055d5440df3
SQL
hamsterish/web-template
/src/main/resources/schema.sql
UTF-8
1,077
3.734375
4
[]
no_license
CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(12) NOT NULL, `gender` varchar(22) DEFAULT NULL, `first_name` varchar(120) NOT NULL, `last_name` varchar(120) NOT NULL, `phone_number` varchar(22) NOT NULL, `email` varchar(120) DEFAULT NULL, `birth` date DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `user_id_uindex` (`id`), UNIQUE KEY `user_email_uindex` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8; CREATE TABLE `address` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `first_line` varchar(255) NOT NULL, `second_line` varchar(255) DEFAULT NULL, `city` varchar(100) NOT NULL, `country` varchar(100) NOT NULL, `post_code` varchar(10) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `address_id_uindex` (`id`), KEY `user_fk` (`user_id`), CONSTRAINT `user_fk` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
true
5c3166ba1e79ec9d20894a739deae40051801898
SQL
kelsenlima/projeto-wms-store-zyon
/VR_MOVEXPEDICAOPRODUTO_PESOOFI.sql
UTF-8
3,040
3.203125
3
[]
no_license
--CREATOR: KELSEN LIMA -- QR MOVIMENTACAO DE PRODUTO EXPEDICAO CREATE OR REPLACE VIEW VR_MOVEXPEDICAOPRODUTO_PESOOFI AS SELECT DS.CODIGOESTABELECIMENTO, (SELECT EST.NOMEESTABELECIMENTO FROM ESTABELECIMENTO EST WHERE EST.CODIGOESTABELECIMENTO = DS.CODIGOESTABELECIMENTO) AS NOMEESTABELECIMENTO, DS.CODIGODEPOSITANTE, (SELECT DEP.DESCRICAOEMPRESA FROM EMPRESA DEP WHERE DEP.CODIGOEMPRESA = DS.CODIGODEPOSITANTE) AS DESCRICAODEPOSITANTE, DS.DATAMOVIMENTO, LS.CODIGOPRODUTO, PRO.DESCRICAOPRODUTO, PRO.CODIGOGRUPO, PRO.CODIGOSUBGRUPO, PRO.CODIGOCATEGORIA, PRO.CODIGOPUBLICOALVO, DS.CODIGOEMPRESA, DS.TIPODOCUMENTO, DS.SERIEDOCUMENTO, DS.DOCUMENTOSAIDA, (SELECT DISTINCT DOSIL.DOCUMENTOOFICIALSAIDA FROM DOCUMENTOOFICIALSAIDAITEMLOTE DOSIL WHERE DOSIL.CODIGOESTABELECIMENTO = DS.CODIGOESTABELECIMENTO AND DOSIL.LOTESAIDA = LS.LOTESAIDA AND ROWNUM = 1) AS DOCUMENTOOFICIALSAIDA, LS.LOTESAIDA, LS.NUMEROREVISAO, LS.CLASSEPRODUTO, LES.TIPOUC, LES.FATORTIPOUC, SUM(LSS.QUANTIDADESAIDA) AS QUANTIDADESAIDA, SUM(LSS.QUANTIDADESAIDA / LES.FATORTIPOUC) AS QUANTIDADESAIDAF, LES.PESOBRUTO AS PESOBRUTO, SUM(LSS.QUANTIDADESAIDA / LES.FATORTIPOUC) * LES.PESOBRUTO AS PESOBRUTOT, (SELECT SUM(DOSIL.QUANTIDADEATENDIDA) FROM DOCUMENTOOFICIALSAIDAITEMLOTE DOSIL WHERE DOSIL.CODIGOESTABELECIMENTO = DS.CODIGOESTABELECIMENTO AND DOSIL.LOTESAIDA = LS.LOTESAIDA) AS QUANTIDADEATENDIDA FROM DOCUMENTOSAIDA DS, LOTESAIDA LS, PRODUTO PRO, LOTESAIDASEQUENCIA LSS, LOTEENTRADASEQUENCIA LES WHERE DS.CODIGOESTABELECIMENTO = LS.CODIGOESTABELECIMENTO AND DS.CODIGOEMPRESA = LS.CODIGOEMPRESA AND DS.TIPODOCUMENTO = LS.TIPODOCUMENTO AND DS.SERIEDOCUMENTO = LS.SERIEDOCUMENTO AND DS.DOCUMENTOSAIDA = LS.DOCUMENTOSAIDA AND LS.CODIGOMATRIZ = PRO.CODIGOEMPRESA AND LS.CODIGOPRODUTO = PRO.CODIGOPRODUTO AND LS.CODIGOESTABELECIMENTO = LSS.CODIGOESTABELECIMENTO AND LS.LOTESAIDA = LSS.LOTESAIDA AND LSS.CODIGOESTABELECIMENTO = LES.CODIGOESTABELECIMENTO AND LSS.LOTEENTRADA = LES.LOTEENTRADA AND LSS.LOTEENTRADASEQUENCIA = LES.LOTEENTRADASEQUENCIA GROUP BY DS.CODIGOESTABELECIMENTO, DS.CODIGODEPOSITANTE, DS.DATAMOVIMENTO, LS.CODIGOPRODUTO, PRO.DESCRICAOPRODUTO, PRO.CODIGOGRUPO, PRO.CODIGOSUBGRUPO, PRO.CODIGOCATEGORIA, PRO.CODIGOPUBLICOALVO, DS.CODIGOEMPRESA, DS.TIPODOCUMENTO, DS.SERIEDOCUMENTO, DS.DOCUMENTOSAIDA, LS.LOTESAIDA, LS.NUMEROREVISAO, LS.CLASSEPRODUTO, LES.TIPOUC, LES.FATORTIPOUC, LES.PESOBRUTO ORDER BY DS.CODIGOESTABELECIMENTO, DS.CODIGODEPOSITANTE, DS.DATAMOVIMENTO, LS.CODIGOPRODUTO ASC /
true
c80b2f2ad3fe31a5dc7b976bbfae18e3bfd7a8fa
SQL
meghashetty16/H1B_VISA
/Hive/Q1a.sql
UTF-8
410
3.421875
3
[]
no_license
use h1bproject; drop table h1b1a; create table h1b1a (year string,total int ) row format delimited fields terminated by '\t' stored as textfile; INSERT OVERWRITE table h1b1a select year,count(case_status) as total from h1b where job_title like '%DATA ENGINEER%' group by year order by year; select a.year,a.total,(((b.total-a.total)*100)/a.total) as percentage from h1b1a a,h1b1a b where b.year=a.year+1;
true
eadfeb4a7c37519752535d9bdcbea017f952f47f
SQL
danolivo/conf
/PGConfRU_2021/joins_plan_dependency.sql
UTF-8
1,120
3.625
4
[ "BSD-3-Clause" ]
permissive
-- EXPLAIN of query plan where join clause has semantic dependencies between variables. -- -- Query -- EXPLAIN (ANALYZE,TIMING OFF,BUFFERS OFF) SELECT count(*) FROM person JOIN employees USING (id) WHERE age<18 AND position='Helper'; -- -- EXPLAIN -- Aggregate (cost=586.53..586.54 rows=1 width=8) (actual rows=1 loops=1) -> Merge Join (cost=256.14..585.99 rows=216 width=0) (actual rows=70 loops=1) Merge Cond: (person.id = employees.id) -> Index Only Scan using person_id_age_idx on person (cost=0.29..3153.95 rows=15903 width=4) (actual rows=1580 loops=1) Index Cond: (age < 18) Heap Fetches: 1580 -> Sort (cost=255.84..259.25 rows=1361 width=4) (actual rows=1361 loops=1) Sort Key: employees.id Sort Method: quicksort Memory: 123kB -> Seq Scan on employees (cost=0.00..185.00 rows=1361 width=4) (actual rows=1361 loops=1) Filter: ("position" = 'Helper'::text) Rows Removed by Filter: 8639 Planning Time: 0.264 ms Execution Time: 4.015 ms (14 rows)
true
7b1ff55f8cbd6773806e620ca6d4c522da9bdba9
SQL
alinangnaiba/migration-java
/sql/ms3Interview.sql
UTF-8
449
2.609375
3
[]
no_license
-- -- File generated with SQLiteStudio v3.2.1 on Sat May 30 20:09:58 2020 -- -- Text encoding used: System -- PRAGMA foreign_keys = off; BEGIN TRANSACTION; -- Table: IMPORT CREATE TABLE import (id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL, a VARCHAR (250), b VARCHAR (250), c VARCHAR (250), d VARCHAR (250), e VARCHAR (250), f VARCHAR (250), g DECIMAL, h BOOLEAN, i BOOLEAN, j VARCHAR (250)); COMMIT TRANSACTION; PRAGMA foreign_keys = on;
true
5a91d5c6a20a42daf414a3b2ada31b83fc90afc6
SQL
rekhaunnam123/Java
/Sql queries.sql
UTF-8
1,821
4.375
4
[]
no_license
SELECT * FROM transcation.customer; ALTER table transcation.customer add column lastname VARCHAR(45); Select * from transcation.customer; /*1)Write a query to display account number, customer�s number, customer�s firstname,lastname,account opening date. Display the records sorted in ascending order based on account number.*/ SELECT account_number,customer_number,firstname,lastname,date FROM customer ORDER BY account_number; /*2).Write a query to display the number of customer�s from Chennai. Give the count an alias name of Cust_Count. SELECT count(customer_number) Cust_Count*/ SELECT count(customer_number) Cust_Count FROM transcation.customer WHERE city='CHENNAI'; /*3)Write a query to display the customer number, customer firstname,account number for the customer�s whose accounts were created after 15th of any month. Display the records sorted in ascending order based on customer number and then by account number.*/ SELECT customer_number, firstname, account_number FROM transcation.customer WHERE extract(day from date)>15 ORDER BY customer_number, account_number ; /*4)Write a query to display the number of customers who have registration but no account in the bank. Give the alias name as Count_Customer for number of customers.*/ SELECT count(customer_number) Count_Customer FROM transcation.customer WHERE customer_number NOT IN (SELECT customer_number FROM transcation.account); /*5)Write a query to display the customer�s firstname who have multiple accounts (atleast 2 accounts). Display the records sorted in ascending order based on customer's firstname.*/ SELECT firstname FROM transcation.customer INNER JOIN transcation.account ON transcation.customer.customer_number=transcation.account.customer_number GROUP BY firstname having count(firstname)>=2 order by firstname;
true
2980a445f866397784b6265558acf3936abe716a
SQL
leviking/legendary-palm-tree
/micah/create.sql
UTF-8
407
3.046875
3
[ "MIT" ]
permissive
-- Create a table CREATE TABLE locations ( id int autoincrement, primary key(id), name varchar(45), address varchar(45), city varchar(45), zip varchar(5), phone varchar(10) ) -- Create an entry in the locations table INSERT INTO locations ( name, address, city, state, zip, phone ) values ( 'South', '1234 Hardy Street', 'Hattiesburg', 'MS', '39345', '6015555555' );
true
a0cb59a89f1a2848f7a9f3f24b8bc8fe06dde98c
SQL
alejandrom13/mtracks-dotnet
/DB/MT Database/Stored Procedures/AddArtist.sql
UTF-8
308
2.84375
3
[]
no_license
CREATE PROCEDURE AddArtist @ArtistName VARCHAR(100), @biography VARCHAR(MAX), @imageURL VARCHAR(500), @heroURL VARCHAR(500) AS INSERT INTO Artist(title, biography, imageURL, heroURL) VALUES(@ArtistName, @biography, @imageURL, @heroURL) SELECT * FROM Artist WHERE title = 'Rihanna' DROP PROC AddArtist
true
4c317ea460011b7efec7755036a71ecce311640c
SQL
Naveentce/TechTalk
/SERVICES-API/src/main/resources/schema.sql
UTF-8
1,983
3.75
4
[]
no_license
CREATE TABLE `TEAM_MEMBER_DETAILS` ( `ID` INT NOT NULL AUTO_INCREMENT, `EMPID` VARCHAR(255) NOT NULL UNIQUE, `EMPNAME` VARCHAR(255) NOT NULL, `DESIGNATION` VARCHAR(255) NOT NULL, `TEAM_ID` INT, `BU` VARCHAR(255) NOT NULL, `EMAIL` VARCHAR(255) NOT NULL UNIQUE, PRIMARY KEY (`ID`) ); CREATE TABLE `TECHTALK_TEAMS` ( `ID` INT NOT NULL AUTO_INCREMENT, `TEAM_NAME` VARCHAR(255) NOT NULL, `VERSION_ID` INT NOT NULL, PRIMARY KEY (`ID`) ); CREATE TABLE `TOPICS` ( `ID` INT NOT NULL AUTO_INCREMENT, `TITLE` varchar(255) NOT NULL, `ATTACHEMENT` blob, `PRESENTED_BY` INT NOT NULL, `PRESENTED_ON` DATE NOT NULL, PRIMARY KEY (`ID`) ); CREATE TABLE `RATINGS` ( `ID` INT NOT NULL AUTO_INCREMENT, `FEED1` INT, `FEED2` INT, `FEED3` INT, `FEED4` INT, `FEED5` INT, `FEED6` INT, `TOPIC_ID` INT NOT NULL, `TEAM_MEMBER_ID` INT NOT NULL, PRIMARY KEY (`ID`) ); CREATE TABLE `VERSION` ( `ID` INT NOT NULL AUTO_INCREMENT UNIQUE, `START_DATE` DATETIME NOT NULL, `END_DATE` DATETIME, `IS_CURRENT` BOOLEAN NOT NULL, PRIMARY KEY (`ID`) ); CREATE TABLE `USER` ( `ID` INT NOT NULL AUTO_INCREMENT, `EMPID` VARCHAR(255) NOT NULL UNIQUE, `PASSWORD` VARCHAR(255) NOT NULL, `TEAM_MEMBER_ID` INT NOT NULL, `IS_ACTIVE` BOOLEAN NOT NULL, PRIMARY KEY (`ID`) ); ALTER TABLE `TEAM_MEMBER_DETAILS` ADD CONSTRAINT `TEAM_MEMBER_DETAILS_fk0` FOREIGN KEY (`TEAM_ID`) REFERENCES `TECHTALK_TEAMS`(`ID`); ALTER TABLE `TECHTALK_TEAMS` ADD CONSTRAINT `TECHTALK_TEAMS_fk0` FOREIGN KEY (`VERSION_ID`) REFERENCES `VERSION`(`ID`); ALTER TABLE `TOPICS` ADD CONSTRAINT `TOPICS_fk0` FOREIGN KEY (`PRESENTED_BY`) REFERENCES `TEAM_MEMBER_DETAILS`(`ID`); ALTER TABLE `RATINGS` ADD CONSTRAINT `RATINGS_fk0` FOREIGN KEY (`TOPIC_ID`) REFERENCES `TOPICS`(`ID`); ALTER TABLE `RATINGS` ADD CONSTRAINT `RATINGS_fk1` FOREIGN KEY (`TEAM_MEMBER_ID`) REFERENCES `TEAM_MEMBER_DETAILS`(`ID`); ALTER TABLE `USER` ADD CONSTRAINT `USER_fk0` FOREIGN KEY (`TEAM_MEMBER_ID`) REFERENCES `TEAM_MEMBER_DETAILS`(`ID`);
true
cc52862ed1c5dda03ca40bf0fbc724aa53779b14
SQL
jsyrjala/nflow-clj
/resources/sql/executors.sql
UTF-8
723
3.328125
3
[]
no_license
-- :name insert-executor! :insert -- :doc Create new executor insert into nflow_executor(host, pid, executor_group, active, expires) values (:host, :pid, :executor_group, current_timestamp, date_add(current_timestamp, interval :expires_in second)); -- :name update-executor-activity! :! -- :doc update nflow_executor set active = current_timestamp, expires = date_add(current_timestamp, interval :expires_in second) where id = :executor_id; -- :name query-executors :* -- :doc TODO select * from nflow_executor where executor_group = :executor_group order by id asc; -- :name update-shutdown! :! -- :doc update nflow_executor set expires = current_timestamp where executor_group = :executor_group and id = :executor_id;
true
b2b99a52001840b42f107a600ea21ae87917772e
SQL
791837060/FastMap
/init-incre-scripts/r_20161209/add_svr_inner_table.sql
UTF-8
344
2.53125
3
[]
no_license
-- used by multisrc2fm create table POI_EDIT_MULTISRC ( pid number(10) not null, source_type varchar2(12) not null, main_type number(2) not null ); CREATE INDEX IDX_POI_EDIT_MS_ID ON POI_EDIT_MULTISRC(PID); CREATE TABLE SVR_MULTISRC_DAY_IMP( FID VARCHAR2(36), START_DATE DATE, END_DATE DATE ); commit; exit;
true
3661869117e94d7c827dfb314a28aa135a357fa5
SQL
autorizadabr/atsadmin
/script/Log/19.sql
UTF-8
18,945
2.984375
3
[]
no_license
SET TERM ^ ; CREATE OR ALTER TRIGGER IBE$RECEBIMENTO_AI FOR RECEBIMENTO ACTIVE AFTER INSERT POSITION 32767 as declare variable tid integer; begin tid = gen_id(ibe$log_tables_gen,1); insert into ibe$log_tables (id, table_name, operation, date_time, user_name) values (:tid, 'RECEBIMENTO', 'I', 'NOW', user); insert into ibe$log_keys (log_tables_id, key_field, key_value) values (:tid, 'CODRECEBIMENTO', new.codrecebimento); if (new.titulo is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'TITULO', null, new.titulo); if (new.emissao is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'EMISSAO', null, new.emissao); if (new.datavencimento is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DATAVENCIMENTO', null, new.datavencimento); if (new.datarecebimento is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DATARECEBIMENTO', null, new.datarecebimento); if (new.caixa is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CAIXA', null, new.caixa); if (new.contadebito is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CONTADEBITO', null, new.contadebito); if (new.contacredito is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CONTACREDITO', null, new.contacredito); if (new.status is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'STATUS', null, new.status); if (new.formarecebimento is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'FORMARECEBIMENTO', null, new.formarecebimento); if (new.databaixa is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DATABAIXA', null, new.databaixa); if (new.historico is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'HISTORICO', null, new.historico); if (new.codalmoxarifado is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODALMOXARIFADO', null, new.codalmoxarifado); if (new.codvendedor is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODVENDEDOR', null, new.codvendedor); if (new.codusuario is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODUSUARIO', null, new.codusuario); if (new.valorrecebido is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALORRECEBIDO', null, new.valorrecebido); if (new.juros is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'JUROS', null, new.juros); if (new.desconto is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DESCONTO', null, new.desconto); if (new.perda is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'PERDA', null, new.perda); if (new.troca is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'TROCA', null, new.troca); if (new.funrural is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'FUNRURAL', null, new.funrural); if (new.valor_prim_via is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALOR_PRIM_VIA', null, new.valor_prim_via); if (new.valor_resto is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALOR_RESTO', null, new.valor_resto); if (new.valortitulo is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALORTITULO', null, new.valortitulo); if (new.codorigem is not null) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODORIGEM', null, new.codorigem); end; ^ SET TERM ; ^ SET TERM ^ ; CREATE OR ALTER TRIGGER IBE$RECEBIMENTO_AU FOR RECEBIMENTO ACTIVE AFTER UPDATE POSITION 32767 as declare variable tid integer; begin tid = gen_id(ibe$log_tables_gen,1); insert into ibe$log_tables (id, table_name, operation, date_time, user_name) values (:tid, 'RECEBIMENTO', 'U', 'NOW', user); insert into ibe$log_keys (log_tables_id, key_field, key_value) values (:tid, 'CODRECEBIMENTO', old.codrecebimento); if ((old.titulo is null and new.titulo is not null) or (new.titulo is null and old.titulo is not null) or (new.titulo is not null and old.titulo is not null and new.titulo <> old.titulo)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'TITULO', old.titulo, new.titulo); if ((old.emissao is null and new.emissao is not null) or (new.emissao is null and old.emissao is not null) or (new.emissao is not null and old.emissao is not null and new.emissao <> old.emissao)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'EMISSAO', old.emissao, new.emissao); if ((old.datavencimento is null and new.datavencimento is not null) or (new.datavencimento is null and old.datavencimento is not null) or (new.datavencimento is not null and old.datavencimento is not null and new.datavencimento <> old.datavencimento)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DATAVENCIMENTO', old.datavencimento, new.datavencimento); if ((old.datarecebimento is null and new.datarecebimento is not null) or (new.datarecebimento is null and old.datarecebimento is not null) or (new.datarecebimento is not null and old.datarecebimento is not null and new.datarecebimento <> old.datarecebimento)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DATARECEBIMENTO', old.datarecebimento, new.datarecebimento); if ((old.caixa is null and new.caixa is not null) or (new.caixa is null and old.caixa is not null) or (new.caixa is not null and old.caixa is not null and new.caixa <> old.caixa)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CAIXA', old.caixa, new.caixa); if ((old.contadebito is null and new.contadebito is not null) or (new.contadebito is null and old.contadebito is not null) or (new.contadebito is not null and old.contadebito is not null and new.contadebito <> old.contadebito)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CONTADEBITO', old.contadebito, new.contadebito); if ((old.contacredito is null and new.contacredito is not null) or (new.contacredito is null and old.contacredito is not null) or (new.contacredito is not null and old.contacredito is not null and new.contacredito <> old.contacredito)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CONTACREDITO', old.contacredito, new.contacredito); if ((old.status is null and new.status is not null) or (new.status is null and old.status is not null) or (new.status is not null and old.status is not null and new.status <> old.status)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'STATUS', old.status, new.status); if ((old.formarecebimento is null and new.formarecebimento is not null) or (new.formarecebimento is null and old.formarecebimento is not null) or (new.formarecebimento is not null and old.formarecebimento is not null and new.formarecebimento <> old.formarecebimento)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'FORMARECEBIMENTO', old.formarecebimento, new.formarecebimento); if ((old.databaixa is null and new.databaixa is not null) or (new.databaixa is null and old.databaixa is not null) or (new.databaixa is not null and old.databaixa is not null and new.databaixa <> old.databaixa)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DATABAIXA', old.databaixa, new.databaixa); if ((old.historico is null and new.historico is not null) or (new.historico is null and old.historico is not null) or (new.historico is not null and old.historico is not null and new.historico <> old.historico)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'HISTORICO', old.historico, new.historico); if ((old.codalmoxarifado is null and new.codalmoxarifado is not null) or (new.codalmoxarifado is null and old.codalmoxarifado is not null) or (new.codalmoxarifado is not null and old.codalmoxarifado is not null and new.codalmoxarifado <> old.codalmoxarifado)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODALMOXARIFADO', old.codalmoxarifado, new.codalmoxarifado); if ((old.codvendedor is null and new.codvendedor is not null) or (new.codvendedor is null and old.codvendedor is not null) or (new.codvendedor is not null and old.codvendedor is not null and new.codvendedor <> old.codvendedor)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODVENDEDOR', old.codvendedor, new.codvendedor); if ((old.codusuario is null and new.codusuario is not null) or (new.codusuario is null and old.codusuario is not null) or (new.codusuario is not null and old.codusuario is not null and new.codusuario <> old.codusuario)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODUSUARIO', old.codusuario, new.codusuario); if ((old.valorrecebido is null and new.valorrecebido is not null) or (new.valorrecebido is null and old.valorrecebido is not null) or (new.valorrecebido is not null and old.valorrecebido is not null and new.valorrecebido <> old.valorrecebido)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALORRECEBIDO', old.valorrecebido, new.valorrecebido); if ((old.juros is null and new.juros is not null) or (new.juros is null and old.juros is not null) or (new.juros is not null and old.juros is not null and new.juros <> old.juros)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'JUROS', old.juros, new.juros); if ((old.desconto is null and new.desconto is not null) or (new.desconto is null and old.desconto is not null) or (new.desconto is not null and old.desconto is not null and new.desconto <> old.desconto)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DESCONTO', old.desconto, new.desconto); if ((old.perda is null and new.perda is not null) or (new.perda is null and old.perda is not null) or (new.perda is not null and old.perda is not null and new.perda <> old.perda)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'PERDA', old.perda, new.perda); if ((old.troca is null and new.troca is not null) or (new.troca is null and old.troca is not null) or (new.troca is not null and old.troca is not null and new.troca <> old.troca)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'TROCA', old.troca, new.troca); if ((old.funrural is null and new.funrural is not null) or (new.funrural is null and old.funrural is not null) or (new.funrural is not null and old.funrural is not null and new.funrural <> old.funrural)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'FUNRURAL', old.funrural, new.funrural); if ((old.valor_prim_via is null and new.valor_prim_via is not null) or (new.valor_prim_via is null and old.valor_prim_via is not null) or (new.valor_prim_via is not null and old.valor_prim_via is not null and new.valor_prim_via <> old.valor_prim_via)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALOR_PRIM_VIA', old.valor_prim_via, new.valor_prim_via); if ((old.valor_resto is null and new.valor_resto is not null) or (new.valor_resto is null and old.valor_resto is not null) or (new.valor_resto is not null and old.valor_resto is not null and new.valor_resto <> old.valor_resto)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALOR_RESTO', old.valor_resto, new.valor_resto); if ((old.valortitulo is null and new.valortitulo is not null) or (new.valortitulo is null and old.valortitulo is not null) or (new.valortitulo is not null and old.valortitulo is not null and new.valortitulo <> old.valortitulo)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALORTITULO', old.valortitulo, new.valortitulo); if ((old.codorigem is null and new.codorigem is not null) or (new.codorigem is null and old.codorigem is not null) or (new.codorigem is not null and old.codorigem is not null and new.codorigem <> old.codorigem)) then insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODORIGEM', old.codorigem, new.codorigem); end; ^ SET TERM ; ^ SET TERM ^ ; CREATE OR ALTER TRIGGER IBE$RECEBIMENTO_AD FOR RECEBIMENTO ACTIVE AFTER DELETE POSITION 32767 as declare variable tid integer; begin tid = gen_id(ibe$log_tables_gen,1); insert into ibe$log_tables (id, table_name, operation, date_time, user_name) values (:tid, 'RECEBIMENTO', 'D', 'NOW', user); insert into ibe$log_keys (log_tables_id, key_field, key_value) values (:tid, 'CODRECEBIMENTO', old.codrecebimento); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'TITULO', old.titulo, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'EMISSAO', old.emissao, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DATAVENCIMENTO', old.datavencimento, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DATARECEBIMENTO', old.datarecebimento, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CAIXA', old.caixa, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CONTADEBITO', old.contadebito, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CONTACREDITO', old.contacredito, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'STATUS', old.status, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'FORMARECEBIMENTO', old.formarecebimento, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DATABAIXA', old.databaixa, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'HISTORICO', old.historico, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODALMOXARIFADO', old.codalmoxarifado, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODVENDEDOR', old.codvendedor, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODUSUARIO', old.codusuario, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALORRECEBIDO', old.valorrecebido, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'JUROS', old.juros, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'DESCONTO', old.desconto, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'PERDA', old.perda, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'TROCA', old.troca, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'FUNRURAL', old.funrural, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALOR_PRIM_VIA', old.valor_prim_via, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALOR_RESTO', old.valor_resto, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'VALORTITULO', old.valortitulo, null); insert into ibe$log_fields (log_tables_id, field_name, old_value, new_value) values (:tid, 'CODORIGEM', old.codorigem, null); end; ^ SET TERM ; ^
true
7cd9fd3daa45cfed1df44b3ea5b59b77731d66d7
SQL
zaenalabid/appz
/appz.sql
UTF-8
15,939
2.859375
3
[ "MIT" ]
permissive
/* SQLyog Ultimate v12.5.1 (64 bit) MySQL - 10.4.13-MariaDB : Database - appz ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!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 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`appz` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; USE `appz`; /*Table structure for table `failed_jobs` */ DROP TABLE IF EXISTS `failed_jobs`; CREATE TABLE `failed_jobs` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `failed_jobs` */ /*Table structure for table `feedback` */ DROP TABLE IF EXISTS `feedback`; CREATE TABLE `feedback` ( `id_feedback` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `feedback` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `stars` int(11) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id_feedback`) ) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `feedback` */ insert into `feedback`(`id_feedback`,`feedback`,`stars`,`created_at`,`updated_at`) values (92,'12345',4,'2020-12-15 01:48:27','2020-12-15 01:49:52'), (93,'-',NULL,'2020-12-15 04:15:18','2020-12-15 04:15:18'), (94,'Rasanya Anjieng Bangget',5,'2020-12-15 04:20:11','2020-12-15 04:22:58'), (95,'-',NULL,'2020-12-15 04:23:59','2020-12-15 04:23:59'), (96,'-',NULL,'2020-12-15 04:34:10','2020-12-15 04:34:10'), (97,'-',NULL,'2020-12-15 08:34:46','2020-12-15 08:34:46'), (98,'-',NULL,'2020-12-15 08:35:24','2020-12-15 08:35:24'), (99,'-',NULL,'2020-12-15 08:37:12','2020-12-15 08:37:12'), (100,'-',NULL,'2020-12-15 08:38:11','2020-12-15 08:38:11'), (101,'-',NULL,'2020-12-15 08:40:03','2020-12-15 08:40:03'), (102,'good',4,'2020-12-15 11:19:49','2020-12-15 11:32:57'), (103,'123',4,'2020-12-15 11:33:24','2020-12-15 11:36:36'), (104,'5476',4,'2020-12-15 11:36:44','2020-12-15 11:37:51'), (105,'good',4,'2020-12-15 12:11:42','2020-12-15 12:13:48'), (106,'mantab',5,'2020-12-15 12:15:44','2020-12-15 12:16:30'); /*Table structure for table `it` */ DROP TABLE IF EXISTS `it`; CREATE TABLE `it` ( `id_it` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `level` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id_it`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `it` */ insert into `it`(`id_it`,`email`,`nama`,`username`,`password`,`level`,`created_at`,`updated_at`) values (8,'yogi.trianto@binus.edu','YOGI TRIANTO','yogi.trianto','$2y$10$ePOw7gnondKVzohBk8OsyuCmllurIsoGFo4oIKHTx2wSWCatXnQiq','user','2020-12-14 05:17:12','2020-12-14 05:17:12'), (9,'m.farisi@binus.edu','M. SALMAN AL-FARISI','m.farisi','$2y$10$CSC.A3AgpZOjijNS082o2OGATgXjaV9pAjtTQUuinQjdmRpCIIiqa','user','2020-12-14 05:19:52','2020-12-14 05:19:52'), (12,'ifaahakhododo@binus.edu','Ikhtiar Faahakhododo','faahakhododo','$2y$10$iPIg1uX1wJWKtQz1wIkDbOySrPZNfBI13qZ.XlOkJwJt55WBMq7rW','Newbie','2020-12-15 03:36:44','2020-12-15 03:36:44'); /*Table structure for table `kerusakan` */ DROP TABLE IF EXISTS `kerusakan`; CREATE TABLE `kerusakan` ( `id_kerusakan` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `jenis_kerusakan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id_kerusakan`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `kerusakan` */ insert into `kerusakan`(`id_kerusakan`,`jenis_kerusakan`,`created_at`,`updated_at`) values (1,'SOFTWARE BERMASALAH','2020-12-10 03:19:41','2020-12-10 03:20:01'), (2,'MOUSE RUSAK','2020-12-10 03:23:07','2020-12-10 03:23:07'), (3,'Internet terputus','2020-12-10 10:56:13','2020-12-10 10:56:13'), (4,'Layar Tidak Tampil','2020-12-10 10:56:27','2020-12-10 10:56:27'), (5,'Lainnya','2020-12-10 10:56:42','2020-12-10 10:56:42'); /*Table structure for table `komputer` */ DROP TABLE IF EXISTS `komputer`; CREATE TABLE `komputer` ( `id_komp` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `nama_komp` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `ip` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `mac` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `user` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `id_ruangan` int(11) NOT NULL, `id_spesifikasi` int(11) NOT NULL, `status_komp` enum('aktif','perbaikan','peminjaman') COLLATE utf8mb4_unicode_ci NOT NULL, `keterangan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id_komp`) ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `komputer` */ insert into `komputer`(`id_komp`,`nama_komp`,`ip`,`mac`,`user`,`email`,`id_ruangan`,`id_spesifikasi`,`status_komp`,`keterangan`,`created_at`,`updated_at`) values (4,'YOGI T','10.38.10.134','D4:4J:33:','YOGI TRI','yogi@binus.edu',2,9,'aktif','LANCAR','2020-12-10 02:02:01','2020-12-10 02:02:01'), (5,'SALMAN-GANTENG','10.0.2.15','D4:33:F4','M. SALMAN AL-FARISI','m.farisi@binus.edu',2,10,'peminjaman','di pinjam acara','2020-12-10 02:38:21','2020-12-15 03:46:03'), (7,'A0503','10.38.11.53','18-60-24-22-55-A1','','',5,0,'aktif','',NULL,NULL), (8,'A0506','10.38.11.56','18-60-24-22-54-A8','','',6,0,'aktif','',NULL,NULL), (9,'A0507','10.38.11.57','18-60-24-22-55-20','','',7,0,'aktif','',NULL,NULL), (10,'A0508','10.38.11.58','18-60-24-22-55-90','','',8,0,'aktif','',NULL,NULL), (11,'A05011','10.38.11.61','18-60-24-22-54-D1','','',9,0,'aktif','',NULL,NULL), (12,'A05012','10.38.11.62','18-60-24-22-55-97','','',10,0,'aktif','',NULL,NULL), (13,'A05016','10.38.11.66','18-60-24-22-54-AD','','',11,0,'aktif','',NULL,NULL), (14,'A0408','10.38.11.8','18-60-24-22-54-52','','',2,0,'aktif','',NULL,NULL), (15,'A0409','10.38.11.9','18-60-24-22-55-57','','',1,0,'aktif','',NULL,NULL), (16,'A0411','10.38.11.11','18-60-24-22-55-58','','',12,0,'aktif','',NULL,NULL), (17,'A0412','10.38.11.12','18-60-24-22-54-54','','',13,0,'aktif','',NULL,NULL), (18,'A0413','10.38.11.13','18-60-24-22-54-4D','','',14,0,'aktif','',NULL,NULL), (19,'A0314','10.38.22.131','10-E7-C6-0A-72-23','','',15,0,'aktif','',NULL,NULL), (20,'A0315','10.38.25.131','10-E7-C6-07-26-45','','',16,0,'aktif','',NULL,NULL), (21,'A0317','10.38.23.131','c4-65-16-9b-ac-c7','','',17,0,'aktif','',NULL,NULL); /*Table structure for table `migrations` */ DROP TABLE IF EXISTS `migrations`; CREATE TABLE `migrations` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `migrations` */ insert into `migrations`(`id`,`migration`,`batch`) values (1,'2020_11_30_035305_create_ruangan_table',1), (2,'2020_11_30_035417_create_it_table',1), (3,'2020_11_30_035458_create_komputer_table',1), (4,'2020_11_30_035819_create_ticket_table',1), (5,'2020_11_30_035833_create_resolution_table',1), (6,'2020_11_30_070523_create_kerusakan_table',1), (7,'2020_11_30_070544_create_spesifikasi_table',1), (8,'2014_10_12_000000_create_users_table',2), (9,'2014_10_12_100000_create_password_resets_table',2), (10,'2019_08_19_000000_create_failed_jobs_table',2), (11,'2020_12_08_053842_create_feedback_table',2); /*Table structure for table `password_resets` */ DROP TABLE IF EXISTS `password_resets`; CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, KEY `password_resets_email_index` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `password_resets` */ /*Table structure for table `resolution` */ DROP TABLE IF EXISTS `resolution`; CREATE TABLE `resolution` ( `id_resolution` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `resolution` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `id_kerusakan` int(11) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id_resolution`) ) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `resolution` */ insert into `resolution`(`id_resolution`,`resolution`,`id_kerusakan`,`created_at`,`updated_at`) values (93,'Okey',3,'2020-12-15 01:48:27','2020-12-15 01:49:58'), (94,NULL,2,'2020-12-15 04:15:18','2020-12-15 04:15:18'), (95,'Dosennya yang bermasalah bukan softwarenya',1,'2020-12-15 04:20:11','2020-12-15 04:22:32'), (96,'Hello Indonesia',2,'2020-12-15 04:23:59','2020-12-15 04:33:13'), (97,NULL,4,'2020-12-15 04:34:10','2020-12-15 04:34:10'), (98,NULL,3,'2020-12-15 08:34:46','2020-12-15 08:34:46'), (99,NULL,2,'2020-12-15 08:35:24','2020-12-15 08:35:24'), (100,NULL,1,'2020-12-15 08:37:12','2020-12-15 08:37:12'), (101,NULL,1,'2020-12-15 08:38:11','2020-12-15 08:38:11'), (102,NULL,3,'2020-12-15 08:40:03','2020-12-15 08:40:03'), (103,'Mantab',2,'2020-12-15 11:19:49','2020-12-15 11:33:14'), (104,'Okey',1,'2020-12-15 11:33:24','2020-12-15 11:36:28'), (105,'Okey',3,'2020-12-15 11:36:44','2020-12-15 11:37:45'), (106,'Good',2,'2020-12-15 12:11:42','2020-12-15 12:13:40'), (107,'Mantab',4,'2020-12-15 12:15:44','2020-12-15 12:16:20'); /*Table structure for table `ruangan` */ DROP TABLE IF EXISTS `ruangan`; CREATE TABLE `ruangan` ( `id_ruangan` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `nama_ruangan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `jenis_ruangan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id_ruangan`) ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `ruangan` */ insert into `ruangan`(`id_ruangan`,`nama_ruangan`,`jenis_ruangan`,`created_at`,`updated_at`) values (1,'A0409','creative class',NULL,NULL), (2,'A0408','creative class','2020-12-09 08:24:43','2020-12-09 08:24:43'), (5,'A0503','Reguler Class',NULL,NULL), (6,'A0506','Reguler Class',NULL,NULL), (7,'A0507','Reguler Class',NULL,NULL), (8,'A0508','Reguler Class',NULL,NULL), (9,'A05011','Reguler Class',NULL,NULL), (10,'A05012','Reguler Class',NULL,NULL), (11,'A05016','Reguler Class',NULL,NULL), (12,'A0411','Tribune Class',NULL,NULL), (13,'A0412','Tribune Class',NULL,NULL), (14,'A0413','Tribune Class',NULL,NULL), (15,'A0314','Lab Komp',NULL,NULL), (16,'A0315','Lab Komp',NULL,NULL), (17,'A0317','Lab Komp',NULL,NULL); /*Table structure for table `spesifikasi` */ DROP TABLE IF EXISTS `spesifikasi`; CREATE TABLE `spesifikasi` ( `id_spesifikasi` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `procesor` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `ram` int(11) NOT NULL, `hardisk` int(11) NOT NULL, `ssd` int(11) NOT NULL, `keyboard` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `monitor` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `mouse` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `cpu` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `tahun` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id_spesifikasi`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `spesifikasi` */ insert into `spesifikasi`(`id_spesifikasi`,`procesor`,`ram`,`hardisk`,`ssd`,`keyboard`,`monitor`,`mouse`,`cpu`,`tahun`,`created_at`,`updated_at`) values (9,'intel core i3',4,500,0,'hp-sasjasQ83718J','HP19-ASNAHKS11','HP-121SQS1','HP 280 G1 MT','2013','2020-12-10 02:02:01','2020-12-10 02:02:01'), (10,'core i3',4,500,0,'HP-1XQG1','HP19-QS1BJ12','HP-AQNSJ12313','HP 280 G1 MT','2013','2020-12-10 02:38:21','2020-12-10 02:38:21'); /*Table structure for table `ticket` */ DROP TABLE IF EXISTS `ticket`; CREATE TABLE `ticket` ( `id_ticket` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `id_komputer` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `problem` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `id_it` int(255) DEFAULT NULL, `id_resolution` int(255) DEFAULT NULL, `id_feedback` int(11) DEFAULT NULL, `status` enum('open','onprogres','close') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `timer` time DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id_ticket`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `ticket` */ insert into `ticket`(`id_ticket`,`id_komputer`,`problem`,`id_it`,`id_resolution`,`id_feedback`,`status`,`timer`,`created_at`,`updated_at`) values ('201215-1284','4','Internet terputus',NULL,102,101,'close',NULL,'2020-12-15 08:40:03','2020-12-15 08:40:03'), ('201215-1741','4','Layar Tidak Tampil',9,107,106,'close','00:29:00','2020-12-15 12:15:44','2020-12-15 12:16:19'), ('201215-3006','20','MOUSE RUSAK',12,96,95,'close','09:03:00','2020-12-15 04:23:59','2020-12-15 04:33:09'), ('201215-3959','4','SOFTWARE BERMASALAH',9,104,103,'close','00:17:00','2020-12-15 11:33:24','2020-12-15 11:36:25'), ('201215-4417','4','MOUSE RUSAK',9,106,105,'close','01:25:00','2020-12-15 12:11:42','2020-12-15 12:13:37'), ('201215-4513','4','MOUSE RUSAK',9,103,102,'close','00:29:00','2020-12-15 11:19:49','2020-12-15 11:32:49'), ('201215-5301','4','Internet terputus',9,105,104,'close','00:14:00','2020-12-15 11:36:44','2020-12-15 11:37:45'), ('201215-5321','4','MOUSE RUSAK',8,94,93,'onprogres',NULL,'2020-12-15 04:15:18','2020-12-15 04:16:07'), ('201215-7366','20','SOFTWARE BERMASALAH',12,95,94,'close','02:02:00','2020-12-15 04:20:11','2020-12-15 04:22:21'), ('201215-9917','4','Internet terputus',9,93,92,'close','01:10:00','2020-12-15 01:48:27','2020-12-15 01:49:41'); /*Table structure for table `users` */ DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `users` */ /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
true
13d601328dc4ebf7dc3ba5b51e95f8d2989fea38
SQL
darcinetodev/REGISTROPESSOAS
/bd/P_MANUT_PESSOA.sql
UTF-8
1,233
3.328125
3
[]
no_license
CREATE DEFINER=`root`@`localhost` PROCEDURE `P_MANUT_PESSOA`(P_TIPO CHAR, P_CODIGO INT, P_CPF DOUBLE, P_NOME VARCHAR(50), P_SENHA VARCHAR(32), P_DATA VARCHAR(11), P_EMAIL VARCHAR(50)) BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN ROLLBACK; /* Efetua a remoção de todas as alterações em caso de erro */ RESIGNAL; /* Retorna o erro de sql exceção a chamada */ END; /* Inicia a transação */ START TRANSACTION; IF P_TIPO = 'A' THEN IF P_SENHA <> '' THEN UPDATE BRP_PESSOAS SET PES_CPF = P_CPF, PES_NOME = P_NOME, PES_SENHA = P_SENHA, PES_DATA_NASCIMENTO = DATE_FORMAT(STR_TO_DATE(P_DATA, '%Y-%m-%d'), '%Y-%m-%d'), PES_EMAIL = P_EMAIL WHERE PES_CODIGO = P_CODIGO; ELSE UPDATE BRP_PESSOAS SET PES_CPF = P_CPF, PES_NOME = P_NOME, PES_DATA_NASCIMENTO = DATE_FORMAT(STR_TO_DATE(P_DATA, '%Y-%m-%d'), '%Y-%m-%d'), PES_EMAIL = P_EMAIL WHERE PES_CODIGO = P_CODIGO; END IF; ELSEIF P_TIPO = 'R' THEN DELETE FROM BRP_PESSOAS WHERE PES_CODIGO = P_CODIGO; DELETE FROM BRP_ENDERECOS WHERE END_PES_CODIGO = P_CODIGO; END IF; /* Grava a alteração efetuada */ COMMIT; END
true
27f54bd16827be02e7c4d8fe9ad0d23f175df719
SQL
bakstansky/bootcamp
/06_Northwind/cities.sql
UTF-8
574
3.203125
3
[]
no_license
DROP TABLE IF EXISTS cities; -- Drop table if it already exists CREATE TABLE cities ( id SERIAL PRIMARY KEY NOT NULL, -- name, data type, contraints. PK = unique! -- SERIAL automatically incremented integer name VARCHAR(50) NOT NULL, population INTEGER NOT NULL, -- 2^32 country VARCHAR(50) NOT NULL ); INSERT INTO cities (name, population, country) VALUES ('Berlin', 3800000, 'Germany'); INSERT INTO cities (name, population, country) VALUES ('Paris', 2200000, 'France'); INSERT INTO cities (name, population, country) VALUES ('New York City', 8800000, 'USA');
true
9b01486c5cd678fd7f9a3d32cbfc96aa67416d68
SQL
AndreCNF/ISD_Project
/Part3/code/SQL/InsertBloodTest.sql
UTF-8
999
2.984375
3
[]
no_license
DROP PROCEDURE InsertBloodTest; DELIMITER $$ CREATE PROCEDURE InsertBloodTest(IN animal_name VARCHAR(50), IN VAT_owner INTEGER, IN date_timestamp TIMESTAMP, IN num INTEGER, IN VAT_assistant INTEGER, IN white_blood_cell_count NUMERIC(5, 2), IN number_neutrophils NUMERIC(5, 2), IN number_monocytes NUMERIC(5, 2)) BEGIN INSERT INTO _procedure VALUES(animal_name, VAT_owner, date_timestamp, num, 'Blood test'); INSERT INTO test_procedure VALUES(animal_name, VAT_owner, date_timestamp, num, 'blood'); INSERT INTO produced_indicator VALUES(animal_name, VAT_owner, date_timestamp, num, "White blood cell count", white_blood_cell_count); INSERT INTO produced_indicator VALUES(animal_name, VAT_owner, date_timestamp, num, "Number of neutrophils", number_neutrophils); INSERT INTO produced_indicator VALUES(animal_name, VAT_owner, date_timestamp, num, "Number of monocytes", number_monocytes); INSERT INTO performed VALUES(animal_name, VAT_owner, date_timestamp, num, VAT_assistant); END$$ DELIMITER ;
true
59bf4f5662ab2d4f40978cbdc33f0f8424204de2
SQL
opengauss-mirror/openGauss-server
/src/test/regress/sql/dfs_orc_hw_cstore_char2num.sql
UTF-8
4,030
3.296875
3
[ "LicenseRef-scancode-mulanpsl-2.0-en", "LicenseRef-scancode-unknown-license-reference", "PostgreSQL", "BSD-3-Clause", "LGPL-2.0-or-later", "LicenseRef-scancode-unicode", "LicenseRef-scancode-warranty-disclaimer", "curl", "GPL-1.0-or-later", "LGPL-2.1-or-later", "LGPL-2.1-only", "CC-BY-4.0", ...
permissive
set enable_global_stats = true; CREATE TABLE char_to_num_row ( id int, a char(30), b varchar(30), c bpchar ); CREATE TABLE char_to_num_row1 ( id int, a char(30), b varchar(30), c bpchar ); CREATE TABLE char_to_num_col ( id int, a char(30), b varchar(30), c bpchar )with ( orientation = orc ) tablespace hdfs_ts; --ok INSERT INTO char_to_num_row VALUES (1, '123', '456', '789'); INSERT INTO char_to_num_row VALUES (2, '123 ', '456', '789'); INSERT INTO char_to_num_row VALUES (3, NULL, NULL, '789'); INSERT INTO char_to_num_row VALUES (3, '1230', '4560', '789'); INSERT INTO char_to_num_row VALUES (3, '', '', '789'); INSERT INTO char_to_num_col select * from char_to_num_row; --error INSERT INTO char_to_num_col VALUES (4, 'abc', 'abc', '789'); INSERT INTO char_to_num_col VALUES (5, '0123', '0120', '789'); INSERT INTO char_to_num_col VALUES (6, ' 123', ' 120', '789'); INSERT INTO char_to_num_col VALUES (7, 'a123', '+123', '789'); INSERT INTO char_to_num_col VALUES (8, '1234567890123456789012', '1234567890123456789012', '789'); INSERT INTO char_to_num_col VALUES (8, '12345678901234567890123456', '12345678901234567890123456', '789'); INSERT INTO char_to_num_col VALUES (9, '123 12', '123 ', '789'); INSERT INTO char_to_num_col VALUES (9, ' ', ' ', '789'); INSERT INTO char_to_num_row1 VALUES (10, '123', '456', '789'); INSERT INTO char_to_num_row1 VALUES (11, '123.', '45 6', '789'); INSERT INTO char_to_num_col select * from char_to_num_row1; SELECT * FROM char_to_num_col ORDER BY id; -- delete a row with a TOASTed value --DELETE FROM char_to_num_col; DROP TABLE char_to_num_row; DROP TABLE char_to_num_row1; DROP TABLE char_to_num_col; -- empty string test CREATE TABLE char_to_num_00 ( a int, b varchar(10) ) with ( orientation = orc ) tablespace hdfs_ts; COPY char_to_num_00 FROM stdin with ( NULL 'null' ); 1 1 null 1 '' 1 '' 1 '' 1 '' 1 '1' 1 '2' 1 '33' 1 '44' 1 1 '' \. SELECT * FROM char_to_num_00 ORDER BY 2; DROP TABLE char_to_num_00; -- need to update source buffer size when decompression CREATE TABLE char_to_num_01 ( a int , b char(11) ); INSERT INTO char_to_num_01 VALUES(1, '2'), (1, '187040'), (1, '3'), (1, '4'), (1, '5'), (1, '6'), (1, '7'), (1, '8'), (1, '9'); INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; INSERT INTO char_to_num_01 SELECT * FROM char_to_num_01; CREATE TABLE char_to_num_02 ( a int , b char(11) ) with ( orientation = orc ) tablespace hdfs_ts; INSERT INTO char_to_num_02 SELECT * FROM char_to_num_01 ORDER BY 2; \o char_to_num_02.dat select * from char_to_num_02 order by 2; \! rm char_to_num_02.dat \o select COUNT(*) from char_to_num_02; DROP TABLE char_to_num_02, char_to_num_01; -- assert failed CREATE TABLE char_to_num_03 (id int, a char(22) ) with (orientation = orc ) tablespace hdfs_ts; COPY char_to_num_03 FROM STDIN; 1 19953730129049907919 1 199537301290499079199 1 19953730129049907919 1 19953730129049907919 1 19953730129049907919 1 19953730129049907918 1 19953730129049907917 \. SELECT * FROM char_to_num_03 ORDER BY 2; DROP TABLE char_to_num_03; -- uint64 overflow CREATE TABLE char_to_num_04 (id int, a varchar(22) ) with (orientation = orc ) tablespace hdfs_ts; COPY char_to_num_04 FROM STDIN; 1 19953730129049907919 1 199537301290499079199 1 19953730129049907919 1 19953730129049907919 1 19953730129049907919 1 19953730129049907918 1 19953730129049907917 \. SELECT * FROM char_to_num_04 ORDER BY 2; DROP TABLE char_to_num_04;
true
c864097e22acd8b3d0ddb5a3e0a45706caf3563d
SQL
JDavidStevens/simulation-3-async
/helo/db/searchLast.sql
UTF-8
94
2.515625
3
[]
no_license
select * from robots where id != $1 and last_name = $2 order by first_name offset $3 limit 6;
true
e20202ab72bda980a9a2861486424620a312aff8
SQL
nandolrs/sge
/dados/modelos/script/sge/Relational_1/SQL Server 2012/DataObjects/ForeignKey/GEOENDERECO_ITTPESSOA_FK.sql
UTF-8
178
2.625
3
[]
no_license
ALTER TABLE GEOENDERECO ADD CONSTRAINT GEOENDERECO_ITTPESSOA_FK FOREIGN KEY(CD_PESSOA) REFERENCES ITTPESSOA(CD_PESSOA) ON DELETE NO ACTION ON UPDATE NO ACTION GO
true
8cf81ab50be7c17bd711e39ca3d4b6c93432bc2f
SQL
Starzeco/Oracle-SQL
/Lista2/zad32_sql.sql
UTF-8
2,483
3.546875
4
[]
no_license
WITH Czarni AS( SELECT PSEUDO FROM KOCURY K JOIN BANDY B on K.NR_BANDY = B.NR_BANDY AND B.NAZWA='CZARNI RYCERZE' ORDER BY W_STADKU_OD ), Laciaci AS( SELECT PSEUDO FROM KOCURY K JOIN BANDY B on K.NR_BANDY = B.NR_BANDY AND B.NAZWA='LACIACI MYSLIWI' ORDER BY W_STADKU_OD ) -- Przed Zmianami SELECT PSEUDO "Pseudonim", PLEC "Plec", PRZYDZIAL_MYSZY "Myszy przed podw.", NVL(MYSZY_EXTRA, 0) "Extra przed podw." FROM KOCURY WHERE PSEUDO IN (SELECT PSEUDO FROM Czarni WHERE ROWNUM <=3 UNION SELECT PSEUDO FROM Laciaci WHERE ROWNUM <=3); -- Zmiana UPDATE KOCURY K1 SET PRZYDZIAL_MYSZY = CASE PLEC WHEN 'M' THEN PRZYDZIAL_MYSZY+10 ELSE PRZYDZIAL_MYSZY+0.1*(SELECT MIN(PRZYDZIAL_MYSZY) FROM KOCURY) END, MYSZY_EXTRA=NVL(MYSZY_EXTRA, 0) + 0.15*(SELECT AVG(NVL(MYSZY_EXTRA, 0)) FROM KOCURY K2 WHERE K2.NR_BANDY=K1.NR_BANDY) WHERE PSEUDO IN (SELECT PSEUDO FROM (SELECT PSEUDO FROM KOCURY K JOIN BANDY B on K.NR_BANDY = B.NR_BANDY AND B.NAZWA='CZARNI RYCERZE' ORDER BY W_STADKU_OD) WHERE ROWNUM <=3 UNION SELECT PSEUDO FROM (SELECT PSEUDO FROM KOCURY K JOIN BANDY B on K.NR_BANDY = B.NR_BANDY AND B.NAZWA='LACIACI MYSLIWI' ORDER BY W_STADKU_OD) WHERE ROWNUM <=3); -- Po zmianach WITH Czarni AS( SELECT PSEUDO FROM KOCURY K JOIN BANDY B on K.NR_BANDY = B.NR_BANDY AND B.NAZWA='CZARNI RYCERZE' ORDER BY W_STADKU_OD ), Laciaci AS( SELECT PSEUDO FROM KOCURY K JOIN BANDY B on K.NR_BANDY = B.NR_BANDY AND B.NAZWA='LACIACI MYSLIWI' ORDER BY W_STADKU_OD ) SELECT PSEUDO "Pseudonim", PLEC "Plec", PRZYDZIAL_MYSZY "Myszy przed podw.", NVL(MYSZY_EXTRA, 0) "Extra przed podw." FROM KOCURY WHERE PSEUDO IN (SELECT PSEUDO FROM Czarni WHERE ROWNUM <=3 UNION SELECT PSEUDO FROM Laciaci WHERE ROWNUM <=3); ROLLBACK
true
8b804c5bd4d9ce408bc82e1c2720d8d93d66c399
SQL
eunh1107/StudySQLServer
/20210513/Select_review.sql
UHC
887
4.0625
4
[]
no_license
-- ȸ SELECT * FROM userTbl; -- ȸ ͸ SELECT * FROM userTbl WHERE userID = 'BBK'; SELECT userID, name, addr FROM userTbl WHERE name LIKE '%%'; -- Ư ̺ ڵ() Ȯ SELECT COUNT(*) FROM userTbl; -- Ű 180̻̰ -- ⵵ 1970Ŀ ¾ -- ̵, ̸, Ű ȸ SELECT userID, name, height FROM userTbl WHERE height >= 180 AND birthYear >= 1970; -- ⵵() ؼ ȸ SELECT * FROM userTbl ORDER BY birthYear DESC; -- ASC | DESC -- SELECT INTO -- userTbl_New ̺ (Pk Ű ̻) SELECT * INTO usertbl_New FROM userTbl; SELECT * FROM usertbl_New; SELECT userID, name, addr INTO usertbl_Backup FROM userTbl WHERE addr = ''; SELECT * FROM userTbl_Backup; SELECT * FROM userTbl_Backup2;
true
fc42cf1be83ac916a1c3eb52e38ac09a2fcc8e96
SQL
RedRoma/aroma-data-operations
/src/main/resources/tech/aroma/sql/ddl/application_ddl.sql
UTF-8
1,017
3.5
4
[ "Apache-2.0" ]
permissive
------------------------------------------------------------------------------ -- APPLICATIONS PROVISIONED TO WORK WITH AROMA ------------------------------------------------------------------------------ CREATE TABLE IF NOT EXISTS Applications ( app_id UUID, app_name TEXT, app_description TEXT, organization_id UUID, owners UUID[], programming_language TEXT, time_provisioned TIMESTAMPTZ DEFAULT now(), time_last_updated TIMESTAMPTZ DEFAULT now(), tier TEXT, time_of_token_expiration TIMESTAMP, app_icon_media_id UUID, PRIMARY KEY (app_id) ); CREATE INDEX IF NOT EXISTS Applications_By_Organization ON Applications (organization_id); -- USED FOR REMEMBERING AN Application's Owners CREATE TABLE IF NOT EXISTS Application_Owners ( app_id UUID, owner_id UUID, since TIMESTAMP DEFAULT now(), PRIMARY KEY (app_id, owner_id) )
true
3d79f84ae7e37cc199d7c1c74b45815b9288c469
SQL
xiaopanwei/PatchManagementSystem
/db/dbFile/web_user.sql
UTF-8
997
2.796875
3
[]
no_license
/* Navicat Premium Data Transfer Source Server : 123 Source Server Type : MySQL Source Server Version : 80018 Source Host : rm-bp1ns8gwl0a1ihnyzro.mysql.rds.aliyuncs.com:3306 Source Schema : xpw_patch Target Server Type : MySQL Target Server Version : 80018 File Encoding : 65001 Date: 02/06/2021 22:15:45 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for web_user -- ---------------------------- DROP TABLE IF EXISTS `web_user`; CREATE TABLE `web_user` ( `user_id` int(255) NOT NULL AUTO_INCREMENT, `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `flag` int(255) NULL DEFAULT 0, PRIMARY KEY (`user_id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;
true
84419984253831d1fa11d4c337ae6b07866ec138
SQL
artyhedgehog/t-systems-webapp
/src/main/resources/db/migration/V1__Init_schema.sql
UTF-8
9,031
3.890625
4
[]
no_license
CREATE TABLE `trucks` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `reg_number` CHAR(7) NOT NULL COMMENT 'Registration number on licence plate.', `drivers_quantity` TINYINT UNSIGNED NOT NULL COMMENT 'Size of drivers shift for the truck.', `capacity_tons` FLOAT UNSIGNED NOT NULL COMMENT 'Capacity for cargo in tons. ', PRIMARY KEY (`id`), UNIQUE INDEX `reg_number_UNIQUE` (`reg_number` ASC)) ENGINE = InnoDB COMMENT = 'Trucks list with basic characteristics.'; CREATE TABLE `truck_conditions` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(16) NOT NULL COMMENT 'Short reference name.', `description` VARCHAR(255) NULL COMMENT 'Human-readable description.', PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC)) ENGINE = InnoDB COMMENT = 'Truck condition value variants. '; CREATE TABLE `towns` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL COMMENT 'Town name.', PRIMARY KEY (`id`), UNIQUE INDEX `title_UNIQUE` (`name` ASC)) ENGINE = InnoDB COMMENT = 'Towns on the country map.'; CREATE TABLE `trucks_state` ( `truck_id` INT UNSIGNED NOT NULL, `truck_condition_id` INT UNSIGNED NOT NULL COMMENT 'Current truck condition.', `town_id` INT UNSIGNED NULL COMMENT 'Current truck location.', PRIMARY KEY (`truck_id`), INDEX `fk_trucks_state_2_idx` (`truck_condition_id` ASC), INDEX `fk_trucks_state_3_idx` (`town_id` ASC), CONSTRAINT `fk_truck` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_truck_condition` FOREIGN KEY (`truck_condition_id`) REFERENCES `truck_conditions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_town` FOREIGN KEY (`town_id`) REFERENCES `towns` (`id`) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE = InnoDB COMMENT = 'Trucks current state information.'; CREATE TABLE `drivers` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `personal_number` INT UNSIGNED ZEROFILL NOT NULL COMMENT 'Drivers personal number.', `first_name` VARCHAR(45) NOT NULL COMMENT 'First name.', `last_name` VARCHAR(45) NOT NULL COMMENT 'Last name.', PRIMARY KEY (`id`), UNIQUE INDEX `personal_number_UNIQUE` (`personal_number` ASC)) ENGINE = InnoDB COMMENT = 'Drivers personal information'; CREATE TABLE `driver_statuses` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(16) UNIQUE NOT NULL COMMENT 'Short reference name.', `description` VARCHAR(255) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB COMMENT = 'Driver status value variants.'; CREATE TABLE `drivers_state` ( `driver_id` INT UNSIGNED NOT NULL, `driver_status_id` INT UNSIGNED NOT NULL COMMENT 'Current driver activity status.', `truck_id` INT UNSIGNED NULL COMMENT 'Current truck.', `town_id` INT UNSIGNED NULL COMMENT 'Current location.', PRIMARY KEY (`driver_id`), INDEX `fk_driver_status_idx` (`driver_status_id` ASC), INDEX `fk_truck_idx` (`truck_id` ASC), INDEX `fk_town_idx` (`town_id` ASC), CONSTRAINT `fk_driver` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_drivers_state_to_driver_status` FOREIGN KEY (`driver_status_id`) REFERENCES `driver_statuses` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT `fk_drivers_state_to_truck` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `fk_drivers_state_to_town` FOREIGN KEY (`town_id`) REFERENCES `towns` (`id`) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE = InnoDB COMMENT = 'Drivers current state information.'; CREATE TABLE `orders` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `order_number` INT(6) ZEROFILL UNSIGNED NOT NULL COMMENT 'Order unique number.', `completed` BIT(1) NOT NULL COMMENT 'Order completion mark.', `truck_id` INT UNSIGNED NULL COMMENT 'A truck assigned to execute order.', PRIMARY KEY (`id`), UNIQUE INDEX `order_number_UNIQUE` (`order_number` ASC), INDEX `fk_truck_idx` (`truck_id` ASC), CONSTRAINT `fk_orders_to_truck` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE = InnoDB COMMENT = 'Freight orders.'; CREATE TABLE `orders_to_drivers` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `order_id` INT UNSIGNED NOT NULL, `driver_id` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`), INDEX `fk_orders_executors_to_order_idx` (`order_id` ASC), INDEX `fk_orders_executors_to_driver_idx` (`driver_id` ASC), CONSTRAINT `fk_orders_executors_to_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_orders_executors_to_driver` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB COMMENT = 'Drivers assigned to execute orders.'; CREATE TABLE `cargo_statuses` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(16) UNIQUE NOT NULL COMMENT 'Short reference name.', `description` VARCHAR(255) NULL COMMENT 'Human-readable description.', PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC)) ENGINE = InnoDB COMMENT = 'Cargo status value variants.'; CREATE TABLE `cargos` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `cargo_number` INT(6) ZEROFILL NOT NULL COMMENT 'Unique number of cargo.', `title` VARCHAR(255) NOT NULL COMMENT 'Human-readable name of cargo.', `mass_kg` FLOAT UNSIGNED NOT NULL COMMENT 'Cargo mass in kilogrammes.', `cargo_status_id` INT UNSIGNED NOT NULL COMMENT 'Current cargo status.', PRIMARY KEY (`id`), UNIQUE INDEX `cargo_number_UNIQUE` (`cargo_number` ASC), INDEX `fk_cargos_to_cargo_status_idx` (`cargo_status_id` ASC), CONSTRAINT `fk_cargos_to_cargo_status` FOREIGN KEY (`cargo_status_id`) REFERENCES `cargo_statuses` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE = InnoDB COMMENT = 'Cargo information.'; CREATE TABLE `waypoint_types` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(16) UNIQUE NOT NULL COMMENT 'Short reference name.', `description` VARCHAR(255) NULL COMMENT 'Human-readable description.', PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC)) ENGINE = InnoDB COMMENT = 'Types of waypoints like loading or unloading.'; CREATE TABLE `orders_waypoints` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `order_id` INT UNSIGNED NOT NULL, `town_id` INT UNSIGNED NOT NULL, `waypoint_type_id` INT UNSIGNED NOT NULL, `cargo_id` INT UNSIGNED NULL, PRIMARY KEY (`id`), INDEX `fk_orders_waypoints_to_order_idx` (`order_id` ASC), INDEX `fk_orders_waypoints_to_town_idx` (`town_id` ASC), INDEX `fk_orders_waypoints_to_type_idx` (`waypoint_type_id` ASC), INDEX `fk_orders_waypoints_to_cargo_idx` (`cargo_id` ASC), CONSTRAINT `fk_orders_waypoints_to_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_orders_waypoints_to_town` FOREIGN KEY (`town_id`) REFERENCES `towns` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT `fk_orders_waypoints_to_type` FOREIGN KEY (`waypoint_type_id`) REFERENCES `waypoint_types` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT `fk_orders_waypoints_to_cargo` FOREIGN KEY (`cargo_id`) REFERENCES `cargos` (`id`) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE = InnoDB COMMENT = 'Waypoints containing by orders.'; CREATE TABLE `roads` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `first_town_id` INT UNSIGNED NOT NULL COMMENT 'One of the connected towns on map.', `second_town_id` INT UNSIGNED NOT NULL COMMENT 'Another of the connected towns on map.', `distance_km` FLOAT UNSIGNED NOT NULL COMMENT 'Distance between first and second town.', PRIMARY KEY (`id`), INDEX `fk_roads_to_town1_idx` (`first_town_id` ASC), INDEX `fk_roads_to_town2_idx` (`second_town_id` ASC), CONSTRAINT `fk_roads_to_town1` FOREIGN KEY (`first_town_id`) REFERENCES `towns` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT `fk_roads_to_town2` FOREIGN KEY (`second_town_id`) REFERENCES `towns` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE = InnoDB COMMENT = 'Roads connecting towns on map.'; CREATE TABLE `driver_work_summary` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `driver_id` INT UNSIGNED NOT NULL COMMENT 'Worked driver.', `period_start` DATE NOT NULL COMMENT 'First day of the period.', `period_end` DATE NOT NULL COMMENT 'Last day of period.', `hours_worked` FLOAT NOT NULL COMMENT 'Hours worked during the period.', PRIMARY KEY (`id`), INDEX `fk_driver_work_summary_to_driver_idx` (`driver_id` ASC), CONSTRAINT `fk_driver_work_summary_to_driver` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB COMMENT = 'Summary for driver work during some calendar period.';
true
15f342021a6ec6b67cff02fa530f7f97d0e95d0c
SQL
Hexilee/online-payment-subsystem
/online-payment-data.sql
UTF-8
215,884
2.796875
3
[]
no_license
/* Navicat Premium Data Transfer Source Server : MySQL Source Server Type : MySQL Source Server Version : 80016 Source Host : localhost:3306 Source Schema : onlineorder Target Server Type : MySQL Target Server Version : 80016 File Encoding : 65001 Date: 20/06/2019 10:15:11 */ -- CREATE DATABASE `Test`; SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; USE `OnlinePayment`; INSERT INTO `Buyer` ( `LoginPassword`, `PayPassword`, `Balance`, `UserName`, `RealName`, `CitizenId`, `TypeId`, `Email`, `Phone`, `Point` ) VALUES ( '7c4a8d09ca3762af61e59520943dc26494f8941b', '7c4a8d09ca3762af61e59520943dc26494f8941b', 0, 'Zhang', 'ZhangSan', '110000199801011010', 0, '123456@qq.com', '13112345678', 0 ); INSERT INTO `Seller` ( `LoginPassword`, `PayPassword`, `Balance`, `UserName`, `RealName`, `CitizenId`, `Email`, `Phone` ) VALUES ( '7c4a8d09ca3762af61e59520943dc26494f8941b', '7c4a8d09ca3762af61e59520943dc26494f8941b', 0, 'Li', 'LiSi', '110000199801011012', '123457@qq.com', '13112345679' ); INSERT INTO `CitizenIdentity` (`RealName`, `CitizenId`) VALUES ('ZhangSan', '110000199801011010'); INSERT INTO `CitizenIdentity` (`RealName`, `CitizenId`) VALUES ('LiSi', '110000199801011012'); INSERT INTO `CitizenIdentity` (`RealName`, `CitizenId`) VALUES ('WangWu', '110000199801011014'); INSERT INTO `Good` ( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( "海航商务舱", "萧山机场", "普陀机场", "2019-03-11", 609, 1, 0 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Cathay 商务舱', 'KCH', 'CAN', '2019/08/11', 1000.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Airasia 经济舱', 'CAN', 'BDO', '2019/07/12', 231.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Airasia 经济舱', 'CAN', 'KUL', '2019/09/22', 442.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Airasia 商务舱', 'BDD', 'CAN', '2019/10/30', 499.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Airasia 经济舱', 'HGH', 'CAN', '2019/11/02', 402.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Cathay 经济舱', 'CAN', 'HGH', '2019/12/10', 600.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('ShangriLa', 'single', NULL, '0', 450.00, 1, 1); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'double', NULL, '0', 234.00, 1, 1); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'single', NULL, '0', 432.00, 1, 1); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'single', NULL, '0', 555.00, 1, 1); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'family', NULL, '0', 234.00, 1, 1); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'family', NULL, '0', 544.00, 1, 0); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'double', NULL, '0', 2332.00, 1, 0); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Cathay 经济舱', 'IDR', 'KUL', '2019/07/20', 388.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Cathay 商务舱', 'KCH', 'CAN', '2019/08/11', 1000.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Airasia 经济舱', 'CAN', 'BDO', '2019/07/12', 231.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Airasia 经济舱', 'CAN', 'KUL', '2019/09/22', 442.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Airasia 商务舱', 'BDD', 'CAN', '2019/10/30', 499.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Airasia 经济舱', 'HGH', 'CAN', '2019/11/02', 402.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Cathay 经济舱', 'CAN', 'HGH', '2019/12/10', 600.00, 1, 1 ); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('ShangriLa', 'single', NULL, '0', 450.00, 1, 1); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'double', NULL, '0', 234.00, 1, 1); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'single', NULL, '0', 432.00, 1, 1); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'single', NULL, '0', 555.00, 1, 1); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'family', NULL, '0', 234.00, 1, 1); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'family', NULL, '0', 544.00, 1, 0); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ('Shangrila', 'double', NULL, '0', 2332.00, 1, 0); INSERT INTO `Good`( `GoodName`, `From`, `Dest`, `Date`, `Price`, `SellerID`, `IsReview` ) VALUES ( 'Cathay 经济舱', 'IDR', 'KUL', '2019/07/20', 388.00, 1, 1 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 6, 2, NOW(), 8701 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 19, 0, NOW(), 5528 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 8, 1, NOW(), 2701 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 8, 3, NOW(), 4258 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 14, 3, NOW(), 6848 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 10, 1, NOW(), 6152 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 0, 1, NOW(), 5765 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 18, 0, NOW(), 8785 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 2, 1, NOW(), 6166 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 15, 0, NOW(), 6896 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 9, 3, NOW(), 1283 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 7, 2, NOW(), 2911 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 13, 1, NOW(), 9076 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 16, 0, NOW(), 4229 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 18, 2, NOW(), 941 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 9, 2, NOW(), 1710 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 18, 0, NOW(), 3415 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 7, 2, NOW(), 7136 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 19, 2, NOW(), 9372 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 6, 2, NOW(), 6001 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 8, 1, NOW(), 1228 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 16, 3, NOW(), 8397 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 9, 1, NOW(), 4109 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 16, 3, NOW(), 709 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 9, 1, NOW(), 669 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 12, 2, NOW(), 1230 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 3, 0, NOW(), 2181 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 17, 1, NOW(), 4723 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 19, 0, NOW(), 6725 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 1, 3, NOW(), 8551 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 9, 1, NOW(), 2578 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 14, 0, NOW(), 6006 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 19, 2, NOW(), 2640 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 10, 3, NOW(), 6874 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 15, 1, NOW(), 8227 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 15, 3, NOW(), 6562 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 10, 0, NOW(), 5850 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 1, 0, NOW(), 1648 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 19, 1, NOW(), 7382 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 16, 3, NOW(), 4163 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 3, 0, NOW(), 3492 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 8, 3, NOW(), 2535 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 12, 2, NOW(), 6989 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 18, 2, NOW(), 3084 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 12, 3, NOW(), 8612 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 11, 1, NOW(), 6977 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 9, 3, NOW(), 5832 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 7, 2, NOW(), 9695 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 10, 1, NOW(), 1637 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 2, 3, NOW(), 3579 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 17, 1, NOW(), 3532 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 15, 3, NOW(), 7528 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 8, 3, NOW(), 1407 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 16, 0, NOW(), 4398 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 3, 3, NOW(), 8249 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 19, 3, NOW(), 4868 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 19, 0, NOW(), 4125 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 8, 0, NOW(), 6475 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 9, 2, NOW(), 192 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 6, 3, NOW(), 1318 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 6, 0, NOW(), 8155 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 12, 3, NOW(), 2931 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 4, 0, NOW(), 826 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 5, 1, NOW(), 9146 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 11, 3, NOW(), 4864 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 3, 3, NOW(), 1701 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 16, 0, NOW(), 3861 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 16, 1, NOW(), 6986 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 5, 2, NOW(), 8984 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 16, 3, NOW(), 4662 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 11, 3, NOW(), 5126 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 6, 1, NOW(), 4767 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 18, 0, NOW(), 6262 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 18, 3, NOW(), 7794 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 11, 0, NOW(), 3021 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 3, 3, NOW(), 3529 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 19, 0, NOW(), 6966 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 4, 1, NOW(), 5420 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 5, 2, NOW(), 681 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 11, 2, NOW(), 6185 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 1, 3, NOW(), 1644 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 15, 2, NOW(), 5895 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 11, 3, NOW(), 8049 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 16, 2, NOW(), 7065 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 14, 2, NOW(), 7156 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 16, 2, NOW(), 7051 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 14, 0, NOW(), 9621 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 15, 0, NOW(), 5889 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 16, 0, NOW(), 8523 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 7, 1, NOW(), 7794 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 16, 2, NOW(), 4468 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 4, 0, NOW(), 1937 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 0, 1, NOW(), 7068 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 17, 0, NOW(), 6459 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 17, 0, NOW(), 8325 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 17, 1, NOW(), 5058 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 8, 0, NOW(), 2496 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 1, 2, NOW(), 3062 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 17, 1, NOW(), 1738 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 9, 0, NOW(), 7508 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 8, 3, NOW(), 2462 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 19, 3, NOW(), 5260 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 14, 2, NOW(), 376 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 8, 2, NOW(), 7581 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 18, 0, NOW(), 4178 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 18, 2, NOW(), 7648 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 18, 0, NOW(), 1453 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 14, 2, NOW(), 9461 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 15, 0, NOW(), 1171 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 10, 2, NOW(), 860 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 6, 2, NOW(), 2057 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 17, 3, NOW(), 7406 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 4, 3, NOW(), 8755 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 12, 1, NOW(), 9125 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 0, 1, NOW(), 4920 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 3, 0, NOW(), 7363 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 14, 2, NOW(), 6678 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 12, 0, NOW(), 9188 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 12, 0, NOW(), 6056 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 2, 1, NOW(), 4214 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 4, 1, NOW(), 6303 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 17, 1, NOW(), 7331 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 1, 3, NOW(), 4892 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 12, 0, NOW(), 4875 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 17, 3, NOW(), 2472 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 0, 0, NOW(), 1982 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 5, 1, NOW(), 3693 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 16, 0, NOW(), 8533 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 2, 3, NOW(), 9802 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 5, 1, NOW(), 7472 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 13, 3, NOW(), 5821 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 9, 3, NOW(), 8180 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 15, 3, NOW(), 5028 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 2, 2, NOW(), 6586 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 14, 2, NOW(), 9293 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 9, 1, NOW(), 1555 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 3, 3, NOW(), 8810 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 0, 2, NOW(), 1832 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 14, 3, NOW(), 8588 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 8, 3, NOW(), 3941 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 12, 3, NOW(), 4928 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 15, 2, NOW(), 1551 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 12, 1, NOW(), 8748 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 15, 3, NOW(), 9882 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 11, 3, NOW(), 438 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 8, 0, NOW(), 9402 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 16, 1, NOW(), 8930 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 7, 2, NOW(), 5362 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 8, 2, NOW(), 8964 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 11, 3, NOW(), 1173 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 7, 0, NOW(), 2772 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 16, 0, NOW(), 7643 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 14, 0, NOW(), 1274 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 2, 3, NOW(), 9195 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 1, 0, NOW(), 4950 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 9, 3, NOW(), 6866 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 19, 3, NOW(), 4846 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 1, 3, NOW(), 379 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 15, 3, NOW(), 8968 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 2, 2, NOW(), 8558 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 7, 3, NOW(), 647 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 14, 0, NOW(), 2999 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 5, 3, NOW(), 2846 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 19, 2, NOW(), 7694 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 16, 1, NOW(), 8005 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 19, 3, NOW(), 7441 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 10, 0, NOW(), 4443 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 7, 1, NOW(), 9618 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 17, 0, NOW(), 8312 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 5, 0, NOW(), 8241 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 8, 3, NOW(), 122 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 18, 3, NOW(), 7411 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 6, 2, NOW(), 5374 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 2, 3, NOW(), 2248 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 13, 3, NOW(), 2703 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 3, 3, NOW(), 6233 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 18, 3, NOW(), 4907 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 15, 2, NOW(), 2137 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 2, 0, NOW(), 6630 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 4, 2, NOW(), 3100 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 8, 1, NOW(), 597 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 16, 3, NOW(), 1237 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 6, 0, NOW(), 4239 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 1, 2, NOW(), 3002 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 4, 1, NOW(), 4667 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 0, 0, NOW(), 4314 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 6, 1, NOW(), 4285 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 13, 1, NOW(), 3309 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 15, 3, NOW(), 200 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 0, 2, NOW(), 6307 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 1, 1, NOW(), 1211 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 14, 2, NOW(), 6805 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 16, 0, NOW(), 1862 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 1, 3, NOW(), 5887 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 5, 3, NOW(), 4296 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 11, 1, NOW(), 4063 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 12, 2, NOW(), 6236 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 15, 0, NOW(), 3899 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 19, 0, NOW(), 2098 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 16, 1, NOW(), 628 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 19, 1, NOW(), 7540 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 16, 2, NOW(), 8128 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 19, 3, NOW(), 1469 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 15, 3, NOW(), 248 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 6, 3, NOW(), 8988 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 15, 1, NOW(), 8985 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 11, 3, NOW(), 2706 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 1, 3, NOW(), 684 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 18, 1, NOW(), 5144 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 9, 0, NOW(), 8088 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 14, 3, NOW(), 1477 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 7, 1, NOW(), 2195 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 3, 3, NOW(), 3916 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 17, 3, NOW(), 3710 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 3, 2, NOW(), 1246 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 1, 2, NOW(), 9359 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 6, 2, NOW(), 6319 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 5, 0, NOW(), 1484 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 14, 0, NOW(), 9958 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 3, 1, NOW(), 3681 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 2, 1, NOW(), 7069 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 0, 2, NOW(), 2566 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 10, 0, NOW(), 1495 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 12, 3, NOW(), 7421 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 14, 3, NOW(), 240 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 5, 3, NOW(), 7746 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 18, 1, NOW(), 7789 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 11, 0, NOW(), 3413 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 18, 1, NOW(), 2629 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 4, 0, NOW(), 3925 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 18, 1, NOW(), 8470 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 18, 2, NOW(), 351 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 19, 0, NOW(), 8517 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 3, 2, NOW(), 9313 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 2, 1, NOW(), 706 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 13, 1, NOW(), 2093 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 8, 1, NOW(), 9087 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 4, 2, NOW(), 4982 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 15, 2, NOW(), 5622 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 14, 1, NOW(), 7483 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 2, 2, NOW(), 1108 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 11, 3, NOW(), 2775 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 16, 1, NOW(), 1400 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 5, 0, NOW(), 8306 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 10, 0, NOW(), 5990 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 16, 0, NOW(), 4861 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 7, 2, NOW(), 2552 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 11, 1, NOW(), 6175 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 14, 3, NOW(), 3774 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 8, 1, NOW(), 5718 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 11, 3, NOW(), 4389 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 16, 0, NOW(), 4485 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 16, 3, NOW(), 2374 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 0, 1, NOW(), 7301 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 9, 3, NOW(), 166 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 13, 2, NOW(), 5184 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 1, 1, NOW(), 9534 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 15, 3, NOW(), 9608 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 10, 1, NOW(), 9355 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 13, 3, NOW(), 2536 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 3, 2, NOW(), 9551 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 19, 1, NOW(), 1441 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 3, 0, NOW(), 5940 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 18, 1, NOW(), 8784 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 6, 0, NOW(), 4314 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 4, 2, NOW(), 8925 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 2, 3, NOW(), 963 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 7, 0, NOW(), 8955 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 15, 0, NOW(), 9532 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 6, 2, NOW(), 9789 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 2, 0, NOW(), 9635 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 15, 3, NOW(), 2104 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 5, 0, NOW(), 4513 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 1, 3, NOW(), 8981 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 1, 3, NOW(), 8532 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 11, 2, NOW(), 4494 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 13, 1, NOW(), 9241 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 19, 1, NOW(), 9376 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 5, 2, NOW(), 6710 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 12, 2, NOW(), 5170 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 18, 1, NOW(), 1081 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 3, 3, NOW(), 6571 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 14, 1, NOW(), 2103 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 4, 1, NOW(), 5302 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 13, 0, NOW(), 2984 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 2, 2, NOW(), 8660 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 13, 3, NOW(), 3127 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 12, 0, NOW(), 5466 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 14, 0, NOW(), 7332 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 14, 3, NOW(), 8550 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 0, 2, NOW(), 2783 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 1, 2, NOW(), 6328 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 12, 0, NOW(), 3493 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 7, 3, NOW(), 9602 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 13, 2, NOW(), 2720 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 2, 3, NOW(), 6947 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 6, 0, NOW(), 1828 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 10, 3, NOW(), 9787 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 14, 0, NOW(), 8821 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 15, 3, NOW(), 1702 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 13, 1, NOW(), 5082 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 12, 2, NOW(), 6838 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 3, 1, NOW(), 9681 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 9, 2, NOW(), 6367 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 18, 1, NOW(), 3793 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 3, 2, NOW(), 4702 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 16, 2, NOW(), 1427 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 3, 2, NOW(), 1970 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 4, 0, NOW(), 2438 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 4, 2, NOW(), 7638 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 14, 3, NOW(), 7629 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 17, 1, NOW(), 1399 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 12, 1, NOW(), 3140 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 0, 1, NOW(), 1030 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 14, 3, NOW(), 7055 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 15, 1, NOW(), 8479 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 0, 3, NOW(), 9605 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 13, 1, NOW(), 2656 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 2, 2, NOW(), 8909 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 14, 0, NOW(), 3508 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 14, 0, NOW(), 8139 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 14, 1, NOW(), 4214 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 10, 0, NOW(), 6272 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 16, 0, NOW(), 3489 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 7, 1, NOW(), 8548 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 12, 1, NOW(), 7264 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 14, 2, NOW(), 7943 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 16, 0, NOW(), 9406 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 7, 1, NOW(), 6009 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 6, 2, NOW(), 3381 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 7, 0, NOW(), 6461 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 9, 2, NOW(), 3304 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 17, 2, NOW(), 6173 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 2, 0, NOW(), 8146 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 3, 2, NOW(), 1981 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 18, 1, NOW(), 3090 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 6, 0, NOW(), 512 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 18, 3, NOW(), 5106 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 15, 0, NOW(), 4105 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 14, 2, NOW(), 6117 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 12, 0, NOW(), 9763 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 3, 0, NOW(), 6339 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 12, 2, NOW(), 2098 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 13, 1, NOW(), 1792 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 11, 2, NOW(), 3475 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 11, 1, NOW(), 9724 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 2, 1, NOW(), 3050 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 11, 1, NOW(), 7992 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 11, 3, NOW(), 8348 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 3, 0, NOW(), 8106 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 10, 0, NOW(), 6892 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 14, 3, NOW(), 4413 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 3, 3, NOW(), 8629 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 4, 1, NOW(), 2596 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 2, 0, NOW(), 7729 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 2, 3, NOW(), 8328 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 18, 3, NOW(), 5131 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 7, 2, NOW(), 5988 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 13, 3, NOW(), 7004 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 9, 0, NOW(), 827 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 0, 3, NOW(), 8006 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 19, 1, NOW(), 7820 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 16, 3, NOW(), 2960 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 4, 2, NOW(), 3948 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 18, 3, NOW(), 4911 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 17, 3, NOW(), 9279 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 9, 0, NOW(), 5998 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 11, 0, NOW(), 5686 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 4, 2, NOW(), 9118 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 3, 3, NOW(), 8682 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 2, 1, NOW(), 8086 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 16, 1, NOW(), 9475 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 10, 3, NOW(), 8745 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 4, 3, NOW(), 3281 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 10, 0, NOW(), 2904 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 10, 2, NOW(), 6841 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 18, 2, NOW(), 3831 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 4, 0, NOW(), 7369 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 13, 0, NOW(), 1959 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 17, 1, NOW(), 9737 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 12, 0, NOW(), 8216 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 7, 2, NOW(), 4249 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 19, 2, NOW(), 7583 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 13, 0, NOW(), 880 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 10, 3, NOW(), 4213 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 11, 3, NOW(), 3654 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 2, 3, NOW(), 7634 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 10, 0, NOW(), 2281 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 3, 0, NOW(), 3409 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 19, 0, NOW(), 768 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 11, 1, NOW(), 5960 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 3, 1, NOW(), 8753 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 13, 3, NOW(), 500 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 4, 3, NOW(), 7441 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 18, 3, NOW(), 5394 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 11, 1, NOW(), 1715 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 12, 0, NOW(), 4302 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 14, 0, NOW(), 2768 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 19, 1, NOW(), 7912 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 0, 1, NOW(), 9929 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 8, 3, NOW(), 5758 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 1, 0, NOW(), 9513 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 5, 0, NOW(), 4248 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 19, 0, NOW(), 4462 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 17, 3, NOW(), 7790 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 5, 2, NOW(), 311 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 9, 3, NOW(), 2823 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 12, 3, NOW(), 765 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 5, 1, NOW(), 7555 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 8, 2, NOW(), 8384 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 6, 0, NOW(), 7226 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 3, 1, NOW(), 6090 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 4, 2, NOW(), 6777 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 16, 1, NOW(), 4803 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 8, 1, NOW(), 9493 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 9, 0, NOW(), 521 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 2, 0, NOW(), 7797 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 9, 0, NOW(), 398 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 5, 2, NOW(), 245 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 1, 1, NOW(), 9342 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 9, 0, NOW(), 5992 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 15, 1, NOW(), 2156 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 13, 1, NOW(), 5658 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 15, 0, NOW(), 6360 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 0, 3, NOW(), 2748 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 18, 1, NOW(), 4042 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 6, 0, NOW(), 9725 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 6, 3, NOW(), 1865 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 19, 2, NOW(), 1939 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 3, 1, NOW(), 5319 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 18, 3, NOW(), 5561 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 5, 3, NOW(), 9194 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 19, 1, NOW(), 4228 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 4, 2, NOW(), 4780 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 3, 2, NOW(), 4828 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 5, 1, NOW(), 3612 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 13, 2, NOW(), 8644 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 11, 2, NOW(), 2602 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 10, 1, NOW(), 4813 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 7, 0, NOW(), 9282 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 18, 2, NOW(), 5326 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 15, 3, NOW(), 4050 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 0, 0, NOW(), 2449 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 11, 0, NOW(), 1355 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 19, 3, NOW(), 1091 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 19, 2, NOW(), 9013 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 4, 2, NOW(), 3726 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 5, 2, NOW(), 8731 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 11, 2, NOW(), 7517 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 17, 3, NOW(), 1286 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 13, 2, NOW(), 5896 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 0, 0, NOW(), 7578 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 6, 1, NOW(), 3354 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 7, 3, NOW(), 8799 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 3, 2, NOW(), 3916 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 5, 1, NOW(), 9867 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 17, 1, NOW(), 8060 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 7, 3, NOW(), 1086 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 0, 0, NOW(), 7198 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 5, 0, NOW(), 9101 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 4, 2, NOW(), 4843 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 7, 0, NOW(), 3947 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 18, 3, NOW(), 284 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 15, 1, NOW(), 3882 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 9, 3, NOW(), 4866 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 5, 3, NOW(), 401 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 16, 2, NOW(), 1090 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 14, 1, NOW(), 4268 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 16, 3, NOW(), 769 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 3, 0, NOW(), 3838 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 11, 1, NOW(), 1173 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 11, 3, NOW(), 7467 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 6, 0, NOW(), 4666 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 12, 1, NOW(), 1753 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 17, 2, NOW(), 7742 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 1, 3, NOW(), 6648 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 1, 1, NOW(), 5208 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 12, 2, NOW(), 8022 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 19, 3, NOW(), 8378 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 3, 2, NOW(), 8315 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 1, 2, NOW(), 3504 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 11, 1, NOW(), 3869 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 18, 1, NOW(), 7925 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 15, 2, NOW(), 2867 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 8, 3, NOW(), 2954 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 18, 2, NOW(), 1782 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 2, 2, NOW(), 3564 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 2, 0, NOW(), 8730 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 18, 1, NOW(), 4591 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 8, 0, NOW(), 3675 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 15, 3, NOW(), 6907 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 8, 3, NOW(), 3204 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 19, 2, NOW(), 7026 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 8, 3, NOW(), 9779 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 18, 0, NOW(), 3192 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 4, 2, NOW(), 2450 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 1, 0, NOW(), 4916 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 3, 2, NOW(), 5224 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 5, 1, NOW(), 2314 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 13, 2, NOW(), 8154 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 0, 1, NOW(), 5810 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 7, 2, NOW(), 4514 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 19, 2, NOW(), 9013 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 8, 1, NOW(), 1030 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 18, 0, NOW(), 6565 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 11, 2, NOW(), 8330 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 7, 1, NOW(), 8099 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 1, 2, NOW(), 8649 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 14, 2, NOW(), 8669 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 18, 0, NOW(), 8009 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 3, 2, NOW(), 699 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 17, 3, NOW(), 4726 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 5, 2, NOW(), 3322 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 4, 1, NOW(), 7945 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 5, 1, NOW(), 590 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 19, 2, NOW(), 7054 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 9, 2, NOW(), 6555 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 2, 2, NOW(), 8503 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 3, 0, NOW(), 3315 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 6, 1, NOW(), 7367 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 18, 3, NOW(), 7733 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 2, 2, NOW(), 1077 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 6, 2, NOW(), 3317 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 3, 3, NOW(), 804 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 14, 0, NOW(), 7821 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 1, 1, NOW(), 4118 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 8, 3, NOW(), 7036 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 13, 0, NOW(), 9942 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 1, 3, NOW(), 5171 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 6, 1, NOW(), 4700 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 15, 0, NOW(), 5576 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 16, 3, NOW(), 819 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 11, 0, NOW(), 200 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 7, 0, NOW(), 8193 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 1, 3, NOW(), 4265 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 2, 3, NOW(), 9110 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 13, 1, NOW(), 6720 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 1, 3, NOW(), 5238 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 14, 0, NOW(), 4644 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 18, 3, NOW(), 8335 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 17, 1, NOW(), 3324 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 8, 2, NOW(), 9964 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 10, 3, NOW(), 5393 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 0, 3, NOW(), 9251 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 5, 1, NOW(), 8648 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 17, 1, NOW(), 3363 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 0, 1, NOW(), 7213 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 10, 0, NOW(), 7165 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 12, 2, NOW(), 450 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 10, 0, NOW(), 3633 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 17, 0, NOW(), 9794 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 13, 1, NOW(), 4416 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 9, 2, NOW(), 6743 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 10, 3, NOW(), 716 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 5, 1, NOW(), 1327 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 12, 3, NOW(), 498 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 5, 3, NOW(), 9629 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 10, 2, NOW(), 2270 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 6, 2, NOW(), 956 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 8, 1, NOW(), 439 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 7, 3, NOW(), 2084 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 10, 2, NOW(), 4040 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 18, 2, NOW(), 2303 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 3, 2, NOW(), 6488 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 16, 3, NOW(), 2355 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 1, 2, NOW(), 7964 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 1, 3, NOW(), 2358 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 7, 3, NOW(), 9298 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 1, 2, NOW(), 5526 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 4, 3, NOW(), 4409 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 0, 3, NOW(), 4922 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 1, 1, NOW(), 2618 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 5, 3, NOW(), 690 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 12, 1, NOW(), 2573 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 9, 3, NOW(), 5649 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 14, 0, NOW(), 8358 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 4, 0, NOW(), 3038 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 7, 2, NOW(), 8796 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 18, 0, NOW(), 2551 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 6, 3, NOW(), 3614 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 19, 1, NOW(), 6785 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 13, 2, NOW(), 898 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 3, 1, NOW(), 1119 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 12, 3, NOW(), 9707 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 19, 0, NOW(), 5317 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 0, 1, NOW(), 1783 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 13, 3, NOW(), 9567 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 13, 3, NOW(), 1370 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 5, 3, NOW(), 5218 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 9, 3, NOW(), 2103 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 4, 1, NOW(), 1089 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 12, 3, NOW(), 5148 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 5, 2, NOW(), 2117 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 11, 0, NOW(), 1729 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 1, 3, NOW(), 950 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 12, 0, NOW(), 1695 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 0, 0, NOW(), 3358 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 5, 0, NOW(), 652 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 19, 2, NOW(), 4396 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 7, 1, NOW(), 2544 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 4, 0, NOW(), 3237 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 3, 3, NOW(), 7383 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 19, 1, NOW(), 4796 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 7, 2, NOW(), 6914 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 10, 1, NOW(), 7874 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 12, 1, NOW(), 4552 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 17, 0, NOW(), 5303 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 10, 0, NOW(), 5414 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 12, 0, NOW(), 4906 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 18, 1, NOW(), 4309 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 14, 1, NOW(), 1254 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 16, 0, NOW(), 7905 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 2, 1, NOW(), 4901 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 4, 0, NOW(), 1497 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 11, 0, NOW(), 3670 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 17, 0, NOW(), 417 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 7, 1, NOW(), 5852 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 1, 2, NOW(), 8118 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 1, 1, NOW(), 3433 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 0, 2, NOW(), 1502 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 5, 1, NOW(), 8670 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 12, 0, NOW(), 4958 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 18, 1, NOW(), 5816 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 14, 0, NOW(), 6299 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 12, 1, NOW(), 4510 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 2, 2, NOW(), 1429 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 15, 0, NOW(), 4200 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 11, 1, NOW(), 4572 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 19, 2, NOW(), 4098 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 16, 0, NOW(), 514 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 0, 0, NOW(), 4266 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 6, 0, NOW(), 4381 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 6, 0, NOW(), 2335 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 15, 3, NOW(), 1002 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 19, 0, NOW(), 5562 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 18, 1, NOW(), 4803 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 9, 3, NOW(), 1577 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 17, 0, NOW(), 8498 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 17, 3, NOW(), 9941 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 5, 0, NOW(), 8853 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 8, 0, NOW(), 3781 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 7, 1, NOW(), 1699 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 2, 2, NOW(), 3400 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 10, 0, NOW(), 4397 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 14, 2, NOW(), 6041 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 13, 3, NOW(), 8523 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 15, 2, NOW(), 5497 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 1, 2, NOW(), 2744 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 10, 0, NOW(), 9005 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 8, 2, NOW(), 9370 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 11, 0, NOW(), 4651 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 12, 3, NOW(), 3638 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 13, 3, NOW(), 1805 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 2, 2, NOW(), 7994 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 8, 1, NOW(), 402 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 17, 2, NOW(), 755 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 6, 1, NOW(), 2336 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 9, 2, NOW(), 749 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 1, 3, NOW(), 1721 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 1, 1, NOW(), 4037 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 8, 3, NOW(), 2113 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 19, 2, NOW(), 1159 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 15, 0, NOW(), 2049 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 13, 3, NOW(), 3996 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 2, 2, NOW(), 1111 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 16, 3, NOW(), 5029 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 4, 1, NOW(), 8551 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 3, 2, NOW(), 2508 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 1, 0, NOW(), 3987 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 11, 1, NOW(), 9042 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 2, 0, NOW(), 6244 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 14, 3, NOW(), 2816 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 4, 1, NOW(), 8900 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 15, 1, NOW(), 4218 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 12, 1, NOW(), 910 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 18, 2, NOW(), 9116 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 2, 0, NOW(), 500 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 6, 1, NOW(), 471 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 8, 2, NOW(), 607 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 4, 3, NOW(), 6708 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 6, 2, NOW(), 7209 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 6, 2, NOW(), 7062 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 11, 1, NOW(), 637 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 4, 3, NOW(), 2351 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 0, 0, NOW(), 6729 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 2, 2, NOW(), 8094 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 18, 0, NOW(), 8356 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 7, 0, NOW(), 1336 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 13, 2, NOW(), 5608 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 1, 2, NOW(), 8470 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 7, 2, NOW(), 4055 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 16, 3, NOW(), 149 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 19, 2, NOW(), 7487 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 12, 3, NOW(), 80 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 6, 1, NOW(), 2043 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 8, 0, NOW(), 1271 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 17, 1, NOW(), 48 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 16, 2, NOW(), 4346 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 3, 0, NOW(), 6598 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 16, 2, NOW(), 4652 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 11, 1, NOW(), 9530 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 11, 3, NOW(), 7767 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 16, 2, NOW(), 3057 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 14, 2, NOW(), 4937 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 3, 0, NOW(), 7480 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 11, 2, NOW(), 291 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 12, 0, NOW(), 1047 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 13, 0, NOW(), 1521 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 15, 3, NOW(), 3115 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 8, 2, NOW(), 4635 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 11, 3, NOW(), 8227 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 6, 3, NOW(), 6251 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 6, 3, NOW(), 2081 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 2, 1, NOW(), 209 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 18, 1, NOW(), 4139 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 19, 2, NOW(), 7978 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 18, 2, NOW(), 6833 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 7, 1, NOW(), 2534 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 2, 2, NOW(), 81 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 7, 1, NOW(), 9912 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 12, 3, NOW(), 1546 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 4, 1, NOW(), 5792 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 0, 2, NOW(), 9715 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 4, 2, NOW(), 6335 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 19, 0, NOW(), 8296 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 13, 2, NOW(), 4560 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 12, 1, NOW(), 9679 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 17, 2, NOW(), 8461 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 14, 3, NOW(), 180 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 5, 2, NOW(), 2071 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 10, 0, NOW(), 1197 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 17, 0, NOW(), 3729 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 7, 3, NOW(), 2009 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 12, 0, NOW(), 6832 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 13, 2, NOW(), 7328 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 9, 0, NOW(), 8359 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 8, 1, NOW(), 2517 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 2, 0, NOW(), 6948 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 11, 0, NOW(), 2960 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 17, 2, NOW(), 5642 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 9, 0, NOW(), 3905 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 5, 2, NOW(), 7765 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 13, 3, NOW(), 8797 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 4, 1, NOW(), 5678 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 18, 3, NOW(), 4756 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 19, 2, NOW(), 3337 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 3, 3, NOW(), 3320 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 6, 1, NOW(), 189 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 4, 2, NOW(), 9155 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 10, 2, NOW(), 3298 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 1, 0, NOW(), 9640 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 18, 2, NOW(), 4407 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 2, 1, NOW(), 6618 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 1, 1, NOW(), 4007 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 19, 2, NOW(), 1052 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 8, 0, NOW(), 3520 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 7, 2, NOW(), 4546 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 4, 3, NOW(), 1108 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 12, 3, NOW(), 7556 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 8, 2, NOW(), 7117 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 8, 0, NOW(), 9784 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 9, 2, NOW(), 3730 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 9, 2, NOW(), 2981 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 0, 1, NOW(), 8678 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 10, 0, NOW(), 7985 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 12, 0, NOW(), 684 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 2, 1, NOW(), 520 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 19, 2, NOW(), 9887 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 1, 0, NOW(), 4158 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 2, 2, NOW(), 5178 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 12, 0, NOW(), 1885 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 8, 3, NOW(), 4918 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 8, 2, NOW(), 3453 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 16, 0, NOW(), 7241 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 19, 2, NOW(), 5973 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 1, 1, NOW(), 7687 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 12, 1, NOW(), 1034 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 19, 2, NOW(), 4465 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 10, 1, NOW(), 9153 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 19, 1, NOW(), 8087 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 0, 0, NOW(), 1951 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 3, 3, NOW(), 4039 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 1, 1, NOW(), 3722 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 3, 0, NOW(), 2150 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 9, 0, NOW(), 7512 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 14, 3, NOW(), 6316 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 1, 1, NOW(), 8432 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 14, 2, NOW(), 4209 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 2, 0, NOW(), 154 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 5, 3, NOW(), 8423 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 3, 3, NOW(), 1419 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 18, 1, NOW(), 2127 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 8, 0, NOW(), 9751 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 8, 1, NOW(), 2744 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 9, 2, NOW(), 7319 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 10, 0, NOW(), 8355 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 15, 0, NOW(), 6401 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 17, 2, NOW(), 4290 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 4, 1, NOW(), 2885 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 15, 2, NOW(), 7999 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 8, 1, NOW(), 9543 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 19, 3, NOW(), 4489 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 5, 3, NOW(), 3620 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 11, 3, NOW(), 5071 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 19, 2, NOW(), 3292 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 19, 0, NOW(), 6950 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 12, 3, NOW(), 3672 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 17, 0, NOW(), 1532 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 7, 3, NOW(), 7530 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 11, 3, NOW(), 8655 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 18, 1, NOW(), 5237 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 3, 1, NOW(), 3440 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 18, 3, NOW(), 5534 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 19, 3, NOW(), 9425 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 14, 1, NOW(), 5016 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 16, 1, NOW(), 390 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 11, 3, NOW(), 5771 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 6, 1, NOW(), 9884 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 7, 0, NOW(), 9240 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 17, 2, NOW(), 969 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 4, 2, NOW(), 7085 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 13, 0, NOW(), 1280 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 3, 1, NOW(), 3409 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 19, 1, NOW(), 2292 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 13, 0, NOW(), 2384 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 4, 0, NOW(), 1601 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 11, 0, NOW(), 2230 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 7, 1, NOW(), 8955 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 4, 2, NOW(), 731 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 4, 0, NOW(), 8898 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 10, 3, NOW(), 5981 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 16, 2, NOW(), 8219 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 1, 1, NOW(), 3091 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 8, 0, NOW(), 6881 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 2, 2, NOW(), 386 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 9, 2, NOW(), 8638 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 12, 1, NOW(), 1663 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 16, 2, NOW(), 8509 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 9, 0, NOW(), 3890 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 12, 0, NOW(), 8121 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 7, 3, NOW(), 7044 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 3, 3, NOW(), 7928 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 19, 2, NOW(), 8784 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 3, 0, NOW(), 9455 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 13, 3, NOW(), 9186 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 0, 1, NOW(), 4961 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 6, 2, NOW(), 885 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 15, 3, NOW(), 5244 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 12, 3, NOW(), 604 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 19, 0, NOW(), 7227 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 18, 3, NOW(), 1886 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 15, 0, NOW(), 1175 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 5, 0, NOW(), 2724 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 2, 0, NOW(), 7366 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 11, 1, NOW(), 7305 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 11, 0, NOW(), 2343 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 19, 1, NOW(), 5647 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 12, 2, NOW(), 9584 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 11, 3, NOW(), 4107 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 18, 2, NOW(), 3755 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 14, 3, NOW(), 4681 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 8, 0, NOW(), 8727 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 14, 1, NOW(), 4042 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 16, 2, NOW(), 6702 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 13, 2, NOW(), 8627 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 0, 1, NOW(), 6580 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 7, 0, NOW(), 6075 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 3, 2, NOW(), 1970 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 19, 0, NOW(), 4076 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 3, 0, NOW(), 9558 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 13, 0, NOW(), 8191 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 19, 0, NOW(), 1882 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 11, 2, NOW(), 2024 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 6, 2, NOW(), 5299 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 8, 3, NOW(), 8502 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 5, 2, NOW(), 3818 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 10, 1, NOW(), 4100 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 6, 1, NOW(), 4756 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 12, 0, NOW(), 7565 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 7, 3, NOW(), 7644 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 4, 0, NOW(), 7559 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 10, 1, NOW(), 8846 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 0, 1, NOW(), 2716 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 10, 2, NOW(), 7240 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 7, 3, NOW(), 7437 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 10, 2, NOW(), 4545 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 8, 2, NOW(), 5997 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 18, 0, NOW(), 4999 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 19, 3, NOW(), 4742 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 4, 0, NOW(), 6090 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 1, 3, NOW(), 5782 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 13, 0, NOW(), 8287 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 8, 2, NOW(), 725 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 6, 2, NOW(), 9377 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 7, 2, NOW(), 7866 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 6, 0, NOW(), 8979 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 17, 0, NOW(), 9087 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 18, 3, NOW(), 3102 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 15, 3, NOW(), 2576 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 3, 0, NOW(), 6984 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 14, 2, NOW(), 8903 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 3, 3, NOW(), 1367 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 19, 3, NOW(), 2082 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 10, 0, NOW(), 8156 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 19, 1, NOW(), 6476 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 3, 3, NOW(), 6885 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 18, 0, NOW(), 8943 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 19, 0, NOW(), 8755 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 19, 1, NOW(), 4356 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 2, 0, NOW(), 1036 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 11, 1, NOW(), 1823 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 9, 2, NOW(), 8413 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 0, 1, NOW(), 6915 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 2, 0, NOW(), 8522 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 11, 1, NOW(), 5894 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 18, 3, NOW(), 2265 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 14, 3, NOW(), 2950 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 18, 2, NOW(), 5118 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 8, 3, NOW(), 7329 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 14, 1, NOW(), 8453 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 10, 0, NOW(), 1760 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 2, 0, NOW(), 8566 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 0, 2, NOW(), 3508 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 13, 3, NOW(), 2789 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 15, 3, NOW(), 9977 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 3, 2, NOW(), 3991 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 9, 2, NOW(), 8201 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 13, 2, NOW(), 4384 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 9, 3, NOW(), 7529 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 13, 3, NOW(), 466 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 11, 2, NOW(), 8957 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 8, 0, NOW(), 8746 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 4, 0, NOW(), 7487 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 13, 0, NOW(), 1793 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 0, 2, NOW(), 8135 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 16, 2, NOW(), 4286 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 7, 1, NOW(), 2094 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 7, 1, NOW(), 8911 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 3, 3, NOW(), 3404 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 4, 3, NOW(), 7603 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 0, 0, NOW(), 9915 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 8, 1, NOW(), 6335 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 1, 3, NOW(), 2169 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 4, 2, NOW(), 2883 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 1, 2, NOW(), 1220 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 9, 0, NOW(), 2359 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 0, 0, NOW(), 4134 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 1, 3, NOW(), 6210 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 8, 2, NOW(), 7137 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 8, 0, NOW(), 6940 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 5, 3, NOW(), 7616 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 14, 3, NOW(), 1142 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 5, 0, NOW(), 1786 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 13, 2, NOW(), 6362 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 18, 1, NOW(), 5174 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 10, 1, NOW(), 8285 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 3, 0, NOW(), 7886 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 17, 3, NOW(), 6027 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 8, 1, NOW(), 378 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 9, 2, NOW(), 1239 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 9, 1, NOW(), 3763 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 0, 0, NOW(), 7447 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 12, 2, NOW(), 4352 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 1, 1, NOW(), 2978 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 1, 2, NOW(), 521 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 5, 0, NOW(), 6347 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 6, 0, 1, NOW(), 3674 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 2, 2, NOW(), 4769 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 10, 2, NOW(), 8104 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 10, 3, NOW(), 5467 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 10, 1, NOW(), 4017 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 18, 3, NOW(), 8783 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 13, 0, NOW(), 8844 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 12, 0, NOW(), 7259 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 8, 0, NOW(), 1995 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 16, 0, NOW(), 7908 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 19, 3, NOW(), 2478 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 2, 17, 0, NOW(), 6861 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 0, 1, NOW(), 6462 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 12, 0, NOW(), 7355 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 0, 2, NOW(), 2087 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 14, 0, NOW(), 988 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 2, 3, NOW(), 8708 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 6, 2, NOW(), 4665 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 4, 6, 3, NOW(), 9780 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 14, 1, NOW(), 5583 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 12, 2, NOW(), 6234 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 14, 0, NOW(), 6979 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 5, 8, 1, NOW(), 716 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 17, 0, NOW(), 50 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 0, 1, NOW(), 718 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 18, 2, NOW(), 5562 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 3, 13, 1, NOW(), 5256 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 7, 2, NOW(), 3631 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 11, 0, NOW(), 9040 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 0, 18, 1, NOW(), 4210 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 8, 13, 3, NOW(), 5790 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 9, 11, 3, NOW(), 5392 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 1, 9, 1, NOW(), 1394 ); INSERT INTO `Order` ( `BuyerId`, `SellerId`, `GoodId`, `Numbers`, `OrderState`, `OrderTime`, `Amount` ) VALUES ( 1, 1, 7, 2, 2, NOW(), 6130 );
true
9ce0ee469a289a044fcb4212a894fcae84b17537
SQL
gregoriB/super-meter-arcade-ecommerce-site
/database/tables/item_categories.sql
UTF-8
236
3.5625
4
[]
no_license
CREATE TABLE item_categories ( ic_id SERIAL PRIMARY KEY, ic_item INT NOT NULL, ic_category INT NOT NULL, FOREIGN KEY (ic_item) REFERENCES items (item_id), FOREIGN KEY (ic_category) REFERENCES categories (cat_id) );
true
542849c5e3b461637fea13a4667e1327f6eb84df
SQL
Honey-lee429/mysql
/generation_game_online.sql
UTF-8
1,635
3.65625
4
[]
no_license
CREATE DATABASE db_generation_game_online; USE db_generation_game_online; CREATE TABLE tb_personagem ( id BIGINT AUTO_INCREMENT, nome VARCHAR(40) NOT NULL, poder_de_ataque INT, poder_de_defesa INT NOT NULL, fk_classe BIGINT(10), PRIMARY KEY (id), FOREIGN KEY (fk_classe) REFERENCES tb_classe (id_classe) ); CREATE TABLE tb_classe( id_classe bigint(5) AUTO_INCREMENT, classe VARCHAR(40), arma_utilizada VARCHAR(8) NOT NULL, PRIMARY KEY(id_classe) ); INSERT INTO tb_classe (classe, arma_utilizada) VALUES ("mago", "livro"); INSERT INTO tb_classe (classe, arma_utilizada) VALUES ("arqueiro", "flecha"); INSERT INTO tb_classe (classe, arma_utilizada) VALUES ("mercador", "machado"); INSERT INTO tb_classe (classe, arma_utilizada) VALUES ("gatuno", "faca"); INSERT INTO tb_classe (classe, arma_utilizada) VALUES ("sniper", "revolver"); INSERT INTO tb_personagem (nome, poder_de_ataque, poder_de_defesa, fk_classe) ("Cachorro", 5000, 8000, 1), ("gato", 2000, 20000, 2), ("cavalo", 1000, 5500, 3), ("pato", 1000, 3000, 4), ("rato", 3000, 30000, 5), ("minhoca", 3000, 100, 5), ("macaco", 3000, 30000, 1), ("leão", 10000, 30000, 4); SELECT * FROM tb_personagem where poder_de_ataque > 2000; SELECT * FROM tb_personagem where poder_de_defesa >= 2000 and poder_de_defesa <= 5000; SELECT * FROM tb_personagem where nome like "c%"; SELECT classe, nome FROM tb_classe INNER JOIN tb_personagem on tb_classe.id_classe = tb_personagem.fk_classe; SELECT classe, nome FROM tb_classe INNER JOIN tb_personagem on tb_classe.id_classe = tb_personagem.fk_classe where classe = "mago";
true
b066a93be1c0833589d9f6e52ca781283a9c0097
SQL
949410591/read
/mysql/scr/常用函数.sql
UTF-8
856
3.15625
3
[]
no_license
select substr("含数发射东方红",4); select substr("含数发射东方红",1,4); select instr("slfjlasdfj","asd"); select trim(" fasdfsdf "); select trim("a" from "aaaaaaaaaaaaa asdjflkasjfls aaaaaaaaaaaaaafasdf sadf asdfas aaaaaaaaaaaaaaaaa"); select lpad("123",10,".."); select rpad("123",10,".."); select round(123.123,2); select round(123.523); select floor(123.123); select truncate(123.123,1); select now(); select curdate(); select curtime(); select year(now()); select year("1997-12-12"); select minute(); select * from employees where hiredate = "1992-4-3"; select distinct hiredate from employees ; select * from employees where hiredate = str_to_date("4-3 1992","%m-%d %Y"); select last_name,date_format(now(),"%m月%d日 %y年") from employees where commission_pct is not null; select version(),database(),user();
true
3df5190026a39bcb1c80b3744585be7c50d833d7
SQL
zerojuls/b2b
/SQL/CAJA_GET.sql
UTF-8
917
4.125
4
[]
no_license
DELIMITER $$ DROP PROCEDURE IF EXISTS CAJA_GET$$ CREATE PROCEDURE `CAJA_GET`( IN P_id_caja CHAR(10), IN P_opcion INT ) BEGIN CASE P_opcion WHEN '1' THEN SELECT C.id_caja, C.c_codigo, C.c_caja, C.t_caja, T.c_tipo, C.id_moneda, M.c_moneda AS Moneda, C.id_empresa, C.c_estado AS Estado FROM CAJA C LEFT JOIN MONEDAS M ON C.id_moneda = M.id_moneda LEFT JOIN EMPRESAS E ON C.id_empresa = E.c_codigo LEFT JOIN TIPO T ON C.t_caja = T.id_tipo WHERE id_caja = P_id_caja OR P_id_caja IS NULL; WHEN '2' THEN SELECT C.c_codigo, CONCAT(C.c_codigo,' - ',C.c_caja) AS Caja, C.id_empresa FROM CAJA C WHERE c_estado = 'ACT' ORDER BY C.c_codigo; WHEN '3' THEN SELECT T.id_tipo, CONCAT(T.id_tipo, ' - ',T.c_tipo) AS Tipo FROM TIPO T WHERE id_tipo_padre = 'TCJ' ORDER BY T.id_tipo; END CASE; END$$
true
439e5b64d8756c2035134aa59ddb3ed2f5c5fb36
SQL
rajmgs/login
/src/main/resources/static/user_schema.sql
UTF-8
219
2.90625
3
[]
no_license
CREATE TABLE user ( id INTEGER NOT NULL AUTO_INCREMENT, name VARCHAR(45) NOT NULL, password VARCHAR(45) NOT NULL, created_date DATE NOT NULL DEFAULT CURRENT_TIMESTAMP PRIMARY KEY (id) );
true
c040c35db6d1c69c0c849da54f660e610955b18e
SQL
pei0804/eventory-goa
/migration/ddl.sql
UTF-8
7,334
3.953125
4
[ "MIT" ]
permissive
SET SESSION FOREIGN_KEY_CHECKS=0; /* Drop Tables */ DROP TABLE IF EXISTS event_genres; DROP TABLE IF EXISTS user_follow_events; DROP TABLE IF EXISTS events; DROP TABLE IF EXISTS user_follow_genres; DROP TABLE IF EXISTS genres; DROP TABLE IF EXISTS user_follow_prefs; DROP TABLE IF EXISTS prefs; DROP TABLE IF EXISTS user_terminals; DROP TABLE IF EXISTS users; /* Create Tables */ -- ユーザー CREATE TABLE users ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ユーザーID', name varchar(30) COMMENT 'ユーザー名', email varchar(255) COMMENT 'メールアドレス', created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '作成日', updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新日', deleted_at datetime COMMENT '削除日', PRIMARY KEY (id) ) COMMENT = 'ユーザー'; -- 都道府県 CREATE TABLE prefs ( id int(2) unsigned NOT NULL AUTO_INCREMENT COMMENT '都道府県ID', name char(4) NOT NULL COMMENT '都道府県名', created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '作成日', updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新日', deleted_at datetime COMMENT '削除日', PRIMARY KEY (id) ) COMMENT = '都道府県'; -- イベント CREATE TABLE events ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'イベントID', api_type enum('atdn','connpass','doorkeeper') NOT NULL COMMENT 'APIの種類', identifier varchar(10) NOT NULL COMMENT '識別子(api-event_id)', title varchar(200) NOT NULL COMMENT 'イベント名', description text NOT NULL COMMENT '説明', url text NOT NULL COMMENT 'イベントページURL', limits int NOT NULL COMMENT '参加人数上限', wait int NOT NULL COMMENT 'キャンセル待ち人数', accept int NOT NULL COMMENT '参加済み人数', pref_id int(2) unsigned COMMENT '都道府県ID', address text NOT NULL COMMENT '住所', start_at datetime NOT NULL COMMENT '開催日時', end_at datetime NOT NULL COMMENT '終了日時', data_hash char(64) NOT NULL COMMENT 'データ識別Hash', created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '作成日', updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新日', deleted_at datetime COMMENT '削除日', PRIMARY KEY (id), UNIQUE (identifier) ) COMMENT = 'イベント' DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; -- ジャンル CREATE TABLE genres ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ジャンルID', name varchar(30) NOT NULL COMMENT 'ジャンル名(表示用)', keyword varchar(50) NOT NULL COMMENT 'キーワード', created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '作成日', updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新日', deleted_at datetime COMMENT '削除日', PRIMARY KEY (id) ) COMMENT = 'ジャンル'; -- イベントジャンル CREATE TABLE event_genres ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', genre_id bigint(20) unsigned NOT NULL COMMENT 'ジャンルID', event_id bigint(20) unsigned NOT NULL COMMENT 'イベントID', created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '作成日', updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新日', deleted_at datetime COMMENT '削除日', PRIMARY KEY (id) ) COMMENT = 'イベントジャンル'; -- ユーザーのキープ状態 CREATE TABLE user_follow_events ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', user_id bigint(20) unsigned NOT NULL COMMENT 'ユーザーID', event_id bigint(20) unsigned NOT NULL COMMENT 'イベントID', status enum('keep','nokeep') NOT NULL COMMENT '状態', batch_processed boolean DEFAULT '0' NOT NULL COMMENT 'バッチ処理済み', created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '作成日', updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新日', deleted_at datetime COMMENT '削除日', PRIMARY KEY (id) ) COMMENT = 'ユーザーのキープ状態'; -- ユーザーフォロージャンル CREATE TABLE user_follow_genres ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ジャンルID', user_id bigint(20) unsigned NOT NULL COMMENT 'ユーザーID', genre_id bigint(20) unsigned NOT NULL COMMENT 'ジャンルID', created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '作成日', updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新日', deleted_at datetime COMMENT '削除日', PRIMARY KEY (id) ) COMMENT = 'ユーザーフォロージャンル'; -- ユーザーのフォロー都道府県 CREATE TABLE user_follow_prefs ( id int(2) unsigned NOT NULL AUTO_INCREMENT COMMENT '都道府県ID', user_id bigint(20) unsigned NOT NULL COMMENT 'ユーザーID', pref_id int(2) unsigned NOT NULL COMMENT '都道府県ID', created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '作成日', updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新日', deleted_at datetime COMMENT '削除日', PRIMARY KEY (id) ) COMMENT = 'ユーザーのフォロー都道府県'; -- ユーザー端末情報 CREATE TABLE user_terminals ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ユーザーID', user_id bigint(20) unsigned NOT NULL COMMENT 'ユーザーID', platform varchar(20) NOT NULL COMMENT 'OSとバージョン', client_version varchar(10) NOT NULL COMMENT 'アプリのバージョン', token char(64) NOT NULL COMMENT 'トークン', identifier char(36) NOT NULL COMMENT '識別子(android:Android_ID, ios:IDFV)', created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '作成日', updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新日', deleted_at datetime COMMENT '削除日', PRIMARY KEY (id) ) COMMENT = 'ユーザー端末情報'; /* Create Foreign Keys */ ALTER TABLE event_genres ADD FOREIGN KEY (event_id) REFERENCES events (id) ON UPDATE RESTRICT ON DELETE RESTRICT ; ALTER TABLE user_follow_events ADD FOREIGN KEY (event_id) REFERENCES events (id) ON UPDATE RESTRICT ON DELETE RESTRICT ; ALTER TABLE event_genres ADD FOREIGN KEY (genre_id) REFERENCES genres (id) ON UPDATE RESTRICT ON DELETE RESTRICT ; ALTER TABLE user_follow_genres ADD FOREIGN KEY (genre_id) REFERENCES genres (id) ON UPDATE RESTRICT ON DELETE RESTRICT ; ALTER TABLE events ADD FOREIGN KEY (pref_id) REFERENCES prefs (id) ON UPDATE RESTRICT ON DELETE RESTRICT ; ALTER TABLE user_follow_prefs ADD FOREIGN KEY (pref_id) REFERENCES prefs (id) ON UPDATE RESTRICT ON DELETE RESTRICT ; ALTER TABLE user_follow_events ADD FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE RESTRICT ON DELETE RESTRICT ; ALTER TABLE user_follow_genres ADD FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE RESTRICT ON DELETE RESTRICT ; ALTER TABLE user_follow_prefs ADD FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE RESTRICT ON DELETE RESTRICT ; ALTER TABLE user_terminals ADD FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE RESTRICT ON DELETE RESTRICT ;
true
828deb43162049c3b58577616810c698112352d5
SQL
vitoorfraga/Impacta
/Linguagem SQL/Exercicios/DB-Empresa.sql
ISO-8859-1
3,145
3.84375
4
[]
no_license
-- Exerccios: --a. Criar Banco de Dados de Empresa --b. Colocar Banco de Dados em Uso --c. Criar Tabelas de: --1. Funcionrio (CPF, Nome, Salrio, Data de Nascimento) --2. Dependentes (CPF, CPF do Responsvel, Nome, Data de Nascimento) --d. Inserir Registros em ambas -- Obs.: Utilize a maior variedade de Tipos de Dados possvel. --a. Criar Banco de Dados de Notas Fiscais --b. Colocar Banco de Dados em Uso --c. Criar Tabelas de: --1. Pedidos (ID do Pedido, ID do Item, Valor Total, Descrio, Data do Pedido) --2. Itens do Pedido (ID do Item, Descrio, Valor Unitrio, Quantidade) --d. Inserir Registros em ambas -- Obs.: Utilize a maior variedade de Tipos de Dados possvel. CREATE DATABASE DB_Empresa USE DB_Empresa DROP DATABASE DB_Empresa CREATE TABLE Tb_Func ( Id_Funcionario INT IDENTITY, CPF BIGINT , NOME VARCHAR(50), SALARIO MONEY, DATA_NASC DATE CONSTRAINT PK_Tb_Func_CPF PRIMARY KEY (CPF) ) INSERT Tb_Func (CPF, NOME, SALARIO, DATA_NASC) VALUES (101, 'Ana', 10000.50, '1980-01-01'), (102, 'Bia', 15000.50, '1980-01-01'), (103, 'Dai', 20000.99, '1980-01-01') CREATE TABLE Dependentes ( Id_Dependente INT IDENTITY, CPF BIGINT NOT NULL, CPF_Responsavel BIGINT NOT NULL, Nome VARCHAR(50) NOT NULL, Data_Nascimento DATE CONSTRAINT PK_Dependentes_CPF PRIMARY KEY (CPF), CONSTRAINT FK_Dependentes_CPF_Responsavel FOREIGN KEY (CPF_Responsavel) REFERENCES Tb_Func(CPF) ) INSERT Dependentes (CPF, CPF_Responsavel, Nome, Data_Nascimento) VALUES (40539964816, 101, 'Vitor Fraga', '2000-11-07') , (26943002864, 101 , 'Cosmo Pereira', '2000-11-07'), (98765431451, 102, 'Vitoria', '2000-11-07'), (98765151, 102, 'Vitoria', '2000-11-07') CREATE TABLE TB_CLIENTE ( ID_Cliente INT IDENTITY , CNPJ BIGINT NOT NULL , Nome VARCHAR(50) NOT NULL CONSTRAINT PK_Clientes_CNPJ PRIMARY KEY (ID_Cliente), ) INSERT TB_CLIENTE (CNPJ, NOME) VALUES (9001, 'Fusca'), (9002, 'Trem'), (9003, 'Trator') SELECT * FROM TB_CLIENTE CREATE TABLE TB_TELEFONE ( DDD CHAR(02) NOT NULL , Telefone INT NOT NULL , Nome VARCHAR(50) NOT NULL , ID_Cliente INT NOT NULL CONSTRAINT PK_Telefones_Telefone PRIMARY KEY(Telefone) , CONSTRAINT FK_Telefones_ID_Cliente FOREIGN KEY (ID_Cliente) REFERENCES TB_CLIENTE(ID_Cliente) ) INSERT TB_TELEFONE (DDD, Telefone, Nome, ID_Cliente) VALUES ('11', 970435347, 'Fusca',2) -- EXERCICIO 2 CREATE TABLE TB_EMPREGADOS ( ID_FUNCIONARIO INT IDENTITY , NOME VARCHAR(50) NOT NULL , SALARIO MONEY NOT NULL , COD_DEPARTAMENTO INT NOT NULL CONSTRAINT PK_TB_EMPREGADOS_ID_FUNCIONARIO PRIMARY KEY(ID_FUNCIONARIO) , CONSTRAINT FK_TB_EMPREGADOS_COD FOREIGN KEY(COD_DEPARTAMENTO) REFERENCES TB_DEPARTAMENTO(COD_DEPARTAMENTO) ) CREATE TABLE TB_DEPARTAMENTO ( COD_DEPARTAMENTO INT NOT NULL , DESCRICAO VARCHAR(50) NOT NULL , SALARIO_INIC MONEY NOT NULL CONSTRAINT PK_TB_DEPARTAMENTO_COD_DEPARTAMENTO PRIMARY KEY(COD_DEPARTAMENTO) ) SELECT * FROM Dependentes DROP TABLE Clientes
true
62de1e3a94644d5d78c8a2c95715cc82a070d98a
SQL
djwhitten/eHMP
/chef-repo/project_cookbooks/ehmp_oracle/files/default/oracledb/pcmm/pcmm_packages.sql
UTF-8
13,220
3.40625
3
[ "Apache-2.0" ]
permissive
-------------------------------------------------------- -- DDL for Package PCMM_API -------------------------------------------------------- CREATE OR REPLACE PACKAGE "PCMM"."PCMM_API" AS FUNCTION get_base_icn(i_icn IN varchar2) RETURN varchar2; FUNCTION pipe_teams_by_facility(i_facility_id IN VARCHAR2) RETURN TEAMS_TAB PIPELINED; FUNCTION pipe_teams_by_facility_patient(i_facility_id IN varchar2, i_icn IN varchar2) RETURN TEAMS_TAB PIPELINED; FUNCTION pipe_teams_by_patient(i_icn IN varchar2) RETURN TEAMS_TAB PIPELINED; FUNCTION pipe_teams_by_staff_ien(i_staff_ien IN varchar2) RETURN TEAMS_TAB PIPELINED; FUNCTION pipe_roles_by_team(i_team_id IN number) RETURN ROLES_TAB PIPELINED; PROCEDURE get_roles_for_team( i_team_id IN number, o_cursor OUT SYS_REFCURSOR); PROCEDURE get_teams_for_facility( i_facility_id IN varchar2, o_cursor OUT SYS_REFCURSOR); PROCEDURE get_teams_for_facility_patient( i_facility_id IN varchar2, i_icn IN varchar2, o_cursor OUT SYS_REFCURSOR); PROCEDURE get_teams_for_patient( i_icn IN varchar2, o_cursor OUT SYS_REFCURSOR); PROCEDURE get_teams_for_user( i_staff_ien IN varchar2, i_staff_site IN varchar2, o_cursor OUT SYS_REFCURSOR); PROCEDURE get_teams_for_user( i_staff_ien IN varchar2, i_staff_division IN varchar2, o_cursor OUT SYS_REFCURSOR); PROCEDURE load_patient_pcm; PROCEDURE load_team_staff_inst; PROCEDURE get_patient_primary_care( i_icn IN varchar2, i_site_code IN varchar2 DEFAULT NULL, i_station_number IN varchar2 DEFAULT NULL, o_team_id OUT number, o_team_name OUT varchar2, o_staff_last_name OUT varchar2, o_staff_first_name OUT varchar2, o_staff_middle_name OUT varchar2, o_staff_name OUT varchar2); END PCMM_API; / -------------------------------------------------------- -- DDL for Package Body PCMM_API -------------------------------------------------------- CREATE OR REPLACE PACKAGE BODY "PCMM"."PCMM_API" AS FUNCTION get_base_icn(i_icn IN varchar2) RETURN varchar2 AS BEGIN RETURN REGEXP_SUBSTR(i_icn,'[^V]+',1,1); END; FUNCTION pipe_teams_by_facility(i_facility_id IN varchar2) RETURN TEAMS_TAB PIPELINED AS BEGIN FOR rec IN ( SELECT DISTINCT T.TEAM_ID, T.TEAM_NAME, T.PCM_STD_TEAM_CARE_TYPE_ID, I.STATIONNUMBER, S.STAFF_IEN FROM PCMM.STAFF S JOIN PCMM.TEAM_MEMBERSHIP TM ON S.STAFF_ID = TM.STAFF_ID JOIN PCMM.TEAM T ON T.TEAM_ID = TM.TEAM_ID JOIN SDSADM.STD_INSTITUTION I ON I.ID = T.VA_INSTITUTION_ID WHERE I.STATIONNUMBER=i_facility_id) LOOP PIPE ROW(TEAMS_ROW(rec.team_id, rec.team_name, rec.pcm_std_team_care_type_id, rec.stationnumber, rec.staff_ien)); END LOOP; RETURN; END; FUNCTION pipe_teams_by_facility_patient(i_facility_id IN varchar2, i_icn IN varchar2) RETURN TEAMS_TAB PIPELINED AS v_base_icn varchar2(50); BEGIN v_base_icn := get_base_icn(i_icn); FOR rec IN ( SELECT DISTINCT T.TEAM_ID, T.TEAM_NAME, T.PCM_STD_TEAM_CARE_TYPE_ID, I.STATIONNUMBER, S.STAFF_IEN FROM PCMM.STAFF S JOIN PCMM.TEAM_MEMBERSHIP TM ON S.STAFF_ID = TM.STAFF_ID JOIN PCMM.TEAM T ON T.TEAM_ID = TM.TEAM_ID JOIN SDSADM.STD_INSTITUTION I ON I.ID = T.VA_INSTITUTION_ID JOIN PCMM.TEAM_PATIENT_ASSIGN TPA ON TPA.TEAM_ID = T.TEAM_ID JOIN PCMM.PCMM_PATIENT P ON P.PCMM_PATIENT_ID = TPA.PCMM_PATIENT_ID WHERE I.STATIONNUMBER=i_facility_id AND P.BASE_ICN = v_base_icn) LOOP PIPE ROW(TEAMS_ROW(rec.team_id, rec.team_name, rec.pcm_std_team_care_type_id, rec.stationnumber, rec.staff_ien)); END LOOP; RETURN; END; FUNCTION pipe_teams_by_patient(i_icn IN varchar2) RETURN TEAMS_TAB PIPELINED AS v_base_icn varchar2(50); BEGIN v_base_icn := get_base_icn(i_icn); FOR rec IN ( SELECT DISTINCT T.TEAM_ID, T.TEAM_NAME, T.PCM_STD_TEAM_CARE_TYPE_ID, I.STATIONNUMBER, S.STAFF_IEN FROM PCMM.STAFF S JOIN PCMM.TEAM_MEMBERSHIP TM ON S.STAFF_ID = TM.STAFF_ID JOIN PCMM.TEAM T ON T.TEAM_ID = TM.TEAM_ID JOIN PCMM.TEAM_PATIENT_ASSIGN TPA ON T.TEAM_ID = TPA.TEAM_ID JOIN PCMM.PCMM_PATIENT P ON P.PCMM_PATIENT_ID = TPA.PCMM_PATIENT_ID JOIN SDSADM.STD_INSTITUTION I ON I.ID = T.VA_INSTITUTION_ID WHERE P.BASE_ICN = v_base_icn) LOOP PIPE ROW(TEAMS_ROW(rec.team_id, rec.team_name, rec.pcm_std_team_care_type_id, rec.stationnumber, rec.staff_ien)); END LOOP; RETURN; END; FUNCTION pipe_teams_by_staff_ien(i_staff_ien IN varchar2) RETURN TEAMS_TAB PIPELINED AS BEGIN FOR rec IN ( SELECT DISTINCT T.TEAM_ID, T.TEAM_NAME, T.PCM_STD_TEAM_CARE_TYPE_ID, I.STATIONNUMBER, S.STAFF_IEN FROM PCMM.STAFF S JOIN PCMM.TEAM_MEMBERSHIP TM ON S.STAFF_ID = TM.STAFF_ID JOIN PCMM.TEAM T ON T.TEAM_ID = TM.TEAM_ID JOIN SDSADM.STD_INSTITUTION I ON I.ID = T.VA_INSTITUTION_ID WHERE S.STAFF_IEN=i_staff_ien) LOOP PIPE ROW(TEAMS_ROW(rec.team_id, rec.team_name, rec.pcm_std_team_care_type_id, rec.stationnumber, rec.staff_ien)); END LOOP; RETURN; END; FUNCTION pipe_roles_by_team(i_team_id IN number) RETURN ROLES_TAB PIPELINED AS BEGIN FOR rec IN ( SELECT DISTINCT TR.PCM_STD_TEAM_ROLE_ID, TR.NAME, S.STAFF_IEN, I.STATIONNUMBER FROM PCMM.STAFF S JOIN PCMM.TEAM_MEMBERSHIP TM ON S.STAFF_ID = TM.STAFF_ID JOIN PCMM.TEAM T ON T.TEAM_ID = TM.TEAM_ID JOIN PCMM.PCM_STD_TEAM_ROLE TR ON TM.PCM_STD_TEAM_ROLE_ID = TR.PCM_STD_TEAM_ROLE_ID JOIN SDSADM.STD_INSTITUTION I ON I.ID = T.VA_INSTITUTION_ID WHERE T.TEAM_ID=i_team_id) LOOP PIPE ROW(ROLES_ROW(rec.pcm_std_team_role_id, rec.name, rec.staff_ien, rec.stationnumber)); END LOOP; RETURN; END; PROCEDURE get_roles_for_team( i_team_id IN number, o_cursor OUT SYS_REFCURSOR) AS BEGIN OPEN o_cursor FOR SELECT DISTINCT PCM_STD_TEAM_ROLE_ID, NAME FROM TABLE(pipe_roles_by_team(i_team_id)) TEAM_ROLES JOIN EHMP.EHMP_DIVISIONS D ON D.DIVISION_ID = TEAM_ROLES.STATIONNUMBER WHERE EXISTS (SELECT null FROM EHMP.EHMP_ROUTING_USERS U WHERE U.USER_IEN = TEAM_ROLES.STAFF_IEN AND U.USER_SITE = D.SITE_CODE); END; PROCEDURE get_teams_for_facility( i_facility_id IN varchar2, o_cursor OUT SYS_REFCURSOR) AS BEGIN OPEN o_cursor FOR SELECT DISTINCT TEAM_ID, TEAM_NAME, PCM_STD_TEAM_CARE_TYPE_ID, STATIONNUMBER FROM TABLE(pipe_teams_by_facility(i_facility_id)) TEAMS WHERE EXISTS (SELECT null FROM EHMP.EHMP_ROUTING_USERS U WHERE U.USER_IEN = TEAMS.STAFF_IEN AND U.USER_SITE = (SELECT SITE_CODE FROM EHMP.EHMP_DIVISIONS WHERE DIVISION_ID = i_facility_id)); END; PROCEDURE get_teams_for_facility_patient( i_facility_id IN varchar2, i_icn IN varchar2, o_cursor OUT SYS_REFCURSOR) AS BEGIN OPEN o_cursor FOR SELECT DISTINCT TEAM_ID, TEAM_NAME, STATIONNUMBER FROM TABLE(pipe_teams_by_facility_patient(i_facility_id, i_icn)) TEAMS JOIN EHMP.EHMP_DIVISIONS D ON D.DIVISION_ID = TEAMS.STATIONNUMBER WHERE EXISTS (SELECT null FROM EHMP.EHMP_ROUTING_USERS U WHERE U.USER_IEN = TEAMS.STAFF_IEN AND U.USER_SITE = D.SITE_CODE); END; PROCEDURE get_teams_for_patient( i_icn IN varchar2, o_cursor OUT SYS_REFCURSOR) AS BEGIN OPEN o_cursor FOR SELECT DISTINCT TEAM_ID, TEAM_NAME, STATIONNUMBER FROM TABLE(pipe_teams_by_patient(i_icn)) TEAMS JOIN EHMP.EHMP_DIVISIONS D ON D.DIVISION_ID = TEAMS.STATIONNUMBER WHERE EXISTS (SELECT null FROM EHMP.EHMP_ROUTING_USERS U WHERE U.USER_IEN = TEAMS.STAFF_IEN AND U.USER_SITE = D.SITE_CODE); END; PROCEDURE get_teams_for_user( i_staff_ien IN varchar2, i_staff_site IN varchar2, o_cursor OUT SYS_REFCURSOR) AS BEGIN OPEN o_cursor FOR SELECT DISTINCT TEAM_ID, TEAM_NAME, PCM_STD_TEAM_CARE_TYPE_ID, STATIONNUMBER FROM TABLE(pipe_teams_by_staff_ien(i_staff_ien)) TEAMS WHERE STATIONNUMBER IN (SELECT D.DIVISION_ID FROM EHMP.EHMP_DIVISIONS D WHERE D.SITE_CODE = i_staff_site); END; PROCEDURE get_teams_for_user( i_staff_ien IN varchar2, i_staff_division IN varchar2, o_cursor OUT SYS_REFCURSOR) AS BEGIN OPEN o_cursor FOR SELECT DISTINCT T.TEAM_ID, T.TEAM_NAME, T.PCM_STD_TEAM_CARE_TYPE_ID, I.STATIONNUMBER, S.STAFF_IEN FROM PCMM.STAFF S JOIN PCMM.TEAM_MEMBERSHIP TM ON S.STAFF_ID = TM.STAFF_ID JOIN PCMM.TEAM T ON T.TEAM_ID = TM.TEAM_ID JOIN SDSADM.STD_INSTITUTION I ON I.ID = T.VA_INSTITUTION_ID WHERE S.STAFF_IEN=i_staff_ien AND I.STATIONNUMBER = i_staff_division; END; PROCEDURE load_patient_pcm AS BEGIN DELETE FROM pcmm.patient_primary_care; INSERT /*+ APPEND */ INTO pcmm.patient_primary_care (ICN, BASE_ICN, TEAM_ID, TEAM_NAME, TEAM_STATION_NUMBER, STAFF_IEN, STAFF_LAST_NAME, STAFF_FIRST_NAME, STAFF_MIDDLE_NAME, TEAM_PATIENT_START_DATE, TEAM_STAFF_START_DATE) SELECT ICN, BASE_ICN, TEAM_ID, TEAM_NAME, TEAM_STATION_NUMBER, STAFF_IEN, STAFF_LAST_NAME, STAFF_FIRST_NAME, STAFF_MIDDLE_NAME, TEAM_PATIENT_START_DATE, TEAM_STAFF_START_DATE FROM pcmm.patient_primary_care_view; COMMIT; EXCEPTION WHEN OTHERS THEN ROLLBACK; RAISE; END; PROCEDURE load_team_staff_inst AS BEGIN DELETE FROM pcmm.team_staff_inst; INSERT /*+ APPEND */ INTO pcmm.team_staff_inst ( TEAM_ID, TEAM_POSITION_ID, PCM_STD_TEAM_ROLE_ID, STATIONNUMBER, STAFF_IEN, VA_INSTITUTION_ID, STAFF_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, PCM_STD_TEAM_CARE_TYPE_ID, PCM_STD_TEAM_FOCUS_CODE ) SELECT TEAM_ID, TEAM_POSITION_ID, PCM_STD_TEAM_ROLE_ID, STATIONNUMBER, STAFF_IEN, VA_INSTITUTION_ID, STAFF_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, PCM_STD_TEAM_CARE_TYPE_ID, PCM_STD_TEAM_FOCUS_CODE FROM PCMM.TEAM_STAFF_INST_VIEW; COMMIT; EXCEPTION WHEN OTHERS THEN ROLLBACK; RAISE; END; PROCEDURE get_patient_primary_care( i_icn IN varchar2, i_site_code IN varchar2 DEFAULT NULL, i_station_number IN varchar2 DEFAULT NULL, o_team_id OUT number, o_team_name OUT varchar2, o_staff_last_name OUT varchar2, o_staff_first_name OUT varchar2, o_staff_middle_name OUT varchar2, o_staff_name OUT varchar2) AS PROCEDURE query_patient_primary_care( i_icn IN varchar2, i_site_code IN varchar2 DEFAULT NULL, i_station_number IN varchar2 DEFAULT NULL, o_team_id OUT number, o_team_name OUT varchar2, o_staff_last_name OUT varchar2, o_staff_first_name OUT varchar2, o_staff_middle_name OUT varchar2, o_staff_name OUT varchar2) AS v_base_icn varchar2(50); BEGIN v_base_icn := get_base_icn(i_icn); SELECT team_id, team_name, staff_last_name, staff_first_name, staff_middle_name INTO o_team_id, o_team_name, o_staff_last_name, o_staff_first_name, o_staff_middle_name FROM ( SELECT DISTINCT ppc.team_id, ppc.team_name, ppc.staff_last_name, ppc.staff_first_name, ppc.staff_middle_name, ppc.team_patient_start_date, ppc.team_staff_start_date FROM pcmm.patient_primary_care ppc LEFT JOIN ehmp.ehmp_divisions d ON d.division_id = ppc.team_station_number WHERE base_icn = v_base_icn and (i_site_code is null or d.site_code = i_site_code) and (i_station_number is null or ppc.team_station_number = i_station_number) ORDER BY ppc.team_patient_start_date DESC, ppc.team_staff_start_date DESC ) WHERE ROWNUM = 1; EXCEPTION WHEN NO_DATA_FOUND THEN NULL; END; BEGIN IF i_site_code IS NULL and i_station_number IS NULL THEN query_patient_primary_care(i_icn, i_site_code, i_station_number, o_team_id, o_team_name, o_staff_last_name, o_staff_first_name, o_staff_middle_name, o_staff_name); ElSIF i_station_number IS NOT NULL THEN query_patient_primary_care(i_icn, NULL, i_station_number, o_team_id, o_team_name, o_staff_last_name, o_staff_first_name, o_staff_middle_name, o_staff_name); END IF; IF o_team_id IS NULL and i_site_code IS NOT NULL THEN query_patient_primary_care(i_icn, i_site_code, NULL, o_team_id, o_team_name, o_staff_last_name, o_staff_first_name, o_staff_middle_name, o_staff_name); END IF; IF o_staff_last_name IS NOT NULL THEN o_staff_name := o_staff_last_name; END IF; IF o_staff_first_name IS NOT NULL THEN o_staff_name := o_staff_name || ', ' || o_staff_first_name; IF o_staff_middle_name IS NOT NULL THEN o_staff_name := o_staff_name || ' ' || o_staff_middle_name; END IF; END IF; END; END PCMM_API; /
true
b773b272dadc6b2269a1e1f6698ff64637677c3e
SQL
es021/cf-app
/test/data-cleanup.sql
UTF-8
1,703
3.84375
4
[]
no_license
-- ###################### -- SUGGESTION UNTUK WHERE IN MALAYSIA xde dlm ref select X.ID, X.val as original_val, X.key_input, X.entity_id, (CASE WHEN X.match_state IS NOT NULL THEN X.match_state ELSE X.match_city END) as matchs from( SELECT s.ID, s.val, s.entity_id, s.key_input, SUBSTRING_INDEX(s.val,',',1), (select rr.val from ref_city_state_country rr where rr.val like CONCAT(SUBSTRING_INDEX(s.val,',',1), "%") and rr.type = "city" and s.val != "" limit 0,1 ) as match_city, (select rr.val from ref_city_state_country rr where rr.val like CONCAT(SUBSTRING_INDEX(s.val,',',1), "%") and rr.type = "state" and s.val != "" limit 0,1 ) as match_state from single_input s where s.key_input = "where_in_malaysia" and s.val NOT IN(SELECT r.val from ref_city_state_country r) )X order by matchs -- ###################### -- WHERE IN MALAYSIA xde dlm ref SELECT s.ID, s.val, s.entity_id, s.key_input, SUBSTRING_INDEX(s.val,',',1), (select rr.val from ref_city_state_country rr where rr.val like CONCAT(SUBSTRING_INDEX(s.val,',',1), "%") and rr.type = "city" and s.val != "" limit 0,1 ) as match_city, (select rr.val from ref_city_state_country rr where rr.val like CONCAT(SUBSTRING_INDEX(s.val,',',1), "%") and rr.type = "state" and s.val != "" limit 0,1 ) as match_state from single_input s where s.key_input = "where_in_malaysia" and s.val NOT IN(SELECT r.val from ref_city_state_country r) -- ####################### -- COUNTRY STUDY MALAYSIA UNTUK BUKAN LOCAL select m.* from cf_map m, single_input s where m.entity = "user" and m.cf = "GWINTER" and s.entity_id = m.entity_id and s.key_input = "country_study" and s.val = "Malaysia"
true
a693708d14c8ddf1f136b73d5d9a25ff201e1279
SQL
eagle2snow/yuedan
/sql.sql
UTF-8
9,091
3.015625
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : selfthis Source Server Version : 50722 Source Host : localhost:3306 Source Database : bar Target Server Type : MYSQL Target Server Version : 50722 File Encoding : 65001 Date: 2018-07-04 18:25:16 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `t_login_log` -- ---------------------------- DROP TABLE IF EXISTS `t_login_log`; CREATE TABLE `t_login_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` longtext, `create_time` datetime(6) DEFAULT NULL, `deleted` int(11) DEFAULT NULL, `enable` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `login_ip` varchar(255) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FKcymi7qmui33qy2i3ecpw5oim9` (`user_id`), CONSTRAINT `FKcymi7qmui33qy2i3ecpw5oim9` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_login_log -- ---------------------------- INSERT INTO `t_login_log` VALUES ('1', null, '2018-07-04 18:24:49.941000', '1', '1', null, '0:0:0:0:0:0:0:1', '1'); -- ---------------------------- -- Table structure for `t_member` -- ---------------------------- DROP TABLE IF EXISTS `t_member`; CREATE TABLE `t_member` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` longtext, `create_time` datetime(6) DEFAULT NULL, `deleted` int(11) DEFAULT NULL, `enable` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `agency_id` varchar(255) DEFAULT NULL, `agency_nickname` varchar(255) DEFAULT NULL, `area` varchar(255) DEFAULT NULL, `balance` decimal(19,2) DEFAULT NULL, `chang_referrer` int(11) DEFAULT NULL, `city` varchar(255) DEFAULT NULL, `consume` decimal(19,2) DEFAULT NULL, `country` varchar(255) DEFAULT NULL, `gender` int(11) DEFAULT NULL, `generalize_cost` decimal(19,2) DEFAULT NULL, `generalize_id` varchar(255) DEFAULT NULL, `integral` int(11) DEFAULT NULL, `ioc_url` varchar(255) DEFAULT NULL, `last_update_qr_code` datetime(6) DEFAULT NULL, `level` int(11) DEFAULT NULL, `login_time` datetime(6) DEFAULT NULL, `love` int(11) DEFAULT NULL, `mobile` varchar(255) DEFAULT NULL, `nickname` varchar(255) DEFAULT NULL, `openid` varchar(255) DEFAULT NULL, `password` varchar(255) DEFAULT NULL, `province` varchar(255) DEFAULT NULL, `qr_code` text, `referrer_generalize_id` varchar(255) DEFAULT NULL, `referrer_nickname` varchar(255) DEFAULT NULL, `set_meal` int(11) DEFAULT NULL, `ten_return_one` decimal(19,2) DEFAULT NULL, `total_revenue` decimal(19,2) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_member -- ---------------------------- -- ---------------------------- -- Table structure for `t_opt_log` -- ---------------------------- DROP TABLE IF EXISTS `t_opt_log`; CREATE TABLE `t_opt_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` longtext, `create_time` datetime(6) DEFAULT NULL, `deleted` int(11) DEFAULT NULL, `enable` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `opt_ip` varchar(255) DEFAULT NULL, `opt_uri` varchar(255) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FK56xgvnksn8373s5p4iuvx5e8r` (`user_id`), CONSTRAINT `FK56xgvnksn8373s5p4iuvx5e8r` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_opt_log -- ---------------------------- INSERT INTO `t_opt_log` VALUES ('1', null, '2018-07-04 18:14:59.949000', '1', '1', null, '0:0:0:0:0:0:0:1', '/admin/sys/loginlog/list/1/15.htm', '1'); -- ---------------------------- -- Table structure for `t_res` -- ---------------------------- DROP TABLE IF EXISTS `t_res`; CREATE TABLE `t_res` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` longtext, `create_time` datetime(6) DEFAULT NULL, `deleted` int(11) DEFAULT NULL, `enable` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `code` varchar(255) DEFAULT NULL, `level` int(11) DEFAULT NULL, `type` int(11) DEFAULT NULL, `url` varchar(255) DEFAULT NULL, `parent_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FK9mxmyqk77m4ta5xfwfurf0tkh` (`parent_id`), CONSTRAINT `FK9mxmyqk77m4ta5xfwfurf0tkh` FOREIGN KEY (`parent_id`) REFERENCES `t_res` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_res -- ---------------------------- INSERT INTO `t_res` VALUES ('1', null, null, '1', '1', '顶级资源', null, '0', '0', null, null); INSERT INTO `t_res` VALUES ('2', null, '2018-04-13 13:57:40.075000', '1', '1', '会员中心', '', '0', '1', '', '1'); INSERT INTO `t_res` VALUES ('3', null, '2018-04-14 17:52:22.665000', '1', '1', '会员管理', 'admin:member:show', '0', '1', '/admin/member/list/1/115.htm', '2'); INSERT INTO `t_res` VALUES ('34', null, '2018-04-13 15:10:46.443000', '1', '1', '管理员中心', '', '0', '1', '', '1'); INSERT INTO `t_res` VALUES ('35', null, '2018-04-13 15:11:43.358000', '1', '1', '管理员管理', 'admin:sys:user:show', '0', '1', '/admin/sys/user/list/1/15.htm', '34'); INSERT INTO `t_res` VALUES ('36', null, '2018-04-13 15:12:12.382000', '1', '1', '添加管理员', 'admin:sys:user:add', '0', '2', '', '35'); INSERT INTO `t_res` VALUES ('37', null, '2018-04-13 15:12:51.566000', '1', '1', '修改管理员信息', 'admin:sys:user:update', '0', '2', '', '35'); INSERT INTO `t_res` VALUES ('38', null, '2018-04-13 15:13:07.038000', '1', '1', '删除管理员', 'admin:sys:user:delete', '0', '2', '', '35'); INSERT INTO `t_res` VALUES ('39', null, '2018-04-13 15:14:26.077000', '1', '1', '资源管理', 'admin:sys:res:show', '0', '1', '/admin/sys/res/list/1/15.htm', '34'); INSERT INTO `t_res` VALUES ('40', null, '2018-04-13 15:15:09.940000', '1', '1', '添加资源', 'admin:sys:res:add', '0', '2', '', '39'); INSERT INTO `t_res` VALUES ('41', null, '2018-04-13 15:15:26.382000', '1', '1', '修改资源', 'admin:sys:res:update', '0', '2', '', '39'); INSERT INTO `t_res` VALUES ('42', null, '2018-04-13 15:16:08.348000', '1', '1', '删除资源', 'admin:sys:res:delete', '0', '2', '', '39'); INSERT INTO `t_res` VALUES ('44', null, '2018-04-16 09:25:20.904000', '1', '1', '会员服务', '', '0', '1', '', '1'); INSERT INTO `t_res` VALUES ('45', null, '2018-04-13 16:27:16.431000', '1', '1', '设置管理员权限', 'admin:user:setRes', '0', '2', '', '35'); INSERT INTO `t_res` VALUES ('46', null, '2018-04-13 17:12:21.693000', '1', '1', '查看登录日志', 'admin:sys:loginlog:show', '0', '1', '/admin/sys/loginlog/list/1/15.htm', '34'); INSERT INTO `t_res` VALUES ('47', null, '2018-04-13 17:12:06.969000', '1', '1', '查看操作日志', 'admin:sys:optlog:show', '0', '1', '/admin/sys/optlog/list/1/15.htm', '34'); -- ---------------------------- -- Table structure for `t_user` -- ---------------------------- DROP TABLE IF EXISTS `t_user`; CREATE TABLE `t_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` longtext, `create_time` datetime(6) DEFAULT NULL, `deleted` int(11) DEFAULT NULL, `enable` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `avatar` varchar(255) DEFAULT NULL, `last_login_date` datetime(6) DEFAULT NULL, `last_login_ip` varchar(255) DEFAULT NULL, `login_count` int(11) DEFAULT NULL, `mobile` varchar(255) DEFAULT NULL, `pass_error_times` int(11) DEFAULT NULL, `password` varchar(255) DEFAULT NULL, `salt` varchar(255) DEFAULT NULL, `sex` int(11) DEFAULT NULL, `sign` varchar(255) DEFAULT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_user -- ---------------------------- INSERT INTO `t_user` VALUES ('1', null, '2018-04-13 16:41:42.228000', '1', '1', '超级管理员', '/static/admin/img/user8-128x128.jpg', null, null, '0', '18174734499', '0', 'admin', null, '0', null, 'admin'); -- ---------------------------- -- Table structure for `t_user_res` -- ---------------------------- DROP TABLE IF EXISTS `t_user_res`; CREATE TABLE `t_user_res` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` longtext, `create_time` datetime(6) DEFAULT NULL, `deleted` int(11) DEFAULT NULL, `enable` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `res_id` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FK9jnp8x22r714llhds35oe91pe` (`res_id`), KEY `FKqfnq1bbob94mdme33ftbqen9j` (`user_id`), CONSTRAINT `FK9jnp8x22r714llhds35oe91pe` FOREIGN KEY (`res_id`) REFERENCES `t_res` (`id`), CONSTRAINT `FKqfnq1bbob94mdme33ftbqen9j` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_user_res -- ----------------------------
true
716847d97e8b5642eb2da7a11e5027a60c32d51b
SQL
lhy274/websource
/shopping1/shopping.sql
UTF-8
398
2.6875
3
[]
no_license
create table productTBL( num number(8), category varchar2(20), name varchar2(50), content varchar2(3000), psize varchar2(10), color varchar2(20), amount number(8), price number(8), goods_date date default sysdate ); alter table productTBL add constraint prod_seq primary key(num); create sequence seq_productTBL; select * from productTBL; DROP TABLE productTBL; DROP TABLE productTBL2;
true
30ec37dd8dacc6f6448b51df9751108af34e8e7c
SQL
bfletcherbiggs/sql-queries
/day2/day2-practice.sql
UTF-8
4,077
4.21875
4
[]
no_license
/* Return to https://chinook.ml. Feel free to drop the existing tables, as you will use them in the afternoon project. */ --UPDATE -- Create a table or use one of the sql files to create a table. CREATE TABLE IF NOT EXISTS country ( code character(3) not null primary key, name text NOT NULL, continent text NOT NULL, region text NOT NULL, surfacearea real, indepyear smallint, population integer, lifeexpectancy real, gnp numeric(10,2), gnpold numeric(10,2), capital integer, code2 character(2) ); -- Update one value in one row. update Album set Title = "Balls in a Glass" where AlbumId=2 -- Update multiple values in one row. update customer set Firstname = "Bozo",lastname="clown" where customerId=2 -- Update multiple values in multiple rows. update customer set Firstname = "Bozo",lastname="clown" where customerId<3 -- Update values in rows using a subquery -- For example, set all country populations to 1000000 where the populations are larger than the population of South Africa update country set populaton=1000000 where population >() select sum(population) from country where region like "southern africa" ) order by population desc --DELETE -- Delete a row from a table. DELETE FROM country WHERE code="CHN"; -- Delete all rows from the table. DELTE FROM country where code is not null -- Undo the operation. (Just kidding--you can't undo a delete!) --JOINS -- Now we're going to need related tables. Copy the statements from world.sql into chinook in order to get started. -- You should see three tables. These tables share one value, the country code. We can use this code to join the tables and provide combined data. -- Begin by joining the country table to the countrylanguage table. select * from country join countrylanguage on code=countrycode -- Now join the city table to the country table. select * from country join city on code=countrycode -- Finally, join all three (I'd just include one column from each) so you can see every language for every city in every country. (Note: this isn't exactly accurate. The country's langauges may not be spoken in every city.) select country.name, city.name, countrylanguage.language from country join city on code=city.countrycode join countrylanguage on code=countrylanguage.countrycode --CALCULATIONS, AGGREGATIONS, and JOINS -- Okay, now that you have the mechanics down, let's see what we can find. -- Find the most populous capital cities. select country.name,city.name,city.population from country join city on capital=city.id order by city.population desc -- Find the languages which have the most number of speakers in any one nation. select country.name,countrylanguage.language, (percentage/100)*country.population AS speakers from country join countrylanguage on code=countrycode order by speakers desc -- Find the languages with the most number of speakers globally. select countrylanguage.language, sum((percentage/100)*country.population) AS speakers from country join countrylanguage on code=countrycode group by countrylanguage.language order by speakers desc -- List the countries with total_urban_population alongside their total population. For an extra challenge, try ranking the countries by the percentage of their population that is urban or rural. select country.name, sum(city.population) as Urban_Pop, country.population-sum(city.population) as Rural_Pop,country.population from country join city on code=countrycode group by country.name select country.name, (country.population-sum(city.population))/country.population*100 as Rur_per,sum(city.population) as Urban_Pop, country.population-sum(city.population) as Rural_Pop,country.population from country join city on code=countrycode group by country.name
true
e9fc350747b9c7329ab6e3f58e4dead417c7630b
SQL
vscherbo/sync-mod-versions
/dev-param-order.sql
UTF-8
794
3.671875
4
[]
no_license
SELECT 'SELECT * FROM crosstab(''' || 'SELECT mp.mod_id, mp.dev_param_id, p.param_id' || ' FROM devmod.modifications m, devmod.modif_param mp, devmod.dev_param dp, devmod.param p' || ' WHERE m.dev_id=mp.dev_id AND m.mod_id=mp.mod_id AND m.version_num=mp.version_num' || ' AND mp.dev_param_id=dp.dev_param_id AND mp.version_num=dp.version_num' || ' AND dp.dev_param_id=p.dev_param_id AND dp.version_num=p.version_num' || ' AND mp.param_id=p.param_id AND mp.version_num=p.version_num' || ' AND dp.dev_id=85 AND dp.version_num=1' || ' ORDER BY m.mod_id, mp.dev_param_id' || '''::TEXT) AS ct(mod_id character varying,' || string_agg( ' "' || dev_param_id || '" integer', ',' ORDER BY dev_param_id) || ');' FROM devmod.dev_param WHERE dev_id=85 AND version_num=1
true
71b8b25ff4f3b0f1fb59de8f03ad0be705701ecd
SQL
gxlimeng/gxlimeng-springmvc
/src/main/java/db/DB.SQL
UTF-8
19,573
3.59375
4
[]
no_license
/* Navicat MySQL Data Transfer Source Server : local Source Server Version : 50622 Source Host : localhost:3306 Source Database : gtrust Target Server Type : MYSQL Target Server Version : 50622 File Encoding : 65001 Date: 2017-01-13 18:03:21 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for app_user -- ---------------------------- DROP TABLE IF EXISTS `app_user`; CREATE TABLE `app_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `sso_id` varchar(30) NOT NULL, `password` varchar(100) NOT NULL, `first_name` varchar(30) NOT NULL, `last_name` varchar(30) NOT NULL, `email` varchar(30) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `sso_id` (`sso_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for app_user_user_profile -- ---------------------------- DROP TABLE IF EXISTS `app_user_user_profile`; CREATE TABLE `app_user_user_profile` ( `user_id` bigint(20) NOT NULL, `user_profile_id` bigint(20) NOT NULL, PRIMARY KEY (`user_id`,`user_profile_id`), KEY `FK_USER_PROFILE` (`user_profile_id`), CONSTRAINT `FK_APP_USER` FOREIGN KEY (`user_id`) REFERENCES `app_user` (`id`), CONSTRAINT `FK_USER_PROFILE` FOREIGN KEY (`user_profile_id`) REFERENCES `user_profile` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for example -- ---------------------------- DROP TABLE IF EXISTS `example`; CREATE TABLE `example` ( `EXP_ID` int(11) NOT NULL, `EXP_NAME` varchar(100) DEFAULT NULL, `EXP_SEX` varchar(5) DEFAULT NULL, `EXP_DATE` date DEFAULT NULL, `EXP_YN` varchar(1) DEFAULT NULL, `INSERT_ID` varchar(20) DEFAULT NULL, `INSERT_DATE` datetime DEFAULT NULL, `MODIFY_ID` varchar(20) DEFAULT NULL, `MODIFY_DATE` datetime DEFAULT NULL, `LAST_VERSION` bigint(10) DEFAULT NULL, PRIMARY KEY (`EXP_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='实例'; -- ---------------------------- -- Table structure for sys_menu -- ---------------------------- DROP TABLE IF EXISTS `sys_menu`; CREATE TABLE `sys_menu` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户编号', `name` varchar(50) NOT NULL COMMENT '菜单名', `ename` varchar(50) NOT NULL COMMENT '英文菜单名', `depth` int(1) NOT NULL COMMENT '菜单深度', `url` varchar(20) NOT NULL COMMENT '角色类型', `controller` varchar(20) DEFAULT NULL COMMENT '角色类型', `method` varchar(20) DEFAULT NULL COMMENT '角色类型', `parent_id` int(11) DEFAULT NULL COMMENT '角色类型', `use_yn` int(1) NOT NULL COMMENT '使用与否是否可用,"1:启用,2:禁用,9:废弃', `sort` varchar(2) NOT NULL COMMENT '排序(同级)', `remark` varchar(100) NOT NULL COMMENT '备注', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10002 DEFAULT CHARSET=utf8 COMMENT='菜单表'; -- ---------------------------- -- Table structure for sys_role -- ---------------------------- DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户编号', `name` varchar(50) NOT NULL COMMENT '角色名', `status` varchar(2) NOT NULL COMMENT '角色状态', `type` varchar(2) NOT NULL COMMENT '角色类型', `remark` varchar(50) NOT NULL COMMENT '备注', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10002 DEFAULT CHARSET=utf8 COMMENT='角色表'; -- ---------------------------- -- Table structure for sys_role_menu -- ---------------------------- DROP TABLE IF EXISTS `sys_role_menu`; CREATE TABLE `sys_role_menu` ( `role_id` int(11) NOT NULL COMMENT '角色编号', `menu_id` int(11) NOT NULL COMMENT '菜单编号', PRIMARY KEY (`role_id`,`menu_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色菜单表'; -- ---------------------------- -- Table structure for sys_user -- ---------------------------- DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户编号', `LOGIN_NAME` varchar(20) NOT NULL COMMENT '用户编码', `USER_NAME` varchar(30) NOT NULL COMMENT '用户名', `USER_PWD` varchar(36) NOT NULL COMMENT '用户密码', `USER_TEL` varchar(12) DEFAULT NULL COMMENT '用户手机', `USER_EMAIL` varchar(30) DEFAULT NULL COMMENT '用户电邮', `USER_STATUS` int(11) NOT NULL COMMENT '用户状态 0-初始化 1-正常使用 2-异常', `USER_TYPE` varchar(2) DEFAULT NULL, `PARENT_ID` int(11) DEFAULT NULL COMMENT '父ID', `COMMONS` varchar(100) DEFAULT NULL COMMENT '备注', `LAST_LOGIN_TIME` datetime DEFAULT NULL COMMENT '最后登陆时间', `LAST_UPDATE_PWD_DATE` date DEFAULT NULL COMMENT '最后密码修改日', `INSERT_ID` int(11) NOT NULL, `INSERT_DATE` datetime NOT NULL, `MODIFY_ID` int(11) DEFAULT NULL, `MODIFY_DATE` datetime DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `IDX_USERS_01` (`LOGIN_NAME`), UNIQUE KEY `IDX_USERS_02` (`USER_TEL`), UNIQUE KEY `IDX_USERS_03` (`USER_EMAIL`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='用户表'; -- ---------------------------- -- Table structure for sys_user_role -- ---------------------------- DROP TABLE IF EXISTS `sys_user_role`; CREATE TABLE `sys_user_role` ( `user_id` int(11) NOT NULL COMMENT '用户编号', `role_id` int(11) NOT NULL COMMENT '角色编号', PRIMARY KEY (`user_id`,`role_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色表'; -- ---------------------------- -- Table structure for taccount -- ---------------------------- DROP TABLE IF EXISTS `taccount`; CREATE TABLE `taccount` ( `CUST_NO` varchar(15) NOT NULL COMMENT '账号', `AMT` double(10,0) NOT NULL COMMENT '剩余金额', `INSERT_ID` varchar(10) NOT NULL, `INSERT_DATE` date NOT NULL, `MODIFY_ID` varchar(10) DEFAULT NULL, `MODIFY_DATE` date DEFAULT NULL, PRIMARY KEY (`CUST_NO`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='顾客账号'; -- ---------------------------- -- Table structure for taccount_record -- ---------------------------- DROP TABLE IF EXISTS `taccount_record`; CREATE TABLE `taccount_record` ( `ACCOUNT_NO` varchar(15) NOT NULL COMMENT '账号', `ACCOUNT_SEQ` varchar(6) NOT NULL COMMENT '账号操作SEQ', `OPER_TYPE` varchar(3) NOT NULL, `OPER_REL_ACCOUNT` varchar(255) NOT NULL, `OPER_AMT` double NOT NULL, `REMI_AMT` double NOT NULL, `INSERT_ID` varchar(255) NOT NULL, `INSERT_DATE` date NOT NULL, PRIMARY KEY (`ACCOUNT_NO`,`ACCOUNT_SEQ`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账号金额变更记录'; -- ---------------------------- -- Table structure for tcode -- ---------------------------- DROP TABLE IF EXISTS `tcode`; CREATE TABLE `tcode` ( `CODE_LGROUP` varchar(4) NOT NULL COMMENT '大分类', `CODE_MGROUP` varchar(20) NOT NULL COMMENT '中分类', `CODE_NAME` varchar(50) DEFAULT NULL COMMENT '分类名', `CODE_GROUP` varchar(50) DEFAULT NULL COMMENT '分类组', `CODE_TYPE` varchar(20) DEFAULT NULL COMMENT '分类类型', `CODE_SORT` int(11) NOT NULL, `USE_YN` varchar(1) NOT NULL COMMENT '是否使用', `INSERT_ID` varchar(20) NOT NULL, `INSERT_DATE` date NOT NULL, `CODE_TAG02` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG03` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG04` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG05` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG06` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG07` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG08` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG09` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG10` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG11` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG22` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG13` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG14` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG15` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG16` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG17` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG18` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG19` varchar(20) DEFAULT NULL COMMENT '标签', `MODIFY_ID` varchar(20) DEFAULT NULL, `MODIFY_DATE` date DEFAULT NULL, `CODE_TAG` varchar(20) DEFAULT NULL COMMENT '标签', `CODE_TAG01` varchar(20) DEFAULT NULL COMMENT '标签', PRIMARY KEY (`CODE_LGROUP`,`CODE_MGROUP`), KEY `IDX_TCODE_01` (`CODE_LGROUP`,`CODE_MGROUP`,`USE_YN`), KEY `IDX_TCODE_02` (`CODE_LGROUP`), KEY `IDX_TCODE_03` (`CODE_NAME`), KEY `IDX_TCODE_04` (`CODE_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='TCODE字典表'; -- ---------------------------- -- Table structure for tcode_explain -- ---------------------------- DROP TABLE IF EXISTS `tcode_explain`; CREATE TABLE `tcode_explain` ( `CODE_LGROUP` varchar(4) NOT NULL COMMENT '大分类', `CODE_MGROUP` varchar(50) NOT NULL, `CODE_NAME` varchar(50) DEFAULT NULL COMMENT '分类名', `CODE_GROUP` varchar(50) DEFAULT NULL COMMENT '分类组', `CODE_TYPE` varchar(50) DEFAULT NULL COMMENT '分类类型', `USE_YN` varchar(1) NOT NULL COMMENT '是否使用', `INSERT_ID` varchar(20) NOT NULL, `INSERT_DATE` date NOT NULL, `CODE_TAG` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG01` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG02` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG03` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG04` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG05` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG06` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG07` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG08` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG09` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG10` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG11` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG22` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG13` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG14` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG15` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG16` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG17` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG18` varchar(50) DEFAULT NULL COMMENT '标签', `CODE_TAG19` varchar(50) DEFAULT NULL COMMENT '标签', `MODIFY_ID` varchar(20) DEFAULT NULL, `MODIFY_DATE` date DEFAULT NULL, PRIMARY KEY (`CODE_LGROUP`), KEY `IDX_TCODE_EXPLAIN_01` (`CODE_LGROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='TCODE表字段描述/说明'; -- ---------------------------- -- Table structure for tcustomer -- ---------------------------- DROP TABLE IF EXISTS `tcustomer`; CREATE TABLE `tcustomer` ( `CUST_NO` varchar(14) NOT NULL DEFAULT '' COMMENT '顾客编号(年月日+SEQ)', `CUST_CODE` varchar(20) NOT NULL COMMENT '顾客编码(登录名)', `CUST_NAME` varchar(20) NOT NULL COMMENT '顾客名', `CUST_PWD` varchar(36) NOT NULL COMMENT '密码', `CUST_TEL` varchar(20) DEFAULT NULL COMMENT '手机', `CUST_EMAIL` varchar(20) DEFAULT NULL COMMENT '电子邮箱', PRIMARY KEY (`CUST_NO`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='顾客基础信息表'; -- ---------------------------- -- Table structure for terrorlog -- ---------------------------- DROP TABLE IF EXISTS `terrorlog`; CREATE TABLE `terrorlog` ( `ERR_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '错误ID - 主键', `ERR_NAME` varchar(255) NOT NULL COMMENT '错误', `ERR_TYPE` varchar(50) NOT NULL COMMENT '错误类型', `ERR_CLASS` varchar(255) NOT NULL COMMENT '错误促发类', `ERR_EXCEPTION` varchar(255) NOT NULL COMMENT '错误异常(简述)', `ERR_MSG` varchar(5000) NOT NULL COMMENT '错误描述', `ERR_DATE` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '错误日期', PRIMARY KEY (`ERR_ID`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for titem -- ---------------------------- DROP TABLE IF EXISTS `titem`; CREATE TABLE `titem` ( `item_code` varchar(8) NOT NULL DEFAULT '' COMMENT '商品编码', `item_name` varchar(50) DEFAULT NULL COMMENT '商品名称', PRIMARY KEY (`item_code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for titemprice -- ---------------------------- DROP TABLE IF EXISTS `titemprice`; CREATE TABLE `titemprice` ( `item_code` varchar(8) NOT NULL COMMENT '商品编码', `unit_code` varchar(3) NOT NULL COMMENT '单件编码', `sale_price` double NOT NULL DEFAULT '0' COMMENT '销售价(含税)', `sale_cost` double NOT NULL DEFAULT '0' COMMENT '销售价(无税)', `sale_vat` double NOT NULL DEFAULT '0' COMMENT '销售税额', `sale_rate` double NOT NULL DEFAULT '0' COMMENT '销售税率', `buy_price` double NOT NULL DEFAULT '0' COMMENT '采购价(含税)', `buy_cost` double NOT NULL DEFAULT '0' COMMENT '采购价(无税)', `buy_vat` double NOT NULL DEFAULT '0' COMMENT '采购税额', `buy_rate` double NOT NULL DEFAULT '0' COMMENT '采购税率', PRIMARY KEY (`item_code`,`unit_code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for tmenu -- ---------------------------- DROP TABLE IF EXISTS `tmenu`; CREATE TABLE `tmenu` ( `MENU_ID` int(11) NOT NULL COMMENT '菜单ID', `MENU_PAGE_URL` varchar(45) DEFAULT NULL COMMENT '菜单页面地址', `MENU_NAME` varchar(45) DEFAULT NULL COMMENT '菜单名', `CTRL_CLASS` varchar(45) DEFAULT NULL COMMENT '菜单对应的控制类', `CTRL_METHOD` varchar(45) DEFAULT NULL COMMENT '菜单对应的控制类方法', `MENU_LEVEL` varchar(45) DEFAULT NULL COMMENT '菜单层级', `MENU_STATUS` varchar(45) DEFAULT NULL COMMENT '菜单状态', `MENU_ORDERBY` varchar(45) DEFAULT NULL COMMENT '菜单排序', `P_MENU_ID` int(11) DEFAULT NULL COMMENT '父菜单', PRIMARY KEY (`MENU_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='菜单表'; -- ---------------------------- -- Table structure for tprojectd -- ---------------------------- DROP TABLE IF EXISTS `tprojectd`; CREATE TABLE `tprojectd` ( `PRJ_NO` varchar(14) NOT NULL COMMENT '项目编号', `PRJ_SEQ` varchar(3) NOT NULL COMMENT '项目SEQ', `PRJ_DNAME` varchar(100) DEFAULT NULL COMMENT '子项目名', `PLAN_START_DATE` date NOT NULL COMMENT '计划开始日', `PLAN_END_DATE` date NOT NULL COMMENT '计划完成日', `DEV_FIN_DATE` date DEFAULT NULL COMMENT '开发完成日', `TEST_FIN_DATE` date DEFAULT NULL COMMENT '测试完成日', `ONLINE_DATE` date DEFAULT NULL COMMENT '上线时间', `PRJ_NOTE` varchar(200) DEFAULT NULL COMMENT '项目描述', `KPI_LEVEL` varchar(2) DEFAULT NULL COMMENT 'KPI等级', `KPI_REASON` varchar(60) DEFAULT NULL COMMENT 'KPI考核原因', `DEV_USER` varchar(20) DEFAULT NULL COMMENT '开发人', `DIFFICULT_LEVEL` varchar(2) DEFAULT NULL COMMENT '困难等级', `END_STATUS` varchar(8) DEFAULT NULL COMMENT '结果状态', `END_NOTE` varchar(100) DEFAULT NULL COMMENT '处理结果-原因说明', PRIMARY KEY (`PRJ_NO`,`PRJ_SEQ`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目子表'; -- ---------------------------- -- Table structure for tprojectm -- ---------------------------- DROP TABLE IF EXISTS `tprojectm`; CREATE TABLE `tprojectm` ( `PRJ_NO` varchar(14) NOT NULL COMMENT '项目编号(年月日+编号)', `PRJ_NAME` varchar(60) NOT NULL COMMENT '项目名称', `PLAN_START_DATE` date NOT NULL COMMENT '项目预计开始日', `PLAN_END_DATE` date NOT NULL COMMENT '项目预计上线日', `ACT_START_DATE` date DEFAULT NULL COMMENT '实际开发日', `ACT_END_DATE` date DEFAULT NULL COMMENT '实际完成日', `PRJ_NOTE` varchar(200) DEFAULT NULL COMMENT '项目描述', `KPI_LEVEL` varchar(2) DEFAULT NULL COMMENT 'KPI考评级别', `KPI_REASON` varchar(60) DEFAULT NULL COMMENT 'KPI考评原因', PRIMARY KEY (`PRJ_NO`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目表'; -- ---------------------------- -- Table structure for tstock -- ---------------------------- DROP TABLE IF EXISTS `tstock`; CREATE TABLE `tstock` ( `wh_code` varchar(3) NOT NULL COMMENT '仓库', `item_code` varchar(8) NOT NULL COMMENT '商品编码', `unit_code` varchar(3) NOT NULL COMMENT '单件编码', `qty` int(11) NOT NULL COMMENT '库存数量', `oper_grogram` varchar(20) NOT NULL COMMENT '操作程序', `insert_id` varchar(20) NOT NULL, `insert_date` date NOT NULL, `modify_id` varchar(20) DEFAULT NULL, `modify_date` date DEFAULT NULL, PRIMARY KEY (`wh_code`,`item_code`,`unit_code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for tunit -- ---------------------------- DROP TABLE IF EXISTS `tunit`; CREATE TABLE `tunit` ( `item_code` varchar(8) NOT NULL COMMENT '商品编码', `unit_code` varchar(3) NOT NULL COMMENT '单件编码', `unit_name` varchar(50) NOT NULL COMMENT '单件名', PRIMARY KEY (`item_code`,`unit_code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for tusermenu -- ---------------------------- DROP TABLE IF EXISTS `tusermenu`; CREATE TABLE `tusermenu` ( `USER_ID` int(11) NOT NULL, `MENU_ID` int(11) NOT NULL, PRIMARY KEY (`USER_ID`,`MENU_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户菜单表'; -- ---------------------------- -- Table structure for tusers -- ---------------------------- DROP TABLE IF EXISTS `tusers`; CREATE TABLE `tusers` ( `USER_ID` int(11) NOT NULL COMMENT '用户编号', `USER_CODE` varchar(20) NOT NULL COMMENT '用户编码', `USER_TEL` varchar(12) DEFAULT NULL COMMENT '用户手机', `USER_EMAIL` varchar(30) DEFAULT NULL COMMENT '用户电邮', `USER_PWD` varchar(36) NOT NULL COMMENT '用户密码', `USER_NAME` varchar(30) NOT NULL COMMENT '用户名', `USER_STATUS` int(11) NOT NULL COMMENT '用户状态 0-初始化 1-正常使用 2-异常', `COMMONS` varchar(100) DEFAULT NULL COMMENT '备注', `LAST_LOGIN_TIME` datetime DEFAULT NULL COMMENT '最后登陆时间', `LAST_UPDATE_PWD_DATE` date DEFAULT NULL COMMENT '最后密码修改日', `INSERT_ID` varchar(20) NOT NULL, `INSERT_DATE` datetime NOT NULL, `MODIFY_ID` varchar(20) DEFAULT NULL, `MODIFY_DATE` datetime DEFAULT NULL, `LAST_VERSION` bigint(20) NOT NULL COMMENT '最后更新版本号', PRIMARY KEY (`USER_ID`), UNIQUE KEY `IDX_USERS_01` (`USER_CODE`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表'; -- ---------------------------- -- Table structure for user_profile -- ---------------------------- DROP TABLE IF EXISTS `user_profile`; CREATE TABLE `user_profile` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `type` varchar(30) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `type` (`type`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- ---------------------------- -- Procedure structure for temp -- ---------------------------- DROP PROCEDURE IF EXISTS `temp`; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `temp`() BEGIN declare i int default 10; begin loop_for :loop INSERT INTO `gtrust`.`example` (`EXP_ID`, `EXP_NAME`, `EXP_SEX`, `EXP_DATE`, `EXP_YN`, `INSERT_ID`, `INSERT_DATE`, `MODIFY_ID`, `MODIFY_DATE`, `LAST_VERSION`) VALUES (i, i, i, '20161215', 1, i, '20161215', i, '20161215', 1); set i= i+1; if(i>10000) then leave loop_for; end if; end loop; end; END ;; DELIMITER ;
true
101907950c4708f1a2967c73adf3e774d00cd00c
SQL
D4rk1ink/Online-Book-Rental-System
/SQL/shopsystem.sql
UTF-8
6,666
3.40625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Nov 07, 2016 at 03:26 PM -- Server version: 10.1.10-MariaDB -- PHP Version: 5.6.19 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: `shopsystem` -- -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE `admin` ( `AdminId` varchar(20) NOT NULL, `Email` varchar(100) NOT NULL, `Password` varchar(15) NOT NULL, `LastLogin` datetime DEFAULT NULL, `FirstName` varchar(30) DEFAULT NULL, `LastName` varchar(30) DEFAULT NULL, `Phone` varchar(15) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`AdminId`, `Email`, `Password`, `LastLogin`, `FirstName`, `LastName`, `Phone`) VALUES ('1920000000000', 'admin@mail.com', '1234', NULL, 'FirstName', 'LastName', '0900000000'); -- -------------------------------------------------------- -- -- Table structure for table `books` -- CREATE TABLE `books` ( `BookId` int(7) NOT NULL, `BookName` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `CategoryId` varchar(10) DEFAULT NULL, `Note` varchar(200) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `books` -- INSERT INTO `books` (`BookId`, `BookName`, `CategoryId`, `Note`) VALUES (3, 'The Art of Movement', '11', NULL), (4, 'Ansel Adams 2017 Wall Calendar', '11', NULL), (5, 'Slim Aarons: Women', '11', NULL), (6, 'The Food Lab: Better Home Cooking Through Science', '12', NULL), (7, 'Cravings: Recipes for All the Food You Want to Eat', '12', NULL), (8, 'Six of Crows', '13', NULL), (9, 'The Last Star: The Final Book of The 5th Wave', '13', NULL), (10, 'A Knight of the Seven Kingdoms', '13', NULL), (11, 'Naruto', '16', ''); -- -------------------------------------------------------- -- -- Table structure for table `category` -- CREATE TABLE `category` ( `CategoryId` int(5) NOT NULL, `CategoryName` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `category` -- INSERT INTO `category` (`CategoryId`, `CategoryName`) VALUES (11, 'Arts & Photography'), (12, 'Cookbooks, Food & Wine'), (13, 'Science Fiction & Fantasy'), (15, 'History'), (16, 'Cartoon'); -- -------------------------------------------------------- -- -- Table structure for table `chapter` -- CREATE TABLE `chapter` ( `ChapterId` int(10) NOT NULL, `BookId` int(7) NOT NULL, `No` int(5) DEFAULT NULL, `Price` double(5,2) DEFAULT NULL, `Quantity` int(5) DEFAULT NULL, `ChapterName` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `chapter` -- INSERT INTO `chapter` (`ChapterId`, `BookId`, `No`, `Price`, `Quantity`, `ChapterName`) VALUES (1000000069, 3, 1, 36.10, 51, 'The Art of Movement'), (1000000070, 4, 1, 14.77, 100, 'Ansel Adams 2017 Wall Calendar'), (1000000071, 5, 1, 18.49, 80, 'Slim Aarons: Women'), (1000000072, 6, 1, 27.55, 100, 'The Food Lab: Better Home Cooking Through Science No.1'), (1000000073, 6, 1, 27.55, 100, 'The Food Lab: Better Home Cooking Through Science No.2'), (1000000074, 7, 1, 15.99, 30, 'Cravings: Recipes for All the Food You Want to Eat'), (1000000075, 8, 1, 5.07, 100, 'Six of Crows: Book 1'), (1000000076, 8, 2, 5.07, 100, 'Six of Crows: Book 2'), (1000000077, 8, 3, 5.07, 100, 'Six of Crows: Book 3'), (1000000078, 9, 1, 10.99, 100, 'The Last Star: The Final Book of The 5th Wave'), (1000000079, 10, 1, 15.99, 100, 'A Knight of the Seven Kingdoms'), (1000000080, 11, 1, 21.50, 100, 'Naruto No.1'), (1000000081, 11, 2, 20.50, 200, 'Naruto No.2'); -- -------------------------------------------------------- -- -- Table structure for table `login` -- CREATE TABLE `login` ( `UserId` varchar(20) NOT NULL, `Password` varchar(15) NOT NULL, `LastLogin` datetime DEFAULT NULL, `Email` varchar(15) NOT NULL, `Level` varchar(5) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `rental` -- CREATE TABLE `rental` ( `UserId` varchar(20) NOT NULL, `ChapterId` int(10) NOT NULL, `Quantity` int(2) NOT NULL, `DateRental` date NOT NULL, `RentalId` int(10) NOT NULL, `Status` tinyint(1) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `rental` -- -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `FirstName` varchar(30) DEFAULT NULL, `LastName` varchar(30) DEFAULT NULL, `Birthday` date DEFAULT NULL, `Address` varchar(200) DEFAULT NULL, `Phone` varchar(15) DEFAULT NULL, `Email` varchar(100) DEFAULT NULL, `UserId` varchar(20) NOT NULL, `Gender` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- -- -- Indexes for dumped tables -- -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`AdminId`); -- -- Indexes for table `books` -- ALTER TABLE `books` ADD PRIMARY KEY (`BookId`); -- -- Indexes for table `category` -- ALTER TABLE `category` ADD PRIMARY KEY (`CategoryId`); -- -- Indexes for table `chapter` -- ALTER TABLE `chapter` ADD PRIMARY KEY (`ChapterId`); -- -- Indexes for table `login` -- ALTER TABLE `login` ADD PRIMARY KEY (`UserId`); -- -- Indexes for table `rental` -- ALTER TABLE `rental` ADD PRIMARY KEY (`RentalId`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`UserId`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `books` -- ALTER TABLE `books` MODIFY `BookId` int(7) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `category` -- ALTER TABLE `category` MODIFY `CategoryId` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; -- -- AUTO_INCREMENT for table `chapter` -- ALTER TABLE `chapter` MODIFY `ChapterId` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1000000082; -- -- AUTO_INCREMENT for table `rental` -- ALTER TABLE `rental` MODIFY `RentalId` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; /*!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
a135ea02a971343bbe77b4deec7d539cc4af1350
SQL
NoraCarey/Leetcode-SQL
/SQL/0569. Median Employee Salary/mysql_count_window_function.sql
UTF-8
790
4.25
4
[]
no_license
# Window Function COUNT() calculates the number of employees in each company # Window Function ROW_NUMBER() records the salary ranking for each employee in each company SELECT Id, Company, Salary FROM (SELECT Id, Company, Salary, COUNT(Salary) OVER(PARTITION BY Company) AS count_num, ROW_NUMBER() OVER(PARTITION BY Company ORDER BY Salary) AS ranking FROM Employee) tbl # select the employees have the median salary in each company # if company have the odd number employees, floor() and ceil() will return to the same number # if company have the even number employees, floor() and ceil() will return to two consecutive numbers WHERE ranking = FLOOR((count_num + 1) / 2) OR ranking = CEIL((count_num + 1) / 2);
true
cac86989fdc4c1b3cde53c7855c0bb5dd83f4c32
SQL
neouzer12/VirtualHG
/vhg.sql
UTF-8
1,853
3.375
3
[]
no_license
-- Adminer 4.2.5 MySQL dump SET NAMES utf8; SET time_zone = '+00:00'; SET foreign_key_checks = 0; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; DROP DATABASE IF EXISTS `virtualhg`; CREATE DATABASE `virtualhg` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `virtualhg`; DROP TABLE IF EXISTS `categories`; CREATE TABLE `categories` ( `category_id` int(11) NOT NULL AUTO_INCREMENT, `category_name` varchar(255) NOT NULL, PRIMARY KEY (`category_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `categories` (`category_id`, `category_name`) VALUES (1, 'Lorem ipsum'); DROP TABLE IF EXISTS `tips`; CREATE TABLE `tips` ( `tip_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `tip_title` varchar(255) NOT NULL, `tip_content` longtext NOT NULL, `category_id` int(10) unsigned NOT NULL, `tip_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`tip_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `tips` (`tip_id`, `tip_title`, `tip_content`, `category_id`, `tip_time`) VALUES (1, 'This will be displayed in Markdown.', '# This will be displayed in Markdown.\r\n## This is the second header.\r\n### This is the third.\r\n> I just quote you.\r\n### Another section\r\n- Unordered list\r\n- Unordered list 2\r\n### Yet another\r\n1. Numbered list\r\n2. Numbered list 2\r\n', 1, '2017-11-09 04:57:19'), (2, 'Writing in Markdown', '# Writing in Markdown\nWriting in Markdown is **easy**!', 1, '2017-11-10 02:46:37'); DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `usr` varchar(32) NOT NULL, `pwd` varchar(64) NOT NULL, `permission` smallint(1) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `users` (`user_id`, `usr`, `pwd`, `permission`) VALUES (1, 'admin', '148DE9C5A7A44D19E56CD9AE1A554BF67847AFB0C58F6E12FA29AC7DDFCA9940', 0); -- 2017-11-10 03:05:27
true
a2aea161da88e7786584fa96f4e0ef4752b8f42a
SQL
erwinmacaraig/perl-cig-prj
/db_setup/new_realm/singapore/new.userauth.setup.sql
UTF-8
663
3.203125
3
[]
no_license
SET @strRealmName="Singapore", @strStatus="ACTIVE", @intEntityLevel="100"; /** Retrieve target realm id **/ SELECT @intRealmID:=intRealmID FROM tblRealms WHERE strRealmName = @strRealmName; /** Load User Acces Files **/ LOAD DATA LOCAL INFILE '/home/jescoto/src/FIFASPOnline/db_setup/new_realm/singapore/ref_data/tblUserAuth.csv' INTO TABLE tblUserAuth FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 ROWS ( userId, entityTypeId, @entityId ) /** SET data manipulation here**/ SET entityId = (SELECT @intEntityID:=intEntityID FROM tblEntity WHERE intRealmID = @intRealmID AND strLocalName = @entityId) ;
true
ff15a932569694fbd0535b2d65ac0caef22495f4
SQL
Rodrivilas/exportBasesDeDatosxd
/cuarentenaRV.sql
UTF-8
7,273
3.09375
3
[]
no_license
-- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64) -- -- Host: localhost Database: cuarentena -- ------------------------------------------------------ -- Server version 8.0.19 /*!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 */; /*!50503 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 `consulta` -- DROP TABLE IF EXISTS `consulta`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `consulta` ( `PacienteID` int NOT NULL, `DoctorID` int NOT NULL, `fecha` datetime DEFAULT NULL, PRIMARY KEY (`PacienteID`,`DoctorID`), KEY `DoctorID` (`DoctorID`), CONSTRAINT `consulta_ibfk_1` FOREIGN KEY (`PacienteID`) REFERENCES `paciente` (`ID`), CONSTRAINT `consulta_ibfk_2` FOREIGN KEY (`DoctorID`) REFERENCES `doctor` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `consulta` -- LOCK TABLES `consulta` WRITE; /*!40000 ALTER TABLE `consulta` DISABLE KEYS */; INSERT INTO `consulta` VALUES (1,1,'2020-03-17 00:00:00'),(2,2,'2020-03-17 00:00:00'),(3,3,'2020-08-27 00:00:00'),(4,4,'2020-05-22 00:00:00'),(5,5,'2020-06-14 00:00:00'); /*!40000 ALTER TABLE `consulta` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `consultorio` -- DROP TABLE IF EXISTS `consultorio`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `consultorio` ( `ID` int NOT NULL AUTO_INCREMENT, `piso` int NOT NULL, `nro` int NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `consultorio` -- LOCK TABLES `consultorio` WRITE; /*!40000 ALTER TABLE `consultorio` DISABLE KEYS */; INSERT INTO `consultorio` VALUES (1,1,101),(2,1,202),(3,1,102),(4,3,222),(5,2,123); /*!40000 ALTER TABLE `consultorio` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `doctor` -- DROP TABLE IF EXISTS `doctor`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `doctor` ( `ID` int NOT NULL AUTO_INCREMENT, `personaID` int NOT NULL, `consultorioID` int NOT NULL, `especialidadID` int NOT NULL, PRIMARY KEY (`ID`), KEY `personaID` (`personaID`), KEY `consultorioID` (`consultorioID`), KEY `especialidadID` (`especialidadID`), CONSTRAINT `doctor_ibfk_1` FOREIGN KEY (`personaID`) REFERENCES `persona` (`CI`), CONSTRAINT `doctor_ibfk_2` FOREIGN KEY (`consultorioID`) REFERENCES `consultorio` (`ID`), CONSTRAINT `doctor_ibfk_3` FOREIGN KEY (`especialidadID`) REFERENCES `especialidad` (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `doctor` -- LOCK TABLES `doctor` WRITE; /*!40000 ALTER TABLE `doctor` DISABLE KEYS */; INSERT INTO `doctor` VALUES (1,10933055,1,1),(2,90445050,2,2),(3,15593420,3,3),(4,22309568,4,4),(5,24798405,5,5); /*!40000 ALTER TABLE `doctor` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `especialidad` -- DROP TABLE IF EXISTS `especialidad`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `especialidad` ( `ID` int NOT NULL AUTO_INCREMENT, `nombre` varchar(30) DEFAULT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `especialidad` -- LOCK TABLES `especialidad` WRITE; /*!40000 ALTER TABLE `especialidad` DISABLE KEYS */; INSERT INTO `especialidad` VALUES (1,'Pediatría'),(2,'Ginecología'),(3,'Odontología'),(4,'Dermatología'),(5,'Cirujano plastico'); /*!40000 ALTER TABLE `especialidad` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `paciente` -- DROP TABLE IF EXISTS `paciente`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `paciente` ( `ID` int NOT NULL AUTO_INCREMENT, `personaID` int NOT NULL, `fechaIngreso` datetime DEFAULT NULL, PRIMARY KEY (`ID`), KEY `personaID` (`personaID`), CONSTRAINT `paciente_ibfk_1` FOREIGN KEY (`personaID`) REFERENCES `persona` (`CI`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `paciente` -- LOCK TABLES `paciente` WRITE; /*!40000 ALTER TABLE `paciente` DISABLE KEYS */; INSERT INTO `paciente` VALUES (1,42069021,'2020-03-17 00:00:00'),(2,88596969,'2019-07-19 00:00:00'),(3,20667035,'2019-03-25 00:00:00'),(4,22102344,'2020-02-12 00:00:00'),(5,10994066,'2020-02-21 00:00:00'); /*!40000 ALTER TABLE `paciente` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `persona` -- DROP TABLE IF EXISTS `persona`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `persona` ( `CI` int NOT NULL, `nombres` varchar(30) DEFAULT NULL, `apellidos` varchar(30) DEFAULT NULL, `fechaNacimiento` datetime DEFAULT NULL, PRIMARY KEY (`CI`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `persona` -- LOCK TABLES `persona` WRITE; /*!40000 ALTER TABLE `persona` DISABLE KEYS */; INSERT INTO `persona` VALUES (10933055,'Rodrigo','Viladegut Alurralde','2000-05-09 00:00:00'),(10994066,'Ignacio','Lizarazu Aramayo','1999-07-29 00:00:00'),(15593420,'Ignacio','Valencia Sauma','2000-12-04 00:00:00'),(20667035,'Michael','Jackson Choque','1977-09-23 00:00:00'),(22102344,'Manuel','Mollinedo Gorayeb','2000-12-24 00:00:00'),(22309568,'Ricardo','Tejerina Flores','2000-08-08 00:00:00'),(24798405,'Fabian','Segurondo Ferrel','1998-05-25 00:00:00'),(42069021,'Juan','Tordoya Taquichiri','2020-04-19 00:00:00'),(88596969,'Jaimito','Cortez Salazar','2001-06-21 00:00:00'),(90445050,'Manuel','Valenzuela Degadillo','2001-01-12 00:00:00'); /*!40000 ALTER TABLE `persona` 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-03-17 16:20:35
true
9742fba1275003ae190bf9af9f63739eca0b8bc9
SQL
macbre/index-digest
/sql/0032-utf-latin-columns.sql
UTF-8
1,088
3.234375
3
[ "MIT" ]
permissive
-- Report text columns that use non-utf collation -- -- https://github.com/macbre/index-digest/issues/32 DROP TABLE IF EXISTS `0032_utf8_table`; CREATE TABLE `0032_utf8_table` ( `item_id` int(9) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `latin_column` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, `big5_column` varchar(255) CHARACTER SET big5, `utf_blob` blob, PRIMARY KEY (`item_id`) ) CHARSET=utf8 COLLATE=utf8_polish_ci; DROP TABLE IF EXISTS `0032_latin1_table`; CREATE TABLE `0032_latin1_table` ( `item_id` int(9) NOT NULL AUTO_INCREMENT, `name` varchar(255), `utf8_column` varchar(255) CHARACTER SET utf8 COLLATE utf8_polish_ci NOT NULL, `ucs2_column` varchar(255) CHARACTER SET ucs2, `utf8mb4_column` varchar(255) CHARACTER SET utf8mb4, `utf16_column` varchar(255) CHARACTER SET utf16, -- `utf16le_column` varchar(255) CHARACTER SET utf16le, -- not supported by MySQL 5.5 `utf32_column` varchar(255) CHARACTER SET utf32, `binary_column` varchar(255) CHARACTER SET binary, `latin_blob` blob, PRIMARY KEY (`item_id`) ) CHARSET=latin1;
true
55bdc54a2af2e8967bb154182920e90797c37864
SQL
jdsee/today
/dataBankTableSetup.sql
UTF-8
1,355
3.453125
3
[]
no_license
DROP TABLE noteReferences; DROP TABLE notes; DROP TABLE attachments; DROP TABLE lectures; DROP TABLE sections; DROP TABLE tasks; DROP TABLE courses; DROP TABLE semesters; CREATE TABLE semesters (semesterID INTEGER PRIMARY KEY, semesterNr INTEGER); CREATE TABLE courses (courseID INTEGER PRIMARY KEY, name VARCHAR(128) NOT NULL, relatedTo INTEGER REFERENCES semesters ON DELETE CASCADE); CREATE TABLE tasks (taskID INTEGER PRIMARY KEY, deadline VARCHAR(16), content VARCHAR(128) NOT NULL, relatedTo INTEGER REFERENCES courses ON DELETE CASCADE); CREATE TABLE sections (sectionID INTEGER PRIMARY KEY, name VARCHAR(64), lecturer VARCHAR(64), relatedTo INTEGER REFERENCES courses ON DELETE CASCADE); CREATE TABLE lectures (lectureID INTEGER PRIMARY KEY, roomNr VARCHAR(32), startTime VARCHAR(16), endTime VARCHAR(16), lectureNr INTEGER, relatedTo INTEGER REFERENCES sections ON DELETE CASCADE); CREATE TABLE notes (noteID INTEGER PRIMARY KEY, title VARCHAR(64), content VARCHAR, relatedTo INTEGER REFERENCES lectures ON DELETE CASCADE); CREATE TABLE noteReferences (referenceID INTEGER PRIMARY KEY, row INTEGER, noteID INTEGER REFERENCES notes ON DELETE CASCADE); CREATE TABLE attachments (attachmentID INTEGER PRIMARY KEY, content VARCHAR, name VARCHAR, relatedTo INTEGER REFERENCES lectures ON DELETE CASCADE);
true
c8b64895dc29b842243e6f2760b4b202b48b1082
SQL
reeraaaay/Project
/kpop.sql
UTF-8
1,599
2.84375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 30, 2019 at 09:56 AM -- Server version: 10.4.8-MariaDB -- PHP Version: 7.3.11 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: `kpop` -- -- -------------------------------------------------------- -- -- Table structure for table `tusers` -- CREATE TABLE `tusers` ( `ID` int(255) UNSIGNED NOT NULL, `username` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `nickname` varchar(255) NOT NULL, `role` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- INSERT INTO `tusers` (`ID`, `username`, `password`, `nickname`, `role`) VALUES (NULL, 'jmgguia123', 'junguiang', 'Taehyung', 'Calculator'); -- -- Indexes for table `tusers` -- ALTER TABLE `tusers` ADD PRIMARY KEY (`ID`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tusers` -- ALTER TABLE `tusers` MODIFY `ID` int(255) UNSIGNED NOT NULL AUTO_INCREMENT; 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
52762a52dd2bcf4de670f0352210d38a6b769db6
SQL
wsgan001/Projects-2
/IDS521/NullValues_exercise_session4.sql
UTF-8
388
2.71875
3
[]
no_license
CREATE TABLE colors ( color VARCHAR(25) ); INSERT INTO colors VALUES ('Red'); /*insert into colors values('Blue');*/ insert into colors values('Green'); insert into colors values('Black'); insert into colors values(''); insert into colors values(null); Select * from colors where Color not in ('Blue', 'Black', null); Select * from colors where Color in ('Blue', 'Black', null);
true
167076ab55523be64b251f6c31ff9d61f9b5b963
SQL
MichaelKremser/cons2db
/sql/pgsql/systems.sql
UTF-8
348
3.203125
3
[ "MIT" ]
permissive
CREATE TABLE systems ( sys_id serial PRIMARY KEY, sys_name character varying(100) NOT NULL, sys_desc character varying(4000) ) WITH ( OIDS=FALSE ); COMMENT ON COLUMN systems.sys_name is 'System name, like a hostname or a metering point code'; COMMENT ON COLUMN systems.sys_desc is 'A human readable description of the system; can be NULL';
true
6ab7f8f55705992e2bd64dbc53b8d2fe0b3cd94d
SQL
guilhascorreia24/les
/database/db.sql
UTF-8
43,394
3.25
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 mydb -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema les -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema les -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `les` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ; USE `les` ; -- ----------------------------------------------------- -- Table `les`.`utilizador` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`utilizador` ( `idutilizador` INT NOT NULL AUTO_INCREMENT, `nome` VARCHAR(45) NOT NULL, `email` VARCHAR(45) NOT NULL, `telefone` VARCHAR(45) NOT NULL, `password` VARCHAR(45) NOT NULL, `userName` VARCHAR(45) NOT NULL, `validada` TINYINT NOT NULL DEFAULT 0, PRIMARY KEY (`idutilizador`), UNIQUE INDEX `email_UNIQUE` (`email` ASC) VISIBLE, UNIQUE INDEX `telefone_UNIQUE` (`telefone` ASC) VISIBLE) ENGINE = InnoDB AUTO_INCREMENT = 15 DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`administrador` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`administrador` ( `Utilizador_idutilizador` INT NOT NULL, PRIMARY KEY (`Utilizador_idutilizador`), CONSTRAINT `fk_Administrador_Utilizador` FOREIGN KEY (`Utilizador_idutilizador`) REFERENCES `les`.`utilizador` (`idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`campus` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`campus` ( `idCampus` INT NOT NULL AUTO_INCREMENT, `nome` VARCHAR(45) NOT NULL, PRIMARY KEY (`idCampus`)) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`espaco` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`espaco` ( `idespaco` INT NOT NULL AUTO_INCREMENT, `nome` VARCHAR(45) NOT NULL, `campus_idCampus` INT NOT NULL, PRIMARY KEY (`idespaco`), INDEX `fk_espaco_campus1_idx` (`campus_idCampus` ASC) VISIBLE, CONSTRAINT `fk_espaco_campus1` FOREIGN KEY (`campus_idCampus`) REFERENCES `les`.`campus` (`idCampus`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`anfiteatro` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`anfiteatro` ( `edificio` VARCHAR(45) NOT NULL, `andar` VARCHAR(45) NOT NULL, `espaco_idespaco` INT NOT NULL, PRIMARY KEY (`espaco_idespaco`), INDEX `fk_anfiteatro_espaco_id` (`espaco_idespaco` ASC) VISIBLE, CONSTRAINT `fk_anfiteatro_espaco` FOREIGN KEY (`espaco_idespaco`) REFERENCES `les`.`espaco` (`idespaco`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`arlivre` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`arlivre` ( `descricao` VARCHAR(45) NOT NULL, `espaco_idespaco` INT NOT NULL, PRIMARY KEY (`espaco_idespaco`), INDEX `fk_arlivre_espaco_id` (`espaco_idespaco` ASC) VISIBLE, CONSTRAINT `fk_arlivre_espaco` FOREIGN KEY (`espaco_idespaco`) REFERENCES `les`.`espaco` (`idespaco`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`unidade_organica` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`unidade_organica` ( `idUO` INT NOT NULL AUTO_INCREMENT, `sigla` VARCHAR(5) NOT NULL, `Campus_idCampus` INT NOT NULL, PRIMARY KEY (`idUO`), INDEX `fk_unidade_organica_Campus_id` (`Campus_idCampus` ASC) VISIBLE, CONSTRAINT `fk_unidade_organica_Campus` FOREIGN KEY (`Campus_idCampus`) REFERENCES `les`.`campus` (`idCampus`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`departamento` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`departamento` ( `idDepartamento` INT NOT NULL AUTO_INCREMENT, `nome` VARCHAR(45) NOT NULL, `unidade_organica_idUO` INT NOT NULL, PRIMARY KEY (`idDepartamento`), INDEX `fk_Departamento_unidade_organica_id` (`unidade_organica_idUO` ASC) VISIBLE, CONSTRAINT `fk_Departamento_unidade_organica` FOREIGN KEY (`unidade_organica_idUO`) REFERENCES `les`.`unidade_organica` (`idUO`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`professor_universitario` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`professor_universitario` ( `Utilizador_idutilizador` INT NOT NULL, `departamento_idDepartamento` INT NOT NULL, PRIMARY KEY (`Utilizador_idutilizador`), INDEX `fk_professor_universitario_departamento1_idx` (`departamento_idDepartamento` ASC) VISIBLE, CONSTRAINT `fk_professor_universitario_departamento1` FOREIGN KEY (`departamento_idDepartamento`) REFERENCES `les`.`departamento` (`idDepartamento`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_professor_universitario_Utilizador` FOREIGN KEY (`Utilizador_idutilizador`) REFERENCES `les`.`utilizador` (`idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`atividade` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`atividade` ( `idAtividade` INT NOT NULL AUTO_INCREMENT, `titulo` VARCHAR(45) NOT NULL, `capacidade` INT NOT NULL, `publico_alvo` VARCHAR(45) NOT NULL, `tematica` VARCHAR(45) NOT NULL, `duracao` FLOAT NOT NULL, `descricao` VARCHAR(250) NOT NULL, `ncolaboradores` INT NOT NULL, `validada` TINYINT NOT NULL DEFAULT 0, `professor_universitario_Utilizador_idutilizador` INT NOT NULL, `unidade_organica_idUO` INT NOT NULL, `Departamento_idDepartamento` INT NOT NULL, `espaco_idespaco` INT NULL DEFAULT NULL, PRIMARY KEY (`idAtividade`), INDEX `fk_Atividade_professor_universitario_id` (`professor_universitario_Utilizador_idutilizador` ASC) VISIBLE, INDEX `fk_Atividade_unidade_organica_id` (`unidade_organica_idUO` ASC) VISIBLE, INDEX `fk_Atividade_Departamento_id` (`Departamento_idDepartamento` ASC) VISIBLE, INDEX `fk_atividade_espaco1_idx` (`espaco_idespaco` ASC) VISIBLE, CONSTRAINT `fk_Atividade_Departamento` FOREIGN KEY (`Departamento_idDepartamento`) REFERENCES `les`.`departamento` (`idDepartamento`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_atividade_espaco` FOREIGN KEY (`espaco_idespaco`) REFERENCES `les`.`espaco` (`idespaco`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_Atividade_professor_universitario` FOREIGN KEY (`professor_universitario_Utilizador_idutilizador`) REFERENCES `les`.`professor_universitario` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_Atividade_unidade_organica` FOREIGN KEY (`unidade_organica_idUO`) REFERENCES `les`.`unidade_organica` (`idUO`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`material` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`material` ( `idMaterial` INT NOT NULL AUTO_INCREMENT, `descricao` VARCHAR(45) NOT NULL, PRIMARY KEY (`idMaterial`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`atividade_has_material` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`atividade_has_material` ( `Atividade_idAtividade` INT NOT NULL, `Material_idMaterial` INT NOT NULL, PRIMARY KEY (`Atividade_idAtividade`, `Material_idMaterial`), INDEX `fk_Atividade_has_Material_Material_id` (`Material_idMaterial` ASC) VISIBLE, INDEX `fk_Atividade_has_Material_Atividade_id` (`Atividade_idAtividade` ASC) VISIBLE, CONSTRAINT `fk_Atividade_has_Material_Atividade` FOREIGN KEY (`Atividade_idAtividade`) REFERENCES `les`.`atividade` (`idAtividade`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_Atividade_has_Material_Material` FOREIGN KEY (`Material_idMaterial`) REFERENCES `les`.`material` (`idMaterial`) ON DELETE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`auth_group` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`auth_group` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(150) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name` (`name` ASC) VISIBLE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`django_content_type` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`django_content_type` ( `id` INT NOT NULL AUTO_INCREMENT, `app_label` VARCHAR(100) NOT NULL, `model` VARCHAR(100) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `django_content_type_app_label_model_76bd3d3b_uniq` (`app_label` ASC, `model` ASC) VISIBLE) ENGINE = InnoDB AUTO_INCREMENT = 333 DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`auth_permission` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`auth_permission` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `content_type_id` INT NOT NULL, `codename` VARCHAR(100) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `auth_permission_content_type_id_codename_01ab375a_uniq` (`content_type_id` ASC, `codename` ASC) VISIBLE, CONSTRAINT `auth_permission_content_type_id_2f476e4b_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `les`.`django_content_type` (`id`)) ENGINE = InnoDB AUTO_INCREMENT = 1329 DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`auth_group_permissions` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`auth_group_permissions` ( `id` INT NOT NULL AUTO_INCREMENT, `group_id` INT NOT NULL, `permission_id` INT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `auth_group_permissions_group_id_permission_id_0cd325b0_uniq` (`group_id` ASC, `permission_id` ASC) VISIBLE, INDEX `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` (`permission_id` ASC) VISIBLE, CONSTRAINT `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `les`.`auth_permission` (`id`), CONSTRAINT `auth_group_permissions_group_id_b120cbf9_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `les`.`auth_group` (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`auth_user` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`auth_user` ( `id` INT NOT NULL AUTO_INCREMENT, `password` VARCHAR(128) NOT NULL, `last_login` DATETIME(6) NULL DEFAULT NULL, `is_superuser` TINYINT(1) NOT NULL, `username` VARCHAR(150) NOT NULL, `first_name` VARCHAR(30) NOT NULL, `last_name` VARCHAR(150) NOT NULL, `email` VARCHAR(254) NOT NULL, `is_staff` TINYINT(1) NOT NULL, `is_active` TINYINT(1) NOT NULL, `date_joined` DATETIME(6) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `username` (`username` ASC) VISIBLE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`auth_user_groups` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`auth_user_groups` ( `id` INT NOT NULL AUTO_INCREMENT, `user_id` INT NOT NULL, `group_id` INT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `auth_user_groups_user_id_group_id_94350c0c_uniq` (`user_id` ASC, `group_id` ASC) VISIBLE, INDEX `auth_user_groups_group_id_97559544_fk_auth_group_id` (`group_id` ASC) VISIBLE, CONSTRAINT `auth_user_groups_group_id_97559544_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `les`.`auth_group` (`id`), CONSTRAINT `auth_user_groups_user_id_6a12ed8b_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `les`.`auth_user` (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`auth_user_user_permissions` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`auth_user_user_permissions` ( `id` INT NOT NULL AUTO_INCREMENT, `user_id` INT NOT NULL, `permission_id` INT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `auth_user_user_permissions_user_id_permission_id_14a6b632_uniq` (`user_id` ASC, `permission_id` ASC) VISIBLE, INDEX `auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm` (`permission_id` ASC) VISIBLE, CONSTRAINT `auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `les`.`auth_permission` (`id`), CONSTRAINT `auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `les`.`auth_user` (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`dia_aberto` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`dia_aberto` ( `ano` YEAR NOT NULL, `descricao` VARCHAR(120) NULL DEFAULT NULL, `datainscricao` DATE NOT NULL, `emailDiaAberto` VARCHAR(120) NOT NULL, `enderecoPaginaWeb` VARCHAR(60) NOT NULL, `dataDiainscricaoAtividadesInicio` DATE NOT NULL, `dataDiaAbertoInicio` DATE NOT NULL, `dataInscricaoAtividadesfim` DATE NOT NULL, `dataDiaAbertofim` DATE NOT NULL, `dataPropostaAtividadeInicio` DATE NOT NULL, `dataPropostaAtividadesFim` DATE NOT NULL, `Utilizador_idutilizador` INT NOT NULL, `Administrador_Utilizador_idutilizador` INT NOT NULL, PRIMARY KEY (`ano`), INDEX `fk_dia_aberto_Utilizador_id` (`Utilizador_idutilizador` ASC) VISIBLE, INDEX `fk_dia_aberto_Administrador_id` (`Administrador_Utilizador_idutilizador` ASC) VISIBLE, CONSTRAINT `fk_dia_aberto_Administrador` FOREIGN KEY (`Administrador_Utilizador_idutilizador`) REFERENCES `les`.`administrador` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_dia_aberto_Utilizador` FOREIGN KEY (`Utilizador_idutilizador`) REFERENCES `les`.`utilizador` (`idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`colaborador` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`colaborador` ( `curso` VARCHAR(45) NOT NULL, `preferencia` VARCHAR(45) NULL DEFAULT NULL, `Utilizador_idutilizador` INT NOT NULL, `dia_aberto_ano` YEAR NOT NULL, PRIMARY KEY (`Utilizador_idutilizador`), INDEX `fk_colaborador_dia_aberto_id` (`dia_aberto_ano` ASC) VISIBLE, CONSTRAINT `fk_colaborador_dia_aberto` FOREIGN KEY (`dia_aberto_ano`) REFERENCES `les`.`dia_aberto` (`ano`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_colaborador_Utilizador` FOREIGN KEY (`Utilizador_idutilizador`) REFERENCES `les`.`utilizador` (`idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`dia` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`dia` ( `dia` DATE NOT NULL, PRIMARY KEY (`dia`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`horario` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`horario` ( `hora` TIME NOT NULL, PRIMARY KEY (`hora`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`horario_has_dia` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`horario_has_dia` ( `horario_hora` TIME NOT NULL, `Dia_dia` DATE NOT NULL, `id_dia_hora` INT NOT NULL, PRIMARY KEY (`id_dia_hora`), INDEX `fk_horario_has_Dia_Dia1_idx` (`Dia_dia` ASC) VISIBLE, INDEX `fk_horario_has_Dia_horario1_idx` (`horario_hora` ASC) VISIBLE, CONSTRAINT `fk_horario_has_Dia_Dia` FOREIGN KEY (`Dia_dia`) REFERENCES `les`.`dia` (`dia`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_horario_has_Dia_horario` FOREIGN KEY (`horario_hora`) REFERENCES `les`.`horario` (`hora`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`colaborador_has_horario` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`colaborador_has_horario` ( `colaborador_Utilizador_idutilizador` INT NOT NULL, `horario_has_dia_id_dia_hora` INT NOT NULL, INDEX `fk_colaborador_has_Horario_colaborador_id` (`colaborador_Utilizador_idutilizador` ASC) VISIBLE, INDEX `fk_colaborador_has_horario_horario_has_dia1_idx` (`horario_has_dia_id_dia_hora` ASC) VISIBLE, CONSTRAINT `fk_colaborador_has_Horario_colaborador` FOREIGN KEY (`colaborador_Utilizador_idutilizador`) REFERENCES `les`.`colaborador` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_colaborador_has_horario_horario_has_dia1` FOREIGN KEY (`horario_has_dia_id_dia_hora`) REFERENCES `les`.`horario_has_dia` (`id_dia_hora`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`colaborador_has_unidade_organica` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`colaborador_has_unidade_organica` ( `colaborador_Utilizador_idutilizador` INT NOT NULL, `unidade_organica_idUO` INT NOT NULL, INDEX `fk_colaborador_has_unidade_organica_unidade_organica_id` (`unidade_organica_idUO` ASC) VISIBLE, INDEX `fk_colaborador_has_unidade_organica_colaborador_id` (`colaborador_Utilizador_idutilizador` ASC) VISIBLE, CONSTRAINT `fk_colaborador_has_unidade_organica_colaborador` FOREIGN KEY (`colaborador_Utilizador_idutilizador`) REFERENCES `les`.`colaborador` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_colaborador_has_unidade_organica_unidade_Organica` FOREIGN KEY (`unidade_organica_idUO`) REFERENCES `les`.`unidade_organica` (`idUO`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`coordenador` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`coordenador` ( `Utilizador_idutilizador` INT NOT NULL, `unidade_organica_idUO` INT NOT NULL, PRIMARY KEY (`Utilizador_idutilizador`), INDEX `fk_Coordenador_unidade_organica_id` (`unidade_organica_idUO` ASC) VISIBLE, CONSTRAINT `fk_Coordenador_unidade_organica` FOREIGN KEY (`unidade_organica_idUO`) REFERENCES `les`.`unidade_organica` (`idUO`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_Coordenador_Utilizador` FOREIGN KEY (`Utilizador_idutilizador`) REFERENCES `les`.`utilizador` (`idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`coordenador_has_departamento` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`coordenador_has_departamento` ( `Coordenador_Utilizador_idutilizador` INT NOT NULL, `Departamento_idDepartamento` INT NOT NULL, PRIMARY KEY (`Coordenador_Utilizador_idutilizador`, `Departamento_idDepartamento`), INDEX `fk_Coordenador_has_Departamento_Departamento_id` (`Departamento_idDepartamento` ASC) VISIBLE, INDEX `fk_Coordenador_has_Departamento_Coordenador_id` (`Coordenador_Utilizador_idutilizador` ASC) VISIBLE, CONSTRAINT `fk_Coordenador_has_Departamento_Coordenador` FOREIGN KEY (`Coordenador_Utilizador_idutilizador`) REFERENCES `les`.`coordenador` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_Coordenador_has_Departamento_Departamento` FOREIGN KEY (`Departamento_idDepartamento`) REFERENCES `les`.`departamento` (`idDepartamento`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`django_admin_log` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`django_admin_log` ( `id` INT NOT NULL AUTO_INCREMENT, `action_time` DATETIME(6) NOT NULL, `object_id` LONGTEXT NULL DEFAULT NULL, `object_repr` VARCHAR(200) NOT NULL, `action_flag` SMALLINT UNSIGNED NOT NULL, `change_message` LONGTEXT NOT NULL, `content_type_id` INT NULL DEFAULT NULL, `user_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `django_admin_log_content_type_id_c4bce8eb_fk_django_co` (`content_type_id` ASC) VISIBLE, INDEX `django_admin_log_user_id_c564eba6_fk_auth_user_id` (`user_id` ASC) VISIBLE, CONSTRAINT `django_admin_log_content_type_id_c4bce8eb_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `les`.`django_content_type` (`id`), CONSTRAINT `django_admin_log_user_id_c564eba6_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `les`.`auth_user` (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`django_migrations` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`django_migrations` ( `id` INT NOT NULL AUTO_INCREMENT, `app` VARCHAR(255) NOT NULL, `name` VARCHAR(255) NOT NULL, `applied` DATETIME(6) NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB AUTO_INCREMENT = 60 DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`django_session` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`django_session` ( `session_key` VARCHAR(40) NOT NULL, `session_data` LONGTEXT NOT NULL, `expire_date` DATETIME(6) NOT NULL, PRIMARY KEY (`session_key`), INDEX `django_session_expire_date_a5c62663` (`expire_date` ASC) VISIBLE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`escola` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`escola` ( `idescola` INT NOT NULL AUTO_INCREMENT, `nome` VARCHAR(45) NOT NULL, `local` VARCHAR(45) NOT NULL, `telefone` VARCHAR(45) NOT NULL, `email` VARCHAR(45) NULL DEFAULT NULL, PRIMARY KEY (`idescola`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`idioma` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`idioma` ( `nome` VARCHAR(24) NOT NULL, `sigla` VARCHAR(45) NOT NULL, `Administrador_Utilizador_idutilizador` INT NOT NULL, PRIMARY KEY (`nome`), UNIQUE INDEX `sigla_UNIQUE` (`sigla` ASC) VISIBLE, INDEX `fk_idioma_Administrador_id` (`Administrador_Utilizador_idutilizador` ASC) VISIBLE, CONSTRAINT `fk_idioma_Administrador` FOREIGN KEY (`Administrador_Utilizador_idutilizador`) REFERENCES `les`.`administrador` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`inscricao` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`inscricao` ( `idinscricao` INT NOT NULL AUTO_INCREMENT, `ano` YEAR NOT NULL, `local` VARCHAR(45) NOT NULL, `nparticipantes` INT NOT NULL, `areacientifica` VARCHAR(45) NOT NULL, PRIMARY KEY (`idinscricao`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`participante` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`participante` ( `Utilizador_idutilizador` INT NOT NULL, PRIMARY KEY (`Utilizador_idutilizador`), CONSTRAINT `fk_Participante_Utilizador` FOREIGN KEY (`Utilizador_idutilizador`) REFERENCES `les`.`utilizador` (`idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`inscricao_coletiva` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`inscricao_coletiva` ( `nresponsaveis` INT NOT NULL, `turma` CHAR(1) NOT NULL, `Participante_Utilizador_idutilizador` INT NOT NULL, `escola_idescola` INT NOT NULL, `inscricao_idinscricao` INT NOT NULL, `telefone` INT NOT NULL, PRIMARY KEY (`inscricao_idinscricao`), INDEX `fk_inscricao_coletiva_Participante_id` (`Participante_Utilizador_idutilizador` ASC) VISIBLE, INDEX `fk_inscricao_coletiva_escola_id` (`escola_idescola` ASC) VISIBLE, INDEX `fk_inscricao_coletiva_inscricao_id` (`inscricao_idinscricao` ASC) VISIBLE, CONSTRAINT `fk_inscricao_coletiva_escola` FOREIGN KEY (`escola_idescola`) REFERENCES `les`.`escola` (`idescola`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_inscricao_coletiva_inscricao` FOREIGN KEY (`inscricao_idinscricao`) REFERENCES `les`.`inscricao` (`idinscricao`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_inscricao_coletiva_Participante` FOREIGN KEY (`Participante_Utilizador_idutilizador`) REFERENCES `les`.`participante` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`menu` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`menu` ( `idMenu` INT NOT NULL AUTO_INCREMENT, `precoAluno` FLOAT NOT NULL, `PrecoProfessor` FLOAT NOT NULL, `tipo` VARCHAR(45) NOT NULL, `menu` VARCHAR(45) NOT NULL, `Administrador_Utilizador_idutilizador` INT NOT NULL, `Campus_idCampus` INT NOT NULL, `horario_has_dia_id_dia_hora` INT NOT NULL, PRIMARY KEY (`idMenu`), INDEX `fk_Menu_Administrador_id` (`Administrador_Utilizador_idutilizador` ASC) VISIBLE, INDEX `fk_Menu_Campus_id` (`Campus_idCampus` ASC) VISIBLE, INDEX `fk_menu_horario_has_dia1_idx` (`horario_has_dia_id_dia_hora` ASC) VISIBLE, CONSTRAINT `fk_Menu_Administrador` FOREIGN KEY (`Administrador_Utilizador_idutilizador`) REFERENCES `les`.`administrador` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_Menu_Campus` FOREIGN KEY (`Campus_idCampus`) REFERENCES `les`.`campus` (`idCampus`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_menu_horario_has_dia1` FOREIGN KEY (`horario_has_dia_id_dia_hora`) REFERENCES `les`.`horario_has_dia` (`id_dia_hora`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`prato` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`prato` ( `idPrato` INT NOT NULL AUTO_INCREMENT, `nralomocosdisponiveis` INT NOT NULL, `descricao` VARCHAR(125) NOT NULL, `Menu_idMenu` INT NOT NULL, PRIMARY KEY (`idPrato`), INDEX `fk_Prato_Menu_id` (`Menu_idMenu` ASC) VISIBLE, CONSTRAINT `fk_Prato_Menu` FOREIGN KEY (`Menu_idMenu`) REFERENCES `les`.`menu` (`idMenu`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`inscricao_has_prato` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`inscricao_has_prato` ( `inscricao_idinscricao` INT NOT NULL, `Prato_idPrato` INT NOT NULL, INDEX `fk_inscricao_has_Prato_Prato_id` (`Prato_idPrato` ASC) VISIBLE, INDEX `fk_inscricao_has_Prato_inscricao_id` (`inscricao_idinscricao` ASC) VISIBLE, CONSTRAINT `fk_inscricao_has_Prato_inscricao` FOREIGN KEY (`inscricao_idinscricao`) REFERENCES `les`.`inscricao` (`idinscricao`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_inscricao_has_Prato_Prato` FOREIGN KEY (`Prato_idPrato`) REFERENCES `les`.`prato` (`idPrato`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`sessao` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`sessao` ( `idsessao` INT NOT NULL AUTO_INCREMENT, `nrinscritos` INT NOT NULL DEFAULT 0, `vagas` INT NOT NULL DEFAULT 0, `Atividade_idAtividade` INT NOT NULL, `horario_has_dia_id_dia_hora` INT NOT NULL, PRIMARY KEY (`idsessao`), INDEX `fk_sessao_Atividade_id` (`Atividade_idAtividade` ASC) VISIBLE, INDEX `fk_sessao_horario_has_dia1_idx` (`horario_has_dia_id_dia_hora` ASC) VISIBLE, CONSTRAINT `fk_sessao_Atividade` FOREIGN KEY (`Atividade_idAtividade`) REFERENCES `les`.`atividade` (`idAtividade`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_sessao_horario_has_dia1` FOREIGN KEY (`horario_has_dia_id_dia_hora`) REFERENCES `les`.`horario_has_dia` (`id_dia_hora`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`inscricao_has_sessao` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`inscricao_has_sessao` ( `inscricao_idinscricao` INT NOT NULL, `sessao_idsessao` INT NOT NULL, INDEX `fk_inscricao_has_sessao_sessao_id` (`sessao_idsessao` ASC) VISIBLE, INDEX `fk_inscricao_has_sessao_inscricao_id` (`inscricao_idinscricao` ASC) VISIBLE, CONSTRAINT `fk_inscricao_has_sessao_inscricao` FOREIGN KEY (`inscricao_idinscricao`) REFERENCES `les`.`inscricao` (`idinscricao`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_inscricao_has_sessao_sessao` FOREIGN KEY (`sessao_idsessao`) REFERENCES `les`.`sessao` (`idsessao`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`inscricao_individual` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`inscricao_individual` ( `nracompanhades` INT(10) UNSIGNED ZEROFILL NOT NULL, `Participante_Utilizador_idutilizador` INT NOT NULL, `inscricao_idinscricao` INT NOT NULL, PRIMARY KEY (`inscricao_idinscricao`), INDEX `fk_inscricao_individual_Participante_id` (`Participante_Utilizador_idutilizador` ASC) VISIBLE, INDEX `fk_inscricao_individual_inscricao_id` (`inscricao_idinscricao` ASC) VISIBLE, CONSTRAINT `fk_inscricao_individual_inscricao` FOREIGN KEY (`inscricao_idinscricao`) REFERENCES `les`.`inscricao` (`idinscricao`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_inscricao_individual_Participante` FOREIGN KEY (`Participante_Utilizador_idutilizador`) REFERENCES `les`.`participante` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`notificacao` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`notificacao` ( `id` INT NOT NULL AUTO_INCREMENT, `descricao` VARCHAR(45) NOT NULL, `criadoem` DATETIME(6) NOT NULL, `idutilizadorenvia` INT NOT NULL, `utilizadorrecebe` INT NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`responsaveis` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`responsaveis` ( `idresponsavel` INT NOT NULL AUTO_INCREMENT, `nome` VARCHAR(45) NOT NULL, `email` VARCHAR(45) NOT NULL, `telefone` VARCHAR(45) NOT NULL, `idInscricao` INT NOT NULL, PRIMARY KEY (`idresponsavel`), INDEX `fk_Responsáveis_Inscricao` (`idInscricao` ASC) VISIBLE, CONSTRAINT `fk_Responsáveis_Inscricao` FOREIGN KEY (`idInscricao`) REFERENCES `les`.`inscricao` (`idinscricao`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`sala` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`sala` ( `edificio` VARCHAR(45) NOT NULL, `andar` VARCHAR(45) NOT NULL, `gabinete` VARCHAR(45) NULL DEFAULT NULL, `espaco_idespaco` INT NOT NULL, PRIMARY KEY (`espaco_idespaco`), INDEX `fk_sala_espaco_id` (`espaco_idespaco` ASC) VISIBLE, CONSTRAINT `fk_sala_espaco` FOREIGN KEY (`espaco_idespaco`) REFERENCES `les`.`espaco` (`idespaco`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`tarefa` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`tarefa` ( `idtarefa` INT NOT NULL AUTO_INCREMENT, `nome` VARCHAR(45) NOT NULL, `concluida` TINYINT NOT NULL, `Coordenador_Utilizador_idutilizador` INT NOT NULL, `colaborador_Utilizador_idutilizador` INT NOT NULL, `Atividade_idAtividade` INT NOT NULL, PRIMARY KEY (`idtarefa`), INDEX `fk_tarefa_Coordenador_id` (`Coordenador_Utilizador_idutilizador` ASC) VISIBLE, INDEX `fk_tarefa_colaborador_id` (`colaborador_Utilizador_idutilizador` ASC) VISIBLE, INDEX `fk_tarefa_Atividade_id` (`Atividade_idAtividade` ASC) VISIBLE, CONSTRAINT `fk_tarefa_Atividade` FOREIGN KEY (`Atividade_idAtividade`) REFERENCES `les`.`atividade` (`idAtividade`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_tarefa_colaborador` FOREIGN KEY (`colaborador_Utilizador_idutilizador`) REFERENCES `les`.`colaborador` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_tarefa_Coordenador` FOREIGN KEY (`Coordenador_Utilizador_idutilizador`) REFERENCES `les`.`coordenador` (`Utilizador_idutilizador`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`transporte` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`transporte` ( `idtransporte` INT NOT NULL AUTO_INCREMENT, `capacidade` INT NOT NULL, `identificacao` VARCHAR(45) NOT NULL, PRIMARY KEY (`idtransporte`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`origem` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`origem` ( `origem` INT NOT NULL, PRIMARY KEY (`origem`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `les`.`destino` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`destino` ( `destino` INT NOT NULL, PRIMARY KEY (`destino`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `les`.`transporte_has_horario` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`transporte_has_horario` ( `transporte_idtransporte` INT NOT NULL, `horario_has_dia_id_dia_hora` INT NOT NULL, `vagas` INT NOT NULL, `id_transporte_has_horario` INT NOT NULL, `table1_origem` INT NOT NULL, `destino_destino` INT NOT NULL, INDEX `fk_transporte_has_Horario_transporte_id` (`transporte_idtransporte` ASC) VISIBLE, INDEX `fk_transporte_has_horario_horario_has_dia1_idx` (`horario_has_dia_id_dia_hora` ASC) VISIBLE, PRIMARY KEY (`id_transporte_has_horario`), INDEX `fk_transporte_has_horario_table11_idx` (`table1_origem` ASC) VISIBLE, INDEX `fk_transporte_has_horario_destino1_idx` (`destino_destino` ASC) VISIBLE, CONSTRAINT `fk_transporte_has_horario_horario_has_dia1` FOREIGN KEY (`horario_has_dia_id_dia_hora`) REFERENCES `les`.`horario_has_dia` (`id_dia_hora`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_transporte_has_Horario_transporte` FOREIGN KEY (`transporte_idtransporte`) REFERENCES `les`.`transporte` (`idtransporte`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_transporte_has_horario_table11` FOREIGN KEY (`table1_origem`) REFERENCES `les`.`origem` (`origem`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_transporte_has_horario_destino1` FOREIGN KEY (`destino_destino`) REFERENCES `les`.`destino` (`destino`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`transporte_has_inscricao` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`transporte_has_inscricao` ( `inscricao_idinscricao` INT NOT NULL, `transporte_has_horario_id_transporte_has_horario` INT NOT NULL, INDEX `fk_transporte_has_inscricao_inscricao_id` (`inscricao_idinscricao` ASC) VISIBLE, INDEX `fk_transporte_has_inscricao_transporte_has_horario1_idx` (`transporte_has_horario_id_transporte_has_horario` ASC) VISIBLE, CONSTRAINT `fk_transporte_has_inscricao_inscricao` FOREIGN KEY (`inscricao_idinscricao`) REFERENCES `les`.`inscricao` (`idinscricao`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_transporte_has_inscricao_transporte_has_horario1` FOREIGN KEY (`transporte_has_horario_id_transporte_has_horario`) REFERENCES `les`.`transporte_has_horario` (`id_transporte_has_horario`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`transporte_pessoal` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`transporte_pessoal` ( `transporte_idtransporte` INT NOT NULL, PRIMARY KEY (`transporte_idtransporte`), CONSTRAINT `fk_Transporte_pessoal_transporte` FOREIGN KEY (`transporte_idtransporte`) REFERENCES `les`.`transporte` (`idtransporte`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`transporte_universitario` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`transporte_universitario` ( `capacidade` INT NOT NULL, `transporte_idtransporte` INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`transporte_idtransporte`), CONSTRAINT `fk_transporte Universitario_transporte` FOREIGN KEY (`transporte_idtransporte`) REFERENCES `les`.`transporte` (`idtransporte`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; -- ----------------------------------------------------- -- Table `les`.`utilizador_has_notificacao` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `les`.`utilizador_has_notificacao` ( `Utilizador_idutilizador` INT NOT NULL, `notificacao_id` INT NOT NULL, INDEX `fk_Utilizador_has_notificacao_notificacao_id` (`notificacao_id` ASC) VISIBLE, INDEX `fk_Utilizador_has_notificacao_Utilizador_id` (`Utilizador_idutilizador` ASC) VISIBLE, CONSTRAINT `fk_Utilizador_has_notificacao_notificacao` FOREIGN KEY (`notificacao_id`) REFERENCES `les`.`notificacao` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_Utilizador_has_notificacao_Utilizador` FOREIGN KEY (`Utilizador_idutilizador`) REFERENCES `les`.`utilizador` (`idutilizador`) 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;
true
fd4487a405e3f3ec266b2e25dddd04873b8ab819
SQL
aliashraf94/Databases-Homework
/week-1/mandatory/homework.sql
UTF-8
3,129
4.1875
4
[]
no_license
drop table if exists mentors cascade; drop table if exists students cascade; drop table if exists topics cascade; drop table if exists classes cascade; drop table if exists attendance cascade; create table mentors ( id serial primary key, name varchar(30) not null, years_living_in_glasgow int default 0 not null, address varchar(50) not null, fav_programming_language varchar(10) ); insert into mentors(name, address) values('Vincent', 'xyz'); insert into mentors(name, address,fav_programming_language) values('carlos', 'abc', 'JavaScript'); insert into mentors(name, address,fav_programming_language,years_living_in_glasgow) values('Alexandra', 'xyz', 'Java', 5); insert into mentors(name, address,fav_programming_language,years_living_in_glasgow) values('hennerite', 'somewhere', 'python', 20); insert into mentors(name, address,fav_programming_language) values('lender', 'some where', 'kotlin'); select * from mentors; create table students ( id serial primary key, name varchar(30), address varchar(50), graduation_date date ); insert into students (name, address) values('Ramin', 'Iran'); insert into students (name, address, graduation_date) values('Ali Ashraf', 'Pakistan', Now()); insert into students (name, address, graduation_date) values('Aleksey', 'Russia', Now()); insert into students (name, address, graduation_date) values('Anudeep', 'India', Now()); insert into students (name, address) values('thony', 'Vanuzuela'); insert into students (name, address, graduation_date) values('Diana', 'Ukrain', Now()); insert into students (name, address) values('Bipasha aka Bips', 'Bangladesh'); insert into students (name, address) values('Jaime', 'Latin American'); insert into students (name, address, graduation_date) values('Noor', 'syria', Now()); insert into students (name, address, graduation_date) values('Heneritte', 'Holand', Now()); select * from students; create table topics ( id serial primary key, name varchar(30) not null ); insert into topics (name) values ('JavaScript'), ('Node'), ('Databases'); select * from topics; create table classes ( id serial PRIMARY KEY, mentor serial REFERENCES mentors(id), topic serial REFERENCES topics(id), date date not null, location VARCHAR(30) not null ); insert into classes (mentor, topic, date, location) values (1,3, now(), 'online'); insert into classes (mentor, topic, date, location) values (2,1, now(), 'online'); insert into classes (mentor, topic, date, location) values (3,2, now(), 'online'); select * from classes; CREATE TABLE attendance ( id serial PRIMARY KEY, student serial REFERENCES students(id), class serial REFERENCES classes(id) ); insert into attendance (student, class) values (1,1); insert into attendance (student, class) values (4,2); insert into attendance (student, class) values (9,3); select * from attendance where class = 3; SELECT * from mentors where years_living_in_glasgow > 5; SELECT * from mentors where fav_programming_language = 'JavaScript'; SELECT * FROM students where graduation_date is not null; SELECT * FROM classes where date < '01/06/2020' SELECT * from students where id = 2;
true
c3fbd0970b2c2d92e41cb6fddf317440536c7de8
SQL
jsgilberto/sparkify
/src/schema.sql
UTF-8
852
3.3125
3
[]
no_license
-- Fact table CREATE TABLE IF NOT EXISTS songplays ( songplay_id SERIAL NOT NULL UNIQUE, start_time TIMESTAMP, user_id INTEGER, song_id VARCHAR, artist_id VARCHAR, session_id INTEGER, level VARCHAR, location VARCHAR, user_agent VARCHAR ); -- Dimension tables CREATE TABLE IF NOT EXISTS users ( user_id INTEGER PRIMARY KEY, first_name VARCHAR, last_name VARCHAR, gender CHAR, level VARCHAR ); CREATE TABLE IF NOT EXISTS songs ( song_id VARCHAR PRIMARY KEY, title VARCHAR, artist_id INTEGER, year SMALLINT, duration FLOAT ); CREATE TABLE IF NOT EXISTS artists ( artist_id VARCHAR PRIMARY KEY, name VARCHAR, location VARCHAR, latitude FLOAT, longitude FLOAT ); CREATE TABLE IF NOT EXISTS time ( start_time TIMESTAMP PRIMARY KEY, hour VARCHAR, day VARCHAR, week VARCHAR, month VARCHAR, year VARCHAR, weekday VARCHAR );
true
7492f64c2ff2b0fa1d54a1674dcca82209c18e87
SQL
flaschenpost/klimawahlen
/struct.sql
UTF-8
1,359
3.5625
4
[ "MIT" ]
permissive
drop table if exists cronrun; create table cronrun( id bigint not null primary key auto_increment, inserted timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, tweets bigint ); drop table if exists tweep; create table tweep( id bigint not null primary key, is_blocked tinyint(4) not null default 0, handle varchar(512), screenname varchar(512) ); drop table if exists thread; create table thread( id bigint not null primary key auto_increment, example_tweet bigint not null, inserted timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ); drop table if exists tweet; create table tweet( id bigint not null primary key, tweep bigint not null, cronrun bigint not null, inserted timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, created_at datetime, complete text(61000), maintext varchar(512), hashtag bigint, url varchar(512), thread bigint , parent bigint, son bigint, index(hashtag) ); drop table if exists hashtag; create table hashtag( id bigint not null primary key auto_increment, hashtag varchar(255), frequency bigint default 1, lastrequested datetime, lastid bigint ); insert into hashtag set hashtag='NieWiederCDU'; insert into hashtag set hashtag='BTW21Fakt'; insert into hashtag set hashtag='BTW21Fakten'; insert into hashtag set hashtag='NieWiederCDUCSU'; insert into hashtag set hashtag='WhatTheFact';
true
263813f23d308831c63fb42d6f2f473446edf77f
SQL
douit/cqes_dev
/重庆二师_Dev/dw_mpp/table/fdm/edu_hb_cqshjzhxsttzwyy.sql
UTF-8
1,288
2.53125
3
[]
no_license
/* # DESCRIPTION: # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: song.shengjie@h3c.com # COMPANY: h3c.bigdata # VERSION: 1.0 # CREATED: 2017/08/07 # REVIEWER: # REVISION: --- */ set names utf8; use FDM; DROP TABLE IF EXISTS `edu_hb_cqshjzhxsttzwyy`; CREATE TABLE `edu_hb_cqshjzhxsttzwyy` ( `DM` char(1) NOT NULL COMMENT '代码', `MC` varchar(5) NOT NULL COMMENT '名称' ) DEFAULT CHARSET=utf8 COMMENT= '[辞去社会兼职或学术团体职务原因代码]代替2002年《教育管理信息化标准 第1部分:学校管理信息标准》'; -- ---------------------------- -- Records of edu_hb_cqshjzhxsttzwyy -- ---------------------------- INSERT INTO `edu_hb_cqshjzhxsttzwyy` VALUES ('1', '任职期满'); INSERT INTO `edu_hb_cqshjzhxsttzwyy` VALUES ('2', '工作调动'); INSERT INTO `edu_hb_cqshjzhxsttzwyy` VALUES ('3', '换届改选'); INSERT INTO `edu_hb_cqshjzhxsttzwyy` VALUES ('4', '离退休'); INSERT INTO `edu_hb_cqshjzhxsttzwyy` VALUES ('5', '健康原因'); INSERT INTO `edu_hb_cqshjzhxsttzwyy` VALUES ('6', '辞职'); INSERT INTO `edu_hb_cqshjzhxsttzwyy` VALUES ('7', '免职'); INSERT INTO `edu_hb_cqshjzhxsttzwyy` VALUES ('8', '处分'); INSERT INTO `edu_hb_cqshjzhxsttzwyy` VALUES ('9', '其他');
true
df4e0d0a7c16dd0120e51439450238fb6cb0b6ce
SQL
chaesiong/rtp-database
/production/PIBICSDM2/tables/crs_deptissuedrc.sql
UTF-8
2,237
2.671875
3
[]
no_license
CREATE TABLE "PIBICSDM2"."CRS_DEPTISSUEDRC" ( "DEPTISSUEDRC_SEQNO" NUMBER, "DEPTISSUEDRC_CODE" CHAR(3 CHAR), "DEPTISSUEDRC_NAME" VARCHAR2(30 CHAR), "ACTFLAG" CHAR(1 CHAR), "CREATE_BY" VARCHAR2(20 CHAR), "CREATE_DATE" TIMESTAMP (6), "UPDATE_BY" VARCHAR2(20 CHAR), "UPDATE_DATE" TIMESTAMP (6), "VERSION" NUMBER ) ; ALTER TABLE "PIBICSDM2"."CRS_DEPTISSUEDRC" ADD CONSTRAINT "CRS_DEPTISSUEDRC_PK" PRIMARY KEY ("DEPTISSUEDRC_SEQNO") USING INDEX ENABLE; CREATE UNIQUE INDEX "PIBICSDM2"."CRS_DEPTISSUEDRC_PK" ON "PIBICSDM2"."CRS_DEPTISSUEDRC" ("DEPTISSUEDRC_SEQNO") ; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "DL_STAGING4PIBICS"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "SERVAPP"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "PIBICSDM2_RO"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "PIBICSAPP"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "ROLE_SERVAPP"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "ROLE_PIBICSAPP"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "ROLE_PIBICSDM2_RO"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "ROLE_DL_STAGING4PIBICS"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIO_BD"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "APPSUP"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOAPPREPORT"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSUPPORT"; GRANT ALTER ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT DELETE ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT INDEX ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT INSERT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT SELECT ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT UPDATE ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT REFERENCES ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT READ ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT ON COMMIT REFRESH ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT QUERY REWRITE ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT DEBUG ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM"; GRANT FLASHBACK ON "PIBICSDM2"."CRS_DEPTISSUEDRC" TO "BIOSAADM";
true
ef53e827dd5f69a4d8023f978a4da2d953998c35
SQL
BrandConstantin/php
/prueba/MVC/Model/oferta.sql
UTF-8
1,921
3.0625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.0.6deb1 -- http://www.phpmyadmin.net -- -- Servidor: localhost -- Tiempo de generación: 17-11-2013 a las 21:25:00 -- Versión del servidor: 5.5.34-0ubuntu0.13.10.1 -- Versión de PHP: 5.5.3-1ubuntu2 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 utf8 */; -- -- Base de datos: `pizzeria` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `oferta` -- CREATE TABLE IF NOT EXISTS `oferta` ( `id` int(11) NOT NULL AUTO_INCREMENT, `titulo` varchar(200) COLLATE utf8_bin NOT NULL, `imagen` varchar(100) COLLATE utf8_bin NOT NULL, `descripcion` varchar(500) COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=17 ; -- -- Volcado de datos para la tabla `oferta` -- INSERT INTO `oferta` (`id`, `titulo`, `imagen`, `descripcion`) VALUES (3, 'Bebida gratis pidiendo dos pizzas', 'pizza3.jpg', 'Pidiendo dos pizzas de cualquier tipo te regalamos dos bebidas (no incluye bebidas alcohólicas de alta graduación). '), (15, 'Oferta de la semana: Funghi a mitad de precio', 'pizza1.jpg', 'Durante esta semana todas las pizzas funghi de tamaño mediano y familiar están a mitad de precio. ¡Viva el champiñón!'), (16, 'Albahaca gratis en cualquier pizza', 'pizza2.jpg', 'Al encargar cualquier pizza puedes pedir que le añadamos albahaca ¡totalmente gratis!'); /*!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
b654de5478234497465005207ec0fc0496b332c8
SQL
julioale21/alkemy-SQL
/Modulo 2 capsula 1.sql
UTF-8
6,301
3.234375
3
[]
no_license
SELECT MIN(salario) from profesor where fecha_nacimiento LIKE '%198%' CREATE TABLE pais ( idpais int AUTO_INCREMENT NOT NULL, nombre VARCHAR NOT NULL, PRIMARY KEY (idpais) ) CREATE TABLE pasajero ( idpasajero int AUTO_INCREMENT NOT NULL, nombre VARCHAR NOT NULL, apaterno VARCHAR NOT NULL, amaterno VARCHAR NOT NULL, tipo_documento VARCHAR NOT NULL, numero_documento VARCHAR NOT NULL, fecha_nacimiento DATA NOT NULL, idpais int NOT NULL, telefono VARCHAR NOT NULL, email VARCHAR NOT NULL, clave VARCHAR NOT NULL, PRIMARY KEY (idpasajero) FOREIGN KEY (idpais) REFERENCES pais(idpais) ) CREATE TABLE pago ( idpago int AUTO_INCREMENT NOT NULL, idreserva int NOT NULL, fecha date NOT NULL, idpasajero int NOT NULL, monto int, tipo_comporbante VARCHAR NOT NULL, numero_comprobante VARCHAR NOT NULL, impuesto int NOT NULL, PRIMARY KEY (idpago) FOREIGN KEY (idpasajero) REFERENCES pasajero(idpasajero) ) INSERT INTO pais VALUES (1, 'Argentina') INSERT INTO pais VALUES (2, 'Peru') INSERT INTO pais VALUES (3, 'Chile') INSERT INTO pais VALUES (4, 'Brasil') INSERT INTO pais VALUES (5, 'Estados Unidos') INSERT INTO pais VALUES (6, 'Mexico') INSERT INTO pasajero VALUES (1, 'Jorge', 'Rios', 'Rojas', 'dni', '23323322', '2003-03-02', 1, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (2, 'Diego', 'Perez', 'Cardenaz', 'dni', '43223344', '2004-01-02', 2, 'sdaffasdf', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (3, 'Mertin', 'Arbe', 'Perez', 'dni', '43233322', '2003-03-02', 2, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (4, 'Mario', 'Amaya', 'Rios', 'dni', '43222333', '2003-03-02', 1, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (5, 'Ana', 'Lopez', 'Rojas', 'dni', '23323322', '2003-03-02', 3, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (6, 'Cristina', 'Perez', '', 'dni', '6555666', '2003-03-02', 4, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (7, 'Laura', 'Marquez', '', 'dni', '44455554', '2003-03-02', 4, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (8, 'Liliana', 'Ruiz', '', 'dni', '22334433', '2003-03-02', 4, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (9, 'Carlos', 'Amaro', '', 'dni', '11222333', '2003-03-02', 1, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (10, 'Daniel', 'Sanchez', '', 'dni', '211122334', '2003-03-02', 5, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (11, 'Eduardo', 'Rios', '', 'dni', '87768657', '2003-03-02', 5, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (12, 'Marcelo', 'Matamala', '', 'dni', '34252345', '2003-03-02', 5, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (13, 'Fernanda', 'Brito', '', 'dni', '87686868', '2003-03-02', 6, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (14, 'Daniel', 'Matamala', '', 'dni', '65454566', '2003-03-02', 6, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pasajero VALUES (15, 'Cintia', 'Perez', '', 'dni', '98678665', '2003-03-02', 1, '343232344', 'fasdfa@fsadf.com', 'fasfas') INSERT INTO pago VALUES (1, 21212, '2001-03-02', 1, 15000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (2, 412342314123, '2001-03-02', 2, 45000, 'fafda', 'fasdfasdfasfa', 4332) INSERT INTO pago VALUES (3, 432141234312, '2001-03-02', 1, 55000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (4, 675676576577, '2001-03-02', 1, 25000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (5, 878787878788, '2001-03-02', 3, 30000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (6, 989898989899, '2001-03-02', 3, 20000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (7, 654363346345, '2001-03-02', 4, 10000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (8, 756577776577, '2001-03-02', 5, 90000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (9, 343456346666, '2001-03-02', 6, 98000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (10, 896789876888, '2001-03-02', 6, 99000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (11, 352453455555, '2001-03-02', 6, 150000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (12, 324534253245, '2001-03-02', 6, 155000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (13, 456456456546, '2001-03-02', 7, 23000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (14, 756756765777, '2001-03-02', 7, 26000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (15, 678678678888, '2001-03-02', 8, 16000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (16, 797898798799, '2001-03-02', 9, 98000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (17, 890890980000, '2001-03-02', 9, 56000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (18, 890800000000, '2001-03-02', 10, 78000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (19, 034543534534, '2001-03-02', 10, 79000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (20, 645645654666, '2001-03-02', 11, 43000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (21, 567567775677, '2001-03-02', 12, 54000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (22, 678678768888, '2001-03-02', 13, 53000, 'fafda', 'fasdfasdfasfa', 2121) INSERT INTO pago VALUES (23, 678678678888, '2001-03-02', 14, 16000, 'fafda', 'fasdfasdfasfa', 2121) -- 1)Cantidad de pasajeros por país SELECT COUNT(pasajero.nombre) FROM pais INNER JOIN pasajero ON pasajero.idpais == pais.idpais GROUP BY pais.idpais SELECT SUM(monto) FROM pagoSELECT COUNT(pasajero.nombre) as cantidad, pais.nombre FROM pais INNER JOIN pasajero ON pasajero.idpais == pais.idpais GROUP BY pais.idpais -- 2)Suma de todos los pagos realizados SELECT ROUND(SUM(monto), 2) as totalPagos from pago -- 3) Suma de todos los pagos que realizó un pasajero. El monto debe aparecer con dos decimales. SELECT ROUND(SUM(monto), 2) as totalPago, pasajero.nombre, pasajero.apaterno from pago INNER JOIN pasajero ON pago.idpasajero = pasajero.idpasajero GROUP by pasajero.idpasajero -- 4) Promedio de los pagos que realizó un pasajero. SELECT ROUND(AVG(pago.monto), 2) as promedioPago, pasajero.nombre, pasajero.apaterno FROM pago, pasajero where pago.idpasajero = pasajero.idpasajero GROUP by pasajero.idpasajero
true
67b8a7fc940ff3787fb16c314d1e912f2724f0e2
SQL
OSGP/open-smart-grid-platform
/osgp/platform/osgp-core/src/main/resources/db/migration/V20170807160951294__Refactors_firmware_for_all_value_streams.sql
UTF-8
10,438
3.9375
4
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
DO $$ BEGIN IF NOT EXISTS ( SELECT 1 FROM pg_tables WHERE schemaname = current_schema AND tablename = 'firmware_file') THEN -- Since we are dealing with firmware files, rename the firmware table to firmware_file. ALTER TABLE firmware RENAME TO firmware_file; -- Rename the sequence used by the firmware_file id column. ALTER SEQUENCE device_model_firmware_id_seq RENAME TO firmware_file_id_seq; -- Since a firmware file can be used by more than one device model, -- we need a many to many relationship between device_model and firmware_file. CREATE TABLE device_model_firmware_file ( device_model_id BIGINT NOT NULL REFERENCES device_model(id), firmware_file_id BIGINT NOT NULL REFERENCES firmware_file(id), CONSTRAINT device_model_firmware_file_pkey PRIMARY KEY (device_model_id, firmware_file_id) ); -- Index on device_model_id should be covered by the PK on (device_model_id, firmware_file_id). CREATE INDEX device_model_firmware_file_ix_firmware_file_id ON device_model_firmware_file (firmware_file_id); ALTER TABLE device_model_firmware_file OWNER TO osp_admin; GRANT ALL ON TABLE device_model_firmware_file TO osp_admin; GRANT SELECT ON TABLE device_model_firmware_file TO osgp_read_only_ws_user; -- Make sure the old firmware to device_model relations are migrated to device_model_firmware_file. INSERT INTO device_model_firmware_file (device_model_id, firmware_file_id) SELECT device_model_id, id FROM firmware_file WHERE device_model_id IS NOT NULL; ALTER TABLE firmware_file DROP COLUMN device_model_id CASCADE; CREATE TABLE firmware_module ( id BIGSERIAL PRIMARY KEY, description VARCHAR(255) NOT NULL, CONSTRAINT firmware_module_description_key UNIQUE (description) ); ALTER TABLE firmware_module OWNER TO osp_admin; GRANT ALL ON TABLE firmware_module TO osp_admin; GRANT SELECT ON TABLE firmware_module TO osgp_read_only_ws_user; -- Add firmware modules based on the version columns of the old firmware table. -- This way existing data can be migrated to firmware_file_firmware_module versions later-on in this script. INSERT INTO firmware_module (description) VALUES ('communication_module_active_firmware'), ('functional'), ('module_active_firmware'), ('m_bus'), ('security'), ('active_firmware'); CREATE TABLE firmware_file_firmware_module ( firmware_file_id BIGINT NOT NULL REFERENCES firmware_file(id), firmware_module_id BIGINT NOT NULL REFERENCES firmware_module(id), module_version VARCHAR(100) NOT NULL, CONSTRAINT firmware_file_firmware_module_pkey PRIMARY KEY (firmware_file_id, firmware_module_id) ); -- Index on firmware_file_id should be covered by the PK on (firmware_file_id, firmware_module_id). CREATE INDEX firmware_file_firmware_module_ix_firmware_module_id ON firmware_file_firmware_module (firmware_module_id); ALTER TABLE firmware_file_firmware_module OWNER TO osp_admin; GRANT ALL ON TABLE firmware_file_firmware_module TO osp_admin; GRANT SELECT ON TABLE firmware_file_firmware_module TO osgp_read_only_ws_user; -- Make sure the old firmware module versions are migrated to firmware_file_firmware_module. INSERT INTO firmware_file_firmware_module (firmware_file_id, firmware_module_id, module_version) SELECT id, (SELECT id FROM firmware_module WHERE description = 'communication_module_active_firmware'), module_version_comm FROM firmware_file WHERE module_version_comm IS NOT NULL; INSERT INTO firmware_file_firmware_module (firmware_file_id, firmware_module_id, module_version) SELECT id, (SELECT id FROM firmware_module WHERE description = 'module_active_firmware'), module_version_ma FROM firmware_file WHERE module_version_ma IS NOT NULL; INSERT INTO firmware_file_firmware_module (firmware_file_id, firmware_module_id, module_version) SELECT id, (SELECT id FROM firmware_module WHERE description = 'm_bus'), module_version_mbus FROM firmware_file WHERE module_version_mbus IS NOT NULL; INSERT INTO firmware_file_firmware_module (firmware_file_id, firmware_module_id, module_version) SELECT id, (SELECT id FROM firmware_module WHERE description = 'security'), module_version_sec FROM firmware_file WHERE module_version_sec IS NOT NULL; -- The old module_version_func holds the new 'active_firmware' module version for smart meters, -- while it holds the new 'functional' module version for other types of devices. -- This method errs when the database contains firmware files that have not been linked to a -- device model that is related to a smart meter device or to a smart meter device directly. -- Such firmware files will be given a functional module version instead of an active_firmware module version. INSERT INTO firmware_file_firmware_module (firmware_file_id, firmware_module_id, module_version) SELECT DISTINCT id, (SELECT id FROM firmware_module WHERE description = 'active_firmware'), module_version_func FROM firmware_file WHERE module_version_func IS NOT NULL AND ( EXISTS ( -- a smart meter that is linked to this firmware file SELECT 1 FROM device_firmware INNER JOIN device ON device_firmware.device_id = device.id INNER JOIN smart_meter ON device.id = smart_meter.id WHERE device_firmware.firmware_id = firmware_file.id ) OR EXISTS ( -- a device model that is linked to both this firmware file and a smart meter SELECT 1 FROM device_model_firmware_file INNER JOIN device_model ON device_model_firmware_file.device_model_id = device_model.id INNER JOIN device ON device_model.id = device.device_model INNER JOIN smart_meter ON device.id = smart_meter.id WHERE device_model_firmware_file.firmware_file_id = firmware_file.id ) ); INSERT INTO firmware_file_firmware_module (firmware_file_id, firmware_module_id, module_version) SELECT id, (SELECT id FROM firmware_module WHERE description = 'functional'), module_version_func FROM firmware_file WHERE module_version_func IS NOT NULL AND id NOT IN ( -- firmware file should not already have been determined to be for smart meters -- (in which case module_version_func is already mapped to active_firmware) SELECT fffm2.firmware_file_id FROM firmware_file_firmware_module fffm2 WHERE fffm2.firmware_module_id = (SELECT id FROM firmware_module WHERE description = 'active_firmware') ); ALTER TABLE firmware_file DROP COLUMN module_version_comm, DROP COLUMN module_version_func, DROP COLUMN module_version_ma, DROP COLUMN module_version_mbus, DROP COLUMN module_version_sec; ALTER TABLE device_firmware RENAME TO device_firmware_file; ALTER TABLE device_firmware_file RENAME firmware_id TO firmware_file_id; ALTER TABLE device_firmware_file RENAME CONSTRAINT fk7e0c025199350fa3 TO device_firmware_file_device_id_fkey; ALTER TABLE device_firmware_file RENAME CONSTRAINT fk8e1c015199350fa3 TO device_firmware_file_firmware_file_id_fkey; -- The database contains two sequences related to device_firmware.id (now device_firmware_file.id). -- Drop one and rename the other to make it obvious in which table it is used. DROP SEQUENCE firmware_id_sequence; ALTER SEQUENCE firmware_id_seq RENAME TO device_firmware_file_id_seq; ALTER TABLE device_firmware_file DROP COLUMN active; DELETE FROM device_firmware_file WHERE device_id IS NULL OR firmware_file_id IS NULL; ALTER TABLE device_firmware_file ALTER COLUMN device_id SET NOT NULL, ALTER COLUMN firmware_file_id SET NOT NULL; -- Make installation_date not null, because it is used to determine the latest firmware on a device. UPDATE device_firmware_file SET installation_date = creation_time WHERE installation_date IS NULL; ALTER TABLE device_firmware_file ALTER COLUMN installation_date SET NOT NULL; CREATE INDEX device_firmware_file_ix_device_id ON device_firmware_file (device_id); CREATE INDEX device_firmware_file_ix_firmware_file_id ON device_firmware_file (firmware_file_id); -- Add an id to manufacturer and use this as PK/FK instead of the 4 character code. CREATE SEQUENCE manufacturer_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1; ALTER TABLE manufacturer_id_seq OWNER TO osp_admin; ALTER TABLE manufacturer ADD id BIGINT NOT NULL DEFAULT nextval('manufacturer_id_seq'::regclass), ADD CONSTRAINT manufacturer_key UNIQUE (id); ALTER TABLE manufacturer RENAME manufacturer_id TO code; -- Use the new manufacturer id as FK instead of the 4 character code. -- Increase the size of model_code and create a unique index on the combination of manufacturer_id and model_code. ALTER TABLE device_model ADD COLUMN manufacturer_id_temp BIGINT; UPDATE device_model SET manufacturer_id_temp = (SELECT id FROM manufacturer WHERE code = manufacturer_id); ALTER TABLE device_model DROP CONSTRAINT model_manufacturer_fkey, ALTER COLUMN manufacturer_id TYPE BIGINT USING manufacturer_id_temp, DROP COLUMN manufacturer_id_temp, ALTER COLUMN model_code TYPE CHARACTER VARYING(255), ADD CONSTRAINT device_model_manufacturer_id_model_code_key UNIQUE (manufacturer_id, model_code); -- Replace the primary key on manufacturer. ALTER TABLE manufacturer DROP CONSTRAINT manufacturer_pkey; CREATE UNIQUE INDEX manufacturer_ix_id_temp ON manufacturer (id); ALTER TABLE manufacturer DROP CONSTRAINT manufacturer_key, ADD CONSTRAINT manufacturer_pkey PRIMARY KEY USING INDEX manufacturer_ix_id_temp, ADD CONSTRAINT manufacturer_code_key UNIQUE (code); ALTER TABLE device_model ADD CONSTRAINT device_model_manufacturer_id_fkey FOREIGN KEY (manufacturer_id) REFERENCES manufacturer(id); END IF; END; $$
true
b5368f68bbb28a50ec9843d21d0a929dad7c7f49
SQL
nicholasmfraser/wos_unpaywall_matching
/sql/criteria/article_title_wos_uniques.sql
UTF-8
147
2.78125
3
[]
no_license
SELECT ROUND((COUNT (DISTINCT ARTICLE_TITLE) / COUNT(*))*100, 2) AS PCT_UNIQUE FROM WOS_B_2019.ITEMS WHERE DOCTYPE IN ('Article', 'Review')
true
0dc139ec8bf26d93ba3ea69d8b71a2adaba16143
SQL
royjoyita/SQL_Challenge
/SQL_Homework/Schemata.sql
UTF-8
492
2.703125
3
[]
no_license
titles - title_id VARCHAR PK title VARCHAR employees - emp_no INT PK emp_title_id VARCHAR FK - titles.title_id birth_date DATE first_name VARCHAR last_name VARCHAR sex VARCHAR hire_date DATE departments - dept_no VARCHAR PK dept_name VARCHAR dept_manager - emp_no INT PK FK - employees.emp_no dept_no VARCHAR PK FK - departments.dept_no dept_emp - emp_no INT PK FK - employees.emp_no dept_no VARCHAR PK FK - departments.dept_no salaries - emp_no INT PK FK - employees.emp_no salary INT
true
192cdf3390575e8ee2ba895c50a68d1f59ad1360
SQL
leelaohu/sqlstudy
/DQL/findismohu.sql
UTF-8
3,453
4.125
4
[]
no_license
#进阶2 条件查询 /* select 查询列表 from 表名 where 筛选条件 分类 1.按条件表达式查询 简单条件运算符:> < = != <> >= <= 2.按逻辑表达式筛选 用于连接条件表达式 逻辑运算符 : && || ! and or not 3.模糊查询 like between and in is null */ #1.按条件表达式筛选 #ex:查询工资大于12000的员工 SELECT * FROM employees WHERE salary>12000 #ex:查询部门编号不等于90号的员工名和部门编号 SELECT last_name,department_id FROM employees WHERE department_id<>90 #1.按逻辑表达式筛选 #ex: 查询工资在10000到20000之间的员工名,工资以及奖金 SELECT last_name, salary, commission_pct FROM employees WHERE salary>=10000 AND salary<=20000; #ex: 查询部门编号不是在90-100之间,或者公资高于15000的员工信息 SELECT * FROM employees WHERE NOT (department_id>=90 AND department_id<=110)orsalary>15000 #-------------------------------------------------------------------------- SELECT * FROM employees WHERE department_id<90 OR department_id>110 OR salary>15000 #3.模糊查询 #like,between and,in,is null,is not null #like搭配通配符使用 # % 任意多个字符,包括0 # _ 任意单个字符 #ex: 查询名字中带有a的员工info SELECT * FROM employees WHERE last_name LIKE '%a%'; #ex 查询员工名中第3个字符为n的第5个字符为l的员工名 SELECT last_name FROM employees WHERE last_name LIKE '__n_l%'; #ex 查询员工名中第2个字符为_的员工名 SELECT last_name FROM employees WHERE last_name LIKE '_\_%'; #-------------------------- SELECT last_name FROM employees WHERE last_name LIKE '_$_%' ESCAPE '$'; #between and #使用他可以提高语句的简洁度 #包含两个临界值,并且不能调换顺序 #ex 查询员工编号在100-120之间的员工信息 SELECT * FROM employees WHERE employee_id>=100 AND employee_id<=120; #--------------------------------------------------------- SELECT * FROM employees WHERE employee_id BETWEEN 100 AND 120; #in /* 判断某字段的值是否属于in列表中的某一项 使用in提高语句简洁度 in列表中的数据类型必须统一或兼容 不能使用通配符 */ #查询员工的工种编号是IT_PROT,AD_VP,AD_PRES中的一个员工名和工种编号 SELECT last_name,job_id FROM employees WHERE job_id='IT_PROT' OR job_id='AD_VP' OR job_id='AD_PRES'; #-------------------------------------------- SELECT last_name,job_id FROM employees WHERE job_id IN ( 'IT_PROT','AD_VP','AD_PRES' ); /* is null =,<>不能用于判断null值 is null ,is not null 可以判断 */ #查询没有奖金的员工名和奖金率 SELECT last_name,commission_pct FROM employees WHERE commission_pct IS NULL; #SELECT last_name,salary FROM employees WHERE salary IS 12000 # 安全等于 <=> SELECT last_name,salary FROM employees WHERE salary <=> 12000; #is null pk <=> #is null 仅仅可以判断null值 可读性较高(推荐) #<=> 可以判断null值也可以判断普通数值 可读性较低 # 查询员工号为176的员工姓名和部门号和年薪`` SELECT last_name, employee_id, department_id, salary*12*(1+IFNULL(commission_pct,0)) AS 年薪 FROM employees WHERE employee_id = 176;
true
27df40eaf9f3665bee9fc4a90c53b4b10fbb05d4
SQL
jasminekhairunissa/HaiMimpi
/haimimpi.sql
UTF-8
14,189
3.265625
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 27, 2019 at 04:19 PM -- Server version: 10.4.8-MariaDB -- PHP Version: 7.3.11 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: `haimimpi` -- -- -------------------------------------------------------- -- -- Table structure for table `articles` -- CREATE TABLE `articles` ( `id` int(10) UNSIGNED NOT NULL, `category_id` int(10) UNSIGNED NOT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `content` text COLLATE utf8mb4_unicode_ci NOT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` enum('PUBLISHED','DRAFT') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PUBLISHED', `date` date NOT NULL, `featured` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `user_id` bigint(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `articles` -- INSERT INTO `articles` (`id`, `category_id`, `title`, `slug`, `content`, `image`, `status`, `date`, `featured`, `created_at`, `updated_at`, `deleted_at`, `user_id`) VALUES (1, 1, 'Hello!', 'hello', '<p>Testing.</p>', NULL, 'PUBLISHED', '2019-11-27', 0, '2019-11-27 07:48:35', '2019-11-27 07:48:35', NULL, 1); -- -------------------------------------------------------- -- -- Table structure for table `article_tag` -- CREATE TABLE `article_tag` ( `id` int(10) UNSIGNED NOT NULL, `article_id` int(10) UNSIGNED NOT NULL, `tag_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` int(10) UNSIGNED NOT NULL, `parent_id` int(11) DEFAULT 0, `lft` int(10) UNSIGNED DEFAULT NULL, `rgt` int(10) UNSIGNED DEFAULT NULL, `depth` int(10) UNSIGNED DEFAULT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `parent_id`, `lft`, `rgt`, `depth`, `name`, `slug`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, NULL, NULL, NULL, NULL, 'Technology', 'technology', '2019-11-27 06:34:47', '2019-11-27 06:34:47', NULL), (2, NULL, NULL, NULL, NULL, 'Art', 'art', '2019-11-27 06:35:03', '2019-11-27 06:35:03', NULL), (3, NULL, NULL, NULL, NULL, 'Sports', 'sports', '2019-11-27 06:35:26', '2019-11-27 06:35:26', NULL); -- -------------------------------------------------------- -- -- Table structure for table `dreams` -- CREATE TABLE `dreams` ( `id` bigint(20) UNSIGNED NOT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `category_id` int(10) UNSIGNED NOT NULL, `user_id` bigint(20) NOT NULL, `status` enum('COMPLETE','PROGRESS','UNSTARTED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'UNSTARTED', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) 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, '2015_08_04_130507_create_article_tag_table', 1), (2, '2015_08_04_130520_create_articles_table', 1), (3, '2015_08_04_130551_create_categories_table', 1), (4, '2015_08_04_131626_create_tags_table', 1), (5, '2016_07_24_060017_add_slug_to_categories_table', 1), (6, '2016_07_24_060101_add_slug_to_tags_table', 1), (7, '2019_11_20_232112_create_users_table', 1), (8, '2019_11_27_114432_create_dreams_table', 1), (9, '2019_11_27_114642_create_tasks_table', 1), (10, '2019_11_27_123031_create_permission_tables', 2), (11, '2019_11_27_132354_add_user_id_to_articles_table', 3); -- -------------------------------------------------------- -- -- Table structure for table `model_has_permissions` -- CREATE TABLE `model_has_permissions` ( `permission_id` bigint(20) UNSIGNED NOT NULL, `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `model_id` bigint(20) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `model_has_roles` -- CREATE TABLE `model_has_roles` ( `role_id` bigint(20) UNSIGNED NOT NULL, `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `model_id` bigint(20) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `model_has_roles` -- INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES (1, 'App\\Models\\BackpackUser', 1), (1, 'App\\Models\\BackpackUser', 4); -- -------------------------------------------------------- -- -- Table structure for table `permissions` -- CREATE TABLE `permissions` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `guard_name` varchar(255) 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 `permissions` -- INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES (1, 'login to admin', 'web', '2019-11-27 05:54:50', '2019-11-27 05:54:50'); -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `guard_name` varchar(255) 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 `roles` -- INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES (1, 'Admin', 'web', '2019-11-27 05:40:15', '2019-11-27 05:40:15'); -- -------------------------------------------------------- -- -- Table structure for table `role_has_permissions` -- CREATE TABLE `role_has_permissions` ( `permission_id` bigint(20) UNSIGNED NOT NULL, `role_id` bigint(20) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `role_has_permissions` -- INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES (1, 1); -- -------------------------------------------------------- -- -- Table structure for table `tags` -- CREATE TABLE `tags` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `tasks` -- CREATE TABLE `tasks` ( `id` bigint(20) UNSIGNED NOT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `dream_id` int(10) UNSIGNED NOT NULL, `status` enum('COMPLETE','PROGRESS','UNSTARTED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'UNSTARTED', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `fullname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 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 `users` -- INSERT INTO `users` (`id`, `name`, `fullname`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Fia', NULL, 'flaw.riette@gmail.com', NULL, '$2y$10$yolqO9she6TMcKOWbuN8tur7S15DWkgcctXpnEnzOh/rSwBzYiFWm', NULL, '2019-11-27 05:33:13', '2019-11-27 05:41:57'), (3, 'Fia', NULL, 'fia_syifa@apps.ipb.ac.id', NULL, '$2y$10$8orFX28D5MY.A.RU0Vvr0uFDF/wXhUtKEybJ4Hz5Pu03WzOQxu3si', 'iZmyAECOAW0lfox8CkwoLJBjrPNho70d4kQ7IPAfywDRyVkywWLTrSBRDecf', '2019-11-27 05:54:13', '2019-11-27 05:54:13'), (4, 'Kyuururi', NULL, 'kyuururi@hotmail.com', NULL, '$2y$10$fuESl86/v4jw/jt06diCZu8yzp8uHKK2/rq8XEtb7xCF6BFZqzU4e', NULL, '2019-11-27 07:53:05', '2019-11-27 07:53:05'); -- -- Indexes for dumped tables -- -- -- Indexes for table `articles` -- ALTER TABLE `articles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `article_tag` -- ALTER TABLE `article_tag` ADD PRIMARY KEY (`id`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `categories_slug_unique` (`slug`); -- -- Indexes for table `dreams` -- ALTER TABLE `dreams` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `model_has_permissions` -- ALTER TABLE `model_has_permissions` ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`), ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`); -- -- Indexes for table `model_has_roles` -- ALTER TABLE `model_has_roles` ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`), ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`); -- -- Indexes for table `permissions` -- ALTER TABLE `permissions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `role_has_permissions` -- ALTER TABLE `role_has_permissions` ADD PRIMARY KEY (`permission_id`,`role_id`), ADD KEY `role_has_permissions_role_id_foreign` (`role_id`); -- -- Indexes for table `tags` -- ALTER TABLE `tags` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `tags_slug_unique` (`slug`); -- -- Indexes for table `tasks` -- ALTER TABLE `tasks` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `articles` -- ALTER TABLE `articles` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `article_tag` -- ALTER TABLE `article_tag` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `dreams` -- ALTER TABLE `dreams` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `permissions` -- ALTER TABLE `permissions` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `roles` -- ALTER TABLE `roles` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tags` -- ALTER TABLE `tags` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tasks` -- ALTER TABLE `tasks` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- Constraints for dumped tables -- -- -- Constraints for table `model_has_permissions` -- ALTER TABLE `model_has_permissions` ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE; -- -- Constraints for table `model_has_roles` -- ALTER TABLE `model_has_roles` ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE; -- -- Constraints for table `role_has_permissions` -- ALTER TABLE `role_has_permissions` ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE; 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
5b206e322d48895d43478a18ce7cacbd12582e75
SQL
zhangpinglong/blog
/migration/article.sql
UTF-8
1,184
3.28125
3
[]
no_license
/* Navicat Premium Data Transfer Source Server : Mysql Source Server Type : MySQL Source Server Version : 50731 Source Schema : blog Target Server Type : MySQL Target Server Version : 50731 File Encoding : 65001 Date: 08/10/2020 21:21:16 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for article -- ---------------------------- DROP TABLE IF EXISTS `article`; CREATE TABLE `article` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户id', `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文章标题', `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文章内容', `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;
true
7131a3e92fd6b9a0faf218d49b7b788f9700b62b
SQL
UCLALibrary/sql-scripts
/Voyager/Circulation/External 5 Reports.sql
UTF-8
3,309
4.09375
4
[]
no_license
CREATED SINCE 2006 select p.last_name, p.first_name, perm_add.address_line1, perm_add.address_line2, perm_add.city, perm_add.state_province, perm_add.zip_postal, perm_phone_primary.phone_number, email.address_line1 email, pg.patron_group_name patron_group, vger_support.lws_csc.concat_stat_cats(p.patron_id) stat_cats from ucladb.patron p -- Join with Voyager's patron_barcode table. Pick only active status barcodes. inner join ucladb.PATRON_BARCODE pb on pb.patron_id = p.patron_id and pb.barcode_status = 1 -- Join with Voyager's patron_group table. inner join ucladb.PATRON_GROUP pg on pg.patron_group_id = pb.patron_group_id -- Join with Voyager's patron_address table. Pick only permanent address records. inner join ucladb.PATRON_ADDRESS perm_add on perm_add.patron_id = p.patron_id and perm_add.address_type = 1 -- Join with Voyager's patron_phone table for phone (primary). left outer join ucladb.PATRON_PHONE perm_phone_primary on perm_phone_primary.address_id = perm_add.address_id and perm_phone_primary.phone_type = 1 -- Join with Voyager's patron_address table. Pick only e-mail address records. left outer join ucladb.PATRON_ADDRESS email on email.patron_id = p.patron_id and email.address_type = 3 where p.create_date >= to_date('2006-01', 'YYYY-MM') and ( pg.patron_group_name = 'External 5 - UCLA Alumni' or pg.patron_group_name = 'External 5 - Other' ) order by p.last_name, p.first_name ALUMNI ISSUED/RENEWED SELECT pb.patron_barcode, CASE WHEN TRUNC(pb.barcode_status_date) BETWEEN TRUNC(TO_DATE('20080701', 'YYYYMMDD')) AND TRUNC(TO_DATE('20090701', 'YYYYMMDD')) THEN 'issued' WHEN TRUNC(p.expire_date) BETWEEN TRUNC(TO_DATE('20090701', 'YYYYMMDD')) AND TRUNC(TO_DATE('20100701', 'YYYYMMDD')) THEN 'renewed' ELSE 'unknown' END AS card_type FROM ucladb.patron p inner join ucladb.patron_barcode pb ON p.patron_id = pb.patron_id WHERE -- pick the patron group we're interested in. pb.patron_group_id = 2 AND -- pick issed and renewed cards. ( -- issued. TRUNC(pb.barcode_status_date) BETWEEN TRUNC(TO_DATE('20080701', 'YYYYMMDD')) AND TRUNC(TO_DATE('20090701', 'YYYYMMDD')) OR -- renewed (expires the following year). TRUNC(p.expire_date) BETWEEN TRUNC(TO_DATE('20090701', 'YYYYMMDD')) AND TRUNC(TO_DATE('20100701', 'YYYYMMDD')) ) -- pick out the active patron barcode, or the one with the lowest number status -- if there isn't an active one. AND NOT EXISTS ( SELECT * FROM ucladb.patron_barcode pb2 WHERE pb.patron_id = pb2.patron_id AND ( pb.barcode_status > pb2.barcode_status OR ( pb.barcode_status = pb2.barcode_status AND pb2.patron_barcode_id < pb.patron_barcode_id ) ) ) BY YEAR SELECT p.last_name || ', ' || p.first_name AS patron_name, ma.address_line1, ma.address_line2, ma.city, ma.state_province, ma.zip_postal, ma.country, ea.address_line1 AS email FROM ucladb.patron p inner join ucladb.patron_barcode pb ON p.patron_id = pb.patron_id left outer join ucladb.patron_address ma ON p.patron_id = ma.patron_id left outer join ucladb.patron_address ea ON p.patron_id = ea.patron_id WHERE pb.patron_group_id = 11 AND TRUNC(p.create_date) BETWEEN TRUNC(TO_DATE('07/01/2007','MM/DD/YYYY')) AND TRUNC(TO_DATE('06/30/2008','MM/DD/YYYY')) AND ma.address_type = 1 AND ea.address_type = 3 ORDER BY patron_name
true
77401e51a0e917451d2d8e77eb9bbfa61a00f831
SQL
SextoSistemasDev20/Repo-Desarrollo
/SCRIPTS/scripts 2020 - copia.sql
UTF-8
6,238
3.421875
3
[]
no_license
/*==============================================================*/ /* Database: PROYECTO_INTEGRADOR_6B */ /*==============================================================*/ CREATE DATABASE PROYECTO_INTEGRADOR_6B; USE PROYECTO_INTEGRADOR_6B; /*==============================================================*/ /* Table: TBL_CAT_PRODUCTOS */ /*==============================================================*/ CREATE TABLE TBL_CAT_PRODUCTOS ( CAT_ID INT NOT NULL AUTO_INCREMENT, CAT_NOMBRE VARCHAR(100), CAT_DESCRIPCION VARCHAR(800), CAT_ESTADO CHAR(1), CAT_ADD TIMESTAMP, PRIMARY KEY (CAT_ID) ); /*==============================================================*/ /* Table: TBL_CLIENTE_PROVEEDOR */ /*==============================================================*/ CREATE TABLE TBL_CLIENTE_PROVEEDOR ( CLI_ID INT NOT NULL AUTO_INCREMENT, CLI_PNOMBRE VARCHAR(100), CLI_SNOMBRE VARCHAR(100), CLI_PAPELLIDO VARCHAR(100), CLI_SAPELLIDO VARCHAR(100), CLI_DIRECCION VARCHAR(100), CLI_TIP_DNI VARCHAR(20), CLI_DNI VARCHAR(20), CLI_F_NACIMIENTO DATE, CLI_GENERO CHAR(1), CLI_CELULAR VARCHAR(20), CLI_TELEFONO VARCHAR(20), CLI_EMAIL VARCHAR(100), CLI_ESTADO CHAR(1), CLI_ADD TIMESTAMP, PRIMARY KEY (CLI_ID) ); /*==============================================================*/ /* Table: TBL_DETALLE_VENTA */ /*==============================================================*/ CREATE TABLE TBL_DETALLE_VENTA ( DET_VENT_ID INT NOT NULL AUTO_INCREMENT, PROD_ID INT, VENT_ID INT, DET_VENT_CANTIDAD INT, DET_VENT_PRECIO_VENTA DECIMAL(10,2), DET_VENT_DESCUENTO DECIMAL(10,2), DET_VENT_ESTADO CHAR(1), DET_VENT_ADD TIMESTAMP, PRIMARY KEY (DET_VENT_ID) ); /*==============================================================*/ /* Table: TBL_PERSONAL */ /*==============================================================*/ CREATE TABLE TBL_PERSONAL ( PERS_ID INT NOT NULL AUTO_INCREMENT, PERS_PNOMBRE VARCHAR(100), PERS_SNOMBRE VARCHAR(100), PERS_PAPELLIDO VARCHAR(100), PERS_SAPELLIDO VARCHAR(100), PERS_DIRECCION VARCHAR(100), PERS_TIP_DNI VARCHAR(20), PERS_DNI VARCHAR(20), PERS_F_NACIMIENTO DATE, PERS_GENERO CHAR(1), PERS_CELULAR VARCHAR(20), PERS_TELEFONO VARCHAR(20), PERS_EMAIL VARCHAR(100), PERS_ESTADO CHAR(1), PERS_ADD TIMESTAMP, PRIMARY KEY (PERS_ID) ); /*==============================================================*/ /* Table: TBL_PRODUCTOS */ /*==============================================================*/ CREATE TABLE TBL_PRODUCTOS ( PROD_ID INT NOT NULL AUTO_INCREMENT, CAT_ID INT, PROD_NOMBRE VARCHAR(100), PROD_DESCRIPCION VARCHAR(800), PROD_STOCK INT, PROD_IMAGEN VARCHAR(50), PROD_ESTADO CHAR(1), PROD_ADD TIMESTAMP, PRIMARY KEY (PROD_ID) ); /*==============================================================*/ /* Table: TBL_TIP_USUARIO */ /*==============================================================*/ CREATE TABLE TBL_TIP_USUARIO ( TUSU_ID INT NOT NULL AUTO_INCREMENT, TUSU_NOMBRE VARCHAR(100), TUSU_ESTADO CHAR(1), TUSU_ADD TIMESTAMP, PRIMARY KEY (TUSU_ID) ); /*==============================================================*/ /* Table: TBL_USUARIO */ /*==============================================================*/ CREATE TABLE TBL_USUARIO ( USU_ID INT NOT NULL AUTO_INCREMENT, TUSU_ID INT, PERS_ID INT, USU_USER VARCHAR(20), USU_PASSWORD VARCHAR(100), USU_ESTADO CHAR(1), USU_ADD TIMESTAMP, PRIMARY KEY (USU_ID) ); /*==============================================================*/ /* Table: TBL_VENTA */ /*==============================================================*/ CREATE TABLE TBL_VENTA ( VENT_ID INT NOT NULL AUTO_INCREMENT, PERS_ID INT, CLI_ID INT, VENT_TIP_COMPROBANTE VARCHAR(100), VENT_NUM_FACTURA VARCHAR(100), VENT_NUM_AUTORIZACION VARCHAR(100), VENT_FECHA_VENTA DATETIME, VENT_IVA DECIMAL(10,2), VENT_TOTAL_VENTA DECIMAL(10,2), VENT_ESTADO CHAR(1), VENT_ADD TIMESTAMP, PRIMARY KEY (VENT_ID) ); ALTER TABLE TBL_DETALLE_VENTA ADD CONSTRAINT FK_PRODUCTOS_A_DETALLE_VENTA FOREIGN KEY (PROD_ID) REFERENCES TBL_PRODUCTOS (PROD_ID) ON DELETE RESTRICT ON UPDATE RESTRICT; ALTER TABLE TBL_DETALLE_VENTA ADD CONSTRAINT FK_VENTA_A_DETALLE_VENTA FOREIGN KEY (VENT_ID) REFERENCES TBL_VENTA (VENT_ID) ON DELETE RESTRICT ON UPDATE RESTRICT; ALTER TABLE TBL_PRODUCTOS ADD CONSTRAINT FK_CATEGORIA_PRODUCTOS_A_PRODUCTOS FOREIGN KEY (CAT_ID) REFERENCES TBL_CAT_PRODUCTOS (CAT_ID) ON DELETE RESTRICT ON UPDATE RESTRICT; ALTER TABLE TBL_USUARIO ADD CONSTRAINT FK_PERSONAL_A_USUARIO FOREIGN KEY (PERS_ID) REFERENCES TBL_PERSONAL (PERS_ID) ON DELETE RESTRICT ON UPDATE RESTRICT; ALTER TABLE TBL_USUARIO ADD CONSTRAINT FK_TIPOS_USUARIO_A_USUARIO FOREIGN KEY (TUSU_ID) REFERENCES TBL_TIP_USUARIO (TUSU_ID) ON DELETE RESTRICT ON UPDATE RESTRICT; ALTER TABLE TBL_VENTA ADD CONSTRAINT FK_CLIENTE_PROVEEDOR_A_VENTA FOREIGN KEY (CLI_ID) REFERENCES TBL_CLIENTE_PROVEEDOR (CLI_ID) ON DELETE RESTRICT ON UPDATE RESTRICT; ALTER TABLE TBL_VENTA ADD CONSTRAINT FK_PERSONAL_A_VENTA FOREIGN KEY (PERS_ID) REFERENCES TBL_PERSONAL (PERS_ID) ON DELETE RESTRICT ON UPDATE RESTRICT;
true
4c761ef32de4d8cbbfb6dbb8a549226836adffdf
SQL
Gdaimon/poliSilabos
/db/Antiguo Sql/scriptCorregido.sql
UTF-8
36,965
3.25
3
[]
no_license
--Creacion de las Tablas CREATE TABLE public .par_usuarios( id SERIAL PRIMARY KEY, id_usuario integer UNIQUE, tipo_cedula text NOT NULL, nombre text NOT NULL, apellido text NOT NULL, email text NOT NULL, password text NOT NULL, perfil integer NOT NULL, fecha_creacion date NOT NULL, estado_usuario boolean NOT NULL DEFAULT TRUE ) WITH(OIDS = FALSE); ALTER TABLE public .par_usuarios OWNER TO polisilabo; CREATE TABLE public .par_facultad( id SERIAL PRIMARY KEY, nombre_facultad text NOT NULL, ciudad_facultad text NOT NULL, fecha_creacion date NOT NULL, estado_facultad boolean NOT NULL DEFAULT TRUE ) WITH(OIDS = FALSE); ALTER TABLE public .par_facultad OWNER TO polisilabo; CREATE TABLE public .par_departamento( id SERIAL PRIMARY KEY, id_facultad integer references par_facultad(id), nombre_departamento text NOT NULL, ciudad_departamento text NOT NULL, fecha_creacion date NOT NULL, estado_departamento boolean NOT NULL DEFAULT TRUE ) WITH(OIDS = FALSE); ALTER TABLE public .par_departamento OWNER TO polisilabo; CREATE TABLE public .par_materias( id SERIAL PRIMARY KEY, cod_materia integer UNIQUE, nombre text NOT NULL, descripcion text NOT NULL, logro text NOT NULL, modalidad text NOT NULL, no_creditos integer NOT NULL, duracion text NOT NULL, tipo_asignatura text NOT NULL, fecha_creacion date NOT NULL, estado_materia boolean NOT NULL DEFAULT TRUE ) WITH(OIDS = FALSE); ALTER TABLE public .par_materias OWNER TO polisilabo; CREATE TABLE public .par_competencia( id SERIAL PRIMARY KEY, cod_competencia integer, descripcion text NOT NULL, fecha_creacion date NOT NULL, estado_competencia boolean NOT NULL DEFAULT TRUE ) WITH(OIDS = FALSE); ALTER TABLE public .par_competencia OWNER TO polisilabo; CREATE TABLE public .par_nucleo_tematico( id SERIAL PRIMARY KEY, cod_materia integer references par_materias(cod_materia), descripcion text NOT NULL, fecha_creacion date NOT NULL, estado_nucleo boolean NOT NULL DEFAULT TRUE ) WITH(OIDS = FALSE); ALTER TABLE public .par_nucleo_tematico OWNER TO polisilabo; CREATE TABLE public .par_titulo( id SERIAL PRIMARY KEY, cod_materia integer references par_materias(cod_materia), descripcion text NOT NULL, fecha_creacion date NOT NULL, estado_nucleo boolean NOT NULL DEFAULT TRUE ) WITH(OIDS = FALSE); ALTER TABLE public .par_titulo OWNER TO polisilabo; CREATE TABLE public .par_objetivo( id SERIAL PRIMARY KEY, cod_materia integer references par_materias(cod_materia), descripcion text NOT NULL, fecha_creacion date NOT NULL, estado_nucleo boolean NOT NULL DEFAULT TRUE ) WITH(OIDS = FALSE); ALTER TABLE public .par_objetivo OWNER TO polisilabo; CREATE TABLE public .par_eje( id SERIAL PRIMARY KEY, cod_materia integer references par_materias(cod_materia), descripcion text NOT NULL, fecha_creacion date NOT NULL, estado_nucleo boolean NOT NULL DEFAULT TRUE ) WITH(OIDS = FALSE); ALTER TABLE public .par_eje OWNER TO polisilabo; --Insertar Datos Tablas --Tabla par_usuarios insert into par_usuarios( "id_usuario", "tipo_cedula", "nombre", "apellido", "email", "password", "perfil", "fecha_creacion", "estado_usuario" ) values ( 99123465, 'CE', 'Mauricio', 'NishidaP', 'mauricio@poligran.edu.co', '1234', 1, current_timestamp, TRUE ), ( 12345678, 'CC', 'Carlos', 'Charris', 'carlos@poligran.edu.co', '1234', 1, current_timestamp, TRUE ), ( 12345677, 'CC', 'Diego', 'Meza', 'diego@poligran.edu.co', '1234', 1, current_timestamp, TRUE ), ( 12345676, 'CC', 'Alejandro', 'Gaitan', 'Alejandro@poligran.edu.co', '1234', 1, current_timestamp, TRUE ); --Tabla par_facultad insert into par_facultad( "nombre_facultad", "ciudad_facultad", "fecha_creacion", "estado_facultad" ) values ( 'Facultad de Ciencias Administrativas, Económicas y Contables', 'Bogotá', current_timestamp, TRUE ), ( 'Facultad de Ingeniería y Ciencias Básicas', 'Bogotá', current_timestamp, TRUE ), ( 'Facultad de Mercadeo, Comunicación y Artes', 'Bogotá', current_timestamp, TRUE ), ( 'Facultad de Ciencias Sociales', 'Bogotá', current_timestamp, TRUE ); --Tabla par_departamento insert into par_departamento( "id_facultad", "nombre_departamento", "ciudad_departamento", "fecha_creacion", "estado_departamento" ) values ( 2, 'Ciencias básicas', 'Bogotá', current_timestamp, TRUE ), ( 2, 'Ingeniería de sistemas y telecomunicaciones', 'Bogotá', current_timestamp, TRUE ), ( 2, 'Ingeniería industrial', 'Bogotá', current_timestamp, TRUE ), ( 1, 'Administración', 'Bogotá', current_timestamp, TRUE ), ( 2, 'Ingeniería y Ciencias Básicas', 'Bogotá', current_timestamp, TRUE ), ( 1, 'Economía e Internacional', 'Bogotá', current_timestamp, TRUE ); --Tabla par_materias insert into par_materias( "cod_materia", "nombre", "descripcion", "logro", "modalidad", "no_creditos", "duracion", "tipo_asignatura", "fecha_creacion", "estado_materia" ) values ( 1002, 'Organización y métodos', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1045, 'Gerencia de producción', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1087, 'Gestión de talento humano', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1203, 'Matemática financiera', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1211, 'Estadística I', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1237, 'Probabilidad', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1238, 'Estadística inferencial', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1252, 'Investigación de operaciones', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1261, 'Análisis y verificación de algoritmos', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1286, 'Teoría de juegos', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1801, 'Fundamentos de economía', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 1861, 'Fundamentos de producción', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2292, 'Simulación gerencial', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2626, 'Estructuras de datos', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2633, 'Elementos de la teoría de la computación', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2640, 'Autómatas, gramáticas y lenguajes', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2655, 'Gerencia de proyectos informáticos', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2657, 'Ingeniería del software II', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2658, 'Bases de datos', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2664, 'Telecomunicaciones', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2668, 'Arquitectura del computador', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2689, 'Sistemas Distribuidos', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2697, 'Práctica aplicada', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2701, 'Procesos industriales', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2702, 'Producción', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2704, 'Distribución de planta', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2707, 'Simulación', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2712, 'Metaheurísticas', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2714, 'Física de plantas', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2717, 'Control de la calidad', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2718, 'Automatización BPM', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2719, 'Automatización industrial', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2721, 'Logística y transporte', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2734, 'Programación estocástica', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2791, 'Programación de computadores', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2799, 'Seguridad y salud ocupacional', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2801, 'Contabilidad general', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 2840, 'Costos y presupuestos', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 4001, 'Dibujo técnico', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 7414, 'Sistemas de información en gestión logística', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 8020, 'Empaques y manejo de materiales', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 8021, 'Scheduling e Inventarios', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 9019, 'Pensamiento Algorítmico', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 9020, 'Introducción a la Ingeniería y Ciencias Básicas', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 9021, 'Herramientas de lógica computacional', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 9022, 'Ingeniería del software I', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 9024, 'Sistemas digitales y ensambladores', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 9025, 'Paradigmas de programación', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 9033, 'Introducción a la robótica', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 9034, 'Programación WEB con PHP', 'prueba', 'III', 'V', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ), ( 9036, 'Fundamentos de química para ingenieros', 'prueba', 'III', 'P', 3, 'Semestral', 'Teórico-práctica', current_timestamp, TRUE ); --Tabla par_competencia insert into par_competencia( "cod_competencia", "descripcion", "fecha_creacion", "estado_competencia" ) values ( 100, 'Abstraer información y comportamiento de objetos del mundo real, utilizando herramientas formales, para la construcción de modelos que permitan el diseño de soluciones.', current_timestamp, TRUE ), ( 101, 'Actuar de forma autónoma, ética y responsable.', current_timestamp, TRUE ), ( 102, 'Actuar de manera autónoma, ética y responsable.', current_timestamp, TRUE ), ( 103, 'Adoptar nuevos conceptos y aceptar su estudio y desarrollo.', current_timestamp, TRUE ), ( 104, 'Adquirir conocimientos en seguridad e higiene ocupacional para aportar a la preservación de los elementos que intervienen en una organización .', current_timestamp, TRUE ), ( 105, 'Analizar e interpretar la información financiera de una organización así como también los fundamentos de economía.', current_timestamp, TRUE ), ( 106, 'Analizar la información asociada con un problema de decisión, con el fin de identificar las relaciones principales entre los elementos que lo componen.', current_timestamp, TRUE ), ( 107, 'Analizar y mejorar el desempeño de sistemas de telecomunicaciones.', current_timestamp, TRUE ), ( 108, 'Analizar y presentar soluciones a problemas basados en los conocimientos básicos.', current_timestamp, TRUE ), ( 109, 'Aplica conceptos básicos de administración y gerencia de un proyecto de software.', current_timestamp, TRUE ), ( 110, 'Aplica las metodologías alternas que se tienen para el desarrollo de software.', current_timestamp, TRUE ), ( 111, 'Aplicabilidad práctica de la ingeniería y la tecnología.', current_timestamp, TRUE ), ( 112, 'Aplicar los conocimientos matemáticos para medir la calidad de un proceso, producto o servicio que permitan dar un diagnóstico que incorpore los conceptos y herramientas de control estadístico.', current_timestamp, TRUE ), ( 113, 'Aplicar conceptos teóricos de ingeniería industrial en prácticas supervisadas en el laboratorio.', current_timestamp, TRUE ), ( 114, 'Aplicar conocimientos teóricos y prácticos en la planeación, diseño y operación de servicios de redes de telecomunicaciones.', current_timestamp, TRUE ), ( 115, 'Aplicar diferentes metodologías de Ingeniería de Software para la construcción de Sistemas de Tecnología de Información y Telecomunicaciones.', current_timestamp, TRUE ), ( 116, 'Aplicar el campo jurídico-normativo relacionado con las telecomunicaciones y los sistemas informáticos.', current_timestamp, TRUE ), ( 117, 'Aplicar esquemas de funcionamiento que requieran diversos conceptos simultáneamente, organizar situaciones complejas como estructuras basadas en principios simples, resolver matemáticamente planteamientos de casos particulares, asociar un esquema o sistema físico o químico con leyes naturales o propiedades matemáticas y entender el vínculo entre su resolución y las leyes que lo sustentan.', current_timestamp, TRUE ), ( 118, 'Aplicar herramientas de análisis y diseño en la construcción y creación de sistemas de información y soluciones en telecomunicaciones.', current_timestamp, TRUE ), ( 119, 'Aplicar las mejores prácticas en lo referente a la construcción y ejecución de proyectos informáticos.', current_timestamp, TRUE ), ( 120, 'Aplicar las metodologías existentes en la gestión de proyectos para lograr su culminación con existo.', current_timestamp, TRUE ), ( 121, 'Aplicar los modelos y algoritmos estudiados en casos particulares o problemas típicos.', current_timestamp, TRUE ), ( 122, 'Aplicar modelos matemáticos en el planteamiento de problemas.', current_timestamp, TRUE ), ( 123, 'Aplicar procedimientos algorítmicos avanzados para la solución de problemas.', current_timestamp, TRUE ), ( 124, 'Aplicar técnicas de análisis probabilístico para el mejoramiento del desempeño de sistemas productivos y del área de servicios.', current_timestamp, TRUE ), ( 125, 'Aprender a utilizar herramientas tecnológicas actuales para la implementación de soluciones tecnologicas en el sector TIC.', current_timestamp, TRUE ), ( 126, 'Aprender autónomamente el dominio de las herramientas tecnológicas actuales para la implementación de soluciones de sistemas, esto incluye lenguajes de programación, ambientes de programación, metodologías, paradigmas de desarrollo, librerías, frameworks, etc.', current_timestamp, TRUE ), ( 127, 'Asimilar problemas de índole tridimensional para ser aplicadas en el desarrollo de producto.', current_timestamp, TRUE ), ( 128, 'Asociar conceptos, comprender sus implicaciones teóricas, predecir las consecuencias numéricas, esclarecer las diferencias entre diversos casos y componer marcos conceptuales a partir de diferentes principios.', current_timestamp, TRUE ), ( 129, 'Asumir un rol en el trabajo en equipo, integrando aspectos tales como autonomía, liderazgo, responsabilidad, creatividad, puntualidad, honestidad y respeto.', current_timestamp, TRUE ), ( 130, 'Asumir una postura responsable sobre los éxitos y fracasos en todas las actividades del quehacer académico.', current_timestamp, TRUE ), ( 131, 'Comprender e interpretar apropiadamente los resultados obtenidos al implementar un problema de optimización.', current_timestamp, TRUE ), ( 132, 'Comprender ideas principales de textos producidos en inglés y elaboración de documentos propios.', current_timestamp, TRUE ), ( 133, 'Comprender una situación compleja y descomponerla en partes más simples, estableciendo relaciones lógicas entre ellas.', current_timestamp, TRUE ), ( 134, 'Comprender y crear una visión crítica acerca de las implicaciones sociales, culturales, económicas, laborales y demás, de las soluciones tecnológicas que se plantean.', current_timestamp, TRUE ), ( 135, 'Comunicar con claridad y precisión diferentes tipos razonamientos.', current_timestamp, TRUE ), ( 136, 'Comunicar eficientemente ideas y proyectos.', current_timestamp, TRUE ), ( 137, 'Comunicarse efectivamente con el otro mediante el empleo de medios de expresión oral, escrita, gráfica y formas no verbales', current_timestamp, TRUE ), ( 138, 'Conocer las metodologías para la identificación , evaluación, control de riesgos y valoración de accidentes de trabajo.', current_timestamp, TRUE ), ( 139, 'Conocer técnicas modernas para la mejora de la calidad de las empresas, las formas de aplicarlas y los beneficios que se pueden obtener de su implementación.', current_timestamp, TRUE ), ( 140, 'Construir y analizar argumentos matemáticos que modelan y analizan situaciones tanto abstractas como físicas.', current_timestamp, TRUE ), ( 141, 'Construir y evaluar propuestas de negocio asociada a proyectos de infraestructura, seguridad y servicios de TICs.', current_timestamp, TRUE ), ( 142, 'Construye e interpreta los diversos indicadores utilizados para medir la calidad del software.', current_timestamp, TRUE ), ( 143, 'Crear relaciones con otros profesionales de diferentes disciplinas para gestionar proyectos.', current_timestamp, TRUE ), ( 144, 'Crear un juicio crítico ante problemáticas ambientales.', current_timestamp, TRUE ), ( 145, 'Crear un pensamiento analítico y el conocimiento ante un panorama innovador.', current_timestamp, TRUE ), ( 146, 'Desarrollar habilidades efectivas de gestión en proyectos de desarrollo de software.', current_timestamp, TRUE ), ( 147, 'Desarrollar habilidades efectivas de gestión en proyectos de infraestructura, seguridad y servicios de TICs.', current_timestamp, TRUE ), ( 148, 'Desarrollar la autonomía intelectual en las áreas básicas del programa como las matemáticas, física, química y lecto-escritura.', current_timestamp, TRUE ), ( 149, 'Desarrollar sistemas de información, a través de simulaciones, bien sea programadas o desarrolladas desde su base.', current_timestamp, TRUE ), ( 150, 'Desarrollar un pensamiento afín al desarrollo sostenible y la creación de productos basados en la investigación.', current_timestamp, TRUE ), ( 151, 'Desarrollar un pensamiento innovador y emprendedor para la creación de empresa o proyectos ambientales.', current_timestamp, TRUE ), ( 152, 'Detectar oportunidades de trabajo, negocio y desarrollo en beneficio de sí mismo y de su comunidad.', current_timestamp, TRUE ), ( 153, 'Determinar el modelo pertinente que se deba emplear en una situación. Realizar las representaciones para aplicarlo, así como los cálculos necesarios para resolverlo, o para hacer predicciones a partir de él.', current_timestamp, TRUE ), ( 154, 'Dimensionar aspectos tecnicos en proyectos de infraestructura, seguridad y servicios de TICs.', current_timestamp, TRUE ), ( 155, 'Diseñar procesos, componentes y sistemas teniendo en cuenta restricciones del entorno para satisfacer las necesidades del mismo.', current_timestamp, TRUE ), ( 156, 'Diseñar y conducir experimentos, analizar e interpretar datos propios de los problemas que competen al diseño y planeación de sistemas productivos automatizados y de plantas industriales.', current_timestamp, TRUE ), ( 157, 'Diseñar y contrastar hipótesis, a partir de la información o de los conocimientos de una investigación, con el propósito de producir un avance en el desarrollo de nuevos conocimientos.', current_timestamp, TRUE ), ( 158, 'Dominar el lenguaje y métodos matemáticos indispensables para lograr comprensión de problemas y discusiones cotidianas contemporáneas en el área de ingeniería.', current_timestamp, TRUE ), ( 159, 'Emplear adecuadamente modelos interpretativos de fenómenos de la naturaleza para enfrentar un problema que implica un número mínimo de variables.', current_timestamp, TRUE ), ( 160, 'Emplear estrategias de estudio efectivas que promuevan la motivación intrínseca en el proceso de aprendizaje.', current_timestamp, TRUE ), ( 161, 'Entender el impacto de las soluciones de la ingeniería en un contexto económico, ambiental y social en la evolución y actualización de los mercados en los que se encuentra inmerso.', current_timestamp, TRUE ), ( 162, 'Establecer relaciones entre variables e identificar las diferencias entre sus comportamientos.', current_timestamp, TRUE ), ( 163, 'Evaluar Sistemas de Tecnologías de Información, tanto software como hardware, a partir de diferentes criterios.', current_timestamp, TRUE ), ( 164, 'Explicar un fenómeno y generar un modelo interpretativo del mismo, que permita la fragmentación de éste en sus variables y la planificación de cómo estudiarlo.', current_timestamp, TRUE ), ( 165, 'Explorar diferentes fuentes de información y conocimiento para el aprendizaje de diferentes Tecnologías de Información y Telecomunicaciones.', current_timestamp, TRUE ), ( 166, 'Explorar diferentes fuentes de información y conocimiento para el aprendizaje de temas asociados a la infraestructura, la seguridad y la gestión de TICs.', current_timestamp, TRUE ), ( 167, 'Fomentar un pensamiento emprendedor desde las ciencias básicas y su utilización para aquello.', current_timestamp, TRUE ), ( 168, 'Fortalecer el concepto de planeación al interior de las organizaciones mediante la aplicación de conocimientos, con el fin de mejorar su competitividad.', current_timestamp, TRUE ), ( 169, 'Fortalecer la capacidad para el aprendizaje autónomo y/o la aplicación de conocimientos, de técnicas y metodologías exitosas de estudio.', current_timestamp, TRUE ), ( 170, 'Generar confianza en los demás a través la honestidad, sinceridad, respeto, lealtad y demás valores.', current_timestamp, TRUE ), ( 171, 'Generar estrategias de trabajo efectivo en equipo.', current_timestamp, TRUE ), ( 172, 'Generar iniciativas empresariales a nivel de los sistemas y las telecomunicaciones.', current_timestamp, TRUE ), ( 173, 'Gestionar dispositivos pertenecientes a la infraestructura de una red de telecomunicaciones.', current_timestamp, TRUE ), ( 174, 'Gestionar y auditar las normativas más relevantes para el diagnóstico, mejoramiento y seguridad industrial en las organizaciones.', current_timestamp, TRUE ), ( 175, 'Hacer lectura crítico-reflexiva del impacto de las tecnologías de la información y la comunicación en lo social, político, económico, nacional e internacional.', current_timestamp, TRUE ), ( 176, 'Identifica las diferentes fases del ciclo de vida de un proyecto de desarrollo de software de acuerdo a los diferentes modelos de proceso que existen actualmente.', current_timestamp, TRUE ), ( 177, 'Identifica los aspectos básicos relacionados con la administración de proyectos de software y las métricas del mismo.', current_timestamp, TRUE ), ( 178, 'Identifica los conceptos principales involucrados en el paradigma de la Programación Orientada a Objetos y su utilidad en el desarrollo de proyectos enfocados en el mismo.', current_timestamp, TRUE ), ( 179, 'Identifica los estándares de codificación para los diferentes lenguajes de programación así como las mejores prácticas de programación para realizar un código legible de fácil entendimiento.', current_timestamp, TRUE ), ( 180, 'Identificar cuales variables o parámetros son los más relevantes en la dinámica del sistema, y así mismo descartar aspectos irrelevantes, o de poca incidencia con el fin de llegar a modelos matemáticos que permitan soluciones analíticas.', current_timestamp, TRUE ), ( 181, 'Identificar de manera clara y objetiva el inicio y final de todo proyecto involucrando las respectivas variables en cada fase.', current_timestamp, TRUE ), ( 182, 'Identificar diferentes fenómenos y leyes físicas en el comportamiento de Sistemas de Tecnología, Información y Telecomunicaciones, y analizar su influencia en el funcionamiento de los mismos.', current_timestamp, TRUE ), ( 183, 'Identificar elementos constitutivos de un problema, construir posibles vías de solución a la luz de sus variables y desarrollar procesos planificados y sistematizados de resolución.', current_timestamp, TRUE ), ( 184, 'Identificar información, organizarla, seleccionarla y validar fuentes y métodos de obtención de la misma.', current_timestamp, TRUE ), ( 185, 'Identificar los posibles riesgos que se pueden presentar en un proyecto.', current_timestamp, TRUE ), ( 186, 'Identificar tendencias en el desarrollo de la tecnologías utilizadas en el sector TICs.', current_timestamp, TRUE ), ( 187, 'Identificar variables y/o parámetros relevantes en la dinámica del sistema, y así mismo descartar aspectos irrelevantes, o de poca incidencia con el fin de llegar a modelos matemáticos que permitan soluciones analíticas.', current_timestamp, TRUE ), ( 188, 'Identificar variables, constantes y parámetros, las relaciones que pueden existir entre ellos y sus diversas representaciones matemáticas.', current_timestamp, TRUE ), ( 189, 'Identificar, formular y resolver problemas presentes en el control y administración de la producción, así como también en el diseño y localización de plantas industriales.', current_timestamp, TRUE ), ( 190, 'Identificar, formular y resolver problemas relacionados al área de Ingeniería Industrial', current_timestamp, TRUE ), ( 191, 'Implementar adecuadamente soluciones a situaciones problémicas que involucren sistemas tecnológicos.', current_timestamp, TRUE ), ( 192, 'Implementar un pensamiento crítico y afectivo ante las nuevas tecnologías de un mundo globalizado.', current_timestamp, TRUE ), ( 193, 'Interpretar datos presentados de diferentes formas (tablas, gráficas, esquemas, símbolos, expresión verbal), así como generar diferentes representaciones a partir de datos.', current_timestamp, TRUE ), ( 194, 'Interpretar y aplicar información técnica, normativa y legal asociada a proyectos de infraestructura, seguridad y servicios de TICs.', current_timestamp, TRUE ), ( 195, 'Manejar habilidades emocionales intrapersonales para un efectivo desarrollo de las actividades.', current_timestamp, TRUE ), ( 196, 'Manejar sus sentimientos y pensamientos hacia el logro de sus metas y propósitos, sin perder de vista la manera como esto se relaciona con las dinámicas sociales en que está inmerso.', current_timestamp, TRUE ), ( 197, 'Manejo de componentes y equipo electrónico con aplicaciones a la programación.', current_timestamp, TRUE ), ( 198, 'Medir y gestionar los impactos que la incorporacón de las tecnologias de telecomunicaciones, tienen en el ambito, social, político, económico, ambiental.', current_timestamp, TRUE ), ( 199, 'Modelar problemas de forma conceptual y matemática con el fin de proponer posibles soluciones a problemas propios de la ingeniería industrial.', current_timestamp, TRUE ), ( 200, 'Obtener, resumir, organizar, analizar e interpretar conjuntos de información (grandes), con el propósito de contribuir al esclarecimiento de un problema o de una pregunta.', current_timestamp, TRUE ), ( 201, 'Organizar estrategias de trabajo que permitan procesos eficientes y resultados exitosos.', current_timestamp, TRUE ), ( 202, 'Participar activamente, en el aula de clase, en la construcción y generación de conocimiento.', current_timestamp, TRUE ), ( 203, 'Participar con liderazgo en trabajos y proyectos que impliquen el trabajo en equipo.', current_timestamp, TRUE ), ( 204, 'Plantear procesos relacionados con la identificación de un problema o la formulación de una pregunta, y la construcción/proposición de estrategias adecuadas para su solución en la situación presentada, además de presentar el tratamiento de datos, la modelación y el uso de herramientas cuantitativas.', current_timestamp, TRUE ), ( 205, 'Plantear soluciones a los problemas empresariales, basándose en la comunicación asertiva para la toma de decisiones.', current_timestamp, TRUE ), ( 206, 'Plantear, diseñar e implementar Sistemas de Tecnología, Información y Telecomunicaciones capaces de resolver una problemática en un contexto dado, con restricciones identificadas y recursos definidos.', current_timestamp, TRUE ), ( 207, 'Poseer habilidades sociales efectivas a la hora de relacionarse y comunicarse.', current_timestamp, TRUE ), ( 208, 'Presentar juicio crítico ante los conocimientos recibidos y sin embargo mostrar una actitud flexible ante los mismos.', current_timestamp, TRUE ), ( 209, 'Proponer algoritmos y estrategias óptimas de solución a diversos problemas aplicables a ambientes reales.', current_timestamp, TRUE ), ( 210, 'Realizar actividades investigativas en problemas propios de la ingeniería industrial.', current_timestamp, TRUE ), ( 211, 'Realizar el análisis sistemático de conceptos y teorías relacionadas con problemas propios de la ingeniería industrial.', current_timestamp, TRUE ), ( 212, 'Reconocer elementos constitutivos de un problema, construir posibles vías de solución a la luz de sus variables y desarrollar procesos planificados y sistematizados de resolución.', current_timestamp, TRUE ), ( 213, 'Reconocer entornos de actuación y establecer relaciones interpersonales adecuadas, pertinentes para el desarrollo de la personalidad.', current_timestamp, TRUE ), ( 214, 'Relacionar variables independientes, dependientes e intervinientes y planificar alternativas de solución con criterios bioéticos y de efecto ambiental positivo o de mínimo riesgo.', current_timestamp, TRUE ), ( 215, 'Ser consciente de los valores y de los objetivos personales en relación con los objetivos de grupo y de comunidad.', current_timestamp, TRUE ), ( 216, 'Ser emprendedor, capaz de decidir en condiciones de incertidumbre valorando las consecuencias que ello implica.', current_timestamp, TRUE ), ( 217, 'Servirse de la autodisciplina para la ejecución de tareas de manera efectiva.', current_timestamp, TRUE ), ( 218, 'Tener consciencia de la autodisciplina como elemento clave en la ejecución de tareas.', current_timestamp, TRUE ), ( 219, 'Tener consciencia sobre la importancia y necesidad de un desarrollo profesional continuo.', current_timestamp, TRUE ), ( 220, 'Tener la capacidad y el poder de decisión para poner en acción, actuar y crear sobre algún proyecto o plan de vida.', current_timestamp, TRUE ), ( 221, 'Tomar decisiones informadas para la incorporación de nuevas tecnologías, enmarcadas en proyectos de infraestructura, seguridad y servicios de TICs.', current_timestamp, TRUE ), ( 222, 'Trabajar en medio de las diferencias para fijar metas comunes y producir resultados colectivos.', current_timestamp, TRUE ), ( 223, 'Traducir del lenguaje verbal al lenguaje formal o simbólico, deducir implicaciones necesarias no visibles a partir de enunciados incompletos y proponer procedimientos de solución no convencionales con base en el conocimiento de variables implicadas y rutas convencionales de solución."', current_timestamp, TRUE ), ( 224, 'Utilizar de forma responsable y reflexiva, estrategias de e-learning incorporado a contextos de aprendizaje de disciplinas del conocimiento.', current_timestamp, TRUE ), ( 225, 'Utilizar estrategias para la protección de la humanidad y el medio ambiente.', current_timestamp, TRUE ), ( 226, 'Utilizar herramientas informáticas CAD y CAM como herramientas de comunicación en el ámbito de la ingeniería.', current_timestamp, TRUE ), ( 227, 'Utilizar sistemas de Tecnología, Información y Telecomunicaciones que permitan la recreación de un modelo, que permita resolver problemas en el mundo real.', current_timestamp, TRUE ), ( 228, 'Utilizar técnicas, destrezas y herramientas propias de la ingeniería para aplicarla a problemas determinísticos y estocásticos de una organización.', current_timestamp, TRUE ), ( 229, 'Validar soluciones, ya sea tecnológicas o de otra índole, planteadas a problemas o necesidades del contexto local o global.', current_timestamp, TRUE ), ( 230, 'Verificar resultados, hipótesis o conclusiones que se derivan de la interpretación y de la modelación de situaciones.', current_timestamp, TRUE ); --Tabla par_nucleo_tematico INSERT INTO par_nucleo_tematico( "cod_materia", "descripcion", "fecha_creacion", "estado_nucleo" ) VALUES ( 1002, 'Conceptos básicos y diseño de producto', current_timestamp, true ), ( 1002, 'Conceptos básicos y diseño de producto', current_timestamp, true ), ( 1002, 'Gestion de proyectos.', current_timestamp, true ), ( 1002, 'Estudio del trabajo.', current_timestamp, true ), ( 1002, 'Medición de la capacidad', current_timestamp, true ), ( 1002, 'Distribución y ubicación de planta.', current_timestamp, true ), ( 1002, 'Estudio de materiales.', current_timestamp, true ), ( 1002, 'Conceptos básicos y diseño de producto', current_timestamp, true ), ( 1002, 'Conceptos básicos y diseño de producto', current_timestamp, true ), ( 1002, 'Gestion de proyectos.', current_timestamp, true ), ( 1002, 'Estudio del trabajo.', current_timestamp, true ), ( 1002, 'Medición de la capacidad', current_timestamp, true ), ( 1002, 'Distribución y ubicación de planta.', current_timestamp, true ), ( 1002, 'Estudio de materiales.', current_timestamp, true );
true
bc063f6cfc6dfe90e222b0aae85f29a9ae30b7ef
SQL
Jsamps76/SQL
/practice.sql
UTF-8
1,624
4.09375
4
[]
no_license
-- Hellow World SQL Query SELECT * FROM actor; -- Query for first name and last name in actor table SELECT first_name, last_name FROM actor; -- Query for first name that is Nick SELECT first_name, last_name FROM actor WHERE first_name = 'Nick'; -- Query for first name that equals Nick using the Like clause SELECT last_name, first_name FROM actor WHERE first_name Like 'Nick'; SELECT last_name, first_name From actor WHERE last_name like 'Wahlberg'; -- Query for first name that starts with J using LIKE and WHERE with a wildcard SELECT last_name, first_name FROM actor WHERE first_name LIKE 'J%'; -- SQL Aggregations => SUM(), ABG(), COUNT(), MIN(), MAX() -- Query to display the sum of the amounts paid that are greater than 5.99 SELECT SUM(amount) As "Total" FROM payment Where amount > 5.99 -- Query to displat the average amounts paid that are greater than 5.99 SELECT AVG(amount) AS average FROM payment WHERE amount > 5.99; -- Query to display the count of amounts paid that are greater than 5.99 SELECT COUNT (*) FROM payment Where amount > 5.99; -- Query to display the max amount paid that is greater than 5.99 SELECT MIN(amount) FROM payment WHERE amount > 5.99; -- Query to display customer_ids with the summed amount for each customer SELECT customer_id, SUM(amount) FROM payment GROUP BY customer_id ORDER BY total DESC; SELECT customer_id, COUNT(*) as num_payments FROM payment WHERE amount > 2.99 GROUP BY customer_id HAVING COUNT(*)> 10 ORDER BY num_payments DESC LIMIT 10; SELECT * FROM inventory SELECT MIN(3.99) FROM payment WHERE amount < 5.99 and amount > 3.99 SELECT * FROM inventory;
true
695d680a6c7112746c91654f40ef77d11440d463
SQL
altamira/visualstudio
/Sistema de Informação Altamira/EGISSQL.Database/dbo/Stored Procedures/Procs2/pr_fechamento_caixa_operador.sql
UTF-8
3,077
3.5
4
[]
no_license
 ------------------------------------------------------------------------------- --sp_helptext pr_fechamento_caixa_operador ------------------------------------------------------------------------------- --pr_fechamento_caixa_usuario ------------------------------------------------------------------------------- --GBS Global Business Solution Ltda 2009 ------------------------------------------------------------------------------- --Stored Procedure : Microsoft SQL Server 2000 --Autor(es) : Carlos Cardoso Fernandes --Banco de Dados : Egissql --Objetivo : Fechamento do Movimento de Caixa do Usuário/Operador -- --Data : 05.02.2009 --Alteração : -- -- ------------------------------------------------------------------------------ create procedure pr_fechamento_caixa_operador @cd_operador_caixa int = 0, @dt_inicial datetime = '', @dt_final datetime = '' as --select * from movimento_caixa_recebimento --select * from tipo_lancamento_caixa --select * from nota_saida select oc.cd_operador_caixa, mc.cd_tipo_lancamento, oc.nm_operador_caixa, (select sum(isnull(vl_movimento_recebimento,0.00)) from movimento_caixa_recebimento where cd_operador_caixa = oc.cd_operador_caixa and cd_tipo_lancamento = mc.cd_tipo_lancamento) as somaGrupo, (select sum(isnull(vl_movimento_recebimento,0.00)) from movimento_caixa_recebimento where cd_operador_caixa = oc.cd_operador_caixa) as somaGrupoOperador, tlc.nm_tipo_lancamento, ns.nm_razao_social_nota as Cliente, mc.cd_documento as Documento, mc.vl_movimento_recebimento as Valor, mc.nm_obs_movimento_caixa as Observacao, hr.nm_historico_recebimento, mc.nm_historico_complemento, isnull(hr.nm_historico_recebimento,'') + ' ' + isnull(mc.nm_historico_complemento,'') as Historico from movimento_caixa_recebimento mc with (nolock) left outer join Operador_Caixa oc with (nolock) on oc.cd_operador_caixa = mc.cd_operador_caixa left outer join Tipo_Lancamento_Caixa tlc with (nolock) on tlc.cd_tipo_lancamento = mc.cd_tipo_lancamento left outer join Nota_Saida ns with (nolock) on ns.cd_nota_saida = mc.cd_nota_saida left outer join Veiculo v with (nolock) on v.cd_veiculo = mc.cd_veiculo left outer join Motorista m with (nolock) on m.cd_motorista = mc.cd_motorista left outer join Historico_Recebimento hr with (nolock) on hr.cd_historico_recebimento = mc.cd_historico_recebimento where mc.dt_movimento_caixa between @dt_inicial and @dt_final and mc.cd_operador_caixa = case when @cd_operador_caixa = 0 then mc.cd_operador_caixa else @cd_operador_caixa end order by mc.cd_operador_caixa, -- Não retirar a ordenação pode interferir no relatório mc.cd_tipo_lancamento -- Não retirar a ordenação pode interferir no relatório --select * from historico_recebimento
true
5c7011c091ae57b8f895e2c2598b928b4ec37a97
SQL
nvanhai/tct2013
/Source/Scipt_NTK_3.2.0/1_rcv_dm_tkhai_13.sql
UTF-8
4,701
2.609375
3
[]
no_license
--To khai 02/TNCN thang insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('02A_TNCN13', '02/KK-TNCN', 'M', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); --To khai 02/TNCN quy insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('02B_TNCN13', '02/KK-TNCN', 'Q', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); -- To khai 07/TNCN insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('07_TNCN13', '07/KK-TNCN', 'Q', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 08/TNCN insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('08_TNCN13', 'Tê khai t¹m nép thuÕ TNCN (Dµnh cho c¸ nh©n kinh doanh thùc hiÖn nép thuÕ theo kª khai)', 'Q', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 01/GTGT insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('01_GTGT13', 'Tê khai thuÕ GTGT khÊu trõ mÉu 01/GTGT', 'M', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 02/GTGT insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('02_GTGT13', 'Tê khai thuÕ GTGT dµnh cho dù ¸n ®Çu t­', 'M', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 03/GTGT insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('03_GTGT13', 'Tê khai thuÕ GTGT tÝnh theo ph­¬ng ph¸p trùc tiÕp trªn GTGT', 'M', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 04/GTGT insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('04_GTGT13', 'Tê khai thuÕ GTGT theo PP trùc tiÕp mÉu 04/GTGT', 'M', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 05/GTGT -- khong thay doi, chi bo sung them to khai lan phat sinh -- To khai 01A/TNDN insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('01A_TNDN13', 'Tê khai thuÕ TNDN t¹m tÝnh mÉu 01A/TNDN', 'Q', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 01B/TNDN insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('01B_TNDN13', 'Tê khai thuÕ TNDN t¹m tÝnh mÉu 01B/TNDN', 'Q', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 02/TNDN -- khong thay doi, chi bo sung them chi tieu quy mo doanh nghiep -- To khai 01/TTDB -- Khong thay doi -- To khai 01/TAIN insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('01_TAIN13', 'Tê khai thuÕ tµi nguyªn mÉu 01/TAIN', 'M', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 01/TBVMT insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('01_TBVMT13', 'Tê KHAI THUÕ B¶O VÖ M¤I TR¦êNG', 'M', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 01/TNCN-BHDC insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('01_TNCN_BHDC13', 'Tê KHAI KHÊU TRõ THUÕ THU NHËP C¸ NH¢N - MÉU 01/KK-BH§C', 'M', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 01/KK-TTS insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('01_TNCN_TTS', 'Tê KHAI THUÕ HO¹T §éNG CHO THU£ TµI S¶N', 'Q', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 03/TNCN thang insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('03A_TNCN13', '03/KK-TNCN-th¸ng Tê khai dµnh cho tæ chøc, c¸ nh©n tr¶ thu nhËp tõ ®Çu t­ vèn...', 'M', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- To khai 03/TNCN quy insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('03B_TNCN13', '03/KK-TNCN Tê khai dµnh cho tæ chøc, c¸ nh©n tr¶ thu nhËp tõ ®Çu t­ vèn...', 'M', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- Bao cao tai chinh TT95 sua doi QD 99 insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('95_BCTC', 'BCTC theo QD95/NHNN', 'Y', '320', to_date('01-01-2014', 'dd-mm-yyyy'), null); commit; -- Bao cao tai chinh QD48 insert into qlt_ntk.rcv_dm_tkhai (MA, TEN, KIEU_KY, PHIEN_BAN, START_DATE, END_DATE) values ('48_BCTC13', 'BCTC theo Qߴ8/BTC', 'Y', '320', to_date('14-09-2006', 'dd-mm-yyyy'), null); commit;
true
ec5016cbb03e7377c0d1c5bdf344d1256ff70012
SQL
erjan/coding_exercises
/stratascratch/medium/active_interview_questions/Book Sales.sql
UTF-8
383
3.703125
4
[ "Apache-2.0" ]
permissive
Calculate the total revenue made per book. Output the book ID and total sales per book. In case there is a book that has never been sold, include it in your output with a value of 0. select a1.book_id, coalesce( unit_price * sum(quantity),0) as total_sales from amazon_books a1 left join amazon_books_order_details a2 on a1.book_id = a2.book_id group by a1.book_id, unit_price
true
da74e4c0cd62ff9e19b220b2abf58b72f24bfa54
SQL
goyalrinki/compsoc_freshers_hack
/cs_fh_database/database_create.sql
UTF-8
1,627
4
4
[]
no_license
-- Table: public.video -- DROP TABLE public.video; CREATE TABLE IF NOT EXISTS public.video ( video_id uuid NOT NULL, link text COLLATE pg_catalog."default" NOT NULL, created_at text COLLATE pg_catalog."default", audio_link text COLLATE pg_catalog."default", CONSTRAINT video_pkey PRIMARY KEY (video_id), CONSTRAINT unique_video_link UNIQUE (link) ) TABLESPACE pg_default; ALTER TABLE public.video OWNER to postgres; -- Table: public.video_word -- DROP TABLE public.video_word; CREATE TABLE IF NOT EXISTS public.video_word ( video_word_id uuid NOT NULL, video_id uuid NOT NULL, word text COLLATE pg_catalog."default" NOT NULL, seconds bigint NOT NULL, transcription_id uuid, CONSTRAINT video_word_pkey PRIMARY KEY (video_word_id), CONSTRAINT video_id_constraint FOREIGN KEY (video_id) REFERENCES public.video (video_id) MATCH SIMPLE ON UPDATE SET DEFAULT ON DELETE SET DEFAULT ) TABLESPACE pg_default; ALTER TABLE public.video_word OWNER to postgres; -- Index: search_word -- DROP INDEX public.search_word; CREATE INDEX search_word ON public.video_word USING btree (word COLLATE pg_catalog."aa_DJ" varchar_ops ASC NULLS LAST) TABLESPACE pg_default; -- Table: public.transcription -- DROP TABLE public.transcription; CREATE TABLE IF NOT EXISTS public.transcription ( transcription_id uuid NOT NULL, transcription_text text COLLATE pg_catalog."default" NOT NULL, CONSTRAINT transcription_pkey PRIMARY KEY (transcription_id) ) TABLESPACE pg_default; ALTER TABLE public.transcription OWNER to postgres;
true
640063beac5ced1b7e3070a6724239806d1f52e6
SQL
jiesonMing/sj_shop
/backup/v2.0.3/sql/v2.0.3.sql
UTF-8
1,556
3.234375
3
[]
no_license
ALTER TABLE `__PREFIX__goods` CHANGE `prom_type` `prom_type` tinyint(1) NULL DEFAULT 0 COMMENT '0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠,4预售' after `sales_sum`; ALTER TABLE `__PREFIX__order` ADD COLUMN `order_prom_type` tinyint(4) NULL DEFAULT 0 COMMENT '0默认1抢购2团购3优惠4预售5虚拟' after `pay_time` , CHANGE `order_prom_id` `order_prom_id` smallint(6) NOT NULL DEFAULT 0 COMMENT '活动id' after `order_prom_type` , CHANGE `order_prom_amount` `order_prom_amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '活动优惠金额' after `order_prom_id` , CHANGE `discount` `discount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '价格调整' after `order_prom_amount` , CHANGE `user_note` `user_note` varchar(255) COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户备注' after `discount` , CHANGE `admin_note` `admin_note` varchar(255) COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '管理员备注' after `user_note` , CHANGE `parent_sn` `parent_sn` varchar(100) COLLATE utf8_general_ci NULL COMMENT '父单单号' after `admin_note` , CHANGE `is_distribut` `is_distribut` tinyint(1) NULL DEFAULT 0 COMMENT '是否已分成0未分成1已分成' after `parent_sn` , ADD COLUMN `paid_money` decimal(10,2) NULL DEFAULT 0.00 COMMENT '订金' after `is_distribut`; ALTER TABLE `__PREFIX__order_goods` CHANGE `prom_type` `prom_type` tinyint(1) NULL DEFAULT 0 COMMENT '0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠,4预售' after `is_comment`;
true
065fa963f89bac12f427107a716dbae5d61db678
SQL
MattMead/SQLiteLab1.5
/SQLiteLab1.5.sql
UTF-8
879
4.0625
4
[]
no_license
--1 SELECT MAX(total) FROM Invoice; --2 SELECT total FROM Invoice ORDER BY total DESC LIMIT 1; --3 SELECT MediaType.name, COUNT(*) as Total FROM Track, MediaType WHERE Track.MediaTypeID = MediaType.MediaTypeId GROUP BY MediaType.name; --4 SELECT MediaType.name, COUNT(*) as Total FROM Track, MediaType WHERE Track.MediaTypeID = MediaType.MediaTypeId GROUP BY MediaType.name ORDER BY Total DESC; --5 SELECT MediaType.name, COUNT(*) as Total FROM Track, MediaType WHERE Track.MediaTypeID = MediaType.MediaTypeId GROUP BY MediaType.name HAVING Total > 200 ORDER BY Total DESC; --6 SELECT COUNT(*) TotalTracks, COUNT(DISTINCT Artist.Name) TotalArtists FROM Track, Album, Artist WHERE Track.AlbumID = Album.AlbumID AND Album.ArtistId = Artist.ArtistId AND Artist.Name LIKE 'A%'; --7 Not sure what to do here SELECT FirstName||" "|| LastName FullName, BirthDate FROM Employee;
true
90fa67eec239ffaf1c643013fcd01b7f403bf2d9
SQL
gutonanet/avaliacao20190610
/src/resource/exercicio1.sql
UTF-8
228
4.03125
4
[]
no_license
Select e.event_type, max(e.value) - (select ev.value from events ev where ev.event_type = e.event_type order by ev.time desc limit 1,1) as value from events e group by e.event_type having count(e.event_type) > 1 and min(e.time)
true
d8a9a8cdd1d287bf17dc3374234c869f611639a5
SQL
sprokushev/Delphi
/MASTER/_DATABASE/Procedures/CLOSE_OLD_PRICES.sql
UTF-8
364
2.96875
3
[]
no_license
-- -- CLOSE_OLD_PRICES (Procedure) -- CREATE OR REPLACE PROCEDURE MASTER.CLOSE_OLD_PRICES (DATE_PRICE DATE,CAT_CEN NUMBER,PROD_ID VARCHAR2) IS BEGIN UPDATE npr_prices SET END_DATE=LAST_DAY(BEGIN_DATE) WHERE END_DATE is NULL AND BEGIN_DATE<TRUNC(date_price) AND PROD_ID_NPR=prod_id AND CAT_CEN_ID=cat_cen; COMMIT; END CLOSE_OLD_PRICES; /
true