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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
39b165e0d7a1589a25cada331cf4c7742a5d6bdd | SQL | ra2003/contactopensource_with_postgresql | /db/migrations/10000000000034_create_color_sign/up.sql | UTF-8 | 1,684 | 3.375 | 3 | [] | no_license | CREATE TABLE color_sign (
id text not null primary key,
updated_at_timestamp_utc timestamp, -- example: 2020-01-01T00:00:00 always UTC
updated_at_clock_count bigint, -- example: 123456789 as suitable for a vector clock
tenant_id text, -- for optional tenant, such as a multi-tenant installation
parent_id text,... | true |
0f453c2ec79331624b0abb9d5a6c21597eb7aca5 | SQL | bertmclin/longboard-2-project | /db/seed.sql | UTF-8 | 1,711 | 3.1875 | 3 | [] | no_license | create table users (
id serial primary key,
name varchar,
email varchar,
password varchar
);
create table boards (
id serial primary key,
name text,
dim text,
image text,
price real
);
create table cart(
board_id integer references boards(id),
quantity integer
);
insert into board... | true |
b221c3994d78f63c506313420818c65b7de922c1 | SQL | valento45/SysCandidato | /candidatosbd.sql | UTF-8 | 2,168 | 3.984375 | 4 | [] | no_license | create database candidatosbd;
use candidatosbd;
create table organizacao_tb(
id int auto_increment primary key,
nome varchar(100)
);
create table users_tb(
id_usuario int auto_increment primary key,
username varchar(150),
normalizedUserName varchar(150),
email varchar(150),
normalizedEmail varchar (150),
passwordha... | true |
a77e2c2a2bc2ebb2fcb3424807eead4c32cae054 | SQL | NEONKID/StudyProtocolSandbox | /Generalizability/Study2/ACCOMPLISH/SQL/ACCOMPLISH_age_cleaning.sql | UTF-8 | 607 | 4.125 | 4 | [] | no_license | DELETE FROM @target_cohort_table
WHERE (subject_id, cohort_start_date) IN (
SELECT c.subject_id, MAX(cohort_start_date) FROM
(SELECT b.subject_id FROM (
SELECT subject_id, COUNT(subject_id) as count FROM
@target_database_schema.@target_cohort_table WHERE cohort_definition_id=2 or cohort_definition_id=3
... | true |
83e18bd7592909e64ac076f639149d5ce6bfcff0 | SQL | soriaj/retraced | /migrations/pg/1491298961.do.actionhour.sql | UTF-8 | 264 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | create table actionhour (
action_id text not null references action(id) on delete cascade,
hour timestamp not null,
count integer not null,
primary key (action_id, hour)
);
alter table environmentuser
add column anomaly_report boolean not null default true;
| true |
b9f90c21872813a8bf239c208107006cde62d48e | SQL | parkkyoung/f4mall | /sql/graph.sql | UHC | 4,080 | 3.46875 | 3 | [] | no_license |
-- ֱ Ѵ ȸ
use f4mall;
select count(*) from member
where date(m_regdate) between date(subdate(now(), INTERVAL 30 DAY))
and date(now())
-- ֱ Ѵ ֹ
use f4mall;
select count(*) from demand
where date(o_regdate) between date(subdate(now(), INTERVAL 30 DAY))
and date(now())
... | true |
c9d6d193e6feb649b853d069814088104b47d419 | SQL | miguelciego1/vacacion | /tablas/vacacion.sql | UTF-8 | 7,694 | 3.21875 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 23-02-2017 a las 13:56:39
-- Versión del servidor: 10.1.16-MariaDB
-- Versión de PHP: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... | true |
2dd2b4f8f9e0de56ccaec98b956f633d927ffc3a | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day26/select1117.sql | UTF-8 | 178 | 2.625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-25T11:17:00Z' AND timestamp<'2017-11-26T11:17:00Z' AND temperature>=24 AND temperature<=41
| true |
60fc1523f845f0c2501d327e64a31cb2c943172b | SQL | Narayana159/SQL | /Activities.sql | UTF-8 | 1,404 | 3.40625 | 3 | [] | no_license | use Narayana_activities;
create table salesman1(salesman_id int,name varchar(20),city varchar(20),commission int,primary key (salesman_id));
insert into salesman1(salesman_id,name,city,commission) values('5001','James Hoog','New York','15');
insert into salesman1(salesman_id,name,city,commission) values('5002','Nail Kn... | true |
04efa3c105a37688a050c4e3a23e173ac85857b5 | SQL | pcnay/Tutoriales | /Mexflix/Models/01Mysql/mexflix_crud.sql | UTF-8 | 2,517 | 4.0625 | 4 | [] | no_license | /* Listado de operaciones CRUD de Mexflix */
/*
MOVIESERIES:
Crear peliculas y series
Eliminar peliculas y series
Actualizar peliculas y series
Buscar todas las peliculas y series
Buscar un pelicula o serie por personas, titulos, genero.
Buscar una pelicula o serie por Categoría
Buscar una pelicula o se... | true |
627e821bda160bf40a08c09232ff218a4b193ef0 | SQL | dam-cav/parcheggi-basidati | /db/esempiquery.sql | UTF-8 | 3,226 | 3.71875 | 4 | [] | no_license | # La tabella delle aperture dei negozi nelle settimane comuni (quelle senza festività al
# loro interno), ovvero tutti i negozi e i loro orari nei vari giorni, Ordinando la ricerca
# per zone e coi giorni della settimana disposti in ordine.
SELECT Destinazione.Nome, Indirizzo, Comune, GiornoS, HAperto, HCHiuso
FROM De... | true |
222cca583eae06b9ceff30eb35100d92a6b509b0 | SQL | Bampi-Cynthia/cs313-php | /web/week4/database_modest_clothes.sql | UTF-8 | 9,778 | 4.25 | 4 | [] | no_license | <<<<<<< HEAD
//NEVER runa UPDATE or DELETE queries without a WHERE clause//
DROP TABLE IF EXISTS customer CASCADE;
CREATE TABLE customer (
id SERIAL PRIMARY KEY,
first_name VARCHAR(80) NOT NULL,
last_name VARCHAR(80) NOT NULL,
address TEXT NOT NULL,
tel VARCHAR(20) NOT NULL,
email VAR... | true |
badca3d164fab6e33cc369dc8085fd73cc277335 | SQL | jfmarasigan/bliss | /ctpl/database-scripts/functions-and-procedures/save_vehicle_details.sql | UTF-8 | 1,936 | 3.359375 | 3 | [] | no_license | DROP PROCEDURE IF EXISTS SAVE_VEHICLE_DETAILS;
DELIMITER //
CREATE PROCEDURE SAVE_VEHICLE_DETAILS(
p_policy_id bigint(12),
p_reg_type varchar(1),
p_model_year varchar(4),
p_car_company_cd bigint(6),
p_make_cd bigint(12),
p_series_cd bigint(12),
p_plate_no varchar(10),
p_... | true |
7c8bedb172e7597256448df4955b215bba6c0606 | SQL | logns/IndoramaReportingTool | /database/tables/dailylog_bu.sql | UTF-8 | 850 | 3.484375 | 3 | [] | no_license | drop table if exists dailylog_bu;
CREATE TABLE IF NOT EXISTS `indorama_poly`.`dailylog_bu` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`bu_id` INT(11) NOT NULL DEFAULT '-1',
`dailylog_id` INT(11) NOT NULL DEFAULT '-1',
`last_edit` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY... | true |
07e2a2ba7b9f2c72b6b8c4047ebaff2816ba3acd | SQL | Knjaz1989/Sql_lesson_5 | /task_1_lesson_5_sql_CREATE.sql | UTF-8 | 1,186 | 4.40625 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS genres (
id serial primary key,
name varchar(50) unique
);
CREATE TABLE IF NOT EXISTS singers (
id serial primary key,
name text
);
-- Link between singers and albums
CREATE TABLE IF NOT EXISTS genresinger (
genre_id integer references genres(id),
singer_id integer references singers(... | true |
38429ad24d3cf1c1a236829befb1b01f20641278 | SQL | jhonnyquest/restaurant-order-api | /src/main/resources/db/migration/orders/V1__create_order_tables.sql | UTF-8 | 1,310 | 3.9375 | 4 | [] | no_license | CREATE TABLE orders (
id varchar(36) PRIMARY KEY,
customer_id varchar(36) NOT NULL,
total double NOT NULL,
status varchar(50),
create_date TIMESTAMP DEFAULT NOW(),
update_date TIMESTAMP DEFAULT NOW()
);
CREATE INDEX order_id ON orders(id);
CREATE INDEX order_customer_id ON orders(customer_id);
C... | true |
f34217d32862168d1af0396a25c5e89a82dbcd91 | SQL | franlima/syscontrol | /sql/tables.sql | UTF-8 | 1,018 | 2.765625 | 3 | [] | no_license | CREATE TABLE users (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
idtype INT NOT NULL,
username VARCHAR(50) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
created DATETIME DEFAULT CURRENT_TIMESTAMP,
finished DATETIME NULL
);
CREATE TABLE userstype (
id INT NOT NULL PRIMARY KEY AUTO_INCREME... | true |
e8db42e51810e1d19200679dca880be2eb1e4a6f | SQL | pericana/rp2 | /database_dump.sql | UTF-8 | 6,158 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 11, 2017 at 10:08 PM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
5577a135b437ccf5b416d0d44c5d3fe5f5314606 | SQL | syarifuzaki/RPL | /Tugas-Besar/fosma/fosma.sql | UTF-8 | 7,653 | 2.75 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 15, 2017 at 05:39 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET... | true |
ee51d8bad7f015cf832d1b00c2276c7298125ccb | SQL | RaquelBorges/generation-MySQL | /Lista 1/Exercicio 1/EX 1 DB.sql | UTF-8 | 1,420 | 3.25 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Fri Feb 12 18:21:12 2021
-- 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='ON... | true |
df3270362772c96d886869bfab40c29e71196e8d | SQL | gondc/TCTech | /sp_actualizarRentXTareas.sql | UTF-8 | 4,482 | 3.5 | 4 | [] | no_license | CREATE OR REPLACE PROCEDURE TCTECH.sp_actualizarRentXTareas IS
cursor comprobantes is select distinct cmp_numero from egresosbancosxproyectos;
cmp number(15);
cantTareas number(15);
importe number(15,8);
BEGIN
delete from tctech.rentabilidadxtareas;
insert into rentabilidadxtareas select t.trs_... | true |
a38d3d0b2155c3ce6121f685b391cb08a1b0bbe3 | SQL | hoodlake/ymxx-sync | /Enterprise/Bytter/Sql_Script/user00038488_ORCL.sql | GB18030 | 709 | 2.90625 | 3 | [] | no_license | --ʱ䣺2013-01-30
--ˣ
--ԭV10.4BUG,ûͨǷÿƿ
--н
DECLARE
VN_COUNT NUMBER;
BEGIN
SELECT COUNT(*)
INTO VN_COUNT
from SYS_SUBSCRIBE_RULES where Notice_Name = 'н' and Sys_Code = 'cms';
IF VN_COUNT < 1 THEN
insert into SYS_SUBSCRIBE_RULES (ID, SYS_CODE, NOTICE_TYPE, NOTICE_NAME, PRE_DAYS, TITLE, CONTENT, T... | true |
c1933e30f8d6d7371ca437f1adf261aaddeb33b4 | SQL | WagnerPrata/BancoDeDadosI | /Meus Lab/Laboratorio03.sql | UTF-8 | 2,280 | 3.90625 | 4 | [] | no_license | CREATE DATABASE LABORATORIO_03
--- USANDO BANCO DE DADOS ESPECIFICO - LABORATORIO 03
USE LABORATORIO_03
---------------------------------------------------------------
--- CRIAÇÃO DE TABELA
CREATE TABLE TB_DVD(
Codigo int NOT NULL PRIMARY KEY,
Titulo varchar(20)NOT NULL,
Ano_Lançamento varchar(20) NOT NULL,
Catego... | true |
59fcb3a1da671cf60db186c2798d1adbbf344556 | SQL | ousophea/brand-tea-web-site | /Implement/Database/Olds/content_languages.sql | UTF-8 | 1,481 | 2.78125 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.12-log - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 8.0.0.4396
-- ---------------------------------------------------... | true |
0e858598a34485ba704c9cc8c57941d1648bb2db | SQL | remix1g/sql | /Choices_Full_KPI.sql | UTF-8 | 14,381 | 3.5625 | 4 | [] | no_license | SELECT nvl(monthly.platform,ad_spend.platform) platform,
nvl(monthly.cohort_date,ad_spend.cohort_date) cohort_date,
nvl(monthly.country,ad_spend.country) country,
isnull(SUM(monthly.cohort_size),0) AS cohort_size,
isnull(SUM(monthly.paid_installs),0) AS paid_installs,
isnull(SUM(month... | true |
444cddd5e4bdb942ef7e9edb8919656bce2209ca | SQL | PomianAurelian/SilexProject | /database/4-create-review-table.sql | UTF-8 | 683 | 2.890625 | 3 | [
"MIT"
] | permissive | CREATE TABLE review (
id int(10) NOT NULL AUTO_INCREMENT,
name varchar(255) NOT NULL,
rating decimal(2, 1) NOT NULL,
review_date datetime NOT NULL,
comment varchar(255),
company_id int(10) NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (`company_id`) REFERENCES `company`(`id`)
);
INSERT INTO review VALUES (NULL, 'Joh... | true |
3e6c971e9bb6b6ad3bd932b1295b591a28b177bc | SQL | kotovmak/redditclone | /migrations/20210515212508_create_users.up.sql | UTF-8 | 1,661 | 3.796875 | 4 | [
"MIT"
] | permissive | CREATE TABLE "users" (
"id" VARCHAR NOT NULL UNIQUE PRIMARY KEY,
"username" VARCHAR NOT NULL UNIQUE,
"encrypted_password" VARCHAR NOT NULL
);
CREATE TABLE sessions (
"user_id" VARCHAR NOT NULL UNIQUE PRIMARY KEY,
"request_id" VARCHAR NOT NULL,
"token" VARCHAR NOT NULL,
CONSTRAINT "user_id" FOREIGN KEY ("u... | true |
0aa92790c06053861ff0064e503dd0251f2286eb | SQL | alanFaccin/TOTVS-Report-SQL-Files | /KPI Iluminação pública.sql | UTF-8 | 7,519 | 3.875 | 4 | [] | no_license | --DADOS DE FATURAMENTO
IF OBJECT_ID(N'tempdb..#TempConsult', N'U') IS NOT NULL
DROP TABLE #TempConsult
CREATE TABLE #TempConsult
(
DESCRICAO_ARMAZEM VARCHAR(37) NULL,
NUM_PROCESSO VARCHAR(11) NULL,
DATA_PROCESSO VARCHAR(8) NULL,
VALOR_TOTAL REAL NULL
)
INSERT INTO #TempConsult
VALUES
('0221... | true |
eb4db2b3295f2193e375dd0925d76705f05ec8ea | SQL | jjtorres93/foodStudiesConnection | /docs/FSCDB.sql | UTF-8 | 670 | 2.546875 | 3 | [] | no_license | DROP DATABASE IF EXISTS `FoodStudiesConnection`;
CREATE DATABASE `FoodStudiesConnection`;
USE `FoodStudiesConnection`;
CREATE TABLE `Autores`(
`nombre` CHAR(25),
`apellido` CHAR(25),
`nombre completo` CHAR(50)
);
INSERT INTO `Autores` VALUES ('Pearl','Michel','Pearl Michel');
INSERT INTO `Autores` VALUES ('Dulce','Gonz... | true |
c2f3a1fe217904059152dbac5da0d5cf23c023b8 | SQL | gcnonato/secode | /application/modules/Ynevent/settings/my-upgrade-4.05p5-4.05p6.sql | UTF-8 | 862 | 2.75 | 3 | [] | no_license | UPDATE `engine4_core_modules` SET `version` = '4.05p6' WHERE `name` = 'ynevent';
INSERT IGNORE INTO `engine4_authorization_permissions`
SELECT
level_id as `level_id`,
'event' as `type`,
'auth_file' as `name`,
5 as `value`,
'["registered","member","owner"]' as `params`
FROM `engine4_authorization_le... | true |
07d0f5e74ada2705902d2f4bb7cbc502ee8b1bf3 | SQL | TongNathan/SwinnyLibraryDB | /SwinnyLibraryDB/Scripts/PostDeploymentScript.sql | UTF-8 | 1,540 | 3.3125 | 3 | [] | no_license | /*
Post-Deployment Script Template
--------------------------------------------------------------------------------------
This file contains SQL statements that will be appended to the build script.
Use SQLCMD syntax to include a file in the post-deployment script.
Example: :r .\myfile.sql
... | true |
196e6414c2b950482c08eb53a1e3dd81b29a056f | SQL | jdsul/w205_2017_spring | /exercise_1/loading_and_modeling/hive_base_ddl.sql | UTF-8 | 6,013 | 2.875 | 3 | [] | no_license |
DROP TABLE hospitals;
CREATE EXTERNAL TABLE hospitals
(
provider_id string,
hospital_name string,
address string,
city string,
state string,
zip_code string,
county string,
phone_number string,
hospital_type string,
hospital_ownership string,
emergency_services string,
mu_ehr string,
overall_rating string,
overall_r... | true |
d6e3c61352f0dd61492611e18f0bc7c40002ef7e | SQL | rage-your-dream/baibaiba | /db/DDL/showdb/T_chart.sql | UTF-8 | 362 | 2.609375 | 3 | [] | no_license | USE `showdb`;
CREATE TABLE `chart` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(45) NOT NULL DEFAULT 'line',
`data` longtext NOT NULL,
`dashboard_id` varchar(45) NOT NULL,
`help_msg` longtext NOT NULL,
`analysis_msg` longtext,
`data_lock` int(1) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB... | true |
0317308dde240686b5c432023f6a8248124d9f5b | SQL | ichoukou/Bigdata | /main/law/spark_short/sql/192.168.74.102/laws_doc_imp_other/u3000_doc_footer_casedate_error处理.sql | UTF-8 | 879 | 3.296875 | 3 | [] | no_license | select id,doc_footer,judge_result from imp_other_etl_v2
where doc_footer like "%u3000%" or judge_result like "%u3000%" or court_idea like "%u3000%" limit 100;
无结果;
create table casedate_error_uuid_old as
SELECT * from imp_other_etl_v2 where SUBSTR(casedate,1,4) > 2018 ;
#3
create table casedate_error_uuid_2018 as ... | true |
ceb8e04a9119548248698efb8ffa1d1a89cb917e | SQL | iqbaal23/inventaris_sd | /inventaris_sd.sql | UTF-8 | 4,113 | 2.953125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 15 Agu 2019 pada 06.23
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... | true |
cefe4ccb4a8299e59ee2218425b222a36280b436 | SQL | RuslanGarber/CouponSystem-ProjectJohnBryce- | /Project_Part_A/mydbproject/mydbproject_customer_coupon.sql | UTF-8 | 2,132 | 2.875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64)
--
-- Host: localhost Database: mydbproject
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESU... | true |
b30f72286fd5b656b6415331d331323e4d0cde36 | SQL | ileri-seviye-mssql-oracle-sql-bootcamp/mssql-e-ticaret-veri-tabani-tasarimi-muratsungu | /Murat Süngü Kodluyoruz Week2 MS SQL DB Ödevi/ecommerce db/Views/1-Customer_Engineers.sql | ISO-8859-9 | 157 | 2.796875 | 3 | [] | no_license | create view customer_engineer as
select * from customers
where job like '%Engineer%';
-- Mhendis olan mterilerimizi grmek iin view oluturdum. | true |
8486e959acf21c70281f50bf83efd24dde38a5af | SQL | LedaVellucci/prova | /prova/db/digitalmedExp.sql | UTF-8 | 2,606 | 3.34375 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versione server: 10.4.12-MariaDB - mariadb.org binary distribution
-- S.O. server: Win64
-- HeidiSQL Versione: 11.0.0.5919
-- ------------------------------------------... | true |
75a51b0b17e96d092bcd8f502e1a4a1e0dde952b | SQL | varela12150/Proyectos | /SQL/SELECT TOP (1) Title, LEN(Title).sql | UTF-8 | 3,472 | 3.984375 | 4 | [] | no_license | SELECT TOP (1) Title, LEN(Title)
FROM Chinook.dbo.Album
ORDER BY LEN(Title), Title
SELECT TOP (1) Title, LEN(Title)
FROM Chinook.dbo.Album
ORDER BY LEN(Title) DESC,Title;
/*SELECT TOP 1 CITY, LEN(CITY)
FROM STATION
ORDER BY LEN(CITY),CITY;
SELECT TOP 1 CITY, LEN(CITY)
FROM STATION
ORDER BY LEN(CITY) DESC... | true |
09d1b15f673e18b5221c37e47148fdc84a4fee4d | SQL | CheeKang12/itsatest | /calculegend.sql | UTF-8 | 1,869 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 23, 2018 at 02:49 AM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 5.6.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
7be8d23cb233a4f2dccaf85a1ecf916f3eb2f545 | SQL | nss-evening-cohort-3/learning-sql-individual-assignment-abidina | /8.sql | UTF-8 | 346 | 3.765625 | 4 | [] | no_license | SELECT Invoice.Total, Customer.FirstName || ' ' || Customer.LastName AS 'Customer Name',
Invoice.BillingCountry AS 'Billing Country',
Employee.FirstName || ' ' || Employee.LastName AS 'Sales Agent Name'
FROM Customer
JOIN Invoice
ON Invoice.InvoiceId==Customer.CustomerId
JOIN Employee
ON Customer.SupportR... | true |
1eef4331721a191758a3711ea4e1f782ccad16d5 | SQL | victorigoleto/turma11java | /MySQL/Atividade2MySQL/inserts_dbrh2.sql | UTF-8 | 1,743 | 3.546875 | 4 | [] | no_license | CREATE DATABASE db_RH2;
use db_RH2;
CREATE TABLE tb_cargo (
id_cargo int primary key not null auto_increment,
nome_cargo varchar(30),
setor_cargo varchar(30)
);
CREATE TABLE tb_funcionarios (
re_fn int primary key not null auto_increment,
nome_fn varchar(30) not null,
nascimento_fn date not ... | true |
6f1d62b8255810e9e375610b33241b07f16d6141 | SQL | alyahmed/JanJan | /create.sql | UTF-8 | 8,545 | 2.96875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.20, for osx10.7 (x86_64)
--
-- Host: localhost Database: janjan
-- ------------------------------------------------------
-- Server version 5.6.20
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... | true |
45833dcd469721f81b665ca6439bed33896a645c | SQL | faralaili/kurikulum_backend | /sprint/sprint-4/Latihan_CRUD/budi.sql | UTF-8 | 639 | 3.359375 | 3 | [] | no_license | create database budi;
use budi;
CREATE TABLE barang_budi(id INT AUTO_INCREMENT PRIMARY KEY,
-nama_barang VARCHAR(50)NOT NULL,
-kode_bar VARCHAR(100),
-harga INT(50));
desc barang_budi;
INSERT INTO barang_budi(nama_barang,kode_bar,harga)value
-> ('lampu','k001',65000),
-> ('buku','k002',5000),
-> ('tas','k0... | true |
c266249d4d44624c9b6ee43fb78b0cbb75923d47 | SQL | josepitteloud/VESPA | /Data Governance/Data Definitions/ThirdPartyVariables/Experian/Mirror_Men_Women.sql | UTF-8 | 7,140 | 3.640625 | 4 | [] | no_license | /*###############################################################################
# Created on: 14/01/2013
# Created by: Tony Kinnaird (TKD)
# Description: Gives a user a process for identifying the Mirror values
# within the Household
#
############################################################################... | true |
f553cf01a604cec78e8b1409763f209103dafc86 | SQL | yonchev/repcar | /sql/scripts/createScript.sql | UTF-8 | 15,637 | 3.484375 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 10.191.39.1
-- Server version: 5.7.13 - MySQL Community Server (GPL)
-- Server OS: Linux
-- HeidiSQL Version: 9.3.0.4984
-- --------------------------------------------------------
... | true |
b9062d8a96bd7ac1ddb2aa855c03db08cd6113ce | SQL | Noobinabox/knowledge | /sqlserver/scripts/iobottleneck.sql | UTF-8 | 1,405 | 3.578125 | 4 | [
"MIT"
] | permissive | /*****************************************************************************************
** File: iobottleneck.sql
** Name: IO Bottle Neck
** Desc: Gets the current IO counters in all databases to determine if there is a disk issue
** Auth: NoobInABox
** Date: Mar 1, 2016
********************************************... | true |
518b1b52360e2ad221a7aa07df273a57c42fae63 | SQL | dbspgnl/JSP | /jsp16_calboard/src/com/cal/db/db.sql | UTF-8 | 688 | 4.5 | 4 | [] | no_license | DROP SEQUENCE CALBOARDSEQ;
DROP TABLE CALBOARD;
CREATE SEQUENCE CALBOARDSEQ;
-- 번호, 아이디, 제목, 내용, 일정, 작성일
CREATE TABLE CALBOARD(
SEQ NUMBER PRIMARY KEY,
ID VARCHAR2(1000) NOT NULL,
TITLE VARCHAR2(2000) NOT NULL,
CONTENT VARCHAR2(4000) NOT NULL,
MDATE VARCHAR2(12) NOT NULL,
REGDATE DATE NOT NULL
);
SELECT * FROM ... | true |
734a917f23ff5172e5cfb8cb069f1650f0662f65 | SQL | matrixorigin/matrixone | /test/distributed/cases/zz_accesscontrol/alter_account.sql | UTF-8 | 8,234 | 3.140625 | 3 | [
"Apache-2.0"
] | permissive | set global enable_privilege_cache = off;
-- @setup
--alter account auth_option: password
create account if not exists Abc ADMIN_NAME 'admin' IDENTIFIED BY '123456' comment 'comment test';
alter account abc admin_name='admin' IDENTIFIED BY '1WERDFT3YG';
-- @session:id=1&user=abc:admin&password=1WERDFT3YG
select user_na... | true |
f1f46e44f879c6fa278999839206419c2dc33d7a | SQL | nbondarczuk/billgentool | /database/bgh-config/BGH_STRING_TABLE_CONSTRAINT.sql | UTF-8 | 1,674 | 2.96875 | 3 | [] | no_license | --------------------------------------------------------
-- Constraints for Table BGH_STRING_TABLE
--------------------------------------------------------
ALTER TABLE "BGH"."BGH_STRING_TABLE" ADD CONSTRAINT "PK_STRING_ID" PRIMARY KEY ("STRING_ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATIST... | true |
2a49c799fafad7b337af80fbec5943d495fb7b6a | SQL | cdesmarais/WebDB-Test | /WebDB/StoredProcedures/Common/dbo.DNCacheTopTenRestaurants.prc | UTF-8 | 2,237 | 3.875 | 4 | [] | no_license | if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DNCacheTopTenRestaurants]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[DNCacheTopTenRestaurants]
GO
--*********************************************************
--** Retrieves a list of top ten lists, used to populate the
--** ... | true |
5682df2067d4cb47131f9590a13acb9606bae63e | SQL | rhMorais/Concessionaria | /Scripts SQL/SQLConcessionariaProcedureListarId.sql | UTF-8 | 2,001 | 3.375 | 3 | [] | no_license | -- COMITADOS
CREATE PROCEDURE LISTAR_OPCIONAL_ID
@OPCID INT
AS
BEGIN
SELECT *
FROM OPCIONAL
WHERE OPCID = @OPCID
END
--_________________________________________________________________
CREATE PROCEDURE LISTAR_CARRO_ID
@CARPLACA VARCHAR(8)
AS
BEGIN
SELECT *
FROM CARRO
WHERE CARPLACA = @CAR... | true |
7cbb08f6ab71de42968e968edbe33bcb747f72a5 | SQL | egemenzeytinci/neo4j-example | /data/insert.cql | UTF-8 | 2,077 | 4.09375 | 4 | [] | no_license | // create constraint to customer id for all customer
CREATE CONSTRAINT ON (customer:Customer) ASSERT customer.customerID IS UNIQUE;
// create customer nodes
:auto
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS
FROM 'https://git.io/JkIjD'
AS line
WITH toInteger(line.CustomerID) AS CustomerID, line WHERE NOT line.Customer... | true |
5e18ae049ee9301976202e0bb7185c79798a443f | SQL | paul-wj/blog-admin | /init/sql/message_user.sql | UTF-8 | 384 | 2.890625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `message_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL COMMENT '用户id',
`messageId` int(11) DEFAULT NULL COMMENT '信息id',
`status` int(11) NULL DEFAULT 10 COMMENT '(10:已阅读)',
`createDate` varchar(50) DEFAULT NULL COMMENT '阅读日期',
PRIMARY KEY (`id`)
) ... | true |
c7dcc31104fc0f267b8c2d5871efb6a3accdf439 | SQL | andrefnb/big_data_processing_taxi_drivers | /project2.sql | UTF-8 | 2,269 | 4 | 4 | [] | no_license | -- Drop table if exists
DROP TABLE IF EXISTS taxis;
-- Create table that will hold the required information for querying
CREATE TABLE IF NOT EXISTS taxis
(
id char(9),
passenger_count int,
haversine_distance float,
precipitation float,
snow_fall ... | true |
9b4a871604f87fe39e10e7f0bff93d067bfe5e23 | SQL | hxf044/ssmSpike | /src/main/sql/seckill.sql | UTF-8 | 2,808 | 3.953125 | 4 | [] | no_license | --- 数据库初始化脚本 2017-11-22
---创建数据库
CREATE DATABASE seckill;
--使用数据库
user seckill;
--创建秒杀库存表
CREATE TABLE seckill (
`seckill_id` bigint NOT NULL AUTO_INCREMENT COMMENT '商品id',
`name` VARCHAR(120) NOT NULL COMMENT '商品名称',
`number` INT NOT NULL COMMENT '库存数量',
`start_time` TIMESTAMP NOT NULL COMMENT '秒杀开始时间',
`end_time` ... | true |
2e51e7ee51a6929eca5be60d8245a66ae9174f71 | SQL | uk-gov-mirror/hmcts.fact-api | /src/main/resources/db/migration/V036__fix_data.sql | UTF-8 | 879 | 2.546875 | 3 | [
"MIT"
] | permissive | drop table search_courtservicearea;
UPDATE public.search_serviceareacourt
SET court_id = 1479430
WHERE id = 3;
UPDATE public.search_serviceareacourt
SET court_id = 1479430
WHERE id = 4;
UPDATE public.search_serviceareacourt
SET court_id = '1480142'
WHERE id = 5;
UPDATE public.search_serviceareacourt
SET court_id = ... | true |
b0ba2ad2980b36a0703c51ff04bc5c3d4e5b8619 | SQL | JorgeGomezPhD/SQL-Database-Project | /Requirement 4/SQLite2.sql | UTF-8 | 180 | 3.21875 | 3 | [] | no_license | SELECT Activities.UserID, Activities.activity, Activities.createdat, Students.address, Students.lastname
FROM Students
INNER JOIN Activities ON Students.UserID = Activities.UserID; | true |
bac75db1ad7645b9cae80adfea9bedea473184af | SQL | Urzhumtsev1/sql_examples | /create_flights.sql | UTF-8 | 1,144 | 3.75 | 4 | [] | no_license | START TRANSACTION ;
create schema if not exists mymodel ;
create table mymodel.flights (
flight_id bigserial not null primary key,
flight_no text not null,
scheduled_departure timestamp,
scheduled_arrival timestamp,
departure_airport char(3) not null,
arrival_airport char(3) not null,
actual_depa... | true |
b468686165afe6eccecd2a5db6a6c8ca9a5f4461 | SQL | durner/json-queries | /yelp/5.sql | UTF-8 | 646 | 4.34375 | 4 | [] | no_license | select
b.data->>'city' as city, count(cast(r.data->>'review_id' as bigint))/count(distinct cast(r.data->>'business_id' as bigint)) as avg_reviews_per_business, count(cast(r.data->>'review_id' as bigint)) as reviews, count(distinct cast(r.data->>'business_id' as bigint)) as businesses
from
yelp b,
yelp r
whe... | true |
e00b39e26742813b1ab60f6f9e52de4b9517ea3c | SQL | helyao/shWeather | /SHWeather/sql/weather.sql | UTF-8 | 959 | 2.890625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : iLocalHost
Source Server Version : 50628
Source Host : localhost:3306
Source Database : weather
Target Server Type : MYSQL
Target Server Version : 50628
File Encoding : 65001
Date: 2017-07-02 17:55:50
*/
CREATE DATABASE IF NOT EXISTS ... | true |
e6adccbf9fd01f73452e548a9273f3cada262516 | SQL | genjay/java_hr | /CSR/p_runSQL 執行sql 語句.sql | UTF-8 | 561 | 3.265625 | 3 | [] | no_license | drop procedure if exists p_runSQL;
delimiter $$
create procedure p_runSQL(
in_Text text
)
begin
/*
取代在procedure 使用prepare ,execute
因為若同時使用 cursor for select...
會有只執行一筆的問題
*/
declare bakText text;
set bakText = @in_p_runSQL_Text; # @in_Text 為全域變數
set @in_p_runSQL_Text=in_Text;
prepare s1 from @in_p_runSQL_Text;... | true |
b287bda20c0f6434e8c55923349f3d2d25ae6e67 | SQL | andrefa/use-case-traceability | /fontes/UCTSecurity/scripts/SECURITY-DB.sql | UTF-8 | 5,895 | 3.515625 | 4 | [] | no_license | ------------------------------------------------------------------------------------
------------------------------------ PASSWORD --------------------------------------
------------------------------------------------------------------------------------
CREATE TABLE password(id INTEGER PRIMARY KEY, ... | true |
8c3b54c3603f875b95bc04d559a3e660706433d3 | SQL | dnviti/ilmuroarrampicata | /assets/sql/report/report_utenti.sql | UTF-8 | 1,332 | 3.734375 | 4 | [] | no_license | select
#concat('<img class="edit_row" src="/assets/third-part/open-iconic/svg/pencil.svg" alt="icon name">', ' ', '<img class="delete_row" src="/assets/third-part/open-iconic/svg/trash.svg" alt="icon name">') as azioni,
concat(concat('<a href="?p=7&ID=', a.id, '">'), concat(a.cognome, '</br>', a.nome), '</a>') as ... | true |
fea8e9f474ed121025d125fa53e3af319f85372a | SQL | QuyenLy87/release-validation-framework | /importer/src/main/resources/scripts/release-type/release-type-delta-validation-stated-relationship.sql | UTF-8 | 1,039 | 3.53125 | 4 | [
"Apache-2.0"
] | permissive | /*
The current stated relationship delta file is an accurate derivative of the current full file
*/
/* in the delta; not in the full */
insert into qa_result (runid, assertionuuid, concept_id, details)
select
<RUNID>,
'<ASSERTIONUUID>',
a.sourceid,
concat('Stated relationship: id=',a.id, ' is in delta fi... | true |
7ae59a823ea073e09dded2ee8d291204ec653609 | SQL | TiszaTamas/BPROF_W6TW4A_MVC | /DatabaseFill.sql | UTF-8 | 3,689 | 3.484375 | 3 | [] | no_license | DROP TABLE MONSTER;
DROP TABLE ADVENTURER;
DROP TABLE JOB;
DROP TABLE CLIENT;
DROP TABLE PERSON;
CREATE TABLE PERSON
(PERSONID NUMERIC(10) NOT NULL,
CLIENTID NUMERIC(10),
ADVENTURERID NUMERIC(10),
FIRST_NAME VARCHAR(20),
LAST_NAME VARCHAR(20),
GUILD_NAME VA... | true |
c475d1f3bc812956f0578d6cefc149b3dfdf3f55 | SQL | KarthikeyanShankar/Twitter-data | /bad-table-create.sql | UTF-8 | 1,878 | 2.84375 | 3 | [] | no_license | CREATE TABLE bad_giant_table (
created_at timestamp with time zone,
text varchar(255),
tweet_id bigint PRIMARY KEY,
in_reply_to_screen_name varchar(255),
in_reply_to_status_id bigint,
in_reply_to_user_id bigint,
retweet_count int,
tweet_source varchar(255),
retweet_of_tweet... | true |
13f0752c0fadcb09aa9c9c170398fb05d9b8af35 | SQL | SergeiPatiakin/ChallengeMe | /server/queries/main/calcMaxAggregate.query.sql | UTF-8 | 509 | 3.125 | 3 | [] | no_license | -- Trusted parameters
--@arg challengeId: string
--@arg challengeUserId: string
WITH agg AS (
-- cte should return 1 row
SELECT
COUNT(*) AS completed_round_count,
MAX(result_float) AS completed_round_aggregate
FROM challenge_user_rounds cur
WHERE cur.challenge_user_id = :challengeUserId
AND cur.is_com... | true |
d26f4506349baa9bd42bfa3bc28ebd20f36767ff | SQL | KatyCodes/PHPshoestore | /shoes.sql | UTF-8 | 3,220 | 3.109375 | 3 | [
"MIT"
] | permissive | --
-- Database: `shoes`
--
CREATE DATABASE IF NOT EXISTS `shoes` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `shoes`;
-- --------------------------------------------------------
--
-- Table structure for table `brands`
--
CREATE TABLE `brands` (
`brand_name` varchar(255) DEFAULT NULL,
`id` bigint(20)... | true |
9130ba272469c72bd94e658552ca26c8c1b88130 | SQL | ernestomendez/dxesoft-src-mysqldb | /dxesoft-data/opportunity07-01-2015.sql | UTF-8 | 2,875 | 3.796875 | 4 | [] | no_license | USE `dxesoft` ;
-- -----------------------------------------------------
-- Table `dxesoft`.`opportunity`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `dxesoft`.`opportunity` ;
CREATE TABLE IF NOT EXISTS `dxesoft`.`opportunity` (
`Id` INT(10) NOT NULL AUTO_INCREMENT ,
`Contact_id` ... | true |
b0defcd96a9a837f9c21338ff5386d5404c92566 | SQL | AdamDukeLee/vue | /tp/weibo/Home/Controller/base.sql | UTF-8 | 1,677 | 3.125 | 3 | [] | no_license |
CREATE TABLE IF NOT EXISTS think_user(
id INT PRIMARY KEY AUTO_INCREMENT,
username varchar(20),
iphon varchar(20),
six tinyint
)ENGINE INNODB AUTO_INCREMENT=10000;
ALTER TABLE think_user ADD password char(20);
INSERT think_user(username,iphon,password) VALUES('黑崎一护','18516543004','123456'),('千与千寻','13566533004','12... | true |
f2f7ec28d236eae02e2e02532d3719961158b0ba | SQL | anastasiazalesova/university-platform-backend | /src/main/resources/db/migration/V000004__TEST_DATA.sql | UTF-8 | 2,549 | 2.578125 | 3 | [] | no_license | insert into university_platform.rec_course
values (md5(random()::text || clock_timestamp()::text)::uuid, 'test_course');
insert into university_platform.rec_module
values (md5(random()::text || clock_timestamp()::text)::uuid, 'test_module',
(select id from university_platform.rec_course where rec_course.name =... | true |
aefeabe0ae035d35001e314a19fe526ef5d76d8c | SQL | lanjianwen/classSystem | /src/main/resources/classsystem.sql | UTF-8 | 12,065 | 3.4375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50717
Source Host : localhost:3306
Source Database : classsystem
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2020-05-22 12:00:14
*/
SET FOREIGN_KEY_CHECKS... | true |
2d00c19db71bbad1ad216c512639176e3f15766c | SQL | DigitalWarrior/eddb2mysql | /ed_schema.sql | UTF-8 | 16,122 | 3.125 | 3 | [
"MIT"
] | permissive | -- MySQL dump 10.16 Distrib 10.1.34-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: ed
-- ------------------------------------------------------
-- Server version 10.1.34-MariaDB-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SE... | true |
8e181ab7828589ab77c7e15dcb96548f4ddc2c94 | SQL | choipureum/OracleSQL_Basic_SW | /01_Grammer/Day10/Final.sql | UTF-8 | 4,230 | 4.09375 | 4 | [] | no_license | --주석, COMMENT
-- null값으로 모두 채워져있다
SELECT * FROM user_tab_comments WHERE table_name =upper('emp');
SELECT * FROM user_col_comments WHERE table_name =upper('emp');
--테이블 주석
COMMENT ON TABLE emp IS '사원정보테이블';
--컬럼 주석
COMMENT ON COLUMN emp.empno IS '사원번호';
COMMENT ON COLUMN emp.ename IS '사원이름';
COMMENT ON COLUMN emp.jo... | true |
8c80a1576c5d051ace5cad51e87c8051168faba7 | SQL | Leshy4/SQL-Database-Design | /4. Intro to SQL/exercise_SOLUTIONS/ch06/ex6-03.sql | UTF-8 | 250 | 3.234375 | 3 | [] | no_license | SELECT account_number, account_description
FROM general_ledger_accounts
WHERE NOT EXISTS
(SELECT *
FROM invoice_line_items
WHERE invoice_line_items.account_number = general_ledger_accounts.account_number)
ORDER BY account_number
| true |
f4a8e77589f1819f19385b067fb25ce0edaa4f81 | SQL | gsgianks/PDVsoft | /Base de Datos/Procedimientos.sql | UTF-8 | 267 | 2.625 | 3 | [] | no_license | use PDVsoft
DELIMITER $$
CREATE PROCEDURE spsegObtenerUsuario(in p_codUsuario varchar(25))
begin
SELECT codUsuario, nomNombre, desPrimerApellido, desSegundoApellido, codContrasena, desCorreo, desURLImagen
FROM segUsuario where codUsuario = p_codUsuario;
END
$$ | true |
bf315b433f1ceccd82d13df4c4eea523f3bcc924 | SQL | Chinawakaka/projects | /nuo/nuo-api/sql/nuo.sql | UTF-8 | 7,233 | 3.234375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `nuo` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
USE `nuo`;
-- MySQL dump 10.13 Distrib 5.6.11, for osx10.6 (i386)
--
-- Host: 47.100.24.40 Database: nuo
-- ------------------------------------------------------
-- Server version 5.7.16
/*!40101 SET @OLD_CHARACTE... | true |
c38a845e9176f53951de3123a7733e3762f845d4 | SQL | mirrormind/mo-test-eam | /mo-test-eam/src/moeam/db/query/driver/Forum_posts.sql | UTF-8 | 454 | 3.453125 | 3 | [
"Apache-2.0"
] | permissive | -- Create Topics and Users tables first because of FK dependency
-- This is dangerous and not compliant with JDBC specs, should be changed in the future
DROP TABLE IF EXISTS posts;
CREATE TABLE posts
(
P_postId int PRIMARY KEY NOT NULL AUTO_INCREMENT UNIQUE,
F_topicId int, FOREIGN KEY (F_topicId) REFERENCES... | true |
b497754e6c7e156afa2e76bf8e1866282cb2bd6d | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day23/select1643.sql | UTF-8 | 178 | 2.703125 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-22T16:43:00Z' AND timestamp<'2017-11-23T16:43:00Z' AND temperature>=35 AND temperature<=65
| true |
a444ddafc38e56aa4b7531efd00d487073d262cb | SQL | vitaliyvt84/hotel.epam.com | /src/sql/HotelDB-CREATE-script.sql | UTF-8 | 3,246 | 4.34375 | 4 | [] | no_license | -- START OF SCRIPT
DROP DATABASE IF EXISTS hotel;
CREATE DATABASE hotel DEFAULT CHARACTER SET utf8 ;
USE hotel;
CREATE TABLE role (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(40) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE account (
id INT NOT NULL AUTO_INCREMENT,
login VARCHAR(40) NOT NULL,
email VARCHAR(100) NOT ... | true |
5c36bd151d3f6bccba5f6a7eb6511f534cf1587c | SQL | ModularArchive/Coding_Dojo | /Python2.7/MySQL/5MySQLCountries/3Countries.sql | UTF-8 | 197 | 3.828125 | 4 | [] | no_license | SELECT cities.name, cities.population
FROM countries
JOIN cities ON countries.id = cities.country_id
WHERE countries.name = 'Mexico' AND cities.population > 500000
ORDER BY cities.population DESC; | true |
15e023a898f91362b7dae64fad752b9d677fc9c7 | SQL | hanshenry90/instagram_database | /query.sql | UTF-8 | 2,042 | 4.53125 | 5 | [] | no_license | -- Below is a real-world scenario where shareholder needs to find crucial information from the instagram database for decision making.
-- 1. We want to reward our users by sending thank you emails who have been around the longest. Find the 5 oldest users.
select * from users order by created_at limit 5;
-- 2. What da... | true |
deee5d7fdc99e41538df95dae578d7629c5e3761 | SQL | Kickrop/sql_statreg | /statreg_pga_1.sql | UTF-8 | 1,270 | 3.78125 | 4 | [] | no_license | select max(length("67")) from _._0_statregistr_statregistr7
create materialized view _._1_statregistr_join_heads as
select *
from (
select * from
_._0_statregistr_statregistr7
where (length("3") < 2 or right("3", 4) = '0001' or "3" is null)
and "1" not in (select "1" from _._0_statregistr_second_head)
... | true |
a19f35efafdee443873138b371a6b20d327f70f5 | SQL | tectronics/leader-mob | /db/20140209215700.sql | UTF-8 | 12,832 | 3.84375 | 4 | [] | no_license |
CREATE TABLE IF NOT EXISTS `tblDataVault` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`expires` DATETIME DEFAULT NULL,
`filename` VARCHAR(150) NOT NULL,
`mimeType` VARCHAR(45) DEFAULT NULL,
`binary` LONGBLOB,
`created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`state` TINYINT(1) NO... | true |
994fa7fd7a2d1bc6b1610309477e6be4592362ba | SQL | snivas/fs-jobapp | /database.sql | UTF-8 | 9,089 | 3.25 | 3 | [] | no_license | DROP DATABASE snivas$jobconsultant;
CREATE DATABASE IF NOT EXISTS snivas$jobconsultant;
USE snivas$jobconsultant;
/* Company table */
CREATE TABLE IF NOT EXISTS companies (
company_id INT AUTO_INCREMENT,
company_name VARCHAR(255) NOT NULL,
PRIMARY KEY (company_id)
) ENGINE=INNODB;
/* Jobs Table */
CREA... | true |
27e489f35e4f1a425b434dafcf1c43c96f0f2993 | SQL | OrionJoshi/SQL | /Sql_Joins/problem6.sql | UTF-8 | 1,463 | 4.40625 | 4 | [] | no_license | -- 6. Write a SQL statement to find the details of a order i.e. order number, order date,
-- amount of order, which customer gives the order and which salesman works for that customer
-- and how much commission he gets for an order.
-- Sample table: customer
-- customer_id | cust_name | city | grad... | true |
c5d99e6484bf0e99d4f35e78e29e39849e8d4b0a | SQL | digitaldemocracy/dd-Data3.0 | /DBEvents/PassingVotesEvent.sql | UTF-8 | 3,443 | 4.0625 | 4 | [] | no_license | /*
Used by AlignmentMeter and BipartisanScores. Keeps track of which votes we consider
'passing'. Ie interesting enough to count, not just procedural.
*/
DROP EVENT IF EXISTS PassingVotes_event;
DELIMITER |
CREATE EVENT PassingVotes_event
ON SCHEDULE
EVERY 1 DAY STARTS '2017-1-1 07:00:00'
DO
BEGIN
D... | true |
7a0bd857bc7c9e2da4a806fdcfa0f7e670891369 | SQL | BorisIvanov/rusoft-review | /src/main/resources/db/migration/mysql/V1__init.sql | UTF-8 | 359 | 3.484375 | 3 | [] | no_license | CREATE TABLE car (
model VARCHAR(250) NOT NULL PRIMARY KEY,
prod_date DATE NOT NULL,
name VARCHAR(250)
);
CREATE TABLE client (
name VARCHAR(250) NOT NULL PRIMARY KEY,
birth_date DATE NOT NULL,
model VARCHAR(250) NOT NULL,
CONSTRAINT fk_client_car FOREIGN KEY... | true |
60494b7ff57cea8fc1252c0bb3c1c2f644e9bc64 | SQL | gl3n0n/TPJ_System | /Documents/WMS/barcode_uoms.sql | UTF-8 | 1,125 | 3.09375 | 3 | [] | no_license | set feedback off
set head off
set lines 312
set pages 0
col sql_text form a1024
spoo D:\systems\oracle\WSM\barcode_uoms2.sql
select decode(uome_code,'exit', 'exit' || chr(10), '' ||
'set head off' || chr(10) ||
'set lines 256' || chr(10) ||
'set feedback off' || chr(10) ||
'set pages 0' |... | true |
5b8a77f152c26b98b6351ea50a5b42590a539c8b | SQL | belenkorobka/delilah-resto | /database.sql | UTF-8 | 2,603 | 3.34375 | 3 | [] | no_license | CREATE DATABASE delilah;
USE delilah;
CREATE TABLE products(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
code VARCHAR(255),
name VARCHAR(255),
price FLOAT(16)
);
CREATE TABLE roles(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL
);
CREATE TABLE users(... | true |
28cfed3257191e7d84fe63a6596324a51f64965b | SQL | ssrdio/IdentityUI | /src/SSRD.IdentityUI.EntityFrameworkCore.SqlServer/Scripts/Migrations/20200824141100_InitialCreate.sql | UTF-8 | 10,144 | 3.53125 | 4 | [
"MIT"
] | permissive | IF OBJECT_ID(N'[__EFMigrationsHistory]') IS NULL
BEGIN
CREATE TABLE [__EFMigrationsHistory] (
[MigrationId] nvarchar(150) NOT NULL,
[ProductVersion] nvarchar(32) NOT NULL,
CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY ([MigrationId])
);
END;
CREATE TABLE [Emails] (
[Id] bigin... | true |
2ea3577bb4ade824dcb9142a210070540170dd46 | SQL | linklovezelda/zolstore | /src/mydb.sql | UTF-8 | 10,244 | 2.859375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 2019-07-12 06:48:36
-- 服务器版本: 5.7.14
-- PHP Version: 5.6.25
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 |
add7af8883b2929cb5a4fd197bddab5e70e4ae16 | SQL | SophiaAvvo/Projects | /2016 Projects/ALS Claim Path/20160810_als_and_control_adding_pageviews.sql | UTF-8 | 8,618 | 3.921875 | 4 | [] | no_license |
/* get all ALS transactions and characterize them */
/* Steps:
1. Identify als transactions and PIDs
2. Identify eligible users and PIDs; get total sessions
3.
*/
WITH eligible_users AS (
SELECT persistent_session_id
,resolved_user_id
,lawyer_user_id
,MIN(t.gmt_timestamp) first_visit_timestamp
,COUNT(ses... | true |
f74d45e58d1cb4f2550a13a6abef453c4ce85830 | SQL | jMac029/HighFlow | /db/schema.sql | UTF-8 | 576 | 3.09375 | 3 | [
"MIT"
] | permissive | ### Schema
CREATE DATABASE highview_db;
USE highview_db;
CREATE TABLE growers
(
id int NOT NULL AUTO_INCREMENT,
grower_name varchar(255) NOT NULL,
location NOT NULL,
email VARCHAR(255) NOT NULL,
bio VARCHAR(280) NOT NULL,
grow_method(280) NOT NULL,
indoor BOOLEAN,
strains VARCHAR(280),
cycle VARCHAR(280) NOT... | true |
f52773f17e64e002aa8314fd3ba29eb2e3a9ca35 | SQL | jfs-Akshata/jfs-repo-1 | /jfs-oracle/joins.sql | UTF-8 | 1,318 | 3.875 | 4 | [] | no_license | --joins
drop table t1;
drop table t2;
create table t1(f1 char(5), f2 char(5), f3 char(5));
create table t2(f1 char(5), f2 char(5), f4 char(5));
insert into t1 values('a','b','ab');
insert into t1 values('a1','b1','a1b1');
insert into t1 values('a2','b2','a2b2');
insert into t1 values('a3','b3','a3b3');
insert into t2 ... | true |
86ae38fdd717f7e652aa679015b5d2c68b1bab5b | SQL | blavoie/oracle-scripts | /_blos/exttools/sqlt/run/sqltxecute.sql | UTF-8 | 8,148 | 3.359375 | 3 | [] | no_license | SPO sqltxecute.log;
@@sqltcommon1.sql
REM $Header: 215187.1 sqltxecute.sql 12.1.01 2013/08/19 carlos.sierra mauro.pagano $
REM
REM Copyright (c) 2000-2013, Oracle Corporation. All rights reserved.
REM
REM AUTHOR
REM carlos.sierra@oracle.com
REM mauro.pagano@oracle.com
REM
REM SCRIPT
REM sqlt/run/sqltxe... | true |
daf5b56f72d91894026a409820a15ab9f927c834 | SQL | andimitre/airbyte-custom | /models/generated/airbyte_ctes/public/tydo_commits_commit_ab1.sql | UTF-8 | 935 | 2.84375 | 3 | [] | no_license | {{ config(schema="_airbyte_public", tags=["nested-intermediate"]) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
select
_airbyte_tydo_commits_hashid,
{{ json_extract_scalar(adapter.quote('commit'), ['url']) }} as url,
{{ ... | true |
1baab1297704981c15e764a3c0347e38612b5f08 | SQL | GromakMaxim/jdbc-task1 | /src/main/resources/my-script.sql | UTF-8 | 117 | 2.859375 | 3 | [] | no_license | select product_name
from orders
join customers on customer_id = customers.id
where customers.name like :name | true |
9c5c1029c354c967209197ea857c2c3cd7eafb94 | SQL | JcGaara/SGA-PLSQL-OPE | /SGA-OPERACION/Triggers/T_OPE_GRUPOS_REL_AIUD.SQL | ISO-8859-3 | 1,571 | 2.875 | 3 | [] | no_license | create or replace trigger OPERACION.T_OPE_GRUPOS_REL_AIUD
after insert or update or delete on OPERACION.OPE_GRUPOS_REL
for each row
/*********************************************************************************************
REVISIONES:
Ver Fecha Autor Descripcion
--------- ----... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.