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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
734cb9c08f1a0842fe60575b2519a191ef39db80 | SQL | tyty3142/PLSQL | /lab2.sql | UTF-8 | 1,319 | 2.984375 | 3 | [] | no_license | -- 2-1
declare
lv_test_date date := '10-DEC-2012';
lv_test_num constant number(3) :=10;
lv_test_txt varchar2(10);
begin
lv_test_txt := 'Brown';
DBMS_OUTPUT.PUT_LINE(lv_test_date);
DBMS_OUTPUT.PUT_LINE(lv_test_num);
DBMS_OUTPUT.PUT_LINE(lv_test_txt);
end;
-- 2-3
--LOW rating
declare
lv_r... | true |
ab906b533a50c3d6fbdee239c75f5a2e802cd528 | SQL | FishermanSqaud/fish_and_chips | /docker/database/init/init.sql | UTF-8 | 868 | 3.203125 | 3 | [] | no_license | SET NAMES utf8;
SET character_set_client = utf8mb4;
SET character_set_server = utf8mb4;
CREATE DATABASE IF NOT EXISTS fish_and_chips;
USE fish_and_chips;
CREATE TABLE IF NOT EXISTS users (
id INTEGER AUTO_INCREMENT NOT NULL,
email TEXT NOT NULL,
password TEXT NOT NULL,
name TEXT,
is_admin TINYINT... | true |
23bd5eed5fc15dc8692fb9b3aefa911f2ea226e2 | SQL | Beyensc/Dogs | /dogs.sql | UTF-8 | 13,306 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Jeu 16 Mars 2017 à 06:58
-- Version du serveur : 5.7.13-0ubuntu0.16.04.2
-- Version de PHP : 7.0.15-0ubuntu0.16.04.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101... | true |
8f0fe842df05f9cdb161f526fc6e162caf148777 | SQL | alexli0707/ori_im | /sql/20190404.sql | UTF-8 | 720 | 2.953125 | 3 | [] | no_license | CREATE TABLE `user` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` VARCHAR(50) NOT NULL
COMMENT '用户帐号',
`nickname` VARCHAR(200) NOT NULL DEFAULT ''
COMMENT '昵称',
`salt` VARCHAR(50) NOT NULL
COMMENT 'salt你懂的',
`encrypted_pwd` VARCHAR(32) NOT... | true |
e3f7227e4cb320b69893420689cb3bc73b09e5d7 | SQL | bellmit/dht | /aliyun-sms/src/main/resources/aliyun_init.sql | UTF-8 | 1,003 | 3.53125 | 4 | [] | no_license | SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for t_aliyun_sms_template
-- ----------------------------
DROP TABLE IF EXISTS `t_aliyun_sms_template`;
CREATE TABLE `t_aliyun_sms_template` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`fun_code` varchar(255) DEFAULT NULL COMMENT '短信功能code... | true |
be4ea2ba5e15b7ffbd4c7846c4febdae4861c545 | SQL | shuvoshahacsedu22/spring-boot-crud | /src/main/resources/schema.sql | UTF-8 | 658 | 3.625 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS department_table (
DepartmentID INT AUTO_INCREMENT,
DepartmentName VARCHAR(255),
NumberOfEmployee INT DEFAULT 0,
RunningProjects VARCHAR(255),
PRIMARY KEY (DepartmentID)
);
CREATE TABLE IF NOT EXISTS employee_table (
EmployeeID INT AUTO_INCREMENT,
EmployeeName VARC... | true |
730d8f7a9c800ae23b6ec11f957a351f31914568 | SQL | bingo-soft/mybatis | /tests/Resources/Databases/Blog/sqlite-blog-derby-schema.sql | UTF-8 | 1,454 | 3.59375 | 4 | [
"MIT"
] | permissive | DROP TABLE IF EXISTS comment;
DROP TABLE IF EXISTS post_tag;
DROP TABLE IF EXISTS tag;
DROP TABLE IF EXISTS post;
DROP TABLE IF EXISTS blog;
DROP TABLE IF EXISTS author;
CREATE TABLE author (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username VARCHAR(255) NOT NULL,
password VAR... | true |
caf5e5ad1e6b78aa9c0392fc10950a70570972b8 | SQL | MohamedAbdelnaby7/CS50-psets | /Pset7/lab7/7.sql | UTF-8 | 99 | 2.828125 | 3 | [] | no_license | SELECT AVG(energy)
FROM songs
JOIN artists
ON artists.id = artist_id AND artists.name = 'Drake';
| true |
7206d2cfe9e8f081d7825e8abf7b5bbd69959c59 | SQL | Donghyun-34/Python | /실습 코드/MySQL 연습/기본문법 연습.sql | UTF-8 | 894 | 3.703125 | 4 | [] | no_license | create database 생활코딩;
use 생활코딩;
drop table if exists topic;
create table topic(
id int(11) NOT NULL auto_increment,
title varchar(100) NOT null,
created datetime NOt null,
primary key(id)
);
insert into topic (title, created) values ('First_book', now());
insert into topic (title, created) values ('... | true |
c96f9b2d1ee051c8dad21543b1fe2683a861cea9 | SQL | sebastianfrasic/Proyecto-MBDA | /CRUDE.sql | ISO-8859-1 | 1,554 | 2.640625 | 3 | [] | no_license | CREATE OR REPLACE PACKAGE mantener_persona
IS
PROCEDURE adicionar_persona(nombre VARCHAR, cedula NUMBER, telefono NUMBER, direccion VARCHAR, correo VARCHAR, fechaNacimiento DATE);
PROCEDURE modificar_persona(Nnombre VARCHAR, Ncedula NUMBER);
PROCEDURE adicionar_empleado(cedula NUMBER,cargo VARCHAR, horario VARCHAR)... | true |
db243bb62b1e177394b93e8cec9188806e5f2166 | SQL | Bill-Windsor/Eat-Da-Burger-Express-Node-Handlebars | /db/y2grvx4scz253cls.sql | UTF-8 | 604 | 2.53125 | 3 | [] | no_license | DROP DATABASE IF EXISTS y2grvx4scz253cls;
CREATE DATABASE y2grvx4scz253cls;
USE y2grvx4scz253cls;
CREATE TABLE burgers (
id INT AUTO_INCREMENT NOT NULL,
burger_name VARCHAR(255),
devoured BOOLEAN NOT NULL DEFAULT false,
createdAt TIMESTAMP NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO burgers(burger_name) VALUES (... | true |
201b1142efde05a3cd4058c5402bc6619128bcac | SQL | xXHellgate25Xx/web-assignment2 | /DB.sql | UTF-8 | 596 | 3.046875 | 3 | [] | no_license | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
CREATE TABLE `users` (
`username` varchar(255) NOT NULL,
`fullname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`createtime` varchar(255) NOT NULL
... | true |
ef0bffcd032797b6995677aec4ce57871f4b35df | SQL | UsachevSergey/PhpViard | /Other/DampDatabase/dump22_12_2017_13_54.sql | UTF-8 | 4,057 | 3.21875 | 3 | [] | no_license | -- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия сервера: 5.7.18-log - MySQL Community Server (GPL)
-- Операционная система: Win64
-- HeidiSQL Версия: 9.4.0.5125
-- --------------------------------------------------------... | true |
f8cb0ece89cd301eba91d072bdb9d21cf8d2158c | SQL | morrowRefactor/tabletop-ledger-express-api | /migrations/019.do.create_user_game_mech_logs.sql | UTF-8 | 289 | 2.90625 | 3 | [] | no_license | CREATE TABLE user_game_mech_logs (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
mech_id INTEGER
REFERENCES games_mech(mech_id) ON DELETE CASCADE NOT NULL,
uid INTEGER
REFERENCES users(id) ON DELETE CASCADE NOT NULL,
sessions INTEGER NOT NULL
); | true |
43f40b535a5c99509993c08c14cc2b4b4231e3ba | SQL | admariner/metrics-playbook | /models/metrics/metrics/intermediate/metrics__calculated.sql | UTF-8 | 4,486 | 3.625 | 4 | [] | no_license | with
metrics as (
select * from {{ ref('metrics__date_spined') }}
),
transform_dates as (
select
*,
date_trunc('month', date_day) as date_month,
date_trunc('quarter', date_day) as date_quarter,
extract(day from date_day) as day_of_month,
extract(month from date_... | true |
0082d3901d2b82f31ed639cb9f3cdfd6336a8a24 | SQL | kalob92/bamazon | /bamazonSeeds.sql | UTF-8 | 1,239 | 3.515625 | 4 | [] | no_license | DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE bamazon;
USE bamazon;
CREATE TABLE products (
item_id int AUTO_INCREMENT NOT NULL,
product_name VARCHAR(100) NOT NULL,
department_name VARCHAR(50) NOT NULL,
price DECIMAL(10, 2) UNSIGNED NOT NULL,
stock_quantity INT(5) UNSIGNED NOT NULL,
PRIMARY KEY... | true |
6bc357ef90e7c4ab109b9a3351866bb798b9d858 | SQL | CSchrisD/OracleSQL-Practice | /Where-OrderBy.sql | UTF-8 | 673 | 4.125 | 4 | [] | no_license | /*
MySQL:
In this exercise, you will practice writing SELECT statements that use both WHERE and ORDER BY.
Create a report that shows the company name, contact name and fax number of
all customers that have a fax number. Sort by company name.
Create a report that shows the city, company name, and contact nam... | true |
7c95c427c3076553132ed5fc25ec0fd8f9590d0c | SQL | naresh-nandu/NanduGST | /WePGSTDB/dbo/Stored Procedures/usp_Push_GSTR1EXPA_EXT_SA.sql | UTF-8 | 4,024 | 3.6875 | 4 | [] | no_license |
/*
(c) Copyright 2017 WEP Solutions Pvt. Ltd..
All rights reserved
Description : Procedure to Insert the External GSTR1 EXPA Records to the corresponding Staging
Area tables
Written by : Sheshadri.mk@wepdigital.com
Date Who Decription
03/06/2018 Seshadri Initial Version
*/
/* Sample Procedure Call
... | true |
e54e265eb5b4b5d8e82f054cdb763f06762e3356 | SQL | victorhugosrosa/queries | /BI/linha_produto_secao.sql | UTF-8 | 972 | 3.734375 | 4 | [] | no_license | select * from BI_CAD_GRUPO
SELECT DISTINCT
LP.COD_PRODUTO
,CP.DESCRICAO
,CG.NO_DEPARTAMENTO
,CG.NO_SECAO
FROM
BI_LINHA_PRODUTOS LP LEFT JOIN BI_CAD_GRUPO CG ON LP.COD_SECAO = CG.COD_SECAO AND LP.COD_GRUPO = CG.COD_GRUPO
LEFT JOIN BI_CAD_PRODUTO AS CP ON (LP.COD_PRODUTO = CP.COD_PRODUTO)
WHERE 1 = 1
AND COD_LO... | true |
aa639f809c4e3b6906c2202f125809b216a8a575 | SQL | smileyo/latenight | /data/Unclaimed Unit Analysis - EXT ASSIST.sql | UTF-8 | 1,805 | 4.25 | 4 | [] | no_license | WITH uc_unit_id AS(
WITH uc_viewing_id AS(
WITH viewings_on_calendar AS (
SELECT viewing_id AS "viewing_on_calendar"
FROM dhs.dhs_viewings v
WHERE ((v.hsu_viewing_outcome IS NULL OR v.hsu_viewing_outcome NOT IN ('Cancelled','Reschedule'))
... | true |
65a336636fe84d1e681976047f00053835c84300 | SQL | Jinmore/shopMall | /db.sql | UTF-8 | 12,117 | 3.5625 | 4 | [] | no_license | create database php39;
use php39;
set names utf8;
-- --------------------创建商品表
create table p39_goods(
id mediumint unsigned not null auto_increment comment 'id',
goods_name varchar(150) not null comment '商品名称',
market_price decimal(10,2) not null comment '市场价格',
shop_price decimal(10,2) not null comment '本店价格',
g... | true |
b24816f15a72623be9f0359d36a6d8b6f26e4c4d | SQL | bibliophagist/GreenatomJavaPractise | /second.tasks/src/main/java/second/tasks/select/update/delete/24.sql | UTF-8 | 177 | 3.359375 | 3 | [] | no_license | SELECT sportsman.sportsman_name
FROM public.sportsman sportsman,
(SELECT avg(sportsman.rank) as rank FROM public.sportsman) as average
WHERE sportsman.rank >= average.rank
| true |
bcadbb2dc3cf63ce20055943858368ae407d4c71 | SQL | TACHAI/shiro-study | /init.sql | UTF-8 | 1,643 | 3.640625 | 4 | [] | no_license | -- 权限表 --
CREATE TABLE permission (
pid int(11) NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL DEFAULT '',
url VARCHAR (255) DEFAULT '',
PRIMARY KEY (pid)
)ENGINE = InnoDB DEFAULT CHARSET = utf8;
insert into permission values(1,'add','')
insert into permission values(2,'delete','')
insert into permission ... | true |
69039adc1959bea3bd7bd931a25b2cba8833735e | SQL | CharlotteBones/Msc-Coursework | /DBM/Labsheet-2/Q11.sql | UTF-8 | 349 | 3.109375 | 3 | [] | no_license | -- Q11
-- List the name and status of all suppliers along with the project numbers they have
-- supplied parts to, if any. If a supplier has not supplied a part to any project,
-- then the returned project number for that supplier should be NULL.
select distinct Sname, Status, Jnum from Supplier
left join Supply
on ... | true |
e833914531bbcd2e83be2636e7809901320ff781 | SQL | Livnetata/find-wikipedia-translations | /queries/HebrewRevisionIDCandidates.sql | UTF-8 | 1,506 | 3.9375 | 4 | [
"MIT"
] | permissive | SELECT page, rev6.rev_id AS rev_id, user_text, time, start_time, max_time, time-start_time AS diff
FROM
(SELECT rev3.rev_page AS page, rev4.rev_user_text AS user_text, MAX(rev4.rev_timestamp) AS time, max_time, start_time
FROM
(SELECT rev1.rev_page AS rev_page, rev1.rev_user_text AS rev_user_text, rev2.r... | true |
b732fe80c966ba569b0a09dc7e70688c11e9f1f2 | SQL | olivia-sin/hulahoop | /oldScripts/635478387409230000_User_SelectByEmail.sql | UTF-8 | 624 | 3.65625 | 4 | [] | no_license | CREATE PROCEDURE User_SelectByEmail
(
@emailAddress nvarchar(256)
)
AS
SELECT TOP 1
U.UserId,
U.EmailAddress,
U.FirstName,
U.LastName,
U.PhoneNumber,
M.Password_Hash,
M.Password_Salt,
T.TypeName,
S.IsOnBeach
FROM
dbo.Users U INNER JOIN dbo.Memberships M ON U.UserId = M.UserId
... | true |
eac0b132a8e866a2ff9daa335a0501aa8ae0e8ae | SQL | oceanman17/Coding-Journal | /SQL code/create table.sql | UTF-8 | 24,476 | 3.40625 | 3 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTI... | true |
b723fa997f6b07cc1e293b1174c283fa924126e4 | SQL | saarthak08/SQL-Practice | /aggregate_functions.sql | UTF-8 | 871 | 3.609375 | 4 | [] | no_license | CREATE database if not exists test;
use test;
source book.sql;
select
count(*)
from
books;
select
count(distinct author_lname)
from
books;
select
count(distinct author_fname, author_lname)
from
books;
select
author_fname,
author_lname,
count(*)
from
books
group by
a... | true |
7a9143917d95f66024bc56c53407f6c74576ecf8 | SQL | vinod-designer1/competitive-programming | /HackerEarth/Passport Parking/Backend/db/db.sql | UTF-8 | 508 | 3.609375 | 4 | [] | no_license |
CREATE DATABASE IF NOT EXISTS Calculator;
USE Calculator;
CREATE TABLE IF NOT EXISTS User
(
u_id int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
ip varchar(23) NOT NULL UNIQUE
);
CREATE TABLE IF NOT EXISTS Operations
(
op_id int(20) AUTO_INCREMENT PRIMARY KEY,
u_id int(20) NOT NULL FOREIGN KEY REFERENCES User(u_id... | true |
43f41be25b9c5abf1d5cde12fbbaf50ebb39be1b | SQL | udistrital/reportes-kronos | /spagobi-studio/Kronos/Business Analysis/cdp/querys/financiera.sql | UTF-8 | 1,177 | 3.875 | 4 | [] | no_license |
SELECT * FROM financiera.disponibilidad;
/*
SELECT rub.codigo, rub.nombre,
diapr.valor, dis.numero_disponibilidad, diapr.fuente_financiamiento
FROM financiera.disponibilidad dis
INNER JOIN financiera.disponibilidad_apropiacion diapr
ON dis.id = diapr.disponibilidad
INNER JOIN financiera.apropiacion apr
ON diapr.ap... | true |
6cc3efefd75dc412dcd6a90bd75a7e0e0eb52433 | SQL | sprokushev/Delphi | /MASTER/_DATABASE/Tables/EUL_SUMO_ITEM_USGS.sql | UTF-8 | 534 | 2.703125 | 3 | [] | no_license | /* This object may not be sorted properly in the script due to cirular references. */
--
-- EUL_SUMO_ITEM_USGS (Table)
--
CREATE TABLE MASTER.EUL_SUMO_ITEM_USGS
(
SIU_ID NUMBER(10) NOT NULL,
SIU_TYPE VARCHAR2(10 BYTE),
SIU_SUMO_ID NUMBER(10),
SIU_EXP_ID NUM... | true |
c5092524797672426d16dc4ecf26bb218f756a75 | SQL | Avsievich/myblog | /sql/myblog.sql | UTF-8 | 4,196 | 4.125 | 4 | [] | no_license | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `myblog` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `myblog` ;
-- --------------------... | true |
a8750202315556bb0e779c393bd6d73c3f296c88 | SQL | tomazlunder/artista2 | /artista-db/create_testData_script.sql | UTF-8 | 2,149 | 2.984375 | 3 | [] | no_license |
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=1;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=1;
#SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
USE `artista` ;
INSERT INTO `user` (`name`,`email`,`pwdhash`) VALUES
('Anton Banana', 'anton.banana@mail.com','0... | true |
1aa52302db006b28d14fa98e19b364d48a0c12d1 | SQL | Jaxelr/Minimig | /tests/SampleMigrations/MySql/0002 - Add Three Table.sql | UTF-8 | 115 | 2.5625 | 3 | [
"MIT",
"CC-BY-3.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | create table Three
(
Id int auto_increment,
Name varchar(50) not null,
constraint PK_Three primary key (Id)
);
| true |
2a90e66d7f094247b1dee841ebc3dccfb594f0c5 | SQL | kelleyco2/legacy-custom-gloves | /db/seed.sql | UTF-8 | 570 | 3.0625 | 3 | [] | no_license | CREATE TABLE PRODUCT(
id serial PRIMARY KEY,
glove_size integer,
web_style varchar (30),
hand varchar (30),
info varchar (500)
)
CREATE TABLE CART(
product_id integer references PRODUCT(id),
quantity Varchar(20) NOT NULL DEFAULT(0)
)
CREATE TABLE ORDERS(
id serial primary key,
prod... | true |
3d468a67770b758cfaddc00fc2b40a73c872e74d | SQL | rubenski/oba-mysql | /oba-portal/ddl_003.1_portal_user.sql | UTF-8 | 414 | 2.875 | 3 | [] | no_license | USE obaportal;
DROP TABLE IF EXISTS obaportal.portal_user;
CREATE TABLE `portal_user`
(
id binary(16) NOT NULL PRIMARY KEY,
cognito_user_id varchar(36) NOT NULL,
organization_id binary(16) NOT NULL,
first_login datetime NULL,
created datetime NOT NULL,
UNIQUE (c... | true |
a55e6c992db51fa68da5bf63e6720f27e627d360 | SQL | Gustavo-oficial/DDL | /DDL.sql | UTF-8 | 830 | 3.546875 | 4 | [] | no_license | /*
DDL'S
Banco criado
*/
CREATE DATABASE Album;
USE Album;
CREATE TABLE artista (
IdArtista INT IDENTITY PRIMARY KEY NOT NULL,
Nome VARCHAR(100) NOT NULL,
);
CREATE TABLE estilo (
IdEstilo INT IDENTITY PRIMARY KEY NOT NULL,
Nome VARCHAR(100) NOT NULL,
);
CREATE TABLE usuario (
IdUsuario INT IDENTITY PR... | true |
50990ffa1913899d03bc128c1bd2712cc88d28e1 | SQL | bozhidar-projects/php-09.05.2016 | /Lesson16/8-Joins/8.7-RightJoin.sql | UTF-8 | 144 | 3.390625 | 3 | [] | no_license | #will make the join but it will keep students that doesn't match the condition
select *
from applications right outer join students using(SID)
| true |
f20103b0e7dbfac68f7da3cf5050f69e0cf86926 | SQL | PratikumWebDasar4101/tamod10-maulinashintade | /modul8.sql | UTF-8 | 1,958 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 05 Nov 2018 pada 04.15
-- Versi server: 10.1.34-MariaDB
-- Versi PHP: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... | true |
13294ad10b9c897c14b16f8359e9b242ac528c08 | SQL | diamonddelt/sql | /queries/chapter 1/specifyingRangesOfValues.sql | UTF-8 | 582 | 3.90625 | 4 | [] | no_license | -- Task: Specify a range of values in a query, such as having a date column show dates only from a specific time period
USE AdventureWorksLT2012;
-- The following query gets product information from the product table,
-- and only shows list prices of products that are between 5 and 100 dollars.
-- If the "ListPrice" ... | true |
fd6e693b9e79b1a40d15a3f5b0a1c8f5c7ce3fa0 | SQL | epochtalk/core-pg | /migrations/sqls/20160729025236-user-activity-unique-user-up.sql | UTF-8 | 134 | 2.921875 | 3 | [
"ISC"
] | permissive | DROP INDEX index_user_activity_on_user_id;
CREATE UNIQUE INDEX index_user_activity_on_user_id ON user_activity USING btree (user_id);
| true |
8d522b5e7070c17269d046fdca63cc15052ab455 | SQL | CUBRID/cubrid-testcases | /sql/_13_issues/_17_1h/cases/cbrd_21109.sql | UTF-8 | 642 | 3.40625 | 3 | [
"BSD-3-Clause"
] | permissive | drop table if exists t;
create table t (i int, dtz datetimetz);
-- Below queries expected return error
insert into t values (9, '1996-01-01 00:00:00 AM America/Lima PET');
insert into t values (11, '1996-01-01 00:00:00 AM America/Lima PEST');
insert into t values (1, '1993-12-31 23:59:59 PM America/Lima PET');
... | true |
d0f0f32e5d59d6ced595e5956691581d8a1bc00a | SQL | DmitriPortniagin/orautl | /utlrcmp/utlrcmp.sql | UTF-8 | 35,147 | 3.0625 | 3 | [] | no_license | Rem Copyright (c) 1998, 2004, Oracle. All rights reserved.
Rem
Rem NAME
Rem utlrcmp.sql - Utility package for dependency-based recompilation
Rem of invalid objects sequentially or in parallel.
Rem
Rem DESCRIPTION
Rem This script provides a packaged interface to recompile invalid
Rem... | true |
7ef8c6d6e99de7240c27c4794de784f807b14ae1 | SQL | Carrie-Zhang/purchase-service | /Database/schema.sql | UTF-8 | 1,537 | 3.359375 | 3 | [] | no_license | -- ---
-- Globals
-- ---
-- SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- SET FOREIGN_KEY_CHECKS=0;
-- ---
-- Table 'Purchase'
--
-- ---
DROP DATABASE IF EXISTS bundlin;
--
CREATE DATABASE bundlin;
USE bundlin;
DROP TABLE IF EXISTS purchases;
CREATE TABLE purchases (
id INTEGER NOT NULL AUTO_INCREMENT,
user_i... | true |
65e714034ff307cf310d2d66774ad9305de736c9 | SQL | leelaohu/sqlstudy | /DQL/学完分页查询后的demo.sql | UTF-8 | 2,662 | 4.375 | 4 | [] | no_license | #查询工资最低的员工的last_name,salary
SELECT MIN(salary) FROM employees;
SELECT last_name,salary FROM employees WHERE salary = (
SELECT MIN(salary) FROM employees
);
#查询平均工资最低的部门信息
#1.查询每个部门的平均工资
SELECT AVG(salary),department_id FROM employees GROUP BY department_id;
#2.查询最低的平均工资
SELECT
MIN(ag)
FROM
departments d,
(SE... | true |
896ca04ca06d2ef8349a7a2bdfeb1c00c04f27fa | SQL | sarojaraut/handicraft | /PLSQL/performanceTuning/recipes/creating_optimal_sql.sql | UTF-8 | 10,628 | 3.71875 | 4 | [] | no_license | SQL/PLSQL is like any other programming language in that it can be coded well, coded poorly, and everywhere in between. Most database performance issues are
caused by poorly written SQL statements. Basic SQL coding fundamentals and some techniques to improve performance of
your SQL statements.
select SYS_CONTEXT('USER... | true |
7449427b6c2728cf761d34414e72b0510aa92fcd | SQL | prestodb/presto | /presto-product-tests/src/main/resources/sql-tests/testcases/group-by/runAggregatesWithWherePredicatesAndGroupByOrdinal.sql | UTF-8 | 147 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | -- database: presto; tables: nation; groups: group-by;
select n_regionkey, count(*), sum(n_regionkey) from nation where n_regionkey > 2 group by 1
| true |
55ca0b8ed034678706ced02171008602e9acb55b | SQL | Ildevana/Reserva | /Create.sql | UTF-8 | 2,330 | 3.734375 | 4 | [] | no_license | --CREATE DATABASE ReservasMesas
create table CLIENTE (
Id int not null primary key,
Nome varchar(255) not null,
Email varchar(255) not null,
Telefone varchar(255) not null,
Senha varchar(255) not null
);
CREATE TABLE MESA (
Id int not null primary key,
CapacidadePessoas int not null,
Ocupada boolean not null... | true |
0a77869876fbb9b44e6d908e2683a291fb4b1676 | SQL | SajjadDaneshmand/app-updater-server | /docs/database/database.sql | UTF-8 | 909 | 3.796875 | 4 | [] | no_license | -- create database
CREATE DATABASE IF NOT EXISTS products;
-- use of database
USE products;
-- create tables
CREATE TABLE IF NOT EXISTS applications(
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) UNIQUE NOT NULL,
author VARCHAR(255) NOT NULL,
description TEXT NOT NULL
);
CREATE TABLE IF NOT... | true |
b579363079510b894074a20707a81ef1c564c666 | SQL | yaakovtayeb/similar | /GA SW discrepancies/smart.com.ph.hql.sql | UTF-8 | 1,204 | 3.71875 | 4 | [] | no_license | DROP TABLE yaakovt.smart;
CREATE EXTERNAL TABLE IF NOT EXISTS yaakovt.smart (
site string,
country int,
mobile_rawvisits double,
mobile_visits double,
desktop_rawvisits double,
desktop_visits double,
YEAR int,
MONTH int
) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' LOCATION '... | true |
7cfd775c4a7ee9a4fa81b7ef3d0497a447be9933 | SQL | pjuliano/glowing-waffle | /Data Requests/Regulatory/Product Family Sales by Year Pivot.sql | UTF-8 | 711 | 3.546875 | 4 | [] | no_license | Select
*
From
(Select
Extract(Year From A.Invoicedate) As Year,
A.Part_Product_Family,
Sum(A.Invoiced_Qty) As Units
From
Kd_Sales_Data_Request A
Where
A.Part_Product_Family In ('OCT','EXHEX','GNSIS','PRIMA','RENOV','RESTO','STAGE','TLMAX','ZMAX','TRINX') And
A.Charge_Type = 'Part... | true |
60d8b39e63f0012a8131a560f154b8fc889ae6b5 | SQL | SylarK/HarvardX | /04. cs50w - dataBases (2019)/create.sql | UTF-8 | 2,859 | 4.34375 | 4 | [] | no_license | CREATE TABLE flights (
id SERIAL PRIMARY KEY,
origin VARCHAR NOT NULL,
destination VARCHAR NOT NULL,
duration INTEGER NOT NULL
);
INSERT INTO flights
(origin, destination, duration)
VALUES ('New York', 'Hong Kong', 380);
INSERT INTO flights
(origin, destination, duration)
VALUES ('Le Blanc', 'London... | true |
b0104fb8814ff03c0be847cd80da1ad0647c38cb | SQL | a559927z/doc | /chinahrd-hrbi/hrd-db/procedure/pro_lv3_all_GuanJianRenCai.sql | UTF-8 | 926 | 2.859375 | 3 | [] | no_license | drop procedure if exists pro_lv3_all_GuanJianRenCai;
CREATE PROCEDURE `pro_lv3_all_GuanJianRenCai`(in p_customer_id VARCHAR(32), in p_user_id VARCHAR(32))
top:begin
DECLARE customerId VARCHAR(32) DEFAULT p_customer_id;
DECLARE optUserId VARCHAR(32) DEFAULT p_user_id;
DECLARE startTime TIMESTAMP DEFAULT now(... | true |
452ab04f090d549cb6c7449f14b1a6805d68a663 | SQL | bin892550156/czb-spring-hotfix | /czb-spring-hotfix-demo/doc/创建表脚本.sql | UTF-8 | 1,905 | 3.203125 | 3 | [] | no_license | -- --------------------------------------------------------
-- 主机: 127.0.0.1
-- 服务器版本: 8.0.20 - MySQL Community Server - GPL
-- 服务器操作系统: Win64
-- HeidiSQL 版本: 11.0.0.5919
-- --------------------------------------------------------
/... | true |
ba9af38430af5be77bdfcf1c46cb789a2e71c006 | SQL | kingwang317/it4fun-guam | /cms_core.sql | UTF-8 | 6,023 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- 主機: localhost
-- 建立日期: Feb 02, 2010, 08:39 AM
-- 伺服器版本: 5.1.36
-- PHP 版本: 5.2.11
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- 資料表格式: `sys_config`
--
CREATE TABLE IF NOT EXISTS `sys_config` (
`conf_id` int(11) NOT NULL AUTO_INCREMENT COMMEN... | true |
508e538aad3239a59dec2a035cbe3ab76c1e5478 | SQL | AnalyticsMJ/prf | /db/queries/ocorrencias_por_estado_portipo.sql | UTF-8 | 404 | 3.234375 | 3 | [] | no_license | use prf;
-- localbr.lbrbr = nome da estrada
--
select tmuuf ESTADO
, ttadescricao
,count(ocoid) 'QTD_OCORRENCIA'
from ocorrencia
left join ocorrenciaacidente on ocoid = oacocoid
JOIN tipoacidente on ttacodigo =oacttacodigo
join municipio on tmucodigo = ocomunicipio
join localbr on lbrid = ocolocal
group by tmuu... | true |
8e3d09ed3d457c5e84e41dbf37b27c1af955abb2 | SQL | NickHuey/StockTalk | /data/tweets_by_user.sql | UTF-8 | 1,718 | 4.3125 | 4 | [] | no_license | -- SQLite
SELECT user_id, user_name, screen_name, max(follower_count) as followers, count(distinct tweet_id) as tweet_count
FROM twitter_tweets
group by user_id, user_name, screen_name
order by followers desc, tweet_count desc;
select t2.user_id
, t2.screen_name
, max(t2.follower_count) as followers
, count(distinct ... | true |
d26e5a5b99088a37a87bd8bed07cf40710c56a3b | SQL | murari-goswami/bi | /ETL/DataVirtuality/views/tableau/tableau.management_management_report_okrs.sql | UTF-8 | 2,293 | 4.15625 | 4 | [] | no_license | -- Name: tableau.management_management_report_okrs
-- Created: 2015-04-24 18:20:05
-- Updated: 2015-04-24 18:20:05
create VIEW tableau.management_management_report_okrs
AS
SELECT
okr.year_quarter,
co.new_customers,
co.new_customers + (co.new_customers / okr.working_days_gone * okr.working_days_left) as ne... | true |
324d6ef643bb9008675ca609e1d82d7a710611bd | SQL | bobbywallace/Ed-Fi-Nebraska | /EdFi_Nebraska_Integration/edfi/Tables/CountryCodeType.sql | UTF-8 | 472 | 2.78125 | 3 | [] | no_license | CREATE TABLE [edfi].[CountryCodeType] (
[CountryCodeTypeId] INT IDENTITY (1, 1) NOT NULL,
[CodeValue] NVARCHAR (20) NOT NULL,
[Description] NVARCHAR (200) NOT NULL,
CONSTRAINT [PKCountryCodeType] PRIMARY KEY NONCLUSTERED ([CountryCodeTypeId] ASC) WITH (DATA_COMPRESSION = PAGE)... | true |
576466f6943642cec7c99e273ea53917a3adef38 | SQL | hamayelq/Database-Projects | /Phase 3/Phase3.sql | UTF-8 | 5,397 | 4.15625 | 4 | [] | no_license | --part 1 create view
/* Critical cases, admitted at least 2wice */
CREATE VIEW CriticalCases AS
SELECT SSN as Patient_SSN, First_Name, Last_Name, NumberOfAdmissionsToICU
From Patient Natural Join (
SELECT Patient_SSN, Count(Patient_SSN) as NumberOfAdmissionsToICU
From Admission Natural JOIN (
... | true |
26c9ca26374fad6a8397a2e2bc3cfd80cd6cc8d8 | SQL | rasyahroel/Tugas2_Golang | /mahasiswa.sql | UTF-8 | 5,042 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 25, 2020 at 01:53 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
cfd4226492ceaaa3e7b4826a794605e8542ae8d5 | SQL | demonicinn/laravel | /pms/public/images/files/laravel-nature-2017-10-05-1-59d64f01930ed.sql | UTF-8 | 15,193 | 2.96875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 01, 2017 at 08:20 PM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
7677336f943a79d6935f692a04189af213d38013 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day13/select0841.sql | UTF-8 | 178 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-12T08:41:00Z' AND timestamp<'2017-11-13T08:41:00Z' AND temperature>=36 AND temperature<=68
| true |
7e9acda898d583de7cd2a253f90492950dc7d07d | SQL | BitofTea/academia_de_codigo | /schema.sql | UTF-8 | 1,270 | 4 | 4 | [] | no_license | DROP DATABASE IF EXISTS library;
CREATE DATABASE library;
USE library;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id INTEGER(9) NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(40) NOT NULL,
phone INTEGER(9) NOT NULL,
age INTEGER(3) NOT NULL
);
DROP TABLE IF EXISTS publishers;
CREATE TABLE ... | true |
ef8c585866f85192611dde7cc6ca498c407f46ba | SQL | complitex/flexpay | /sz/etc/sql/update/2008_12_26_3.sql | UTF-8 | 5,247 | 3.15625 | 3 | [] | no_license |
alter table `flexpay_db`.`subsreqvnach` rename to `flexpay_db`.`sz_subsidy_records_tbl`;
alter table `flexpay_db`.`oszn_tbl` rename to `flexpay_db`.`sz_oszns_tbl`;
alter table `flexpay_db`.`characteristic_records_tbl` rename to `flexpay_db`.`sz_characteristic_records_tbl`;
alter table sz_files_tbl
drop inde... | true |
bd8db93456cacbf7d89d5fc3b6f64cc950cba1f9 | SQL | Ysatys-Kytanya/ETNA_PISCINE | /BIGDATA/portig_t/.svn/pristine/bd/bd8db93456cacbf7d89d5fc3b6f64cc950cba1f9.svn-base | UTF-8 | 554 | 2.875 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `bigdata`;
CREATE TABLE `author` (
`tweet_author_id` bigint NOT NULL,
`tweet_author_name` varchar(255),
`tweet_author_screen_name` varchar(255),
`tweet_author_location` varchar(255)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `tweet` (
`tweet_id` bigint NOT NULL,
`twee... | true |
f58344dc94addea6d988495d5296e024c5ff1ec2 | SQL | wjphappy90/JavaEE360 | /docs/03_MySQL数据库/SQL代码/一对多的省市案例.sql | UTF-8 | 973 | 3.875 | 4 | [] | no_license | /*
一对多练习
省和市
*/
# 创建省份表,主键,名字
CREATE TABLE province(
pid INT PRIMARY KEY AUTO_INCREMENT,
pname VARCHAR(20)
);
# 创建城市表,主键,名字,外键
CREATE TABLE city(
cid INT PRIMARY KEY AUTO_INCREMENT,
cname VARCHAR(20),
pid INT
);
# 城市表添加外键约束,外键是pid,主键是省份表的pid
ALTER TABLE city ADD CONSTRAINT FOREIGN KEY fk_city_pid (pid)
R... | true |
5ea1b27630173ed368e958186f4e5acd9e7425d8 | SQL | ipalis/MyTestProject | /Homework/Lesson4/Scripts/Story1.sql | UTF-8 | 475 | 3.375 | 3 | [] | no_license | #Story 1:
SELECT f.flightNumber, f.departureAirport, f.arrivalAirport, f.averageTicketPrice, f.availableSeats, l.airline, l.additionalSpaceService, p.priorityBoarding
FROM flights AS f
JOIN airlines AS l
ON f.flightNumber = l.flightNumber
JOIN airports AS p
ON f.departureAirport = p.airport
WHERE departureAirport = 'L... | true |
34c9c1675c3905f5d43d23a7c9e3aa747e7a1d36 | SQL | doltuss/PhpSimple | /phpprojectbase.sql | UTF-8 | 1,636 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Czas generowania: 08 Maj 2017, 03:31
-- Wersja serwera: 10.1.19-MariaDB
-- Wersja PHP: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT *... | true |
8a47d0a2de5577963ef89c209ff0e685f75d6009 | SQL | zenghuapei/hospital | /数据库/hospital.sql | UTF-8 | 12,956 | 3.171875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 50540
Source Host : localhost:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50540
File Encoding : 65001
Date: 2016-04-19 20:51:52
*/
SET FOREIGN_KEY_CHECKS=0;
-- --------... | true |
2829f018dd7d3ad5fd8a16872fc423a889a9406c | SQL | gdiccini/trybe-exercises | /bloco22/22.3/exercicio3.sql | UTF-8 | 235 | 3.390625 | 3 | [] | no_license | CREATE VIEW address_info AS
SELECT
A.address_id, A.address, A.district, C.city_id, C.city
FROM
sakila.address AS A
INNER JOIN
sakila.city AS C ON A.city_id = C.city_id
ORDER BY C.city;
SELECT * FROM address_info;
| true |
84e481d9d86a45e7d9861dd4eecd528848991b75 | SQL | ReneNyffenegger/Oracle-INFORMATION_SCHEMA | /routines.sql | UTF-8 | 2,424 | 3.046875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | create or replace view information_schema.routines as
select
sys_context('userenv', 'DB_NAME') routine_catalog,
sys_context('userenv', 'DB_NAME') specific_catalog,
ap.owner ... | true |
7e7b5a8bda7e7748bcbd102857c805bfa8a0ed50 | SQL | spoonser/Tournament-Website---Database-Project | /database/DML.sql | UTF-8 | 9,298 | 4.59375 | 5 | [] | no_license | -- Select all Fighters and their Weapon. If the Fighter has NULL as a Weapon, populates with 'No Weapon' to be more readable.
SELECT f.fighterName, f.fighterID, (IFNULL(w.weaponName, 'No Weapon')) as `weapon` FROM Fighters as f
LEFT JOIN Weapons as w
on f.weaponID=w.weaponID
ORDER BY f.fighterN... | true |
9d91235031d4008fc9c5087ed51a653c953298da | SQL | YingjingYe/DataAndSQL | /sql1.sql | UTF-8 | 2,957 | 4.125 | 4 | [] | no_license | -- Step 4a (1)
select b.business_name as 'Hospital Name', a.license_beds as 'Total License Beds', a.bed_id
from bed_fact a left join business b on a.ims_org_id = b.ims_org_id
where bed_id = 4 or bed_id = 15
order by license_beds desc
limit 10;
-- Step 4a (2)
select b.business_name as 'Hospital Name', a.census_beds as ... | true |
a438f5430fd12b2bd457e8bfbb4111f326bfe287 | SQL | erwinmacaraig/perl-cig-prj | /db_setup/tblLanguages.sql | UTF-8 | 406 | 2.875 | 3 | [] | no_license | DROP TABLE IF EXISTS tblLanguages;
CREATE TABLE tblLanguages (
intLanguageID int(11) NOT NULL AUTO_INCREMENT,
intRealmID INT NOT NULL,
intSubRealmID INT NOT NULL,
strName varchar(100) DEFAULT '',
strNameLocal varchar(100) DEFAULT '',
strLocale VARCHAR(10) DEFAULT '',
intNonLatin TINYINT DEFAULT 0,
PRIM... | true |
7c32c131d1542b37632d549c36f9ac3ab9244749 | SQL | radtek/abs3 | /sql/mmfo/bars/ForeignKey/social_agency_acctypes.sql | UTF-8 | 1,402 | 3.03125 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/Bars/ForeignKey/SOCIAL_AGENCY_ACCTYPES.sql ======
PROMPT =====================================================================================
PROMPT *** Create constrain... | true |
b7e58df91be1293282b7019223af0120b6a0c301 | SQL | simonardejr/vk | /arquivos/dump.sql | UTF-8 | 1,362 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Banco de dados: `db_de_teste`
--
CREATE DATABASE IF NOT EXISTS `db_de_teste` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci... | true |
3a89cf401561419d7543f001de8f64912fc90139 | SQL | bitraf/p2k16 | /migrations/V001.014__event.sql | UTF-8 | 655 | 3.046875 | 3 | [
"MIT"
] | permissive | DROP TABLE IF EXISTS event;
CREATE TABLE event (
id BIGSERIAL NOT NULL PRIMARY KEY,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
created_by BIGINT NOT NULL REFERENCES account,
domain VARCHAR NOT NULL,
int1 INTEGER,
int2 INTEGER,
... | true |
796c8d9c596e49955b86a08b17abce33e977d083 | SQL | renzaldrin01/nadarang.github.io | /products.sql | UTF-8 | 2,534 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 09, 2018 at 03:04 AM
-- Server version: 10.1.33-MariaDB
-- PHP Version: 7.2.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
d8f5737ab96c0716c6ad82139414a7959eed1728 | SQL | umrashid/QuizMe | /Database/TableCreation/ScoreCategory.sql | UTF-8 | 356 | 3.796875 | 4 | [] | no_license | Create Table scoreCategory (
scoreID int NOT NULL AUTO_INCREMENT,
userID varchar(255) NOT NULL,
score int(10) NOT NULL,
categoryID int(10) NOT NULL,
UNIQUE(scoreID),
PRIMARY KEY(scoreID, userID),
Index(scoreID),
Foreign Key (categoryID) References categories(categoryID),
Foreign Key ... | true |
8643e1363d04daed125ae2b1b095ec36168d82ba | SQL | jblomer/voronoi-webapp | /whois-schema.sql | UTF-8 | 151 | 2.640625 | 3 | [] | no_license | drop table if exists subnets;
create table subnets (
id integer primary key autoincrement,
subnet string not null,
lon integer,
lat integer
);
| true |
541f26e287776cc94eaf16967abacbd91472f33d | SQL | InnoZ/Bikesharing | /data_import/create_empty_tables.sql | UTF-8 | 910 | 3.09375 | 3 | [] | no_license | --tables: create relevant tables
DROP TABLE IF EXISTS bikesharing.stations;
CREATE TABLE bikesharing.stations
(
provider varchar,
city varchar,
station_id integer,
station_name varchar,
latitude numeric,
longitude numeric,
vehicle_type varchar,
from_movements boolean
)
;
DROP TABLE ... | true |
71e216f39d57d4457e6dc4703eeb34a0319a4c7f | SQL | JonathanRH07/Control-de-versiones | /DB ICAAVweb/Suite_mig_demo/Stored_Procedures/sp_dash_administrador_contenido_usuarios_ult_conexion_c.sql | UTF-8 | 2,366 | 3.453125 | 3 | [] | no_license | DELIMITER $$
CREATE DEFINER=`root`@`%` PROCEDURE `sp_dash_administrador_contenido_usuarios_ult_conexion_c`(
IN pr_id_grupo_empresa INT,
IN pr_ini_pag INT,
IN pr_fin_pag INT,
OUT pr_rows_tot_table INT,
OUT pr_message VARCHAR(500)
)
BEGIN
/*
@nombre: sp_dash_administrador_conte... | true |
8a4ecd3b74972d7840f83dcf51614de551e66e07 | SQL | fedormoore/GeekBrains | /Level7/Lesson7/ms-product/src/main/resources/db/migration/V1__init.sql | UTF-8 | 693 | 2.796875 | 3 | [] | no_license | create table products(
id bigserial primary key,
title varchar(255),
price int,
created_at timestamp default current_timestamp,
updated_at timestamp default current_timestamp
);
insert into products (title, price)
values ('Молоко', 82),
('Яйцо', 100),
('Колбаса', 480),
('Сосиски', 180),
('Х... | true |
1f0faf930e90455731db977a0a0712e5df3bbd10 | SQL | FSM-Systems/FSM-Erp | /sql/db.sql | UTF-8 | 26,579 | 2.734375 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.2
-- Dumped by pg_dump version 9.6.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min... | true |
92ab78274bd68666258fb73cafd673019347ceab | SQL | Aleksandyr/Software-University | /Homeworks/Database/04.SQLIntoduction/17.EmpTop5Salarys.sql | UTF-8 | 89 | 2.71875 | 3 | [] | no_license | SELECT TOP (5) e.FirstName, e.LastName, e.Salary FROM Employees e
ORDER BY e.Salary DESC | true |
c512f9aab9fbe861af5f5732181bee5a93adfcb3 | SQL | gregouz66/ppe2 | /info/shop.sql | UTF-8 | 27,993 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Mer 02 Mai 2018 à 09:10
-- Version du serveur : 5.7.11
-- Version de PHP : 5.6.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET... | true |
f64f9eadc80294f586f5cc88ceda0096c572ac44 | SQL | mcrobertw/codigosvarios | /Oracle_estructurasencillatrigger.sql | UTF-8 | 480 | 2.625 | 3 | [] | no_license | --TABLA
create table PAGO
(
IDPAGO INTEGER not null,
IDPRESTAMO INTEGER,
FECHAPAGO DATE,
VALORPAGO NUMBER(10,2),
SALDOPENDIENTEDEUDA NUMBER(10,2),
constraint PK_PAGO primary key (IDPAGO)
);
--TRIGGER
CREATE OR REPLACE TRIGGER TR_PAGO --EN ... | true |
fb8ac3616d055a6c8413b6e205cde24798c360dc | SQL | meet-jethva/ERPofChemicalIndustry | /printreports(Final)/printreports/queries for cwsr/queries with no vaiables/qry_2.sql | UTF-8 | 640 | 3.875 | 4 | [] | no_license | drop table chloritech_d.dbo.rcpt2
select ti.category ,SUM(iss.recpt)as rcpt ,SUM(iss.ov)as opening ,SUM(iss.issued)as issue , SUM(iss.ov)+SUM(iss.recpt)-SUM(iss.issued) as closing
into chloritech_d.dbo.rcpt2
from chloritech_d.dbo.tblitemmaster ti ,
(select t2.ov,t2.recpt,t2.id,qtyissue*t2.f_rate as issued
from... | true |
4e0a20a7bc33c8f5fbc2396b6546f3c808c9e073 | SQL | md-prog/Go-rmd-svr | /sql/test_db_backup.sql | UTF-8 | 72,907 | 2.796875 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 9.4.5
-- Dumped by pg_dump version 9.6.2
-- Started on 2017-03-15 09:32:06 EDT
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_... | true |
092742a2dba00076ab3443c8e7565b08f18de69d | SQL | Refaat-alktifan/sql-cheat-sheet | /joins.sql | UTF-8 | 1,817 | 3.734375 | 4 | [] | no_license |
-- creating basic stuff to work on them
create database cheatsheet;
use cheatsheet;
create table student
(
eid int primary key,
fname varchar(20),
lname varchar(20),
salary real,
joindate date,
class varchar(10),
gender char
);
create table project
(
pid int primary key,
eid int,
... | true |
b946fbabb949a434573ac47c8f764cf45f6777e7 | SQL | po9357/MyStudy | /DataBase/Oracle/20_database/02_MYSTUDY~CRUD/02_DDL_CREATE.sql | UHC | 6,955 | 4.3125 | 4 | [] | no_license | /************************************************************
Ǿ
- DDL (Data Dfinition Language) : ϴ
- CREATE (), DROP (), ALTER()
- { } ݺ , [ ] , | Ǵ ()
CREATE TABLE ̺ (
{÷ Ÿ
[ NOT NULL | UNIQUE | DEFAULT ⺻ | CHECK üũ ]
}
[ PRIMARY KEY ÷ ] ... | true |
9a88b5ea9a655d4ef4ecfcdb6c3430fcb1f0562d | SQL | wikimedia/analytics-data-warehouse | /scripts/test-user-dimension.sql | UTF-8 | 2,636 | 2.921875 | 3 | [] | no_license | -- user dimension matches source user table
select count(*) as enwiki_users_that_should_be_bots
from warehouse.user
where user_id in (
select ug_user
from enwiki.user_groups
where ug_group = 'bot'
)
and wiki = 'enwiki'
and in_bot_user_group = 0
;
select count(*) as... | true |
eeef25c56d3bd99f057a933908d9892fa2248a07 | SQL | rohailkhan/Data-Warehousing | /Assessment 02/solution/createDW.sql | UTF-8 | 2,881 | 3.390625 | 3 | [] | no_license | --------------------------------------------------------
-- Removing any existing tables from Data Warehouse
--------------------------------------------------------
DROP TABLE w_facts;
DROP TABLE d_customers;
DROP TABLE d_products;
DROP TABLE d_stores;
DROP TABLE d_suppliers;
DROP TABLE d_time;
---------------------... | true |
80d17dd9595aae1fcb1eb1c25366ce040aa0cfa8 | SQL | gpipperr/OraDBASQLScripts | /profile.sql | UTF-8 | 1,115 | 3.296875 | 3 | [] | no_license | --==============================================================================
-- GPI - Gunther Pippèrr
-- Desc: get the profiles of the database
-- Date: September 2013
--
--==============================================================================
set linesize 130 pagesize 300
define USER_NAME = &1
colu... | true |
70d0dd7558a08a365e8c376ad615f130a474091e | SQL | FTS152/moontalk | /404412081.sql | UTF-8 | 2,318 | 3.40625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- 主機: student_mysql
-- 產生時間: 2018 年 02 月 05 日 03:23
-- 伺服器版本: 5.7.17-log
-- PHP 版本: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA... | true |
aab1afa29a3bbcb2a154db8c9991e164a768b632 | SQL | madhurivaishnav/SALTWEB | /SALT_NewDesign/Database/Procedure/dbo.prcClassification_GetType.PRC | UTF-8 | 905 | 3.515625 | 4 | [] | no_license | SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[prcClassification_GetType]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
/*
Summary: Gets a list of Classification Types for an Organisation
Parameters: OrganisationID
R... | true |
1a1f33e23438fd815214b830730d0468c8da69ed | SQL | fleetmack/mines | /me/Major Gifts/peter/mcs_gold_platinum_diamond_20051028.sql | UTF-8 | 323 | 2.890625 | 3 | [] | no_license | /*** MSC Members for Gold, Platinum, and Diamond ***/
select decode(cs_gold,'1','Gold'),
decode(cs_diamond,'1','Diamond'),
decode(cs_platinum,'1','Platinum')
from a_dw_gift_clubs g,
a_dw_address_good a
where a.id_number = g.id_number
and (cs_gold = '1'
or cs_platinum = '1'
or cs_diamond = '... | true |
4b09225c07e36824bca1183ca0be0d5419576882 | SQL | warncke/immutable-commerce | /sql/immutable/01-product.sql | UTF-8 | 431 | 2.625 | 3 | [
"MIT"
] | permissive | CREATE TABLE `product` (
`productId` binary(16) NOT NULL,
`originalProductId` binary(16) NOT NULL,
`parentProductId` binary(16) DEFAULT NULL,
`sessionId` binary(16) NOT NULL,
`productData` mediumtext NOT NULL,
`productCreateTime` datetime(6) NOT NULL,
PRIMARY KEY (`productId`),
UNIQUE KEY `parentProduct... | true |
a8bb6689cf6d5bca4f998ebc5b62122754a3f64a | SQL | Jennaz/Hackrrank-SQL-solutions | /basic_select_challenges/Employee_Salaries.sql | UTF-8 | 88 | 2.734375 | 3 | [] | no_license | SELECT name FROM employee
where months <10 and salary >2000
ORDER BY employee_id ASC; | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.