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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5062878d13dad74b8c595b876861a50113835f7b | SQL | uvalib/apollo | /backend/db/queries.sql | UTF-8 | 1,262 | 3.5625 | 4 | [] | no_license | -- get tree
SELECT n.id, n.parent_id, n.sequence, n.pid, n.value, n.created_at, n.updated_at,
nt.pid, nt.name, nt.controlled_vocab
FROM nodes n
INNER JOIN node_types nt ON nt.id = n.node_type_id
WHERE deleted=0 and current=1 and (n.id=1 or ancestry REGEXP '(^.*/|^)1($|/.*)') order by n.id asc;
-- get CHILDREN
SE... | true |
cbf9cd8ef175ed93a8e25cb9ac5bca489036cafd | SQL | farazyarkhan/Data-Analysis-Portfolio | /SQL/Data Cleaning In SQL (Nashville Housing Dataset).sql | UTF-8 | 2,526 | 4.25 | 4 | [] | no_license | --Dataset That We Will Be Working On.
select * from HousingData
--Removing Timestamp from SaleDate Column.
alter table HousingData add CleanSaleDate date;
update HousingData set CleanSaleDate = CONVERT(Date, SaleDate)
alter table HousingData drop column SaleDate;
sp_rename 'HousingData.CleanSaleDate', 'SaleDate... | true |
3c8cde45f43953ecd2b20c24275bc09785131aed | SQL | jabautista/GeniisysSCA | /src/main/resources/sql/procedures/bae_get_module_parameters.prc | UTF-8 | 2,340 | 2.84375 | 3 | [] | no_license | DROP PROCEDURE CPI.BAE_GET_MODULE_PARAMETERS;
CREATE OR REPLACE PROCEDURE CPI.BAE_get_module_parameters (
var_module_item_no IN giac_module_entries.item_no%type,
var_module_name IN giac_modules.module_name%type,
var_gl_acct_category IN OUT giac_module_entries.gl_acct_ca... | true |
54bfb8d74b11fab2f5287f11b59d04326a9f4b53 | SQL | Amandaalmeida12/foodsearch | /db/19_11_2017.sql | UTF-8 | 6,273 | 2.984375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
--
-- Host: localhost Database: foodsearch_db
-- ------------------------------------------------------
-- Server version 5.7.20-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARAC... | true |
020868f6fb7b789f6c22650eeedcbde001eb4d6c | SQL | bkiers/sqlite-parser | /src/test/resources/e_fkey.test_27.sql | UTF-8 | 562 | 3.125 | 3 | [
"MIT"
] | permissive | -- e_fkey.test
--
-- execsql {
-- CREATE TABLE artist(
-- artistid INTEGER PRIMARY KEY,
-- artistname TEXT
-- );
-- CREATE TABLE track(
-- trackid INTEGER,
-- trackname TEXT,
-- trackartist INTEGER NOT NULL,
-- FOREIGN KEY(trackartist) REFERENCES artist(arti... | true |
4208893dfd13c1a2edfc19e10ec186075599db1b | SQL | kevin-meng/learn-data-analysis-the-hard-way | /SQL/interview/solutions/Q24:查询学生平均成绩及其名次.sql | UTF-8 | 2,452 | 4.34375 | 4 | [] | no_license | -- ########################################################
-- Q24:查询学生平均成绩及其名次
-- ########################################################
--24.1 查询学生的平均成绩并进行排名,sql 2000用子查询完成,分平均成绩重复时保留名次空缺和不保留名次空缺两种。
select
t1.*,
px = (
select
count(1)
from (
select
m.SID 学生编号,
m.Snam... | true |
7131335d1a037811f29889d77ea7c153bf420b31 | SQL | richnamk/python_nov_2017 | /richardN/mySqlQueries/friendships/queryCommands | UTF-8 | 899 | 3.375 | 3 | [] | no_license | INSERT INTO users (first_name, last_name, created_at, updated_at)
VALUES ('Chris','Baker', NOW(), NOW() );
INSERT INTO users (first_name, last_name, created_at, updated_at)
VALUES ('Dianna','Smith', NOW(), NOW() );
INSERT INTO users (first_name, last_name, created_at, updated_at)
VALUES ('James','Johnson', NOW(), NOW... | true |
e10c753881fa626e8062795902c5ee19b362fca9 | SQL | ShinMinGyeong006/Studysqlserver | /sql/07_Tt-sql/210209_join_example.sql | UTF-8 | 419 | 3.15625 | 3 | [] | no_license | select * from userTbl;
select * from buyTbl;
select * from userTbl where userid='Jyp';
select * from buyTbl where userid='Jyp';
select * from buyTbl where userid='bbk';
--inner join
select u.username,u.addr,
concat(u.mobile1,'-', left(u.mobile2,4),'-',right(u.mobile2,4)) as mobile,
b.prodName,b.price,b.amo... | true |
e02c753f7c6da4c5adb392004f895cfdea83dd80 | SQL | JoseManuelLopezBocanegra/BDNBA | /src/DecepctionEntertainment/NBA/sql/CreacionTablas.sql | UTF-8 | 1,258 | 3.328125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Author: manul
* Created: 22-abr-2019
*/
CREATE TABLE EQUIPOS (
ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
NO... | true |
ba6fa42b5f88670047d63eb6255275ecf1dd4897 | SQL | nikhil199710/Employee_Payroll_Problem | /UC3_Insert data.sql | UTF-8 | 399 | 2.9375 | 3 | [] | no_license | /* UC 3 :
Insert data into the table */
use payroll_service;
/* Creating a table */
create table employee_payroll
(EmpID int not null identity(1,1) primary key,
EmpName varchar(150) not null,
Salary float not null,
StartDate date not null
);
/* Inserting data into table */
insert into employee_payroll(EmpName,Salary,St... | true |
b03ef58e9d97ffc5de01d18e4f209fd5e146d081 | SQL | vti/object-db1 | /t/test_schema/mysql.sql | UTF-8 | 1,650 | 3.046875 | 3 | [] | no_license | CREATE TABLE `category` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`author_id` INTEGER,
`title` varchar(40) default ''
) TYPE=innodb;
CREATE TABLE `article` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`category_id` INTEGER,
`author_id` INTEGER,
`title` varchar(40) default ''
) TYPE=innodb;
CREATE TABLE `comment` ... | true |
c74c23a0cf50b79a5c5164b1e77d8c578c72c303 | SQL | ligy2016/mysql | /gaoxiao_sql_bk/obj_prod_update_ccnt_blnc.sql | UTF-8 | 4,485 | 3.546875 | 4 | [] | no_license | /*
SQLyog Enterprise v12.09 (64 bit)
MySQL - 5.7.20-log : Database - feps
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHE... | true |
b7bcf25e05c335a91d8b3781773e46da5bcea92b | SQL | rhirning/nicki-consulting | /nicki-consulting-core/db/derby/create_CUSTOMERS.sql | UTF-8 | 376 | 2.609375 | 3 | [] | no_license | DROP TABLE APP.CUSTOMERS;
CREATE TABLE APP.CUSTOMERS (
ID bigint NOT NULL GENERATED ALWAYS AS IDENTITY,
NAME varchar(1000) NOT NULL,
PARENT_ID bigint,
ALIAS varchar(1000),
STREET varchar(1000),
ZIP varchar(1000),
CITY varchar(1000),
INVOICE_TEMPLATE varchar(1000),
TIMESHEET_TEMPLATE varcha... | true |
daede74a2e4230bb1a8ea10cee7fdc3f7744948e | SQL | He-Ze/Web-SYSU | /大作业/test/dataset/blogger_likes.sql | UTF-8 | 847 | 2.8125 | 3 | [
"MIT"
] | permissive | create table likes
(
lid int auto_increment
primary key,
blogId int not null,
userId varchar(255) null
);
INSERT INTO blogger.likes (lid, blogId, userId) VALUES (1, 1, 'gth');
INSERT INTO blogger.likes (lid, blogId, userId) VALUES (2, 1, 'heze');
INSERT INTO blogger.likes (lid, blogId, ... | true |
a0c06544ffb982597ad4b555a8cc027019f7ea89 | SQL | Gemy95/Back-End-EasyKashTask | /create database/create and insert queries.sql | UTF-8 | 1,608 | 3.359375 | 3 | [] | no_license | create database if not exists easykashtaskdb;
use EasyKashTaskDB ;
CREATE TABLE IF Not Exists Seller (
seller_id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
email VARCHAR(50) NOT NULL,
phone_number VARCHAR(50) NOT NULL,
address VARCHAR(50) NOT NULL,
cre... | true |
1ca240d5c132a81600053c662af22da47b272011 | SQL | OneSharpeGuy/prime | /sts/osg_singout_support/osg_users.sql | UTF-8 | 872 | 3.765625 | 4 | [] | no_license | SELECT u.uid,
u.name AS u_name,
u.mail,
d.name AS voice_part,
d.tid,
ifnull(m.hit,0) as is_member,
ifnull(n.hit,1) as is_singer,
CASE u.uid
WHEN 1 THEN 1
ELSE ifnull(a.hit,0)
END AS is_admin
FROM users u
LEFT JOIN field_data_field_voice_pa... | true |
50eaa81fc3b7ef5aa47b6c00cabb458d9749ff2c | SQL | qk27015/Introduction-to-practical-SQL | /03/002_union.sql | UTF-8 | 231 | 2.8125 | 3 | [] | no_license | -- UNIONを用いた条件分岐
-- 実行計画が冗長になる
select item_name, year, price_tax_ex as price
from Items
where year <= 2001
union all
select item_name, year, price_tax_in as price
from Items
where year >= 2002; | true |
3a8216bca9ebfd434f0c276e4b66cc1f98eab702 | SQL | strongyoung/spider | /sql/selectSeed.sql | UTF-8 | 391 | 2.625 | 3 | [] | no_license | delimiter $$
use forconsumer ;
drop procedure if exists selectSeed;
create procedure selectSeed(
in iStart int,
in iNum int,
in vown varchar(50))
begin
if iNum is null or iNum = 0 then
select * from seed where is_visited=0 and is_valid=1 and own=vown;
else
select * from seed where is_visited=0 and is... | true |
abdc032370aae243583232c4f4218a1eca42461d | SQL | Tong-Chen/eg | /config/mm9/makeDb.sql | UTF-8 | 2,422 | 2.625 | 3 | [] | no_license | drop table if exists config;
create table config (
bbiPath text not null,
seqPath text null,
defaultGenelist text not null,
defaultCustomtracks text not null,
defaultPosition varchar(255) not null,
defaultDataset varchar(255) not null,
defaultDecor text null,
defaultScaffold text null,
hasGene boolean... | true |
7a37094d3cd52f485c625b005a3da8cd19c791e4 | SQL | OvidiuEDSgrup/CARMOLACT | /Stored Procedures/Procs1/CompletezDateReceptiiSF.sql | UTF-8 | 774 | 3.25 | 3 | [] | no_license | CREATE procedure CompletezDateReceptiiSF @Sub char(9), @Tip char(2), @Numar char(8), @Data datetime AS
if OBJECT_ID('tempdb..#yso_pozdocsf') is not null drop table #yso_pozdocsf
select p.idPozDoc
,f.Valoare, f.TVA_22
into #yso_pozdocsf
from pozdoc p
inner join facturi f on f.Subunitate=p.Subunitate and f.Tip=0x54... | true |
7408bac057c2b99a42cb658925d2505b44b38172 | SQL | ku5-ku5/CM2305-Voting-System-Prototype- | /Scripts/SQL Scripts/Politicians_Table.sql | UTF-8 | 914 | 2.53125 | 3 | [] | no_license | CREATE TABLE Political_Party(
UId CHAR(38) NOT NULL,
Name VARCHAR(255) NOT NULL,
PRIMARY KEY (UId)
);
INSERT INTO `votedb`.`political_party`
(`UId`,
`Name`)
VALUES
('c5a60d73-ffe0-11e9-8f05-1831bf97a796',
'Labour');
INSERT INTO `votedb`.`political_party`
(`UId`,
`Name`)
VALUES
('c5a7721d-ffe0-11e9-8f05-1831bf97a... | true |
8872e51c5232df5c6f42819b53708253285cff0d | SQL | sprokushev/Delphi | /MASTER/_DATABASE/Tables/MASTER_KLS_STRUCTURE.sql | WINDOWS-1251 | 2,083 | 3.375 | 3 | [] | no_license | --
-- MASTER_KLS_STRUCTURE (Table)
--
CREATE TABLE MASTER.MASTER_KLS_STRUCTURE
(
ID VARCHAR2(50 BYTE) NOT NULL,
CAPTION VARCHAR2(100 BYTE),
SORTBY NUMBER(3),
TABLE_NAME VARCHAR2(50 BYTE),
UNIQUE_FIELD VARCHAR2(30 BYTE) DEFAULT 'ID'... | true |
f7ea7782e14566900fc064df44c5adaca4ee641f | SQL | lidianzhe/sqlscript | /Iris/inout.sql | UTF-8 | 248 | 2.546875 | 3 | [] | no_license | PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE InoutDetails(
PId integer not null primary key autoincrement,
DeviceNo varchar(20) ,
PersonId int null,
CardTime datetime,
Flag tinyint,
SeriesId tinyint,
if_UserNo integer
);
COMMIT;
| true |
dfbe4411294fce121245cff30410f9c6ca44e319 | SQL | AlexeyTiunov/avtodok.com.ua | /bitrix/php_interface/include/autodoc_preprocess_tmp_db.sql | UTF-8 | 619 | 2.8125 | 3 | [] | no_license |
-- Ищем текущий ID для всех товаров во временной таблице
UPDATE b_autodoc_import_temp AS t1, b_autodoc_items_m AS t2
SET t1.CurItemID = t2.id
WHERE t1.ItemCode = t2.ItemCode
AND t1.BrandCode = t2.BrandCode
;
-- Работа с ценами
-- Ищем текущий ID цены для всех товаров во временной таблице
UPD... | true |
2e0e34b7710fa023ae6ea00d2f5fe6e12c03e6b0 | SQL | fagan2888/Loan-Canoe | /notebooks/00_sql/03b_interim_wrangle__balanced_rand_samp__bbz.sql | UTF-8 | 87,612 | 3.5625 | 4 | [
"MIT"
] | permissive | /***************************************************************************************************************/
/* Purpose: (1) Typecast transform & Generate Simple, Balanced, Random Samples for each year for ingestion */
/* + (2) Union all the samples for the interim dataset for additional wranglin... | true |
86dff74b81262e13d7972994a11d12d3d6f4859a | SQL | Andacanaver/books-backend | /migrations/001.do.create_books_table.sql | UTF-8 | 683 | 3.640625 | 4 | [] | no_license | CREATE TABLE books (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
book_name TEXT NOT NULL,
date_created TIMESTAMP NOT NULL DEFAULT now()
);
CREATE TABLE book_content (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
title TEXT NOT NULL,
plot TEXT,
book_id INTEGER REFERE... | true |
b6abc86cff82d480b16de200ae2a99e8db7e452f | SQL | nigelainscoe/biml-database | /CRM_Database/Logging/Tables/ClientFileProcessing.sql | UTF-8 | 482 | 2.765625 | 3 | [
"MIT"
] | permissive | CREATE TABLE Logging.ClientFileProcessing
(
ClientFileId INT IDENTITY
NOT NULL
, FileName NVARCHAR(256) NOT NULL
, StagingStarted DATETIME2(0)
, RowsStagedCount INT
, StagingCompleted DATETIME2(0)
, ProductionLoadStarted DATETIME2(0)
, RowsLoadedCount INT
, ... | true |
8518d6218fb97c18899f0a549c7e559039ed47c9 | SQL | cordulaflavio/etl_cecampe_ne | /SQL/024_Relacionamento_ideges_ref_2020_com_censo_escolas_2020.sql | UTF-8 | 4,574 | 4.0625 | 4 | [] | no_license | -- Tabela da tabela key_ideges_ref2020_censo_escolar_2020 para relacionar ideges ref2020 a censo_escolar_2020_escolas
-- ideges --> ano_ref_ideges = 2020
-- olinda_pdde_adesao_atualizacao --> an_exercicio = 2020
-- key_ideges_ref2020_censo_escolar_2020
-- Insere dados de olinda_pdde_adesao_atualizacao
-- insere só os ... | true |
83d92268d6836ec625b85ea88be2b11cc86d0864 | SQL | bellmit/origin | /family_order/sql/.svn/pristine/83/83d92268d6836ec625b85ea88be2b11cc86d0864.svn-base | UTF-8 | 691 | 3.015625 | 3 | [] | no_license | SELECT eparchy_code,city_code,res_type_code,res_kind_code,to_char(sum(sale_num)) sale_num,value_code,stock_id
FROM tf_b_cardsale_log
WHERE (:RES_TYPE_CODE is null or res_type_code=:RES_TYPE_CODE)
AND (:RES_KIND_CODE is null or res_kind_code=:RES_KIND_CODE)
AND (:VALUE_CODE is null or value_code=:VALUE_CODE)
... | true |
000f6d22679b24005a713d839cfd324f5949cc6f | SQL | Abraao2501/Exercicios-SQL | /group by.sql | ISO-8859-2 | 937 | 3.984375 | 4 | [
"MIT"
] | permissive | --GROUP BY
--Group by divide o resultado da pesquisa em grupos
SELECT *
FROM Sales.SalesOrderDetail
SELECT SpecialOfferID, SUM(UnitPrice) AS 'Soma'
FROM Sales.SalesOrderDetail
GROUP BY SpecialOfferID
SELECT ProductID, COUNT(ProductID)AS 'Contagem'
FROM Sales.SalesOrderDetail
GROUP BY ProductID
SELECT FirstName, COUN... | true |
559ae74def0bd2af89783dc716c9bc6147245f3b | SQL | radtek/OracleScripts | /SQL/TEMP/id6.sql | UTF-8 | 500 | 2.75 | 3 | [] | no_license | SQL>
SQL> select 'alter index '||owner||'.'||name||' rebuild tablespace '||tablespace_name
2 ||';'
3 from temp_stats, dba_indexes
4 where
5 temp_stats.name = dba_indexes.index_name
6 and
7 (height > 3
8 or
9 del_lf_rows > 10);
SQL>
SQL> select 'analyze index '||owner||'.'||name||' compute stat... | true |
473cb8e212986ab7c40541e32b299acbdf767275 | SQL | ebukaodu/Exercise-4 | /books.sql | UTF-8 | 10,186 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 25, 2018 at 06:01 PM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
f892712472d24313230b757b89bad879c8bbe27e | SQL | mike14747/express-passport-sessions | /config/schema.sql | UTF-8 | 1,032 | 3.40625 | 3 | [] | no_license | DROP DATABASE IF EXISTS testDB;
CREATE DATABASE testDB;
USE testDB;
set foreign_key_checks=0;
-- --------------------------------------------------------
CREATE TABLE sessions (
session_id varchar(128) COLLATE utf8mb4_bin NOT NULL,
expires int unsigned NOT NULL,
data mediumtext COLLATE utf8mb4_bin,
P... | true |
f98d3af3469ab08049f426fe3296597a5cfbd755 | SQL | dragonrossa/database_fakultet | /SQLQuery_10052018.sql | WINDOWS-1250 | 16,786 | 3.40625 | 3 | [] | no_license |
/*komentari
u vie
redaka*/
--kreiramo bazu koja se zove Prva_baza
CREATE DATABASE Prva_baza;
-- ulazak/odabir baze
USE Prva_baza;
--drop database brie bazu
DROP DATABASE Prva_baza;
CREATE DATABASE Prva_baza;
USE MOJA_FIRMA;
CREATE TABLE osobe (
OIB char(11),
Ime varchar(50),
Prezi... | true |
f84dc85dd78014d7c50fe88ae79fc7966e9598ea | SQL | Zhenghao-Liu/LeetCode_problem-and-solution | /1174.即时食物配送II/solution2.sql | UTF-8 | 284 | 3.65625 | 4 | [] | no_license | # Write your MySQL query statement below
SELECT
ROUND(AVG(IF(order_date=customer_pref_delivery_date,1,0))*100,2) AS immediate_percentage
FROM
Delivery
WHERE
(customer_id,order_date) IN (SELECT customer_id,MIN(order_date) AS order_date FROM Delivery GROUP BY customer_id);
| true |
bf3e564b46b9039aafb11da225e2362427ae7a69 | SQL | gabaghul/URI | /2988.sql | UTF-8 | 1,068 | 3.578125 | 4 | [] | no_license | select
t.name,
count(*) as matches,
count(case when
((t.id = m.team_1 and m.team_1_goals > m.team_2_goals)
or (t.id = m.team_2 and m.team_2_goals > m.team_1_goals)) then m.id end) as "victories",
count(case when
((t.id = m.team_1 and m.team_1_goals < m.team_2_goals)
... | true |
dd56139e20db9b0ef0973719c2a0195833ea3d26 | SQL | dougfii/zjslzj.web | /db/zjslzj.alter.20180520.sql | UTF-8 | 29,448 | 3.078125 | 3 | [] | no_license | alter table t_project add column type INTEGER NOT NULL DEFAULT 0;
update t_project set type=1;
alter table t_project add column n10005 INTEGER NOT NULL DEFAULT 0;
alter table t_project add column n10006 INTEGER NOT NULL DEFAULT 0;
alter table t_project add column n10007 INTEGER NOT NULL DEFAULT 0;
alter table t_proje... | true |
012d2bde92c00d64bc08affd3b8357fa54aae60b | SQL | hw79chopin/MySQL-Codebook | /SQL 스터디/초급/052.sql | UTF-8 | 277 | 3.359375 | 3 | [] | no_license | -- 집계 결과 출력하기 (ROLLUP) (MySQL에서는 WITH ROLLUP)
-- Q 부번호, 직업과 직업별 토탈 월급을 출력하되, 중간중간마다 부서의 토탈 월급을 출력하시오
SELECT deptno, job, sum(sal)
FROM emp
GROUP BY deptno, job
WITH ROLLUP; | true |
46887bd2c8b240cd9cc4c2113a46388ea4b2be27 | SQL | jimianelli/FishSampleR | /cases/Atka/sql/atka.sql | UTF-8 | 979 | 3.125 | 3 | [] | no_license | /* age script for revised aug 98 */
spool atka_age.dat
set pagesize 0;
set linesize 65;
set termout off;
set feedback off;
select h.vessel_type ||'_'||h.cruise||'_'||h.vessel||'_'||h.haul||' '||
h.nmfs_area ||' '||
nvl(h.bottom_depth,-9) ||' '||
to_char(x.haul_date,'mm') ||' '||... | true |
78c175e3530094069ca3669b2d3a4eea5d5fac24 | SQL | malliina/musicpimp | /musicpimp/conf/db/migration/V1__initial.sql | UTF-8 | 2,553 | 3.765625 | 4 | [
"BSD-3-Clause"
] | permissive | create table if not exists USERS
(
USER varchar(100) not null primary key,
PASS_HASH text not null
);
create table if not exists FOLDERS
(
ID varchar(191) not null primary key,
TITLE text not null,
PATH text not null,
PARENT varchar(191) not null,
constra... | true |
4671f1a2b9fea32e6cce5af172a675e3b55d090e | SQL | GordinV/buh70 | /sql/palk/create_view_palk.cur_puudumine.sql | UTF-8 | 1,386 | 3.1875 | 3 | [] | no_license | DROP VIEW IF EXISTS palk.cur_puudumine;
CREATE OR REPLACE VIEW palk.cur_puudumine AS
SELECT p.id,
p.lepingid,
p.kpv1,
p.kpv2,
p.paevad,
p.summa,
p.puudumiste_liik :: VARCHAR(20) AS pohjus,
p.tyyp,
amet.nimetus AS amet,
t.rekvid,
... | true |
a03b2d101ce676732a655134e742db201d98597b | SQL | OlafMd/MedCon1.0 | /mm-libs/dbaccess/Level 3/CL3_DeveloperTasks/Atomic/Retrieval/SQL/cls_Get_RecommendedDeveloperTaskList_for_ActiveUser.sql | UTF-8 | 2,176 | 3.203125 | 3 | [] | no_license |
Select
tms_pro_developertasks.TMS_PRO_DeveloperTaskID AS DeveloperTask_ID
From
tms_pro_developertask_recommendations Inner Join
tms_pro_projectmembers
On tms_pro_developertask_recommendations.RecommendedTo_ProjectMember_RefID =
tms_pro_projectmembers.TMS_PRO_ProjectMemberID Inner Join
tms_pro_feature_2... | true |
b885a37fe3e89b8a23ba8c21b19c4d9dab9ed96e | SQL | chipbuster/skull-atlas | /scripts/SQL/genDB.sql | UTF-8 | 432 | 2.96875 | 3 | [
"BSD-3-Clause"
] | permissive | /* This file is meant to be used to generate a standard schema for the
* skull atlas project.
* Let ${DB} be the file that sqlite3 uses to store the database. To use
* this script, simply run sqlite3 ${DB} < genDB.sql.
* Note that this will fail if the tables already exist within the db. */
create table metrics(pa... | true |
0fb55dc6fc8c66ac82bf9dabb02f62692be88aea | SQL | vigneshvkp/Asp-Internal-Work | /temp.sql | UTF-8 | 14,758 | 3.703125 | 4 | [] | no_license |
DROP TABLE IF EXISTS `assesment_group`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `assesment_group` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`group_name` varchar(50) CHARACTER SET latin1 NOT NULL,
`description` varchar(255) CH... | true |
574caf93e6fca4590d5730d848bd3cccaf6b3318 | SQL | milafiolita/mysql | /task1.sql | UTF-8 | 5,140 | 3.234375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
--
-- Host: localhost Database: task1
-- ------------------------------------------------------
-- Server version 5.7.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... | true |
6fd6e67d3043c84613f9f1fab5c0e4599305fa8a | SQL | Vizzuality/trase | /db/views/ind_values_meta_mv_v01.sql | UTF-8 | 3,385 | 4.34375 | 4 | [
"MIT"
] | permissive | WITH flow_paths AS (
SELECT DISTINCT(UNNEST(path)) AS node_id, context_id FROM flows
), nodes AS (
SELECT
nodes.id,
nodes.node_type_id,
fp.context_id
FROM flow_paths fp
JOIN nodes ON fp.node_id = nodes.id
), node_values AS (
SELECT
ind_id,
context_id,
country_id,
commodity_id,
ARRAY_... | true |
7c163c3cca655558688c8845943e9c16cd562dbd | SQL | bew61990/SE3910CommerceProject | /Final Prototype (Dec6)/Final Prototype (Dec6)/test2Prototype/create_db.sql | UTF-8 | 1,163 | 3.203125 | 3 | [] | no_license | CREATE DATABASE SportsChatApp;
CREATE TABLE users (
user_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
username VARCHAR(20) NOT NULL,
pass VARCHAR(128) NOT NULL,
email VARCHAR(60) NOT NULL,
fav_player INTEGER UNSIGNED,
fav_team INTEGER UNSIGNED,
PRIMARY KEY (user_id)
);
CREATE TABLE teams (
team_id INTEGE... | true |
528bc5f4ccdb7a90a345c06f75fefb8379051953 | SQL | mujurin/project-d3.js | /baciroui/baciro.sql | UTF-8 | 2,198 | 2.828125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 14, 2016 at 03:59 PM
-- Server version: 5.5.49-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
dd3064c80dabf9c892816766c4fe058201fd2d45 | SQL | Killor1/CampJPA | /summerCamp_schema.sql | UTF-8 | 1,599 | 3.515625 | 4 | [] | no_license | CREATE TABLE cuidador (
dni char(9),
nom varchar(30),
telefon char(9),
adreça varchar(100),
email varchar(25),
CONSTRAINT cuidador_pk PRIMARY KEY (dni),
CONSTRAINT dni_valid_ck CHECK (dni ~*'[[:digit:]]{8}[[:alpha]]{1}')
);
CREATE TABLE nen (
id_nen int,
... | true |
7e637d98daff698468893c7f00e2069e8e53c12c | SQL | MurielPinho/FEUP-BDAD-Project | /3rd Delivery/Queries/int1.sql | UTF-8 | 312 | 3.90625 | 4 | [] | no_license | .bail ON
.mode columns
.headers on
.nullvalue NULL
PRAGMA foreign_keys = ON;
-- 1. Ranking of the channels by follower count.
SELECT channel.name AS Channel, COUNT(follows.channelID) AS Followers
FROM channel, follows
WHERE channel.channelID = follows.channelID
GROUP BY channel.name
ORDER BY Followers DESC
| true |
a60a72c49f54e1684c18d2235cb1cc3a72698dd2 | SQL | vikozlov89/iowa_liquor_sales_eda | /scripts/sql/query_basic_columns_stats.sql | UTF-8 | 5,220 | 2.6875 | 3 | [] | no_license | SELECT 'Stats' as series_name
, count(invoice_and_item_number) total_rows
, count(distinct invoice_and_item_number) distinct_invoice_and_item_number_values
, count(distinct date) days_tracked
, min(date) earliest_day_tracked
, max(date) latest_day_tracked
, date_diff(max(date),min(date),DA... | true |
6d93e6a96b843abeb3a1f9b5e57aa814f6fe41ff | SQL | DilshanSamaraweera96/LMS | /db/sipsewana.sql | UTF-8 | 17,975 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jun 09, 2020 at 05:25 AM
-- Server version: 5.7.26
-- PHP Version: 7.2.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
ad18b530717dd6344014793b310c50a9fdfe8f61 | SQL | bgoldfarb/libraryDatabase | /mySQL_Queries/queries12.sql | UTF-8 | 1,480 | 4.125 | 4 | [] | no_license | use l;
SELECT SSN, Nme
FROM EMPLOYEE
WHERE SSN IN (SELECT ESSN FROM EMPDEP)
UNION
SELECT SSN, Nme
FROM EMPLOYEE
WHERE SSN IN (SELECT ManagerSSN FROM EMPLOYEE);
SELECT SSN, Nme
FROM EMPLOYEE
WHERE SSN IN (SELECT ESSN FROM EMPDEP) AND
SSN IN(
SELECT SSN
FROM EMPLOYEE
WHERE SSN IN (SELECT ManagerSSN FROM EMPLOYEE));
S... | true |
58a76c61033922bec0babbcd2dd97179a599382b | SQL | cosmic-cowboy/sql_head_training_cource | /10_set_operation_03/10_list08.sql | UTF-8 | 311 | 3.109375 | 3 | [] | no_license | SELECT
CASE
WHEN age < 20 THEN '子供'
WHEN age >= 20 AND age < 69 THEN '成人'
WHEN age >= 70 THEN '老人'
ELSE NULL
END AS age_case,
COUNT(*)
FROM Persons
GROUP BY
CASE
WHEN age < 20 THEN '子供'
WHEN age >= 20 AND age < 69 THEN '成人'
WHEN age >= 70 THEN '老人'
ELSE NULL
END | true |
bb631257ae03e961ba2fa653584f4d8b44828438 | SQL | LizeDong22/BlakeDong | /dopl.sql | UTF-8 | 2,092 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Dec 13, 2019 at 12:59 PM
-- Server version: 5.6.34-log
-- PHP Version: 7.1.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
e3d117115a41607329b067862c2fe4b9eb52184b | SQL | cbush2014/MySQL-Employee-Tracker | /schema.sql | UTF-8 | 2,830 | 4.53125 | 5 | [] | no_license | DROP DATABASE IF EXISTS ee_tracker;
CREATE DATABASE ee_tracker;
USE ee_tracker;
CREATE TABLE departments (
department_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30)
);
CREATE TABLE roles (
role_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(30),
salary ... | true |
03e1b3293094a638345a5d96209b8127fe3d3bce | SQL | geniot/adserverbeans | /db/procs/get_random_banner_by_traffic_share.sql | UTF-8 | 1,204 | 3.5625 | 4 | [] | no_license | DELIMITER ;;
DROP FUNCTION if exists get_random_banner_by_traffic_share;
CREATE FUNCTION get_random_banner_by_traffic_share(valid_banners TEXT, total_traffic_share INTEGER)
RETURNS INTEGER
NOT DETERMINISTIC
BEGIN
DECLARE pos INTEGER DEFAULT 1;
DECLARE rnd INTEGER DEFAULT 0;
DECLARE current_... | true |
ebc4c03c185d0c22b008423e417c24cf07e3b7b1 | SQL | ivanborodkin1997/StartJava | /src/com/startjava/lesson_5/queries.sql | UTF-8 | 1,232 | 3.390625 | 3 | [] | no_license | --queries
SELECT * FROM Jeagers; --вывод всей таблицы
SELECT * FROM Jeagers WHERE status = 'Active'; --отображение только не уничтоженных роботов
SELECT * FROM Jeagers WHERE mark IN ('1','6'); --отображение роботов нескольких серий (Mark-1,6)
SELECT * FROM Jeagers ORDER BY mark DESC; --отсортированная таблицы по уб... | true |
61425cbb92aaf7c0c94e3417bf06b653be95f680 | SQL | kristijnswinnen/Natuurpunt-wwf-lpi | /Natuurpunt-wwf-lpi dragonfly.sql | UTF-8 | 3,731 | 4.09375 | 4 | [] | no_license | -- select all dragonflies with more than 30 recordings, create a temp table a
drop table if exists a;
create temp table a
as
(select v.id, naam_nl, naam_lat, count(distinct(w.id)) aantal
from vogel v
inner join waarneming w on (w.id_vogel=v.id)
where v.ind_diergroep in (5) --dragonflies
and id_species_type ... | true |
d096f74970c95b6d5a5345ae7c5d2c08db1e2e87 | SQL | MohamedHar0un/BookManagement | /todoapp.sql | UTF-8 | 3,285 | 3.40625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 31, 2015 at 08:18 PM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
27aa2a0fda74d9c5ebf0b91f13ea9e68dfe85f07 | SQL | toun0u/CaamhroApi | /app/install/forms/structure.sql | UTF-8 | 4,572 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.11.2
-- http://www.phpmyadmin.net
--
-- Host: mysql1.netlorconcept.com
-- Generation Time: Apr 17, 2008 at 06:41 AM
-- Server version: 4.0.27
-- PHP Version: 5.2.0-8+etch10
-- --------------------------------------------------------
--
-- Table structure for table `dims_mod_forms`
... | true |
60e85fea5be649c01ee19ce48c5f0a51b01cfcbd | SQL | MARK-42/Store_Management | /tables.sql | UTF-8 | 2,490 | 3.578125 | 4 | [] | no_license | DROP TABLE tabEmployee;
DROP SEQUENCE employeeSeq;
DROP TABLE tabCustomer;
DROP SEQUENCE customerSeq;
DROP TABLE tabBill;
DROP SEQUENCE billSeq;
DROP TABLE tabProductStock;
DROP TABLE tabProductRegister;
create table tabEmployee(
employeeId number(4) NOT NULL PRIMARY KEY,
firstName varchar2(15) NOT NULL,
... | true |
ab7377481cf4f8b6ec1aa2e11a6c4fb5087d1af7 | SQL | ferkopar/ToDoSchema | /TREATM_REL_TAPI_1.sql | UTF-8 | 4,943 | 2.828125 | 3 | [] | no_license | --------------------------------------------------------
-- DDL for Package Body TREATM_REL_TAPI
--------------------------------------------------------
CREATE OR REPLACE PACKAGE BODY "TREATM_REL_TAPI"
IS
-- insert
PROCEDURE ins(
p_TREATM_ID2 IN TREATM_REL.TREATM_ID2%type ,
p_TIME_START ... | true |
1cda4dc3370c0ebb9c068d5abc538b81405b01fb | SQL | jrjr-randy/backoffice | /sql/proc/payout_rank_bonus.proc.sql | UTF-8 | 1,962 | 4.25 | 4 | [] | no_license | -- --------------------------------------------------------------------------------
-- Commissions - Rank Bonus
-- --------------------------------------------------------------------------------
DELIMITER $$
DROP PROCEDURE IF EXISTS `payout_rank_bonus`$$
CREATE PROCEDURE `payout_rank_bonus`(_commission_period_id INT... | true |
d8df8571d2025ddf3b5dd64209b41587fd162391 | SQL | ProfDema/uam | /pam/examples/anon_data/group_0088/q9.sql | UTF-8 | 506 | 3.625 | 4 | [] | no_license | truncate query9;
--[5 Marks] Report of sales by products introduced on or before 31 Dec 2015 and sort them in increasing order of the introduction date. A sale
--is represented by a row of order table with status ‘S’.
INSERT INTO query9
SELECT p.pid as pid, p.introdate as date, sum(o.quantity*o.price) as totalsa... | true |
c90736a610f801e167ddc5efb37860feb850606f | SQL | Swarmops/Swarmops | /Database/Schemata/upgrade-0075.sql | UTF-8 | 5,606 | 4 | 4 | [
"LicenseRef-scancode-warranty-disclaimer",
"CC0-1.0",
"Unlicense",
"LicenseRef-scancode-public-domain"
] | permissive | CREATE TABLE `FinancialAccountDocuments` (
`FinancialAccountDocumentId` INT NOT NULL AUTO_INCREMENT,
`FinancialAccountId` INT NOT NULL,
`FinancialAccountDocumentTypeId` INT NOT NULL,
`UploadedDateTime` DATETIME NOT NULL,
`UploadedByPersonId` INT NOT NULL,
`ConcernsPeriodStart` DATETIME NOT NULL,
`Concerns... | true |
a51c67f879f60902cee712277ebee3185f90ee0f | SQL | CollinJWynn/MySQLFinalProject | /newCreatedBy.sql | UTF-8 | 665 | 4.21875 | 4 | [] | no_license | USE finalproject;
DROP TABLE IF EXISTS CreatedBy;
CREATE TABLE CreatedBy (
CreatedBy_ID int(11) NOT NULL auto_increment,
CreatedBy VARCHAR(50) NOT NULL,
PRIMARY KEY (CreatedBy_ID)
) AS
SELECT DISTINCT CreatedBy
FROM invoices
WHERE CreatedBy IS NOT NULL
ORDER BY CreatedBy;
ALTER TABLE invoices
ADD COLUMN C... | true |
9da380f708d1429c7501a100afbdc0eb43ace257 | SQL | sebgatullah372/Perky_Rabbit_task | /perky_rabbit.sql | UTF-8 | 8,199 | 2.875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 22, 2020 at 10:12 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
a598ce4f893b6fa788aba23a9985a3462da4554e | SQL | ouahsai/corot_enquetes | /_SQL/requeteCOUNT.sql | UTF-8 | 187 | 3.40625 | 3 | [] | no_license | USE sondages;
SELECT p.libelle, count(DISTINCT r.id) compte
FROM proposition p
LEFT JOIN reponse r
ON r.id_proposition = p.id
WHERE p.id_question = 4
GROUP BY p.id
ORDER BY compte DESC;
| true |
e4cc00faee7774378a15c594ba57468f3301fa2d | SQL | asmgit/erp_example_sql | /assets/seed/test_data_documents.sql | UTF-8 | 5,860 | 3.65625 | 4 | [] | no_license | SET @@cte_max_recursion_depth = 999999
;
SET @clients_count = 5000
, @materials_count = 50000
, @documents_count = 100000
, @positions_per_document = 150
;
SET FOREIGN_KEY_CHECKS = 0, SQL_LOG_BIN = 0, UNIQUE_CHECKS = 0
;
TRUNCATE TABLE current_stock;
TRUNCATE TABLE document_positions;
TRUNCATE TABLE documents;
TRUNCATE... | true |
94b79d019757103f16c5aa36e32e23ae93078930 | SQL | JuanMtz/Examen-2da-oportunidad | /examen2_juanAntonio.sql | UTF-8 | 14,401 | 3.234375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- 05/07/15 18:59:44
-- 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='TRADITION... | true |
5086ddf1a839e242bb69d1c38e3044d2b91a3ca1 | SQL | gpereiraPy/Paddle | /BD.sql | UTF-8 | 1,918 | 3.46875 | 3 | [] | no_license |
create database paddle;
create table usuarios (
id_usuario int not null primary key AUTO_INCREMENT,
nombre varchar(50) not null,
edad char(4) not null,
email varchar(40),
telefono char(15),
direccion varchar(60)
);
create table cancha (
id_cancha int not null primary key AUTO_INCREMENT,
precio DECIMAL(7,... | true |
d68ae408d6129e3051cac07377f481f3ab9133f3 | SQL | mscheck-mscs/1714mscheckV | /1714mscheck2F2/1417mscheck2f2.sql | UTF-8 | 1,501 | 3.96875 | 4 | [] | no_license | --Miranda Scheck
--EX: 2F quries
--Animal Shelter
--1) All Animals
SELECT Animals.AnimalName, AnimalTypes.Type, People.FirstName + N' ' + People.LastName AS Owner
FROM Animals INNER JOIN
AnimalTypes ON Animals.AnimalType_Id = AnimalTypes.Id INNER JOIN
... | true |
97daac1ba059794dee202e2fd538d9b8101d6ca6 | SQL | lyoshik11111993/auction_house | /auctionhouse.sql | UTF-8 | 1,341 | 3.921875 | 4 | [] | no_license | CREATE TABLE `Seller` (
`id` int(11) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `product` (
`id` int(11) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`seller_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_pro... | true |
e0775c8f4f2b34728a10855f90872dbf3325581b | SQL | abaker4/grocery-list | /bootstrap.sql | UTF-8 | 688 | 3.09375 | 3 | [] | no_license | CREATE DATABASE grocerylist;
use grocerylist;
CREATE TABLE `list` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(355) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
C... | true |
d1dc9437339a15300b2c489125601ab85074e439 | SQL | dsoccer1980/spring-db | /jpa/spring-boot-jpa/src/main/resources/data.sql | UTF-8 | 475 | 2.515625 | 3 | [] | no_license | DELETE FROM Book;
DELETE FROM Author;
INSERT INTO Author(id, name) VALUES (1, 'Стругацкий');
INSERT INTO Author(id, name) VALUES (2, 'Уэллс');
INSERT INTO Author(id, name) VALUES (3, 'Пушкин');
INSERT INTO Book(id, name, author_id) VALUES (100, 'Трудно быть Богом', 1);
INSERT INTO Book(id, name, author_id) VALUE... | true |
2517880db68a91963eee57e96e4ec0515b140c63 | SQL | ICE-SIB/sib | /sql/V3__fix_rate_type.sql | UTF-8 | 316 | 2.984375 | 3 | [
"MIT"
] | permissive | ALTER TABLE machine_deployments DROP COLUMN rate_type;
ALTER TABLE machine_deployments DROP CONSTRAINT location;
ALTER TABLE machines RENAME COLUMN code TO asset_number;
ALTER TABLE machines ADD COLUMN rate_type char(1) NOT NULL;
ALTER TABLE machines ADD CONSTRAINT valid_rate_type CHECK (rate_type IN ('h', 'd'));
| true |
72c54220fe4148c6b24bc30d29a14b30a08b7aa9 | SQL | reiya-shioda/takuma-b | /mydb.sql | UTF-8 | 2,565 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2017 年 7 朁E20 日 05:49
-- サーバのバージョン: 10.1.16-MariaDB
-- PHP Version: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
4f5c053730dfe3342a4a5a400cefe7175f37d434 | SQL | lyrric/config-server | /server/src/main/resources/sql/config_server.sql | UTF-8 | 2,078 | 3.09375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_1
Source Server Version : 50640
Source Host : localhost:3306
Source Database : config_server
Target Server Type : MYSQL
Target Server Version : 50640
File Encoding : 65001
Date: 2020-04-29 10:33:31
*/
SET FOREIGN_KEY_CHECKS=... | true |
3787c2081df2dbb2e91ab5621ea6766a607b3d86 | SQL | R4zi4l/smart-notes-trial | /database/setup.sql | UTF-8 | 13,478 | 3.828125 | 4 | [] | no_license | CREATE TABLE `owner` (
`id` CHAR(36) CHARACTER SET ascii NOT NULL,
`table` VARCHAR(255) CHARACTER SET ascii NOT NULL,
PRIMARY KEY(`id`)
);
CREATE TABLE `session` (
`id` CHAR(36) CHARACTER SET ascii NOT NULL,
`owner` CHAR(36) CHARACTER SET ascii DEFAULT NULL,
`updated` DATETIME(3) NOT NULL,
`started`... | true |
305ec6c9085024427dbd67cfabdc5f43888ef7fa | SQL | rhindli/utils | /scloud/sql/createUsers.sql | UTF-8 | 880 | 2.8125 | 3 | [] | no_license | -- Create SocrateOpen User
CREATE USER sopen IDENTIFIED BY sopen DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK;
GRANT CONNECT, DBA, RESOURCE TO sopen WITH ADMIN OPTION;
GRANT INSERT ANY TABLE TO sopen WITH ADMIN OPTION;
GRANT SELECT ANY TABLE TO sopen WITH ADMIN OPTION;
GRANT EXECUTE... | true |
0aff441c2e733de2bec4b7304335ce26187b2be7 | SQL | JLucas220/ProjetoPW-S | /dadosPWS.sql | UTF-8 | 11,233 | 2.84375 | 3 | [] | no_license | use projetopws;
insert into aeroportos values
(default, 'Aeroporto de Lisboa', 'Lisboa', 'Portugal', 'Alameda das Comunidades Portuguesas, 1700-111 Lisboa'),
(default, 'Aeroporto Francisco Sa Carneiro', 'Porto', 'Portugal', '4470-558 Vila Nova da Telha'),
(default, 'Aeroporto Internacional Domodedovo', 'Moscovo', 'Rus... | true |
972fa72de9f344294178268da612379c34a185e8 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day12/select1554.sql | UTF-8 | 191 | 2.78125 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-11T15:54:00Z' AND timestamp<'2017-11-12T15:54:00Z' AND SENSOR_ID='77429a10_2148_48c9_801f_ed7971bc0ae0'
| true |
3bc73d671c228549d7b6bae687aa2735dda6069d | SQL | ghillstr/Tech-Elevator-Final-Capstone--Big-Disk-Energy | /java/database/schema.sql | UTF-8 | 2,771 | 3.71875 | 4 | [] | no_license |
BEGIN TRANSACTION;
DROP TABLE IF EXISTS scores;
DROP TABLE IF EXISTS tee_time;
DROP TABLE IF EXISTS invite;
DROP TABLE IF EXISTS invite_status;
DROP TABLE IF EXISTS users_leagues;
DROP TABLE IF EXISTS leagues;
DROP TABLE IF EXISTS users;
DROP SEQUENCE IF EXISTS seq_user_id;
CREATE SEQUENCE seq_user_id
INCREMENT B... | true |
69d9228497538149b61cbba776039e61bbfc1400 | SQL | redareda9/shopify-app-express | /reports/order_stats_sums.sql | UTF-8 | 291 | 3.90625 | 4 | [] | no_license | select
to_char(po.created_date, 'YYYY-MM Month'),
count(distinct order_id) as orders
from product_orders po
join shop_resources sr on sr.id = po.shop_resource_id
join shops sh on sh.id = sr.shop_id
and sh.created_date > '2021-06-17'
group by 1
order by 1 desc;
| true |
40e2994d1924970f90992789844a706829b37aaa | SQL | flaviohnm/projetophp | /app/scritp/app_crud.sql | UTF-8 | 1,393 | 3.28125 | 3 | [] | no_license | CREATE DATABASE app_crud;
CREATE TABLE IF NOT EXISTS `app_crud`.`customers` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`cpf_cnpj` VARCHAR(14) NOT NULL,
`birthdate` DATE NOT NULL,
`address` VARCHAR(255) NOT NULL,
`hood` VARCHAR(100) NOT NULL,
`zip_code` VARCHAR(8) NOT NULL,
`city`... | true |
9a9194463b71a2f6de52316a7b32233318f58487 | SQL | msolyakov/net-mvc-sample-app | /trunk/v1/Flat4Me.Database/cmn/Stored Procedures/Auth/sp_Auth_UserClaim_GetList.sql | UTF-8 | 171 | 2.609375 | 3 | [] | no_license | CREATE PROCEDURE [cmn].[sp_Auth_UserClaim_GetList]
@UserId int
AS
BEGIN
select [Type], [Value]
from cmn.Auth_UserClaim with(nolock)
where UserId = @UserId
END
| true |
60adf0ba37be54476a65c7d5cc3c8ac5fc4bb9dc | SQL | CUBRID/cubrid-testcases | /sql/_29_CTE_recursive/_06_cte_join_normal/cases/01_example.sql | UTF-8 | 14,382 | 4.0625 | 4 | [
"BSD-3-Clause"
] | permissive | drop table if exists t1,t2;
create table t1 (a int, b varchar(32));
insert into t1 values
(4,'aaaa' ), (7,'bb'), (1,'ccc'), (4,'dd');
insert into t1 values
(3,'eee'), (7,'bb'), (1,'fff'), (4,'ggg');
create table t2 (c int);
insert into t2 values
(2), (4), (5), (3);
with recursive t as (select a from t1 where... | true |
8b6ce4ce69948c142b7b4a877d3f590d030aac3c | SQL | jengfad/webscraping | /others/cp-magicians/schema.sql | UTF-8 | 596 | 2.984375 | 3 | [] | no_license | USE CP;
CREATE TABLE IF NOT EXISTS error_logs (
id INT AUTO_INCREMENT PRIMARY KEY,
notes TEXT,
error_message TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS magicians (
id INT AUTO_INCREMENT PRIMARY KEY,
name TEXT,
email TEXT,
location TEXT,
in... | true |
014f86547606d3d23a8672b66897aa4eb8e706fc | SQL | Andrey1de/andrey1de-rates | /sql/Stocks.CreateTable.sql | UTF-8 | 439 | 2.8125 | 3 | [] | no_license | SET TRANSACTION READ WRITE;
CREATE TABLE Stocks (
symbol varchar(8) CONSTRAINT firstkey PRIMARY KEY,
region varchar(8) NULL,
shortname varchar(20) NULL,
quoteType varchar(10) NOT NULL,
index varchar(10) NOT NULL,
score double NOT NULL,
typeDisp ... | true |
130c2c425cdacfe1863ae4f7d9695abf3d699c7b | SQL | dickeawacs/awacs | /code/ecp/src/main/resources/DBscript/ATS备份数据库过程(执行1).sql | UTF-8 | 18,731 | 2.5625 | 3 | [] | no_license | DELIMITER $$
USE `ats`$$
DROP PROCEDURE IF EXISTS `buildData`$$
CREATE PROCEDURE `buildData`( )
BEGIN
DECLARE onenum INT DEFAULT 1;
DECLARE onemax INT DEFAULT 128;
DECLARE twonum INT DEFAULT 0;
DECLARE twomax INT DEFAULT 255;
DECLARE userIndex INT DEFAULT 0;
-- 一层设备循环
WHILE onenum<=onemax DO
SET twonum=0;
-... | true |
b320acdb571cf98c167b56f80413a76c58656989 | SQL | victorjmacmed/SQL-for-data-science--IBM-course | /SQL code/Project1_create_table_testcode/SQL_script1-2.sql | UTF-8 | 1,128 | 4.0625 | 4 | [] | no_license | /* This is a practice scrip using SQL */
/* This code builds a table with some variables, then we insert some data, later we select all the columns.
Then we select some particular columns, later on we update the city of instructor 1. To conclude we delete a particular row*/
DROP table INSTRUCTOR;
CREATE table... | true |
d403652c8dfd838958c912a6d5e8e41c28e9e998 | SQL | oxoxoline/database | /lesson8/homework.sql | UTF-8 | 3,114 | 4.34375 | 4 | [] | no_license | -- 1. Добавить необходимые внешние ключи для всех таблиц базы данных vk (приложить команды).
ALTER TABLE profiles
ADD CONSTRAINT profiles_user_id_fk
FOREIGN KEY (user_id) REFERENCES users(id)
ON DELETE CASCADE,
ADD CONSTRAINT profiles_photo_id_fk
FOREIGN KEY (photo_id) REFERENCES media(id)
ON DELETE SE... | true |
34502910195b197d40506b6b0ccea9d355169e36 | SQL | fishstudy/codeigniter_advance | /wz_yixun_proj/document/开发设计/资料类文档/website.sql | UTF-8 | 3,284 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.3.8
-- http://www.phpmyadmin.net
--
-- Host: 10.24.179.138:3306
-- Generation Time: 2015-03-30 15:38:39
-- 服务器版本: 5.5.40
-- PHP Version: 5.3.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40... | true |
3e085b77fe31003d337150fd154a8f726570391d | SQL | antkudruk/test-for-carbonclick | /src/main/resources/db/migration/V1__Create_Participant.sql | UTF-8 | 223 | 2.515625 | 3 | [] | no_license | create table participant (
participant_id bigint not null primary key auto_increment,
first_name varchar(64) not null ,
last_name varchar(64) not null,
email varchar(128) not null,
unique(first_name, last_name)
); | true |
c46799475178e801104f0c1020fb4ea4f684c0e1 | SQL | Guilherme-Marcionilo/MySQL-and-SpringBoot | /Modulo II - Banco de dados/table_funcionario.sql | UTF-8 | 527 | 3.453125 | 3 | [] | no_license | create database RH;
use RH;
drop table funcionarios;
CREATE table funcionarios(
id int primary key auto_increment,
nome varchar(30),
sexo enum('M','F'),
salario decimal(10,3),
peso decimal(5,2)
);
insert into funcionarios (nome,sexo,salario,peso) values
('Guilherme','M','1.000','50.2'),
('Junior','M','12.000','60.2... | true |
251a3d6b1581ad3bbc8bfcaa45f7c3b985ccf5b7 | SQL | carolynmary/employee-management-system | /db/schema.sql | UTF-8 | 836 | 3.921875 | 4 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS employee_management_db;
CREATE DATABASE employee_management_db;
USE employee_management_db;
CREATE TABLE departments (
dept_id INT NOT NULL AUTO_INCREMENT,
department VARCHAR(30) NOT NULL,
PRIMARY KEY (dept_id)
);
CREATE TABLE roles (
role_id INT NOT NULL AUTO_INCREMENT,
t... | true |
8c5095da50fbe79b278da069111b7100a8da6d37 | SQL | baked-pan/Code-PHP-Dev | /PHParticle/045/Resource/045_5.sql | UTF-8 | 5,307 | 2.671875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2016-12-27 09:20:23
-- 服务器版本: 5.7.11
-- PHP Version: 7.1.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET... | true |
6c42a8df2013781ee521c180d9dd32ba5aea0e7d | SQL | Ricardocanul7/Hotel | /SqlScript/db_hotel_DML.sql | UTF-8 | 1,278 | 2.578125 | 3 | [] | no_license | use db_hotel;
/* Estado de habitacion */
INSERT INTO estado_habitacion (estado) VALUES ('No disponible');
INSERT INTO estado_habitacion (estado) VALUES ('Mantenimiento');
INSERT INTO estado_habitacion (estado) VALUES ('Limpieza');
INSERT INTO estado_habitacion (estado) VALUES ('Disponible');
/* Puesto de empleado */
... | true |
aa834a2988a9bf7fb9fcb29c64be6617c34844ab | SQL | kpapadopoul/dvd-rental-scripts | /6.sql | UTF-8 | 300 | 3.890625 | 4 | [] | no_license | WITH film_rentals AS (
SELECT inventory.film_id, COUNT(*)
FROM rental
JOIN inventory ON rental.inventory_id = inventory.inventory_id
GROUP BY inventory.film_id)
SELECT film.*, film_rentals.count
FROM film
JOIN film_rentals ON film.film_id = film_rentals.film_id
ORDER BY film_rentals.count DESC | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.