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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a630c3755e9fa3d19dc69744abd03eb833a7f31a | SQL | kennykarnama/transaction-api | /database/migrations/mysql/1_init-schema.up.sql | UTF-8 | 957 | 3.734375 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS transactions (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
`uuid` CHAR(36) NOT NULL UNIQUE,
user_id INTEGER NOT NULL,
device_timestamp TIMESTAMP NOT NULL,
total_amount INTEGER NOT NULL DEFAULT 0,
paid_amount INTEGER NOT NULL DEFAULT 0,
change_amount INTEGER NOT NULL DEF... | true |
92323660202b193491042a169223124768eb62cb | SQL | moontide/WeChatBotEngine | /sql/emoji.mysql.sql | UTF-8 | 1,729 | 3.375 | 3 | [] | no_license | CREATE TABLE emoji
(
sn INT UNSIGNED NOT NULL DEFAULT 0,
code VARCHAR(45) CHARACTER SET ascii NOT NULL DEFAULT '',
emoji_char VARCHAR(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT 'emoji 字符。有的 emoji 是由两个甚至五个字符组成的,所以,长度不能设置为 1。而且很多 emoji 的 utf8 编码都是 4 字节的,所以此字段的字符集编码也要用 4 字节的 utf8: utf8mb4。... | true |
767c8c68db1ecae1d04c03df4bdc5c35fe34b264 | SQL | srqway/SQL-Server-Administration | /Data Migration Assistant/03 DMA Report Summary Headers.sql | UTF-8 | 1,720 | 3.765625 | 4 | [
"MIT"
] | permissive | --Nested JSON arrays (look for square bracket characters in the JSON data).
--Use a CROSS APPLY for each level of nesting. :(
SELECT
'Title: ' + r.Title + CHAR(13) + CHAR(10) +
'Category: ' + r.Category + ' (' + r.ChangeCategory + ')' + CHAR(13) + CHAR(10) +
'Severity: ' + r.Severity + CHAR(13) + CHAR(10) +
'Im... | true |
41d7180841108e47e421a62cb5b4ea9de0329664 | SQL | swthomas/GasLoggerAngular | /trackerdb.sql | UTF-8 | 1,997 | 3.484375 | 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='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema trackerdb... | true |
4387f8f027e858d3f02c736fa9b3af94751170a5 | SQL | xie-summer/sjct | /src_platform/com/qfw/platform/source/init.sql | UTF-8 | 4,220 | 3.09375 | 3 | [] | no_license | DROP TABLE IF EXISTS `cms_catalog`;
CREATE TABLE `cms_catalog` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`title` varchar(255) NOT NULL COMMENT '标题',
`content` text NOT NULL COMMENT '内容',
`type` int(11) NOT NULL COMMENT '栏目类型',
`htmlFilePath` varchar(255) DEFAULT NULL COMMENT '静态页面地址',
`i... | true |
6a018f5f9be10044af6e7b1853514f7c9c2599fb | SQL | payneteasy/superfly | /superfly-sql/src/all-proc.sql | UTF-8 | 6,623 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | drop table if exists mysql_routines_return_arguments;
create table mysql_routines_return_arguments (
routine_name varchar(128) not null,
argument_name varchar(128) not null,
argument_type varchar(128) not null,
ordinal_number int(10),
unique key unq_mysql_routines_arguments_name_type (routine_name, argument_n... | true |
a6c599232cbbd73894117930e75daf86517e38e6 | SQL | esbap/bacula | /sql/pesq_arq.sql | UTF-8 | 579 | 3.59375 | 4 | [] | no_license | SELECT
File.FileId,
CAST(Path.Path AS CHAR(10000) CHARACTER SET utf8),
CAST(Filename.NAME AS CHAR(10000) CHARACTER SET utf8),
CAST(Client.NAME AS CHAR(10000) CHARACTER SET utf8) AS client,
Job.JobId,
Job.RealEndTime
FROM
File
JOIN Filename ON File.FilenameId = Filename.FilenameId
JOIN Path ON ... | true |
f8aa284a725469cd6505a0f1ea48b28954a931c8 | SQL | rklarpit/LeetHub | /activity-participants/activity-participants.sql | UTF-8 | 547 | 3.96875 | 4 | [
"MIT"
] | permissive | # Write your MySQL query statement below
WITH CTE AS(
SELECT A.NAME, COUNT(F.NAME) AS NUM_PLAYERS
FROM ACTIVITIES A
LEFT JOIN FRIENDS F
ON A.NAME = F.ACTIVITY
GROUP BY 1),
MAX_MIN AS(
SELECT
MAX(NUM_PLAYERS) AS MAX_PLAYERS,
MIN(NUM_PLAYERS) AS MIN_PLAYERS
FROM
CTE)
SELECT
NAME AS ACTIVITY
FROM
CTE... | true |
78b2958c9d6508b8c323a03ffb27eaf9047040a8 | SQL | WDusss/CRUD_simple | /crud_sederhana.sql | UTF-8 | 3,626 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 18, 2013 at 07:59 AM
-- Server version: 5.5.27
-- PHP Version: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
e758fa6a5625771f0aad9a529e99439452ffb3de | SQL | titiscms/brewer | /brewer/src/main/resources/db/migration/V007__criar_tabela_usuario_grupo_permissao.sql | UTF-8 | 1,150 | 3.828125 | 4 | [
"MIT"
] | permissive | CREATE TABLE usuario (
codigo BIGINT(20) PRIMARY KEY AUTO_INCREMENT,
nome VARCHAR(50) NOT NULL,
email VARCHAR(50) NOT NULL,
senha VARCHAR(120) NOT NULL,
ativo BOOLEAN DEFAULT true,
data_nascimento DATE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE grupo (
codigo BIGINT(20) PRIMARY KEY,... | true |
3d456c3623818bb652edee2ded22709aff4d0f20 | SQL | teamlm2/lm2 | /sql/support/1a_roles.sql | UTF-8 | 677 | 2.59375 | 3 | [] | no_license | -- To be run by a user with 'createrole' privilege
-- creates all required group roles and two user roles (role_manager and role_reporting)
create role geodb_admin createdb createrole login password 'geodb_admin';
create role land_office_administration;
create role db_creation createdb;
create role role_management cre... | true |
3182921992aa56660a6718a9a77cb1cfab0f9929 | SQL | frank-rahn/guidelines-spring-boot | /guideline-springboot-app-jdbc/src/main/resources/schema.sql | UTF-8 | 1,286 | 3.3125 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2019-2020 the original author or authors.
*
* 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 ... | true |
1c0688712b71873bc9fa0de60f5026a2fbed9cbf | SQL | romelgomez/jqtree-cakephp-openshift-example | /php/db/jqtree-cakephp-example.sql | UTF-8 | 2,293 | 2.859375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 23-09-2014 a las 23:46:38
-- Versión del servidor: 5.5.38-0ubuntu0.14.04.1
-- Versión de PHP: 5.5.9-1ubuntu4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @O... | true |
7ee05367629f149ab612911b05c3fcfd368661f4 | SQL | JeremiahValerio0923/VALERIO_JEREMIAH | /SQL/SQLQuery13.sql | UTF-8 | 192 | 2.609375 | 3 | [] | no_license | CREATE TABLE salary(
id int NOT NULL,
salary int
PRIMARY KEY(id)
);
INSERT INTO salary
VALUES(1, 10000);
INSERT INTO salary
VALUES(2,15000);
INSERT INTO salary
VALUES(3,20000); | true |
f1c20a8baea0c8c19bc3e2bbf953e17b00724f8e | SQL | DeyanParushev/MyStudentProjects | /MS SQL/Indices, Grouping and DataAgregation/Excercise/Problem 6.sql | UTF-8 | 148 | 3.203125 | 3 | [] | no_license | SELECT
DepositGroup,
SUM(DepositAmount) AS TotalSum
FROM WizzardDeposits
WHERE MagicWandCreator = 'Ollivander family'
GROUP BY DepositGroup
| true |
373e682e9f742bb7d53f1b7eb416c22a0b15efd5 | SQL | inspectaTech/joomla_component_maker | /template/pkg_psmod_v1.1.0/packages/com_psmod_v1.1.0/admin/sql/install.mysql.utf8.sql | UTF-8 | 1,701 | 2.8125 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `#__psmod` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` VARCHAR(250) UNIQUE NOT NULL DEFAULT '',
`tool_data` TEXT NOT NULL DEFAULT '',
`options` TEXT NOT NULL DEFAULT '',
`module_id` INT(10) NOT NULL DEFAULT '0',
`data_ids` TEXT NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
)ENGINE=Inn... | true |
5c29535ba0886eaffe93e2321f913cf8c8828df9 | SQL | deansy11/postgreSQL_db_dp | /todo.sql | UTF-8 | 1,158 | 3.4375 | 3 | [] | no_license | CREATE TABLE todos (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
details TEXT NULL,
priority INTEGER NOT NULL DEFAULT 1,
created_at TIMESTAMP NOT NULL,
completed_at TIMESTAMP NULL
);
INSERT INTO todos (title, details, priority, created_at, completed_at) VALUES ('Finish my homework!', 'Complete the ... | true |
6149909102aa0da58ab80e83e6f30c0a66801ef8 | SQL | RumiTDC/InfrastructureDash2020 | /Database3/sp/Stored Procedures/FillCustomerMovementTable.sql | UTF-8 | 20,158 | 2.875 | 3 | [] | no_license | CREATE PROCEDURE [sp].[FillCustomerMovementTable]
AS
WITH TEST AS (
SELECT
adresse_kvhx,
TDC_Fiber_Enabled =
CASE
WHEN WL_Fiber = '1' THEN 1
ELSE 0
END
, TDC_Coax_Enabled =
CASE
WHEN BBR_Coax_anlaeg_id <> '' THEN
CASE
WHEN WL_Coax_Adgang_Andre_BBOperatoer IN ('Nej', '') and WL_Coax_BB_Styret_... | true |
93c16fab9969da17cfac4a1fb3d1f95f998dc1f9 | SQL | marinafrank/si-sandbox | /Scripts/GENERAL/DataAnalysis_LOP2812-How_many_revenues_are_linked_with_another_revenue.sql | ISO-8859-1 | 11,491 | 3.109375 | 3 | [] | no_license | -- DataAnalysis_LOP2812-How_many_revenues_are_linked_with_another_revenue.sql
-- FraBe 05.12.2013 MKS-129996:1 / LOP2812
spool DataAnalysis_LOP2812-How_many_revenues_are_linked_with_another_revenue.log
set echo off
set verify off
set feedback off
set timing off
set heading o... | true |
a62a22825ed4f104416a691ff828bb3339383ab9 | SQL | utk23dubey/admin--panel | /project.sql | UTF-8 | 7,245 | 3.390625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 15, 2018 at 01:15 PM
-- Server version: 5.1.53
-- PHP Version: 5.3.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... | true |
854f3a5320a2c4954e23b68b547164f5473758d9 | SQL | radtek/abs3 | /sql/mmfo/bars/Function/fost_snp.sql | UTF-8 | 1,207 | 2.703125 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/function/fost_snp.sql =========*** Run *** =
PROMPT =====================================================================================
CREATE OR REPLACE FUNCTION BA... | true |
8eeab086e622bde39fe6df18641de93e0f9c954f | SQL | nigelbayliss/oracle-db-examples | /machine-learning/sql/19c/oml4sql-attribute-importance.sql | UTF-8 | 1,847 | 3.578125 | 4 | [
"UPL-1.0",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | -----------------------------------------------------------------------
-- Oracle Machine Learning for SQL (OML4SQL) 19c
--
-- Attribute Importance - "EXPLAIN" function - dmaidemo.sql
--
-- Copyright (c) 2020 Oracle Corporation and/or its affilitiates.
--
-- The Universal Permissive License (UPL), Version 1.... | true |
83af3277e7dc2707b071923f8e965155a73d67cd | SQL | ukiridwan/Akademik | /src/database/akademik.sql | UTF-8 | 6,005 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 08, 2016 at 06:55 AM
-- Server version: 5.6.26
-- PHP Version: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
096e4eab6bc77761f111566a210bf2236b8d3a7b | SQL | lejarx/Oracle-PLSQL | /source_code/chapter 9/listings/listing9_10.sql | UTF-8 | 354 | 3.8125 | 4 | [] | no_license | select department_name, last_name, first_name, wages,
emp_wage_rank
from (select department_name, last_name, first_name, wages,
rank() over(partition by department_name
order by nvl(wages,0) desc) as emp_wage_rank
from department, employee
where department = fk_depart... | true |
d04dfa24d95b54d31cf0b499def3d47f61d069c5 | SQL | CUBRID/cubrid-testcases | /sql/_01_object/_03_virtual_class/_006_querypart/cases/1011.sql | UTF-8 | 449 | 3.140625 | 3 | [
"BSD-3-Clause"
] | permissive | --test querypart with null as a column
create class student(
id int auto_increment,
name varchar(10)
);
insert into student (name) values('aaa');
create vclass vstudent(
address string shared 'no',
name string
) as select null, name from student;
create vclass vstudent1(
address string shared 'no',
name string... | true |
0cea55e1ca7a10adfb358a096fd4ca1036354f06 | SQL | ReneNyffenegger/oracle-patterns | /Installed/dbms/xmlget/getxml.sql | UTF-8 | 856 | 3.171875 | 3 | [] | no_license | create table tq84_table (
id number primary key,
col_1 varchar2(10),
col_2 date
);
insert into tq84_table values (1, 'one' , date '1905-05-23');
insert into tq84_table values (2, 'two' , date '1875-02-16');
insert into tq84_table values (3, 'three', date '1897-09-29');
insert into tq84_table values (4, 'fou... | true |
71c5496ee2bf2da808a130464119d7cc1c87945d | SQL | cesardarinel/webScraping | /Prestamo.sql | UTF-8 | 787 | 3.34375 | 3 | [] | no_license | --TABLA CLIENTE
CREATE TABLE cliente(
id INTEGER NOT NULL primary key,
identificacion VARCHAR(16),
telefono VARCHAR(16),
nombre VARCHAR(255)
);
--TABLA PRESTANOS
CREATE TABLE prestamo(
id INTEGER NOT NULL primary key,
idcliente INTEGER NOT NULL FOREIGN KEY REFERENCES cliente(id),
... | true |
1d45fd3aaa80d44cee70f1776343149503d3d2ff | SQL | dimascapella/Managemen | /management_store.sql | UTF-8 | 3,802 | 3.28125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 23, 2019 at 02:37 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
561a1444909d2236db33fbcc7a23080ab13b010f | SQL | umddb/CMSC724 | /Assignment3/TPCH/tpch-load.sql | UTF-8 | 5,410 | 3.21875 | 3 | [] | no_license | DROP TABLE lineitem;
DROP TABLE orders;
DROP TABLE partsupp;
DROP TABLE supplier;
DROP TABLE part;
DROP TABLE customer;
DROP TABLE nation;
DROP TABLE region;
create table nation (
n_nationkey decimal(3,0) not null,
n_name char(25) not null,
n_regionkey decimal(2,0) not null,
n_comment varchar(152)
);
creat... | true |
6245f5da1516739939ed4b70c64278da22fa67b5 | SQL | IvayloIV/Java | /MySQL/Exams/09.06.2019/06.Newbies.sql | UTF-8 | 247 | 3.734375 | 4 | [
"MIT"
] | permissive | SELECT
e.id,
CONCAT(e.first_name, ' ', e.last_name) AS 'full_name',
CONCAT('$', e.salary) AS 'salary',
e.started_on
FROM employees AS e
WHERE e.salary >= 100000 AND
e.started_on >= '2018-01-01'
ORDER BY
e.salary DESC,
e.id DESC; | true |
2d9152512c5dd959dac25c87cd86b7b91b0c0fcf | SQL | doubleW1985/ETL-with-Python-and-MySQL-Docker- | /2_MySQL_with_Docker/privileges.sql | UTF-8 | 253 | 2.59375 | 3 | [] | no_license | use mysql;
select host, user from user;
create user ###your username### identified by '###your password###';
grant all on ###your database name###.* to ###your username###@'%' identified by '###your password###' with grant option;
flush privileges;
| true |
2a30bf7705447c9cb5c2b60470293b24435659c2 | SQL | sahina/listlist | /database.sql | UTF-8 | 473 | 3.5625 | 4 | [] | no_license | drop table if exists list_item;
drop table if exists list_list;
create table list_list (
id serial primary key,
title varchar(150) not null
);
create table list_item (
id serial primary key,
title varchar(150) not null,
list_id integer not null,
foreign key (list_id) references list_list(id)
)... | true |
656c08e54913be00730a608aa59b452feb87917f | SQL | JoseRivas1998/COMP-420-term-project | /sql/STAT_NATURES.sql | UTF-8 | 732 | 3.6875 | 4 | [] | no_license | USE pokemondb;
DROP PROCEDURE IF EXISTS get_natures_that_increase_stat;
DROP PROCEDURE IF EXISTS get_natures_that_decrease_stat;
DELIMITER //
CREATE PROCEDURE get_natures_that_increase_stat(IN STAT INT)
BEGIN
SELECT NATURE.*
FROM NATURE_STAT
JOIN NATURE USING (NATURE_ID)
WHERE STAT_ID = STAT... | true |
6510b7d06d4563d78cd689b07fe7ce76adb2b2ef | SQL | KojuOrg/E-Mart-Project | /backup/DatabaseWithoutData-Fresh/emart.sql | UTF-8 | 8,323 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 10, 2020 at 08:30 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
e988388da3a2e4d7007abdec5a54794cb5afa1d0 | SQL | Milena8903/PracticasAGN | /Sql/1.1/IngresoInfo2 (2).sql | UTF-8 | 17,107 | 3.234375 | 3 | [] | no_license | use AGN3;
/* ++++++++++pruebas de ingreso usuario y funciones ++++++++++++++++++*/
/* empleado */
insert into empleado (Nombre_empleado, Apellido_Empleado, CedulaC, Estado, fecha_ingreso) values ('Ana Cecilia', 'Rincon Perez', 51818336,1,'1996-01-01');
/* resolucion 1*/
insert into resolucion (Numero, F... | true |
7fe5a06a016f0991bbf92486d242a676583bfaad | SQL | diiina/database_course_2020 | /Zemlyanoy/hw2/create_payments.sql | UTF-8 | 311 | 3.171875 | 3 | [] | no_license | CREATE TABLE `payments` (
`payment_id` INTEGER NOT NULL AUTO_INCREMENT,
`user_id` INTEGER NOT NULL,
`payment_sum` DOUBLE,
`payment_dttm` TIMESTAMP,
PRIMARY KEY (`payment_id`),
FOREIGN KEY (`user_id`)
REFERENCES `users` (`user_id`)
ON UPDATE CASCADE
ON DELETE NO ACTION
);
| true |
8553c87344e284979cc387c525707f02d3d2cfc4 | SQL | abdulsamadmj/sql-lab | /employee.sql | UTF-8 | 1,171 | 3.859375 | 4 | [] | no_license | DROP DATABASE IF EXISTS employee;
#Create a table employee with fields (EmpID, EName, Salary, Department, and Age).Insert some records. Write SQL queries using aggregate functions and group by clause
CREATE DATABASE employee;
USE employee;
CREATE TABLE employee(
EmpID VARCHAR(10) PRIMARY KEY,
... | true |
b545a0263f352253a4e3645eaacf27b4b796da93 | SQL | mas-dse-bwesterb/UCSD-MAS-DSE201 | /SalesCube/queries.sql | UTF-8 | 2,859 | 4.6875 | 5 | [] | no_license | --
-- 1. Show the total sales (quantity sold and dollar value) for each customer.
select customer.customer_id, customer.customer_name, SUM(quantity) as quantity, SUM(price) as dollar_value
from sales.customer inner join sales.sale on sales.sale.customer_id = customer.customer_id
GROUP BY customer.customer_id
order ... | true |
e4a09d48247c4a5548006050df0ac5cd789859ee | SQL | wangfenjin/simple | /example.sql | UTF-8 | 5,784 | 3.40625 | 3 | [
"MIT"
] | permissive | -- Examples to use simple tokenizer
-- load so file
.load libsimple
select '启用拼音分词:';
-- set tokenize to simple
CREATE VIRTUAL TABLE t1 USING fts5(x, tokenize = 'simple');
-- add some values into the table
insert into t1(x) values ('周杰伦 Jay Chou:最美的不是下雨天,是曾与你躲过雨的屋檐'),
('I love China! 我爱中国!')... | true |
4db10a4e04b472cf7ea2b55b1ce4f64975e0b5bc | SQL | anfemoca19/Android | /android-cesde-master/web-service-banco/WEB-SERVICE-PHP/banco-co.sql | UTF-8 | 3,775 | 3.1875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 02-09-2019 a las 06:36:28
-- Versión del servidor: 10.1.32-MariaDB
-- Versión de PHP: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... | true |
010282bba5a107e1a7eac319b2f1b0b1f34f7aa5 | SQL | clausoriano/BD | /Tema 5/16.sql | UTF-8 | 178 | 3.21875 | 3 | [] | no_license | select art_num,art_nom
from articulos
where not exists(
select * from tiendas
where not exists (
select vnt_tda
from ventas
where vnt_tda = tda_num and vnt_art = art_num)
);
| true |
e0906d94d536d0f2014074a1d3c35adb806f0ce7 | SQL | italoangelo13/sitekingcar | /Scripts Banco/BDKINGCAR-V001.sql | UTF-8 | 62,291 | 3.25 | 3 | [
"MIT"
] | permissive |
/*TABELA DE USO GERAL - CONTROLE DE VERSÃO DE APLICAÇÃO - UGETBLCVA*/
CREATE TABLE IF NOT EXISTS `UGETBLCVA` (
`CVACOD` int(11) NOT NULL AUTO_INCREMENT,
`CVAVERSAO` varchar(50) NOT NULL,
`CVADATCADASTRO` DATETIME NOT NULL,
`CVAUSER` varchar(50) NOT NULL,
PRIMARY KEY (`CVACOD`)
) ENGINE=MyISAM AUTO_INCREMENT... | true |
adda2dcb915c0e4386921f96d67b1a922bd44e0b | SQL | pinghsuanC/covid19_database | /contacts.sql | UTF-8 | 454 | 3.1875 | 3 | [] | no_license |
SELECT person_name as name, person_email as email, person_phone_number as phone_number FROM MONITORED_INDIVIDUAL
WHERE record_id IN (
SELECT DISTINCT id_1 AS id FROM (
(SELECT person_2 AS id_1 FROM contact WHERE person_1 =
(SELECT record_id FROM MONITORED_INDIVIDUAL WHERE person_email = 'dub.vizer@br.com')
)
U... | true |
ee33a60f9f4d982b3b32ae8fdcbfedd8338e5ad6 | SQL | avhirupc/LeetCode | /problems/Pattern : Untagged/Immediate Food Delivery I.sql | UTF-8 | 207 | 3.265625 | 3 | [] | no_license | # Write your MySQL query statement below
select ROUND((COUNT(delivery_id)/(select COUNT(delivery_id) from delivery))*100,2) as immediate_percentage
from delivery
where order_date=customer_pref_delivery_date
| true |
2c68bb538a05830c8ebef72fcc68448648960df0 | SQL | trabz777/Data-warehouse-Oracle | /3_Data Loading/2_Data_loading_PRACTICE_DIM.sql | UTF-8 | 911 | 2.890625 | 3 | [] | no_license | declare
Cursor c_practiceDetails is
SELECT "PracticeID","Address_Line_1","Town","County","Postcode","Telephone#","Fax#","Bypass#","Approximate List Size","Out of Hours Arrangement","LNT practice code","LNT GP code"
from "practiceDetails";
a NUMBER(4);
begin
for c_rec in c_practicedetails loop
a:= TO_NUMBER... | true |
cb572b3ef528c1ac5d113d5638796ee965673743 | SQL | Ian8VT/Ian8VT.github.io | /qgis/lab_8/process.sql | UTF-8 | 4,091 | 3.734375 | 4 | [] | no_license | Developed by Ian8VT
SELECT addgeometrycolumn('public', 'dorian', 'geom', 102004,
'POINT', 2);
UPDATE dorian
SET geom = st_transform(st_setsrid(st_makepoint(lng,lat),4326),102004);
SELECT addgeometrycolumn('public', 'november', 'geom', 102004,
'POINT', 2);
UPDATE november
SET geom = st_transform(st_setsrid(st_... | true |
0296c2bf0981656dab464203a9b8e0844cac7f76 | SQL | wanzhip/mynodeapp | /stumsg.sql | UTF-8 | 2,035 | 3.4375 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 50732
Source Host : localhost:3306
Source Schema : students
Target Server Type : MySQL
Target Server Version : 50732
File Encoding : 65001
Date: 15/01/2... | true |
d84408ef1c08645b754f1235e179dc7fc44f1e98 | SQL | ontop/ontop-examples | /aaai-2017-MTL-datalog/experiment-queries/weather/Hurricane.sql | UTF-8 | 1,590 | 4.21875 | 4 | [
"Apache-2.0"
] | permissive | WITH HFW AS (
SELECT SID, dFrom, dTo, prevWSpeed, wSpeed
FROM (SELECT station_id AS SID,
lag(date_time, 1) OVER (PARTITION BY station_id ORDER BY date_time) AS dFrom,
date_time AS dTo,
lag(wind_speed_set_1, 1) OVER (PARTITION BY station_id ORDER BY date_time) AS prevWSpeed,
wind_speed_set_1 AS wSpeed,
ROW_NUMBER() OV... | true |
4ff7acc5cb261ef911f53ddce6a21424a5f3a2ae | SQL | zx8754/Progeny | /RelationToProband.sql | UTF-8 | 4,083 | 2.890625 | 3 | [] | no_license | CASE
WHEN {Degree of Relation2}=1 OR {Proband status}=1 THEN 'Proband'
WHEN {Degree of Relation2}=2 AND {Gender}=1 AND {Gender Unknown}=0 THEN 'Brother'
WHEN {Degree of Relation2}=2 AND {Gender}=0 AND {Gender Unknown}=0 THEN 'Sister'
WHEN {Degree of Relation2}=3 AND {Gender}=1 AND {Gender Unknown}=0 THEN 'Son'
WHE... | true |
27036b89f3d96eb1fabddd846c3aaed4eccd0efd | SQL | V-Uzunov/Soft-Uni-Education | /04.DatabasesBasics-MSSQLServer/01.DataDefinitionAndDatatypesExercises.sql | WINDOWS-1251 | 12,620 | 4 | 4 | [
"MIT"
] | permissive | CREATE DATABASE Minions
CREATE TABLE Minions
(
Id int,
Name varchar(50),
Age int
)
CREATE TABLE Towns
(
Id int,
Name varchar(50)
)
ALTER TABLE Minions
ALTER COLUMN Id INT NOT NULL
ALTER TABLE Minions
ADD CONSTRAINT PK_Id PRIMARY KEY(Id)
ALTER TABLE Towns
ALTER COLUMN Id INT NOT NULL
ALTER TABLE Towns
ADD CONSTRAI... | true |
0142129e9a32d6ad18a8cd7973d5c2af6c7eb6d0 | SQL | mamonroy/Hotel-Database-Application | /values insert.sql | UTF-8 | 8,625 | 2.953125 | 3 | [] | no_license | -----STRONG ENTITIES---------
--Hotel--
INSERT INTO Hotel values(12,"Rose Street, Bay Avenue", 5091);
INSERT INTO Hotel values(34,"James Street, Citta Avenue", 1478);
INSERT INTO Hotel values(56,"22nd Street, Ittalia Avenue", 2310);
INSERT INTO Hotel values(79,"Andreas Street, Jos Avenue", 7789);
... | true |
a5e253dcc4a2e1485c78b28a16839d51a9c208d4 | SQL | DennisCheung/nxft | /dbscript/fxp/dbms/tables/09_帐户/3000010_p_coupon_activity_发券活动表.sql | GB18030 | 2,372 | 3.3125 | 3 | [] | no_license | --
-- ȯ
--
--
-- v1.0 2016.08.30
-- authorwing
--
-- ˵
--
--
-- ʷ
--
--
-- Drop Table fxp.p_coupon_activity ;
Create Table fxp.p_coupon_activity (
-- +-----------------------------+--------------+-----------+
factivity_id varchar2(32) not null, -- id
factivity_name varchar... | true |
a8edbaaaa1bb28eb82870841cb6f7d77d59d812d | SQL | vavavr00m/aion-source | /gameserver/sql/PvP_Event_Steel_Rake/steel_rake.sql | UTF-8 | 1,404 | 2.8125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : AE_Server25
Source Server Version : 50141
Source Host : localhost:3306
Source Database : au_server_gs
PvP Event Steel Rake : @author Dallas Aion Extreme 2.5
Target Server Type : MYSQL
Target Server Version : 50141
File Encoding ... | true |
fbd085aba0c1b1f4e25eddf8757f15283932ef7f | SQL | nelsonnathan/sql-2-lab | /alter-table.sql | UTF-8 | 660 | 3.234375 | 3 | [] | no_license | CREATE TABLE animals (id SERIAL PRIMARY KEY, name VARCHAR(50), type TEXT, age INTEGER);
INSERT INTO animals (name, type, age)
VALUES ('Leo', 'lion', 12),
('Jerry', 'mouse', 4),
('Marty', 'zebra', 10),
('Gloria', 'hippo', 8),
('Alex', 'lion', 9),
('Melman', 'giraffe', 15),
('Nala', 'lion', 2),
('Marie', 'cat', ... | true |
060036cdb3ee2f1337a7b9333b7d9cdc6bc70a86 | SQL | VijayMVC/JsMain | /web/sql_builds/JSC-1051.sql | UTF-8 | 1,808 | 2.984375 | 3 | [] | no_license | use MOBILE_API;
CREATE TABLE `BROWSER_NOTIFICATION` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`REG_ID` varchar(255) NOT NULL,
`NOTIFICATION_KEY` varchar(20) NOT NULL,
`NOTIFICATION_TYPE` varchar(10) NOT NULL,
`MESSAGE` varchar(200) NOT NULL,
`TITLE` varchar(50) NOT NULL,
`ICON` varchar(100) NOT NULL,
`TAG` varch... | true |
9d71edfa99e2732ca889dc2a8a6e8d6b82b2b330 | SQL | p300g611/PostgresDB | /dba-master/data_support/db/rally_requests/US17201/top.sql | ISO-8859-1 | 5,992 | 3.171875 | 3 | [] | no_license | SELECT distinct on(e.studentid)
(select displayidentifier from organization_parent(o.id) where organizationtypeid=5 limit 1) "District Number"
,(select organizationname from organization_parent(o.id) where organizationtypeid=5 limit 1) "District Name"
,o.displayiden... | true |
13cce321da468c66a972686c451c942c4e966353 | SQL | yerkozec/test | /concremag.sql | UTF-8 | 19,203 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 28-02-2018 a las 21:47:40
-- Versión del servidor: 10.1.29-MariaDB
-- Versión de PHP: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
564f80d9b4458913efec6715cc991b6f30c89fd7 | SQL | ebrahimsalehi1/PL-SQL | /PureCodes-Learning/p098.sql | UTF-8 | 682 | 2.671875 | 3 | [] | no_license | -- Learning PL/SQL with Ebrahim Salehi
-- If you have questions, You will send an email to ebrahim.salehi.oshtorjani@gmail.com
-------------------------------------------------------------------------------
create or replace function test_fun(p1 in number) return number is
begin
update employees
set salary = sala... | true |
abf08554dd5d1d4b788cd9f902b787b66bad11f1 | SQL | faridnetzz/Reservasi-Hotel | /hotel.sql | UTF-8 | 8,852 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 09, 2020 at 08:06 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.3.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
666eb3cee4a22b4ebb33d2b30bb7b8540edfb20a | SQL | tgspacelabs/Dev | /PER730XD-Portal50/PER730XD-Portal50/dbo/Stored Procedures/usp_CEI_GetAlarmTextOnly.sql | UTF-8 | 1,329 | 3.4375 | 3 | [] | no_license |
--CEI Procedures
--QueryTextOnly--GetAlarmTextOnly
CREATE PROCEDURE usp_CEI_GetAlarmTextOnly
AS
Begin
SET NOCOUNT ON;
SELECT
int_alarm.alarm_id,
int_alarm.start_dt,
int_alarm.alarm_level,
int_alarm_retrieved.annotation,
int_mrn_map.mrn_xid,
int_mrn_ma... | true |
90d6a4b42790b9121d172e194c19dc42ac92f2b4 | SQL | datlt/fictionMovieApi | /DB/migrations/000001_create_table.up.sql | UTF-8 | 1,485 | 3.453125 | 3 | [
"MIT"
] | permissive | create table if not exists favorites (
movie_id integer not null,
user_id integer not null,
constraint favorites_PKC primary key (movie_id,user_id)
) ;
create table if not exists api_key (
api_key varchar(200) not null,
user_id integer not null,
expired_on timestamp without time zone,
constraint api_key_... | true |
f01b517bd11e03258ee6153753ad4fb14aac80c0 | SQL | eaquino-2018073/WebRestaurante_IN5BM2018073 | /DBRestaurante.sql | UTF-8 | 2,157 | 3.5 | 4 | [] | no_license | create database DBRestaurante;
use DBRestaurante;
create table areas(
idarea int not null auto_increment,
descripcion varchar(45) not null,
primary key pk_idarea (idarea)
);
create table cocinero(
idcocinero int not null auto_increment,
nombre varchar(45) not null,
apellido varchar(45) not null,
... | true |
0af4c5f75ad8e72f6b2ca153e06a383ea9a3087f | SQL | McLoy/myStore | /myStoredb/sql/ddl/table_myStore_good.sql | UTF-8 | 1,075 | 3.328125 | 3 | [] | no_license | DROP TABLE MYSTORE_GOOD;
--------------------------------------------------
-- Table MYSTORE_GOOD
--------------------------------------------------
Create table MYSTORE_GOOD (
GOOD_ID NUMBER(12) NOT NULL,
GOOD_NAME VARCHAR2(20 CHAR) NOT NULL,
GOOD_TODO_I... | true |
8b1cac7b7c0b5b7ecdfb5c8cbf102e80eb4752c4 | SQL | barbara90/tudasklaszter | /db/createNewsTable.sql | UTF-8 | 282 | 2.71875 | 3 | [] | no_license | DROP TABLE IF EXISTS images;
CREATE TABLE news (
id smallint(5) unsigned NOT NULL auto_increment,
headline text NOT NULL,
story text NOT NULL,
name varchar(255),
email varchar(255),
timestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
PRIMARY KEY (id)
); | true |
6dec8db17c51fdad6d781a7a659d4113b86ec1dc | SQL | Kauhsa/stamina-top-100 | /schema/01-initial.sql | UTF-8 | 583 | 3.609375 | 4 | [] | no_license | create schema stamina;
create schema stamina_private;
create extension if not exists "uuid-ossp";
create table stamina.user (
id uuid primary key default uuid_generate_v1mc(),
name text check (char_length(name) < 20),
created_at timestamp with time zone default now()
);
create unique index name_lower_case_idx o... | true |
1b04806466d5551e24e501bf701e5477e3e007c1 | SQL | halberdholder/bbs | /data/setup.sql | UTF-8 | 1,837 | 3.59375 | 4 | [] | no_license | drop database if exists bbs;
create database bbs;
use bbs;
drop table if exists users;
drop table if exists threads;
drop table if exists posts;
drop table if exists sessions;
drop table if exists thread_class;
create table users (
id int primary key auto_increment,
uuid varchar(64) not ... | true |
96b39d0c538440107de6d5d29c3a708064c681cd | SQL | marlon19991/appfinal | /final.sql | UTF-8 | 5,904 | 3.53125 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 19-06-2016 a las 23:40:04
-- Versión del servidor: 5.5.16
-- Versión de PHP: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER... | true |
41c4c0be112320ddfa7c8a02bfc773b30f564534 | SQL | ES-INF-UFG-2016-2/Sempre-UFG | /db/postgres/ddl/VisaoEgressoOutrasInstEnsino.sql | UTF-8 | 4,626 | 3.546875 | 4 | [] | no_license | /*==========================================*/
/* Table: egresso */
/* Data de criação: 12/10/2016 */
/*==========================================*/
DROP TABLE IF EXISTS egresso;
CREATE TABLE egresso
(
id_egresso BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
matricula INTEGER NOT NULL,
nome_of... | true |
7020fbddc4b7c21afbeb3088b2eb0aaae0dc66d4 | SQL | HoangThiCamVan/BaoCaoCuoiKyCSharp | /HoangThiCamVanDB.sql | UTF-8 | 6,652 | 3.171875 | 3 | [] | no_license | create database HoangThiCamVanDB
use HoangThiCamVanDB
create table UserAccount
(
ID int identity(1,1) primary key,
UserName nvarchar(100),
Password varchar(50),
Status nvarchar(100)
)
insert into UserAccount(UserName,Password,Status)
values
('van','van','Activated'),
('camvan','camvan','Activated'),
('cvan','cvan... | true |
44a4aa0c2b67626a8f6e138fa4453db12f246827 | SQL | Marvinmw/news-crawler-python | /db.sql | UTF-8 | 419 | 2.671875 | 3 | [] | no_license | create database spider;
use spider;
CREATE TABLE `articles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`body` text COLLATE utf8_unicode_ci,
`publish_time` varchar(255) COLLATE utf8_unicode_ci DEFAU... | true |
13707a773990350b023c8dbeacb3ec25477e8aab | SQL | songaal/WMS | /SQL/create-tables.sql | UTF-8 | 13,160 | 3.078125 | 3 | [] | no_license | CREATE TABLE `approval_info` (
`id` int(11) NOT NULL auto_increment,
`aprv_type` char(1) NOT NULL,
`aprv_id` int(11) NOT NULL,
`req_user` char(4) NOT NULL,
`req_datetime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`res_user1` char(4) NOT NULL,
`res_user2` char(4) default NUL... | true |
92f1f742b1242401973766ec5394263d859e06de | SQL | google-code/befriends | /befriends/web/dbSetup.sql | UTF-8 | 2,245 | 3.515625 | 4 | [] | no_license | DROP DATABASE IF EXISTS befriends;
CREATE DATABASE befriends;
USE befriends;
/* create table for account */
CREATE TABLE Account (
accountId int primary key auto_increment,
avatar text,
birthday date,
emailAddress varchar(50) not null unique,
gender varchar(6),
interestGender varchar(6),
password varch... | true |
722048921e3c74ad10fe739e0a85a2882c21a62f | SQL | ashifin72/Dip-project.loc | /opp-diploma.sql | UTF-8 | 3,720 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Мар 25 2020 г., 10:21
-- Версия сервера: 5.7.20
-- Версия PHP: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTE... | true |
1024f48b2dce33943e930a8ca34187ee54dd397d | SQL | merecmoney/DistributedDataBases | /Practice_7/s_03_CAHA_agencia.sql | UTF-8 | 2,053 | 3.46875 | 3 | [] | no_license | --@Autor: Hernández Arrieta Carlos Alberto
--@Fecha creación: 12/Junio/2020
--@Descripción: Creación de la tabla agencia
prompt Conectandose a cahabdd_s1 como usuario caha_particiones_bdd
connect caha_particiones_bdd/caha_particiones_bdd@cahabdd_s1
prompt Creando tabla agencia
create table agencia(
agencia_id ... | true |
5b15c4997f07fa324274517e592e5c53d38b24b8 | SQL | drixen/BANNER_SCRIPT_SHELLS | /UTVSRAT_List.sql | UTF-8 | 1,381 | 3.328125 | 3 | [] | no_license | Select * from utvsrat
where utvsrat_code IN ('IACF','COD1')
order by utvsrat_code
Select * from utrsrat
where utrsrat_SRAT_code IN ('IACF','COD1')
order by utrsrat_SRAT_code
-------------------------------------------
column utvsrat_code heading 'Rate|Code'
column utvsrat_desc heading 'Description'... | true |
4252ae99a426144cf667240836a6f98c713c5e5d | SQL | grahamalytics/hacker-rank-practice | /sql/basic-select/select-by-id.sql | UTF-8 | 178 | 2.84375 | 3 | [] | no_license | -- HACKERRANK SQL: BASIC SELECT
-- https://www.hackerrank.com/challenges/select-by-id/problem
-- Level: EASY
-- Points: 10
-- Result: PASSED
SELECT *
FROM CITY
WHERE ID = 1661;
| true |
9b5f6c104662a5a42e80420968ee9e51995bb212 | SQL | chriskim0926/Employee-Tracker | /schema.sql | UTF-8 | 619 | 3.671875 | 4 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS employee_tracker_db;
CREATE database employee_tracker_db;
USE employee_tracker_db;
CREATE TABLE employee (
id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(100) NULL,
last_name VARCHAR(100) NULL,
role_id integer,
manager_id integer,
PRIMARY KEY (id)
);
CREATE TABLE role (
id I... | true |
bb1a3f0052951b9fcf7f5756c3a1f3ad53df35de | SQL | earlyway/210430oracle | /plsql제어문.sql | UHC | 6,229 | 3.625 | 4 | [] | no_license | create or replace procedure emp_info(p_empno in emp.empno%type)-- in ڷ. ̺.ʵ%type==>ʵ忡 ڷ
is--
v_empno emp.empno%type;
v_ename emp.ename%type;
v_sal emp.sal%type;
begin
select empno,ename,sal into v_empno,v_ename,v_sal from emp
where empno=p_empno;
dbms_output.put_line(':'||v_empno);
dbms_output.put_... | true |
efd1bd3d4ff116e2aa0680c0ffa268768f78b8a1 | SQL | tylerneu/HookKeeper | /sql/migrations/0.sql | UTF-8 | 833 | 2.875 | 3 | [] | no_license | DROP DATABASE IF EXISTS `HookKeeper`;
CREATE DATABASE `HookKeeper`;
use `HookKeeper`;
CREATE TABLE `pull` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `class` (
`id` int(11) unsig... | true |
70a116a00aa29af3d75d0ae5c7fd383ca62dbbb2 | SQL | wtfauonabt/Profile-Site | /src/339_a2/dump.sql | UTF-8 | 3,903 | 3.34375 | 3 | [] | no_license | -- MySQL dump 10.16 Distrib 10.1.16-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: a2
-- ------------------------------------------------------
-- Server version 10.1.16-MariaDB-1~trusty
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULT... | true |
03ebbee545020631dea491bb0bd1e8564b06fd4b | SQL | TihomirIvanovIvanov/SoftUni | /C#DBFundamentals/DB-Basics-MS-SQL-Server/MyExam-19February2017/16. Customers With Countries.sql | UTF-8 | 186 | 3.390625 | 3 | [
"MIT"
] | permissive | CREATE VIEW v_UserWithCountries
AS
SELECT CONCAT(c.FirstName, ' ', c.LastName) AS CustomerName,
c.Age, c.Gender, cc.Name
FROM Customers AS c
JOIN Countries AS cc
ON cc.Id = c.CountryId | true |
bf9661a43ab41dcf223895f148b4d60a9c7316dd | SQL | Eltotino/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/15-comedy_only.sql | UTF-8 | 277 | 3.625 | 4 | [] | no_license | -- Write a script that lists all shows contained in hbtn_0d_tvshows.
-- Select all Comedy shows
SELECT title FROM tv_show_genres tsg
INNER JOIN tv_genres tg
ON tsg.genre_id = tg.id
INNER JOIN tv_shows tvs
ON tsg.show_id = tvs.id
WHERE name = 'Comedy'
ORDER BY title ASC;
| true |
bf0ab0fad6749ae16e4f364138c9da63f9489c67 | SQL | martinmhan/messaging-app-api | /src/database/scripts/002-addEmailColumnToUserTable.sql | UTF-8 | 561 | 3.28125 | 3 | [] | no_license | DROP PROCEDURE IF EXISTS addEmailColumnToUserTable;
DELIMITER $$
CREATE PROCEDURE addEmailColumnToUserTable()
BEGIN
DECLARE emailColumnCount INT;
SET emailColumnCount = (
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_SCHEMA = DATABASE() AND
TABLE_NAME = 'user' AND
COLUMN... | true |
c1d0a6c7119ee5426ab668e7540302a69ca7e696 | SQL | Rosh1903/Hindiji | /shippers.sql | UTF-8 | 15,128 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 06, 2016 at 02:24 PM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... | true |
2de8210f0401b6f4e5ee31dfc5fa41ab145ca3ee | SQL | omkar-falke/Spring-Boot | /DemoLive/sql/stored_procedures/setHML.sql | UTF-8 | 1,864 | 3.203125 | 3 | [] | no_license | -- Generate SQL
-- Version: V5R3M0 040528
-- Generated on: 23/07/08 20:35:03
-- Relational Database: SPLWS01
-- Standards Option: DB2 UDB iSeries
SET PATH "QSYS","QSYS2","FIMS" ;
drop procedure spldata.setHML;
commit;
CREATE PROCEDURE SPLDATA.SETHML (
... | true |
a76af70ef4a560f5914885097347b263ab6b0588 | SQL | spencerrecneps/pfb | /signalized.sql | UTF-8 | 980 | 2.796875 | 3 | [] | no_license | ----------------------------------------
-- INPUTS
-- location: neighborhood
----------------------------------------
UPDATE neighborhood_ways_intersections SET signalized = 'f';
UPDATE neighborhood_ways_intersections
SET signalized = 't'
FROM neighborhood_osm_full_point osm
WHERE neighborhood_ways_... | true |
cb5e60b741eb483abc69690a306a18960e2a8d21 | SQL | Qujh97/anzuke | /anzuke.sql | UTF-8 | 8,004 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 2018-07-29 04:50:43
-- 服务器版本: 10.1.30-MariaDB
-- PHP Version: 7.2.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET... | true |
aa093db55358aecdf80daa64a71610ced5f5dfbb | SQL | Estebankno/angular | /server/DB/dbmysql.sql | UTF-8 | 2,418 | 2.90625 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS movies;
USE movies;
CREATE TABLE movie(
mov_id INT NOT NULL auto_increment PRIMARY KEY,
mov_title VARCHAR(50) NOT NULL ,
mov_year INT NOT NULL,
mov_time INT NOT NULL,
mov_lang VARCHAR(50) NOT NULL,
mov_dt_rel DATE NULL,
mov_rel_country CHAR(5) NOT NULL
);
INSERT INTO `movies`.`movie... | true |
8c1cfe007b6f822f2df0c46aca9a91e198c08a91 | SQL | mypizzaa/mypizza-service | /MyPizzaDAO/build/classes/proven/mypizzadao/myPizza.sql | UTF-8 | 21,119 | 3.578125 | 4 | [] | no_license | DROP USER 'dam1804'@'localhost';
DROP DATABASE dam1804;
CREATE USER 'dam1804'@'localhost' IDENTIFIED BY 'Ew5kaer6';
-- Crear base de dades.
CREATE DATABASE dam1804 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT SELECT, INSERT, UPDATE, DELETE ON dam1804.* TO 'dam1804'@'localhost';
USE dam1804;
... | true |
223147815cfb85ced7b581cc0ab45dda08c8eafc | SQL | yu-minghao/yu-minghao | /admin.sql | UTF-8 | 1,030 | 2.8125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost-3306
Source Server Version : 50717
Source Host : localhost:3306
Source Database : stutea
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2021-06-24 19:53:08
*/
SET FOREIGN_KEY_CHECKS=0;
... | true |
b931d5389eccdab4e7e54930b6ddc8f2eef5a07f | SQL | FelipeLeonardo98/SQL-WEEK---LINKEDIN | /DaySix_Oracle-Indexes_Performance/2 Script Solution.sql | UTF-8 | 1,870 | 3.890625 | 4 | [] | no_license | -- Analyzing Table Student before Index
select * from students order by student_id;
-- COST: 5.393
select * from students where student_id = 703;
-- COST: 3
select * from students where cpf = '45197452186';
-- COST: 1.087
select * from students where age BETWEEN 17 and 31;
-- COST: 1.075
select *... | true |
a6bb006091109dfbddef9dbcee9ea2c40cb5de95 | SQL | aroquemaurel/Lessons-and-doc | /L2/siaweb4/TD/1-3.sql | UTF-8 | 295 | 2.984375 | 3 | [] | no_license | alter table EQUIPE ADD (
np decimal(3),
bt decimal(3),
constraint ck_equipe_bt check(bt >= 0),
constraint ck_equipe_np check(np >= 0)
);
update equipe e1 set np = (select count(*) from projets WHERE projets.ne=e1.ne),
bt = (select sum(pbudget) from projets where projets.ne=e1.ne);
| true |
0a554571b611425e25b7349a0cba4301b1f930d8 | SQL | jain14aditya/Distributed-Systems | /hotels.sql | UTF-8 | 1,078 | 2.734375 | 3 | [] | no_license |
create table hotel_perm (
to_loc varchar(50),
data DATE ,
availability int,
cost int);
insert into hotel_perm values('A','2018-04-12',10,100);
insert into hotel_perm values('A','2018-04-13',10,101);
insert into hotel_perm values('A','2018-04-14',10,102);
insert into hotel_perm values('A','2018-... | true |
f932c5a0542fd870215521e2ae495cf25661d191 | SQL | gucuk/deneme | /28.07-joinli örnek.sql | ISO-8859-9 | 1,418 | 4.15625 | 4 | [] | no_license | --bir sipariin hangi alan tarafndan hangi mteriye hangi kategorideki rnden hangi fiyatta ka adet satldn listeleyiniz.
select (e.FirstName+' '+e.LastName) 'alan',cust.CompanyName 'Mteri',c.CategoryName 'Kategori', od.UnitPrice 'Fiyat',od.Quantity 'Adet' from Orders o
inner join Employees e on e.EmployeeID=o.EmployeeID... | true |
7fad2ff99f8e05b244364cfbfa23236249be0fcb | SQL | ststeiger/CoinBaseSharp | /libCoinBaseSharp/SQL/SELECT_CurrenciesByDate.sql | UTF-8 | 11,753 | 2.609375 | 3 | [] | no_license |
SELECT
--DISTINCT cur_name, ',MAX(CASE cur_name WHEN ''' || cur_name || ''' THEN cur_rate ELSE null END) AS ' || cur_name
-- cur_uid
--,cur_time
--,cur_name
--,cur_rate
cur_time
,MAX(CASE cur_name WHEN 'AED' THEN cur_rate ELSE null END) AS AED
,MAX(CASE cur_name WHEN 'AFN' THEN cur_rate ELSE nul... | true |
ac92248770392ca15056ead79909fdbe9e09bcd8 | SQL | Mahima-M-A/Engineering-Course-ISE | /Semester 5/DBMS Lab/PL-SQL/P3.sql | UTF-8 | 362 | 2.546875 | 3 | [] | no_license | --To check if the entered number is prime or not
set serveroutput on;
declare
n1 number:=#
flag number:=0;
n number;
r number;
begin
n:=n1/2;
for i in 2..n loop
r:=mod(n1,i);
if r=0 then
flag:=1;
end if;
end loop;
if flag=0 then
dbms_output.put_line(n1||' is prime');
else
dbms_output.put_li... | true |
21efec671981201a0b8189ee4e259c9c92b800b2 | SQL | DMilmont/mode | /Mode/roadster/spaces/Team SALES OPS/Lexus FTP Data.5d3b7ca12418/Date Parameter.077f22c1af62.sql | UTF-8 | 314 | 3.015625 | 3 | [] | no_license | SELECT s::date
FROM generate_series(date_trunc('day', now() - '91 days'::interval), date_trunc('day', now()), '1 day') s
{% form %}
start_date:
type: date
default: {{ 'now' | date: '%s' | minus: 604800 | date: '%Y-%m-%d' }}
end_date:
type: date
default: {{ 'now' | date: '%Y-%m-%d' }}
{% endform %} | true |
704399f6110dc77cee4104f2755970bfc40f296e | SQL | ibtissamemme/script-sql | /Archives/Scripts_ORCL/Mise_a_jour_schema/00_T_ORCL_2005.sql | UTF-8 | 7,361 | 2.640625 | 3 | [] | no_license | ALTER TABLE RESIDANTS ADD (NBBDGIMPR NUMBER);
ALTER TABLE HVISITES ADD (
ORIGINEVISITE NUMBER,
NBBDGIMPR NUMBER,
NBBDGIMPRTOTAL NUMBER
);
ALTER TABLE VISITES ADD (
FREE1 VARCHAR2(50),
FREE2 VARCHAR2(50),
FREE3 VARCHAR2(50),
FREE4 VARCHAR2(50),
FREE5 VARCHAR2(50),
FREE6 VARCHAR2(50),
FREE7 VARCHAR2(50),
FREE... | true |
8ade103424a8ad43d4869bed8321fcf46e9750b5 | SQL | adeskmr/SQL | /lab2/query1.sql | UTF-8 | 121 | 3.0625 | 3 | [] | no_license |
SELECT c.customerID, c.custName, c.address
FROM Customers c
WHERE c.custName LIKE '%FAKE%'
AND c.ifValidCustomer = True; | true |
6546b4e3b72e610d4e81f0c7b95f70dfa13a563d | SQL | lorrenzo/exercice-m2 | /sql/Base_projet_OlfatiBank.sql | ISO-8859-1 | 3,463 | 3.890625 | 4 | [] | no_license | -- Supprimer la base si elle existe
DROP DATABASE IF EXISTS OlfatiBank;
-- Crer la base
CREATE DATABASE OlfatiBank;
-- Utiliser la base
USE OlfatiBank;
-- Cration des tables
CREATE TABLE clients
( id_client INT(11) ZEROFILL NOT NULL AUTO_INCREMENT,
civilite VARCHAR (3) NOT NULL,
nom VARCHAR (50) NOT NU... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.