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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
d6da4f03c5b37026af9cfe9f2bb22833bf311a8d | SQL | XuZzc/Nike | /SQLQuery1.sql | GB18030 | 7,441 | 3.59375 | 4 | [] | no_license | select * from Salesman
select Role,[Salesman-Name] from Salesman where Mobile ='13812345555'
select * from Type
select * from Goods
select * from Sales
select * from SalesDetail
delete Sales
select * from Sales,SalesDetail ,Goods,Salesman where Sales .SalesID =SalesDetail .SalesID and SalesDetail .GoodsID =G... | true |
3bb3fcaa193d363027695aa46f6b539205f91945 | SQL | rupali-soni/ss-fb-app | /db/fb-app_2017-07-09.sql | UTF-8 | 2,050 | 3.03125 | 3 | [] | no_license | # ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.5.5-10.1.21-MariaDB)
# Database: fb-app
# Generation Time: 2017-07-08 20:08:43 +0000
# *********************************... | true |
2717aefd3170c468d51a1fbe16b3161fe468a273 | SQL | chojh96/TeamProject | /sampledb_menu.sql | UTF-8 | 3,480 | 2.890625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
--
-- Host: localhost Database: sampledb
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... | true |
f73cc230bf0648718ad7cee5b4e23c798397c1e4 | SQL | Kahiko/Growthware | /SQLServer/2005/GrowthWareDB/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/ZFP_GET_NVP_RLS.proc.sql | UTF-8 | 616 | 3.734375 | 4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | CREATE PROCEDURE [ZFP_GET_NVP_RLS]
@P_NVP_SEQ_ID int,
@P_SE_SEQ_ID INT,
@P_ErrorCode int OUTPUT
AS
-- SELECT one or more existing rows from the table.
SELECT
ZFC_SECURITY_RLS.[NAME] AS ROLES
FROM
ZFC_SECURITY_NVP_RLS,
ZFC_SECURITY_RLS_SE,
ZFC_SECURITY_RLS
WHERE
ZFC_SECURITY_NVP_RLS.NVP_SEQ_ID = @P_NVP_SEQ_ID
... | true |
e5363fe021e55bf32bb222cc437d0aae562b0432 | SQL | not-much-io/remind-me | /src/clj/remind_me/queries/queries.sql | UTF-8 | 304 | 3.125 | 3 | [] | no_license | -- :name create-reminders-table :!
CREATE TABLE reminders (
id INTEGER PRIMARY KEY,
name TEXT
);
-- :name insert-reminder :! :n
INSERT INTO reminders (name)
VALUES (:name);
-- :name delete-reminder-with-id :! :n
DELETE FROM reminders WHERE id = :id;
-- :name get-reminders
SELECT * FROM reminders; | true |
7e3c55f6914b4dd5a6a0726bf1d1a7c705e24316 | SQL | harksodje/mysql_tutorial | /fetching and query.sql | UTF-8 | 461 | 3.4375 | 3 | [] | no_license | -- fetching and query
-- to select all columns from data base
show databases;
use students;
select * from student_info;
-- to select particular column
select name from student_info;
-- to select with orders
select name from student_info order by student_id desc;
-- to select using limit
select student_info.name, stude... | true |
69af1891cd19836f4d4e1bd0a19ba9d993ff7ef3 | SQL | wadewswc/wade-postgresql | /Scripts/DatabaseTables/D_THERMOELECTRIC.sql | UTF-8 | 3,397 | 3.765625 | 4 | [
"LicenseRef-scancode-public-domain-disclaimer"
] | permissive | -- Table: "WADE"."D_THERMOELECTRIC"
-- DROP TABLE "WADE"."D_THERMOELECTRIC";
CREATE TABLE "WADE"."D_THERMOELECTRIC"
(
"ORGANIZATION_ID" character varying(10) NOT NULL, -- A unique identifier assigned to the organization.
"REPORT_ID" character varying(35) NOT NULL, -- A unique identifier assigned to the report by... | true |
39e5edb91921bfe3d7b0700f8f44dfe90af2938a | SQL | HristoShabanakov/Databases-Basics-MS-SQL-Server-September-2019 | /MS SQL Server - September 2019/05.Data Aggregation - Exercise/19.Salary Challenge.sql | UTF-8 | 216 | 3.75 | 4 | [] | no_license | SELECT TOP (10) FirstName, LastName, DepartmentID
FROM Employees AS e1
WHERE Salary > (
SELECT AVG(Salary) AS [AvgSalary]
FROM Employees AS e2
WHERE e2.DepartmentID = e1.DepartmentID
GROUP BY DepartmentID
) | true |
18be02d33f680512ef4a25a4b00cccf321cc4066 | SQL | theochihaia/TradingPlatform | /TradingResearchAPI/TradingResearchAPI/Database/SQL/Tables.sql | UTF-8 | 1,883 | 3.84375 | 4 | [] | no_license | -- Tables
USE TradingPlatform;
/*
Stock
*/
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = N'Stock')
CREATE TABLE Stock(
StockID INT PRIMARY KEY IDENTITY(1,1)
,Symbol VARCHAR(10)
,Name VARCHAR(50)
,DateInserted DATETIME
-- ,IsActive BIT
)
/*
Trading Session
*/
IF NOT EXISTS (SELECT... | true |
f8a431164889b57b1d3c553fec07b3003e4dda6d | SQL | SabraTech/OrderProcessingSystem | /Schema/project schema.sql | UTF-8 | 4,875 | 4.25 | 4 | [] | no_license |
drop schema `order_System`;
create schema `order_System`;
use `order_System`;
create table `order_System`.`Book`(
`book_ISBN` int primary key not null,
`title` varchar(45),
`publisher` varchar(45),
`publication_year` varchar(10),
`price` double,
`category` enum('Science', 'Art', 'Religion', 'Hi... | true |
ac7fffffc5f7a8567a628a9ba2719094c431aa28 | SQL | Anna-Gordon/BootcampX | /4_queries/6_cohort_with_longest_assistances.sql | UTF-8 | 325 | 3.890625 | 4 | [] | no_license | SELECT cohorts.name AS name,
AVG(completed_at - started_at) AS average_assistance_time
FROM cohorts
JOIN students ON cohorts.id = cohort_id
JOIN assistance_requests ON students.id = student_id
GROUP BY cohorts.name
ORDER BY average_assistance_time DESC
LIMIT... | true |
dd28673a7af1ed5cd2ec46afdf82ec1c6b11c8a0 | SQL | boatfu/fish-goose | /back-end/init/sqls/code.sql | UTF-8 | 293 | 2.546875 | 3 | [
"MIT"
] | permissive | DROP TABLE IF EXISTS `code`;
CREATE TABLE `code` (
`id` int(15) NOT NULL AUTO_INCREMENT,
`code` varchar(50) DEFAULT NULL,
`status` int(4) DEFAULT NULL,
`update_time` int(15) DEFAULT NULL,
`create_time` int(15) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | true |
c4e3d1e15d680fce8d1f26558494b6b807be223c | SQL | raularias86/TSQL-Normal | /Querys LZ/Catálogo Sectorial - Mensual/Creación Tabla en ZDR - Catálogo Sectorial.sql | UTF-8 | 2,237 | 3.59375 | 4 | [] | no_license |
/****************
PROCESO A SEGUIR UNA VEZ, LA DE CREACIÓN Y DEFINICIÓN EN ÁREA DE RESULTADOS PARA TABLA DE CATÁLOGO SECTORIAL,
LUEGO DE ESTO SOLO APLICA EL PASO 4, PARA IR INSERTANDO LOS NUEVOS VALORES MENSUALES DEL CATÁLOGO
****************/
---AL TENERLO CARGADO EL CATÁLOGO SECTORIAL HACER EL PROCESO PARA CARGARL... | true |
db8124e5313f851a910ab7951778dd3722fa0a68 | SQL | sps-lco-2020-21/database-integration-ii-Erick-Jian | /SQL/Q9.sql | UTF-8 | 341 | 3.453125 | 3 | [
"MIT"
] | permissive | SELECT 'before 1980'[time period], avg(mean) from {
SELECT m.year, avg(r.rating) mean
from Movies m
JOIN Ratings r
on m.id = r.mid
where m.year < 1980
group by
m.id, m.year
} UNION
-- create a temp table: running a query TABLE on in another
-- LOGICAL union: two query tables, one after another
-- find out the ... | true |
adfbf375d611359cf68bb81db4a641d2ebb2e26b | SQL | dsteven12/mysql_bootcamp | /agg_functions/group_code.sql | UTF-8 | 429 | 3.734375 | 4 | [] | no_license | SELECT CONCAT('In ', released_year, ' ', COUNT(*), ' book(s) released.') AS '# of Books Released Per Year' FROM books
GROUP BY released_year;
-- SELECT author_lname, COUNT(*) FROM books
-- GROUP BY author_lname;
-- SELECT CONCAT(author_fname, ' ', author_lname), COUNT(*) AS 'Author Name' FROM books
-- GROUP BY autho... | true |
e31e7567882fc42a078ba5e97f7ff1dffe44da60 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day12/select1649.sql | UTF-8 | 267 | 3.09375 | 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='Thermometer' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['4202','3082','1407','5011','3058','4221','4061','4091','5214','2048'])
| true |
26f6fe6895005f1fb6ad2bda2dd5d5e033d94082 | SQL | dilanindrajith/CBMS | /CBMS/WebContent/META-INF/script.sql | UTF-8 | 4,759 | 3.3125 | 3 | [] | no_license | CREATE DATABASE "CBMS_V1.0"
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default
LC_COLLATE = 'English_United States.1252'
LC_CTYPE = 'English_United States.1252'
CONNECTION LIMIT = -1;
CREATE TABLE product_catalog
(
prd_catlog_id integer NOT NULL... | true |
19036d8c7f32efbe76c284dcad2e17cc7aeb76b7 | SQL | jjrich13/weekend-5-movie-collection | /movie_collection.sql | UTF-8 | 1,204 | 3.109375 | 3 | [] | no_license | CREATE DATABASE "movie_collection";
CREATE TABLE movies (
id SERIAL PRIMARY KEY,
title character varying(200) NOT NULL,
genre_id integer NOT NULL REFERENCES genres(id) ON DELETE CASCADE,
director character varying(50) NOT NULL,
released integer NOT NULL,
synopsis text,
revenue integer,
... | true |
655a47ee5229e693946ebcf3923095a6b4736c41 | SQL | pedro911/generic-dwh-app | /generic-dwh-web/src/main/resources/static/resources/queries/snowflake_queries.sql | UTF-8 | 10,748 | 3.78125 | 4 | [
"MIT"
] | permissive | use tpch_snow_1gb;
set @sf := 1;
#for SF1:
set @quantity_limit := 199;
set @max_customer := "Customer#000142346";
#for SF10:
#set @quantity_limit := 499;
#set @max_customer := "Customer#001371611";
select '#q1.1';
SET @start_time := sysdate(2);
select r_name,d_year_number, sum(revenue), sum(product_cost), sum(prof... | true |
c5b382bef84df0c82a122a3046c980ead2447ad0 | SQL | jazz-community/rtc-git-connector-service | /reporting/sql_db2_derby/tables/create_commit_table.sql | UTF-8 | 1,944 | 3.4375 | 3 | [
"MIT"
] | permissive | CREATE TABLE RIODS.GIT_COMMIT (
COMMENT VARCHAR(1024),
-- 2083 is the maximum length of urls supported by IE, and general
-- consensus among developers is that this should be used as a maximum
-- length of general urls
URL VARCHAR(2083) NOT NULL,
COMMITER_EMAIL VARCHAR(512),
COMMITER_NAME VA... | true |
8f2a13851caefba1d2912f6729114d659748c490 | SQL | ctissera/MHP | /f2102 (1).sql | UTF-8 | 1,490,067 | 2.6875 | 3 | [] | no_license | set define off
set verify off
set feedback off
WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
begin wwv_flow.g_import_in_progress := true; end;
/
--application/set_environment
prompt APPLICATION 2102 - Compras - Portal Proveedores
--
-- Application Export:
-- Application: 2102
-- Name: ... | true |
b8d278be10fcf1bf6df69d22787f859dd45c42c1 | SQL | vinaybagale/integration-studio-examples | /streaming-integration/transform-mysql-cdc/resources/data.sql | UTF-8 | 1,023 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | CREATE SCHEMA ETL;
USE ETL;
CREATE TABLE ORDERS
(
OrderID varchar(45) NOT NULL,
RetailerID varchar(45) DEFAULT NULL,
ProductIDs varchar(45) DEFAULT NULL
);
CREATE TABLE RETAILERS
(
RetailerID varchar(45) NOT NULL,
Retailer varchar(45) DEFAULT NULL
);
CREATE TABLE PRODUCTS
(
ProductID ... | true |
e33f7fad7bee63836f156e46c5711396ffdcc42d | SQL | polavarapup2/CTRP_4x_PA | /pa/dbscripts/db-upgrade/postgresql/3.10/PO-6291.sql | UTF-8 | 29,419 | 3 | 3 | [] | no_license | --PO-6291 :: System-generated email messages: missing space after (trial) TITLE
update pa_properties set value =
'<hr>
<p><b>Title: </b>${trialTitle}</p>
<table border="0">
<tr>
<td><b>Lead Organization Trial ID:</b></td>
<td>${leadOrgTrialIdentifier}</td>
</tr>
<tr>
<td><b>Lead Organization:</b></td>
<td>${leadOrgNam... | true |
f12c1a8a6892ac839a6ff95b7e524f64f666fcc7 | SQL | sakanksha19/Basic-Banking-System | /sparks-bank.sql | UTF-8 | 1,627 | 3.546875 | 4 | [] | no_license | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
CREATE TABLE `accountdetails` (
`sno` int(11) NOT NULL,
`accNo` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`email` varchar(100) NOT NULL,
`balance` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `a... | true |
e8703cd2eaef09676daeb7a5343d10c6e51da050 | SQL | alerario/ProjetoTEC2016 | /script/database/fill_tables.sql | UTF-8 | 4,870 | 3.171875 | 3 | [] | no_license | -- script para popular o banco.
-- Pode ser utilizado nos testes ou novos scrips para populacao poderao ser criados
-- Caso não tenha crud, um conjunto basico de registros deve ser adicionado a tabela. Utilize este script para isso
-- TABELA TESTE
INSERT INTO public.teste(codigo, nome) VALUES (1, 'Alexandre... | true |
b4df87236598c3e734d7bbc8157d5193ce96208b | SQL | erichilarysmithsr/givinggraph | /db/queries/from_nonprofits_ids_to_shared_followers.sql | UTF-8 | 352 | 3.546875 | 4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | SELECT weight as shared_followers
FROM giving.nonprofit_twitter_edges as edges, giving.nonprofits as non1, giving.nonprofits as non2
WHERE non1.nonprofits_id = XXXXX and non2.nonprofits_id = XXXXX and
(edges.source = non1.twitter_name and edges.target = non2.twitter_name or
edges.source = non2.twitter_name and edges... | true |
7b7884f60fb00f2bb462e0b7896778bda3845e28 | SQL | DionelShiftHA/ShiftHA | /Consulta/19_00.SQL | UTF-8 | 1,930 | 3.546875 | 4 | [] | no_license | --La consulta trae resultados de Microbiologia. Se separa el resultado en tipo(Positivo,Negativo,Interno,Parcial)
--Creacion 14102020 SHIFTHA
SELECT
acao.CbiId->OsRecipienteProcedimentoId->OsProcedimento->Os->data FechaOS,
acao.CbiId->OsRecipienteProcedimentoId->OsProcedimento->Os->CodigoOs OS,
dado.ArqOrdem... | true |
f4448b87d3127f826421077cb5139c320ed9f3a1 | SQL | soumiya98/Pet-adoption-management-system | /Database_pet/pet_1_address.sql | UTF-8 | 3,201 | 2.9375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64)
--
-- Host: localhost Database: pet_1
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... | true |
06e7e49c31b157642eb308839b20dee1a987186e | SQL | cosminDCG/EasyShop-BE | /src/main/resources/db/migration/V2019.06.02.23.49.00__createTableBill.sql | UTF-8 | 232 | 2.734375 | 3 | [] | no_license | create table if not exists bill(
bill_id int auto_increment,
shop varchar(50) not null,
bill_value decimal(10,2) not null,
payed int not null,
payed_by varchar(100),
emitted_date date not null,
pay_date date,
primary key(bill_id)
); | true |
28561272cb0c572e9837cc82f4a226bf60de016f | SQL | ytaustin/Classroom_System_Design | /database/addCourseRefresh.sql | UTF-8 | 627 | 3.3125 | 3 | [] | no_license | DROP TABLE IF EXISTS `addcourse`;
CREATE TABLE addcourse AS
(SELECT semcourse.id AS id,
semcourse.semester_id AS semester_id,
course.cname AS cname,
course.detail AS cdetail,
teacher.fname AS tfname,
teacher.lname AS tlname,
semcourse.room AS room,
... | true |
fb0281b15ad8d19bc8c06dc81306b1b4802a9edb | SQL | rffdlh/semester1 | /login/data_diri/data_diri.sql | UTF-8 | 1,513 | 2.75 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 29, 2019 at 01:53 PM
-- Server version: 10.1.40-MariaDB-0ubuntu0.18.04.1
-- PHP Version: 7.2.20-1+ubuntu18.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSAC... | true |
ec0661b6c8c93a071e7994834e4dda06391dd06c | SQL | marceloSantosC/anotacoes | /6 - Banco de dados/Revisão 4/23 - FUNCÕES DE AGREGAÇÃO.sql | UTF-8 | 605 | 3.640625 | 4 | [] | no_license | # MAX Retorna o maior valor
SELECT MAX(ALL PRECO) AS 'MAX_PRECO' FROM PRODUTO;
# MIN Retorna o menor valor
SELECT MIN(DISTINCT PRECO) AS 'MIN_PRECO' FROM PRODUTO WHERE PRECO > 1000;
# AVG Retorna a média aritmética de um campo ou dado
SELECT AVG(PRECO) AS 'PRECO_MEDIO' FROM PRODUTO;
# SUM soma os valores passados
SE... | true |
4209c26b769b807e54702822216dadb3893bf8a0 | SQL | AVeryHandsomePerson/bju | /com.cn.bju.bigdata.offline.spark/createTable/zipper.sql | UTF-8 | 27,897 | 3.3125 | 3 | [] | no_license | --动态分区 在spark-sql中执行
set hive.exec.dynamici.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;
-----暂时去除
create external table dwd.fact_item
(
item_id bigint comment '商品id',
brand_id bigint comment '品牌',
cid bigint comment '类目ID',
seller... | true |
093c7fe13a1bf4681f162efcf77e7c76ce40ec2b | SQL | EffinMaggie/phylactery | /src/party.sql | UTF-8 | 1,946 | 4.03125 | 4 | [
"MIT"
] | permissive | create table party
(
id integer not null primary key,
karma integer not null default 300,
karmavariance integer not null default 100,
sentient integer not null default 0,
members integer not null default (4 + (random() % 3))
);
create table pcharacter
(
paid integer not null,
cid integer no... | true |
4034efe465b43b330880350611a67de4e7d8bce5 | SQL | fabiociconi/Oracle | /Oracle/Chapter5-Procedures.sql | UTF-8 | 5,220 | 3.65625 | 4 | [] | no_license | --Procedures--
/*CREATE[OR REPLACE]PROCEDURE
procedure_name
[(parameter1_name[mode] data type,
parameter2_name[mode] data type,
...)]
IS|AS
declaration section
BEGIN
executable section
EXCEPTION
exception handlers
END;*/
CREATE OR REPLACE PROCEDURE ship_cost_sp
(p_qty in number, p_ship out n... | true |
bf0cab71d72e5dd11c6e05dc6cee52198d557c5d | SQL | SteelsenS/ATK_Tools | /databaseTools/proc_Get_Top_Level_Parent.sql | UTF-8 | 722 | 3.375 | 3 | [
"Unlicense"
] | permissive | DELIMITER $$
DROP FUNCTION IF EXISTS `yale_dev`.`getTopComponent` $$
CREATE FUNCTION `yale_dev`.`getTopComponent` (GivenID INT) RETURNS VARCHAR(1024)
DETERMINISTIC
BEGIN
DECLARE rv INT;
DECLARE ch INT;
SET rv = 0; /*There is no component 0 so this will be returned if first hit is top level*/
SET ch = GivenI... | true |
0500f0d4ecd5866d9631865e10725935df917cf8 | SQL | sqlfluff/sqlfluff | /test/fixtures/dialects/oracle/within_group.sql | UTF-8 | 984 | 3.515625 | 4 | [
"MIT"
] | permissive | --https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/LISTAGG.html#GUID-B6E50D8E-F467-425B-9436-F7F8BF38D466
SELECT LISTAGG(last_name, '; ')
WITHIN GROUP (ORDER BY hire_date, last_name) "Emp_list",
MIN(hire_date) "Earliest"
FROM employees
WHERE department_id = 30;
SELECT department... | true |
5e3108a72d9e9a9130de624792d3c11b3ee0e593 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day19/select0543.sql | UTF-8 | 177 | 2.609375 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-18T05:43:00Z' AND timestamp<'2017-11-19T05:43:00Z' AND temperature>=1 AND temperature<=56
| true |
0540cb02314851030becda6a5551868606f2c6b5 | SQL | dabio/php_cms | /db/sql.sql | UTF-8 | 1,619 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.7.0-pl2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 07. Januar 2006 um 18:01
-- Server Version: 4.1.14
-- PHP-Version: 5.0.4
--
-- Datenbank: `monoseat_de`
--
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabel... | true |
711ef7dcd0c6a6f140e510f0e6c913edfd4c2f35 | SQL | barcvilla/Transact-Sql | /ch04/9. Manth functions.sql | UTF-8 | 1,090 | 3.515625 | 4 | [] | no_license | /* FUNCIONES MATEMATICAS */
/*
* POW: retorna la potencia de un numero
*/
select power(10, 1) as [ten to the first],
power(10, 2) as [then to the second],
power(10, 3) as [ten to the third];
/*
* SQUARE: Retorna la raiz cuadrada.
*/
select square(10) as [square of 10],
sqrt(10) as [square root of 10],
... | true |
d8907abf6678c3e6f030ea71a69e74fd4788e2d1 | SQL | jacobdiaz/UIC-CS | /CS341/mySQL/ProjectSubmission/Proj2_09.sql | UTF-8 | 662 | 3.859375 | 4 | [] | no_license | -- 9. What is the Percentage drop for the Blue Line as a whole?
-- Compute this by taking the average of the columns from the previous table.
-- Again, round PreCOVIDAvg, PostCOVIDAvg, and Decrease to the nearest whole number,
-- and PercentDrop to the nearest hundredth place.
SELECT
ROUND(AVG(ROUND(pre.Pre... | true |
c964e75d05a90961fc20e81ceed20043f8589101 | SQL | beavis28/EventJoiner | /client/mobile/setupsql/accesstoken.sql | UTF-8 | 701 | 3.484375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `user_access_token` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '',
`user_id` BIGINT(20) UNSIGNED NULL COMMENT '',
`access_token` VARCHAR(255) NOT NULL COMMENT '',
`device` TEXT NOT NULL COMMENT '',
`created` DATETIME NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`upda... | true |
dc87615f19e98e32a07e36dac2fd289c39d83a16 | SQL | danbarra33/Desarrollo_Sistema | /database/valesdesarrollo04112020.sql | UTF-8 | 682 | 3.25 | 3 | [] | no_license | # Renombrando la tabla sucursales
rename table Sucursales to sucursales;
#Borrando la clave foranea para poder renombrar el cambo de id_sucursal
ALTER TABLE users DROP FOREIGN KEY cliente_a_sucursal;
#Renombrando los nombres de las columnas
alter table sucursales CHANGE ID_Sucursal id_sucursal int auto_increment;
al... | true |
32daaf942c4a948178c14fddc974fea840ceff81 | SQL | zectendou/sqlperformance | /sqlperformance/lock.sql | UTF-8 | 612 | 3.171875 | 3 | [] | no_license | SELECT pid, query_start, substr(query, 0, 50)
FROM pg_stat_activity WHERE state='active' ORDER BY query_start;
---とりあえずこれで様子見---
SELECT pg_cancel_backend(pid);
---これでキャンセルしてみる---
SELECT pg_terminate_backend(pid);
---これで滅ぼす---
SELECT l.pid,l.granted,d.datname,l.locktype,relation,relation::regclass,transactionid,... | true |
87c8dd2232e77da3706c0e83fbaf685434b58f43 | SQL | anuragphadnis/dbmspro | /dbmspro_latest.sql | UTF-8 | 11,302 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 26, 2018 at 05:51 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
56edd91ff70beeed5354921df0e3969125092b2f | SQL | RyanIrfandi/MapODP | /v1/tbl_lokasi.sql | UTF-8 | 1,803 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 23, 2018 at 12:39 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
901c24e7e6285fa764b9f0e6a4f1fa36618721d9 | SQL | smitpatil02/Data-Warehousing-and-Business-Intelligence | /Week12/HW9b_Smit_Patil.sql | UTF-8 | 19,273 | 2.796875 | 3 | [] | no_license | USE DWBI;
-- Creating Staging table to load the COVID-19 Nursing Home Dataset
CREATE TABLE Stg_COVID19_NHD
(
Week_Ending VARCHAR(8000),
Federal_Provider_Number VARCHAR(8000),
Provider_Name ... | true |
acddfc137f2096d143e77f7af3bde4c93b4d0ab6 | SQL | agdiaz/GestionDeDatos | /TP1C2013 K3051 SI_NO_APROBAMOS_HAY_TABLA 16 ZIP123/data/Finales/01 - SELECT/60.sp_insertar_compra.sql | UTF-8 | 306 | 2.71875 | 3 | [] | no_license | CREATE PROCEDURE SI_NO_APROBAMOS_HAY_TABLA.sp_insert_compra
(
@p_id_compra int output,
@p_id_usuario int,
@p_fecha_compra datetime
)
AS
BEGIN
INSERT INTO SI_NO_APROBAMOS_HAY_TABLA.Compra
(id_usuario, fecha_compra)
VALUES
(@p_id_usuario, @p_fecha_compra)
SET @p_id_compra = SCOPE_IDENTITY()
END
| true |
bb8c6aad3b2a76b7291a8c10d8c74295c4d3b237 | SQL | YingX110/Milestone-5 | /Milestone5c.sql | UTF-8 | 3,411 | 2.875 | 3 | [] | no_license | INSERT INTO Company.SITE(Mgr_ssn, SiteNumber)
VALUES
('213456789', '20'),
('777777777', '12');
INSERT INTO Company.DEPARTMENT(Dname, Dnumber)
VALUES
('Sale', '4'),
('Warehouse','2');
INSERT INTO Company.EMPLOYEE (Fname, Lname, Ssn, Bdate, Sex, SiteNo, Dno)
VALUES
('Jim', 'Halpert', '1... | true |
84928ebe4f6a1daec400441066f4db57756ae867 | SQL | ashutoshraina/nyctaxianalyser | /data/borough.sql | UTF-8 | 154 | 3 | 3 | [] | no_license | SELECT
count(*) as BookingCount,
borough
FROM
fhv,
zone
WHERE
fhv.locationid = zone.locationid
group by borough
order by BookingCount DESC;
| true |
48db85a3f6a808c226a47d9c720d5350b8b8dc0a | SQL | youwu94/database-projects | /ebay database/query4.sql | UTF-8 | 109 | 2.859375 | 3 | [] | no_license | select count(distinct(Item.userID))
from Item,User
where Item.userID = User.userID
and User.rating > 1000; | true |
b162a48c29ef597012e327f2e8e11011f8bc07c2 | SQL | internet-of-energy/Centralized_IOE | /shared_electricity.sql | UTF-8 | 6,254 | 3.359375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.16, for osx10.14 (x86_64)
--
-- Host: localhost Database: shared_electricity
-- ------------------------------------------------------
-- Server version 8.0.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_R... | true |
4357f938dea84553a92444346b0a94b7daed66f3 | SQL | RuslanYakupov/SQL_Products_Category | /ProductsCategory.sql | UTF-8 | 153 | 2.59375 | 3 | [] | no_license | CREATE TABLE ProductsCategory (
products_id INT not null,
category_id INT not null
);
INSERT INTO ProductsCategory
VALUES (1, 1),
(2, 1),
(3, 2);
| true |
f1cba1bdf8427f2c9455db0f6ffb967ac1015c7a | SQL | paulie134/Work-SQL-Health-Check-Scripts-1- | /Work SQL Health Check Scripts/Script 8_TABLE_COUNTS.SQL | UTF-8 | 297 | 2.53125 | 3 | [] | no_license | --count of tables
select count(*) from mhgroup.docmaster
SELECT COUNT(*) FROM MHGROUP.DOCMASTER WITH (NOLOCK) WHERE TYPE='D'
select count(*) from mhgroup.projects
select count(*) from mhgroup.project_items
select count(*) from mhgroup.doc_index
select count(*) from mhgroup.dochistory
| true |
0eb08ac64fbdf44fb162ffe12c0c9a53c14dbe42 | SQL | RusOllegator/GB_DB | /Lesson8/Problem_4.sql | UTF-8 | 261 | 3.265625 | 3 | [] | no_license | USE vk;
-- Определить кто больше поставил лайков (всего) - мужчины или женщины?
SELECT count(1) AS total, p.gender FROM
likes l JOIN profiles p ON p.user_id = l.user_id
GROUP BY 2
ORDER BY 1 DESC
LIMIT 1; | true |
dc95525901f13c45e7a9fec36cab589b34d346ab | SQL | d-georgiev-91/TelerikAcademy | /Php/BooksCatalog/books.sql | UTF-8 | 2,725 | 3.40625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 27, 2013 at 10:52
-- Server version: 5.6.12
-- PHP Version: 5.5.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
e089254d6aee49c2213ca0d4fed0dec2e93bf1d6 | SQL | AlexFlek1990/bankapi | /src/main/resources/sql scripts/accounts.sql | UTF-8 | 306 | 2.65625 | 3 | [] | no_license |
CREATE TABLE IF NOT EXISTS public.accounts
(
id bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1 ),
balance bigint,
name character varying(255) COLLATE pg_catalog."default",
CONSTRAINT accounts_pkey PRIMARY KEY (id)
)} | true |
b660d1d6581949e3e0b5a804bb1aaf697ad281e5 | SQL | khaledabdelfattah74/Book-Store-System | /Bookstore/src/database/bookstore_ddl.sql | UTF-8 | 6,231 | 4.09375 | 4 | [] | no_license | drop schema bookstore;
create schema if not exists bookstore;
use bookstore;
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE publisher;
create table if not exists publisher
(
publisher_name varchar(45) primary key not null
);
create table if not exists publisher_addresses
(
publisher_name varchar(45) not null,... | true |
e542943032ff5abafbdab84a4248023b4c87d450 | SQL | rond556/SQL.LetsGetTogether | /answers/exercise5.sql | UTF-8 | 94 | 2.75 | 3 | [] | no_license | SELECT Country, COUNT(*)AS num_students
FROM Students
GROUP BY Country
ORDER BY Count(*) DESC; | true |
3d7afab794b3da7eb43cc9c360d9ab3ff2b6b415 | SQL | petersaunders/macleans_reader | /sql/table/ArticleCategory.sql | UTF-8 | 207 | 3.234375 | 3 | [] | no_license | /* Association table for article categories */
DROP TABLE IF EXISTS ArticleCategory;
CREATE TABLE ArticleCategory (
article_id INTEGER,
category_id INTEGER,
UNIQUE(article_id, category_id)
);
| true |
a2193503afb2e887c9f973aef708d4935a2ae6d6 | SQL | fiammacoedo/gdd | /Resueltos SQL/Ejercicio 13-SQL.sql | ISO-8859-2 | 749 | 4.25 | 4 | [] | no_license | -- Ejercicio 13 [SQL]
-- Realizar una consulta que retorne para cada producto que posea composicin
-- nombre del producto, precio del producto, precio de la sumatoria de los precios por
-- la cantidad de los productos que lo componen. Solo se debern mostrar los
-- productos que estn compuestos por ms de 2 productos y d... | true |
798555ee589ec9d8e38b33bb1f3fd3ee8b0a6ccc | SQL | anitamazur/Projet-PHP | /bdd/modele_bdd_annuaire.sql | UTF-8 | 12,618 | 3.359375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.7deb7
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Dim 27 Mai 2012 à 18:44
-- Version du serveur: 5.1.61
-- Version de PHP: 5.3.3-7+squeeze9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 S... | true |
77a0033aa92a01db0ef124559f8840ae871fa121 | SQL | barbalex/ae2 | /src/sql/one-offs/2022-10-06.sql | UTF-8 | 800 | 3.359375 | 3 | [
"ISC"
] | permissive | -- 1. correct last import
UPDATE
ae.object
SET
"properties" = json_build_object('Taxonomie ID', o.taxonomie_id, 'Code', o.code, 'Gattung', o.gattung, 'Art', o.art, 'Unterart', o.unterart, 'Name Deutsch', o.name_deutsch, 'Artname vollständig', o.name, 'Synonym', o.synonym, 'CAPTX', o.captx, 'Taxon ID VDC', CONCAT('i... | true |
4564a41f36b3dd99986d7d60b3a89a1b28b80de9 | SQL | Szilmaril/book_shop2 | /book_shop/database/library.sql | UTF-8 | 6,230 | 3.640625 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Gép: 127.0.0.1
-- Létrehozás ideje: 2019. Ápr 01. 21:18
-- Kiszolgáló verziója: 10.1.38-MariaDB
-- PHP verzió: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
76c02a1ece9caeadefd3de0248aa293a563e1c88 | SQL | MrD0079/portal | /sql/bud_ru_zay_report_total.sql | UTF-8 | 20,140 | 3.203125 | 3 | [] | no_license | /* Formatted on 05/04/2016 18:59:55 (QP5 v5.252.13127.32867) */
SELECT current_status,
(SELECT name1
FROM accept_types
WHERE id = z.current_status)
current_status_txt,
SUM (DECODE (full, -2, 1, 0)) full2,
SUM (DECODE (full, 1, 1, 0)) + SUM (DECODE (full, 0... | true |
1d2f51fb469048634a0993baf35d6cd514c54d1a | SQL | stajun/digital | /SQL/테이블/test_attend0.sql | UTF-8 | 3,471 | 3 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `test`;
-- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Se... | true |
d0c08672a32aa3cfbf75d87337bcbcac29a6e702 | SQL | jeffersonsevero/estudos_bd | /sub_querys.sql | UTF-8 | 538 | 3.640625 | 4 | [] | no_license |
/*subconsulta feita na parte do SELECT*/
SELECT usuarios.nome, (select faixas.titulo from faixas where faixas.id_faixa = usuarios.faixa_salarial) as faixa
FROM usuarios;
/*subconsulta feita na parte do WHERE*/
SELECT usuarios.nome
FROM usuarios
WHERE (select faixas.titulo from faixas where faixas.id_faixa = usuario... | true |
b965e1d44ea47c49b6ae8a48f35a7cffa955b237 | SQL | galle2018/BD2 | /EJERCICIOS-1/ex24.sql | UTF-8 | 247 | 3.078125 | 3 | [] | no_license | # 24. Escreva uma consulta SQL que retorne todos os empregados (employees) cujo nome (first_name) seja
# igual a 'Yinghua' ou igual a 'Elvis'.
USE psdb; # la selecciono
SELECT * FROM employees
where (first_name='Yinghua'
or first_name='Elvis'); | true |
fcafd55e37eae4a2e99a19aa2852f101c46b8f4c | SQL | mcorallo/mc2 | /mc2_engine/db/2-insert-init-data.sql | UTF-8 | 1,593 | 3.140625 | 3 | [] | no_license | use `bs-auth`;
start transaction;
/*admin pwd 4tWLQR4SaMH506pY*/
insert into sys_users (username,password,email,default_access) values ('admin', '5b0b188718d91aad5c963cef516a42d453269c26', '', 'FULL');
insert into sys_profiles (name,description) values ('ADMIN', 'System administrator');
insert into sys_user_prof... | true |
7a30fbe39d59b1e2a67af0712df125d799bc81a5 | SQL | mczal/Sidekeek-Server | /sidekeek.sql | UTF-8 | 13,642 | 2.90625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 07, 2016 at 04:02 PM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
aca5c30725a4b5dd6672e9b8e0b5481a13b8b716 | SQL | JustAStatistic/BV_tool | /Best_View_Dbase/bvt_prod/Tables/Drop_Date_Calc_Rules.sql | UTF-8 | 488 | 2.609375 | 3 | [] | no_license | CREATE TABLE [bvt_prod].[Drop_Date_Calc_Rules] (
[idDrop_Date] INT IDENTITY (1, 1) NOT NULL,
[idProgram_Touch_Definitions_TBL_FK] INT NOT NULL,
[Days_Before_Inhome] INT NOT NULL,
[drop_start_date] DATE NOT NULL,
PRIMARY KEY CLUSTERED ([id... | true |
6cda8b60ebcc0f9c1be86967385f6b5152665854 | SQL | JimSow/lodsve-framework | /lodsve-transaction/src/main/resources/db/transaction/V1__transaction_init.sql | UTF-8 | 1,646 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | -- ----------------------------
-- Table structure for `t_payment`
-- ----------------------------
DROP TABLE IF EXISTS `t_payment`;
CREATE TABLE `t_payment` (
`id` bigint(20) NOT NULL,
`amount` bigint(20) DEFAULT NULL,
`complete_time` timestamp DEFAULT NULL,
`description` varchar(255) COLLATE utf8_bin DEFAULT... | true |
151c9de4100519cddd50e08fa920fbb96694d0ae | SQL | hqottsz/MXI | /assetmanagement-database/src/upgrade/plsql/lib/liquibase/8/0/2/0/sql/QC-7917.sql | UTF-8 | 361 | 2.703125 | 3 | [] | no_license | --liquibase formatted sql
--changeSet QC-7917:1 stripComments:false endDelimiter:\n\s*/\s*\n|\n\s*/\s*$
BEGIN
utl_migr_schema_pkg.table_create('
Create table "SSO_TICKET" (
"ID" Raw(16) NOT NULL DEFERRABLE ,
"PRINCIPAL" Varchar2 (40) NOT NULL DEFERRABLE ,
"EXPIRE_DT" Date NOT NULL DEFERRABLE ,
Constraint "PK_SSO_... | true |
a938b55169973218f436606cab113965010afa54 | SQL | astrioh/plarson_test_task | /task2/task2.sql | UTF-8 | 1,728 | 4.40625 | 4 | [] | no_license | SELECT month, days FROM (SELECT MONTHNAME(CONCAT(YEAR(CURDATE()), '-01', '-01')) AS month,
DAY(LAST_DAY(CONCAT(YEAR(CURDATE()), '-01', '-01'))) as days
UNION
SELECT MONTHNAME(CONCAT(YEAR(CURDATE()), '-02', '-01')) AS month,
DAY(LAST_DAY(CONCAT(YEAR(CURDATE()), '-02', '-01'))) as days
UNION
SELECT MONT... | true |
9d0c7c79495f4588d8d567ea111e8dbcc18d6759 | SQL | KaryNaiKo/TreeStruct | /src/main/resources/db/populateDB.sql | UTF-8 | 769 | 2.8125 | 3 | [] | no_license | DELETE FROM tree_element;
DELETE FROM tree;
ALTER SEQUENCE global_seq RESTART WITH 100000;
insert into tree (tree_type, parent_id, children_order) values
('SIMPLE_TREE', null, null),
('SIMPLE_TREE', 100000, 0),
('SIMPLE_TREE', 100000, 1),
('SIMPLE_TREE', 100000, 2),
('SIMPLE_TREE', 100000, 3),
('SIMPLE_TRE... | true |
53ab817eaaa2f59d1c6001146e520a2f11d3099e | SQL | ehfhcrc/LabKeyModules | /ISCore/queries/immport/ISC_test.sql | UTF-8 | 1,361 | 3.609375 | 4 | [
"Artistic-2.0"
] | permissive | -- Make a dataset tables with all files
PARAMETERS($STUDY VARCHAR DEFAULT NULL)
SELECT DISTINCT
file_info.name AS file_info_name,
file_info.purpose,
file_info.filesize_bytes AS filesize,
biosample_2_expsample.expsample_accession,
biosample.biosample_accession,
biosample.subject_accession || '.' || SUBSTRING(biosample.s... | true |
af728954a1a497630eea84943b5a63871cd06590 | SQL | TakiyaHideto/hive_eleme | /dm_hive2cassandra_dm_ups_user_info_inc.sql | UTF-8 | 3,502 | 2.734375 | 3 | [] | no_license | #***************************************************************************************************
# ** 文件名称: dm_ups_user_info_inc_h2c_q.sql
# ** 功能描述: 生成dm_ups_user_info_inc表 Cassandra
# ** 创建者: jiahao.dong
# ** 创建日期: 2016-11-08
#***************************************************************************************... | true |
7e92717951f4a52cf14184410c7e172ec5ff34d2 | SQL | joansmith1/ontrack | /ontrack-backend/src/main/resources/META-INF/db/update.17.sql | UTF-8 | 857 | 3.765625 | 4 | [
"MIT"
] | permissive | -- Flag for the events having been sent
-- Previous entries remain NULL - they will be counted as false
ALTER TABLE EVENTS ADD SENT BOOLEAN;
-- Sets all previous entry to true, in order to prevent them being sent again
UPDATE EVENTS SET SENT = TRUE;
-- Considers all previous authors as being not correct since the forei... | true |
991a793a54c3cd5da9c084979d94ec25bdb41843 | SQL | mark-myzhao/snickr | /doc/database-design/cascade.sql | UTF-8 | 1,459 | 2.90625 | 3 | [
"MIT"
] | permissive | alter table Channel
add constraint chfk foreign key (wid) references Workspace(wid) on DELETE cascade;
alter table Message
add constraint mfk foreign key (wid, cname) references Channel(wid, cname) on DELETE cascade;
alter table Message
add constraint mfk2 foreign key (uemail) references User(uemail) on DELETE... | true |
668acb8ee09359e68dedea0c53b2ceacb5a489e5 | SQL | UFOP-CSI477/2019-01-atividades-MarcosVinicius1994 | /Php/DB/academico-v20190523.sql | UTF-8 | 2,228 | 3.515625 | 4 | [] | no_license | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET N... | true |
daa2475b8e290ef6880381be34acf73545314644 | SQL | Ashok4994/Database-Scripts | /Rollback/Validation/020_DBAatCAS_IT335_RB_VALIDATION.sql | UTF-8 | 2,480 | 3.140625 | 3 | [] | no_license | /*
Script: 020_DBAatCAS_IT335_RB_VALIDATION.sql
Author: Carolina Ardura
Date: 03/13/2019
Purpose: run database deployment.
*/
SET TERMOUT ON
SET ECHO OFF
SET LINESIZE 80
--SET ESCAPE ^
--SET DEFINE OFF
SET SERVEROUTPUT ON SIZE 10000
WHENEVER SQLERROR EXIT ROLLBACK
column file... | true |
21bd13845aa9dd1eb90d333d058598171bfd488c | SQL | jhonlloydclarion/PasuyoWEB | /Registration System/sql/Create TABLES.sql | UTF-8 | 767 | 3.765625 | 4 | [] | no_license | CREATE TABLE Product(
prod_id int NOT NULL,
prod_name varchar(45) NOT NULL,
prod_price int NOT NULL,
prod_img varchar(45) NOT NULL,
prod_category varchar(45) NOT NULL,
prod_qty int,
PRIMARY KEY (prod_id)
);
CREATE TABLE Customer(
cust_id int NOT NULL,
cust_name varchar(45) NOT NULL,
cust_mobile ... | true |
6421af5791c1cabe6f6adcf59a0f6a03a374a3a8 | SQL | FELLSAT/Procedimientos | /Procedimientos/parte 5/H3i_CONS_DET_MEDORD_HISTEVO.sql | UTF-8 | 1,840 | 3.171875 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE H3i_CONS_DET_MEDORD_HISTEVO /*PROCEDIMIENTO ALMACENADO PARA CONSULTAR LAS ORDENES MÉDICAS (DETALLES) ASOCIADAS A UNA HICL O EVOLUCIÓN*/
-- =============================================
-- Author: FELIPE SATIZABAL
-- =============================================
(
v_NUMHICL IN NU... | true |
0a28845b577ab074ac873d87149fc5501f7a680e | SQL | smserpa/burger | /db/schema.sql | UTF-8 | 359 | 3.21875 | 3 | [
"MIT"
] | permissive | -- Drops the burgers_db if it already exists --
DROP DATABASE IF EXISTS burgers_db;
-- Creates the database burgers_db and specifies it for use.
CREATE DATABASE burgers_db;
USE burgers_db;
-- Creates the table burgers.
CREATE TABLE burgers (
id int NOT NULL AUTO_INCREMENT,
burger_name varchar(255),
devoured bo... | true |
ab6f603868bc2e103446f98851bc4f599122356b | SQL | Wowu/agh-io-schedules-backend | /src/main/resources/db/migration/V1.1__tables.sql | UTF-8 | 2,426 | 3.734375 | 4 | [] | no_license | CREATE TABLE email
(
id SERIAL PRIMARY KEY,
email TEXT UNIQUE NOT NULL
);
CREATE TABLE my_user
(
id SERIAL PRIMARY KEY,
email_id INTEGER UNIQUE NOT NULL,
password TEXT NOT NULL,
role TEXT NOT NULL
);
ALTER TABLE my_user
ADD CONSTRAINT email_fk FOREIGN KEY (... | true |
1c9dbc7b2d9037ba95e094cece1f73ec2ef66c7b | SQL | Goggot/Automne2012 | /BDD/SQL/2- Mises � jour/Table - nouveau_dept.sql | ISO-8859-1 | 918 | 3.0625 | 3 | [] | no_license |
-- =======================================================
PROMPT DESTRUCTION de la table NouvDept
-- =======================================================
DROP TABLE nouveau_departement;
-- =======================================================
PROMPT CRATION DE LA TABLE NouvDept
-- ===========================... | true |
e0a30493b9cd1af14725b7bb83e39e847869d2ca | SQL | ConnorCleveland2002/Node-Employee-Tracker | /schema.sql | UTF-8 | 471 | 3.484375 | 3 | [] | no_license | DROP DATABASE IF EXISTS employees_db;
CREATE DATABASE employees_db;
USE employees_db;
CREATE TABLE employees (
id INT auto_increment,
first_name VARCHAR(30),
last_name VARCHAR(30),
manager_id VARCHAR(30),
role_id INT,
primary key (id)
);
CREATE TABLE departments (
id INT auto_increment,
name VARCHAR(30... | true |
181621690e8c0e71c8a4b31747ace3b005bf99b9 | SQL | hosseinOwj/dataGen | /procedures/Job_Change_Data_Gen.sql | UTF-8 | 6,992 | 3.25 | 3 | [] | no_license |
create or replace procedure Job_Change_Data_Gen
(
noRows integer, -- Number of Rows in Job_Change_Data table
error_Rate number, -- Pecentage of Error Rate ( 0 - 100 )
startDate number, -- given data range - start
endDate number, -- given data range - end
-- Optional Parameters
Parameters_Table_ID integer de... | true |
08b2d3b108541e7de7ee9960a45ea0e863c0ab60 | SQL | fvaller/npi | /base.sql | UTF-8 | 1,967 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.3
-- http://www.phpmyadmin.net
--
-- Servidor: mysql08.uni5.net
-- Tempo de Geração: Abr 10, 2014 as 02:24 PM
-- Versão do Servidor: 5.1.70
-- Versão do PHP: 5.2.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Banco de Dados: `npi`
--
-- ------------------------------------------... | true |
aee499015388dbadbbbd86f8942263f2aa760e47 | SQL | ShahakBH/jazzino-master | /bi/bi-reporting/src/main/resources/deltas/138.sql | UTF-8 | 6,637 | 3.28125 | 3 | [] | no_license | -- WEB-4513 - standardise indexing; remove foreign keys
create index account_session_account_id_idx on account_session (account_id);
create index account_session_start_ts_idx on account_session (start_ts);
alter table invitations drop constraint invitations_player_id_fkey;
create index invitations_player_id_idx on in... | true |
122bbf06137b6a1ebfc44f91593234eab44a767d | SQL | programacionparaaprender/materias-computacion | /semestre_6_cul/Sistemas de BD/Asignacion_teoria/SQL/TablaCD.sql | UTF-8 | 361 | 2.609375 | 3 | [] | no_license | use Tienda;
CREATE TABLE CD
(
Codigo varchar(20) not null
,Nombre varchar(50) not null
,Precio real not null
,constraint pk_Codigo PRIMARY KEY(Codigo)
);
INSERT INTO CD(Codigo,Nombre,Precio)
VALUES('123','Guitarra Electrica',300);
INSERT INTO CD(Codigo,Nombre,Precio)
VALUES('124','Violin',300);
INSERT INTO CD(Codigo,No... | true |
a573f0ff99a390fa8faaff2cdc341f8372b74631 | SQL | DevKal/database | /Dump20160203.sql | UTF-8 | 5,944 | 3.078125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `trombi_simplon` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `trombi_simplon`;
-- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (x86_64)
--
-- Host: 127.0.0.1 Database: trombi_simplon
-- ------------------------------------------------------
-- Server version 5.5.46-0ubuntu0... | true |
ebec8de9d5215adfd1e10d200e096d9e3190c388 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day22/select1942.sql | UTF-8 | 264 | 2.984375 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='WeMo' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['1431','6051','6011','1407','5048','2084','2092','2100_1','2221','5100_2'])
| true |
91c2db6e8ae345efffd0705edf053d3e16dbc9c4 | SQL | raizeta/Tutorial | /Mysql/data-definition-language.SQL | UTF-8 | 1,375 | 3.671875 | 4 | [] | no_license | #CREATE TABLE
CREATE TABLE IF NOT EXISTS TBL_EMPLOYE
(
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
nama_employe VARCHAR(255) NOT NULL COMMENT 'Nama Lengkap Karyawan',
email VARCHAR(50) NOT NULL,
tanggal DATE NOT NULL,
create_at DATETIME NOT NULL,
update_at DATETIME DEFAULT NULL,
alamat VARCHAR(255) NOT NULL D... | true |
b31795abe3ca804479b3143688808a7ca92e7da4 | SQL | tharwin-carr/SQL-examples | /gameshop.sql | UTF-8 | 533 | 3.890625 | 4 | [] | no_license | CREATE TABLE customers (
customer_id int NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL,
age int(11) NOT NULL,
PRIMARY KEY (customer_id)
);
CREATE TABLE products (
product_id int NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL,
PRIMARY KEY (product_id)
);
CREATE TABLE orders (
order_id int NOT NULL AUTO_INCR... | true |
434e70fd15d28a4d1688630368faab0e72df4104 | SQL | lucasjellema/mobile-red-flight-app | /FlyingHighAirlineServices/FlightService/database.sql | UTF-8 | 8,318 | 3.921875 | 4 | [
"Artistic-2.0"
] | permissive | create table fli_airports
( id number(5) not null primary key
, name varchar2(100)
, country_code varchar2(2) not null
, iata_code varchar2(3) not null
, city varchar2(50) not null
);
create table fli_airline_carriers
( id number(5) not null primary key
, iata_code varchar2(2) not null
, name varchar2(100) not null
);... | true |
accf8143c5802fd68896202cf78eab5e8a283bf0 | SQL | CUBRID/cubrid-testcases | /sql/_04_operator_function/_03_string_op/_012_upper/cases/1012.sql | UTF-8 | 248 | 2.6875 | 3 | [
"BSD-3-Clause"
] | permissive | --test upper function with set type
create class tb(
col1 varchar
);
insert into tb values('varchar1');
insert into tb values('varchar2');
select * from tb where col1 like '%VAR%';
select * from tb where upper(col1) like '%VAR%';
drop class tb; | true |
4b8334ed244a91d8a89f3f9091b218904f9c874f | SQL | BergSouza/PlusLife | /src/Banco_de_dados/pluslife (v0) BACKUP.sql | UTF-8 | 2,932 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 07-Abr-2018 às 20:19
-- Versão do servidor: 10.1.29-MariaDB
-- PHP Version: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
cf2757bd3cdc2328ed31d2cde0b6275e54f9128e | SQL | gabrielschorsch/Senai-2Semestre-DB | /Scripts/Exercicio-T_Dps.sql | ISO-8859-1 | 1,775 | 4.21875 | 4 | [] | no_license | CREATE DATABASE T_DPS
USE T_DPS
BEGIN -- Criar tabelas
CREATE TABLE Departamentos (
IdDepartamento INT PRIMARY KEY IDENTITY,
Nome VARCHAR(50) UNIQUE NOT NULL
);
CREATE TABLE Habilidades(
IdHabilidade INT PRIMARY KEY IDENTITY,
Nome VARCHAR(50) UNIQUE NOT NULL
);
CREATE TABLE Funcionarios(
IdFuncionario INT PRI... | true |
1cbae3d83f9103cd937d3f3cfb223fe993435a7d | SQL | Ragedancer/Advanced-Databases | /11. Set Operator Functions/Set Operator Functions Statements.sql | UTF-8 | 496 | 3.484375 | 3 | [] | no_license | --Query14
SELECT * FROM sandwiches;
SELECT * FROM itemorder;
--Shows which sandwiches and shipments were placed or made on the same day
SELECT item_Number AS "ID",sandwich_datemade AS "Date",'sandwich' AS "Role"
FROM sandwiches
UNION
SELECT order_id,order_orderDate,'shipment'
FROM itemorder
ORDER BY 1;
--Query15
SELECT... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.