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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
eb8ff4663c80d101b3129d8d4928eb4975349877 | SQL | RWShelton/Galatea | /CRSFF_DB/read_CSV.sql | UTF-8 | 6,247 | 4.28125 | 4 | [
"MIT"
] | permissive | CREATE TABLE CSV_import (
author_first TEXT,
author_last TEXT,
title TEXT,
source TEXT,
editor_first TEXT,
editor_last TEXT,
year INTEGER,
language TEXT,
place_of_publication TEXT,
publisher TEXT,
page_start TEXT,
page_end TEXT,
translator_first TEXT,
translator_last TEXT,
edition TEXT,
keyword TEXT,
o... | true |
74dd2e61fb74b27d1a26dcdf99ab7d6e29687f7a | SQL | dsuru1499/siri-xlite-quarkus-hr | /src/main/resources/db/migration/V1.0.0__Initiale_version.sql | UTF-8 | 14,237 | 2.9375 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 12.6
-- Dumped by pg_dump version 12.6
--
-- Name: call; Type: TABLE; Schema: public; Owner: siri-xlite
--
CREATE TABLE public.call (
id integer NOT NULL,
actualarrivaltime time without time zone,
actualdeparturetime time without time zone... | true |
46f61414bed44e42c9449a7f1ac75a79c68d8a78 | SQL | bakink/DBA_Oracle | /oem_db_listener.sql | UTF-8 | 700 | 2.78125 | 3 | [] | no_license | col host_name for a30
col target_name for a38
col property_name for a20
col property_value for a5
SELECT mgmt$target.host_name
, mgmt$target.target_name
--, mgmt$target.target_type
, mgmt$target_properties.property_name
, mgmt$target_properties.property_value
FROM mgmt$target
, mgmt$target_properties
WHERE ( mg... | true |
240c232f59dce55ccb38d6396fcd9a1be274da13 | SQL | bayardg/Base-de-don-nes | /u.sql | UTF-8 | 1,835 | 3.71875 | 4 | [] | no_license | --Requete 1
--Cas d un forfait DI :
SELECT prix FROM ForfaitDI WHERE idForfait = 'VeloElecGuillaume';
--Cas d un forfait DL :
SELECT (dateFin-dateDebut)*24*prix FROM ForfaitDL WHERE idForfait = 'VeloGuillaume';
-- Le .java est beaucoup plus précis.
--Requete 2
SELECT v.idV, SUM(DateArrivee - DateDepart)/(COUNT (*))
F... | true |
197d0cccf77f755d88d3465bbcfe44be89c9e65e | SQL | TmanishaT/Functional-Programming | /raiseSalaryProc.sql | UTF-8 | 765 | 3.53125 | 4 | [] | no_license | SET SERVEROUTPUT ON
CREATE OR REPLACE PROCEDURE raiseEmpSalary (
p_emp_id MyEmployees.employee_id%TYPE,
p_sal_raise NUMBER
) AS
v_emp_update_count INTEGER:=0;
BEGIN
UPDATE MyEmployees set salary = (salary*p_sal_raise/100)+salary where employee_id = p_emp_id;
v_emp_update_count := SQL%ROWCOUNT;
IF v_emp_update_... | true |
5519aae937c95549c20f8f97e691e8322b0cac96 | SQL | zvezdomirov/sql-course | /05_table-relations/exercise/05_ex-solutions.sql | UTF-8 | 5,795 | 4.0625 | 4 | [] | no_license | #problem 1
CREATE TABLE passports(
`passport_id` INT NOT NULL AUTO_INCREMENT,
`passport_number` CHAR(8) UNIQUE NOT NULL,
PRIMARY KEY (`passport_id`)
);
ALTER TABLE passports
AUTO_INCREMENT = 101;
CREATE TABLE persons(
`person_id` INT NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(50) NOT NULL,
`sal... | true |
c6335ebfebab452d3e6b399086b23b93bd698eb9 | SQL | ZVlad1980/adm_scripts | /sql/cbo/tuning_sets/example_select_cursor_chache.sql | UTF-8 | 4,110 | 3.96875 | 4 | [] | no_license | -- Get sql ids and sql text for statements with 500 buffer gets.
SELECT sql_id, sql_text
FROM table(DBMS_SQLTUNE.SELECT_CURSOR_CACHE('buffer_gets > 500'))
ORDER BY sql_id;
-- Get all the information we have about a particular statement.
SELECT *
FROM table(DBMS_SQLTUNE.SELECT_CURSOR_CACHE('sql_id = ''4rm4183czbs7j... | true |
eafd5e7737bd01a68998b7548bec0755d45bd8af | SQL | lrichiewl/SeckillAPI | /src/main/sql/schema.sql | UTF-8 | 2,192 | 3.921875 | 4 | [] | no_license | /**
* @author RyanLu
* 本文件为脚本文件,在终端运行,不在IDEA上运行。
*/
CREATE DATABASE seckill;
use seckill;
CREATE TABLE seckill(
`seckill_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '商品库存ID',
`name` varchar(120) NOT NULL COMMENT '商品名称',
`number` int NOT NULL COMMENT '库存数量',
`start_time` timestamp NOT NULL DEFAULT CU... | true |
92e6113a50f60f851ddb7bf6a512606a8e8bdbe3 | SQL | maltablock/eosio_chaindb | /sql/chaindb_dbtables.sql | UTF-8 | 5,017 | 3.59375 | 4 | [] | no_license | CREATE DATABASE chaindb;
CREATE USER 'chaindb'@'localhost' IDENTIFIED BY 'ce5Sxish';
GRANT ALL ON chaindb.* TO 'chaindb'@'localhost';
grant SELECT on chaindb.* to 'chaindbro'@'%' identified by 'chaindbro';
use chaindb;
CREATE TABLE TRANSFERS
(
network VARCHAR(15) NOT NULL,
seq BIGINT UNSIGNED NOT NUL... | true |
0781ef4a98159b03c622d99d9f71e68fcee66db4 | SQL | Polina10034/SqlDB-Project | /SQL/recordstudio_record.sql | UTF-8 | 2,408 | 3.0625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.15, for Win64 (x86_64)
--
-- Host: localhost Database: recordstudio
-- ------------------------------------------------------
-- Server version 8.0.15
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... | true |
24a822ea872883130b9b33ea42bcf81a5fd26840 | SQL | hatefi-arman/Modules | /Fuel/FuelReportImporter/Database/Import Voyages.sql | UTF-8 | 364 | 3 | 3 | [] | no_license | INSERT INTO Fuel.Voyage
SELECT
[VoyageNumber]
,[VoyageNumber] AS [Description]
,1 AS [VesselInCompanyId] --For ABBA In SAPID
,11 AS CompanyId -- SAPID
,[StartDateTime] AS [StartDate]
,[EndDateTime] AS [EndDate]
,[IsActive]
FROM dbo.SAPIDVoyagesView
INNER JOIN Fuel.Vessel ON Vessel.Code COLLATE Arabic_CI_AS = SAPID... | true |
7facc0ab89f7a28df35a28da6a2d8114d78bc0a0 | SQL | FUUK/fuuk | /fuuk/people/models/sql/updates/update-0.11-human.mysql.sql | UTF-8 | 1,187 | 3.234375 | 3 | [] | no_license | ALTER TABLE people_human ADD COLUMN subtitle varchar(200);
ALTER TABLE people_human ADD COLUMN subtitle_en varchar(200);
ALTER TABLE people_human ADD COLUMN subtitle_cs varchar(200);
ALTER TABLE people_human ADD COLUMN cv longtext;
ALTER TABLE people_human ADD COLUMN cv_en longtext;
ALTER TABLE people_human ADD COLUMN ... | true |
108c39bef1cc324253bbcd5e2859c3f9489d0504 | SQL | k2003/HospitalOSV3 | /HospitalOSV3/app/database/dental/dental_update_1.sql | UTF-8 | 12,435 | 3.328125 | 3 | [] | no_license | ---------------------------------------------------------- DENTAL Version 1.1.070707----------------------------------------
--- สร้างตาราง t_dental_order ใหม่ เนื่องจากมีการเปลี่ยนแปลง Flow การทำงาน
DROP TABLE t_dental_order;
CREATE TABLE t_dental_order (
t_dental_order_id character varying(255) NOT NULL,
t_pa... | true |
ebdab90d5a03bfaa66d1aed135dd1b4dcf05bb26 | SQL | deadbird1980/ams | /app/db/visa_application.sql | UTF-8 | 603 | 2.625 | 3 | [] | no_license | DROP TABLE IF EXISTS `visa_application`;
CREATE TABLE `visa_application` (
`id` int(11) NOT NULL,
`application_id` int(11) NOT NULL,
`type` char(10) NOT NULL DEFAULT '',
`start_date` date NOT NULL,
`passport_no` char(10) NOT NULL DEFAULT '',
`passport_start_date` date NOT NULL,
`passport_end_date` date N... | true |
41d260545fc4444d4d6ff16f8783e031e0092f6b | SQL | lisamarie616/sql-crowdfunding-lab-v-000 | /lib/insert.sql | UTF-8 | 1,845 | 2.640625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | INSERT INTO projects (id, title, category, funding_goal, start_date, end_date) VALUES
(1, "Cat Mansion Renovation", "Cats", 150000, "12/30/2015", "12/31/2015"),
(2, "Cat Toy Replacement", "Cats", 10000, "01/15/2016", "01/31/2016"),
(3, "Cat Food Stock-up", "Cats", 25000, "01/01/2016", "01/07/2016"),
(4, "Dog House Ren... | true |
0e5b435a2655acc83832455866c4f811bf4fb9e1 | SQL | AlinaSadovskaya/DataMola_course | /U2/lw7/scripts/mv_model_clouse.sql | UTF-8 | 1,392 | 3.640625 | 4 | [] | no_license | DROP MATERIALIZED VIEW mv_PRICE_SALES_MONTHLY;
CREATE MATERIALIZED VIEW mv_PRICE_SALES_MONTHLY
BUILD IMMEDIATE
REFRESH COMPLETE ON DEMAND START WITH SYSDATE NEXT (SYSDATE + 1/1440)
AS
SELECT /*+ parallel(ff 8 prg 8)*/
DISTINCT PRODUCT_NAME AS PRODUCT
, NVL(PROMOTION, 'ALL SALES') AS PROMOTION
... | true |
b3e0e75a0d13b645f201c742f1d173058f62f0ec | SQL | liyasthomas/feedie | /database/feedie_base (Test Build).sql | UTF-8 | 40,528 | 3.34375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 10, 2018 at 03:26 PM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
bc5559a163c1ec27199673393faf964fee3b1330 | SQL | NatanMelo95/Serratec | /Banco de dados/produtos.sql | UTF-8 | 827 | 2.875 | 3 | [] | no_license | Criando coluna desconto
ALTER TABLE produto ADD COLUMN desconto double precision;
Criando coluna valor_desconto
ALTER TABLE produto ADD COLUMN valor_desconto double precision;
Criando coluna valor_com_desconto
ALTER TABLE produto ADD COLUMN valor_com_desconto double precision;
Atribuindo percentual do desconto a col... | true |
517e329f1f9d4d281c530d8ccd6a9874816b0b6e | SQL | MohamedSoliman2022/BI-First-Enquiry-scripts-Scedual-Doctors-clinics | /ACtual vs apology vs planed clinics- OPD live.sql | WINDOWS-1256 | 1,936 | 3.71875 | 4 | [] | no_license |
SELECT *
FROM [opd].BK_PatternInstance i
left join [opd].PHS_OPDPattern o
on o.id = i.PatternID
and o.PhysicianID=168
where i.StartDateTime between '2020-10-11 01:00:00.000'and '2020-10-11 23:00:00.000'
and o.PhysicianID=168
and i.IsActive=1
order by i.StartDateTime desc
----------------------
selec... | true |
9f6e8faeb810189333c2d997024a1edec0b9697f | SQL | gilmagno/consulta | /db/consulta.sql | UTF-8 | 50,975 | 3.484375 | 3 | [] | no_license | create table states (
id serial primary key,
name varchar,
abbreviation varchar
);
create table cities (
id serial primary key,
state_id int references states,
name varchar
);
----------------------------------------------------------------------
create table clients (
... | true |
80c35b3ef8a36d9492821c91dc9bc11d60b72ce5 | SQL | thelia-modules/ColissimoLabel | /Config/update/1.0.0.sql | UTF-8 | 1,053 | 2.921875 | 3 | [
"MIT"
] | permissive | # This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
-- ---------------------------------------------------------------------
-- colissimo_label
-- ---------------------------------------------------------------------
ALTER... | true |
7a257bb6ac87c36363fbe372d4fbd0cf75f8c30d | SQL | qimy1314524/note | /杂记/sql图片/day1.sql | UTF-8 | 820 | 3.671875 | 4 | [] | no_license | #========day_2.1=========
ALTER TABLE stu ADD tea_id VARCHAR(30)
ALTER TABLE stu ADD FOREIGN KEY
(tea_id) REFERENCES teacher(tea_id)
ALTER TABLE stu DROP FOREIGN KEY stu_ibfk_1
ALTER TABLE stu DROP INDEX tea_id
ALTER TABLE stu DROP FOREIGN KEY tea_stu_id
ALTER TABLE stu DROP INDEX tea_stu_id
ALTER TABLE stu ADD CONSTR... | true |
464efc9cc54afc6c8ae45440193c5461db8b24fb | SQL | Mygrey/mrgray.notebook | /traffic/code/traffic_mysql_create.sql | UTF-8 | 7,874 | 2.578125 | 3 | [] | no_license | grant all on traffic.* to 'root'@'%' identified by 'bigDataTeam' with grant option;
create table zc_driver_train(
sfzh varchar(50),
jl int(11),
zt int(11),
ryzt int(11),
max_wfxw int(11),
level1_count int(11),
level2_count int(11),
level3_count int(11),
wfxw_count int(11),
max_wfjfs int(11),
a... | true |
d7e1df8fcd144205bda8c21248227d24b80362d0 | SQL | Elang89/Proyecto-I-Bases-I | /SQL scripts/21.CreatePetEnergy.sql | UTF-8 | 251 | 2.859375 | 3 | [] | no_license | /* Made by Miuyin Yong
Script for creating Pet's Energy Level table
*/
CREATE TABLE PetEnergy
(
pet_energy_level varchar2(30) CONSTRAINT pet_energy_level_nn NOT NULL, /*Pet's energetic level from 0 to 5*/
pet_energy_code NUMBER(10) /*PRIMARY KEY*/
); | true |
c1dd5800a01e08fa9853acd7f765f5ac4f6d27dc | SQL | Oleiva/Testing | /sql/dreamshop_items.sql | UTF-8 | 2,416 | 2.84375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: localhost Database: dreamshop
-- ------------------------------------------------------
-- Server version 5.7.9-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;... | true |
aae423b396bfa5930af793f47ca38f67eec71dc6 | SQL | Eshi44/Employee-Tracker | /company_employees_db.sql | UTF-8 | 2,222 | 4.34375 | 4 | [] | no_license | DROP DATABASE IF EXISTS company_employees_db;
CREATE database company_employees_db;
USE company_employees_db;
-- * **department**:
CREATE TABLE department (
-- * **id** - INT PRIMARY KEY
id INT NOT NULL AUTO_INCREMENT,
-- * **name** - VARCHAR(30) to hold department name
department_name VARCHAR(30)... | true |
2d05d1d938c673ca7608f1f3dea7454f2dd4b64e | SQL | mandmod/trining | /member.sql | UTF-8 | 2,236 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 09, 2012 at 10:37 PM
-- Server version: 5.1.50-community
-- PHP Version: 5.3.14
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_C... | true |
89555bf53138d2fd215e536336eda5eda590f24f | SQL | pamidipadmapriya/bootstrap | /sql/derex.sql | UTF-8 | 3,284 | 2.921875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 02, 2014 at 06:39 PM
-- Server version: 5.5.8
-- PHP Version: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SE... | true |
2504912311afec0a2da45d6f8cf5b49a9c567597 | SQL | nsh92/Bigdata-and-Machine-Learning-Education-at-ITWILL | /1_Database_SQL/chap09_GroupFunction/groupFunction_exam.sql | UTF-8 | 1,605 | 4.4375 | 4 | [] | no_license | /*
* 집합 함수(COUNT,MAX,MIN,SUM,AVG)
* 작업 대상 테이블 : EMP, STUDENT, PROFESSOR
* '별'로 끝난다 = 그룹바이를 써라
*/
select * from emp;
select * from student;
select * from professor;
--Q1. EMP 테이블에서 소속 부서별 최대 급여와 최소 급여 구하기
select max(sal) "최대 급여", min(sal) "최소 급여" from emp group by deptno;
--Q2. EMP 테이블에서 JOB의 수 출력하기
select job, ... | true |
51fa8406ebde243355325e363ed0c3fd968238ec | SQL | dennishemken/ination | /EZ Data/phone_info.sql | UTF-8 | 387 | 2.984375 | 3 | [] | no_license | SELECT
"public"."PHONE"."CONTACTID",
"public"."PHONE"."AREACODE"||'-'||"public"."PHONE"."DIALNUMBER" as Phone_number,
"public"."PHONE"."EXTENSION",
"public"."PHONE"."PHONETYPE",
"public"."PHONE"."REMARK",
"public"."PHONE"."PURENUMBER"
FROM
"public"."PHONE"
where "CONTACTID" in
(
SELECT
"public"."CONTACT"."CONTACTID"
F... | true |
3589a2b5908688d17ac32587e975ff4b927fe0fd | SQL | djsavaliya/hostel-management | /databases/managers.sql | UTF-8 | 616 | 3.5 | 4 | [] | no_license | DROP TABLE IF EXISTS `managers`
CREATE TABLE `managers` (
`manager_id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(255) NOT NULL,
`last_name` varchar(255) NOT NULL,
`date_of_birth` date NOT NULL,
`mobile` varchar(30) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
... | true |
5beeeec9082a571cbf9756912afa8158c16fd853 | SQL | misaelobregon/Unit-4-HW-PySchools | /SQL HW7/SQL Table _Schemata_Misa.sql | UTF-8 | 1,530 | 3.84375 | 4 | [] | no_license | -- Create tables. DROP TABLES as failsafe
DROP TABLE IF EXISTS departments;
DROP TABLE IF EXISTS dept_emp;
DROP TABLE IF EXISTS dept_manager;
DROP TABLE IF EXISTS employees;
DROP TABLE IF EXISTS salaries;
DROP TABLE IF EXISTS titles;
CREATE TABLE departments (
dept_no character varying(20) NOT NULL,
dept_name char... | true |
76324d276b8072387e1b0aceedae2c8f93eb9811 | SQL | jpvelsamy/mingo | /sql-scripts/fligh-plan-schedule-dml.sql | UTF-8 | 2,601 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | TRUNCATE `mingo_txn`.`flight_plan`;
TRUNCATE `mingo_txn`.`flight_plan_detail`;
TRUNCATE `mingo_txn`.`ticket_pool`;
INSERT INTO `mingo_txn`.`flight_plan` (`flight_plan_id`, `flight_start_date`, `flight_end_date`, `is_multi_city_stop`, `first_origin`, `last_destination`, `seat_count`, `public_seat_count`, `captive_s... | true |
4b33e29fdec9c32ad566c7628820af8d8296cfe3 | SQL | Vutov/Web-Development-Basics-Project | /Cart.sql | UTF-8 | 6,257 | 3.359375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 28, 2015 at 07:49 PM
-- 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 |
43d3d6f7e8d229b0103dd75aeb06eda636bac895 | SQL | carlosjuraszek/adventure_works | /academy_adventure_works/models/staging/stg_product.sql | UTF-8 | 2,128 | 3.21875 | 3 | [] | no_license | with src_data as (
select
cast(productid as INT64) as id_produto
, name as produto
, productnumber as produto_numero
, case
when makeflag is true then 'Sim'
else 'Nao'
end as produto_comprado
, case
when finishedgoodsflag is true ... | true |
bcecf28e048a052f9c17b17944c282924790c1c5 | SQL | carluazevedo/websis | /sql/03_reg_ponto.sql | UTF-8 | 559 | 2.609375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #######################################
# CRIAR TABELA PARA REGISTRO DE PONTO #
#######################################
CREATE TABLE IF NOT EXISTS `reg_ponto_carlu` (
`id` int(6) UNSIGNED NOT NULL AUTO_INCREMENT,
`data` date NOT NULL DEFAULT '0000-00-00',
`folga` tinyint(1) DEFAULT NULL,
`entrada_1` ti... | true |
edeca95fc10a44163f412798eb415904c3a1e1d4 | SQL | eshxd41/AgileTool | /StoredProcedure.sql | UTF-8 | 4,689 | 3.109375 | 3 | [] | no_license | DELIMITER $$
DROP PROCEDURE IF EXISTS project_reset $$
CREATE PROCEDURE project_reset()
BEGIN
-- Disable foreign key constraint checks
SET FOREIGN_KEY_CHECKS = 0;
-- Empty tables and set their auto-incrément to 1
TRUNCATE TABLE acceptance_test;
TRUNCATE TABLE acceptance_test_status;
TRUNCATE TABLE feature;... | true |
eb3f6fbcec3cd24093318ed8c6825f6715c2041e | SQL | Yan-Brav/ua.skillsup.gelius | /config/db/testData.sql | UTF-8 | 3,885 | 2.71875 | 3 | [] | no_license | INSERT INTO client (client_id, company_name, phone_number) VALUES
(1, 'АВК', '+38050-355-62-78'),
(2, 'Ласунка', '+38066-355-62-78'),
(3, 'Петрушенко', '+38067-355-62-78');
INSERT INTO product_type (product_type_id, product_type) VALUES
(1, 'Ящик (4 клапана)'),
(2, 'Ящик сложный'),
(3, 'Ящик (крышка)'),
... | true |
f14f8668ea399b7d3b528ef114e932842beb4c9c | SQL | RUM/barrica | /sql/collaborations.sql | UTF-8 | 1,385 | 3.96875 | 4 | [] | no_license | create type collaboration_types as enum ('author', 'co-author', 'translator', 'editor', 'guest', 'producer', 'host');
create table if not exists
collaborations (
relation collaboration_types
, collab_id uuid references collabs (id) on update cascade
, article_id uuid references articles (id) on update cascade... | true |
2dbb3770ae37d2381ed59e62e65f748bcec45b5d | SQL | moumoukings/LearnForJavaEE | /day29/Database/sort.sql | UTF-8 | 578 | 3.03125 | 3 | [
"MIT"
] | permissive | CREATE TABLE sort(
sid INT PRIMARY KEY AUTO_INCREMENT,
sname VARCHAR(100),
sprice DOUBLE,
sdesc VARCHAR(5000)
);
-- 初始化数据
INSERT INTO `sort`(sname,sprice,sdesc) VALUES ('家电',2000,'优惠的促销'),
('家具',8900,'家具价格上调,原材料涨价'),
('儿童玩具',300,'赚家长钱'),
('生鲜',500.99,'生鲜商品'),
('服装',24000,'换季销售'),
('洗涤',50,'洗发水促销')... | true |
917d00e234cff16f07a3b0436ec920d39d788de4 | SQL | nicvidal/SocialRecipe-SGBD | /sql/consultations.sql | UTF-8 | 6,645 | 4.21875 | 4 | [] | no_license | -----------------------------------------------------------------------------
--Consultations
-----------------------------------------------------------------------------
-- Informations sur recettes :
SELECT id_recipe, recipe_name, date_added, preparation_time, cooking_time, waiting_time, servings
FROM recipe;
-- I... | true |
b98060f93c3e136fcee5190cdcdb3bb63c64f138 | SQL | vijaydairyf/TimelyFish | /SolomonApp/dbo/Stored Procedures/dbo.ADG_ProcessMgr_ARCustID.sql | UTF-8 | 205 | 2.71875 | 3 | [] | no_license | create proc ADG_ProcessMgr_ARCustID
as
select ar.CpnyID,
ar.CustID
from ARDoc ar
join CustomerEDI ca
on ca.CustID = ar.CustID
where ca.CreditRule = 'B'
group by ar.CpnyID,
ar.CustID
| true |
f3b9c34ffb3175a75fd3fb4f4b782ce99b19ca42 | SQL | romain-teste/CNAM_USAL37_2020-3 | /USAL37/tp_freelancer/tp_freelancer_selects.sql | UTF-8 | 379 | 3.359375 | 3 | [] | no_license | USE tp_feelancer;
SELECT
customer_name, cat_name
FROM customers
JOIN customers_cats ON customers.cat_id = customers_cats.cat_id;
SELECT customer_id, customer_name, customer_email
FROM customers;
SELECT
job_title,
J.customer_id,
customer_name, cat_name
from jobs AS J
JOIN customers AS C ON J.customer_id = C.custome... | true |
32ea1d7e465b8e9243ee343a5a695a6ada423024 | SQL | EmuZONE/FrozenEMU | /Database/game_event_npcflag.sql | UTF-8 | 1,249 | 2.78125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : TrinityWotLK
Source Server Version : 50634
Source Host : localhost:3307
Source Database : wow_world
Target Server Type : MYSQL
Target Server Version : 50634
File Encoding : 65001
Date: 2016-12-21 19:19:53
*/
SET FOREIGN... | true |
e7510c1cfbe1bed1b66adcd57041e91dc80e02c6 | SQL | MyDAIDAI/paper | /毕业设计图表/sql/bbs_user.sql | UTF-8 | 2,088 | 3.078125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 1
Source Server Version : 50553
Source Host : localhost:3306
Source Database : xiuno4
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2017-04-23 11:15:35
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------... | true |
0a46a1d8d75f18e47c676d15bdaceec04d9234b8 | SQL | Tiffanymctsou/realtime-weather | /realtime_weather.sql | UTF-8 | 5,055 | 2.96875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.31, for macos10.14 (x86_64)
--
-- Host: localhost Database: realtime_weather
-- ------------------------------------------------------
-- Server version 5.7.31
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_R... | true |
10483d83e8fbfb5a75049507162e247927581e28 | SQL | noranuk0/tiny-fw | /sql/init.sql | UTF-8 | 277 | 2.78125 | 3 | [] | no_license | create schema area;
CREATE TABLE area.m_regions (
id serial,
region_id integer unique not null,
name text not null
);
CREATE TABLE area.m_prefectures (
id serial,
region_id integer not null,
prefecture_id integer unique not null,
name text not null
);
| true |
74f6a5c2ba0e40531725eda42bb59f3668ade9aa | SQL | chenxy11/wx | /wx-master/src/main/resources/db/migration/V56__ADD_SOURCE_IMAGE_FONT.SQL | UTF-8 | 2,413 | 3.703125 | 4 | [] | no_license | -- Create table
create table SOURCE_IMAGE_FONT
(
id VARCHAR2(64) not null,
title VARCHAR2(2000),
thumb_media_id VARCHAR2(64),
author VARCHAR2(200),
digest VARCHAR2(1000),
show_cover_pic VARCHAR2(4),
content BLOB,
content_source_url ... | true |
d5c119abc7567ebc77f22f0cfb235ffca829e2fd | SQL | CityofToronto/bdit_volumes | /volume_project/flow_data_processing/data_cleanup/flag_anomalies.sql | UTF-8 | 3,231 | 4.15625 | 4 | [] | no_license | -- Flag timestamps that share multiple counts
-- 1445051 rows affected, 10:10 minutes execution time.
UPDATE prj_volume.cnt_det_clean
SET flag = 2
WHERE count_info_id IN
(SELECT count_info_id
FROM traffic.countinfo
WHERE (arterycode, count_date) IN
(SELECT DISTINCT arterycode, count_date
FROM traffic.countinfo ... | true |
37aa6c567033a13de1c45f1cc43f1404883d504a | SQL | ToniJRod/CreativeCakes | /creativecakes.sql | UTF-8 | 2,071 | 3.03125 | 3 | [] | no_license | CREATE DATABASE `pies` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `pies`;
CREATE TABLE IF NOT EXISTS `products` (
`sku` int(11) DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`img` varchar(255) COLLATE utf8_... | true |
b14b74078026b281142f23ec0166aa6a7d5dc46b | SQL | fprp/sql-hospital | /SQL-PL/Checklist/checklist27.sql | UTF-8 | 335 | 3.21875 | 3 | [] | no_license | --Checklist 27 Pacientes que tem o mesmo nome do seu medico com o respectivo nome e pacientes q tem nome diferente do seu medico,como nenhum paciente tem nome igual ao medico, não vai mostrar nenhum medico
select paciente.cpfpaciente, medico.nomemedico
from paciente
left outer join medico on paciente.nomepaciente = med... | true |
87c0c2d542b38847da8f0b67f660db3a5311cbb8 | SQL | joynara86/FindSorts | /findsports.sql | UTF-8 | 1,278 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 19-Nov-2017 às 02:51
-- Versão do servidor: 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 |
65ab9be4f0105f3659f2d722a5bb426baafe8a9d | SQL | tchellosan/PL-SQL | /plsql_13_function_date3.sql | UTF-8 | 680 | 3.34375 | 3 | [] | no_license | clear scr;
set serveroutput on;
declare
wsessiontimezone varchar2(10) default sessiontimezone;
wcurrent_date date default current_date;
wsysdate date default sysdate;
begin
dbms_output.put_line('Fuso horário : ' || wsessiontimezone);
dbms_output.put_line('Data local : ' || wcurrent_date);
dbms_ou... | true |
10f411e85f19bf6a47189013710321e599b5f23a | SQL | pok1800/Navision-SQL-Queries | /Sql/ProductQuery.sql | UTF-8 | 940 | 3.78125 | 4 | [
"MIT"
] | permissive | SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT I.No_ AS ITEM_ID,
I.No_ AS PRODUCT_CODE,
I.Description AS DESCRIPTION,
IC.Description AS CATEGORY,
I.[Base Unit of Measure] AS UNIT_OF_MEASURE,
CONVERT(CHAR(19), I.[Created Datetime], 121) AS DATE_CREATED,
CONVERT(
... | true |
18d6e2d82c56e3fa5ca11b5a511d728e6ff1714c | SQL | liangsu/notes | /mysql/参数.sql | UTF-8 | 16,583 | 3.109375 | 3 | [] | no_license | -- 系统表空间的大小,autoextend表示容量不够则自动增长
show variables like '%innodb_data_file_path%';
-- 系统表空间每次增长多少M
show variables like '%innodb_autoextend_increment%';
-- innodb能识别的目录
show variables like '%innodb_directories%';
show variables like '%innodb_data_home_dir%';
show variables like '%datadir%';
-- undo表空间目录
show variables lik... | true |
d4677d908562dc853b099b1b31285936948be904 | SQL | DoNotErase/GoalSquad | /database-mysql/data.sql | UTF-8 | 11,954 | 3.296875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `egg` (
`egg_id` int(11) NOT NULL AUTO_INCREMENT,
`egg_name` varchar(255) NOT NULL,
PRIMARY KEY (`egg_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `goal` (
`goal_id` int(11) NOT NULL AUTO_INCREMENT,
`goal_name` varchar(255) NOT NULL,
`g... | true |
e8d811b3d1cefa3e3427d66caa6d2089e89a92b8 | SQL | bandzarzewski/SQL_repo | /Dzien4_Baza_northwind.sql | UTF-8 | 699 | 3.46875 | 3 | [] | no_license | SELECT
orders.OrderID, customers.ContactName, orders.OrderDate
FROM
customers
INNER JOIN
orders ON orders.CustomerID = customers.CustomerID;
SELECT
customers.ContactName, orders.OrderID
FROM
orders
LEFT JOIN
customers ON customers.CustomerID = orders.CustomerID ORDER BY customer... | true |
0925a4778a09b76f57c0e289bef2f8be9eeef848 | SQL | keco/PhotoSeshBooking | /conf/schema.sql | UTF-8 | 2,860 | 3.578125 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS customer
(
id BIGSERIAL PRIMARY KEY NOT NULL,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
email VARCHAR(255) NOT NULL,
phone VARCHAR(30) NOT NULL,
pay_method VARCHAR(30) NOT NULL,
balance NUMERIC NOT NULL
);
ALTER SEQUENCE customer_id_seq RESTART W... | true |
fa8f9a7eb4336e062ce0f6372d7c11e0ffd4dba9 | SQL | ardidagol/Package-Oracle | /2020/MKT/XXMKT_SEQUENCES.sql | UTF-8 | 3,236 | 3.421875 | 3 | [] | no_license | --ALTER TABLE XXMKT.XXMKT_SEQUENCES
-- DROP PRIMARY KEY CASCADE;
--
--DROP TABLE XXMKT.XXMKT_SEQUENCES CASCADE CONSTRAINTS;
CREATE TABLE XXMKT.XXMKT_SEQUENCES
(
SEQ_TYPE_ID NUMBER NOT NULL,
APPLICATION_SHORT_NAME VARCHAR2(50 BYTE) NOT NULL,
SEQ_TYPE VARCHAR... | true |
3cc9a9beafffb2b0298fedc01718eee7ac61792b | SQL | Douglasmantovani/Exercicios-SQL | /1.2.exercicios-locadora/DDL.sql | UTF-8 | 972 | 3.296875 | 3 | [] | no_license | Create database Locadora_Manha;
use Locadora_Manha;
create table Empresa (
idEmpresa int primary key identity,
TituloEmpresa varchar(200)not null
);
create table Marca(
idMarca int primary key identity,
TituloMarca VARCHAR(200)not null,
);
CREATE TABLE Cliente (
idCliente int primary key identity,
TituloCliente var... | true |
4de0fa0c3a913bd9b94a3854e3dcf69e91b7e813 | SQL | lanaflonPerso/IMIE | /BDD/TP2.sql | UTF-8 | 1,423 | 3.6875 | 4 | [] | no_license | -- TP 2
DROP DATABASE IF EXISTS tp2;
CREATE DATABASE IF NOT EXISTS tp2;
USE tp2;
CREATE TABLE IF NOT EXISTS client (
id BIGINT AUTO_INCREMENT,
nom VARCHAR(120) NOT NULL,
PRIMARY KEY(id)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS facture (
id BIGINT AUTO_INCREMENT,
date_facture DATETIME NOT NULL,
client_id BIG... | true |
f32376bb5c6f5496abb84f21e8163cfed7e2ddd1 | SQL | aruizcanton/ETLGenerator | /gen_creates_modelo_logico.sql | UTF-8 | 116,910 | 3 | 3 | [
"Apache-2.0"
] | permissive | DECLARE
/* (20150907) Angel Ruiz . NF: Se crea una tabla de metadato MTDT_MODELO_SUMMARY y otra MTDT_MODELO_DETAIL */
/* CURSOR QUE NOS DARA TODAS LAS TABLAS QUE HAY QUE CREAR */
CURSOR c_mtdt_modelo_logico_TABLA
IS
SELECT
TRIM(TABLE_NAME) "TABLE_NAME",
TRIM(TABLESPACE) "TABLESPACE",
T... | true |
47d20b685d97a056273be912fe0d9c7e08304c78 | SQL | jgarzonext/packages | /function/F_REDIST_PERMITE_SPL.sql | ISO-8859-1 | 2,359 | 3.078125 | 3 | [] | no_license | --------------------------------------------------------
-- DDL for Function F_REDIST_PERMITE_SPL
--------------------------------------------------------
CREATE OR REPLACE EDITIONABLE FUNCTION "AXIS"."F_REDIST_PERMITE_SPL" (psseguro IN NUMBER)
RETURN NUMBER IS
/***********************************************... | true |
0e27cadc3f9324de8a1cdc68b1994b11ef0d0c82 | SQL | extensible-cms/ecms-domain-model-mysql | /scripts/default_data_users_and_contacts.sql | UTF-8 | 1,527 | 3.640625 | 4 | [
"BSD-3-Clause"
] | permissive | -- Description: Populates `users` with a default `superadmin` user and also populates
-- `contacts` and `contact_relationships` with the pertinent data for that `superadmin` user.
-- ** Note ** If you run this file separately from the build process, do so with caution.
-- Set Database
use `ecms`;
-- Prelims
SET @use... | true |
7d7c301568e9b2897ac0ddeb0f3d2535ee80ceb1 | SQL | muhammedessa/SQLSERVER_files | /Transact-SQL - sql server microsoft/Ordering Results Example.sql | UTF-8 | 604 | 3.5 | 4 | [] | no_license |
-- Orders the results by LastName only
select distinct LastName, FirstName, EmailPromotion
from Person.person
order by LastName
-- Orders the results by LastName, then FirstName
select distinct LastName, FirstName, EmailPromotion
from Person.person
order by LastName,FirstName
-- Orders the results by LastName in ... | true |
3464e7e007e42fbcc7568d4e2179e206f3223cec | SQL | albertocubeddu/variousSnippets | /mysqlSnippets/commonQuery/groupConcatLastTwoResult.sql | UTF-8 | 428 | 4.4375 | 4 | [] | no_license | #Retrieve the (n) and (n-1) value by a certain date.
# (?) is The date that you want to retrieve and compare with the older one.
SELECT t1.col1,
(
SELECT GROUP_CONCAT(t2.value_to_retrieve ORDER BY as_of_date DESC LIMIT 2)
FROM table_2 as t2
WHERE t2.col1 <=> t1.col1
AND t2.as_of_date <= ?... | true |
ec65ace4569cef6ee302a4ce0df70bf37dca990d | SQL | robotunicorn/caketrek | /schema.sql | UTF-8 | 30,718 | 3.40625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Mer 30 Janvier 2013 à 15:53
-- Version du serveur: 5.5.24-log
-- Version de PHP: 5.3.13
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... | true |
b9eabd5bf029997449cd36f86cb7be074a9e5c32 | SQL | SARWARISSAM/coke | /Database file/library.sql | UTF-8 | 7,596 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 02, 2018 at 06:19 AM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
314da35b2191be63238f3ebb32b1f0cb4ab0b7be | SQL | falent05/cscripts | /cs_rsrc_mgr_update.sql | UTF-8 | 4,675 | 2.609375 | 3 | [] | no_license | ----------------------------------------------------------------------------------------
--
-- File name: dbrmu.sql | cs_rsrc_mgr_update.sql
--
-- Purpose: Database Resource Manager (DBRM) Update
--
-- Author: Carlos Sierra
--
-- Version: 2020/12/16
--
-- Usage: Execute connected to CDB or PDB.
--
... | true |
ca816903a0853baff70526dd5c3e8e5a09253a8e | SQL | Njoki254/News-Portal | /create.sql | UTF-8 | 463 | 2.6875 | 3 | [
"MIT"
] | permissive |
CREATE DATABASE news_portal;
\c news_portal;
CREATE TABLE news(id serial PRIMARY KEY, content VARCHAR, publisher VARCHAR);
CREATE TABLE department_news(id serial PRIMARY KEY, content VARCHAR, publisher VARCHAR, departmentId INTEGER);
CREATE TABLE users(id serial PRIMARY KEY, position VARCHAR, role VARCHAR, department ... | true |
8e32b8a3f89e2ee08f1b0a4bc97c4918d092c3f3 | SQL | yenesey/Synapse | /tasks/Отчет по доходности в разрезе карт продуктов.sql | UTF-8 | 4,681 | 3.3125 | 3 | [] | no_license | SELECT
ID,
/*
Поля для доп. информации
*/
PRODUCT_NAME,
PRODUCT_CODE_PC,
PAN,
DATE_BEGIN,
DATE_CLOSE,
STATE,
(CASE WHEN lower(PRODUCT_NAME) like '%mfk%' or lower(PRODUCT_NAME) like '%мфк%' THEN 1 ELSE 0 END) MFK,
(CASE WHEN lower(PRODUCT_NAME) like '%зарплат%' or l... | true |
dc678f2401f8f1bec0d12a51788981bebe42fe37 | SQL | subhamkrverma/subham | /project1234.sql | UTF-8 | 4,124 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 27, 2019 at 10:05 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
422c1c74d3c3ac8e400965d239fbfff0d18c29d3 | SQL | danielvitorti/plsql | /utils/criar_perfil_oracle.sql | UTF-8 | 773 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | -- Tem que estar logado como usuario system
-- Cria o tablespace para os dados
create tablespace tbs_dados
datafile 'C:\oraclexe\app\oracle\oradata\tbd_dados.dbf' size 100M reuse
autoextend on next 10M maxsize 200M
online;
create user aluno -- usuario
identified by "123" --senha
default tablespace tbs_dados
tempora... | true |
541528cb22447ea1a4616af4ef629296a05e963f | SQL | LoneRanger66/Longzhu | /resource/sql.sql | UTF-8 | 639 | 2.9375 | 3 | [] | no_license | CREATE SCHEMA `longzhu` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ;
CREATE TABLE `longzhu`.`danmu` (
`iddanmu` INT NOT NULL AUTO_INCREMENT,
`uid` INT NULL COMMENT '龙珠号',
`username` VARCHAR(30) NULL COMMENT '用户名',
`content` VARCHAR(60) NULL COMMENT '弹幕内容',
`grade` INT NULL COMMENT '用户等级',
`ti... | true |
6ec5dd508fbc71d8c829e15db8c91d4fb4b9ab84 | SQL | soriaj/retraced | /migrations/pg/1492023766.do.templates.sql | UTF-8 | 383 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | create table display_template (
id text not null,
created_at timestamp without time zone,
updated_at timestamp without time zone,
project_id text not null references project(id) on delete cascade,
environment_id text not null references environment(id) on delete cascade,
name text not null,
rule t... | true |
3e614b0bdf77968d6f1adbc8d9757172626959fc | SQL | gashndolo/opinionneeded | /resources/migrations/20211030082005-create-comments-table.up.sql | UTF-8 | 223 | 3.1875 | 3 | [] | no_license | CREATE TABLE comments(
id SERIAL PRIMARY KEY,
comment text not null,
upvotes int default 0,
argument_id int,
CONSTRAINT fk_argument
FOREIGN KEY(argument_id)
REFERENCES arguments(id) ON DELETE SET NULL
); | true |
7b8fce70bc7d1d42272b25f2e1afa2cf4d62d703 | SQL | dael-victoria-reyes/data-act-broker-backend | /dataactvalidator/config/sqlrules/fabs35_detached_award_financial_assistance_2.sql | UTF-8 | 344 | 3.28125 | 3 | [
"CC0-1.0"
] | permissive | -- LegalEntityZIP5 is not a valid zip code.
SELECT
dafa.row_number,
dafa.legal_entity_zip5
FROM detached_award_financial_assistance AS dafa
WHERE dafa.submission_id = {0}
AND COALESCE(dafa.legal_entity_zip5, '') <> ''
AND NOT EXISTS (
SELECT 1
FROM zips AS z
WHERE z.zip5 = dafa.l... | true |
f723012faaf9b5e06f64a1f375bc1d97c68665fe | SQL | pmacmil1/NBA-SQL | /F14_0_QUARTER _STATISTICS.sql | UTF-8 | 7,117 | 3.59375 | 4 | [] | no_license | --Feature 14: Show statistics of a quarter in a game, including quarter level statistics listed
--in Assumption 11 and statistics of a player in that quarter
--(same as listed in Assumption 10 but at quarter level), which can be computed
--using play-by-play data.
--Create lots of temp tables to join the necessary ... | true |
cb0ab4467bbf6c9e5f16a4dab9d4ada5ecbc4240 | SQL | forestphoenix/Temperature-Logger | /templog-server/db/select-running-time.sql | UTF-8 | 711 | 4.15625 | 4 | [] | no_license | WITH pairs AS (
SELECT ((julianday(late.taken_at) - julianday(early.taken_at)) * 24 * 60 * 60) as diff, early.taken_at as stop, late.taken_at as restart, early.*, late.* FROM measurement as early
INNER JOIN measurement as late ON late.measurement_id = early.measurement_id + 1
),
long_pauses AS (
SELECT * from pairs... | true |
6d74a45d3c233a77ecb6802a02ff454963100e85 | SQL | Qvinticom/fightclub | /db/storedprocs.sql | UTF-8 | 23,494 | 3.640625 | 4 | [] | no_license | /* ALL SQL QUERY STORED IN THIS FILE */
DROP PROCEDURE IF EXISTS CreateUser;
DROP PROCEDURE IF EXISTS ValidateUser;
DROP PROCEDURE IF EXISTS GetUser;
DROP PROCEDURE IF EXISTS CreateTaskGroup;
DROP PROCEDURE IF EXISTS UpdateTaskGroup;
DROP PROCEDURE IF EXISTS UpdateTaskGroupOrder;
DROP PROCEDURE IF EXISTS DeleteTaskGro... | true |
1674345e14c6fa3f4048567b3f0c6e30c472b203 | SQL | nogsantos/plsql-oracle-introducao-basica | /aula_02_20-04-2013/Exercicio06_procedure.sql | UTF-8 | 1,858 | 3.9375 | 4 | [] | no_license | /*
Criar uma procedure que mostre o numero, nome, data admissão
(formatar a data em dd/mm/yyyy) e o nome do departamento do
empregado 7369. Caso o salário seja menor do que R$1000,00,
conceder 20% de aumento. Caso seja maior ou igual a R$1000,00
e menor do que R$10000,00 conceder 15% de aumento. Caso o ... | true |
ff26d26fdba55a2b316b8baa35fcda6a6b8a066f | SQL | huiboz/school_intro-to-database | /hw3/hw3_advanced.sql | UTF-8 | 6,627 | 4.59375 | 5 | [] | no_license | # Given a month, return what semester that month corresponds to
DROP FUNCTION IF EXISTS `convert_semester`;
DELIMITER $$
CREATE FUNCTION `convert_semester` (`month` int(16))
RETURNS int(16)
BEGIN
DECLARE semester INT;
if `month` in (9,10,11,12) then
SET semester = 1;
end if;
if `month` in (1... | true |
d207a9efcc4b247085b161dced115931b8d432ad | SQL | mkcafe/sample | /multitenant/fix_unique_constraint.sql | UTF-8 | 1,460 | 3.984375 | 4 | [
"MIT"
] | permissive | create or replace procedure fix_unique_constraint
(table_name in varchar2
,constraint_name in varchar2 := null) is
-- Modify unique constraint(s) to include security_group_id
l_ddl varchar2(32767);
begin
for r in (
select c.table_name, c.constraint_name
,decode(c.constraint_type
,... | true |
837a5a70c7fdbaab326a3678384dfcaff14eaf04 | SQL | prateekinfi/sapestore | /FinalSapestoreBackup 20180409 1802.sql | UTF-8 | 163,229 | 3.140625 | 3 | [] | no_license | -- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.7.21
/*!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 */;
... | true |
b5c1824ce98b035c137c27e2e74dd632b39946d8 | SQL | THE-STUDNET/twic-api | /data/db/251-upt-abo.sql | UTF-8 | 575 | 3.546875 | 4 | [
"MIT"
] | permissive | SET foreign_key_checks = 0;
truncate subscription;
DELETE FROM `contact` WHERE deleted = 0 and accepted = 0 and requested = 0;
SET foreign_key_checks = 1;
INSERT IGNORE INTO `subscription` (`user_id`, `libelle`,`created_date`) SELECT * FROM
(SELECT user_id, CONCAT('PP',page_id) libelle, UTC_TIMESTAMP created_date FROM... | true |
a28077a9c7c8ec648286f125b8e8b1411c40c5e8 | SQL | taylorak/Has-Many-Relationships | /joins.sql | UTF-8 | 2,800 | 3.578125 | 4 | [] | no_license | -- 1
-- SELECT *
-- FROM users;
-- 2
-- SELECT *
-- FROM posts
-- WHERE user_id = 100;
-- 3
-- SELECT posts.*, users.first_name, users.last_name
-- FROM posts
-- JOIN users
-- ON posts.user_id = users.id
-- WHERE users.id = 200;
-- 4
-- SELECT posts.*, users.username
-- FROM posts
-- JOIN users
-- ON posts.user_id =... | true |
c84d6ddcbf69493861e84bcc77f4e0c401124f06 | SQL | KMtheStarter/bit_spring | /board.sql | UTF-8 | 383 | 3.046875 | 3 | [] | no_license | create table t_board(
no number(5) primary key,
title varchar2(200) not null,
writer varchar2(100) not null,
content varchar2(2000),
view_cnt number(5) default 0,
reg_date date default sysdate
);
create sequence seq_t_board_no nocache;
select * from t_board;
insert into t_board(no, title, con... | true |
8a63b8c5203c01e32cf3ebd90a18b8a34b585a4a | SQL | skyblue777/Yii-project | /public_html/database/setup.sql | UTF-8 | 9,977 | 3.515625 | 4 | [] | no_license | DROP TABLE IF EXISTS `ann_favorites`;
CREATE TABLE `ann_favorites` (
`user_id` int(11) NOT NULL,
`annonce_id` int(5) NOT NULL,
PRIMARY KEY (`user_id`,`annonce_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Table structure for table `annonce` */
DROP TABLE IF EXISTS `annonce`;
CREATE TABLE `annonce` (
`id` int... | true |
ee5425e4e53fbe8f9d9bb626e3e4983be4870ba7 | SQL | unity-idm/furms | /furms-database-module/src/main/resources/db/migration/V8__community_allocation.sql | UTF-8 | 463 | 3.46875 | 3 | [
"BSD-2-Clause"
] | permissive | /*
* Copyright (c) 2020 Bixbit s.c. All rights reserved.
* See LICENSE file for licensing information.
*/
CREATE TABLE community_allocation (
id UUID PRIMARY KEY NOT NULL,
community_id UUID NOT NULL,
resource_credit_id UUID NOT NULL,
name VARCHAR(255) UNIQUE NOT NULL,
amount DECIMAL NOT NULL,
... | true |
2e460e22d2d60384ac9901b109d4b061eb5fadf1 | SQL | akheron/sqltyper | /tests/integration/cte-update.sql | UTF-8 | 633 | 3.421875 | 3 | [] | no_license | --- setup -----------------------------------------------------------------
CREATE TABLE person (
id serial PRIMARY KEY,
name varchar(255) NOT NULL,
age integer
);
--- query -----------------------------------------------------------------
WITH youngsters AS (
SELECT * FROM person
WHERE age < ${maximumAge}... | true |
a6076b184af3ecb3713ba07f6c9ea58c8e495c8c | SQL | vk-hollay/JavaWeb | /EMS201824113330/web/db/EquipmentStorage.sql | UTF-8 | 997 | 3.484375 | 3 | [] | no_license | CREATE DATABASE EquipmentStorage DEFAULT CHARSET utf8mb4;
CREATE TABLE IF NOT EXISTS employee (
`id` CHAR(10) PRIMARY KEY,
`password` VARCHAR(32) NOT NULL,
`name` VARCHAR(50),
`phone` CHAR(13),
`usertype` CHAR(8),
`department` VARCHAR(20)
)
CREATE TABLE IF NOT EXISTS department (
`id` VARCHAR(20) PRIMARY KEY,... | true |
ed0ba4f47d82934e7182b5eeb371f0f167763e2e | SQL | sarthak0415/mongo-routing | /psql_sample_queries.sql | UTF-8 | 353 | 2.578125 | 3 | [] | no_license | #Postgres start server
brew services start postgresql
#Login
psql <database_name>
#create new db and connect
CREATE DATABASE routing1;
\connect routing1
#create extensions
create extension postgis;
create extension pgrouting;
CREATE EXTENSION hstore;
osm2pgrouting --f iiit_map.osm --conf mapconfig.xml --dbname ro... | true |
cd64fd0531576ba9e84b33235a0625e054e85d26 | SQL | xixi51/web | /docs/数据库脚本/文章增加类别字段.sql | UTF-8 | 246 | 2.59375 | 3 | [] | no_license | alter table blog_details add column blog_category INT;
alter table code_library add column code_category INT;
--初始化为0,默认分类所有文章
UPDATE blog_details SET blog_category = 0;
UPDATE code_library SET code_category = 0; | true |
bfaa0642a53fdb82caba56b0ae8a0be33b2516a0 | SQL | lukasklisevicius/egzaminas | /U2_Lukas_Kliševičius/egzamino_db.sql | UTF-8 | 28,485 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 22, 2021 at 09:12 AM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
fa260971bbfebc1849a8e8e37a008e8fcbd65593 | SQL | NeotomaDB/Neotoma_SQL | /function/ti/getanalysisunit.sql | UTF-8 | 646 | 3 | 3 | [
"MIT"
] | permissive | CREATE OR REPLACE FUNCTION ti.getanalysisunit(_collectionunitid integer,
_analunitname character varying DEFAULT NULL::character varying,
_depth double precision DEFAULT NULL::double precision,
_thickness double precision DEFAULT NULL::double precision)
RETURNS TABLE(analysisunitid integer)
LANGUAGE sql
A... | true |
16ce058afa213d6757a40653c56c2673bcea9e65 | SQL | Henrytran13/sql_challenge | /Part-1-SQL-Drills/02-Alter_Update/SOLVED.sql | UTF-8 | 1,413 | 4.0625 | 4 | [] | no_license | /*PART 1
Difference Between ALTER and UPDATE Command in SQL
alter-vs-updateALTER and UPDATE are the two modifying commands of SQL. ALTER is used to modify the structure of the relations (Tables) in the database. UPDATE Command is used to modify the data stored in a relation of the database. The basic difference betwee... | true |
3c6ce9c51fca2d417778dcbdf25f134a84ee0d34 | SQL | ldcduc/leetcode-training | /department-highest-salary.sql | UTF-8 | 479 | 3.515625 | 4 | [] | no_license | /* Problem url: https://leetcode.com/problems/department-highest-salary
* Code by: ldcduc
* */
/* Begin of Solution */
# Write your MySQL query statement below
select D.Name as Department, E.Name as Employee, E.Salary
from Employee E join Department D
on E.DepartmentId = D.Id
where not exists (
select *
from... | true |
c32628b8193a8dde5758e09289cb20c991d59794 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day22/select1024.sql | UTF-8 | 178 | 2.671875 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-21T10:24:00Z' AND timestamp<'2017-11-22T10:24:00Z' AND temperature>=28 AND temperature<=38
| true |
c9f558c76933a3a40d45a90437ce795696c58d04 | SQL | dilleepk/faadu | /resources/db/movies.sql | UTF-8 | 971 | 2.953125 | 3 | [] | no_license |
DROP TABLE IF EXISTS `movie`;
CREATE TABLE `movie` (
`id` int(11) NOT NULL,
`title` varchar(100) DEFAULT NULL,
`language` varchar(45) DEFAULT NULL,
`release_date` datetime DEFAULT NULL,
`playtime` int(11) DEFAULT NULL,
`media_id` int(11) DEFAULT NULL,
`cast_crew` varchar(200) DEFAULT NULL,
`brief` varc... | true |
b8186bd23ea1347410a9b575aad6b9ccdab83431 | SQL | j7ng/CLFY_SA | /SA/Views/TABLE_RULE_CONDS.sql | UTF-8 | 1,225 | 3.390625 | 3 | [] | no_license | CREATE OR REPLACE FORCE VIEW sa.table_rule_conds (cond_objid,rule_objid,"TYPE","OPERATOR",operand1,op1_type,operand2,op2_type) AS
select table_rule_cond.objid, table_rule_cond.parentrule2com_tmplte,
table_rule_cond.type, table_rule_cond.operator,
table_rule_cond.operand1, table_rule_cond.op1_type,
table_rule_cond.o... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.