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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2f6a3914f746c3982a629a8464e81081dfdf3778
|
SQL
|
duilee/workspace
|
/SQL/consecutive_numbers.sql
|
UTF-8
| 224
| 3.578125
| 4
|
[] |
no_license
|
# Write your MySQL query statement below
SELECT DISTINCT t1.num AS ConsecutiveNums
FROM Logs AS t1
INNER JOIN Logs AS t2 ON t2.id = t1.id +1
INNER JOIN Logs AS t3 ON t3.id = t1.id +2
WHERE t1.num = t2.num AND t2.num = t3.num
| true
|
e02d20feea687e6bbe7f96c71915958507ea09a4
|
SQL
|
teager/Spring3MVC
|
/src/main/webapp/WEB-INF/classes/META-INF/sqlScript/init.sql
|
UTF-8
| 1,655
| 2.9375
| 3
|
[] |
no_license
|
/**
Create Table
**/
CREATE TABLE `anonymity` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`clientDeviceId` varchar(100) DEFAULT NULL,
`clientDeviceName` varchar(100) DEFAULT NULL,
`clientDeviceToken` varchar(100) DEFAULT NULL,
`clientVersion` varchar(20) DEFAULT NULL,
`clientOS` varchar(20) DEFAULT NULL,
`clientLang` varchar(20) DEFAULT NULL,
`productVersion` varchar(20) DEFAULT NULL,
`productID` varchar(20) DEFAULT NULL,
`loginIp` varchar(20) DEFAULT NULL,
`createTime` datetime DEFAULT NULL,
`updateTime` datetime DEFAULT NULL,
`uninstallTime` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `clientDeviceId` (`clientDeviceId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8
CREATE TABLE `gp_property` (
`name` varchar(100) NOT NULL,
`propValue` text NOT NULL,
PRIMARY KEY (`name`)
) ENGINE=INNODB DEFAULT CHARSET=utf8
CREATE TABLE `banner` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`productId` VARCHAR(50) DEFAULT NULL,
`appStoreId` VARCHAR(50) DEFAULT NULL,
`imageUrl` VARCHAR(100) DEFAULT NULL,
`bannerType` int(5) DEFAULT NULL,
`status` int(5) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
CREATE TABLE `product` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`productId` VARCHAR(50) DEFAULT NULL,
`productName` VARCHAR(50) DEFAULT NULL,
`appIsnew` int(5) DEFAULT NULL,
`appStoreId` VARCHAR(50) DEFAULT NULL,
`schema` VARCHAR(100) DEFAULT NULL,
`productPrice` double DEFAULT NULL,
`description` VARCHAR(100) DEFAULT NULL,
`status` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
| true
|
320e3d6ed54543546a87d785c7fa17b573f16bed
|
SQL
|
Ariah-Group/Research
|
/db_scripts/main/KC-RELEASE-3_1_SP4-SCRIPT/MYSQL/CONSTRAINTS/KC_FK_KC_QRTZ_TRIGGER_LISTENERS.sql
|
UTF-8
| 190
| 2.9375
| 3
|
[
"Apache-2.0",
"ECL-2.0"
] |
permissive
|
ALTER TABLE KC_QRTZ_TRIGGER_LISTENERS
ADD CONSTRAINT FK_KC_QRTZ_TRIGGER_LISTENERS FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP)
REFERENCES KC_QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP);
| true
|
359829687632cfaacb33225cce2357b2f3ede049
|
SQL
|
aramnatsyan/restaurantCheckSystem
|
/restourantcheckingsystemDB.sql
|
UTF-8
| 4,977
| 3.03125
| 3
|
[
"MIT"
] |
permissive
|
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Dec 08, 2020 at 07:59 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.4.0
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: `checkincanteen`
--
-- --------------------------------------------------------
--
-- Table structure for table `clientlogs`
--
DROP TABLE IF EXISTS `clientlogs`;
CREATE TABLE IF NOT EXISTS `clientlogs` (
`id` int(255) NOT NULL AUTO_INCREMENT,
`client_id` int(255) NOT NULL,
`current_date_today` date NOT NULL DEFAULT current_timestamp(),
`craphic_id` int(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
--
-- Dumping data for table `clientlogs`
--
INSERT INTO `clientlogs` (`id`, `client_id`, `current_date_today`, `craphic_id`) VALUES
(1, 10, '2020-12-08', 4),
(2, 10, '2020-12-08', 4),
(3, 1, '2020-12-08', 4),
(4, 1, '2020-12-08', 4),
(5, 1, '2020-12-08', 4),
(6, 1, '2020-12-08', 4),
(7, 10, '2020-12-21', 4),
(8, 10, '2020-12-07', 4),
(9, 1, '2020-12-07', 4);
-- --------------------------------------------------------
--
-- Table structure for table `clients`
--
DROP TABLE IF EXISTS `clients`;
CREATE TABLE IF NOT EXISTS `clients` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`surname` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`id_card_number` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`picture_path` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
--
-- Dumping data for table `clients`
--
INSERT INTO `clients` (`id`, `name`, `surname`, `id_card_number`, `picture_path`) VALUES
(1, 'apeք', 'mnatsyanա', '%B4375111010079899^MNATSYAN/ARA ^2112201121800000000000491000000?;4375111010079899=21122011218049100000?', 'images/profile-images/1/profilePic.jpg'),
(3, 'serj', 'azarich', NULL, 'images/profile-images/3/profilePic.jpg'),
(2, 'aper', 'chan', 'f65htrfe55245%B4375111010079899^MNATSYAN/ARA ^2112201121800000000000491000000?;4375111010079899=21122011218049100000?', 'images/profile-images/6/profilePic.jpg'),
(8, 'ասդ', 'асд', 'ասդ', 'images/profile-images/8/profilePic.jpg'),
(7, 'john', 'doe', NULL, 'images/profile-images/7/profilePic.jpg'),
(9, 'hrach', 'jan', NULL, 'images/profile-images/9/profilePic.jpg'),
(10, 'ara', 'mnatsyan', '%B36151201024469^MNATSYAN/ARA ^211010119100000000000000802000000?;36151201024469=2110101191000080200000?', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `graphics`
--
DROP TABLE IF EXISTS `graphics`;
CREATE TABLE IF NOT EXISTS `graphics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`graphic_name` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`start_time` time NOT NULL,
`finish_time` time NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
--
-- Dumping data for table `graphics`
--
INSERT INTO `graphics` (`id`, `graphic_name`, `start_time`, `finish_time`) VALUES
(1, 'Նախաճաշ', '09:00:00', '11:00:00'),
(2, 'Ճաշ', '12:00:00', '15:00:00'),
(4, 'Ընթրիկ', '15:30:00', '22:30:00');
-- --------------------------------------------------------
--
-- Table structure for table `homes`
--
DROP TABLE IF EXISTS `homes`;
CREATE TABLE IF NOT EXISTS `homes` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
DROP TABLE IF EXISTS `migrations`;
CREATE TABLE IF NOT EXISTS `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=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2020_12_04_100408_create_homes_table', 1),
(2, '2020_12_04_134259_create_clients_logs_table', 1);
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
|
5e2d138220dfe8cdb09c15e050c6e31f18404661
|
SQL
|
NCIP/ctms-commons
|
/suite/authorization/src/test/resources/csm-sql/oracle/seeddata.sql
|
UTF-8
| 21,731
| 2.75
| 3
|
[
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] |
permissive
|
INSERT INTO csm_application(application_name, application_description) VALUES ('CTMS_SUITE', 'CTMS_SUITE')
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('system_administrator', 'Configures the technical system level properties and behavior of the applications (i.e. the password policy, email setup, ESB, etc).', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('business_administrator', 'Manages the domain related application wide properties and behavior (i.e. label names, reference data lists, etc)', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('person_and_organization_information_manager', 'Manages organizations and rosters / Creates and updates person info including contact info, degrees/certifications, rosters they''re associated with', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('data_importer', 'Identifies studies defined by Coordinating Center and imports as a consumer that data defined elsewhere', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('user_administrator', 'Ability to read system personnel (research staff and investigators) and create/manage user accounts/application roles, defines Custom Combination Roles', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('study_qa_manager', 'Updates core study info after saving / opening study.(e.g. PI, title, phase, epochs/arms, basic study design) Read-only review of study calendar template / releases templates to participating sites', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('study_creator', 'Creates the core study info (e.g. PI, title, description, phase, epochs/arms & basic study design, etc.) NOTE: some sites may want to combine the supplemental study info roles into this role', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('supplemental_study_information_manager', 'Adds treatment assignment, drugs, adEERS-specific diseases, adEERs reporting criteria, CTC/MedDRA version, etc. Update/manage registration metadata (e.g. stratifications, eligibility criteria, notifi', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('study_team_administrator', 'Connects study level people to study and internal staff to study; Assigns internal staff to protocol, determines study artifact accessiblity for staff (e.g. study calendar templates, CRFs, etc.)', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('study_site_participation_administrator', 'Connects participating sites to a protocol', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('ae_rule_and_report_manager', 'Creates, manages, imports AE rules / Creates, manages, imports AE report definitions', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('study_calendar_template_builder', 'Creates and updates study calendar templates', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('registration_qa_manager', 'Updates registration information (study subject ID, Date of consent) after enrollment. Can waive the eligibility criteria for certain study subjects.', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('subject_manager', 'Defines patient to system (remaining subject data managed by other roles which are not defined)', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('study_subject_calendar_manager', 'Creates and updates a subject-specific study calendar based on a study calendar template', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('registrar', 'Accepts and approves/denies subject registration requests; requests subject registration on a particular study', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('ae_reporter', 'Creates / updates info about AE that needs reported / submits report to appropriate parties per report definition. Enters set of required AEs to be assessed and any other AEs that patient experienced.', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('ae_expedited_report_reviewer', 'Read-only: reviews, provides comments, and routes expedited reports through the review workflow', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('ae_study_data_reviewer', 'Read-only: reviews, provides comments, and adverse event data through a review workflow', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('lab_impact_calendar_notifier', 'Creates a calendar notification for a potential lab-based treatment modification', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('lab_data_user', 'Enters, edits, and imports labs from LIMS, viewing labs, selecting and sending labs to CDMS and caAERS', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('data_reader', 'Read-only: typically not part of org being audited, granted temporary access (no updates) to whole study or specific study/subjects, or any data entered by site for study/subject, crosses all apps.', csm_applicati_application__seq.currval)
/
INSERT INTO csm_group(group_name, group_desc, application_id) VALUES ('data_analyst', 'Read-only: searches for data, uses built-in analysis tools, exports data to third party tools', csm_applicati_application__seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('system_administrator', 'Configures the technical system level properties and behavior of the applications (i.e. the password policy, email setup, ESB, etc).', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('system_administrator', 'Configures the technical system level properties and behavior of the applications (i.e. the password policy, email setup, ESB, etc).')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('business_administrator', 'Manages the domain related application wide properties and behavior (i.e. label names, reference data lists, etc)', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('business_administrator', 'Manages the domain related application wide properties and behavior (i.e. label names, reference data lists, etc)')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('person_and_organization_information_manager', 'Manages organizations and rosters / Creates and updates person info including contact info, degrees/certifications, rosters they?re associated with', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('person_and_organization_information_manager', 'Manages organizations and rosters / Creates and updates person info including contact info, degrees/certifications, rosters they?re associated with')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('data_importer', 'Identifies studies defined by Coordinating Center and imports as a consumer that data defined elsewhere', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('data_importer', 'Identifies studies defined by Coordinating Center and imports as a consumer that data defined elsewhere')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('user_administrator', 'Ability to read system personnel (research staff and investigators) and create/manage user accounts/application roles, defines Custom Combination Roles', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('user_administrator', 'Ability to read system personnel (research staff and investigators) and create/manage user accounts/application roles, defines Custom Combination Roles')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('study_qa_manager', 'Updates core study info after saving / opening study.(e.g. PI, title, phase, epochs/arms, basic study design) Read-only review of study calendar template / releases templates to participating sites', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('study_qa_manager', 'Updates core study info after saving / opening study.(e.g. PI, title, phase, epochs/arms, basic study design) Read-only review of study calendar template / releases templates to participating sites')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('study_creator', 'Creates the core study info (e.g. PI, title, description, phase, epochs/arms & basic study design, etc.) NOTE: some sites may want to combine the supplemental study info roles into this role', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('study_creator', 'Creates the core study info (e.g. PI, title, description, phase, epochs/arms & basic study design, etc.) NOTE: some sites may want to combine the supplemental study info roles into this role')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('supplemental_study_information_manager', 'Adds treatment assignment, drugs, adEERS-specific diseases, adEERs reporting criteria, CTC/MedDRA version, etc. Update/manage registration metadata (e.g. stratifications, eligibility criteria, notifi', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('supplemental_study_information_manager', 'Adds treatment assignment, drugs, adEERS-specific diseases, adEERs reporting criteria, CTC/MedDRA version, etc. Update/manage registration metadata (e.g. stratifications, eligibility criteria, notifi')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('study_team_administrator', 'Connects study level people to study and internal staff to study; Assigns internal staff to protocol, determines study artifact accessiblity for staff (e.g. study calendar templates, CRFs, etc.)', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('study_team_administrator', 'Connects study level people to study and internal staff to study; Assigns internal staff to protocol, determines study artifact accessiblity for staff (e.g. study calendar templates, CRFs, etc.)')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('study_site_participation_administrator', 'Connects participating sites to a protocol', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('study_site_participation_administrator', 'Connects participating sites to a protocol')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('ae_rule_and_report_manager', 'Creates, manages, imports AE rules / Creates, manages, imports AE report definitions', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ( 'ae_rule_and_report_manager', 'Creates, manages, imports AE rules / Creates, manages, imports AE report definitions')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('study_calendar_template_builder', 'Creates and updates study calendar templates', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('study_calendar_template_builder', 'Creates and updates study calendar templates')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('registration_qa_manager', 'Updates registration information (study subject ID, Date of consent) after enrollment. Can waive the eligibility criteria for certain study subjects.', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('registration_qa_manager', 'Updates registration information (study subject ID, Date of consent) after enrollment. Can waive the eligibility criteria for certain study subjects.')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('subject_manager', 'Defines patient to system (remaining subject data managed by other roles which are not defined)', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('subject_manager', 'Defines patient to system (remaining subject data managed by other roles which are not defined)')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('study_subject_calendar_manager', 'Creates and updates a subject-specific study calendar based on a study calendar template', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('study_subject_calendar_manager', 'Creates and updates a subject-specific study calendar based on a study calendar template')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('registrar', 'Accepts and approves/denies subject registration requests; requests subject registration on a particular study', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('registrar', 'Accepts and approves/denies subject registration requests; requests subject registration on a particular study')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('ae_reporter', 'Creates / updates info about AE that needs reported / submits report to appropriate parties per report definition. Enters set of required AEs to be assessed and any other AEs that patient experienced.', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('ae_reporter', 'Creates / updates info about AE that needs reported / submits report to appropriate parties per report definition. Enters set of required AEs to be assessed and any other AEs that patient experienced.')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('ae_expedited_report_reviewer', 'Read-only: reviews, provides comments, and routes expedited reports through the review workflow', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('ae_expedited_report_reviewer', 'Read-only: reviews, provides comments, and routes expedited reports through the review workflow')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('ae_study_data_reviewer', 'Read-only: reviews, provides comments, and adverse event data through a review workflow', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('ae_study_data_reviewer', 'Read-only: reviews, provides comments, and adverse event data through a review workflow')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('lab_impact_calendar_notifier', 'Creates a calendar notification for a potential lab-based treatment modification', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('lab_impact_calendar_notifier', 'Creates a calendar notification for a potential lab-based treatment modification')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('lab_data_user', 'Enters, edits, and imports labs from LIMS, viewing labs, selecting and sending labs to CDMS and caAERS', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('lab_data_user', 'Enters, edits, and imports labs from LIMS, viewing labs, selecting and sending labs to CDMS and caAERS')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('data_reader', 'Read-only: typically not part of org being audited, granted temporary access (no updates) to whole study or specific study/subjects, or any data entered by site for study/subject, crosses all apps.', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('data_reader', 'Read-only: typically not part of org being audited, granted temporary access (no updates) to whole study or specific study/subjects, or any data entered by site for study/subject, crosses all apps.')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
INSERT INTO csm_role(role_name, role_description, application_id, active_flag) VALUES ('data_analyst', 'Read-only: searches for data, uses built-in analysis tools, exports data to third party tools', csm_applicati_application__seq.currval, 1)
/
INSERT INTO csm_privilege(privilege_name, privilege_description) VALUES ('data_analyst', 'Read-only: searches for data, uses built-in analysis tools, exports data to third party tools')
/
INSERT INTO csm_role_privilege(role_id, privilege_id) VALUES (csm_role_role_id_seq.currval,csm_privilege_privilege_id_seq.currval)
/
| true
|
7525084414f3e328725d36c61645940442941740
|
SQL
|
Longek/J2SE-Shoes-Cash
|
/shoescash.sql
|
UTF-8
| 15,908
| 3.140625
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 17, 2020 at 02:55 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `db_shoescash`
--
CREATE DATABASE IF NOT EXISTS `db_shoescash` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `db_shoescash`;
-- --------------------------------------------------------
--
-- Table structure for table `getfree`
--
CREATE TABLE `getfree` (
`id_promo` varchar(100) NOT NULL,
`id_product` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `getfree`
--
INSERT INTO `getfree` (`id_promo`, `id_product`) VALUES
('PR008', 'SH001'),
('PR008', 'SH003'),
('PR008', 'SH004'),
('PR009', 'SH008'),
('PR010', 'SH008'),
('PR006', 'SH009'),
('PR008', 'SH010'),
('PR006', 'SH013'),
('PR008', 'SH015'),
('PR008', 'SH019'),
('PR006', 'SH020'),
('PR008', 'SH020');
-- --------------------------------------------------------
--
-- Table structure for table `products`
--
CREATE TABLE `products` (
`id_product` varchar(100) NOT NULL,
`brand` varchar(100) NOT NULL,
`type` varchar(100) NOT NULL,
`descr` varchar(100) NOT NULL,
`size` int(100) NOT NULL,
`capital` int(100) NOT NULL,
`price` int(100) NOT NULL,
`stock` int(100) NOT NULL,
`updateAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `products`
--
INSERT INTO `products` (`id_product`, `brand`, `type`, `descr`, `size`, `capital`, `price`, `stock`, `updateAt`) VALUES
('SH001', 'Vans', 'Balck Widown', '-', 39, 230000, 330000, 2, '2020-06-16 01:11:08'),
('SH002', 'Vans', 'Balck Widown', '-', 40, 260000, 350000, 2, '2020-06-16 01:11:08'),
('SH003', 'Vans', 'Balck Widown', '-', 41, 200000, 270000, 1, '2020-06-16 01:11:08'),
('SH004', 'Vans', 'Balck Widown', '-', 42, 210000, 290000, 6, '2020-06-16 01:11:08'),
('SH005', 'Vans', 'Chees Stop', '-', 37, 237000, 330000, 0, '2020-06-16 01:11:08'),
('SH008', 'Vans', 'Chees Stop', '-', 39, 230000, 330000, 2, '2020-06-16 01:11:08'),
('SH009', 'Vans', 'Chees Stop', '-', 40, 230000, 300000, 3, '2020-06-16 01:11:08'),
('SH010', 'AllStar', 'Styleme', '-', 39, 270000, 310000, 3, '2020-06-16 01:11:08'),
('SH011', 'AllStar', 'Styleme', '-', 40, 275000, 320000, 4, '2020-06-16 01:11:08'),
('SH012', 'AllStar', 'Styleme', '-', 41, 250000, 300000, 4, '2020-06-16 01:11:08'),
('SH013', 'GMX', 'Blood Shecker', 'New Edition', 39, 330000, 450000, 9, '2020-06-17 01:17:42'),
('SH015', 'Vans', 'Limited Edition', 'import from UK', 37, 410000, 530000, 6, '2020-06-16 01:11:08'),
('SH016', 'Vans', 'Limited Edition', 'import from UK', 38, 390000, 500000, 2, '2020-06-16 01:11:08'),
('SH017', 'Ardiles', 'Red White', '-', 39, 190000, 270000, 2, '2020-06-16 01:11:08'),
('SH018', 'Ardiles', 'Full White', '-', 39, 230000, 330000, 4, '2020-06-16 01:11:08'),
('SH019', 'GeoffMax', 'Black', 'Limited Edition', 39, 200000, 250000, 6, '2020-06-16 01:11:08'),
('SH020', 'Vans', 'Black', '-', 38, 280000, 330000, 3, '2020-06-16 01:11:08'),
('SH021', 'Vans', 'Limited Edition', 'Terbatas', 30, 270000, 300000, 3, '2020-06-16 01:11:08'),
('SH023', 'AllStart', 'slim', '-', 20, 220000, 300000, 9, '2020-06-16 01:17:40'),
('SH024', 'Vans', 'Casual', '-', 29, 200000, 300000, 10, '2020-06-17 01:17:04'),
('SH025', 'Vans', 'Casual', '-', 30, 300000, 400000, 10, '2020-06-17 01:17:23'),
('SH026', 'GeofMaxx', 'tipe', '-', 30, 300000, 300000, 10, '2020-06-17 02:49:02'),
('SH027', 'GeofMaxx', 'tipe', '-', 30, 100000, 200000, 3, '2020-06-17 02:49:16');
-- --------------------------------------------------------
--
-- Table structure for table `profit`
--
CREATE TABLE `profit` (
`no` int(11) NOT NULL,
`date` date NOT NULL,
`trans_today` int(100) NOT NULL,
`trans_total` int(100) NOT NULL,
`sold_today` int(100) NOT NULL,
`sold_total` int(100) NOT NULL,
`admission_fee_today` int(100) NOT NULL,
`admission_fee_total` int(100) NOT NULL,
`capital` int(100) NOT NULL,
`income_today` int(100) NOT NULL,
`income_total` int(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `profit`
--
INSERT INTO `profit` (`no`, `date`, `trans_today`, `trans_total`, `sold_today`, `sold_total`, `admission_fee_today`, `admission_fee_total`, `capital`, `income_today`, `income_total`) VALUES
(1, '2020-03-09', 0, 0, 0, 0, 0, 0, 0, 0, 0),
(2, '2020-03-10', 6, 6, 32, 32, 11410000, 11410000, 8620000, 2790000, 2790000),
(3, '2020-03-11', 2, 8, 5, 37, 2400000, 13810000, 10390000, 630000, 3420000),
(5, '2020-04-07', 2, 10, 4, 41, 1340000, 15150000, 11340000, 390000, 3810000),
(6, '2020-05-27', 1, 11, 101010, 101051, 20000, 15170000, 11360000, 0, 3810000);
-- --------------------------------------------------------
--
-- Table structure for table `promo`
--
CREATE TABLE `promo` (
`id_promo` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`type` enum('discount','getfree') NOT NULL,
`discount` int(100) NOT NULL DEFAULT '0',
`max_get_discount` int(100) NOT NULL DEFAULT '0',
`min_buy` int(100) NOT NULL DEFAULT '0',
`min_items` int(100) NOT NULL DEFAULT '0',
`free_lots` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `promo`
--
INSERT INTO `promo` (`id_promo`, `name`, `type`, `discount`, `max_get_discount`, `min_buy`, `min_items`, `free_lots`) VALUES
('PR001', 'Open House', 'discount', 22, 200000, 700000, 0, 0),
('PR002', 'Happy Shoes', 'discount', 15, 200000, 600000, 0, 0),
('PR005', 'the winer', 'discount', 20, 0, 0, 0, 0),
('PR006', 'combo discount and free', 'getfree', 0, 300000, 500000, 5, 2),
('PR007', 'Diskon 20%', 'discount', 20, 20, 20, 20, 20),
('PR008', 'beli 2 dapat 1', 'getfree', 0, 0, 200000, 2, 1);
-- --------------------------------------------------------
--
-- Table structure for table `tes`
--
CREATE TABLE `tes` (
`a` int(11) NOT NULL,
`b` varchar(100) NOT NULL,
`c` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`d` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `transaction`
--
CREATE TABLE `transaction` (
`id_trans` varchar(100) NOT NULL,
`datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`tot_sold` int(100) NOT NULL,
`promo` varchar(100) DEFAULT NULL,
`discount` int(100) DEFAULT NULL,
`tot_capital` int(100) NOT NULL,
`pay` int(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `transaction`
--
INSERT INTO `transaction` (`id_trans`, `datetime`, `tot_sold`, `promo`, `discount`, `tot_capital`, `pay`) VALUES
('TR001', '2020-03-09 20:08:07', 16, 'PR003', 0, 3970000, 5290000),
('TR002', '2020-03-09 20:18:07', 6, NULL, 0, 1450000, 1830000),
('TR003', '2020-03-09 20:28:07', 1, NULL, 0, 230000, 330000),
('TR004', '2020-03-09 20:38:07', 3, 'PR001', 200000, 1310000, 1540000),
('TR005', '2020-03-09 20:48:07', 2, NULL, 0, 460000, 660000),
('TR006', '2020-03-09 20:58:07', 4, NULL, 0, 1200000, 1760000),
('TR007', '2020-03-11 01:52:14', 3, NULL, 0, 1310000, 1740000),
('TR008', '2020-03-11 01:54:44', 2, NULL, 0, 460000, 660000),
('TR009', '2020-04-07 04:04:02', 2, NULL, 0, 490000, 680000),
('TR010', '2020-04-07 04:11:50', 2, NULL, 0, 460000, 660000),
('TR011', '2020-05-27 13:42:47', 101010, NULL, NULL, 20000, 20000);
--
-- Triggers `transaction`
--
DELIMITER $$
CREATE TRIGGER `after_tranasction_insert_to_profit` AFTER INSERT ON `transaction` FOR EACH ROW BEGIN
DECLARE nox INT;
DECLARE datex DATE;
DECLARE trans_totx INT;
DECLARE sold_totx INT;
DECLARE adm_fee_totx INT;
DECLARE capx INT;
DECLARE income_totx INT;
DECLARE this_income INT;
DECLARE fill INT;
SELECT no INTO nox FROM profit ORDER BY no DESC LIMIT 1;
SELECT date INTO datex FROM profit ORDER BY no DESC LIMIT 1;
SELECT trans_total INTO trans_totx FROM profit ORDER BY no DESC LIMIT 1;
SELECT sold_total INTO sold_totx FROM profit ORDER BY no DESC LIMIT 1;
SELECT admission_fee_total INTO adm_fee_totx FROM profit ORDER BY no DESC LIMIT 1;
SELECT capital INTO capx FROM profit ORDER BY no DESC LIMIT 1;
SELECT income_total INTO income_totx FROM profit ORDER BY no DESC LIMIT 1;
SET this_income = NEW.pay - NEW.tot_capital;
SELECT no INTO fill FROM profit WHERE date=date(NEW.datetime);
IF (fill > 0 ) THEN
UPDATE profit SET trans_today = trans_today + 1,
trans_total = trans_total + 1,
sold_today = sold_today + NEW.tot_sold,
sold_total = sold_total + NEW.tot_sold,
admission_fee_today = admission_fee_today + NEW.pay,
admission_fee_total = admission_fee_total + NEW.pay,
capital = capital + NEW.tot_capital,
income_today = income_today + this_income,
income_total = income_total + this_income WHERE no = fill;
ELSE
INSERT INTO profit VALUES
( null, date(NEW.datetime),
1, (trans_totx + 1),
NEW.tot_sold, (sold_totx + NEW.tot_sold),
NEW.pay, (adm_fee_totx + NEW.pay),
(capx + NEW.tot_capital), this_income,
(income_totx + this_income));
END IF;
END
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `trans_detail`
--
CREATE TABLE `trans_detail` (
`id_trans` varchar(100) NOT NULL,
`id_product` varchar(100) NOT NULL,
`amount` int(100) NOT NULL,
`sub_capital` int(100) NOT NULL,
`sub_total` int(100) NOT NULL,
`is_free` enum('1','0') NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `trans_detail`
--
INSERT INTO `trans_detail` (`id_trans`, `id_product`, `amount`, `sub_capital`, `sub_total`, `is_free`) VALUES
('TR001', 'SH001', 5, 150000, 165000, '0'),
('TR001', 'SH003', 1, 200000, 0, '1'),
('TR001', 'SH016', 2, 780000, 100000, '0'),
('TR001', 'SH018', 8, 1840000, 2640000, '0'),
('TR002', 'SH004', 1, 210000, 290000, '0'),
('TR002', 'SH009', 3, 690000, 900000, '0'),
('TR002', 'SH011', 2, 550000, 640000, '0'),
('TR003', 'SH001', 1, 260000, 350000, '0'),
('TR004', 'SH002', 1, 260000, 350000, '0'),
('TR004', 'SH015', 2, 820000, 1060000, '0'),
('TR005', 'SH001', 2, 460000, 660000, '0'),
('TR006', 'SH010', 4, 1200000, 1760000, '0'),
('TR007', 'SH002', 1, 260000, 350000, '0'),
('TR007', 'SH015', 2, 820000, 1060000, '0'),
('TR008', 'SH001', 2, 460000, 660000, '0'),
('TR009', 'SH001', 1, 230000, 330000, '0'),
('TR009', 'SH002', 1, 260000, 350000, '0'),
('TR010', 'SH001', 2, 460000, 660000, '0'),
('TR011', 'SH001', 2, 90000, 900, '0');
--
-- Triggers `trans_detail`
--
DELIMITER $$
CREATE TRIGGER `after_trans_detail_insert_to_products` AFTER INSERT ON `trans_detail` FOR EACH ROW BEGIN
DECLARE lot INT;
SELECT stock INTO lot FROM products WHERE products.id_product = NEW.id_product;
UPDATE products SET stock = (lot - NEW.amount) WHERE products.id_product = NEW.id_product;
END
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`uname` varchar(100) NOT NULL,
`paswd` varchar(100) NOT NULL,
`nama` varchar(100) NOT NULL,
`lvl` varchar(100) NOT NULL,
`jk` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`uname`, `paswd`, `nama`, `lvl`, `jk`) VALUES
('dev', 'c4ca4238a0b923820dcc509a6f75849b', 'Big Boss', '', 'l'),
('in', 'c20ad4d76fe97759aa27a0c99bff6710', 'Admin Barang', 'inventori', 'l'),
('kas', 'c4ca4238a0b923820dcc509a6f75849b', 'Kasir Sepatu', 'kasir', 'p'),
('ow', 'c4ca4238a0b923820dcc509a6f75849b', 'Pemilik Toko', 'owner', 'l');
-- --------------------------------------------------------
--
-- Stand-in structure for view `v_dettrans`
-- (See below for the actual view)
--
CREATE TABLE `v_dettrans` (
`datetime` timestamp
,`id_trans` varchar(100)
,`id_product` varchar(100)
,`NmSepatu` varchar(201)
,`size` int(100)
,`amount` int(100)
,`price` int(100)
,`Status` varchar(6)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `v_getfree`
-- (See below for the actual view)
--
CREATE TABLE `v_getfree` (
`id_promo` varchar(100)
,`id_product` varchar(100)
,`sepatu` varchar(201)
,`size` int(100)
,`price` int(100)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `v_sepatu`
-- (See below for the actual view)
--
CREATE TABLE `v_sepatu` (
`id_product` varchar(100)
,`sepatu` varchar(201)
,`descr` varchar(100)
,`size` int(100)
,`price` int(100)
,`stock` int(100)
);
-- --------------------------------------------------------
--
-- Structure for view `v_dettrans`
--
DROP TABLE IF EXISTS `v_dettrans`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_dettrans` AS select `transaction`.`datetime` AS `datetime`,`trans_detail`.`id_trans` AS `id_trans`,`trans_detail`.`id_product` AS `id_product`,concat(`products`.`brand`,' ',`products`.`type`) AS `NmSepatu`,`products`.`size` AS `size`,`trans_detail`.`amount` AS `amount`,`products`.`price` AS `price`,if((`trans_detail`.`is_free` = 1),'Free','Dibeli') AS `Status` from ((`trans_detail` join `products` on((`trans_detail`.`id_product` = `products`.`id_product`))) join `transaction` on((`trans_detail`.`id_trans` = `transaction`.`id_trans`))) order by `transaction`.`datetime` desc ;
-- --------------------------------------------------------
--
-- Structure for view `v_getfree`
--
DROP TABLE IF EXISTS `v_getfree`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_getfree` AS select `getfree`.`id_promo` AS `id_promo`,`getfree`.`id_product` AS `id_product`,concat(`products`.`brand`,' ',`products`.`type`) AS `sepatu`,`products`.`size` AS `size`,`products`.`price` AS `price` from (`getfree` join `products` on((`getfree`.`id_product` = `products`.`id_product`))) ;
-- --------------------------------------------------------
--
-- Structure for view `v_sepatu`
--
DROP TABLE IF EXISTS `v_sepatu`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_sepatu` AS select `products`.`id_product` AS `id_product`,concat(`products`.`brand`,' ',`products`.`type`) AS `sepatu`,`products`.`descr` AS `descr`,`products`.`size` AS `size`,`products`.`price` AS `price`,`products`.`stock` AS `stock` from `products` where (`products`.`stock` > 0) ;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `getfree`
--
ALTER TABLE `getfree`
ADD PRIMARY KEY (`id_promo`,`id_product`),
ADD KEY `id_product` (`id_product`);
--
-- Indexes for table `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id_product`);
--
-- Indexes for table `profit`
--
ALTER TABLE `profit`
ADD PRIMARY KEY (`no`);
--
-- Indexes for table `promo`
--
ALTER TABLE `promo`
ADD PRIMARY KEY (`id_promo`);
--
-- Indexes for table `tes`
--
ALTER TABLE `tes`
ADD PRIMARY KEY (`a`);
--
-- Indexes for table `transaction`
--
ALTER TABLE `transaction`
ADD PRIMARY KEY (`id_trans`),
ADD KEY `promo` (`promo`);
--
-- Indexes for table `trans_detail`
--
ALTER TABLE `trans_detail`
ADD PRIMARY KEY (`id_trans`,`id_product`),
ADD KEY `id_product` (`id_product`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`uname`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `profit`
--
ALTER TABLE `profit`
MODIFY `no` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `tes`
--
ALTER TABLE `tes`
MODIFY `a` int(11) 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
|
dadc98a0eff5b26420eee9f128b463df974f341e
|
SQL
|
vchapple17/hometown-heroes
|
/hometown_heroes_data.sql
|
UTF-8
| 9,691
| 3.3125
| 3
|
[] |
no_license
|
DROP TABLE IF EXISTS `hh_event_time`;
DROP TABLE IF EXISTS `hh_event_register`;
DROP TABLE IF EXISTS `hh_event_review`;
DROP TABLE IF EXISTS `hh_event_date`;
DROP TABLE IF EXISTS `hh_tag_event`;
DROP TABLE IF EXISTS `hh_tag_user`;
DROP TABLE IF EXISTS `hh_event`;
DROP TABLE IF EXISTS `hh_tag`;
DROP TABLE IF EXISTS `hh_role_user`;
DROP TABLE IF EXISTS `hh_role`;
DROP TABLE IF EXISTS `hh_level_user`;
DROP TABLE IF EXISTS `hh_level`;
DROP TABLE IF EXISTS `hh_social_media_user`;
DROP TABLE IF EXISTS `hh_social_media`;
DROP TABLE IF EXISTS `hh_user`;
--
-- Table structure for table `hh_user`
--
CREATE TABLE `hh_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255),
`password` varchar(255),
`username` varchar(255),
`lname` varchar(255),
`fname` varchar(255),
`mobile` varchar(15),
`street` varchar(255),
`street_2` varchar(255),
`city` varchar(255),
`state` varchar(255),
`zip` varchar(5),
`points` int(11) DEFAULT '0',
`streak_len` int(11) DEFAULT '0',
`multiplier` int(11) DEFAULT '0',
`accepted` enum('Yes','No') NOT NULL DEFAULT 'No',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
INSERT INTO `hh_user`(`id`,`email`,`password`,`username`,`lname`,`fname`,`mobile`,`street`,`city`,`state`,`zip`,`points`,`streak_len`,`multiplier`,`accepted`)
VALUES (1001,'email','password','Hockey_Bob','Hockey','Bob',8011234567,'123 Rink Ave','Hockey Town','WI',54321,1600,1,1,'Yes'),
(1002,'email','password','user2','Two','User',8011234568,'225 Some St','Corvalis','OR',97331,0,0,1,'Yes'),
(1003,'email','password','user3','Three','User',8011234568,'335 Some St','Corvalis','OR',97331,150,2,1,'Yes'),
(1004,'email','password','user4','Four','User',8011234568,'445 Some St','Corvalis','OR',97331,460,1,1,'Yes'),
(1005,'email','password','user5','Five','User',8011234568,'555 Some St','Corvalis','OR',97331,710,1,1,'Yes');
--
-- Table structure for table `hh_social_media`
--
CREATE TABLE `hh_social_media` (
`id` int(11) NOT NULL,
`service` enum('Facebook','Twitter') NOT NULL,
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `service` (`service`),
UNIQUE KEY `url` (`url`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
INSERT INTO `hh_social_media`
VALUES (81,'Twitter','https://twitter.com/login'),(82,'Facebook','https://en-gb.facebook.com/login/');
--
-- Table structure for table `hh_social_media_user`
--
CREATE TABLE `hh_social_media_user` (
`uid` int(11) NOT NULL,
`sid` int(11) NOT NULL,
`user_social_id` varchar(255) NOT NULL,
PRIMARY KEY (`uid`, `sid`),
UNIQUE KEY `social_user_id` (`social_user_id`),
CONSTRAINT `hh_social_media_user_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `hh_user` (`id`),
CONSTRAINT `hh_social_media_user_ibfk_2` FOREIGN KEY (`sid`) REFERENCES `hh_social_media` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `hh_social_media_user`
VALUES (1001,81,12345678),(1001,82,23456789),(1002,81,34567891),(1003,82,45678912),
(1004,81,56789123),(1005,81,67891234),(1005,82,78912345);
--
-- Table structure for table `hh_level`
--
CREATE TABLE `hh_level` (
`id` int(11) NOT NULL,
`name` varchar(255),
`min_points` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
UNIQUE KEY `min_points` (`min_points`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
INSERT INTO `hh_level`
VALUES (1,NULL,0),(2,NULL,60),(3,NULL,90),(4,NULL,135),(5,NULL,202),(6,NULL,303),
(7,NULL,455),(8,NULL,683),(9,NULL,1025),(10,NULL,1537);
--
-- Table structure for table `hh_level_user`
--
CREATE TABLE `hh_level_user` (
`lid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
PRIMARY KEY (`lid`, `uid`),
CONSTRAINT `hh_level_user_ibfk_1` FOREIGN KEY (`lid`) REFERENCES `hh_level` (`id`),
CONSTRAINT `hh_lvel_user_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `hh_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `hh_level_user`
VALUES (10,1001),(1,1002),(4,1003),(7,1004),(8,1005);
--
-- Table structure for table `hh_role`
--
CREATE TABLE `hh_role` (
`id` int(11) NOT NULL,
`name` varchar(255),
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
INSERT INTO `hh_role`
VALUES (1,'administrator'),(2,'reviewer'),(3,'user');
--
-- Table structure for table `hh_role_user`
--
CREATE TABLE `hh_role_user` (
`rid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
PRIMARY KEY (`rid`, `uid`),
CONSTRAINT `hh_role_user_ibfk_1` FOREIGN KEY (`rid`) REFERENCES `hh_role` (`id`),
CONSTRAINT `hh_role_user_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `hh_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `hh_role_user`
VALUES (1,1001),(3,1002),(3,1003),(2,1004),(2,1005);
--
-- Table structure for table `hh_tag`
--
CREATE TABLE `hh_tag` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
INSERT INTO `hh_tag`
VALUES (1,'Homelessness'),(2,'Hunger'),(3,'Advocacy'),(4,'Environment'),(5,'Children'),(6,'Disabilities'),
(7,'Veterans'),(8,'Sports'),(9,'Seniors'),(10,'Handywork'),(11,'tutoring');
--
-- Table structure for table `hh_event`
--
CREATE TABLE `hh_event` (
`id` int(11) NOT NULL,
`name` varchar(255),
`oid` int(11) NOT NULL,
`street` varchar(255) NOT NULL,
`street_2` varchar(255),
`city` varchar(255) NOT NULL,
`state` varchar(255) NOT NULL,
`zip` varchar(5) NOT NULL,
`description` varchar(255),
`num_volunteers` int(11),
`num_days` int(11),
PRIMARY KEY (`id`, `name`),
CONSTRAINT `hh_event_ibfk_1` FOREIGN KEY (`oid`) REFERENCES `hh_user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
INSERT INTO `hh_event`(`id`,`name`,`oid`,`street`,`city`,`state`,`zip`,`description`,`num_volunteers`,`num_days`)
VALUES (502,'Tutoring at the Boys and Girls Club',1002,'another address','another town','state',54321,'Afterschool tutoring for grades 6-12 in Math and English',5,4),
(501,'Special Olympics Summer Games',1005,'another address','another town','state',54321,'Referees and fans needed for track and field, soccer, softball, and swimming',50,2);
--
-- Table structure for table `hh_event_date`
--
CREATE TABLE `hh_event_date` (
`id` int(11) NOT NULL,
`eid` int(11) NOT NULL,
`date` datetime,
`start` time,
`end` time,
PRIMARY KEY (`id`, `eid`, `date`),
CONSTRAINT `hh_event_date_ibfk_1` FOREIGN KEY (`eid`) REFERENCES `hh_event` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
INSERT INTO `hh_event_date`(`id`,`eid`,`date`,`start`,`end`)
VALUES (5021,502,'2017-09-18','16:00','18:00'),(5022,502,'2017-09-19','16:00','18:00'),(5023,502,'2017-09-20','16:00','18:00'),
(5024,502,'2017-09-21','16:00','18:00'),(5011,501,'2017-06-02','09:00','17:00'),(5012,501,'2018-06-04','09:00','17:00');
--
-- Table structure for table `hh_event_time`
-- Allows for more than one start/end time per day
--
CREATE TABLE `hh_event_time` (
`did` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`start` time NOT NULL,
`end` time,
PRIMARY KEY (`did`, `uid`, `start`),
CONSTRAINT `hh_event_time_ibfk_1` FOREIGN KEY (`did`) REFERENCES `hh_event_date` (`id`),
CONSTRAINT `hh_event_time_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `hh_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `hh_event_time`(`did`,`uid`,`start`,`end`)
VALUES (5011,1001,'09:00','17:00'),(5012,1001,'09:00','12:00'),(5012,1001,'13:00','17:00'),(5012,1005,'09:00','15:00');
--
-- Table structure for table `hh_event_review`
--
CREATE TABLE `hh_event_review` (
`eid` int(11) NOT NULL,
`rid` int(11) NOT NULL,
`approved` enum('Yes','No') NOT NULL DEFAULT 'No',
`comment` varchar(255),
PRIMARY KEY (`eid`, `rid`),
CONSTRAINT `hh_event_review_ibfk_1` FOREIGN KEY (`eid`) REFERENCES `hh_event` (`id`),
CONSTRAINT `hh_event_review_ibfk_2` FOREIGN KEY (`rid`) REFERENCES `hh_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `hh_event_review`
VALUES (501,1001,'Yes',NULL),(502,1001,'Yes',NULL);
--
-- Table structure for table `hh_event_register`
--
CREATE TABLE `hh_event_register` (
`did` int(11) NOT NULL,
`uid` int(11) NOT NULL,
PRIMARY KEY (`did`, `uid`),
CONSTRAINT `hh_event_register_ibfk_1` FOREIGN KEY (`did`) REFERENCES `hh_event_date` (`id`),
CONSTRAINT `hh_event_register_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `hh_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `hh_event_register`
VALUES (5011,1001),(5012,1001),(5012,1005),(5021,1002),(5022,1003),(5023,1004),(5024,1005);
--
-- Table structure for table `hh_tag_user`
--
CREATE TABLE `hh_tag_user` (
`uid` int(11) NOT NULL,
`tid` int(11) NOT NULL,
PRIMARY KEY (`uid`, `tid`),
CONSTRAINT `hh_tag_user_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `hh_user` (`id`),
CONSTRAINT `hh_tag_user_ibfk_2` FOREIGN KEY (`tid`) REFERENCES `hh_tag` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `hh_tag_user`
VALUES (1001,10),(1001,9),(1001,6),(1001,1),(1001,11),(1001,4),
(1002,2),(1002,1),(1002,4),(1002,5),(1002,7),(1002,11),
(1003,11),(1003,10),(1003,9),(1003,8),(1003,7),(1003,6),
(1004,11),(1004,5),(1004,4),(1004,3),(1004,2),(1004,1),
(1005,11),(1005,9),(1005,8),(1005,7),(1005,6),(1005,5);
--
-- Table structure for table `hh_tag_event`
--
CREATE TABLE `hh_tag_event` (
`eid` int(11) NOT NULL,
`tid` int(11) NOT NULL,
PRIMARY KEY (`eid`, `tid`),
CONSTRAINT `hh_tag_event_ibfk_1` FOREIGN KEY (`eid`) REFERENCES `hh_event` (`id`),
CONSTRAINT `hh_tag_event_ibfk_2` FOREIGN KEY (`tid`) REFERENCES `hh_tag` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `hh_tag_event`
VALUES (501,5),(501,6),(501,8),(502,5),(502,11);
| true
|
034065c25f2e1bb0ff952d6cf7fb5b7f24d51ff7
|
SQL
|
yonelT/essaie-2-open-food-facts-javaEE
|
/bin/1 - Recherche 100 produits selon la catégorie, marque, nom, grade nutritionnel, énergie, graisse.sql
|
UTF-8
| 314
| 3.25
| 3
|
[] |
no_license
|
use openfoodfacts;
select categories.nom as CATEGORIE, marques.nom as MARQUE, produits.nom as NOM_PRODUIT, produits.grade as GRADE_NUTRITIONEL, produits.energie as ENERGIE, produits.graisse as GRAISSE
from categories, marques, produits
where categories.id=produits.id_cat and marques.id=produits.id_mrq limit 100;
| true
|
23c924ccd8be4c0498ba1dfb00d9b5b8944ef142
|
SQL
|
tilluhlig/ostepu-core
|
/DB/DBNotification/Sql/DeleteNotification.sql
|
UTF-8
| 559
| 2.78125
| 3
|
[] |
no_license
|
<?php
/**
* @file DeleteNotification.sql
* deletes an specified Notification from %Notification table
*
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL version 3
*
* @package OSTEPU (https://github.com/ostepu/system)
* @since 0.4.3
*
* @author Till Uhlig <till.uhlig@student.uni-halle.de>
* @date 2015
*
* @param int \$notid a %Notification identifier
* @result -
*/
?>
DELETE FROM `Notification<?php echo $pre; ?>_<?php echo Notification::getCourseFromNotificationId($notid); ?>`
WHERE
NOT_id = '<?php echo Notification::getIdFromNotificationId($notid); ?>'
| true
|
1192fe529580d1bfa934048b06233e911556040c
|
SQL
|
arpitpardesi/Advance-Analytics
|
/RDBMS/Day 9 (SQL)/TRIGGER.sql
|
UTF-8
| 1,524
| 4.09375
| 4
|
[] |
no_license
|
CREATE TABLE TAB1(A INTEGER);
CREATE TABLE TAB2(B INTEGER);
CREATE TABLE TAB3(C INTEGER);
DROP TABLE tab3
-----------------------------------
CREATE TRIGGER TRIG1
ON TAB1
FOR INSERT
AS
BEGIN
INSERT INTO TAB2
SELECT * FROM INSERTED
END
-------------------------
select * from tab1
select * from tab2
insert into tab1 values(100)
----------------------------------
CREATE TRIGGER TRIG2
ON TAB1
FOR DELETE
AS
BEGIN
INSERT INTO TAB3
SELECT * FROM DELETED
END
DELETE FROM TAB1
-------------------------
select * from tab1
select * from tab3
-------------------------
CREATE TABLE TAB4(D INTEGER);
DROP TRIGGER TRIG4
CREATE TRIGGER TRIG3
ON TAB4
FOR INSERT
AS
BEGIN
IF (SELECT D FROM INSERTED)<100
BEGIN
PRINT'VALUE CANNOT BE LESS THEAN 100'
rollback tran
END
END
insert into tab4 values(90)
select * from tab4
--------------------------------
Create table s(roll integer, name varchar(40));
Insert into s values(1,'A');
Insert into s values(2,'B');
Insert into s values(3,'C');
Insert into s values(4,'D');
create table r(roll integer,marks integer);
Insert into r values(2,90);
Insert into r values(3,98);
--------------------------------------
select * from s;
select * from r
create view sr
as
select s.roll,s.name,r.marks
from s,r
where s.roll = r.roll;
insert into sr values(5,'z',80);
create trigger trig12
on SR
INSTEAD OF INSERT --fOR INSERTING VALUES THROUGH VIEW
as
begin
insert into s
select roll,name
from Inserted
insert into r
select roll,marks
from inserted
end
| true
|
d44dacf1ace50fc1c0654fe1802a6c0615f41653
|
SQL
|
hitoshidevx/SQLServer
|
/ClinicaVet/DML/ClinicaVet.sql
|
ISO-8859-1
| 833
| 3.515625
| 4
|
[] |
no_license
|
/*DML - Data Manipulation Language*/
USE clinica;
/*INSERT - insero de dados*/
INSERT INTO clinica (Nome, Endereco) VALUES ('PetMania', 'Vila Mogilar');
INSERT INTO veterinario (Nome, IdClinica) VALUES ('Elaine Y.', 2);
INSERT INTO dono (Nome) VALUES ('Breno');
INSERT INTO espcie (Especie) VALUES ('Vira-Lata');
INSERT INTO raa (Raa, IdEspecie) VALUES ('Cachorro', 4);
INSERT INTO pet (Nome, DataNascimento, IdDono, IdRaca) VALUES('Scooby', '2019-01-01T12:00:00', 2, 6);
/*DQL de consulta simples*/
SELECT * FROM clinica;
SELECT * FROM dono;
SELECT * FROM pet;
SELECT * FROM raa;
SELECT * FROM espcie;
SELECT * FROM veterinario;
/*UPDATE - Alterar dados (NO ESQUECER DO WHERE!!)*/
UPDATE pet SET
IdDono = 4
WHERE IdPet = 4;
/*DELETE - Deletar Dados (NO ESQUECER DO WHERE!!)*/
DELETE FROM raa WHERE IdRaca = 4;
| true
|
4700835f4ca594dbc1fd7ab2e74ef1c1c793dd65
|
SQL
|
Ramkavanan/easybpm
|
/src/main/resources/bpmFunctions/GetFamilyTree.sql
|
UTF-8
| 1,721
| 3.5625
| 4
|
[] |
no_license
|
CREATE DEFINER=`root`@`%` FUNCTION `GetFamilyTree`(GivenID VARCHAR(1024),needChild BOOLEAN) RETURNS VARCHAR(1024) CHARSET latin1
DETERMINISTIC
BEGIN
DECLARE rv,q,queue,queue_children,front_id VARCHAR(1024);
DECLARE queue_length,pos INT;
SET rv = '';
SET queue = GivenID;
SET queue_length = 1;
WHILE queue_length > 0 DO
IF queue_length = 1 THEN
SET front_id = queue;
SET queue = '';
ELSE
SET pos = LOCATE(',',queue) - 1;
SET q = SUBSTR(queue,1,pos);
SET front_id = q;
SET queue = SUBSTR(queue,pos+2);
END IF;
SET queue_length = queue_length - 1;
IF needChild = TRUE THEN
SELECT IFNULL(qc,'') INTO queue_children
FROM (SELECT GROUP_CONCAT(id) qc
FROM ETEC_USER WHERE manager = front_id) A;
ELSE
SELECT IFNULL(qc,'') INTO queue_children
FROM (SELECT GROUP_CONCAT(manager) qc
FROM ETEC_USER WHERE id = front_id) A;
END IF;
IF LENGTH(queue_children) = 0 THEN
IF LENGTH(queue) = 0 THEN
SET queue_length = 0;
END IF;
ELSE
IF LENGTH(rv) = 0 THEN
SET rv = queue_children;
ELSE
SET rv = CONCAT(rv,',',queue_children);
END IF;
IF LENGTH(queue) = 0 THEN
SET queue = queue_children;
ELSE
SET queue = CONCAT(queue,',',queue_children);
END IF;
SET queue_length = LENGTH(queue) - LENGTH(REPLACE(queue,',','')) + 1;
END IF;
END WHILE;
RETURN rv;
END
| true
|
b422ff909be5fc23f9ec01071782cb3647390a3b
|
SQL
|
amednin/monitor-service
|
/sql/monitor_service_backup_2019-06-05.sql
|
UTF-8
| 20,257
| 3.09375
| 3
|
[] |
no_license
|
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.10)
# Database: monitor_service
# Generation Time: 2019-06-08 04:16:48 +0000
# ************************************************************
/*!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 */;
/*!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 */;
# Dump of table ActivityType
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ActivityType`;
CREATE TABLE `ActivityType` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `ActivityType` WRITE;
/*!40000 ALTER TABLE `ActivityType` DISABLE KEYS */;
INSERT INTO `ActivityType` (`id`, `type`)
VALUES
(1,'ACTIVITY'),
(2,'BENCHMARK'),
(3,'ERROR');
/*!40000 ALTER TABLE `ActivityType` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table AuditLog
# ------------------------------------------------------------
DROP TABLE IF EXISTS `AuditLog`;
CREATE TABLE `AuditLog` (
`poi_log_id` int(11) NOT NULL,
`current_value` varchar(500) DEFAULT NULL,
`old_value` varchar(500) DEFAULT NULL,
`entity_name` varchar(45) NOT NULL,
`entity_id` int(11) DEFAULT NULL,
`notes` longtext,
`action` varchar(100) NOT NULL,
PRIMARY KEY (`poi_log_id`),
CONSTRAINT `fk_AuditLog_PoiLog1` FOREIGN KEY (`poi_log_id`) REFERENCES `PoiLog` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `AuditLog` WRITE;
/*!40000 ALTER TABLE `AuditLog` DISABLE KEYS */;
INSERT INTO `AuditLog` (`poi_log_id`, `current_value`, `old_value`, `entity_name`, `entity_id`, `notes`, `action`)
VALUES
(3,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(4,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(6,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(7,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(8,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(9,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(10,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(11,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(12,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(13,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(14,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(15,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(16,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(17,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(18,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(19,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(20,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(21,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(22,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'\\/api\\/job\\/batch'),
(23,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/job/batch'),
(24,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(25,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(26,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(27,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(28,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(29,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(30,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(31,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(32,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(33,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(34,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(35,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(36,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(37,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(38,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(39,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(40,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(41,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(42,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(43,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(44,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(45,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(46,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(47,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(48,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(49,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(50,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(51,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(52,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(53,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(54,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(55,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(56,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(57,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(58,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(59,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(60,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(61,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(62,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(63,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(64,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(65,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(66,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(67,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(68,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(69,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login'),
(70,'{\"jobs\": \"11, 12\"}',NULL,'Job',NULL,NULL,'/api/login');
/*!40000 ALTER TABLE `AuditLog` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table Client
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Client`;
CREATE TABLE `Client` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(45) NOT NULL,
`user_agent` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `Client` WRITE;
/*!40000 ALTER TABLE `Client` DISABLE KEYS */;
INSERT INTO `Client` (`id`, `username`, `user_agent`)
VALUES
(4,'bla@test.com','PostmanRuntime\\/7.6.1'),
(5,'bla@test.com','PostmanRuntime/7.6.1');
/*!40000 ALTER TABLE `Client` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ErrorLog
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ErrorLog`;
CREATE TABLE `ErrorLog` (
`poi_log_id` int(11) NOT NULL,
`severity` varchar(45) NOT NULL,
`message` varchar(500) NOT NULL,
`code` int(11) NOT NULL,
`trace_message` longtext NOT NULL,
`meta_data` longtext,
PRIMARY KEY (`poi_log_id`),
CONSTRAINT `fk_ErrorLog_PoiLog1` FOREIGN KEY (`poi_log_id`) REFERENCES `PoiLog` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `ErrorLog` WRITE;
/*!40000 ALTER TABLE `ErrorLog` DISABLE KEYS */;
INSERT INTO `ErrorLog` (`poi_log_id`, `severity`, `message`, `code`, `trace_message`, `meta_data`)
VALUES
(5,'high','Unexpected Exception. Try again later',500,'cURL error 7: Failed to connect to localhost port 8004: Connection refused (see http:\\/\\/curl.haxx.se\\/libcurl\\/c\\/libcurl-errors.html)',NULL);
/*!40000 ALTER TABLE `ErrorLog` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table Log
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Log`;
CREATE TABLE `Log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(45) NOT NULL,
`service` varchar(45) NOT NULL,
`log` longtext NOT NULL,
`logged_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Dump of table MetricsLog
# ------------------------------------------------------------
DROP TABLE IF EXISTS `MetricsLog`;
CREATE TABLE `MetricsLog` (
`cpu_usage` decimal(10,3) DEFAULT NULL,
`response_time_ms` decimal(10,3) DEFAULT NULL,
`poi_log_id` int(11) NOT NULL,
`requested_at` datetime DEFAULT NULL,
`response_at` datetime DEFAULT NULL,
`resource` varchar(45) NOT NULL,
`method` varchar(45) NOT NULL DEFAULT '',
PRIMARY KEY (`poi_log_id`),
KEY `fk_MetricsLog_PoiLog1_idx` (`poi_log_id`),
CONSTRAINT `fk_MetricsLog_PoiLog1` FOREIGN KEY (`poi_log_id`) REFERENCES `PoiLog` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `MetricsLog` WRITE;
/*!40000 ALTER TABLE `MetricsLog` DISABLE KEYS */;
INSERT INTO `MetricsLog` (`cpu_usage`, `response_time_ms`, `poi_log_id`, `requested_at`, `response_at`, `resource`, `method`)
VALUES
(NULL,12.866,3,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/job/batch','PATCH'),
(NULL,12.866,4,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/job/batch','PATCH'),
(NULL,12.866,6,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,7,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,8,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,9,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,10,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,11,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,12,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,13,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,14,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,15,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,16,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,17,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,18,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,19,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,20,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,21,'2019-05-12 16:39:27','2019-05-12 16:39:27','\\/api\\/job\\/batch','PATCH'),
(NULL,12.866,22,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/job/batch','PATCH'),
(NULL,12.866,23,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/job/batch','PATCH'),
(NULL,12.866,24,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,25,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,26,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,27,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,28,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,29,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,30,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,31,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,32,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,33,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,34,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,35,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,36,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,37,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,38,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,39,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,40,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,41,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,42,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,43,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,44,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,45,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,46,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,47,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,48,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,49,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,50,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,51,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,52,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,53,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,54,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,55,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,56,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,57,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,58,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,59,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,60,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,61,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,62,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,63,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,64,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,65,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,66,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,67,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,68,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,69,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH'),
(NULL,12.866,70,'2019-05-12 16:39:27','2019-05-12 16:39:27','/api/login','PATCH');
/*!40000 ALTER TABLE `MetricsLog` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table PoiLog
# ------------------------------------------------------------
DROP TABLE IF EXISTS `PoiLog`;
CREATE TABLE `PoiLog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created_at` datetime NOT NULL,
`activity_type_id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`ip` varchar(45) DEFAULT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`id`,`activity_type_id`,`client_id`),
KEY `fk_PoiLog_ActivityType1_idx` (`activity_type_id`),
KEY `fk_PoiLog_Client1_idx` (`client_id`),
CONSTRAINT `fk_PoiLog_ActivityType1` FOREIGN KEY (`activity_type_id`) REFERENCES `ActivityType` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_PoiLog_Client1` FOREIGN KEY (`client_id`) REFERENCES `Client` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `PoiLog` WRITE;
/*!40000 ALTER TABLE `PoiLog` DISABLE KEYS */;
INSERT INTO `PoiLog` (`id`, `created_at`, `activity_type_id`, `user_id`, `ip`, `client_id`)
VALUES
(3,'2019-06-03 21:00:29',1,200,'127.0.0.1',4),
(4,'2019-06-03 21:01:03',1,200,'127.0.0.1',4),
(5,'2019-06-03 22:24:46',3,200,'127.0.0.1',4),
(6,'2019-06-04 00:13:11',1,200,'127.0.0.1',4),
(7,'2019-06-04 00:13:38',1,200,'127.0.0.1',4),
(8,'2019-06-04 00:14:12',1,200,'127.0.0.1',4),
(9,'2019-06-04 00:16:41',1,200,'127.0.0.1',4),
(10,'2019-06-04 00:17:11',1,200,'127.0.0.1',4),
(11,'2019-06-04 00:17:59',1,200,'127.0.0.1',4),
(12,'2019-06-04 00:22:44',1,200,'127.0.0.1',4),
(13,'2019-06-04 00:23:35',1,200,'127.0.0.1',4),
(14,'2019-06-04 18:47:39',1,200,'127.0.0.1',4),
(15,'2019-06-04 18:54:33',1,200,'127.0.0.1',4),
(16,'2019-06-04 18:55:32',1,200,'127.0.0.1',4),
(17,'2019-06-04 18:56:33',1,200,'127.0.0.1',4),
(18,'2019-06-04 19:05:09',1,200,'127.0.0.1',4),
(19,'2019-06-04 19:05:27',1,200,'127.0.0.1',4),
(20,'2019-06-04 19:06:31',1,200,'127.0.0.1',4),
(21,'2019-06-04 19:07:09',1,200,'127.0.0.1',4),
(22,'2019-06-04 19:08:30',1,200,'127.0.0.1',4),
(23,'2019-06-04 20:09:31',1,200,'127.0.0.1',5),
(24,'2019-06-04 20:10:13',1,200,'127.0.0.1',5),
(25,'2019-06-04 21:00:39',1,200,'127.0.0.1',5),
(26,'2019-06-04 21:06:18',1,200,'127.0.0.1',5),
(27,'2019-06-04 21:09:01',1,200,'127.0.0.1',5),
(28,'2019-06-04 21:09:31',1,200,'127.0.0.1',5),
(29,'2019-06-04 21:14:41',1,200,'127.0.0.1',5),
(30,'2019-06-04 21:17:01',1,200,'127.0.0.1',5),
(31,'2019-06-04 21:17:08',1,200,'127.0.0.1',5),
(32,'2019-06-04 21:17:09',1,200,'127.0.0.1',5),
(33,'2019-06-04 21:17:10',1,200,'127.0.0.1',5),
(34,'2019-06-04 21:17:13',1,200,'127.0.0.1',5),
(35,'2019-06-04 21:17:15',1,200,'127.0.0.1',5),
(36,'2019-06-04 21:17:16',1,200,'127.0.0.1',5),
(37,'2019-06-04 21:17:17',1,200,'127.0.0.1',5),
(38,'2019-06-04 21:17:19',1,200,'127.0.0.1',5),
(39,'2019-06-04 21:19:07',1,200,'127.0.0.1',5),
(40,'2019-06-04 21:19:08',1,200,'127.0.0.1',5),
(41,'2019-06-04 21:19:09',1,200,'127.0.0.1',5),
(42,'2019-06-04 21:35:33',1,200,'127.0.0.1',5),
(43,'2019-06-04 21:35:34',1,200,'127.0.0.1',5),
(44,'2019-06-04 21:35:35',1,200,'127.0.0.1',5),
(45,'2019-06-04 21:35:36',1,200,'127.0.0.1',5),
(46,'2019-06-04 21:35:37',1,200,'127.0.0.1',5),
(47,'2019-06-04 21:35:38',1,200,'127.0.0.1',5),
(48,'2019-06-05 19:17:39',1,200,'127.0.0.1',5),
(49,'2019-06-05 19:17:40',1,200,'127.0.0.1',5),
(50,'2019-06-05 19:17:43',1,200,'127.0.0.1',5),
(51,'2019-06-05 19:17:47',1,200,'127.0.0.1',5),
(52,'2019-06-05 19:17:49',1,200,'127.0.0.1',5),
(53,'2019-06-05 19:19:51',1,200,'127.0.0.1',5),
(54,'2019-06-05 19:19:52',1,200,'127.0.0.1',5),
(55,'2019-06-05 19:19:53',1,200,'127.0.0.1',5),
(56,'2019-06-05 19:19:54',1,200,'127.0.0.1',5),
(57,'2019-06-05 19:57:50',1,200,'127.0.0.1',5),
(58,'2019-06-05 19:57:51',1,200,'127.0.0.1',5),
(59,'2019-06-05 19:57:52',1,200,'127.0.0.1',5),
(60,'2019-06-05 19:57:53',1,200,'127.0.0.1',5),
(61,'2019-06-05 19:57:55',1,200,'127.0.0.1',5),
(62,'2019-06-05 19:57:56',1,200,'127.0.0.1',5),
(63,'2019-06-05 19:57:57',1,200,'127.0.0.1',5),
(64,'2019-06-05 20:02:30',1,200,'127.0.0.1',5),
(65,'2019-06-05 20:06:31',1,200,'127.0.0.1',5),
(66,'2019-06-05 20:06:32',1,200,'127.0.0.1',5),
(67,'2019-06-05 20:06:33',1,200,'127.0.0.1',5),
(68,'2019-06-05 20:06:34',1,200,'127.0.0.1',5),
(69,'2019-06-05 20:06:36',1,200,'127.0.0.1',5),
(70,'2019-06-05 20:06:38',1,200,'127.0.0.1',5);
/*!40000 ALTER TABLE `PoiLog` ENABLE KEYS */;
UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_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 */;
| true
|
c2ec0da35db949f957ffd56a02585c3d256eb454
|
SQL
|
htamakos/oracle_samples
|
/partition/partitioning_enhancement_oracle_11g/interval_partitioning/create_partitioning.sql
|
UTF-8
| 267
| 3.28125
| 3
|
[] |
no_license
|
CREATE TABLE interval_tab (
id NUMBER,
code VARCHAR2(10),
description VARCHAR2(50),
created_date DATE
)
PARTITION BY RANGE (created_date)
INTERVAL (NUMTOYMINTERVAL(1, 'MONTH'))
(
PARTITION part_01 VALUES LESS THAN (TO_DATE('01-NOV-2007', 'DD-MON-YYYY'))
);
| true
|
dc6e049e476d52b9fd973b297abf013c86cc4ec5
|
SQL
|
Mehdikossir/Projects
|
/Projets/ Automaton learning application/data/init.sql
|
UTF-8
| 2,688
| 3.5
| 4
|
[] |
no_license
|
CREATE TABLE "Users" (
id SERIAL PRIMARY KEY,
firstName VARCHAR NOT NULL,
lastName VARCHAR NOT NULL,
pseudo VARCHAR NOT NULL,
password VARCHAR NOT NULL,
suspendedAccount BOOLEAN NOT NULL DEFAULT FALSE,
isAdmin BOOLEAN NOT NULL DEFAULT FALSE
);
INSERT INTO "Users" (firstName, lastName, pseudo, password, suspendedAccount, isAdmin)
VALUES ('John', 'Doe', 'admin', 'password', FALSE, TRUE);
INSERT INTO "Users" (firstName, lastName, pseudo, password, suspendedAccount, isAdmin)
VALUES ('Bourse', 'Coddity', 'coddity', 'coddity', FALSE, TRUE);
INSERT INTO "Users" (firstName, lastName, pseudo, password, suspendedAccount, isAdmin)
VALUES ('Thomas', 'Meyer', 'tm', 'password', FALSE, TRUE);
INSERT INTO "Users" (firstName, lastName, pseudo, password, suspendedAccount, isAdmin)
VALUES ('Romain', 'Beuzelin', 'rb', 'password', FALSE, TRUE);
INSERT INTO "Users" (firstName, lastName, pseudo, password, suspendedAccount, isAdmin)
VALUES ('El Mehdi', 'Kossir', 'md', 'password', FALSE, TRUE);
INSERT INTO "Users" (firstName, lastName, pseudo, password)
VALUES ('Joueur', 'Un', 'j1', 'password');
INSERT INTO "Users" (firstName, lastName, pseudo, password)
VALUES ('Joueur', 'Deux', 'j2', 'password');
INSERT INTO "Users" (firstName, lastName, pseudo, password)
VALUES ('Joueur', 'Trois', 'j3', 'password');
CREATE TABLE "Challenges" (
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL,
difficultyLevel INTEGER,
description TEXT,
sequenceNumber INTEGER
);
INSERT INTO "Challenges" (name, difficultyLevel, description, sequenceNumber)
VALUES ('Challenge 1', 1, '{}', 5);
INSERT INTO "Challenges" (name, difficultyLevel, description, sequenceNumber)
VALUES ('Challenge 2', 2, '{}', 2);
INSERT INTO "Challenges" (name, difficultyLevel, description, sequenceNumber)
VALUES ('Challenge 3', 3, '{}', 6);
INSERT INTO "Challenges" (name, difficultyLevel, description, sequenceNumber)
VALUES ('Challenge 5', 4, '{}', 3);
INSERT INTO "Challenges" (name, difficultyLevel, description, sequenceNumber)
VALUES ('Challenge 5', 5, '{}', 5);
CREATE TABLE "ChallengesPlayed" (
idUser INTEGER NOT NULL,
idChallenge INTEGER NOT NULL,
progression INTEGER,
savePlayersSolution VARCHAR,
PRIMARY KEY (idUser,idChallenge),
CONSTRAINT ChallengesPlayed_idChallenge_fkey FOREIGN KEY (idChallenge)
REFERENCES "Challenges" (id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT ChallengesPlayed_idUser_fkey FOREIGN KEY (idUser)
REFERENCES "Users" (id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
);
INSERT INTO "ChallengesPlayed" (idUser, idChallenge, progression, savePlayersSolution)
VALUES (1, 1,2, 'ma progression');
| true
|
3603c6cec4dfaeb0672b7d7ad504c6497a59fabc
|
SQL
|
Greenfin17/chinook-sql-exercises
|
/line_item_track_artist.sql
|
UTF-8
| 278
| 3.1875
| 3
|
[] |
no_license
|
select InvoiceLine.InvoiceId as [Invoice], Track.Name as [Track Name], Artist.Name as [Artist]
from InvoiceLine join Track
on InvoiceLine.TrackId = Track.TrackId
join Album
on Track.AlbumId = Album.AlbumId
join Artist
on Album.ArtistId = Artist.ArtistId
Order by Artist.Name;
| true
|
968cb2387fd1fed07a725d5a698c0daad3310fe9
|
SQL
|
sketchband/test29
|
/test31/SQL.sql
|
UTF-8
| 453
| 3.203125
| 3
|
[] |
no_license
|
CREATE TABLE MEMBER12(
zipcode char(6),
address char(50)
)engine=innodb charset=utf8;
select * from MEMBER12;
drop table MEMBER12;
create table tblZipcode2(
zipcode char(8) not null,
area1 char(10) default null,
area2 char(20) default null,
area3 char(40) default null,
area4 char(20) default null
)engine=innodb charset=utf8;
select count(*) from tblZipcode2;
select * from tblZipcode2;
drop table tblZipcode2;
drop table zipcode;
| true
|
41654af304e8d1188568310ad9bd59824805e2ad
|
SQL
|
WhySeven/Education-Repository
|
/Базы данных/БД_ЛАБЫ/Labs_4sem/Lab_3/Lab_3_3.sql
|
UTF-8
| 550
| 2.8125
| 3
|
[] |
no_license
|
Drop Table Air_Price;
Create Table Air_Price
(
Код_Рейса int not null IDENTITY(1,1),
Цена money,
Дата_покупки Date,
Дата_вылета Date
)
insert into Air_Price (Цена,Дата_Покупки,Дата_вылета) values
(5000,'01.11.2020','01.11.2020'),
(5500,'02.11.2020','01.11.2020'),
(6000,'03.11.2020','01.11.2020'),
(6500,'04.11.2020','01.11.2020'),
(7000,'05.11.2020','05.11.2020');
update Air_Price set Цена = Цена*1.1 where Дата_покупки = Дата_вылета;
Select* from Air_Price;
| true
|
41edf7165e5c889341f65b5de7620dbb704428c5
|
SQL
|
HaydenTaylor/practice3
|
/W3D1 - SQL/notes/notes.sql
|
UTF-8
| 1,635
| 4.5625
| 5
|
[] |
no_license
|
-- RDBMS
-- SELECT, FROM, WHERE
SELECT
fname
FROM
characters
WHERE
lname = 'Baratheon'
-- ORDER, LIMIT
SELECT
*
FROM
characters
WHERE
lname = 'Baratheon'
ORDER BY
fname
LIMIT
3
-- LIKE, IN, NULL
SELECT
*
FROM
characters
WHERE
lname LIKE 'S%'
SELECT
*
FROM
characters
WHERE
lname IN ('Stark', 'Snow')
SELECT
*
FROM
pets
WHERE
owner_id IS NULL
-- DISTINCT
SELECT
DISTINCT lname
FROM
characters
-- GROUP BY, HAVING, AGGREGATE FUNCTIONS
SELECT
lname, COUNT(id) AS family_size
FROM
characters
GROUP BY
lname
HAVING
COUNT(id) > 2
-- SUBQUERIES
-- don't actually need a subquery here, but we did it!
SELECT
robs.lname
FROM (
SELECT
*
FROM
characters
WHERE
fname LIKE 'Rob%'
) AS robs
-- JOIN
-- inner join
SELECT
*
FROM
characters
JOIN
pets ON pets.owner_id = characters.id
-- left outer join
SELECT
*
FROM
characters
LEFT OUTER JOIN
pets ON characters.id = pets.owner_id
-- full outer join -> you probably shouldn't be using this...
SELECT
*
FROM
characters
FULL OUTER JOIN
pets ON pets.owner_id = characters.id
-- house_memberships is a "join table" - used for many-to-many relationships
SELECT
COUNT(characters.id), houses.name
FROM
characters
JOIN
house_memberships
ON
characters.id = house_memberships.character_id
JOIN
houses
ON
house_memberships.house_id = houses.id
GROUP BY
houses.id
-- COALESCE, CASE, CAST
-- default (this is a silly example)
SELECT
name, COALESCE(owner_id, 25)
FROM
pets
SELECT
fname,
CASE lname
WHEN 'Stark'
THEN 'Good'
ELSE 'Bad'
END AS goodness
FROM
characters
| true
|
3251792579bc831626fb05702c1478a42876ef1d
|
SQL
|
dabarc/DabarcStrategyNewDesignMabe
|
/DabarcStrategyNewDesign/dabarc/Stored Procedures/sp_SSIS_ReadListOfTDM_Reg.sql
|
UTF-8
| 1,299
| 3.125
| 3
|
[] |
no_license
|
CREATE PROCEDURE [dabarc].[sp_SSIS_ReadListOfTDM_Reg] @IsRegister INT, @table_id INT AS
-----------------------------------------------------------------------
-- Tabla Interfaz de Trabajo
-----------------------------------------------------------------------
CREATE TABLE #t_Objeto(
Object_id int NULL,
name nvarchar(128) NULL,
description nvarchar(256) NULL,
type nvarchar(10) NULL)
-----------------------------------------------------------------------
-- Carga de tabla Interfaz
-----------------------------------------------------------------------
IF (@IsRegister = 0)
BEGIN
INSERT INTO #t_Objeto
SELECT ssis_id
,name
,description
,'SSIS' as type
FROM dabarc.t_SSIS
WHERE registered = 0 and name like 'SSIS[_]TDM[_]%'
END
ELSE
BEGIN
INSERT INTO #t_Objeto
SELECT ssis_id
,name
,description
,'SSIS' as type
FROM dabarc.t_SSIS
WHERE registered = 1 and name like 'SSIS[_]TDM[_]%' AND table_id = @table_id
END
-----------------------------------------------------------------------
-- Retorno de Valores
-----------------------------------------------------------------------
SELECT Object_id
,name
,description
,type
FROM #t_Objeto
ORDER BY name
| true
|
5f9c0feec2a8fa5e136795560d05614da5a74881
|
SQL
|
krishnaaddala/MyFirstBootCampRepo
|
/course-content/11-mysql/activities/11-popQuiz/popquiz.sql
|
UTF-8
| 368
| 2.84375
| 3
|
[] |
no_license
|
DROP DATABASE IF EXISTS popquiz_db;
CREATE DATABASE popquiz_db;
USE popquiz_db;
CREATE TABLE quiz(
id INTEGER(10) NOT NULL AUTO_INCREMENT,
name VARCHAR(30),
bidValue INTEGER(10)
);
INSERT INTO quiz(name, bidValue)
VALUES ("Krishna", 100);
INSERT INTO quiz(name, bidValue)
VALUES ("Jerome", 1000);
INSERT INTO quiz(name, bidValue)
VALUES ("Roger", 900);
| true
|
47f4da1caaf371e94d6c5dd14a9d898cca5a1aff
|
SQL
|
happyjianguo/cap-root
|
/cap-paf-service/db/paf_batch_crdt_detail_oracle.sql
|
UTF-8
| 2,320
| 3.328125
| 3
|
[] |
no_license
|
drop table PAF_BATCH_CRDT_DETAIL;
create table PAF_BATCH_CRDT_DETAIL
(
BATCH_NO VARCHAR2(20 CHAR) not null,
SEQ_NO VARCHAR2(20 CHAR) not null,
TX_AMT NUMBER,
CR_ACCTNO VARCHAR2(32 CHAR),
CR_ACCTNAME VARCHAR2(255 CHAR),
CR_CHGNO VARCHAR2(12 CHAR),
CR_OPNCHGNO VARCHAR2(12 CHAR),
CR_ADDR VARCHAR2(80 CHAR),
SUMMARY VARCHAR2(60 CHAR),
REF_ACCTNO VARCHAR2(32 CHAR),
REF_SEQNO1 VARCHAR2(32 CHAR),
REF_SEQNO2 VARCHAR2(32 CHAR),
CAP_AMT NUMBER,
INT_AMT NUMBER,
TX_STATUS VARCHAR2(1 CHAR),
HOST_SEQNO VARCHAR2(32 CHAR),
HOST_RSPCODE VARCHAR2(20 CHAR),
HOST_RSPMSG VARCHAR2(120 CHAR)
);
-- Add comments to the columns
comment on table PAF_BATCH_CRDT_DETAIL
is '公积金批量付款附表';
comment on column PAF_BATCH_CRDT_DETAIL.BATCH_NO
is '批量编号';
comment on column PAF_BATCH_CRDT_DETAIL.SEQ_NO
is '序号';
comment on column PAF_BATCH_CRDT_DETAIL.TX_AMT
is '金额';
comment on column PAF_BATCH_CRDT_DETAIL.CR_ACCTNO
is '收方账号';
comment on column PAF_BATCH_CRDT_DETAIL.CR_ACCTNAME
is '收方户名 ';
comment on column PAF_BATCH_CRDT_DETAIL.CR_CHGNO
is '收方联行号 ';
comment on column PAF_BATCH_CRDT_DETAIL.CR_OPNCHGNO
is '收方开户行联行号 ';
comment on column PAF_BATCH_CRDT_DETAIL.CR_ADDR
is '收方地址 ';
comment on column PAF_BATCH_CRDT_DETAIL.SUMMARY
is '摘要';
comment on column PAF_BATCH_CRDT_DETAIL.REF_ACCTNO
is '业务明细账号';
comment on column PAF_BATCH_CRDT_DETAIL.REF_SEQNO1
is '业务明细流水号 1';
comment on column PAF_BATCH_CRDT_DETAIL.REF_SEQNO2
is '业务明细流水号 2';
comment on column PAF_BATCH_CRDT_DETAIL.CAP_AMT
is '本金发生额';
comment on column PAF_BATCH_CRDT_DETAIL.INT_AMT
is '利息发生额';
comment on column PAF_BATCH_CRDT_DETAIL.TX_STATUS
is '交易状态:0、登记;1、处理中;2、记账成功;3、记账失败';
comment on column PAF_BATCH_CRDT_DETAIL.HOST_SEQNO
is '核心系统流水号';
comment on column PAF_BATCH_CRDT_DETAIL.HOST_RSPCODE
is '核心系统响应代码';
comment on column PAF_BATCH_CRDT_DETAIL.HOST_RSPMSG
is '核心系统响应信息';
-- Create/Recreate primary, unique and foreign key constraints
alter table PAF_BATCH_CRDT_DETAIL add primary key (BATCH_NO,SEQ_NO);
| true
|
5d4410e0be3c3b0149c0b8562057b1382509e0f8
|
SQL
|
raviladhar/BostonCrimes_KaggleData
|
/SQL Quries for data exploration.sql
|
UTF-8
| 2,556
| 3.90625
| 4
|
[] |
no_license
|
select * from dbo.tmp5kbon6z6
-- total offenses reports during all five years
select crimeData.YEAR, count(crimeData.OFFENSE_CODE) as total_offense
from dbo.tmp5kbon6z6 as crimeData
group by crimeData.YEAR
order by total_offense desc
-- frequently reported offenses in the particular streets
select crimeData.OFFENSE_CODE_GROUP, count(crimeData.OFFENSE_CODE_GROUP) as total_offenses, crimeData.STREET
from dbo.tmp5kbon6z6 as crimeData
group by crimeData.OFFENSE_CODE_GROUP, crimeData.STREET
having count(crimeData.OFFENSE_CODE_GROUP) > 5
order by crimeData.OFFENSE_CODE_GROUP
-- frequently reported offenses
select crimeData.OFFENSE_CODE_GROUP, count(crimeData.OFFENSE_CODE_GROUP) as total_offenses
from dbo.tmp5kbon6z6 as crimeData
group by crimeData.OFFENSE_CODE_GROUP
order by total_offenses Desc
-- frequently reported offenses during the particular timing
select crimeData.HOUR, count(crimeData.OFFENSE_CODE_GROUP) as total_offenses
from dbo.tmp5kbon6z6 as crimeData
group by crimeData.HOUR
order by total_offenses Desc
-- frequently reported offenses during the particular Daysof weeks
select crimeData.DAY_OF_WEEK, count(crimeData.OFFENSE_CODE_GROUP) as total_offenses
from dbo.tmp5kbon6z6 as crimeData
group by crimeData.DAY_OF_WEEK
order by total_offenses Desc
-- frequently reported offenses in top 10 District wise
select top(10) crimeData.DISTRICT, count(crimeData.OFFENSE_CODE_GROUP) as total_offenses
from dbo.tmp5kbon6z6 as crimeData
group by crimeData.DISTRICT
order by total_offenses Desc
--which 10 was the highest crimes reports are being reported in 2018
select top(10) crimeData.OFFENSE_CODE_GROUP, crimeData.YEAR ,count(crimeData.OFFENSE_CODE_GROUP) as total_offenses
from dbo.tmp5kbon6z6 as crimeData
where crimeData.Year = 2018
group by crimeData.OFFENSE_CODE_GROUP, crimeData.YEAR
order by total_offenses desc
--street shooting crimes mostly
select crimeData.STREET, crimeData.SHOOTING, count(crimeData.STREET) as total_count
from dbo.tmp5kbon6z6 as crimeData
where crimeData.SHOOTING = 'Y'
group by crimeData.STREET, crimeData.SHOOTING
order by total_count desc
--Every Year more than 10 shooting incidents shooting incidents
select crimeData.STREET, crimeData.SHOOTING, crimeData.YEAR, count(crimeData.STREET) as total_count
from dbo.tmp5kbon6z6 as crimeData
where crimeData.SHOOTING = 'Y'
group by crimeData.STREET, crimeData.SHOOTING, crimeData.YEAR
having count(crimeData.STREET) > 10
order by crimeData.YEAR desc , total_count desc
| true
|
34b16df102d5c81fae35fd74261a5160d7e251cf
|
SQL
|
VERTICA-FAST/FAST
|
/vsql/SFDC/SF_Event.sql
|
UTF-8
| 11,908
| 2.921875
| 3
|
[] |
no_license
|
/****
****Script Name : SF_Event.sql
****Description : Incremental data load for SF_Event
****/
/*Setting timing on */
\timing
/**SET SESSION AUTOCOMMIT TO OFF;**/
\set ON_ERROR_STOP on
CREATE LOCAL TEMP TABLE Start_Time_Tmp ON COMMIT PRESERVE ROWS AS select count(*) count, sysdate st from "swt_rpt_stg"."SF_Event";
/* Inserting values into Audit table */
INSERT INTO swt_rpt_stg.FAST_LD_AUDT
(
SUBJECT_AREA
,TBL_NM
,LD_DT
,START_DT_TIME
,END_DT_TIME
,SRC_REC_CNT
,TGT_REC_CNT
,COMPLTN_STAT
)
select 'SFDC','SF_Event',sysdate::date,sysdate,null,(select count from Start_Time_Tmp) ,null,'N';
Commit;
INSERT /*+Direct*/ INTO swt_rpt_stg.SF_Event_Hist SELECT * from swt_rpt_stg.SF_Event;
COMMIT;
CREATE LOCAL TEMP TABLE duplicates_records ON COMMIT PRESERVE ROWS AS (
select id,max(auto_id) as auto_id from swt_rpt_stg.SF_Event where id in (
select id from swt_rpt_stg.SF_Event group by id,LASTMODIFIEDDATE having count(1)>1)
group by id);
delete from swt_rpt_stg.SF_Event where exists(
select 1 from duplicates_records t2 where swt_rpt_stg.SF_Event.id=t2.id and swt_rpt_stg.SF_Event.auto_id<t2.auto_id);
Commit;
CREATE LOCAL TEMP TABLE SF_Event_stg_Tmp ON COMMIT PRESERVE ROWS AS
(
SELECT DISTINCT * FROM swt_rpt_stg.SF_Event)
SEGMENTED BY HASH(ID,LastModifiedDate) ALL NODES;
TRUNCATE TABLE swt_rpt_stg.SF_Event;
CREATE LOCAL TEMP TABLE SF_Event_base_Tmp ON COMMIT PRESERVE ROWS AS
(
SELECT DISTINCT ID,LastModifiedDate FROM swt_rpt_base.SF_Event)
SEGMENTED BY HASH(ID,LastModifiedDate) ALL NODES;
CREATE LOCAL TEMP TABLE SF_Event_stg_Tmp_Key ON COMMIT PRESERVE ROWS AS
(
SELECT id, max(LastModifiedDate) as LastModifiedDate FROM SF_Event_stg_Tmp group by id)
SEGMENTED BY HASH(ID,LastModifiedDate) ALL NODES;
/* Inserting Stage table data into Historical Table */
insert /*+DIRECT*/ into swt_rpt_stg.SF_Event_Hist
(
AccountId
,ActivityDate
,ActivityDateTime
,CreatedById
,CreatedDate
,CurrencyIsoCode
,Description
,DurationInMinutes
,EndDateTime
,EventSubtype
,GroupEventType
,Id
,IsAllDayEvent
,IsArchived
,IsChild
,IsDeleted
,IsGroupEvent
,IsPrivate
,IsRecurrence
,IsReminderSet
,LastModifiedById
,LastModifiedDate
,Location
,OwnerId
,RecurrenceActivityId
,RecurrenceDayOfMonth
,RecurrenceDayOfWeekMask
,RecurrenceEndDateOnly
,RecurrenceInstance
,RecurrenceInterval
,RecurrenceMonthOfYear
,RecurrenceStartDateTime
,RecurrenceTimeZoneSidKey
,RecurrenceType
,ReminderDateTime
,ringdna__Abandoned_Call__c
,ringdna__Automated_Voicemail_Used__c
,ringdna__Automated_Voicemail__c
,ringdna__Called_Back__c
,ringdna__Call_Connected__c
,ringdna__Call_Direction__c
,ringdna__Call_Disposition__c
,ringdna__Call_Duration_min__c
,ringdna__Call_Duration__c
,ringdna__Call_Hour_Of_Day_Local__c
,ringdna__Call_Rating__c
,ringdna__Call_Recording_URL__c
,ringdna__Call_Recording__c
,ringdna__Created_by_RingDNA__c
,ringdna__Local_Presence_Num__c
,ringdna__Local_Presence__c
,ringdna__Queue_Hold_Time__c
,ringdna__Queue__c
,ringdna__Supervisor_Notes__c
,ringdna__Voicemail__c
,ShowAs
,StartDateTime
,Subject
,SWT_Abandoned_Call__c
,SWT_Automated_Voicemail_Used__c
,SWT_Automated_Voicemail__c
,SWT_Called_Back__c
,SWT_Call_Direction__c
,SWT_Call_Disposition__c
,SWT_Call_Duration__c
,SWT_Call_Hour_of_Day_Local__c
,SWT_Call_Rating__c
,SWT_Call_Recording_URL__c
,SWT_Call_Result__c
,SWT_Call_Type__c
,SWT_Created_by_Ring_DNA__c
,SWT_Date_Initiated__c
,SWT_Local_Presence_Number__c
,SWT_Local_Presence__c
,SWT_Origin__c
,SWT_Pre_sales_Subtype__c
,SWT_Queue_Hold_Time__c
,SWT_Queue__c
,SWT_Reason_Closed__c
,SWT_Voicemail__c
,SystemModstamp
,WhatCount
,WhatId
,WhoCount
,WhoId
,SWT_Approval_Type__c
,SWT_Completion_Date__c
,SWT_Referral_partner__c
,SWT_Sourced_Partner__c
,LD_DT
,SWT_INS_DT
,d_source
)
select
AccountId
,ActivityDate
,ActivityDateTime
,CreatedById
,CreatedDate
,CurrencyIsoCode
,Description
,DurationInMinutes
,EndDateTime
,EventSubtype
,GroupEventType
,Id
,IsAllDayEvent
,IsArchived
,IsChild
,IsDeleted
,IsGroupEvent
,IsPrivate
,IsRecurrence
,IsReminderSet
,LastModifiedById
,LastModifiedDate
,Location
,OwnerId
,RecurrenceActivityId
,RecurrenceDayOfMonth
,RecurrenceDayOfWeekMask
,RecurrenceEndDateOnly
,RecurrenceInstance
,RecurrenceInterval
,RecurrenceMonthOfYear
,RecurrenceStartDateTime
,RecurrenceTimeZoneSidKey
,RecurrenceType
,ReminderDateTime
,ringdna__Abandoned_Call__c
,ringdna__Automated_Voicemail_Used__c
,ringdna__Automated_Voicemail__c
,ringdna__Called_Back__c
,ringdna__Call_Connected__c
,ringdna__Call_Direction__c
,ringdna__Call_Disposition__c
,ringdna__Call_Duration_min__c
,ringdna__Call_Duration__c
,ringdna__Call_Hour_Of_Day_Local__c
,ringdna__Call_Rating__c
,ringdna__Call_Recording_URL__c
,ringdna__Call_Recording__c
,ringdna__Created_by_RingDNA__c
,ringdna__Local_Presence_Num__c
,ringdna__Local_Presence__c
,ringdna__Queue_Hold_Time__c
,ringdna__Queue__c
,ringdna__Supervisor_Notes__c
,ringdna__Voicemail__c
,ShowAs
,StartDateTime
,Subject
,SWT_Abandoned_Call__c
,SWT_Automated_Voicemail_Used__c
,SWT_Automated_Voicemail__c
,SWT_Called_Back__c
,SWT_Call_Direction__c
,SWT_Call_Disposition__c
,SWT_Call_Duration__c
,SWT_Call_Hour_of_Day_Local__c
,SWT_Call_Rating__c
,SWT_Call_Recording_URL__c
,SWT_Call_Result__c
,SWT_Call_Type__c
,SWT_Created_by_Ring_DNA__c
,SWT_Date_Initiated__c
,SWT_Local_Presence_Number__c
,SWT_Local_Presence__c
,SWT_Origin__c
,SWT_Pre_sales_Subtype__c
,SWT_Queue_Hold_Time__c
,SWT_Queue__c
,SWT_Reason_Closed__c
,SWT_Voicemail__c
,SystemModstamp
,WhatCount
,WhatId
,WhoCount
,WhoId
,SWT_Approval_Type__c
,SWT_Completion_Date__c
,SWT_Referral_partner__c
,SWT_Sourced_Partner__c
,SYSDATE AS LD_DT
,SWT_INS_DT
,'base'
FROM "swt_rpt_base".SF_Event WHERE id in
(SELECT STG.id FROM SF_Event_stg_Tmp_Key STG JOIN SF_Event_base_Tmp
ON STG.id = SF_Event_base_Tmp.id AND STG.LastModifiedDate >= SF_Event_base_Tmp.LastModifiedDate);
/* Deleting before seven days data from current date in the Historical Table */
/*delete /*+DIRECT*/ from "swt_rpt_stg"."SF_Event_HIST" where LD_DT::date <= TIMESTAMPADD(DAY,-7,sysdate)::date;*/
/* Incremental VSQL script for loading data from Stage to Base */
DELETE /*+DIRECT*/ FROM "swt_rpt_base".SF_Event WHERE id in
(SELECT STG.id FROM SF_Event_stg_Tmp_Key STG JOIN SF_Event_base_Tmp
ON STG.id = SF_Event_base_Tmp.id AND STG.LastModifiedDate >= SF_Event_base_Tmp.LastModifiedDate);
INSERT /*+DIRECT*/ INTO "swt_rpt_base".SF_Event
(
AccountId
,ActivityDate
,ActivityDateTime
,CreatedById
,CreatedDate
,CurrencyIsoCode
,Description
,DurationInMinutes
,EndDateTime
,EventSubtype
,GroupEventType
,Id
,IsAllDayEvent
,IsArchived
,IsChild
,IsDeleted
,IsGroupEvent
,IsPrivate
,IsRecurrence
,IsReminderSet
,LastModifiedById
,LastModifiedDate
,Location
,OwnerId
,RecurrenceActivityId
,RecurrenceDayOfMonth
,RecurrenceDayOfWeekMask
,RecurrenceEndDateOnly
,RecurrenceInstance
,RecurrenceInterval
,RecurrenceMonthOfYear
,RecurrenceStartDateTime
,RecurrenceTimeZoneSidKey
,RecurrenceType
,ReminderDateTime
,ringdna__Abandoned_Call__c
,ringdna__Automated_Voicemail_Used__c
,ringdna__Automated_Voicemail__c
,ringdna__Called_Back__c
,ringdna__Call_Connected__c
,ringdna__Call_Direction__c
,ringdna__Call_Disposition__c
,ringdna__Call_Duration_min__c
,ringdna__Call_Duration__c
,ringdna__Call_Hour_Of_Day_Local__c
,ringdna__Call_Rating__c
,ringdna__Call_Recording_URL__c
,ringdna__Call_Recording__c
,ringdna__Created_by_RingDNA__c
,ringdna__Local_Presence_Num__c
,ringdna__Local_Presence__c
,ringdna__Queue_Hold_Time__c
,ringdna__Queue__c
,ringdna__Supervisor_Notes__c
,ringdna__Voicemail__c
,ShowAs
,StartDateTime
,Subject
,SWT_Abandoned_Call__c
,SWT_Automated_Voicemail_Used__c
,SWT_Automated_Voicemail__c
,SWT_Called_Back__c
,SWT_Call_Direction__c
,SWT_Call_Disposition__c
,SWT_Call_Duration__c
,SWT_Call_Hour_of_Day_Local__c
,SWT_Call_Rating__c
,SWT_Call_Recording_URL__c
,SWT_Call_Result__c
,SWT_Call_Type__c
,SWT_Created_by_Ring_DNA__c
,SWT_Date_Initiated__c
,SWT_Local_Presence_Number__c
,SWT_Local_Presence__c
,SWT_Origin__c
,SWT_Pre_sales_Subtype__c
,SWT_Queue_Hold_Time__c
,SWT_Queue__c
,SWT_Reason_Closed__c
,SWT_Voicemail__c
,SystemModstamp
,WhatCount
,WhatId
,WhoCount
,WhoId
,SWT_Approval_Type__c
,SWT_Completion_Date__c
,SWT_Referral_partner__c
,SWT_Sourced_Partner__c
,SWT_INS_DT
)
SELECT DISTINCT
AccountId
,ActivityDate
,ActivityDateTime
,CreatedById
,CreatedDate
,CurrencyIsoCode
,Description
,DurationInMinutes
,EndDateTime
,EventSubtype
,GroupEventType
,SF_Event_stg_Tmp.Id
,IsAllDayEvent
,IsArchived
,IsChild
,IsDeleted
,IsGroupEvent
,IsPrivate
,IsRecurrence
,IsReminderSet
,LastModifiedById
,SF_Event_stg_Tmp.LastModifiedDate
,Location
,OwnerId
,RecurrenceActivityId
,RecurrenceDayOfMonth
,RecurrenceDayOfWeekMask
,RecurrenceEndDateOnly
,RecurrenceInstance
,RecurrenceInterval
,RecurrenceMonthOfYear
,RecurrenceStartDateTime
,RecurrenceTimeZoneSidKey
,RecurrenceType
,ReminderDateTime
,ringdna__Abandoned_Call__c
,ringdna__Automated_Voicemail_Used__c
,ringdna__Automated_Voicemail__c
,ringdna__Called_Back__c
,ringdna__Call_Connected__c
,ringdna__Call_Direction__c
,ringdna__Call_Disposition__c
,ringdna__Call_Duration_min__c
,ringdna__Call_Duration__c
,ringdna__Call_Hour_Of_Day_Local__c
,ringdna__Call_Rating__c
,ringdna__Call_Recording_URL__c
,ringdna__Call_Recording__c
,ringdna__Created_by_RingDNA__c
,ringdna__Local_Presence_Num__c
,ringdna__Local_Presence__c
,ringdna__Queue_Hold_Time__c
,ringdna__Queue__c
,ringdna__Supervisor_Notes__c
,ringdna__Voicemail__c
,ShowAs
,StartDateTime
,Subject
,SWT_Abandoned_Call__c
,SWT_Automated_Voicemail_Used__c
,SWT_Automated_Voicemail__c
,SWT_Called_Back__c
,SWT_Call_Direction__c
,SWT_Call_Disposition__c
,SWT_Call_Duration__c
,SWT_Call_Hour_of_Day_Local__c
,SWT_Call_Rating__c
,SWT_Call_Recording_URL__c
,SWT_Call_Result__c
,SWT_Call_Type__c
,SWT_Created_by_Ring_DNA__c
,SWT_Date_Initiated__c
,SWT_Local_Presence_Number__c
,SWT_Local_Presence__c
,SWT_Origin__c
,SWT_Pre_sales_Subtype__c
,SWT_Queue_Hold_Time__c
,SWT_Queue__c
,SWT_Reason_Closed__c
,SWT_Voicemail__c
,SystemModstamp
,WhatCount
,WhatId
,WhoCount
,WhoId
,SWT_Approval_Type__c
,SWT_Completion_Date__c
,SWT_Referral_partner__c
,SWT_Sourced_Partner__c
,SYSDATE AS SWT_INS_DT
FROM SF_Event_stg_Tmp JOIN SF_Event_stg_Tmp_Key ON SF_Event_stg_Tmp.id= SF_Event_stg_Tmp_Key.id AND SF_Event_stg_Tmp.LastModifiedDate=SF_Event_stg_Tmp_Key.LastModifiedDate
WHERE NOT EXISTS
(SELECT 1 from "swt_rpt_base".SF_Event BASE
WHERE SF_Event_stg_Tmp.id = BASE.id);
/* Inserting new audit entry with all stats */
INSERT INTO swt_rpt_stg.FAST_LD_AUDT
(
SUBJECT_AREA
,TBL_NM
,LD_DT
,START_DT_TIME
,END_DT_TIME
,SRC_REC_CNT
,TGT_REC_CNT
,COMPLTN_STAT
)
select 'SFDC','SF_Event',sysdate::date,(select st from Start_Time_Tmp),sysdate,(select count from Start_Time_Tmp) ,(select count(*) from swt_rpt_base.SF_Event where SWT_INS_DT::date = sysdate::date),'Y';
Commit;
/* Deleting partial audit entry */
/*
DELETE FROM swt_rpt_stg.FAST_LD_AUDT where SUBJECT_AREA = 'SFDC' and
TBL_NM = 'SF_Event' and
COMPLTN_STAT = 'N' and
LD_DT=sysdate::date and
SEQ_ID = (select max(SEQ_ID) from swt_rpt_stg.FAST_LD_AUDT where SUBJECT_AREA = 'SFDC' and TBL_NM = 'SF_Event' and COMPLTN_STAT = 'N');
commit;
*/
SELECT DROP_PARTITION('swt_rpt_stg.SF_Event_Hist', TIMESTAMPADD(day,-7,getdate())::date);
/*select do_tm_task('mergeout','swt_rpt_stg.SF_Event_Hist');*/
select do_tm_task('mergeout','swt_rpt_base.SF_Event');
select do_tm_task('mergeout','swt_rpt_stg.FAST_LD_AUDT');
select ANALYZE_STATISTICS('swt_rpt_base.SF_Event');
| true
|
a5cf8bf4446fc7bc442fdc2ea8db181b914f64ce
|
SQL
|
2Nifty/PFC
|
/_My Workorders/_Closed/WO 1913 - Duplicate ItemBranchUsage records/IBU duplicates.sql
|
UTF-8
| 5,128
| 3.59375
| 4
|
[] |
no_license
|
select count(*) from ItemBranchUsage --2025728
--select * from ItemBranchUsage
--606 records
select IBU.* from ItemBranchUsage IBU inner join
(
select * from
(select Count(*) as reccount, Location, ItemNo, CurPeriodNo from ItemBranchUsage ---2025375
group by Location, ItemNo, CurPeriodNo) tmp
where reccount > 1
) dups
on IBU.Location = dups.Location and IBU.ItemNo = dups.ItemNo and IBU.CurPeriodNo = dups.CurPeriodNo
order by IBU.Location, IBU.ItemNo, IBU.CurPeriodNo
--27 duplicates
select * from ItemBranchUsage
where Location='10' and ItemNo='00200-2400-021' and CurPeriodNo='200902'
--572
--these are the ones that are 100% identical
select IBU.* from ItemBranchUsage IBU inner join
(
select * from
(select Count(*) as reccount,
Location,
ItemNo,
CurPeriodNo
from ItemBranchUsage
group by
Location,ItemNo,
CurPeriodNo,CurBegOnHandQty,CurBegOnHandDol,CurBegOnHandWght,
CurNoofReceipts,CurReceivedQty,CurReceivedDol,CurReceivedWght,
CurNoofReturns,CurReturnQty,CurReturnDol,CurReturnWght,
CurNoofBackOrders,CurBackOrderQty,CurBackOrderDol,CurBackOrderWght,
CurNoofSales,CurSalesQty,CurSalesDol,CurSalesWght,CurCostDol,
CurNoofTransfers,CurTransferQty,CurTransferDol,CurTransferWght,
CurNoofIssues,CurIssuesQty,CurIssuesDol,CurIssuesWght,
CurNoofAdjust,CurAdjustQty,CurAdjustDol,CurAdjustWght,
CurNoofChanges,CurChangeQty,CurChangeDol,CurChangeWght,
CurNoofPO,CurPOQty,CurPODol,CurPOWght,
CurNoofGER,CurGERQty,CurGERDol,CurGERWght,
CurNoOfWorkOrders,CurWorkOrderQty,CurWorkOrderDol,CurWorkOrderWght,
CurLostSlsQty,CurDailySlsQty,CurDailyRetQty,
CurEndOHQty,CurEndOHDol,CurEndOHWght,CurNoOfOrders,
CurNRSalesQty,CurNRNoSales,CurNRSalesDol,CurNRSalesWght,CurNRCostDol) tmp
where reccount > 1
) dups
on IBU.Location = dups.Location and IBU.ItemNo = dups.ItemNo and IBU.CurPeriodNo = dups.CurPeriodNo
order by IBU.Location, IBU.ItemNo, IBU.CurPeriodNo
--------------------------------------------------------------------------------------------------
SELECT DISTINCT
Location,ItemNo,
CurPeriodNo,CurBegOnHandQty,CurBegOnHandDol,CurBegOnHandWght,
CurNoofReceipts,CurReceivedQty,CurReceivedDol,CurReceivedWght,
CurNoofReturns,CurReturnQty,CurReturnDol,CurReturnWght,
CurNoofBackOrders,CurBackOrderQty,CurBackOrderDol,CurBackOrderWght,
CurNoofSales,CurSalesQty,CurSalesDol,CurSalesWght,CurCostDol,
CurNoofTransfers,CurTransferQty,CurTransferDol,CurTransferWght,
CurNoofIssues,CurIssuesQty,CurIssuesDol,CurIssuesWght,
CurNoofAdjust,CurAdjustQty,CurAdjustDol,CurAdjustWght,
CurNoofChanges,CurChangeQty,CurChangeDol,CurChangeWght,
CurNoofPO,CurPOQty,CurPODol,CurPOWght,
CurNoofGER,CurGERQty,CurGERDol,CurGERWght,
CurNoOfWorkOrders,CurWorkOrderQty,CurWorkOrderDol,CurWorkOrderWght,
CurLostSlsQty,CurDailySlsQty,CurDailyRetQty,
CurEndOHQty,CurEndOHDol,CurEndOHWght,CurNoOfOrders,
CurNRSalesQty,CurNRNoSales,CurNRSalesDol,CurNRSalesWght,CurNRCostDol
FROM ItemBranchUsage (NoLock)
--------------------------------------------------------------------------------------------------
select IBU.* from tempItemBranchUsage IBU inner join
(
select * from
(select Count(*) as reccount, Location, ItemNo, CurPeriodNo from tempItemBranchUsage
group by Location, ItemNo, CurPeriodNo) tmp
where reccount > 1
) dups
on IBU.Location = dups.Location and IBU.ItemNo = dups.ItemNo and IBU.CurPeriodNo = dups.CurPeriodNo
order by IBU.Location, IBU.ItemNo, IBU.CurPeriodNo
SELECT DISTINCT
Location,ItemNo,CurPeriodNo,
--CurBegOnHandQty,CurBegOnHandDol,CurBegOnHandWght,
CurNoofReceipts,CurReceivedQty,CurReceivedDol,CurReceivedWght,
CurNoofReturns,CurReturnQty,CurReturnDol,CurReturnWght,
CurNoofBackOrders,CurBackOrderQty,CurBackOrderDol,CurBackOrderWght,
CurNoofSales,CurSalesQty,CurSalesDol,CurSalesWght,CurCostDol,
CurNoofTransfers,CurTransferQty,CurTransferDol,CurTransferWght,
CurNoofIssues,CurIssuesQty,CurIssuesDol,CurIssuesWght,
CurNoofAdjust,CurAdjustQty,CurAdjustDol,CurAdjustWght,
CurNoofChanges,CurChangeQty,CurChangeDol,CurChangeWght,
CurNoofPO,CurPOQty,CurPODol,CurPOWght,
CurNoofGER,CurGERQty,CurGERDol,CurGERWght,
CurNoOfWorkOrders,CurWorkOrderQty,CurWorkOrderDol,CurWorkOrderWght,
CurLostSlsQty,CurDailySlsQty,CurDailyRetQty,
--CurEndOHQty,CurEndOHDol,CurEndOHWght,
CurNoOfOrders,CurNRSalesQty,
EntryID, CAST (FLOOR (CAST (EntryDt AS FLOAT)) AS DATETIME) as EntryDt,
'FixDups' AS ChangeID, CAST (FLOOR (CAST (GETDATE() AS FLOAT)) AS DATETIME) AS ChangeDt,
CurNRNoSales,CurNRSalesDol,CurNRSalesWght,CurNRCostDol
FROM ItemBranchUsage (NoLock)
UPDATE tempItemBranchUsage
SET CurBegOnHandQty = IBU.CurBegOnHandQty,
CurBegOnHandDol = IBU.CurBegOnHandDol,
CurBegOnHandWght = IBU.CurBegOnHandWght,
CurEndOHQty = IBU.CurEndOHQty,
CurEndOHDol = IBU.CurEndOHDol,
CurEndOHWght = IBU.CurEndOHWght,
ChangeID = 'FixDups',
ChangeDt = CAST (FLOOR (CAST (GETDATE() AS FLOAT)) AS DATETIME)
FROM ItemBranchUsage IBU
WHERE tempItemBranchUsage.Location = IBU.Location AND
tempItemBranchUsage.ItemNo = IBU.ItemNo AND
tempItemBranchUsage.CurPeriodNo = IBU.CurPeriodNo
select * from tempItemBranchUsage
select CAST (FLOOR (CAST (GETDATE() AS FLOAT)) AS DATETIME) from ItemBranchUsage
| true
|
d2645454c89a7a58fc9b04eee0a9d629cf64f47e
|
SQL
|
anykarolyne/crud-nodejs-mysql
|
/user.sql
|
UTF-8
| 1,330
| 2.75
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Inang: localhost
-- Waktu pembuatan: 02 Mei 2014 pada 12.05
-- Versi Server: 5.5.34
-- Versi PHP: 5.4.22
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: `nodejs`
--
-- --------------------------------------------------------
--
-- Stable structure `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`address` text NOT NULL,
`email` varchar(200) NOT NULL,
`phone` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
--
-- Dumping data for table`user`
--
INSERT INTO `user` (`id`, `name`, `address`, `email`, `phone`) VALUES
(2, 'Any', 'Itjubá', 'anykarolyne@gmail.com', '984127067'),
(3, 'Bruno', 'Cambuí', 'bruno@gmail.com', '0000000'),
(4, 'Clayton ', 'Bueno Brandão', 'clayton@gmail.com', '0000000');
/*!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
|
21b7aa105ea6a1b1cf4afa89d89f6f3b443deecf
|
SQL
|
maataka/CappacitaDEV_Desafio_Final
|
/postagem_postagens.sql
|
UTF-8
| 2,724
| 3
| 3
|
[] |
no_license
|
-- MySQL dump 10.13 Distrib 8.0.26, for Win64 (x86_64)
--
-- Host: localhost Database: postagem
-- ------------------------------------------------------
-- Server version 8.0.26
/*!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 `postagens`
--
DROP TABLE IF EXISTS `postagens`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `postagens` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(60) DEFAULT 'Anônimo',
`comentario` varchar(250) NOT NULL,
`criado_em` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `postagens`
--
LOCK TABLES `postagens` WRITE;
/*!40000 ALTER TABLE `postagens` DISABLE KEYS */;
INSERT INTO `postagens` VALUES (1,'maataka@gmail.com','até que enfim ','2021-09-19 18:33:58'),(2,'teste@teste.com.br','tesde de comentarios','2021-09-19 18:54:46'),(3,'atakamarcos@gmail.com','Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum .','2021-09-19 19:08:30'),(4,'','','2021-09-19 19:08:39'),(5,'zeSilva@gmail.com','Tempo está cabando.','2021-09-19 21:46:56'),(6,'zeSilva@gmail.com','Tempo está cabando.','2021-09-19 21:47:31'),(7,'zeSilva@gmail.com','Eu aqui, de novo.','2021-09-19 21:51:45'),(8,'teste@teste.com.br','novo comment.','2021-09-19 22:38:08'),(9,'maataka@gmail.com','olha só o horário!','2021-09-19 22:44:31'),(10,'zeSilva@gmail.com','mais um post.','2021-09-19 22:59:05'),(11,'zeSilva@gmail.com','acabando o prazo','2021-09-19 23:14:50');
/*!40000 ALTER TABLE `postagens` 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 2021-09-20 0:01:10
| true
|
46de0d3e990afc065aa7e44a9568de4b0feef648
|
SQL
|
nickprys/QALight-SQL-Home-work
|
/6-HW.sql
|
UTF-8
| 7,802
| 4.375
| 4
|
[] |
no_license
|
-- 1. Напишите запрос с EXISTS, позволяющий вывести данные обо всех студентах,
-- обучающихся в вузах с рейтингом не попадающим в диапазон от 488 до 571
select * from STUDENTS s
where exists (
select rating from UNIVERSITIES u
where rating not between 488 and 571 and u.id = s.UNIV_ID)
-- 2. Напишите запрос с EXISTS, выбирающий всех студентов, для которых в том же городе,
-- где живет и учится студент, существуют другие университеты, в которых он не учится.
--select * from students
--where exists
select * from students s where exists
(select city from students s
where city in ( select city from UNIVERSITIES u where id=s.UNIV_ID)) and
city in (select city from UNIVERSITIES
group by city
having count(*)>1)
-- 3. Напишите запрос, выбирающий из таблицы SUBJECTS данные о названиях предметов обучения,
-- экзамены по которым были хоть как-то сданы более чем 12 студентами, за первые 10 дней сессии.
-- Используйте EXISTS. Примечание: по возможности выходная выборка должна быть без пересдач.
select name from SUBJECTS sb
where exists (select count(subj_id) from EXAM_MARKS em where sb.id=em.SUBJ_ID
and em.EXAM_DATE between min(EXam_date) and min(exam_date)+9
group by SUBJ_ID
having count(*)>11 )
--
select name from SUBJECTS sb where exists (
select subj_id
from exam_marks em
where EXAM_DATE <=(select min (exam_date)+9 from EXAM_MARKS) and em.subj_id = sb.id
group by subj_id
having count(distinct student_id)>12)
-- 4. Напишите запрос EXISTS, выбирающий фамилии всех лекторов, преподающих в университетах
-- с рейтингом, превосходящим рейтинг каждого харьковского универа.
select surname from LECTURERS l
where exists (select * from UNIVERSITIES u where u.id=l.univ_id and rating >
(select max(rating) from UNIVERSITIES
where city = 'Харьков'))
-- 5. Напишите 2 запроса, использующий ANY и ALL, выполняющий выборку данных о студентах,
-- у которых в городе их постоянного местожительства нет университета.
select surname from students s
where s.city <> all (select u.city from UNIVERSITIES u)
select * from students s
where not s.city = any(select u.city from UNIVERSITIES u)
-- 6. Напишите запрос выдающий имена и фамилии студентов, которые получили
-- максимальные оценки в первый и последний день сессии.
-- Подсказка: выборка должна содержать по крайне мере 2х студентов.
select name, surname from students s
where id in
(select STUDENT_ID from EXAM_MARKS
where EXAM_DATE = (select max(exam_date) from EXAM_MARKS) and
mark = (select max(mark) from EXAM_MARKS
where EXAM_DATE = (select max(exam_date)from EXAM_MARKS))
union
select STUDENT_ID from EXAM_MARKS
where EXAM_DATE = (select min(exam_date) from EXAM_MARKS) and
mark = (select max(mark) from EXAM_MARKS
where EXAM_DATE = (select min(exam_date)from EXAM_MARKS)))
-- 7. Напишите запрос EXISTS, выводящий кол-во студентов каждого курса, которые успешно
-- сдали экзамены, и при этом не получивших ни одной двойки.
select count(*) from STUDENTS s
--
where exists (select * from EXAM_MARKS em where em.STUDENT_ID = s.id and mark in(3,4,5))
and not exists
(select * from EXAM_MARKS em where em.STUDENT_ID = s.id and mark in(2))
group by course
-- 8. Напишите запрос EXISTS на выдачу названий предметов обучения,
-- по которым было получено максимальное кол-во оценок.
select name from SUBJECTS s
where exists (
select count(MARK) cnt
from EXAM_MARKS em
group by SUBJ_ID
having count(MARK) = (select max(cnt) from (select count(MARK) cnt
from EXAM_MARKS em
group by SUBJ_ID) as A) and s.id=em.subj_id )
-- 9. Напишите команду, которая выдает список фамилий студентов по алфавиту,
-- с колонкой комментарием: 'успевает' у студентов , имеющих все положительные оценки,
-- 'не успевает' для сдававших экзамены, но имеющих хотя бы одну
-- неудовлетворительную оценку, и комментарием 'не сдавал' – для всех остальных.
-- Примечание: по возможности воспользуйтесь операторами ALL и ANY.
select surname,'успевает' from students s
where exists (select * from EXAM_MARKS em where s.id = em.student_id and mark >= 3) and
not exists (select * from EXAM_MARKS em where s.id = em.student_id and mark = 2)
union
select surname,'не успевает' from students s
where exists (select * from EXAM_MARKS em where s.id = em.student_id and MARK in (2))
union
select surname,'не сдавал' from students s
where not exists (select * from EXAM_MARKS em where s.id = em.student_id )
order by SURNAME
-- union или union all Березовский все равно попадвет дважды :(
-- 10. Создайте объединение двух запросов, которые выдают значения полей
-- NAME, CITY, RATING для всех университетов. Те из них, у которых рейтинг
-- равен или выше 500, должны иметь комментарий 'Высокий', все остальные – 'Низкий'.
select name, city,rating ,'высокий'rating from UNIVERSITIES u
where rating >=500
union all
select name, city,rating ,'низкий' from UNIVERSITIES u
where rating <500
-- 11. Напишите UNION запрос на выдачу списка фамилий студентов 4-5 курсов в виде 3х полей выборки:
-- SURNAME, 'студент <значение поля COURSE> курса', STIPEND
-- включив в список преподавателей в виде
-- SURNAME, 'преподаватель из <значение поля CITY>', <значение зарплаты в зависимости от города проживания (придумать самим)>
-- отсортировать по фамилии
-- Примечание: достаточно учесть 4-5 городов.
select s.surname, 'студент'role ,cast(course as varchar)+' курса', stipend from students s
where course in (4,5)
union all
select l.surname, 'преподаватель из', city , case when city ='Киев' then 10000
when city ='Луганск' then 5000
when city ='Львов' then 8000
when city ='Луцк' then 6000 end
from lecturers l
order by surname
| true
|
67a2e9d6ac26591147603b2cc9c63b89064887b8
|
SQL
|
roerjo/custom-php-framework-todo-app
|
/migrations/sqlite/create_tasks_table_20190924072400.sql
|
UTF-8
| 300
| 2.578125
| 3
|
[] |
no_license
|
CREATE TABLE IF NOT EXISTS `tasks` (
`id` INTEGER PRIMARY KEY,
`title` TEXT NOT NULL,
`description` TEXT NOT NULL,
`completed` INTEGER NOT NULL DEFAULT 0,
`created_at` TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
`completed_at` TEXT
);
| true
|
da23cb6772511939603e25ba09d432565bf5620e
|
SQL
|
dalida/Sites
|
/wipsea/protected/data/wipsea.sql
|
UTF-8
| 4,069
| 4
| 4
|
[] |
no_license
|
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema wipsea
-- -----------------------------------------------------
DROP SCHEMA IF EXISTS `wipsea` ;
CREATE SCHEMA IF NOT EXISTS `wipsea` ;
-- -----------------------------------------------------
-- Schema testdrive
-- -----------------------------------------------------
USE `wipsea` ;
-- -----------------------------------------------------
-- Table `wipsea`.`person`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `wipsea`.`person` ;
CREATE TABLE IF NOT EXISTS `wipsea`.`person` (
`id` SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(45) NOT NULL,
`last_name` VARCHAR(45) NOT NULL,
`email` VARCHAR(128) NOT NULL,
`username` VARCHAR(128) NOT NULL DEFAULT TRUE,
`password` VARCHAR(128) NOT NULL,
`organisation` VARCHAR(128) NULL,
`create_date` DATETIME NOT NULL,
`last_update` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COMMENT = 'Table storing all persons.' /* comment truncated */ /*
Basic information about a person like first and last name are stored in the table itself. Same for the date the record was created and when the information was last updated.*/;
CREATE INDEX `idx_last_name` ON `wipsea`.`person` (`last_name` ASC);
CREATE INDEX `idx_email` ON `wipsea`.`person` (`email` ASC);
CREATE INDEX `idx_username` ON `wipsea`.`person` (`username` ASC);
-- -----------------------------------------------------
-- Table `wipsea`.`image`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `wipsea`.`image` ;
CREATE TABLE IF NOT EXISTS `wipsea`.`image` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(60) NOT NULL,
`longitude` VARCHAR(50) NULL,
`latitude` VARCHAR(50) NULL,
`altitude` VARCHAR(50) NULL,
`img_path` VARCHAR(255) NULL COMMENT 'Filesystem path to image.',
`type` VARCHAR(128) NOT NULL COMMENT 'Image is of either type :' /* comment truncated */ /*0 - background scene
1 - wildlife object*/,
`processed` TINYINT(1) NULL DEFAULT 0 COMMENT 'For images of type background scene, indicates whether image has been processed for wildlife object detection.',
`valid` TINYINT(1) NULL DEFAULT 0 COMMENT 'For images of type wildlife object, indicates whether or not it is valid.',
`created_by` VARCHAR(128) NOT NULL COMMENT 'Person who uploaded image.',
`created` DATETIME NOT NULL,
`last_update` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COMMENT = 'Images can be either type background, or wildlife.';
-- -----------------------------------------------------
-- Table `wipsea`.`image_queue`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `wipsea`.`image_queue` ;
CREATE TABLE IF NOT EXISTS `wipsea`.`image_queue` (
`id` INT NOT NULL,
`image_id` INT UNSIGNED NOT NULL,
`status` INT NOT NULL DEFAULT 0 COMMENT 'Status of item:' /* comment truncated */ /*0 - waiting to be processed
1 - processing
2 - processed*/,
PRIMARY KEY (`id`),
CONSTRAINT `fk_queue_image`
FOREIGN KEY (`image_id`)
REFERENCES `wipsea`.`image` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
COMMENT = 'Queue to process images.';
-- -----------------------------------------------------
-- Table `wipsea`.`image_type`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `wipsea`.`image_type` ;
CREATE TABLE IF NOT EXISTS `wipsea`.`image_type` (
`type` VARCHAR(128) NOT NULL COMMENT 'image types :' /* comment truncated */ /*- background
- wildlife
*/,
PRIMARY KEY (`type`))
ENGINE = InnoDB
COMMENT = 'Queue to process images.';
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
| true
|
52e7eb5df7013884d69222c0559a479e37287b2e
|
SQL
|
PrasananTrainer03/MphasisData
|
/sql1/MySql_Exam_Prep_3.sql
|
UTF-8
| 436
| 2.984375
| 3
|
[] |
no_license
|
select * from bank.accounts;
select * into accounts from bank.accounts;
use hexanew;
create table accounts as select * from bank.accounts;
select * from accounts;
select A.AccountNo,FirstName,LastName,City,TransAmount,TransDate
from accounts A INNER JOIN Bank.Trans T
ON A.AccountNo=T.AccountNo;
select A.AccountNo,FirstName,LastName,City,TransAmount,TransDate
from accounts A LEFT JOIN Bank.Trans T
ON A.AccountNo=T.AccountNo;
| true
|
e926786a42fb12d2cc44822ef02613576d112776
|
SQL
|
jdguevara/CS-HU310
|
/project/FinalSubmission/Final_Project.sql
|
UTF-8
| 10,192
| 4.46875
| 4
|
[] |
no_license
|
create database cs310project;
use cs310project;
-- 1. Create a table for Concession Items
create table Item (
ID int auto_increment,
ItemCode varchar(5) unique,
ItemDescription varchar(50) not null,
Price decimal(4,2) default 0,
primary key (ID));
-- couldn't create the table without defining the auto_increment as a key (according to MySQL)
-- Tests for Item table --
Insert into Item (ItemCode,ItemDescription, Price) Values ('A','aa',5),('A','aaaa',4); -- worked error was due to duplication (i.e. uniqueness was checked)
Insert into Item (ItemCode,ItemDescription, Price) Values ('B','aa',5),('B','aaaa',4); -- checking to make sure previous wasn't due to just being 'A'
Insert into Item (ItemCode, Price) Values ('B',5); -- ItemDescription checked for value, no default given not null constraint
Insert into Item (ItemCode, Price) Values ('J',5); -- same test as above, to make sure it wasn't the first value
Insert into Item (ItemCode, Price) Values ('J',6); -- this one makes sure it wasn't because of the second value
-- Insert into Item(ItemCode, ItemDescription, Price) Values ('Drink','Large Soda') ; -- This is not flying with MySQL as there's no Price value being given
Insert into Item(ItemCode, ItemDescription) Values ('Drink','Large Soda') ; -- This one should allow for us to insert the values and have Price use its default
Select Id, Price from Item Where ItemCode = 'Drink';
Update Item Set Price =4.50 Where ItemCode='Drink'; -- updates the price of our "Drink" to 4.50
-- 2. Storage for purchases
drop table Purchase;
create table Purchase (
ID int auto_increment
, ItemID int
, Quantity int not null
, PurchaseDate datetime not null
, primary key (ID)
, foreign key (ItemID) references Item(ID));
-- Tests for Purchase table --
Insert into Purchase (ItemID,Quantity, PurchaseDate) Values (-8, 1, Now()); -- tests the foreign key constraint of ItemID
Insert into Purchase (ItemID,Quantity, PurchaseDate) Values (2, 1, Now()); -- testing to make sure it's not because the value was negative
Insert into Purchase (ItemID, PurchaseDate) Values (1, Now()); -- Makes sure that Quantity picked up on the fact it had nothing (i.e. null)
Insert into Purchase (ItemID,Quantity) Values (1, 1); -- Makes sure that it's receiving a PurchaseDate value
-- adding two values into Purchase and checking for them
Insert into Purchase (ItemID,Quantity, PurchaseDate) Values (1, 1, Now());
Insert into Purchase (ItemID,Quantity, PurchaseDate) Values (1, 1, Now());
Select * from Purchase ;
-- 3. Storage for Shipments
create table Shipment (
ID int auto_increment
, ShipmentDate datetime not null
, ItemID int
, Quantity int not null
, primary key (ID)
, foreign key (ItemID) references Item(ID));
-- Tests for Shipments table --
Insert into Shipment(ShipmentDate,ItemID,Quantity) Values (Now(), -9, 3); -- tests the ItemID constraint
Insert into Shipment(ShipmentDate,ItemID,Quantity) Values (Now(), 9, 3); -- makes sure the ItemID constraint works with positive values as well
Insert into Shipment(ItemID,Quantity) Values (1, 3); -- tests that ShipmentDate isn't empty
Insert into Shipment(ShipmentDate,ItemID) Values (Now(), 1); -- tests to make sure Quantity isn't empty
-- tests insertion into Shipment --
Insert into Shipment(ShipmentDate,ItemID,Quantity) Values (Now(),1, 1);
Insert into Shipment(ShipmentDate,ItemID,Quantity) Values (Now(),1,1);
Select * from Shipment;
-- 4. Procedure for creating an item --
delimiter //
create procedure CreateItem (paramCode varchar(5), paramDescription varchar(50), paramPrice decimal(4,2))
begin
insert into Item(ItemCode, ItemDescription, Price)
values (paramCode, paramDescription, paramPrice);
end //
delimiter ;
-- Procedure for creating a shipment --
delimiter //
create procedure CreateShipment (paramShipDate datetime, paramCode varchar(5), paramQuantity int)
begin
set @itemID := (select ID from Item where ItemCode = paramCode);
insert into Shipment(ShipmentDate, ItemID, Quantity)
values (paramShipDate, @itemID, paramQuantity);
end //
delimiter ;
-- Procedure for creating a purchase --
delimiter //
create procedure CreatePurchase (paramCode varchar(5), paramQuantity int, paramPurchaseDate datetime)
begin
insert into Purchase (ItemID, Quantity, PurchaseDate)
values ((select ID from Item where ItemCode = paramCode), paramQuantity, paramPurchaseDate);
end //
delimiter ;
-- Tests for procedure success --
Call CreateItem ('Candy','All Candy Same Price', 4.50);
Call CreateShipment(Now(),'Candy',5);
Call CreatePurchase('Candy', 1,Now());
-- 5. Procedure for getting an item based on code --
delimiter //
create procedure GetItems (paramCode varchar(5))
begin
select * from Item where ItemCode like paramCode;
end //
delimiter ;
-- Procedure for getting shipment records based on date made--
delimiter //
create procedure GetShipments (thisDate date)
begin
select * from Shipment where cast(ShipmentDate as date) = thisDate;
end //
delimiter ;
-- Procedure for getting purchase records based on date made --
delimiter //
create procedure GetPurchases (thisDate date)
begin
select * from Purchase where cast(PurchaseDate as date) = thisDate;
end //
delimiter ;
-- Tests for reading procedure success --
Call GetItems ('%'); -- returns all Items
Call GetItems ('d'); -- returns no Items
Call GetItems ('Drink'); -- returns 1 Item
Call GetItems ('Candy'); -- extra test --
Call GetShipments("2018-02-19");
Call GetPurchases("2018-02-19");
Call GetShipments("2018-02-11"); -- extra test based on my db data --
Call GetPurchases("2018-02-11"); -- extra test based on my db data --
-- 6. Procedure for reporting available quantities for a given item --
delimiter //
create procedure ItemsAvailable (pCode varchar(5))
begin
select ItemCode as 'Code', ItemDescription as 'Description', ifnull(sum(Shipment.Quantity)-sum(Purchase.Quantity), 0) as 'Available Quantity'
from Item
inner join Shipment
on Shipment.ItemID = Item.ID
inner join Purchase
on Purchase.ItemID = Item.ID
where ItemCode like pCode
group by ItemCode, ItemDescription;
end //
delimiter ;
-- Test for reporting procedure --
Call ItemsAvailable('Drink'); -- returns one record , no duplicates exist
call ItemsAvailable('%'); -- returns all quantity records for the available items
call ItemsAvailable('Candy'); -- Extra test
call ItemsAvailable('Ice'); -- Test for items that doesn't exist should not return anything
-- New Test for an item with no shipment/purchase --
insert into Item(ItemCode, ItemDescription, Price) values ('Chips', 'All the Chips', 5.00);
insert into Shipment(ShipmentDate, ItemID, Quantity) values (now(), 3, 0);
Insert into Purchase (ItemID,Quantity, PurchaseDate) Values (3, 0, Now());
call ItemsAvailable('Chips');
-- 7. Update Procedures --
-- Update Shipments --
delimiter //
create procedure UpdateShipment (pShipmentDate date, pItemCode varchar(5), pQuantity int)
begin
update Shipment
set Quantity = pQuantity
where Shipment.ItemID = (select ID from Item where ItemCode = pItemCode) and cast(Shipment.ShipmentDate as date) = pShipmentDate;
end //
delimiter ;
-- Tests for UpdateShipment --
call UpdateShipment ("2018-02-11", 'Drink', 5); -- These first two will change up the values currently existing
call UpdateShipment ("2018-02-19", 'Candy', 1);
call UpdateShipment ("2018-02-11", 'Drink', 1); -- These last two should update them to their original quantities
call UpdateShipment ("2018-02-19", 'Candy', 5);
call UpdateShipment ('Candy', 5); -- Test for the correct number of parameters
-- Update Items --
delimiter //
create procedure UpdateItem (pItemCode varchar(5), pDescription varchar(50), pPrice decimal(4,2))
begin
update Item
set ItemDescription = pDescription, Price = pPrice
where ItemCode = pItemCode;
end //
delimiter ;
-- Tests for UpdateItem --
call UpdateItem('Candy', 'New candy', 5.50);
call UpdateItem('Candy', 'All candy same price', 4.50);
-- Update Purchases --
delimiter //
create procedure UpdatePurchase (pItemCode varchar(5), pQuantity int, pPurchaseDate date)
begin
update Purchase
set Quantity = pQuantity
where Purchase.ItemID = (select ID from Item where ItemCode = pItemCode) and cast(Purchase.PurchaseDate as date) = pPurchaseDate;
end //
delimiter ;
-- Tests for UpdatePurchase --
call UpdatePurchase ('Drink', 5, "2018-02-11"); -- These first two will change up the values currently existing
call UpdatePurchase ('Candy', 5, "2018-02-19");
call UpdatePurchase ('Drink', 1, "2018-02-11"); -- These last two should update them to their original quantities
call UpdatePurchase ('Candy', 1, "2018-02-19");
call UpdatePurchase ('Candy', 5); -- Test for the correct number of parameters
-- 8. Delete Procedures --
-- Deleting a Shipment --
delimiter //
create procedure DeleteShipment (pShipmentDate date, pCode varchar(5))
begin
delete from Shipment
where cast(ShipmentDate as date) = pShipmentDate and ItemID = (select ID from Item where ItemCode = pCode);
end //
delimiter ;
-- Test DeleteShipment --
call DeleteShipment(cast(now() as date), 'Chips');
insert into Shipment(ShipmentDate, ItemID, Quantity) values (now(), 3, 0);
call DeleteShipment(cast(now() as date), 'Chips');
-- Deleting an Item --
delimiter //
create procedure DeleteItem (pCode varchar(5))
begin
delete from Item
where ItemCode = pCode;
end //
delimiter ;
-- Tests for DeleteItem --
call DeleteItem('Chips'); -- Won't be able to do this at the moment as it is tied to Shipment and Purchase through their FKs
-- Deleting a Purchase --
delimiter //
create procedure DeletePurchase (pPurchaseDate date, pCode varchar(5))
begin
delete from Purchase
where cast(PurchaseDate as date) = pPurchaseDate and ItemID = (select ID from Item where ItemCode = pCode);
end //
delimiter ;
-- Test DeletePurchase --
call DeletePurchase(cast(now() as date), 'Chips');
Insert into Purchase (ItemID,Quantity, PurchaseDate) Values (3, 0, Now());
call DeletePurchase(cast(now() as date), 'Chips');
-- Try the previous DeleteItem test again --
call DeleteItem('Chips'); -- Should now work that both the Shipment and Purchase tied to it have been deleted, freing it up from their FKs
| true
|
2c523aa46ead8dd1080dc7ebc3cbec3b5791a75a
|
SQL
|
JordanReiter/django-geonames
|
/gis/mysql/distance.sql
|
UTF-8
| 398
| 3.359375
| 3
|
[
"MIT"
] |
permissive
|
DELIMITER $$
DROP FUNCTION IF EXISTS `distance` $$
CREATE FUNCTION distance(a POINT, b POINT) RETURNS double
DETERMINISTIC
COMMENT 'Spatial distance function using the great-circle distance formula (in km)'
RETURN ( 6378.7
* acos(
sin( radians(X(a)) ) * sin( radians(X(b)) )
+ cos( radians(X(a)) ) * cos( radians(X(b)) )
* cos( radians(Y(b)) - radians(Y(a)) )
)
) $$
DELIMITER ;
| true
|
c690c53b5f7f4fced1104c2d009003f603d5861a
|
SQL
|
msecret/openFEC
|
/data/sql_updates/create_linkage_names_vw.sql
|
UTF-8
| 2,129
| 3.578125
| 4
|
[
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] |
permissive
|
drop materialized view if exists ofec_name_linkage_vw;
create materialized view ofec_name_linkage_vw as
select
l.linkages_sk as linkage_key,
l.cand_sk as candidate_key,
l.cmte_sk as committee_key,
l.cand_id as candidate_id,
(select max(cand_election_yr) from dimlinkages dl where dl.cand_id = l.cand_id) as active_through,
l.cand_election_yr as election_year,
l.cmte_id as committee_id,
l.cmte_tp as committee_type,
case l.cmte_tp
when 'P' then 'Presidential'
when 'H' then 'House'
when 'S' then 'Senate'
when 'C' then 'Communication Cost'
when 'D' then 'Delegate Committee'
when 'E' then 'Electioneering Communication'
when 'I' then 'Independent Expenditor (Person or Group)'
when 'N' then 'PAC - Nonqualified'
when 'O' then 'Independent Expenditure-Only (Super PACs)'
when 'Q' then 'PAC - Qualified'
when 'U' then 'Single Candidate Independent Expenditure'
when 'V' then 'PAC with Non-Contribution Account - Nonqualified'
when 'W' then 'PAC with Non-Contribution Account - Qualified'
when 'X' then 'Party - Nonqualified'
when 'Y' then 'Party - Qualified'
when 'Z' then 'National Party Nonfederal Account'
else 'unknown' end as committee_type_full,
l.cmte_dsgn as committee_designation,
case l.cmte_dsgn
when 'A' then 'Authorized by a candidate'
when 'J' then 'Joint fundraising committee'
when 'P' then 'Principal campaign committee'
when 'U' then 'Unauthorized'
when 'B' then 'Lobbyist/Registrant PAC'
when 'D' then 'Leadership PAC'
else 'unknown' end as committee_designation_full,
l.link_date as link_date,
l.load_date as load_date,
l.expire_date as expire_date,
(select cand_nm from dimcandproperties where dimcandproperties.cand_sk = l.cand_sk order by candproperties_sk desc limit 1) as candidate_name,
(select cmte_nm from dimcmteproperties where dimcmteproperties.cmte_sk = l.cmte_sk order by cmteproperties_sk desc limit 1) as committee_name
from dimlinkages l;
| true
|
0c1311ad89cb4048108b00cd8817e2d0faeb9e95
|
SQL
|
cxq-chuxq/studyroom
|
/studyroom/docs/studyroom.sql
|
UTF-8
| 2,178
| 3.78125
| 4
|
[] |
no_license
|
create database `studyroom`;
-- 用户
CREATE TABLE `user` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`username` VARCHAR(64) UNIQUE DEFAULT '' COMMENT '用户名',
`password` VARCHAR(64) DEFAULT '' COMMENT '密码',
`authority` TINYINT(1) UNSIGNED DEFAULT 0 COMMENT '是否是管理员权限 : 1 -> 是,0 -> 否',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = `utf8mb4` COMMENT ='管理员和用户表';
INSERT INTO `user` (`username`,`password`,`authority`) VALUES ('admin','123456',1);
-- 座位表
CREATE TABLE `seat` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`about` TINYINT(1) UNSIGNED DEFAULT 0 COMMENT '是否是预约状态 : 1 -> 是,0 -> 否',
`repair` TINYINT(1) UNSIGNED DEFAULT 0 COMMENT '是否是维修状态 : 1 -> 是,0 -> 否',
-- `state` TINYINT(1) UNSIGNED DEFAULT 0 COMMENT '座位状态 : 0 -> 未预约,1 -> 已预约,2 -> 维修中',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = `utf8mb4` COMMENT ='座位表';
-- 订单表
CREATE TABLE `order` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`seat_id` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联座位ID',
`user_id` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联用户ID',
`state` TINYINT(1) UNSIGNED DEFAULT 1 COMMENT '订单状态 : 1 -> 预约中,0 -> 已取消',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = `utf8mb4` COMMENT ='订单表';
| true
|
05bdbc5afb0353b744ad2fc4a2b364b2b8bbcaf4
|
SQL
|
01pshe/notes
|
/src/main/resources/database.sql
|
UTF-8
| 1,098
| 4.25
| 4
|
[] |
no_license
|
-- id sequence
create sequence id_seq;
-- users table
create table users(
id integer default nextval('id_seq'::regclass) not null
constraint users_pkey
primary key,
name varchar(255) not null,
password varchar(255) not null,
datecreate date default CURRENT_DATE not null,
locked boolean default true,
datelock date
);
create unique index users_name_uindex on users (name);
-- roles table
create table roles(
id integer default nextval('id_seq'::regclass) not null
constraint roles_pkey
primary key,
name varchar(255) not null
);
-- user_roles table
create table user_roles(
user_id INTEGER NOT NULL,
role_id INTEGER NOT NULL ,
FOREIGN KEY (user_id) REFERENCES users(id),
FOREIGN KEY (role_id) REFERENCES roles(id),
UNIQUE (user_id, role_id)
);
-- create system user
INSERT INTO users (name, password, locked) VALUES ('testuser','testuser',false);
-- create roles
INSERT INTO roles (name) VALUES ('ROLE_USER');
INSERT INTO roles (name) VALUES ('ROLE_ADMIN');
-- assign role to system user
INSERT INTO user_roles (user_id, role_id) VALUES (1,3);
| true
|
9e49f4ec606eeadd28829b6ff7aceb80265d2506
|
SQL
|
sksoh/mcdonalds-queries
|
/Customer Base/new_customers.sql
|
UTF-8
| 1,134
| 3.609375
| 4
|
[] |
no_license
|
DECLARE start_date DATE DEFAULT '2021-01-01';
DECLARE end_date DATE DEFAULT '2021-03-31';
DECLARE start_utc date DEFAULT '2020-12-31';
DECLARE end_utc date DEFAULT '2021-08-01';
DECLARE chains ARRAY <STRING> DEFAULT ['cm4kh', 'cz5ud', 'cz8ck', 'co5oz'];
select count(distinct case when acq.is_first_order_with_this_chain then o.pd_customer_uuid end) as new_customers,
from `fulfillment-dwh-production.pandata_curated.pd_orders` o
join `fulfillment-dwh-production.pandata_curated.pd_vendors` v
on o.vendor_code = v.vendor_code and o.global_entity_id = v.global_entity_id
join `fulfillment-dwh-production.pandata_curated.sf_accounts` a
on a.global_entity_id = v.global_entity_id and a.global_vendor_id = v.global_vendor_id
left join `fulfillment-dwh-production.pandata_report.marketing_pd_orders_agg_acquisition_dates` acq
on acq.uuid = o.uuid
where a.is_marked_for_testing_training = false
and v.is_test = false
and v.is_private = false
and v.chain_code in unnest(chains)
and o.created_date_local between start_date and end_date
and o.created_date_utc between start_utc and end_utc
and o.is_test_order = false
| true
|
ae3055f27ffb0976adb1da5368866f8040988d06
|
SQL
|
stevenanderson37/macbook-personalProject
|
/db/initialize/user_table_initialize.sql
|
UTF-8
| 268
| 2.53125
| 3
|
[] |
no_license
|
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
email VARCHAR(100) UNIQUE,
password VARCHAR(100),
first_name VARCHAR(100),
last_name VARCHAR(100),
birthday DATE,
country VARCHAR(100),
announcements BOOLEAN,
media BOOLEAN,
news BOOLEAN
);
| true
|
477075d1eecd016e8d848349702081f8639185fb
|
SQL
|
scchess/LabKey
|
/server/customModules/ehr/resources/schemas/dbscripts/sqlserver/obsolete/EHR-12.350-12.351.sql
|
UTF-8
| 596
| 3.125
| 3
|
[] |
no_license
|
/*
* Copyright (c) 2013-2016 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
--NOTE: this change is not applied to postgres
ALTER TABLE ehr.snomed_tags DROP PK_snomed_tags;
ALTER TABLE ehr.snomed_tags ADD CONSTRAINT PK_snomed_tags PRIMARY KEY NONCLUSTERED (rowid);
CREATE CLUSTERED INDEX CIDX_snomed_tags ON
ehr.snomed_tags (container, recordid, set_number, sort)
--NOTE: free versions of SQLServer do not support compression, so we cannot add this in the upgrade script.
--WITH (DATA_COMPRESSION = ROW);
| true
|
4973bbad3337db20a33e8fa9fbf28c618dc806d1
|
SQL
|
Franzanella/ControleBancario
|
/banco.sql
|
UTF-8
| 606
| 3.015625
| 3
|
[] |
no_license
|
create database dbbanco;
use dbbanco;
create table tb_conta(
cd_banco varchar(50) not null,
nm_banco varchar(100) not null,
cd_agencia varchar (50) not null,
nm_agencia varchar(100) not null,
cd_contacorrente varchar(45)not null,
nm_titular varchar(50) not null,
cd_cpf char(15) not null,
cd_saldo varchar(100)not null);
create table tb_movimenta(
cd_lancamento varchar(50) not null,
dt_lancamento varchar(11)not null,
nm_historico varchar(100),
ic_dc char(1),
vl_movimenta varchar(50) not null,
CONSTRAINT pk_lancamento,
PRIMARY KEY (cd_lancamento)
);
select * from tb_conta;
drop table tb_conta;
| true
|
6c7f389b426a21f3937f37e69380d99199cb4f93
|
SQL
|
whatisjavascript/workspace
|
/sql/attence.sql
|
UTF-8
| 1,596
| 3.546875
| 4
|
[] |
no_license
|
/*
Navicat Premium Data Transfer
Source Server : workspace
Source Server Type : MySQL
Source Server Version : 50721
Source Host : localhost:3306
Source Schema : company
Target Server Type : MySQL
Target Server Version : 50721
File Encoding : 65001
Date: 22/05/2018 07:41:26
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for attence
-- ----------------------------
DROP TABLE IF EXISTS `attence`;
CREATE TABLE `attence` (
`Id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Id',
`OpenId` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户OpenId',
`StartTime` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '上班时间',
`EndTime` datetime(0) NULL DEFAULT NULL COMMENT '下班日期',
`StartTimeState` tinyint(4) NULL DEFAULT NULL COMMENT '0: 正常 1:迟到 2:外勤 3:请假',
`EndTimeState` tinyint(4) NULL DEFAULT NULL COMMENT '0:正常 1:早退 2: 外勤 3:请假',
`StartLocation` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上班打卡地点',
`EndLocation` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下班打开地点',
PRIMARY KEY (`Id`) USING BTREE,
INDEX `OpenId`(`OpenId`) USING BTREE,
CONSTRAINT `OpenId` FOREIGN KEY (`OpenId`) REFERENCES `userinfo` (`OpenId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
| true
|
3d1207182acb4f478ae375a2e9e73a137d41e089
|
SQL
|
souravidea/OOAD_MWP_Solver
|
/MWPDB.sql
|
UTF-8
| 75,589
| 2.734375
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1ubuntu0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 05, 2019 at 06:47 PM
-- Server version: 5.5.62-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.29
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: `MWPDB`
--
-- --------------------------------------------------------
--
-- Table structure for table `attend`
--
CREATE TABLE IF NOT EXISTS `attend` (
`sent_sl_no` int(5) NOT NULL,
`agent` int(30) NOT NULL,
`phenomena` int(30) NOT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `be`
--
CREATE TABLE IF NOT EXISTS `be` (
`sent_sl_no` int(5) NOT NULL,
`owner_name` varchar(30) DEFAULT NULL,
`variable_name` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `borrow`
--
CREATE TABLE IF NOT EXISTS `borrow` (
`sent_sl_no` int(5) NOT NULL,
`borrower` varchar(30) NOT NULL,
`lender` varchar(30) DEFAULT NULL,
`theme` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `break`
--
CREATE TABLE IF NOT EXISTS `break` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `buy`
--
CREATE TABLE IF NOT EXISTS `buy` (
`sent_sl_no` int(5) NOT NULL,
`buyer` varchar(30) DEFAULT NULL,
`seller` varchar(30) DEFAULT NULL,
`goods` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `cost`
--
CREATE TABLE IF NOT EXISTS `cost` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`second_owner` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `crack`
--
CREATE TABLE IF NOT EXISTS `crack` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `crack`
--
INSERT INTO `crack` (`sent_sl_no`, `owner`, `item`, `variable_count`) VALUES
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25),
(3, 'sally', 'seashell', 25);
-- --------------------------------------------------------
--
-- Table structure for table `cut`
--
CREATE TABLE IF NOT EXISTS `cut` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) NOT NULL,
`source` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`pieces` int(10) DEFAULT NULL,
`place` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `decide`
--
CREATE TABLE IF NOT EXISTS `decide` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`variable_name` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `decrement`
--
CREATE TABLE IF NOT EXISTS `decrement` (
`sent_sl_no` int(5) NOT NULL,
`primary_owner` varchar(30) DEFAULT NULL,
`secondary_owner` varchar(30) DEFAULT NULL,
`item_name` varchar(30) DEFAULT NULL,
`item_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `eat`
--
CREATE TABLE IF NOT EXISTS `eat` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) DEFAULT NULL,
`food` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `find`
--
CREATE TABLE IF NOT EXISTS `find` (
`sent_sl_no` int(5) NOT NULL,
`perceiver` varchar(30) NOT NULL,
`sought_entity` varchar(50) DEFAULT NULL,
`variable_count` int(20) DEFAULT NULL,
`location` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `finish`
--
CREATE TABLE IF NOT EXISTS `finish` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) NOT NULL,
`location` varchar(30) DEFAULT NULL,
`activity` varchar(30) DEFAULT NULL,
`result` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `gather`
--
CREATE TABLE IF NOT EXISTS `gather` (
`sent_sl_no` int(5) NOT NULL,
`person` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `gather`
--
INSERT INTO `gather` (`sent_sl_no`, `person`, `item`, `variable_count`) VALUES
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33),
(2, 'joan', 'book', 33);
-- --------------------------------------------------------
--
-- Table structure for table `generic`
--
CREATE TABLE IF NOT EXISTS `generic` (
`sent_sl_no` int(5) NOT NULL,
`primary_owner` varchar(30) DEFAULT NULL,
`secondary_owner` varchar(30) DEFAULT NULL,
`variable_name` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `get`
--
CREATE TABLE IF NOT EXISTS `get` (
`sent_sl_no` int(5) NOT NULL,
`receiver` varchar(30) DEFAULT NULL,
`doner` varchar(30) DEFAULT NULL,
`theme` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `give`
--
CREATE TABLE IF NOT EXISTS `give` (
`sent_sl_no` int(2) NOT NULL,
`doner` varchar(20) NOT NULL,
`recipient` varchar(20) DEFAULT NULL,
`variable_name` varchar(20) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL,
`item_specific_attribute` varchar(20) DEFAULT NULL,
`operation1` varchar(100) DEFAULT NULL,
`operation2` varchar(100) DEFAULT NULL,
PRIMARY KEY (`sent_sl_no`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `go`
--
CREATE TABLE IF NOT EXISTS `go` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) NOT NULL,
`event` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `grow`
--
CREATE TABLE IF NOT EXISTS `grow` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) NOT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `have`
--
CREATE TABLE IF NOT EXISTS `have` (
`sent_sl_no` int(5) NOT NULL,
`owner_name` varchar(20) NOT NULL,
`second_owner` varchar(30) DEFAULT NULL,
`variable_name` varchar(20) DEFAULT NULL,
`item_specific_attribute` varchar(20) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL,
PRIMARY KEY (`sent_sl_no`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `increment`
--
CREATE TABLE IF NOT EXISTS `increment` (
`sent_sl_no` int(5) NOT NULL,
`primary_owner` varchar(30) DEFAULT NULL,
`secondary_owner` varchar(30) DEFAULT NULL,
`item_name` varchar(30) DEFAULT NULL,
`item_count` int(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `join`
--
CREATE TABLE IF NOT EXISTS `join` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `loose`
--
CREATE TABLE IF NOT EXISTS `loose` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `lose`
--
CREATE TABLE IF NOT EXISTS `lose` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `make`
--
CREATE TABLE IF NOT EXISTS `make` (
`sent_sl_no` int(5) NOT NULL,
`creator` varchar(30) DEFAULT NULL,
`product` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `miss`
--
CREATE TABLE IF NOT EXISTS `miss` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `miss`
--
INSERT INTO `miss` (`sent_sl_no`, `owner`, `item`, `variable_count`) VALUES
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 7),
(2, 'any', NULL, 41),
(2, 'any', NULL, 12),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'total', 4),
(3, 'keith', 'total', 4),
(3, 'keith', 'game', 4),
(3, 'keith', 'game', 4),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(2, 'tom', 'game', 7),
(3, 'keith', 'game', 4),
(2, 'any', NULL, 35);
-- --------------------------------------------------------
--
-- Table structure for table `MWP`
--
CREATE TABLE IF NOT EXISTS `MWP` (
`problem_id` int(2) NOT NULL DEFAULT '1',
`no_of_sentences` int(2) NOT NULL,
`problem_category` varchar(25) NOT NULL DEFAULT 'addition_substraction',
`owner_name` varchar(15) DEFAULT NULL,
`variable_name` varchar(20) DEFAULT NULL,
`item_specific_attribute` varchar(30) DEFAULT NULL,
`verb` varchar(30) DEFAULT NULL,
`result` int(10) DEFAULT '0',
PRIMARY KEY (`problem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `MWP`
--
INSERT INTO `MWP` (`problem_id`, `no_of_sentences`, `problem_category`, `owner_name`, `variable_name`, `item_specific_attribute`, `verb`, `result`) VALUES
(1, 3, 'addition_substraction', 'they', 'balloon', 'yellow', 'have', 0);
-- --------------------------------------------------------
--
-- Table structure for table `negtransfer`
--
CREATE TABLE IF NOT EXISTS `negtransfer` (
`sent_sl_no` int(5) NOT NULL,
`primary_owner` varchar(30) DEFAULT NULL,
`secondary_owner` varchar(30) DEFAULT NULL,
`item_name` varchar(30) DEFAULT NULL,
`item_count` int(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `NERlist`
--
CREATE TABLE IF NOT EXISTS `NERlist` (
`sent_sl_no` int(2) NOT NULL,
`word` varchar(50) NOT NULL,
`ner` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `objectitem`
--
CREATE TABLE IF NOT EXISTS `objectitem` (
`sent_sl_no` int(5) NOT NULL,
`variable_name` varchar(20) DEFAULT NULL,
`owner_name` varchar(30) DEFAULT NULL,
`item_specific_attribute` varchar(20) DEFAULT NULL,
`variable_count` int(5) DEFAULT NULL,
`unit` varchar(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `objectitem`
--
INSERT INTO `objectitem` (`sent_sl_no`, `variable_name`, `owner_name`, `item_specific_attribute`, `variable_count`, `unit`) VALUES
(1, 'balloon', 'tom', 'yellow', 9, NULL),
(2, 'balloon', 'sara', 'yellow', 8, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `observation`
--
CREATE TABLE IF NOT EXISTS `observation` (
`sent_sl_no` int(5) NOT NULL,
`primary_owner` varchar(30) DEFAULT NULL,
`secondary_owner` varchar(30) DEFAULT NULL,
`item_name` varchar(30) DEFAULT NULL,
`item_count` int(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `own`
--
CREATE TABLE IF NOT EXISTS `own` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `own`
--
INSERT INTO `own` (`sent_sl_no`, `owner`, `item`, `variable_count`) VALUES
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(1, 'veronica', 'cat', 12),
(2, 'veronica', 'dog', 17),
(5, 'maurice', 'cat', 1),
(3, 'tom', 'game', 2),
(4, 'melanie', 'game', 4),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2),
(3, 'tom', 'game', 2);
-- --------------------------------------------------------
--
-- Table structure for table `owner`
--
CREATE TABLE IF NOT EXISTS `owner` (
`state_no` int(5) NOT NULL,
`owner_name` varchar(15) NOT NULL,
`owner_specific_attribute` varchar(20) DEFAULT NULL,
`verb_lemma` varchar(20) DEFAULT NULL,
`operator` varchar(20) DEFAULT NULL,
`variable_name` varchar(15) DEFAULT NULL,
`item_specific_attribute` varchar(30) DEFAULT NULL,
`variable_count` int(4) DEFAULT NULL,
`equation` varchar(80) DEFAULT NULL,
`evaluated_value` int(10) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `owner`
--
INSERT INTO `owner` (`state_no`, `owner_name`, `owner_specific_attribute`, `verb_lemma`, `operator`, `variable_name`, `item_specific_attribute`, `variable_count`, `equation`, `evaluated_value`) VALUES
(1, 'tom', NULL, 'have', NULL, 'balloon', 'yellow', 9, 'obj[0].variable_count=9;', 0),
(1, 'sara', NULL, 'have', NULL, 'balloon', 'yellow', 8, 'obj[1].variable_count=8;', 0);
-- --------------------------------------------------------
--
-- Table structure for table `pay`
--
CREATE TABLE IF NOT EXISTS `pay` (
`sent_sl_no` int(5) NOT NULL,
`buyer` varchar(30) DEFAULT NULL,
`seller` varchar(30) DEFAULT NULL,
`goods` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pick`
--
CREATE TABLE IF NOT EXISTS `pick` (
`sent_sl_no` int(5) NOT NULL,
`cognizer` varchar(30) NOT NULL,
`second_owner` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `place`
--
CREATE TABLE IF NOT EXISTS `place` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) NOT NULL,
`second_owner` varchar(30) DEFAULT NULL,
`theme` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL,
`location` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `plan`
--
CREATE TABLE IF NOT EXISTS `plan` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `plan`
--
INSERT INTO `plan` (`sent_sl_no`, `owner`, `item`, `variable_count`) VALUES
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(4, 'alyssa', 'game', 15),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', 'game', 16),
(3, 'nancy', 'game', 7),
(3, 'jason', NULL, 16),
(3, 'jason', NULL, 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16),
(3, 'jason', 'game', 16);
-- --------------------------------------------------------
--
-- Table structure for table `plant`
--
CREATE TABLE IF NOT EXISTS `plant` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) NOT NULL,
`location` varchar(30) DEFAULT NULL,
`theme` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `play`
--
CREATE TABLE IF NOT EXISTS `play` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`variable_name` varchar(30) DEFAULT NULL,
`variable_count` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `postransfer`
--
CREATE TABLE IF NOT EXISTS `postransfer` (
`sent_sl_no` int(5) NOT NULL,
`primary_owner` varchar(30) DEFAULT NULL,
`secondary_owner` varchar(30) DEFAULT NULL,
`item_name` varchar(30) DEFAULT NULL,
`item_count` int(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `purchase`
--
CREATE TABLE IF NOT EXISTS `purchase` (
`sent_sl_no` int(5) NOT NULL,
`buyer` varchar(30) DEFAULT NULL,
`seller` varchar(30) DEFAULT NULL,
`goods` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `receive`
--
CREATE TABLE IF NOT EXISTS `receive` (
`sent_sl_no` int(5) NOT NULL,
`recipient` varchar(30) NOT NULL,
`doner` varchar(30) DEFAULT NULL,
`theme` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `sell`
--
CREATE TABLE IF NOT EXISTS `sell` (
`sent_sl_no` int(5) NOT NULL,
`seller` varchar(30) DEFAULT NULL,
`buyer` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `sentence`
--
CREATE TABLE IF NOT EXISTS `sentence` (
`sent_sl_no` int(2) NOT NULL,
`sent_type` varchar(10) NOT NULL,
`sentenceline` varchar(100) NOT NULL,
`no_of_tokens` int(2) NOT NULL,
`verb_name` varchar(10) DEFAULT NULL,
`verb_lemma` varchar(20) DEFAULT NULL,
`owner_name` varchar(15) DEFAULT NULL,
`second_owner` varchar(20) DEFAULT NULL,
`variable_name` varchar(20) DEFAULT NULL,
`item_specific_attribute` varchar(30) DEFAULT NULL,
`variable_count` int(8) DEFAULT '0',
`pipeline_equation1` varchar(100) DEFAULT NULL,
`pipeline_equation2` varchar(100) DEFAULT NULL,
PRIMARY KEY (`sent_sl_no`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `sentence`
--
INSERT INTO `sentence` (`sent_sl_no`, `sent_type`, `sentenceline`, `no_of_tokens`, `verb_name`, `verb_lemma`, `owner_name`, `second_owner`, `variable_name`, `item_specific_attribute`, `variable_count`, `pipeline_equation1`, `pipeline_equation2`) VALUES
(1, 'normal', 'Tom has 9 yellow balloons .', 6, 'has', 'have', 'tom', NULL, 'balloon', 'yellow', 9, 'tom.variable_count=9;', NULL),
(2, 'normal', 'Sara has 8 yellow balloons .', 6, 'has', 'have', 'sara', NULL, 'balloon', 'yellow', 8, 'sara.variable_count=8;', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `serve`
--
CREATE TABLE IF NOT EXISTS `serve` (
`sent_sl_no` int(5) NOT NULL,
`server` varchar(30) DEFAULT NULL,
`recipient` varchar(30) DEFAULT NULL,
`theme` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `spend`
--
CREATE TABLE IF NOT EXISTS `spend` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) NOT NULL,
`resource` varchar(30) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `SRLdata`
--
CREATE TABLE IF NOT EXISTS `SRLdata` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`sent_sl_no` int(8) NOT NULL,
`word` varchar(20) NOT NULL,
`lemma` varchar(20) NOT NULL,
`POS` varchar(20) DEFAULT NULL,
`dependency` varchar(10) NOT NULL,
`ispred` char(1) NOT NULL,
`pred` varchar(30) DEFAULT NULL,
`Args1` varchar(30) DEFAULT NULL,
`Args2` varchar(30) DEFAULT NULL,
`Args3` varchar(30) DEFAULT NULL,
`Args4` varchar(20) DEFAULT NULL,
`Args5` varchar(20) DEFAULT NULL,
`Args6` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=25 ;
--
-- Dumping data for table `SRLdata`
--
INSERT INTO `SRLdata` (`id`, `sent_sl_no`, `word`, `lemma`, `POS`, `dependency`, `ispred`, `pred`, `Args1`, `Args2`, `Args3`, `Args4`, `Args5`, `Args6`) VALUES
(1, 1, 'Tom', 'Tom', 'NNP', 'SUB', '_', '_', 'Total', '_', NULL, NULL, NULL, NULL),
(2, 1, 'has', 'have', 'VBZ', 'ROOT', 'Y', 'Inclusion', '_', '_', NULL, NULL, NULL, NULL),
(3, 1, '9', '9', 'CD', 'NMOD', '_', '_', '_', '_', NULL, NULL, NULL, NULL),
(4, 1, 'yellow', 'yellow', 'JJ', 'NMOD', 'Y', 'Emotion_directed', '_', '_', NULL, NULL, NULL, NULL),
(5, 1, 'balloons', 'balloon', 'NNS', 'OBJ', '_', '_', 'Part', 'Stimulus', NULL, NULL, NULL, NULL),
(6, 1, '.', '.', '.', 'P', '_', '_', '_', '_', NULL, NULL, NULL, NULL),
(8, 2, 'Sara', 'Sara', 'NNP', 'SUB', '_', '_', 'Total', '_', NULL, NULL, NULL, NULL),
(9, 2, 'has', 'have', 'VBZ', 'ROOT', 'Y', 'Inclusion', '_', '_', NULL, NULL, NULL, NULL),
(10, 2, '8', '8', 'CD', 'NMOD', '_', '_', '_', '_', NULL, NULL, NULL, NULL),
(11, 2, 'yellow', 'yellow', 'JJ', 'NMOD', 'Y', 'Emotion_directed', '_', '_', NULL, NULL, NULL, NULL),
(12, 2, 'balloons', 'balloon', 'NNS', 'OBJ', '_', '_', 'Part', 'Stimulus', NULL, NULL, NULL, NULL),
(13, 2, '.', '.', '.', 'P', '_', '_', '_', '_', NULL, NULL, NULL, NULL),
(15, 3, 'How', 'how', 'WRB', 'AMOD', '_', '_', '_', '_', '_', '_', NULL, NULL),
(16, 3, 'many', 'many', 'JJ', 'NMOD', 'Y', 'Quantity', 'Quantity', '_', '_', '_', NULL, NULL),
(17, 3, 'yellow', 'yellow', 'JJ', 'NMOD', 'Y', 'Emotion_directed', '_', '_', '_', '_', NULL, NULL),
(18, 3, 'balloons', 'balloon', 'NNS', 'SUB', '_', '_', 'Individuals', 'Experiencer', 'Agent', '_', NULL, NULL),
(19, 3, 'do', 'do', 'VBP', 'ROOT', 'Y', 'Intentionally_act', '_', '_', '_', '_', NULL, NULL),
(20, 3, 'they', 'they', 'PRP', 'SUB', '_', '_', '_', '_', '_', '_', NULL, NULL),
(21, 3, 'have', 'have', 'VBP', 'VMOD', '_', '_', '_', '_', 'Act', '_', NULL, NULL),
(22, 3, 'in', 'in', 'IN', 'VMOD', '_', '_', '_', '_', '_', '_', NULL, NULL),
(23, 3, 'total', 'total', 'NN', 'PMOD', 'Y', 'Completeness', '_', '_', '_', '_', NULL, NULL),
(24, 3, '?', '?', '.', 'P', '_', '_', '_', '_', '_', '_', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `stack`
--
CREATE TABLE IF NOT EXISTS `stack` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `store`
--
CREATE TABLE IF NOT EXISTS `store` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) DEFAULT NULL,
`theme` varchar(3) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `take`
--
CREATE TABLE IF NOT EXISTS `take` (
`sent_sl_no` int(5) NOT NULL,
`receiver` varchar(30) DEFAULT NULL,
`doner` varchar(30) DEFAULT NULL,
`item` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `tear`
--
CREATE TABLE IF NOT EXISTS `tear` (
`sent_sl_no` int(5) NOT NULL,
`owner` varchar(30) DEFAULT NULL,
`theme` varchar(30) DEFAULT NULL,
`variable_count` int(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tear`
--
INSERT INTO `tear` (`sent_sl_no`, `owner`, `theme`, `variable_count`) VALUES
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 8),
(2, 'any', NULL, 6),
(2, 'any', NULL, 6),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'sandy', NULL, 5),
(2, 'sandy', NULL, 5),
(2, 'sandy', 'card', 5),
(2, 'sally', 'card', 9),
(2, 'dan', 'card', 8),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sally', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'sara', 'card', 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9),
(2, 'any', NULL, 6),
(2, 'any', NULL, 8),
(2, 'any', NULL, 9),
(2, 'any', NULL, 9);
-- --------------------------------------------------------
--
-- Table structure for table `verb class`
--
CREATE TABLE IF NOT EXISTS `verb class` (
`sl_no` int(5) NOT NULL AUTO_INCREMENT,
`verb name` varchar(20) NOT NULL,
`predicate` varchar(30) DEFAULT NULL,
`args1` varchar(30) DEFAULT NULL,
`args2` varchar(30) DEFAULT NULL,
PRIMARY KEY (`sl_no`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `verblist`
--
CREATE TABLE IF NOT EXISTS `verblist` (
`list_id` int(5) NOT NULL AUTO_INCREMENT,
`verb_lemma` varchar(20) NOT NULL,
`verb_category` varchar(20) NOT NULL,
`operator1` varchar(10) DEFAULT NULL,
`operator2` varchar(20) DEFAULT NULL,
`operation1` varchar(80) DEFAULT NULL,
`operation2` varchar(80) DEFAULT NULL,
PRIMARY KEY (`list_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=45 ;
--
-- Dumping data for table `verblist`
--
INSERT INTO `verblist` (`list_id`, `verb_lemma`, `verb_category`, `operator1`, `operator2`, `operation1`, `operation2`) VALUES
(1, 'have', 'observation', NULL, NULL, 'owner_name.variable_name=variable_count', NULL),
(2, 'give', 'negetive transfer', '-', '+', 'doner.variable_name=doner.variable_name-variable_count', 'recipient.variable_name=recipient.variable_name+variable_count'),
(3, 'find', 'observation', NULL, NULL, 'perciver.variable_name=variable_count', NULL),
(4, 'cut', 'positive transfer', '-', '-', 'agent.variable_count=agent.variable_count+variable_count', NULL),
(5, 'be', 'observation', NULL, NULL, 'owner_name.variable_count=count', NULL),
(6, 'plant', 'increment', '+', '+', 'agent.variable_count=agent.variable_count+variable_count', NULL),
(7, 'serve', 'negetive transfer', '-', '+', 'server.variable_count=server.variable_count-variable_count', 'recipient.variable_count=recipient.variable_count+variable_count'),
(8, 'grow', 'observation', '+', '+', 'agent.variable_count=agent.variable_count+variable_count', NULL),
(9, 'pick', 'increment', '+', '-', 'cognizer.variable_count=cognizer.variable_count+variable_count', NULL),
(10, 'place', 'increment', '+', '+', 'agent.variable_count=agent.variable_count+variable_count', NULL),
(11, 'go', 'observation', '+', NULL, NULL, NULL),
(12, 'buy', 'positive transfer', '+', '-', 'buyer.variable_count=buyer.variable_count+x', 'seller.variable_count=seller.variable_count-x'),
(13, 'finish', 'observation', NULL, NULL, '', NULL),
(14, 'receive', 'positive transfer', '+', '-', '', NULL),
(15, 'spend', 'decrement', '-', NULL, '', NULL),
(16, 'attend', 'increment', '+', NULL, 'agent.variable_count=x', NULL),
(17, 'wash', 'observation', NULL, NULL, 'agent.variable_count=x', NULL),
(18, 'stack', 'increment', '+', '+', 'agent.variable_count=x', NULL),
(19, 'store', 'increment', '+', NULL, 'agent.variable_count=x', NULL),
(20, 'lose', 'decrement', '-', NULL, 'agent.variable_count=x', NULL),
(21, 'borrow', 'positive transfer', '+', '-', '', NULL),
(22, 'eat', 'decrement', '-', NULL, '', NULL),
(23, 'make', 'observation', NULL, NULL, '', NULL),
(24, 'take', 'positive transfer', '+', '-', '', NULL),
(25, 'decide', 'observation', NULL, NULL, '', NULL),
(26, 'sell', 'negetive transfer', '-', '+', '', NULL),
(27, 'purchase', 'positive transfer', '+', '-', '', NULL),
(28, 'join', 'increment', '+', NULL, '', NULL),
(29, 'get', 'positive transfer', '+', '-', '', NULL),
(30, 'pay', 'negetive transfer', '-', '+', '', NULL),
(31, 'own', 'observation', NULL, NULL, NULL, NULL),
(32, 'gather', 'observation', NULL, NULL, NULL, NULL),
(33, 'tear', 'decrement', '-', NULL, NULL, NULL),
(34, 'miss', 'decrement', '-', NULL, NULL, NULL),
(35, 'crack', 'decrement', '-', NULL, NULL, NULL),
(36, 'plan', 'observation', '+', NULL, NULL, NULL),
(37, 'cost', 'observation', '-', NULL, NULL, NULL),
(38, 'break', 'decrement', '-', NULL, NULL, NULL),
(39, 'play', 'observation', NULL, NULL, NULL, NULL),
(40, 'want', 'observation', NULL, NULL, NULL, NULL),
(41, 'clean', 'increment', '+', NULL, NULL, NULL),
(42, 'win', 'increment', '+', '+', NULL, NULL),
(43, 'defeat', 'decrement', '-', NULL, NULL, NULL),
(44, 'damage', 'bothdecrement', '-', '-', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `verbshema`
--
CREATE TABLE IF NOT EXISTS `verbshema` (
`sent_sl_no` int(5) NOT NULL,
`primary_owner` varchar(30) DEFAULT NULL,
`secondary_owner` varchar(30) DEFAULT NULL,
`variable_name` varchar(30) DEFAULT NULL,
`variable_count` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `verbstable`
--
CREATE TABLE IF NOT EXISTS `verbstable` (
`sent_sl_no` int(5) NOT NULL,
`verb_name` varchar(20) NOT NULL,
`verb_lemma` varchar(20) NOT NULL,
`owner_name` varchar(20) DEFAULT NULL,
`second_owner` varchar(20) DEFAULT NULL,
`variable_name` varchar(20) DEFAULT NULL,
`variable_count` int(10) DEFAULT NULL,
PRIMARY KEY (`sent_sl_no`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `verbstable`
--
INSERT INTO `verbstable` (`sent_sl_no`, `verb_name`, `verb_lemma`, `owner_name`, `second_owner`, `variable_name`, `variable_count`) VALUES
(1, 'has', 'have', 'tom', NULL, 'balloon', 9),
(2, 'has', 'have', 'sara', NULL, 'balloon', 8);
-- --------------------------------------------------------
--
-- Table structure for table `wash`
--
CREATE TABLE IF NOT EXISTS `wash` (
`sent_sl_no` int(5) NOT NULL,
`agent` varchar(30) DEFAULT NULL,
`theme` varchar(30) DEFAULT NULL,
`variable_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!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
|
c3651bf35707cdb78822ebb65a73c6c17d6d0293
|
SQL
|
Xenothium/AlumniConnect
|
/database.txt
|
UTF-8
| 4,523
| 3.5625
| 4
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 08, 2012 at 07:25 PM
-- Server version: 5.5.16
-- PHP Version: 5.3.8
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: `alumniconnect`
--
CREATE DATABASE `alumniconnect` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `alumniconnect`;
-- --------------------------------------------------------
--
-- Table structure for table `contact`
--
CREATE TABLE IF NOT EXISTS `contact` (
`type` varchar(30) NOT NULL DEFAULT '',
`value` varchar(50) NOT NULL DEFAULT '',
`id` int(5) NOT NULL DEFAULT '0',
PRIMARY KEY (`type`,`value`,`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `education`
--
CREATE TABLE IF NOT EXISTS `education` (
`id` int(5) NOT NULL,
`start` date NOT NULL DEFAULT '0000-00-00',
`end` date NOT NULL DEFAULT '0000-00-00',
`institution` varchar(300) NOT NULL DEFAULT '',
`branch` varchar(100) NOT NULL DEFAULT '',
`degree` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`,`start`,`end`,`institution`,`branch`,`degree`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `relative`
--
CREATE TABLE IF NOT EXISTS `relative` (
`id` int(5) NOT NULL,
`gender` varchar(8) NOT NULL,
`relation` varchar(30) NOT NULL,
`name` varchar(100) NOT NULL DEFAULT '',
`dob` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`id`,`gender`,`relation`,`name`,`dob`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `status`
--
CREATE TABLE IF NOT EXISTS `status` (
`id` int(5) NOT NULL,
`content` varchar(6000) DEFAULT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`subject` varchar(70) NOT NULL DEFAULT '(Untitled)',
PRIMARY KEY (`id`,`time`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(5) NOT NULL,
`first_name` varchar(50) NOT NULL,
`last_name` varchar(50) NOT NULL,
`email_id` varchar(50) NOT NULL,
`dob` date DEFAULT NULL,
`anniversary` date DEFAULT NULL,
`pic_url` varchar(200) DEFAULT NULL,
`address1` varchar(100) DEFAULT NULL,
`address2` varchar(100) DEFAULT NULL,
`city` varchar(100) DEFAULT NULL,
`state` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email_id` (`email_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `work`
--
CREATE TABLE IF NOT EXISTS `work` (
`id` int(5) NOT NULL,
`start` date NOT NULL DEFAULT '0000-00-00',
`end` date NOT NULL DEFAULT '0000-00-00',
`institution` varchar(300) NOT NULL DEFAULT '',
`designation` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`,`start`,`end`,`institution`,`designation`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `contact`
--
ALTER TABLE `contact`
ADD CONSTRAINT `contact_ibfk_1` FOREIGN KEY (`id`) REFERENCES `user` (`id`);
--
-- Constraints for table `education`
--
ALTER TABLE `education`
ADD CONSTRAINT `education_ibfk_1` FOREIGN KEY (`id`) REFERENCES `user` (`id`);
--
-- Constraints for table `relative`
--
ALTER TABLE `relative`
ADD CONSTRAINT `relative_ibfk_1` FOREIGN KEY (`id`) REFERENCES `user` (`id`);
--
-- Constraints for table `status`
--
ALTER TABLE `status`
ADD CONSTRAINT `status_ibfk_1` FOREIGN KEY (`id`) REFERENCES `user` (`id`);
--
-- Constraints for table `work`
--
ALTER TABLE `work`
ADD CONSTRAINT `work_ibfk_1` FOREIGN KEY (`id`) REFERENCES `user` (`id`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true
|
28fdecaad8a39cbe7fa520008eb1089068ee4f94
|
SQL
|
Muqriz1010/FootballLeagueDataAnalytics
|
/dw_pl.sql
|
UTF-8
| 2,659
| 3.25
| 3
|
[] |
no_license
|
delimiter $$
CREATE TABLE `dim_club` (
`dim_clubid` int NOT NULL,
`clubid` char(3) NOT NULL,
`clubname` varchar(50) DEFAULT NULL,
PRIMARY KEY (`dim_clubid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci$$
delimiter $$
CREATE TABLE `dim_clubmatch` (
`dim_clubmatchid` varchar(3) NOT NULL,
`clubid` char(3) NOT NULL,
`matchid` int NOT NULL,
`result` char(1) DEFAULT NULL,
PRIMARY KEY (`dim_clubmatchid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci$$
delimiter $$
CREATE TABLE `dim_game` (
`dim_matchid` int NOT NULL,
`hometeam` varchar(50) DEFAULT NULL,
`awayteam` varchar(50) DEFAULT NULL,
`gamedate` date DEFAULT NULL,
`matchid` int NOT NULL,
PRIMARY KEY (`dim_matchid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci$$
delimiter $$
CREATE TABLE `dim_player` (
`dim_playerid` int NOT NULL,
`playername` varchar(255) DEFAULT NULL,
`playerid` int DEFAULT NULL,
PRIMARY KEY (`dim_playerid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci$$
delimiter $$
CREATE TABLE `dim_playerposition` (
`dim_positionid` int NOT NULL,
`positiontype` varchar(3) NOT NULL,
`positionname` varchar(50) DEFAULT NULL,
`positionid` varchar(3) NOT NULL,
PRIMARY KEY (`dim_positionid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci$$
delimiter $$
CREATE TABLE `dim_time` (
`dim_timeid` int NOT NULL AUTO_INCREMENT,
`dt` date DEFAULT NULL,
`yr` smallint DEFAULT NULL,
`mth` smallint DEFAULT NULL,
`dy` smallint DEFAULT NULL,
`wk` smallint DEFAULT NULL,
`mth_name` char(3) DEFAULT NULL,
`day_name` char(10) DEFAULT NULL,
PRIMARY KEY (`dim_timeid`)
) ENGINE=InnoDB AUTO_INCREMENT=7671 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci$$
delimiter $$
CREATE TABLE `Fact_BestPlayerPosition` (
`dim_playerid` int NOT NULL,
`dim_matchid` int NOT NULL,
`dim_positionid` int NOT NULL,
`dim_clubid` int NOT NULL,
`goals` int DEFAULT NULL,
`shots` int DEFAULT NULL,
`chancescreated` int DEFAULT NULL,
`assists` int DEFAULT NULL,
`dim_timeid` smallint DEFAULT NULL,
PRIMARY KEY (`dim_clubid`,`dim_positionid`,`dim_matchid`,`dim_playerid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci$$
delimiter $$
CREATE TABLE `Fact_TransferSpending` (
`dim_playerid` int NOT NULL,
`dim_clubid` int NOT NULL,
`dim_timeid` int NOT NULL,
`transferin` char(3) DEFAULT NULL,
`transferout` char(3) DEFAULT NULL,
`fee` decimal(10,2) DEFAULT NULL,
PRIMARY KEY (`dim_playerid`,`dim_clubid`,`dim_timeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci$$
| true
|
34416a844d4b84039609096f27208fffe27ed7fa
|
SQL
|
mingael/Analytics
|
/collect.sql
|
UTF-8
| 1,564
| 3.15625
| 3
|
[] |
no_license
|
-- Main
create table collect (
idx integer not null auto_increment comment '일련번호',
save_date date comment '저장일자',
ip character varying(15) comment 'IP',
app_time integer not null comment '접속일시',
close_time integer not null comment '종료일시',
primary key (idx)
)
comment = '사용자정보수집';
-- Browser 정보
create table collect_browser (
collect_idx integer not null comment 'collect 일련번호',
save_time integer not null comment '저장일시',
type character varying(1) comment '접속기기',
code_name character varying(30) comment '브라우저 코드명',
name character varying(30) comment '브라우저명',
version text comment '브라우저 버전',
platform character varying(15) comment 'OS',
product character varying(20) comment '엔진',
device character varying(25) comment '기기',
user_agent text comment '운영체제 정보'
)
comment = '사용자정보수집-접속정보';
-- Location 페이지 정보
create table collect_location (
collect_idx integer not null comment 'collect 일련번호',
save_time integer not null comment '저장일시',
language_type character varying(2) comment '언어종류',
language character varying(5) comment '언어',
protocol character varying(5) comment '프로토콜',
host character varying(200) comment '방문페이지',
url character varying(255) not null comment '전체주소',
param text comment '파라미터'
)
comment = '사용자정보수집-페이지';
| true
|
a03189390889bb92640aab21e6dd7a683c14679c
|
SQL
|
FilipeVoges/SQL_Scripts
|
/mysql/Date Dimension.sql
|
UTF-8
| 2,114
| 4.28125
| 4
|
[
"MIT"
] |
permissive
|
-- Define o Valor Pt-BR para o banco
SET lc_time_names = 'pt_BR';
-- Verifica se a Tabela já não existe
DROP TABLE IF EXISTS numbers_small;
-- Cria a Tabela
CREATE TABLE numbers_small (number INT);
INSERT INTO numbers_small VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-- Verifica se a Tabela já não existe
DROP TABLE IF EXISTS numbers;
-- Cria a Tabela
CREATE TABLE numbers (number BIGINT);
INSERT INTO numbers
SELECT thousands.number * 1000 + hundreds.number * 100 + tens.number * 10 + ones.number
FROM numbers_small thousands, numbers_small hundreds, numbers_small tens, numbers_small ones
LIMIT 1000000;
-- Verifica se a Tabela já não existe
DROP TABLE IF EXISTS Dates_D;
-- Cria a Tabela
CREATE TABLE Dates_D (
date_id BIGINT PRIMARY KEY,
date DATE NOT NULL,
day CHAR(10),
day_of_week INT,
day_of_month INT,
day_of_year INT,
previous_day date,
next_day date,
type_day CHAR(20) NOT NULL DEFAULT "Weekday",
week_of_year CHAR(2),
month CHAR(10),
month_of_year CHAR(2),
quarter_of_year INT,
year INT,
UNIQUE KEY `date` (`date`));
-- Insere os valores
INSERT INTO Dates_D (date_id, date)
SELECT number, DATE_ADD( '2017-01-01', INTERVAL number DAY )
FROM numbers
WHERE DATE_ADD( '2017-01-01', INTERVAL number DAY ) BETWEEN '2017-01-01' AND '2030-12-31'
ORDER BY number;
-- Atualiza os valores com base na data
UPDATE Dates_D SET
day = DATE_FORMAT( date, "%W" ),
day_of_week = DAYOFWEEK(date),
day_of_month = DATE_FORMAT( date, "%d" ),
day_of_year = DATE_FORMAT( date, "%j" ),
previous_day = DATE_ADD(date, INTERVAL -1 DAY),
next_day = DATE_ADD(date, INTERVAL 1 DAY),
type_day = IF( DATE_FORMAT( date, "%W" ) IN ('Sábado','Domingo'), 'Final de Semana', 'Dia de Semana'),
week_of_year = DATE_FORMAT( date, "%V" ),
month = DATE_FORMAT( date, "%M"),
month_of_year = DATE_FORMAT( date, "%m"),
quarter_of_year = QUARTER(date),
year = DATE_FORMAT( date, "%Y" );
-- Remove as Tabelas Temporarias
DROP TABLE numbers_small;
DROP TABLE numbers;
| true
|
7c186f885b8b53cd624b267ef3aa9337d79b693f
|
SQL
|
SprintatGH/store
|
/prod/database/querys/cliente/ca_cliente_contacto.sql
|
UTF-8
| 807
| 2.953125
| 3
|
[
"MIT"
] |
permissive
|
-- Creador: Juan pablo Basualdo
-- Fecha: 19-07-2020
-- version: cliente
-- Menu: administrador
-- Estructura de tabla para la tabla `ca_cliente_ contacto`
--
CREATE TABLE `ca_cliente_contacto` (
`id` bigint(20) UNSIGNED NOT NULL,
`estado` int(1) NOT NULL,
`nombre` 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;
--
-- Indices de la tabla `ca_cliente_ contacto`
--
ALTER TABLE `ca_cliente_ contacto`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT de la tabla `ca_cliente_ contacto`
--
ALTER TABLE `ca_cliente_ contacto`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
| true
|
9906195a92f209ff717e571ad02299ccad857c76
|
SQL
|
mh-malekpour/DB-Course
|
/final_project/warehouse.sql
|
UTF-8
| 8,119
| 3.328125
| 3
|
[] |
no_license
|
/* ___________________________________________ Create tables ___________________________________________ */
CREATE TABLE "translator" (
"translator_id" integer NOT NULL UNIQUE,
"first_name" varchar(35) NOT NULL,
"last_name" varchar(35) NOT NULL,
"birth_date" DATE NOT NULL,
"created_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "translator_pk" PRIMARY KEY ("translator_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "translator_book" (
"id" integer NOT NULL UNIQUE,
"translator_id" integer NOT NULL,
"book_id" integer NOT NULL,
"created_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "translator_book_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "book_item" (
"item_id" integer NOT NULL UNIQUE,
"is_borrow" bool NOT NULL,
"created_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "book_item_pk" PRIMARY KEY ("item_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "borrow_status" (
"status_id" integer NOT NULL UNIQUE,
"item_id" integer NOT NULL,
"customer_id" integer NOT NULL,
"borrowed_date" TIMESTAMP NOT NULL,
"due_date" TIMESTAMP NOT NULL,
"is_overdue" bool NOT NULL,
"return_date" TIMESTAMP,
"created_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "borrow_status_pk" PRIMARY KEY ("status_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "customer" (
"customer_id" integer NOT NULL UNIQUE,
"first_name" varchar(35) NOT NULL,
"last_name" varchar(35) NOT NULL,
"birth_date" DATE NOT NULL,
"registration_date" TIMESTAMP NOT NULL,
"email" varchar(255) NOT NULL,
"phone_number" varchar(15) NOT NULL,
"address" TEXT NOT NULL,
"created_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "customer_pk" PRIMARY KEY ("customer_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "genre" (
"genre_id" integer NOT NULL UNIQUE,
"name" varchar(25) NOT NULL,
"created_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "genre_pk" PRIMARY KEY ("genre_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "genre_book" (
"id" integer NOT NULL UNIQUE,
"genre_id" integer NOT NULL,
"book_id" integer NOT NULL,
"created_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "genre_book_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "book" (
"book_id" integer NOT NULL UNIQUE,
"ISBN" bigint NOT NULL UNIQUE,
"version" integer NOT NULL,
"title" varchar(255) NOT NULL,
"overview" TEXT,
"publisher" varchar(255) NOT NULL,
"publication_date" TIMESTAMP NOT NULL,
"language" varchar(25) NOT NULL,
"created_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "book_pk" PRIMARY KEY ("book_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "author_book" (
"id" integer NOT NULL UNIQUE,
"author_id" integer NOT NULL,
"book_id" integer NOT NULL,
"created_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "author_book_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "author" (
"author_id" integer NOT NULL UNIQUE,
"first_name" varchar(35) NOT NULL,
"last_name" varchar(35) NOT NULL,
"birth_date" DATE NOT NULL,
"biography" TEXT,
"created_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "author_pk" PRIMARY KEY ("author_id")
) WITH (
OIDS=FALSE
);
/* ___________________________________________ Add foreign keys ___________________________________________ */
ALTER TABLE "translator_book" ADD CONSTRAINT "translator_book_fk0" FOREIGN KEY ("translator_id") REFERENCES "translator"("translator_id") ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE "translator_book" ADD CONSTRAINT "translator_book_fk1" FOREIGN KEY ("book_id") REFERENCES "book"("book_id") ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE "book_item" ADD CONSTRAINT "book_item_fk0" FOREIGN KEY ("item_id") REFERENCES "book"("book_id") ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE "borrow_status" ADD CONSTRAINT "borrow_status_fk0" FOREIGN KEY ("item_id") REFERENCES "book_item"("item_id") ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE "borrow_status" ADD CONSTRAINT "borrow_status_fk1" FOREIGN KEY ("customer_id") REFERENCES "customer"("customer_id") ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE "genre_book" ADD CONSTRAINT "genre_book_fk0" FOREIGN KEY ("genre_id") REFERENCES "genre"("genre_id") ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE "genre_book" ADD CONSTRAINT "genre_book_fk1" FOREIGN KEY ("book_id") REFERENCES "book"("book_id") ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE "author_book" ADD CONSTRAINT "author_book_fk0" FOREIGN KEY ("author_id") REFERENCES "author"("author_id") ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE "author_book" ADD CONSTRAINT "author_book_fk1" FOREIGN KEY ("book_id") REFERENCES "book"("book_id") ON UPDATE NO ACTION ON DELETE NO ACTION;
/* ___________________________________________ Create history tables ___________________________________________ */
CREATE TABLE "book_history" (
"book_id" integer NOT NULL UNIQUE,
"ISBN" bigint NOT NULL UNIQUE,
"version" integer NOT NULL,
"title" varchar(255) NOT NULL,
"overview" TEXT,
"publisher" varchar(255) NOT NULL,
"publication_date" TIMESTAMP NOT NULL,
"language" varchar(25) NOT NULL,
"event" varchar(6) NOT NULL,
"occurred_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "book_history_pk" PRIMARY KEY ("book_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "author_book_history" (
"id" integer NOT NULL UNIQUE,
"author_id" integer NOT NULL,
"book_id" integer NOT NULL,
"event" varchar(6) NOT NULL,
"occurred_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "author_book_history_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "translator_book_history" (
"id" integer NOT NULL UNIQUE,
"translator_id" integer NOT NULL,
"book_id" integer NOT NULL,
"event" varchar(6) NOT NULL,
"occurred_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "translator_book_history_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "book_item_history" (
"item_id" integer NOT NULL UNIQUE,
"is_borrow" bool NOT NULL,
"created_at" TIMESTAMP NOT NULL,
"event" varchar(6) NOT NULL,
"occurred_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "book_item_history_pk" PRIMARY KEY ("item_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "genre_book_history" (
"id" integer NOT NULL UNIQUE,
"genre_id" integer NOT NULL,
"book_id" integer NOT NULL,
"event" varchar(6) NOT NULL,
"occurred_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "genre_book_history_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "borrow_status_history" (
"status_id" integer NOT NULL UNIQUE,
"item_id" integer NOT NULL,
"customer_id" integer NOT NULL,
"borrowed_date" TIMESTAMP NOT NULL,
"due_date" TIMESTAMP NOT NULL,
"is_overdue" bool NOT NULL,
"return_date" TIMESTAMP,
"event" varchar(6) NOT NULL,
"occurred_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "borrow_status_history_pk" PRIMARY KEY ("status_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "translator_history" (
"translator_id" integer NOT NULL UNIQUE,
"first_name" varchar(35) NOT NULL,
"last_name" varchar(35) NOT NULL,
"birth_date" DATE NOT NULL,
"event" varchar(6) NOT NULL,
"occurred_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "translator_history_pk" PRIMARY KEY ("translator_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "author_history" (
"author_id" integer NOT NULL UNIQUE,
"first_name" varchar(35) NOT NULL,
"last_name" varchar(35) NOT NULL,
"birth_date" DATE NOT NULL,
"biography" TEXT,
"event" varchar(6) NOT NULL,
"occurred_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "author_history_pk" PRIMARY KEY ("author_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "customer_history" (
"customer_id" integer NOT NULL UNIQUE,
"first_name" varchar(35) NOT NULL,
"last_name" varchar(35) NOT NULL,
"birth_date" DATE NOT NULL,
"registration_date" TIMESTAMP NOT NULL,
"email" varchar(255) NOT NULL,
"phone_number" varchar(15) NOT NULL,
"address" TEXT NOT NULL,
"event" varchar(6) NOT NULL,
"occurred_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "customer_history_pk" PRIMARY KEY ("customer_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "genre_history" (
"genre_id" integer NOT NULL UNIQUE,
"name" varchar(25) NOT NULL,
"event" varchar(6) NOT NULL,
"occurred_at" TIMESTAMP DEFAULT NOW(),
CONSTRAINT "genre_history_pk" PRIMARY KEY ("genre_id")
) WITH (
OIDS=FALSE
);
| true
|
25f538fa3b50213326a588797bdae2fd2f8516c3
|
SQL
|
znjRoLS/pia
|
/dbdump/pia_conference.sql
|
UTF-8
| 3,040
| 3.109375
| 3
|
[] |
no_license
|
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: localhost Database: pia
-- ------------------------------------------------------
-- Server version 5.7.17-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `conference`
--
DROP TABLE IF EXISTS `conference`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `conference` (
`conference_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`place` varchar(255) DEFAULT NULL,
`start_date` date DEFAULT NULL,
`end_date` date DEFAULT NULL,
`location_id` int(11) NOT NULL,
`start_time` time DEFAULT NULL,
`end_time` time DEFAULT NULL,
PRIMARY KEY (`conference_id`),
KEY `FK_lxi0wc9ymqd75skv8k4dwgjjj` (`location_id`),
CONSTRAINT `FK_lxi0wc9ymqd75skv8k4dwgjjj` FOREIGN KEY (`location_id`) REFERENCES `location` (`location_id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `conference`
--
LOCK TABLES `conference` WRITE;
/*!40000 ALTER TABLE `conference` DISABLE KEYS */;
INSERT INTO `conference` VALUES (6,'dsfdsf','sdf','2017-06-13','2017-06-23',1,NULL,NULL),(7,'sdf','sdf','2017-06-06','2017-06-29',1,NULL,NULL),(8,'dsfdsf','sdf','2017-06-13','2017-06-23',1,'03:00:00','13:00:00'),(9,'dsfdsf','sdf','2017-06-13','2017-06-23',1,NULL,NULL),(10,'dsfdsf','sdf','2017-06-13','2017-06-23',1,NULL,NULL),(11,'dsfdsf','sdf','2017-06-13','2017-06-23',1,NULL,NULL),(12,'TELFOR 2018','beograd','2017-06-01','2017-06-22',1,NULL,NULL),(13,'TELFOR 2018','df','2017-06-06','2017-06-14',1,NULL,NULL),(14,'herhe','herhe','2017-06-29','2017-06-30',1,NULL,NULL),(15,'TELFOR 2018','Beograd','2018-11-20','2018-11-22',1,NULL,NULL),(16,'haha konferencija','zajecar','2017-06-30','2018-12-07',1,NULL,NULL),(17,'mladen','canovic','2017-06-30','2019-01-10',1,NULL,NULL);
/*!40000 ALTER TABLE `conference` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-06-27 17:42:51
| true
|
ef458d7d25261964c90b11d0cda6fe5e8b83e5f2
|
SQL
|
SebearChen/Capcom.shopping.ssm
|
/WebContent/capcom.shopping.ssm.sql
|
UTF-8
| 3,550
| 3.109375
| 3
|
[] |
no_license
|
-- --------------------------------------------------------
-- 主机: localhost
-- 服务器版本: 5.7.24 - MySQL Community Server (GPL)
-- 服务器OS: Win64
-- HeidiSQL 版本: 10.2.0.5599
-- --------------------------------------------------------
/*!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' */;
-- Dumping database structure for capcom.shopping.ssm
CREATE DATABASE IF NOT EXISTS `capcom.shopping.ssm` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `capcom.shopping.ssm`;
-- Dumping structure for table capcom.shopping.ssm.commodity
CREATE TABLE IF NOT EXISTS `commodity` (
`commodityid` int(11) NOT NULL AUTO_INCREMENT,
`commodityname` varchar(255) DEFAULT NULL,
`commodityprice` bigint(20) DEFAULT NULL,
`pubdate` date DEFAULT NULL,
`commoditytype` varchar(20) DEFAULT NULL,
`commodityintro` varchar(255) DEFAULT NULL,
`commodityphoto` varchar(150) DEFAULT NULL,
PRIMARY KEY (`commodityid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
-- Dumping data for table capcom.shopping.ssm.commodity: ~6 rows (大约)
/*!40000 ALTER TABLE `commodity` DISABLE KEYS */;
INSERT INTO `commodity` (`commodityid`, `commodityname`, `commodityprice`, `pubdate`, `commoditytype`, `commodityintro`, `commodityphoto`) VALUES
(1, '哥美斯', 99901, '2021-05-01', '普通怪兽', '在东海弹丸道路第三工地的地底出现,并与原始怪鸟·利特拉展开决斗,但最终被其击败。', 'monster1.png'),
(2, '宇宙忍者', 99902, '2021-05-05', '宇宙人', '宇宙忍者巴尔坦星人,出自于《初代奥特曼》并且是《奥特曼》系列作品中第一个登场的宇宙人,拥有蝉一样的眼睛,双手有龙虾一样的双钳,拥有极度发达的高科技。巴尔坦的名字来源于巴尔干(Balkan),即巴尔干半岛。', 'monster2.png'),
(3, '分身宇宙人', 99903, '2021-05-08', '宇宙人', '曾是嘎次星的一种鸟类,直到自己的大脑高度发达而进化成类人型,同时也失去了飞行能力。曾利用大力怪兽 阿龙分析赛文的战斗数据并轻松打败了赛文。', 'monster3.png'),
(4, '达兰比尔', 99904, '2021-05-08', '斯菲亚合成兽', '由宇宙球体斯菲亚制造出来的首只斯菲亚合成兽。是斯菲亚与火星岩石融合形成的怪兽,外表类似蜘蛛。摧毁了人类在火星上辛辛苦苦建立的基地,全身有亚空间防护罩保护,口中发出破坏光线。', 'monster4.png'),
(5, '奈奥达兰比尔', 99905, '2021-05-09', '斯菲亚合成兽', '是达兰比尔的残骸通过斯菲亚球体再次集合并强化变成的怪兽,也是戴拿的初战对手,最后被戴拿的索尔捷特光线打败。', 'monster5.png'),
(6, '格兰雷恩', 99906, '2021-05-10', '斯菲亚合成兽', '降落在地球的斯菲亚为了袭击TPC热能源基地以及TPC本部,依靠火山熔岩的能量制造出的斯菲亚合成兽,在斯菲亚将SUPER GUTS引出地球后开始活动。', 'monster6.png');
/*!40000 ALTER TABLE `commodity` ENABLE KEYS */;
/*!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
|
5c6cf0a5bd8d27e23bf7e2c98b7edfdae07b3792
|
SQL
|
jamesfulford/tutoring-database-scripts
|
/initialization/4reports/subjectList/whatDoTutorsTutor.sql
|
UTF-8
| 601
| 3.171875
| 3
|
[
"MIT"
] |
permissive
|
clear screen
clear columns
clear break
set linesize 66
set pagesize 50000
set underline =
spool "whatDoOutTutorsTutor.txt"
TTITLE LEFT 'What Do Our Tutors Tutor' RIGHT 'page' SQL.PNO SKIP 2-
COLUMN CONTACT_ID HEADING 'ID'
COL FIRSTNAME HEADING 'First|Name' FORMAT A12
COL LASTNAME HEADING 'Last|Name' FORMAT A12
COL SUBJECT HEADING 'Meeting|Location' FORMAT A40
BREAK ON LASTNAME SKIP PAGE ON FIRSTNAME SKIP 2
SELECT FIRSTNAME, LASTNAME, SUBJECT FROM subjectList NATURAL JOIN (rs_contact_subject NATURAL JOIN (contacts NATURAL JOIN tutors)) ORDER BY LASTNAME;
spool off
| true
|
1a9f3c9be55ab99d40f2f1fd5fe20ed44f97b80a
|
SQL
|
ikioresko/job4j_design
|
/scripts/inner_students.sql
|
UTF-8
| 1,133
| 3.828125
| 4
|
[] |
no_license
|
create table course(
id serial primary key,
num int
);
create table students(
id serial primary key,
name varchar(100),
age int,
course_id int references course(id)
);
insert into course(num) values ('1');
insert into course(num) values ('2');
insert into course(num) values ('3');
insert into course(num) values ('4');
insert into course(num) values ('5');
insert into students(name, age, course_id) values('Tom', 19, 1);
insert into students(name, age, course_id) values('Ron', 20, 2);
insert into students(name, age, course_id) values('Dan', 23, 5);
insert into students(name, age, course_id) values ('Tim', 17, 1);
insert into students(name, age, course_id) values ('Sam', 21, 3);
insert into students(name) values ('Jane');
select * from students join course c on students.course_id = c.id;
select s.name, c.num from students as s join course as c on s.course_id = c.num;
select s.name as Имя, c.num as Курс from students as s join course as c on s.course_id = c.num;
select s.name as Имя, s.age as Возраст, c.num as Курс from students as s join course as c on s.course_id = c.num;
| true
|
aa238215db324617fa8c02d32ad433b38d73874d
|
SQL
|
vinitshahdeo/team-9
|
/care.sql
|
UTF-8
| 4,295
| 2.8125
| 3
|
[
"LicenseRef-scancode-warranty-disclaimer"
] |
no_license
|
-- MySQL dump 10.13 Distrib 5.7.22, for Linux (x86_64)
--
-- Host: localhost Database: careworks
-- ------------------------------------------------------
-- Server version 5.7.22-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `Activity`
--
DROP TABLE IF EXISTS `Activity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Activity` (
`sid` int(11) NOT NULL,
`Rennovation` bit(1) DEFAULT NULL,
`Flooring` bit(1) DEFAULT NULL,
`Plastering` bit(1) DEFAULT NULL,
`Waterproofing` bit(1) DEFAULT NULL,
`Electrification` bit(1) DEFAULT NULL,
`Externalpainting` bit(1) DEFAULT NULL,
PRIMARY KEY (`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `Activity`
--
LOCK TABLES `Activity` WRITE;
/*!40000 ALTER TABLE `Activity` DISABLE KEYS */;
/*!40000 ALTER TABLE `Activity` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `Classroom`
--
DROP TABLE IF EXISTS `Classroom`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Classroom` (
`Sid` int(11) NOT NULL,
`Numberofcomputers` int(11) DEFAULT NULL,
`Library` bit(1) DEFAULT NULL,
`Sciencelab` bit(1) DEFAULT NULL,
`Drinkingwater` bit(1) DEFAULT NULL,
`Toilet` bit(1) DEFAULT NULL,
`Handwash` bit(1) DEFAULT NULL,
PRIMARY KEY (`Sid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `Classroom`
--
LOCK TABLES `Classroom` WRITE;
/*!40000 ALTER TABLE `Classroom` DISABLE KEYS */;
/*!40000 ALTER TABLE `Classroom` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `Resourceallocation`
--
DROP TABLE IF EXISTS `Resourceallocation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Resourceallocation` (
`Sid` int(11) NOT NULL,
`Activity` varchar(20) DEFAULT NULL,
`money` int(11) DEFAULT NULL,
`Time` varchar(10) DEFAULT NULL,
`Workprogress` varchar(10) DEFAULT NULL,
PRIMARY KEY (`Sid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `Resourceallocation`
--
LOCK TABLES `Resourceallocation` WRITE;
/*!40000 ALTER TABLE `Resourceallocation` DISABLE KEYS */;
/*!40000 ALTER TABLE `Resourceallocation` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `User`
--
DROP TABLE IF EXISTS `User`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `User` (
`Uid` int(11) NOT NULL AUTO_INCREMENT,
`Phone` varchar(10) DEFAULT NULL,
`Email` varchar(50) DEFAULT NULL,
`Password` varchar(20) DEFAULT NULL,
`AorU` varchar(5) DEFAULT NULL,
`Name` varchar(20) DEFAULT NULL,
PRIMARY KEY (`Uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `User`
--
LOCK TABLES `User` WRITE;
/*!40000 ALTER TABLE `User` DISABLE KEYS */;
/*!40000 ALTER TABLE `User` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-07-07 15:31:08
| true
|
37a195717691762d2f26b7678c3c322e4d25d690
|
SQL
|
tran0202/thuviendulieu
|
/scripts/AFC Asian Cup/aac_kuwait1980.sql
|
UTF-8
| 6,694
| 3.453125
| 3
|
[] |
no_license
|
# Insert new tournament
# Replace all the tournament_id
# 1980 AFC Asian Cup Kuwait
INSERT INTO tournament (name, start_date, end_date, tournament_type_id, logo_filename, golden_goal_rule, points_for_win)
VALUES ('1980 AFC Asian Cup Kuwait', '1980-09-15', '1980-09-30', 15, 'AFC.png', null, 2);
INSERT INTO group_tournament (tournament_id, group_id, group_order, parent_group_id, parent_group_order)
VALUES (194, 41, 1, 39, 1),
(194, 44, 1, 40, 2),
(194, 45, 2, 40, 2),
(194, 46, 3, 40, 2);
SELECT * FROM `team` WHERE team_type_id = 1 ORDER BY name;
# INSERT INTO nation (name, flag_filename, parent_nation_id, nation_type_id, code)
# VALUES ('Upper Volta', 'Upper_Volta.png', 32, 6, 'UPV');
#
INSERT INTO team (name, team_type_id, nation_id, parent_team_id)
VALUES ('Bangladesh', 1, 17, null);
INSERT INTO team_tournament (team_id, tournament_id, group_id, group_order)
VALUES (1062, 194, 1, 1),
(210, 194, 1, 2),
(1020, 194, 1, 3),
(219, 194, 1, 4),
(1027, 194, 1, 5),
(16, 194, 2, 1),
(237, 194, 2, 2),
(1023, 194, 2, 3),
(1011, 194, 2, 4),
(229, 194, 2, 5);
INSERT INTO `match` (home_team_id, home_team_score, away_team_id, away_team_score, tournament_id, match_date, match_time, match_order, round_id, stage_id)
VALUES (229, 1, 237, 1, 194, '1980-09-15', '190000', 1, 41, 39),
(210, 3, 1027, 2, 194, '1980-09-16', '210000', 2, 41, 39),
(16, 1, 1023, 1, 194, '1980-09-16', '183000', 3, 41, 39),
(1062, 0, 1020, 0, 194, '1980-09-17', '210000', 4, 41, 39),
(1011, 2, 229, 1, 194, '1980-09-17', '210000', 5, 41, 39),
(210, 2, 219, 1, 194, '1980-09-18', '190000', 6, 41, 39),
(237, 3, 1023, 1, 194, '1980-09-18', '210000', 7, 41, 39),
(1027, 0, 1020, 1, 194, '1980-09-19', '190000', 8, 41, 39),
(1011, 0, 16, 2, 194, '1980-09-19', '183000', 9, 41, 39),
(219, 2, 1062, 2, 194, '1980-09-20', '210000', 10, 41, 39),
(1023, 2, 229, 0, 194, '1980-09-20', '210000', 11, 41, 39),
(237, 0, 16, 3, 194, '1980-09-21', '163000', 12, 41, 39),
(1027, 0, 1062, 7, 194, '1980-09-22', '190000', 13, 41, 39),
(1020, 1, 219, 0, 194, '1980-09-23', '210000', 14, 41, 39),
(1023, 1, 1011, 1, 194, '1980-09-23', '190000', 15, 41, 39),
(1062, 3, 210, 2, 194, '1980-09-24', '210000', 16, 41, 39),
(16, 4, 229, 1, 194, '1980-09-24', '183000', 17, 41, 39),
(219, 6, 1027, 0, 194, '1980-09-25', '190000', 18, 41, 39),
(237, 4, 1011, 0, 194, '1980-09-25', '210000', 19, 41, 39),
(210, 2, 1020, 1, 194, '1980-09-26', '190000', 20, 41, 39);
INSERT INTO `match` (home_team_id, home_team_score, home_team_extra_time_score, home_team_penalty_score,
away_team_id, away_team_score, away_team_extra_time_score, away_team_penalty_score,
tournament_id, match_date, match_time, match_order, round_id, stage_id, bracket_order)
VALUES (1062, 1, null, null, 237, 2, null, null, 194, '1980-09-28', '200000', 21, 44, 40, 21),
(16, 2, null, null, 210, 1, null, null, 194, '1980-09-28', '193000', 22, 44, 40, 22),
(1062, 3, null, null, 210, 0, null, null, 194, '1980-09-29', '180000', 23, 45, 40, 24),
(237, 3, null, null, 16, 0, null, null, 194, '1980-09-30', '183000', 24, 46, 40, 23);
CREATE TABLE IF NOT EXISTS tournament (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL UNIQUE,
start_date DATE,
end_date DATE,
logo_filename VARCHAR(255),
tournament_type_id INT,
parent_tournament_id INT,
points_for_win TINYINT UNSIGNED,
golden_goal_rule TINYINT UNSIGNED,
FOREIGN KEY (tournament_type_id) REFERENCES tournament_type(id),
FOREIGN KEY (parent_tournament_id) REFERENCES tournament(id)
);
CREATE TABLE IF NOT EXISTS team (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL UNIQUE,
team_type_id INT,
nation_id INT,
FOREIGN KEY (team_type_id) REFERENCES team_type(id),
FOREIGN KEY (nation_id) REFERENCES nation(id),
FOREIGN KEY (parent_team_id) REFERENCES team(id),
code VARCHAR(255),
short_name VARCHAR(255),
official_name VARCHAR(255)
);
CREATE TABLE IF NOT EXISTS team_tournament (
id INT AUTO_INCREMENT PRIMARY KEY,
team_id INT NOT NULL,
tournament_id INT NOT NULL,
group_id INT,
group_order TINYINT UNSIGNED,
parent_group_id INT,
parent_group_order TINYINT UNSIGNED,
seed TINYINT UNSIGNED,
FOREIGN KEY (team_id) REFERENCES team(id),
FOREIGN KEY (tournament_id) REFERENCES tournament(id),
FOREIGN KEY (group_id) REFERENCES `group`(id),
FOREIGN KEY (parent_group_id) REFERENCES `group`(id)
);
CREATE TABLE IF NOT EXISTS `match` (
id INT AUTO_INCREMENT PRIMARY KEY,
home_team_id INT,
home_team_score TINYINT UNSIGNED,
away_team_id INT,
away_team_score TINYINT UNSIGNED,
home_team_first_leg_score TINYINT UNSIGNED,
away_team_first_leg_score TINYINT UNSIGNED,
tournament_id INT NOT NULL,
match_date DATE,
match_time TIME,
match_order SMALLINT UNSIGNED,
bracket_order TINYINT UNSIGNED,
waiting_home_team VARCHAR(255),
waiting_away_team VARCHAR(255),
home_team_extra_time_score TINYINT UNSIGNED,
away_team_extra_time_score TINYINT UNSIGNED,
home_team_penalty_score TINYINT UNSIGNED,
away_team_penalty_score TINYINT UNSIGNED,
round_id INT,
round_order TINYINT UNSIGNED,
stage_id INT,
stage_order TINYINT UNSIGNED,
group_id INT,
home_retired TINYINT UNSIGNED,
away_retired TINYINT UNSIGNED,
home_set1_score TINYINT UNSIGNED,
away_set1_score TINYINT UNSIGNED,
home_set1_tiebreak TINYINT UNSIGNED,
away_set1_tiebreak TINYINT UNSIGNED,
home_set2_score TINYINT UNSIGNED,
away_set2_score TINYINT UNSIGNED,
home_set2_tiebreak TINYINT UNSIGNED,
away_set2_tiebreak TINYINT UNSIGNED,
home_set3_score TINYINT UNSIGNED,
away_set3_score TINYINT UNSIGNED,
home_set3_tiebreak TINYINT UNSIGNED,
away_set3_tiebreak TINYINT UNSIGNED,
home_set4_score TINYINT UNSIGNED,
away_set4_score TINYINT UNSIGNED,
home_set4_tiebreak TINYINT UNSIGNED,
away_set4_tiebreak TINYINT UNSIGNED,
home_set5_score TINYINT UNSIGNED,
away_set5_score TINYINT UNSIGNED,
home_set5_tiebreak TINYINT UNSIGNED,
away_set5_tiebreak TINYINT UNSIGNED,
FOREIGN KEY (home_team_id) REFERENCES team(id),
FOREIGN KEY (away_team_id) REFERENCES team(id),
FOREIGN KEY (tournament_id) REFERENCES tournament(id),
FOREIGN KEY (round_id) REFERENCES `group`(id),
FOREIGN KEY (stage_id) REFERENCES `group`(id),
FOREIGN KEY (group_id) REFERENCES `group`(id)
);
CREATE TABLE IF NOT EXISTS group_tournament (
id INT AUTO_INCREMENT PRIMARY KEY,
tournament_id INT NOT NULL,
group_id INT,
group_order TINYINT UNSIGNED,
parent_group_id INT,
parent_group_order TINYINT UNSIGNED,
FOREIGN KEY (tournament_id) REFERENCES tournament(id),
FOREIGN KEY (group_id) REFERENCES `group`(id),
FOREIGN KEY (parent_group_id) REFERENCES `group`(id)
);
| true
|
32aa42d2bbda4ba4a8837e41f43e18004ff2793e
|
SQL
|
MadLluks/wandee
|
/config/wandee.sql
|
UTF-8
| 5,016
| 2.984375
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Lun 19 Août 2013 à 20:28
-- Version du serveur: 5.5.24-log
-- Version de PHP: 5.4.3
--
-- Base de données: wandee
--
-- --------------------------------------------------------
SET time_zone = "+02:00";
--
-- Structure de la table plat
--
DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS reservedmeal;
DROP TABLE IF EXISTS plat;
DROP TABLE IF EXISTS reservation;
DROP TABLE IF EXISTS goldbook;
DROP TABLE IF EXISTS reservationsurplace;
CREATE TABLE IF NOT EXISTS plat (
id int NOT NULL AUTO_INCREMENT,
name varchar(50) NOT NULL,
type varchar(10) NOT NULL,
description varchar(100) NOT NULL,
price decimal(10,2) NOT NULL,
piment int(2) NOT NULL,
imageLink varchar(100) NOT NULL,
PRIMARY KEY (id)
);
--
-- Contenu de la table plat
--
INSERT INTO plat (name, type, description, price, piment, imageLink) VALUES
('Brochettes de poulet', 'entree', '', '1.00', 0, 'photo1.jpg'),
('Rouleau de printemps', 'entree', '', '2.00', 0, 'photo1.jpg'),
('Popia aux légumes', 'entree', '', '0.60', 0, 'IMG_1446.jpg'),
('Popia au porc', 'entree', '', '1.05', 0, 'IMG_1446.jpg'),
('Popia au poulet', 'entree', '', '1.05', 0, 'IMG_1446.jpg'),
('Popia au boeuf', 'entree', '', '1.25', 0, 'IMG_1446.jpg'),
('Popia aux crevettes', 'entree', '', '1.25', 0, 'IMG_1446.jpg'),
('Samoussa au boeuf', 'entree', '4 pièces', '1.10', 0, 'IMG_1437.jpg'),
('Samoussa au poulet', 'entree', '4 pièces', '1.10', 0, 'IMG_1437.jpg'),
('Pince de crabe', 'entree', '2 pièces', '1.50', 0, 'IMG_1441.jpg'),
('Surimi de Saint Jacques', 'entree', '', '1.50', 0, 'IMG_1443.jpg'),
('Beignet de crevettes', 'entree', '4 pièces', '3.10', 0, 'IMG_1439.jpg'),
('Salade', 'entree', '', '4.00', 0, 'photo1.jpg'),
('Yam aux crevettes et seiches', 'entree', '', '6.60', 0, 'photo1.jpg'),
('Bô Bun', 'entree', '', '6.90', 0, 'IMG_1471.jpg'),
('Poulet vapeur au curry rouge', 'plat', '', '4.80', 0, 'photo1.jpg'),
('Cuisse de poulet à la citronnelle', 'plat', '', '5.00', 0, 'IMG_1461.jpg'),
('Canard laqué sauce barbecue', 'plat', '', '5.50', 0, 'IMG_1458.jpg'),
('Aubergine farcie', 'plat', '', '5.50', 0, 'photo1.jpg'),
('Sauté de légumes', 'plat', '', '5.00', 0, 'photo1.jpg'),
('Sauté de viande', 'plat', '', '5.60', 0, 'IMG_1453.jpg'),
('Sauté de crevettes', 'plat', '', '6.90', 0, 'IMG_1449.jpg'),
('Vermicelles sauté au porc', 'plat2', '', '5.50', 0, 'photo1.jpg'),
('Vermicelles sauté au poulet', 'plat2', '', '5.50', 0, 'photo1.jpg'),
('Riz sauté au poulet à la Thaï', 'plat2', '', '5.50', 0, 'IMG_1430.jpg'),
('Pad Thaï', 'plat2', '', '8.90', 0, 'pad_thai.jpg'),
('Riz nature', 'accompagnement', '', '2.00', 0, 'photo1.jpg'),
('Riz cantonais', 'accompagnement', '', '2.80', 0, 'photo1.jpg'),
('Nouilles sautées', 'accompagnement', '', '2.80', 0, 'photo1.jpg'),
('Gâteau', 'dessert', '', '1.30', 0, 'photo1.jpg'),
('Nouget dur', 'dessert', '', '1.30', 0, 'photo1.jpg'),
('Nouget mou', 'dessert', '', '1.50', 0, 'photo1.jpg'),
('Gingembre confit', 'dessert', '', '2.80', 0, 'photo1.jpg'),
('Fruit frais', 'dessert', '', '3.00', 0, 'photo1.jpg'),
('Coca cola (33cl)', 'boisson', '', '1.00', 0, 'photo1.jpg'),
('Orangina (33cl)', 'boisson', '', '1.00', 0, 'photo1.jpg'),
('Jus d''orange (33cl)', 'boisson', '', '1.00', 0, 'photo1.jpg');
-- --------------------------------------------------------
CREATE TABLE IF NOT EXISTS reservation (
id int NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL,
surname varchar(100) NOT NULL,
email varchar(100),
number int(10) NOT NULL,
date date NOT NULL,
moment varchar(10) NOT NULL,
PRIMARY KEY (id)
);
--
-- Structure de la table reservation
--
CREATE TABLE IF NOT EXISTS reservedmeal (
idReservation int NOT NULL,
idPlat int NOT NULL,
quantity int NOT NULL,
PRIMARY KEY (idReservation, idPlat)
);
-- --------------------------------------------------------
--
-- Structure de la table user
--
CREATE TABLE IF NOT EXISTS user (
id int NOT NULL AUTO_INCREMENT,
login varchar(20) NOT NULL,
password varchar(50) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS goldbook (
id int NOT NULL AUTO_INCREMENT,
message varchar(300) NOT NULL,
note int(1) NOT NULL,
date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS reservationsurplace (
id int NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL,
number int(10) NOT NULL,
date date NOT NULL,
moment varchar(10) NOT NULL,
nb int(2) NOT NULL,
PRIMARY KEY (id)
);
alter table reservedmeal add constraint FK_idReservation_id foreign key (idReservation)
references reservation (id) on delete restrict on update restrict;
alter table reservedmeal add constraint FK_idPlat_id foreign key (idPlat)
references plat (id) on delete restrict on update restrict;
| true
|
6b2f8d7016b4144da53145e96b675cbb3d1f7e4c
|
SQL
|
jgarzonext/plsql-testing
|
/script_plsql/bd_iaxis/script/tables/MIG_GARANSEG.sql
|
ISO-8859-1
| 4,356
| 2.9375
| 3
|
[] |
no_license
|
--------------------------------------------------------
-- DDL for Table MIG_GARANSEG
--------------------------------------------------------
CREATE TABLE "AXIS"."MIG_GARANSEG"
( "NCARGA" NUMBER,
"CESTMIG" NUMBER,
"MIG_PK" VARCHAR2(50 BYTE),
"MIG_FK" VARCHAR2(50 BYTE),
"CGARANT" NUMBER(4,0),
"NRIESGO" NUMBER(6,0),
"NMOVIMI" NUMBER(4,0),
"SSEGURO" NUMBER,
"FINIEFE" DATE,
"ICAPITAL" NUMBER,
"PRECARG" NUMBER(6,2),
"IEXTRAP" NUMBER(19,12),
"IPRIANU" NUMBER,
"FFINEFE" DATE,
"IRECARG" NUMBER,
"IPRITAR" NUMBER,
"FALTA" DATE,
"CREVALI" NUMBER(2,0),
"PREVALI" NUMBER(8,5),
"IREVALI" NUMBER,
"NMOVIMA" NUMBER(4,0),
"PDTOCOM" NUMBER(6,2),
"IDTOCOM" NUMBER,
"ITOTANU" NUMBER,
"PDTOTEC" NUMBER(6,2),
"PRECCOM" NUMBER(6,2),
"IDTOTEC" NUMBER,
"IRECCOM" NUMBER,
"FINIVIG" DATE,
"FFINVIG" DATE,
"CCOBPRIMA" NUMBER,
"IPRIDEV" NUMBER
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "AXIS" ;
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."NCARGA" IS 'Nmero de carga';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."CESTMIG" IS 'Estado del registro valor inicial 1';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."MIG_PK" IS 'Clave nica de MIG_GARANSEG';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."MIG_FK" IS 'Clave externa para la pliza (MIG_SEGUROS)';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."CGARANT" IS 'Cdigo Garantia';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."NRIESGO" IS 'Nmero de riesgo';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."NMOVIMI" IS 'Nmero de movimiento';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."SSEGURO" IS 'Nmero de secuencia de seguro, valor=0, lo calcula el proceso de migracin';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."FINIEFE" IS 'fecha inicio de efecto';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."ICAPITAL" IS 'Importe garanta';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."PRECARG" IS 'Porcentaje de recargo';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."IEXTRAP" IS 'Extraprima';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."IPRIANU" IS 'Importe prima manual';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."FFINEFE" IS 'Fecha fin de efecto';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."IRECARG" IS 'Importe del recargo';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."IPRITAR" IS 'Importe tarifa';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."FALTA" IS 'Fecha en que se dio de alta la Garanta';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."CREVALI" IS 'Cdigo Revalorizacin VF 62';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."PREVALI" IS 'Porcentaje de revalorizacion';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."IREVALI" IS 'Importe de revalorizacion';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."NMOVIMA" IS 'Nmero de movimiento de alta';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."PDTOCOM" IS 'Porcentaje descuento comercial';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."IDTOCOM" IS 'Importe descuento comercial';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."ITOTANU" IS 'Total prima anualizada';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."PDTOTEC" IS 'Porcentaje descuento tcnico';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."PRECCOM" IS 'Porcentaje recargo comercial';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."IDTOTEC" IS 'Importe descuento tcnico';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."IRECCOM" IS 'Importe recargo comercial';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."FINIVIG" IS 'Fecha inicio vigencia cobertura';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."FFINVIG" IS 'Fecha fin vigencia cobertura';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."CCOBPRIMA" IS 'Cobra Prima';
COMMENT ON COLUMN "AXIS"."MIG_GARANSEG"."IPRIDEV" IS 'Prima Devengada';
COMMENT ON TABLE "AXIS"."MIG_GARANSEG" IS 'Tabla Intermedia migracin Garantias';
GRANT UPDATE ON "AXIS"."MIG_GARANSEG" TO "R_AXIS";
GRANT SELECT ON "AXIS"."MIG_GARANSEG" TO "R_AXIS";
GRANT INSERT ON "AXIS"."MIG_GARANSEG" TO "R_AXIS";
GRANT DELETE ON "AXIS"."MIG_GARANSEG" TO "R_AXIS";
GRANT SELECT ON "AXIS"."MIG_GARANSEG" TO "CONF_DWH";
GRANT SELECT ON "AXIS"."MIG_GARANSEG" TO "PROGRAMADORESCSI";
| true
|
42cc8276784e77ab26feefc9a2fda4e20987368a
|
SQL
|
dulumary/java_web
|
/database/06_mysql_join/test/test03/test03.sql
|
UTF-8
| 5,147
| 3.296875
| 3
|
[] |
no_license
|
# 1. 테이블 생성
CREATE TABLE `company` (
`id` int NOT NULL AUTO_INCREMENT primary key,
`name` varchar(32) NOT NULL,
`business` varchar(16) NOT NULL,
`scale` varchar(8) NOT NULL,
`headcount`int NOT NULL,
`createdAt`timestamp DEFAULT CURRENT_TIMESTAMP,
`updatedAt`timestamp DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `recruit`(
`id` int NOT NULL AUTO_INCREMENT primary key,
`companyId`int NOT NULL,
`position`varchar(64) NOT NULL,
`responsibilities` varchar(128) NOT NULL,
`qualification` text NOT NULL,
`type`varchar(8) NOT NULL,
`region` varchar(16) NOT NULL,
`salary` int NOT NULL,
`deadline` timestamp,
`createdAt`timestamp DEFAULT CURRENT_TIMESTAMP,
`updatedAt`timestamp DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# 2. 데이터 저장
INSERT INTO `company` (`name`, `business`, `scale`, `headcount`, `createdAt`, `updatedAt`)
VALUES ('Cacao', '인터넷 포털', '대기업', 2848, now(), now()),
('Rine', '모바일 무선', '대기업', 1138, now(), now()),
('NG소프트', '컨텐츠 게임', '중견기업', 4430, now(), now()),
('쿠퐁', '쇼핑몰', '중견기업', 5350, now(), now()),
('Naber', '인터넷 포털', '대기업', 4048, now(), now()),
('우와한형제들', '소프트웨어 솔루션', '중견기업', 926, now(), now());
INSERT INTO `recruit`(`companyId`, `position`, `responsibilities`, `qualification`, `type`, `region`, `salary`, `deadline`, `createdAt`, `updatedAt`)
VALUES (1, '안드로이드 개발자', '메신저앱 개발', 'kotlin 경력 3년 이상', '정규직', '성남시 분당구', 7300, '2026-03-13', now(), now()),
(1, '안드로이드 개발자', '쇼핑 서비스 개발', 'kotlin 경력 3년 이상', '정규직', '성남시 분당구', 6300, '2026-04-04', now(), now()),
(1, '웹 back-end 개발자', '이모티콘 샵 API 서버 개발', 'spring 경력 3년 이상', '정규직', '성남시 분당구', 7000, '2026-03-28', now(), now()),
(2, '아이폰 앱 개발자', '메신져 앱 개발', 'RxSwift 개발 경력 3년 이상', '정규직', '성남시 분당구', 7600, '2026-04-01', now(), now()),
(2, '웹 back-end 개발자', 'Rine 포스팅 기능 API 개발', 'spring 개발 경력 3년 이상', '정규직', '성남시 분당구', 6600, '2026-03-29', now(), now()),
(3, '게임 개발자', '게임 개발', 'Unreal Engine 개발 5년 이상', '정규직', '성남시 분당구', 8400, '2026-04-20', now(), now()),
(3, '모바일 게임 개발자', '리뉘쥐 모바일 게임 개발', 'Unreal Engine 개발 가능자', '계약직', '성남시 분당구', 8500, '2026-04-05', now(), now()),
(4, '웹 back-end 개발자', '오픈마켓 웹 개발', 'spring 개발 가능자', '정규직', '서울시 송파구', 8100, '2026-05-02', now(), now()),
(4, '웹 front-end 개발자', '오픈마켓 웹 개발', 'react 개발 가능자', '계약직', '서울시 송파구', 9000, '2026-04-10', now(), now()),
(5, '웹 back-end 개발자', 'Naber 메일 기능 개발', 'spring 개발 경력 5년 이상', '계약직', '성남시 분당구', 9800, '2026-04-20', now(), now()),
(5, '동영상 플레이어 개발자', '네이버TV 플레이어 개발', '동영상 코덱 기술 개발가능자', '정규직', '성남시 분당구', 7800, '2026-05-01', now(), now()),
(5, '웹 front-end 개발자', 'Now 웹 개발', 'Vue.js 개발 가능자', '정규직', '성남시 분당구', 7000, '2026-04-15', now(), now()),
(6, '웹 back-end 개발자', '사내 인트라넷 개발', 'spring 개발경력 3년이상', '계약직', '서울시 송파구', 8800, '2026-04-15', now(), now()),
(6, '웹 back-end 개발자', '쇼핑 라이브 API 개발', 'spring 개발경력 3년이상', '정규직', '서울시 송파구 ', 8200, '2026-05-12', now(), now());
# 3. 연봉순 정렬
SELECT company.name, recruit.position, recruit.qualification, recruit.type, recruit.salary
FROM `company` JOIN `recruit`ON company.id = recruit.companyId ORDER BY recruit.salary DESC;
# 4. 복합 조건
SELECT company.name, company.scale, recruit.position, recruit.qualification, recruit.type, recruit.salary
FROM `company` JOIN `recruit`ON company.id = recruit.companyId
WHERE company.scale = '대기업' AND recruit.type = '정규직' AND recruit.salary >= 7000
ORDER BY recruit.salary DESC LIMIT 3;
# 5. 기업별 공고 수
SELECT company.name, count(*) as count, company.business, company.headcount
FROM `company` JOIN `recruit`ON company.id = recruit.companyId
WHERE recruit.deadline < '2026-05-01'
GROUP BY recruit.company ORDER BY count DESC;
# 6. 근무형태 별 평균 연봉
SELECT recruit.type, avg(recruit.salary) as salary
FROM `company` JOIN `recruit`ON company.id = recruit.companyId
WHERE company.scale = '중견기업'
GROUP BY recruit.type ;
# 7. 기업별 평균 연봉
SELECT company.name, avg(recruit.salary) as salary, company.scale, company.headcount
FROM `company` JOIN `recruit`ON company.id = recruit.companyId
WHERE recruit.region = '성남시 분당구'
GROUP BY company.id HAVING salary >= 7000
ORDER BY company.headcount DESC;
| true
|
89a507b168a430bd3e839cf1155b4caba4f55c43
|
SQL
|
dimitrivitulin/mycave
|
/mycave.sql
|
UTF-8
| 6,513
| 2.90625
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : jeu. 01 juil. 2021 à 21:58
-- Version du serveur : 5.7.31
-- Version de PHP : 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `mycave`
--
-- --------------------------------------------------------
--
-- Structure de la table `mes_vins`
--
DROP TABLE IF EXISTS `mes_vins`;
CREATE TABLE IF NOT EXISTS `mes_vins` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`titre` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`cepage` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`pays` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`region` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`millesime` int(11) NOT NULL,
`stock` int(100) NOT NULL,
`image_vin` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description_vin` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `mes_vins`
--
INSERT INTO `mes_vins` (`id`, `titre`, `cepage`, `pays`, `region`, `date`, `millesime`, `stock`, `image_vin`, `description_vin`) VALUES
(26, 'CHATEAU DE SAINT COSME', 'Grenache / Syrah', 'France', 'Southern Rhone / Gigondas', '2021-06-30 09:02:59', 2009, 12, '60dc1723ec8521.06637330.png', 'The aromas of fruit and spice give one a hint of the light drinkability of this lovely wine, which makes an excellent complement to fish dishes.'),
(27, 'LAN RIOJA CRIANZA', 'Tempranillo', 'Spain', 'Rioja', '2021-06-30 09:09:19', 2006, 6, '60dc189f256e83.71127922.png', 'A resurgence of interest in boutique vineyards has opened the door for this excellent foray into the dessert wine market. Light and bouncy, with a hint of black truffle, this wine will not fail to tickle the taste buds.'),
(28, 'MARGERUM SYBARITE', 'Sauvignon Blanc', 'USA', 'California Central Cosat', '2021-06-30 09:12:04', 2010, 10, '60dc1944725f35.23853641.png', '"The cache of a fine Cabernet in ones wine cellar can now be replaced with a childishly playful wine bubbling over with tempting tastes of black cherry and licorice. This is a taste sure to transport you back in time."'),
(29, 'OWEN ROE "EX UMBRIS"', 'Syrah', 'USA', 'Washington', '2021-06-30 09:16:02', 2009, 8, '60dc1a3295d8b1.75672486.png', '"A one-two punch of black pepper and jalapeno will send your senses reeling, as the orange essence snaps you back to reality. Don\'t miss this award-winning taste sensation."'),
(30, 'REX HILL', 'Pinot Noir', 'USA', 'Oregon', '2021-06-30 09:22:24', 2009, 6, '60dc1bb03e8049.66144348.png', '"One cannot doubt that this will be the wine served at the Hollywood award shows, because it has undeniable star power. Be the first to catch the debut that everyone will be talking about tomorrow."'),
(31, 'VITICCIO CLASSICO RISERVA', 'Sangiovese Merlot', 'Italy', 'Tuscany', '2021-06-30 09:27:56', 2007, 10, '60dc1cfc203485.43492122.png', 'Though soft and rounded in texture, the body of this wine is full and rich and oh-so-appealing. This delivery is even more impressive when one takes note of the tender tannins that leave the taste buds wholly satisfied.'),
(32, 'CHATEAU LE DOYENNE', 'Merlot', 'France', 'Bordeaux', '2021-06-30 09:33:14', 2005, 24, '60dc1e3a92fea6.56304754.png', '"Though dense and chewy, this wine does not overpower with its finely balanced depth and structure. It is a truly luxurious experience for the senses."'),
(33, 'DOMAINE DU BOUSCAT', 'Merlot', 'France', 'Bordeaux', '2021-06-30 09:43:23', 2009, 16, '60dc209bd0e442.99484300.png', 'The light golden color of this wine belies the bright flavor it holds. A true summer wine, it begs for a picnic lunch in a sun-soaked vineyard.'),
(34, 'BLOCK NINE', 'Pinot Noir', 'USA', 'California', '2021-06-30 09:49:20', 2009, 6, '60dc2200b77093.83192656.png', 'With hints of ginger and spice, this wine makes an excellent complement to light appetizer and dessert fare for a holiday gathering.'),
(35, 'DOMAINE SERENE', 'Pinot Noir', 'USA', 'Oregon', '2021-06-30 09:52:18', 2007, 6, '60dc22b2b5b875.95101614.png', 'Though subtle in its complexities, this wine is sure to please a wide range of enthusiasts. Notes of pomegranate will delight as the nutty finish completes the picture of a fine sipping experience.'),
(36, 'BODEGA LURTON', 'Pinot Gris', 'Argentina', 'Mendoza', '2021-06-30 09:59:08', 2011, 8, '60dc244c64c8c9.12974806.png', 'Solid notes of black currant blended with a light citrus make this wine an easy pour for varied palates.'),
(37, 'LES MORIZOTTES', 'Chardonnay', 'France', 'Burgundy', '2021-06-30 10:08:53', 2009, 8, '60dc2695342235.20972851.png', '"Breaking the mold of the classics, this offering will surprise and undoubtedly get tongues wagging with the hints of coffee and tobacco in perfect alignment with more traditional notes. Breaking the mold of the classics, this offering will surprise and undoubtedly get tongues wagging with the hints of coffee and tobacco in perfect alignment with more traditional notes. Sure to please the late-night crowd with the slight jolt of adrenaline it brings."'),
(40, 'test', 'test', 'france', 'champagne', '2021-06-30 15:36:50', 2020, 5, '60dc77290008alan_rioja.png', 'c\'est bon le champagne');
-- --------------------------------------------------------
--
-- Structure de la table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`password` varchar(255) NOT NULL,
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `created_at`) VALUES
(3, 'dimitri', '$2y$10$GsVEX9ywXtB7y5aKDTvO6e8ihVOZvQ4nQxb1ixK7gkC3iSfubf6se', '2021-07-01 14:29:13');
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
|
325d79265aa673037f3d810252c213cdbf5e54d5
|
SQL
|
pccode21/PythonLearn
|
/src/spider/football_player.sql
|
UTF-8
| 1,851
| 2.953125
| 3
|
[] |
no_license
|
/*
Navicat Premium Data Transfer
Source Server : 114.67.111.196(京东云Docker)
Source Server Type : MySQL
Source Server Version : 50728
Source Host : 114.67.111.196:3306
Source Schema : test
Target Server Type : MySQL
Target Server Version : 50728
File Encoding : 65001
Date: 18/01/2020 00:19:01
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for football_player
-- ----------------------------
DROP TABLE IF EXISTS `football_player`;
CREATE TABLE `football_player` (
`jiantiming` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '简体名',
`yingwenming` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '英文名',
`fantiming` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '繁体名',
`yujishenjia` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预计身价',
`shengri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生日',
`tizhong` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '体重',
`shengao` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身高',
`guanyongjiao` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '惯用脚',
`guoji` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '国籍',
`hetongjiezhiqi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '合同截止期'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
| true
|
6a7a0eeba63f910a13c7625311883c8f960a0ee2
|
SQL
|
AlexWattt/WPF_Demo
|
/query.sql
|
UTF-8
| 3,762
| 3.84375
| 4
|
[] |
no_license
|
-----------GETS THE PLAYERS With names like X ('B' in this case)-----------------
Select PLAYER_NAME as Name
FROM player
WHERE Name LIKE 'B%';
-----------GETS THE PLAYERS WITH RANK HIGHER THAN X (48 in this case)------------
Select P.player_name AS Name, Player_Attributes.overall_rating AS Rating
FROM Player AS P
JOIN Player_Attributes ON P.player_api_id = Player_Attributes.player_api_id
Group BY p.player_api_id Having Player_Attributes.overall_rating >= 48
Order By Rating;
-----------GETS THE AMOUNT OF WINS A TEAM HAS------------------------------------
SELECT
(SELECT COUNT(*)
FROM (
SELECT TEAM_API_ID
FROM TEAM WHERE TEAM_LONG_NAME = '" + row[0] + "') AS HOME_TEAM
JOIN MATCH ON MATCH.HOME_TEAM_API_ID = HOME_TEAM.TEAM_API_ID
WHERE MATCH.HOME_TEAM_GOAL > MATCH.AWAY_TEAM_GOAL) +
(SELECT COUNT(*)
FROM (
SELECT TEAM_API_ID
FROM TEAM WHERE TEAM_LONG_NAME = '" + row[0] + "') AS AWAY_TEAM
JOIN MATCH ON MATCH.AWAY_TEAM_API_ID = AWAY_TEAM.TEAM_API_ID
WHERE MATCH.HOME_TEAM_GOAL < MATCH.AWAY_TEAM_GOAL)
AS SumCount;
-----------------------------------------------------------------------------------------
---------------------------------COMPARES TWO TEAMS WINS AGAINST EACHOTHER---------------------------------
SELECT count(*) AS COUNTS, team_long_name
FROM (
SELECT A.team_long_name
FROM(
SELECT C.team_long_name, C.home_team_goal, C.away_team_goal
FROM
(SELECT MATCH.home_team_goal,MATCH.away_team_goal, HOME_TEAM.team_long_name
FROM TEAM AS HOME_TEAM
JOIN MATCH ON MATCH.home_team_api_id = HOME_TEAM.team_api_id
) AS C
WHERE C.home_team_goal > C.away_team_goal ) AS A
UNION ALL
SELECT A.team_long_name
FROM
(SELECT C.team_long_name, C.home_team_goal, C.away_team_goal
FROM
(SELECT MATCH.home_team_goal,MATCH.away_team_goal, away_TEAM.team_long_name
FROM TEAM AS AWAY_TEAM
JOIN MATCH ON MATCH.AWAY_team_api_id = AWAY_TEAM.team_api_id
) AS C
WHERE C.home_team_goal < C.away_team_goal ) AS A
)
GROUP BY team_long_name
HAVING COUNTS >
(SELECT
(SELECT COUNT(*)
FROM (
SELECT TEAM_API_ID
FROM TEAM WHERE TEAM_LONG_NAME = '" + row[0] + "') AS HOME_TEAM
JOIN MATCH ON MATCH.HOME_TEAM_API_ID = HOME_TEAM.TEAM_API_ID
WHERE MATCH.HOME_TEAM_GOAL > MATCH.AWAY_TEAM_GOAL) +
(SELECT COUNT(*)
FROM (
SELECT TEAM_API_ID
FROM TEAM WHERE TEAM_LONG_NAME = '" + row[0] + "') AS AWAY_TEAM
JOIN MATCH ON MATCH.AWAY_TEAM_API_ID = AWAY_TEAM.TEAM_API_ID
WHERE MATCH.HOME_TEAM_GOAL < MATCH.AWAY_TEAM_GOAL)
AS SumCount)
ORDER by team_long_name
---------------------------------------------------------------------------------------------------
--------------- GET WHICH COUNTRYS ARE IN WHICH League --------------------------------
SELECT Country.NAME AS CountryName, League.name AS LeagueName
FROM Country
JOIN League ON League.country_id = Country.id;
--------------------------Give betting deatils about teams ----------------------------
SELECT team_long_name,
team_short_name,
buildUpPlaySpeed,
buildUpPlaySpeedClass,
buildUpPlayDribbling,
buildUpPlayDribblingClass,
buildUpPlayPassing,
buildUpPlayPassingClass,
buildUpPlayPositioningClass,
chanceCreationPassing,
chanceCreationPassingClass,
chanceCreationCrossing,
chanceCreationCrossingClass,
chanceCreationShooting,
chanceCreationShootingClass,
chanceCreationPositioningClass,
defencePressure,
defencePressureClass,
defenceAggression,
defenceAggressionClass,
defenceTeamWidth,
defenceTeamWidthClass,
defenceDefenderLineClass
FROM TEAM
JOIN Team_Attributes ON Team.team_api_id = Team_Attributes.team_api_id;
------------------------------------------------------------------------------------------------------------
| true
|
7762ddd5d942f907141add9d8b60d7825bc91c35
|
SQL
|
georgetown-cset/ai-definitions-for-policymaking
|
/sql/wos_arxiv_categories.sql
|
UTF-8
| 930
| 4.125
| 4
|
[] |
no_license
|
/*
Identify the WoS category associated with each WoS publication in the analysis.
Determine whether it's a category we've coded as having overlap with arXiv's coverage of fields.
These codings are in `oecd_for_james.arxiv_wos_coverage`.
*/
with subject as (
select id,
subject,
cast(arxiv_overlap as boolean) arxiv_coverage
from oecd.wos_subjects_20200219 subjects
left join (
select *
from oecd_for_james.arxiv_wos_coverage coverage
where arxiv_overlap = 1
) coverage on lower(subjects.subject) = lower(coverage.category)
)
select corpus.id,
array_agg(distinct subject.subject ignore nulls order by subject.subject) as subject,
max(coalesce(arxiv_coverage, false)) as arxiv_coverage
from oecd.en_2010_2020 corpus
left join subject on corpus.id = subject.id
where corpus.dataset = 'wos'
group by 1
| true
|
617dad2f612b438422c820e17656a80f9bec19c7
|
SQL
|
MaiconLan/aarf
|
/src/main/resources/flyway/V1__1.0.1.sql
|
UTF-8
| 21,747
| 3.421875
| 3
|
[] |
no_license
|
-- Database generated with pgModeler (PostgreSQL Database Modeler).
-- pgModeler version: 0.8.2
-- PostgreSQL version: 9.5
-- Project Site: pgmodeler.com.br
-- Model Author: ---
-- Database creation must be done outside an multicommand file.
-- These commands were put in this file only for convenience.
-- -- object: aarf | type: DATABASE --
-- -- DROP DATABASE IF EXISTS aarf;
-- CREATE DATABASE aarf
-- ;
-- -- ddl-end --
--
-- object: cadastro | type: SCHEMA --
-- DROP SCHEMA IF EXISTS cadastro CASCADE;
CREATE SCHEMA cadastro;
-- ddl-end --
ALTER SCHEMA cadastro OWNER TO postgres;
-- ddl-end --
-- object: matricula | type: SCHEMA --
-- DROP SCHEMA IF EXISTS matricula CASCADE;
CREATE SCHEMA matricula;
-- ddl-end --
ALTER SCHEMA matricula OWNER TO postgres;
-- ddl-end --
-- object: publico | type: SCHEMA --
-- DROP SCHEMA IF EXISTS publico CASCADE;
CREATE SCHEMA publico;
-- ddl-end --
ALTER SCHEMA publico OWNER TO postgres;
-- ddl-end --
-- object: financeiro | type: SCHEMA --
-- DROP SCHEMA IF EXISTS financeiro CASCADE;
CREATE SCHEMA financeiro;
-- ddl-end --
ALTER SCHEMA financeiro OWNER TO postgres;
-- ddl-end --
SET search_path TO pg_catalog,public,cadastro,matricula,publico,financeiro;
-- ddl-end --
-- object: cadastro.endereco | type: TABLE --
-- DROP TABLE IF EXISTS cadastro.endereco CASCADE;
CREATE TABLE cadastro.endereco(
id_endereco serial NOT NULL,
id_pessoa integer,
cep character varying(8) NOT NULL,
logradouro character varying NOT NULL,
complemento character varying,
bairro character varying,
CONSTRAINT id_endereco_pk PRIMARY KEY (id_endereco)
);
-- ddl-end --
ALTER TABLE cadastro.endereco OWNER TO postgres;
-- ddl-end --
-- object: cadastro.pessoa | type: TABLE --
-- DROP TABLE IF EXISTS cadastro.pessoa CASCADE;
CREATE TABLE cadastro.pessoa(
id_pessoa serial NOT NULL,
nome character varying NOT NULL,
nascimento date NOT NULL,
cpf character varying(11) NOT NULL,
rg character varying(7) NOT NULL,
email character varying NOT NULL,
genero character NOT NULL,
telefone character varying(10) NOT NULL,
celular character varying(11) NOT NULL,
CONSTRAINT id_pessoa_pk PRIMARY KEY (id_pessoa)
);
-- ddl-end --
ALTER TABLE cadastro.pessoa OWNER TO postgres;
-- ddl-end --
-- object: cadastro.usuario | type: TABLE --
-- DROP TABLE IF EXISTS cadastro.usuario CASCADE;
CREATE TABLE cadastro.usuario(
id_usuario serial NOT NULL,
login character varying NOT NULL,
senha character varying NOT NULL,
CONSTRAINT id_usuario_pk PRIMARY KEY (id_usuario)
);
-- ddl-end --
ALTER TABLE cadastro.usuario OWNER TO postgres;
-- ddl-end --
-- object: cadastro.associado | type: TABLE --
-- DROP TABLE IF EXISTS cadastro.associado CASCADE;
CREATE TABLE cadastro.associado(
id_associado serial NOT NULL,
id_pessoa integer,
id_usuario integer,
cargo character varying NOT NULL,
inativo boolean,
CONSTRAINT id_associado PRIMARY KEY (id_associado)
);
-- ddl-end --
ALTER TABLE cadastro.associado OWNER TO postgres;
-- ddl-end --
-- object: cadastro.estudante | type: TABLE --
-- DROP TABLE IF EXISTS cadastro.estudante CASCADE;
CREATE TABLE cadastro.estudante(
id_estudante serial NOT NULL,
id_pessoa integer,
id_instituicao integer,
id_usuario integer,
inativo boolean,
CONSTRAINT id_estudante PRIMARY KEY (id_estudante)
);
-- ddl-end --
ALTER TABLE cadastro.estudante OWNER TO postgres;
-- ddl-end --
-- object: pessoa_fk | type: CONSTRAINT --
-- ALTER TABLE cadastro.associado DROP CONSTRAINT IF EXISTS pessoa_fk CASCADE;
ALTER TABLE cadastro.associado ADD CONSTRAINT pessoa_fk FOREIGN KEY (id_pessoa)
REFERENCES cadastro.pessoa (id_pessoa) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: pessoa_fk | type: CONSTRAINT --
-- ALTER TABLE cadastro.estudante DROP CONSTRAINT IF EXISTS pessoa_fk CASCADE;
ALTER TABLE cadastro.estudante ADD CONSTRAINT pessoa_fk FOREIGN KEY (id_pessoa)
REFERENCES cadastro.pessoa (id_pessoa) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: cadastro.instituicao | type: TABLE --
-- DROP TABLE IF EXISTS cadastro.instituicao CASCADE;
CREATE TABLE cadastro.instituicao(
id_instituicao serial NOT NULL,
nome character varying NOT NULL,
tipo character varying NOT NULL,
id_cidade integer,
CONSTRAINT id_instituicao PRIMARY KEY (id_instituicao),
CONSTRAINT ck_tipo CHECK (tipo IN ('Ensino', 'Financeira'))
);
-- ddl-end --
ALTER TABLE cadastro.instituicao OWNER TO postgres;
-- ddl-end --
-- object: instituicao_fk | type: CONSTRAINT --
-- ALTER TABLE cadastro.estudante DROP CONSTRAINT IF EXISTS instituicao_fk CASCADE;
ALTER TABLE cadastro.estudante ADD CONSTRAINT instituicao_fk FOREIGN KEY (id_instituicao)
REFERENCES cadastro.instituicao (id_instituicao) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: cadastro.historico_instituicao | type: TABLE --
-- DROP TABLE IF EXISTS cadastro.historico_instituicao CASCADE;
CREATE TABLE cadastro.historico_instituicao(
id_historico_instituicao serial NOT NULL,
id_estudante integer,
id_instituicao integer,
termino date NOT NULL,
CONSTRAINT id_historico_instituicao_pk PRIMARY KEY (id_historico_instituicao)
);
-- ddl-end --
ALTER TABLE cadastro.historico_instituicao OWNER TO postgres;
-- ddl-end --
-- object: estudante_fk | type: CONSTRAINT --
-- ALTER TABLE cadastro.historico_instituicao DROP CONSTRAINT IF EXISTS estudante_fk CASCADE;
ALTER TABLE cadastro.historico_instituicao ADD CONSTRAINT estudante_fk FOREIGN KEY (id_estudante)
REFERENCES cadastro.estudante (id_estudante) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: matricula.matricula | type: TABLE --
-- DROP TABLE IF EXISTS matricula.matricula CASCADE;
CREATE TABLE matricula.matricula(
id_matricula serial NOT NULL,
id_edital integer,
id_estudante integer,
semestre character varying,
inscricao timestamp NOT NULL,
situacao character varying NOT NULL,
data_situacao timestamp NOT NULL,
CONSTRAINT id_matricula_pk PRIMARY KEY (id_matricula)
);
-- ddl-end --
ALTER TABLE matricula.matricula OWNER TO postgres;
-- ddl-end --
-- object: matricula.edital | type: TABLE --
-- DROP TABLE IF EXISTS matricula.edital CASCADE;
CREATE TABLE matricula.edital(
id_edital serial NOT NULL,
titulo character varying NOT NULL,
inicio date NOT NULL,
termino date NOT NULL,
finalizado boolean,
CONSTRAINT id_edital_pk PRIMARY KEY (id_edital)
);
-- ddl-end --
ALTER TABLE matricula.edital OWNER TO postgres;
-- ddl-end --
-- object: estudante_fk | type: CONSTRAINT --
-- ALTER TABLE matricula.matricula DROP CONSTRAINT IF EXISTS estudante_fk CASCADE;
ALTER TABLE matricula.matricula ADD CONSTRAINT estudante_fk FOREIGN KEY (id_estudante)
REFERENCES cadastro.estudante (id_estudante) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: edital_fk | type: CONSTRAINT --
-- ALTER TABLE matricula.matricula DROP CONSTRAINT IF EXISTS edital_fk CASCADE;
ALTER TABLE matricula.matricula ADD CONSTRAINT edital_fk FOREIGN KEY (id_edital)
REFERENCES matricula.edital (id_edital) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: matricula.cancelamento | type: TABLE --
-- DROP TABLE IF EXISTS matricula.cancelamento CASCADE;
CREATE TABLE matricula.cancelamento(
id_cancelamento serial NOT NULL,
id_matricula integer,
cancelamento timestamp NOT NULL,
motivo character varying NOT NULL,
CONSTRAINT id_cancelamento_pk PRIMARY KEY (id_cancelamento)
);
-- ddl-end --
ALTER TABLE matricula.cancelamento OWNER TO postgres;
-- ddl-end --
-- object: matricula_fk | type: CONSTRAINT --
-- ALTER TABLE matricula.cancelamento DROP CONSTRAINT IF EXISTS matricula_fk CASCADE;
ALTER TABLE matricula.cancelamento ADD CONSTRAINT matricula_fk FOREIGN KEY (id_matricula)
REFERENCES matricula.matricula (id_matricula) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: cancelamento_uq | type: CONSTRAINT --
-- ALTER TABLE matricula.cancelamento DROP CONSTRAINT IF EXISTS cancelamento_uq CASCADE;
ALTER TABLE matricula.cancelamento ADD CONSTRAINT cancelamento_uq UNIQUE (id_matricula);
-- ddl-end --
-- object: pessoa_fk | type: CONSTRAINT --
-- ALTER TABLE cadastro.endereco DROP CONSTRAINT IF EXISTS pessoa_fk CASCADE;
ALTER TABLE cadastro.endereco ADD CONSTRAINT pessoa_fk FOREIGN KEY (id_pessoa)
REFERENCES cadastro.pessoa (id_pessoa) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: endereco_uq | type: CONSTRAINT --
-- ALTER TABLE cadastro.endereco DROP CONSTRAINT IF EXISTS endereco_uq CASCADE;
ALTER TABLE cadastro.endereco ADD CONSTRAINT endereco_uq UNIQUE (id_pessoa);
-- ddl-end --
-- object: publico.noticia | type: TABLE --
-- DROP TABLE IF EXISTS publico.noticia CASCADE;
CREATE TABLE publico.noticia(
id_noticia serial NOT NULL,
id_instituicao integer,
id_associado integer,
abrangencia boolean,
titulo character varying NOT NULL,
publicacao date NOT NULL,
severidade character varying,
conteudo character varying NOT NULL,
CONSTRAINT id_noticia_pk PRIMARY KEY (id_noticia)
);
-- ddl-end --
ALTER TABLE publico.noticia OWNER TO postgres;
-- ddl-end --
-- object: associado_fk | type: CONSTRAINT --
-- ALTER TABLE publico.noticia DROP CONSTRAINT IF EXISTS associado_fk CASCADE;
ALTER TABLE publico.noticia ADD CONSTRAINT associado_fk FOREIGN KEY (id_associado)
REFERENCES cadastro.associado (id_associado) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: usuario_fk | type: CONSTRAINT --
-- ALTER TABLE cadastro.associado DROP CONSTRAINT IF EXISTS usuario_fk CASCADE;
ALTER TABLE cadastro.associado ADD CONSTRAINT usuario_fk FOREIGN KEY (id_usuario)
REFERENCES cadastro.usuario (id_usuario) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: associado_uq | type: CONSTRAINT --
-- ALTER TABLE cadastro.associado DROP CONSTRAINT IF EXISTS associado_uq CASCADE;
ALTER TABLE cadastro.associado ADD CONSTRAINT associado_uq UNIQUE (id_usuario);
-- ddl-end --
-- object: usuario_fk | type: CONSTRAINT --
-- ALTER TABLE cadastro.estudante DROP CONSTRAINT IF EXISTS usuario_fk CASCADE;
ALTER TABLE cadastro.estudante ADD CONSTRAINT usuario_fk FOREIGN KEY (id_usuario)
REFERENCES cadastro.usuario (id_usuario) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: estudante_uq | type: CONSTRAINT --
-- ALTER TABLE cadastro.estudante DROP CONSTRAINT IF EXISTS estudante_uq CASCADE;
ALTER TABLE cadastro.estudante ADD CONSTRAINT estudante_uq UNIQUE (id_usuario);
-- ddl-end --
-- object: financeiro.apoio | type: TABLE --
-- DROP TABLE IF EXISTS financeiro.apoio CASCADE;
CREATE TABLE financeiro.apoio(
id_apoio serial NOT NULL,
id_instituicao integer,
valor numeric NOT NULL,
recebimento date,
CONSTRAINT id_apoio_pk PRIMARY KEY (id_apoio)
);
-- ddl-end --
ALTER TABLE financeiro.apoio OWNER TO postgres;
-- ddl-end --
-- object: cadastro.anexo | type: TABLE --
-- DROP TABLE IF EXISTS cadastro.anexo CASCADE;
CREATE TABLE cadastro.anexo(
id_anexo serial NOT NULL,
nome character varying NOT NULL,
extensao character varying NOT NULL,
hash character varying NOT NULL,
caminho character varying NOT NULL,
tipo character varying,
CONSTRAINT id_anexo_pk PRIMARY KEY (id_anexo)
);
-- ddl-end --
ALTER TABLE cadastro.anexo OWNER TO postgres;
-- ddl-end --
-- object: financeiro.boleto | type: TABLE --
-- DROP TABLE IF EXISTS financeiro.boleto CASCADE;
CREATE TABLE financeiro.boleto(
id_boleto serial NOT NULL,
id_parcela integer,
id_conta integer,
vencimento date NOT NULL,
pagamento timestamp,
CONSTRAINT id_boleto_pk PRIMARY KEY (id_boleto)
);
-- ddl-end --
ALTER TABLE financeiro.boleto OWNER TO postgres;
-- ddl-end --
-- object: instituicao_fk | type: CONSTRAINT --
-- ALTER TABLE financeiro.apoio DROP CONSTRAINT IF EXISTS instituicao_fk CASCADE;
ALTER TABLE financeiro.apoio ADD CONSTRAINT instituicao_fk FOREIGN KEY (id_instituicao)
REFERENCES cadastro.instituicao (id_instituicao) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: financeiro.parcela | type: TABLE --
-- DROP TABLE IF EXISTS financeiro.parcela CASCADE;
CREATE TABLE financeiro.parcela(
id_parcela serial NOT NULL,
id_matricula integer,
numero integer NOT NULL,
valor numeric NOT NULL,
CONSTRAINT id_parcela_pk PRIMARY KEY (id_parcela)
);
-- ddl-end --
ALTER TABLE financeiro.parcela OWNER TO postgres;
-- ddl-end --
-- object: matricula_fk | type: CONSTRAINT --
-- ALTER TABLE financeiro.parcela DROP CONSTRAINT IF EXISTS matricula_fk CASCADE;
ALTER TABLE financeiro.parcela ADD CONSTRAINT matricula_fk FOREIGN KEY (id_matricula)
REFERENCES matricula.matricula (id_matricula) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: financeiro.investimento | type: TABLE --
-- DROP TABLE IF EXISTS financeiro.investimento CASCADE;
CREATE TABLE financeiro.investimento(
id_investimento serial NOT NULL,
id_apoio integer,
valor numeric,
pagamento date,
CONSTRAINT id_investimento PRIMARY KEY (id_investimento)
);
-- ddl-end --
ALTER TABLE financeiro.investimento OWNER TO postgres;
-- ddl-end --
-- object: apoio_fk | type: CONSTRAINT --
-- ALTER TABLE financeiro.investimento DROP CONSTRAINT IF EXISTS apoio_fk CASCADE;
ALTER TABLE financeiro.investimento ADD CONSTRAINT apoio_fk FOREIGN KEY (id_apoio)
REFERENCES financeiro.apoio (id_apoio) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: instituicao_fk | type: CONSTRAINT --
-- ALTER TABLE cadastro.historico_instituicao DROP CONSTRAINT IF EXISTS instituicao_fk CASCADE;
ALTER TABLE cadastro.historico_instituicao ADD CONSTRAINT instituicao_fk FOREIGN KEY (id_instituicao)
REFERENCES cadastro.instituicao (id_instituicao) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: parcela_fk | type: CONSTRAINT --
-- ALTER TABLE financeiro.boleto DROP CONSTRAINT IF EXISTS parcela_fk CASCADE;
ALTER TABLE financeiro.boleto ADD CONSTRAINT parcela_fk FOREIGN KEY (id_parcela)
REFERENCES financeiro.parcela (id_parcela) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: matricula.matriculas_anexos | type: TABLE --
-- DROP TABLE IF EXISTS matricula.matriculas_anexos CASCADE;
CREATE TABLE matricula.matriculas_anexos(
id_anexo integer,
id_matricula integer,
CONSTRAINT matriculas_anexos_pk PRIMARY KEY (id_anexo,id_matricula)
);
-- ddl-end --
-- object: anexo_fk | type: CONSTRAINT --
-- ALTER TABLE matricula.matriculas_anexos DROP CONSTRAINT IF EXISTS anexo_fk CASCADE;
ALTER TABLE matricula.matriculas_anexos ADD CONSTRAINT anexo_fk FOREIGN KEY (id_anexo)
REFERENCES cadastro.anexo (id_anexo) MATCH FULL
ON DELETE RESTRICT ON UPDATE CASCADE;
-- ddl-end --
-- object: matricula_fk | type: CONSTRAINT --
-- ALTER TABLE matricula.matriculas_anexos DROP CONSTRAINT IF EXISTS matricula_fk CASCADE;
ALTER TABLE matricula.matriculas_anexos ADD CONSTRAINT matricula_fk FOREIGN KEY (id_matricula)
REFERENCES matricula.matricula (id_matricula) MATCH FULL
ON DELETE RESTRICT ON UPDATE CASCADE;
-- ddl-end --
-- object: financeiro.conta | type: TABLE --
-- DROP TABLE IF EXISTS financeiro.conta CASCADE;
CREATE TABLE financeiro.conta(
id_conta serial NOT NULL,
id_banco integer,
agencia integer NOT NULL,
numero_conta integer NOT NULL,
digito integer NOT NULL,
titular character varying NOT NULL,
aceite boolean,
convenio integer NOT NULL,
cedente integer NOT NULL,
local_pagamento character varying NOT NULL,
especie_documento character varying NOT NULL,
especie character varying NOT NULL,
carteira integer NOT NULL,
modalidade integer NOT NULL,
instrucoes character varying,
tipo_dias_protesto character varying NOT NULL,
dias_protesto integer NOT NULL,
inativo boolean,
layout character varying NOT NULL,
CONSTRAINT id_conta_pk PRIMARY KEY (id_conta)
);
-- ddl-end --
ALTER TABLE financeiro.conta OWNER TO postgres;
-- ddl-end --
-- object: conta_fk | type: CONSTRAINT --
-- ALTER TABLE financeiro.boleto DROP CONSTRAINT IF EXISTS conta_fk CASCADE;
ALTER TABLE financeiro.boleto ADD CONSTRAINT conta_fk FOREIGN KEY (id_conta)
REFERENCES financeiro.conta (id_conta) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: financeiro.banco | type: TABLE --
-- DROP TABLE IF EXISTS financeiro.banco CASCADE;
CREATE TABLE financeiro.banco(
id_banco serial NOT NULL,
nome character varying NOT NULL,
CONSTRAINT id_banco_pk PRIMARY KEY (id_banco)
);
-- ddl-end --
ALTER TABLE financeiro.banco OWNER TO postgres;
-- ddl-end --
-- object: banco_fk | type: CONSTRAINT --
-- ALTER TABLE financeiro.conta DROP CONSTRAINT IF EXISTS banco_fk CASCADE;
ALTER TABLE financeiro.conta ADD CONSTRAINT banco_fk FOREIGN KEY (id_banco)
REFERENCES financeiro.banco (id_banco) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: cadastro.cidade | type: TABLE --
-- DROP TABLE IF EXISTS cadastro.cidade CASCADE;
CREATE TABLE cadastro.cidade(
id_cidade serial NOT NULL,
nome character varying NOT NULL,
uf character varying NOT NULL,
CONSTRAINT id_cidade_pk PRIMARY KEY (id_cidade)
);
-- ddl-end --
ALTER TABLE cadastro.cidade OWNER TO postgres;
-- ddl-end --
-- object: cidade_fk | type: CONSTRAINT --
-- ALTER TABLE cadastro.instituicao DROP CONSTRAINT IF EXISTS cidade_fk CASCADE;
ALTER TABLE cadastro.instituicao ADD CONSTRAINT cidade_fk FOREIGN KEY (id_cidade)
REFERENCES cadastro.cidade (id_cidade) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: instituicao_fk | type: CONSTRAINT --
-- ALTER TABLE publico.noticia DROP CONSTRAINT IF EXISTS instituicao_fk CASCADE;
ALTER TABLE publico.noticia ADD CONSTRAINT instituicao_fk FOREIGN KEY (id_instituicao)
REFERENCES cadastro.instituicao (id_instituicao) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: matricula.viagem | type: TABLE --
-- DROP TABLE IF EXISTS matricula.viagem CASCADE;
CREATE TABLE matricula.viagem(
id_viagem serial NOT NULL,
id_matricula integer,
id_instituicao integer,
id_configuracao_viagem integer,
dia_semana character varying NOT NULL,
sentido character varying NOT NULL,
CONSTRAINT id_viagem_pk PRIMARY KEY (id_viagem)
);
-- ddl-end --
ALTER TABLE matricula.viagem OWNER TO postgres;
-- ddl-end --
-- object: matricula_fk | type: CONSTRAINT --
-- ALTER TABLE matricula.viagem DROP CONSTRAINT IF EXISTS matricula_fk CASCADE;
ALTER TABLE matricula.viagem ADD CONSTRAINT matricula_fk FOREIGN KEY (id_matricula)
REFERENCES matricula.matricula (id_matricula) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: instituicao_fk | type: CONSTRAINT --
-- ALTER TABLE matricula.viagem DROP CONSTRAINT IF EXISTS instituicao_fk CASCADE;
ALTER TABLE matricula.viagem ADD CONSTRAINT instituicao_fk FOREIGN KEY (id_instituicao)
REFERENCES cadastro.instituicao (id_instituicao) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: matricula.configuracao_viagem | type: TABLE --
-- DROP TABLE IF EXISTS matricula.configuracao_viagem CASCADE;
CREATE TABLE matricula.configuracao_viagem(
id_configuracao_viagem serial NOT NULL,
id_edital integer,
id_instituicao integer,
valor numeric NOT NULL,
dia_semana character varying[] NOT NULL,
sentido character varying[] NOT NULL,
CONSTRAINT id_configuracao_viagem_pk PRIMARY KEY (id_configuracao_viagem)
);
-- ddl-end --
ALTER TABLE matricula.configuracao_viagem OWNER TO postgres;
-- ddl-end --
-- object: instituicao_fk | type: CONSTRAINT --
-- ALTER TABLE matricula.configuracao_viagem DROP CONSTRAINT IF EXISTS instituicao_fk CASCADE;
ALTER TABLE matricula.configuracao_viagem ADD CONSTRAINT instituicao_fk FOREIGN KEY (id_instituicao)
REFERENCES cadastro.instituicao (id_instituicao) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: configuracao_viagem_fk | type: CONSTRAINT --
-- ALTER TABLE matricula.viagem DROP CONSTRAINT IF EXISTS configuracao_viagem_fk CASCADE;
ALTER TABLE matricula.viagem ADD CONSTRAINT configuracao_viagem_fk FOREIGN KEY (id_configuracao_viagem)
REFERENCES matricula.configuracao_viagem (id_configuracao_viagem) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
-- object: edital_fk | type: CONSTRAINT --
-- ALTER TABLE matricula.configuracao_viagem DROP CONSTRAINT IF EXISTS edital_fk CASCADE;
ALTER TABLE matricula.configuracao_viagem ADD CONSTRAINT edital_fk FOREIGN KEY (id_edital)
REFERENCES matricula.edital (id_edital) MATCH FULL
ON DELETE SET NULL ON UPDATE CASCADE;
-- ddl-end --
CREATE TABLE financeiro.prestacao_conta
(
id_prestacaoconta bigserial NOT NULL,
data timestamp without time zone,
id_instituicao bigint,
nome_gasto character varying(255),
observacao character varying(255),
observacao_gasto character varying(255),
valor bigint,
valor_gasto bigint,
id_insituicao bigint,
CONSTRAINT prestacao_conta_pkey PRIMARY KEY (id_prestacaoconta),
CONSTRAINT prestacoes_instituicao FOREIGN KEY (id_insituicao)
REFERENCES cadastro.instituicao (id_instituicao) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
);
CREATE TABLE cadastro.atualizacao
(
id_atualizacao serial NOT NULL,
inicio date NOT NULL,
termino date NOT NULL,
concluido boolean,
observacao character varying,
CONSTRAINT id_atualizacao_pk PRIMARY KEY (id_atualizacao)
)
WITH (
OIDS = FALSE
)
;
INSERT INTO cadastro.usuario (login, senha) VALUES
('admin', '8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918');
INSERT INTO cadastro.pessoa (nome, nascimento, cpf, rg, email, genero, telefone, celular)
VALUES ('Administrador', current_date, '00000000000', 0000000, 'developer.icarus@gmail.com', 'M', '0000000000', '00000000000');
INSERT INTO cadastro.associado (cargo, id_pessoa, id_usuario)
VALUES ('Administrador', currval('cadastro.pessoa_id_pessoa_seq'), currval('cadastro.usuario_id_usuario_seq'));
| true
|
64ea764c78fd734f9d32e896a9d2ec42de065943
|
SQL
|
pgadea/Learn-T-SQL
|
/5.Where with Like/Where Like.sql
|
UTF-8
| 1,545
| 3.859375
| 4
|
[] |
no_license
|
--Using the where clause with LIKE operator examples:
--The like operator is used with the Where clause to find patterns
Select *
FROM [AdventureWorks2012].[Production].[Product]
--filter the data using the column names
Select Name, ProductNumber, Color, ListPrice
FROM [AdventureWorks2012].[Production].[Product]
--Name of product starting with the letter "s":--<< the like operator is enclosed in open apostrophes with the percent sign
SELECT * FROM [AdventureWorks2012].[Production].[Product]
WHERE Name LIKE 's%';
--Name of product ending with the letter "s":
SELECT * FROM [AdventureWorks2012].[Production].[Product]
WHERE Name LIKE '%s';
--Name of product containing the pattern 'end'
SELECT * FROM [AdventureWorks2012].[Production].[Product]
WHERE Name LIKE '%end%';
--Name of product NOT containing the pattern 'end'
SELECT * FROM [AdventureWorks2012].[Production].[Product]
WHERE Name NOT LIKE '%end%';
--Name of product starting with 'dec'
SELECT * FROM [AdventureWorks2012].[Production].[Product]
WHERE Name LIKE 'dec%';
--selects all products with a name starting with "a", "b", or "m":
SELECT * FROM [AdventureWorks2012].[Production].[Product]
WHERE Name LIKE '[abm]%';
--selects all products with a name NOT starting with "a", "b", or "m" using the hyphen
SELECT * FROM [AdventureWorks2012].[Production].[Product]
WHERE Name NOT LIKE '[abm]%';
--selects all products starting with any character, followed by 'lat'
SELECT * FROM [AdventureWorks2012].[Production].[Product]
WHERE Name LIKE '_lat%';
| true
|
03e2a4602463f675ad61a1cedee4b59c89d131a5
|
SQL
|
gcnonato/secode
|
/application/modules/Ynfullslider/settings/my.sql
|
UTF-8
| 2,396
| 3
| 3
|
[] |
no_license
|
--
-- Module insertion
--
INSERT IGNORE INTO `engine4_core_modules` (`name`, `title`, `description`, `version`, `enabled`, `type`) VALUES ('ynfullslider', 'YN - Full Slider', '', '4.01', 1, 'extra') ;
--
-- Admin menu items
--
INSERT IGNORE INTO `engine4_core_menuitems` (`name`, `module`, `label`, `plugin`, `params`, `menu`, `submenu`, `order`) VALUES
('core_admin_main_plugins_ynfullslider', 'ynfullslider', 'YN - Full Slider', '', '{"route":"admin_default","module":"ynfullslider","controller":"sliders"}', 'core_admin_main_plugins', '', 999),
('ynfullslider_admin_main_sliders', 'ynfullslider', 'Manage Sliders', '', '{"route":"admin_default","module":"ynfullslider","controller":"sliders"}', 'ynfullslider_admin_main', '', 1),
('ynfullslider_admin_main_settings', 'ynfullslider', 'Global Settings', '', '{"route":"admin_default","module":"ynfullslider","controller":"settings", "action":"index"}', 'ynfullslider_admin_main', '', 2);
--
-- Table structure for `engine4_ynfullslider_sliders`
--
CREATE TABLE IF NOT EXISTS `engine4_ynfullslider_sliders` (
`slider_id` int(11) unsigned NOT NULL auto_increment,
`user_id` int(11) unsigned NOT NULL,
`creation_date` datetime NOT NULL,
`title` varchar(128) NOT NULL,
`photo_id` int(11) NOT NULL DEFAULT '0',
`slide_count` int(11) NOT NULL default '0',
`valid_from` datetime default NULL,
`valid_to` datetime default NULL,
`unlimited` boolean NOT NULL default '1',
`params` text NULL,
PRIMARY KEY (`slider_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for `engine4_ynfullslider_slides`
--
CREATE TABLE IF NOT EXISTS `engine4_ynfullslider_slides` (
`slide_id` int(11) unsigned NOT NULL auto_increment,
`title` varchar(128) default NULL,
`slider_id` int(11) unsigned NOT NULL,
`photo_id` int(11) NOT NULL DEFAULT '0',
`show_slide` boolean NOT NULL default '1',
`slide_order` int(11) DEFAULT 0,
`params` text NULL,
`slide_elements` text NULL,
`elements_order` text NULL,
`elements_count` text NULL,
`animation_order` text NULL,
PRIMARY KEY (`slide_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for `engine4_ynfullslider_elements`
--
CREATE TABLE IF NOT EXISTS `engine4_ynfullslider_elements` (
`element_id` int(11) unsigned NOT NULL auto_increment,
`slide_id` int(11) unsigned NOT NULL,
`creation_date` datetime NOT NULL,
`params` text NULL,
PRIMARY KEY (`element_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| true
|
da6a49e57913abe624f27a5eb01503f503c78563
|
SQL
|
kunxinlin/Banking-Application
|
/sql/bankapp-database-creation.sql
|
UTF-8
| 714
| 3.125
| 3
|
[] |
no_license
|
CREATE DATABASE IF NOT EXISTS `bankapp`;
USE `bankapp`;
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(100) NOT NULL,
`last_name` VARCHAR(100) NOT NULL,
`balance` DECIMAL(12,2) NOT NULL,
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `userlogin`;
CREATE TABLE `userlogin` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`email` VARCHAR(45) UNIQUE NULL,
`password` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
| true
|
6dc6aa573ff32d95dd82f6c347b934f0213cc1c3
|
SQL
|
AleksDik/SQL_RAB
|
/1.102 1.115 1.125 1.90 Выверка/1.102 Доработка интерфейса АРМ Выверка для статуса отсканировано/verify_rep_vyv_users.~prc
|
WINDOWS-1251
| 3,520
| 3.59375
| 4
|
[] |
no_license
|
CREATE OR REPLACE PROCEDURE verify_rep_vyv_users (begin_date_ VARCHAR2, end_date_ VARCHAR2, cur_ IN OUT kurs3.curstype, type_ NUMBER := 1) AS
--
-- , type_: 1 -
--
-- 28.11.2011 BlackHawk
-- #24.06.2013 Dikan
--
BEGIN
CASE
WHEN type_ = 1 THEN
OPEN cur_ FOR
SELECT DECODE (
user_id
,999, ''
,DECODE (SUBSTR (get_user_name_fmt (user_id), 1, 36)
,'Department Account Research Technics', ''
,get_user_name_fmt (user_id)
)
)
user_name
,user_id
,DECODE (user_id, 999, SUM (all_count) OVER (PARTITION BY 1), all_count) all_count
,DECODE (user_id, 999, SUM (vyvereno) OVER (PARTITION BY 1), vyvereno) vyvereno
,DECODE (user_id, 999, SUM (vozvrat) OVER (PARTITION BY 1), vozvrat) vozvrat
,DECODE (user_id, 999, NULL, get_user_work_time (user_id, TO_DATE (begin_date_, 'dd.mm.yyyy'), TO_DATE (end_date_, 'dd.mm.yyyy')))
begin_work
FROM ( SELECT user_id
,COUNT (1) all_count
,SUM (CASE WHEN status = 2 THEN 1 ELSE 0 END) vyvereno
,SUM (CASE WHEN status = 4 THEN 1 ELSE 0 END) vozvrat
FROM (SELECT num, user_id, datetime, status
FROM (SELECT ROW_NUMBER () OVER (PARTITION BY l.obj_id, l.new_value ORDER BY l.record_dt) num
,l.record_dt AS datetime
,l.user_id
,d.status
,l.new_value
FROM scan.ea_delo d, verify_filer l,
users u -- #24.06.2013
WHERE
-- #24.06.2013
l.user_id=u.user_id and
u.workplace_id = 2 and
-- / #24.06.2013
l.op_type = 1
AND l.obj_type_id = 9 -- EA_DELO.STATUS
AND (CASE
WHEN d.status = 2 AND l.new_value = '2' THEN 1 --2 - , 4 -
WHEN d.status = 4 AND l.new_value = '4' THEN 1
ELSE 0
END) = 1
AND d.delo_id = l.obj_id)
WHERE num = 1
AND datetime BETWEEN TO_DATE (begin_date_, 'dd.mm.yyyy')
AND TO_DATE (end_date_, 'dd.mm.yyyy') + 1 - 1 / (24 * 60 * 60))
GROUP BY user_id
UNION
SELECT 999, 0, 0, 0 FROM DUAL)
ORDER BY DECODE (user_name, '', NULL, user_name);
END CASE;
END verify_rep_vyv_users;
/
| true
|
c1ca26f3448caf68b32a7e823813cca652e25972
|
SQL
|
genbodev/jilfond
|
/sql.sql
|
UTF-8
| 1,359
| 2.953125
| 3
|
[] |
no_license
|
-- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия сервера: 5.5.45 - MySQL Community Server (GPL)
-- ОС Сервера: Win32
-- HeidiSQL Версия: 9.3.0.4984
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 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' */;
-- Дамп структуры для таблица jilfond.comments
DROP TABLE IF EXISTS `comments`;
CREATE TABLE IF NOT EXISTS `comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid_hash` char(32) NOT NULL DEFAULT '0',
`email` varchar(50) NOT NULL DEFAULT '0',
`comment` text NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uniq` (`guid_hash`,`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Экспортируемые данные не выделены.
/*!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
|
050c9550927b416312fd3616fadfd5c34df0cbad
|
SQL
|
AdedejiArt/Adedeji_Sankoh_databasesql
|
/mwscdb (3).sql
|
UTF-8
| 8,448
| 2.953125
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 15, 2020 at 06:31 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `mwscdb`
--
-- --------------------------------------------------------
--
-- Table structure for table `bills`
--
CREATE TABLE `bills` (
`bill_id` int(255) NOT NULL,
`premise_Id` int(255) NOT NULL,
`Tarrif_id` int(255) NOT NULL,
`Client_id` int(11) NOT NULL,
`Name` char(234) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `bills`
--
INSERT INTO `bills` (`bill_id`, `premise_Id`, `Tarrif_id`, `Client_id`, `Name`) VALUES
(1, 1, 1, 1, 'Adio Adedeji'),
(2, 3, 4, 3, 'Onifade Anjola'),
(3, 4, 3, 4, 'Keshinroloye Abobade'),
(4, 2, 2, 2, 'Razaq Afeez'),
(5, 2, 5, 2, 'Razaq Afeez'),
(6, 7, 6, 7, 'Santiege sankoh');
-- --------------------------------------------------------
--
-- Table structure for table `charge_structure`
--
CREATE TABLE `charge_structure` (
`tarriff_id` int(255) NOT NULL,
`lower_limit` int(255) NOT NULL,
`Upper_limit` int(255) NOT NULL,
`Charge` decimal(65,0) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `charge_structure`
--
INSERT INTO `charge_structure` (`tarriff_id`, `lower_limit`, `Upper_limit`, `Charge`) VALUES
(1, 5, 2, '10'),
(2, 2, 5, '10'),
(3, 2, 5, '10'),
(4, 2, 5, '10'),
(5, 2, 5, '10'),
(6, 2, 5, '10'),
(1, 5, 2, '10'),
(2, 2, 5, '10'),
(3, 2, 5, '10'),
(4, 2, 5, '10'),
(5, 2, 5, '10'),
(6, 2, 5, '10');
-- --------------------------------------------------------
--
-- Table structure for table `clients`
--
CREATE TABLE `clients` (
`Clients_Id` int(255) NOT NULL,
`Name` char(255) NOT NULL,
`telephone_Number` int(255) NOT NULL,
`Zone` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `clients`
--
INSERT INTO `clients` (`Clients_Id`, `Name`, `telephone_Number`, `Zone`) VALUES
(1, 'Adio Adedeji', 807654234, '001'),
(2, 'Razaq Afeez', 4563748, '001'),
(3, 'Onifade Anjola', 989763844, '002'),
(4, 'Keshiroloye Abobade', 235457449, '003'),
(5, 'Debo Suleyman', 70654322, '004'),
(6, 'Afe Babalola', 9123345, '001');
-- --------------------------------------------------------
--
-- Table structure for table `payment`
--
CREATE TABLE `payment` (
`bill_id` varchar(255) NOT NULL,
`transaction_id` varchar(255) NOT NULL,
`amount_paid` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `payment`
--
INSERT INTO `payment` (`bill_id`, `transaction_id`, `amount_paid`) VALUES
('001', '001', '10,000'),
('001', '001', '10,000'),
('002', '002', '50,000'),
('003', '003', '100,000'),
('004', '004', '70,000'),
('005', '005', '20,000'),
('005', '005', '10,000'),
('002', '002', '50,000'),
('003', '003', '100,000'),
('004', '004', '70,000'),
('005', '005', '20,000'),
('005', '005', '10,000');
-- --------------------------------------------------------
--
-- Table structure for table `plants`
--
CREATE TABLE `plants` (
`Plant_Name` char(255) NOT NULL,
`Plant_id` int(255) NOT NULL,
`Plant_Size` varchar(255) NOT NULL,
`Clients_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `plants`
--
INSERT INTO `plants` (`Plant_Name`, `Plant_id`, `Plant_Size`, `Clients_id`) VALUES
('Plant One', 1, '3,000 Litres', 0),
('Plant two', 2, '4000 Litres', 0),
('Plant three', 3, '9,000 Litres', 0),
('Plant Four', 4, '6,000 Litres', 0),
('Plant Five', 5, '10,000Litres', 0),
('Plant Six', 6, '29,000Litres', 0),
('plant Seven', 7, '30,000', 0),
('Plant One', 1, '3,000 Litres', 0),
('Plant two', 2, '4000 Litres', 0),
('Plant three', 3, '9,000 Litres', 0),
('Plant Four', 4, '6,000 Litres', 0),
('Plant Five', 5, '10,000Litres', 0),
('Plant Six', 6, '29,000Litres', 0),
('plant Seven', 7, '30,000', 0);
-- --------------------------------------------------------
--
-- Table structure for table `premises`
--
CREATE TABLE `premises` (
`premise_Id` varchar(255) NOT NULL,
`Client_id` varchar(255) NOT NULL,
`Meter_Number` int(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `premises`
--
INSERT INTO `premises` (`premise_Id`, `Client_id`, `Meter_Number`) VALUES
('001', '001', 1),
('002', '002', 2),
('003', '003', 3),
('004', '004', 4),
('005', '005', 5),
('006', '006', 6),
('003', '003', 3),
('004', '004', 4),
('005', '005', 5),
('006', '006', 6);
-- --------------------------------------------------------
--
-- Table structure for table `route`
--
CREATE TABLE `route` (
`route_id` varchar(255) NOT NULL,
`route_name` varchar(255) NOT NULL,
`Plant_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `route`
--
INSERT INTO `route` (`route_id`, `route_name`, `Plant_id`) VALUES
('1', 'Ife', 0),
('2', 'Oyo', 0),
('3', 'Ogbomosho', 0),
('4', 'Katsina', 0),
('5', 'Jigawa', 0),
('6', 'Osun', 0),
('1', 'Ife', 0),
('2', 'Oyo', 0),
('3', 'Ogbomosho', 0),
('4', 'Katsina', 0),
('5', 'Jigawa', 0),
('6', 'Osun', 0),
('7', 'Freetown', 1),
('8', 'Salone', 2),
('9', 'Borno', 3),
('3', 'ogbomosho', 4),
('6', 'AlabaTOWN', 5),
('7', 'Freetown', 1),
('8', 'Salone', 2),
('9', 'Borno', 3),
('3', 'ogbomosho', 4),
('6', 'AlabaTOWN', 5),
('7', 'Freetown', 1),
('8', 'Salone', 2),
('9', 'Borno', 3),
('3', 'ogbomosho', 4),
('6', 'AlabaTOWN', 5);
-- --------------------------------------------------------
--
-- Table structure for table `sector`
--
CREATE TABLE `sector` (
`Sector_id` varchar(255) NOT NULL,
`Sector_Name` char(255) NOT NULL,
`Office_physical_address` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `sector`
--
INSERT INTO `sector` (`Sector_id`, `Sector_Name`, `Office_physical_address`) VALUES
('1', 'S1', 'kIGALI'),
('2', 'S2', 'kACYIRU'),
('3', 'S3', 'kivu'),
('4', 's4', 'Baro'),
('5', 's5', 'Riyya'),
('6', 's6', 'Brookliu'),
('7', 's7', 'Adegbayi'),
('8', 's8', 'Alaakia'),
('9', 's9', 'Oyoba'),
('10', 's10', 'Sango'),
('11', 's11', 'Agbowo'),
('12', 's12', 'UI');
-- --------------------------------------------------------
--
-- Table structure for table `sector office`
--
CREATE TABLE `sector office` (
`Id` int(255) NOT NULL,
`Name` varchar(255) NOT NULL,
`Email address` varchar(255) NOT NULL,
`Job title` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `staff`
--
CREATE TABLE `staff` (
`Staff_id` int(255) NOT NULL,
`Staff_Name` varchar(255) NOT NULL,
`Sector_id` int(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `staff`
--
INSERT INTO `staff` (`Staff_id`, `Staff_Name`, `Sector_id`) VALUES
(1, 'Ayo Deji', 1),
(2, 'Sam Amunudu', 2),
(3, 'Bobson', 3),
(4, 'Paul', 4),
(5, 'Zahra', 4),
(6, 'Bayo', 5),
(7, 'Shayo', 6),
(8, 'Kunmi', 9),
(9, 'Malik', 8),
(10, 'Tife', 4),
(1, 'Ayo Deji', 1),
(2, 'Sam Amunudu', 2),
(3, 'Bobson', 3),
(4, 'Paul', 4),
(5, 'Zahra', 4),
(6, 'Bayo', 5),
(7, 'Shayo', 6),
(8, 'Kunmi', 9),
(9, 'Malik', 8),
(10, 'Tife', 4);
-- --------------------------------------------------------
--
-- Table structure for table `zone`
--
CREATE TABLE `zone` (
`Zone_id` int(255) NOT NULL,
`Zone_name` varchar(255) NOT NULL,
`Sector_Id` int(233) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `zone`
--
INSERT INTO `zone` (`Zone_id`, `Zone_name`, `Sector_Id`) VALUES
(1, 'Zone 1', 1),
(2, 'Zone 2', 2),
(1, 'Zone 1', 1),
(2, 'Zone 2', 2);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `bills`
--
ALTER TABLE `bills`
ADD PRIMARY KEY (`bill_id`);
--
-- Indexes for table `clients`
--
ALTER TABLE `clients`
ADD PRIMARY KEY (`Clients_Id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `bills`
--
ALTER TABLE `bills`
MODIFY `bill_id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101;
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
|
9acd95ad5c6cadd66f1b1f66cd40d29492f52651
|
SQL
|
cristian-bedoya/holbertonschool-higher_level_programming
|
/0x0E-SQL_more_queries/7-cities.sql
|
UTF-8
| 559
| 4.1875
| 4
|
[] |
no_license
|
-- Creates the database hbtn_0d_usa and the table cities (in the database hbtn_0d_usa).
-- cities description: id INT unique, auto generated, can’t be null and is a primary key
-- state_id INT, can’t be null and must be a FOREIGN KEY that references to id of the states table
-- name VARCHAR(256) can’t be null
CREATE DATABASE IF NOT EXISTS hbtn_0d_usa;
USE hbtn_0d_usa;
CREATE TABLE IF NOT EXISTS cities(id INT UNIQUE NOT NULL AUTO_INCREMENT PRIMARY KEY,
state_id INT NOT NULL,
name VARCHAR(256) NOT NULL,
FOREIGN KEY(state_id) REFERENCES states(id));
| true
|
3d8b524e28a233c36390887031983f31e0fc7a7c
|
SQL
|
andreammgcol/AirBnB_clone_v2
|
/setup_mysql_test.sql
|
UTF-8
| 364
| 2.59375
| 3
|
[] |
no_license
|
-- script that creates a database hbnb_test_db with a user hbnb_test
--
CREATE DATABASE IF NOT EXISTS hbnb_test_db;
CREATE USER IF NOT EXISTS hbnb_test@localhost IDENTIFIED BY 'hbnb_test_pwd';
GRANT USAGE ON * . * TO hbnb_test@localhost;
GRANT ALL PRIVILEGES ON hbnb_test_db. * TO hbnb_test@localhost;
GRANT SELECT ON performance_schema. * TO hbnb_test@localhost;
| true
|
33d2d675efc906c2327b31e3cae8ea67540765d3
|
SQL
|
ayaz/MCollectiveAgentActionBackground
|
/bg.ddl
|
UTF-8
| 1,279
| 2.734375
| 3
|
[] |
no_license
|
metadata :name => "Bg",
:description => "Demonstrate a technique to run agent actions in background.",
:author => "Ayaz Ahmed Khan",
:license => "GPLv2",
:version => "0.1",
:url => "",
:timeout => 25
action "run_bg", :description => "Run in background" do
output :status,
:description => "Status",
:display_as => "Status"
output :result,
:description => "Response",
:display_as => "Response"
end
action "status", :description => "Return status of background jobs." do
input :pid,
:prompt => "PID",
:description => "PID of job",
:type => :string,
:validation => "^[0-9]+$",
:maxlength => 10,
:optional => false
input :operation,
:prompt => "Operation",
:description => "Operation type",
:type => :string,
:validation => "^.+$",
:maxlength => 100,
:optional => false
output :status,
:description => "Status",
:display_as => "Status"
output :result,
:description => "Response",
:display_as => "Response"
end
| true
|
b3bbc84e3316871a65c27eb473c4393ca71aadc3
|
SQL
|
dev-shine/Protocol-Backend
|
/schemas/bridges.sql
|
UTF-8
| 481
| 2.90625
| 3
|
[] |
no_license
|
CREATE TABLE bridges (
"id" INT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 1021 INCREMENT BY 97),
"from" INT NOT NULL REFERENCES "elements" ("id"),
"to" INT NOT NULL REFERENCES "elements" ("id"),
"relation" SMALLINT NOT NULL REFERENCES "relations" ("id"),
"tags" VARCHAR(300) DEFAULT '',
"desc" TEXT DEFAULT '',
"created_at" TIMESTAMP NOT NULL,
"created_by" INT,
"updated_at" TIMESTAMP NOT NULL,
"updated_by" INT,
"status" SMALLINT DEFAULT 0
);
| true
|
212b56020b667cfb118a86a03c82b0e27800ab1b
|
SQL
|
ClickHouse/ClickHouse
|
/tests/queries/0_stateless/02565_update_empty_nested.sql
|
UTF-8
| 700
| 3.1875
| 3
|
[
"Apache-2.0",
"BSL-1.0"
] |
permissive
|
DROP TABLE IF EXISTS t_update_empty_nested;
CREATE TABLE t_update_empty_nested
(
`id` UInt32,
`nested.arr1` Array(UInt64),
)
ENGINE = MergeTree
ORDER BY id
SETTINGS min_bytes_for_wide_part = 0, index_granularity = 8192, index_granularity_bytes = '10Mi';
SET mutations_sync = 2;
INSERT INTO t_update_empty_nested SELECT 1, range(number % 10) FROM numbers(100000);
ALTER TABLE t_update_empty_nested ADD COLUMN `nested.arr2` Array(UInt64);
ALTER TABLE t_update_empty_nested UPDATE `nested.arr2` = `nested.arr1` WHERE 1;
SELECT * FROM t_update_empty_nested FORMAT Null;
SELECT sum(length(nested.arr1)), sum(length(nested.arr2)) FROM t_update_empty_nested;
DROP TABLE t_update_empty_nested;
| true
|
b05a98161db1b7ed732ecfe72f50da4185fd0dbe
|
SQL
|
tdwwzxy/BBS
|
/bbs.sql
|
UTF-8
| 3,647
| 3.21875
| 3
|
[] |
no_license
|
/*
Navicat MySQL Data Transfer
Source Server : test
Source Server Version : 50623
Source Host : 127.0.0.1:3306
Source Database : bbs
Target Server Type : MYSQL
Target Server Version : 50623
File Encoding : 65001
Date: 2015-06-07 19:13:41
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`commentId` int(255) NOT NULL AUTO_INCREMENT,
`commentNote` int(255) NOT NULL,
`commentContent` text NOT NULL,
`commentAuthor` varchar(255) NOT NULL,
`commentTime` datetime NOT NULL,
PRIMARY KEY (`commentId`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of comment
-- ----------------------------
INSERT INTO `comment` VALUES ('1', '8', '围观学习', 'Reed', '2015-06-01 15:21:01');
INSERT INTO `comment` VALUES ('4', '4', '看个人情况吧', 'Reed', '2015-06-04 19:10:54');
INSERT INTO `comment` VALUES ('11', '8', '前排围观', '颜文青', '2015-06-04 20:18:04');
INSERT INTO `comment` VALUES ('20', '8', '不知道', '111111', '2015-06-07 16:54:58');
INSERT INTO `comment` VALUES ('21', '13', '我是来找书的', 'Hallo', '2015-06-07 19:04:48');
INSERT INTO `comment` VALUES ('22', '12', '不懂也能进来么', 'Hallo', '2015-06-07 19:05:11');
INSERT INTO `comment` VALUES ('23', '15', '同求', '颜文青', '2015-06-07 19:08:42');
INSERT INTO `comment` VALUES ('24', '16', '自己顶上去', '颜文青', '2015-06-07 19:08:56');
-- ----------------------------
-- Table structure for note
-- ----------------------------
DROP TABLE IF EXISTS `note`;
CREATE TABLE `note` (
`noteId` int(255) NOT NULL AUTO_INCREMENT,
`noteTitle` text NOT NULL,
`noteContent` text NOT NULL,
`noteAuthor` varchar(255) NOT NULL,
`noteTime` datetime NOT NULL,
`noteClassify` varchar(255) NOT NULL,
PRIMARY KEY (`noteId`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of note
-- ----------------------------
INSERT INTO `note` VALUES ('4', 'c++', 'c++语言好学么', '111111', '2015-05-29 19:29:36', 'C++');
INSERT INTO `note` VALUES ('8', 'html5', 'html5和html的差别', 'tangpan', '2015-05-29 21:21:25', 'HTML5');
INSERT INTO `note` VALUES ('12', '懂oc的来看看', 'object-c怎么实现内存管理', 'Reed', '2015-06-07 18:58:41', 'Object-C');
INSERT INTO `note` VALUES ('13', 'android的ui设计', '求推荐android ui设计方面的书籍', 'Reed', '2015-06-07 18:59:31', '其他');
INSERT INTO `note` VALUES ('15', 'java初学者', 'java初学者,求指导', 'Hallo', '2015-06-07 19:04:28', 'JAVA');
INSERT INTO `note` VALUES ('16', '新人冒泡', '我是c的初学者,过来冒个泡', '颜文青', '2015-06-07 19:08:19', 'C');
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`userId` varchar(255) NOT NULL,
`userPassword` varchar(255) NOT NULL,
`userImage` varchar(255) DEFAULT NULL,
PRIMARY KEY (`userId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('111111', '111111', 'upload/111111.jpg');
INSERT INTO `user` VALUES ('byroner', '111111', 'upload/tp.jpg');
INSERT INTO `user` VALUES ('Hallo', '123123', 'upload/tp.jpg');
INSERT INTO `user` VALUES ('Reed', '111111', 'upload/Reed.jpg');
INSERT INTO `user` VALUES ('tangpan', '123456', 'upload/tp.jpg');
INSERT INTO `user` VALUES ('颜文青', '12341234', 'upload/颜文青.jpg');
| true
|
d29abbc6abfef7e8f10e85948528db5ec9f52980
|
SQL
|
matt-winkler/demo-subdirectories
|
/dbt/tests/models/marts/core/dim_customers.sql
|
UTF-8
| 904
| 3.4375
| 3
|
[] |
no_license
|
{{
config(
materialized = 'table',
transient=false
)
}}
with customer as (
select * from {{ ref('stg_tpch_customers') }}
),
nation as (
select * from {{ ref('stg_tpch_nations') }}
),
region as (
select * from {{ ref('stg_tpch_regions') }}
),
final as (
select
customer.customer_key,
customer.name,
customer.address,
{# nation.nation_key as nation_key, #}
nation.name as nation,
{# region.region_key as region_key, #}
region.name as region,
customer.phone_number,
customer.account_balance,
customer.market_segment
-- new column
from
customer
inner join nation
on customer.nation_key = nation.nation_key
inner join region
on nation.region_key = region.region_key
)
select
*
from
final
order by
customer_key
| true
|
af4a1252898fff58b90c740b464f5dcd521eadbd
|
SQL
|
Jauhar-Wibisono/stand-by-dorayaki-backend
|
/setup.sql
|
UTF-8
| 782
| 3.609375
| 4
|
[] |
no_license
|
DROP DATABASE IF EXISTS stand_by_dorayaki_db;
CREATE DATABASE stand_by_dorayaki_db;
USE stand_by_dorayaki_db;
CREATE TABLE IF NOT EXISTS dorayaki(
id_dorayaki BIGINT AUTO_INCREMENT,
rasa VARCHAR(255) UNIQUE NOT NULL,
deskripsi VARCHAR(255),
gambar VARCHAR(255) NOT NULL, # karena mau nyimpen path
PRIMARY KEY (id_dorayaki)
);
CREATE TABLE IF NOT EXISTS toko(
id_toko BIGINT AUTO_INCREMENT,
nama VARCHAR(255) NOT NULL,
jalan VARCHAR(255),
kecamatan VARCHAR(255),
provinsi VARCHAR(255),
PRIMARY KEY (id_toko)
);
CREATE TABLE IF NOT EXISTS stok_toko(
id_dorayaki BIGINT NOT NULL,
id_toko BIGINT NOT NULL,
jumlah INT NOT NULL,
FOREIGN KEY (id_dorayaki) REFERENCES dorayaki(id_dorayaki),
FOREIGN KEY (id_toko) REFERENCES toko(id_toko),
UNIQUE(id_dorayaki, id_toko)
);
| true
|
fc911c7a9c2ae98163a3755b2bbc43ad5b92f482
|
SQL
|
sircanist/clipper
|
/clipper-cli/src/test/scripts/v_Subj19Course.sql
|
UTF-8
| 204
| 2.859375
| 3
|
[
"Apache-2.0"
] |
permissive
|
DROP VIEW v_Subj19Course CASCADE;
CREATE OR REPLACE VIEW v_Subj19Course AS
SELECT innerRel.x1 AS att1
FROM (
SELECT ca_0.individual AS x1
FROM concept_assertion ca_0
WHERE ca_0.concept=71
) as innerRel
| true
|
44464c27860dcfebf52a55e816063ef636c9d2e0
|
SQL
|
juanmetalmolina89/invent
|
/DB_IVE/35_PK_IVE_INVENTARIO.sql
|
UTF-8
| 10,437
| 2.640625
| 3
|
[] |
no_license
|
create or replace PACKAGE "PK_IVE_INVENTARIO" is
/********************************************************************************
DESCRIPCION : Paquete utilizado para agrupar todos los procedimientos y funciones
para la administraci?n de inventarios
REALIZADO POR : Luis Felipe Rueda Forero
FECHA CREACION : 08/12/2016
FECHA MODIFICA :
MODIFICADO POR :
DESCRIPCION CAMBIO:
*******************************************************************************/
NOMBRE_PAQUETE CONSTANT VARCHAR2(100) := 'PK_IVE_INVENTARIO';
TYPE CURSOR_SALIDA IS REF CURSOR;
procedure Pr_RegistrarInventario (p_A003OBJETO IN IVET_T003_INVENTARIO.A003OBJETO%TYPE,
p_A003FECHA_INICIAL IN IVET_T003_INVENTARIO.A003FECHA_INICIAL%TYPE,
p_A003FECHA_FINAL IN IVET_T003_INVENTARIO.A003FECHA_FINAL%TYPE,
p_A003IDDIVIPOLA IN IVET_T003_INVENTARIO.A003IDDIVIPOLA%TYPE,
p_A003DESCRIPCION_TERRITORIO IN IVET_T003_INVENTARIO.A003DESCRIPCION_TERRITORIO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ActualizarInventario (p_A003CODIGO IN IVET_T003_INVENTARIO.A003CODIGO%TYPE,
p_A003OBJETO IN IVET_T003_INVENTARIO.A003OBJETO%TYPE,
p_A003FECHA_INICIAL IN IVET_T003_INVENTARIO.A003FECHA_INICIAL%TYPE,
p_A003FECHA_FINAL IN IVET_T003_INVENTARIO.A003FECHA_FINAL%TYPE,
p_A003ESTADO_INVENTARIO IN IVET_T003_INVENTARIO.A003ESTADO_INVENTARIO%TYPE,
p_A003IDDIVIPOLA IN IVET_T003_INVENTARIO.A003IDDIVIPOLA%TYPE,
p_A003DESCRIPCION_TERRITORIO IN IVET_T003_INVENTARIO.A003DESCRIPCION_TERRITORIO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ConsultarInventarioId (p_A003CODIGO IN IVET_T003_INVENTARIO.A003CODIGO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_EliminarInventario (p_A003CODIGO IN IVET_T003_INVENTARIO.A003CODIGO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ListarInventario (p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ConsultarGrillaInv (p_PalabraClave IN VARCHAR2,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_RegistrarInvFuente (p_A007IDINVENTARIO IN IVET_T007_INVENTARIOFUENTE.A007IDINVENTARIO%TYPE,
p_A007IDFUENTE IN IVET_T007_INVENTARIOFUENTE.A007IDFUENTE%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_EliminarInvFuente (p_A007CODIGO IN IVET_T007_INVENTARIOFUENTE.A007CODIGO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ConsultarInvFuente (p_A007IDINVENTARIO IN IVET_T007_INVENTARIOFUENTE.A007IDINVENTARIO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_RegistrarInvContamina (p_A016IDINVENTARIO IN IVET_T016_INVENTCONTAMINA.A016IDINVENTARIO%TYPE,
p_A016IDCONTAMINANTE IN IVET_T016_INVENTCONTAMINA.A016IDCONTAMINANTE%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_EliminarInvContamina (p_A016CODIGO IN IVET_T016_INVENTCONTAMINA.A016CODIGO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ConsultarInvContamina (p_A016IDINVENTARIO IN IVET_T016_INVENTCONTAMINA.A016IDINVENTARIO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_RegistrarGometria (p_A004GEOMETRIA IN IVET_T004_GEOMETRIA.A004GEOMETRIA%TYPE,
p_A004IDINVENTARIO IN IVET_T004_GEOMETRIA.A004IDINVENTARIO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ConsultarGometriaId (p_A004IDINVENTARIO IN IVET_T004_GEOMETRIA.A004IDINVENTARIO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ActualizarGeometria (p_A004CODIGO IN IVET_T004_GEOMETRIA.A004CODIGO%TYPE,
p_A004GEOMETRIA IN IVET_T004_GEOMETRIA.A004GEOMETRIA%TYPE,
p_A004IDINVENTARIO IN IVET_T004_GEOMETRIA.A004IDINVENTARIO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_RegistrarAdjunto (p_A014NOMBREADJUNTO IN IVET_T014_ADJUNTO.A014NOMBREADJUNTO%TYPE,
p_A014RUTAADJUNTO IN IVET_T014_ADJUNTO.A014RUTAADJUNTO%TYPE,
p_A014IDINVENTARIO IN IVET_T014_ADJUNTO.A014IDINVENTARIO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ActualizarAdjunto (p_A014CODIGO IN IVET_T014_ADJUNTO.A014CODIGO%TYPE,
p_A014NOMBREADJUNTO IN IVET_T014_ADJUNTO.A014NOMBREADJUNTO%TYPE,
p_A014RUTAADJUNTO IN IVET_T014_ADJUNTO.A014RUTAADJUNTO%TYPE,
p_A014IDINVENTARIO IN IVET_T014_ADJUNTO.A014IDINVENTARIO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ConsultarAdjuntoId (p_A014IDINVENTARIO IN IVET_T014_ADJUNTO.A014IDINVENTARIO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_CambioEstadoInv (p_A003CODIGO IN IVET_T003_INVENTARIO.A003CODIGO%TYPE,
p_A003OBS_RECHAZO IN IVET_T003_INVENTARIO.A003OBS_RECHAZO%TYPE,
p_estpasa IN NUMBER, --estado al que pasa el inventario
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
end PK_IVE_INVENTARIO;
| true
|
e7643bcb15856ae6f7f03fc650e0fc6d7f9766b8
|
SQL
|
jhekasoft/jhekasoft0
|
/inf/jhekasoft_structure.sql
|
UTF-8
| 4,972
| 3.265625
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Июн 24 2013 г., 04:07
-- Версия сервера: 5.5.31-MariaDB-log
-- Версия PHP: 5.4.16
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 */;
--
-- База данных: `jhekasoft`
--
CREATE DATABASE IF NOT EXISTS `jhekasoft` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `jhekasoft`;
-- --------------------------------------------------------
--
-- Структура таблицы `jh_blog`
--
CREATE TABLE IF NOT EXISTS `jh_blog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`datetime` datetime NOT NULL,
`title` varchar(255) NOT NULL,
`cut_text` text NOT NULL,
`text` text NOT NULL,
`image` varchar(255) NOT NULL,
`show` enum('no','yes') NOT NULL DEFAULT 'no',
`show_comments` enum('no','yes') NOT NULL DEFAULT 'no',
`meta_title` varchar(255) NOT NULL,
`meta_description` varchar(255) NOT NULL,
`meta_keywords` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
-- --------------------------------------------------------
--
-- Структура таблицы `jh_final_countdown_email`
--
CREATE TABLE IF NOT EXISTS `jh_final_countdown_email` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
`ip` varchar(255) NOT NULL,
`server_info` longtext NOT NULL,
`email` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
-- --------------------------------------------------------
--
-- Структура таблицы `jh_page`
--
CREATE TABLE IF NOT EXISTS `jh_page` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`par_id` int(11) NOT NULL,
`datetime` datetime NOT NULL,
`title` varchar(255) NOT NULL,
`author` varchar(255) NOT NULL,
`text` text NOT NULL,
`image` varchar(255) NOT NULL,
`show` enum('no','yes') NOT NULL DEFAULT 'no',
`show_share` enum('no','yes') NOT NULL DEFAULT 'yes',
`show_comments` enum('no','yes') NOT NULL DEFAULT 'no',
`meta_title` varchar(255) NOT NULL,
`meta_description` varchar(255) NOT NULL,
`meta_keywords` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;
-- --------------------------------------------------------
--
-- Структура таблицы `jh_software`
--
CREATE TABLE IF NOT EXISTS `jh_software` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`datetime` datetime NOT NULL,
`title` varchar(255) NOT NULL,
`version` varchar(255) NOT NULL,
`short_text` text NOT NULL,
`text` text NOT NULL,
`image` varchar(255) NOT NULL,
`file` varchar(255) NOT NULL,
`archive` enum('yes','no') NOT NULL DEFAULT 'no',
`show` enum('no','yes') NOT NULL DEFAULT 'no',
`type` enum('software','game') NOT NULL DEFAULT 'software',
`author_id` int(11) NOT NULL,
`platform_linux` enum('0','1') NOT NULL DEFAULT '0',
`platform_android` enum('0','1') NOT NULL DEFAULT '0',
`platform_www` enum('0','1') NOT NULL DEFAULT '0',
`platform_windows` enum('0','1') NOT NULL DEFAULT '0',
`meta_title` varchar(255) NOT NULL,
`meta_description` varchar(255) NOT NULL,
`meta_keywords` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;
-- --------------------------------------------------------
--
-- Структура таблицы `jh_sound`
--
CREATE TABLE IF NOT EXISTS `jh_sound` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`datetime` datetime NOT NULL,
`author` varchar(255) NOT NULL,
`title` varchar(255) NOT NULL,
`lyrics` text NOT NULL,
`file` varchar(255) NOT NULL,
`file2` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
-- --------------------------------------------------------
--
-- Структура таблицы `jh_user`
--
CREATE TABLE IF NOT EXISTS `jh_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`login` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `login` (`login`),
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
/*!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
|
d1bd8862e28aabeac97b86b7ae4192c6b2358e92
|
SQL
|
danielacapassi/projetobancodedados
|
/pedido.sql
|
UTF-8
| 2,075
| 3.09375
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 24-Out-2020 às 20:15
-- Versão do servidor: 10.4.14-MariaDB
-- versão do PHP: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Banco de dados: `recode`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `pedido`
--
CREATE TABLE `pedido` (
`idpedidos` int(11) NOT NULL,
`nomedocliente` varchar(150) NOT NULL,
`endereco` varchar(230) NOT NULL,
`telefone` varchar(45) NOT NULL,
`nome do produto` varchar(200) NOT NULL,
`valorunitario` decimal(8,2) NOT NULL,
`quantidade` int(10) NOT NULL,
`valortotal` decimal(8,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Extraindo dados da tabela `pedido`
--
INSERT INTO `pedido` (`idpedidos`, `nomedocliente`, `endereco`, `telefone`, `nome do produto`, `valorunitario`, `quantidade`, `valortotal`) VALUES
(1, 'Daniela Capassi Moreira', 'Rua:Sebastião da Nóbrega, 66 cep:0402-160 Interlagos', '11 -5522-0355', 'Refrigerador Brastemp Frost Free - 375Litros', '2269.00', 1, '2269.00'),
(2, 'Antonia Maria da Silva', 'Rua: Joaquim Nabuco, 44 cep:07923-010 Jardim Aleatório', '13-4567-3426', 'Forno de micro-ondas Philco com Porta Espelhada - 25 Litros', '2269.00', 1, '2269.00');
--
-- Índices para tabelas despejadas
--
--
-- Índices para tabela `pedido`
--
ALTER TABLE `pedido`
ADD PRIMARY KEY (`idpedidos`);
--
-- AUTO_INCREMENT de tabelas despejadas
--
--
-- AUTO_INCREMENT de tabela `pedido`
--
ALTER TABLE `pedido`
MODIFY `idpedidos` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
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
|
0a969a01c95ac0ca42efacf82a931e43ef894fb9
|
SQL
|
P79N6A/fast
|
/install/efast365/pro_report_base_order_collect.sql
|
UTF-8
| 8,867
| 3.921875
| 4
|
[] |
no_license
|
DROP PROCEDURE IF EXISTS pro_report_base_order_collect;
CREATE PROCEDURE `pro_report_base_order_collect`(kh_id INT,biz_date varchar(30) , OUT out_respones INT)
mypro:BEGIN
declare start_date varchar(30);
declare end_date varchar(30);
SET start_date = CONCAT(biz_date,' 00:00:00');
SET end_date = CONCAT(biz_date,' 23:59:59');
SET out_respones = -1;
/*销售数据插入*/
INSERT IGNORE INTO report_base_order_collect
(kh_id,biz_date,sale_channel_code,sale_channel_name,shop_code,shop_name,order_sale_count,order_sale_money,order_sale_express_money)
SELECT kh_id,biz_date,base_sale_channel.sale_channel_code,base_sale_channel.sale_channel_name,tmp.shop_code,tmp.shop_code,tmp.order_count,tmp.order_sale_money,order_sale_express_money
FROM base_sale_channel,
(
SELECT oms_sell_record.sale_channel_code,oms_sell_record.shop_code,COUNT(1) as order_count,SUM(oms_sell_record.payable_money) as order_sale_money,
SUM(express_money) as order_sale_express_money
FROM oms_sell_record
WHERE ((pay_time >= start_date AND pay_time < end_date) OR (pay_type = 'cod' AND create_time >= start_date AND create_time < end_date)) AND order_status<>3
GROUP BY oms_sell_record.shop_code
) as tmp
WHERE base_sale_channel.sale_channel_code = tmp.sale_channel_code
ON DUPLICATE KEY UPDATE order_sale_count = values(order_sale_count),order_sale_money = values(order_sale_money),order_sale_express_money = values(order_sale_express_money);
/*更新具体商品销售数量*/
UPDATE report_base_order_collect ,
(
SELECT tmp.shop_code,SUM(oms_sell_record_detail.num) as num FROM oms_sell_record_detail ,
(
SELECT shop_code,sell_record_code
FROM oms_sell_record
WHERE (oms_sell_record.pay_time >= start_date AND oms_sell_record.pay_time < end_date) AND oms_sell_record.order_status<>3
) as tmp
WHERE tmp.sell_record_code = oms_sell_record_detail.sell_record_code GROUP BY tmp.shop_code
) as tmp2
SET report_base_order_collect.goods_sale_count = tmp2.num
WHERE report_base_order_collect.kh_id = kh_id AND report_base_order_collect.biz_date = biz_date AND report_base_order_collect.shop_code = tmp2.shop_code;
/*退单申请笔数与金额*/
INSERT IGNORE INTO report_base_order_collect
(kh_id,biz_date,sale_channel_code,sale_channel_name,shop_code,shop_name,refund_apply_count,refund_apply_money)
SELECT kh_id,biz_date,tmp.sale_channel_code,tmp.sale_channel_code,tmp.shop_code,tmp.shop_code,tmp.refund_apply_count,tmp.refund_apply_money FROM
(
SELECT sale_channel_code,shop_code,
COUNT(1) AS refund_apply_count,SUM(refund_total_fee) AS refund_apply_money FROM oms_sell_return WHERE return_order_status <> 3 AND (create_time > start_date AND create_time < end_date)
GROUP BY shop_code
) as tmp
ON DUPLICATE KEY UPDATE report_base_order_collect.refund_apply_count = values(refund_apply_count),report_base_order_collect.refund_apply_money = values(refund_apply_money)
;
/*发货订单笔数和发货金额*/
INSERT IGNORE INTO report_base_order_collect
(kh_id,biz_date,sale_channel_code,sale_channel_name,shop_code,shop_name,order_shipping_count,order_shipping_money,order_shipping_goods_count)
SELECT kh_id,biz_date,base_sale_channel.sale_channel_code,base_sale_channel.sale_channel_name,tmp.shop_code,tmp.shop_code,tmp.order_shipping_count,tmp.order_shipping_money,tmp.order_shipping_goods_count
FROM base_sale_channel,
(
SELECT oms_sell_record.sale_channel_code,oms_sell_record.shop_code,COUNT(1) as order_shipping_count,SUM(oms_sell_record.payable_money) as order_shipping_money,SUM(goods_num) AS order_shipping_goods_count
FROM oms_sell_record
WHERE (delivery_time >= start_date AND delivery_time < end_date) AND order_status<>3 AND shipping_status = 4
GROUP BY oms_sell_record.shop_code
) as tmp
WHERE base_sale_channel.sale_channel_code = tmp.sale_channel_code
ON DUPLICATE KEY UPDATE order_shipping_count = values(order_shipping_count),order_shipping_money = values(order_shipping_money),order_shipping_goods_count = values(order_shipping_goods_count);
/*未发货订单笔数和未发货金额*/
INSERT IGNORE INTO report_base_order_collect
(kh_id,biz_date,sale_channel_code,sale_channel_name,shop_code,shop_name,order_un_shipping_count,order_un_shipping_money,order_un_shipping_goods_count)
SELECT kh_id,biz_date,base_sale_channel.sale_channel_code,base_sale_channel.sale_channel_name,tmp.shop_code,tmp.shop_code,tmp.order_un_shipping_count,tmp.order_un_shipping_money,tmp.order_un_shipping_goods_count
FROM base_sale_channel,
(
SELECT oms_sell_record.sale_channel_code,oms_sell_record.shop_code,COUNT(1) as order_un_shipping_count,SUM(oms_sell_record.payable_money) as order_un_shipping_money,SUM(goods_num) AS order_un_shipping_goods_count
FROM oms_sell_record
WHERE order_status<>3 AND shipping_status <> 4
GROUP BY oms_sell_record.shop_code
) as tmp
WHERE base_sale_channel.sale_channel_code = tmp.sale_channel_code
ON DUPLICATE KEY UPDATE order_un_shipping_count = values(order_un_shipping_count),order_un_shipping_money = values(order_un_shipping_money),order_un_shipping_goods_count = values(order_un_shipping_goods_count);
/*仓库实际收到包裹数*/
INSERT IGNORE INTO report_base_order_collect
(kh_id,biz_date,sale_channel_code,sale_channel_name,shop_code,shop_name,refund_return_goods_order_count)
SELECT kh_id,biz_date,tmp.sale_channel_code,tmp.sale_channel_code,tmp.shop_code,tmp.shop_code,tmp.refund_return_goods_order_count FROM
(
SELECT sale_channel_code,shop_code,
COUNT(1) AS refund_return_goods_order_count,SUM(refund_total_fee) AS refund_apply_money FROM oms_sell_return
WHERE return_order_status <> 3 AND return_shipping_status=1 AND (receive_time >= start_date AND receive_time < end_date)
GROUP BY shop_code
) as tmp
ON DUPLICATE KEY UPDATE report_base_order_collect.refund_return_goods_order_count = values(refund_return_goods_order_count)
;
/*仓库实际收到包裹数的商品数量*/
UPDATE report_base_order_collect ,
(
SELECT
oms_sell_return.sale_channel_code,oms_sell_return.shop_code,SUM(oms_sell_return_detail.recv_num) AS refund_return_goods_count FROM oms_sell_return , oms_sell_return_detail
WHERE oms_sell_return.sell_return_code = oms_sell_return_detail.sell_return_code
AND oms_sell_return.return_order_status <> 3 AND (oms_sell_return.receive_time > start_date AND oms_sell_return.receive_time < end_date) AND oms_sell_return.return_shipping_status = 1
GROUP BY shop_code
) as tmp SET report_base_order_collect.refund_return_goods_count = tmp.refund_return_goods_count
WHERE report_base_order_collect.kh_id = kh_id AND report_base_order_collect.biz_date = biz_date AND report_base_order_collect.shop_code = tmp.shop_code;
/*财务退款金额*/
INSERT IGNORE INTO report_base_order_collect
(kh_id,biz_date,sale_channel_code,sale_channel_name,shop_code,shop_name,refund_actual_money)
SELECT kh_id,biz_date,tmp.sale_channel_code,tmp.sale_channel_code,tmp.shop_code,tmp.shop_code,tmp.refund_actual_money FROM
(
SELECT sale_channel_code,shop_code,
SUM(compensate_money + buyer_express_money + adjust_money + return_avg_money) AS refund_actual_money FROM oms_sell_return
WHERE return_order_status <> 3 AND finance_check_status = 1 AND (finance_confirm_time >= start_date AND finance_confirm_time < end_date)
GROUP BY shop_code
) as tmp
ON DUPLICATE KEY UPDATE report_base_order_collect.refund_actual_money = values(refund_actual_money);
SET out_respones = 0;
/*
SELECT * FROM
(
SELECT biz_date,
SUM(order_sale_count) AS order_sale_count,
SUM(report_base_order_collect.order_sale_money) AS order_sale_money,
SUM(report_base_order_collect.order_shipping_goods_count) AS order_shipping_goods_count,
SUM(report_base_order_collect.order_shipping_count) AS order_shipping_count,
SUM(report_base_order_collect.order_shipping_money) AS order_shipping_money,
SUM(report_base_order_collect.refund_apply_count) AS refund_apply_count,
SUM(report_base_order_collect.refund_apply_money) AS refund_apply_money,
SUM(report_base_order_collect.refund_return_goods_order_count) AS refund_return_goods_order_count,
SUM(report_base_order_collect.refund_return_goods_count) AS refund_return_goods_count,
SUM(report_base_order_collect.refund_actual_money) AS refund_actual_money,
SUM(report_base_order_collect.order_un_shipping_count) AS order_un_shipping_count,
SUM(report_base_order_collect.order_un_shipping_goods_count) AS order_un_shipping_goods_count,
SUM(report_base_order_collect.order_un_shipping_money) AS order_un_shipping_money
FROM report_base_order_collect
WHERE biz_date BETWEEN '2015-07-12' AND '2015-07-13'
GROUP BY biz_date
) AS tmp ORDER BY tmp.biz_date DESC
*/
END
| true
|
68c72d0e46cbbb9b789ef4f6437eccd7a2f14f99
|
SQL
|
andkovs/railroadcompany
|
/src/main/resources/db/migration/V16__createTableRole.sql
|
UTF-8
| 198
| 2.53125
| 3
|
[] |
no_license
|
CREATE TABLE `role` (
`role_id` bigint NOT NULL,
`role_name` varchar(45) DEFAULT NULL,
PRIMARY KEY (`role_id`),
UNIQUE KEY `role_name_unq` (`role_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| true
|
30ea070263fd4bf29fe25ec36fa93a70a24684a6
|
SQL
|
wl1982ss/flask-tutorial
|
/flaskr/schema.sql
|
UTF-8
| 428
| 3.4375
| 3
|
[] |
no_license
|
DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS post;
CREATE TABLE user(
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE post(
id INTEGER PRIMARY KEY AUTOINCREMENT,
author_id INTEGER NOT NULL,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
title TEXT NOT NULL,
body TEXT NOT NULL,
FOREIGN KEY(author_id) REFERENCES user(id)
);
| true
|
a883092f66d9e2fa166445860132ebf6d6a458e3
|
SQL
|
EdOber-DA/sql-challenge
|
/EmployeeSQL/Code/EmployeeSQL_Schema.sql
|
UTF-8
| 1,607
| 4.0625
| 4
|
[] |
no_license
|
-- Schema for sql-challenge - EmployeeSQL
-- Create tables that other tables are dependent on first to avoid foreign key creation in dependent tables
CREATE TABLE Title (
Title_ID varchar(5) NOT NULL PRIMARY KEY,
Title varchar(20) NOT NULL
);
CREATE TABLE Department (
Department_Number varchar(4) NOT NULL PRIMARY KEY,
Department_Name varchar(25) NOT NULL UNIQUE
);
CREATE TABLE Employee (
Employee_Number int NOT NULL PRIMARY KEY,
Employee_Title_ID char(5) NOT NULL,
Birth_Date date NOT NULL,
First_Name varchar(30) NOT NULL,
Last_Name varchar(30) NOT NULL,
Gender char(1) NOT NULL,
Hire_Date date NOT NULL,
FOREIGN KEY(Employee_Title_ID) REFERENCES Title(Title_ID)
);
CREATE TABLE Salary (
Employee_Number int NOT NULL PRIMARY KEY,
Salary int NOT NULL,
FOREIGN KEY(Employee_Number) REFERENCES Employee(Employee_Number)
);
CREATE TABLE Department_Employee (
Employee_Number int NOT NULL,
Department_Number varchar(4) NOT NULL,
PRIMARY KEY (Employee_Number, Department_Number),
FOREIGN KEY(Department_Number) REFERENCES Department(Department_Number),
FOREIGN KEY(Employee_Number) REFERENCES Employee (Employee_Number)
);
CREATE TABLE Department_Manager (
Department_Number varchar(4) NOT NULL,
Employee_Number int NOT NULL,
PRIMARY KEY (Employee_Number, Department_Number),
FOREIGN KEY(Department_Number) REFERENCES Department (Department_Number),
FOREIGN KEY(Employee_Number) REFERENCES Employee (Employee_Number)
);
| true
|
652d2d9357274e2129faa56125254992d624cd95
|
SQL
|
KazminAA/Cinema
|
/src/main/resources/cinema_schema.sql
|
UTF-8
| 5,905
| 3.71875
| 4
|
[] |
no_license
|
-- MySQL Script generated by MySQL Workbench
-- 09/22/16 13:32:08
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema cinema
-- -----------------------------------------------------
DROP SCHEMA IF EXISTS `cinema` ;
-- -----------------------------------------------------
-- Schema cinema
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `cinema` DEFAULT CHARACTER SET latin1 ;
USE `cinema` ;
-- -----------------------------------------------------
-- Table `cinema`.`film`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cinema`.`film` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(60) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`year` INT(11) NULL DEFAULT NULL,
`duration` INT(11) NULL DEFAULT NULL,
`genre` VARCHAR(70) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`country` VARCHAR(45) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`produser` VARCHAR(45) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`cast` VARCHAR(100) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`description` VARCHAR(500) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`smallposter` VARCHAR(200) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`bigposter` VARCHAR(200) CHARACTER SET 'utf8' NULL DEFAULT NULL,
'rait' FLOAT NULL DEFAULT '0',
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 5
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;
-- -----------------------------------------------------
-- Table `cinema`.`hall`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cinema`.`hall` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) CHARACTER SET 'utf8' NOT NULL DEFAULT 'Красный зал',
PRIMARY KEY (`id`),
UNIQUE INDEX `name_UNIQUE` (`name` ASC))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;
-- -----------------------------------------------------
-- Table `cinema`.`structure`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cinema`.`structure` (
`raw` INT(11) NOT NULL,
`columns` INT(11) NOT NULL,
`hallID` INT(11) NOT NULL,
PRIMARY KEY (`hallID`, `raw`),
CONSTRAINT `hallID`
FOREIGN KEY (`hallID`)
REFERENCES `cinema`.`hall` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;
-- -----------------------------------------------------
-- Table `cinema`.`session`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cinema`.`session` (
`id` INT NOT NULL AUTO_INCREMENT,
`filmID` INT NOT NULL,
`datetime` DATETIME NULL,
`hallID` INT NOT NULL,
`price` DECIMAL(10,4) NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `session_unique` (`datetime`, `hallID`),
INDEX `fk_session_film1_idx` (`filmID` ASC),
INDEX `fk_session_hall_idx` (`hallID` ASC),
CONSTRAINT `fk_session_film`
FOREIGN KEY (`filmID`)
REFERENCES `cinema`.`film` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION,
CONSTRAINT `fk_session_hall`
FOREIGN KEY (`hallID`)
REFERENCES `cinema`.`hall` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;
-- -----------------------------------------------------
-- Table `cinema`.`userrole`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cinema`.`userrole` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;
-- -----------------------------------------------------
-- Table `cinema`.`user`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cinema`.`user` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`login` VARCHAR(45) CHARACTER SET 'utf8' NOT NULL DEFAULT 'User',
`passwd` VARCHAR(50) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`email` VARCHAR(50) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`name` VARCHAR(50) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`surname` VARCHAR(60) CHARACTER SET 'utf8' NULL DEFAULT NULL,
`birthday` DATE NULL DEFAULT NULL,
`roleID` INT(11) NOT NULL,
`sex` TINYINT(4) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `login_UNIQUE` (`login` ASC),
UNIQUE INDEX `email_UNIQUE` (`email` ASC),
INDEX `role_id_idx` (`roleID` ASC),
CONSTRAINT `role_id`
FOREIGN KEY (`roleID`)
REFERENCES `cinema`.`userrole` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;
-- -----------------------------------------------------
-- Table `cinema`.`ticket`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cinema`.`ticket` (
`id` INT NOT NULL AUTO_INCREMENT,
`raw` INT NULL,
`col` INT NULL,
`chk` TINYINT(1) NULL,
`purchase` TINYINT(1) NULL,
`timecreate` TIMESTAMP(1) NULL,
`sessionID` INT NULL,
`userID` INT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ticket_key` (`raw`, `col`, `sessionID`),
INDEX `user_id_idx` (`userID` ASC),
INDEX `session_id_idx` (`sessionID` ASC),
CONSTRAINT `user_id`
FOREIGN KEY (`userID`)
REFERENCES `cinema`.`user` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION,
CONSTRAINT `session_id`
FOREIGN KEY (`sessionID`)
REFERENCES `cinema`.`session` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
| true
|
8f63494cf92024cd72eba794009e29968ef69060
|
SQL
|
Letractively/chunksofcode
|
/web-wings-mines/db/setup-db.sql
|
UTF-8
| 643
| 2.953125
| 3
|
[] |
no_license
|
DROP TABLE tminesweeperhighscore;
CREATE TABLE tminesweeperhighscore (
player_name VARCHAR (15) NOT NULL,
game_millisecs INT8 NOT NULL
);
INSERT INTO tminesweeperhighscore (player_name, game_millisecs) VALUES ('andre', 15000);
INSERT INTO tminesweeperhighscore (player_name, game_millisecs) VALUES ('andre', 14999);
INSERT INTO tminesweeperhighscore (player_name, game_millisecs) VALUES ('verena', 2555);
INSERT INTO tminesweeperhighscore (player_name, game_millisecs) VALUES ('andre', 99999999);
SELECT * FROM tminesweeperhighscore order by game_millisecs asc FETCH FIRST 10 rows only;
DELETE FROM tminesweeperhighscore where 1=1;
| true
|
d2e99f690b894b57493760baabc70d3052173133
|
SQL
|
Zamanro/lab-ci
|
/BBB/application/registers.sql
|
UTF-8
| 2,501
| 2.890625
| 3
|
[
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] |
permissive
|
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- โฮสต์: localhost
-- เวลาในการสร้าง:
-- เวอร์ชั่นของเซิร์ฟเวอร์: 5.6.12-log
-- รุ่นของ PHP: 5.4.12
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 */;
--
-- ฐานข้อมูล: `registers`
--
CREATE DATABASE IF NOT EXISTS `registers` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
USE `registers`;
-- --------------------------------------------------------
--
-- โครงสร้างตาราง `fileupload`
--
CREATE TABLE IF NOT EXISTS `fileupload` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`name` varchar(50) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=13 ;
--
-- dump ตาราง `fileupload`
--
INSERT INTO `fileupload` (`id`, `name`) VALUES
(12, 'xyz');
-- --------------------------------------------------------
--
-- โครงสร้างตาราง `userid`
--
CREATE TABLE IF NOT EXISTS `userid` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`username` varchar(50) COLLATE utf8_bin NOT NULL,
`password` varchar(50) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=62 ;
--
-- dump ตาราง `userid`
--
INSERT INTO `userid` (`id`, `username`, `password`) VALUES
(61, '552535009', '1234');
-- --------------------------------------------------------
--
-- โครงสร้างตาราง `userinfo`
--
CREATE TABLE IF NOT EXISTS `userinfo` (
`userinfoid` int(9) NOT NULL AUTO_INCREMENT,
`field` varchar(50) COLLATE utf8_bin NOT NULL,
`fieldValue` varchar(50) COLLATE utf8_bin NOT NULL,
`id` int(9) NOT NULL,
PRIMARY KEY (`userinfoid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=58 ;
--
-- dump ตาราง `userinfo`
--
INSERT INTO `userinfo` (`userinfoid`, `field`, `fieldValue`, `id`) VALUES
(57, 'Name', 'Worapon', 0);
/*!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
|
6ffb7df26c62d7951a1f96e080e5094d3fe60ca7
|
SQL
|
blockchain-etl/bitcoin-etl-airflow
|
/dags/resources/stages/enrich/sqls/outputs.sql
|
UTF-8
| 442
| 2.71875
| 3
|
[
"MIT"
] |
permissive
|
SELECT
transactions.hash as transaction_hash,
transactions.block_hash,
transactions.block_number,
transactions.block_timestamp,
outputs.index,
outputs.script_asm,
outputs.script_hex,
outputs.required_signatures,
outputs.type,
outputs.addresses,
outputs.value
FROM `{{params.destination_dataset_project_id}}.{{params.dataset_name}}.transactions` as transactions,
transactions.outputs as outputs
| true
|
6adad465a12ed954808b5caadfb1e5a3d2eefc94
|
SQL
|
XingXing2019/LeetCode
|
/Database/LeetCode 612 - ShortestDistanceInAPlane/ShortestDistanceInAPlane_MySQL.sql
|
UTF-8
| 210
| 3.125
| 3
|
[] |
no_license
|
select distinct min(round(sqrt(abs(p1.x - p2.x) * abs(p1.x - p2.x) + abs(p1.y - p2.y) * abs(p1.y - p2.y)), 2)) as shortest from
point_2d p1 cross join point_2d p2
where abs(p1.x - p2.x) + abs(p1.y - p2.y) <> 0
| true
|
23b2c7416e5c22c0b19f242a90e9e5a57e8b7f81
|
SQL
|
charliejharrison/elefriends
|
/src/SQL/flagged_posts_with_unique_types.sql
|
UTF-8
| 501
| 3.953125
| 4
|
[] |
no_license
|
SELECT DISTINCT posts.id post_id, content_flag_types.name flag_type, posts.text post_text
FROM content_flaggings
INNER JOIN content_flag_types
ON content_flaggings.content_flag_type_id = content_flag_types.id
INNER JOIN content_flags
ON content_flaggings.content_flag_id = content_flags.id
INNER JOIN posts
ON content_flags.attachable_id = posts.id
WHERE content_flags.attachable_type = 'Post'
ORDER BY flag_type
| true
|
53bc1399ab41545677caffb3e26a872b5e4149ca
|
SQL
|
dev-with-dave/sql-course
|
/update.sql
|
UTF-8
| 1,717
| 4.21875
| 4
|
[] |
no_license
|
/*
La commande UPDATE permet d’effectuer des modifications sur des lignes existantes.
Très souvent cette commande est utilisée avec WHERE pour spécifier
sur quelles lignes doivent porter la ou les modifications.
*/
-- La syntaxe basique d’une requête utilisant UPDATE est la suivante :
UPDATE nom_de_table
SET nom_colonne_1 = 'nouvelle valeur'
WHERE condition;
/*
Cette syntaxe permet d’attribuer une nouvelle valeur à la colonne nom_colonne_1
pour les lignes qui respectent la condition stipulé avec WHERE.
Il est aussi possible d’attribuer la même valeur à la colonne nom_colonne_1
pour toutes les lignes d’une table si la condition WHERE n’était pas utilisée.
*/
/*
Pour spécifier en une seule fois plusieurs modification,
il faut séparer les attributions de valeur par des virgules.
Ainsi la syntaxe deviendrait la suivante :
*/
UPDATE nom_de_table
SET colonne_1 = 'valeur 1',
colonne_2 = 'valeur 2',
colonne_3 = 'valeur 3'
WHERE condition;
--? exercice :
--? 1) dans la table users, modifier le first_name de l'enregistrement portant l'id 3
--? 2) dans la table users, modifier le first_name et age de l'enregistrement portant l'id 5
--? 3) dans la table users ajouter une colonne is_admin qui est un bouleen avec une valeur par défaut à false
--? ensuite passer cette valeur a true pour l'enregistrement portant l'id 1 et 4
--! correction
--* 1)
UPDATE users SET first_name = "Alex" WHERE user_id = 3;
--* 2)
UPDATE users SET first_name = "Brian", age = 21 WHERE user_id = 5;
--* 3)
ALTER TABLE users ADD COLUMN is_admin BOOLEAN DEFAULT false;
UPDATE users SET is_admin = true WHERE user_id IN (1, 4);
| true
|
f2c501dd2393c570acb1a5956b5d6d15c9347f45
|
SQL
|
deanlxvii/ci
|
/app/delicious/db/sqlite/delicious.ddl
|
UTF-8
| 2,515
| 3.546875
| 4
|
[] |
no_license
|
CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"name" varchar(255) NOT NULL UNIQUE,
"created_at" datetime,
"updated_at" datetime);
CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"url" varchar(255) NOT NULL UNIQUE,
"created_at" datetime,
"updated_at" datetime);
CREATE TABLE "tags" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"tag" varchar(255) NOT NULL UNIQUE,
"created_at" datetime,
"updated_at" datetime);
CREATE TABLE "extendeds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"extended" text,
"user_id" integer,
"url_id" integer,
"created_at" datetime,
"updated_at" datetime,
FOREIGN KEY("url_id") REFERENCES urls("id"),
FOREIGN KEY("user_id") REFERENCES users("id")
);
CREATE TABLE "descriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"description" text,
"url_id" integer,
"created_at" datetime,
"updated_at" datetime,
FOREIGN KEY("url_id") REFERENCES urls("id")
);
CREATE TABLE "url_dates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"url_date" datetime,
"url_id" integer,
"user_id" integer,
"created_at" datetime,
"updated_at" datetime,
FOREIGN KEY("url_id") REFERENCES urls("id"),
FOREIGN KEY("user_id") REFERENCES users("id")
);
CREATE TABLE "user_url_tags" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"user_id" integer,
"url_id" integer,
"tag_id" integer,
"created_at" datetime,
"updated_at" datetime,
FOREIGN KEY("url_id") REFERENCES urls("id"),
FOREIGN KEY("user_id") REFERENCES users("id")
);
| true
|
70438d9fa94e99af40f66fbfe09c4011afecd270
|
SQL
|
denini08/Youtube
|
/php-webapp-mvc/sql.sql
|
UTF-8
| 803
| 3.75
| 4
|
[] |
no_license
|
create database mydb;
use mydb;
create table if not exists users (
id int auto_increment primary key,
nickname varchar(15) not null unique,
email varchar(40) not null unique,
password varchar(60) not null,
created_at timestamp default current_timestamp(),
updated_at timestamp default current_timestamp()
);
create table if not exists avatars (
id int auto_increment primary key,
user int not null unique,
image longblob not null,
name varchar(255) default 'image',
constraint avatars_user_fk foreign key(user)
references users(id)
on delete cascade
on update cascade
);
create table if not exists feedbacks (
id int auto_increment primary key,
user int not null,
comment varchar(255),
constraint feedbacks_user_fk foreign key(user)
references users(id)
on delete cascade
on update cascade
);
| true
|
10eef799e3bde646b902abf11fcd706f37186478
|
SQL
|
danielmuxel/sqlite-express-api
|
/database/database.sql
|
UTF-8
| 1,531
| 3.640625
| 4
|
[] |
no_license
|
CREATE TABLE IF NOT EXISTS projects (
id integer PRIMARY KEY NOT NULL,
name text NOT NULL
);
CREATE TABLE IF NOT EXISTS customers (
id integer PRIMARY KEY NOT NULL,
firstname text NOT NULL,
lastname text NOT NULL,
phone text,
email text
);
CREATE TABLE IF NOT EXISTS addresses (
id integer PRIMARY KEY NOT NULL,
street text NOT NULL,
postcode text NOT NULL,
city text NOT NULL,
country text NOT NULL
);
CREATE TABLE IF NOT EXISTS customer_addresses (
id integer PRIMARY KEY NOT NULL,
customerId integer NOT NULL,
addressId integer NOT NULL,
FOREIGN KEY(customerId) REFERENCES customers(id)
FOREIGN KEY(addressId) REFERENCES addresses(id)
);
INSERT INTO projects (name)
VALUES
('Projekt Ros Boesch'),
('Projekt Carla Kiefer'),
('Projekt Amalric Schlimme'),
('Projekt Herrick Wegener'),
('Projekt Wiebe Frei');
INSERT INTO customers (firstname, lastname, phone, email)
VALUES
('Ros', 'Boesch', '09194957508', 'ros.boesch@email.com'),
('Carla', 'Kiefer', '06502820528', 'carla.biefer@email.com'),
('Amalric', 'Schlimme', '02771556234', 'amalric.schlimme@email.com'),
('Herrick', 'Wegener', '07024322248', 'herrick.wegener@email.com'),
('Wiebe', 'Frei', '030999530', 'wiebe.frei@email.com');
INSERT INTO addresses (street, postcode, city, country)
VALUES
('Hochstrasse 78', '25966', 'Westerland', 'DE'),
('Kieler Strasse 49', '83246', 'Unterwössen', 'DE'),
('Eichendorffstr. 67', '88090', 'Immenstaad', 'DE'),
('Stuttgarter Platz 32', '63832', 'Sulzbach', 'DE'),
('Schönhauser Allee 11', '79848', 'Bonndorf', 'DE');
INSERT INTO customer_addresses (customerId, addressId)
VALUES
(1, 1),
(2, 2),
(3, 3),
(4, 4),
(5, 5);
| true
|
f4a1a310d12116dbce03fd2ff6037708a90f801e
|
SQL
|
luutruonghailan/hoc-lap-trinh-online-zendvn
|
/khoa-hoc-lap-trinh-php/ch07/sql/02-where.sql
|
UTF-8
| 1,604
| 4
| 4
|
[] |
no_license
|
-- 07. Hiển thị tất cả thông tin của kiến trúc sư "le thanh tung"
SELECT * FROM architect
WHERE name = "le thanh tung";
-- 08. Hiển thị tên, năm sinh các công nhân có chuyên môn hàn hoặc điện
SELECT name, birthday, skill FROM worker
WHERE skill = "han" OR skill = "dien";
-- 09. Hiển thị tên các công nhân có chuyên môn hàn hoặc điện và năm sinh lớn hơn 1948
SELECT name, birthday, skill FROM worker
WHERE (skill = "han" OR skill = "dien") AND (birthday > 1948);
-- 10. Hiển thị những công nhân bắt đầu vào nghề khi dưới 20 (birthday + 20 > year)
SELECT * FROM worker
WHERE birthday + 20 > year;
-- 11. Hiển thị những công nhân có năm sinh 1945, 1940, 1948
-- C1
SELECT * FROM worker
WHERE birthday = 1945 OR birthday = 1940 OR birthday = 1948;
-- C2
SELECT * FROM worker
WHERE birthday NOT IN (1940, 1945, 1948);
-- 12. Tìm những công trình có chi phí đầu tư từ 200 đến 500 triệu đồng
-- C1
SELECT * FROM building
WHERE cost >= 200 AND cost <= 500;
-- C2
SELECT * FROM building
WHERE cost BETWEEN 200 AND 500;
-- 13. Tìm kiếm những kiến trúc sư có họ là nguyen: % chuỗi
SELECT * FROM architect
WHERE name LIKE "nguyen%";
-- 14. Tìm kiếm những kiến trúc sư có họ lót là anh
SELECT * FROM architect
WHERE name LIKE "%anh%";
-- 15. Tìm kiếm những kiến trúc sư có tên bắt đầu th và có 3 ký tự
SELECT * FROM architect
WHERE name LIKE "%th_";
-- 16. Tìm chủ thầu không có phone
SELECT * FROM contractor
WHERE phone IS NOT NULL;
| true
|
de48cc0f34b56e176a5f1bc45960e424607cbcd4
|
SQL
|
snowplow-starter-aws/5-data-modeling
|
/src/main/resources/db/migration/V1_0__atomic-def.sql
|
UTF-8
| 5,107
| 3.21875
| 3
|
[
"Apache-2.0"
] |
permissive
|
-- Copyright (c) 2013-2018 Snowplow Analytics Ltd. All rights reserved.
--
-- This program is licensed to you under the Apache License Version 2.0,
-- and you may not use this file except in compliance with the Apache License Version 2.0.
-- You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the Apache License Version 2.0 is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
--
-- Version: 0.11.0
-- URL: -
--
-- Authors: Yali Sassoon, Alex Dean, Peter van Wesep, Fred Blundun, Konstantinos Servis, Mike Robins
-- Copyright: Copyright (c) 2013-2018 Snowplow Analytics Ltd
-- License: Apache License Version 2.0
-- Create the schema
CREATE SCHEMA atomic;
-- Create events table
CREATE TABLE atomic.events (
-- App
app_id varchar(255),
platform varchar(255),
-- Date/time
etl_tstamp timestamp,
collector_tstamp timestamp not null,
dvce_created_tstamp timestamp,
-- Event
event varchar(128),
event_id char(36) not null unique,
txn_id int,
-- Namespacing and versioning
name_tracker varchar(128),
v_tracker varchar(100),
v_collector varchar(100) not null,
v_etl varchar(100) not null,
-- User and visit
user_id varchar(255),
user_ipaddress varchar(128),
user_fingerprint varchar(128),
domain_userid varchar(128),
domain_sessionidx int,
network_userid varchar(128),
-- Location
geo_country char(2),
geo_region char(3),
geo_city varchar(75),
geo_zipcode varchar(15),
geo_latitude double precision,
geo_longitude double precision,
geo_region_name varchar(100),
-- IP lookups
ip_isp varchar(100),
ip_organization varchar(128),
ip_domain varchar(128),
ip_netspeed varchar(100),
-- Page
page_url varchar(4096),
page_title varchar(2000),
page_referrer varchar(4096),
-- Page URL components
page_urlscheme varchar(16),
page_urlhost varchar(255),
page_urlport int,
page_urlpath varchar(3000),
page_urlquery varchar(6000),
page_urlfragment varchar(3000),
-- Referrer URL components
refr_urlscheme varchar(16),
refr_urlhost varchar(255),
refr_urlport int,
refr_urlpath varchar(6000),
refr_urlquery varchar(6000),
refr_urlfragment varchar(3000),
-- Referrer details
refr_medium varchar(25),
refr_source varchar(50),
refr_term varchar(255),
-- Marketing
mkt_medium varchar(255),
mkt_source varchar(255),
mkt_term varchar(255),
mkt_content varchar(500),
mkt_campaign varchar(255),
-- Custom structured event
se_category varchar(1000),
se_action varchar(1000),
se_label varchar(4096),
se_property varchar(1000),
se_value double precision,
-- Ecommerce
tr_orderid varchar(255),
tr_affiliation varchar(255),
tr_total dec(18,2),
tr_tax dec(18,2),
tr_shipping dec(18,2),
tr_city varchar(255),
tr_state varchar(255),
tr_country varchar(255),
ti_orderid varchar(255),
ti_sku varchar(255),
ti_name varchar(255),
ti_category varchar(255),
ti_price dec(18,2),
ti_quantity int,
-- Page ping
pp_xoffset_min int,
pp_xoffset_max int,
pp_yoffset_min int,
pp_yoffset_max int,
-- User Agent
useragent varchar(1000),
-- Browser
br_name varchar(50),
br_family varchar(50),
br_version varchar(50),
br_type varchar(50),
br_renderengine varchar(50),
br_lang varchar(255),
br_features_pdf boolean,
br_features_flash boolean,
br_features_java boolean,
br_features_director boolean,
br_features_quicktime boolean,
br_features_realplayer boolean,
br_features_windowsmedia boolean,
br_features_gears boolean,
br_features_silverlight boolean,
br_cookies boolean,
br_colordepth varchar(12),
br_viewwidth int,
br_viewheight int,
-- Operating System
os_name varchar(50),
os_family varchar(50),
os_manufacturer varchar(50),
os_timezone varchar(255),
-- Device/Hardware
dvce_type varchar(50),
dvce_ismobile boolean,
dvce_screenwidth int,
dvce_screenheight int,
-- Document
doc_charset varchar(128),
doc_width int,
doc_height int,
-- Currency
tr_currency char(3),
tr_total_base dec(18, 2),
tr_tax_base dec(18, 2),
tr_shipping_base dec(18, 2),
ti_currency char(3),
ti_price_base dec(18, 2),
base_currency char(3),
-- Geolocation
geo_timezone varchar(64),
-- Click ID
mkt_clickid varchar(128),
mkt_network varchar(64),
-- ETL tags
etl_tags varchar(500),
-- Time event was sent
dvce_sent_tstamp timestamp,
-- Referer
refr_domain_userid varchar(128),
refr_dvce_tstamp timestamp,
-- Session ID
domain_sessionid char(128),
-- Derived timestamp
derived_tstamp timestamp,
-- Event schema
event_vendor varchar(1000),
event_name varchar(1000),
event_format varchar(128),
event_version varchar(128),
-- Event fingerprint
event_fingerprint varchar(128),
-- True timestamp
true_tstamp timestamp,
CONSTRAINT event_id_0110_pk PRIMARY KEY(event_id)
);
CREATE INDEX collector_tstamp_idx ON atomic.events (collector_tstamp);
-- DISTSTYLE KEY
-- DISTKEY (event_id)
-- SORTKEY (collector_tstamp);
| true
|
09f42f30c095f03e01b5fa085ffa85e3a854f36c
|
SQL
|
ftsaylon/infohive-server
|
/db/schema.sql
|
UTF-8
| 9,424
| 3.21875
| 3
|
[] |
no_license
|
-- MySQL dump 10.13 Distrib 5.7.22, for Linux (x86_64)
--
-- Host: localhost Database: dabar
-- ------------------------------------------------------
-- Server version 5.7.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP USER IF EXISTS 'dabar';
CREATE USER 'dabar' IDENTIFIED BY 'pwd@dabar33';
DROP DATABASE IF EXISTS `dabar`;
CREATE DATABASE `dabar`;
GRANT SUPER ON *.* TO 'dabar';
GRANT ALL PRIVILEGES ON dabar.* TO 'dabar' WITH GRANT OPTION;
USE `dabar`;
--
-- Table structure for table `cart`
--
DROP TABLE IF EXISTS `cart`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cart` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`total` float NOT NULL DEFAULT '0',
`date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`checkedout` tinyint(1) NOT NULL DEFAULT '0',
`forapproval` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
CONSTRAINT `cart_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cart_product`
--
DROP TABLE IF EXISTS `cart_product`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cart_product` (
`cart_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`quantity` int(24) NOT NULL,
`price` float NOT NULL,
PRIMARY KEY (`cart_id`,`product_id`),
KEY `product_id` (`product_id`),
CONSTRAINT `cart_product_ibfk_1` FOREIGN KEY (`cart_id`) REFERENCES `cart` (`id`) ON DELETE CASCADE,
CONSTRAINT `cart_product_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `category`
--
DROP TABLE IF EXISTS `farm`;
CREATE TABLE `farm`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`population` int(11),
`name` varchar(128) NOT NULL,
`lat` float(10,6) NOT NULL,
`lng` float(10,6) NOT NULL,
`type` varchar(30) NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
CONSTRAINT `farm_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE SET NULL
);
DROP TABLE IF EXISTS `bee`;
CREATE TABLE `bee` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`farm_id` int(11) NOT NULL,
`name` varchar(256) NOT NULL,
`description` text NOT NULL,
`imageUrl` varchar(1024) DEFAULT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `bee_ibfk_1` FOREIGN KEY (`farm_id`) REFERENCES `farm` (`id`)
);
DROP TABLE IF EXISTS `category`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(128) NOT NULL UNIQUE,
`product_id` int(11),
`deleted` TINYINT(1) NOT NULL DEFAULT '0',
KEY `product_id` (`product_id`),
PRIMARY KEY (`id`),
CONSTRAINT `category_fk` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `comment`
--
DROP TABLE IF EXISTS `comment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`productId` int(11) NOT NULL,
`comment` text NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`commenter` varchar(512) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `contact`
--
DROP TABLE IF EXISTS `contact`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contact` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(512) NOT NULL,
`address` varchar(512) NOT NULL,
`city` varchar(256) NOT NULL,
`province` varchar(256) NOT NULL,
`zipcode` int(5) NOT NULL,
`phone` varchar(64) DEFAULT NULL,
`email` varchar(256) DEFAULT NULL,
`webUrl` varchar(1024) DEFAULT NULL,
`created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `distributor`
--
DROP TABLE IF EXISTS `distributor`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `distributor` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(512) NOT NULL,
`address` varchar(512) NOT NULL,
`city` varchar(256) NOT NULL,
`province` varchar(256) NOT NULL,
`zipcode` int(5) NOT NULL,
`phone` varchar(64) DEFAULT NULL,
`email` varchar(256) DEFAULT NULL,
`webUrl` varchar(1024) DEFAULT NULL,
`created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `pricechange`
--
DROP TABLE IF EXISTS `pricechange`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pricechange` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`product_id` int(11) NOT NULL,
`price` float NOT NULL,
PRIMARY KEY (`id`),
KEY `product_id` (`product_id`),
CONSTRAINT `pricechange_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `product`
--
DROP TABLE IF EXISTS `product`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL,
`name` varchar(256) NOT NULL,
`description` text NOT NULL,
`distributorId` int(11) DEFAULT NULL,
`contactId` int(11) DEFAULT NULL,
`price` float NOT NULL,
`stock` int(10) NOT NULL,
`size` varchar(128) DEFAULT NULL,
`imageUrl` varchar(1024) DEFAULT NULL,
`siteUrl` varchar(1024) DEFAULT NULL,
`created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
FOREIGN KEY (`category_id`) REFERENCES `category` (`id`) ,
FOREIGN KEY (`distributorId`) REFERENCES `distributor` (`id`) ,
FOREIGN KEY (`contactId`) REFERENCES `contact` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `stocklog`
--
DROP TABLE IF EXISTS `stocklog`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stocklog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`stocks_left` int(10) DEFAULT NULL,
`stocks_changed` int(10) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `product_id` (`product_id`),
CONSTRAINT `stocklog_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(256) NOT NULL,
`is_admin` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`,`email`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!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 2018-07-06 14:23:50
| true
|
4c20f1a0b1585ac3bddaeaa74850964522283078
|
SQL
|
neWorld864/Oracle
|
/PRACTICE.sql
|
UHC
| 1,173
| 3.25
| 3
|
[] |
no_license
|
SELECT EMP_ID, EMP_NAME, DEPT_CODE, SALARY
FROM EMPLOYEE
WHERE DEPT_CODE IS NULL;
/*
213 ϵ 2320000
218 ̿ 2890000
*/
SELECT EMP_ID, EMP_NAME, DEPT_CODE, SALARY
FROM EMPLOYEE
WHERE (DEPT_CODE, SALARY) IN (SELECT DEPT_CODE, MAX(SALARY)
FROM EMPLOYEE
GROUP BY DEPT_CODE)
ORDER BY DEPT_CODE;
/*
900 ä D1 4300000
220 D2 2490000
215 ȥ D5 3760000
205 D6 3900000
212 D8 2550000
200 D9 8000000
*/
----------------------------------------------
CREATE TABLE PRACTICE
AS SELECT * FROM EMPLOYEE;
SELECT * FROM PRACTICE;
SELECT EMP_ID, EMP_NAME, NVL(DEPT_CODE, 'μ'), SALARY
FROM PRACTICE;
SELECT EMP_ID, EMP_NAME, DEPT_CODE, SALARY
FROM PRACTICE
WHERE (DEPT_CODE, SALARY) IN (SELECT DEPT_CODE, MAX(SALARY)
FROM EMPLOYEE
GROUP BY DEPT_CODE)
ORDER BY DEPT_CODE;
/*
900 ä D1 4300000
220 D2 2490000
215 ȥ D5 3760000
205 D6 3900000
212 D8 2550000
200 D9 8000000
*/
ROLLBACK;
| true
|
ee0261ea0548f63539f47e6db1b3ff865fb7905f
|
SQL
|
nadiasfmh/10119278Nadiasitifatimah
|
/10119278_kepegawaian.sql
|
UTF-8
| 4,155
| 3.078125
| 3
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 14 Agu 2021 pada 12.51
-- Versi server: 10.4.20-MariaDB
-- Versi PHP: 7.3.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `db_nadiasitifatimah`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `admin`
--
CREATE TABLE `admin` (
`id` int(11) NOT NULL,
`username` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `admin`
--
INSERT INTO `admin` (`id`, `username`, `password`) VALUES
(1, 'admin', '21232f297a57a5a743894a0e4a801fc3');
-- --------------------------------------------------------
--
-- Struktur dari tabel `gaji`
--
CREATE TABLE `gaji` (
`bulan` int(20) NOT NULL,
`nip` int(20) NOT NULL,
`masuk` int(5) NOT NULL,
`sakit` int(5) NOT NULL,
`izin` int(5) NOT NULL,
`alpha` int(5) NOT NULL,
`lembur` int(5) NOT NULL,
`potongan` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Struktur dari tabel `golongan`
--
CREATE TABLE `golongan` (
`kode_golongan` int(3) NOT NULL,
`nama_golongan` varchar(10) NOT NULL,
`tunjangan_suami_istri` int(10) NOT NULL,
`tunjangan_anak` int(10) NOT NULL,
`uang_makan` int(10) NOT NULL,
`uang_lembur` int(10) NOT NULL,
`askes` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Struktur dari tabel `jabatan`
--
CREATE TABLE `jabatan` (
`kode_jabatan` int(3) NOT NULL,
`nama_jabatan` varchar(40) NOT NULL,
`tunjangan_jabatan` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Struktur dari tabel `pegawai`
--
CREATE TABLE `pegawai` (
`nip_pegawai` int(11) NOT NULL,
`nama_pegawai` varchar(40) NOT NULL,
`kode_jabatan` int(32) NOT NULL,
`kode_golongan` int(3) NOT NULL,
`status` varchar(15) NOT NULL,
`jumlah_anak` int(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Struktur dari tabel `user`
--
CREATE TABLE `user` (
`idadmin` int(5) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `user`
--
INSERT INTO `user` (`idadmin`, `username`, `password`) VALUES
(1, 'admin', 'admin'),
(2, 'admin', '21232f297a57a5a743894a0e4a801fc3');
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `gaji`
--
ALTER TABLE `gaji`
ADD PRIMARY KEY (`bulan`);
--
-- Indeks untuk tabel `golongan`
--
ALTER TABLE `golongan`
ADD PRIMARY KEY (`kode_golongan`);
--
-- Indeks untuk tabel `jabatan`
--
ALTER TABLE `jabatan`
ADD PRIMARY KEY (`kode_jabatan`);
--
-- Indeks untuk tabel `pegawai`
--
ALTER TABLE `pegawai`
ADD PRIMARY KEY (`nip_pegawai`);
--
-- Indeks untuk tabel `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`idadmin`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `gaji`
--
ALTER TABLE `gaji`
MODIFY `bulan` int(20) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `golongan`
--
ALTER TABLE `golongan`
MODIFY `kode_golongan` int(3) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `jabatan`
--
ALTER TABLE `jabatan`
MODIFY `kode_jabatan` int(3) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `pegawai`
--
ALTER TABLE `pegawai`
MODIFY `nip_pegawai` int(11) 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
|
76810acd3301e9dbd0b6c6574870b24baf9ce8d0
|
SQL
|
baozong-gao/ubs_mag
|
/control-service/src/test/resources/后台表.sql
|
UTF-8
| 11,301
| 3.71875
| 4
|
[] |
no_license
|
--1. 创建系统资源表
create table TBL_BTS_SYS_FUNCTION
(
func_id VARCHAR2(20) not null,
func_name VARCHAR2(20),
func_father_id VARCHAR2(20),
func_desc VARCHAR2(100),
func_remark VARCHAR2(255),
func_disable_tag CHAR(1) default 1,
func_create_by VARCHAR2(20),
func_create_datetime TIMESTAMP(6),
func_update_by VARCHAR2(20),
func_update_datetime TIMESTAMP(6),
func_tag CHAR(1) default 0,
func_level CHAR(1) default 4,
func_url VARCHAR2(255),
func_icon VARCHAR2(20),
func_priority NUMBER default 99 not null
);
comment on column TBL_BTS_SYS_FUNCTION.func_disable_tag is '0-禁用 1-启用';
comment on column TBL_BTS_SYS_FUNCTION.func_tag is '0-菜单 1-资源';
comment on column TBL_BTS_SYS_FUNCTION.func_level is '1-一级菜单 2-二级菜单 3-三级菜单 4-资源';
comment on column TBL_BTS_SYS_FUNCTION.func_url is '功能链接';
comment on column TBL_BTS_SYS_FUNCTION.func_icon is '功能图标';
comment on column TBL_BTS_SYS_FUNCTION.func_priority is '优先级(值越小优先级越高)';
alter table TBL_BTS_SYS_FUNCTION add primary key (FUNC_ID) using index ;
--2. 创建系统角色表
create table TBL_BTS_SYS_ROLE
(
role_id VARCHAR2(20) not null,
role_name VARCHAR2(50) not null,
role_disable_tag CHAR(1) default 1,
role_remark VARCHAR2(255),
role_create_by VARCHAR2(20),
role_create_datetime TIMESTAMP(6),
role_updatetime_by VARCHAR2(20),
role_updatetime_datetime TIMESTAMP(6)
)
;
comment on column TBL_BTS_SYS_ROLE.role_disable_tag is '0-禁用 1-启用';
create unique index ROLE_NAME_UK on TBL_BTS_SYS_ROLE (ROLE_NAME);
alter table TBL_BTS_SYS_ROLE add primary key (ROLE_ID) using index ;
--3. 创建角色资源表
create table TBL_BTS_SYS_ROLE_FUNC
(
role_id VARCHAR2(20) not null,
func_id VARCHAR2(20) not null,
role_func_remark VARCHAR2(255),
role_func_create_by VARCHAR2(20),
role_func_create_datetime TIMESTAMP(6),
role_func_update_by VARCHAR2(20),
role_func_update_datetime TIMESTAMP(6)
)
;
alter table TBL_BTS_SYS_ROLE_FUNC add primary key (ROLE_ID, FUNC_ID) using index ;
--4. 创建用户表
create table TBL_BTS_SYS_USR
(
usr_id VARCHAR2(20) not null,
usr_name VARCHAR2(20) not null,
usr_pwd VARCHAR2(64) not null,
usr_remark VARCHAR2(255),
usr_disable_tag CHAR(1) default 1 not null,
usr_email VARCHAR2(50),
usr_create_by VARCHAR2(20),
usr_create_date TIMESTAMP(6),
usr_update_by VARCHAR2(20),
usr_update_date TIMESTAMP(6),
usr_type VARCHAR2(24)
);
comment on column TBL_BTS_SYS_USR.usr_remark is '用户备注';
comment on column TBL_BTS_SYS_USR.usr_disable_tag is '0-禁用 1-启用';
comment on column TBL_BTS_SYS_USR.usr_email is '用户邮箱';
create unique index USR_NAME_UN on TBL_BTS_SYS_USR (USR_NAME);
alter table TBL_BTS_SYS_USR add primary key (USR_ID) using index;
--5. 创建用户角色表
create table TBL_BTS_SYS_USR_ROLE
(
usr_id VARCHAR2(20) not null,
role_id VARCHAR2(20) not null,
usr_role_remark VARCHAR2(255),
usr_role_create_by VARCHAR2(20),
usr_role_create_datetime TIMESTAMP(6),
usr_role_update_by VARCHAR2(20),
usr_role_update_datetime TIMESTAMP(6)
);
alter table TBL_BTS_SYS_USR_ROLE add primary key (USR_ID, ROLE_ID) using index ;
--一些序列(mysql 改成自动增加字段)
create sequence TBL_MER_ROUTE_COUNT_ID_SEQ
minvalue 1
maxvalue 999999999999999
start with 1
increment by 1
cache 20
cycle;
create sequence TBL_BTS_SYS_FUNCTION_ID_SEQ
minvalue 1
maxvalue 999999999999999
start with 55
increment by 1
cache 20
cycle;
create sequence TBL_BTS_SYS_USR_ID_SEQ
minvalue 1
maxvalue 999999999999999
start with 3
increment by 1
cache 20
cycle;
create sequence TBL_BTS_SYS_ROLE_ID_SEQ
minvalue 1
maxvalue 999999999999999
start with 5
increment by 1
cache 20
cycle;
create sequence TBL_BTS_INST_ID_SEQ
minvalue 1
maxvalue 999999999999999
start with 1
increment by 1
cache 20
cycle;
create sequence TBL_BTS_INST_CODE_SEQ
minvalue 1
maxvalue 9999999
start with 1
increment by 1
cache 20
cycle;
create sequence TBL_INST_ROUTE_SEQ
minvalue 1
maxvalue 99999999
start with 1
increment by 1
cache 20
cycle;
--初始数据
insert into TBL_BTS_SYS_USR_ROLE (USR_ID, ROLE_ID, USR_ROLE_REMARK, USR_ROLE_CREATE_BY, USR_ROLE_CREATE_DATETIME, USR_ROLE_UPDATE_BY, USR_ROLE_UPDATE_DATETIME)
values ('1', '1', '管理员', null, null, null, null);
insert into TBL_BTS_SYS_USR (USR_ID, USR_NAME, USR_PWD, USR_REMARK, USR_DISABLE_TAG, USR_EMAIL, USR_CREATE_BY, USR_CREATE_DATE, USR_UPDATE_BY, USR_UPDATE_DATE, USR_TYPE)
values ('1', 'admin', 'nKaUqQKFwDRDLJVQQht7nb1cD0tmc/BfbbzlgFK6IOQkgEGVbujJouyfECkM3AeC', '管理员', '1', 'admin@77pay.com.cn', null, null, null, null, null);
insert into TBL_BTS_SYS_ROLE (ROLE_ID, ROLE_NAME, ROLE_DISABLE_TAG, ROLE_REMARK, ROLE_CREATE_BY, ROLE_CREATE_DATETIME, ROLE_UPDATETIME_BY, ROLE_UPDATETIME_DATETIME)
values ('1', '管理员', '1', '1', null, null, null, null);
insert into TBL_BTS_SYS_FUNCTION (FUNC_ID, FUNC_NAME, FUNC_FATHER_ID, FUNC_DESC, FUNC_REMARK, FUNC_DISABLE_TAG, FUNC_CREATE_BY, FUNC_CREATE_DATETIME, FUNC_UPDATE_BY, FUNC_UPDATE_DATETIME, FUNC_TAG, FUNC_LEVEL, FUNC_URL, FUNC_ICON, FUNC_PRIORITY)
values ('900', '用户维护', '90', '用户维护', '左菜单栏', '1', null, null, null, null, '0', '3', '/userManagement/query_all_user', 'table', 99);
insert into TBL_BTS_SYS_FUNCTION (FUNC_ID, FUNC_NAME, FUNC_FATHER_ID, FUNC_DESC, FUNC_REMARK, FUNC_DISABLE_TAG, FUNC_CREATE_BY, FUNC_CREATE_DATETIME, FUNC_UPDATE_BY, FUNC_UPDATE_DATETIME, FUNC_TAG, FUNC_LEVEL, FUNC_URL, FUNC_ICON, FUNC_PRIORITY)
values ('901', '角色维护', '90', '角色维护', '左菜单栏', '1', null, null, null, null, '0', '3', '/roleManagement/query_all_role', 'table', 99);
insert into TBL_BTS_SYS_FUNCTION (FUNC_ID, FUNC_NAME, FUNC_FATHER_ID, FUNC_DESC, FUNC_REMARK, FUNC_DISABLE_TAG, FUNC_CREATE_BY, FUNC_CREATE_DATETIME, FUNC_UPDATE_BY, FUNC_UPDATE_DATETIME, FUNC_TAG, FUNC_LEVEL, FUNC_URL, FUNC_ICON, FUNC_PRIORITY)
values ('902', '功能维护', '90', '功能维护', '左菜单栏', '1', null, null, null, null, '0', '3', '/funcManagement/query_all_func', 'table', 99);
insert into TBL_BTS_SYS_FUNCTION (FUNC_ID, FUNC_NAME, FUNC_FATHER_ID, FUNC_DESC, FUNC_REMARK, FUNC_DISABLE_TAG, FUNC_CREATE_BY, FUNC_CREATE_DATETIME, FUNC_UPDATE_BY, FUNC_UPDATE_DATETIME, FUNC_TAG, FUNC_LEVEL, FUNC_URL, FUNC_ICON, FUNC_PRIORITY)
values ('13', '系统管理', '8', '系统管理', null, '1', null, null, null, null, '0', '2', null, 'fa-credit-card', 99);
insert into TBL_BTS_SYS_FUNCTION (FUNC_ID, FUNC_NAME, FUNC_FATHER_ID, FUNC_DESC, FUNC_REMARK, FUNC_DISABLE_TAG, FUNC_CREATE_BY, FUNC_CREATE_DATETIME, FUNC_UPDATE_BY, FUNC_UPDATE_DATETIME, FUNC_TAG, FUNC_LEVEL, FUNC_URL, FUNC_ICON, FUNC_PRIORITY)
values ('90', '权限管理', '9', '系统基本管理', '左菜单栏', '1', null, null, null, null, '0', '2', null, null, 99);
insert into TBL_BTS_SYS_FUNCTION (FUNC_ID, FUNC_NAME, FUNC_FATHER_ID, FUNC_DESC, FUNC_REMARK, FUNC_DISABLE_TAG, FUNC_CREATE_BY, FUNC_CREATE_DATETIME, FUNC_UPDATE_BY, FUNC_UPDATE_DATETIME, FUNC_TAG, FUNC_LEVEL, FUNC_URL, FUNC_ICON, FUNC_PRIORITY)
values ('9', '系统管理', null, '系统管理', '标签栏', '1', null, null, null, null, '0', '1', null, null, 99);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '10', '用户维护', null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '11', '角色维护', null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '12', '功能维护', null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '9', '用户管理', null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '8', '123', null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '21', null, null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '14', null, null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '34', null, null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '35', null, null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '900', '左菜单栏', null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '901', '左菜单栏', null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '902', '左菜单栏', null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '13', null, null, null, null, null);
insert into TBL_BTS_SYS_ROLE_FUNC (ROLE_ID, FUNC_ID, ROLE_FUNC_REMARK, ROLE_FUNC_CREATE_BY, ROLE_FUNC_CREATE_DATETIME, ROLE_FUNC_UPDATE_BY, ROLE_FUNC_UPDATE_DATETIME)
values ('1', '90', '左菜单栏', null, null, null, null);
| true
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.