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
d1a9b630b7667becfe64ef7e66516cbd9902bc40
SQL
rocketeerbkw/DNA
/Release/Source/Databases/The Guide/storedprocedures/numberinindex.sql
UTF-8
350
3.46875
3
[]
no_license
CREATE PROCEDURE numberinindex @char varchar(4) AS SELECT @char = LEFT(@char,1) IF @char >= 'a' AND @char <= 'z' SELECT 'ArticleCount' = COUNT(*) FROM GuideEntries WHERE LEFT(Subject,1) = @char AND Status IN (1,3,4) ELSE SELECT 'ArticleCount' = COUNT(*) FROM GuideEntries WHERE LEFT(Subject,1) LIKE '[^a-z]'...
true
ce9b761c4a3e51c2c118c24857e18e872b3484dd
SQL
eastxiang/easy555-main
/uc-dao/src/main/sql/schema/init-system-schema.sql
UTF-8
6,975
3.4375
3
[]
no_license
-- 如果复制到mysql中执行时 加上 -- DELIMITER ; -- 组织机构、用户、角色 drop table if exists sys_organization; drop table if exists sys_user; drop table if exists sys_role; -- 应用、资源、菜单 drop table if exists sys_application; drop table if exists sys_resource; drop table if exists sys_menu; -- 角色资源权限、用户角色列表、用户授权信息 drop table if exists sys_r...
true
c1d3ddbc2293d693481ba1809131ce2f7a005305
SQL
luongngoc2194/T2104E
/Database/ChoThueXe.sql
UTF-8
10,713
3.28125
3
[]
no_license
create table NhaCungCap( MaNhaCC nchar(20) primary key, TenNhaCC nvarchar(100) not null unique, DiaChi nvarchar(255) not null, SoDT nchar(20) not null unique, MaSoThue nchar(20) not null unique ); create table LoaiDichVu( MaLoaiDV nchar(20) primary key, TenLoaiDV nvarchar(100) not null unique ); create table ...
true
3a152898de276727f00cf762960239338a914380
SQL
anonyarras/ppdb_online
/db/ppdb.sql
UTF-8
17,193
2.796875
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Mar 17, 2021 at 05:27 PM -- 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
9150263e88cc18b8058e19e20995e0eae35208b0
SQL
ReneNyffenegger/about-MSSQL
/administration/system-databases/msdb/tables/sysjobactivity/select.sql
UTF-8
1,224
3.625
4
[]
no_license
select * from ( select -- job.job_id, job.name job_name, act.run_requested_date, -- run_requested_source, ----------------------------------------------------- case act.run_requested_source when 1 then 'scheduler' when 2 then 'aler...
true
7ff57bee4d11167f43ba6ba76ed10f8cc4fbc9ed
SQL
JonFillip/sql_databases
/mining_text/formating_text.sql
UTF-8
7,326
4.3125
4
[]
no_license
-- Text data exists in structured and semi-structured and occassionally one might need extract data, quantify data -- from speeches, reports, press releases and other documents. -- FORMATTING TEXT USING STRINGS FUNCTIONS -- CASE FORMATTING SELECT UPPER('string'); -- Returns a capitalized version of the string SELECT ...
true
03b47cfa6a318d8255acf83ce9a3f96d4c4eb44e
SQL
fulldb/Oracle
/Oracle_DBA_monitoring_scripts_Luca_Canali_ver_June2015/top_10g.sql
UTF-8
1,267
3.4375
3
[]
no_license
-- Top.sql: prints details of active sessions -- Usage: @top, run a few times on to see dynamics of active sessions -- Luca Canali 2002, last updated and customized for 10g Feb 2011 col username for a21 col service for a19 col "User@Term" for a10 col program for a22 col inst_sid_serial# for a12 col seq for a...
true
1e494c34096b33513b7987b2054bcdcd60fd333f
SQL
pwidders/burger-time
/db/schema.sql
UTF-8
257
2.640625
3
[]
no_license
DROP DATABASE IF EXISTS burgers_db; CREATE DATABASE burgers_db DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; USE burgers_db; CREATE TABLE burgers ( id INT AUTO_INCREMENT PRIMARY KEY, burger_name VARCHAR (100), devoured BOOLEAN );
true
d9141ff52c67c7448f2ebc7f75d69d822c0c4dbf
SQL
Fakorede/videotube
/videotube.sql
UTF-8
7,171
3.171875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: May 10, 2019 at 07:51 PM -- Server version: 10.1.10-MariaDB -- PHP Version: 7.0.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI...
true
f6be05b3c297b64f2ab76ae3e1ba24ed234fd03e
SQL
meggsimum/sauber-sdi-docker
/db/update-files.d/007_create_pg_cron_jobs.sql
UTF-8
1,173
3.640625
4
[ "MIT" ]
permissive
\c sauber_data CREATE EXTENSION IF NOT EXISTS pg_cron; /* Check a if a specific query exists in pg_cron, else create it. Prevents jobs stack up on every deployment w/o adding a unique constraint on table cron.job (with unkown results). To add queries, alter cols 1 and 2 (cron schedule and query). */ -- Refresh st...
true
32112a2da20c2fcee6e3a9ddbdc4c3f09376b3a6
SQL
Efficeon/JavaRushTest
/src/resources/InitializationDB.sql
UTF-8
3,330
2.84375
3
[]
no_license
CREATE SCHEMA IF NOT EXISTS test DEFAULT CHARACTER SET utf8; CREATE DATABASE if NOT EXISTS test DEFAULT CHARACTER SET utf8; CREATE TABLE IF NOT EXISTS `test`.`USERS` ( `id` INT(8) AUTO_INCREMENT, `name` VARCHAR(25) NOT NULL , `age` INT NOT NULL, `isAdmin` BIT , `createdDate` TIMESTAMP NOT NULL DEFAULT curr...
true
8584d68e51c41709ca229413079e78bed843e43a
SQL
awgst/project-pendaftaran-sekolah
/daftar_sekolah.sql
UTF-8
1,912
3.15625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 31 Okt 2018 pada 13.48 -- Versi server: 10.1.31-MariaDB -- Versi PHP: 7.2.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARA...
true
41a6100aa772232f7a79e4b3833b7148718c4ff1
SQL
aldiansahm6543/data-siswa
/data_siswa.sql
UTF-8
12,371
3
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 12 Mar 2020 pada 11.16 -- Versi server: 10.1.38-MariaDB -- Versi PHP: 7.3.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARA...
true
3d4b0f9d9bf422f13466d150082b5c226ab207af
SQL
afrin321/SP2
/sql/ap_sys.sql
UTF-8
21,658
2.65625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 25, 2021 at 04:27 AM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.4.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIE...
true
fdc386f6937c6275f5ae6ae239973b230b18fc9a
SQL
AsterixKo/java-spring-boot-backend-apirest-harry-potter
/src/main/resources/import.sql
UTF-8
968
2.640625
3
[]
no_license
/* Populate tabla movies*/ INSERT INTO movies (imdbID, title, year, stars) VALUES('ttaaaaa01', 'Titulo 1', '2001', '1'); INSERT INTO movies (imdbID, title, year, stars) VALUES('ttaaaaa02', 'Titulo 2', '2002', '2'); INSERT INTO movies (imdbID, title, year, stars) VALUES('ttaaaaa03', 'Titulo 3', '2003', '3'); INSERT INTO...
true
9efadc768064dfcce23d1ca5a0029636d280d4db
SQL
IngFabianRodriguez/AplicacionWebCalle90
/Calle90/bd.sql
UTF-8
13,965
2.90625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 29-04-2017 a las 00:22:06 -- Versión del servidor: 10.1.21-MariaDB -- Versión de PHP: 7.1.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLI...
true
c425d23a5cd397aad65bd58fc88d17b450bc3088
SQL
DaniRAlmanza/MTIE_dara615342
/volumes/logstash/config/queries/world.sql
UTF-8
365
2.796875
3
[]
no_license
SELECT C.`Code`, C.`Name`, C.Continent, C.Region, C.SurfaceArea, C.IndepYear, C.Population, C.LifeExpectancy, C.GNP, C.GNPOld, C.LocalName, C.GovernmentForm, C.HeadOfState, C.Capital, C.Code2, L.`Language`, L.IsOfficial, L.Percentage FROM world.country AS C INNER JOIN world.country...
true
92441ad15569032f56e780cad7735ff91b22b155
SQL
r99r99r99/shdb
/db/table/aiot/maintain/aiot_maintain.sql
UTF-8
926
2.984375
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50625 Source Host : localhost:3306 Source Database : liaoheocean Target Server Type : MYSQL Target Server Version : 50625 File Encoding : 65001 Date: 2018-05-25 08:46:51 */ SET FOREIGN_KEY_CHECKS=0; ...
true
8a0d8f079963ff31e370e23ad3c2390c8b865136
SQL
jgarzonext/packages
/paquete body/PAC_MD_CTACLIENTE.sql
ISO-8859-3
57,148
2.9375
3
[]
no_license
-------------------------------------------------------- -- DDL for Package Body PAC_MD_CTACLIENTE -------------------------------------------------------- CREATE OR REPLACE EDITIONABLE PACKAGE BODY "AXIS"."PAC_MD_CTACLIENTE" AS /***************************************************************************** NAME: ...
true
cbba54ff87b2a425731ad03e4ec54f75c048dc3a
SQL
lining041038/zrt
/src/main/resource/bapdbdeploy/mysql/020_系统初始化脚本.sql
UTF-8
28,574
3
3
[]
no_license
/* 当前初始化脚本截至sqlserver脚本的第020个文件 */ CREATE TABLE WORKITEMINFO (WORKITEMID bigint(20), CREATIONDATE datetime, NAME varchar(255), PROCESSINSTANCEID bigint(20) NOT NULL, STATE bigint(20) NOT NULL, OPTLOCK int(11), WORKITEMBYTEARRAY blob); CREATE TABLE TMP_SYS_USER_UNIT_RELATE (usersid varchar(36) NOT NULL, unitsid varc...
true
f51b8788017ac71e1f206dd0a53faa235c7f8350
SQL
LuyeT/Fantasy_Taverns-mysql
/queries/assignment5/1.sql
UTF-8
213
3.328125
3
[]
no_license
-- 1. Write a query to return a “report” of all users and their roles SELECT ur.UserID,name,dateOfBirth,roleName FROM UserRoles ur JOIN Users ON ur.userID = Users.UserID JOIN Roles ON ur.roleID = Roles.RoleID
true
8a48301d57c60f561d298f51ef914c080e420d8a
SQL
jacksondouglasti/ordering-backend
/src/main/resources/data-h2.sql
UTF-8
4,505
2.5625
3
[]
no_license
INSERT INTO CATEGORY (ID, NAME) VALUES (1, 'Informática'); INSERT INTO CATEGORY (ID, NAME) VALUES (2, 'Escritório'); INSERT INTO CATEGORY (ID, NAME) VALUES (3, 'Cama mesa e banho'); INSERT INTO CATEGORY (ID, NAME) VALUES (4, 'Eletrônicos'); INSERT INTO CATEGORY (ID, NAME) VALUES (5, 'Jardinagem'); INSERT INTO CATEGORY ...
true
247d43b54163ffc1e865bbd74b850b647ec2595d
SQL
KHNafiulIslam/Inventory_project
/invertory_db.sql
UTF-8
3,171
3
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 12, 2021 at 12:38 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIEN...
true
c7cd6ecad27a735e9c7e09bb58fed53f2566397a
SQL
opengauss-mirror/openGauss-server
/src/test/regress/sql/alter_table_002.sql
UTF-8
19,032
3.796875
4
[ "LicenseRef-scancode-mulanpsl-2.0-en", "LicenseRef-scancode-unknown-license-reference", "PostgreSQL", "BSD-3-Clause", "LGPL-2.0-or-later", "LicenseRef-scancode-unicode", "LicenseRef-scancode-warranty-disclaimer", "curl", "GPL-1.0-or-later", "LGPL-2.1-or-later", "LGPL-2.1-only", "CC-BY-4.0", ...
permissive
-- --FOR BLACKLIST FEATURE: REFERENCES/INHERITS/WITH OIDS/RULE/CREATE TYPE/DOMAIN is not supported. -- -- test check constraint adding create table atacc1 ( test int ); -- add a check constraint alter table atacc1 add constraint atacc_test1 check (test>3); -- should fail insert into atacc1 (test) values (2); -- should...
true
c93018bff5b982d93a5faba7d4a53e198677825f
SQL
rpmshuvo/article-crud
/article-crud.sql
UTF-8
12,127
3.109375
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 11, 2020 at 04:34 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
7c8cfb007909f82e7641c82a1c681dd75c9f057c
SQL
heplayskeys/BAMAZON
/bamazon_schema.sql
UTF-8
2,999
3.78125
4
[]
no_license
CREATE DATABASE bamazon; USE bamazon; CREATE TABLE products ( item_id INT AUTO_INCREMENT PRIMARY KEY, product_name VARCHAR(150) NOT NULL, department_name VARCHAR(100), price DECIMAL(10,2), stock_quantity INT ); INSERT INTO products SET product_name = "Travel Mug (24oz)", department_name = "Household"...
true
cc06cdffcb538b767daa5d4f48227f24dcd2d2cd
SQL
Ondevilla/Halcyon-ELearning
/HALCYON UPDATE/hmhs_elearning_v2.sql
UTF-8
19,354
3.375
3
[]
no_license
/* SQLyog Ultimate - MySQL GUI v8.2 MySQL - 5.1.42-community : Database - hmhs_elearning ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD...
true
3d4cb78bf7caa3e73f73bdbfbb2e99f8d40c0bf0
SQL
castaway/Locale-Object
/locale.sql
UTF-8
136,770
2.859375
3
[ "CC0-1.0", "LicenseRef-scancode-public-domain" ]
permissive
PRAGMA foreign_keys=on; BEGIN TRANSACTION; CREATE TABLE country ( code_alpha2 char(2), code_alpha3 char(3), code_numeric char(5), name char(100), dialing_code smallint, PRIMARY KEY (code_alpha2) ); INSERT INTO country VALUES('ad','...
true
5f59d2b531d6747ae4b523fd3e82c3741c2d4612
SQL
diogocapela/isep-bddad
/report03/Exercício 05.sql
UTF-8
2,738
3.703125
4
[ "MIT" ]
permissive
-- Procedure create or replace procedure proc_tratar_nota_encomenda(p_cod_nota_encomenda NotaEncomenda.cod_nota_encomenda%type) is parametro_invalido_exception exception; quantidade_invalida_exception exception; nota_encomenda_count number; codArtigo NotaEncomenda_Zona_Artigo.cod_artigo%type; cod...
true
960a3295090866bae60fb3f524272c224845283a
SQL
srini-nathan/backend-nft
/prisma/migrations/20210628122001_included_asset_index/migration.sql
UTF-8
1,058
3.40625
3
[]
no_license
/* Warnings: - You are about to drop the column `isMinted` on the `Ipfs` table. All the data in the column will be lost. - You are about to drop the column `isAssetReady` on the `Ipfs` table. All the data in the column will be lost. - Added the required column `assetIndex` to the `Ipfs` table without a default...
true
b84853c60b45e4b0fa31fe7deff9447293e082dc
SQL
DiegoRodriguezTandil/dolibarr_customs
/htdocs/install/mysql/migration/2.0.0-2.1.0.sql
UTF-8
55,326
3.015625
3
[]
no_license
-- -- Attention a l ordre des requetes. -- Ce fichier doit etre charge sur une version 2.0.0 -- sans AUCUNE erreur ni warning -- create table llx_paiementfourn_facturefourn ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_paiementfourn INT(11) DEFAULT NULL, fk_facturefourn INT(11) DEFAULT NULL, amount DOUBLE D...
true
3ff78392e00afca256d4a9c212c15be2f7ff2248
SQL
pbha310/SQL
/Questions/Pbha310A2.sql
UTF-8
3,181
4.3125
4
[]
no_license
/*1 */ Select "Prachi" as FirstName ,"Sethi" as LastName, "Female" as Gender, "Tutor" as Role, "Friendly tutor and very approachable" as Short_Description; /*2 */ select * from artist where (artistID % 17) = 0; /*3 */ select address|| ", " ||city|| ", "||country Full_Address from customer Order by length(Full_Addre...
true
b13cc619d2248c9f4145bf6fa944eba39203eb4c
SQL
glsystem/apiRestOpe
/dbBackup.sql
UTF-8
3,364
3.0625
3
[]
no_license
-- MySQL dump 10.13 Distrib 8.0.16, for macos10.14 (x86_64) -- -- Host: localhost Database: OPE -- ------------------------------------------------------ -- Server version 8.0.16 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*...
true
8fc4b77b9cb5a2b85c54f4e41ec8f16fa5d07361
SQL
idhammubarok/sewa_mobil_sederhana
/sewa_mobil.sql
UTF-8
2,399
3.125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 17, 2020 at 11:02 AM -- Server version: 10.4.8-MariaDB -- PHP Version: 7.3.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
true
9afd6fb106eb4c3196fb9edfc1cb83044314095e
SQL
AndreiIvanou/active-directory-angularjs-singlepageapp-dotnet-webapi
/SQLQuery4.sql
UTF-8
235
2.578125
3
[ "MIT" ]
permissive
SELECT SUSER_SNAME() + (CASE IS_MEMBER('ANIVN_AzureADSQLUsers') WHEN 1 THEN ' Is a Member of ANIVN_AzureADSQLUsers' ELSE ' Is Not a Member of ANIVN_AzureADSQLUsers' END) --CREATE USER [ANIVN_AzureADSQLUsers] FROM EXTERNAL PROVIDER;
true
a0feed9c91dd8c6b7dd6e0b713e21697e5e429ed
SQL
Jonathanbustos15/SISEP
/Script/Requerimiento_19/funcionario.sql
UTF-8
2,419
3.046875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 20-06-2019 a las 18:49:52 -- Versión del servidor: 10.1.38-MariaDB -- Versión de PHP: 5.6.40 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00";...
true
a2129eaa52c503eb2b48ecf3d1130b8485750c87
SQL
VijayMVC/JCC-Data-Warehouse
/SQLDB/dbo/Views/AA_SL_TRANSACTION_THREESIXTY_HEADER_VIEW.sql
UTF-8
477
3.03125
3
[]
no_license
create view AA_SL_TRANSACTION_THREESIXTY_HEADER_VIEW /* ** Returns transaction header information to be used by the Three Sixty enquiry. ** ** Written: 22/09/2005 SH ** Last Amended: */ as select S.ST_PRIMARY as [PRIMARY], S.ST_TRANTYPE, isnull(S.ST_HEADER_REF,'') as ST_HEADER_REF, S.ST_DATE, S.ST_G...
true
fea2c32329ba531696944dd60245aa53f59492e9
SQL
zhangzhongyu/Ximage
/MySQL/getProducerMapping.sql
UTF-8
383
2.640625
3
[]
no_license
USE core_db; DROP PROCEDURE IF EXISTS getProducerMapping; DELIMITER // CREATE PROCEDURE getProducerMapping ( IN i_ProducerId SMALLINT ) BEGIN SELECT * FROM ProducerMapping WHERE ProducerId = i_ProducerId AND Status = 1; END // DELIMITER ; GRANT EXECUTE ON PROCEDURE getPro...
true
2be84ae839faf00e06131d2d9cef9c454ab5cdb4
SQL
jiangrry/study
/Month2/MySQL/2-4-MySQL-DAY04/hero.sql
UTF-8
2,579
4.4375
4
[]
no_license
-- 数据库高级查询 -- - 创建库:`hero` create database hero charset=utf8; -- - 创建表:`sanguo` -- - 字段:`id name genger county attack defense` -- - 参考数据: -- - `attack > 100` -- - `defence 0 - 100` -- - 魏:曹操 司马懿 夏侯渊 张辽 甄姬 -- - 蜀:刘备 关羽 赵云 诸葛亮 张飞 孙尚香 -- - 吴:周瑜 大乔 小乔 陆逊 吕蒙 use hero; create table sang...
true
a2aef77a179883d05412b1c5a80054b32b3c10d2
SQL
Prabashi/Hackerrank-codes-answers
/sqlCodes.sql
UTF-8
4,930
4.3125
4
[]
no_license
/* Revising the Select Query I */ select * from city where population>100000 and countrycode = 'USA'; /* Revising the Select Query II */ Select name from city where population>120000 and countrycode='USA'; /* Select All */ Select * from city; /* Select By ID */ Select * from city where id=1661; /* Japanese Cities'...
true
0dc867922a889dcf049fcb210675c7e5ea1ab0ef
SQL
oneokstudio/chuangrui-race
/backend/race.sql
UTF-8
1,512
2.921875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.4.13.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: 2015-09-09 08:29:19 -- 服务器版本: 5.6.26 -- PHP Version: 5.5.24 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SE...
true
4059b8a900da6f20c271c583deadd2272a834645
SQL
spring-projects/spring-data-examples
/jdbc/howto/bidirectionalinternal/src/main/resources/schema.sql
UTF-8
176
2.625
3
[ "Apache-2.0" ]
permissive
CREATE TABLE MINION ( ID IDENTITY PRIMARY KEY, NAME VARCHAR(255), ); CREATE TABLE TOY ( MINION BIGINT NOT NULL, NAME VARCHAR(255) );
true
cff1ec972b00d61c17b96f60579f7b1463274eb8
SQL
oral-history-video-archive/digital-archive-processing
/InformediaCORE.Schema/Schema Objects/Schemas/idvl/Tables/Keys/TaskStates.SegmentID.fkey.sql
UTF-8
204
2.734375
3
[]
no_license
-- InformediaCORE Database Schema ALTER TABLE [idvl].[TaskStates] ADD CONSTRAINT [FK_TaskStates_SegmentID] FOREIGN KEY ([SegmentID]) REFERENCES [idvl].[Segments] ([SegmentID]) ON DELETE CASCADE
true
4e59f336b4e4df3b2c3d8f343173c7c38213cbd0
SQL
ontop/ontop-examples
/jair-2017-MTL-datalog/postgresql/standard-sql-alg/mesowest/HurricaneAffectedState.sql
UTF-8
2,836
4.0625
4
[ "Apache-2.0" ]
permissive
WITH HFW AS ( SELECT SID, dFrom, dTo, prevWSpeed, wSpeed FROM (SELECT station_id AS SID, lag(date_time, 1) OVER (PARTITION BY station_id ORDER BY date_time) AS dFrom, date_time AS dTo, lag(wind_speed_set_1, 1) OVER (PARTITION BY station_id ORDER BY date_time) AS prevWSpeed, wind_speed_set_1 AS wSpeed, ROW_NUMBER() OV...
true
6c096b478c095fbbab06dbac63514d836417e998
SQL
johndpope/spy611scripts
/script/ma/lr.sql
UTF-8
2,020
3.265625
3
[]
no_license
-- -- ~/spy611/script/ma/lr.sql -- DROP TABLE IF EXISTS my_out_table_model1; DROP TABLE IF EXISTS my_out_table_model2; DROP TABLE IF EXISTS my_out_table_model3; DROP TABLE IF EXISTS my_out_table_model1_summary; DROP TABLE IF EXISTS my_out_table_model2_summary; DROP TABLE IF EXISTS my_out_table_model3_summary; DROP TAB...
true
9a4179011ae598831f7a1f898d3ae54b86fa75ab
SQL
wildeastengineer/webchange
/resources/sql/queries.sql
UTF-8
2,746
4.09375
4
[]
no_license
-- :name create-user! :<! -- :doc creates a new user record INSERT INTO users (first_name, last_name, email, password, active, created_at, last_login) VALUES (:first_name, :last_name, :email, :password, :active, :created_at, :last_login) RETURNING id -- :name update-user! :! :n -- :doc updates an existing user record ...
true
a333f91c81e1ae2cf172069e117c37f5c5da73b7
SQL
UAMS-DBMI/PosdaTools
/posda/posdatools/queries/sql/WorkItemReport.sql
UTF-8
770
3.203125
3
[ "Apache-2.0" ]
permissive
-- Name: WorkItemReport -- Schema: posda_files -- Columns: ['work_id', 'status', 'status_text', 'operation_name', 'invoking_user', 'since_invoked', 'wait_time', 'since_started', 'duration', 'since_ended'] -- Args: ['work_id'] -- Tags: ['BackgroundStatistics'] -- Description: Get background job statistics -- select ...
true
99d344270d2ff100b72cddfb120dd05878653cb1
SQL
lzxyzq/Cracking_the_Coding_Interview
/Cracking_the_Code_Interview/Leetcode_Database/Medium/1841.League_Statistics.sql
UTF-8
4,428
4.625
5
[]
no_license
Table: Teams +----------------+---------+ | Column Name | Type | +----------------+---------+ | team_id | int | | team_name | varchar | +----------------+---------+ team_id is the primary key for this table. Each row contains information about one team in the league.   Table: Matches +---------...
true
b6a5847042ecb6f146ac943b30e08c8f402f8053
SQL
Daan-Carr/enceustas
/database/ottos_26141815_encuestas.sql
UTF-8
12,675
3.109375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1:33065 -- Tiempo de generación: 08-07-2020 a las 09:05:57 -- Versión del servidor: 10.4.11-MariaDB -- Versión de PHP: 7.4.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET...
true
fcc10d8b12febf683a37f2eb3dc49513bcb501e6
SQL
qawemlilo/lante
/com_otc/admin/sql/updates/mysql/0.0.9.sql
UTF-8
503
3.125
3
[]
no_license
CREATE TABLE IF NOT EXISTS `#__otc_bank` ( `id` int(11) NOT NULL AUTO_INCREMENT, `memberid` int(11) NOT NULL, `account_id` int(13) NOT NULL, `created_by` int(11) NOT NULL, `amount` int(7) NOT NULL, `transaction_type` varchar(8) NOT NULL, `ts` timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY ...
true
3321620f83de69402b6b0853921a7f3252b983ea
SQL
PratikRaut15/speed-elixia-project
/databasescripts/speeddbSP/get_invoice_payment_old.sql
UTF-8
435
3.390625
3
[]
no_license
USE `speed`; DROP procedure IF EXISTS `get_invoice_payment_old`; DELIMITER $$ USE `speed`$$ CREATE PROCEDURE `get_invoice_payment_old`( IN invoiceidParam INT ) BEGIN SELECT i.invoiceid,i.ledgerid,i.customerno,i.tds_amt,ip.payment_amt,ip.payment,i.paymentdate,ip.chequeno,ip.bank_name,ip.branch from invoice i ...
true
bdc26aa42d68cd771da020225d92cdfe550e6d3f
SQL
jcrutchy/exec-irc-bot
/scripts/mud/mysql/schema.sql
UTF-8
459
2.640625
3
[ "Unlicense" ]
permissive
DROP DATABASE IF EXISTS exec_mud; CREATE DATABASE IF NOT EXISTS exec_mud DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE TABLE `exec_mud`.`mud_players` ( `hostname` varchar(100) NOT NULL, `x_coord` integer unsigned NOT NULL, `y_coord` integer unsigned NOT NULL, `deaths` integer unsigned NOT NULL, ...
true
06420a7cf1eae6d6efd4dfbdcd44f09dc4a1c829
SQL
Scienze-in-gioco/website-db-scripts
/fillTables.sql
UTF-8
24,521
2.578125
3
[]
no_license
INSERT INTO Contents VALUES ( 1, "super-bella-gara-cesenatico", "gara super bella a Cesenatico", "la gara si è svolta in data x y z ed è stata bella", "Tizio Caio", 0, 0, DEFAULT ), ( 2, "le-cem-favolose-queens", "Tanto gentile e tanto onesta pare la cem", "Tanto gentile e tanto...
true
2320dbce088a8d6c1bc4104c95a9030e6cf77b2c
SQL
fabianazioti/CAP-349
/src/Consultas_espaciais.sql
UTF-8
1,772
4.0625
4
[]
no_license
-- Os dados estao disponiveis em DADOS_BDG SELECT ST_AsText(ST_Union(geom)) as geom from ba_municipios; -- MUNICIPIOS VIZINHOS A SALVADOR SELECT nome_munic FROM ba_municipios WHERE ST_Touches((SELECT geom FROM ba_municipios WHERE nome_munic = 'Salvador'), geom); -- EM QUAL MUNICIPIO DA BAHIA FOI DETECTADO O MAIOR N...
true
e8382476dac3a51f8f1030bc2f6f157ae8587651
SQL
CUBRID/cubrid-testcases
/sql/_17_sql_extension2/_02_full_test/_03_alter_table/_01_alter_change/cases/alter_change_type_numeric_to_double.sql
UTF-8
780
3.25
3
[ "BSD-3-Clause" ]
permissive
--+ holdcas on; --alter_table_change_type_strict --change the type of a numeric column to double create class coo( col1 numeric(13, 3), col2 numeric(18, 7) ); insert into coo values(7384783821.223, 12345372642.1234567); show columns in coo; d --numeric -> double, old prec <= 15, min(double) < nume...
true
3d16d219e05d37fcdc7fdb3640c6b58b78a10aa3
SQL
Eond/JeRoFa
/OLDSource/Ressources/InitDb.sql
ISO-8859-1
66,464
3.34375
3
[]
no_license
-- ---------------------------------------------------------------------------------------- -- -- Script SQL de cration de la base de donne du projet JeRoFa -- Cr par Jean-Franois Brun et Jean-Michel Beauvais -- En date du 4 novembre 2010 -- -- Dans le cadre du cours Programmation Oriente Objet II -- Professeu...
true
3acdb60f3563e0659c6d3aca9b174bd711cd0c3e
SQL
mdiatan/pmobile
/todolist/todolist.sql
UTF-8
1,633
2.859375
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.0.9 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: May 19, 2015 at 05:52 PM -- Server version: 5.6.14 -- PHP Version: 5.5.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /...
true
ac27e173cd4403ed86d21d0bf2fc0995f1cbb959
SQL
thanhai2312/cart-lavarel
/database/s-cart.sql
UTF-8
101,532
2.953125
3
[]
no_license
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 10.1.28-MariaDB - mariadb.org binary distribution -- Server OS: Win32 -- HeidiSQL Version: 9.5.0.5196 -- ------------------------------------------------...
true
e7e311b0ca320efa0b36c7b7eedd75d3d858f25e
SQL
ErikVestesen/Skole
/DB/Dag8._8.2.sql
UTF-8
1,479
4.09375
4
[]
no_license
drop table item drop table itemnew drop table histprice -- old no history table create table item ( itemno int identity(1,1) primary key, itemname varchar(25), price decimal(7,2) ) insert into item values('pommes frites',17),('small burger',25),('checken nuggets',28),('hot wings',27) -- -- -- new system with history ...
true
55e360aa60bcf5a749822ac3d7463f9421303d3a
SQL
ndaleksey/RolesConfigurator
/Queries/777.sql
UTF-8
238
2.5625
3
[]
no_license
set search_path to 'permission'; select r.name from role r join account a on r.id = a.role_id where a.login = 'avdeev'; select r.name, rp.plugin_name from role r join role_plugin rp on r.id = rp.role_id order by r.name, rp.plugin_name
true
a632f8914eb57d8eafc884d10f5c70256e8c1553
SQL
CurtLH/bokeh
/apartment_temp/query.sql
UTF-8
388
3.609375
4
[]
no_license
SELECT date_trunc('hour', a.datetime) as datetime, ROUND(AVG((a.condition -> 'current_observation' ->> 'temp_f')::numeric), 1) AS outside, ROUND(AVG((b.temp)::numeric), 1) AS inside FROM arlington_weather_condition as a, inside_temp as b WHERE date_trunc('hour', a.datetime) = date_trunc('hour', b.datetime) GROUP BY dat...
true
f7b8fb940ea04ce4ba9b993573d789e43e1c8b3e
SQL
ambrosiora/projetoIntegradorGeo
/scriptsBanco/Versão2/projetointegradorgeo_usuario.sql
UTF-8
2,518
3.15625
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.6.23, for Win64 (x86_64) -- -- Host: localhost Database: projetointegradorgeo -- ------------------------------------------------------ -- Server version 5.6.17 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RE...
true
733589f0919dc0e62b4b8caa8725db3b3bf2a710
SQL
Panshaojun/english-back-end
/config/新东方考研单词(5297).sql
UTF-8
264,945
2.59375
3
[]
no_license
INSERT INTO words ( w, e ) VALUES ('a','art.一(个);每一(个);(同类事物中)任一个'), ('abandon','vt.离弃,丢弃;遗弃,抛弃;放弃'), ('abdomen','n.腹,下腹(胸部到腿部的部分)'), ('abatement','n.减(免)税,打折扣,冲销'), ('abide','vi.(abode,abided)(by)遵守;坚持;vt.忍受,容忍'), ('ability','n.能力;本领;才能,才干;专门技能,天资'), ('able','a.有(能力、时间、知识等)做某事,有本事的'), ('abnormal','a.反常的,不正常的,不规则的'), (...
true
81b0b51b2bb0bda7da9621a921eba26d8b177f35
SQL
cornelioroyer/abaco-design
/u_factura2_precio.sql
UTF-8
273
2.84375
3
[]
no_license
update factura2 set precio = 0 from factura1 where factura1.almacen = factura2.almacen and factura1.tipo = factura2.tipo and factura1.num_documento = factura2.num_documento and factura1.tipo in ('02','RE') and factura1.fecha_factura >= '2012-06-01' and factura2.precio > 0
true
e67502e9ad2bdbaa9044f2d0b953370662ff13fd
SQL
gicadmin/allo
/PHENIX/Tables/PCI_USER_VENDORS.sql
UTF-8
976
3.4375
3
[]
no_license
CREATE TABLE phenix.pci_user_vendors ( puv_pus_id NUMBER(15) NOT NULL, puv_ven_code NUMBER(5) NOT NULL, puv_pcro_id NUMBER(15) NOT NULL, CONSTRAINT puv_pk PRIMARY KEY (puv_pus_id,puv_ven_code) USING INDEX (CREATE UNIQUE INDEX phenix.puv_pk_i ON phenix.pci_user_vendors(puv_pus_id,puv_ven_code) ), CONSTRAINT...
true
6247d1e03136f2e0153dffab8c28338c306d1567
SQL
ruanjf/mybatis-crud-helper
/src/test/resources/init.sql
UTF-8
1,005
3.125
3
[]
no_license
CREATE TABLE `SimpleTable` ( `id` int(11) NOT NULL, `first_name` varchar(30) NOT NULL, `last_name` varchar(30) NOT NULL, `birth_date` date NOT NULL, `employed` varchar(3) NOT NULL, `occupation` varchar(30) DEFAULT NULL, `create_time` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAUL...
true
a78c120464490ac264eaddda503321816f19a5c4
SQL
gmotro/BookStoreProj
/SQL/PRC/UpdateExistingBookSP.prc
UTF-8
1,515
3.84375
4
[]
no_license
if exists (select top 1 1 from dbo.sysobjects where id=object_id(N'[dbo].[UpdateExistingBookSP]') and objectproperty(id,N'IsProcedure')=1) drop procedure dbo.UpdateExistingBookSP GO CREATE PROCEDURE [dbo].[UpdateExistingBookSP] @BookID int, @Title varchar(50), @AuthFirstName varchar(50), @AuthLastName ...
true
0b5f0078c5105bc1ba362cea8195c27095c363d7
SQL
lulygomes/SQL-aulas
/Pratica-Func-DATEPART.sql
ISO-8859-1
1,979
3.75
4
[]
no_license
--FUNCAO DE DATA E HORA PARTES --RETORNA O DIA/Mes/Ano SELECTGetdate()data_hora, Datename(day,Getdate())DIA_N, Datename(month,Getdate())MES_N, Datename(year,Getdate())ANO_N --RETORNA O DIA/Mes/Ano SELECTDatepart(day,Getdate()) DIA_P, Datepart(month,Getdate())MES_P, Datepart(year,Getda...
true
47d95c72d8cc6dec4973518f1456270429c63644
SQL
mansuri97/Langy
/database/Langy.sql
UTF-8
3,322
3.453125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Mar 18, 2019 at 09:39 PM -- Server version: 10.1.38-MariaDB -- PHP Version: 5.6.40 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
true
57a42f1d778fa58a022223cd817b449032e1726a
SQL
yesgosu/DataBase_hospital
/12월17일데이터베이스_병원관리.sql
UTF-8
4,856
3.375
3
[]
no_license
create table majorward ( Major varchar2(20) not null, Wardcode varchar2(15), constraint pk_majorward primary key (Major) ) ; create table doctor ( Medical_number varchar2(10) not null, doctor_name varchar2(10), doctor_date date, Gender varchar2(7), age varchar2(4), Major varchar2(20), salary int, co...
true
be2b67b0ebd164c81a47692371d18d54724112df
SQL
ankurprajapati/OracleDB-PL-SQL
/Lab08/lab8.sql
UTF-8
4,664
4
4
[]
no_license
/*-------------------------1-a--------------------------------*/ CREATE OR REPLACE PACKAGE table_pkg IS PROCEDURE make(p_table_name VARCHAR2, p_col_specs VARCHAR2); PROCEDURE add_row(p_table_name VARCHAR2, p_col_values VARCHAR2, p_cols VARCHAR2 := NULL); PROCEDURE upd_row(p_table_name VARCHAR2, p_set_v...
true
830a3a8662713330b5c6365034caa9447e090506
SQL
tankehwin/lifeboat
/sql/mysql/lifeboat_events.sql
UTF-8
270
2.640625
3
[]
no_license
CREATE TABLE lifeboat_events ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(100), description text, evt_type int, organiser_fk int, -- connected to lifeboat_user date_start datetime, date_end datetime, date_created datetime, date_updated datetime );
true
3414f3b9c29ed3f2605158cbb67834a95202300c
SQL
thona-seguros/Repositorio-Sicas
/Objetos-BD/Procedimientos/oc_pagos_siniestros_temporal.sql
ISO-8859-3
11,469
3.015625
3
[]
no_license
-- -- OC_PAGOS_SINIESTROS_TEMPORAL (Procedure) -- -- Dependencies: -- STANDARD (Package) -- DBMS_OUTPUT (Synonym) -- DBMS_STANDARD (Package) -- SYS_STUB_FOR_PURITY_ANALYSIS (Package) -- APROBACIONES (Table) -- APROBACION_ASEG (Table) -- TRANSACCION (Table) -- SINIESTRO (Table) -- COMPROBANTES_CONT...
true
2ff5f2f89e73b58fb4880d7d6461dae664582cba
SQL
codythompson/cs345Proj
/testing/testLOANSupdate.sql
UTF-8
623
3.359375
3
[]
no_license
-- this should update just fine where patronid_fk and copid_fk exist in patron and copies update cdt27.loans set copyid = 5, patronid = 1, returned = SYSDATE, due = SYSDATE where patronid = 6 AND copyid = 2; -- this should fail because none of the columns in the cdt27.loans table allow nulls update cdt27.loans ...
true
e2259945d52f5276795312afe66445fe985f8b16
SQL
Yrp/explorer
/model/src/main/resources/trxplorer/db/migration/common/schema/V0003__Add_transaction_result_table.sql
UTF-8
225
2.5625
3
[]
no_license
CREATE TABLE `transaction_result` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `fee` DOUBLE UNSIGNED NULL, `code` TINYINT(1) UNSIGNED NOT NULL, `transaction_id` BIGINT UNSIGNED NOT NULL, PRIMARY KEY (`id`));
true
cb42c0943139d01e0e3f82bad0aac73b06dbd93b
SQL
tdriancourt/BiB
/data/create sqliteDb/db-create.sql
UTF-8
3,901
3.515625
4
[ "CC0-1.0", "MIT", "LicenseRef-scancode-public-domain" ]
permissive
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 10.1.22-MariaDB - mariadb.org binary distribution -- Server OS: Win64 -- HeidiSQL Version: 9.4.0.5169 -- ------------------------------------------------...
true
f6b885d804abc8f44fec907e31c8ddbdf7ecc655
SQL
mannhuynh/PLSQL-by-Khaled-Part1
/Section 11 Creating Function/chapter-11-part-3.sql
UTF-8
634
3.90625
4
[]
no_license
-- create a function to calc tax on salary --if salary <5000 then tax 10% else 15% create or replace function get_sal_tax (p_sal number) return number is begin if p_sal<5000 then return p_sal* (10/100); else return p_sal* (15/100); end if; end; --------------------------------- select em...
true
a680fcd484f70e9b5d76005df482051399d92c7a
SQL
ericbleiler/Java-Server-Pages
/test.sql
UTF-8
514
2.765625
3
[]
no_license
DROP DATABASE IF EXISTS test; CREATE DATABASE test; USE test; CREATE TABLE `jspexam` ( `question_id` int(11) NOT NULL AUTO_INCREMENT, `answer1` varchar(128) NOT NULL, `answer2` varchar(45) NOT NULL, `answer3` varchar(128) NOT NULL, `answer4` varchar(128) NOT NULL, `selected` varchar(128) NOT NULL, `co...
true
60ad39ca7d3cb6a622a03ace0d97c28b43e4e4da
SQL
CUBRID/cubrid-testcases
/sql/_27_banana_qa/issue_13412_partition_indexes/cases/_04_unique_cadinality.sql
UTF-8
2,369
3.46875
3
[ "BSD-3-Clause" ]
permissive
drop table if exists t; create table t(i int ) partition by range(i) ( partition p0 values less than (5), partition p1 values less than (25), partition p2 values less than (35), partition p3 values less than (45) ); insert into t values(1),(2),(3),(4); insert into t values(21),(22),(23),(24); insert into t values(31),(...
true
f03183e44752ad075532a5dd6c7b0af68afcd181
SQL
erjan/coding_exercises
/average_selling_price.sql
UTF-8
441
4.34375
4
[ "Apache-2.0" ]
permissive
''' Write an SQL query to find the average selling price for each product. average_price should be rounded to 2 decimal places. Return the result table in any order. The query result format is in the following example. ''' select prices.product_id, round(sum(price*units)/ sum(units),2) as average_price from pric...
true
7ae7a7be41f87d9b8dc39f77c103b1f78406d133
SQL
Mat4wrk/Joining-Data-in-SQL-Datacamp
/4.Subqueries/Subquery inside where.sql
UTF-8
398
3.109375
3
[]
no_license
-- Select average life_expectancy SELECT AVG(life_expectancy) -- From populations FROM populations -- Where year is 2015 WHERE year = 2015; -- Select fields SELECT * -- From populations FROM populations -- Where life_expectancy is greater than WHERE life_expectancy > 1.15 * -- 1.15 * subquery (SELECT AVG(...
true
592166403f4a8618205700c3c36be57c01e7b89e
SQL
AgataKowal/bazy_danych
/Zestaw 02/pyt-09.sql
WINDOWS-1250
1,155
4.03125
4
[]
no_license
/* z tabel klientw, zamwienie i ich pozycji oblicz zysk na poszczeglnych towarach dla poszczeglnych klientw */ SELECT imie, nazwisko, opis, sum(ilosc), sum(ilosc) * (cena - koszt) AS zysk FROM (( klient INNER JOIN zamowienie ON klient.nr = zamowienie.klient_nr ...
true
c1e8d9fd6baf863f64ea61a24dc4d5498d4eba26
SQL
normal10as/s20-e0101-dml-editorial-leombpunk
/My SQL/serie 1.5.sql
UTF-8
381
3.421875
3
[]
no_license
use editorial; show databases; /*1. Consultas básicas*/ /*1.5. Mostrar por cada título su nombre y cuanto corresponde de regalías por cada 1000 títulos vendidos. Esta columna se debe mostrar como “Regalías x cada 1000 unidades”. Titulo.regalías es un porcentaje.*/ select t.titulo, (t.regalias * t.precio / 100) * 1000 ...
true
705a40f13af4c87d966015fd6b145d17aef75fa3
SQL
zhichao19930808/mysql
/sql/Day0403.sql
UTF-8
1,248
3.703125
4
[]
no_license
-- SQL where 行检索-------------------------------------------------------------------------------------------------------------------------------------- SHOW DATABASES ; SHOW TABLE STATUS FROM scott;-- 显示 scott库 的情况 SHOW FULL COLUMNS FROM scott.emp; -- 显示 emp表中所有列 的情况 SHOW FULL COLUMNS FROM scott.dept;-- 显示 emp表中所有列 的...
true
71a8503d22257ed96a7ab1a823c99aeb093eb78f
SQL
CrazyKidCN/PHP-GuestBook
/db/db.sql
UTF-8
2,683
3.265625
3
[]
no_license
/* SQLyog Ultimate v8.32 MySQL - 5.5.5-10.1.33-MariaDB : Database - php_homework ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN...
true
bc7018dfcd8bd22c523212016705c60932b63d34
SQL
buiminhhai1/golang_simple_store
/db/query/book.sql
UTF-8
744
3.71875
4
[]
no_license
-- name: CreateBook :one INSERT INTO books ( name, price, quantity, image, description, book_category_id ) VALUES ( $1, $2, $3, $4, $5, $6 ) RETURNING *; -- name: GetBookById :one SELECT * FROM books WHERE id = $1 LIMIT 1; -- name: GetBooksByCategoryId :many SELECT * FROM books WHERE book_category_id = ...
true
7f684e497875a6fff3ad98706aa05b649094dfbd
SQL
CTeillet/Birdy
/Birdy/res/Corentin_Teillet.sql
ISO-8859-1
2,798
3.359375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Hte : 127.0.0.1:3306 -- Gnr le : mar. 19 mai 2020 15:32 -- Version du serveur : 8.0.18 -- Version de PHP : 7.3.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
true
4f17a1409cdbaf868efa1a0feac460e8234cff96
SQL
markfindley/sql-challenge
/EmployeeSQL/SQLHomeworkQueries.sql
UTF-8
2,582
4.34375
4
[]
no_license
-- List the following details of each employee: employee number, last name, first name, gender, and salary. select e.EmpNo, e.LastName, e.FirstName, e.Gender, s.Salary from Employees as e join Salaries as s on e.EmpNo = s.EmpNo; -- List employees who were hired in 1986. select EmpNo, LastName, FirstName, HireDate f...
true
4346eb6394d9a8554bce289d52af0e51dda9c130
SQL
masinette/bootcampx
/4_queries/1_total_teacher_assistance_requests.sql
UTF-8
373
3.671875
4
[]
no_license
-- SELECT -- (SELECT COUNT(teacher_feedback) -- FROM assistance_requests -- WHERE teacher_id = teachers.id) -- AS total_assistances, -- name -- FROM teachers -- WHERE name = 'Waylon Boehm'; SELECT count(assistance_requests.*) as total_assistances, teachers.name FROM assistance_requests JOIN teachers ON teachers.id...
true
a017135586ad276e14e6e8d68fc177e279c78025
SQL
mcekovic/integration-testing-demo-java
/src/test/resources/db/e2e/initial-load.sql
UTF-8
530
3.09375
3
[]
no_license
INSERT INTO event (event_id, name, state) VALUES (1, 'Tour de France', 'O'); INSERT INTO market (market_id, event_id, name, state) VALUES (1, 1, 'General Classification Winner', 'O'); INSERT INTO selection (selection_id, market_id, index, name, price, state) VALUES (1, 1, 1, 'Tadej Pogacar', 1.33, 'O'), (2, 1, 2, 'Pr...
true
b66f33e5b9ba0b6f6a3b39889b1757a4e2d5f524
SQL
glezo1/mac_oui_db_loader
/main/creates.sql
UTF-8
217
2.515625
3
[]
no_license
CREATE DATABASE IF NOT EXISTS mac_vendor; USE mac_vendor; DROP TABLE IF EXISTS vendors; CREATE TABLE vendors ( mac VARCHAR(8) NOT NULL, vendor VARCHAR(512), vendor_group VARCHAR(512), PRIMARY KEY(mac) );
true
2e4dbf2ca117842d9552afb96dbb54f71af3954d
SQL
nextbeat-public/summer-intern-0809-D
/conf/db/migration/V4__idol.sql
UTF-8
1,827
2.984375
3
[]
no_license
-- アイドル定義 (sample) ---------------------- CREATE TABLE "idol" ( "id" INT NOT NULL AUTO_INCREMENT PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "profile" VARCHAR(1024) DEFAULT NULL, "twitter_id" VARCHAR(255) DEFAULT NULL, "location" VARCHAR(255) NOT NULL,...
true
40f4db6aedb1b400e8745cb896798a9223ab2371
SQL
Gabrieldrc/microservice_demo
/product-service/src/test/resources/schema.sql
UTF-8
601
3.640625
4
[]
no_license
CREATE DATABASE "product-service"; CREATE TABLE IF NOT EXISTS CATEGORIES ( "id" SERIAL NOT NULL, "name" VARCHAR(45) NOT NULL, PRIMARY KEY ("id")); CREATE TABLE IF NOT EXISTS PRODUCTS ( "id" SERIAL NOT NULL, "name" VARCHAR(45) NULL, "description" TEXT NULL, "price" DECIMAL(16,2) NULL, "stock" DECIMAL(1...
true
914f6a5611aeb5bd690f07a88eaf1bb341856694
SQL
BoyStarIT/final-project
/vue_lar07.sql
UTF-8
28,406
3.046875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 10, 2020 at 05:02 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
true
b951478f8d9592eda82fd224d9755fee2c6d29b2
SQL
mrvannghia2015/Java
/Test2105/Quanlibanhang.sql
UTF-8
1,694
3.515625
4
[]
no_license
create database QUANLIBANHANG use QUANLIBANHANG create table Khach ( Makhach varchar(10) NOT NULL, Tenkhach nvarchar(50) NOT NULL, Diachi nvarchar(50) NOT NULL, Dienthoai nvarchar(12) NOT NULL, primary key (Makhach) ) create table HDBan ( MaHDBan varchar(10) NOT NULL, Manhanvien varchar(10) NOT NULL, Ngayban datetime...
true
d4e2727c4bb663ab287a9b0bf6466cbab0530329
SQL
swissChili/ReflectProxy
/project/create.sql
UTF-8
425
2.625
3
[]
no_license
create database if not exists reflectjs; use reflectjs; create table if not exists requests ( id int not null auto_increment primary key comment 'ID', requested_at datetime comment 'When the request was made', client_ip varchar(31) comment 'The clients IP address', host varchar(255) comment 'The host requeste...
true
0fc869e3b5b35d4bd0190632b1f075a282f87ce7
SQL
Robi-Rozali/Toko-online
/toko_online.sql
UTF-8
5,562
2.828125
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 20, 2020 at 03:42 PM -- Server version: 10.1.37-MariaDB -- PHP Version: 7.2.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
true
2925214a3bb627f623430b8dddd7ea2d50898634
SQL
oplatek/dwdm
/postgres/artpop.sql
UTF-8
1,241
3.453125
3
[]
no_license
DROP SCHEMA IF EXISTS artpop CASCADE; CREATE SCHEMA artpop; CREATE TABLE artpop.Date ( keyDate serial NOT NULL, Hour smallint NOT NULL, Day smallint NOT NULL, Month smallint NOT NULL, Year smallint NOT NULL, PRIMARY KEY (keyDate) ); CREATE TABLE artpop.Article ( keyArticle serial NOT NULL, Ti...
true
46c843cb942a70e679a7bf0a74d60b12ea78072b
SQL
MARCOSBLACKER7/ESCOM-TRAYECTORIA
/BASES DE DATOS/Apuntes clases/Ejercicios_en_clase/15_Feb_18/q_2.sql
UTF-8
405
2.875
3
[]
no_license
spool F:\Ejercicios_en_clase\15_Feb_18\Ejercicio_2.txt PROMPT DESPLIEGA LOS OBJETOS TIPO TABLA E INDEX EN PARA EL USUARIO HR COLUMN OWNER FORMAT A10 JUS CENTER COLUMN OBJECT_NAME FORMAT A25 JUSTIFY CENTER COLUMN Tipo FORMAT A10 JUS CENTER SELECT OWNER, OBJECT_NAME, OBJECT_TYPE "Tipo" FROM ALL_OBJECTS WHERE OWN...
true
1e2735d13e30e32d0a78ddccbcfa9614aae1cd0c
SQL
JulMikh/products
/zend-test.sql
UTF-8
1,525
3
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.0.10deb1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 25, 2017 at 05:13 PM -- Server version: 5.5.54-0ubuntu0.14.04.1 -- PHP Version: 5.5.9-1ubuntu4.20 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_C...
true