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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0cc5b2aa6b6078289c08c7bb2fe0e34a167b3eb9 | SQL | atiqahammed/lrn | /db/Weather Observation Station 11.sql | UTF-8 | 170 | 2.84375 | 3 | [] | no_license | SELECT DISTINCT
CITY
FROM STATION
WHERE NOT lower(SUBSTRING(CITY, LEN(CITY), 1)) in ('a','e','i','o','u')
OR
NOT lower(SUBSTRING(CITY,1,1)) in ('a','e','i','o','u'); | true |
dac63b85b1c35673337de998781072d45794dd91 | SQL | emeraldjava/bhaa-zend | /sql/Procs/applyNewRunnerStandard.sql | UTF-8 | 361 | 2.671875 | 3 | [] | no_license | DROP PROCEDURE `applyNewRunnerStandard`//
CREATE DEFINER=`bhaa1`@`localhost` PROCEDURE `applyNewRunnerStandard`(_race INT, _runner INT, _standard INT)
BEGIN
START TRANSACTION;
UPDATE raceresult
SET postRaceStandard = _standard
WHERE race = _race AND runner = _runner;
UPDATE runner
SET standard = _standard
... | true |
b119363b0da00fc39032caa669110f1985c8bdc1 | SQL | genjay/java_hr | /CSR/同步syscode的z開頭至default.sql | UTF-8 | 322 | 3.203125 | 3 | [] | no_license | insert into tcatcode
(ouguid,codeguid,syscode,codeid,codeDesc,codeseq)
Select 'default',uuid(),syscode,codeid,codeDesc,codeseq
from tcatcode a
where syscode like 'z%'
and not exists (select * from tcatcode x where x.OUguid='default'
and x.syscode=a.syscode and x.codeid=a.codeid)
group by syscode,codeid,codeDesc,codes... | true |
511ae58769e291e669b6602be4ca8f97bde806c4 | SQL | askor2005/blagosfera | /Blagosfera/data-jpa/src/main/resources/mybatis_migrations/scripts/20160706165058_update_community_name_comment.sql | UTF-8 | 1,147 | 2.796875 | 3 | [] | no_license | -- // update_community_name_comment
-- Migration SQL that makes the change goes here.
update fields set comment = 'Введите название объединения людей или название юридического лица, если объединение действует в рамках этого юридического лица. Название объединения может быть не уникальным. Название юридического лица пи... | true |
812d6a67dabaa1cfcc7b792e1142b379310f6718 | SQL | kursk-ye/oracle | /operateAllContraint.sql | UTF-8 | 1,307 | 2.71875 | 3 | [] | no_license | select
'alter table ' || OWNER || '.' || TABLE_NAME || ' disable constraint ' || CONSTRAINT_NAME || ';' noprimarykey
from dba_constraints
where owner in ('FM','GHSJ_XM','GHSJ_JCSJ','PLATFORM') and CONSTRAINT_TYPE <> 'P';
select
'alter table ' || OWNER || '.' || TABLE_NAME || ' disable constraint ' || CONSTRAIN... | true |
fc855f60cb1e4ed6484202f1441c023fe6bc87c9 | SQL | madhurivaishnav/SALTWEB | /SALT_NewDesign/Database/Procedure/dbo.prcJobGetAgentStatus.PRC | UTF-8 | 1,068 | 2.578125 | 3 | [] | no_license | SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[prcJobGetAgentStatus]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
CREATE Procedure [prcJobGetAgentStatus]
@Status Varchar(50) OUTPUT
AS
/****************************... | true |
5b301f00b9f91aa8d9fbf96f0f34dc51f7777965 | SQL | EnterpriseWebSoftwareDevelopmentSEM7-G2/project-ec-management | /src/main/webapp/db/schema.sql | UTF-8 | 7,166 | 3.796875 | 4 | [] | no_license | SET @OLD_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS = 0;
DROP DATABASE IF EXISTS ecm_db;
CREATE DATABASE ecm_db;
USE ecm_db;
CREATE TABLE faculty (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100) NOT NULL
)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
CREATE TA... | true |
575fa369345e74166bb9553997d8d531ce55e971 | SQL | HarryBoBerry/325-Project-with-my-final-db | /325design.sql | UTF-8 | 2,161 | 3.515625 | 4 | [] | no_license | -- Harry Almeraz
-- CS 325 -- Fall 2016
-- 11/13/16
spool 325design.txt;
-- num_stamps referes to one of the business rule, refer to the pdf
prompt creating customer...
drop table customer cascade constraints;
create table customer
(
cust_id char(4) not null,
cust_fname varchar2(10),
cust_lname varchar2(15... | true |
8537a0f1a575a7283fa5de36820b2a28dc0fd4f9 | SQL | KaiqueLimaNovaes/fullstack-games-react | /sql/fullstackgames_produtos.sql | UTF-8 | 2,908 | 2.96875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: localhost Database: fullstackgames
-- ------------------------------------------------------
-- Server version 5.7.31
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS ... | true |
f6030f4d89e59f498cd538a3ebe4873db25c98bb | SQL | escola-de-dados/ddj_local | /3_educacao/codigo_3_aula-extra-sobre-JOIN.sql | UTF-8 | 17,955 | 3.78125 | 4 | [] | no_license | -- O COMANDO JOIN
/*
O comando JOIN (do verbo 'juntar') serve para o cruzamento de duas tabelas.
Exemplo: digamos que tenho uma tabela A com as colunas 'codigo_municipio', 'escola' e 'ideb' e 10 mil linhas com escolas brasileiras.
Mas quero acrescentar uma coluna com o nome do municipio.
Para isso, posso buscar ... | true |
7ee9b0250eb655f9db9465240fdf554b24cb25aa | SQL | Code2swap/Mini-Project | /Employee Maintenance System/db/emsDBScript.sql | UTF-8 | 3,676 | 3.515625 | 4 | [] | no_license |
#First configure the the file->db.properties in folder->resorces
#Run the following script in sql before running the java program
CREATE TABLE Employee(Emp_ID VARCHAR2(6) PRIMARY KEY, Emp_First_Name VARCHAR2(25),
Emp_Last_Name VARCHAR2(25), Emp_Date_of_Birth DATE, Emp_Date_of_Joining DATE,
Emp_Dept_ID NUMBER, Emp_Gr... | true |
3c38e558f05fd5bd0f13ed1164708d36df53edd0 | SQL | mariodavid/cuba-fire-departments | /modules/core/db/update/postgres/21/02/210218-2-updateEmployee01.sql | UTF-8 | 176 | 3.234375 | 3 | [] | no_license | alter table CFD_EMPLOYEE add constraint FK_CFD_EMPLOYEE_ON_USER foreign key (USER_ID) references SEC_USER(ID);
create index IDX_CFD_EMPLOYEE_ON_USER on CFD_EMPLOYEE (USER_ID);
| true |
2205aa52b42aca9d8fdf1ab4557e3889489611ae | SQL | jingug1004/pythonBasic | /docu/rbm (2)/9.PROCEDURES/SP_SEND_SALES_RESULT.sql | UHC | 6,597 | 3.328125 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE USRBM.SP_SEND_SALES_RESULT
IS
/******************************************************************************
- , :
- α : SP_SDL_DAEMON_CHECK
- αŸ : procedure
- : ϸ ϵ SMS Ѵ.
- IN μ :
- μ
1. ֺ ۽ 25 SDLڷᰡ Ѿ üũѴ.
- ν 18:00 ~ 22:00 (ٷ )
*****... | true |
0d424096d66bb61ba0277226e94a436cdc3e59ef | SQL | ketan-pansare/ketan-pansare-projects | /EnterpriseWebApplications/HW3_Pansare_Ketan/Data/ewa_address.sql | UTF-8 | 366 | 2.71875 | 3 | [] | no_license | use ewa;
select * from address;
CREATE TABLE `address` (
`order_id` int NOT NULL,
`u_name` varchar(45) DEFAULT NULL,
`cstreet` varchar(45) DEFAULT NULL,
`ccity` varchar(45) DEFAULT NULL,
`cstate` varchar(45) DEFAULT NULL,
`czipcode` varchar(45) DEFAULT NULL,
PRIMARY KEY (`order_id`)
) ENGINE=InnoDB DEFAUL... | true |
a8ab77cab55086740990311b1577b5f1edcc9c7f | SQL | smallmenu/learning-springboot | /springboot.sql | UTF-8 | 7,722 | 3.53125 | 4 | [] | no_license | -- --------------------------------------------------------
-- 主机: 10.10.7.131
-- 服务器版本: 5.7.19 - MySQL Community Server (GPL)
-- 服务器操作系统: Linux
-- HeidiSQL 版本: 9.5.0.5196
-- --------------------------------------------------------
... | true |
96a38ad2c4736f3f8db15424c8c4f059d1a9ff9d | SQL | spicytuner/test-rep | /SQL/move_part.sql | UTF-8 | 605 | 2.8125 | 3 | [] | no_license | alter tablespace archive_data read write;
alter tablespace metaserv31_data read write;
Create index ip_08SEP2008_IND01 on IP_ALLOCATION_EVENTS_08SEP2008(eventtime,eventtype)
NOLOGGING storage(initial 500M next 200M) tablespace archive_data;
Create index ip_08SEP2008_ip on IP_ALLOCATION_EVENTS_08SEP2008(ipaddress)
N... | true |
66da16986981174ee6bab141d65d33620ff2ffb4 | SQL | dhdmsdud/TIL | /ORACLE/EXAM/Select_Exam.sql | UHC | 2,617 | 4.34375 | 4 | [] | no_license | --1. б а ̸ 迭 ǥϽÿ. , "а ", "迭" ǥϵ Ѵ.
SELECT DEPARTMENT_NAME AS "а ",
CATEGORY AS 迭
FROM TB_DEPARTMENT;
--2. а а · ȭ鿡 Ѵ.
--а
--------------------
--а 20 Դϴ.
SELECT DEPARTMENT_NAME||' '||CAPACITY||' Դϴ.'
FROM TB_DEPARTMENT;
-- 3. "а" ٴϴ л л ãƴ û Դ. ΰ?
--(а 'аڵ' а ̺(TB_DEPARTMENT) ȸؼ ã )/ 001
... | true |
2b82dad2e40a3927e7bb9778eabc13f1f575da4f | SQL | krimmkr/MIPT-Programming | /1 Sem/DataBases/SQL/053.SQL | UTF-8 | 99 | 2.703125 | 3 | [] | no_license | SELECT CAST(AVG(CAST(numGuns AS NUMERIC(6, 2))) AS NUMERIC(6, 2)) FROM Classes
WHERE type = 'bb'
| true |
074e2f4381f36d1197f8c756f9e2649be8ae5844 | SQL | zhaungdonglin/manaphp | /ManaPHP/Logger/Adapter/Db/manaphp_log.sql | UTF-8 | 579 | 2.65625 | 3 | [
"MIT"
] | permissive | CREATE TABLE `manaphp_log` (
`log_id` int(11) NOT NULL AUTO_INCREMENT,
`host` varchar(16) NOT NULL,
`client_ip` varchar(15) CHARACTER SET ascii NOT NULL,
`request_id` varchar(64) CHARACTER SET ascii NOT NULL,
`category` varchar(64) CHARACTER SET ascii NOT NULL,
`level` char(8) CHARACTER SET ascii NOT NULL,
... | true |
54167cb248ffb47c158129fad616f14a16138258 | SQL | aldo2312/Cibertec-Struts | /Struts/trabajofinalStrutsBD.sql | UTF-8 | 309 | 2.609375 | 3 | [] | no_license |
CREATE TABLE Cliente (
codigo int NOT NULL AUTO_INCREMENT,
nombre varchar(255) NOT NULL,
apellido varchar(255) NOT NULL,
genero CHAR(1),
profesion varchar(50),
numeroMovil varchar(20),
publicidad bit,
correo varchar(200),
PRIMARY KEY (codigo)
);
select * from Cliente | true |
997e67cb710996e7deae56d2e4086d153a74420f | SQL | muthukrishnan-s/fsmdevlocal | /SQL/fsm-sql/wsrd/Tables/IPTType.sql | UTF-8 | 178 | 2.640625 | 3 | [] | no_license | CREATE TABLE [wsrd].[IPTType] (
[iptID] BIGINT NOT NULL,
[iptName] VARCHAR (50) NULL,
PRIMARY KEY CLUSTERED ([iptID] ASC) WITH (FILLFACTOR = 90)
);
| true |
dd476efdcff42789bb4089fe4f8d9f3c84b41d37 | SQL | amirtl/E-commerce-database | /Query4.sql | UTF-8 | 154 | 3.25 | 3 | [] | no_license | Select *
From ProductInCart
WHERE CartID NOT IN(
Select Cart.CartID From Cart JOIN CustomerGivesOrder
ON (Cart.CartID = CustomerGivesOrder.CartID)); | true |
535ed04200eb9ca64d1aa53962a8878350533c79 | SQL | gicadmin/allo | /PHENIX/Packages/RMC_PACK.sql | UTF-8 | 3,124 | 2.921875 | 3 | [] | no_license | CREATE OR REPLACE PACKAGE phenix.RMC_PACK AS
FUNCTION GET_KEY_FUNC
RETURN NUMBER;
PROCEDURE INIT_RECORD_PROC(
p_rec OUT NOCOPY recurring_misc_charges%ROWTYPE);
FUNCTION GET_FULL_FUNC(
p_rmc_id IN recurring_misc_charges.rmc_id%TYPE,
p_rmc_rec ... | true |
b0348b55d922b8dbacd44812396cb898f3550055 | SQL | gaurab123/DataQuest | /04_WorkingWithDataSources/03_SQL_Intermediate_TableRelationsAndJoins_psql_Advanced/02_IntermediateJoinsInSQL_psql-sqlite_convert/06_PatternMatchingUsingLike.sql | UTF-8 | 421 | 3.765625 | 4 | [] | no_license | /*
You have just returned from lunch to see another phone message on your desk: "Call Belle".
Write a query that finds the contact details a customer with a first_name
containing Belle from the databasc.
Your query should include the following columns, in order:
first_name
last_name
phone
*/
SELECT... | true |
1aa83ba145dbf1e04a4df1807cb9a47c94e8f206 | SQL | DimolSPA/Dimol-Fix-Carteras | /Dimol.Carteras/Dimol.Carteras.Database/dbo/Stored Procedures/Procs2/Trae_Reporte_VentasComparativo.sql | UTF-8 | 1,559 | 2.8125 | 3 | [] | no_license |
Create Procedure Trae_Reporte_VentasComparativo(@cbc_codemp integer, @idi_idid integer, @desde datetime, @hasta datetime) as
SELECT view_cabecera_comprobantes.pcl_rut,
view_cabecera_comprobantes.pcl_nomfant,
view_cabecera_comprobantes.tci_nombre,
view_cabecera_comprobantes.cbc_nu... | true |
f9282b47aba1586b2ad0ae8bf5887a719da4203c | SQL | kelleyco2/simulation-2 | /db/seed.sql | UTF-8 | 526 | 3.078125 | 3 | [] | no_license | -- create table houses (
-- id serial primary key,
-- name varchar,
-- address varchar,
-- city varchar,
-- state varchar,
-- zip integer
-- );
-- insert into houses (name, address, city, state, zip)
-- values ('Home', '4885 Old Post Road', 'Ogden', 'UT', 84403),
-- ('Parents', '2862 N 4200 W',... | true |
59a2064159ac3eb64c115896035f82ce277aed94 | SQL | galij899/sql_bank | /sql_bank_dump/dddaub9p3odvng_public_deposits.sql | UTF-8 | 401 | 2.671875 | 3 | [] | no_license | create table deposits
(
deposit_id serial not null
constraint deposits_pkey
primary key,
account_id integer not null
constraint deposits_account_id_foreign
references account_balance,
open_date date not null,
close_date date not null,
inter... | true |
7c2890da96006822e2e93520ac0ee05dba5981df | SQL | TEAM-STAB-RABS/ITERATION-ON-WOBBEGAINZ | /wobbegainz.sql | UTF-8 | 2,671 | 3.40625 | 3 | [
"MIT"
] | permissive | SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row... | true |
4576e3cb54552657a897f56950a16cb475692534 | SQL | DangerYao/Leetcode | /src/com/danger/leetcode/easy/P627_SwapSalary.sql | UTF-8 | 344 | 3.515625 | 4 | [] | no_license | --Given a table salary, such as the one below,
--that has m=male and f=female values.
--Swap all f and m values (i.e., change all f values to m and vice versa)
--with a single update query and no intermediate temp table.
update salary s set s.sex=if(s.sex='m','f','m');
-- or UPDATE salary SET sex = CASE WHEN sex = '... | true |
0ede58600df2cc82defba23abc9b23470b0886f7 | SQL | ibuetler/e1pub | /docker/alpine-nginx-php-mysql/root/etc/mysql/db.sql | UTF-8 | 1,792 | 3.515625 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS `accounts`;
USE `accounts`;
--
-- Table structure for table `role`
--
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
--
-- Dumping d... | true |
7fbbe33741ca04118d4e726b731bd5ab95c61939 | SQL | xulb-study/nacos_example | /nacos-spring-cloud-example/nacos-spring-cloud-config-multi-data-ids-example/test.sql | UTF-8 | 1,121 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : eam-mysql
Source Server Version : 50726
Source Host : eam-mysql:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50726
File Encoding : 65001
Date: 2019-10-28 10:08:19
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... | true |
2f78d79f09fab2bb007799d6e5bdd1d0a82b18a6 | SQL | moiraleon/heroku-database | /postgres.sql | UTF-8 | 1,304 | 3.9375 | 4 | [] | no_license | CREATE TABLE customer(
customer_ID INTEGER PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
email_address VARCHAR(100),
phone_number INTEGER
); DONE
INSERT INTO customer (customer_ID, first_name, last_name, email_address, phone_number) VALUES(1,'John','Doe','johndoe@gmail.com',999-888-7777),
(2,'Jane','D... | true |
e0588971fa5e13a579757719e80067aa79a445cd | SQL | DianaGumar/DataBaseComparable | /qbq.EPCIS.Repository/Import/Stored Procedures/usp_Import_MergeBusinessTransaction.sql | UTF-8 | 1,427 | 3.40625 | 3 | [] | no_license | -----------------------------------------------------------------------------------------
-- Projekt: EPCIS1_1
-- Firma: QUIBIQ
-- (c) 2015 QUIBIQ Schweiz AG
-----------------------------------------------------------------------------------------
--
--
--
-- Datum | Version | Autor | Komment... | true |
4b40a55b46dcf76e547c6c78acfb0b42543d2009 | SQL | arnoldduque/dataifx | /Papeleria/Script.PostDeployment1.sql | UTF-8 | 1,977 | 3.53125 | 4 | [] | no_license | /*
Post-Deployment Script Template
--------------------------------------------------------------------------------------
This file contains SQL statements that will be appended to the build script.
Use SQLCMD syntax to include a file in the post-deployment script.
Example: :r .\myfile.sql
... | true |
25bc4e387c996fad6594498cf77fefca6733ef4e | SQL | ishabelle/ASK-MATE-final-project | /sample_data/askmatepart2-sample-data.sql | UTF-8 | 6,852 | 3.234375 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.6
-- Dumped by pg_dump version 9.5.6
ALTER TABLE IF EXISTS ONLY public.question
DROP CONSTRAINT IF EXISTS pk_question_id CASCADE;
ALTER TABLE IF EXISTS ONLY public.answer
DROP CONSTRAINT IF EXISTS pk_answer_id CASCADE;
ALTER TABLE IF EXISTS... | true |
2798d8569eb61b2b123e6f17059b7dd4e8e5dbbf | SQL | WarpWorldwideLLC/Portal | /SQL/Product Queries CN.sql | UTF-8 | 21,274 | 2.84375 | 3 | [] | no_license |
TRUNCATE TABLE Product;
/* *************************************************************************************************** */
/* Peterson's ILRN
/* *************************************************************************************************** */
INSERT INTO Product (ID,ProductCode, ProductExternal... | true |
73e4385b5185d039ebaa21f9af8ad3a9f3ad2085 | SQL | eliosf27/meli | /internal/postgres/migrations/000001_create_item_table.up.sql | UTF-8 | 528 | 3.765625 | 4 | [
"MIT"
] | permissive | CREATE TABLE IF NOT EXISTS item
(
id SERIAL PRIMARY KEY,
item_id TEXT NULL,
title TEXT NULL,
category_id TEXT NULL,
price DECIMAL NULL,
start_time TEXT NOT NULL,
stop_time TEXT NOT NULL,
created_at TIMESTAMP(0) DEFAULT NOW(),
updated_at TI... | true |
ac56ceadc699613a8a1ee9cba43692fc2c9b1ebd | SQL | robbertvdzon/reference-implementation-hibernate-spring4-angular | /src/main/resources/schema.sql | UTF-8 | 482 | 3.265625 | 3 | [] | no_license | create table contacts (
id bigint generated by default as identity,
email varchar(255),
name varchar(255),
user_id bigint,
uuid varchar(255),
primary key (id)
);
create table users (
id bigint generated by default as identity,
passwd varchar(255),
username varchar(255),
permiss... | true |
e0a35a600730b95917d1c3f92b402b479ff720cd | SQL | desertrockclimber/bamazon | /bamazon.sql | UTF-8 | 289 | 2.9375 | 3 | [] | no_license | DROP database if exists bamazonDB;
create database bamazonDB;
use bamazonDB;
create table products (
item_id integer(10) NOT NULL,
product_name VARCHAR(50) NULL,
department_name VARCHAR(50) NULL,
price Decimal (10,4) NULL,
stock_quantity integer(50) NULL,
primary key(item_id)
);
| true |
9f2ce43bc50b139c560d9d9f2e2edb3c66ea2174 | SQL | vikramjaygude20/Big-Data_Project | /crawlplaystore.sql | UTF-8 | 599 | 2.640625 | 3 | [] | no_license | use crawlplaystore;
create table Website_App_Brain(Application_Rank int(100),Application_Name text, Hyperlink text, date timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
create table Google_Playstore_Data(Application_Name text, Hyperlink text,DocumentID varchar(300), date timestamp DEFAULT CURRENT_TI... | true |
31a361e65f3b3b51f2013c6613d01399fd63f78e | SQL | D-Jonczyk/masnaszamav2 | /database/views/courier_schedules.sql | UTF-8 | 295 | 3.59375 | 4 | [
"MIT"
] | permissive | DROP VIEW IF EXISTS courier_schedules;
CREATE VIEW courier_schedules AS
SELECT s.schedule_id, s.start_time, s.end_time, s.full_date, es.person_id as "courier_id", s.week_number
FROM schedule s
JOIN employees_schedules es ON s.schedule_id = es.schedule_id
JOIN courier c ON es.person_id = c.id;
| true |
f5df47a640877c0e8090cfc8d1878c3628474c52 | SQL | capristano/medication-stock | /test-api/src/main/resources/schema.sql | UTF-8 | 664 | 3.296875 | 3 | [] | no_license | /*
* This script is executed when our application is starting
*/
CREATE TABLE IF NOT EXISTS medication(
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(512) NOT NULL,
dosage REAL,
unit_measurement VARCHAR(3),
initial_amount INTEGER,
amount_quarter1 INTEGER,
price_quarter1 REAL,
amount_quarter2 INTEGER,
p... | true |
831dc3f62896446338d9a0451db92452c59553b3 | SQL | AppSecAI-TEST/servercenter | /ordercenter/doc/orderCenter.sql | UTF-8 | 6,261 | 3.515625 | 4 | [] | no_license | drop SCHEMA if exists `zm_order`;
CREATE SCHEMA `zm_order` ;
use zm_order;
drop table if exists `zm_order`.`order_base`;
CREATE TABLE `zm_order`.`order_base` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`order_id` CHAR(20) NOT NULL,
`combination_id` CHAR(20) NULL COMMENT '订单拆分后的总ID',
`u... | true |
090d6054aed0158bcee81595d17aa4227c9a9e48 | SQL | johnkhanal/fran-s-furniture | /j_furniture.sql | UTF-8 | 5,132 | 3.5 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 05, 2019 at 08:14 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
0975fbe9107df3c49f4df9b67615ad18ac5501ef | SQL | gissegauto/SistemaGestionIncidencias | /script.sql | UTF-8 | 1,056 | 3.109375 | 3 | [] | no_license | DROP DATABASE `mitv`;
-- CREAR BASE DE DATOS
create database mitv;
-- CREAR ROL ADMINISTRADOR
INSERT INTO `mitv`.`rol` (`idrol`, `descripcion`, `estado`) VALUES ('1', 'Administrador', 'Activo');
select * from mitv.rol;
--- CREAR USUARIO ADMIN
INSERT INTO `mitv`.`usuario` (`idusuario`, `estado`, `password`, `userna... | true |
132d5c78e195019d9444e535c6e8c7d5ae68d7ef | SQL | timgavin/cloud-files-image-gallery | /open-cloud.sql | UTF-8 | 898 | 3.234375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | CREATE TABLE `galleries` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`container` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`private` char(1) NOT NULL DEFAULT '0',
`created_at` datetime NOT... | true |
f70f4857b7379763de4d6a8ca3607e647ace5d02 | SQL | orangemug/sql-stamp | /test/operators/require/in.sql | UTF-8 | 333 | 2.703125 | 3 | [
"MIT"
] | permissive | WITH spread_cte AS (
{> ./in_sub.sql, ...user}
),
object_cte AS (
{> ./in_sub.sql, user.id}
),
key_cte AS (
{> ./in_sub.sql, id:user.id}
),
multi_arg_cte AS (
{> ./in_sub_multi.sql, id:user.id, role:user.role}
)
/* This is a totally pointless example, but tests what we want */
select * from spread_cte, object_c... | true |
18258c407b972c54edfae612ba66c907647bac19 | SQL | renmoneyP/todo | /todo.sql | UTF-8 | 1,622 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 25, 2019 at 03:10 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
583c09a56eecfecfbb5cb7a7c61c0cf259db6276 | SQL | ZMEYZZZ/Dayz-private-master-linux-fix | /SQL/windows.sql | UTF-8 | 31,109 | 3.1875 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.11-log - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.3.0.5053
-- --------------------------------------------------------... | true |
08d812cee5f7a8d06f6d09e0b43abc89410f9964 | SQL | JohnnyAces72/ProjectII-Datbase | /projectii_account_name.sql | UTF-8 | 2,538 | 2.984375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: projectii
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULT... | true |
5eec453bde4f1501905598fe3b0ad33597c0264c | SQL | Alok-M-Rao/PANCHAYAT-DATABASE-SYSTEM | /PANCHAYAT.sql | UTF-8 | 17,594 | 3.671875 | 4 | [] | no_license | create database PANCHAYAT
use PANCHAYAT
GRAMA_SABHA(VillageNumber)
CITIZEN (Fname,Mname,Lname,UID,Sex,DOB,Phone,Address,VNumber)
MEMBER (MemberID,MUID,Department,Salary)
SARPANCH (SarpanchID,SUID,Salary)
PANCHAYAT (VillageName,DistrictName,SarID,VNo)
GOVERNMENT (StateName,ChiefMinister,Governor,GID)
SECRETARY (Fnam... | true |
d312a8e0d4dfa280350d65e262be754eaf5a82a7 | SQL | vincent-kangzhou/Leetcode_SQL_Hard | /185_Department Top Three Salaries.sql | UTF-8 | 638 | 4.28125 | 4 | [] | no_license | # Write your MySQL query statement below
select d.name department, e1.name Employee, e1.salary Salary from department d join employee e1 on e1.departmentid=d.id where 3>(
select count(distinct e2.salary) from employee e2 where e2. salary>e1.salary and e2.departmentid=e1.departmentid
)
order by department, salary;
... | true |
5baf3beeea7d3b626f75425c36292e2780f32c0a | SQL | JayrajSarvaiya0413/EMAIL-COMIC-USING-GOOGLE-API | /DATABASE/rtcampemail.sql | UTF-8 | 1,408 | 2.796875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 29, 2021 at 07:41 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
9eb146225d6acc28785084252f85dec3ab53b078 | SQL | chardmd/spring-goodreads | /src/main/resources/db/hsqldb/initDB.sql | UTF-8 | 335 | 2.765625 | 3 | [] | no_license | DROP TABLE books IF EXISTS;
CREATE TABLE books (
id INTEGER IDENTITY PRIMARY KEY,
title VARCHAR(100),
author VARCHAR(100)
);
CREATE TABLE readers (
id INTEGER IDENTITY PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHAR(30),
address VARCHAR(255),
city VARCHAR(80),
telephone ... | true |
70c133fb0ab62ae2aaaca17c03e04108eb071d57 | SQL | bugaosuni59/homework-DB | /合同管理系统/htdocs/install.sql | UTF-8 | 1,596 | 3.171875 | 3 | [] | no_license | CREATE DATABASE hmwk;
USE hmwk;
CREATE TABLE IF NOT EXISTS user (
uid INT PRIMARY KEY,
name VARCHAR(30),
pswd VARCHAR(30)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE IF NOT EXISTS stage (
sid INT PRIMARY KEY,
sname VARCHAR(30)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
... | true |
bb0e3f20d94599c8ca74a6be4e68f67b008bf726 | SQL | GeorgeNakhle/OOP-Project | /database/contacts.sql | UTF-8 | 258 | 3.46875 | 3 | [] | no_license | USE `chats_db`;
SELECT
adder.username AS 'Added By',
added.username AS 'User Added',
c.nickname AS 'Nickname',
c.notes AS 'Notes'
FROM
contact c, user adder, user added
WHERE
c.added_by = adder.id AND
c.user_added = added.id; | true |
a7e39bd2bd24c45f47cbfe4072430434d6c33e30 | SQL | teiid/teiid-spring-boot | /tools/vdb-codegen-test/src/test/resources/materialized.ddl | UTF-8 | 4,137 | 3.453125 | 3 | [
"Apache-2.0"
] | permissive | /*
###########################################
# START DATABASE customer
###########################################
*/
CREATE DATABASE customer VERSION '1' OPTIONS (ANNOTATION 'Customer VDB');
USE DATABASE customer VERSION '1';
--############ Translators ############
CREATE FOREIGN DATA WRAPPER mypostgresql TYPE post... | true |
2e4fd84eeed30300e6cd926209c8e006fb1f3bae | SQL | nikmois/testing | /php testing/books/books.sql | UTF-8 | 521 | 2.890625 | 3 | [] | no_license | CREATE DATABASE books;
USE books;
CREATE TABLE books (
ID INT PRIMARY KEY,
Title VARCHAR(100) NOT NULL,
YearPublished INT NOT NULL,
Edition INT NOT NULL,
Publisher VARCHAR(60) NOT NULL,
Authors VARCHAR(120) NOT NULL
);
INSERT INTO books VALUES
(1, "The C++ Programming Language", 2013, 4, "Addison-Wesley", "Bjarn... | true |
c05b6046d6fbb6985832729ef00f8b131fa4fc86 | SQL | b1ck0/python_coding_problems | /SQL/009_leetcode_department_highest_salary.sql | UTF-8 | 570 | 4.46875 | 4 | [] | no_license | -- https://leetcode.com/problems/department-highest-salary/
select
department_table.Name as "Department",
employee_table.Name as "Employee",
employee_table.Salary as "Salary"
from Employee as employee_table
join Department as department_table
on employee_table.DepartmentId = department_table.Id
join (
s... | true |
8008e23a8cfd7db13746626618697201779e5561 | SQL | FastnetDigitalMedia/zipi-manager | /distro/data/src/main/resources/ddls/zipi_h2.ddl | UTF-8 | 24,730 | 2.609375 | 3 | [] | no_license | -- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: c:/Users/ewittman/git/zipi/zipi/distro/ddl/src/main/liquibase/master.xml
-- Ran at: 9/29/15 2:11 PM
-- Against: null@offline:h2?versi... | true |
b99ae407bd62583d0b72f129ad0900edd327dc3c | SQL | sork01/dbas | /lab1/present/lab1.4.sql | UTF-8 | 650 | 4.15625 | 4 | [] | no_license | -- 4. Which hemisphere has the largest lake/desert area ratio,
-- the eastern or the western?
-- eastern: longitude > 0, western: longitude < 0
SELECT
(CASE WHEN
(lake_west.sum / desert_west.sum) < (lake_east.sum / desert_east.sum)
THEN 'east'
ELSE 'west' END) AS answer
FROM
(SELECT SUM(area) FR... | true |
eb22fd9c091161261b395309e14a9f20c848632a | SQL | zymITsky/nike-dq-boot | /src/main/resources/database/mysql/nikedq-mysql-schema.sql | UTF-8 | 11,859 | 3.703125 | 4 | [] | no_license |
DROP DATABASE IF EXISTS nikedq;
CREATE DATABASE IF NOT EXISTS nikedq;
use nikedq;
-- =============================
-- Table of DQ_USER_PROFILE_TAB
-- =============================
DROP TABLE IF EXISTS DQ_USER_PROFILE_TAB;
CREATE TABLE IF NOT EXISTS DQ_USER_PROFILE_TAB (
USER_ID INT NOT NULL AUTO_INCREMENT,
USE... | true |
2a937255f1469cb536b1d9b1b2daeebe52850cb9 | SQL | biacpaixao/Projeto_Final | /dump_mysql_customer.sql | UTF-8 | 12,256 | 3.75 | 4 | [] | no_license | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `customer` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `customer` ;
-- -----------------------... | true |
7bd0bb798b189138d0309eb390d9130a00f459cd | SQL | bobbykawade/SQL-Programming | /Leetcode-SQL-main/197. Rising Temperature.sql | UTF-8 | 138 | 3.265625 | 3 | [] | no_license | SELECT w1.id
FROM Weather w1, Weather w2
WHERE w1.recordDate = DATE_ADD(w2.recordDate, INTERVAL 1 DAY)
AND w1.Temperature > w2.Temperature | true |
8faa514bc90d94a8f544cca481d3cf6e40254797 | SQL | zaoldyeck/quantlib | /src/main/resources/sql/materialized_view/2_balance_sheet_with_titles.sql | UTF-8 | 6,155 | 3.25 | 3 | [] | no_license | create materialized view balance_sheet_with_titles as
with cash as (select year, quarter, company_code, value
from balance_sheet
where (title = '現金及約當現金' or title = '現金及約當現金合計' or title = '現金及約當現金總額')
and value is not null),--66577
receivable as (select market, year, qua... | true |
1d13a9e7558c85c44aa2e00cea36d6cdbfed2885 | SQL | boyyob747/edocument | /edeocument.sql | UTF-8 | 4,539 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.8
-- http://www.phpmyadmin.net
--
-- โฮสต์: localhost
-- เวลาในการสร้าง: 24 ก.ค. 2017 09:17น.
-- เวอร์ชั่นของเซิร์ฟเวอร์: 5.1.73-log
-- รุ่นของ PHP: 5.4.45
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- ฐานข้อมูล: `swcm_smss`
--
-- ---------------------... | true |
de248b9ae7b0d03645e640bb9b6d23a7030bdf52 | SQL | th45i4/UC_Davis_SQL_Certification | /Week1/week_1_practice_quiz.sql | UTF-8 | 2,057 | 4.0625 | 4 | [] | no_license | --For all of the questions in this quiz, we are using the Chinook database. All of the interactive code blocks have been setup to retrieve data only from this database.
--1: Run query: Retrieve all the data from the tracks table. Who is the composer for track 18?
Select *
From Tracks;
--2:Run Query: Retrieve all data... | true |
816a1f729a91e751892d5a7dfdabaec058c9f753 | SQL | arteam/jdit-examples | /custom-dbi-factory/src/test/resources/schema.sql | UTF-8 | 886 | 3.734375 | 4 | [
"MIT"
] | permissive | create table manufacturers (id bigint primary key, name varchar(64));
create table types (name varchar(16) primary key);
create table models (
id bigint primary key,
name varchar(64) not null,
manufacturer_id bigint not null,
type_name varchar(16) not null,
year ... | true |
212e40a5289d408c349129aed23f903657fe5c4a | SQL | berdosi/postgrest-example | /000_initial_grant.sql | UTF-8 | 594 | 2.8125 | 3 | [] | no_license | -- https://postgrest.org/en/v7.0.0/schema_structure.html :
-- By default, when a function is created, the privilege to execute it is not
-- restricted by role. The function access is PUBLIC—executable by all roles
-- (more details at PostgreSQL Privileges page). This is not ideal for an API
-- schema. To disable this b... | true |
91dd59895a676fbb0823455896e2b77b224f2242 | SQL | andersoncruzz/framework-AG | /db.sql | UTF-8 | 2,029 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 26-Mar-2018 às 09:16
-- Versão do servidor: 5.7.19-0ubuntu0.16.04.1
-- PHP Version: 7.0.18-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
4d326ee312f87880d57585cc80f1900eab74a566 | SQL | fadhilihsn/Hello-Coffee | /hellocoffee.sql | UTF-8 | 4,507 | 3.015625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 22 Apr 2019 pada 14.57
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
c0b7864aedc5caad64d93b4505c41912f21bca71 | SQL | toncus/MySQL10hw | /SQL10hw_6b.sql | UTF-8 | 238 | 3.546875 | 4 | [] | no_license | select first_name, last_name, SUM(amount) from sakila.staff
JOIN sakila.payment on staff.staff_id = payment.staff_id
where YEAR(payment.payment_date)='2005' and month(payment.payment_date)='08'
group by last_name, first_name;
| true |
b37836e6a59974d069650a6c8fb4e060bd6b8a56 | SQL | jmmedel/Laravel_Blog_CMS | /blog/freshdb.sql | UTF-8 | 16,206 | 2.984375 | 3 | [
"MIT"
] | permissive | -- MySQL dump 10.13 Distrib 5.5.43, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: laravel5_blog_dist
-- ------------------------------------------------------
-- Server version 5.5.43-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_... | true |
0156c4c31efd288350888c6b712a05b7824a846e | SQL | arieh/Autosave | /Demo/data.sql | UTF-8 | 653 | 2.625 | 3 | [] | no_license | /*
MySQL Data Transfer
Source Host: localhost
Source Database: autosave
Target Host: localhost
Target Database: autosave
Date: 31/08/2010 13:47:07
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for data
-- ----------------------------
DROP TABLE IF EXISTS `data`;
CREATE TABLE `data` (
... | true |
1c32d34c5043dae6816950eb855403adec3e2e3a | SQL | atiqahammed/QL | /basic/Table/0001_Create/ForeignKey/CREATE_TABLE_0001.sql | UTF-8 | 312 | 3.625 | 4 | [] | no_license | USE [Test1]
CREATE TABLE [Product]
(
product_id INT PRIMARY KEY,
product_name VARCHAR(50) NOT NULL,
product_categoty VARCHAR(50)
);
CREATE TABLE [Order]
(
order_id INT PRIMARY KEY,
product_id INT NOT NULL,
CONSTRAINT product_foreign_key
FOREIGN KEY (product_id)
REFERENCES [Product] (product_id)
); | true |
cfb7ec66014192219ba0e53befb8e49efed33306 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day12/select0013.sql | UTF-8 | 264 | 2.90625 | 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='WiFiAP' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['3100_7','2206','5068','6011','2072','5084','5221','3226','4088','6092'])
| true |
41dd236c5e286f7095e6544d04deaa12b7f71956 | SQL | MaciejDot/WorkoutPlanService | /WorkoutPlanService.DataPersistance/Workout/Stored Procedures/sp_WorkoutSchedule_Add.sql | UTF-8 | 544 | 2.671875 | 3 | [] | no_license | CREATE PROCEDURE [Workout].[sp_WorkoutSchedule_Add]
@ExternalId UNIQUEIDENTIFIER,
@Recurrence INT,
@FirstDate DATETIME2(7),
@RecurringTimes INT,
@WorkoutPlanExternalId UNIQUEIDENTIFIER,
@Created DATETIME2(7),
@IsActive BIT
AS
INSERT INTO [Workout].[WorkoutSchedu... | true |
1a38bfa176099dd8785e058e2f2aa0389b91cab1 | SQL | Escobar3/parcial3 | /parcial.sql | UTF-8 | 1,622 | 3.8125 | 4 | [] | no_license | create database Pr;
use pr;
create table students (
SID integer not null,
name varchar(30),
lapellido varchar(30),
email varchar(30),
primary key(SID)
);
create table EXERCISE(
CAT varchar(1),
ENO integer,
TOPIC varchar(30),
MAXPT INTEGER,
primary key (CAT,ENO)
);
create table RESULTS(
SID i... | true |
f28439b206f042ce09b2cc8dd10dd5ad551d0e9c | SQL | AlexArchibeque/Aa_Classwork | /W5D3/AA_Questions/import_db.sql | UTF-8 | 2,949 | 4.03125 | 4 | [] | no_license | DROP TABLE IF EXISTS replies;
DROP TABLE IF EXISTS question_likes;
DROP TABLE IF EXISTS question_follows;
DROP TABLE IF EXISTS questions;
DROP TABLE IF EXISTS users;
PRAGMA foreign_keys = ON;
CREATE TABLE users (
id INTEGER PRIMARY KEY,
fname TEXT NOT NULL,
lname TEXT NOT NULL
);
INSERT INTO
users(f... | true |
a0c482564fe90dbb1013f351975c85d2414b4a06 | SQL | RZHANG2021/sql-challenge | /EmployeeSQL/schemata.sql | UTF-8 | 1,575 | 4 | 4 | [] | no_license | -- ref https://en.wikipedia.org/wiki/Associative_entity
-- Drop the table is exists
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;
-- 1.Create departements table
CREATE TA... | true |
4ec840f5e5598f9248f29a2094d624bf3ae582e5 | SQL | viniciusamelio/Estudos-PHP | /DAO/Database/proc_usuarios_insert.sql | UTF-8 | 300 | 2.6875 | 3 | [] | no_license | use poo;
delimiter $
create procedure if not exists proc_usuarios_insert(
pnome varchar(80),
plogin varchar(60),
psenha varchar(40)
)
begin
insert into usuarios(nome,login,senha) values(pnome,plogin,psenha);
select * from usuarios where id = LAST_INSERT_ID();
end
$
delimiter ;
| true |
565a9ec48b0ad19ff02fa9d6fc8356051129b133 | SQL | anatole72/sql_scripts | /admin_scripts/scripts/profiles.sql | UTF-8 | 690 | 3.65625 | 4 | [] | no_license | REM
REM Display profiles
REM
PROMPT
PROMPT P R O F I L E S
PROMPT
ACCEPT pro PROMPT "Profile name like (ENTER for all): "
ACCEPT res PROMPT "Resource name like (ENTER for all): "
ACCEPT lim PROMPT "Limit like (ENTER for all): "
@_BEGIN
@_TITLE "P R O F I L E S"
COLUMN profile FORMAT A30
COLUMN resource_n... | true |
ea6b70a47dd0483ba1411fdd2a8d7669306c9067 | SQL | Ruk33/AresLands | /sql/tables/quests.sql | UTF-8 | 1,672 | 2.890625 | 3 | [
"MIT",
"LicenseRef-scancode-dco-1.1"
] | permissive | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 5.6.17 - MySQL Community Server (GPL)
-- SO del servidor: Win64
-- HeidiSQL Versión: 9.1.0.4867
-- --------------------------------------------------------
/*... | true |
fcfce7a1ed3cfe37f0ffd837be06f27f173497af | SQL | grachro/dbviewer | /initialize/init-sample-sqlite.sql | UTF-8 | 4,204 | 3.015625 | 3 | [] | no_license | create table pages (title varchar,url varchar, primary key(title));
create table categories (category_name varchar, primary key(category_name));
create table category_page (category_name varchar, title varchar, primary key(category_name, title));
insert into pages (title) values ('FORTRAN');
insert into pages (title)... | true |
30684452aeea0589cb4e121dd928f50d7fdf0e32 | SQL | kronik-coder/movie-theatre-sql | /movie_theatre.sql | UTF-8 | 676 | 3.46875 | 3 | [] | no_license | CREATE TABLE customer(
customer_id SERIAL PRIMARY KEY,
first_name VARCHAR(100),
last_name VARCHAR(100)
);
CREATE TABLE movie(
movie_id SERIAL PRIMARY KEY,
movie_name VARCHAR(150)
);
CREATE TABLE ticket(
ticket_id SERIAL PRIMARY KEY,
customer_id INTEGER NOT NULL,
movie_id INTEGER NOT NU... | true |
8239906128a74e6331d0c7bb52f8bfd147dbedf4 | SQL | moqiang02/novel | /jieqi.sql | UTF-8 | 13,110 | 3 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | CREATE TABLE IF NOT EXISTS `jieqi_system_groups` (
`groupid` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '1是游客,2是管理员,3是普通用户,6是作者',
`name` varchar(50) NOT NULL DEFAULT '',
`description` text,
`grouptype` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`groupid`) USING BTREE,
unique key `na... | true |
bbc970cdc88f20d7a00c106fe70c06b4ac1a2ada | SQL | msoto6/ITMD__321_Final_Project | /Datasets/USCrimes_multi_bias.sql | UTF-8 | 2,669 | 2.96875 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `USCrimes` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `USCrimes`;
-- MySQL dump 10.13 Distrib 8.0.21, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: USCrimes
-- ------------------------------------------------------... | true |
818a5b6ad8dee1fb6f6e1a33a07b9ed30b86598b | SQL | wawans/webcafe | /database.sql | UTF-8 | 5,266 | 2.921875 | 3 | [
"MIT"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : MySQL
Source Server Version : 50614
Source Host : localhost:3306
Source Database : lacafe
Target Server Type : MYSQL
Target Server Version : 50614
File Encoding : 65001
Date: 2016-01-22 15:51:38
*/
SET FOREIGN_KEY_CHECKS=0;
-- ------... | true |
aa2cbb486b224e0d81e26f8e4489324a9e74a3d0 | SQL | archivesspace-labs/container_checker | /container.sql | UTF-8 | 2,950 | 3.859375 | 4 | [] | no_license | SELECT
CASE
WHEN i.accession_id IS NOT NULL then CONCAT( "(", a.id, ")", " ", a.title, " " )
ELSE NULL
END as accession,
CASE
WHEN i.resource_id IS NOT NULL then CONCAT( "(", r.id, ")", " ", r.title, " " )
WHEN i.archival_object_id IS NOT NULL the... | true |
9bd2ca0d5e35fec4a39da91b82941ee67bd0fb42 | SQL | vbastosr/sql | /week01/aula1/ex/ex01.sql | UTF-8 | 140 | 2.703125 | 3 | [
"Unlicense"
] | permissive | -- Ex1: Quantos produtos temos da categoria 'artes'?
SELECT count(*) as qtd_items
FROM tb_products
WHERE product_category_name = 'artes' | true |
8e27ee2cc6ae124e22e1b2c84461d664579f8a7e | SQL | deepab1971/Sitecore-Maintenance-Scripts | /Maintenance/Sitecore_CleanupAuthenticationTickets.sql | UTF-8 | 393 | 2.859375 | 3 | [] | no_license | /*
--Too many records in CORE DB properties table will slow down the sitecore login process,
hence peridocally SC_TICKET records must be cleanedup
*/
BEGIN
--Deletes records in batch to limit the number of records in one transaction
WHILE 1=1
BEGIN
SET ROWCOUNT 10000
DELETE dbo.properties
WHERE [key] like '%S... | true |
6e541d2473d0d55dd4dddc7d557232bbccfdfab3 | SQL | salvajih/LSC-Grants | /Easygrants_Web_LSC/Easygrants_Web_LSC/DBScripts/Build 4.x/Build 4.0/12_Create_vLSC_OPEN_CASE_TOTAL.sql | UTF-8 | 319 | 2.765625 | 3 | [] | no_license | CREATE VIEW vLSC_OPEN_CASE_TOTAL
AS
SELECT lsc_open_case_id,
ISNULL(con_fin, 0) +
ISNULL(education, 0) +
ISNULL(employment, 0) +
ISNULL(family, 0) +
ISNULL(juvenile, 0) +
ISNULL(health, 0) +
ISNULL(housing, 0) +
ISNULL(income, 0) +
ISNULL(individual, 0) +
ISNULL(misc, 0) total
FROM LSC_OPEN_CASE | true |
fb24be2f650861f407b392b07d2fd7092bfc5317 | SQL | caligula95/online-store-examle | /src/main/resources/db/migration/V2__change_purchase_item_order_mapping.sql | UTF-8 | 325 | 2.9375 | 3 | [] | no_license | alter table purchase_item_table
add order_id int;
alter table purchase_item_table
add constraint purchase_item_table_order_table_id_fk
foreign key (order_id) references order_table;
alter table order_table drop constraint order_table_purchase_item_table_id_fk;
alter table order_table drop column purchase_item_id... | true |
7343fbbd116ee9932b7ac7d7158d2969c68bfd45 | SQL | marhanlang/Olympic_analysis | /Segment_2/pstgrs.sql | UTF-8 | 438 | 2.765625 | 3 | [] | no_license | Create table Summer (
Name Varchar,
Sex Varchar,
Age INT NOT NULL,
Height INT NOT NULL,
Weight INT NOT NULL,
Team Varchar,
Games Varchar,
Season Varchar,
Event Varchar,
Medal Varchar
);
SELECT * From Summer
Create table Winter (
Name Varchar,
Sex Varchar,
Age INT NOT NULL,
Height INT NOT NULL,
Weight ... | true |
3e5c2e533674dc6483946fdb2e0d7c42de81ad6c | SQL | NickDevSpace/DianTou | /app/database/migrations/STORED_PROCEDURES.sql | UTF-8 | 2,236 | 3.484375 | 3 | [
"MIT"
] | permissive | DROP PROCEDURE P_PROJECT_STATE_SCAN;//
CREATE PROCEDURE P_PROJECT_STATE_SCAN()
BEGIN
-- 把融资时间已到的项目的状态改掉,并记录项目生命周期。
-- 因为这个是前台无法被主动触发的。而对于融资还未到期金额已满的项目,则PHP即可处理
CREATE TEMPORARY TABLE IF NOT EXISTS TMP_PROJECTS
(
PROJECT_ID INTEGER,
RSLT VARCHAR(20)
... | true |
540efccd44bbc86abcac2196372b4e4a09d3720c | SQL | kopwei/homeworkyun | /dbsql.sql | UTF-8 | 452 | 2.6875 | 3 | [] | no_license |
CREATE TABLE `users` (
`id` bigint(20) NOT NULL auto_increment,
`md5_id` varchar(200) NOT NULL,
`user_name` varchar(200) collate utf8_general_ci NOT NULL default '',
`pwd` varchar(220) collate utf8_general_ci NOT NULL default '',
`gender` smallint NOT NULL,
`ckey` varchar(220) collate utf8_general_c... | true |
148c54a9ac033277368547451dc89d2de2340946 | SQL | Rizalmultimedia2/uaspemweb | /go_promote.sql | UTF-8 | 7,249 | 3.171875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 08 Des 2020 pada 14.51
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... | true |
346aec8382f17dc316c6b3d21553b39382bb4437 | SQL | makiftutuncu/dream-theater | /conf/evolutions/default/2.sql | UTF-8 | 395 | 2.765625 | 3 | [
"MIT"
] | permissive | -- !Ups
CREATE TABLE "dreams"(
"id" UUID PRIMARY KEY,
"user_id" UUID NOT NULL REFERENCES "users"("id"),
"title" TEXT NOT NULL,
"body" TEXT NOT NULL,
"attachment_url" TEXT,
"created_at" TIMESTAMPTZ(3) NOT NULL,
"updated_at" TIMESTAMPTZ(3) NOT NUL... | true |
5994dfd614551b313dd962b9c5fddefe2b13db5c | SQL | arjunhm/dbms_project | /Database/hotelproject_employee.sql | UTF-8 | 2,988 | 2.703125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: hotelproject
-- ------------------------------------------------------
-- Server version 5.7.19-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... | true |
d7c9c5ee88309d295e41474308935bc3ce5a4630 | SQL | Samyuktha1420/SQLServer-Cheat-Sheet | /ETESP info 2 mod/Respostas aula 03 (22-02-17).sql | WINDOWS-1252 | 1,744 | 3.984375 | 4 | [] | no_license | --Exerccios Funes de data e operador union. ( aula 03)
--1 Exiba o nome e data de nascimento dos funcionrios, separando dia, ms e ano.
select DAY(dataNasc) as 'Dia', MONTH(dataNasc) as 'Mes', YEAR(dataNasc) as 'Ano' from Funcionarios
--2 Exiba o nome dos meses da data de nascimento dos funcionrios ordenados.
selec... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.