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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1ac598f516e335f6cc85460ffc252f04be442d2b | SQL | Birajit1/googlemapusingphp | /database.sql | UTF-8 | 1,537 | 3.015625 | 3 | [
"Unlicense"
] | permissive |
-- On PHPmyadmin create database as myproject
-- Table structure for `location`.
CREATE TABLE `location`(
id int(10),
name varchar(100),
lat varchar(100),
lng varchar(100),
type varchar(100)
);
-- Inserting some value on location table.
INSERT INTO `location` (`id`, `name`, `lat`, `lng`, `ty... | true |
8902339467bee42d5a8012503611ee014a90c55f | SQL | hendraramadani/Big-Data | /Tugas 1/Dataset/Split SQL/2018.sql | UTF-8 | 7,742 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 18, 2020 at 07:59 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
4dffbf4f6321ce0e8e60bea56a922c4a6e497e54 | SQL | iwansuryaningrat/mini-projectPBP | /project-pbp/pbp.sql | UTF-8 | 59,024 | 3.140625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 26 Okt 2021 pada 06.48
-- Versi server: 10.4.21-MariaDB
-- Versi PHP: 8.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... | true |
1b6f8f478ad57920cf9c8b8f518fa8f698271857 | SQL | nirapach/Facebook_DPA_Spring_MySql | /src/main/sql/create_tables.sql | UTF-8 | 38,815 | 3.234375 | 3 | [] | no_license | CREATE SCHEMA dpa-reports;
USE dpa-reports;
CREATE TABLE `Account_Information_Master` (
`Application_Page_ID` bigint(20) NOT NULL DEFAULT '0',
`Business_Manager_Ad_Account_ID` bigint(20) DEFAULT '0',
`Business_Client_Name` varchar(45) DEFAULT NULL,
`Application_Long_Lived_Access_Token` longtext,
PRIMARY KEY... | true |
3624df29210d4be0038cf601b8c2abf3f435d9bc | SQL | javierarancibia/primer-desafio-base-de-datos | /operaciones_tabla.sql | UTF-8 | 3,567 | 4.125 | 4 | [] | no_license | -- 1. Crear Base de datos posts
CREATE DATABASE posts;
-- 2. Crear tabla post, con los atributos id, nombre de usuario, fecha de creación, contenido, descripción
CREATE TABLE post(id SERIAL, nombre_usuario VARCHAR(70), fecha_de_creacion DATE, contenido VARCHAR(70), descripcion VARCHAR(70), PRIMARY KEY(id));
-- 3. I... | true |
749fe562ae9ff5f57797c2e14e295136a6338359 | SQL | christophboecker/YF4b2-Testcase | /dataset.sql | UTF-8 | 3,972 | 3.109375 | 3 | [] | no_license | ## Redaxo Database Dump Version 5
## Prefix rex_
## charset utf8
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `rex_yf4b_buch`;
CREATE TABLE `rex_yf4b_buch` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`b_datum` date NOT NULL,
`b_titel` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`b_id_dokument` ... | true |
75fa8b8540a8dd79170133385fea112448677894 | SQL | arcigajember/ambweb | /Web.Db/dbo/Stored Procedures/SubjectUpdate.sql | UTF-8 | 371 | 2.875 | 3 | [] | no_license |
CREATE PROCEDURE SubjectUpdate(
@SubjectId int,
@SubjectName varchar(50),
@Description varchar(50)
)
AS
UPDATE dbo.Subject
SET
--SubjectId - this column value is auto-generated
dbo.Subject.SubjectName = @Subjectname, -- varchar
dbo.Subject.Description = @Description -- varc... | true |
f01b28c2fd004797d1789833bc14638a2f8f2819 | SQL | pixtelation/BookHive | /Orders.sql | UTF-8 | 392 | 2.671875 | 3 | [] | no_license |
create table Orders
(
bookid int ,
bookcode varchar(100),
bookname varchar(100),
bookauthor varchar(100),
bookprice int,
)
insert into Orders(bookid,bookcode,bookname,bookauthor,bookprice)
select bookid,bookcode,bookname,bookauthor,bookprice from Customercart
truncate table Customercart;
select ... | true |
20f476f1a691f29d143605baa55b4e883acd9c16 | SQL | nate-hughes/dba-scripts | /database-get-encryption-state.sql | UTF-8 | 267 | 3.171875 | 3 | [] | no_license | SELECT d.name AS [database]
,d.is_encrypted
,dek.encryption_state
,dek.percent_complete
,dek.key_algorithm
,dek.key_length
FROM master.sys.databases d
LEFT JOIN master.sys.dm_database_encryption_keys dek ON d.database_id = dek.database_id
ORDER BY d.name; | true |
a338a54b2696c4569e821d0e9e4d8457d357103c | SQL | nabind/prism_test | /Codebase/FileTracking/DB/Table/ER_TEST_SCHEDULE_SUPPORT.sql | UTF-8 | 1,292 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | -- Create table
create table ER_TEST_SCHEDULE_SUPPORT
(
ER_TEST_SCHEDID NUMBER not null,
ER_STUDID NUMBER,
SCHEDULE_ID NUMBER,
DATE_SCHEDULED DATE,
TIMEOFDAY VARCHAR2(30),
DATECHECKEDIN DATE,
CONTENT_AREA_CODE ... | true |
de477b4efd8834b4eb079cfb919e3f5299ea774d | SQL | anri-1151/airline_system | /airline_system.sql | UTF-8 | 12,330 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 19, 2015 at 10:35 PM
-- Server version: 5.6.20
-- PHP Version: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
20747faef07e557ed97c99beb5a0eddc23dd49d3 | SQL | KuhlThing/EmployeeTracker | /assets/seed.sql | UTF-8 | 3,718 | 2.90625 | 3 | [] | no_license | INSERT INTO employee_managerdb.department (department_id, department_name)
VALUES (1, "Engineering");
INSERT INTO employee_managerdb.department (department_id, department_name)
VALUES (2, "Finance");
INSERT INTO employee_managerdb.department (department_id, department_name)
VALUES (3, "Legal");
INSERT INTO employee_... | true |
1e79db9b19beae1bb1e846d8dfa3ad3439d98852 | SQL | t-crow-142/web-lab-06 | /exercises/sql/lab-database.sql | UTF-8 | 420 | 2.796875 | 3 | [] | no_license | -- Run this script to create or re-initialize the database.
drop table if exists users;
create table users (
id integer not null primary key,
username varchar(64) unique not null,
password varchar(64) not null,
name varchar(64),
authToken varchar(128)
);
insert into users (id, username, passwor... | true |
7bfc536eb7095c73f86c3fb2fae484363221a97f | SQL | jhrozo/IntroducaoSQL | /exemplos.sql | WINDOWS-1252 | 5,852 | 4.03125 | 4 | [] | no_license | -- exemplos.sql v.1.0 2021
-- Jaime H Rozo - jhrozo@yahoo.com
/*
Exemplos do manual Introduo ao SQL.
Use os scripts criarEsquema.sql e popularTabelas.sql para criar e
popular as tabelas usadas nos exemplos.
*/
use bd_01;
-- SELECT
SELECT Id, Nome, Cidade
FROM Cliente;
SELECT Empresa, Co... | true |
be967f8ad44e8b4d453c170d7acd51d059ed1f33 | SQL | marklxie/my-sql_scripts | /SQLQuerySalesPractice.sql | UTF-8 | 546 | 3.859375 | 4 | [] | no_license | use SalesDb
/*select * from customers;
select * from orders;
select * from customers
join orders on customers.id = orders.customerid;
*/
select c.Name, (c.City + ',' + c.State) 'city,state', o.Date, ol.Product from customers c
join orders o on c.id = o.customerid
join orderlines ol on o.id = ol.ordersid
order by Dat... | true |
8efdd4fa6b96994401976566b48f93765207b5b9 | SQL | fjnw/jam | /db/create_tables.sql | UTF-8 | 2,704 | 3.65625 | 4 | [] | no_license | CREATE TABLE users (
id BIGINT unsigned auto_increment primary key,
userName VARCHAR (25) UNIQUE NOT NULL,
firstName VARCHAR (25) NOT NULL,
lastName VARCHAR (25) NOT NULL,
email VARCHAR(100) NOT NULL,
password VARCHAR(41) NOT NULL COLLATE utf8_bin,
image VARCHAR(500) null,
imageType varc... | true |
3651c09051bd52c86d4b6fef626718b16aa287eb | SQL | ShadowShade/KhACL | /schema.sql | UTF-8 | 2,389 | 2.703125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.6.1-rc1
-- http://www.phpmyadmin.net
--
-- Generation Time: Mar 26, 2008 at 11:06 AM
-- Server version: 4.1.22
--
-- --------------------------------------------------------
--
-- Table structure for table `khacl_access`
--
CREATE TABLE IF NOT EXISTS `khacl_access` (
`id` in... | true |
db718ba069ba1b332d6354f42f2410d6ed902350 | SQL | joanrsar/challenge | /scripts/postgres/Script-1.sql | UTF-8 | 1,568 | 4.375 | 4 | [] | no_license | --Se asume que todos los campos son obligatorios menos start time y stop time
--Se asume que el item_id es unico
create table item(
item_id varchar(30) not null,
title varchar(100) not null,
category_id varchar(100) not null,
price float not null,
start_time timestamp ,
stop_time timestamp
);
ALTER TABLE item AD... | true |
c982221aaf866f2a7b19f07066d09159a9632750 | SQL | CrisPassos/sql-queries | /Microsoft SQL for Beginners/Querying Multiple Tables with Joins.sql | UTF-8 | 4,087 | 4.03125 | 4 | [] | no_license | -- Using the INNER JOIN --
SELECT
P.Name,
P.ProductNumber,
PS.Name AS "PRODUCT SUB CATEGORY"
FROM Production.Product P
INNER JOIN Production.ProductSubcategory PS
ON P.ProductSubcategoryID = PS.ProductSubcategoryID
ORDER BY "PRODUCT SUB CATEGORY"
SELECT
PS.Name AS "PRODUCTSUBCATEGORY",
PC.Name A... | true |
a45c4ff5731806343951dbf7a4a102fea3725b3a | SQL | zesk/xmodules | /whois/classes/Class/Query.sql | UTF-8 | 342 | 2.515625 | 3 | [
"MIT"
] | permissive | -- Database: mysql
CREATE TABLE {table} (
id integer unsigned PRIMARY KEY AUTO_INCREMENT NOT NULL,
name varchar(64) NOT NULL,
server integer unsigned NOT NULL,
registrar integer NULL,
created timestamp NOT NULL DEFAULT 0,
fetched timestamp NULL DEFAULT NULL,
results text,
taken tinyint N... | true |
2561b31c82db93f53d3b2a458f3680b579e05170 | SQL | huangjiesen/dynamic-datasource | /database.sql | UTF-8 | 414 | 2.734375 | 3 | [] | no_license | CREATE DATABASE test1;
CREATE DATABASE test2;
CREATE DATABASE test3;
use test1;
CREATE TABLE user(
id INT(11) PRIMARY KEY ,
name VARCHAR(50) NOT NULL,
sex BIT,
age INT(11)
);
use test2;
CREATE TABLE user(
id INT(11) PRIMARY KEY ,
name VARCHAR(50) NOT NULL,
sex BIT,
age INT(11)
);
use test3;
CREATE TA... | true |
239c23b73110cfe7f4c74460208c680473f7eea3 | SQL | badalb/sboot-microservices-docker-k8s-cloud | /inventory-service/src/main/resources/db/migration/V1_0_0_1__Base_version.sql | UTF-8 | 744 | 3.375 | 3 | [] | no_license | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
CREATE SCHEMA IF NOT EXISTS `inventories` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `inventori... | true |
4eca44ce324f00a414a3fafd6f450a4cd181e398 | SQL | casacciserena/corso_java | /workspace/ProximaPersistence/resources/sql/03_cc_tables.sql | UTF-8 | 3,889 | 3.53125 | 4 | [] | no_license | drop table bitcoinhistorical;
drop table cryptoexchangevaluesprovider;
drop table currencyregistry;
CREATE TABLE cryptoexchangevaluesprovider (
id bigint NOT NULL AUTO_INCREMENT,
label VARCHAR(255),
site VARCHAR(255),
imgpath VARCHAR(255),
PRIMARY KEY (id)
);
INSERT INTO cryptoexchangevaluesprovider(label, site) ... | true |
a5ddb91bc2bb0d34922e62b174ce01ec0c364978 | SQL | toomuchcoffee/Collectables | /src/main/resources/db/migration/V0_0_5__alter_collectibles_add_foreign_key_constraints.sql | UTF-8 | 147 | 2.953125 | 3 | [] | no_license | ALTER TABLE collectible ADD CONSTRAINT product_line_abbreviation_fk
FOREIGN KEY (product_line_abbreviation) REFERENCES product_line (abbreviation); | true |
e478340b8d8a1750a790c62c275f7e72fead84b2 | SQL | VirWus/SiteWeb | /Moussaouii-master/support.sql | UTF-8 | 2,009 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Client : 127.0.0.1
-- Généré le : Sam 21 Avril 2018 à 13:25
-- Version du serveur : 10.1.21-MariaDB
-- Version de PHP : 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... | true |
5492895f74ee2d0351d3a220ab3d511d637f37ad | SQL | zhilien-tech/zhiliren-we | /we-web-parent/web-linyun-airline/src/main/resources/sql/international_invoice.sql | UTF-8 | 4,332 | 3.171875 | 3 | [] | no_license | /*international_invoice_list_sql*/
SELECT
tpi.*, tuo.ordersnum,
tuo.ordersstatus,
tor.orderstatus receiveorderstatus
FROM
t_up_order tuo
INNER JOIN t_plan_info tpi ON tpi.ordernumber = tuo.id
LEFT JOIN t_order_receive tor ON tor.orderid = tuo.id
AND tor.orderstatus = @ordersstatus
$condition
/*internat... | true |
cbd49a6d42c9de74d59c513075314214fc69c954 | SQL | krishnamohankaruturi/secret | /aart-web-dependencies/db/other/US18198-LoadingData.sql | UTF-8 | 337 | 2.609375 | 3 | [] | no_license | DROP TABLE IF EXISTS temp_students_enrollments;
CREATE TABLE temp_students_enrollments(statestudentidentifier CHARACTER VARYING, aypschooldisplayidentifier CHARACTER VARYING, attendanceschooldisplayidentifier CHARACTER VARYING);
\COPY temp_students_enrollments FROM 'ks_students_enrollments_to_inactive.csv' DELIMITER ... | true |
b4d5f5fafbb434e37003c7051640ff771900a9ae | SQL | feetha05/cs109b-grp9-final-project | /notes/commands.cql | UTF-8 | 3,243 | 3.953125 | 4 | [] | no_license | CREATE CONSTRAINT jurisdictionId IF NOT EXISTS on (jur:Jurisdiction) ASSERT jur.id IS UNIQUE;
LOAD CSV WITH HEADERS FROM 'file:///jurisdictions.csv' AS row
WITH row
MERGE (jurisdiction:Jurisdiction {id:toInteger(row.id)})
ON CREATE SET jurisdiction.name = row.name_long,
jurisdiction.url = row.url;
CREATE CONSTRAINT co... | true |
d418f539fef1a946906f4d6a545734e5063bc05b | SQL | medical-projects/Riskmarkers_ACS | /SQL-extraction/13procedures.sql | UTF-8 | 3,815 | 3.546875 | 4 | [] | no_license | -- ------------------------------------------------------------------
-- Title: Extraction of procedures
-- Notes: This query extracts information about procedures that patients received during their ICU stay.
-- ------------------------------------------------------------------
drop view procedimientos_nstemi cascade;... | true |
55fdee1019d46c2b8842cf91491144060ef69f0b | SQL | pradana1/tamplate_ | /code_cishop.sql | UTF-8 | 6,045 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 06 Jul 2021 pada 08.42
-- Versi server: 10.4.17-MariaDB
-- Versi PHP: 7.4.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... | true |
70850fe2cdb1340c8f4fd888b64b85216ff12810 | SQL | msantacruz/hcam-recolector | /sql/base_datos.sql | UTF-8 | 9,789 | 3.09375 | 3 | [] | no_license | -- Database: hcam
-- DROP DATABASE hcam;
CREATE DATABASE hcam
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default
LC_COLLATE = 'Spanish_Ecuador.1252'
LC_CTYPE = 'Spanish_Ecuador.1252'
CONNECTION LIMIT = -1;
-- Table: movimiento_diesel
-- DROP TABLE movimiento_diesel... | true |
e2f71c115a7d209e4bb9931ac2aca402fe505340 | SQL | cwi-crescer-2017-1/jomar.cardoso | /modulo-07/aula-03/Package.sql | ISO-8859-1 | 6,023 | 3.625 | 4 | [] | no_license | /*
Exerccio 1: Cidades Duplicadas
A partir do conhecimento de procedures/functions e packages obtidos (rapidamente)
crie uma package que permita eliminar cidades duplicadas. Para essa tarefa respeite
as seguintes regras: -> identifique as cidades duplicadas; -> identifique os clientes
que esto relacionados com ela; ->... | true |
a7050b4d7cb27a5a9cce1be94f4539945280521c | SQL | PaulineFP/exo_sql_php | /exo_sql/petites_annonces/bdd.sql | UTF-8 | 1,046 | 3.9375 | 4 | [] | no_license | CREATE TABLE post (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
slug VARCHAR (255) NOT NULL,
content TEXT (650000) NOT NULL,
create_at DATETIME NOT NULL,
PRIMARY KEY (id)
)
CREATE TABLE category (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
slug VARCHAR (255) NOT NULL,... | true |
03226504dc40113000de76222765f216869f0c9c | SQL | loreleivillatte/UML_project_6 | /sql/create_db.sql | UTF-8 | 7,960 | 3.703125 | 4 | [] | no_license |
CREATE SEQUENCE public.status_id_seq;
CREATE TABLE public.status (
id INTEGER NOT NULL DEFAULT nextval('public.status_id_seq'),
title VARCHAR(20) NOT NULL,
CONSTRAINT status_pk PRIMARY KEY (id)
);
ALTER SEQUENCE public.status_id_seq OWNED BY public.status.id;
CREATE ... | true |
5092958622a3401a5c34a4d7279e47c63445d848 | SQL | rodrigolosik/desafio-perfil-investimento | /PerfilInvestidor/PerfilInvestidor.sql | UTF-8 | 986 | 3.234375 | 3 | [] | no_license | CREATE DATABASE PerfilInvestidor;
use PerfilInvestidor;
CREATE TABLE Usuarios (
Id INT IDENTITY PRIMARY KEY,
Nome VARCHAR(255) not null,
Email VARCHAR(255) not null,
Senha VARCHAR(255) not null,
TipoPerfil INT null
);
CREATE TABLE UsuariosRespostas (
Id INT IDENTITY PRIMARY KEY NOT NULL,
UsuarioId INT NOT NU... | true |
2d4e9ac0fd9efd6332afff084cb71cffa25a08df | SQL | emmelinetsen/Databases-ECS165 | /165a/hw2/p2q10.sql | UTF-8 | 160 | 3.125 | 3 | [] | no_license | select cityId
from CITY
where pop is not null
except
select C1.cityId
from CITY C1, CITY C2
where C1.pop < C2.pop
and C1.pop is not null
and C2.pop is not null
| true |
811698214a4590f244da7ca6a563a5df1b02669f | SQL | fowler013/iambham-final-project | /server/src/config/SQL/SQL TABS/stored-procedures/favorites.sql | UTF-8 | 2,500 | 4.1875 | 4 | [] | no_license | -- -- procedures for User Favorites TABLE
-- Get all Favorites
drop procedure if exists spGetAllFavorites;
delimiter $$
CREATE PROCEDURE spGetAllFavorites()
BEGIN
SELECT *
FROM UserFavorites;
END $$
delimiter ;
-- GET FAVORITE
drop procedure if exists spGetFavorite;
delimiter $$
CREATE PROCEDURE spGetFavorite(in p... | true |
6b29df5697fa2caba0de68020379343f5f548991 | SQL | jmxcg/AAA | /Doc/MySqlDDL.sql | UTF-8 | 8,144 | 3.921875 | 4 | [] | no_license | /**001 PLAT_USER(用户)*/
DROP TABLE IF EXISTS plat_user;
CREATE TABLE plat_user (
id varchar(36) NOT NULL COMMENT 'uuid(用户id)',
loginName varchar(15) NOT NULL COMMENT '登录账号',
userName varchar(100) NOT NULL COMMENT '登录账号',
password varchar(30) DEFAULT NULL,
mailAdress varcha... | true |
1ccb050d1a0bbdced497ee1574192ba112f91862 | SQL | Saynoz/Java | /SQL/Avions.sql | UTF-8 | 2,760 | 3.21875 | 3 | [] | no_license |
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 18, 2018 at 11:14 AM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 5.2.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_C... | true |
99c897852e464793bac1fe24f5a2bcafc3aa644f | SQL | grzesko38/NotesManager | /src/main/webapp/WEB-INF/sql_scripts/sample_data.sql | UTF-8 | 3,348 | 2.671875 | 3 | [] | no_license | INSERT INTO USERS
(
id, nick, email, date_registered, password_hash, password_encoding, password_salt, enabled, user_type
)
VALUES
(
1, 'Adam', 'adam.arczynski@gmail.com', '1990-01-01 00:00:00', '0264abd1fc2a47a9d938201ae4429594882fb9887c8b7b3e8041c9784f8ac85c', 'sha-256', 'cfd6a7346064d78b38d9a5a2f19f2963', 1, 'Regi... | true |
3731644817c2abce17e7c8b36858453c96ef072f | SQL | Dong-Jun-Shin/Study_Oracle_SQL_19_09 | /Oracle SQL/SCOTTUSER Query/SCOTTUSER(19.09.16).sql | UTF-8 | 3,241 | 4.28125 | 4 | [] | no_license | SELECT 4+3 FROM DEPT;
-- 테이블 구조 확인시 DESC
-- dual은 시스템에 존재하는 dummy라는 값이 한자리 들어가는 기본 테이블이다. --임시 테이블
DESC dual;
DESC dept;
SELECT * FROM DUAL;
SELECT INITCAP('DATA BASE PROGRAM') FROM dual;
SELECT CONCAT('Data', 'Base') FROM dual;
SELECT 'Data' || 'Base' FROM dual;
SELECT LENGTH('DataBase'), LENGTH('데이터베이스') FROM dual;... | true |
86141f58cf1f81a93b808517346e7ae46875d650 | SQL | Denvise/Rakna | /Valnut (2).sql | UTF-8 | 1,843 | 3.1875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Client : localhost
-- Généré le : Mer 03 Mai 2017 à 21:50
-- Version du serveur : 5.7.17
-- Version de PHP : 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET... | true |
277c0a16510082070e0f22599572c9485e19cb07 | SQL | usdigitalresponse/data-act-broker-backend | /dataactvalidator/config/sqlrules/fabs2_detached_award_financial_assistance_2_1.sql | UTF-8 | 845 | 3.875 | 4 | [
"CC0-1.0"
] | permissive | -- The combination of FAIN, AwardModificationAmendmentNumber, URI, CFDA_Number, and AwardingSubTierAgencyCode must be
-- unique from currently published ones unless the record is a correction or deletion, if
-- CorrectionDeleteIndicator = C or D.
SELECT
dafa.row_number,
dafa.fain,
dafa.award_modification_am... | true |
2b073ddf05209acf5b80b04b262fe7e5adff5371 | SQL | mrgrayhat/Khodkar-Platform | /KS.WebSiteUI/SourceCode/Codes/Databasce/SqlServer/khodkar/c605ceb2289b419e9695262f68b0cfa6/authorizeviewsourcecodeofmasterdatakeyvalues.sql | UTF-8 | 1,546 | 3.578125 | 4 | [] | no_license | -- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
alter PROCEDURE [Security].[AuthorizeViewSourceCodeOfMasterDataKeyValues]
(
@permissionTypeId int,
@TypeId int,
@ActionKey int,
@... | true |
4a1a4f4d86c9eb452c7aee13c59ebb8bcd77c3ed | SQL | welis/carreg-sob-demanda | /bd-comment-video.sql | UTF-8 | 1,640 | 3.015625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: 21-Set-2020 às 19:37
-- Versão do servidor: 5.7.26
-- versão do PHP: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
bee22132e13d85129e0049aaf325ef19a05e23ce | SQL | ser6440/java | /Day0501_Database/sqlBasic4.sql | UTF-8 | 3,818 | 4.46875 | 4 | [] | no_license | 서브쿼리
쿼리문 안에 다른 쿼리문이 존재
스미스씨와 같은 부서에서 일하는 모든 직원을 조회
1. 스미스씨가 어떤 부서에서 일하는지 알아야 한다.
select deptno
from emp
where ename = 'SMITH'; ->쿼리
단일행 서브쿼리
select ename
from emp
where deptno = (select deptno
from emp
where ename = 'SMITH'); ->서브쿼리(쿼리문안에 다른 쿼리가 들어간다)
복수행 서브쿼리
select deptno
from emp
where job = 'CLERK';
업무가 C... | true |
e08a66f48e52da2c30f36bb53f49134255e5f99f | SQL | danleyb2/Bursar | /assets/bursar.sql | UTF-8 | 4,947 | 3.515625 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 26, 2015 at 03:34 PM
-- Server version: 5.1.72-community
-- PHP Version: 5.6.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_C... | true |
a0ae5c16bf55e04e9821ff787ffdcb9a8ce5eef4 | SQL | milon120203/cseku_wpl_2017_survey_feedback_system | /config/sql/cseku_wpl_2017_education.sql | UTF-8 | 49,696 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 18, 2017 at 05:45 AM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
85e3b32b36099fb34a3a8a799a646725507f8bd5 | SQL | Sachini009/JavaFils | /SQLQuery5_BETWEEN_operator.sql | UTF-8 | 312 | 3.421875 | 3 | [] | no_license | --//Between SQL
--//Table->Number(pk),item,date(varchar)
--// Print 1 and 3 items also
SELECT *
FROM Table_1
WHERE Number BETWEEN 1 AND 3;
SELECT *
FROM Table_1
WHERE Number NOT BETWEEN 1 AND 3;
SELECT *
FROM Table_1;
select count(Number)
from Table_1
where mydate between '06-10-2020' and '06-10-2020';
| true |
3972c7a66be959609894cb019d43775056d3d746 | SQL | SkillsFundingAgency/DC-Alpha-EasyWrapperPaaS | /XMLLoader/Assets/Loader/Scripts/GetSourceFilesSQL_SFA_ILR_2017_18.sql | UTF-8 | 363 | 2.75 | 3 | [
"MIT"
] | permissive | select cast(
(
select
(
select
[SourceFileName]
,cast([FilePreparationDate] as date) as FilePreparationDate
,[SoftwareSupplier]
,[SoftwarePackage]
,[Release]
,[SerialNo]
,[DateTime]
from
SourceFile
for xml auto,
type,
elements
)
for xml path('SourceFiles')... | true |
25b2eb0c5fe3debcf5327249bf5a99f775119313 | SQL | CodeupClassroom/easley-database-exercises | /temp_tables_exercies.sql | UTF-8 | 1,164 | 4.34375 | 4 | [] | no_license | use ryan;
-- Historic average and standard deviation b/c the problem says "use historic average"
-- 63,810 historic average salary
-- 16,904 historic standard deviation
create temporary table historic_aggregates as (
select avg(salary) as avg_salary, std(salary) as std_salary
from employees.salaries
);
create temp... | true |
e828d2a518d069d3719d1fc7437d06f9a489ddb5 | SQL | 06-paulx/Amenities | /db/schema.sql | UTF-8 | 259 | 2.609375 | 3 | [] | no_license | DROP DATABASE IF EXISTS Amenities;
CREATE DATABASE Amenities;
USE Amenities;
CREATE TABLE Amenities (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
amenity VARCHAR(4000) NOT NULL,
amenity_type VARCHAR(255),
listing INT,
amenity_url VARCHAR(500)
); | true |
b7fc282b434703985ef49b455e14f6a74a92a160 | SQL | aesyungan/usserappBackend | /db/sqldb.sql | UTF-8 | 597 | 3.125 | 3 | [] | no_license | --data base tables examples
create table users(
id bigint(20) primary key auto_increment,
first_name varchar(255) null,
second_name varchar(255) null,
username varchar(255) null,
phone varchar(255) null,
address varchar(255) null
)
create table notices(
id bigint(20) primary key auto_... | true |
84febef38280182ea6fa10e80e2004b185b27e42 | SQL | srinivasiyerb/webportal | /bin/jcatalog_ddl.sql | UTF-8 | 977 | 4.0625 | 4 | [] | no_license | CREATE DATABASE catalog;
USE catalog;
CREATE TABLE IF NOT EXISTS category (
id int(10) primary key auto_increment,
name varchar(50) not null,
description varchar(255));
CREATE TABLE IF NOT EXISTS product (
id varchar(20) primary key,
name varchar(50) not null,
price decimal(8, 2),
width decimal(8, 2),
... | true |
04f4c53807acb8a82238f7e2cab625ab16494e5f | SQL | vaflia/oracle_scripts | /разбор полетов с объемами пересчет/olap и статистика вместе один лицевой.sql | WINDOWS-1251 | 1,264 | 3.140625 | 3 | [] | no_license | --
select t.lsk as lsk,
u.usl,
sum(t.volume) vl
from prep.info_usl_lsk t, scott.s_reu_trest r, scott.usl u, scott.sprorg o, scott.spul ul
where t.reu= r.reu
and t.usl= u.usl and t.org= o.kod an... | true |
f4b032f5190bf87022adf8e16edaca895c68153d | SQL | monpdev/webDevCA | /SQL/sqlCal.sql | UTF-8 | 993 | 3.984375 | 4 | [] | no_license | -- Performing SQL Calculations. Part of Codecademy/Web dev track.
SELECT COUNT(*)
FROM fake_apps
WHERE price = 0;
--SUM-Add all values in a particular column
SELECT SUM(downloads)
FROM fake_apps;
SELECT MIN(downloads)
FROM fake_apps;
--Min and max
--SELECT MIN(downloads)
--FROM fake_apps;
SELECT MAX(price)
FR... | true |
95558cc72e8d6d8d27c7cef45a9198c492fd7d1f | SQL | tayduivn/training | /rdbms/update/.svn/text-base/sacwis_770.sql.svn-base | UTF-8 | 5,559 | 2.59375 | 3 | [] | no_license | --STGAP00015825 - Release(3.5) CAPTA DBCR for Admin Review Page
--Please see the attachment for the DBCR. Make sure the message didn't get chopped in to two different lines.
INSERT INTO CAPS.MESSAGE ( NBR_MESSAGE, TXT_MESSAGE_NAME,TXT_MESSAGE,
CD_SOURCE, CD_PRESENTATION, IND_BATCH)
VA... | true |
a47c0f68567e40264b252114e5c73f1098b9ba30 | SQL | tjordanwells/rh-paint-store | /db_scripts/ColorLibVendor.sql | UTF-8 | 5,298 | 2.515625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 14, 2019 at 03:15 PM
-- Server version: 5.7.25-0ubuntu0.18.04.2
-- PHP Version: 7.2.10-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
338bad2bd57726d2ff2b9b66831dd29b062f39d0 | SQL | oshod10/postscript_db | /POST_DB_SCRIPT.sql | UTF-8 | 14,571 | 2.53125 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE FOUNDATION.SP_POST_DB_SCRIPT (iDB IN VARCHAR2 :=null, iDM01 IN VARCHAR2 := null, iDM02 IN VARCHAR2 := null,
iDM03 IN VARCHAR2 := null,
iDM04 IN VARCHAR2 := null,
iOC01 IN VARCHAR2 := null,
iOC02 IN VARCHAR2 := null,
iOC03 IN VARCHAR2 := null,
iOC04 IN VARCHAR2 := null,... | true |
d7481d0b346c2f819d25ac0196ec1f852f002cd1 | SQL | lejarx/Oracle-PLSQL | /source_code/chapter 8/listings/listing8_6.sql | UTF-8 | 175 | 2.890625 | 3 | [] | no_license | select fk_department, last_name, first_name
from employee
where fk_department in (select fk_department from employee
where last_name = 'ROOSEVELT'); | true |
5164104df754609dad4fc60be1ec7ca4e8201432 | SQL | cjporteo/sql-zoo-solns | /4 - SELECT in SELECT/q6.sql | UTF-8 | 89 | 2.78125 | 3 | [
"Unlicense"
] | permissive | SELECT name
FROM world
WHERE gdp > (SELECT MAX(gdp) FROM world WHERE continent='Europe')
| true |
9bc89ca3876cc308a6149abca72fa1da27125413 | SQL | lift-house-design/lifthousedev | /_riskpix/dev/iuw.sql | UTF-8 | 8,153 | 3.109375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.5.35, for debian-linux-gnu (i686)
--
-- Host: localhost Database: iuw
-- ------------------------------------------------------
-- Server version 5.5.35-0ubuntu0.13.10.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACT... | true |
bcb7079a04a0e89223ab598c978236bd33c7dd36 | SQL | yanshengjia/algorithm | /leetcode/SQL/1393. Capital Gain:Loss.sql | UTF-8 | 3,086 | 4.6875 | 5 | [
"MIT"
] | permissive | """
+---------------+---------+
| Column Name | Type |
+---------------+---------+
| stock_name | varchar |
| operation | enum |
| operation_day | int |
| price | int |
+---------------+---------+
(stock_name, day) is the primary key for this table.
The operation column is an ENUM of type... | true |
4e827e363c5aff20d435833abaeb8a22d686bcb6 | SQL | jsonlog/sqlserver | /12/8/SQLQuery.sql | UTF-8 | 282 | 2.984375 | 3 | [] | no_license | ALTER TRIGGER connection_limit_trigger
ON ALL SERVER WITH EXECUTE AS 'nxt'
FOR LOGON
AS
BEGIN
IF ORIGINAL_LOGIN()= 'nxt' AND
(SELECT COUNT(*) FROM sys.dm_exec_sessions
WHERE is_user_process = 1 AND
original_login_name = 'nxt') > 3
ROLLBACK;
END;
| true |
d3ed39eac747480c5790109f12cb2b366d8f91ab | SQL | skmuddamsetty/JAVASCRIPT-DATA-STRUCTURES-AND-ALGORITHMS | /LeetCode/Google/613. Shortest Distance in a Line.sql | UTF-8 | 1,653 | 4.375 | 4 | [
"MIT"
] | permissive | Table point holds the x coordinate of some points on x-axis in a plane, which are all integers.
Write a query to find the shortest distance between two points in these points.
| x |
|-----|
| -1 |
| 0 |
| 2 |
The shortest distance is '1' obviously, which is from point '-1' to '0'. So the output is as b... | true |
58f99ae35dd40d02c643cfae176efc3a1edb1b3b | SQL | ssk1002/Basic-Image-Gallery-Web-App | /Filled Image Gallery SQL.sql | UTF-8 | 2,397 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Feb 16, 2017 at 05:14 AM
-- Server version: 5.6.28
-- PHP Version: 7.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `image-gallery`
--
-- --------------------------... | true |
563f32ef8fff37dbdeb15e97486be505b9772bb9 | SQL | rashika057/Wendy-sBell | /dborder.sql | UTF-8 | 13,175 | 2.65625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 15, 2017 at 09:19 AM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
40ab29ed2a3d15b33be7728f080944a1761d1a70 | SQL | adelabuhashim/Udacity-Data-Analyst-Nanodegree | /P1. Exploring Weather Trends/query.sql | UTF-8 | 252 | 3.015625 | 3 | [] | no_license | SELECT city_data.year, city_data.avg_temp AS city_data,
global_data.avg_temp AS global_data
FROM city_data
JOIN global_data
ON city_data.year = global_data.year
WHERE city_data.city = 'Cairo'
ORDER BY 1;
| true |
b6fd9ba125e4474db4f9d89373709b3e26b66212 | SQL | ahdahddl/cytoscape | /cellcircuits/branches/new-pubs/db/sql/create_gene_model.sql | UTF-8 | 309 | 3.0625 | 3 | [] | no_license | DROP TABLE IF EXISTS gene_model;
CREATE TABLE gene_model (
id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
model_id int,
gene_product_id int,
UNIQUE INDEX gm0 (id,model_id,gene_product_id),
UNIQUE INDEX gm1 (model_id,gene_product_id),
INDEX gm2 (gene_product_id)
);
| true |
7054cc97ea73ecd907718488407b635c5e2886cf | SQL | drkthunder02/w4rpservices | /database/seeds/ItemComposition.sql | UTF-8 | 8,592 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 06, 2018 at 10:07 PM
-- Server version: 10.2.18-MariaDB-10.2.18+maria~xenial
-- PHP Version: 7.1.22-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+... | true |
d721cda396c0cc82c9da6c95a384012bc681e1e4 | SQL | irkallacz/reservation | /migrations/dummy-data/2019-03-27-105152-tests.sql | UTF-8 | 3,645 | 2.671875 | 3 | [] | no_license | -- Adminer 4.2.4 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
TRUNCATE `visits`;
TRUNCATE `groups_x_persons`;
TRUNCATE `persons`;
TRUNCATE `groups`;
TRUNCATE `admins`;
INSERT INTO `admins` (`id`, `name`, `surname`, `mail`, `password`, `date_... | true |
6f708f4cec86dbcf1f02b8d5dbbf43b518095346 | SQL | gchq/stroom | /stroom-legacy/stroom-legacy-db-migration/src/main/resources/stroom/legacy/db/migration/V5_0_0_5__Analytic_Output.sql | UTF-8 | 1,254 | 3.09375 | 3 | [
"LicenseRef-scancode-proprietary-license",
"Apache-2.0",
"CDDL-1.0",
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"MPL-1.0",
"CC-BY-4.0",
"LicenseRef-scancode-public-domain",
"EPL-1.0"
] | permissive | /*
* Copyright 2016 Crown Copyright
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... | true |
ec7543cace7e62f5f8924d26411858d7a59e5379 | SQL | SusanDarvishi/FilmProject | /sql/Films.sql | UTF-8 | 265 | 2.984375 | 3 | [] | no_license | CREATE TABLE `Films` (
`film_id` int(11) NOT NULL AUTOINCREMENT,
`filmname` varchar(45) NOT NULL,
PRIMARY KEY (`film_id`,`filmname`),
UNIQUE KEY `film_id_UNIQUE` (`film_id`),
UNIQUE KEY `filmname_UNIQUE` (`filmname`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 | true |
cf62445f403c45ed87f0366b1a38135b8af6ba64 | SQL | mafe-rnanda/BootcampX | /2_queries_joins/2_total_time_spent_on_assignments_by_cohort.sql | UTF-8 | 317 | 3.875 | 4 | [] | no_license | -- Get the total amount of time that all students from a specific cohort have spent on all assignments.
SELECT sum(assignment_submissions.duration) as total_duration
FROM students
JOIN cohorts
ON students.cohort_id = cohorts.id
JOIN assignment_submissions
ON students.id = student_id
WHERE cohorts.name = 'FEB12'; | true |
d77eee95263b08a5e7d4df512fe28b589018438d | SQL | naowal/Privileges_Tree_View_Checkbox | /id7540069_rolemanager.sql | UTF-8 | 8,021 | 3.015625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Oct 21, 2018 at 08:38 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.0.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
59f9c4768f5e76c1bc4a85bfa3d899f32dbd961d | SQL | TheGhostGroup/DynastyCore | /sql/updates/archive/old/world/2015/06/2015_06_20_world_ashran_captains.sql | UTF-8 | 22,702 | 2.5625 | 3 | [] | no_license | SET NAMES utf8;
DELETE FROM creature_text WHERE entry IN (80499, 80484, 79902, 80498, 80488, 85129, 80495, 85140, 85137, 80497, 80490, 80493, 80492, 80491, 79900, 80489, 80486, 80496, 87690, 85138, 88109);
INSERT INTO creature_text VALUES
(80499, 0, 0, 'To the face!', 14, 0, 100, 0, 0, 0, 'AvengerTurleySlay1'),
(80499... | true |
4b489ad132692a396a829e8791a44a50408a3d16 | SQL | monica-li205/meowtivate | /back-end/db/schema/08_user_pots.sql | UTF-8 | 251 | 2.78125 | 3 | [] | no_license | DROP TABLE IF EXISTS user_pots CASCADE;
CREATE TABLE user_pots (
id SERIAL PRIMARY KEY NOT NULL,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
pot_id INTEGER REFERENCES pots(id) ON DELETE CASCADE,
is_default BOOLEAN default FALSE
); | true |
31017509bab1f66bc6fc8c244927bdc4cbbbc1f4 | SQL | Gor-Solomon/ArtificialConsciousness | /AC.Database/attributes/Tabels/AttributeDescription.sql | UTF-8 | 223 | 2.640625 | 3 | [] | no_license | CREATE TABLE [attributes].[AttributeDescription] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (50) NULL unique,
[Description] NVARCHAR(150) NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
| true |
3911d85c7b201bd858dac52be1b13cd5fc5bbc1e | SQL | GilSolis/corona-virus-tracker | /db/seeds.sql | UTF-8 | 671 | 3.625 | 4 | [
"MIT"
] | permissive | DROP database IF EXISTS businessBD;
CREATE DATABASE businessBD;
-- USE businessBD;
-- create table categories
-- (
-- id int NOT NULL AUTO_INCREMENT,
-- name varchar (100) NOT NULL,
-- PRIMARY KEY(id)
-- );
-- create table places
-- (
-- id int AUTO_INCREMENT NOT NULL,
-- name varchar(255) NO... | true |
87ebdc629051ae3c5b8155dab4a5503acdb26503 | SQL | cuba-platform/saml-addon | /modules/core/db/update/mysql/18/201118-addIdpMetadataFile.sql | UTF-8 | 338 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | alter table SAMLADDON_SAML_CONNECTION add column IDP_METADATA_ID varchar(32);
alter table SAMLADDON_SAML_CONNECTION add constraint FK_SAMLADDON_SAML_CONNECTION_ON_IDP_METADATA foreign key (IDP_METADATA_ID) references SYS_FILE(ID);
create index IDX_SAMLADDON_SAML_CONNECTION_ON_IDP_METADATA on SAMLADDON_SAML_CONNECTION ... | true |
7770718c9036065af0e2400b5eeec02be2fa4e7f | SQL | Sefhia/zf3-album | /database/seecbr_cosmic.sql | UTF-8 | 1,567 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 26 Jan 2017 pada 15.55
-- Versi Server: 10.1.19-MariaDB
-- PHP Version: 7.0.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... | true |
330227df7d6202f18068d2a790ea4cccc94f0fea | SQL | Facter/ProyectoManhattan | /Base de datos/Dump20140621-1/blog_usuarios.sql | UTF-8 | 2,628 | 3.046875 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `blog` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci */;
USE `blog`;
-- MySQL dump 10.13 Distrib 5.6.13, for Win32 (x86)
--
-- Host: 127.0.0.1 Database: blog
-- ------------------------------------------------------
-- Server version 5.6.14
/*!40101 SET @OLD_CHARACTER_S... | true |
ca24172ca5c923ad6802553bd79c7b28cf77d4e7 | SQL | apnicjim/whowas-service | /test/ripe-database/sql/00-create-schema.sql | UTF-8 | 1,222 | 3.109375 | 3 | [
"BSD-3-Clause"
] | permissive |
CREATE DATABASE IF NOT EXISTS whowas_test;
CREATE TABLE IF NOT EXISTS whowas_test.last (
object_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
sequence_id INT(10) UNSIGNED NOT NULL,
timestamp INT(10) UNSIGNED NOT NULL,
object_type TINYINT(3) UNSIGNED NOT NULL,
obj... | true |
7b9b20a5999d5bcaeb0f0a69857c4cea8da2b561 | SQL | sergiojaviermoyano/sideli | /database/tablas agente y banco.sql | WINDOWS-1250 | 1,904 | 3.25 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : localhost_root
Source Server Version : 50528
Source Host : localhost:3306
Source Database : sideli
Target Server Type : MYSQL
Target Server Version : 50528
File Encoding : 65001
Date: 2017-07-19 12:21:03
*/
SET FOREIGN_KEY_CHECKS=0;
-... | true |
6339ffad055969f71d8b511d7103f9865ab8ffc4 | SQL | emilismailli/Stock-Solution | /AzStock/MHM.Accountancy.Database/Accounting/Procedures/spCustomerContract.sql | UTF-8 | 4,600 | 3.640625 | 4 | [] | no_license | CREATE PROCEDURE [Accounting].[spCustomerContract]
@userId int,
@operationType tinyint,
@id int=null,
@customerName NVARCHAR(200) =NULL,
@customerLeader NVARCHAR(200) =NULL,
@workTypeId INT =NULL,
@voen NVARCHAR(50) =NULL,
@currencyId INT =NULL,
@bankId INT =NULL,
@bankSwift NVARCHAR(200) =NULL,
@regionId int =... | true |
08155c2110fda6178bff76cbafeb762b906dcc45 | SQL | gvamshi15/GVK-GIT | /connectgroup-old/src/main/resources/OrderInMemSchema.sql | UTF-8 | 321 | 2.703125 | 3 | [] | no_license | -- DROP SEQUENCE ORD_SEQ;
-- DROP TABLE ORDER_MEM;
-- CREATE SEQUENCE ORD_SEQ AS INTEGER START WITH 1001 INCREMENT BY 1;
CREATE TABLE ORDER_MEM (ID INTEGER NOT NULL PRIMARY KEY, DOB DATE, NAME VARCHAR(40), PHONE BIGINT, ADDRESS1 VARCHAR(80), CITY VARCHAR(30),PINCODE VARCHAR(6), PRODUCT VARCHAR(100), QUANTITY INTEGER);
... | true |
ff83cc4f318988498589b95157ff8ac5ae114d23 | SQL | haizhou85/sites-java | /src/main/resources/schema.sql | UTF-8 | 446 | 3.03125 | 3 | [] | no_license | CREATE TABLE sites (
id INT NOT NULL,
name VARCHAR(50) NOT NULL,
address VARCHAR(50) NOT NULL,
city VARCHAR(20) NOT NULL,
state VARCHAR(20) NOT NULL,
zipcode VARCHAR(20) NOT NULL
);
CREATE TABLE site_uses (
id INT NOT NULL,
description VARCHAR(50) NOT NULL,
site_id INT NOT NULL,
size_sqft... | true |
a61df85724c8eeba251550fe9094b63e06272be6 | SQL | sregnard42/piscine_php-rush00 | /admin/miniboutique.sql | UTF-8 | 7,765 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 31, 2019 at 08:39 AM
-- Server version: 5.6.43
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
fedddfa6303bf56f93ffa67da3d5183595eedea9 | SQL | MartnAR/SyracuseUniversityProjects | /IST659 Project/Project Data Exploration - 1.sql | UTF-8 | 656 | 3.765625 | 4 | [] | no_license | /*We want to know how many pitches, grouped by pitch type, did Jose Urena throw in the first inning against the Cubs and
what his average velocity, release point, and movement was. */
-- Let's first check how many pitches he threw
SELECT playerID, concat(first_name, ' ', last_name) as player_name, TeamID, inning, C... | true |
bc72ad205e667020608a02f5a0c61492a2d82176 | SQL | Piyushmahatkar/OnlineProductReviewSystem | /product_review.sql | UTF-8 | 4,784 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.15.5
-- http://www.phpmyadmin.net
--
-- Host: localhost:3307
-- Generation Time: Apr 21, 2018 at 10:18 PM
-- Server version: 5.5.49-log
-- 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_... | true |
8efd052ed86d6b708f402c04bfa0fbd73f6ebc70 | SQL | randallhelms/data_warehousing | /1_database_management_essentials/week 3/summarization_and_joins_1_example.SQL | UTF-8 | 356 | 3.859375 | 4 | [] | no_license | --List number of students enrolled in each 2013 course offering, showing the offer number and number of students in the result
Select Offering.OfferNo,
Count (*) AS NumStudents
FROM Enrollment, Offering
WHERE Offering.OfferNo = Enrollment.OfferNo
AND OffYear = 2013
GROUP BY Offering.OfferNo; --need to qual... | true |
36d0d7128d0736112ca8593faa4c4e43e343c4a9 | SQL | azevedoluan/Python-and-Shell-Scripts | /Scripts/Rotinas/Gerar delta cargas SAP/Controle_materiais.sql | UTF-8 | 271 | 2.625 | 3 | [] | no_license | --TRIGGER CONTROLA ULTIMA DATA DE INSERT/UPDATE DO MATERIAL
CREATE OR REPLACE TRIGGER MM_SAP_IU_TR
BEFORE INSERT OR UPDATE ON STAGING_MATERIAL FOR EACH ROW
BEGIN
--ATUALIZA DATA DE INSERT/UPDATE
:NEW.STATUS_5 := TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS');
END;
/ | true |
ae90f9b632184c403aad5c177e6faa11211d0829 | SQL | dba-kosova/OracleScripts | /work/ia.sql | UTF-8 | 692 | 2.984375 | 3 | [] | no_license | declare
Cursor ExCur is
select 'alter index '||index_name||
' modify partition '||partition_name||' logging' stm
from user_ind_partitions where logging !='YES'
union all
select 'alter table '||table_name||
' modify partition '||partition_name||' logging' stm
from user_tab_partitions where logging !='YES';
ExRec ExCur%r... | true |
d79c8376a4f7942d979dea883a2ef4f1daa85e27 | SQL | OlafMd/MedCon1.0 | /mmdocconnect-core/MMDocConnectDBMethods/Case/Atomic/Retrieval/SQL/cls_Get_Case_Order_Status_for_CaseID.sql | UTF-8 | 2,803 | 3.109375 | 3 | [] | no_license |
Select
ord_prc_procurementorder_statuses.Status_Code as order_status
From
hec_cas_case_relevantperformedactions Inner Join
hec_act_plannedactions
On hec_cas_case_relevantperformedactions.PerformedAction_RefID = hec_act_plannedactions.IfPlannedFollowup_PreviousAction_RefID And
... | true |
f62a4b0f4c183c1da036cc0235473c72a036c468 | SQL | psmukherjee009/OrderDude | /DB_Tables/MSG_Board.sql | UTF-8 | 1,472 | 2.703125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 15, 2013 at 12:58 PM
-- Server version: 5.1.70-cll
-- PHP Version: 5.3.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
941c6f6d74c85ed7a95a8069657269d877d1d128 | SQL | yuji-oka/gs_kadai | /0622課題/gs_user_table.sql | UTF-8 | 2,310 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2017 年 6 月 22 日 13:17
-- サーバのバージョン: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101... | true |
370dde9a44f6834740b7be1dd3cd3baa2f13f3dd | SQL | scottmcdonald1/java-web-dev-techjobs-persistent | /queries.sql | UTF-8 | 758 | 4.25 | 4 | [] | no_license | ## Part 1: Test it with SQL
SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'job';
id int (primary key), employer_name VARCHAR, employer_id int,
## Part 2: Test it with SQL
SELECT name FROM employer WHERE location="St. Louis"; -- NOTE: only able to do this from the employer table at th... | true |
1d7d2291e63b613a72c60335dc864cc9699928bb | SQL | KStomberg/SimplePacenotes-solo-project | /database.sql | UTF-8 | 1,072 | 3.59375 | 4 | [] | no_license |
-- USER is a reserved keyword with Postgres
-- You must use double quotes in every query that user is in:
-- ex. SELECT * FROM "user";
-- Otherwise you will have errors!;
CREATE TABLE "user" (
"id" SERIAL PRIMARY KEY,
"username" VARCHAR (80) UNIQUE NOT NULL,
"password" VARCHAR (1000) NOT NULL
);
CREATE T... | true |
bc333082e9b54f7286d8b6af79478978c8500fe3 | SQL | y2sud/Python_Login | /DDL/ddl_create_user.sql | UTF-8 | 346 | 2.703125 | 3 | [] | no_license | CREATE TABLE `user` (
`email_id` varchar(30) NOT NULL,
`username` varchar(15) NOT NULL,
`password` varchar(64) NOT NULL,
`fullname` varchar(45) NOT NULL,
PRIMARY KEY (`username`),
UNIQUE KEY `email_id_UNIQUE` (`email_id`),
UNIQUE KEY `user_id_UNIQUE` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 CO... | true |
f6c9a3e0d011af1b5b1a9f19342e0e91fc503d2f | SQL | MikeRena77/sdlw | /SQL/legacyHarvestSQL/User Contact.sql | UTF-8 | 3,162 | 2.96875 | 3 | [] | no_license | WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
SPOOL &1
DECLARE
tobjid NUMBER;
aobjid NUMBER;
BEGIN
SELECT MAX(formtypeobjid) INTO tobjid
FROM harFormType;
tobjid := tobjid + 1;
INSERT INTO harFormType(formtypeobjid, formtablename, formtypename)
VALUES(tobjid, 'harUserContact', 'User Contact');
... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.