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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
77b05930a09e990ab6c7bc9f2ca14cdaaef0c496 | SQL | apollowesley/jun_test | /tmp/sys/mallplus3/新创建表/sys_permission_category.sql | UTF-8 | 1,064 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50725
Source Host : localhost:3306
Source Database : mallplus
Target Server Type : MYSQL
Target Server Version : 50725
File Encoding : 65001
Date: 2019-04-27 15:13:14
*/
SET FOREIGN_KEY_CHECKS=0;
-- ... | true |
4f45ad972d2bcb35c45ae1210d72ccf114db7b80 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day10/select0545.sql | UTF-8 | 264 | 2.921875 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='WeMo' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['6048','5074','2038','2243','5100_1','3064','3214','3211','5076','4100_3'])
| true |
def91c556290a0b3ab1f885150aa6ce3df8252e2 | SQL | Financial-Times/ip-envoy-lucidimporter | /service/schema/create.ddl | UTF-8 | 9,656 | 3.6875 | 4 | [] | no_license | CREATE SCHEMA IF NOT EXISTS core;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
/* Section 0 - set up Entity Tables */
CREATE TABLE IF NOT EXISTS core."entityType"(
"name" VARCHAR(16) NOT NULL PRIMARY KEY
);
COMMENT ON TABLE core."entityType" IS 'Defines Entities, in most cases this will be users but can
be expanded... | true |
e486a8cf4f3d52f59a6b6406558bf20c665cce54 | SQL | artur309/1_artur_12M_trab_aval_m17A | /Receitas/config/schema/sessions.sql | UTF-8 | 459 | 3 | 3 | [] | no_license | CREATE TABLE `sessions` (
`id` char(40) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
`created` datetime DEFAULT CURRENT_TIMESTAMP, -- optional, requires MySQL 5.6.5+
`modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- optional, requires MySQL 5.6.5+
`data` blob DEFAULT NULL, -- for ... | true |
15d3c1b112131df9cfdd301cef82a423e26c4d20 | SQL | mattpwest/entelect-spring-webapp-template | /persistence/src/main/resources/dev_initial_data.sql | UTF-8 | 4,411 | 2.8125 | 3 | [
"MIT"
] | permissive | INSERT INTO AppUser(Id, Email, Password, FirstName, LastName, Verified, Enabled, ChangeEmailEnabled, VerificationToken, PasswordResetToken) VALUES (1, 'admin@entelect.co.za', '$2a$10$o.fQqZQCrwnnXaixs1XhOes0NwlpX8uL3Q7eYe0BO1Xxa9j9G5.Cy', 'Ser', 'Admin', 1, 1, 0, NULL, NULL);
INSERT INTO Role(Id, Name, Description) VAL... | true |
361b2762f9a2a021d33bd14f9b3f8e290b76f5ce | SQL | AsnemBlue/mega_IT | /source/2_DB/200106.12_DCL명령어.sql | UHC | 904 | 3.75 | 4 | [] | no_license | -- DCL (CREATE USER ~, ALTER USER~, GRANT, REVOKE, DROP USER) - DBA
CREATE USER gong IDENTIFIED BY gong; --
ALTER USER gong IDENTIFIED BY tiger; -- йȣ
select * from empv1;
GRANT CREATE SESSION TO gong;
-- grant(Ѻο) ʰ Ѱü ѹ ִ°
CREATE ROLE ROLLEX1; -- ROLLEX1 ü
-- ROLLEX1 α, ̺, ִ ü
GRANT CREATE SESSION, CREA... | true |
0c55ebe5e04a9703a5a43f69c3cdaf071d83b71e | SQL | royceda/personnal-portfolio | /cours/S7/SGBD/Projet/s12-project/Database/client/donnees.sql | ISO-8859-1 | 27,399 | 2.8125 | 3 | [] | no_license | USE RRL;
-- adresse
INSERT INTO adresse (id, ville, rue, code_postale, pays)
VALUES (1,'LH', '12 rue du beau', 76000, 'FRANCE');
INSERT INTO adresse (id, ville, rue, code_postale, pays)
values(2, 'PARIS', '12 rue Rivoli', 1000, 'FRANCE');
INSERT INTO adresse (id, ville, rue, code_postale, pays)
... | true |
548d7483dc25ebd722f5eff65a37fcd040fa577d | SQL | ptums/udacity-fullstack-nanodegree-final-project | /casting.sql | UTF-8 | 959 | 3.4375 | 3 | [] | no_license | CREATE TABLE Movies (
id SERIAL PRIMARY KEY,
title varchar(500) NOT NULL,
release varchar(500) NOT NULL
);
CREATE TABLE Actors (
id SERIAL PRIMARY KEY,
name varchar(500) NOT NULL,
age varchar(500) NOT NULL,
gender varchar(500) NOT NULL,
movie_id int NULL,
FOREIGN KEY (movie_id) REF... | true |
00c593aa68ef8eb7eb77b3975d1821d353f074de | SQL | Yvette14/future-star | /src/main/resources/db/migration/V2017_09_27_21_14__Create_Shopping_Cart_Table.sql | UTF-8 | 386 | 2.796875 | 3 | [] | no_license | CREATE TABLE `shopping_cart` (
`id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKmqnothmsk2tre969lqbv8m3uu` (`user_id`),
CONSTRAINT `FKmqnothmsk2tre969lqbv8m3uu` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`id`)
)... | true |
e6bcfead940050f1cd6b9c5169dc23430da5f319 | SQL | ajlane17/cit225 | /apply_mysql_lab8.sql | UTF-8 | 4,402 | 3.859375 | 4 | [] | no_license | -- ----------------------------------------------------------------------
-- Instructions:
-- ----------------------------------------------------------------------
-- The two scripts contain spooling commands, which is why there
-- isn't a spooling command in this script. When you run this file
-- you first connect to... | true |
576c8ec2160d346c1c9884a104dc4cfd0809496b | SQL | RodrigoEche/SQL-ejercicios | /ej05_PrestamoDePeliculas.sql | UTF-8 | 3,480 | 4.25 | 4 | [] | no_license | -- crear base de datos
create database ej5_PrestamoDePeliculas;
-- usar la base de datos
use ej5_PrestamoDePeliculas;
-- crear tablas
create table rubro
(
codRubro int not null,
nombRubro varchar(30) not null,
primary key(codRubro)
);
create table pelicula
(
codPel int not null,
titulo varchar(30) not null,
du... | true |
bdd3e3832fbe2363bad0014e38b5f37dfb062892 | SQL | byeon-jiyoung/korail | /Scripts/init.sql | UTF-8 | 15,299 | 3.71875 | 4 | [] | no_license | -- 코레일
DROP SCHEMA IF EXISTS korail;
-- 코레일
CREATE SCHEMA korail;
-- 회원
CREATE TABLE korail.member (
mem_id VARCHAR(10) NOT NULL COMMENT '아이디', -- 아이디
mem_pw CHAR(41) NULL COMMENT '비밀번호', -- 비밀번호
mem_tpw INT(4) NULL COMMENT '현장발권비밀번호', -- 현장발권비밀번호
mem_name V... | true |
c8326a7c3b2081fc5715e3d3f88fabcc9c6ed174 | SQL | btrd/jee | /week301/src/test/resources/test-data.sql | UTF-8 | 1,408 | 3.15625 | 3 | [] | no_license | delete from region;
insert into region(id, nom) values (1, 'Hauts-de-France'), (2, 'Grand Est'), (3, 'Normandie'), (4, 'Ile-de-France');
delete from club;
insert into club(id, nom, region_id) values (1, 'Lille', 1), (2, 'Cambrai', 1), (3, 'Abbeville', 1), (4, 'Colmar', 2), (5, 'Le Havre', 3), (6, 'Bailleau',... | true |
addc1b453f89ea57212e6296de4e182bb66a4be4 | SQL | supreet-totagi/scaling-lamp | /part_3_select_e.sql | UTF-8 | 321 | 3.8125 | 4 | [] | no_license | WITH day_count(day, login_count) AS (
SELECT
TO_CHAR(created_at, 'Day') AS day,
COUNT(*) as login_count
FROM
login_attempts
WHERE
is_success = true
GROUP BY
1
)
SELECT
day,
login_count
FROM
day_count
WHERE
login_count =(
SELECT
MAX(login_count)
FROM
day_count
);... | true |
a6a0f859435ba4e60286ff736f3628f7467f8adf | SQL | xiaohuawang/FinalFinal | /InfinityDTHServices/SQL/module2.sql | UTF-8 | 2,972 | 3.53125 | 4 | [] | no_license |
--MODULE 2
-------------------------Set Top Box Types TABLE/4.1----------------------------
CREATE TABLE setTopBox(
setTopBoxId INTEGER PRIMARY KEY,
setTopBoxType VARCHAR(8) CHECK (setTopBoxType= 'Standard' OR setTopBoxType='HD' OR
setTopBoxType='HD+' OR setTopBoxType='IPTV') NOT NULL,
setTopBoxFeatur... | true |
d1fda33b5c73b3a0df2a6f6f92de7a7e8b40ebb9 | SQL | Teemo-Yordles/AWS-DevOps-Demo | /db/createDelayCode.sql | UTF-8 | 987 | 3.453125 | 3 | [] | no_license | -- script to create flight related tables
-- DROP DATABASE IF EXISTS `view`;
-- CREATE DATABASE `view`;
use `view`;
SET FOREIGN_KEY_CHECKS=0;
-- ---------------------------------------------------------------
-- Table structure for reference data management system tables
-- --------------------------------------------... | true |
5ac7f7f34d56e3affc1da56896f1a9d28a0c6c11 | SQL | wuxiaohua17/springcloud-demo | /mycloud-api/src/main/resources/sql/messagedemo1.sql | UTF-8 | 1,398 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : docker-1
Source Server Version : 50722
Source Host : 192.168.105.80:3306
Source Database : messagedemo1
Target Server Type : MYSQL
Target Server Version : 50722
File Encoding : 65001
Date: 2018-12-29 17:08:46
*/
SET FOREIGN_KEY_CHECKS... | true |
fa285d9ddf3038bc81f72a60ad6ecfc5af01c208 | SQL | JordonNes/SQL-Challenge | /SQL-Challenge_HW.sql | UTF-8 | 3,157 | 4.625 | 5 | [] | no_license | CREATE TABLE employees(
emp_no INT NOT NULL,
emp_title VARCHAR (30) NOT NULL,
birth_date DATE NOT NULL,
first_name VARCHAR (30) NOT NULL,
last_name VARCHAR (30) NOT NULL,
sex VARCHAR (1),
hire_date DATE)
SELECT * FROM employees;
drop table employees
CREATE TABLE departments(
dept_no VARCHAR (6) NOT NULL,
... | true |
f52adfe8c61d3bbb1772e10b4e83e17e712a74d6 | SQL | proyectospae/ProyectoADSI | /phpmyadmin/dbtest.sql | UTF-8 | 14,968 | 3.296875 | 3 | [] | no_license | /*
SQLyog Ultimate v11.11 (32 bit)
MySQL - 5.5.5-10.1.25-MariaDB : Database - dbtest
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FORE... | true |
27e8b46b5be7e51368d57df6ce6c8fd3a5630cb7 | SQL | PeachIceTea/fela | /db/migrations/20200414232525_init.sql | UTF-8 | 1,182 | 3.6875 | 4 | [] | no_license | -- migrate:up
CREATE TABLE user (
id BIGINT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL UNIQUE,
password BINARY(60) NOT NULL,
role ENUM('user', 'uploader', 'admin') NOT NULL DEFAULT 'user',
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP
);
CR... | true |
38da7b846ca0fed6d27c9a76e5278e2b60d3719e | SQL | jongvin/werp | /werp/erpw/general/t_web/sql/Procedure/SP_T_FIN_MAKE_INSUR_SLIP.sql | UHC | 3,941 | 2.890625 | 3 | [] | no_license | Create Or Replace Procedure SP_T_FIN_MAKE_INSUR_SLIP
(
Ar_Work_Slip_Id Number,
Ar_Work_Slip_IdSeq Number,
Ar_Work_Code Varchar2,
Ar_Make_Comp_Code Varchar2,
Ar_Dept_Code Varchar2,
Ar_Work_Dept_Code Varchar2,
Ar_Insur_No Number,
Ar_CrtUserNo Varchar2
)
Is
lrRec T_SET_CONS_INS... | true |
bf239f1391d077056db2dccd9e51a4a35fadb97c | SQL | Zongsoft/Administratives | /Administratives-China-Tables(mysql).sql | UTF-8 | 2,393 | 3.4375 | 3 | [
"MIT"
] | permissive | SET NAMES utf8mb4;
SET TIME_ZONE='+08:00';
CREATE TABLE IF NOT EXISTS `Province` (
`ProvinceId` tinyint unsigned NOT NULL COMMENT '主键,省份代码',
`Name` varchar(50) NOT NULL COMMENT '省份名称' COLLATE 'utf8mb4_general_ci',
`Abbr` varchar(50) NOT NULL COMMENT '省份简称' COLLATE 'utf8mb4_general_ci',
`A... | true |
3f731792b93c6010a668da3f03e196af053307ca | SQL | hassanEbrahimi/time-tracker | /database/timer_ticker.sql | UTF-8 | 2,660 | 3.046875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 04, 2018 at 08:45 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
8ae4300df69d083f1a9ec382ce209a7c086ced1f | SQL | tsukuba-pbl/16-4_PosTom | /init.sql | UTF-8 | 8,127 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2016 年 11 朁E04 日 05:57
-- サーバのバージョン: 10.1.10-MariaDB
-- PHP Version: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
c17030a4f602c37525307a945cc24309ce0c58bf | SQL | vgoel38/PQET | /inputs/really_final_outputs/without_seq/original/1b.sql | UTF-8 | 3,412 | 2.875 | 3 | [] | no_license | QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------... | true |
a132084f04d0ca600d29b890ec35f7d968e56a5b | SQL | fpuche/DWESE-Practica5 | /clases/sql/esquema.sql | UTF-8 | 1,642 | 3.5 | 4 | [] | no_license |
CREATE TABLE `producto` (
`id` int(11) NOT NULL primary key auto_increment,
`nombreProducto` varchar(40) NOT NULL,
`descripcionProducto` varchar(100) NOT NULL,
`precioProducto` decimal(7,2) NOT NULL,
`ivaProducto` decimal(5,2) NOT NULL,
`foto` varchar(50) NOT NULL
) ENGINE=InnoDB;
CREATE TABLE `venta` (
`id` int(11)... | true |
51146e41ad500bc27dcff6afc6bef7299c42c615 | SQL | hstrada/senai-codexp-mobile | /sql/script-join.sql | UTF-8 | 3,357 | 3.921875 | 4 | [] | no_license | /*
=
= Referências: https://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html
=
*/
/* --------------------------------------------------------------------------------------- */
/*
=
= Mostrar os problemas para trabalhar apenas com uma tabela
=
*/
DROP SCHEMA IF EXISTS senai_codexp_mobile;
CREATE SCHEMA... | true |
ad785e04c3c6a86c5ff954611b0c9077a0a41094 | SQL | AlexeyZatsepin/StorageSQL | /RestrictionsRGR.sql | UTF-8 | 1,082 | 3.59375 | 4 | [] | no_license | #drop trigger `before_insert_customer`;drop trigger `before_insert_distributor`;
DELIMITER //;
CREATE TRIGGER `before_insert_customer`
before insert ON Storage_Company.Customer
FOR EACH ROW
BEGIN
SET @FIO:= NEW.FIOCustomer;
SET @PhoneNumber := NEW.MobileNumber;
IF @FIO not REGEXP '[:alpha:]|[:blank:]' THEN
... | true |
be20cf8c0105a9edede9ab2c3c6c506280251616 | SQL | amrcs92/kanban | /kanban.sql | UTF-8 | 3,876 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 23, 2017 at 09:23 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 |
05045ce8113e664e8a619fcdff78e9d0a1647217 | SQL | TawfikYasser/Banking-System-JSP | /Dump20201227.sql | UTF-8 | 4,984 | 3.09375 | 3 | [
"MIT"
] | permissive | -- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: localhost Database: a2_web
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... | true |
02532425dc7bdd3839ffaa918015c068f1165c61 | SQL | scarecrow98/EduNET | /edunet.sql | UTF-8 | 22,048 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Gép: 127.0.0.1
-- Létrehozás ideje: 2018. Már 15. 23:57
-- Kiszolgáló verziója: 10.1.25-MariaDB
-- PHP verzió: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
8191a53da5c6270eca700e4682bfb7441856947c | SQL | NikhitaMethwani/Database-Management-System | /trigger_Update_Stock.sql | UTF-8 | 1,491 | 3.765625 | 4 | [] | no_license | use ecommerce;
select * from products;
select * from cartitems;
select productId,
products.instock,
products.instock - sum(quantity) as'available_stock',
sum(quantity)
from cartitems
inner join products
on cartitems.productid = products.idproduct
where idorder = 'O1'
group by (productId);
delimiter //
create trigger u... | true |
d916aac6cf64a1a0ebbd63c0d2c506a6d294713e | SQL | delphi-pascal-archive/wzs-tools | /wzsTools/wzsOraDBTools/wzsProcExecutor_DemoPiped/test_pipe_pkg.sql | UTF-8 | 1,290 | 2.734375 | 3 | [
"Unlicense"
] | permissive | /*
wzsTools components
(c) Protasov Serg
wzonnet.blogspot.com
wzff.livejournal.com
wzonnet@kemcity.ru
Test procedures TwzsOraProcExecutor demo from wzsOraDBTools Delphi components.
*/
create or replace package test_pipe_pkg as
function test_loop(p_in in varchar2, p_out out varchar2) return integer;
... | true |
52742aeda9c1489442d479a2959799903a9c28c4 | SQL | radtek/abs3 | /sql/mmfo/bars/Table/nbur_ref_version_status.sql | WINDOWS-1251 | 3,847 | 3.234375 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Table/NBUR_REF_VERSION_STATUS.sql =========*
PROMPT =====================================================================================
PROMPT *** ALTER_POLICY_INFO... | true |
20407cfb40a8a4d8a0a9e691c63d5214c39d6387 | SQL | juanlvo/plsql-course | /S06L41.sql | UTF-8 | 1,662 | 3.90625 | 4 | [] | no_license | SELECT employee_id,
first_name,
salary,
department_id,
case department_id
when 90 then salary*1.1
when 60 then salary*1.2
when 100 then salary*1.3
else salary
end new_sal
from employees;
-------
SELECT employee_id,
first_name,
salar... | true |
8709da4b7df2ea46b94062bd4b15bdc02f030d96 | SQL | BEhnert/12-Employee_Management_System | /schema.sql | UTF-8 | 887 | 3.921875 | 4 | [
"MIT"
] | permissive | DROP DATABASE personnel;
/* Create database */
CREATE DATABASE personnel;
USE personnel;
/* Create new table with a primary key that auto-increments, and a text field */
CREATE TABLE department (
id INT NOT NULL AUTO_INCREMENT,
dept_name VARCHAR(30) NOT NULL,
PRIMARY KEY (id)
);
/* Create new table with a prim... | true |
4c130ff37a94349aae40fafc67868a5823ed25ac | SQL | Badran1987/Eventat-Canada-Project-NodeJS | /DB-File/eventat.sql | UTF-8 | 2,818 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 27, 2021 at 07:47 AM
-- Server version: 5.7.24
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
3718c0a7e999038703d847dfc553c05e5996f02a | SQL | kubAretip/company-products-orders-api | /src/main/resources/db/migration/common/V1.1.0__add_status_table.sql | UTF-8 | 307 | 2.546875 | 3 | [] | no_license | create table if not exists status
(
id bigint not null auto_increment,
name varchar(25) not null,
locale varchar(11) not null,
title varchar(50) not null,
description varchar(500) not null,
primary key (id),
constraint unique (name, locale)
); | true |
7b84f6cfa409e5de80ae79c739b4b533d4cc667a | SQL | themanish/ovr-j2ee | /ovr/db_ovr.sql | UTF-8 | 8,735 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 19, 2015 at 08:26 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
f6ea27b070e71f9f109ba24818cc3a2e3a0c18df | SQL | stephenhu/gogetsdone | /db/migrations/004_groups.up.sql | UTF-8 | 556 | 3.671875 | 4 | [
"MIT"
] | permissive | create table if not exists groups(
id INTEGER NOT NULL PRIMARY KEY,
owner_id INTEGER,
name VARCHAR NOT NULL,
created DATETIME DEFAULT CURRENT_TIMESTAMP,
updated DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(owner_id) REFERENCES users(id)
);
create table if not exists user_groups(
id INTEGER NOT NULL PR... | true |
4d9fe23767e871d810991cd88aad5c0c34b661b4 | SQL | mixersoft/PES | /app/config/schema/baked.schema.sql | UTF-8 | 19,270 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1:3306
-- Generation Time: Apr 27, 2010 at 03:52 AM
-- Server version: 5.1.41
-- PHP Version: 5.3.1
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT *... | true |
332db3f0c899c3e901de7dcae58b5b0cfb0db518 | SQL | davischaliq/Logistik | /db/logistik.sql | UTF-8 | 5,516 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 01 Nov 2020 pada 16.04
-- Versi server: 10.4.14-MariaDB
-- Versi PHP: 7.3.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... | true |
1f9ff4154cbc964f7ddd25bb8ddf2cdf6f0fd044 | SQL | chidamodu/HackerRank-MYSQL-Challenge | /Print Prime Numbers.sql | UTF-8 | 1,217 | 3.984375 | 4 | [] | no_license | To generate a sequence of prime numbers in MYSQL. Write a query to print all prime numbers less than or equal to 1000
drop temporary table if exists n;
create temporary table if not exists n
select t2.c*100 + t1.c*10 + t0.c + 1 as seq from
(select 0 c union all select 1 c union all select 2 c union all selec... | true |
02260bb52db0a1ec1d9c1708b930e8fa540a684f | SQL | CameronCT/SAMP-QS | /scriptfiles/database.sql | UTF-8 | 1,927 | 3.34375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Sun Apr 23 21:33:22 2017
-- 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 |
80b4614e96cdc6ac56a0815bdd876dba06a99e74 | SQL | OsipovStas/footbality | /conf/evolutions/default/1.sql | UTF-8 | 725 | 3.515625 | 4 | [] | no_license | # --- First database schema
# --- !Ups
CREATE TABLE teams (
id serial NOT NULL,
name varchar(255) NOT NULL,
PRIMARY KEY(id)
);
CREATE TABLE matches (
id serial NOT NULL,
home_id int NOT NULL,
away_id int NOT NULL,
home_score smallint NOT NULL,
away_score smallint NOT NULL,
played ... | true |
821d956533d3bec54eefb2b517d5957e9364086b | SQL | modirufa6317/Roille | /sql/roilleBDD.sql | UTF-8 | 4,201 | 3.546875 | 4 | [] | no_license | DROP DATABASE IF EXISTS Roille;
CREATE DATABASE Roille;
USE Roille;
-- créations des tables
CREATE TABLE Agences
(
code_ag INT(3) AUTO_INCREMENT NOT NULL,
nom_ag VARCHAR(25),
adresse_ag VARCHAR(50),
email_ag VARCHAR(30),
tel_ag VARCHAR(10),
cp_ag VARCHAR(25),
ville_ag V... | true |
7724edebfcc34d57cbb33a37d887cbc94981e53d | SQL | novius-os/core | /framework/applications/noviusos_media/migrations/008_change_paths_size.sql | UTF-8 | 931 | 2.578125 | 3 | [] | no_license | /**
* NOVIUS OS - Web OS for digital communication
*
* @copyright 2011 Novius
* @license GNU Affero General Public License v3 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0.html
* @link http://www.novius-os.org
*/
ALTER TABLE `nos_media` CHANGE `media_title` `med... | true |
d1c8cea7f88372a5c1f5740d518d31e4f9f129ff | SQL | spatialdev/mn-water-2019 | /queries/polygonal_no_change.sql | UTF-8 | 808 | 4.28125 | 4 | [] | no_license | /*
This query identifies OSM polygonal features that have not changed between two time slices.
- The OSM ID should be identical
- The geometry should be identical
*/
CREATE TABLE results_final.polygonal_no_change AS
SELECT
t_1.osm_id_all as osm_id_t1,
t_2.osm_id_all as osm_id_t2,
t_1.all_tags as all_tags_t... | true |
e15482dc2fc9a41f27a2f97f3dfe90d1daf5bb80 | SQL | bomkeen/office | /db/office.sql | UTF-8 | 35,179 | 3 | 3 | [
"BSD-3-Clause"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : slave
Source Server Version : 50505
Source Host : 192.168.1.253:3306
Source Database : office
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2016-03-30 21:19:39
*/
SET FOREIGN_KEY_C... | true |
6bdc82538dff8bca5a9b247ed36ee79ad4aed4bc | SQL | Milen-Tanev/TelerikAcademy | /DataBases/SQL Intro/Task13.sql | UTF-8 | 240 | 3.421875 | 3 | [] | no_license | USE TelerikAcademy
------------------------------
-- 13. Salary 20000 - 30000 --
------------------------------
SELECT FirstName + ' ' + LastName as 'Full name', Salary
FROM dbo.Employees
WHERE (Salary > 20000) AND (Salary < 30000)
| true |
007e5e9c517b24243c3e79300181efd832bfc9fe | SQL | alexkup/ais | /db/tables/dbo.stalls_type.sql | UTF-8 | 258 | 2.78125 | 3 | [] | no_license | CREATE TABLE dbo.stalls_type (
"id_stall_type" INTEGER NOT NULL DEFAULT AUTOINCREMENT,
"name" nvarchar(80) NOT NULL,
"xid" UNIQUEIDENTIFIER,
PRIMARY KEY ( "id_stall_type" ASC )
) IN "system";
COMMENT ON TABLE "dbo"."stalls_type" IS 'Типы мест';
| true |
e1d6cd8baa76cb33413e86b91e7c0fd46f4612b3 | SQL | MennaEmadZ/SW2-Restraunts-Project | /sw2-restraunt.sql | UTF-8 | 5,757 | 3.40625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 02, 2020 at 05:25 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
b6b6f67acbcc666ad7123010ee028d2235c978b5 | SQL | crackHu/hhw | /server/src/main/java/hhw.sql | UTF-8 | 23,580 | 3.078125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50619
Source Host : 172.16.1.127:3306
Source Database : hhw
Target Server Type : MYSQL
Target Server Version : 50619
File Encoding : 65001
Date: 2017-01-09 12:09:57
*/
SET FOREIGN_KEY_CHECKS=0;
... | true |
c1846cdf9eb4cd154cf0687d8a3d3856afbea6f8 | SQL | 17607993928/todo-list | /src/main/resources/db/todo_list.sql | UTF-8 | 1,571 | 2.625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : project
Source Server Version : 80015
Source Host : localhost:3306
Source Database : todo_list
Target Server Type : MYSQL
Target Server Version : 80015
File Encoding : 65001
Date: 2021-10-12 20:08:16
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... | true |
6940067b6897fa9c0286d87d1732fc3588174064 | SQL | jgarzonext/plsql-testing | /script_plsql/bodega/vistas materializadas/DIM_PERSONA.sql | UTF-8 | 4,480 | 2.75 | 3 | [] | no_license | ----- DELETE VISTA ----------
BEGIN
PAC_SKIP_ORA.p_comprovadrop('DIM_PERSONA','MATERIALIZED VIEW');
END;
/
----- CREATE VISTA ----------
CREATE MATERIALIZED VIEW "CONF_DWH"."DIM_PERSONA" ("PER_CODIGO", "PER_PERSONA", "PER_PERSONA_NOMBRE", "PER_TIPO_PERSONA", "PER_TIPO_PERSONA_DESC", "PER_DIRECC_OFICINA", "PER_D... | true |
bb9073f5e181b3919032f7bb684a756c98b73d11 | SQL | Sgrygorczuk/SQL_Classes | /SQL Practice/JoeyBlue.sql | UTF-8 | 4,139 | 3.828125 | 4 | [] | no_license | --Click F5 to execut
--https://www.youtube.com/watch?v=9Pzj7Aj25lw&list=LLy55t2rmSwx2uRk7aWzqycw&index=4&t=314s
/*
Creates the database called Customer
create database Customer
*/
/*
Switches to Customer database in SQL Server Managment Studio
use Customer
*/
/*
Creates table
create table Customer(
... | true |
73bbb21635d58e83b05bfed3bf7d073bd7117ce8 | SQL | eduardcf17/Documentos | /trigers i disparadores/si tienen el mismo nombre.sql | UTF-8 | 762 | 3.453125 | 3 | [] | no_license | drop procedure mismoNombre;
delimiter //
create procedure mismoNombre()
begin
DECLARE done INT DEFAULT FALSE;
declare nombreE varchar (45);
declare nombreV varchar (20);
declare curEmp cursor for select nombre from empresa.CLIENTE;
declare curVid cursor for select nom from videoclub.CLIENT;
DECLARE CONT... | true |
b0e72dd2a3d52ccff8617dd4e63f5ff11b0f1ca0 | SQL | spkerkela/mmh-clojure | /src/sql/marathons.sql | UTF-8 | 646 | 3.921875 | 4 | [] | no_license | -- name: all-marathons
-- Get all marathons
SELECT * from marathons;
-- name: marathon-participants
-- Get all users that are participating in the given marathon
SELECT id, username, email, last_login, users.created_at, updated_at FROM users
INNER JOIN marathon_participants
ON users.id = marathon_participants.use... | true |
8fc7832ca6f68fc99cd3272fd6fd90d4c4a73108 | SQL | FirojShaikh/StudentRegistrationSystem-DatabaseModeling | /db_scripts/question3_d_3_e_checking_your_database.sql | UTF-8 | 1,146 | 3.390625 | 3 | [] | no_license | /*Que 3-d*/
DELETE FROM location WHERE LOC_ID = 11;
/*
RESPONSE: "Error Code: 1451. Cannot delete or update a parent row: a foreign key constraint fails
(`firojsha_BFS_LU_Student_Registration`.`faculty`, CONSTRAINT `fk_faculty_location` FOREIGN
KEY (`LOC_ID`) REFERENCES `location` (`LOC_ID`) ON DELETE NO ACTION ON UP... | true |
ec9669003971ef6ec260f97fced98c759a7743b4 | SQL | BorovskiyKonstantin/Bell-practice | /src/main/resources/schema.sql | UTF-8 | 5,656 | 4.0625 | 4 | [] | no_license |
CREATE TABLE IF NOT EXISTS Organization (
id INTEGER COMMENT 'Уникальный идентификатор' PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL UNIQUE COMMENT 'Название организации',
full_name VARCHAR(255) NOT NULL UNIQUE COMMENT 'Полное название ор... | true |
285eca537e4b8acdea9aba0fca076a2ae9ca7a38 | SQL | heonjunkim/Biz_502_2020_07_DBMS | /oracle/USER1(2020-07-14).sql | UTF-8 | 13,074 | 4.3125 | 4 | [] | no_license | -- 여기는 USER1사용자의 명령 공간입니다.
-- USER1은 DBA 권한을 부여받앗으므로
-- Table 생성, CRUD등의 명령을 사용할 수 있다.
-- DB에 데이터를 저장하기
-- DB를 대상으로 업무를 수행할때 데이터가 있어야만 여러가지 일을 수행할 수있다.
-- CRUD 중에서 가장 먼저 수행해야할 명령이 Create 형 명령
-- DML CRUD Create DDL CREATE명령과 구분을 해야 한다.
-- DDL의 CREATE : 생성이라는 개념이고 운영체와 밀접한 관련이 있거나,
-- 물리적인 요소가 많다.
-- CREATE TABLESPACE... | true |
c069d858af73154753c82b11734c0d38a65c8619 | SQL | jakeandrews186/Databases | /dump.sql | UTF-8 | 3,152 | 3.25 | 3 | [] | no_license | DROP DATABASE IF EXISTS GroupProject;
CREATE DATABASE GroupProject;
USE GroupProject;
INSERT INTO Class (c_number, term, sec_number, description) VALUES
('CS410', "FA18", 1, "Databases"),
('CS410', "FA18", 2, "Databases"),
('CS410', "SP19", 1, "Databases"),
('CS410', "SP19", 2, "Databases"),
('CS410', "FA19", 1, "Dat... | true |
204115f18c667db814c356de2ac427602dadd009 | SQL | ray1028/-BootcampX | /4_queries/4_average_cohort_assistance_time.sql | UTF-8 | 229 | 3.671875 | 4 | [] | no_license | select c.name, avg(completed_at - started_at) as average_assistance_time
from cohorts c join students s
on c.id = s.cohort_id
join assistance_requests ar
on ar.student_id = s.id
group by c.name
order by average_assistance_time;
| true |
14870d37bb55c80db921c490c704fb5e379900ff | SQL | pauljstuart/Scripts | /pl-sql/migrate_entire_schema.sql | UTF-8 | 8,574 | 3.421875 | 3 | [] | no_license |
-- big script to migrate all the data from one schema to another tablespace :
set serveroutput on
prompt
prompt Running MVDS downstream schema migration version 7
prompt
DECLARE
s_owner VARCHAR2(64);
s_target_tablespace VARCHAR2(64) := 'MERIVAL_DATA_OTHER';
i_count INTEGER := 0;
BEGIN
DBMS_OUTPUT.ENABLE ... | true |
344b9d7f501116a204ea74bce2b3b1a00bc6f7ec | SQL | kurnisurni/holidaymaker | /sql/holidaymakerTaskQuery.sql | UTF-8 | 1,390 | 3.84375 | 4 | [] | no_license | /*CREATE VIEW roomsXroom_types AS
SELECT rooms.id AS id, room_types.guests_capacity AS guests_capacity, room_types.description AS description, room_types.accommodation AS accommodation
FROM (rooms JOIN room_types ON((rooms.room_type = room_types.id)));*/
/*CREATE VIEW bookingRooms_date AS
SELECT bookings.check_in AS... | true |
7d6b0c80155f1d12f2e7ebeeac64f3414986668d | SQL | Sumtudou/multi-table-query-english-2019-10-12-6-42-26-537 | /select.sql | UTF-8 | 2,084 | 4.625 | 5 | [] | no_license | # 1.Query the existence of 1 course
select * from student where id in (select studentId from student_course where courseId = 1);
# 2.Query the presence of both 1 and 2 courses
select * from student where id in (select t1.studentId from
(select studentId from student_course where courseId = 1) as t1,
(select student... | true |
3d8a6a749a51b3a83147283f3d6bb12e7cddbba4 | SQL | jabautista/GeniisysSCA | /src/main/resources/revert/Revert-GIIS_MODULES-insert-GIISS224.sql | UTF-8 | 659 | 2.921875 | 3 | [] | no_license | /* Created by : Dren Niebres
* Date Created : 09.15.2016
* Remarks : SR-5278
*/
SET SERVEROUTPUT ON
DECLARE
v_exists VARCHAR2 (1) := 'N';
BEGIN
SELECT 'Y'
INTO v_exists
FROM cpi.giis_modules
WHERE module_id = 'GIISS224';
IF v_exists = 'Y'
THEN
DELETE FROM cpi.giis_modules
... | true |
feeea1bf91cf1bec9b81d4bc0af15be92ea070b1 | SQL | renatabg2205/Pewlett-Hackard-Analysis | /Queries/Employee_Database_challenge.sql | UTF-8 | 5,391 | 4.84375 | 5 | [] | no_license | /*
Deliverable 1: The Number of Retiring Employees by Title
Create a Retirement Titles table that holds all the titles of current employees
who were born between January 1, 1952 and December 31, 1955.
Because some employees may have multiple titles in the database—for example,
due to promotions—you’ll need to ... | true |
631f398e30e576680457f730b214d40c1b65f9ea | SQL | rubiles/Practica2 | /sql/backup.sql | UTF-8 | 3,221 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 08-12-2014 a las 21:24:41
-- Versión del servidor: 5.6.17
-- Versión de PHP: 5.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... | true |
4ebb08cc572c568a0dd9d8bc233ab9f31bac238c | SQL | First-01/dune_queries | /queries/31194_24h_volume.sql | UTF-8 | 244 | 3.359375 | 3 | [] | no_license | WITH swaps AS (
SELECT
usd_amount AS usd_amount
FROM
dex.trades
WHERE
project = 'Balancer'
AND block_time > NOW() - INTERVAL '24h'
)
SELECT
SUM(usd_amount) AS usd_amount
FROM
swaps | true |
7cb93a70f1800ea90807945830da85a3082b2905 | SQL | dmarkwell/snomed-moodle-additional-plugins | /sql/functions/function_MoodleStamp.sql | UTF-8 | 474 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | DELIMITER ;;
DROP FUNCTION IF EXISTS `MoodleStamp`;;
CREATE FUNCTION `MoodleStamp`() RETURNS varchar(255) CHARSET latin1
RETURN CONCAT('elearning.ihtsdotools.org+',DATE_FORMAT(now(),'%y%m%d%H%i%s'),'+',CHAR(FLOOR(RAND()*26)+IF(RAND()>=.5,97,65))
,CHAR(FLOOR(RAND()*26)+IF(RAND()>=.5,97,65)),CHAR(FLOOR(RAND()*26)+IF(RAND... | true |
56ab17dbb3718c6239c2bd13cd247ed4ae5ba6c6 | SQL | AOzsoylu/plsql-scripts | /sql/noextent1.sql | UTF-8 | 1,421 | 3.765625 | 4 | [] | no_license | column owner format a15 heading "Owner"
column segment_name format a50 heading "Object"
column tablespace_name format a25 heading "Tablespace"
column next_extent format 9G999G999 heading "Next (K)"
column max_free format 999G999G999 heading "Max Free (K)"
prompt
select... | true |
3f55bf7dab4928d8ba03ba30a59d8cf8ad1f56ef | SQL | realLewin/Mysql-playground | /database-course/3.crud-commands/2.chanllenge.sql | UTF-8 | 2,844 | 4.125 | 4 | [] | no_license | /**
Create a new database shirts_db;
Create a new table shirts;
the columns: shirt_id article color shirt_size last_worn;
Fill them:
('t-shirt', 'white', 'S', 10),
('t-shirt', 'green', 'S', 200),
('polo shirt', 'black', 'M', 10),
('tank top', 'blue', 'S', 50),
('t-shirt', 'pink', 'S', 0),
... | true |
fb429b4532c450973207116c1cff0de5910a8b43 | SQL | evrimulgen/Oracle-DBA-Life | /INFO/Books Codes/Oracle Database 10g PLSQL/Code/Chapter9/OverloadRestrictReferences.sql | UTF-8 | 977 | 3.171875 | 3 | [
"MIT"
] | permissive | /*
* OverloadRestrictReferences.sql
* Chapter 9, Oracle10g PL/SQL Programming
* by Ron Hardman, Michael McLaughlin and Scott Urman
*
* This script demonstrates overloaded packages.
*/
CREATE OR REPLACE PACKAGE Overload AS
FUNCTION TestFunc(p_Parameter1 IN NUMBER)
RETURN VARCHAR2;
PRAGMA RESTRICT_REFERENC... | true |
798d1965457c85dccf56559f67b39f71ec819ca2 | SQL | ShahakBH/jazzino-master | /bi/bi-dbdw/src/main/resources/deltas/161.sql | UTF-8 | 695 | 3.671875 | 4 | [] | no_license | DROP TRIGGER IF EXISTS players_by_platform_and_time_trigger#
CREATE TRIGGER players_by_platform_and_time_trigger
AFTER INSERT ON rpt_players_by_platform_and_time
FOR EACH ROW
BEGIN
DECLARE source_val varchar(255) DEFAULT '';
SELECT s.SOURCE into source_val
FROM rpt_account_sources_mv s
WHERE s.ACCOUNT_ID = N... | true |
69c99aca17e216e76f88476703b42f4061a491d2 | SQL | lumenwrites/sketchdaily | /backend/prisma/migrations/20210702052312_implicit_posttags/migration.sql | UTF-8 | 878 | 3.796875 | 4 | [
"MIT"
] | permissive | /*
Warnings:
- You are about to drop the `PostTags` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "PostTags" DROP CONSTRAINT "PostTags_postId_fkey";
-- DropForeignKey
ALTER TABLE "PostTags" DROP CONSTRAINT "PostTags_tagId_fkey";
-- DropIndex
DROP INDEX... | true |
beecee1ebc4a698ac01eb3f694dd33890b3458d5 | SQL | jumorris2017/SQL-queries | /HomeStore__SBP416.sql | UTF-8 | 3,694 | 4.0625 | 4 | [] | no_license | --/* CAW */
--/* % home store customers */
WITH SQ AS(
SELECT
T3.STORE_NUM
,T3.FSCL_YR_NUM
--,SUM(CASE WHEN T2.HOME_STORE = T3.STORE_NUM THEN 1 ELSE NULL END) AS HS_CUST_COUNT
--,COUNT(DISTINCT T2.GUID_ID) AS ALL_CUST_COUNT
,ROUND(SUM(CASE WHEN T2.HOME_STORE = T3.STORE_NUM THEN 1 ELSE NULL END) / COUNT(DIST... | true |
26070f32645b93553092143dafc5eccf130adfe2 | SQL | felismelo22/sis | /database.sql | UTF-8 | 2,217 | 2.546875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
DROP TABLE IF EXISTS... | true |
4926d0308c6312c790c719f26e3b9a95a5c0ebcf | SQL | kumaryash18/HackerrankPracticeProblems | /SQL/1. BASIC SELECT/04. Select By ID.sql | UTF-8 | 146 | 2.78125 | 3 | [
"MIT"
] | permissive | -- # Problem: https://www.hackerrank.com/challenges/select-by-id/problem
-- # Score: 10
-- # Difficulty: Easy
SELECT *
FROM CITY
WHERE ID = 1661; | true |
923699515b519a554b824a051c9e041fd19fd136 | SQL | trajepl/Kiyoshi | /soochow.sql | UTF-8 | 98,398 | 3.265625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50713
Source Host : localhost:3306
Source Database : soochow
Target Server Type : MYSQL
Target Server Version : 50713
File Encoding : 65001
Date: 2016-08-08 16:34:24
*/
SET FOREIGN_KEY_CHECKS=0;
... | true |
b08658a56a10259579e2c6f13f544fc46642013f | SQL | kdnc/mssql-reference-application | /general/sql-examples-vt-is-sbtb-p1020/Chapter 7 - Views/0703_Using_the_union_clause.sql | UTF-8 | 626 | 3.6875 | 4 | [] | no_license | -- Union takes first record set and appends the second record set
-- Both record sets should have the same number of columns and same data tpes in each column
create view dbo.vwUnionContractStats
as
select c.contactid, c.fn as Firstname, c.sn as Lastname, b.contractValue, b.ranking, b.contractYear
from dbo.vwAnnualBe... | true |
be19d166584d5e004b61502475e6db3f16e5ce6b | SQL | GradedJestRisk/db-training | /RDBMS/ORACLE/SQL/dblink.sql | UTF-8 | 1,278 | 3.265625 | 3 | [] | no_license | ---------------------------------------------------------------------------
-------------- Rights -------------
---------------------------------------------------------------------------
SELECT
DISTINCT PRIVILEGE AS "Database Link Privileges"
FROM ROLE_SYS_PRIVS
WHERE 1=1
AND PRIVILEGE IN (
... | true |
668ab043be4c7bda01d7e08093e5240a2101a1f7 | SQL | CHENXI-s1874351/Leetcode_excecise | /sql/Running_Total_for_Different_Genders.sql | UTF-8 | 256 | 3.71875 | 4 | [] | no_license | # Write your MySQL query statement below
select s1.gender as gender, s1.day as day, sum(s2.score_points) as total
from Scores s1, Scores s2
where datediff(s1.day, s2.day) >= 0 and s1.gender = s2.gender
group by s1.gender, s1.day
order by s1.gender, s1.day
| true |
9786b9caccb27f9631323db9b1c00c237a8eac36 | SQL | MLClark/Bookmarks | /Benefit Specific/COBRA/cobra-eligible.sql | UTF-8 | 1,141 | 3.09375 | 3 | [] | no_license | select * from person_employment where emplstatus = 'T' and effectivedate >= '2018-01-01';
select * from person_names where nametype = 'Legal'
and current_date between effectivedate and enddate and current_timestamp between createts and endts and personid in
(select personid from person_bene_election where ben... | true |
c49233cb190b77e7c187c05d35f51ef0fe9fb243 | SQL | mikeburns22/Bulls-and-Cows | /countingDB.sql | UTF-8 | 434 | 3.25 | 3 | [] | no_license | create database if not exists countingDB;
use countingDB;
create table Game (
ID int primary key auto_increment,
GameDone bool default false,
FinalAnswer char(4) not null
);
create table Round (
ID int primary key auto_increment,
GameID int,
foreign key fk_game (GameID)
references Game(ID)... | true |
5f9170df594901be9022e87490abf2fd98e066b0 | SQL | bekumar123/cs-studio | /applications/plugins/org.csstudio.dct.desy/resources/tables.sql | UTF-8 | 246 | 2.625 | 3 | [] | no_license | CREATE TABLE `desy_record_db`.`records`
(
id int PRIMARY KEY NOT NULL,
io_name text NOT NULL,
epics_name text NOT NULL,
record_type text NOT NULL,
dct_id text,
dct_project_id text
)
;
CREATE UNIQUE INDEX PRIMARY ON records(id)
; | true |
2fa5511d8f7559fe9f53f2b723b88aec28c563b8 | SQL | dwalone/Redditvirus | /sql/upward_infection_chain_query.sql | UTF-8 | 423 | 3.203125 | 3 | [] | no_license | WITH RECURSIVE
infected_record(level, name) AS (
VALUES(0, '<reddit user>')
UNION
SELECT infected_record.level+1, infections.infector
FROM infections, infected_record
WHERE infections.name = infected_record.name
)
SELECT infected_record.level, infections.name
FROM infec... | true |
6a50a0faf2c005d19d60630375333ecdb7f1468b | SQL | JacoKritzinger/SQL | /employeesDB/project1_employeesDB.sql | UTF-8 | 3,443 | 3.390625 | 3 | [] | no_license | create table Employees (
Employee_id bigserial ,
first_name varchar(30),
last_name varchar(30),
Date_of_birth varchar(20),
id_number varchar(20),
Age varchar(3),
nationality varchar(100)
);
create table Department (
Department_id bigserial,
Department_name varchar(50),
CONSTRAINT Department_key PRIMARY... | true |
12f6bc495245c18854cdf0e176b9fbb39caee14f | SQL | ASKJR/Coavalieitor | /database/sql/feedback_abertos_by_profe.sql | UTF-8 | 324 | 3.296875 | 3 | [] | no_license |
select * from usuario p inner join turma t on t.professor_usuario_id = p.id
inner join avaliacao a on a.turma_id = t.id
inner join solucao s on s.avaliacao_id = a.id
inner join correcao c on c.solucao_id = s.id
left join correcao_final cf on cf.avaliacao_id = a.id
where p.id = 3 and cf.feedback is ... | true |
6ab81f33c3770c6f6bde090389ca90cc5b0877ad | SQL | Henrique-Santana/Sprint1-BancoDados-SQL | /SQL banco/RoteiroLivros.sql | ISO-8859-1 | 1,854 | 3.625 | 4 | [] | no_license | -- comando para criar banco de dados
-- DDL Linguagem de Definio de dados
CREATE DATABASE RoteiroLivros;
USE RoteiroLivros;
CREATE TABLE Generos( --ATRIBUTO SEMPRE DENTRO DO PARENTESES E ANTES DO PARENTESES A ENTIDADE
IDGenero INT PRIMARY KEY IDENTITY, -- PRIMARY KEY A CHAVE PRIMARIA --IDENTITY NO DEIXA REPETIR ... | true |
60514984fda12249547f48db8bef11a6a7746020 | SQL | bellmit/xishiweb | /guns-parent/doc/sql/schema.sql | UTF-8 | 13,009 | 3.34375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Fri Mar 8 13:10:23 2019
-- 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 |
314d339f53e91c97adf5f158115b70a2a6ce5d7b | SQL | Database-Final-Project-sp2021/March-Madness-Database | /March-Madness-Data.sql | UTF-8 | 18,444 | 3.109375 | 3 | [] | no_license | /*Order of insert: best_player -> team -> region -> matchup */
/*Values need to be present in previous table*/
/*delete from matchup;
delete from region;
delete from team;
delete from best_player;*/
/*Best_Player Populating*/
insert into best_player values ('Drew', 'Timme', 'Senior', 17);
insert into best_pla... | true |
5b853c855999a85fd3247dcc54142b3486b989c3 | SQL | tsubasa0404/mosaic | /DataBase/NEW/CAREERS.SQL | UTF-8 | 1,698 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2015 年 8 朁E13 日 11:56
-- サーバのバージョン: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101... | true |
c20185278a1ace9366114bb837f1a34991992066 | SQL | RizwanIqbal15/SQL | /Bus Schema Queries/Bus Schema.sql | UTF-8 | 7,050 | 4.09375 | 4 | [] | no_license | /*
CREATING BASIC SCHEMA TABLE
*/
CREATE TABLE USERS(
first_name VARCHAR2(50),
last_name VARCHAR2(50),
password VARCHAR2(50),
email VARCHAR2(50),
mobile_no CHAR(10),
wallet_money NUMBER(10,2),
role_name VARCHAR2(50)
);
CREATE TABLE BUS(
BUS_model VARCHAR2(50),
BUS_owner VARCHAR2(50),
BUS_number CHAR(10... | true |
cf626ee80ea9f1754662e2f2e52f6be02ee1a516 | SQL | mihailkuzmin/testing-system | /src/server/db/setup.sql | UTF-8 | 1,753 | 3.703125 | 4 | [
"MIT"
] | permissive | CREATE TABLE PLanguage (
id SERIAL PRIMARY KEY,
name varchar(30) NOT NULL
);
CREATE TABLE Role (
id SERIAL PRIMARY KEY,
name varchar(30) NOT NULL
);
CREATE TABLE StudentGroup (
id SERIAL PRIMARY KEY,
name varchar(20) UNIQUE NOT NULL
);
CREATE TABLE Student (
id SERIAL PRIMARY KEY,
last_name varchar(30)... | true |
6c4fb2431de4895c1cb518d48c53cdebeb97e5f9 | SQL | imo-mp-20/Aleksandr_Sedrysev | /ЛБ_3/№8_2.sql | UTF-8 | 184 | 3.59375 | 4 | [] | no_license | select orders.onum, customers.cname, salespeople.sname
from orders, customers, salespeople
where orders.cnum = customers.cnum and orders.snum = salespeople.snum
order by orders.onum | true |
e2251dfa52f94da542fa1137d759180c80d53156 | SQL | collabsoft/Storage-Boxx | /core/storage-boxx.sql | UTF-8 | 1,412 | 3.59375 | 4 | [
"MIT"
] | permissive | CREATE TABLE `stock` (
`stock_sku` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`stock_name` varchar(255) NOT NULL,
`stock_desc` varchar(255) DEFAULT NULL,
`stock_unit` varchar(255) NOT NULL,
`stock_qty` decimal(12,2) NOT NULL DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE... | true |
62ea35123e670b89c075ea327040af72fcb4e9b9 | SQL | dhenriquedba/SQL | /scripts_auxiliares/ModifyDefaultPartition.sql | UTF-8 | 952 | 3.03125 | 3 | [] | no_license | @login
set echo off feedback off pages 0 linesize 150
spool __ModifyDefaultPartition_1.SQL
select 'alter table '||d.owner||'.'||d.table_name||' modify default attributes tablespace '||p.tablespace_name||';'
from DBA_PART_TABLES d, dba_tab_partitions p
where d.owner not in ('SYS','SYSTEM')
and d.table_name= p.ta... | true |
fddc3b2c7f8952af094e0584531e80ac4bebf795 | SQL | briffraff/SoftUni_ | /04.01 Databases Basic/SQL resheniq-lekcii/ExamPrep2/Solution_ExamPrep2.sql | UTF-8 | 5,058 | 4.40625 | 4 | [] | no_license | CREATE TABLE Cities
(
Id INT PRIMARY KEY IDENTITY,
Name NVARCHAR(20) NOT NULL,
CountryCode CHAR(2) NOT NULL
)
CREATE TABLE Hotels
(
Id INT PRIMARY KEY IDENTITY,
Name NVARCHAR(30) NOT NULL,
CityId INT FOREIGN KEY REFERENCES Cities(Id) NOT NULL,
EmployeeCount INT NOT NULL,
BaseRate DECIMAL(15,2)
)
CREATE TABLE... | true |
475f2bc45d403da8ca1c338e2a505b2e9090d0c2 | SQL | metallgun/rand_data_generator | /Analysis_of_data.sql | WINDOWS-1251 | 1,524 | 3.953125 | 4 | [] | no_license |
with cross_join as
(
select s.*, m.name as month, m.start_date as month_start, m.end_date as month_end from subscriptions s
cross join months m
),
table1 as
(
select
id,
case
when start_date < month_start and end_date > month_start then 1 else 0
end as old_users,
case
when start_date between month_... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.