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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a1cf5e34aaf5a7ba3ccbabbc284b5e3a5f75083c | SQL | kongyew/gpdb | /src/test/tinc/tincrepo/mpp/gpdb/tests/package/contrib/postgis/roads.sql | UTF-8 | 2,413 | 4.125 | 4 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"PostgreSQL",
"LicenseRef-scancode-other-copyleft",
"metamail",
"BSD-3-Clause",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-other-permissive",
"ISC",
"Python-2.0",
"bzip2-1.0.6",
"LicenseRef-scancode-ssleay-windows",
"LicenseRef-scanco... | permissive | -- start_ignore
DROP TABLE IF EXISTS areas;
-- end_ignore
CREATE TABLE areas (id INT4, name text);
SELECT AddGeometryColumn('public','areas','geom', 0,'GEOMETRY',2);
INSERT INTO areas(id, geom, name) VALUES (1, ST_GeomFromText('POLYGON((1 1, 4 1, 4 4, 1 4, 1 1))'),'A');
INSERT INTO areas(id, geom, name) VALUES (2, ST_... | true |
ecd1a7d49d73e59d81552b5cd24c869c8c66021b | SQL | Maribmdj/chaoDesempleoProyII | /SCRIPTS/ESTADISTICAS/solicitantesxDistrito.sql | UTF-8 | 376 | 3.046875 | 3 | [] | no_license | Delimiter $$
CREATE PROCEDURE `SolicitantesxDistrito`()
MODIFIES SQL DATA
BEGIN
SELECT
dp.distrito,
count(dp.id_person) as 'Total'
FROM (select p.id_person, d.name as 'distrito' from person p, distrito d where p.id_distrito = d.id_distrito and p.id_typeperson = 3) as dp, jobxperson
WHERE dp.id_person = job... | true |
3ae853bbbb2c584675260692f19a4a0919304156 | SQL | Haga-z/final-exam | /src/main/resources/db/migration/V5__create_photo_table.sql | UTF-8 | 261 | 3.125 | 3 | [] | no_license | use `exam`;
CREATE TABLE IF NOT EXISTS `photos` (
`id` int auto_increment NOT NULL,
`name` varchar(100) NOT NULL,
`photo` longblob NOT NULL,
`place_id` int NOT NULL ,
PRIMARY KEY (`id`),
foreign key (place_id)references `places`(id)
); | true |
cd009f4865842ddd9c116339356ca808fe80c765 | SQL | YuanzheChen/moocMIT_quantified | /feature_populate/scripts/706_rewatching_rate_per_video.sql | UTF-8 | 2,192 | 4.0625 | 4 | [] | no_license | -- time the script takes to run on moocdb db: xxx seconds
-- date: 27/07/2017
-- author: John Mucong Ding
-- email: johnding1996@hotmail.com
-- description of feature:
set @current_date = CAST('CURRENT_DATE_PLACEHOLDER' AS DATETIME);
set @num_weeks = NUM_WEEKS_PLACEHOLDER;
DROP FUNCTION IF EXISTS get_if_rewatched;
... | true |
88f89e242bdbc6276d81419ee33c0a278ccc3d96 | SQL | alldatacenter/alldata | /olap/doris/regression-test/suites/github_events_p2/sql/repositoriesByAmountOfModifiedCode.sql | UTF-8 | 352 | 4 | 4 | [
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"OpenSSL",
"LicenseRef-scancode-facebook-patent-rights-2",
"PSF-2.0",
"dtoa",
"GPL-2.0-only",
"LicenseRef-scancode-public-domain"
] | permissive | SELECT
repo_name,
count() AS prs,
count(distinct actor_login) AS authors,
sum(additions) AS adds,
sum(deletions) AS dels
FROM github_events
WHERE (event_type = 'PullRequestEvent') AND (action = 'opened') AND (additions < 10000) AND (deletions < 10000)
GROUP BY repo_name
HAVING (adds / dels) < 10
ORD... | true |
f0a96a81a887fcce729c0946f41d1b194d2b41d8 | SQL | awelnerhissen/repository3 | /nejashiDb.sql | UTF-8 | 6,045 | 2.859375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 19, 2018 at 01:44 PM
-- Server version: 5.7.22-0ubuntu0.16.04.1
-- PHP Version: 7.0.28-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
81899c4ca11fb58d7e83913dc9369dc1389ee580 | SQL | memsql/benchmarks-tpc | /tpcc/load.sql | UTF-8 | 4,895 | 3.03125 | 3 | [] | no_license | use tpcc;
-- Example load commands - fill in your AWS keys and AWS bucket
CREATE PIPELINE IF NOT EXISTS customer_pipeline AS
LOAD DATA S3 "yourbucket/tpcc/customer."
CONFIG '{"region":"us-east-1", "disable_gunzip": false}'
CREDENTIALS '{ "aws_access_key_id": "YOUR_AWS_ACCESS_KEY_ID", "aws_secret_access_key": "YOUR_AW... | true |
9c8be4f32fa5fda9f09e2341a334e5b8b26e3fc7 | SQL | Aseem001/EmployeePayrollDB_UC8-UC12 | /UC11CreatingTablesAsERConcept.sql | UTF-8 | 2,010 | 3.84375 | 4 | [] | no_license | /*UC 11 : Implemetation of E-R concept*/
use payroll_services;
--Creating company table
create table company
(CompanyId int not null primary key,
CompanyName varchar(150) not null
);
select * from company;
--Adding data to table
insert into company values
(1001,'Capgemini'),
(1002,'Bridgelabz');
--Creating employee ... | true |
794b71aadc21c7f359d7d0d2152726b08ddb4d74 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day28/select0442.sql | UTF-8 | 178 | 2.625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-27T04:42:00Z' AND timestamp<'2017-11-28T04:42:00Z' AND temperature>=23 AND temperature<=44
| true |
8c4323c0c9b86b36ba0f068bf91c0f8d3ec1548b | SQL | migueljoba/par2017 | /PAROnline/script_bd.sql | UTF-8 | 555 | 3.5 | 4 | [] | no_license | CREATE TABLE categoria (
id_categoria SERIAL CONSTRAINT PK_CATEGORIA PRIMARY KEY,
descripcion TEXT
);
CREATE TABLE usuario (
id_usuario SERIAL PRIMARY KEY,
nombre VARCHAR(100),
apellido VARCHAR(100),
login_name VARCHAR(30),
password VARCHAR(50),
tipo_usuario INTEGER
);
CREATE TABLE producto (
id_producto S... | true |
c76afcc86abe3f79bfabb8a3248e2f4df780d063 | SQL | yahong2018/imms-aisan | /src/main/sql/upgrade/org.sql | UTF-8 | 2,162 | 3.578125 | 4 | [] | no_license | --
-- 转换组织结构
--
truncate table imms.zhxh_org;
insert into imms.zhxh_org(org_code,org_name,org_type,description,parent_id,op_index,prev_index,workshop_type,gid,did,did_template,wocg_code,loc_code)
select org_code,
org_name,
case org_type when 'ORG_WORK_SHOP' then 'ORG_WORKSHOP' when 'ORG_WORK_STATION' then... | true |
ca157ad690fde3efecb02c737d2f6bcff035b3d3 | SQL | ehsia1/st-francis-web-portal | /lutece_portal/lutece/WEB-INF/sql/plugins/calendar/plugin/create_db_calendar.sql | UTF-8 | 4,833 | 3.390625 | 3 | [] | no_license | --
-- Table structure for table calendar_agendas
--
DROP TABLE IF EXISTS calendar_agendas;
CREATE TABLE calendar_agendas
(
id_agenda int default 0 NOT NULL,
agenda_name varchar(130) default NULL,
agenda_image varchar(130) default NULL,
agenda_prefix varchar(130) default NULL,
role varchar(130) NOT NULL,
... | true |
e6b4ddf028eae942835aaf2e0518c79e4453c47a | SQL | MiguelBautistaS/Proyecto_Scrapping | /oferta_academica.sql | UTF-8 | 3,244 | 3.859375 | 4 | [] | no_license | CREATE TABLE clave(
id INT PRIMARY KEY AUTO_INCREMENT,
clave VARCHAR(5) NOT NULL,
materia VARCHAR(100) NOT NULL
);
CREATE TABLE seccion(
id INT PRIMARY KEY AUTO_INCREMENT,
seccion VARCHAR(3) NOT NULL
);
CREATE TABLE profesor(
id INT PRIMARY KEY AUTO_INCREMENT,
nombre VARCHAR(100) NOT NULL
... | true |
49f4ed1699fe2bcd4a6761c1dd0ef3f370385eec | SQL | norbertpogi/Data_Science | /PLSQL/SECTION_4 (2-c_exercise).sql | UTF-8 | 3,377 | 4.53125 | 5 | [] | no_license | --1) Write a procedure to fetch data from table SALES for a given parameter orderid and
--display the data.
create or replace PROCEDURE FETCH_SALES (s_o_id NUMBER)
AS
o_id sales.order_id%type;
p_id sales.product_id%type;
c_id sales.customer_id%type;
t_amount sales.total_amount%type;
BEGIN
SELEC... | true |
2f21beb748e7b324006d5a8e59b5aeec4a14c2ed | SQL | habitual4laif/Jingo | /sql.sql | UTF-8 | 2,422 | 3.28125 | 3 | [] | no_license | CREATE TABLE product1 (
id int(11) NOT null PRIMARY KEY AUTO_INCREMENT,
title varchar(255) not null,
price decimal(10,2) not null,
last_price decimal(10,2) not null,
brand int(11) not null,
categories varchar(255) not null,
image varchar(255) not null,
description text(255) not null
);
... | true |
bf9b9113c43e2856faa68a1b1a74989630694970 | SQL | anton-ju/pt4-reports | /source_query.sql | UTF-8 | 8,802 | 2.6875 | 3 | [
"MIT"
] | permissive | SELECT ((case when( lookup_positions.flg_sb) then 0
else (case when( lookup_positions.flg_bb) then 1
else (case when( lookup_positions.flg_ep) then 2
else (case when( lookup_positions.flg_mp) then 3
else (case when( lookup_positions.flg_co) then 4
else 5 end) end) end) end) end)) as "val_... | true |
deaa9f7af2273628f9950f6a644b4ff358571278 | SQL | centralsofttrain2019/GkeiMail | /gkei_mail_db_create.sql | UTF-8 | 9,815 | 3.4375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Fri Jun 21 16:10:00 2019
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON... | true |
1cf834924e6ee13395a1e6c52f2a88bfd23752fb | SQL | JPedroSilveira/joao.silva | /Java - Módulo 08/SQL/Modulo8JavaTeste.sql | ISO-8859-13 | 546 | 3.546875 | 4 | [] | no_license | SELECT * FROM CIDADE;
SELECT * FROM ESTADO;
SELECT * FROM CIDADE WHERE NOME = 'Curvelndia';
Select c.ID,c.Nome as Nome_Cidade ,e.Nome as Nome_Estado From Cidade c Inner Join Estado e On c.Estado = e.ID;
Select * From Teste;
CREATE TABLE PESSOA (
ID NUMBER(8) NOT NULL,
NOME VARCHAR2(60) DEFAULT NULL,
CONSTRAINT... | true |
8c9e1c4bd35f0ff69d1cef816cecef6d3842a63b | SQL | 798141652/lajifenlei | /src/advice.sql | UTF-8 | 1,410 | 3.25 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 腾讯云
Source Server Type : MySQL
Source Server Version : 50728
Source Host : 49.234.101.49:3306
Source Schema : lajifenlei
Target Server Type : MySQL
Target Server Version : 50728
File Encoding : 65001
Date: 1... | true |
7070e234652718a8f14cc90c2624a7e056b16dfa | SQL | ecksma/wdi-darth-vader | /05_full_stack_sinatra/d01/Matt_Herron/SQL statements/sql-sheat-sheet.sql | UTF-8 | 903 | 3.75 | 4 | [] | no_license | #CREATE database
CREATE DATABASE vader;
#List databases
\l
#show all the tables
\dt
#Create a new table in the database
CREATE TABLE students(id SERIAL PRIMARY KEY, name varchar(255), email varchar(255));
#Insert a single record into the database
INSERT INTO students (name, email)
VALUES
('Matt', 'matthew.herron77@... | true |
f8ca3891142a5181b267c85781e3c4e0dc5d4e5e | SQL | C1DeChand/BC-Homework12 | /schema.sql | UTF-8 | 455 | 3.328125 | 3 | [] | no_license | drop database if exists homework12;
create database homework12;
use homework12;
create table department (
id int not null AUTO_INCREMENT,
name varchar(30),
primary key (id)
);
create table role (
id int AUTO_INCREMENT,
title varchar(30),
salary decimal,
department_id int,
primary key (id)
);
create table employee (... | true |
18a630400e3893f171352afa7aa280977026ab83 | SQL | qq827992983/projects | /java/ownHome/WebRoot/WEB-INF/classes/sql.sql | UTF-8 | 909 | 3.15625 | 3 | [] | no_license | create database if not exists ownhome;
create table if not exists log(id int primary key auto_increment, msg varchar(256));
create table if not exists users(userId int primary key auto_increment,userName varchar(100),password varchar(100) ,realName varchar(100),sex varchar(10));
create table if not exists type... | true |
8915e42c1503e9339ecbf9ce671935dea642ef07 | SQL | with-sahan/jentest | /database/CreateDatabase/Tables/subscription_organization.sql | UTF-8 | 2,353 | 3.15625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: subscription
-- ------------------------------------------------------
-- Server version 5.5.47
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... | true |
c73f40aa28cc2cbebd3670852e9e57aabfa5b91c | SQL | angelesaaron/studysounds | /StudySounds/db/init.sql | UTF-8 | 5,387 | 3.21875 | 3 | [] | no_license | -- TODO: create tables
-- CREATE TABLE `examples` (
-- `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
-- `name` TEXT NOT NULL
-- );
-- TODO: initial seed data
-- INSERT INTO `examples` (name) VALUES ('example-1');
-- INSERT INTO `examples` (name) VALUES ('example-2');
CREATE TABLE `users` (
`id` INT... | true |
0dbbb7c3cc9c0489b189e9ee11d0ad0cbae6e881 | SQL | gaborwho/adatbazis-feleves | /12_listak/w_ADD.sql | ISO-8859-2 | 831 | 3.390625 | 3 | [] | no_license | SET serveroutput ON
SET verify OFF
ACCEPT nev PROMPT "Krem a dik nevt: "
ACCEPT anyja_neve PROMPT "Krem a dik anyjnak nevt: "
ACCEPT szuletes PROMPT "Krem a dik szletsi dtumt: "
ACCEPT targy PROMPT "Krem a trgy nevt: "
ACCEPT osztalyzat PROMPT "Krem az osztlyzatot (res, ha hinyzott): " default 0
ACCEPT datum PROMPT "K... | true |
0a5b8ca8ae07e1c7bbf6d1131d2c7c1448c9d75f | SQL | NimahM/7777FWA_7777KEL9 | /pororoland.sql | UTF-8 | 16,154 | 3.078125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 22, 2017 at 12:54 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 |
5a84016bdfce2a3271c0172217b2267e76c5a427 | SQL | parkseoeun5322/Class_Example | /Oracle/수업자료/2020_05_29_DB_lecture.sql | UHC | 7,932 | 4.53125 | 5 | [] | no_license | 8. ǥ : NULL - Ұ, Ұ
, ÷ǥ IS NULL/IS NOT NULL Ǵ NULL ƴ ľ
SELECT * --23
FROM locations;
SELECT * --17
FROM locations
WHERE state_province LIKE '%';
--Ʒ
SELECT * --17
FROM locations
WHERE state_province IS NOT NULL;
01. μġ (, μڵ尡 NULL )
, , μڵ, ڵ, ȸ
SELECT employee_id, last_name, department_id,... | true |
86efa8ee891438fa2edda6489de4b68ca7100cd5 | SQL | JudithHe/csc343_database | /Database_Assignment/Assignment_PartB.sql | UTF-8 | 5,916 | 4.5625 | 5 | [] | no_license |
######## QUESTION 1 ######## – { 10 Points }
# a) Show the list of databases.
SHOW DATABASES;
# b) Select sakila database.
USE sakila;
# c) Show all tables in the sakila database.
SHOW TABLES;
# d) Show each of the columns along with their data types for the actor table.
DESCRIBE actor;
# e) Show the total number of r... | true |
20717937b2275d9d798789bbcb5ab60c2e6502dc | SQL | simonaslaurinavicius/art-gallery-database | /sql/create_view.sql | UTF-8 | 663 | 3.609375 | 4 | [
"MIT"
] | permissive | CREATE VIEW Grafika
AS SELECT * FROM Manager.Kurinys
WHERE Kurinys.Tipas = 'Grafika';
CREATE VIEW Pirkimai_svarbi_info
AS SELECT Pirkejas.Vardas || ' ' || Pirkejas.Pavarde AS "Pirkėjas", Pirkimas.data AS "Pirkimo data", Pirkimas.kaina AS "Pirkimo kaina", Kurinys.Pavadinimas AS "Kūrinio pavadinimas"
... | true |
d5259ed6419fc3e679c3e7419ef4afda1331f165 | SQL | macega/Jsys | /scripts/view/jsysFuncionarios.sql | UTF-8 | 401 | 2.96875 | 3 | [] | no_license | CREATE VIEW jsysFuncionarios
AS
SELECT idCliente AS idFuncionario
,nomeCorentista AS nomeCliente
,'Geral' AS turno
,'Todos' AS categoria
,cargo AS funcao
,ctps
,admissao AS dataAdmissaoServico
,jsysClientes.idLoja
FROM jsysClientes WITH (NOLOCK)
INNER JOIN jsysLojas ON jsysLojas.idloja = jsysClientes.... | true |
cc753cc662857e02a7185e1c57d331e17d5a89cd | SQL | varun2108/learning | /todayscode.sql | UTF-8 | 10,196 | 3.109375 | 3 | [] | no_license |
SQL*Plus: Release 11.2.0.2.0 Production on Fri Aug 2 10:13:46 2019
Copyright (c) 1982, 2014, Oracle. All rights reserved.
SQL> connect hr/hr
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0
SQL> connect hr/hr;
ERROR:
ORA-01033: ORACLE initi... | true |
55d2beac744231a84074ba873d898d8cb8ecb29d | SQL | THTangelrayt/phptabledata | /calisanlar.sql | UTF-8 | 1,669 | 3.265625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Anamakine: localhost
-- Üretim Zamanı: 25 May 2018, 22:43:41
-- Sunucu sürümü: 5.7.17-log
-- PHP Sürümü: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... | true |
04fd23edbd58f3712075c75b70d3978639ac081f | SQL | maze51/study | /Oracle/5-2. select.sql | UTF-8 | 16,538 | 3.703125 | 4 | [] | no_license |
--P.17
INSERT INTO LPROD (LPROD_ID,LPROD_GU,LPROD_NM) VALUES (1, 'P101', '컴퓨터제품');
INSERT INTO LPROD (LPROD_ID,LPROD_GU,LPROD_NM) VALUES (2, 'P102', '전자제품');
INSERT INTO LPROD (LPROD_ID,LPROD_GU,LPROD_NM) VALUES (3, 'P201', '여성캐주얼');
INSERT INTO LPROD (LPROD_ID,LPROD_GU,LPROD_NM) VALUES (4, 'P202', '남성캐주얼');
INSERT IN... | true |
b77637f1ed65ecac2dd81694d7498e12b4c2a962 | SQL | KergmaHyper/PyDjLL | /ant180921/set-event-data_6041_2759_1630310135.sql | UTF-8 | 119,325 | 2.90625 | 3 | [] | no_license | DROP TABLE IF EXISTS auslosungeinzel;[EOL]
CREATE TABLE `auslosungeinzel` (
`vernr` int(11) NOT NULL DEFAULT '0',
`knr` int(11) NOT NULL DEFAULT '0',
`nnr` int(11) NOT NULL DEFAULT '0',
`pos` int(3) NOT NULL DEFAULT '0',
`pool` int(3) NOT NULL DEFAULT '1',
`del` int(1) DEFAULT '0',
`fieldpos` int(11) NOT... | true |
13cfc176ce6b420cb17c7e9d3d6994511281ea46 | SQL | danstoyanov/CSharp-Databases | /01 - [MS SQL Problems]/[MS SQL Server Exams]/09 - [Databases MS SQL Server Exam 13 February 2021]/Section01_DDL.sql | UTF-8 | 1,410 | 3.609375 | 4 | [
"MIT"
] | permissive | CREATE DATABASE Bitbucket
CREATE TABLE Users
(
Id INT PRIMARY KEY IDENTITY,
Username VARCHAR(30) NOT NULL,
Password VARCHAR(30) NOT NULL,
Email VARCHAR(50) NOT NULL
)
CREATE TABLE Repositories
(
Id INT PRIMARY KEY IDENTITY,
Name VARCHAR(50) NOT NULL
)
CREATE TABLE RepositoriesContr... | true |
6e8ba86ac36440bb3ffb8ea54e068c5d6444fdec | SQL | claytonbrown/photoshare | /db/migrations/20140620173116_ChangeTagCountView.sql | UTF-8 | 1,452 | 3.953125 | 4 | [
"MIT"
] | permissive |
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE OR REPLACE VIEW tag_counts AS
SELECT t.id, t.name, ( SELECT count(*) AS count
FROM photo_tags pt
WHERE t.id = pt.tag_id) AS num_photos, ( SELECT p.photo
FROM photos p
JOIN photo_tags pt ON pt.p... | true |
8968578fc820aab49789c1dccc1485ffa9e3d115 | SQL | bitgittry/BaseCodeAnalysis | /trunk/dbv/stored_routines/PromotionRandomlySelectPlayersToAward.sql | UTF-8 | 3,423 | 3.921875 | 4 | [] | no_license | DROP procedure IF EXISTS `PromotionRandomlySelectPlayersToAward`;
DELIMITER $$
CREATE DEFINER=`bit8_admin`@`127.0.0.1` PROCEDURE `PromotionRandomlySelectPlayersToAward`(promotionID BIGINT, recurrenceID BIGINT, sessionID BIGINT, OUT statusCode INT)
root: BEGIN
DECLARE promotionIDCheck, bonusRuleAwardCounterID BIG... | true |
e14cb26394b7c749bc8051b68e5132d08a7a1a4f | SQL | TanzimIbthesam/ONLINE-GADGET-SHOPPING-CART- | /ShoppingCart/Database/producttb.sql | UTF-8 | 1,726 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 21, 2019 at 12:17 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.2.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
f6d2af332acb1e2fc66b4c690324fbd91fa0e276 | SQL | elricboa/sek-kill-demo | /src/main/sql/schema.sql | UTF-8 | 1,427 | 3.4375 | 3 | [
"Apache-2.0"
] | permissive | 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 COMMENT '秒杀开启时间',
`end_time` TIMESTAMP NOT NULL COMMENT '秒杀结束时间',
`crea... | true |
8b4d50b219f724dd8eb780a32f91a7d897f22312 | SQL | Ensembl/ensembl-funcgen | /sql/patch_69_70_b.sql | UTF-8 | 1,581 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | -- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016-2023] EMBL-European Bioinformatics Institute
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may ob... | true |
f284d169d0d0989412263cf9cc9f0f89149f4dfd | SQL | yislamovic/bootcampx | /0_selects/1_students_without_github.sql | UTF-8 | 86 | 2.671875 | 3 | [] | no_license | SELECT id, name, email, cohort_id
FROM students
WHERE email IS null
ORDER BY cohort_id | true |
f795eb63f8c840cd94af0fb6509176d8bcca39c3 | SQL | subham3947/zoyo-rooms | /src/main/resources/import.sql | UTF-8 | 2,617 | 3.015625 | 3 | [] | no_license | insert into hotel(hotel_id, hotel_name,city, star)values (1234,'Ethnotel','Kolkata',3);
insert into hotel(hotel_id, hotel_name,city, star)values (5678,'Hotel Vishal','Hyderabad',4);
insert into hotel(hotel_id, hotel_name,city, star)values (9101,'Skyline','Bengaluru',2);
insert into facility(HOTEL_ID,AC,MEALS,RESTAURA... | true |
b7dfc07cd09434a589f6bbf7f9711325019c0100 | SQL | thomas-claireau/P4-Openclassrooms | /#4 - Modele et base de donnees/express_food_bdd.sql | UTF-8 | 10,031 | 3.765625 | 4 | [] | no_license | DROP DATABASE IF EXISTS express_food;
-- -----------------------------------------------------
-- Schema Express_Food
-- -----------------------------------------------------
CREATE DATABASE `Express_Food` CHARACTER SET UTF8 ;
USE `Express_Food` ;
-- -----------------------------------------------------
-- Table `Expr... | true |
e942005c43f6691ecb089c74cb82da4adf98df79 | SQL | platonist0/club_coding | /migrations/2018-05-14-084011_create_users_groups/up.sql | UTF-8 | 353 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE `users_group` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL,
`group_id` bigint(20) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGIN... | true |
dba2ce52d2bba0ab7b6974d90e1630333fe3058a | SQL | hongyujin/finalproject_danim_yj | /finalproject_danim_yj/src/main/resources/finaldb/notice.sql | UTF-8 | 340 | 3.265625 | 3 | [] | no_license | drop sequence notice_seq;
create sequence notice_seq nocache;
drop table notice
create table notice(
notice_no number primary key,
timePosted date not null,
title varchar2(100) not null,
content clob not null,
id varchar2(100) not null,
constraint fk_notice_id foreign key(id) references member(id)
)
... | true |
0b9f50222b90f9b43899243f23e9722bc5fbeef1 | SQL | cr101/twitter-crm-blitz | /db/migrations/20210906123027_changing_relationships_to_attach_to_twitteraccounts_instead_of_user/migration.sql | UTF-8 | 2,477 | 3.609375 | 4 | [] | no_license | /*
Warnings:
- You are about to drop the column `userId` on the `DirectMessage` table. All the data in the column will be lost.
- The primary key for the `Relationship` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `user... | true |
fea1b42b453ab7f1bf7e75d6ad04e63d9a984540 | SQL | j7ng/CLFY_SA | /SA/Tables/X_BI_FLOW_CONFIG.sql | UTF-8 | 1,130 | 3.25 | 3 | [] | no_license | CREATE TABLE sa.x_bi_flow_config (
objid NUMBER(22) NOT NULL,
x_brand_name VARCHAR2(50 BYTE),
x_channel VARCHAR2(50 BYTE),
x_bal_cfg_id NUMBER(22),
x_flow_id VARCHAR2(50 BYTE),
x_script_id VARCHAR2(50 BYTE),
x_chl_cfg2metering_scenarios NUMBER(22),
insert_timestamp DATE DEFAULT SYSDATE,
updat... | true |
fec34b62788d6bf244568d7ec4454279f0ab108e | SQL | codeforeurope/gim | /db/spire/01 - CREATE DB AND USER gim_milano.sql | UTF-8 | 849 | 3.1875 | 3 | [] | no_license | --------------------------------------------------------
-- DDL for Create Database gim_milano
--------------------------------------------------------
CREATE DATABASE gim_milano;
--------------------------------------------------------
-- DDL for Create User gim_milano
-----------------------------------------------... | true |
c17f3f14024b177da7f1e05255c37800efa9258f | SQL | Abdul-Raheem-1/smart-cart | /mysql/triggers.sql | UTF-8 | 1,953 | 4.15625 | 4 | [] | no_license |
-- * User Triggers
-- ** if user tries to insert a super admin
create trigger tr_user_beforeInsert
before insert
on `user` for each row
BEGIN
if
NEW.role = 'superadmin' then set NEW.role = NULL;
end if;
END;
-- ** if user tries to update role to super admin
create trigger tr_user_beforeUpdate
before update
on... | true |
ba82ab5df6e7b94987dc359ee157fc85ac29b8dc | SQL | xfusek08/Order_project-public | /SQL/Orders/DB/V1_00/Build/V1_00_00_00/triggers/tg_oradr_bfins.sql | UTF-8 | 226 | 2.546875 | 3 | [] | no_license |
create trigger tg_oradr_bfins
for or_address
active
before insert position 0
as
begin
if (new.oradr_pk is null) then
new.oradr_pk = gen_id (gn_oradr, 1);
new.oradr_created = current_timestamp;
end
^
| true |
ef2939327a6b193456a224508d366324bffe434c | SQL | chongqiongjie/etl_sql | /model.d_cocacola_sku_mapping.sql | UTF-8 | 1,080 | 2.78125 | 3 | [] | no_license | --**********************************
--* [intro]
--* author=larluo@spiderdt.com
--* func=partition algorithm for data warehouse
--*=================================
--* [param]
--* tabname=staging table name
--* prt_cols_str=ods partition cols
--*=================================
--* [caller]
--* s... | true |
7f3801365f306ba5b2b59714744c4fac2f279652 | SQL | NotAlwaysRignt/Personal_Study | /project/Blog/src/main/sql/BlogScheme.sql | UTF-8 | 1,438 | 4.1875 | 4 | [] | no_license | CREATE DATABASE Blog;
/*
Category 是博客文章的类别,如"历史","编程"
*/
CREATE TABLE Blog.Category(
id INT NOT NULL AUTO_INCREMENT,
description CHAR(50),
name VARCHAR(50) NOT NULL,
PRIMARY KEY(id)
);
/*
Series 是同一系列的文章,如果 rank 为 0,则表示散文(只有一篇 ArticleDTO 的 id 会指向它)
*/
CREATE TABLE Blog.Series(
id INT NOT NULL AUTO_INCREMENT,
name VAR... | true |
975baaccfd8f11695cd20905ad064fd63d7818a8 | SQL | Sp3nc3r123/test-Node-jS | /db/nodelogin_accounts.sql | UTF-8 | 2,414 | 2.90625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.25, for Win64 (x86_64)
--
-- Host: localhost Database: nodelogin
-- ------------------------------------------------------
-- Server version 8.0.25
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULT... | true |
346f6aa08e723ef0c68256a66e757e974bf80122 | SQL | poechethc86/LaboEquipe | /DB_SQL/requete clubsport et count.sql | UTF-8 | 200 | 3.515625 | 4 | [] | no_license | SELECT t_clubs.Nom_Club, Count(ti_membres_clubs.FK_Membres)
AS CompteDeFK_Membres FROM t_clubs INNER JOIN ti_membres_clubs
ON t_clubs.PK_Club = ti_membres_clubs.FK_Clubs GROUP BY t_clubs.Nom_Club | true |
4ce4f91edac9ae8211541b86d2829260818d7119 | SQL | Lairin-pdj/coding_test_practice_programmers | /고양이와 개는 몇 마리 있을까.sql | UTF-8 | 99 | 2.65625 | 3 | [] | no_license | SELECT A.ANIMAL_TYPE, COUNT(*)
FROM ANIMAL_INS A
GROUP BY A.ANIMAL_TYPE
ORDER BY A.ANIMAL_TYPE ASC
| true |
e531439b23693e943af8db167884633d5b5d11af | SQL | helenhan/leetcode | /src/com/helen/leetcode/SqlSolutions.sql | UTF-8 | 2,139 | 4.59375 | 5 | [] | no_license | /* Second Highest Salary
https://leetcode.com/problems/second-highest-salary/discuss/52957/Simple-query-which-handles-the-NULL-situation*/
select max(Salary) as SecondHighestSalary from Employee where Salary< (select max(Salary) from Employee)
/*The LIMIT clause can be used to constrain the number of rows returned by ... | true |
3db8b02183ec69e5b1272041cd519b710d56ccb9 | SQL | GersonBelteton/Semi1-32-Proyecto1 | /backend_Semi1/config/bdscript.sql | UTF-8 | 1,638 | 4.15625 | 4 | [] | no_license | create database Proyecto1Semi1;
use Proyecto1Semi1;
create table Usuario(
id_usuario integer auto_increment primary key,
nombre_usuario varchar(50),
correo varchar(50),
contrasena varchar(50),
foto varchar(200)
);
create table Archivo(
id_archivo integer auto_increment primary key,
nombre_archiv... | true |
1e03717061d59dcf2b5b02d8c76e75204f620203 | SQL | leskovsky1/FRI | /Bc/4.semester/zaklady databazovych systemov/zaloha_suborov_zo_serveru_asterix/zdbs/cv02/7-prednasajuci_#predmet.sql | UTF-8 | 234 | 3.453125 | 3 | [] | no_license | SELECT DISTINCT zap_predmety.prednasajuci, zap_predmety.cis_predm, ucitel.meno, predmet.nazov
FROM zap_predmety
JOIN ucitel
ON (zap_predmety.prednasajuci = ucitel.os_cislo)
JOIN predmet
ON (zap_predmety.cis_predm = predmet.cis_predm); | true |
8df30576751d64390fccabfd7a42438022af7461 | SQL | Nadeera3784/OT_System_MAS | /tables/emp_details.sql | UTF-8 | 7,013 | 2.8125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 09, 2019 at 10:17 AM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
ae8b902411aa32c943db97ede606124da7395fc8 | SQL | koolay/xlstest | /schema.sql | UTF-8 | 621 | 2.75 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `xlstest`;
USE xlstest;
CREATE TABLE IF NOT EXISTS `logs` (
`id` int(11) NOT NULL auto_increment,
`page_url` varchar(1024) NOT NULL,
`product_name` varchar(255) NOT NULL,
`appid` varchar(255) NOT NULL,
`proto` varchar(64) NOT NULL DEFAULT '',
`copyright` varchar... | true |
e6aec1fb03ed13b8dc3019b1b08f2d04691a1caf | SQL | iymlm35/spring-boot-doma2-sample | /sample-domain/src/main/resources/META-INF/com/sample/domain/dao/system/CodeDao/select.sql | UTF-8 | 231 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | SELECT
/*%expand*/*
FROM
code
WHERE
deleted_at IS NULL
/*%if criteria.id != null */
AND code_id = /* criteria.id */1
/*%end*/
/*%if criteria.codeKey != null */
AND code_key = /* criteria.codeKey */'01'
/*%end*/
LIMIT
1
| true |
45fa9de9038879b105b4bb26675580aca887c42e | SQL | amitrofanov82/ItStep2019 | /L78-cabyprojForStudents/src/main/resources/db/changelog/0.0.1/relations.sql | UTF-8 | 1,298 | 3.546875 | 4 | [] | no_license | CREATE TABLE user_shop_management_relation (
user_id bigint NOT NULL,
shop_id bigint NOT NULL,
PRIMARY KEY(user_id, shop_id),
FOREIGN KEY (user_id) REFERENCES users(id),
FOREIGN KEY (shop_id) REFERENCES shops(id)
);
CREATE TABLE user_user_follow_relation (
follower_id bigint NOT NULL,
follo... | true |
5afcb96400dc189da61041c7e7079d2377482a9c | SQL | AmandineYborra/eval | /Evaluation/Part 1/Question 12.sql | UTF-8 | 347 | 3.5625 | 4 | [] | no_license | -- ALTER TABLE culture ADD FOREIGN KEY (fkresponsable) REFERENCES employe(idemploye);
DELIMITER $$
create trigger poste_assigne BEFORE UPDATE ON culture FOR EACH ROW
BEGIN
UPDATE culture SET idculture = 112 OR idculture =232
WHERE culture.fkresponsable = employe.fkposte AND employe.fkposte = poste.idposte AND poste.n... | true |
8932f35b5febd93e04f218b8b0bd9e08d9348cad | SQL | vladandrei0/educator-mate | /prisma/migrations/20210125115301_almost_final/migration.sql | UTF-8 | 5,450 | 3.390625 | 3 | [] | no_license | -- CreateEnum
CREATE TYPE "Role" AS ENUM ('USER', 'ADMIN');
-- CreateTable
CREATE TABLE "Categorieontema" (
"temaId" INTEGER NOT NULL,
"categorieId" INTEGER NOT NULL,
PRIMARY KEY ("temaId","categorieId")
);
-- CreateTable
CREATE TABLE "CategorieTema" (
"id" SERIAL,
"nume" TEXT NOT NULL,
PRIMARY ... | true |
f677cdc653c257afe4f78fd274bf5ccb7021ce63 | SQL | AndreSoares94/AEBD_OracleDB | /Database/script.sql | ISO-8859-1 | 1,670 | 4.34375 | 4 | [] | no_license | /*** Criao TableSpaces ***/
CREATE TABLESPACE monitor_tables
DATAFILE 'monitor_tables_01.dbf'
SIZE 400M;
CREATE TEMPORARY TABLESPACE monitor_temp
TEMPFILE 'monitor_temp_01.dbf'
SIZE 200M AUTOEXTEND ON;
SELECT * FROM DBA_TABLESPACES;
/*** Criao User ***/
CREATE USER monitor IDENTIFIED BY monitor
... | true |
1a0a1b34d5473dfb0fa98bfa09b7c52b10069c54 | SQL | lannerxiii/CouchInn | /CouchInn/prueba (1).sql | UTF-8 | 15,090 | 2.921875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 11-07-2016 a las 03:24:16
-- Versión del servidor: 10.1.13-MariaDB
-- Versión de PHP: 7.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... | true |
4efdd323ca1d6f05c3805b3b2721e64b677c8701 | SQL | lthflk/earchive | /Database/digital_arsip.sql | UTF-8 | 21,244 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 21, 2018 at 04:52 PM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
6d2cbe3f3644b984962f6c12a0955ff2e770cec6 | SQL | Nakade-PlayInside/nakade-web | /module/League/SQL/saison.sql | UTF-8 | 1,529 | 3.1875 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 18. Feb 2013 um 15:26
-- Server Version: 5.5.29
-- PHP-Version: 5.3.10-1ubuntu3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... | true |
c5772e27ea061f6dcbd75472731efee111766a7c | SQL | hausofliufeng/flash_sale_system | /数据库/shop.sql | UTF-8 | 10,073 | 2.78125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.15.10
-- https://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 23, 2021 at 07:29 PM
-- Server version: 5.6.49-log
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
719ef8a0a5e4ff60c32865398c2fbc322f2cbbd3 | SQL | lih627/python-algorithm-templates | /LeetCodeSolutions/LeetCode_1082.sql | UTF-8 | 199 | 3.546875 | 4 | [
"MIT"
] | permissive | # Write your MySQL query statement below
select seller_id
from sales
group by seller_id
having sum(price) =
(select sum(price) as sellsum
from sales
group by seller_id
order by sellsum desc
limit 1); | true |
4eb366572e01594e60c7727e4f08e82b8926b110 | SQL | pithecuse527/udacity-IntroToProgramming | /back-endProject/newsdata.sql | UTF-8 | 5,990 | 3.375 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = fal... | true |
f837d2c85e6088e7d3cd5cf1ef29d0685ca068b6 | SQL | enrimont/Tarea1 | /Query.sql | UTF-8 | 261 | 3.3125 | 3 | [] | no_license | use db1;
select
libros.id, libros.nombre as Titulo, autores.nombre as Autor, editoriales.id, editoriales.Nombre as Editorial
from
libros,autores,editoriales
where
libros.id= 'fw_771-h' and
libros.id_autor = autores.id and
libros.id_editorial = editoriales.id; | true |
c6f797df7107f7264967ea19c6438bb2429c5bcb | SQL | lurahealth/aws_lambda_functions | /tables/dentist_table.sql | UTF-8 | 652 | 3.234375 | 3 | [] | no_license | -- creating a dentist data table
CREATE TABLE dentists(
dentist_id SERIAL PRIMARY KEY,
dentist_name TEXT NULL,
dentist_email TEXT NOT NULL
);
Table "public.dentists"
Column | Type | Collation | Nullable | Default
---------------+-------... | true |
4a38f2b6e0a6b03a5593df9cb5dfe226a947b9ab | SQL | grvgoel81/leetcode | /product-price-at-a-given-date.sql | UTF-8 | 532 | 4.59375 | 5 | [] | no_license | SELECT
t1.product_id,
COALESCE(t2.new_price, 10) AS price
FROM (
SELECT DISTINCT product_id
FROM Products
) t1
LEFT OUTER JOIN (
SELECT
t.product_id,
p.new_price
FROM (
SELECT
product_id,
MAX(change_date) AS last_change_date
FROM Products
... | true |
806f20d1284c501a5ad2b33704d54fa780e71285 | SQL | CuityMiko/vpds | /sql/vpds.sql | UTF-8 | 966 | 2.625 | 3 | [
"MIT"
] | permissive | /*
Navicat Premium Data Transfer
Source Server : fddcn.cn_3306
Source Server Type : MySQL
Source Server Version : 50556
Source Host : 101.236.23.161:3306
Source Schema : vpds
Target Server Type : MySQL
Target Server Version : 50556
File Encoding : 65001
Date: 08/07/2... | true |
f4171736c347b82df4dc7cd1002141a5d5b65c72 | SQL | GabrielNogueiraBR/Banco-de-Dados-I | /Aula 06 - SELECT (Cláusulas like, where, between, distinct, order by)/Aula 06 - SELECT (Cláusulas like, where, between, distinct, order by).sql | WINDOWS-1252 | 2,316 | 4.34375 | 4 | [
"MIT"
] | permissive | USE BD2020_S2
CREATE TABLE GAME_SERVER(
ID_GAME_SERVER INT NOT NULL IDENTITY,
IP VARCHAR(30),
TYPE VARCHAR(100),
CREATION_DATE DATETIME,
CONSTRAINT PK_IDGameServer PRIMARY KEY (ID_GAME_SERVER)
)
CREATE TABLE PLAYER(
ID_PLAYER INT NOT NULL IDENTITY,
NAME VARCHAR(200),
USER_NAME VARCHAR(200),
PASSWORD VARC... | true |
4422ec073b2c418badff9a62255326bcc2ef1602 | SQL | joyc/PLSQL | /concer.sql | UTF-8 | 1,337 | 3.171875 | 3 | [] | no_license | /*
*/
set serveroutput on
declare
--部门光标
cursor cdept is select deptno from dept;
pdeptno dept.deptno%type;
--部门中员工薪水
curcor cemp(dno number) is select sal from emp where deptno = dno;
psal emp.sal%type;
--每个段的员工数
count1 number;
count2 number;
count3 number;
--每个部门工资总和
... | true |
48018c7ed0009abb864320f2c7f58b6da43c79a3 | SQL | gunapaturi/Student-Activity-Management-System | /AllScripts/IndexoneventName.sql | UTF-8 | 133 | 2.796875 | 3 | [] | no_license |
use university;
create index events_title on eventstable(eventName);
show index from eventstable;
select eventName from eventstable; | true |
2ae5a2670b5d4a04547d9803abcae296d6f265e4 | SQL | ella-hong22/SQL-Developer | /변환함수.sql | UHC | 2,080 | 4.25 | 4 | [] | no_license | desc employee;
select * from employee;
select ename, salary from employee;
select ename, salary from employee
where salary < 1000
and salary < 2000
order by salary desc;
04 ȯ Լ
select hiredate, round(hiredate,'MONTH') as a, trunc(hiredate, 'MONTH') as b
from employee
order by a;
¥ ¥
select ename, sysda... | true |
835cf10fb8c10a5adc3feef44cd5ff7460bfdeb3 | SQL | danielecioffo/SmartSauna | /smart_sauna.sql | UTF-8 | 2,981 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Creato il: Ago 17, 2021 alle 18:23
-- Versione del server: 10.1.25-MariaDB
-- Versione PHP: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
64d4e992ed671932d9f504758c4b0f4532e419f8 | SQL | SmelcorS/MySQL-Basics | /6-Joins-Subqueries-and-Indices/employees_without_projects.sql | UTF-8 | 233 | 3.65625 | 4 | [] | no_license | SELECT `e`.`employee_id`, `e`.`first_name`
FROM `employees` AS `e`
LEFT JOIN `employees_projects` AS `e_p`
ON `e`.`employee_id` = `e_p`.`employee_id`
WHERE `e_p`.`project_id` IS NULL
ORDER BY `e`.`employee_id` DESC
LIMIT 3; | true |
624e5a8e885568423cba5c5d8a073010ce6ace88 | SQL | nabind/prism_test | /INORS/PrismPdfUtility/DB/Useful_Query.sql | UTF-8 | 741 | 3.296875 | 3 | [] | no_license | --Org subtest combinatio, if PDF is not generated for certain date
SELECT DISTINCT ORG_NODEID || '|' || SUBTESTID
FROM SUBTEST_SCORE_FACT SSF
WHERE TRUNC(SSF.DATETIMESTAMP) = '17-OCT-2016'
AND (STUDENT_BIO_ID, SUBTESTID) IN
(SELECT STUDENT_BIO_ID, SUBTESTID
FROM SUBTEST_SCORE_FACT SSF
... | true |
744f2b3f585a43be261f82e85d44a64f7e61d096 | SQL | janecms/oracleplsql-examples | /chap04_controlstructure/for_loop_hr_schema.sql | UTF-8 | 473 | 3.15625 | 3 | [] | no_license | -- This is source file
SET serveroutput ON;
DECLARE
min_id employees.employee_id%TYPE;
max_id employees.employee_id%TYPE;
mail employees.email%TYPE;
BEGIN
SELECT MIN(employee_id) INTO min_id FROM employees;
SELECT MAX(employee_id) INTO max_id FROM employees;
FOR id IN min_id..max_id
LOOP
SELECT EMAI... | true |
cc38b98025c8f964e1b20ac999d6593410977190 | SQL | gingko/client | /cypress/fixtures/deleteTestData.sql | UTF-8 | 312 | 2.71875 | 3 | [
"MIT"
] | permissive | PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
DELETE FROM tree_snapshots WHERE treeId IN (SELECT trees.id FROM trees WHERE owner='cypress@testing.com');
DELETE FROM cards WHERE treeId IN (SELECT trees.id FROM trees WHERE owner='cypress@testing.com');
DELETE FROM trees WHERE owner='cypress@testing.com';
DELETE FROM users ... | true |
e802e9bd8eb9f9707f1005159a22e2b1488b1d93 | SQL | armourjami/armourtake | /backup_mdb.sql | UTF-8 | 17,480 | 3.21875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: mdb
-- ------------------------------------------------------
-- Server version 5.5.46-0ubuntu0.14.04.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARA... | true |
52db625829684b1828c4fb63f5f892ebbcb600de | SQL | shanirajkali/newsfeed | /database/newsgroup_merchantprofile.sql | UTF-8 | 3,299 | 2.984375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.12, for Win32 (AMD64)
--
-- Host: localhost Database: newsgroup
-- ------------------------------------------------------
-- Server version 5.7.16-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... | true |
abcb081bccb49543a73daf6db18a05f43f6353e9 | SQL | adrianursu/car-rent-java | /SGBD/SGBD Project/SGBD SCRIPTS/triggers/trigger_generateDescription_reviews.sql | UTF-8 | 882 | 3.21875 | 3 | [] | no_license | /*Daca descrierea nu se introduce la review, aceasta se genereaza automat in functie de steaua acordata*/
DELIMITER $$
CREATE
TRIGGER trigger_stars BEFORE INSERT
ON review
FOR EACH ROW BEGIN
IF NEW.stars = "1" AND NEW.description IS NULL THEN SET NEW.description = "Bad service!";
ELSEIF NEW.stars = "2... | true |
88ad95e9c352832479845d8e7916985c47d3503a | SQL | dimasmaspur/ferish | /tugasakhir.sql | UTF-8 | 2,184 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # SQL-Front 5.1 (Build 4.16)
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
/*!40101 SET SQL_MODE='NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
/*!40103 SET SQL_NOTES='ON' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=0 */;
/*!40... | true |
5ae28fa68b78c37654f5436242c5827874382880 | SQL | ireapps/census | /tools/sql/ire_export/ire_PCT20C.sql | UTF-8 | 2,141 | 2.765625 | 3 | [
"MIT"
] | permissive | -- PCT20C. GROUP QUARTERS POPULATION BY GROUP QUARTERS TYPE (AMERICAN INDIAN AND ALASKA NATIVE ALONE)
-- designed to work with the IRE Census bulk data exports
-- see http://census.ire.org/data/bulkdata.html
CREATE TABLE ire_pct20c (
geoid VARCHAR(11) NOT NULL,
sumlev VARCHAR(3) NOT NULL,
state VARCHAR(2) NOT NULL... | true |
e9d372629410ecd920fc3e1a79f61900e1ea534c | SQL | giullliana/turma18G | /MySql/db_farmacia_do_bem-3.sql | UTF-8 | 1,547 | 3.703125 | 4 | [] | no_license | create database db_farmacia_do_bem;
use db_farmacia_do_bem;
create table tb_categorias(
id bigint auto_increment,
descricao varchar(255) not null,
ativo boolean not null,
primary key(id)
);
create table tb_produto(
id bigint auto_increment,
xarope varchar(255) not null,
comprimido varchar(255) not null,
solução varchar... | true |
db3d8d3c163c87651cd14dd24d0424092e2e5f9d | SQL | chepiga1995/db_project | /scripts/view_posts.sql | UTF-8 | 340 | 4.125 | 4 | [] | no_license | SELECT p.post_id, p.name, p.description, p.min_salary, p.max_salary, s.amount, COUNT(st.stuff_id) AS work
FROM posts p
INNER JOIN structures s ON s.post_id=p.post_id
LEFT JOIN stuff st ON st.post_id=p.post_id
WHERE s.date_out IS NULL AND st.data_out IS NULL
GROUP BY p.post_id, p.name, p.description, p.min_salary, p.m... | true |
17583261ea246229da85804188581bc05ec17aac | SQL | renancs93/loja_games_git | /Modelo_UML/SQL_loja_games_banco.sql | UTF-8 | 2,108 | 3.203125 | 3 | [] | no_license | create database games;
use games;
create table pessoa(
cpf_pessoa varchar(14) not null,
nome varchar(50) not null,
rg varchar(15),
data_nascimento date,
telefone varchar(11),
sexo char,
estado_civil varchar(10),
email varchar(30),
rua varchar(40),
numero integer,
bairro varchar(30),
estado varchar(2),
cep varchar(10... | true |
22eacc34d1a8b017125201697d7a514b874dd78c | SQL | lll-666/emcs | /emcs-web/dbScript/tables/CM_ACCT_TRAN_SEQ_账务流水表.sql | UTF-8 | 3,312 | 3.0625 | 3 | [] | no_license | drop table if exists `cm_acct_tran_seq`;
create table `cm_acct_tran_seq` (
`tran_seq_no` varchar(32) not null comment '银行账务流水号',
`pub_seq_no` varchar(32) comment '公共流水号',
`tran_date` date comment '交易日期',
`tran_time` varchar(10) comment '交易时间',
`curreny` ... | true |
17b693db1b0bde15a77cb596cdc3db1e27cf2d3f | SQL | vindulasenanayake/School-Management-System | /school_system.sql | UTF-8 | 217,319 | 2.734375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 20, 2018 at 07:25 PM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
db9a3557bcdf48a848b09c6b88c2435a5f5a50b4 | SQL | abdaljaleel/Kinoreservierungssystem | /Quellcode/Backend/Java/src/test/resources/schema.sql | UTF-8 | 12,950 | 3.546875 | 4 | [] | no_license |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Exportiere Struktur v... | true |
a55a9181c6ab7756a85724ee2e64136a8c638c03 | SQL | damir-bubanovic/MySQL-CodeBook | /METADATA - listing or checking existence of database or tables.sql | UTF-8 | 1,268 | 4.1875 | 4 | [] | no_license | /*
!!METADATA - LISTING OR CHECKING EXISTENCE OF DATABASE OR TABLES!!
> You want to list the databases hosted by the MySQL server or the tables in a database.
> Or you want to check whether a particular database or table exists
> Use INFORMATION_SCHEMA to get this information.
>> The SCHEMATA table contain... | true |
ddca720e3f41222ecc123198a102dc79f01aaf60 | SQL | Ani-Gil/Database | /Study/오라클로 배우는 데이터베이스 입문 (서적)/실습 6-34_월과 요일을 다양한 형식으로 출력하기.sql | UTF-8 | 243 | 2.546875 | 3 | [] | no_license | SELECT SYSDATE,
TO_CHAR(SYSDATE, 'MM') AS MM,
TO_CHAR(SYSDATE, 'MON') AS MON,
TO_CHAR(SYSDATE, 'MONTH') AS MONTH,
TO_CHAR(SYSDATE, 'DD') AS DD,
TO_CHAR(SYSDATE, 'DY') AS DY,
TO_CHAR(SYSDATE, 'DAY') AS DAY
FROM DUAL; | true |
5253ae2512dd431ddd88ddb304f720684eb4dd44 | SQL | ZVlad1980/adm_scripts | /sql/pipelined/show_departments_pipe.sql | UTF-8 | 492 | 3.25 | 3 | [] | no_license | select case
when value(d) is of type (department_detail_typ) then
'DEPT'
else 'EMP'
end row_type,
treat(value(d) as department_detail_typ) obj_dept,
treat(value(d) as employee_detail_typ) obj_empl
from table(pipelined_api.departments_pipe(cursor(
select * fro... | true |
79b8bfacf315f1f6d711997dd5dc13cf4cd227d3 | SQL | CrystallizedSnowflakes/MySQL-SoftUni | /MySQL-Exam-20-Jun-2021/01-Table-Design-by-DDL-Diagram.sql | UTF-8 | 1,757 | 4.1875 | 4 | [] | no_license | DROP DATABASE IF EXISTS stc;
CREATE DATABASE stc;
USE stc;
CREATE TABLE categories(
id INT PRIMARY KEY AUTO_INCREMENT,
`name` VARCHAR(10) NOT NULL
);
CREATE TABLE cars(
id INT PRIMARY KEY AUTO_INCREMENT,
make VARCHAR(20) NOT NULL,
model VARCHAR(20),
`year` INT NOT NULL DEFAULT 0,
mileage INT DEF... | true |
55265bcc6239c9093d671374e2c99baed495e0e4 | SQL | kliopa10/bro | /upgrade/db/3.0.1.sql | UTF-8 | 224 | 2.578125 | 3 | [] | no_license | ALTER TABLE users
ADD language varchar(255) DEFAULT NULL;
UPDATE `modules` SET `name` = 'Featured Actors' WHERE `modules`.`id` = 2;
ALTER TABLE `modules`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.