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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0953affada803be4aa72426adb344921f4d7197a | SQL | tsaxena/MySQL-Coursera | /social_network_modification.sql | UTF-8 | 992 | 3.953125 | 4 | [] | no_license | SQL Social-Network Modification Exercises
-- Question 1
-- It's time for the seniors to graduate. Remove all 12th graders from Highschooler.
DELETE FROM Highschooler
WHERE grade = 12
-- Question 2
-- If two students A and B are friends, and A likes B but not vice-versa, remove the Likes tuple.
DELETE FROM likes
... | true |
08428b8fa51d702be5b008e78dd9184c354f4357 | SQL | JpMurcia/Jp_asig_2019-S2 | /CSI/SIGEPI_CSI/Construccion/Models/BD/BDchaira-11-02.sql | UTF-8 | 21,993 | 3.203125 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.21-log - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 10.3.0.5771
-- -------------------------------------------------------... | true |
7ed0b1b120c0066d08823df1576e9a8e4cd975f8 | SQL | jinlin82/database-and-sql | /LJX/1_questions.sql | UTF-8 | 4,301 | 4.5625 | 5 | [] | no_license | -- LINK: The_computer_store
-- 1.1 Select the names of all the products in the store.
Select name from Products;
-- 1.2 Select the names and the prices of all the products in the store.
Select name,price from Products;
-- 1.3 Select the name of the products with a price less than or equal to $200.
Select name,price fro... | true |
18dd24503823a8b3f885d9a532fe0c5a7b5fae87 | SQL | luiscarlosjunior/aulas-graduacao | /banco-dados/linguagem-procedure/plsql-oracle/02-conceito-plsql/Aula 08/Exemplos/Exemplo 2 GOTO.sql | UTF-8 | 342 | 2.6875 | 3 | [
"MIT"
] | permissive | -- example with GOTO statement
DECLARE
vNome aluno.nome%type;
vID NUMBER(3) := 1;
BEGIN
<<pegar_nome>>
SELECT nome
INTO vNome
FROM aluno
WHERE ID = vID;
DBMS_OUTPUT.PUT_LINE (vNome);
IF vNome != 'Emma' THEN
vID := vID + 1;
GOTO pegar_nome; -- branch to enclosing bl... | true |
ac35faa9db6b5f29f8f793d337a046397a936525 | SQL | Jahirul1404092/Electricity-Bill-Management-System | /electricity_bill_managment_system.sql | UTF-8 | 2,707 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 25, 2018 at 09:56 AM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
65729854f2d099480020fbe8b40790770893fca4 | SQL | javanumberone4bu4/secondhandmall | /src/main/resources/sql/schema.sql | UTF-8 | 4,957 | 3.5625 | 4 | [] | no_license | drop database if exists shtm;
create database shtm default character set utf8 collate utf8_general_ci;
use shtm;
drop table if exists shtm.sumclassify;
create table shtm.sumclassify(
sumclassify_id int not null auto_increment comment 'ID',
sumclassify_name varchar(50) default null comment '分类名',
sumclassify_click... | true |
7b1b315aee6782a90a3b097b8084b052c4ecb87a | SQL | VB6Hobbyst7/vault_repo | /MasterTract/server/src/schema/0042-doc_assignment_tract.sql | UTF-8 | 620 | 2.96875 | 3 | [] | no_license | create sequence DOC_ASSIGNMENT_TRACT_SQC;
create table DOC_ASSIGNMENT_TRACT(
ID int not null,
TRACT_ID int not null,
ASSIGNMENT_ID int not null
);
alter table DOC_ASSIGNMENT_TRACT
add constraint PK_DOC_ASSIGNMENT_TRACT primary key (ID);
alter table DOC_ASSIGN... | true |
9057181cbfe805edbddaad1bac8e80c5e7beb762 | SQL | jcarlosadm/tutorials | /sql/sql_useacabeca/08/11select.sql | UTF-8 | 147 | 2.796875 | 3 | [] | no_license | -- equijoin: testa a igualdade
USE headfirst_sql;
SELECT boys.boy, toys.toy
FROM boys
INNER JOIN
toys
ON boys.id_toys = toys.id_toy;
| true |
b3d8d5465524aeb9e62ba2b7c90b0a0440b0faa8 | SQL | scuseedman/spark | /spark-scala/pharmacist_licensed.sql | UTF-8 | 1,171 | 3 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : hadoop03
Source Server Version : 50173
Source Host : hadoop03:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50173
File Encoding : 65001
Date: 2018-04-09 15:14:53
*/
SET FOREIGN_KEY_CHECK... | true |
b97b04cd19a0a3ab5a5ab93bc82c7d0bd73069b4 | SQL | YuanyuWendyMu/EveryDaySQL | /Leetcode/1050. Actors and Directors Who Cooperated At Least Three Times.sql | UTF-8 | 162 | 3.46875 | 3 | [] | no_license | select actor_id, director_id
from(
select actor_id, director_id, count(1)as num_cop
from ActorDirector
group by actor_id, director_id
having num_cop >=3)tbl1 | true |
41755cf18f72c9c549fd249092d6c38be418d365 | SQL | sayuri10/clinic | /database/xyz.sql | UTF-8 | 4,821 | 2.890625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 30, 2020 at 04:51 AM
-- Server version: 5.7.17
-- PHP Version: 7.1.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTE... | true |
7d14e3e2f61984c576a7f28b9c5bf9e5d9db188c | SQL | robv/Douche-Crunch | /data/sql/lib.model.schema.sql | UTF-8 | 1,902 | 3.578125 | 4 | [] | no_license |
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
#-----------------------------------------------------------------------------
#-- douche
#-----------------------------------------------------------------------------
... | true |
79e0b9c62bbb98ea83025a964eccd6204699d4b7 | SQL | Dominik0608/flotta_nyilvantarto | /terran_proba.sql | UTF-8 | 2,798 | 3.28125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Gép: 127.0.0.1:3307
-- Létrehozás ideje: 2021. Aug 16. 16:15
-- Kiszolgáló verziója: 10.4.13-MariaDB
-- PHP verzió: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_... | true |
c536c7b96f3b02b72bac2c1a9ea7eba0fc133436 | SQL | destroyer78/openMIC | /Source/Data/SQLite/_openMIC.sql | UTF-8 | 2,440 | 3.96875 | 4 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | CREATE TABLE ConnectionProfile(
ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
Name VARCHAR(200) NOT NULL,
Description TEXT NULL,
CreatedOn DATETIME NOT NULL DEFAULT '',
CreatedBy VARCHAR(200) NOT NULL DEFAULT '',
UpdatedOn DATETIME NOT NULL DEFAULT '',
UpdatedBy VARCHAR(200) NOT NULL DEFAUL... | true |
0cc5c5d92ae1986344a00ab43e45e58d92f1f358 | SQL | codechaos87/snail | /src/main/java/m03/d29/xuchao/mysql/销售表.sql | UTF-8 | 603 | 4.125 | 4 | [] | no_license | #按月统计销售表中货物的销售数量 没有的用0表示。
SELECT no1,no2,
SUM(CASE MONTH(sadate) WHEN '9' THEN FORMAT(num,1) ELSE 0 END) AS 九月,
SUM(CASE MONTH(sadate) WHEN '10' THEN FORMAT(num,1) ELSE 0 END) AS 十月,
SUM(CASE MONTH(sadate) WHEN '11' THEN FORMAT(num,1) ELSE 0 END) AS 十一月,
SUM(CASE MONTH(sadate) WHEN '12' THEN FORMAT(num,1) ELSE... | true |
45c0567489e3c3bfb395292443c23eaa1cf97cde | SQL | victordesouza/projeto-integres | /victor/bkp_banco/categorias.sql | UTF-8 | 1,721 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4deb1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: 18-Jun-2017 às 14:08
-- Versão do servidor: 5.7.15-1
-- PHP Version: 5.6.26-1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_... | true |
69fea33e62280f16c6448f22c5d4e62c552838c3 | SQL | qw4n7y/highkick | /migrations/mysql/0004_add_logs_count_to_jobs.up.sql | UTF-8 | 171 | 3.3125 | 3 | [] | no_license | ALTER TABLE `jobs`
ADD COLUMN `logs_count` INT NOT NULL DEFAULT 0;
UPDATE `jobs` j SET
j.logs_count = (SELECT COUNT(jl.id) FROM `job_logs` jl WHERE jl.job_id = j.id); | true |
1c790f6b1a5097476636df33682e3756d4f15a7c | SQL | MindSparkTm/restapidemospring | /DatabaseScripts/bankaccount.sql | UTF-8 | 5,168 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 22, 2018 at 06:44 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 5.6.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
feef42094dcc5a2a9794e39ec7d7f02837bb46b5 | SQL | ReformSun/sql-demo | /testData.sql | UTF-8 | 1,830 | 3.640625 | 4 | [] | no_license |
-- 创建表
DROP TABLE IF EXISTS "public"."Persons";
CREATE TABLE "public"."Persons" (
"LastName" varchar(255),
"FirstName" varchar(255),
"Address" varchar(255),
"City" varchar(20)
);
-- 插入数据
INSERT INTO "public"."Persons" VALUES ('Adams', 'John', 'Oxford Street', 'London');
INSERT INTO "public"."Persons" VALUES ('Bush', '... | true |
931cf38027e148b67414d395f6aeef14da888df6 | SQL | wangmingquan/leet-code | /src/182.sql | UTF-8 | 164 | 3.421875 | 3 | [] | no_license | # Write your MySQL query statement below
Select distinct Email From Person Where Email In (select Email from Person group by Email having count(Email) > 1)
| true |
9aef142ac8c340daf7ddfd3b946dab14543bfab1 | SQL | johnpwood/data-warehousing | /mysql_mariaDB_dyer/birdwatchers_mysql_backup.sql | UTF-8 | 4,400 | 3.078125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
--
-- Host: localhost Database: birdwatchers
-- ------------------------------------------------------
-- Server version 5.7.20-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACT... | true |
3161008145f0cd5c6a741e11dcb7d913a16600ae | SQL | moutainhigh/foss | /stl/plsql/src/期末余额表需要调整的字段(6-9之后之二).sql | GB18030 | 2,812 | 3.296875 | 3 | [] | no_license | -- Create table
create table t_stl_balance_Detail_INIT_tmp
(
id VARCHAR2(50) not null,
source_bill_no VARCHAR2(50),
source_bill_type VARCHAR2(20),
check_out_org_code VARCHAR2(50),
stl_type VARCHAR2(20),
product_code VARCHAR2(20) not null,
customer_code VARCHAR2(5... | true |
028fd49bd099bd2ac5649247addcddf257d29a11 | SQL | RafaelUrdaneta13/ProyectoBD | /database/db.sql | UTF-8 | 734 | 3.453125 | 3 | [] | no_license | CREATE DATABASE database_proyect;
USE database_proyect;
CREATE TABLE Sede(
nombreFiscal INT(10) NOT NULL,
ubicacion VARCHAR(60) NOT NULL,
horario DATETIME(6) NOT NULL
);
ALTER TABLE Sede
ADD PRIMARY KEY (nombreFiscal);
ALTER TABLE Sede
MODIFY nombreFiscal INT(11) NOT NULL AUTO_INCREMENT, AUTO_I... | true |
9fbf1279ea12e82097479b9879dc2a80ef038a3d | SQL | tianlanlandelan/myBlog | /src/main/resources/templates/sql/CreateTable.sql | UTF-8 | 798 | 3.03125 | 3 | [] | no_license | create table article_info
(
title varchar(200) null,
content longtext null,
sendtime datetime(6) null,
id int not null auto_increment
primary key,
outline text null,
txtContent longtext null,
imgurl varchar(200) null
)
;
create table article_tags
(
article_id int null,
tag_name varchar(20) null
)
;
comment... | true |
98962e9f821e55e24f6dd5b49ed7b9616d10a0d8 | SQL | smk-141510243/ujikom-141510243 | /sandilogin.sql | UTF-8 | 16,430 | 3.0625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 25, 2017 at 03:06 AM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 7.0.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER... | true |
05521818a897839b68dc8a9de7b6613b811f5f6a | SQL | Meng-Gen/YuantaCat | /database/postgres/init.sql | UTF-8 | 7,688 | 3.03125 | 3 | [] | no_license | --------------------------------------------------------------------------------
-- Table: stock_symbol
--------------------------------------------------------------------------------
DROP TABLE IF EXISTS stock_symbol;
CREATE TABLE stock_symbol
(
creation_dt timestamp without time zone DEFAULT now(),
release_dat... | true |
f022908753beb030e3a0cf4bf0fbf61ed2665739 | SQL | vyesubabu/metview | /odb_api_bundle-0.17.6-Source/odb/src/ddl/ssa_robody_2m.sql | UTF-8 | 820 | 2.75 | 3 | [] | no_license | //
//-- ODB/SQL file 'ssa_robody_2m.sql'
//
// Last updated: 17-May-2002
//
READONLY;
CREATE VIEW ssa_robody_2m AS // SSA-analysis (2m analyses); ROBODY-part
SELECT seqno, // r/o; Must become first
entryno,
varno, // r/o
datum_status@surfbody_... | true |
babb17dbd1d64483a47b0f737d515eb05c403004 | SQL | petr-korobeinikov/flyway-example | /db/changelog/R8__create_or_replace_view_full_document.sql | UTF-8 | 373 | 3.453125 | 3 | [] | no_license | -- drop and create is workaround for postgres,
-- which can't recreate view with different set of columns.
drop view if exists full_document;
create view full_document as
select
d.id document_id,
d.name document_name,
d.value document_value,
p.id person_id,
p.name person_name
from docum... | true |
18533de83e59a1b50e4d5c76bcd5357f551e8329 | SQL | tranduong12893/SQL | /lab 2/ss6.sql | UTF-8 | 1,631 | 3.203125 | 3 | [] | no_license | CREATE DATABASE [Customer_DB] ON PRIMARY
( NAME = 'Customer_DB', FILENAME = 'C:\Program Files\Microsoft SQL Server\
MSSQL11.MSSQLSERVER\MSSQL\DATA\Customer_DB.mdf')
LOG ON
( NAME = 'Customer_DB_log', FILENAME = 'C:\Program Files\Microsoft SQL Server\
MSSQL11.MSSQLSERVER\MSSQL\DATA\Customer_DB_log.ldf')
COLLATE SQL_Lat... | true |
424641f7740211819a7ccffb7637609e3e8c9124 | SQL | LittleGeorgeWatchingStar/Rialto2020 | /data_migrations/completed/mantis2527.sql | UTF-8 | 191 | 2.546875 | 3 | [] | no_license | insert into ItemVersion
(stockCode, version, active, weight)
select i.StockID, '', 1, i.KGS
from StockMaster i
left join ItemVersion v
on i.StockID = v.stockCode
where v.version is null;
| true |
179f22612648a0b07731efd73d7529f67ae13f57 | SQL | evrimulgen/Oracle-DBA-Life | /SCRIPTS/RPT/DB_FILES.SQL | UTF-8 | 1,790 | 3.25 | 3 | [
"MIT"
] | permissive | REM db_files.sql checked out on 6/12/97 17:05:13 version 1.6
set termout off
REM ---- Var '&1' not used
REM ---- Enter the tablespace name or wildcard to match:%
define prefix = '&2'
REM ---- Enter the Title for the top of the report:?
define app_name = '&3'
REM ---- Var '&4' not used
REM ---- Var '&5' not used
RE... | true |
eed41c486d9288cd219c3b7eb266d4f5e8e1fb3e | SQL | Vakhrushev/uni | /migrations/2016-10-30_2_create_tables.sql | UTF-8 | 403 | 3.015625 | 3 | [] | no_license | use uni;
CREATE TABLE `users` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(64) NOT NULL DEFAULT '',
`password` VARCHAR(255) NOT NULL DEFAULT '',
`dt_create` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`session_id` VARCHAR(32) NOT NULL DEFAULT '',
`text` TEXT NOT NULL DEFAULT '',
PRIMARY KEY ... | true |
5fa85388103728536d8c3b4a534b8cc1a9a54e0a | SQL | GordinV/buh70 | /sql/raama/create_table_leping1.sql | UTF-8 | 2,083 | 4.03125 | 4 | [] | no_license | drop table if exists docs.leping1;
CREATE TABLE docs.leping1
(
id serial NOT NULL,
parentid integer NOT NULL,
asutusid integer NOT NULL,
rekvid integer NOT NULL,
doklausid integer NOT NULL,
"number" character(20) NOT NULL,
kpv date NOT NULL,
tahtaeg date,
selgitus text NOT NULL DEFAULT space(1),
do... | true |
270add7b13e34f77dfe33c3c94da5374315ed04d | SQL | rianby64/spaghetti-not-deferrable-test-plpgsql | /inmediate.sql | UTF-8 | 6,139 | 2.59375 | 3 | [] | no_license | \set QUIET 1
\ir ./fns.sql
\ir ./aux0aux0.sql
\ir ./aux0.sql
\ir ./aux1.sql
\ir ./maestra.sql
DO $$BEGIN
RAISE NOTICE 'DELETE FROM "Aux0" WHERE id=3;';
END$$;
DELETE FROM "Aux0" WHERE id=3;
DO $$BEGIN
RAISE NOTICE 'DELETE FROM "Aux1" WHERE id=3;';
END$$;
DELETE FROM "Aux1" WHERE id=3;
DO $$BEGIN
RAISE NOTICE 'DELETE... | true |
bfdd1fa8f6d06175bf6ee0e5aad1b6f7753630bf | SQL | elitsaleontieva/Databases-Basics-MS-SQL-Server | /Exercises- Data Definition and Data Types/Add Check Constraint.sql | UTF-8 | 63 | 2.5625 | 3 | [] | no_license | ALTER TABLE Users
ADD CONSTRAINT Id PRIMARY KEY (Id,Username)
| true |
1a76983899cf9f3aa0f9fdaba6e20d448f7ece12 | SQL | katiannap/Practice_Patterns_Assessment_Study | /intraocular_pressure_processing.sql | UTF-8 | 7,483 | 4.28125 | 4 | [] | no_license |
--1. Get mean IOP (0-80) measurements (not visits) closest to index and then 1 year
--2. 1 ac visits table and 1 for non ac tbl--actual measurements: summary stats
--Result date and measurement that was taken on same date
--3. Check having cap
--fix demo and results + add eye visit codes
--WORK ON VA CTD AND I... | true |
e1ecaca19d94f99c26d684be120b2cfe575e1609 | SQL | ana-kalashnikova/CookPal | /src/main/resources/database/schema.sql | UTF-8 | 1,678 | 3.796875 | 4 | [] | no_license | CREATE TABLE cookpal.users (
id int NOT NULL AUTO_INCREMENT,
username varchar(20) NOT NULL,
email varchar(50) NOT NULL UNIQUE,
password varchar(50) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE cookpal.recipes(
id int NOT NULL AUTO_INCREMENT,
title varchar(200),
dateTime DATETIME,
inst... | true |
0d8251f660962a3d7b74774af74a2b4d4acc01da | SQL | sreecharan15/cherry | /hw02.sql | UTF-8 | 528 | 2.734375 | 3 | [] | no_license | create database sree_hw02;
use sree_hw02;
create table item;
(
Name varchar(25),
Street varchar(25),
City varchar(25),
State char(2),
Zipcode char(10),
Cost varchar(10),
Retail_price varchar(10),
Colors varchar(25),
Notes varchar(255),
Profit varcha... | true |
c217dc616a3ad06dfec469df4922183560e68e1d | SQL | bebo-eggo/compiere-eggo | /compiere-custo-eurocenter/data/oldCustos/14766-sql-00.sql | UTF-8 | 174 | 2.6875 | 3 | [] | no_license | UPDATE AD_COLUMN
SET AD_ELEMENT_ID = (SELECT AD_ELEMENT_ID FROM AD_ELEMENT WHERE COLUMNNAME LIKE 'IsManufactured')
WHERE COLUMNNAME = 'IsManufactured' AND AD_TABLE_ID = 208; | true |
003c0c4848fe7e9298ad6287cf80a628d282903d | SQL | smwright/FTC-PAM | /database/queries/asset_get_number_of_childs.sql | UTF-8 | 791 | 4.21875 | 4 | [] | no_license | CREATE DEFINER=`root`@`localhost` PROCEDURE `asset_get_number_of_childs`(
IN asset_parent INT,
OUT number_of_children INT
)
BEGIN
SELECT COUNT(result_table.childs) INTO number_of_children FROM
(
SELECT node.id AS childs, (COUNT(parent.id) - (sub_tree.depth + 1)) AS depth
FROM asset AS node, asset AS parent, ass... | true |
cc9bbd54189c79c41615334c988bd8d41653e2fe | SQL | crispane/JavaBootcamp | /mySqlProjects/createSales.sql | UTF-8 | 2,342 | 3.859375 | 4 | [] | no_license | CREATE DATABASE sales;
USE sales;
CREATE TABLE IF NOT EXISTS products (
Pcode INT AUTO_INCREMENT PRIMARY KEY,
Pdescr VARCHAR(45) NOT NULL,
Pprice DECIMAL(7,2)
);
CREATE TABLE IF NOT EXISTS customers (
Ccode INT AUTO_INCREMENT PRIMARY KEY,
Cname VARCHAR(20)
);
CREATE TABLE IF NOT EXISTS salesmen (
S... | true |
8f6b274f251f6bd13231d71d06918d013e00dc49 | SQL | greenplum-db/gpdb | /contrib/indexscan/sql/read_ao_index.sql | UTF-8 | 388 | 3.328125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"PostgreSQL",
"OpenSSL",
"LicenseRef-scancode-stream-benchmark",
"ISC",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-ssleay-windows",
"BSD-2-Clause",
"Python-2.0"
] | permissive | drop table if exists ao_t1;
drop index if exists ao_i1;
create table ao_t1 (a integer, b integer) with (appendonly=true);
insert into ao_t1 select 1 as a, * from generate_series(1, 1000) as b;
create index ao_i1 on ao_t1(b);
select count(*) from ao_t1;
select * from readindex('ao_i1'::regclass) as (ictid tid, hctid ti... | true |
fe262a432b0c5054feacdd45e99e3ba2b39b5798 | SQL | hyuk-jang/uwps | /program/sql/federated.sql | UTF-8 | 467 | 2.65625 | 3 | [] | no_license | CREATE TABLE `admin` (
`id` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '관리자아이디',
`name` VARCHAR(255) NULL DEFAULT NULL COMMENT '이름',
`password` VARCHAR(255) NULL DEFAULT NULL COMMENT '비밀번호',
`createdate` DATETIME NULL DEFAULT NULL,
`updatedate` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_... | true |
ad5ef31dc484f37761123391e314be94ae585194 | SQL | werew/DB-videosharing | /proc-fun.sql | UTF-8 | 8,818 | 3.875 | 4 | [] | no_license | SET SERVEROUTPUT ON;
/***************** Exercise 1 *********************/
PROMPT
PROMPT ******** Exercise 1 ******************************************
PROMPT * Définir une fonction qui convertit au format json les *
PROMPT * informations d’une vidéo *
PROMPT ******************... | true |
3a6e7ec75e18d437d2f720b58b608453efcb5460 | SQL | juandrd/0939879-0933174 | /DSII/sql/sql proyecto dsII.sql | UTF-8 | 8,739 | 3.265625 | 3 | [] | no_license | -----PROYECTO DESARROLLO DE SOFTWARE II
-----Juan David Rengifo 0939879
-----Cristian Dario Loaiza 0933174
-----CREACION DE TABLAS
DROP TABLE tarjetas_personalizadas CASCADE;
CREATE TABLE tarjetas_personalizadas (
pin_tarjeta varchar(100) PRIMARY KEY,
nro_pasajes int,
estado varchar(10),
adelanto_disponible int);
... | true |
41b12274d7609224864d3fbea53f93e33c60bf76 | SQL | antoniolazaro/spring-security-sample | /scripts/segurannca_spring_security.sql | UTF-8 | 1,569 | 3.5 | 4 | [] | no_license | drop table users;
drop table authorities;
drop table group_authorities;
drop table group_members;
/* Banco de dados usado postgres SQL */
CREATE TABLE IF NOT EXISTS users (
username VARCHAR(50) NOT NULL ,
password VARCHAR(50) NOT NULL ,
enabled VARCHAR(50) NOT NULL ,
PRIMARY KEY (username) );
CREATE TABL... | true |
cb0f17b80fb578cca193fb141e5815ac5b38a2e4 | SQL | QuentinBens/miniprojet | /requete/getFourBestCat.sql | UTF-8 | 216 | 3.9375 | 4 | [] | no_license | SELECT categories.id, categories.title, categories.description, count(movies.id) AS count
FROM categories
INNER JOIN movies ON movies.categories_id = categories.id
GROUP BY categories.id
ORDER BY count DESC
LIMIT 4
| true |
d7f23a74a607262de70bcb301373c70ca079ca66 | SQL | ctylerg/RESTaurant | /migration.sql | UTF-8 | 470 | 3.03125 | 3 | [] | no_license | CREATE DATABASE fivestar;
\c fivestar
CREATE TABLE foods (
id SERIAL PRIMARY KEY,
name VARCHAR(255),
cents INTEGER,
cuisine VARCHAR(255),
free BOOLEAN
);
CREATE TABLE parties (
id SERIAL PRIMARY KEY,
table_number INTEGER,
is_paid BOOLEAN,
cents INTEGER
);
CREATE TABLE orders (
id SERIAL PRIMARY K... | true |
2915e930990b1bf9c636b667b5426584eb76d035 | SQL | Holt86/Voting-API | /src/main/resources/db/populateDB.sql | UTF-8 | 1,286 | 3.234375 | 3 | [] | no_license | DELETE FROM user_roles;
DELETE FROM user_voter;
DELETE FROM dish;
DELETE FROM users;
DELETE FROM restaurant;
ALTER SEQUENCE global_seq RESTART WITH 100;
INSERT INTO users (name, email, password) VALUES
('User1', 'user1@yandex.ru', '$2a$10$kpr5QRyU2aj/eCjqweVxreGScNqM82vUvRCORLjAZopo.Kxp5B2S2'),
('User2', 'user2@ya... | true |
e5f839cfff2340e34a3a680133243a4eea9e6421 | SQL | hoaingo/new-project | /pms-sp-configuration/src/main/resources/list-sp/up_pms_update_role_by_id.sql | UTF-8 | 669 | 3.015625 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Author: gohan.intern
* Created: Apr 24, 2018
*/
DELIMITER //
DROP PROCEDURE IF EXISTS up_pms_update_role_by_id//
CREATE DEF... | true |
78f6b83f76caa050876e01d4d628269c3b9b9fdc | SQL | batego/db_fintra | /selectrik/opav/Tables/opav.sl_areas_proyecto.sql | UTF-8 | 954 | 3.328125 | 3 | [] | no_license | -- Table: opav.sl_areas_proyecto
-- DROP TABLE opav.sl_areas_proyecto;
CREATE TABLE opav.sl_areas_proyecto
(
id serial NOT NULL,
reg_status character varying(1) NOT NULL DEFAULT ''::character varying,
dstrct character varying(4) NOT NULL DEFAULT ''::character varying,
id_solicitud character varying(1... | true |
a2116c6b4e8e2226b4765aff6f894f00bdaa8d20 | SQL | hassanarshad115/Resturent-system | /Immaginary Resturent | UTF-8 | 12,476 | 3.90625 | 4 | [] | no_license | drop database if exists `restaurant`;
create database `restaurant`;
use `restaurant`;
drop table if exists `USER`;
create table `USER`(
`User_Id` int NOT NULL AUTO_INCREMENT,
`Fname` varchar(50) NOT NULL,
`Lname` varchar(50) NOT NULL,
`Password` varchar(50) NOT NULL,
PRIMARY KEY (`User_Id`)
)ENGINE=InnoDB DEFAULT... | true |
41c5854667d0ab290da11bfcddee9237d76fbee9 | SQL | neostreet/poker_session_data | /null_num_hands.sql | UTF-8 | 300 | 3.328125 | 3 | [] | no_license | use poker
select count(*),f.poker_flavor_descr,
s.initial_stake,sum(num_hands) / count(*) hands_per_session
from poker_sessions s,poker_flavors f
where s.poker_flavor = f.poker_flavor and
s.num_hands is null
group by s.poker_flavor,s.initial_stake
order by count(*) desc,f.poker_flavor_descr;
quit
| true |
dfdb648d405c1f6d062209875076f29cb3f11f18 | SQL | thequinneffect/t32020 | /databases/final/work/q1/q1.sql | UTF-8 | 515 | 4.09375 | 4 | [] | no_license | -- COMP3311 20T3 Final Exam
-- Q1: longest album(s)
-- ... helper views (if any) go here ...
create or replace view longest_album_length(s_length)
as
select sum(s.length)
from songs s
group by s.on_album
order by sum(s.length) desc
limit 1
;
create or replace view q1("group",album,year)
as
select g.name, a.title, a.... | true |
7179565f0c4df91a45e77a81e19b941b1e93d7bf | SQL | dungw/gpis88ce | /database/Standard_30_05_2015.sql | UTF-8 | 18,265 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : JF
Source Server Version : 50539
Source Host : localhost:3306
Source Database : gpis88ce_fresher
Target Server Type : MYSQL
Target Server Version : 50539
File Encoding : 65001
Date: 2015-05-31 08:35:26
*/
SET FOREIGN_KEY_CHECKS=0;
--... | true |
9448b550f110b7f1470f776b3863f565f4d408ea | SQL | JhanviShah1/BootcampX | /migrations/assignments_submissions.sql | UTF-8 | 379 | 3.15625 | 3 | [] | no_license | CREATE TABLE assignments(id SERIAL PRIMARY KEY NOT NULL,
name VARCHAR(255),
content TEXT,
day INTEGER,
chapter INTEGER,
duration INTEGER
);
CREATE TABLE assignment_submissions(id SERIAL PRIMARY KEY NOT NULL,
assignment_id INTEGER REFERENCES assignments(id) ON DELETE CASCADE,
student_id INTEGER REFERENCES students(id) ... | true |
29217add81c686aab837c1dea1b0453257401723 | SQL | ZhenJie-Zhang/MySQL | /workspace/m3_table.sql | UTF-8 | 2,127 | 4.25 | 4 | [] | no_license | -- 使用指令輸入新增表格
CREATE TABLE employee(
empno decimal(4) PRIMARY KEY,
ename varchar(30) NOT NULL,
hiredate date NOT NULL,
salary int NOT NULL,
deptno decimal(3) NOT NULL,
title varchar(20) NOT NULL
);
-- 使用視窗介面新增表格的指令內容
CREATE TABLE `db01`.`department` (
`deptno` DECIMAL(3) NOT NULL,
`... | true |
a6e4abdea0b19385753a3a74e8ffa8a6cbaca1d4 | SQL | mustfun/learnExample | /src/test/Resource/Sql/kuaiqian.sql | UTF-8 | 1,545 | 4.0625 | 4 | [] | no_license | SELECT
ubi.id AS banks_id,
ba. NAME AS banks_cat,
ubi.bank_card_no AS banks_account,
re. NAME AS banks_province,
re2. NAME AS banks_city,
ubi.open_bank_code AS banks_name,
CASE
WHEN ba. NAME = '中国银行' THEN
'1'
WHEN ba. NAME = '招商银行' THEN
'1'
ELSE
'0'
END AS typeFlag
FROM
user_bankcard_info ubi
LEFT JOIN bank ... | true |
c6860953ef5e236ce655356126b34c7d6367ca36 | SQL | cohenjo/dbautils | /oracle/dbmon/sqls/create_uspace.sql | UTF-8 | 448 | 3 | 3 | [] | no_license | -- The script is called by cleandb and by showunused.
-- It creates table,that will contain information
-- about large objects which use less than 10% of the
-- allocated space.
#set term off
create table uspace_&1 (owner varchar2(30),
object_name varchar2(30),
object_type varchar2(10),
ts_name varcha... | true |
e3b4c67125f09bb1cb65c84c59a6f14e87294e1a | SQL | clara081094/TrabajoJavaAdvance | /transacciones.sql | UTF-8 | 4,176 | 3.078125 | 3 | [] | no_license | create database if not exists prueba;
use prueba;
create table categoria (
id int primary key auto_increment,
nombre varchar(50) not null
);
create table producto (
id int primary key auto_increment,
nombre varchar(100) not null,
descripcion varchar(500) not null,
categoria_id int not null,
foreign key... | true |
329a47952b295e636449e78a7741403eaf2bff7f | SQL | ishita-kapur/University-Library | /Item 3.sql | UTF-8 | 725 | 4.1875 | 4 | [] | no_license | /*Ishita Kapur, UTA ID: 1001753123*/
/*3. Write a query that will prepare a report for weekly Borrowing activity by Subject area, by Author, number of copies and number of days loaned out.*/
select Subject, Author_Name, isbn_copies_days.Copies_Loaned, isbn_copies_days.Days_Loaned
from book JOIN (select issue_book.I... | true |
45b70bcf5040ff84fd624d7834882a2a940fef43 | SQL | F-Kapok/WeChatShop | /cloud.sql | UTF-8 | 7,634 | 3.421875 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : 192.168.242.130
Source Server Version : 50723
Source Host : 192.168.242.130:3306
Source Database : cloud
Target Server Type : MYSQL
Target Server Version : 50723
File Encoding : 65001
Date: 2019-01-16 17:56:27
*/
SET FO... | true |
1323440e9923a0a5e9a73b0dc53d9f6b8ac9a760 | SQL | honyma/tropical_fish | /_docs/fish_mysql.sql | UTF-8 | 5,952 | 3.09375 | 3 | [
"MIT"
] | permissive | /*
Navicat Premium Data Transfer
Source Server : 立构星-uat
Source Server Type : MySQL
Source Server Version : 50628
Source Host : 192.168.126.80:3307
Source Schema : seckillcenter
Target Server Type : MySQL
Target Server Version : 50628
File Encoding : 65001
Date: 19/0... | true |
d9e54e7ec2e99dc425a21239d7bff8bbcf8fc990 | SQL | inest-us/db | /cms/GetCategories.sql | UTF-8 | 177 | 2.671875 | 3 | [
"MIT"
] | permissive | ALTER PROCEDURE dbo.GetCategories
AS
SELECT CategoryID,
AddedDate,
AddedBy,
Title,
Importance,
Description,
ImageUrl
FROM Categories | true |
ca20d1c11ee91ecf8ca39696fb58150d7db71b23 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day19/select1522.sql | UTF-8 | 191 | 2.796875 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-18T15:22:00Z' AND timestamp<'2017-11-19T15:22:00Z' AND SENSOR_ID='ac5a2393_a779_4dd8_b93b_9e5f5d18278c'
| true |
6438427161a04fd38b4cde338f27b7b769d9e705 | SQL | DtLooker/Edu_System | /sql/edu_klass.sql | UTF-8 | 812 | 2.9375 | 3 | [] | no_license |
-- ----------------------------
-- Table structure for `edu_klass`
-- ----------------------------
DROP TABLE IF EXISTS `edu_klass`;
CREATE TABLE `edu_klass` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(40) NOT NULL DEFAULT '' COMMENT '名称',
`teacher_id` int(11) unsigned NOT NULL... | true |
143bb91c4014f69c901a837d0ebfe2643e79ebb5 | SQL | appNG/appng | /appng-core/src/main/resources/db/migration/mysql/V1_4__Add_DatabaseConnection.sql | UTF-8 | 723 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | create table database_connection (
id integer not null auto_increment,
description varchar(255),
driver_class varchar(255),
jdbc_url varchar(255),
name varchar(255),
password longblob,
type varchar(255),
username varchar(255),
mutable bit,
version datetime,
site_id integer,
primary key (id)
) ENGINE=InnoDB ... | true |
76856098f9c5e2fdded59548f501d3ec4dfcf8bd | SQL | karlarao/scripts | /workload_sizing_and_capacity/run_awr/utl/run_awr_sgastat.sql | UTF-8 | 4,969 | 2.6875 | 3 | [] | no_license | -- awr_sysstat.sql
-- AWR CPU Workload Report
-- Karl Arao, Oracle ACE (bit.ly/karlarao), OCP-DBA, RHCE
-- http://karlarao.wordpress.com
--
set feedback off pages 0 term off head on und off trimspool on echo off lines 4000 colsep ','
set arraysize 5000
set termout off
set echo off verify off
COLUMN blocksize NEW_VAL... | true |
7fb959e587115fceeab646ecbcb30baaec418ab2 | SQL | lilihao1993/old_blog | /src/main/resources/blog.sql | UTF-8 | 6,074 | 3.328125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : family
Source Server Version : 50712
Source Host : localhost:3306
Source Database : blog
Target Server Type : MYSQL
Target Server Version : 50712
File Encoding : 65001
Date: 2016-10-28 17:20:42
*/
SET FOREIGN_KEY_CHECKS... | true |
ad1735feb2b6ea3b124e63e681f955c49c4783c6 | SQL | abiZsrm/learning-microservices | /gamification/Database/Schema.sql | UTF-8 | 635 | 3 | 3 | [] | no_license | -- Create Database.
USE SocMulDB;
-- Multiplication table.
CREATE TABLE SCORE_CARD
(
CARD_ID INT NOT NULL,
USER_ID INT NOT NULL,
ATTEMPT_ID INT NOT NULL,
SCORE INT
PRIMARY KEY (CARD_ID)
);
-- User table.
CREATE TABLE BADGE_CARD (
BADGE_ID INT NOT NULL,
USER_ID INT NOT NULL, ... | true |
2a3e234fb0a00f2a0bc8456e616631d32e59269c | SQL | krafik/php2.0 | /php2.0/les9/les8.sql | UTF-8 | 1,668 | 3.015625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1
-- Время создания: Апр 13 2019 г., 20:48
-- Версия сервера: 10.1.36-MariaDB
-- Версия PHP: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
a64ddad4b3ef113596d732acec15d5b11b09b72f | SQL | Mariama2006/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/7-cities.sql | UTF-8 | 317 | 3.875 | 4 | [] | no_license | -- hat creates the database hbtn_0d_usa and the table
CREATE DATABASE IF NOT EXISTS hbtn_0d_usa;
CREATE TABLE IF NOT EXISTS hbtn_0d_usa.cities (
id INT UNIQUE AUTO_INCREMENT NOT NULL,
state_id INT NOT NULL,
name VARCHAR(256) NOT NULL,
PRIMARY KEY(id),
FOREIGN KEY (state_id) REFERENCES hbtn_0d_usa.states(id)
); | true |
891a2d3bd2717e34fa1ec77b4677af5a387c33ae | SQL | aplayspace/clockwiseviz | /db.sql | UTF-8 | 1,923 | 3 | 3 | [] | no_license | -- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.5.8
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTI... | true |
c0dd11679e09f9d699bf411bbaa08915b1cf5c2f | SQL | luoquanhong/JKSJ | /Java/Week05/src/main/resources/initSql.sql | UTF-8 | 2,005 | 3.234375 | 3 | [] | no_license | CREATE TABLE student
(Sno varchar(20) NOT NULL,
Sname varchar(20) NOT NULL,
sex varchar(20) NOT NULL,
age INT NOT NULL,
dept varchar(20) NOT NULL,
PRIMARY KEY (Sno)
);
CREATE TABLE course
(Cno varchar(20) NOT NULL,
Cname varchar(20) NOT NULL,
hours VARCHAR(20) NOT NU... | true |
c639d97e622d17dd0bab3eed8db4531fd8efb8e9 | SQL | faultyserver/lunch | /db/migrations/20180102095255_db_setup.sql | UTF-8 | 995 | 3.75 | 4 | [] | no_license | -- +micrate Up
CREATE TABLE accounts (
id integer PRIMARY KEY,
username text NOT NULL,
encrypted_password text NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
discord text,
twitch text,
twitter text,
timezone text,
admin boolean DEFAULT f... | true |
6f7b9863af25070b41e6c3079b77a12a114e9861 | SQL | shawnmann0203/teamStore | /storeDB/storeDB.sql | UTF-8 | 679 | 3.59375 | 4 | [] | no_license | create database if not exists store;
use store;
drop table if exists customer;
drop table if exists products;
drop table if exists orders;
create table customers (
id int(10) not null auto_increment,
first_name varchar(25) not null,
last_name varchar(25) not null,
primary key(id)
);
create table products (
id ... | true |
3efed3927e6be840a05932bae675ee2713c80f82 | SQL | SidhaantAnand/MLB-Analysis | /searchSQL/umpire_queries.sql | UTF-8 | 1,541 | 4.15625 | 4 | [] | no_license | -- (num_games)
with umpireId as
(select umpire_id from Umpires where full_name = '{umpire_name}')
select count(*) as num_games from GameUmpireStats
inner join umpireId using (umpire_id);
-- (num_outs, num_challenges, num_correct_challenges)
with umpireId as
(select umpire_id from Umpires where full_name = '{umpire_nam... | true |
b19ed88f6179cbe0f99615191ffa1ad22bf3dcee | SQL | diegosantos17/cases-docker-site-frutas-test4 | /api/db/scripts.sql | UTF-8 | 304 | 2.859375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS db_site_frutas4;
USE db_site_frutas4;
CREATE TABLE IF NOT EXISTS products(
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(255),
price DECIMAL(10,2),
PRIMARY KEY(id)
);
INSERT INTO products VALUES(0, 'Uva', 10);
INSERT INTO products VALUES(0, 'Pessego', 15);
| true |
9818ee23436f66158b71740fc7a9cdcb26d43650 | SQL | mike742/EhglishGrammar | /englishGrammar.sql | UTF-8 | 846 | 3.15625 | 3 | [] | no_license | select * from Sections order by id desc
select * from Units order by id desc
select * from Descriptions order by id desc
select * from Exercises order by id desc
select * from Questions order by id desc
select * from textBoxes order by id desc
select * from Answers order by id desc
select * FROM Questions where conten... | true |
4120fe6d5e4e38694cb625b6b24659314828e37b | SQL | clinthawkes/CourseWork | /cs340/library_DMQ.sql | UTF-8 | 2,836 | 3.96875 | 4 | [] | no_license | /* This will add a new author to the author table */
INSERT INTO author(firstName, lastName, homeCity, homeState)
values(:fromFirstName, :fromLastName, :fromHomeCity, :fromHomeState);
/* This will add a new customer to the customer table */
INSERT INTO customer(firstName, lastName, streetAddress, city, state, zip)
va... | true |
756d1604fdda591e8ed7331568a7b8e28f1b6aad | SQL | manusinghal1997/Node-And-MySQL-CRUD-OPERATIONS | /database/nodecrud.sql | UTF-8 | 1,664 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 17, 2019 at 08:27 AM
-- Server version: 5.7.16-log
-- PHP Version: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
bdbd40fa5e1d346c04e764e4c0844e24215de8b3 | SQL | filimonov/ClickHouse | /dbms/tests/queries/0_stateless/00604_shard_remote_and_columns_with_defaults.sql | UTF-8 | 1,392 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
DROP TABLE IF EXISTS test.t4;
CREATE TABLE test.t1(x UInt32, y UInt32) ENGINE TinyLog;
CREATE TABLE test.t2(x UInt32, y UInt32 DEFAULT x + 1) ENGINE TinyLog;
CREATE TABLE test.t3(x UInt32, y UInt32 MATERIALIZED x + 1) ENGINE Tiny... | true |
41043d45c16b0c475a935bab5233b8acec07c24c | SQL | whehdwns/CSE_111 | /Lab_9/Lab_9/15.sql | UTF-8 | 208 | 3.25 | 3 | [] | no_license | SELECT COUNT(DISTINCT o_orderkey)
FROM orders, Q151, Q152, lineitem
WHERE o_orderkey = l_orderkey AND o_custkey=c_custkey AND
l_suppkey NOT IN (
SELECT s_suppkey
FROM Q152
)
| true |
e397d7ca46dd4282bc6d4a42acd0a92aabf9dfb5 | SQL | Yennhi176/C0720G1_TranThiYenNhi_Module3 | /3.thao_tac_voi_CSDL/bai_tap/thiet_ke_va_cai_dat_CSDL_cho_ung_dung_quan_li_thu_vien_p1.sql | UTF-8 | 1,195 | 3.078125 | 3 | [] | no_license | create database ung_dung_quan_ly_thu_vien_p1;
use ung_dung_quan_ly_thu_vien_p1;
create table sach(
maSach int primary key,
tenSach varchar(50),
nhaXuatBan varchar(50),
tacGia varchar(50),
namXuatBan date,
soLanXuatBan int,
gia double,
anh varchar(4000)
);
create table loaiSach(
maLoaiSach int primary key,
tenSach var... | true |
21174e8e02ac5673e52a5b6b4a3211505a04ab9a | SQL | bkvspeaks/CT-SQLEssentials | /Day3/doc4_create.sql | UTF-8 | 864 | 3.96875 | 4 | [] | no_license | /* CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
columnName datatype FOREIGN KEY REFERENCES Table(PK_Field),
....
Constraint = rules for data
Ex: NOT NULL, Primary Key, Foriegn Key, Unique, Default(0), Index, Identity
Make a list: CHECK constra... | true |
b5328b8582c71dd5cdeafdf33e7589ea7be79557 | SQL | SzymonMajk/LittleDatabase | /lab5/ex_6.sql | UTF-8 | 427 | 3.65625 | 4 | [] | no_license | select sum(masypudelek.summa)
from (select sum(z.sztuk*c.masa) as summa
from czekoladki c join zawartosc z using (idczekoladki) join pudelka p using(idpudelka)
group by z.sztuk,c.masa
) as masypudelek;
select sum(koszty.sumpud) + sum(koszty.sumczek)
from (select sum(p.stan*p.cena) as sumpud, sum(c.koszt*z.sztuk) as s... | true |
3471d302bf57ea9bfe528af8576a5d12aeda36f7 | SQL | rodrigoalexandrecosta/zuptube-api | /src/main/resources/db/schema/init_schema.sql | UTF-8 | 620 | 2.75 | 3 | [] | no_license | CREATE USER bootcamp WITH password 'bootcamp';
CREATE SCHEMA zuptubeapi_service;
ALTER USER bootcamp SET search_path = 'zuptubeapi_service, public';
GRANT USAGE, CREATE ON SCHEMA zuptubeapi_service TO bootcamp;
GRANT ALL ON ALL TABLES IN SCHEMA zuptubeapi_service TO bootcamp;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCH... | true |
d4429ea167409d2029052e08b6b13fb40a631df2 | SQL | bpurty/Project | /Our Mini core Java/ver 1.2/UniversityAdmisssionSystem/Database/Readme.sql | UTF-8 | 1,660 | 3.203125 | 3 | [] | no_license | CREATE TABLE Programs_Offered(
ProgramName VARCHAR2(5) PRIMARY KEY,
description VARCHAR2(20),
applicant_eligibility VARCHAR2(40),
duration NUMBER,
degree_certificate_offered VARCHAR2(10));
CREATE TABLE Programs_Scheduled(
Scheduled_program_id VARCHAR2(5) PRIMARY KEY,
ProgramName VARCHAR2(5) REFERENCES Progra... | true |
562011379b6482bc6cd627dfcbb9ec686486bf6c | SQL | the-kingyoung/java | /src/a00_exp/a08_1222/a01_db.sql | UTF-8 | 8,967 | 4.15625 | 4 | [] | no_license | /*1. sql 명령문의 종류(ex DQL, DDL...)와 기능을 설명하고 주요 명령문의 예제 확인해서 정리하세요.
1) 질의어(DQL : data query language) : 데이터를 검색시 사용 ex)select*from 테이블
2) 데이터 조작어 (DML : data manipulation language) : 데이터를 입력/수정/삭제
-INSERT into 테이블명(컬럼명1,컬럼명2...) values(데이터1,데이터2...);
-UPDATE 테이블명
set 컬럼명 = 변경할데이터,
컬럼명 = 변경할데이터
... | true |
437032eb872399a532d5019863b5c427e61776ca | SQL | ejimenezdelgado/funda_datos_miercoles_1_2019 | /Semana 9/aerolinea_4.sql | UTF-8 | 1,746 | 4.03125 | 4 | [] | no_license | ---Listar todos los números de licencia y nombre
---de los pilotos cuyo nombre es 'Juan'
SELECT licencia, nombre
FROM piloto
WHERE nombre LIKE 'Juan_%';
--Listar los nombres de los pilotos que
--tienen más de 3000 horas de vuelo
SELECT nombre,horas_vuelo
FROM piloto
WHERE horas_vuelo > 3000;
SELECT *
FROM destino;... | true |
add411fba50a39e68492e589061f4941ad41f956 | SQL | shivdeepmodi/Setup | /sqlpath/buffer_objects.sql | UTF-8 | 1,825 | 3.796875 | 4 | [] | no_license | rem
rem Script: buff_obj.sql
rem Author: J.P.Lewis
rem Dated: 25-Oct-1998
rem Purpose: List blocks per object in buffer, by buffer pool
rem
rem Notes:
rem This has to be run by SYS because the 'working data set' is
rem only present as an X$ internal, and the column of the buffer
rem header that we need is not expos... | true |
7321bfe6075c55b17d5dbd6b1580eb51ee2edfd5 | SQL | nbonamy/angularjs-test | /db/banking.sql | UTF-8 | 1,469 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.7.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 15, 2013 at 04:14 PM
-- Server version: 5.5.8
-- PHP Version: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*... | true |
965fa92975b5e5f742437f873364ee8c734fb81a | SQL | VishnuSatis/DataBaseSetup | /scripts/DBScripts/INITDBSCRIPT.sql | UTF-8 | 942 | 2.703125 | 3 | [] | no_license | --
-- PostgreSQL database dump CREATE_SAAS_DB
--
-- DROP DATABASE IF EXISTS "SAAS";
CREATE DATABASE "VAAS"
WITH ENCODING='UTF8'
CONNECTION LIMIT=-1;
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warn... | true |
b5614a529fa40aebf066f13b960c8a64c5840f6e | SQL | Vizzart/T-sqlSolutions | /1-30/28.sql | UTF-8 | 99 | 3.015625 | 3 | [] | no_license | SELECT COUNT(*)
FROM
(SELECT maker
FROM product
GROUP BY maker
HAVING COUNT(model)=1
) AS res
| true |
ac320a3fa073d5fd895c91d5b03faa87d7502229 | SQL | orangezeit/leetcode | /CPP/1401-1500/1454-Active-Users.sql | UTF-8 | 458 | 3.421875 | 3 | [
"BSD-3-Clause"
] | permissive | /* Write your T-SQL query statement below */
select distinct a.id,a.name
from Logins l1 join Logins l2 on l1.id = l2.id and DATEADD(day,1,l1.login_date) = l2.login_date
join Logins l3 on l2.id = l3.id and DATEADD(day,1,l2.login_date) = l3.login_date
join Logins l4 on l3.id = l4.id and DATEADD(day,1,l3.login_date) = l4.... | true |
9b15cd8962dc233d2338b628929a65651cbe99e3 | SQL | soma97/Zero-Trust-VPN | /AccessController/creation.sql | UTF-8 | 2,251 | 3.4375 | 3 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTI... | true |
e4368de55684e851f9d74d36401d1f5fd21ee702 | SQL | MitchellHCrane/SQL2 | /alter-table.sql | UTF-8 | 843 | 4.1875 | 4 | [] | no_license | -- Copy, paste, and run the insert statement from the
-- delete section above. (You should have deleted
-- all the entries.)
CREATE TABLE animals (
id SERIAL PRIMARY KEY, name VARCHAR(50), type TEXT, age INTEGER
);
-- Add a column to the animals table called “location”.
-- It should have a VARCHAR data type.
ALT... | true |
255905d7ec10c43e7670e2ff17f8a0cbc53294e7 | SQL | hathehoang/LuanVan | /database query.sql | UTF-8 | 4,168 | 3.515625 | 4 | [] | no_license | create database SystemDB;
use SystemDB;
set global optimizer_switch='derived_merge=off'
set optimizer_switch='derived_merge=off'
select @@optimizer_switch;
select @@GLOBAL.optimizer_switch;
create table ACCOUNT
(
Id int not null auto_increment,
UserName nvarchar(20),
Password nvarchar(20),
AccountType nvarchar(10),
... | true |
65e6f446cb6367ef3397cebce8369edb06a98108 | SQL | soffunicorn/teg | /otros/Dump20210204 (2).sql | UTF-8 | 20,594 | 3.28125 | 3 | [
"MIT"
] | permissive | -- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: teg_laravel
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;... | true |
9ffdf873128141cc9b9c0cd3b14c15b2bd39d255 | SQL | nickgiann/Aueb-projects | /4th semester/Databases WhitestRabbit 19-20/ergasia2/final/3160098-3160164/sql/create_neighbourhoods.sql | UTF-8 | 152 | 2.59375 | 3 | [] | no_license | create table Neighbourhoods(
neighbourhood_group varchar(20),
neighbourhood varchar(80),
constraint PK_Neighbour primary key (neighbourhood)
); | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.