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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
514cf91284f07c734792281c6c65eeee4b70567a | SQL | fengkehh/InCite_Public | /real_data/data_conversion.sql | UTF-8 | 2,553 | 3.890625 | 4 | [] | no_license | /* Importing data from XMLImport */
INSERT INTO InCiteDB.InCiteApp_article(eid, issn, title, journal, publish_date)
SELECT RawArticle.eid, RawArticle.issn, RawArticle.title, RawSource.title, RawArticle.publishDate
FROM XMLimport.Article AS RawArticle, XMLimport.Source AS RawSource
WHERE RawArticle.publicati... | true |
2406516cb0168292831246cf9edee6f0682fd4e7 | SQL | noomkrub/EN_broadcast_stats | /en_broadcast.sql | UTF-8 | 1,985 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.8
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 19, 2016 at 03:43 AM
-- Server version: 5.1.68-community
-- PHP Version: 5.3.24
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
33203193744339d7374bf40bef7eedd6330ff2b6 | SQL | christine-lepird/CrossRedditPosts | /AddSentiment.sql | UTF-8 | 2,646 | 4 | 4 | [
"MIT"
] | permissive |
--takes sentiment score from R and finds average for each post
drop table if exists comment_sentiment_nondistinct;
create table comment_sentiment_nondistinct as
select id,
sub,
url,
postscore,
postposted,
frequency,
comment,
count(*) over(partition by id) as num_comments,
avg(anger) over(partition by id) as... | true |
3d98cb1e059ed07ee701683f7ba11031098add5a | SQL | sunchaserinfo/doctrine-pgsql-ip | /demo/db.sql | UTF-8 | 401 | 2.578125 | 3 | [
"ISC"
] | permissive | create table ip_demo
(
id serial
constraint ip_demo_pk
primary key,
ip inet not null
);
create table ipblock_demo
(
id serial
constraint ipblock_demo_pk
primary key,
ipblock cidr not null
);
create table nullable_demo
(
id serial
constraint... | true |
69110fc52708587ecba3a8e4f1f7265b264de700 | SQL | morten-egan/ninja_rest | /ninja_rest.spec.sql | UTF-8 | 3,009 | 3.203125 | 3 | [] | no_license | create or replace package ninja_rest
as
/** NINJA REST - This is a package to handle most of the internals, when communicating with REST services
* from the PL/SQL.
* @author Morten Egan
* @version 0.0.1
* @project NINJA_REST
*/
p_version varchar2(50) := '0.0.1';
-- Type definitions
type call_request is re... | true |
aea14cc784ddca3f1f1e960f0a1b89099f95ced5 | SQL | thoufee4004/mysql | /insert select.sql | UTF-8 | 413 | 2.8125 | 3 | [] | no_license | CREATE DATABASE college;
CREATE TABLE Persons (
Id int(40),
LastName varchar(54),
FirstName varchar(30),
Address varchar(35),
City varchar(13) NOT NULL
);
INSERT INTO Persons Values('4001','kasi','mala','porure','co');
INSERT INTO Persons Values('4002','frost','jack','nungabakkam','... | true |
e580782fe5b26adb2e9a37782e6e0478990c1ebe | SQL | Mupu/MeetNow | /Projektmappe/DatabaseScript.sql | UTF-8 | 3,212 | 3.96875 | 4 | [] | no_license |
DROP DATABASE meetnow;
CREATE DATABASE IF NOT EXISTS meetnow;
USE meetnow;
CREATE TABLE IF NOT EXISTS Raum (
RaumId INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
Ort CHAR(50) NOT NULL,
anzahlStuhl INT(10) UNSIGNED NOT NULL,
anzahlTisch INT(10) UNSIGNED NOT NULL,
anzahlLaptop INT(10) UNSIGNED NOT NULL,
Whiteboard... | true |
375a54dafcf70f65dfc29f5b8c3cd974956f79ec | SQL | 736229999/src | /github.com/lalala/mimi-server/doc/sql/mimi-buycai.sql | UTF-8 | 2,817 | 2.953125 | 3 | [] | no_license | SET client_min_messages = warning;
SET client_encoding = 'UTF8';
CREATE TABLE ssq (
id SERIAL primary key not null,
issue text NOT NULL,
start_time timestamp with time zone NOT NULL,
end_time timestamp with time zone NOT NULL,
open_time timestamp with time zone NOT NULL,
open_balls text
);
ALT... | true |
c45956298ec2960ed85d8b953182b6ad1bc4a729 | SQL | maiconn/venda-rapida | /VendaRapida/SQLs/Fornecedor.sql | UTF-8 | 627 | 2.75 | 3 | [] | no_license | --
--Fornecedor:
--
-- ID
-- Nome
-- CNPJ/CPF
-- Endereco
-- Bairro
-- Cidade
-- Estado
-- Contato
-- Email
-- Telefone
-- Produtos
-- IDProduto -> referencia tabela produtos
-- Descricao
-- Unidade
-- ValorProdutoFornecedor
DROP TABLE IF EXISTS `fornecedor`;
/*!40101 SET @saved_cs_client = @@character_set... | true |
33e80e61859514592501f6878cc3487a328fd35d | SQL | spudtrooper/urlshortener | /create_database.sql | UTF-8 | 881 | 3.15625 | 3 | [
"MIT"
] | permissive | SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE IF NOT EXISTS `clicks` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`url_id` int(10) NOT NULL,
`timestamp` int(32) NOT NULL,
`ip` varchar(15) NOT NULL,
`referrer` varchar(512) NOT NULL,
`user_agent` varchar(255) NOT NULL,
PRIMARY KEY... | true |
e5d0229ad99e5f8c163a861e1660969198f9e5a8 | SQL | flavioyamada/AlumniProject | /alumni/alumni.sql | UTF-8 | 7,113 | 3.15625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 28-Jun-2019 às 06:22
-- Versão do servidor: 10.1.36-MariaDB
-- versão do PHP: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... | true |
a4e01593ca27212079c9d61775796a36d05c77c3 | SQL | andergabrielsantos/Curso-SQL-SERVER | /SQL SERVER/27 - LEFT JOIN.sql | UTF-8 | 344 | 3.6875 | 4 | [
"MIT"
] | permissive |
-- CONSULTA DE 2 TABELAS COM LEFT JOIN
SELECT CONCAT(FUN.FUN_SOBRENOME, ',',FUN.FUN_NOME) AS NOME_FUNCIONARIO,
FUN.FUN_DATA_NASCIMENTO,
PAC_DATA_INICIAL,
PAC_DATA_FINAL,
CONVERT(TIME(0), PAC.PAC_DATA_FINAL - PAC.PAC_DATA_INICIAL) AS HORAS_TRABALHADAS
FROM FUN_FUNCIONARIOS AS FUN LEFT JOIN PAC_PONTOS_ACESSO AS PAC
ON ... | true |
85b409594b18258ea95054dfbeb41054f509746e | SQL | arielrojasg/baratico | /auditoria.sql | UTF-8 | 5,919 | 3.609375 | 4 | [] | no_license | create database auditoria_supermercado;
use auditoria_supermercado;
create table auditoria(
nombre_tabla varchar(40),
operacion varchar(40),
valor_viejo varchar(50),
valor_nuevo varchar(50),
fecha_actual date,
usuario varchar(20)
);
------------------------- puntos_venta
-- insert
CREATE TRIGGER insertar... | true |
f1a6ef73f28033d55bd1845c0039281514f974d5 | SQL | SheldonZheng/LeetCode | /sql/ActorsAndDirectorsWhoCooperatedAtLeastThreeTimes.sql | UTF-8 | 108 | 2.671875 | 3 | [] | no_license | SELECT
actor_id,
director_id
FROM actordirector
GROUP BY actor_id,director_id
HAVING COUNT(*) >= 3;
| true |
84573ad572b6882e9704b8a650502c8b3a98fa38 | SQL | wangss/du-ma-se | /sql/tb_user_friend.sql | UTF-8 | 484 | 3.3125 | 3 | [] | no_license |
# Created by wangshuisheng on 2015/6/15.
CREATE TABLE tb_user_friend(
uid INT(11) NOT NULL COMMENT 'uid',
friend INT(11) NOT NULL COMMENT 'friend Id',
is_friend TINYINT(2) NOT NULL COMMENT '是否好友,值为1',
add_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
msg VARCHAR(32) COMMENT 'msg',
PRIMARY KE... | true |
4121f947bce670fbd7be1c8d9c35116a7476cbeb | SQL | ppedvAG/Power-Woche-SQL-Server-Abfragen-VC | /Powerwoche_SQL/Powerwoche_SQL/010_DISTINCT.sql | ISO-8859-1 | 1,332 | 3.765625 | 4 | [] | no_license | -- DISTINCT
-- was sind denn alle Lnder, in die geliefert wird?
SELECT Country
FROM Customers
-- Ergebnis: Lnder von allen Kunden, also auch doppelte, wenn mehr als 1 Kunde in einem Land
-- Lsung:
SELECT DISTINCT Country
FROM Customers
-- mehrere Spalten mglich?
SELECT DISTINCT Country, CustomerID
FROM Customers
... | true |
e57eea24c4c8b83c121fafc1550c29c8658c4f56 | SQL | shiinayusuke01/textbook | /setup.sql | SHIFT_JIS | 1,922 | 3.359375 | 3 | [] | no_license | DROP TABLE textbooks CASCADE;
DROP TABLE members CASCADE;
DROP TABLE categories CASCADE;
DROP TABLE inquiries CASCADE;
CREATE TABLE members (
id SERIAL Not Null Primary Key,
last_name Varchar(30) Not Null,
first_name Varchar(30) Not null,
postal Varchar(10) Not null,
address Varchar(100) Not null,
tel V... | true |
f058289086fd1da77a99485e3849349e96952c09 | SQL | CristinaNSSauces/proyectoMtoDepartamentosTema4 | /scriptDB/CreaDAW215DBDepartamentos.sql | UTF-8 | 784 | 3.515625 | 4 | [] | no_license | -- CREACION BASE DE DATOS
-- Creacion de la base de datos DAW215DBDepartamentos
CREATE DATABASE if NOT EXISTS DAW215DBDepartamentos;
-- Creacion de tablas de la base de datos
CREATE TABLE if NOT EXISTS DAW215DBDepartamentos.Departamento (
CodDepartamento VARCHAR(3),
DescDepartamento VARCHAR(255) NOT NULL,... | true |
07823abda078ee5b81c8cda09a39ef82eaaf5381 | SQL | aagarwal-gtr/DBSLabs | /dbslab3.sql | UTF-8 | 3,789 | 3.8125 | 4 | [] | no_license | @ "D:\employee.sql"
@ "D:\restaurant.sql"
SELECT name FROM items WHERE PRICE <= 0.99;
SELECT * FROM items WHERE dateadded > '31-DEC-1999';
SELECT repfname FROM vendors WHERE repfname LIKE 's%';
SELECT companyname FROM vendors WHERE companyname LIKE '%#_%' ESCAPE '#';
SELECT name, price from items where ... | true |
3d93d295f8fb7d090d448cfea0b6d7b7ce4f6d05 | SQL | abigail3306/Study-Buddy | /schema/create.sql | UTF-8 | 985 | 3.09375 | 3 | [] | no_license | DROP TABLE IF EXISTS Test_Score;
DROP TABLE IF EXISTS School;
DROP TABLE IF EXISTS Division;
CREATE TABLE Division (
div_num integer NOT NULL,
div_name text NOT NULL
);
ALTER TABLE Division OWNER TO ateam;
COMMENT ON TABLE Division IS 'All divisions in Virginia';
CREATE TABLE School (
div_num integer... | true |
64003d5a76e2bd4f41d8d5d96112321858153b14 | SQL | bmakendi/Fleuropa | /bmakendi.sql | UTF-8 | 11,947 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Mer 06 Janvier 2016 à 00:11
-- Version du serveur: 5.5.24-log
-- Version de PHP: 5.4.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIE... | true |
e5f68ea53b2b9de6ad242e936df9d0098c51aed7 | SQL | Jellyyyyy/assignment-02-postgis-analytics | /query04.sql | UTF-8 | 1,131 | 4.4375 | 4 | [] | no_license | /*
Using the _shapes.txt_ file from GTFS bus feed, find the **two** routes with the longest trips.
In the final query, give the `trip_headsign` that corresponds to the `shape_id` of this route and the length of the trip.
*/
alter table septa_bus_shapes
add the_geom geometry;
update septa_bus_shapes
set the_geom = st_... | true |
8f8df46b493276c35a1f11ea183b04775642e5d8 | SQL | goncalor/SIBD | /Projeto/part2/queryReadings.sql | UTF-8 | 957 | 4.1875 | 4 | [] | no_license | -- What are all the readings of a patient (identified by his/her number)
-- in the last 6 months from devices with the words "blood pressure"
-- in the description field?
drop procedure if exists queryReadings;
delimiter $$
create procedure queryReadings()
begin
select distinct Wears.patient as 'Patient ID', Readi... | true |
9dc83ba437313c9889b4b85e7a395d3095daa850 | SQL | RAINYBEARD/FINALBOSS | /basededatos/caece_v2_20180818.sql | UTF-8 | 3,530 | 2.921875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64)
--
-- Host: localhost Database: caece
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40... | true |
fdf3bde382245d021f18bf531249147d10f0cc80 | SQL | JeanC7/Servicio-Web | /sql/db.sql | UTF-8 | 1,287 | 3.015625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS projects(
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
name text NOT NULL CHECK(name <> ''),
priority integer NOT NULL,
description text,
deliverydate date NOT NULL
);
CREATE TABLE IF NOT EXISTS tasks(
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENT... | true |
3756d822004b9fdeabb78092b8337091fb37ea0a | SQL | HoTrang123/C0920G1-HoNguyenThuyTrang | /module_3/src/_02_thiet_ke_va_tao_CSDL/thuc_hanh/tao_khoa_chinh.sql | UTF-8 | 434 | 3.421875 | 3 | [] | no_license | drop database if exists thuchanh2;
create database thuchanh2;
use thuchanh2;
CREATE TABLE users(
user_id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(40),
`password` VARCHAR(255),
email VARCHAR(255)
);
CREATE TABLE userroles(
user_id INT NOT NULL,
role_id INT NOT NULL,
-- PRIMARY KEY(user_id,r... | true |
10b30b72c7931e90edf6424212a1313791b13e86 | SQL | aadamini/esercitazione_pc | /127-0-0-1.sql | UTF-8 | 2,754 | 3.53125 | 4 | [
"MIT"
] | permissive | -- Adminer 4.2.5 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
CREATE DATABASE `adamini` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `adamini`;
DROP TABLE IF EXISTS `interventi`;
CREATE TABLE `interventi` (
`id` int(11) NOT NULL AUTO_INCREM... | true |
16589cf721ff6fabdb68903224ec44e4fa7f8a76 | SQL | DanielJechev/SoftUni | /MySQL/Basic CRUD - Exercise/Last 7 Hired Employees.sql | UTF-8 | 111 | 2.515625 | 3 | [] | no_license | USE `soft_uni`;
SELECT `first_name`, `last_name`, `hire_date`
FROM employees
ORDER BY `hire_date` DESC
LIMIT 7; | true |
b7fad4a87c87a58ed9d4ef95511d98d5054b7d17 | SQL | fdoooch/SynapseAnalytics | /sql/YaDir_Base_Daily.sql | UTF-8 | 1,189 | 3.03125 | 3 | [] | no_license | #YaDir_Base_Daily
WITH
YaDir_CNTX_Search_Old AS
(SELECT
Date,
ClientLogin,
CampaignId,
CampaignName,
Impressions,
Cost,
Clicks
FROM
ds_garpun_yandex_direct.yandex_direct_ad_keyword_device_stat_fingarant35_direct),
YaDir_CNTX_Search_New AS
(SELECT
Date,
ClientLogin,
CampaignId,
CampaignName,
Impressions,
Cost,
Clicks... | true |
a288bcf7556ffd461447698cf12c165b0c5350e3 | SQL | pi-module/order | /sql/mysql.sql | UTF-8 | 19,039 | 2.828125 | 3 | [] | no_license | CREATE TABLE `{order}`
(
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`uid` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`code` VARCHAR(16) NOT NULL DEFAULT '',
`type_commodity` ENUM ('product', 'serv... | true |
630f9f804ec7e3aa60b904645e64b04a31fa7d75 | SQL | salungp/simple-crud | /siswa.sql | UTF-8 | 1,741 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 02 Jan 2020 pada 02.35
-- Versi server: 10.4.10-MariaDB
-- Versi PHP: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
6bace4218ed37e2e2a471a05863a5e394df5cc9e | SQL | godwinKvg/gestion | /gestioncontact.sql | UTF-8 | 4,070 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : lun. 24 mai 2021 à 18:55
-- Version du serveur : 10.4.10-MariaDB
-- Version de PHP : 7.4.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... | true |
457ef4d7e8af75bc91f8e7c3ccf7ce317d3836ad | SQL | 9uilherme/familyCareParent | /familycare-back-end/src/main/resources/db/migration/inicial.sql | UTF-8 | 964 | 3.515625 | 4 | [] | no_license | -- Table: flyway_schema_history
CREATE TABLE flyway_schema_history
(
installed_rank integer NOT NULL,
version character varying(50),
description character varying(200) NOT NULL,
type character varying(20) NOT NULL,
script character varying(1000) NOT NULL,
checksum integer,
installed_by character varying(... | true |
45a524a1df7835820f7f01ac942109fbc00a956c | SQL | AdrianRiedl/duckdb | /test/sqlsmith/queries/sqlsmith-26.sql | UTF-8 | 196 | 3.0625 | 3 | [
"MIT"
] | permissive | SELECT
ref_0.r_regionkey AS c0,
ref_0.r_name AS c1,
CAST(nullif (ref_0.r_comment, ref_0.r_name) AS VARCHAR) AS c2
FROM
main.region AS ref_0
WHERE
ref_0.r_name IS NULL
LIMIT 53
| true |
19335224317c0b21ad44ab253f1904cde43c485c | SQL | loganwolf619/Being-There-Drone-System | /DAT-601.FinalHanding.Milton/Database Being There/Procedure C.1.sql | UTF-8 | 492 | 3.125 | 3 | [] | no_license | ----Transaction C1----
---DROP PROCEDURE IF EXISTS TransactionC1;
CREATE PROCEDURE TransactionC1
AS
BEGIN
---USE BEING THERE DATABASE
SELECT ContractorOrganizationName,BTDrone.BTDroneID, BTDrone.BTDroneLongitude, BTDrone.BTDroneLatitude
FROM Contract
JOIN Contractor ON Contractor.ContractorID = Contract.Contractor... | true |
4a88771457dded994977da048c00dc951a288d7d | SQL | mrmurilo75/Data-Bases | /Ficha06/ex15.sql | UTF-8 | 154 | 3.421875 | 3 | [] | no_license | SELECT ACTOR.Name, COUNT(*) AS N
FROM MOVIE
NATURAL JOIN MOVIE_ACTOR
NATURAL JOIN ACTOR
GROUP BY ACTOR.Name
ORDER BY N DESC, ACTOR.Name
LIMIT 20;
| true |
a499881a5e0180b8c7d43eb805e9da15d558955c | SQL | qw1hbmk/pharmaDrugs | /views.sql | UTF-8 | 889 | 3.609375 | 4 | [] | no_license |
create temporary view BrandNameActiveIngredients as
select distinct
BrandName,
ActiveIngredientCode
from DrugProduct, ActiveIngredients
where DrugProduct.DrugCode = ActiveIngredients.DrugCode
;
create temporary view BrandNameConflicts as
select
DrugProduct.BrandName as BrandName,
ActiveI... | true |
e24c8772aa395d5241eea534aedd6790960c0a4e | SQL | abhiwalia15/CSE-Lab-Manual | /V Semester/Database-Management-System/Problem 2/query6.sql | UTF-8 | 278 | 3.71875 | 4 | [
"MIT"
] | permissive | -- Find the aids of all aircraft that can be used on routes from Bengaluru to New Delhi.
SELECT DISTINCT A.aid
FROM Aircraft A
WHERE A.cruisingrange > (
SELECT MIN(F.distance)
FROM Flights F
WHERE
F.ffrom = 'Bengaluru' AND
F.tto = 'New Delhi'
)
;
| true |
0faf02b5b8fce059ad6c3258bedc1d5222bbf07d | SQL | pfmiller/Group-Informatics | /R-Code/MyLyn/SQL/createTnetPRoc2.sql | UTF-8 | 611 | 2.734375 | 3 | [] | no_license | -- --------------------------------------------------------------------------------
-- Routine DDL
-- --------------------------------------------------------------------------------
DELIMITER $$
CREATE DEFINER=`root`@`%` PROCEDURE `getTnetFormattedNetwork_all`()
begin
DECLARE done INT DEFAULT 0;
declare releaseInner ... | true |
7d3daef8d7875685d392388625b9d5d9073c1d38 | SQL | fortytwobinary/recipes | /recipe-data.sql | UTF-8 | 3,341 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | -- data for testing and development
use recipes;
insert into recipes (name, recipe_category_id, description) values ('Caprese Salad', 16, 'A very simple tomato and mozarella salad for two');
insert into measurement_qty (qty) values ('4-1/4');
insert into measurement_qty (qty) values ('2-1/8');
insert into measuremen... | true |
ab8cba18b37acaa542e5a1150ef032db5fb7afc1 | SQL | byez0210/dbsql | /20200929.sql | UTF-8 | 6,389 | 4.25 | 4 | [] | no_license | 실습ana3]
SELECT empno, ename, sal, deptno,
MAX(sal) OVER (PARTITION BY deptno) MAX_sal
FROM emp;
분석함수 사용X
SELECT empno, ename, sal, A.deptno, a.MAX_sal
FROM emp,
(SELECT deptno, MAX(sal) MAX_sal
FROM emp
GROUP BY deptno)a
WHERE emp.deptno = a.deptno;
실습ana4]
SELECT empno, ename, sal, deptno,
... | true |
801e6007910a423176ea368a1e3c967850f4ea50 | SQL | shengxingli/super-star | /project/microcamp.sql | UTF-8 | 15,853 | 3.1875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50718
Source Host : localhost:3306
Source Database : microcamp
Target Server Type : MYSQL
Target Server Version : 50718
File Encoding : 65001
Date: 2019-01-03 14:38:52
*/
SET FOREIGN_KEY_CHECKS=0... | true |
01ecad0e2b0252ccea117ec51697cb9151de4c3e | SQL | sheneral-zz/Web-Interface-to-Database | /sql final.sql | UTF-8 | 5,147 | 4.28125 | 4 | [] | no_license | /* Update Customer's name: */
DELIMITER //
CREATE PROCEDURE UpdateSGCustomerName
(IN oldCustomerLastName Char(25),
IN oldCustomerFirstName Char(25),
IN newCustomerLastName Char(25),
IN newCustomerFirstName Char(25))
BEGIN
DECLARE varRowCount Int;
SELECT COUNT(*) INTO varRowCount
FROM SG_CUSTOMER A... | true |
97c446af449ced499c5e279cf7640268f0ab0ac5 | SQL | AphelionSoftware/Meerkat | /SQL Solution/Aphelion.Meerkat.DB/Meerkat/forms/Tables/PotentialResponse.sql | UTF-8 | 1,225 | 3.21875 | 3 | [] | no_license | CREATE TABLE [forms].[PotentialResponse] (
[PotentialResponseID] INT IDENTITY (1, 1) NOT NULL,
[Name] VARCHAR (50) NOT NULL,
[Code] VARCHAR (50) NOT NULL,
[TextDescription] VARCHAR (MAX) NOT NULL,
[QuestionID] INT NOT NULL,
[Activ... | true |
560b99b22d6d5c5194b0d3b4c5b237b802fa16fb | SQL | Honghm/QuanLyDaiLy | /QL_DaiLyXeMay/csdl.sql | UTF-8 | 5,270 | 3.640625 | 4 | [] | no_license | create database QUANLYDAILY
USE QUANLYDAILY
create table QUAN
(
MaQuan char(4),
TenQuan nchar(50),
constraint quan_ma_pk primary key(MaQuan)
)
INSERT INTO dbo.QUAN
( MaQuan, TenQuan )
VALUES ( 'Q1', N'Quận 1'), ( 'Q2', N'Quận 2'), ( 'Q3', N'Quận 3'), ( 'Q4', N'Quận 4'), ( 'Q5', N'Quận 5'),
( 'Q6', N'Quận 6... | true |
c01a7f6f6fced4260e3e2c63a043cb4b7c9128f1 | SQL | guhrabelo/BancodeDados | /Atividade banco de dados 2/Atividade1.sql | UTF-8 | 894 | 3.3125 | 3 | [] | no_license | create database rh;
use rh;
Create table tb_funcionarios(
id bigint(5) auto_increment,
nome varchar(30),
salario decimal(10,2),
sexo char(1) not null,
telefone int(9),
primary key (id)
);
insert into tb_funcionarios (nome, salario,sexo,telefone) Values ("João",5000.00,'M',985120507);
insert into tb_funcionarios (nome... | true |
598e654d0a922920b517b15cebd6381bc14ef121 | SQL | MikeRena77/sdlw | /SQL/legacyHarvestSQL/numFilesChanged.sql | UTF-8 | 351 | 2.96875 | 3 | [] | no_license | SELECT COUNT(haritem.itemname)
FROM harversion, harenvironment, haritem, harpackage, harpathfullname
WHERE harversion.versionfiletime > '01-OCT-01' AND
harenvironment.envobjid = harversion.envobjid AND
harversion.itemobjid = haritem.itemobjid AND
harpackage.packageobjid = harversion.packageobjid AND
harpathfullnam... | true |
a0afcb6efaf7e53adaf108c4288ae5ddbe87708d | SQL | hany7u/tempsql | /数据库用户占用空间查询.sql | UTF-8 | 335 | 3.5625 | 4 | [] | no_license | select *
from (select owner || '.' || tablespace_name name, sum(b) g
from (select owner,
t.segment_name,
t.partition_name,
round(bytes / 1024 / 1024 / 1024, 2) b,
tablespace_name
from dba_segments t)
where owner not in
('SYS', 'OUTLN', 'SYSTEM', 'TSMSYS', 'DBSNMP', 'WMSYS')
group by owner || '.' || tablespace_name)
or... | true |
a56125b24ff040ccd20b6f57c072577f56211045 | SQL | Typersun/quiz-engine-servlets | /src/main/resources/quiz_db_public_answer.sql | UTF-8 | 484 | 2.859375 | 3 | [] | no_license | create table answer
(
id serial not null
constraint answer_pk
primary key,
question_id integer
constraint answer_question_id_fk
references question
constraint answer_question_option_id_fk
references question_option,
question_... | true |
5a9a3eb1d295f02a5bd56433d03d7bb9096e9307 | SQL | siramvenki/placementsRecordPortal | /placements/placements.sql | UTF-8 | 1,621 | 2.734375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 23, 2017 at 01:47 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... | true |
e3a4e95438383315a58bca671586a59fbe6eec8f | SQL | fandashtic/arc_chennai | /Sivabalan-SQL/SQL_STORED_PROCEDURE/spr_Companywise_Itemwise_BookStock_Rec_Abstract.sql | UTF-8 | 1,550 | 3.59375 | 4 | [] | no_license | CREATE Procedure spr_Companywise_Itemwise_BookStock_Rec_Abstract (@FromDate Datetime, @CompanyID nvarchar(100))
as
CREATE TABLE #temp(CompanyID nvarchar(50), Field4 nvarchar(128), Field5 nvarchar(128), Field6 nvarchar(128), Field7 nvarchar(128))
insert into #temp
Select Reports.CompanyID,
"To... | true |
1cd01d0dc073ab1a26e0005dfbd9c07930f97f4f | SQL | admiral-aokiji/IPL-Analytics | /sql files/5 - points table, powerplay and death-overs tables.sql | UTF-8 | 17,258 | 3.8125 | 4 | [] | no_license | #################### POINTS AND DETAILED_MATCHES TABLE####################
drop table if exists points_table;
drop table if exists detailed_matches;
CREATE TABLE IF NOT EXISTS points_table (
entry_id int unsigned NOT NULL AUTO_INCREMENT,
season mediumint NOT NULL,
team varchar(45) NOT NULL,
matches_played smal... | true |
a2c6f75d1d4918724c66f8844daf3ccda32db1f9 | SQL | KirillBas/MY_SQL | /2.sql | UTF-8 | 310 | 4.25 | 4 | [] | no_license | select project, max(salary_all)
from (
select projects.project_name as project, sum(salary) as salary_all
from developers_projects
join developers on developers.id = developers_projects.developer_id
join projects on projects.id = developers_projects.project_id
group by projects.project_name) as salary; | true |
8b42eb8e6c372627e97b764944dc69f740124a20 | SQL | ToborTheGreat/Repository01 | /stg.sam_neid_cellnum_carrierindex_params.sql | UTF-8 | 1,910 | 3.046875 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = stg, pg_catalog;
DROP INDEX stg.sam_neid_cellnum_carrierindex_para... | true |
b0dd1f54057f2e0bb8872dfd5e4161dfabb11090 | SQL | simonkeng/TournamentResults | /tournament/tournament.sql | UTF-8 | 332 | 2.71875 | 3 | [] | no_license | -- Project 4 in FSND track, Jan 18 2017
DROP DATABASE IF EXISTS tournament;
CREATE DATABASE tournament;
\c tournament
create table players (
id SERIAL primary key,
name text
);
create table matches (
match_id SERIAL primary key,
winner_id SERIAL REFERENCES Players,
loser_id SERIAL REFERENCES ... | true |
7b69c38dc94ab5dc538c47741f63d751b9132286 | SQL | bravesoftdz/reparaciones | /sql/tablas.sql | UTF-8 | 872 | 2.921875 | 3 | [] | no_license | CREATE TABLE Clientes (
id INTEGER PRIMARY KEY NOT NULL
, Nombre varchar(500)
, Organizacion varchar(500)
, documento varchar(50)
, Domicilio varchar(500)
, Telefono varchar(100)
, email varchar(100)
, notas varchar(2000)
, bVisible integer default 1
);
CREATE TABLE Equipos (
id INTEGER PRIMARY KEY NOT ... | true |
f8dc44a9c41a8aed798f2d4ad814762594973ae0 | SQL | charlesgilfeather/CourseConstructor | /db/queries.sql | UTF-8 | 775 | 4.6875 | 5 | [] | no_license | -- 1. For each course, list all the prerequisites of that course.
select c.cno, p.prerequisite_cno
from course c
left join course_prerequisite p
on c.cno = p.cno
group by c.cno, p.prerequisite_cno
order by c.cno asc;
-- 2. For each department, list the total numbers of students, total number of credit hours taken by t... | true |
4bc379e320b9abf6d37452a9f9280da0399d8803 | SQL | johnloberger/sql-table-relations-crowdfunding-join-table-lab-chi01-seng-ft-051120 | /lib/insert.sql | UTF-8 | 1,982 | 2.921875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | INSERT INTO users (id, name, age) VALUES (1, 'John', 15), (2, 'Johnny', 33), (3, 'Jones', 55), (4, 'James', 22),
(5, 'Jordan', 23), (6, 'Solange', 24), (7, 'Amanda', 21), (8, 'Tory', 35), (9, 'Momo', 43), (10, 'Lucas', 67),
(11, 'Jonathan', 25), (12, 'Hunter', 20), (13, 'Zach', 46), (14, 'Syd', 69), (15, 'Ashe', 10),... | true |
a49684a8ea54311d9b0095bfc0031f5ea0963d06 | SQL | Echelon77/datahub | /metadata-ingestion/tests/integration/trino/setup/hive_setup.sql | UTF-8 | 1,759 | 3.875 | 4 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause",
"MIT"
] | permissive | CREATE DATABASE IF NOT EXISTS db1;
CREATE DATABASE IF NOT EXISTS db2;
-- Setup a "pokes" example table.
CREATE TABLE IF NOT EXISTS db1.pokes (foo INT, bar STRING) PARTITIONED BY (baz STRING);
LOAD DATA LOCAL INPATH '/opt/hive/examples/files/kv1.txt' OVERWRITE INTO TABLE db1.pokes PARTITION (baz='dummy');
CREATE TABLE ... | true |
f445822d4aa0252de06ed8b8a35e2a894577b06d | SQL | CUBRID/cubrid-testcases | /sql/_09_64bit/_02_bigint/cases/1047.sql | UTF-8 | 2,189 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | --to_char()
create class test_class (bigint_col bigint, char_col char(10));
insert into test_class(bigint_col, char_col) values (0, 'zero');
insert into test_class(bigint_col, char_col) values (100, 'plus');
insert into test_class(bigint_col, char_col) values (-100, 'minus');
insert into test_class(bigint_col, char_col... | true |
c2927d435e0375cad1f56cfd8eb260fdb5e62844 | SQL | Scapin-Raul/2s2019-sprint-1-bd | /SSolve/M_02_RaulScapin_DML.sql | ISO-8859-1 | 1,232 | 3.171875 | 3 | [] | no_license | USE M_SSolve
INSERT Clientes(NomeFantasia,Cnpj,RazaoSocial,Endereco)
VALUES('Senai',111,'SERVIO NACIONAL DE APRENDIZAGEM INDUSTRIAL','Rua AAA'),('Sesi',222,'SERVIO SOCIAL DA INDUSTRIA','Rua BBB'),('Habib s',333,'Ms Arabian Food Industria E Comercio De Alimentos Ltda','Rua CCC'),('Uber',444,'UBER DO BRASIL TECNOLOGIA ... | true |
06d6b03724e805cdc3d7fb5cae0085b0f31dd221 | SQL | 361382300/SQL-procedures | /国内LK查询语句new.sql | UTF-8 | 1,418 | 3.375 | 3 | [] | no_license | select d.documentnumber,
d.dateofissue,
d.reasoncode,
c.couponid,
c.reasonsubcode,
c.settlementauthoration,
c.involuntary,
c.couponnumber,
c.status,
fc.marketingcarrier,
fc.flightno,
fc.carrier,
fc.flightdate,
fc.originairport,
... | true |
220490abb586f360f6d2e1fd16e397e5f66713f1 | SQL | FoxComm/highlander | /phoenix-scala/sql/V1.020__create_order_lock_events_table.sql | UTF-8 | 264 | 2.703125 | 3 | [
"MIT"
] | permissive | create table cart_lock_events (
id serial primary key,
cart_ref text references cords(reference_number) on update restrict on delete restrict,
locked_at generic_timestamp,
locked_by int references store_admins(id) on update restrict on delete restrict
);
| true |
2f121e02925136853eeab114f81d7a1393dd6c19 | SQL | DiWu9/Course-Recommendation-Database-by-CSSA | /suggestions.sql | UTF-8 | 503 | 3.40625 | 3 | [] | no_license | -- Chapter 14
-- 14.1, 14.2: set up db of courses; need to determine features
-- 14.3: set up data table of each feature on a course
-- 14.4: insert data into the table(s)
-- 14.5: select data from the table(s); REGEXP; patterning; index
CREATE DATABASE courses{
course_prefix: CHAR;
course_number: NUMBER(500);
... | true |
4d9b40cb3ba8302f03615f91bf023a1878738b4f | SQL | HaiNguyen3112/C0420G1-NguyenVanHai-Module3 | /create_primary_and_foreign_key.sql | UTF-8 | 731 | 3.828125 | 4 | [] | no_license | create database second_database;
use second_database;
create table users(
user_id int auto_increment primary key,
username varchar(40),
password varchar(255),
email varchar(255)
);
create table roles(
role_id int auto_increment,
role_name varchar(50),
primary key(role_id)
);
create table userrole(
user_id int not null... | true |
7692a77abd579ddeb8f3238fbfaa7d8efed00b24 | SQL | nafis00141/Computer-Store-Management-System | /cart and sell functions.sql | UTF-8 | 5,761 | 3.65625 | 4 | [] | no_license |
create or replace package cart_sell_package as
procedure show_cart;
procedure empty_cart;
function add_to_cart(pro_code product_info.product_code%TYPE)
return number;
function delete_from_cart(pro_code product_info.product_code%TYPE)
return number;
procedure show_recept(purch_id in pur... | true |
4dfc8fdbfdc8232f58acc4bc11b720fcddeac735 | SQL | BlaskoEric/CSE572-Database-Systems | /fastcab Database Project/get_comments.sql | UTF-8 | 1,547 | 3.125 | 3 | [] | no_license | spool tableDesc.txt
COLUMN table_name FORMAT A20
COLUMN column_name FORMAT A20
COLUMN comments FORMAT A40 WRAPPED
SET LINESIZE 132
SET PAGESIZE 55
-- Query comments of table
-- This query will show all your project’s tables made in your account.
SELECT table_name, table_type, comments
FROM us... | true |
e843b38c6fd738477c9ec93e52dbf413f2da7a46 | SQL | ramaferdyan/modules-database | /database/online_shop1.sql | UTF-8 | 13,779 | 3.015625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 03 Jul 2020 pada 03.30
-- Versi server: 10.1.34-MariaDB
-- Versi PHP: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... | true |
ecab6c85b5c4036b4c8257df2bbd5df4b7d82fbc | SQL | apuc/add_user | /filds.sql | UTF-8 | 1,897 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10.2
-- http://www.phpmyadmin.net
--
-- Хост: phototim.mysql.ukraine.com.ua
-- Время создания: Июн 30 2015 г., 13:38
-- Версия сервера: 5.1.72-cll-lve
-- Версия PHP: 5.2.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... | true |
6b37b539f08573099c015c94008b31df84f5caf9 | SQL | develanton/godinezbook | /models/godinezbook.sql | UTF-8 | 351 | 2.796875 | 3 | [] | no_license | DROP DATABASE IF EXISTS godinezbook;
CREATE DATABASE godinezbook;
USE godinezbook;
CREATE TABLE usuarios (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(50) NOT NULL,
mail VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE posts (
id INT NOT NULL AUTO_INCREMENT,
post TEXT NO... | true |
10b84e0db4fd77418b19b71b3f590e1300dd8eef | SQL | LBHackney-IT/housing-needs-collab-casework-api | /schema.sql | UTF-8 | 692 | 3.6875 | 4 | [] | no_license | CREATE TABLE contacts
(
id SERIAL PRIMARY KEY,
name VARCHAR(128) NULL,
number VARCHAR(32) NOT NULL,
jigsaw_id INTEGER NULL
);
CREATE UNIQUE INDEX contacts_number ON contacts(number);
CREATE UNIQUE INDEX contacts_jigsaw_id ON contacts(jigsaw_id);
CREATE TABLE users
(
id SERIAL PRIMARY KEY,
username VARCHAR(... | true |
64599ca0a65520ab6283f0bcabc6f7c89088d9cc | SQL | jimmy-oss/wildlife-tracker | /create.sql | UTF-8 | 390 | 2.59375 | 3 | [
"MIT"
] | permissive | CREATE DATABASE wildlife_tracker;
\c wildlife_tracker;
CREATE TABLE IF NOT EXISTS sightings (
id SERIAL PRIMARY KEY,
category VARCHAR,
species VARCHAR,
location VARCHAR,
health VARCHAR,
age VARCHAR,
ranger VARCHAR,
date_sighted VARCHAR
);
CREATE TABLE IF NOT EXISTS animals (
id SERIAL PRIMARY KEY,
species VARCHAR
);
... | true |
f7b8a59ab2d51b14bdeab10c50e0250f36291f5f | SQL | SkillsFundingAgency/DC-Data-LARS | /src/ESFA.DC.Data.LARS.Database/Core/Tables/LARS_LearningDeliveryCategory.sql | UTF-8 | 752 | 3.171875 | 3 | [
"MIT"
] | permissive | CREATE TABLE [Core].[LARS_LearningDeliveryCategory] (
[LearnAimRef] VARCHAR (8) NOT NULL,
[CategoryRef] INT NOT NULL,
[EffectiveFrom] DATE NOT NULL,
[EffectiveTo] DATE NULL,
[Created_On] DATETIME NOT NULL,
[Created_By] VARCHAR (100) NOT NULL,
[... | true |
8bdc784257535be42ead09fc004ff3d13eed8e6a | SQL | brunarafaela/aulas_laboratorio_banco_de_dados | /atividade06_correcao.sql | UTF-8 | 3,766 | 4.15625 | 4 | [] | no_license | /**********************************
Atividade 6 - Banco de Dados Objeto-Relacional : Com as instruções SQL para tipos e tabelas tipadas no Objeto Relacional
a) Defina um tipo para turma e a respectiva tabela tipada, com uma referência para o objeto curso.
Popule com duas linhas a tabela tipada.
Turma(num_turma(PK... | true |
96950fb9209346879649afcce8c7738c1e639233 | SQL | nicooffee/ayudantia_adaw | /database_ejemplo/sql_ejemplos.sql | UTF-8 | 489 | 3.34375 | 3 | [] | no_license | -- Tabla usuario
-- Atributos:
-- id, pass, fecha_registro
CREATE TABLE IF NOT EXISTS "USUARIO"
(
"usu_id" varchar(30) NOT NULL,
"usu_pass" varchar(20) NOT NULL,
"usu_fecha_registro" timestamp NOT NULL,
CONSTRAINT "PK_USUARIO" PRIMARY KEY ("usu_id")
);
-- INSERT INTO PUBLIC."USUARIO" (usu_id,usu_pass,usu_fe... | true |
aa558a8d3fef5cc99b7923e255857e769e91b975 | SQL | opitzconsulting/orcas | /orcas_sqlplus_core/sqlplus_api/sql/declare_partition.sql | UTF-8 | 6,618 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | @@default_include
declare
--API:
-----------------------------------------------------------------------
v_table_name varchar2(30) := substr(upper('&1'),1,30);
v_partition_name varchar2(30) := substr(upper('&2'),1,30);
v_partition_values varchar2(2000) := substr('&3',1,2000);
v... | true |
0b6300a5c611f85c11f162e2b3c620fd4522b123 | SQL | cyberstormdotmu/seconds | /Lapwing git/Lapwing/db-scripts/src/demo/resources/V20160211104300__add_product.sql | UTF-8 | 4,613 | 3.015625 | 3 | [] | no_license | INSERT INTO PRODUCTS(PRODUCT_CODE, NAME, DESCRIPTION, CATEGORY_ID, VENDOR_ID,PRODUCT_STOCK, TERMS_AND_CONDITIONS,REVIEW,SUITABILITY,PROCESS_NOTIFICATION,SUBMIT_NOTIFICATION)
VALUES ('HPPAVILION550Z',
'HP Pavilion 550z Windows 7 Desktop',
'While other towers have been standing still, HP has revolutionize... | true |
8a0fb5adfc9c294f6368246cd16e6f17ec393c73 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day08/select1644.sql | UTF-8 | 270 | 2.9375 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='WiFiAP' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['3044','2243','3100_2','2074','5068','3026','5100_6','4008','2100_1','3100_8'])
| true |
83cbfe55f1c0d297d77c8a595a824da86e30e2cc | SQL | dibley1973/StoredProcedureFramework | /Examples/Dibware.StoredProcedureFramework.Examples.Database/app/Stored Procedures/TenantGetForId.sql | UTF-8 | 469 | 3.015625 | 3 | [
"MIT"
] | permissive |
-- =============================================
-- Author: Duane Wingett
-- Create date: 2015/11/12
-- Description: Gets the Tenant for the specified tenant id
-- =============================================
CREATE PROCEDURE [app].[TenantGetForId]
@TenantId INT
AS
BEGIN
SELECT [TenantId]
, ... | true |
48f9beb12c162d5d142e467b275891f1a0980586 | SQL | alam93mahboob/castor | /castor/tags/DEV0_8/castor-2002/castor/src/tests/jdo/create.sql | UTF-8 | 975 | 2.78125 | 3 | [] | no_license | create table test_table (
id int not null,
first varchar(200) not null,
second varchar(200) not null
);
create unique index test_table_pk on test_table ( id );
create table test_master (
id int not null,
value varchar(200) not null,
one_of int not null
);
create unique index test_master_pk on t... | true |
859178955d3f0b5c73bfc139a021ffb512387021 | SQL | dandraden/Database-Scripts | /Oracle/sql/perf1.sql | UTF-8 | 861 | 3.28125 | 3 | [] | no_license | REM Reduce the Reloads and try to increase the hit ratios to above 85%
ttitle center 'LIBRARY CACHE STATS' skip 2
column namespace format a8 heading 'Library'
column gets format 999,999,990 heading 'GETS'
column gethits format 999,999,990 heading 'GETHITS'
column gethitratio format 99.90 heading 'GET|HIT|RATIO'
... | true |
6e0fd0a382d9e465fb8ba01731abfa17c2f72944 | SQL | denismilovanov/V | /db.schema/vmeste/schemas/vk/tables/audio_artists_vk.sql | UTF-8 | 329 | 3.15625 | 3 | [] | no_license | -------------------------------------------------------------
-- исполнители
CREATE TABLE vk.audio_artists_vk (
id integer NOT NULL DEFAULT nextval('vk.audio_artists_vk_id_seq'::regclass) PRIMARY KEY,
name varchar NOT NULL
);
CREATE UNIQUE INDEX
ON vk.audio_artists_vk
USING btree(vk.prepare(name));
| true |
55750a7e5e61d9cae2df3e8b385517b77d13474a | SQL | bodii/test-code | /go/leetcode_go/1873.Calculate_Special_Bonus/Solution01.sql | UTF-8 | 174 | 2.90625 | 3 | [] | no_license | # Write your MySQL query statement below
select employee_id, if(substr(name, 1,1) != 'M' and employee_id%2=1, salary, 0) as bonus
from Employees
order by employee_id asc;
| true |
ec0569d4a31ff4759bf1e9359463603b1e07ed12 | SQL | PratikRaut15/speed-elixia-project | /databasescripts/16_group.sql | UTF-8 | 539 | 2.6875 | 3 | [] | no_license | -- Insert SQL here.
CREATE TABLE IF NOT EXISTS `group` (
`groupid` int(11) NOT NULL AUTO_INCREMENT,
`groupname` varchar(100) NOT NULL,
`customerno` int(11) NOT NULL,
`userid` int(11) NOT NULL,
`isdeleted` tinyint(1) NOT NULL,
`timestamp` datetime NOT NULL,
PRIMARY KEY (`groupid`)
) ENGINE=MyISAM DEFAULT ... | true |
3983f7a44e4969ad4bdb9c73d89abc16e958839a | SQL | defnico/Grad-School | /SQL/Nico_Filip-Sanchez_d.sql | UTF-8 | 140 | 3.03125 | 3 | [] | no_license | select distinct facility_name
from inspections
where facility_id not in (
select facility_id
from violations)
order by facility_name asc;
| true |
1f6c12e6160ae23e58035e5d0c83637b593eb94f | SQL | mcoindreau/database-exercises | /select_exercise.sql | UTF-8 | 915 | 3.765625 | 4 | [] | no_license | use codeup_test_db;
SELECT 'The name of all albums by Pink Floyd' AS '';
SELECT * FROM albums WHERE ARTIST LIKE 'PINK FLOYD';
SELECT '';
SELECT 'The year Sgt. Pepper''s Lonely Hearts Club Band was released' AS '';
SELECT DATE_FORMAT(release_date, '%Y') AS 'Release Year' FROM albums WHERE NAME LIKE 'Sgt.%' ;
SELECT '... | true |
b049f8d0442fcd11f42c617e8863f10112f4399b | SQL | woori3104/nomadcoffee-backend | /prisma/migrations/20210602090032_add_created_at_updated_at/migration.sql | UTF-8 | 1,184 | 3.265625 | 3 | [] | no_license | /*
Warnings:
- You are about to drop the column `userId` on the `CoffeeShopPhoto` table. All the data in the column will be lost.
- Added the required column `updatedAt` to the `Category` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to t... | true |
80ea8dc02399c4bc7e18a5b9840ec44e86a72839 | SQL | wengyanqing/ssb | /flattened/queries/Q2.1.sql | UTF-8 | 228 | 3.03125 | 3 | [] | no_license | SELECT
sum(LO_REVENUE),
toYear(LO_ORDERDATE) AS year,
P_BRAND
FROM lineorder_wide
WHERE (P_CATEGORY = 'MFGR#12') AND (S_REGION = 'AMERICA')
GROUP BY
year,
P_BRAND
ORDER BY
year ASC,
P_BRAND ASC | true |
836b4c5bd8d66f3869b85de5c74829cbb0f448e3 | SQL | robertoalencar/portalchamados | /portalchamados/aep/Script Criação.sql | ISO-8859-1 | 6,955 | 3.21875 | 3 | [] | no_license | -- Criao de Sequences
CREATE SEQUENCE TICKET_SEQ;
CREATE SEQUENCE ORIGEM_CHAMADO_SEQ;
CREATE SEQUENCE PRIORIDADE_SEQ;
CREATE SEQUENCE SETOR_SEQ;
CREATE SEQUENCE SISTEMA_SEQ;
CREATE SEQUENCE STATUS_COPERGAS_SEQ;
CREATE SEQUENCE STATUS_FORNECEDOR_SEQ;
CREATE SEQUENCE STATUS_SEQ;
CREATE SEQUENCE TICKET_CATEGORI... | true |
f03ad0cb94fc6d080faec91f43faa369785516ae | SQL | zaifei5/Document | /DataBase/database/51CTO下载-50个常用sql语句.sql | GB18030 | 1,399 | 4.21875 | 4 | [] | no_license | create database school
create table Student(Sid int identity primary key,Sname varchar(20),Sage varchar(20),Ssex varchar(20))-- ѧ
create table Course(Cid int identity primary key,Cname varchar(20),Tid int references Teacher(Tid))-- γ̱
create table SC(Sid int primary key identity,Cid int references Course(Cid),score... | true |
8aaea114d6828c51780b522b2e10c28ab53ac62c | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day10/select1221.sql | UTF-8 | 178 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-09T12:21:00Z' AND timestamp<'2017-11-10T12:21:00Z' AND temperature>=25 AND temperature<=96
| true |
961253bab50636dfd11287023ebe08c4a4b924f7 | SQL | Atish0007/twtter_assignment | /Mysql_database/twitter.sql | UTF-8 | 3,216 | 3.1875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 06, 2020 at 11:56 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
db31579d1b0fb65272a69f2ac60295367c8ccbc4 | SQL | GottMusIg/GottMusIgMultimodul | /database-service/src/main/resources/create_tables.sql | UTF-8 | 9,962 | 3.09375 | 3 | [] | no_license | CREATE TABLE `account` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`password` VARCHAR(64) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `name_UNIQUE` (`name` ASC))
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
-- -----------------------------------------------------
-- Table `gmidb`.`wowc... | true |
07beb882538bacb8e6111473ca365a6c1f628d71 | SQL | TaillandierCamille/repositoryLisa | /lisa.sql | UTF-8 | 10,017 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Client : 127.0.0.1
-- Généré le : Jeu 13 Avril 2017 à 12:32
-- Version du serveur : 5.7.14
-- Version de PHP : 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_S... | true |
1d5a292cec55027bdac3b9e71441cf5e74473d35 | SQL | szkonopka/ergast-f1-analysis-project | /layers/data-storage/create-hive-ergast-db-tables.sql | UTF-8 | 1,311 | 2.875 | 3 | [] | no_license | set hive.vectorized.execution.enabled = true;
set hive.vectorized.execution.reduce.enabled = true;
set hive.execution.engine=tez;
set hive.tez.java.opts="-server -Xmx512m -Djava.net.preferIPv4Stack=true";
set hive.tez.container.size=512;
CREATE TABLE IF NOT EXISTS ergast_results.circuits(
circuitId varchar(50),
na... | true |
a3dd02bdcc5fbcca28e2eb3bfc1444a27f883891 | SQL | douit/cqes_dev | /重庆二师_Dev/dw_mpp/table/fdm/edu_hb_wjfl.sql | UTF-8 | 1,699 | 2.671875 | 3 | [] | no_license | /*
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: wu.yabing@h3c.com
# COMPANY: h3c.bigdata
# VERSION: 1.0
# CREATED: 2017/08/08
# REVIEWER:
# REVISION: ---
*/
-- ----------------------------
-- Table structure for edu_hb_wjfl
--... | true |
a427a387162e7e136c7139aa870043875683723e | SQL | akertek/SQL-Server | /Day3.sql | UTF-8 | 7,051 | 4.1875 | 4 | [] | no_license | -- Day 3 --
-- Person.Person tablosu BusinessEntityID, FirstName, MiddleName, LastName last name 3. basamağı o ya da a olanlar
SELECT*
FROM Person.Person
WHERE LastName LIKE '__[ao]%'
-- last name ja ile başlayıp es ile bitenler
SELECT*
FROM Person.Person
WHERE LastName LIKE 'ja%es'
-- last name ja ile başlayıp ... | true |
22c01c1538e0f519cf9ae6fd62b25c0621c378e5 | SQL | radtek/abs3 | /sql/mmfo/bars/Script/patch_ebk_tbl.sql | UTF-8 | 5,621 | 3.4375 | 3 | [] | no_license | SET SERVEROUTPUT ON SIZE UNLIMITED FORMAT WRAPPED
SET FEEDBACK OFF
SET DEFINE OFF
SET TIMING ON
SET TRIMSPOOL ON
declare
l_d_qty pls_integer := 0;
l_u_qty pls_integer := 0;
begin
for c in ( select g.ROWID as RID
, g.KF
, g.RNK
... | true |
853723f1d950ffa87e361f2f974d305b1618ab91 | SQL | maron6/SEIDR | /SEIDR.Database/SEIDR/Views/vw_Repetition.sql | UTF-8 | 604 | 3.796875 | 4 | [
"MIT"
] | permissive | CREATE VIEW SEIDR.vw_Repetition
AS
SELECT g.RepetitionGroupID, g.Description [RepetitionGroup], c.RepetitionGroupSize,
g.AllowLateRegistration, g.HourInterval, g.MinuteInterval,
r.RepetitionID, i.Description [RepetitionIntervalType], RepetitionInterval
FROM SEIDR.RepetitionGroup g
CROSS APPLY(SELECT COUNT(*... | true |
e36862a03baf5eca4b79084ce2a6e6515c4b499b | SQL | Open-Source-Program/Be-Social | /iteration-project_postgres_create.sql | UTF-8 | 3,923 | 4.15625 | 4 | [] | no_license | CREATE TABLE users
(
"userid" serial PRIMARY KEY,
"username" varchar NOT NULL CHECK ( username <> ''),
"firstname" varchar NOT NULL CHECK ( firstname <> ''),
"lastname" varchar NOT NULL CHECK ( lastname <> ''),
"profilephoto" varchar NOT NULL,
UNIQUE ( username )
);
SELECT setval('users_userid_seq', 1, ... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.