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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
856e7ac25086397d6bdf8fbea881c3aa7168d790 | SQL | SocialGouv/reva | /packages/reva-api/prisma/migrations/20220901123131_uniform_organism_fields/migration.sql | UTF-8 | 442 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive |
-- DropIndex
DROP INDEX "organism_contact_administratif_key";
-- Rename old columns and default
ALTER TABLE "organism"
RENAME COLUMN "adress" TO "address";
ALTER TABLE "organism"
RENAME COLUMN "contact_administratif" TO "contact_administrative_email";
ALTER TABLE "organism"
RENAME COLUMN "cp" TO "zip";
-- C... | true |
360e69f2b900e8ca2b1bd56e03e9607fb541b6de | SQL | martinschmitz77/Compustat | /MSSQL/CSTAT_Changes_To_Cash_Flow_Working_Capital_Changes_For_FASB_95_In_XF.sql | UTF-8 | 2,166 | 3.546875 | 4 | [] | no_license | /***********************************************************************************************
Returns Changes To Cash Flow Working Capital Changes For FASB 95
Packages Required:
Core
Core 2
Core History
Core Prelim Standardized
Universal Identifiers:
GVKEY
Primary Columns Used:
consol
datadate
datafmt
gvkey
indf... | true |
5f7990e719093c3878da26857c42a04fd5259b4b | SQL | insanexx/sportsvolunteer | /sql/enterprise.sql | UTF-8 | 411 | 2.671875 | 3 | [] | no_license | use sportsvolunteer;
CREATE TABLE IF NOT EXISTS `enterprise` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(30) NOT NULL,
`password` varchar(30) NOT NULL,
`enterpriseName` varchar(50) NOT NULL,
`address` varchar(100) DEFAULT NULL,
`phonenumber` varchar(20) DEFAULT NULL,
`business` varc... | true |
682f60367a9f84b9a034fed4ac05578e88fddf12 | SQL | arman1507/Penjadwalan-Desa-Dengan-Framework-Yii | /db desa/desa.sql | UTF-8 | 1,549 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 05, 2018 at 06:58 AM
-- Server version: 10.1.9-MariaDB
-- PHP Version: 7.0.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIE... | true |
67b58e82be9f357ac1374c4f3b34aa47ac320fcd | SQL | inventorsoft-academy/educational-journal | /backend/src/main/resources/db.sql | UTF-8 | 531 | 3.75 | 4 | [] | no_license | # CREATE DATABASE Journal;
CREATE TABLE STUDENTS (
`id` SERIAL,
`firstname` VARCHAR(45) NOT NULL,
`lastname` VARCHAR(45) NOT NULL,
`birthday` DATE NOT NULL,
`group` INT NOT NULL,
PRIMARY KEY (`id`));
CREATE TABLE MARKS(
id SERIAL,
student_id INT ,
subject_id INT ,
mark INT ,
FOREIGN KEY (student_id... | true |
c3412884f2ed191d52b5564b881cd19c3da847a0 | SQL | cnobile2012/dcolumn | /db/create_schema.ddl | UTF-8 | 592 | 3.21875 | 3 | [
"MIT"
] | permissive | /*
* $ sudo -u postgres psql template1 -f db/create_schema.ddl
*/
DROP DATABASE IF EXISTS dcolumn;
CREATE DATABASE dcolumn;
DO
$body$
BEGIN
IF NOT EXISTS (SELECT * FROM pg_catalog.pg_user WHERE pg_user.usename = 'dcolumn')
THEN
CREATE USER dcolumn WITH PASSWORD 'dcolumn';
ALTER USER dcolumn CREATE... | true |
c361dc4cabf6471c3bd0266f1ba47bb96d6b6906 | SQL | alexa984/python101 | /week9/ships_2.sql | UTF-8 | 154 | 2.703125 | 3 | [] | no_license | --task2--
SELECT NAME,
country,
numguns,
launched
FROM classes
LEFT JOIN ships
ON ships.class = classes.class
| true |
ab06e2b290b567286dfb02b75937cd1bd1b2976c | SQL | wxmfsq/test | /eds-core/src/main/resources/META-INF/com/founder/eds/dao/ExternalDataDao/selectDataSource.sql | UTF-8 | 906 | 3.28125 | 3 | [] | no_license | select d.data_source_sn dataSourceSn,d.connection_name connectionName,d.database_type databaseType,d.connection_url connectionUrl,"user" ,
d.password passWord from data_source d where d.delete_flag='0'
/*%if null !=cond.connectionName && ! cond.connectionName.isEmpty() */
and d.connection_name like '%' || /*cond... | true |
bcf60a1b41531d885d804e8fc2fb7cbde141630e | SQL | luizeo/JavaJDBCCourse | /dbcclientes(1).sql | UTF-8 | 3,768 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 21/01/2020 às 15:00
-- Versão do servidor: 8.0.13
-- Versão do PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... | true |
b2843aa8ef9abf6e3e321e0ceb621c6e37907f3e | SQL | paul-rogers/drill-test-framework | /framework/resources/Functional/drill_fragments/decimal/data/join_big_with_big_zero_prec.sql | UTF-8 | 493 | 3.09375 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | SET planner.width.max_per_node=100;
SET planner.slice_target=1;
SET planner.enable_multiphase_agg=false;
SELECT
avg(decimal_big.DECIMAL_18_8),
avg(decimal_big_zero_prec.DECIMAL_18_18)
FROM
dfs.drillTestDir.`decimal/fragments/T_DECIMAL_BIG` decimal_big
JOIN
dfs.drillTestDir.`decimal/fragments/T_DECIMAL_BIG_ZERO_... | true |
55de0b7ec225b1e9c74ab3ca9f0b5e22fa92f5f8 | SQL | BowenChan/cs157a | /Database Files/CreateTables.sql | UTF-8 | 5,359 | 3.46875 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Thu Oct 22 22:49:49 2015
-- 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='TR... | true |
0bf91b3ea16b9eb1242b73276ecd99845e642caf | SQL | robin253/doc | /oracle/sqls/alter table move.sql | GB18030 | 3,176 | 4.09375 | 4 | [] | no_license | OracleƶCLOBռ
ο
http://www.cnblogs.com/Cratical/archive/2010/08/24/1806948.html
http://www.itpub.net/thread-1402010-1-1.html
-- compress
--ˮλºϲƬƶˮλ
alter table xxx move;
--ˮλºϲƬƶˮλ, ͬʱѹ
alter table xxx move compress for all operations;
-- shrink
--
1ܶclusterclustered table κLONGеĶʹ
2ѹβ֧кλͼı
3䲻ѹӳʹCASCADE
4... | true |
d0d2b15f1fc96ed2155b90ff2fe28db0ce8ebf9a | SQL | dalphaaabdourahamane/Pomme | /src/SQLDATA/postgres_public_bureauvote.sql | UTF-8 | 1,150 | 3.34375 | 3 | [] | no_license | -- Table: public.bureauvote
-- DROP TABLE public.bureauvote;
CREATE TABLE public.bureauvote
(
bid integer NOT NULL,
nom character varying(25) NOT NULL,
cp integer,
rue character varying(55),
vid integer NOT NULL,
CONSTRAINT bureauvote_bid_vid_pk PRIMARY KEY (bid, vid),
CONSTRAINT fkkh460go2jgyqa7f83i3j8... | true |
9ef72a50162d32dc18c58fc19020f616b9bab891 | SQL | THavart/Computer-Engineering-Technology | /Database/Database Systems/Labs/Week 5/DBP-e13-IM-CH02-MSSQL-MI-Create-Tables.sql | UTF-8 | 1,728 | 3.6875 | 4 | [] | no_license | /********************************************************************************/
/* */
/* Kroenke and Auer - Database Processing (13th Edition) Chapter 02 */
/* */
/* Morgan Importing [MI-CH02] Project Create Tables */
/* */
/* Microsoft SQL Server 2008... | true |
a2739ff78cd8deb1153d11c07ad364a29ff61095 | SQL | siddeshshewde/Competitive_Programming_v2 | /SQLBolt/SQL Lesson 02 - Queries with constraints (Pt. 1).sql | UTF-8 | 586 | 3.875 | 4 | [] | no_license | /*
Name: SQL Lesson 3: Queries with constraints (Pt. 1)
Link: https://sqlbolt.com/lesson/select_queries_with_constraints
*/
1. Find the movie with a row id of 6 ✓
SELECT title FROM movies
WHERE id = 6;
2. Find the movies released in the years between 2000 and 2010 ✓
SELECT title FROM movies
WHERE year betw... | true |
3cab5f48a7e381ed6b42a48d7225e6cb36cce5e1 | SQL | janwaraus/DES_PrgWin | /ZL/MySQL procedures/get_deposit_invoicing_by_vs.sql | UTF-8 | 2,081 | 4.40625 | 4 | [] | no_license | -- kompletní select s plnou granularitou až na billing_itemy pro všechny zákazníky
-- obdoba ZLView jak měl táta (složený ještě z dvou dalších views)
-- ct.tag_id = 4 znaměná "platba předem jinak"
DELIMITER //
CREATE PROCEDURE get_deposit_invoicing_by_vs(
IN in_active_date date,
IN in_bb_date date,
IN in_v... | true |
c634689c20b5b5c36562e7d4b01b59b5d92e9b5b | SQL | krasova/part_management_system | /database/schema/create_schema.sql | UTF-8 | 10,160 | 3.359375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- 11/17/14 22:34:59
-- 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 |
08f782f284fcdd2ed4df3770b75f231872ba51ab | SQL | Max-212/CourseWork_DataBase_Music | /TMI_Music_CreateTables.sql | WINDOWS-1251 | 3,598 | 3.84375 | 4 | [] | no_license | create database TMI_Music_BSTU_2020;
use TMI_Music_BSTU_2020;
--
DROP table Audio
create table Audio
(
Id int identity(1000,1) not null,
Title nvarchar(50) not null,
[Year] nvarchar(4),
BandId int not null,
AlbumId int not null,
CONSTRAINT PK_AudioID PRIMARY KEY (Id),
CONSTRAINT FK_BAND FOREIGN KEY(Ban... | true |
848a809450e7b5da7d1393efee5f26ec224f2f88 | SQL | Bikashbhaila/Project-2 | /db/schema.sql | UTF-8 | 1,062 | 3.140625 | 3 | [] | no_license | DROP DATABASE IF EXISTS maps_db;
CREATE DATABASE maps_db;
USE maps_db;
CREATE TABLE Main_map (
Map_id INTEGER(11) auto_increment NOT NULL,
Map_Name varchar(100),
PRIMARY KEY (Map_id)
);
CREATE TABLE City (
Map_id INTEGER(11) auto_increment NOT NULL,
City_Name VARCHAR(100),
Population INTEGER(100),
Is_... | true |
57801a467a7d930bf99ce41ac46d60d608ae1dbb | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day23/select0108.sql | UTF-8 | 191 | 2.796875 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-22T01:08:00Z' AND timestamp<'2017-11-23T01:08:00Z' AND SENSOR_ID='7ba2be18_4253_43af_9afd_506e991c5a8b'
| true |
d79ebb9cb82f28ddb1400c2d2553517c6988c619 | SQL | shwetankri/SQLServerPublic | /TSQL-GenreateScripts.sql | UTF-8 | 355 | 3.734375 | 4 | [] | no_license | #Use below to Grant execute permission to all the stored procedure to user test
#This is basically know-how to use SELECT with concatenation to generate scripts
SELECT ob.name, * , 'GRANT EXECUTE ON ' + sc.name + '.' + ob.name + ' TO test'
FROM sys.objects ob
JOIN sys.schemas sc
ON ob.schema_id = sc.schema_id
WHERE ... | true |
be1d947f31c95c40e34083762234e6e2280cd62b | SQL | MikeDias79/Secovi | /Secovi - Consultas.sql | UTF-8 | 350 | 3.71875 | 4 | [] | no_license | /* nome, contato e endereço de somente pessoas que possuam contato independente de ter endereço ou não. */
SELECT p.nome AS Nome, DATE_FORMAT(p.DT_Insercao,'%d/%m/%Y') AS DT, c.email AS Email, e.endereco AS Endereco
FROM tb_pessoas p
RIGHT JOIN tb_contatos c ON p.ID_Pessoa = c.ID_Pessoa
LEFT JOIN tb_enderecos e O... | true |
4754f381a54ca8a0c0b41b77a8bbd3ffc80023aa | SQL | PameSol02/ItlaBike | /database/dbItlaBike.sql | UTF-8 | 3,879 | 3.953125 | 4 | [] | no_license | create database itlabike;
use itlabike;
create table Rol (
rolId int not null auto_increment,
rol varchar (50),
constraint pk_rolid primary key (rolId)
);
create table Usuario (
usuarioId int not null auto_increment,
nombre varchar (50),
apellido varchar (50),
email varchar (100),
password... | true |
2c2a11a6729b2d134f0030049c6c6a63e26a31b1 | SQL | caiofior/mementomei.it | /install/data/schema/beloved_memento.sql | UTF-8 | 685 | 2.96875 | 3 | [] | no_license | CREATE TABLE `beloved_memento` (
`beloved_id` int(11) NOT NULL COMMENT 'Beeloved id',
`memento_code` varchar(20) NOT NULL COMMENT 'Memento code',
`user_id` int(11) DEFAULT NULL COMMENT 'User id',
`agency_id` int(11) DEFAULT NULL COMMENT 'Agency id',
`datetime` datetime NOT NULL COMMENT 'Date time',
`data` text NO... | true |
06b76f22ae179c0aa80658727d73d997737e855b | SQL | ory/keto | /internal/persistence/sql/migrations/sql/20210623162417000002_relationtuple.sqlite3.up.sql | UTF-8 | 663 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive |
CREATE INDEX keto_relation_tuples_subject_sets_idx ON keto_relation_tuples (nid,
namespace_id,
object,
... | true |
1259ca32659794afa60f2121fc3d9e6337ef0750 | SQL | saintlyzero/Quiz-App | /quiz_app.sql | UTF-8 | 7,071 | 3.25 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 15, 2019 at 07:40 AM
-- Server version: 10.3.15-MariaDB
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... | true |
f7b95558e2569aec974ad2056406fb888a482e85 | SQL | picnic106/fragment | /mysql/fragment.sql | UTF-8 | 1,834 | 3.75 | 4 | [] | no_license | CREATE TABLE `app_resource_feedback` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`resourceId` INT(11) NOT NULL DEFAULT '0' COMMENT '资源id',
`userId` INT(11) NOT NULL DEFAULT '0' COMMENT '用户id,哪个用户点击',
`scoreType` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '得分类型,0为一般,1为有用',
`resourceType` TINYINT(1) NOT NULL DEFAULT ... | true |
00d8678a1a24d449b83c2cff663a08250bb1e966 | SQL | weishiji/play-api | /conf/evolutions/default/1.sql | UTF-8 | 3,229 | 3.671875 | 4 | [
"CC0-1.0"
] | permissive | # --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table category (
category_id bigint auto_increment not null,
name varchar(255),
status tinyint,
sort_order ... | true |
750e39ebf9c23c2e1ee2dad494b4fd4db23149bb | SQL | rafakwas/soa-projekt | /guard_module/src/main/resources/import.sql | UTF-8 | 1,851 | 3.0625 | 3 | [] | no_license | --
-- JBoss, Home of Professional Open Source
-- Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
-- contributors by the @authors tag. See the copyright.txt in the
-- distribution for a full listing of individual contributors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- y... | true |
e0eecda5e2235836d25eb064ee9b5f3a175cd983 | SQL | eamt/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/6-states.sql | UTF-8 | 249 | 2.578125 | 3 | [] | no_license | -- creates the database `hbtn_0d_usa` and
-- The table `states` in MySQL Server.
CREATE DATABASE IF NOT EXISTS hbtn_0d_usa;
CREATE TABLE IF NOT EXISTS `hbtn_0d_usa`.`states` (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(256) NOT NULL
);
| true |
f8c406599c9e1988b4028fa34648b37e7c99b9e2 | SQL | isabelaelguy/BD2 | /32.sql | UTF-8 | 103 | 2.765625 | 3 | [] | no_license | SELECT emp_no, first_name FROM employees
WHERE first_name LIKE 'Crist%'
AND emp_no >= '485733'; | true |
7384bdd88112f14c059ced7ed8d1fd69027d49e4 | SQL | mattwilkinsonn/go-graphql | /sql/query/user.sql | UTF-8 | 503 | 3.28125 | 3 | [] | no_license | -- name: GetUserById :one
SELECT *
FROM users
WHERE id = $1
LIMIT 1;
-- name: GetAllUsers :many
SELECT *
FROM users
ORDER BY id ASC;
-- name: CreateUser :one
INSERT INTO users (username, email, password)
VALUES ($1, $2, $3)
RETURNING *;
-- name: DeleteUser :exec
DELETE FROM users
WHERE id = $1;
-- name: GetUserByEmail ... | true |
25bfb60f612d5ca6297574d872da60af661ebf1b | SQL | Ezak91/Muhvieh-Mobile | /scripts/muhvieh.sql | UTF-8 | 4,412 | 3.328125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.4.11.1deb2+deb7u1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 12. Okt 2014 um 18:52
-- Server Version: 5.5.38
-- PHP-Version: 5.4.4-14+deb7u14
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... | true |
37e921091584b6644c0ebe9b7756015bcf533307 | SQL | tactlabs/microservices-demo | /src/main/resources/testdb/schema.sql | UTF-8 | 587 | 3.015625 | 3 | [
"MIT"
] | permissive | drop table T_ACCOUNT if exists;
create table T_ACCOUNT (ID bigint identity primary key, NUMBER varchar(9),
NAME varchar(50) not null, BALANCE decimal(8,2), unique(NUMBER));
ALTER TABLE T_ACCOUNT ALTER COLUMN BALANCE SET DEFAULT 0.0;
drop table T_WEAPON if exists;
cr... | true |
0f56dbb585444b2d1209704568bce7b122631e93 | SQL | complitex/flexpay | /ab/etc/sql/flexpay_ab.ddl.sql | UTF-8 | 55,923 | 4.3125 | 4 | [] | no_license |
create table ab_apartment_numbers_tbl (
id bigint not null auto_increment,
begin_date date not null,
end_date date not null,
value varchar(255) not null comment 'Apartment number value',
apartment_id bigint not null comment 'Apartment reference',
primary key (id)
... | true |
df6412b905c98175f411d48c146b416b894da309 | SQL | NerdKvothe/SistemaConsorcio | /03 - Construcao/SistemaConsorcio.sql | UTF-8 | 7,770 | 3.140625 | 3 | [] | no_license | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `sistemaconsorcio` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
USE `sistemaconsorcio` ;
-- -------... | true |
35d934573d4d4d480affa286e2ed816647311d5e | SQL | nayguns/DIO-desafio-github-FR | /Aula de SQL - Introdução/SQLQuery1_DIOCurse.sql | UTF-8 | 285 | 3.078125 | 3 | [] | no_license |
select *
from Clientes cli
inner join Pedido ped
on cli.Codigo = ped.CodigoCliente
select *
from Clientes cli
left join Pedido ped
on cli.Codigo = ped.CodigoCliente
select *
from Pedido ped
right join Clientes cli
on cli.Codigo = ped.CodigoCliente
where ped.TotalPedido > 10
| true |
fcf7d6639b0406b16eb71ad64725b2eb685c7363 | SQL | IlliaVeremiev/Simple-InternetShop | /src/main/resources/db/postgresql/migration/V11006__WarehouseEntry_Init.sql | UTF-8 | 404 | 3.21875 | 3 | [] | no_license | DROP TYPE if EXISTS "warehouse_entry_status" CASCADE;
CREATE TYPE "warehouse_entry_status" AS ENUM ('AVAILABLE', 'RECEIVED');
DROP TABLE if EXISTS "warehouse_entries" CASCADE;
CREATE TABLE "warehouse_entries" (
"id" INT8 NOT NULL,
"warehouse_id" INT8 NOT NULL,
"product_id" INT8 NOT NULL,
"count" DEC... | true |
e548861526832d5c426eb03b29938e523ac6c25b | SQL | lgillie/openstore-schema-core | /resources/sql/mysql-utf8-compat/create_schema_extra_utf8_compat.sql | UTF-8 | 22,058 | 3.4375 | 3 | [
"MIT"
] | permissive | DELIMITER //
DROP FUNCTION IF EXISTS `slugify` //
DELIMITER ;
DELIMITER //
CREATE FUNCTION `slugify` (dirty_string VARCHAR(255))
RETURNS VARCHAR(255) CHARSET latin1
DETERMINISTIC
BEGIN
DECLARE x, y , z INT;
DECLARE temp_string, new_string VARCHAR(255);
... | true |
4ce78469985b10a9820bb11e3de7c3ac97e3c7d3 | SQL | ankitsinghmyself/Confer_space | /confer.sql | UTF-8 | 8,666 | 3.421875 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 02, 2020 at 09:47 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
404e6c7d37d94d384081dd6f2838630d7472a7ca | SQL | sprataps/Database-Project-University | /project/load.sql | UTF-8 | 1,176 | 3.09375 | 3 | [] | no_license | use stackoverflow;
-- users data
LOAD DATA LOCAL INFILE '/users/suryak/courses/db-class/project/data/users.txt'
INTO TABLE users
FIELDS TERMINATED BY '\t';
-- tags data
LOAD DATA LOCAL INFILE '/users/suryak/courses/db-class/project/data/tags.txt'
INTO TABLE tags
FIELDS TERMINATED BY '\t';
-- posts data
SET FOREIGN_... | true |
e9a984ea4fc74561d8f54575bccf3ffb204732e8 | SQL | FeFelix/teste | /db_teste_pg.sql | UTF-8 | 2,419 | 3.421875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Tempo de geração: 22-Nov-2020 às 21:43
-- Versão do servidor: 8.0.21
-- versão do PHP: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
49de7968ab860156c1e7966e3f3b2c83ca98f316 | SQL | clester24/Covid-Analysis | /SQLQuery_Covid.sql | UTF-8 | 8,391 | 3.96875 | 4 | [] | no_license | Select Location, date, total_cases, new_cases, total_deaths, population
From CovidProject..CovidDeath
Where continent is not null
order by 1,2
--Total Cases vs Total Deaths
Select Location, date, total_cases, total_deaths, (total_deaths/total_cases)*100 as DeathPCT
From CovidProject..CovidDeath
Where continent... | true |
024753af8325eef656a8ce34f46520eb74f69552 | SQL | ALriddle/sikm-alirsyad | /database/kategory_pemasukan.sql | UTF-8 | 1,438 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 14, 2015 at 10:27 AM
-- Server version: 5.1.41
-- PHP Version: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... | true |
a64e26f7f5c82baf19de8bb96046f7d6df271501 | SQL | scan1500/prog-sql | /Aufgabe04/wwfgusc_integrity.sql | UTF-8 | 6,360 | 3.8125 | 4 | [] | no_license | use wwfgusc;
# Aufgabe 1
/*
Mit Außerdienststellung (Löschung) eines Flugzeugs wird auch die
Information gelöscht, welche Ausstattungsmerkmale es besitzt (ALTER TABLE…).
*/
ALTER TABLE wwfgusc.Maschine_Merkmal
DROP FOREIGN KEY maschine_merkmal_ibfk_1;
ALTER TABLE wwfgusc.Maschine_Merkmal
ADD CONSTRAINT maschine_m... | true |
6341f524b10b9e20d382873f59f16accfe7d44a7 | SQL | vkazhdan/springbmvc-app | /src/main/resources/db/springb-test.sql | UTF-8 | 5,154 | 3 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 10.5
-- Dumped by pg_dump version 10.5
-- Started on 2019-03-04 10:58:02 EET
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_ca... | true |
2be03859dafccd84f5efd61354ccb8b0dfc97b3e | SQL | mtstnt/soaltest | /SOAL_SQL.sql | UTF-8 | 416 | 3.578125 | 4 | [] | no_license | DROP DATABASE IF EXISTS soaltestsql_matthew;
CREATE DATABASE soaltestsql_matthew;
CREATE TABLE user(
id INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(20),
parent INT
);
INSERT INTO user (username, parent) VALUES("Ali", 2), ("Budi", 0), ("Cecep", 1);
SELECT u.id as Id, u.username as UserName, v.username as Par... | true |
0c926d51d5fa57769d343a7b83efc4f9e90cfdbd | SQL | junrudai/sqlzoo | /Guest_house/Medium/10.sql | UTF-8 | 223 | 3.375 | 3 | [] | no_license | -- Attention on the date calculation, whether it's inclusive or not
SELECT
SUM(occupants)
FROM
booking AS b
WHERE
b.booking_date <= '2016-11-21'
AND DATEADD (day, nights - 1, b.booking_date) >= '2016-11-21'
| true |
42d4bd335aa7c23d2b0c7eff9eb2197d0a00cc89 | SQL | yashdedania/equipment_library | /equiptemp.sql | UTF-8 | 5,662 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 15, 2018 at 02:28 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 |
54e3ea28df0ef03e753eb9cc386d26942e5aa390 | SQL | pingcap/dm | /tests/sql_mode/data/db2.increment.sql | UTF-8 | 1,013 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | set @@session.sql_mode='ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,REAL_AS_FLOAT';
-- NO_AUTO_CREATE_USER set failed in mysql8.0
use sql_mode;
-... | true |
327e5aea0942d1e565100490afbd5562d6aae253 | SQL | daniiel/cursos | /Oracle 11g - Introduction to SQL/courselabs/sql2/code_ex/code_06_33_s.sql | UTF-8 | 724 | 3.703125 | 4 | [] | no_license | Drop Table Flights;
CREATE TABLE flights
(source varchar(20), destin varchar(20), flight_time number);
INSERT INTO flights VALUES ('San Jose', 'Los Angeles', 1.3);
INSERT INTO flights VALUES ('New York', 'Boston', 1.1);
INSERT INTO flights VALUES ('Los Angeles', 'New York', 5.8);
COMMIT;
SELECT Source, Destin, Flig... | true |
b1829339df4b1e6ba392db5842d25def7bf1dbf0 | SQL | MikhailTokarev/CS561 | /cs561Project/database/warehouse.sql | UTF-8 | 2,670 | 3.4375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 001
Source Server Version : 50016
Source Host : localhost:3306
Source Database : warehouse
Target Server Type : MYSQL
Target Server Version : 50016
File Encoding : 65001
Date: 2019-10-07 13:16:07
*/
SET FOREIGN_KEY_CHEC... | true |
16cecf51e44e82c43a231001961204615f24785a | SQL | leetoo/openstock | /src/main/resources/db/migration/V2015.07.26.13.08__create_table_account.sql | UTF-8 | 207 | 2.625 | 3 | [] | no_license | CREATE TABLE account
(
id serial NOT NULL,
email character varying(255) NOT NULL,
balance numeric NOT NULL,
created timestamp without time zone NOT NULL,
CONSTRAINT "PK_ACCOUNT" PRIMARY KEY (id)
); | true |
96a2db5ec34ee7596d71330246ab0e9509a0ef32 | SQL | candycake124/NTL_AHT | /Test-MVC/db_quanly.sql | UTF-8 | 2,589 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 19, 2021 at 03:53 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
d9145491c883bd82f1d8d048de55362adb12327f | SQL | cin-lawrence/sqlcookbook | /commander/commands/chapter14/06.sql | UTF-8 | 527 | 3.09375 | 3 | [] | no_license | -- 14.6 Searching for Mixed Alphanumeric Strings --
with V as (
select 'ClassSummary' strings from t1
union
select '3453430278' from t1
union
select 'findRow 55' from t1
union
select '1010 switch' from t1
union
select '333' from t1
union
select 'threes' from t1
)
select strings
from (
selec... | true |
ebc2e433bbec333c843ad293ef06f0c0f8a493d3 | SQL | phonotheque-historique-ocean-indien/mysql-database | /export-valentina-db-pro/current_script_folder/Links/lnk_Projetdemastering_Traiter.sql | UTF-8 | 334 | 2.828125 | 3 | [] | no_license | -- CREATE LINK "lnk_Projetdemastering_Traiter" -----------------
ALTER TABLE `Traiter`
ADD CONSTRAINT `lnk_Projetdemastering_Traiter` FOREIGN KEY ( `idProjetdemastering` )
REFERENCES `Projetdemastering`( `idProjetdemastering` )
ON DELETE Cascade
ON UPDATE Cascade;
-- ------------------------------------------------... | true |
ff223476732c6115f474dfc394f35261f554e137 | SQL | radtek/abs3 | /sql/mmfo/bars/Package/customer_utl.sql | WINDOWS-1251 | 8,878 | 3.15625 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/package/customer_utl.sql =========*** Run **
PROMPT =====================================================================================
CREATE OR REPLACE PACKAGE BAR... | true |
2a90900a23554099ffb3201dd1a0e00c570292c2 | SQL | masy-web/Pemro-P-Web-B | /QUIZ 2/login.sql | UTF-8 | 1,474 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 15 Bulan Mei 2021 pada 15.40
-- Versi server: 10.4.17-MariaDB
-- Versi PHP: 7.4.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
f6da83e13c12b7b40112fb1d9a0e1ff8f1e079ea | SQL | nurnadz/Mailing-Post-System-or-Unistorage | /G4_UniStorage.sql | UTF-8 | 790 | 3.265625 | 3 | [] | no_license | create table User(
icno varchar(14)not null,
user_name varchar(100)not null,
user_phone varchar(15)not null,
user_email varchar(50)not null,
user_addr varchar(200)not null,
user_password varchar(8),
unique key(user_password),
primary key(icno)
);
create table Parcel(
parcel_code varchar(15)not null,
no_shelf int(4),
p... | true |
949883dd0f9365d220289c0faf3ee8df32f77545 | SQL | vitor-paholsky/SqlCommands | /Count/query.sql | UTF-8 | 234 | 2.71875 | 3 | [
"MIT"
] | permissive | /* seleciona todos os produtos */
SELECT COUNT(*)
FROM production.product
/* seleciona quantos tamanhos de produtos tem cadastrado na tabela */
SELECT Count(size)
FROM Production.Production
-- top
SELECT TOP 10 *
FROM TABELA
| true |
9ed1eb105f7b5d4a00f628fe6fcaafc389decd77 | SQL | wyericso/lunmap | /01_create_db_tables.sql | UTF-8 | 2,881 | 2.625 | 3 | [] | no_license | CREATE DATABASE vspg;
USE vspg;
CREATE TABLE wlb_server (
System VARCHAR(50), # matches with wlb_hostgrp_wwn.System
Server VARCHAR(50) UNIQUE, # matches with wlb_hostgrp_wwn.Server
MigrationMethod VARCHAR(50),
PowerHAorHACMP VARCHAR(1),
Batch VARCHAR(2),
Grp VARCHAR(2)
);
CREAT... | true |
392b299ec16c94645d32ca68668134a7b75b158d | SQL | dungho966/C1020G1_Ho_Anh_Dung_module2 | /module3/bai2_thietke_taoCSDL/baitap/bt1.sql | UTF-8 | 747 | 3.421875 | 3 | [] | no_license | create database bai2;
use bai2;
create table customers (
customer_id int primary key not null auto_increment unique,
customer_name varchar(50) not null,
email varchar(50),
phone_number int
);
create table accounts(
account_number int primary key not null ,
account_type varchar(50)... | true |
981da6af6a2e95c26a13a437359b4bf6acabf2c6 | SQL | AndariasSilvanus/SimpleBlog | /simple_blog.sql | UTF-8 | 5,634 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 24, 2016 at 11:20 AM
-- Server version: 10.1.9-MariaDB
-- PHP Version: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
f16332c183fbcfabd0061bfebb3bc26b6bd26c8a | SQL | RohiTech/JFilesController | /dist/bd_files_controller/bd_files_controller.sql | UTF-8 | 959 | 3.453125 | 3 | [] | no_license | CREATE TABLE Detalle_Unidad (
Num_Archivo INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
Nombre VARCHAR(150) NOT NULL,
Directorio VARCHAR(300) NULL,
Etiqueta VARCHAR(50) NULL,
PRIMARY KEY(Num_Archivo)
);
CREATE TABLE Unidad (
Etiqueta VARCHAR(50) NOT NULL,
Cantidad_Archivos INTEGER UNSIGNED NULL,
... | true |
402ffd0efe55375e6d0d6c5a8e06083ffb6370df | SQL | onwuchekwa/CIT111-Introduction-to-Database | /Davy/Week 13/davy msql week13.sql | UTF-8 | 4,235 | 4.4375 | 4 | [] | no_license | USE mydb;
# Query 1: Report shohwing the number of courses in each college.
# College, Courses
SELECT college_name AS college, COUNT(DISTINCT c.course_id) AS course
FROM college col
JOIN department d
USING (college_id)
JOIN course c
USING (dept_id)
GROUP BY college_name
;
... | true |
58b42a2634a4402eac2cbc82f1490c58a63a704d | SQL | chiranjitengineer/learngit | /OfficeWorks/Caledonian/09032021/PIS STRUCTURE MIGR/VIEWS.sql | UTF-8 | 18,848 | 2.875 | 3 | [] | no_license | DROP VIEW PISASSIGN;
/* Formatted on 09/03/2021 12:28:10 PM (QP5 v5.115.810.9015) */
CREATE OR REPLACE FORCE VIEW PISASSIGN
(
COMPANYCODE,
DIVISIONCODE,
WORKERSERIAL,
YEARMONTH,
ADHOC,
ATN_INCNT,
BASIC,
CHOWKIDARI,
CONV_AMT,
CONV_FLAG,
DA,
FURNITURE,
HRA_PERC,
HR_DEDN,
ITAX... | true |
be544112ea758c2ccdcb08a7f3f6aa391f13b237 | SQL | twdahlinghaus/sql-scrips | /UPDATE and DELETE GPA and Names scripts.sql | UTF-8 | 341 | 2.984375 | 3 | [] | no_license | select * from student;
INSERT Student
(Firstname, Lastname, SAT, GPA, MajorId)
VALUES
('Kaela', 'Dhaus', 5000, 4.5, (Select Id From Major Where Description = 'Engineering'));
Update student Set
Firstname = 'Thomas', SAT = 555, GPA = 2.2 Where id = 196;
delete from student
Where GPA = 2.20
AND firstname = 'Greg'
A... | true |
5eb3c1f988d9b5a8954280beb7f541b2e9e5765b | SQL | neeveermoree/sql_stepik | /2. Запросы SQL к связанным таблицам/3. Запросы корректировки, соединение таблиц/2.3.3-insert_book.sql | UTF-8 | 207 | 3.0625 | 3 | [
"MIT"
] | permissive | INSERT INTO book(title, author_id, price, amount)
SELECT title, author_id, price, amount
FROM
author
INNER JOIN supply ON author.name_author = supply.author
WHERE amount <> 0;
SELECT * FROM book;
| true |
ffcca9ed4367d206f4c65609ac67036fffb4d3d3 | SQL | cncf/devstats | /metrics/istio/flaky_prs.sql | UTF-8 | 563 | 4 | 4 | [
"Apache-2.0"
] | permissive | with issues as (
select distinct id,
dup_repo_name as repo,
min(created_at) as created_at
from
gha_issues
where
is_pull_request = false
and created_at >= '{{from}}'
and created_at < '{{to}}'
group by
id,
dup_repo_name
), issues_labels as (
select count(distinct i.id) as all_iss... | true |
5a180cc616472c3158b1e2c5a11bfa27aee7a4dd | SQL | tommybotabara1/trucking | /db scripts/additional_tables 20200329.sql | UTF-8 | 3,267 | 3.0625 | 3 | [] | no_license | CREATE TABLE `payables` (
`payableID` int(11) NOT NULL AUTO_INCREMENT,
`date` date DEFAULT NULL,
`invoiceNo` varchar(45) DEFAULT NULL,
`documentDate` date DEFAULT NULL,
`supplier` varchar(45) DEFAULT NULL,
`amount` float DEFAULT NULL,
`particulars` varchar(45) DEFAULT NULL,
`checkVoucherNo` varchar(45) ... | true |
eda8451f697602fb0372fe4903f54fd4f55a440b | SQL | cdesmarais/WebDB-Test | /WebDB/StoredProcedures/ConsoleDB/dbo.OTConGetReservationByID.PRC | UTF-8 | 521 | 3.203125 | 3 | [] | no_license | if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OTConGetReservationByID]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[OTConGetReservationByID]
GO
--
-- Gets the specfic reservation
--
CREATE Procedure dbo.OTConGetReservationByID
@RID INT, -- not strictly necessary (Re... | true |
995763225555f7ab8a8aadcbfc235f81146bbc37 | SQL | caiki/APOSTILA-DB | /DB-APOSTILA.sql | UTF-8 | 21,369 | 3.140625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.28, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: MBD-USP
-- ------------------------------------------------------
-- Server version 5.6.28-0ubuntu0.15.10.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@C... | true |
943c4b6cbfeaf05a21c18de4c569b3d380a505ec | SQL | andreyAmaterasu/AS2020 | /scriptDronTaxi.sql | UTF-8 | 4,698 | 3.59375 | 4 | [] | no_license | create table Useraccount (
email varchar(50) primary key,
password varchar(50) not null,
lastname varchar(30) not null,
firstname varchar(30) not null,
patronymic varchar(30) not null,
date_of_birth date,
gender varchar(20),
phone_number varchar(30),
photo varchar(150)
);
insert int... | true |
ab266ec7a3d1225494018631e17b12e44c5acc18 | SQL | mayoricodevault/riot-core-services | /src/main/resources/sql/mysql/V050000_RC2_to_050000_RC3.sql | UTF-8 | 949 | 3.375 | 3 | [
"Apache-2.0"
] | permissive | ALTER TABLE token ADD tokenActive BOOLEAN NOT NULL DEFAULT TRUE AFTER creationTime;
CREATE TABLE IF NOT EXISTS `thingtypepath` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID of the table',
`originThingType_id` bigint(20) NOT NULL COMMENT 'Thing Type ID origin',
`destinyThingType_id` bigint(20) NOT NULL ... | true |
0e5760d52c9882ea04f756bb2a86c37d502b4455 | SQL | kenmd/spring-boots | /spring-data-jdbc-web-security/src/main/resources/schema.sql | UTF-8 | 335 | 2.875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS users (
id IDENTITY,
username VARCHAR NOT NULL,
password VARCHAR NOT NULL,
enabled BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE IF NOT EXISTS authorities (
id IDENTITY,
username VARCHAR NOT NULL,
authority VARCHAR NOT NULL,
created_at TIMESTAMP DE... | true |
d1d73fda68a8e154c781016fb87e7861c6afc94b | SQL | xiemenger/sql-procedures-and-functions | /CreateTriggerForTable.sql | UTF-8 | 337 | 2.96875 | 3 | [] | no_license | -- For one table:
CREATE TRIGGER test AFTER INSERT OR UPDATE OR DELETE ON t_trig_table
FOR EACH ROW EXECUTE PROCEDURE change_trigger();
-- For multiple tables:
CREATE TRIGGER testtrigger
AFTER INSERT OR UPDATE OR DELETE
ON 'table1 || table2 || table3 || ... '
FOR EACH ROW EXECUTE PROCEDURE change_t... | true |
7e67e0a005d400be71468fd68ad540ecbcac7407 | SQL | clarkfitzg/phd_research | /hadoop/basic/gamma.sql | UTF-8 | 515 | 3.40625 | 3 | [] | no_license | -- gamma.sql
DROP TABLE gamma
;
CREATE TABLE gamma (
userid INT,
movieid INT,
rating INT,
gamma_col DOUBLE)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
;
add FILE gamma.R
;
INSERT OVERWRITE TABLE gamma
SELECT
TRANSFORM (userid, movieid, rating)
-- The 3 following the command makes it available from comm... | true |
42b8c459d414f824b5f20bf15d1a00e47c5882ff | SQL | junrudai/sqlzoo | /Guest_house/Hard/11.sql | UTF-8 | 1,315 | 4.9375 | 5 | [] | no_license | --- Coincidence. Have two guests with the same surname ever stayed in the hotel on the evening? Show the last name and both first names. Do not include duplicates.
WITH guest2 AS (
SELECT
b.booking_date,
b.nights,
g.last_name,
g.first_name
FROM
booking AS b
INNER... | true |
a8e80e46ec1effb1b8514fd574146f43b4327063 | SQL | achmadnabawi/sparkdata | /zlj/project/service/t_base_ec_feed_user_buy_info.sql | GB18030 | 823 | 3.453125 | 3 | [] | no_license |
-- û¼
-- ƷϢ ûϢ ̻Ϣ
-- create table t_base_ec_feed_user_buy_info as
INSERT INTO TABLE t_base_ec_feed_user_buy_info PARTITION (ds='20160418' )
select
t2.item_id ,
t2.user_id ,
t2.cat_id ,
t2.root_cat_id ,
t2.root_cat_name ,
t2.brand_id ,
t2.brand_name ,
t2.bc_type ,
t2.pr... | true |
c5daa524b88a3279a4933e00ee42a5742386fa33 | SQL | joaovcog/algamoney-api | /src/main/resources/db/migration/V07__criar_e_registrar_cidades_estados.sql | UTF-8 | 2,976 | 3.390625 | 3 | [] | no_license | CREATE TABLE estados (
codigo BIGINT(20) PRIMARY KEY AUTO_INCREMENT,
nome VARCHAR(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO estados (codigo, nome) VALUES(1, 'Acre');
INSERT INTO estados (codigo, nome) VALUES(2, 'Alagoas');
INSERT INTO estados (codigo, nome) VALUES(3, 'Amazonas');
INSERT INTO est... | true |
dd1c0234a0227913093193e1aee785228c993ab3 | SQL | DorianPATRU/USAL37_BDD | /EVAL_MD214_PATRU/EVAL_MD214_SCRIPT.sql | UTF-8 | 2,664 | 3.78125 | 4 | [] | no_license | /* Suppression de la base de données si elle existe */
DROP DATABASE IF EXISTS usal37_legumos;
/* Création de la base de données si elle n'existe pas avec le set de caractères par défaut UTF-8 */
CREATE DATABASE IF NOT EXISTS usal37_legumos DEFAULT CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
/* Utilisatio... | true |
c8d42a32e947ea907076d192523f5f07af039fbe | SQL | EkhlasMridha/HotelBookingCRUD | /assignment-bookingsystem.sql | UTF-8 | 1,657 | 3.59375 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS `BookingDetails`(
`Id` BIGINT NOT NULL AUTO_INCREMENT,
`BookedFrom` datetime not null,
`LeaveAt` datetime not null,
`BookedBy` BIGINT not null,
`PaidAmount` decimal null,
`Comments` varchar(300) null,
`CreatedAt` DATETIME NOT NULL,
`UpdatedAt` datetime NULL... | true |
1f57e835abb37130ac5a1f3e51f783bda109c360 | SQL | Seeker1911/chinook_database | /total_sales_year.sql | UTF-8 | 90 | 2.609375 | 3 | [] | no_license | select sum(Total)
from Invoice
where InvoiceDate like '2009%'
or
InvoiceDate like '2011%' | true |
3304aaf175c64b8a038c29c7e92e48d59de0cb7a | SQL | 316k/IFT1155-SQL | /db-sqlite.sql | UTF-8 | 1,965 | 3.890625 | 4 | [] | no_license | DROP TABLE IF EXISTS `locaux`;
CREATE TABLE `locaux` (
`_id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`numero` TEXT NOT NULL,
`categorie` TEXT NOT NULL,
CHECK(`categorie` in ('reunion', 'cours'))
);
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`_id` INT... | true |
c8917a4673743ba374264ef48f806732a2373190 | SQL | javachengwc/java-apply | /modules/sharding-dbtable/modules/sharding-springboot-demo/src/main/resources/db/create.sql | UTF-8 | 3,366 | 3.875 | 4 | [] | no_license |
create database demo_ds_0;
create database demo_ds_1;
###分别在数据库 demo_ds_0, demo_ds_1执行建表语句,t_order_0,t_order_1,t_order_item_0,t_order_item_1
create table if not exists t_order_0(
order_id bigint auto_increment,
user_id bigint comment '用户id',
user_name varchar(32) default '' comment '用户名称',
statu int default 0 ... | true |
39b3b6b2d0f86fa97372bc7626227c95ebfc12e8 | SQL | itsnatscott/WDI_project_1 | /schema.sql | UTF-8 | 968 | 3.1875 | 3 | [] | no_license |
-- DROP TABLE IF EXISTS post;
-- CREATE TABLE post (
-- id INTEGER PRIMARY KEY,
-- title TEXT,
-- comment INTEGER,
-- pic TEXT,
-- author INTEGER,
-- body TEXT,
-- category INTEGER,
-- created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-- upvote INTEGER, --for posts
-- downvote INTEGER --not used
-- )... | true |
e1e092dadb2ce0ccda94e2aeafc3930898ff6197 | SQL | teach-tech-service/postgres | /query5.sql | UTF-8 | 367 | 2.625 | 3 | [] | no_license | SELECT
id as "Id zgłoszenia",
data_zgloszenia as "Data zgłoszenia",
termin_rozwiazania as "Termin rozwiązania",
data_rozwiazania as "Data rozwiązania",
CONCAT(opis, ' wyjasnienie: ', wyjasnienie) as "Opis z wyjaśnieniem",
DATE_PART(
'day',
data_rozwiazania :: timestamp - termin_rozwiazania :: timest... | true |
75820a2232291596c40553fd11b9539e86b649a7 | SQL | rafaelmarchesin/event-sourcing | /src/database_scripts/CreateTable.sql | UTF-8 | 507 | 2.734375 | 3 | [] | no_license | CREATE TABLE todo_list_table (
id INT(8) not null AUTO_INCREMENT PRIMARY KEY,
task_id INT (8) NOT NULL,
version INT (1) default 1,
task VARCHAR(140) NOT NULL,
done INT(1) default 0,
event_type VARCHAR(140),
date_time DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE todo_list_projections (
id INT(8) not null AUTO_INC... | true |
334a3a48b199df329983561989024a54fdc08874 | SQL | rkboyce/WebAPI | /src/main/resources/resources/cohortdefinition/sql/dateOffsetStrategy.sql | UTF-8 | 172 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | select event_id, person_id,
case when DATEADD(day,@offset,@dateField) > start_date then DATEADD(day,@offset,@dateField) else start_date end as end_date
from @eventTable
| true |
17f4a7377bb6646715248852507e9e2af4ed619f | SQL | pookieofdoom/school | /365/lab2/WINE/WINE-queries.sql | UTF-8 | 3,829 | 3.9375 | 4 | [] | no_license | -- Anthony Dinh
-- adinh03@calpoly.edu
-- CPE 365
-- WINE-queries.sql
-- Q1
SELECT A.*
FROM (SELECT W.Grape, G.Color, COUNT(DISTINCT W.Appellation) AS NumApp
FROM Wine W, Grapes G
WHERE W.Grape = G.Grape
GROUP BY W.Grape) AS A
WHERE A.NumApp =
(SELECT MAX(A2.NumApp)
FROM (SELECT W.Grape, G.Colo... | true |
1fd149b67ceab4eaac7215bfa55a891a042e7e25 | SQL | yaroslavtsepkov/ESA | /database/tododb.sql | UTF-8 | 1,605 | 4.1875 | 4 | [] | no_license | create table users (
iduser serial,
username VARCHAR(64) not null,
password VARCHAR(64) not null,
constraint pk_iduser primary key(iduser)
);
create table tasks (
idtask serial,
iduser int not null,
title varchar(64) default null,
description varchar(256) default null,
status bit(1) default null,
deadline d... | true |
faaec3197a39ee29b0d71c394e9ca4ce6d351fd0 | SQL | souvikdas2411/DBMS-COURSE-CS310 | /CarInsurance/PDM/6.sql | UTF-8 | 344 | 3.28125 | 3 | [] | no_license | use mydb;
SELECT DISTINCT
t1.*
FROM
t3_CUSTOMER AS t1,
t3_COVERAGE AS t2,
t3_CLAIM_SETTLEMENT AS t3,
t3_CLAIM AS t4
WHERE
t4.t3_Claim_Amount < t2.t3_Coverage_Amount
AND t4.t3_Claim_Amount > (t3.t3_Claim_Settlement_Id + t3.t3_Vehicle_Id + t3.t3_Claim_Id + t3.t3_Cust_Id)
AND t1.t3_... | true |
4673055596499f8ee7201bb34d0fc55905384ab9 | SQL | termlex/release-assertion-toolkit | /release-assertion-resources/src/main/resources/scripts/component-centric/component-centric-snapshot-description-fsn-synonym-text.sql | UTF-8 | 2,341 | 3.703125 | 4 | [] | no_license |
/********************************************************************************
file-centric-snapshot-description-synonym-tag
Assertion:
For each active FSN associated with active concept there is a synonym that has the same text.
*************************************************************************... | true |
fc94acf6acbb71c1e72300d05b7941e6bac6b989 | SQL | enniebabs/Islay-web | /queries_create/people.sql | UTF-8 | 615 | 3.125 | 3 | [] | no_license | CREATE TABLE PEOPLE
(PEOPLE_ID NUMBER(6) not null,
SURNAME VARCHAR2(2000) null,
OTHERNAMES VARCHAR2(2000 )null,
MAIDEN_NAME VARCHAR2(1000 )null,
STATUS VARCHAR(20) null,
BURIED_AT VARCHAR(2000) null,
SUPPLEMENTARY CLOB null,
REFERENCE VARCHAR(2000) null,
AGE NUMBER(5) null,
YEAR_BORN NUMBER(4) null,
YEAR_MA... | true |
9759a85d5fd419636b2958b4d4e23161d3d16381 | SQL | vsolv/BigFin | /Bigflow/DB/SPS/Master/sp_Customergroup_Set.sql | UTF-8 | 13,026 | 2.953125 | 3 | [] | no_license | CREATE DEFINER=`developer`@`%` PROCEDURE `sp_Customergroup_Set`(IN `Action` varchar(16),IN `li_custgrp_gid` int,
IN `ls_custgrp_code` VARCHAR(8),IN `ls_custgrp_name` varchar(128),IN `li_add_gid` int,IN `ls_cpname1` varchar(64),
IN `ls_desig1` varchar(64),IN `ls_Mobile1` varchar(16),IN `ls_landln1` varchar(16),IN `ls_cp... | true |
17d5931c52ed2574fb5e409b5a3adea8b9c5a1c9 | SQL | devsg-gh/UCI-Homework | /SQL Challenge Homework/EmployeeSQL/sqlcode.sql | UTF-8 | 1,910 | 4.0625 | 4 | [] | no_license | -- query #1
-- select e.emp_no, e.first_name, e.last_name, e.gender, s.salary
-- from employees e
-- join salaries s
-- on e.emp_no = s.emp_no
-- ;
-- query #2
-- select e.emp_no, e.first_name, e.last_name
-- from employees e
-- where date_part('year', hire_date) ='1986'
-- ;
--query #3
-- select d.dept_no, d.dept_... | true |
2cb42cff7ff80f5ca5ec20eb98ac4de3652343bf | SQL | marcosumali/restaurant-erp | /server/seeders/role.sql | UTF-8 | 367 | 2.671875 | 3 | [] | no_license | create table role (
id BIGSERIAL NOT NULL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
UNIQUE(name)
);
insert into role (name) values ('Owner');
insert into role (name) values ('Manager');
insert into role (name) values ('Cashier');
insert into role (name) values ('Waiter');
insert into role (name) values ('Kitchen');
... | true |
c848df1d20df3139bb06d97e8cc9439086197127 | SQL | abullatama/Asset-Management-Information-System-on-PT.Blitzspot | /blitzspot.sql | UTF-8 | 24,024 | 2.921875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 31 Agu 2020 pada 12.33
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
0f52c058a3b57069c801b65d6deb0da112442061 | SQL | omar-1999/codeigniter-test | /scripts.sql | UTF-8 | 465 | 3.109375 | 3 | [
"MIT"
] | permissive | CREATE TABLE empleado (
id int primary key not null AUTO_INCREMENT,
fecha_ingreso date not null,
nombre varchar(50) not null,
salario numeric(10.5) not null
);
CREATE TABLE solicitud (
id int primary key not null AUTO_INCREMENT,
codigo varchar(50) not null,
descripcion varchar(50) not null,... | true |
ee1954a3c3ac53bff0dd9b4423f2d5288516eeab | SQL | yh1008/DoodleMeet | /schema.sql | UTF-8 | 3,932 | 4.21875 | 4 | [] | no_license | drop table if exists users;
create table users(
userid int primary key,
firstname text,
lastname text,
fund numeric check (fund > 0) ,
gender text,
age int
);
drop table if exists friendship;
create table friendship(
fid int primary key,
usr int,
friend int,
foreign key (usr) ref... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.