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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
d37e7e5c912ad897fd3975dae59bfa820dda3321 | SQL | savadev/leetcode-sql-4 | /sql/shortest-distance-in-a-line.sql | UTF-8 | 315 | 3.515625 | 4 | [] | no_license | # Write your MySQL query statement below
SELECT
min( abs( tmp_1.x - tmp_2.x ) ) AS shortest
FROM
( SELECT x, ( @a := @a + 1 ) AS id FROM point p, ( SELECT @a := 0 ) a ORDER BY p.x ) tmp_1,
( SELECT x, ( @b := @b + 1 ) AS id FROM point p, ( SELECT @b := 0 ) b ORDER BY p.x ) tmp_2
WHERE
tmp_1.id - tmp_2.id =-1 | true |
00f67e4de2ad37de0788804769fd0cb655562301 | SQL | stel89/test5 | /test3.sql | UTF-8 | 6,247 | 2.90625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Апр 14 2017 г., 13:38
-- Версия сервера: 5.7.17-0ubuntu0.16.04.2
-- Версия PHP: 7.0.15-0ubuntu0.16.04.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... | true |
9174a21454ebdd33e78f8f22a895d29314505adb | SQL | BoseAmrita/realty-administration | /database.sql | UTF-8 | 2,440 | 3.171875 | 3 | [] | no_license |
SET SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO';
CREATE TABLE IF NOT EXISTS Users
(
F_name char(25) NOT NULL,
L_name char(25) NOT NULL,
Uids int NOT NULL AUTO_INCREMENT,
Gender char(10) NOT NULL,
Utype char(25) NOT NULL,
Password char(50) NOT NULL,
PRIMARY KEY (Uids),
CHECK (Gender IN ('Prefer Not to say','Male', ... | true |
fa558ad2fac3937186b6d8481e567157fe13dbd9 | SQL | transcom/mymove | /migrations/app/schema/20191011191842_re_create_domestic_tables.up.sql | UTF-8 | 2,451 | 3.375 | 3 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | create table re_domestic_linehaul_prices
(
id uuid
constraint re_domestic_linehaul_prices_pkey primary key,
contract_id uuid not null
constraint re_domestic_linehaul_prices_contract_id_fkey references re_contracts,
weight_lower integer not null,
weight_upper integer not null,
miles_l... | true |
7cd81d9af11e074eb62f54b93ab5480d9afe27f7 | SQL | harshitrai17152/A-Music-Management-Application-Musify- | /SQL Files/mood.sql | UTF-8 | 4,863 | 3.328125 | 3 | [
"MIT"
] | permissive | create database d7;
use d7;
CREATE TABLE User (
UserID INTEGER,
UserName VARCHAR(100),
LoginID VARCHAR(100),
Password VARCHAR(20),
Subscription BOOLEAN,
Followers INTEGER,
FavouriteArtist VARCHAR(100),
PRIMARY KEY (UserID)
);
CREATE TABLE Artist (
ArtistID INTEGER NOT NULL... | true |
0a04653e8a33473e963f879eb0a7ce18b1382738 | SQL | jalvaran/tss_basante | /ControlAvances/actualizacion_mipres_2021_02_22.sql | UTF-8 | 3,913 | 3.03125 | 3 | [] | no_license | UPDATE `mipres_estados_entrega` SET `estado_entrega` = 'REPORTADO' WHERE `ID` = '2';
UPDATE `mipres_estados_entrega` SET `estado_entrega` = 'PTE. POR REPORTAR' WHERE `ID` = '1';
CREATE TABLE `mipres_estados_reporte_entrega` (
`ID` int(11) NOT NULL,
`estado_reporte_entrega` varchar(45) COLLATE utf8_spanish_ci ... | true |
fe644dab80cb9962136d2d55c395ab5841008df6 | SQL | kickgod/Md-Linux | /oracle/视图_创建_简单视图_01.sql | GB18030 | 284 | 3.125 | 3 | [] | no_license | /*
create force|noforce or replace view viewname
as
slect * from .....
*/
-- force ʾҪͼıҲҪͼ
-- noforce ʾͼ
create or replace view stuinfo
as
select * from Student inner join SC on SC.SNO=STUDENT.SNO;
| true |
92afb02c711f162525c1b1afa4af825634426406 | SQL | thona-seguros/Repositorio-Sicas | /Objetos-BD/Procedimientos/proc_prueba.sql | UTF-8 | 393 | 2.609375 | 3 | [] | no_license | --
-- PROC_PRUEBA (Procedure)
--
-- Dependencies:
-- STANDARD (Package)
-- SYS_STUB_FOR_PURITY_ANALYSIS (Package)
-- PERSONA_NATURAL_JURIDICA (Table)
--
CREATE OR REPLACE PROCEDURE SICAS_OC."PROC_PRUEBA" IS
cDummy VARCHAR2(1);
BEGIN
select 'X' into cdummy
from persona_natural_juridica
where row... | true |
c7b08e8af16a33f2e28209fc21bc72026db2c92e | SQL | tdcoa/sql | /filesets/demo/substitution_order.coa.sql | UTF-8 | 291 | 2.78125 | 3 | [] | no_license | /* demonstrate substitution order
*/
create volatile table substitution_order
(priority integer
,comment varchar(256)
) no primary index
on commit preserve rows
;
insert into substitution_order({priority},'{comment}')
;
/*{{save:sub_order.csv}}*/
select * from substitution_order
;
| true |
a94dc5f208b405a18afaec3e37b2a5e478b9802b | SQL | serioussoftwareuk/.NET-developer-Dmitry | /sql/schema.sql | UTF-8 | 268 | 2.828125 | 3 | [] | no_license | CREATE TABLE if not exists quotes (
"date" TIMESTAMP NOT NULL,
symbol varchar(10) NOT NULL,
"type" integer NOT NULL,
"open" numeric,
"close" numeric,
high numeric,
low numeric,
volume numeric,
PRIMARY KEY("date", symbol, "type")
); | true |
428fa6b92481f943864146f734615643b8e22c61 | SQL | sarkarChanchal105/Coding | /Leetcode/Database/Medium/consecutive-numbers.sql | UTF-8 | 209 | 3.328125 | 3 | [] | no_license | /*
https://leetcode.com/problems/consecutive-numbers/
*/
SELECT DISTINCT L1.Num ConsecutiveNums
FROM Logs L1 join Logs L2 on L1.Id+1=L2.Id
join Logs L3 on L2.Id+1=L3.Id
where L1.Num=L2.Num
and L2.Num=L3.Num | true |
61a0b48abc788003c989664296341c0d5d7eedff | SQL | IMrsFoxx/GrandRoute | /src/main/resources/db/migration/V1__Init_DB.sql | UTF-8 | 1,179 | 3.171875 | 3 | [] | no_license | create table hotel_booking (
id_order bigint not null,
email_client varchar(255),
name_client varchar(255),
number_client varchar(255),
primary key (id_order)) engine=MyISAM
create table main_orders (
order_id bigint not null,
name_client varchar(128),
passport_client varchar(100),
soname_client varchar(100),
date_arr... | true |
7d2450f9cc029a1b2978dd96383adbcac3e863c0 | SQL | vergilyn/persistence-examples | /mybatis-examples/mybatis-basic-examples/mybatis-plus-examples/mybatis_plus.sql | UTF-8 | 584 | 2.53125 | 3 | [] | no_license | DROP TABLE IF EXISTS `mybatis_plus`;
CREATE TABLE `mybatis_plus`
(
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`is_deleted` TINYINT(1) NOT ... | true |
9fd9be223cc02c0fc07ba7cde57510988a020c1f | SQL | VasilDimitroff/SoftUni-MS-SQL-Server | /1. DataDefinitionAndDataTypes/CreateTablePeople.sql | UTF-8 | 750 | 3.3125 | 3 | [] | no_license | USE Minions
CREATE TABLE People (
Id INT PRIMARY KEY IDENTITY,
Name NVARCHAR(200) NOT NULL,
Picture VARBINARY(MAX),
Height DECIMAL(5,2),
Weight DECIMAL(5,2),
Gender CHAR(1) NOT NULL CHECK (Gender IN('m', 'f')),
Birthdate DATETIME2 NOT NULL,
Biography NVARCHAR(MAX)
)
INSERT INTO People ... | true |
66c9e40ccd272b7698ad935152d8f0124eeea38f | SQL | mysticrenji/flask_blog | /app/schema.sql | UTF-8 | 389 | 3.390625 | 3 | [] | no_license | /*DROP TABLE IF EXISTS posts;*/
CREATE TABLE IF NOT EXISTS products (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
productname TEXT NOT NULL,
brand TEXT NOT NULL,
category TEXT NOT NULL,
stockstatus TEXT NOT NULL,
store TEXT NOT NULL,
quan... | true |
0700479a4864eb242b9c429fd4646bb9b5c34439 | SQL | georgepatrik/university_database_oracle | /create.sql | UTF-8 | 2,561 | 4 | 4 | [] | no_license |
ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY' NLS_DATE_LANGUAGE='english';
CREATE SEQUENCE PRIMARY_STUDENTS_KEY
INCREMENT BY 1
START WITH 1
MINVALUE 1
MAXVALUE 999999
CYCLE;
CREATE TABLE SCHOOL (
ID NUMBER(2) NOT NULL, -- only a few schools -- PRIMARY KEY,
SCHOOL_NAME VARCHAR2(80) NOT NULL,
FOUNDI... | true |
4a5692bf1016bfe3bcc8f57eda15ccc248b0e6fd | SQL | ClickHouse/ClickHouse | /tests/queries/0_stateless/01780_column_sparse_tuple.sql | UTF-8 | 2,075 | 3.515625 | 4 | [
"Apache-2.0",
"BSL-1.0"
] | permissive | DROP TABLE IF EXISTS sparse_tuple;
CREATE TABLE sparse_tuple (id UInt64, t Tuple(a UInt64, s String))
ENGINE = MergeTree ORDER BY tuple()
SETTINGS ratio_of_defaults_for_sparse_serialization = 0.5;
INSERT INTO sparse_tuple SELECT number, (if (number % 20 = 0, number, 0), repeat('a', number % 10 + 1)) FROM numbers(1000... | true |
e38469ab37b22ee75fc9cea784ebf3da72b398f3 | SQL | Tonsofattraction/ClickHouse | /dbms/tests/queries/0_stateless/00687_top_and_offset.sql | UTF-8 | 745 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | SET send_logs_level = 'none';
DROP TABLE IF EXISTS test.test;
CREATE TABLE test.test(val Int64) engine = Memory;
INSERT INTO test.test VALUES (1);
INSERT INTO test.test VALUES (2);
INSERT INTO test.test VALUES (3);
INSERT INTO test.test VALUES (4);
INSERT INTO test.test VALUES (5);
INSERT INTO test.test VALUES (6);
... | true |
d96573b700db76b1b4439efc8d7ad6182766d92a | SQL | edivaldo100/api-get-tweets | /src/main/resources/db/migration/V01__criar_tb_inicial.sql | UTF-8 | 1,545 | 3.734375 | 4 | [] | no_license | SET default_storage_engine=InnoDB;
USE twitter;
DROP TABLE IF EXISTS twitter;
CREATE TABLE twitter.hastag (
`hashtag_id` bigint(20) NOT NULL AUTO_INCREMENT,
`texto` varchar(255) DEFAULT NULL,
PRIMARY KEY (`hashtag_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE twitter.i... | true |
6b8c5ec34af703b18e7a17927da4f7f8a2c043cf | SQL | wangxx97/StudentManager | /stuMgr.sql | UTF-8 | 7,294 | 3 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64)
--
-- Host: localhost Database: stuMgr
-- ------------------------------------------------------
-- Server version 5.7.24-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... | true |
8a7985dc2faa3c886112a182c4d5a662e7999ae6 | SQL | rcancino/sw2 | /sw2-core/src/main/resources/sql/parches/TesoreriaModel2.sql | UTF-8 | 2,347 | 3.53125 | 4 | [] | no_license | drop table sx_corte_tarjetas_det
drop table sx_corte_tarjetas
create table SX_CORTE_TARJETAS (
CORTE_ID bigint not null auto_increment
, COMENTARIO varchar(250)
, FECHA_CORTE date
, FECHA date not null
, TARJETA_TIPO varchar(20) not null
, TOTAL numeric(19,2) not null
, CARGOABONO_ID bigint
, CUENTA_ID ... | true |
1901c3148b85069fcb157c1ae603de54fca7a635 | SQL | bellmit/report | /report/batch_dwd_rsc_credit/script/dwd_rsc_credit.sql | UTF-8 | 26,700 | 2.828125 | 3 | [] | no_license | use dwd;
drop table if exists dwd.dwd_rsc_credit;
create table if not exists dwd.dwd_rsc_credit(
apply_no string comment "订单编号",
report_no string comment "征信报告编号",
customer_no string comment "客户编号",
relation_name string comment "关系人类型",
customer_name string comment "姓名",
id_card_no string comment "身份证",
age bigi... | true |
9f8929f6b833d7e6d14a820ecf657e90e95f4218 | SQL | grunch/rest-api-docker | /code/sql/schema.sql | UTF-8 | 234 | 2.5625 | 3 | [
"MIT"
] | permissive | CREATE DATABASE api;
USE api;
CREATE TABLE api.users (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL,
picture varchar(200) DEFAULT NULL,
address text,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| true |
60df091fcedb23bda9edef964adcbd7a28a5e757 | SQL | moyui/database | /建存储过程(2).sql | GB18030 | 279 | 3.28125 | 3 | [] | no_license | create proc find_harbour @num char(6)
as
select ۿ.ۿڱ,ʱ̱.ֻ,ʱ,ʱ from ʱ̱,ۿ,λ
where ʱ̱.ֻ = @num and ʱ̱.λ = λ.λ and λ.ۿڱ = ۿ.ۿڱ | true |
9a47380515661ff2666a4108e6fb7d67d8b621dd | SQL | Dewalk/mysql | /HW1.sql | UTF-8 | 1,456 | 4 | 4 | [] | no_license | #1. HNL, Honolulu is the furtherest destination
SELECT dest FROM flights ORDER BY distance DESC LIMIT 1;
SELECT distance FROM flights WHERE dest = 'HNL' LIMIT 1;
#2. Engines numbers are 1, 2,3, and 4. **The second part I am having trouble with
SELECT DISTINCT engines FROM planes;
SELECT DISTINCT model AS 'Model', SUM(... | true |
5da20f83f56e2ffd5b305a6672abb4b570881d75 | SQL | krishnamohankaruturi/secret | /aart-web-dependencies/db/dml/774.sql | UTF-8 | 478 | 2.609375 | 3 | [] | no_license | --DE18432: Predictive School Year for Kap
INSERT INTO public.appconfiguration
(attrcode, attrtype, attrname, attrvalue, activeflag, createduser, createddate, modifieduser, modifieddate, assessmentprogramid)
select 'PredictiveSchoolYearKap', 'PredictiveSchoolYear', 'PredictiveSchoolYearKap',
'2016 - 2017', true, 12, ... | true |
be8d9a3030e30cf56db1343dd28245d42a2a9d4b | SQL | bellmit/dbSmellsData | /data/open-source/extracted_sql/richardkiss_pycoin.sql | UTF-8 | 919 | 3.375 | 3 | [
"MIT"
] | permissive | create table if not exists BIP32Key (id integer primary key,slug text not null unique,as_text text not null)
select count(*) from Spendable where does_seem_spent = 0
create table if not exists Spendable (tx_hash text,tx_out_index integer,coin_value integer,script text,block_index_available integer,does_seem_spent boole... | true |
c4001e3e3a3af5e4ed9d3ccb486579c2e1cad156 | SQL | rilex001/PERN-TODO | /Books/auth/server/database.sql | UTF-8 | 746 | 3.28125 | 3 | [] | no_license | CREATE DATABASE authtodo;
CREATE TABLE users(
user_id uuid DEFAULT uuid_generate_v4(),
user_name VARCHAR(255) NOT NULL,
user_email VARCHAR(255) NOT NULL UNIQUE,
user_password VARCHAR(255) NOT NULL,
PRIMARY KEY(user_id)
);
CREATE TABLE todo(
todo_id SERIAL,
user_id UUID ,
description VARCHAR(255),
PR... | true |
6e1cc57dfe4e818e43730603ece14b332b52dd14 | SQL | pjambet/apogee | /apogee-ig4/bd/alter.sql | UTF-8 | 3,171 | 2.78125 | 3 | [] | no_license | alter table ECUE
add constraint fkenseignant_ecue foreign key(idenseignant) references enseignant(idenseignant);
alter table ECUE
add constraint fkue_ecue foreign key(codeue) references ue(codeue);
alter table UE
add constraint fkenseignant_ue foreign key(idenseignant) references enseignant(idenseignant);
alter tab... | true |
c3d93d009a5eeeb3e2cc2fafb5af84a97ede2d2e | SQL | bhavish2207/House-Rental-Database-System | /IST 659 PROJECT GROUP 5.sql | UTF-8 | 3,631 | 3.8125 | 4 | [] | no_license | -- IST 659 PROJECT GROUP 5
--1. CREATING RENTAL AGENCY TABLE
CREATE TABLE Rental_Agency
(
Agency_ID VARCHAR(20) PRIMARY KEY,
Agency_Name VARCHAR(20) NOT NULL,
Email_ID VARCHAR(20) NOT NULL,
Website_url VARCHAR(50) NOT NULL,
Phone_No NUMERIC(10,0) NOT NULL,
Office_Address VARCHAR(30) NOT NULL,
Zipcode NUMERIC(... | true |
09576b5fd2b455770ac8ee0d73d6639b23410474 | SQL | saqibnizami/CodingPractice | /SQL/HackerRank/RevisingAggregationsAverages.sql | UTF-8 | 245 | 2.890625 | 3 | [] | no_license | -- Revising Aggregations - Averages
--https://www.hackerrank.com/challenges/revising-aggregations-the-average-function/problem?h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen
select avg(population)
from city
where district = 'California'
| true |
97decc4215e3a27c7485f54a66cdbbf76b226eb3 | SQL | ReneNyffenegger/oracle-patterns | /Installed/dynamic-performance-views/sql/area/parsed-by-user.sql | UTF-8 | 428 | 3.203125 | 3 | [] | no_license | select
-- sql.last_active_time,
round((sysdate - sql.last_active_time) * 24*60*60) last_active_secs_ago,
-- sql.first_load_time,
sql.sql_id,
sql.sql_text,
sql.executions,
sql.parse_calls,
sql.last_load_time,
sql.*
from
v$sqlarea sql join
dba_users us... | true |
f71168ad19199fedb117b5627c9e2243199703b5 | SQL | camerican/wdi-jan-07-team | /test.db.sql | UTF-8 | 654 | 3.28125 | 3 | [] | no_license |
-- Users Table
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id integer PRIMARY KEY AUTOINCREMENT,
email VARCHAR(64),
name_first VARCHAR(64),
name_last VARCHAR(64)
);
-- Profiles Table
-- To do: Write profiles table
DROP TABLE IF EXISTS profiles;
CREATE TABLE profiles (
id integer PRIMARY KEY AUTOINCREMENT,... | true |
0d92ad8c89dd3ba4a5ab261e9d9a14f2aa6372dc | SQL | BestInternDeveloper/MyDB | /test/small_dataset/test_select.sql | UTF-8 | 407 | 3.65625 | 4 | [] | no_license | use school;
select student.sid, student.name, grade.gid, course.subject, grade.score
from student, course, grade
where student.sid=grade.sid and course.cid=grade.cid;
select cid, avg(score) from grade;
select cid, avg(score) from grade group by cid;
select cid, avg(score) from grade where score>=60 group by cid;
select... | true |
eb0df3c31c8c62ccc172c5a39aec91b6085c43ea | SQL | gabriela-ivanova/Ajax-Monster-Job-Project | /CMS_AJAX_SERVER/sql/migration_job_offer.sql | UTF-8 | 15,923 | 3.25 | 3 | [] | no_license | CREATE DATABASE monsterjob;
CREATE TABLE monsterjob.tb_job_offer (
id INTEGER AUTO_INCREMENT PRIMARY KEY ,
title VARCHAR(512) NOT NULL ,
company_name VARCHAR(256) NOT NULL ,
content TEXT NOT NULL
);
INSERT INTO monsterjob.t... | true |
eb4e0a47f3caef027af1a3e594c3578bad04016d | SQL | echoveau/Mes_projets_web | /blog_mvc_objet/BD/blog (copie).sql | UTF-8 | 3,391 | 3.546875 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Ven 15 Février 2019 à 13:20
-- Version du serveur : 5.7.22-0ubuntu0.16.04.1
-- Version de PHP : 7.0.30-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40... | true |
8e132a063840c9a5e1cde2bc87e13d7d9ad87a37 | SQL | jgillies/dbt-profiler | /integration_tests/tests/test_print_profile_schema.sql | UTF-8 | 701 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | {% if execute %}
{% set schema_dict = dbt_profiler.print_profile_schema(relation_name="test_data") %}
{% set actual_model_count = schema_dict["models"] | length %}
{% set actual_relation_name = schema_dict["models"][0]["name"] %}
{% set actual_description = schema_dict["models"][0]["description"] %}
{% set ... | true |
d9ade30f45792d660820d732be42b87c2bfee4f6 | SQL | salimkocabas/QA-Tech-Notes | /SQL/Syntax Class/002.sql | UTF-8 | 397 | 2.859375 | 3 | [] | no_license | USE syntaxhrm_mysql;
SELECT * FROM hs_hr_employees WHERE emp_firstname= "Donald";
SELECT * FROM hs_hr_employees WHERE emp_number=8357;
SELECT emp_number,employee_id,emp_firstname,emp_middle_name,emp_lastname,emp_marital_status
FROM hs_hr_employees
WHERE emp_number=8344;
SELECT * FROM hs_hr_employees
WHERE emp_firstn... | true |
f2dca03e20e96ed5fc9d712500989d0ff285e73c | SQL | srthkgarg/JBBAssociatesWebsite | /docs/db/sql/version1/jbbassociates-db-sql-script-version1.sql | UTF-8 | 2,489 | 3.90625 | 4 | [] | no_license | DROP DATABASE IF EXISTS `jbb-associates-db`;
CREATE DATABASE IF NOT EXISTS `jbb-associates-db`;
USE `jbb-associates-db`;
-- Table structure for table `user_details_table`
DROP TABLE IF EXISTS `user_details_table`;
CREATE TABLE `user_details_table` (
`user_id` int(11) NOT NULL auto_increment,
`password` char(120) ... | true |
eab1421cd75744f9c41804e8fa95d155875322fd | SQL | bobbybru/FBD_anvisa | /8 - alg_relacional_full_join.sql | UTF-8 | 212 | 3.140625 | 3 | [] | no_license | select a.produto,
b.pmc
from anvisa.medicamento as a
join anvisa.preco as b
ON Medicamento_principio_ativo = principio_ativo
AND Medicamento_apresentacao = apresentacao
AND Medicamento_produto = produto | true |
bbdb7bb44635ee6fdd670f5f733a37ccb4de608f | SQL | liwushuo/flask-perm | /migrate/init.sql | UTF-8 | 2,144 | 3.34375 | 3 | [
"MIT"
] | permissive | CREATE TABLE `perm_permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`code` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ux_permission_code` (`code`)
) ENGINE=... | true |
929de7c715a43183c7bb2c3d63d0a3820db907dc | SQL | evrimulgen/about-Avaloq | /tables/obj/bp/person/rel/select-with-keys.sql | UTF-8 | 2,205 | 3.421875 | 3 | [] | no_license | select
rel_type.name relation_type,
bp_2_pers.rel_person_id obj_pers_id,
bp_2_pers.obj_id obj_bp_id,
bp_key.key_val bp_nr,
pers_key.key_val pers_nr,
obj_bp.birthdate bp_birthdate,
b... | true |
3af772a01f87943c0f1a9285579d1bf13dc11d37 | SQL | techtronics/trcfaucet | /setup/schema.sql | UTF-8 | 873 | 2.984375 | 3 | [] | no_license | drop table if exists drip_request;
create table drip_request (
id integer primary key autoincrement,
crdate string not null,
ip string not null,
address string not null,
coupon string not null,
trans_id string not null
);
insert into drip_request (id, crdate, ip, address, coupon, trans_id)
values (null, datetim... | true |
61ecffb90eb7db77d10dec98c310dd880b40941a | SQL | vladimirbasaric/it-obuka | /SQL/42 43 44 45/42_vezbanje_resenja/biblioteka_upiti.sql | UTF-8 | 536 | 2.796875 | 3 | [] | no_license | -- 1
INSERT INTO `knjige`(`Id`, `Naziv`, `Autor`, `Broj_strana`, `Godina_izdanja`) VALUES (NULL, "Znakovi pored puta", "IA200", 476, 1976), (NULL, "Mister Dolar", "BN408", 93, 1932);
-- 2
DELETE FROM `knjige` WHERE `Godina_izdanja` = 1924;
-- 3
UPDATE `iznajmljivanje` SET `Vraćeno`=1 WHERE `Iznajmljeno`<'2019-... | true |
edfe0bbb2a0b7616e6ca502ab672b39c8be5b11f | SQL | petrunov-d/smart-tac-calc | /src/main/resources/db/migration/V1__init.sql | UTF-8 | 4,226 | 3.859375 | 4 | [] | no_license | -- TRAIN_TYPES
CREATE TABLE PUBLIC.train_types
(
id BIGSERIAL PRIMARY KEY NOT NULL,
code INTEGER,
name TEXT,
year INTEGER,
unique (year, name)
);
-- UNIT_PRICE
CREATE TABLE PUBLIC.unit_price
(
id BIGSERIAL PRIMARY KEY NOT NULL,
code INTEGER,
name TEX... | true |
015c3a40ebb8bc43b713c653299f44e0386815af | SQL | Reelwens/SimonLucas | /simonlucas.sql | UTF-8 | 9,845 | 3.265625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.12deb2+deb8u2
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Dim 30 Avril 2017 à 00:48
-- Version du serveur : 5.5.54-0+deb8u1
-- Version de PHP : 5.6.29-0+deb8u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... | true |
6e374166c1dd41592a93856198bdbadb697ab392 | SQL | dsmilo/MSDA-Bridge-SQL | /Week1.sql | UTF-8 | 2,262 | 4.125 | 4 | [] | no_license | -- Question 1: furthest destination
SELECT dest, distance FROM flights
GROUP BY dest ORDER BY distance DESC LIMIT 1;
-- The furthest airport is Honolulu Intl (HNL) at 4,983 miles
-- Question 2: number of engines and seats
SELECT engines FROM planes
GROUP BY engines ORDER BY engines;
-- Planes have 1, 2, 3, or 4 engin... | true |
a4d87e718df32ef508aeecd087fcc03877f435e5 | SQL | jefff8/CI | /database/local1222.sql | UTF-8 | 53,371 | 3.09375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : hxajxt
Source Server Version : 50547
Source Host : localhost:3306
Source Database : jmadmin
Target Server Type : MYSQL
Target Server Version : 50547
File Encoding : 65001
Date: 2017-12-22 10:14:56
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... | true |
1b60c7340075b865b4feb268c6ff8c27a8c128cf | SQL | ToborTheGreat/Repository01 | /lte.hourly_sam_c_num_csfb_indicator.sql | UTF-8 | 2,477 | 3 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = lte, pg_catalog;
DROP TRIGGER hourly_sam_c_num_csfb_indicator_trig... | true |
e3deec956cb24dc648385a5baeae1138b9dcde2a | SQL | APCompEeng/RevatureProject1 | /Q5_RevatureProject1.sql | UTF-8 | 2,962 | 3.65625 | 4 | [] | no_license |
CREATE TABLE revision_wiki (
wiki_db STRING,
event_entity STRING,
event_type STRING,
event_timestamp STRING,
event_comment STRING,
event_user_id INT,
event_user_text_historical STRING,
event_user_text STRING,
event_user_blocks_historical STRING,
event_user_blocks STRING,
event_user_groups_historical STRING,... | true |
eff46d780fbae9965b577057d0d165f764ee34eb | SQL | ionicsolutions/kokolores | /datasets/queries/random_batch.sql | UTF-8 | 153 | 2.734375 | 3 | [
"MIT"
] | permissive | SELECT DISTINCT
page_id
FROM
page
INNER JOIN flaggedrevs ON page.page_id=flaggedrevs.fr_page_id
WHERE page_namespace=0
ORDER BY RAND()
LIMIT %(num)s;
| true |
a04b01730cc05d2b614c63285723ab156c68c8ca | SQL | SorielV/club | /server/database/bechmark.sql | UTF-8 | 315 | 3.03125 | 3 | [] | no_license | EXPLAIN ANALYZE SELECT
"UserInfo"."idUser",
"User".username,
"UserInfo"."firstName",
"UserInfo"."profileImage"
from "User"
inner join "UserInfo"
on "User".id = "UserInfo"."idUser"
where "User".username = 1;
EXPLAIN ANALYZE select * from "UserProfile" where "UserProfile"."idUser" = 1; | true |
e15756efbff9faa08931336efe089808a14d2558 | SQL | username4/civ6_x10_mod | /civs_x10/text/zh_Hans_CN/TraitTexts_zh_Hans_CN.sql | UTF-8 | 32,236 | 2.890625 | 3 | [] | no_license | ---------------------------------------------------------
---------------------------------------------------------
--AMERICA
---------------------------------------------------------
---------------------------------------------------------
UPDATE LocalizedText
SET Text = '十倍速度获得所有政体传承加成。'
WHERE Language = 'z... | true |
9d24c74382202e943053e206c7084f878c0169df | SQL | robkoltai/DBA_scripts | /SQL_perf_changed/sql_perf_changed.sql | UTF-8 | 5,058 | 3.84375 | 4 | [] | no_license | -- https://carlos-sierra.net/tag/plan-hash-value/
----------------------------------------------------------------------------------------
--
-- File name: sql_performance_changed.sql
--
-- Purpose: Lists SQL Statements with Elapsed Time per Execution changing over time
--
-- Author: Carlos Sierra
--
-- Ver... | true |
99566103b91a8bb6559d13ac9d9839700dd492ee | SQL | akshayreddykotha/trendence-sql-hackathon-2019 | /Question 2_Part 2.sql | UTF-8 | 876 | 3.921875 | 4 | [] | no_license | SELECT sum(num_act.num_activities)
FROM (SELECT v.activity_type at, count(*) num_activities
FROM studentVle sv
JOIN vle v
ON v.id_site = sv.id_site
WHERE sv.course_code = 'AAA' AND sv.batch_code = '2013J'
GROUP BY v.activity_type) num_act
GROUP BY num_act.at;
SELECT activity_type, cast(cast(c... | true |
37457aea1d57df8a1518066428afde001a957c5e | SQL | Jonathan-PS/MySqlWowtasticAPI | /wowtastic.sql | UTF-8 | 5,551 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Mar 07, 2019 at 12:45 PM
-- Server version: 5.7.24-log
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
a4724e0db4de6139d3dcbfb793065c6ee3362edb | SQL | messiisgod/wechat_shetuan_server | /SQL/wechatdb0.2.sql | UTF-8 | 10,889 | 3.5625 | 4 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : myconnection
Source Server Type : MySQL
Source Server Version : 50539
Source Host : localhost:3306
Source Schema : wechatdb
Target Server Type : MySQL
Target Server Version : 50539
File Encoding : 65001
Date: 15/08/2018 ... | true |
21617bc0e76a441a163f620992e3283c20d92b62 | SQL | solico93/CouponSystem_Part1 | /Dump MySQL DB/coupons_forward_cusotmer_coupons.sql | UTF-8 | 2,484 | 3.015625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: coupons_forward_cusotmer
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARA... | true |
04d2318577ea0ed729ece6715fc0dd47ae07ca65 | SQL | travv0/soberbot | /script.sql | UTF-8 | 989 | 2.96875 | 3 | [] | no_license | CREATE TABLE "Bans" (
"ID" INTEGER NOT NULL CONSTRAINT "PK_Bans" PRIMARY KEY AUTOINCREMENT,
"ServerID" INTEGER NOT NULL,
"UserID" INTEGER NOT NULL,
"Message" TEXT NULL
);
CREATE TABLE "Config" (
"ID" INTEGER NOT NULL CONSTRAINT "PK_Config" PRIMARY KEY AUTOINCREMENT,
"ServerID" INTEGER NOT NULL,
... | true |
817069a9ac97d5fac3d5c7edbc6e61ee6d113be0 | SQL | xMlex/l2phoenix-epilogue | /sql/login/accounts.sql | UTF-8 | 843 | 2.546875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `accounts` (
`login` varchar(45) NOT NULL default '',
`password` varchar(256) default '',
`lastactive` int(15) unsigned NOT NULL default '0',
`access_level` tinyint(6) NOT NULL default '0',
`lastIP` varchar(15) default '',
`lastServer` int(4) default '1',
`comments` text default... | true |
2a14fad226c916afd5a7119926759ca11b36dc97 | SQL | erdprt/postgresql | /postgresql/clusters/petstores/scripts/databases/db_billings/schemas/sch_billings/scripts/schema.sequence.reinit.sql | UTF-8 | 767 | 2.609375 | 3 | [] | no_license | SET search_path TO sch_billings;
SELECT SETVAL('TAB_METADONNEES_SEQ',(SELECT MAX(MTD_ID) FROM TAB_METADONNEES),true);
SELECT SETVAL('TAB_PERSON_SEQ',(SELECT MAX(PER_ID) FROM TAB_PERSON),true);
SELECT SETVAL('TAB_ADDRESS_SEQ',(SELECT MAX(ADR_ID) FROM TAB_ADDRESS),true);
SELECT SETVAL('TAB_PRODUCT_SEQ',(SELECT MAX(PROD_... | true |
55b4771a2765ac85d9197a3ca4b056cf62d65d52 | SQL | mackecm2/texaco-loyalty | /DBInterface/DB/AutoRedemption.sql | UTF-8 | 621 | 2.953125 | 3 | [] | no_license | drop table If exists AutoRedeemOptions;
create table AutoRedeemOptions
(
OptionId integer auto_increment primary key,
ProductId integer,
MerchantId integer,
Description varchar(80),
Active enum( 'Y', 'N' ) not null,
Cost integer,
AssocAccount bigint,
CreationDate TimeStamp,
CreatedBy varchar(20),
INDEX( P... | true |
3ff51571d44dfc8197260af3f29ac2d17985ce1e | SQL | araczkowski/GLA | /VW/my_gifts_vw.sql | UTF-8 | 2,883 | 3.375 | 3 | [] | no_license | CREATE OR REPLACE VIEW my_gifts_vw AS
SELECT decode(gle.status,'REZ','',decode(v('APP_USER'), gl.dodal, '<a href="f?p=1315:2:&APP_SESSION.::::P2_ROWID:'||gl.rowid||'"><img src="/i/menu/pencil16x16.gif" alt=""></a>', '')) edycja,
gl.impreza_id,
gl.nazwa,
'<h3>'||gl.nazwa||'</h3>'||gl.opis || gl_util... | true |
e2ffdfd3f6ae906be315e2cf637267e88e167578 | SQL | foivz/RepositoryTeam32 | /Dokumentacija/BazaPI-podaci2.sql | UTF-8 | 11,436 | 3.5 | 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';
CREATE SCHEMA IF NOT EXISTS `greymatterpi` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `greymatterpi` ;... | true |
e75932af0712e677aacd7d878446bda8418e38e8 | SQL | aaronlee28/sql-challange | /EmployeeSQL/data analysis/query.sql | UTF-8 | 1,596 | 4.28125 | 4 | [] | no_license | -- Data Analysis #1
SELECT employees.emp_no, employees.last_name, employees.first_name, employees.sex, salaries.salary
INTO TABLE employee_info
FROM employees
LEFT JOIN salaries
ON employees.emp_no = salaries.emp_no;
-- Data Analysis #2
SELECT employees.first_name, employees.last_name, employees.hire_date
INTO TA... | true |
ac8e4b8fb11393f044468548d96371f9ef368a47 | SQL | haivido/Vido | /sqlite create table.sql | UTF-8 | 1,283 | 3 | 3 | [] | no_license | CREATE TABLE CardType
(
CardTypeId INTEGER PRIMARY KEY,
Name TEXT,
Description TEXT
);
CREATE TABLE Card
(
CardId TEXT PRIMARY KEY,
CardTypeId INTEGER,
IsUse NUMERIC,
FOREIGN KEY(CardTypeId) REFERENCES CardType(CardTypeId)
);
CREATE TABLE EntryExit
(
CardId TEXT PRIMARY KEY,
EntryPlateNumber TEXT,
EntryTi... | true |
ad3623e13d40016f6e6c18fb37496cfe8ee69fea | SQL | JuniorSong92/GestionAbsence | /gab.sql | UTF-8 | 7,993 | 2.9375 | 3 | [
"BSD-3-Clause"
] | permissive | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.19-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Version: 9.4.0.5169
-- -------------------------------------------... | true |
bff751f9d432a1e661ede9b46ed4e73b471d343a | SQL | BesedaM/Autobase | /database/backup.sql | UTF-8 | 46,768 | 2.96875 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 10.10
-- Dumped by pg_dump version 10.10
-- Started on 2019-10-03 21:30:45
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_cata... | true |
ff060d4533e4cbbd6ba14a4494f1836bb066f1c2 | SQL | gigawave07/C0620G1-HOANG-MINH-QUAN | /module 3/case_study/cs_sp.sql | UTF-8 | 2,097 | 3.6875 | 4 | [] | no_license | use furama_resort;
delimiter //
create procedure displayAll()
begin
select *, c.name as 'c.name', ct.name as 'ct.name' from customer c
left join customer_type ct on c.customer_type_id = ct.id;
end //
delimiter ;
delimiter //
create procedure deleteCustomer(input_id varchar(45))
begin
delete from customer ... | true |
bb2c168a3ac45a096dbe672555b2a5f278477e7b | SQL | rayanc/Pecuniaus | /Database/Stored Procedures/avz_cc_spSelectOffer.sql | UTF-8 | 823 | 3.40625 | 3 | [] | no_license | drop procedure if exists avz_cc_spSelectOffer;
delimiter $$
create procedure avz_cc_spSelectOffer
( iNofferId bigint,iNmerchantId bigint,iNcontractId bigint)
begin
update tb_offers set status=190002 where merchantid=iNmerchantId and contractid=iNcontractId;
UPDATE tb_offers
SET
offerAcceptanceDate = NOW(),
... | true |
fc21821334b054eeb382a07043087b34a234ad3c | SQL | Misranfuadi/PARTime | /PARtimeWeb/db_partime.sql | UTF-8 | 10,380 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.8
-- https://www.phpmyadmin.net/
--
-- 主機: localhost:3306
-- 產生時間: 2018 年 08 月 11 日 11:52
-- 伺服器版本: 5.5.56-MariaDB-cll-lve
-- PHP 版本: 7.1.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... | true |
bcc27529dcf300ca947db0b9086ec46752c77641 | SQL | dennywu/babemusicstudio | /rent-band.sql | UTF-8 | 3,943 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 15, 2012 at 05:42 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 */;
/*!... | true |
1b50435ccdc67b9e36fb2c364f76491fee23a5f4 | SQL | yudisputra/Enterprise | /dicam.sql | UTF-8 | 6,267 | 3.015625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 15 Okt 2018 pada 03.54
-- Versi Server: 10.1.29-MariaDB
-- PHP Version: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
e8ae49d1e60bbfc856857d484a1bbcf488c3529e | SQL | kendallrowe/bootcampx | /3_queries/4_total_assignment_submissions.sql | UTF-8 | 465 | 4.28125 | 4 | [] | no_license | -- -- Get the total number of assignment submissions for each cohort.
-- Select the cohort name and total submissions.
-- Order the results from greatest to least submissions.
SELECT cohorts.name AS COHORT, COUNT(assignment_submissions.*) AS total_submissions
FROM cohorts
JOIN students ON students.cohort_id = cohorts... | true |
6850cd646d1e8d7503253c32f15923766f598ea4 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day11/select0955.sql | UTF-8 | 191 | 2.78125 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-10T09:55:00Z' AND timestamp<'2017-11-11T09:55:00Z' AND SENSOR_ID='bfccdb0b_65a2_4082_8316_f5b8f1fa6bfb'
| true |
6ea1c6a39e7b60ebf7eb479032f66be6f3fcc1bb | SQL | Marcos-Vinicius2003/Banco_Vendas | /sql_vendas.sql | UTF-8 | 3,520 | 3.5 | 4 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTI... | true |
851a7a51edc9124af80fc01ae3721b4f488023c7 | SQL | iuvei/lottery-10 | /plsql2/table/T_BET_ORDER_CHOICE.sql | UTF-8 | 1,297 | 3.609375 | 4 | [] | no_license | -- Create table
create table T_BET_ORDER_CHOICE
(
CHOICE_ID NUMBER(20) not null,
AGAINST_ID NUMBER(20),
BET_ORDER_ID NUMBER(20),
BET_PLAN VARCHAR2(50),
DAN_CODE VARCHAR2(50),
CHANGCI NUMBER(10)
)
tablespace LOTTERY
pctfree 10
pctused 40
initrans 1
maxtrans 255
stor... | true |
7f2d32c3a802bfb5db3ffb4c6f2ffe9e74f330e8 | SQL | apmuthu/bounce | /sample_bounce_2020-01-25.sql | UTF-8 | 8,547 | 3.203125 | 3 | [] | no_license | /*
**********************************
MySQL - 5.1.41 : Database - bounce
**********************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KE... | true |
f2fdd11c9466735bb6f1e02bd8d3a8f5f855e098 | SQL | marat-chardymov/TestingApp | /DumpTestingAppDBSchemaOnly.sql | UTF-8 | 5,261 | 3.296875 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `testingappdb` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `testingappdb`;
-- MySQL dump 10.13 Distrib 5.6.13, for Win32 (x86)
--
-- Host: localhost Database: testingappdb
-- ------------------------------------------------------
-- Server version 5.6.15
/*!40101 SET @OLD_CHARACTER_S... | true |
ea4d21a2d03edb20bac9962b2704f667e27fe8be | SQL | cicilestaris/PLA_project | /TN.sql | UTF-8 | 1,397 | 3.46875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | create database TN;
use TN;
create table NMS(
id_nms integer primary key auto_increment,
nama_nms varchar(50)
);
create table Lokasi(
id_lokasi integer primary key auto_increment,
nama_lokasi varchar(50)
);
create table Merk(
id_merk integer primary key auto_increment,
nama_merk varchar(50)
);
create table B... | true |
beb37a2dc17202aef63d68c61f6da2a270530b12 | SQL | thinkful-ei-heron/Group5-Capstone3-Server | /migrations/013.undo.make.head.deferrable.sql | UTF-8 | 139 | 2.875 | 3 | [] | no_license | ALTER TABLE lists DROP CONSTRAINT lists_head_fkey;
ALTER TABLE lists ADD CONSTRAINT lists_head_fkey FOREIGN KEY(head) REFERENCES nodes(id); | true |
e8654977fa3258eddae7af3aa0202e19a7c3dd40 | SQL | ShinXinyuChen/LeetCode-SQL-Summary | /Questions_by_ID/569_Median_Employee_Salary.sql | UTF-8 | 825 | 4.5625 | 5 | [] | no_license | -- Solution 1: Window Function, Subquery
WITH tb1 AS (
SELECT *,
ROW_NUMBER() OVER (PARTITION BY company ORDER BY salary) AS r,
COUNT(*) OVER (PARTITION BY company) AS num
FROM employee
)
SELECT id, company, salary
FROM tb1
WHERE r BETWEEN num*1.0/2 AND num*1.0/2 + 1;
-- Solution 2: Join, S... | true |
0e6cfbb299300c19d352edc9ec0782a402e5f6fd | SQL | RudzinskyiYurii/DataBaseLessons | /lesson 3/usage_triggers.sql | UTF-8 | 947 | 3.40625 | 3 | [] | no_license | DELIMITER //
CREATE TRIGGER trigger_check_emplyee_id
AFTER INSERT
ON employee FOR EACH ROW
BEGIN
IF (SELECT COUNT(*) FROM employee WHERE new.identity_number RLIKE '[0]{2}$') != 0
THEN SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = "ID can`t end by 00";
END IF;
END //
DELIMITER ;
DELIMITER //
CREATE TRIGGER trigge... | true |
9501889e46d15aba2608f7290086e48d6d0aba2a | SQL | timetable-ka/rozklad-hpc | /src/main/resources/db/migration/data/course/4/V24__ME-171.sql | UTF-8 | 3,775 | 3.21875 | 3 | [] | no_license | # МЕ-171 (ауд.133) = 46 20
INSERT INTO timetable (group_id, lesson_room_id, lesson_room_id_optional, lesson_week,
day_number, lesson_number, teacher_id, teacher_id_optional, lesson_id)
VALUES
# Monday
(46, 20, null, 1,
1, 1, 72 /* Кайдановська О.М */, null, 87 /* Фінанси підприємства */),... | true |
507e67aad4e7e5469cc921e58d6e9266710c80db | SQL | druidwang/kssp | /src/SQL Script/LocalPersonalSQLScript/Check委外移库寄售Bug.sql | UTF-8 | 2,816 | 2.78125 | 3 | [] | no_license | Select top 1000 * from Inv_RecSIExecution where Item ='200885' and MesLocation ='9103'
Select top 1000 * from Inv_RecSIExecution where Item ='200885' and MesLocation ='9103'
Select top 1000 * from BAT_Job
Select top 1000 * from BAT_JobParam
Select top 1000 * from BAT_TriggerParam
Select top 1000 * from BAT_Ru... | true |
2c808f82d236678ff079ce571ed9a52b9b352b99 | SQL | deodeveloper/tinySQL | /test_scripts/music_and_or.sql | UTF-8 | 519 | 3.53125 | 4 | [] | no_license | --
-- This script demonstrates support for and/or combinations in where clauses
-- as well as the selection of null column values (COLN_VERSN)
-- It is assumed that you are connected to the MUSIC database directory
--
SELECT C.COLN_NAME,C.COLN_VERSN,A.TRACK_NAME FROM MUSIC_TRACKS A,
MUSIC_COLLECTION_TRACKS B,MUSI... | true |
d701b324fa9479f61562ab189a0962f13ffa5c3a | SQL | cleverpig/jsfsecurity | /misc/authorities.sql | UTF-8 | 944 | 3.25 | 3 | [] | no_license | /*
MySQL Data Transfer
Source Host: localhost
Source Database: demo
Target Host: localhost
Target Database: demo
Date: 2011-1-13 14:59:21
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for authorities
-- ----------------------------
CREATE TABLE `authorities` (
`id` int(11) NOT NULL ... | true |
7e1cba15a0c9d1fa8738716048ae1c4a9d5662af | SQL | surachai-tw/bpk | /BOP/SQL/Structure/Data Warehouse - SQL Server/For Inven Movement BOP.sql | UTF-8 | 2,969 | 3.5 | 4 | [] | no_license | SELECT * FROM bpk_stock_movement_summary
SELECT dbo.fBpkGetBpkNameById(bpk_id) Site, count(id) Cnt FROM bpk_stock_movement_summary GROUP BY bpk_id
SELECT dbo.fBpkGetBpkNameById(bpk_id) Site, movement_type, count(id) Cnt
FROM bpk_stock_movement_summary
GROUP BY bpk_id, movement_type
ORDER BY bpk_id, movement... | true |
454fce917ef3284e18fa2607994d63c517a1221e | SQL | Fernando2020/Aula_PooII_UFC_Combate_II | /sqlReport.sql | UTF-8 | 2,582 | 3.875 | 4 | [] | no_license | use ufcCombate;
delete from fighter;
delete from combat;
delete from championship;
delete from fighterchampionship;
select *from fighter;
select *from combat;
select *from championship;
select *from fighterchampionship;
-- 01 Computar os lutadores vencedores de cada luta
select fighter.name as fighter, combat.name a... | true |
a4ad4552d9269e3048f531929e796219552a60a4 | SQL | canred/lemew | /Limew-web/initDataBase/SQL/MSSQL/VIEW/View.sql | UTF-8 | 16,323 | 2.921875 | 3 | [] | no_license | CREATE VIEW [group_appmenu_v]
as
SELECT
a.UUID,
a.IS_ACTIVE,
a.CREATE_DATE,
a.CREATE_USER,
a.UPDATE_DATE,
a.UPDATE_USER,
a.APPMENU_UUID,
a.GROUP_HEAD_UUID,
a.IS_DEFAULT_PAGE
FROM group_appmenu a
;
CREATE VIEW [department_v]
as
SELECT
Cmp.id company_id,
Cmp.c_name co... | true |
bf059cdc54a7ea730f2faed33fbdaf35da73736e | SQL | vpetrigo/courses | /db2017/week05/task03/schema.sql | UTF-8 | 4,634 | 3.234375 | 3 | [] | no_license | -- database sample for task 5.3
DROP TABLE IF EXISTS Flight;
DROP TABLE IF EXISTS Planet;
DROP TABLE IF EXISTS PoliticalSystem;
-- Справочник политических строев
CREATE TABLE PoliticalSystem(
id SERIAL PRIMARY KEY,
VALUE TEXT UNIQUE
);
-- Планета, её название, расстояние до Земли, политический строй
CREATE TA... | true |
d0e28bd1b8cd88c984f788a4ae3f7c3f110ce072 | SQL | jstarcher/databrary.org | /hasura/migrations/1582827846641_set_fk_public_users_avatarId/up.sql | UTF-8 | 282 | 2.859375 | 3 | [
"MIT"
] | permissive |
alter table "public"."users" drop constraint "users_fileObjectId_fkey",
add constraint "users_avatarId_fkey"
foreign key ("avatarId")
references "public"."assets"
("id") on update no action on delete cascade;
| true |
7e3ce3c0ccf462d39f47c85ef20336d22f8a29df | SQL | reynaldoeg/customers | /public/sql/ingenia.sql | UTF-8 | 6,973 | 2.765625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.4.15.9
-- https://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 17-11-2018 a las 19:25:45
-- Versión del servidor: 5.6.37
-- Versión de PHP: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA... | true |
bcb5696aa981bcbf931e99c57a0b75fa603ac039 | SQL | woo7348/team1_v2sbm3c | /team1_v2sbm3c/src/main/webapp/WEB-INF/doc/상품 비교/iCOMPARE.ddl | UTF-8 | 3,790 | 3.734375 | 4 | [] | no_license |
/**********************************/
/* Table Name: 적금 상품 */
/**********************************/
CREATE TABLE IMONEY(
installno INTEGER(10) NOT NULL PRIMARY KEY,
prodno NUMBER(10) NULL ,
bank VARCHAR2(30) NOT NULL,
iname... | true |
9f93854086d8e5544286b4ea5282720fda5b8cd9 | SQL | sdifiore/Projeto-P2---Biblioteca | /Biblioteca.sql | UTF-8 | 3,057 | 3.40625 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- 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_DATE... | true |
506fa325175525781ff5f13ed00ec93b61716bd2 | SQL | intake24/api-server | /FoodDataSQL/src/main/resources/sql/shared/categories_all_categories_headers_frv.sql | UTF-8 | 943 | 4.34375 | 4 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT",
"BSD-2-Clause",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | WITH RECURSIVE t(code, level) AS (
(SELECT category_code as code, 0 as level FROM categories_categories WHERE subcategory_code = {category_code} ORDER BY code)
UNION ALL
(SELECT category_code as code, level + 1 as level FROM t JOIN categories_categories ON subcategory_code = code ORDER BY code)
)
SELECT DISTINC... | true |
5f6f8d4b7513a513986109d7d8007b90e57a8ccc | SQL | webclinic017/portfolio-manager-4 | /setup/setup_database.sql | UTF-8 | 645 | 3.3125 | 3 | [] | no_license | /* CREATE TABLES IN DATABASE */
CREATE TABLE securities_holding (
symbol VARCHAR(10) PRIMARY KEY,
description VARCHAR(200) DEFAULT null,
asset_type VARCHAR(20) DEFAULT null,
main_type VARCHAR(20) DEFAULT null,
quantity INTEGER DEFAULT 0,
target INTEGER DEFAULT 0
);
CREATE TABLE securit... | true |
f1630d87eba6f644b29a83e1c4e51f84210d1ed7 | SQL | cesar954202/check | /BKPcheckVACIA.sql | UTF-8 | 10,298 | 2.625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 19-07-2018 a las 11:37:03
-- Versión del servidor: 10.1.19-MariaDB
-- Versión de PHP: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... | true |
349571b448dd58221466cae01019bd8031aca2a9 | SQL | kevinburke/rickover | /db/migrations/20160204190200_AddJobs.sql | UTF-8 | 389 | 2.984375 | 3 | [
"MIT"
] | permissive | -- +goose Up
CREATE TYPE delivery_strategy AS enum('at_most_once', 'at_least_once');
CREATE TABLE jobs (
name text PRIMARY KEY,
delivery_strategy delivery_strategy NOT NULL,
attempts SMALLINT NOT NULL,
concurrency SMALLINT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT (now() AT TIME ZONE 'utc... | true |
a912399c93e505a8bf244772fd0b140aa9583f97 | SQL | lefterispap13/PapadogiannisLefterisProjectPartB | /projectB/CreatingDbAndTables(2).sql | UTF-8 | 2,127 | 3.796875 | 4 | [] | no_license | CREATE DATABASE PrivateSchoolStructure;
USE privateSchoolstructure;
CREATE TABLE students(
id INT PRIMARY KEY AUTO_INCREMENT,
last_name VARCHAR(40),
first_name VARCHAR(40),
date_of_birth DATE);
CREATE TABLE trainers(
id INT PRIMARY KEY AUTO_INCREMENT,
last_name VARCHAR(40),
first_name VARCHAR(40),
`subject` VARCHAR(... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.