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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
57aafef66444c0c80046e17201f8043dc5c164cd | SQL | gopz25/SQL-Test-databricks | /notebook/SQL Gopi Test.sql | UTF-8 | 3,955 | 2.8125 | 3 | [] | no_license | -- Databricks notebook source
DROP TABLE IF EXISTS diamonds;
CREATE TABLE diamonds USING CSV OPTIONS (path "/databricks-datasets/Rdatasets/data-001/csv/ggplot2/diamonds.csv", header "true")
-- COMMAND ----------
-- MAGIC %python
-- MAGIC
-- MAGIC diamonds = spark.read.csv("/databricks-datasets/Rdatasets/data-001/cs... | true |
4cd2b19a5553c1fa535868169ff00e3baae4dfc7 | SQL | bloriot97/codebuff | /output/tsql_noisy/1.4.14/sel_DeadLinkedServers.sql | UTF-8 | 560 | 3.75 | 4 | [
"BSD-2-Clause"
] | permissive | SELECT CONVERT(nvarchar(14), sls.SourceServer) AS SourceServer
, CONVERT(nvarchar(16), sls.DestinationServer) AS DestinationServer
, sls.LastUpdate
FROM t_server s
JOIN SQLLinkedServers sls ON s.server_name = sls.DestinationServer
WHERE s.active = '0'
order by 1,2
SELECT ServerName
, DBName
, Da... | true |
95fdfd2276e55f0fea4706c242aa7df13218e1c8 | SQL | harrypatrick94/Album-orm-site | /artists.sql | UTF-8 | 389 | 2.859375 | 3 | [] | no_license |
DROP TABLE IF EXISTS artists;
CREATE TABLE artists ( -- create table and add rows
id INTEGER PRIMARY KEY AUTOINCREMENT, -- take care of IDs for us
name TEXT,
formed INTEGER,
together BOOLEAN,
photo TEXT
);
INSERT INTO artists (name, formed, together, photo) -- insert first artist in
VALUES (
"Joy Di... | true |
e10a8fc3e5e3228dd9dbd06177a99675547c1069 | SQL | fabricioeliasbr/ScriptVideogame | /Script VideoGame Finalizado.sql | UTF-8 | 2,714 | 3.25 | 3 | [] | no_license | drop database videogame;
create database videogame;
use videogame;
create table videogame(
id_videogame int primary key not null auto_increment,
modelo_videogame varchar(20),
NS_videogame varchar(24)
);
create table jogos(
id_jogos int primary key not null auto_increment,
nome_jogo varchar(30),
descricao_jog... | true |
e30be60a2e27459a4aeae96a323c2a8264da668b | SQL | Spntrx/EmployeeTracker | /seed.sql | UTF-8 | 622 | 2.53125 | 3 | [] | no_license | INSERT INTO department VALUE (1, "President" );
INSERT INTO department VALUE (2, "HR" );
INSERT INTO department VALUE (3, "Engineer" );
INSERT INTO department VALUE (4, "Sales" );
INSERT INTO role VALUES(1,"Senior Developer", "70000.00", "1");
INSERT INTO role VALUES(2,"Junior Developer", "30000.00", "2");
INSE... | true |
b62c6df1194e7ecbbc5413a78a1f3c7fe644be91 | SQL | TheGitBrancher/obudai-nagyv-21-tav-kiss-peter | /cookbook-app/src/main/resources/data.sql | UTF-8 | 2,534 | 3.4375 | 3 | [] | no_license | --Users
insert into user (id, dtype, username, password) values
(1, 'Cook', 'gipszjakab', '$2a$12$aXhL/SbUJR7iyPaAqxgZd.hbfc1qVujsq0mF7sPYTxeRk3wrFQCb6'),
(2, 'Cook', 'palkata', '$2a$12$aXhL/SbUJR7iyPaAqxgZd.i4vYEzhaXQLYGxmSRArJH4lo7TaNzCe');
create table authorities (
username varchar(256) references user... | true |
7bade8c60fb97e16c68fae54d2711d7262a8312d | SQL | okcoders/data_analysis_fall2019 | /classes/week1/solutions_s2.SQL | UTF-8 | 1,214 | 4.53125 | 5 | [] | no_license | -- In-Class Exercises
-- Please use the "company_employees_plus.db" database to answer all questions.
/*
Which counry accounts for the highest percentage of the population of the continent
it sits on?
*/
SELECT country, ((ct.population * 1.0) / cn.population) as pop_ratio
FROM country_master ct
INNER JOIN continen... | true |
bd9fcfe392ae820faefa73f1301bfd70b6c03d9e | SQL | Karmaqueda/SGFENS_BAFAR-1 | /build/web/scripts/SGFENS_CR.sql | UTF-8 | 39,762 | 3.515625 | 4 | [] | no_license |
CREATE DATABASE `cr_bafar`;
USE `cr_bafar`;
-- copiamos contenido de bd facturav3
-- a nueva bd cr_bafar
-- Cesar Martinez 09-06-2016
-- Tablas para formularios dinámicos
CREATE TABLE cr_grupo_formulario(
`id_grupo_formulario` INT NOT NULL AUTO_INCREMENT COMMENT 'ID unico de tabla',
`nombre` VARCHAR(50) ... | true |
2830ca63c46136ff2faa10e955ced339cea9a055 | SQL | tautvydascoding/2019-01 | /dirbame_cia/diena_14/Darius mysql/SQL funkcijos.sql | UTF-8 | 1,907 | 3.90625 | 4 | [] | no_license | -- komentaras, duomenu bazes valdomos SQL kalba
select * from Customers; --visi customers stulpeliai su *
SELECT ContactName, Country
FROM Customers; -- ContactName, Country eilutes, kuriu norim pamatyti is customer lenteles
SELECT Customers.City, Categories.Description
FROM Customers, Categories -- is dvieju lente... | true |
b640eba4462ea76a3c4fba87bb3859ca318a245c | SQL | Alvgarsot/proyectoms2 | /DB/msalvaro.sql | UTF-8 | 9,857 | 2.765625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 28-02-2016 a las 23:17:17
-- Versión del servidor: 5.6.21
-- Versión de PHP: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... | true |
597138a436ad31c61a0d2c49869a5ea99479fc18 | SQL | Berabjesus/SQL-ZOO | /SQL_ZOO_Problems_0_to_4.sql | UTF-8 | 5,928 | 4.375 | 4 | [
"MIT"
] | permissive | -- Problem 0 SELECT basics
-- 1
SELECT population
FROM world
WHERE name = 'Germany' -- 2SELECT name,
population
FROM world
WHERE name IN ('Sweden', 'Norway', 'Denmark');
-- 3
SELECT name,
area
FROM world
WHERE area
BETWEEN 200000
AND 250000
-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_... | true |
d40c815beaec5ca5e799a34dad7ec7280a2c616d | SQL | vcavallo/flatiron-assignments | /sql_quiz/insert.sql | UTF-8 | 1,752 | 3.21875 | 3 | [] | no_license | INSERT INTO users (name) VALUES
("Vinney"),
("Mooskers"),
("Jai-Lee")
;
INSERT INTO quizzes (name) VALUES
("gittin_it"),
("ruby_awakening")
;
INSERT INTO questions (content, quiz_id) VALUES
-- (id, content, quiz_id)
("What is the approximate age of the Earth (in years)?", 1),
("How many continents are... | true |
a187f14fb7e9ec4df14f17302bc7a66f9f20fd88 | SQL | nestorivanmo/sql-class | /lab-teoria/11-practica/scripts/s-02-respuestas.sql | UTF-8 | 12,070 | 4.21875 | 4 | [] | no_license | ---@Autor(es): Néstor Iván Martínez Ostoa
---@Fecha de creación: 13/05/2020
---@Descripcón: Sentencias práctica 11.
/*
1. Seleccionar el número total de artículos que pertenecen a las subastas del
2010, así como el total de los ingresos obtenidos en las subastas del 2010.
Emplear como nombres de columnas: num_articu... | true |
0decf9ba0f778a8183c8899350e38170946aaafe | SQL | timhannifan/minml | /src/minml/components/experiment/best_models.sql | UTF-8 | 201 | 3.28125 | 3 | [
"MIT"
] | permissive | ## get best performing model types by thresh
select threshold, metric, model_name, max(metric_value) as max_val from results
group by metric, threshold, model_name
order by threshold asc, max_val desc | true |
ea342e9a2a4f47ac72a9dd32f93b8729dda78a3d | SQL | diemontufar/microxt | /mobile/sql/model/create.sql | UTF-8 | 48,810 | 3.421875 | 3 | [
"Apache-2.0"
] | permissive |
CREATE TABLE COMPANY (
COMPANY_ID VARCHAR(4) NOT NULL,
NAME VARCHAR(40) NOT NULL,
DATAFILE_ID INTEGER,
UPGRADE_NUMBER DECIMAL(4,2),
LICENSE_DATE DATETIME,
ENABLE TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (COMPANY_ID)
);
CREATE TABLE DATABASE_TYPE (
DATA_TYPE_ID VARCHAR(30) NOT NULL,
DATABASE_ID VARCHAR(30... | true |
4b046a3084c5b7cc1b43edfe067ce3bbaec66081 | SQL | KainosGurung/plsql | /basic/get_customer_salary.sql | UTF-8 | 342 | 2.859375 | 3 | [] | no_license | DECLARE
c_id customers.id%TYPE := 1;
c_name customers.name%TYPE;
c_addr customers.address%TYPE;
c_sal customers.salary%TYPE;
BEGIN
SELECT name, address, salary INTO c_name, c_addr, c_sal
FROM customers
WHERE id = c_id;
dbms_output.put_line
('Customer ' ||c_name || ' from ' || c_addr || ' e... | true |
b4a01e78b0c9e2151bac068a89ebc173e00961f6 | SQL | GerritSommer/ember-api-with-php | /sql/base.sql | UTF-8 | 780 | 3.15625 | 3 | [] | no_license | DROP DATABASE IF EXISTS base;
CREATE DATABASE base;
CREATE TABLE IF NOT EXISTS base.users (
`id` int(4) NOT NULL AUTO_INCREMENT,
`name` varchar(10) NOT NULL,
`password` varchar(17) NOT NULL,
`role` varchar(10) NOT NULL,
`updated_at` DATETIME,
`created_at` DATETIME,
PRIMARY KEY (`id`),
UNIQUE KEY `name`... | true |
f3fb5cbc1d110a54c85f7875f0b1500bee023462 | SQL | shrutiupari/event_management | /events.sql | UTF-8 | 1,773 | 2.875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 18, 2017 at 10:54 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.3.13
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
1c6d70144289fa4420181bbfb26d4eed057bd99b | SQL | Ghanouch/AppleGame | /apple_game.sql | UTF-8 | 3,049 | 3.375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Dim 24 Avril 2016 à 04:00
-- Version du serveur : 5.6.17
-- Version de PHP : 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... | true |
779ffbbd5c1385907921491e2f746d921ad4db75 | SQL | CUBRID/cubrid-testcases | /sql/_04_operator_function/_08_click_counter/_002_decr/cases/1014.sql | UTF-8 | 482 | 3.375 | 3 | [
"BSD-3-Clause"
] | permissive | -- create class,insert data,create class,insert data,select clause with decr(object.attribute) function
create class xoo ( a int, b int);
insert into xoo values(1, 1);
insert into xoo values(2, 2);
insert into xoo values(3, 3);
create class yoo ( a int, b int);
insert into yoo values(1, 1);
insert into yoo values(2, ... | true |
20e802d375fc99a800792b9f266ac621a668c6c5 | SQL | Sumo99/teksystems-java | /sql/sql_mock_sba/sql_mock_sba_script6.sql | UTF-8 | 332 | 3.75 | 4 | [] | no_license | WITH result AS (
SELECT STORES.NAME AS NAME, COUNT(ORDERS.STORE_ID) AS QUANTITY
FROM ORDERS
JOIN STORES
USING (STORE_ID)
GROUP BY NAME
)
SELECT NAME, QUANTITY,
CASE QUANTITY
WHEN QUANTITY > 3 THEN 'High'
WHEN QUANTITY <= 1 THEN 'Low'
ELSE 'Medium'
END SALES_FIGURE
FROM result
ORDER BY QU... | true |
cfb8921c2c3a5620e6c161f5e6fad79cd63491ab | SQL | kiko-g/feup-bdad | /SQL/int6.sql | UTF-8 | 275 | 3.53125 | 4 | [] | no_license | .mode columns
.headers on
.nullvalue NULL
-- 6
-- Preco medio das encomendas de cada cliente
.print ''
.print ''
SELECT Cliente.NIF, email, avg(preçoFinal) AS 'Preço Final medio'
FROM Cliente, Encomenda
WHERE Cliente.NIF = Encomenda.NIF
GROUP BY Cliente.NIF;
.print '' | true |
724576ac9939bad1907a01f4c955c70436043dbe | SQL | haochenxiao666/itelftool | /installfile/basesql/itelftool.sql | UTF-8 | 40,195 | 3.40625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 192.168.1.240
Source Server Version : 50640
Source Host : 192.168.1.240:3306
Source Database : itelftool
Target Server Type : MYSQL
Target Server Version : 50640
File Encoding : 65001
Date: 2018-10-17 16:09:46
*/
SET FOREIGN_KEY_CHECK... | true |
a790ddb63473a3d5239989854b400690f97aad02 | SQL | mmmmm2016/PLSQL | /lab_09_01.sql | UTF-8 | 594 | 3.421875 | 3 | [] | no_license | SET SERVEROUTPUT ON;
DECLARE
v_ename employees.last_name%TYPE;
v_emp_sal employees.salary%TYPE :=2000;
BEGIN
select last_name into v_ename from employees where salary=v_emp_sal;
insert into messages (results) values ('Name : ' || v_ename || ' -- salary : ' || v_emp_sal);
EXCEPTION
WHEN NO_DATA_FOUND THEN
... | true |
fee14220b117f79031aeeee188a05497773cd8c6 | SQL | fandashtic/arc_chennai | /Sivabalan-SQL/SQL_STORED_PROCEDURE/mERP_Sp_CountMargin.sql | UTF-8 | 274 | 3.1875 | 3 | [] | no_license | Create Procedure mERP_Sp_CountMargin
AS
Select Count(*) from tbl_mERP_MarginDetail MDet Inner Join tbl_mERP_MarginAbstract MAbs
On MAbs.marginID = MDet.MarginID
where dbo.StripTimefromDate(CreationDate) = DATEADD(D, 0, DATEDIFF(D, 0, GETDATE()))
and MAbs.ReceiveDocID <> 0
| true |
f142a538da489ef52918806ed46fbe8bdb7ae193 | SQL | fishercoder1534/Leetcode | /database/_1068.sql | UTF-8 | 97 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | select p.product_name, s.year, s.price
from Product p
join Sales s
on s.product_id = p.product_id | true |
304738cad4f5c5db10d3d8b84327b509ae1b4427 | SQL | weliazar/3WA | /PROJET RESTAURANT/CODE DEPART/dataRestaurant.sql | UTF-8 | 7,141 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost
-- Généré le : mar. 19 fév. 2019 à 10:18
-- Version du serveur : 5.7.25-0ubuntu0.16.04.2
-- Version de PHP : 7.2.11-2+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTI... | true |
20fad31972051ef61e5b179e102194b568eca153 | SQL | ignacardel/bd2-ada | /Proyecto Ingeniero/respaldo/CERVEZA/trigger validarTour.sql | UTF-8 | 3,768 | 3.34375 | 3 | [] | no_license | CREATE OR REPLACE TRIGGER validarTour
BEFORE INSERT ON tour
FOR EACH ROW
DECLARE
CURSOR cur IS SELECT * FROM TABLE(:new.descuentos);
busqueda cur %rowtype;
CURSOR cur2 IS SELECT * FROM TABLE(:new.horarios);
busqueda2 cur %rowtype;
CURSOR cur3 IS SELECT * FROM TABLE(:new.reqadquisicions);
busqueda3 ... | true |
f77099e507de8838a9279b36ffed411f8d63f4d6 | SQL | wnsfuf70/finalProject | /finalProject/target/classes/kos/triple/project/persistence/chul/EpilogueDAO.sql | UTF-8 | 3,405 | 3.421875 | 3 | [] | no_license | DESC TRIP_LOCATION_INFO;
ALTER TABLE TRIP_LOCATION_INFO
MODIFY (DETAIL_INFO VARCHAR2(1500));
DESC TRIP_LOCATION_INFO;
SELECT * FROM TRIP_LOCATION_INFO;
ALTER TABLE TRIP_LOCATION_INFO
MODIFY (DETAIL_INFO VARCHAR2(2000),
OPEN_TIME VARCHAR2(30),
CLOSE_TIME VARCHAR2(30)
);
... | true |
d65ec25c4e9c593b548bcd1fcae11b4293f3caf6 | SQL | Inthuch95/IS5108-DigData | /is5108group-4__digdata_2018-04-27.sql | UTF-8 | 20,397 | 2.921875 | 3 | [] | no_license | # ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: is5108group-4.host.cs.st-andrews.ac.uk (MySQL 5.5.5-10.2.14-MariaDB)
# Database: is5108group-4__digdata
# Generation Time: 2018-04-27 17:10... | true |
0aae2e4f5c6aef1577c762c29a6be635c8f57832 | SQL | McCrack/audi | /lab/modules/shunter/install/query.sql | UTF-8 | 990 | 3.1875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS gb_task_timing(
TaskID INT UNSIGNED NOT NULL AUTO_INCREMENT,
created INT UNSIGNED,
towork INT UNSIGNED NOT NULL DEFAULT 0,
towaste INT UNSIGNED NOT NULL DEFAULT 0,
CommunityID INT UNSIGNED,
PRIMARY KEY(TaskID),
FOREIGN KEY (CommunityID) REFERENCES gb_community(CommunityID)
ON UPDATE ... | true |
d8c18a84ebd6ca41d811477133157840f134432a | SQL | DanielGomeX/Ignite-Constructions | /Ignite-Constructions/database/Query.sql | UTF-8 | 316 | 3.953125 | 4 | [] | no_license | SELECT
godown_transfers.id,
godown_transfers.quantity AS currentQty,
SUM(f.quantity) AS sentQty
FROM
godown_transfers
LEFT JOIN site_godown_transfers f
ON godown_transfers.id = f.godown_transfer_id
GROUP BY
godown_transfers.id
HAVING
sentQty < godown_transfers.quantity || sentQty IS NULL | true |
359f3acd01cb38f13aaff09b9ae3da5a34aeead3 | SQL | madhavkumar504/importCSV | /laravel_import_export.sql | UTF-8 | 12,961 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 08, 2021 at 08:28 AM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
cc5be511b9e374410983002d510fb72b6c35d255 | SQL | iammyr/xenia | /xenia_start.sql | UTF-8 | 684 | 3.125 | 3 | [] | no_license | create database xenia;
use xenia;
create table roles (name varchar(10) not null primary key);
create table forbids (id int(10) auto_increment primary key, role varchar(10), forbmethod varchar(4), forbresource varchar(10), foreign key(role) references roles(name));
create table users (username varchar(20) not null pr... | true |
e6e4ad8053de2a6d0cb55241a242757373252e51 | SQL | zev-deutsch/Course-Website-backend | /omnivox.sql | UTF-8 | 4,870 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 16, 2019 at 08:16 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
dc2bd38853a787230634b4fc5903b88be4b60668 | SQL | ygkee/dbv_localsrm | /schema/srm_po_quality_edit_history.sql | UTF-8 | 600 | 3.453125 | 3 | [] | no_license | CREATE TABLE `srm_po_quality_edit_history` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`srm_po_quality_id` int(11) DEFAULT NULL,
`edited_on` datetime DEFAULT NULL,
`edited_by` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `edited_by` (`edited_by`),
KEY `srm_po_quality_id` (`srm_po_quality_id`),
CONSTRAINT `... | true |
9e0ab9e3fecc6e12ff1006b24dcb045f88a3c66e | SQL | vladimirlojanica/a12n-server | /mysql-schema/005-oauth2-redirect-uri.sql | UTF-8 | 419 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | SET NAMES utf8mb4;
START TRANSACTION;
INSERT INTO changelog VALUES (5, UNIX_TIMESTAMP());
CREATE TABLE oauth2_redirect_uris (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
oauth2_client_id INT UNSIGNED NOT NULL,
uri VARCHAR(300) NOT NULL
);
INSERT INTO oauth2_redirect_uris (oauth2_client_id, uri) SELECT... | true |
0e4dd25a73cff7081f9b96b9b0303975edd168d1 | SQL | oryjk/crm | /src/main/resources/db/migration/V1_5__sms_info_sql.sql | UTF-8 | 1,661 | 3.09375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50508
Source Host : localhost:3306
Source Database : phpok
Target Server Type : MYSQL
Target Server Version : 50508
File Encoding : 65001
Date: 2015-11-18 16:49:11
*/
-- ----------... | true |
a76eca1edc624d517d9c44d96c25a25e1f11f6c8 | SQL | CuCTeMeH/tenancity_old | /migrations/1.0.0/6_users_x_estates.up.sql | UTF-8 | 714 | 3.078125 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `users_x_estates` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned DEFAULT NULL,
`estate_id` bigint(20) unsigned DEFAULT NULL,
`rent_id` bigint(20) unsigned DEFAULT NULL,
`is_tenant` tinyint(1) NOT NULL DEFAULT 0,
`is_landlord` tinyint(1) NOT NULL ... | true |
ae6958b0da70a27df250768e3c1ae357dac74436 | SQL | greatschism/quizzy | /schema/R0.8/br-138.sql | UTF-8 | 265 | 2.640625 | 3 | [] | no_license | ALTER TABLE `user` CHANGE `type` `type` ENUM('trial-user','student','teacher','admin','super') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'trial-user';
UPDATE `user` SET `date_updated` = NULL, `type` = 'super' WHERE `user`.`type` = 'super-admin'; | true |
0b93f47b7e6d77f693acd86f4a479afe8328d91a | SQL | kerrykato/SQL-Scripts | /Report Troubleshooting/Draw Totals - By Manifest.sql | UTF-8 | 910 | 3.921875 | 4 | [] | no_license | /*
report troubleshooting
Draw Totals - By Manifest
*/
;with cteDraw
as (
select ap.AccountPubID, ap.AccountId, ap.PublicationId, d.DrawAmount
from scDraws d
join nsPublications p
on d.PublicationID = p.PublicationID
join scAccounts a
on d.AccountID = a.AccountID
join scAccountsPubs ap
on a.AccountID = a... | true |
60595cf386edb8557ae31f95493c7107e1ac90ac | SQL | FolloW12587/amazon_django | /src/amazon_analytics/sql/upload_missing_requests.sql | UTF-8 | 374 | 3.578125 | 4 | [] | no_license | INSERT INTO amazon_analytics_requests (request)
SELECT request
FROM
(
SELECT ttops.id AS id
,ttops.request AS request
,ttops.position AS position
,req.id AS request_id
FROM amazon_analytics_temporaryrequesttops ttops
LEFT JOIN amazon_analytics_requests req
ON req.request... | true |
e1543edb864869ff380970b7779726e41b0282a0 | SQL | hrr16-project-crystal/project-crystal | /server/db/sql/lovebucks/create.sql | UTF-8 | 419 | 3.234375 | 3 | [] | no_license | /*
Creates table Lovebucks
*/
CREATE TABLE Lovebucks
(
buck_id serial PRIMARY KEY,
points int NOT NULL,
memo text NOT NULL DEFAULT 'Because...',
name text NOT NULL,
user_id int NOT NULL,
couple_id int NOT NULL,
type int NOT NULL,
created_at timestamp NOT NULL DEFAULT now(),
FORE... | true |
82949012e97e079126a97640295d5f13444d9a32 | SQL | DidiMilikina/DataCamp | /Data Analyst with Python - Career Track/05. Joining Data in SQL/04. Subqueries/02. Subquery inside where (2).sql | UTF-8 | 548 | 3.96875 | 4 | [] | no_license | /*
Subquery inside where (2)
Use your knowledge of subqueries in WHERE to get the urban area population for only capital cities.
Instructions
100 XP
Make use of the capital field in the countries table in your subquery.
Select the city name, country code, and urban area population fields.
*/
SOLUTION
-- 2. Select fiel... | true |
df08808e7e9e67b35432f1d3dfd7255fa4c17dca | SQL | abalbuena/bd10s | /practica_segundo_parcial/2doparcial3.sql | UTF-8 | 464 | 3.171875 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE P_RENOMBRAR IS
CURSOR C_TABLAS IS
SELECT DISTINCT(TABLE_NAME) AS NOMBRE_TABLA
FROM USER_TAB_COLUMNS
WHERE UPPER(COLUMN_NAME) LIKE 'CEDULA' AND
UPPER(TABLE_NAME) NOT LIKE 'B_%';
V_SENTENCIA_ALTER VARCHAR2(500);
BEGIN
FOR TAB IN C_TABLAS LOOP
V_SENTENCIA_ALTER... | true |
0dc3049dbf83222b4da32222e15041adff1cfafb | SQL | playaround88/webfs | /src/main/resources/db/oracle.init.sql | GB18030 | 1,137 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | -- Create sequence
create sequence SEQ_FILEMETA_ID
minvalue 1
maxvalue 9999999999999999999999999999
start with 1
increment by 1
cache 20;
-- Create table
create table file_meta
(
id number not null,
ori_name varchar2(30) not null,
save_name varchar2(20) not null,
fsize number not null,
file_url ... | true |
e4cd8b2ec74e0a4e2eee49f05fe969ebd39f9f2b | SQL | ly4aznik/Course-work | /autocarrier.sql | UTF-8 | 7,900 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Июл 27 2021 г., 01:28
-- Версия сервера: 8.0.19
-- Версия PHP: 7.1.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... | true |
799e299110c1c43add992ced2eceaf4bbb968bde | SQL | eib/jam-sessions | /db/0.0.1/tables/instruments.upgrade.sql | UTF-8 | 233 | 2.78125 | 3 | [
"MIT"
] | permissive | CREATE TABLE IF NOT EXISTS instruments (
instrument_id bigserial PRIMARY KEY,
description text UNIQUE NOT NULL,
created_dt timestamp with time zone DEFAULT now(),
modified_dt timestamp with time zone DEFAULT now()
);
| true |
6e7e15f04e5506787fd2422d7a31256f7f88e4b6 | SQL | myui/gridool | /gridool/src/examples/psql/tpch/12map.sql | UTF-8 | 578 | 3.625 | 4 | [] | no_license | select
l_shipmode,
sum(case
when o_orderpriority = '1-URGENT'
or o_orderpriority = '2-HIGH'
then 1
else 0
end) as C2,
sum(case
when o_orderpriority <> '1-URGENT'
and o_orderpriority <> '2-HIGH'
then 1
else 0
end) as C3
from
orders,
lineitem
where
lineitem._hidden & 2 = 2
and orders._hidden ... | true |
a1f373f4cce51bb69d7bd027957d71575ab4b52b | SQL | trousev/watchme | /old/res/pattern.sql | UTF-8 | 489 | 3.9375 | 4 | [
"BSD-2-Clause"
] | permissive | select
cast(count(timestamp) as DOUBLE) / 10 as rec_count,
rules.pattern as pattern
from
(select * from watch
where timestamp > strftime('%s','now')-{minimum}
and timestamp < strftime('%s','now')-{maximum}
) as watch
LEFT JOIN
(SELECT * FROM rules order by l... | true |
22ccee59e3ff41217107aa36d8d58fbd34c65c07 | SQL | romie1/mjd | /mySql/m3/s11.sql | UTF-8 | 337 | 3.609375 | 4 | [] | no_license | -- group by
use me;
-- average salary for each department
select department_id, truncate(avg(salary), 0) as 'avg salary'
from employees
group by department_id
order by 1;
select department_id, truncate(avg(salary), 0) as 'avg salary'
from employees
where department_id is not null
group by department_id
o... | true |
c926e2f0ecaf219edbbf585a54117d06d98c62c7 | SQL | pravinborate04/spring-boot-app | /src/main/resources/db/migration/V1_0__initial_migration.sql | UTF-8 | 4,407 | 3.234375 | 3 | [] | no_license | CREATE TABLE product (
id BIGINT NOT NULL AUTO_INCREMENT,
name VARCHAR(255),
amount BIGINT,
quantity BIGINT,
brand VARCHAR(255),
is_active TINYINT(1) NULL DEFAULT 0,
created_by BIGINT,
created_date DATETIME NULL DEFAULT CURRENT_TIMESTAMP,
deleted TINYINT(1) NULL DEFAULT 0,
modifi... | true |
f71e99258408270572ad11f763f698a647b8e01a | SQL | sairam8882/Flyway | /V15__change.sql | UTF-8 | 103 | 3.09375 | 3 | [] | no_license | alter table people123 add constraint fk_people_state
foreign key (state) references states(state);
| true |
056866fef5646426f243cb0f90683c80bee94afc | SQL | pavilkau/fxsim-db-queries | /minMax.sql | UTF-8 | 588 | 3.859375 | 4 | [] | no_license | WITH subquery AS
(
SELECT MIN(bid) as mbid, date_trunc('minute', "time") as mtime
FROM tick
WHERE pair='EUR/USD'
GROUP BY (date_trunc('minute', "time"))
)
UPDATE min
SET min=subquery.mbid
FROM subquery
where (date_trunc('minute', "time")) = subquery.mtime AND pair='EUR/USD';
WITH subquery AS
(
S... | true |
184ad6b4862c7acb4dae62cd5c9b73cb862a6046 | SQL | Kchandwani21/SQL-notes | /Ch7.sql | UTF-8 | 1,426 | 4.4375 | 4 | [] | no_license | #Kanchi Chandwani
# Chapter 7: How to code Subqueries
#Problem 1
SELECT DISTINCT category_name
FROM categories
WHERE categories.category_id IN
(SELECT products.category_id
FROM products)
ORDER BY category_name;
#Problem 2
SELECT product_name, list_price
FROM products
WHERE list_price > (
SELECT AVG(products.li... | true |
b95e4ed26ecc78bf498c1fcea5b88361a4e17f41 | SQL | SantiagoLuna07/farmacia-app | /resources/database/pl-sql/client.sql | UTF-8 | 1,751 | 4.125 | 4 | [] | no_license | DELIMITER //
CREATE FUNCTION save_client(
v_name VARCHAR(45),
v_lastname VARCHAR(45),
v_idCard VARCHAR(45),
v_gender VARCHAR(45),
v_birtDate VARCHAR(45)
) RETURNS INT(1) READS SQL DATA DETERMINISTIC
BEGIN
DECLARE res INT DEFAULT 0;
IF NOT EXISTS(SELECT idClient FROM clients WHERE idCard = v_idCard)
TH... | true |
10bac37be23119bcbced80ca389c1dccd3a0d448 | SQL | UCLALibrary/sql-scripts | /Voyager/Cataloging/Law Internet holdings SILSLA-34.sql | UTF-8 | 1,752 | 3.96875 | 4 | [] | no_license | /* Law internet holdings - 2 reports.
SILSLA-34
*/
-- Report 1: Law non-Internet records with Internet holdings for 856 42 fields
with bibs as (
select
record_id as bib_id
from vger_subfields.ucladb_bib_subfield
where tag = '856x'
and subfield like 'UCLA Law%'
and indicators = '42'
)
, law as (
s... | true |
f3fe028f7d01e10e5ef75aebdfbf0bdd386c008d | SQL | krishnakumarongit/ukdogs | /dogscart.sql | UTF-8 | 11,431 | 2.78125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 19, 2020 at 04:39 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.2.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
f87596484782068c07956576cce24129768a8976 | SQL | superThisMe/DB-oracle | /05.select-query-3.sql | UHC | 2,913 | 4.6875 | 5 | [] | no_license | -- SUBQUERY
-- 1-1. ̸ ȸ
SELECT MAX(PRICE)
FROM BOOK;
SELECT *
FROM BOOK
WHERE PRICE = 35000;
-- 1-2. ̸ ȸ
SELECT *
FROM BOOK
WHERE PRICE = ( SELECT MAX(PRICE)
FROM BOOK );
-- 2-1. ִ ̸ ȸ
SELECT DISTINCT CUSTID
FROM ORDERS;
SELECT *
FROM CUSTOMER
WHERE CUSTID IN (1, 2, 3, 4);... | true |
efe6cca4541adf5563b068a60e2311d789162098 | SQL | radtek/abs3 | /sql/mmfo/bars/View/v_customer_fm.sql | UTF-8 | 1,135 | 2.515625 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/View/V_CUSTOMER_FM.sql =========*** Run ***
PROMPT =====================================================================================
PROMPT *** Create view V_CU... | true |
56fcc299186e95ac0a202837ec5ab438a1462106 | SQL | Domi-hub/Petition | /setup.sql | UTF-8 | 566 | 3.25 | 3 | [] | no_license | DROP TABLE IF EXISTS signatures;
DROP TABLE IF EXISTS user_profiles;
DROP TABLE IF EXISTS users;
CREATE TABLE users(
id SERIAL PRIMARY KEY,
first_name VARCHAR NOT NULL,
last_name VARCHAR NOT NULL,
email VARCHAR NOT NULL UNIQUE,
password VARCHAR NOT NULL
);
CREATE TABLE signatures(
id SER... | true |
f0a7a3ded507c09270ada073e6f69d25017aa210 | SQL | devepkm/JDBCProj_ConnectionPool | /src/com/devepkm/dbresource/data.sql | UTF-8 | 3,340 | 3.046875 | 3 | [] | no_license | create table student(HKID varchar(10) not null ,
Name varchar(20) not null ,
Birth DATE,AdmissionID varchar(10) not null ,
PRIMARY KEY (HKID));
create table result(HKID varchar(10) not null ,
Chinese varchar(1),
English varchar(1),
Maths varchar(1),
LiberalStudies varchar(1),
foreign key (HKID) REFERENCES studen... | true |
47efce5d5df8e4d8b32b173e49e5bb7fa1607cb8 | SQL | yaoforx/cs145-2017 | /projects/project2/trigger9_add.sql | UTF-8 | 389 | 3.5 | 4 | [] | no_license | --description : implement for constrain 9 cannot bid item oneself is selling
PRAGMA forein_keys = ON;
drop trigger if exists preventBidSelf;
create trigger preventBidSelf
before insert on bidTable
for each row
when exists (
select * from
sellerTable
where sellUserId = new.bidUserId
and itemId = new.itemId
)
begin
... | true |
57465d0be05ff383b96597978509c4c19bc3e5d5 | SQL | ameshalexk/100DaysOfCodeTracker | /day01_sqlpractice/carmen-sandiego/find_carmen.sql | UTF-8 | 4,204 | 3.671875 | 4 | [
"MIT"
] | permissive | -- TEST COMMAND AND SAMPLE OUTPUT
-- Record your query (or queries, some clues require more than one) below the clue, then comment out the output below it
-- use two `-` to comment at the start of a line, or highlight the text and press `⌘/` to toggle comments
-- EXAMPLE: SELECT ALL FROM THE TABLE COUNTRY AND LIMIT IT ... | true |
d78f13ec05c231b216a7043a8c681f91bda8638b | SQL | desen-eduardo/Formulario-de-Email | /base_20210321_164013.sql | UTF-8 | 1,468 | 2.90625 | 3 | [
"MIT"
] | permissive | -- Valentina Studio --
-- MySQL dump --
-- ---------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40014 SET @OLD... | true |
244c81bd27fa87c48334e446ed420b0d3d1df0ec | SQL | MayurMah/leetcode | /trips_and_users.sql | UTF-8 | 722 | 4.53125 | 5 | [] | no_license | -- T-SQL code
-- Goal : Get cancellation rates for unbanned users (driver and cliet both) between Oct 1 & Oct 3 by date
-- Logic:
-- a. Get unbanned users from Users table
-- b. Get all trips between Oct 1 & Oct 3 inner joined on Client_Id & Driver_Id
-- c. Group by date, sum(trips) s1, sum(cancelled trips) s2, rate ... | true |
da12578e25a56affd3554f0205fe019d55792116 | SQL | FerriSyamsulMaarif/pw2020_193040145 | /tubes/tubes.sql | UTF-8 | 2,803 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 14 Bulan Mei 2020 pada 23.37
-- Versi server: 10.1.36-MariaDB
-- Versi PHP: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
162804e5e19277ff7cb4d2920723e66d4f9bd69d | SQL | ferkopar/ToDoSchema | /TIME_TABLE_REFCONSTRAINT.sql | UTF-8 | 404 | 2.765625 | 3 | [] | no_license | --------------------------------------------------------
-- Ref Constraints for Table TIME_TABLE
--------------------------------------------------------
ALTER TABLE "TIME_TABLE" ADD CONSTRAINT "FK_ALRT_TIMT" FOREIGN KEY ("ALERT_ID")
REFERENCES "ALERT" ("ALERT_ID") DISABLE;
ALTER TABLE "TIME_TABLE" ADD CONST... | true |
8ddb6b9e9d8718750417d1cf71abfdb7a0ac3955 | SQL | cdeco-it/OPS-Dev | /DOCUMENTATION/opsdev-100617.sql | UTF-8 | 8,250 | 3.34375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- 10/06/17 11:55:51
-- Model: New Model Version: 1.0
-- 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='TRADITION... | true |
d2660916095c4f3336bc3ca993e26e78b84de2e9 | SQL | HieroSalim/RacetrackManager | /Database Script/autodromo.sql | UTF-8 | 4,257 | 3.125 | 3 | [] | no_license | /*
SQLyog Community v13.1.7 (64 bit)
MySQL - 10.4.11-MariaDB : Database - autodromo
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECK... | true |
15c998a146f463857e83dc0d62d63b11b25d32a2 | SQL | carolfly86/altar | /sql/golden_record/adventureworks/adventureworks_ws5_gr.sql | UTF-8 | 2,771 | 2.78125 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = fals... | true |
a6acba0f9e7341c61aec58907f815f02e21cd58b | SQL | RomanBelkov/YaccConstructor | /Tests/materials/pl-sql/jrxml2pdf-release/install/demodata5.sql | UTF-8 | 35,661 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | declare
v_data clob;
begin
dbms_lob.createtemporary(v_data, true, DBMS_LOB.SESSION);
dbms_lob.open(v_data, dbms_lob.LOB_READWRITE);
v_data := v_data || '<?xml version="1.0" encoding="UTF-8"?>' || unistr('\000a') ||
'<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperrep... | true |
11c6d949f38fa5655bced71f1a36bb33da001a5c | SQL | thinkful-ei22/Donny-Bored-Server | /scratch/moodboard-data.sql | UTF-8 | 2,286 | 3.703125 | 4 | [] | no_license | DROP TABLE IF EXISTS images;
DROP TABLE IF EXISTS moodboards;
-- psql -U dev dev-moodboards-app
--postgres://dygzount:ee6GtSt5m-P69rS4Y6tnhEDPf_HHXQQ7@pellefant.db.elephantsql.com:5432/dygzount
--PRIMARY DATA TABLES
CREATE TABLE users(
id serial PRIMARY KEY,
username varchar(150) NOT NULL,
email varch... | true |
668f826609f7e7fb654c6a8bf263d73fe240bc42 | SQL | aliefalhadi/sistemperhitunganzakat | /hitungzakat (1).sql | UTF-8 | 9,395 | 3.0625 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 10, 2018 at 08:51 AM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
7533d1c5872eb07d03e8659385c4608eb1e4eeb8 | SQL | jmabf/IAAD | /Semana7/Quesito 4 Script.sql | UTF-8 | 7,360 | 3.390625 | 3 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTI... | true |
9ab18b2e508f3134eaaf8ae93428557435951ba3 | SQL | asouzab/oracle_plsql | /GOLIVEELO/TOPSQL/saldocontratoovprotocolo.sql | UTF-8 | 4,075 | 3.25 | 3 | [] | no_license | with cte_vbak as
(
SELECT
proto.nu_protocolo, proto.cd_elo_carteira, proto.CD_ELO_VBAK , proto.CD_ELO_VBAK_PROTOCOLO , proto.QT_AGENDADA_PROTOCOLO,
VVV.NU_CONTRATO_SAP, VVV.CD_ITEM_CONTRATO, VVV.NU_CONTRATO
FROM VND.ELO_VBAK_PROTOCOLO proto
INNER JOIN VND.ELO_VBAK VVV
ON VVV.CD_ELO_VBAK = proto.CD_ELO_VBAK
WHER... | true |
51b4fdf5fd06876ca55a0582bf5cc759bf6bdbe0 | SQL | Gaia3D/openindoormap | /doc/database/platform/ddl/dataInfo_log.sql | UTF-8 | 7,613 | 3.578125 | 4 | [
"Apache-2.0"
] | permissive | -- FK, Index 는 별도 파일로 분리. 맨 마지막에 작업 예정
drop table if exists data_info_log cascade;
drop table if exists data_info_log_2020 cascade;
drop table if exists data_info_log_2021 cascade;
drop table if exists data_info_log_2022 cascade;
drop table if exists data_info_log_2023 cascade;
drop table if exists data_info_log_2024 c... | true |
a0247a08e6e4dcd34a8d17a2fd2784418b6a583f | SQL | dimitarminchev/ITCareer | /06. Бази данни/02. Relationships/geography.sql | UTF-8 | 31,832 | 3.40625 | 3 | [
"CC-BY-NC-4.0",
"CC-BY-NC-SA-4.0"
] | permissive | /* geography database */
CREATE DATABASE IF NOT EXISTS `geography`
USE `geography`;
CREATE TABLE IF NOT EXISTS `continents` (
`continent_code` char(2) NOT NULL,
`continent_name` varchar(50) NOT NULL,
PRIMARY KEY (`continent_code`),
UNIQUE KEY `PK_Continents` (`continent_code`)
) ENGINE=InnoDB DEFAULT CHARSET=... | true |
298c6178802d3162f676e74bd4d136e8f0c26e6d | SQL | greigsbarrie/floodmaster | /FL94_OBJECTIVES_CONSTRAINT.sql | UTF-8 | 905 | 2.8125 | 3 | [] | no_license | --------------------------------------------------------
-- Constraints for Table FL94_OBJECTIVES
--------------------------------------------------------
ALTER TABLE "FLOODMASTER"."FL94_OBJECTIVES" ADD CONSTRAINT "FL94_PK" PRIMARY KEY ("OBJECTIVE_ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATIS... | true |
e4234914f0cc36a00ae5981baa3ceb8a7e6ee01f | SQL | mbarretogit/sql | /Rel_Dt_Pagamento_Dt_Geracao_07jul2016.sql | UTF-8 | 856 | 3.53125 | 4 | [] | no_license | --SELECT * FROM ly_cheques WHERE NUMERO= '35'
--SELECT * FROM LY_PLANO_PGTO_PERIODO WHERE resp = '01947786571'
--SELECT * FROM HD_USUARIO hu WHERE hu.USUARIO = '01947786571'
--SELECT * FROM ly_aluno WHERE aluno IN ('160520052','160520171','160520234')
--SELECT * FROM ly_item_cred WHERE LANC_CRED = '21472'
--SELECT *... | true |
3d4ef6eab50f3cc40fd57976c9965cbebe81684a | SQL | Slawgorodskij/PHPLessons | /lesson5/engine/Script.sql | WINDOWS-1251 | 2,858 | 3.40625 | 3 | [] | no_license | DROP DATABASE IF exists lesson_fifth;
CREATE DATABASE lesson_fifth;
USE lesson_fifth;
DROP TABLE IF EXISTS `media`;
CREATE TABLE `media`(
`id` SERIAL PRIMARY KEY,
`filename` VARCHAR(255)
);
INSERT INTO `media` (`filename`)
VALUES
(' '),
(' '),
(''),
(''),
(''),
(' '),
(''),
(''),
(''),
(''),
(' '),
(''),
(''),
('... | true |
7dcb8d81d56be357e7db200cc1e5d3e8f9a8c0e6 | SQL | sbDevelopments/coyote2 | /module/profiler/install/schema.sql | UTF-8 | 392 | 2.890625 | 3 | [] | no_license | SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE `profiler` (
`profiler_page` tinytext NOT NULL,
`profiler_time` float NOT NULL,
`profiler_sql` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `profiler_sql` (
`sql_id` char(32) NOT NULL,
`sql_query` tinytext NOT NULL,
`sql_time` float N... | true |
31c57e856b16d43cf90ee7da3e55cfeeb1ad099c | SQL | arudenko2002/SwiftVelocity | /src/main/python/Velocity_Queries/velocity_verificator_Olga.sql | UTF-8 | 2,833 | 2.75 | 3 | [] | no_license | WITH regions_spotify AS (
SELECT rank_lw, streams_lw, count(1) as countt
FROM `umg-swift.swift_alerts.trending_tracks_regions`
WHERE _PARTITIONTIME = "2017-12-14 00:00:00" and country_code = 'US' and region_dma_code = '803'
group by rank_lw, streams_lw
having countt > 1
order by streams_lw
),
olga_regions_spotify AS (
... | true |
ff4033a895fac65b943440d28b1791289b09d031 | SQL | hardsky/music-head | /db/create_lfp_tbl.sql | UTF-8 | 354 | 2.515625 | 3 | [
"MIT"
] | permissive | CREATE TABLE `looking_people` (
`Id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`BandId` bigint UNSIGNED,
`Country` varchar(80),
`City` varchar(80),
`Language` varchar(45),
`LookingFor` varchar(80),
`Comment` varchar(255),
`Created` datetime,
`Creater` bigint UNSIGNED,
PRIMARY KEY (`Id`) )
ENGINE = InnoDB
CHARACTER SET... | true |
cbb7dff4d20a795c97628726b0b5a39023d2ebfb | SQL | bellmit/origin | /family_order/sql/TF_F_USER_VPN/SEL_VPMN_NO_CENTREX_BYCUSTID.sql | UTF-8 | 678 | 3.609375 | 4 | [] | no_license | SELECT A.USER_ID, A.VPN_NO
FROM TF_F_USER B, TF_F_USER_VPN A
WHERE B.USER_ID = A.USER_ID
AND B.PARTITION_ID = MOD(B.USER_ID, 10000)
AND B.REMOVE_TAG = '0'
AND A.REMOVE_TAG = '0'
AND B.CUST_ID = TO_NUMBER(:CUST_ID)
AND (B.PRODUCT_ID = '8000' AND (A.VPN_USER_CODE IS NULL OR A.VPN_USER_CODE != '2'))
AND (SEL... | true |
ea12ef22cd0c31aa505b4a6f7b750c9f88b0a5ea | SQL | subamkumar/Forum | /forum.sql | UTF-8 | 5,989 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 17, 2016 at 11:15 AM
-- Server version: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
4d2721e59e928f7120622e3a8d6ef9efe7bc3fee | SQL | avni/3day-rdbms | /packer/sql/bank.sql | UTF-8 | 1,287 | 3.96875 | 4 | [] | no_license | use threedayrdbms;
create table bank_customers (
customer_id int not null primary key auto_increment,
customer_name varchar(100) not null,
-- defaults in MySQL must be constant, except for timestamp
date_joined timestamp not null default current_timestamp
);
create table bank_accou... | true |
a25203d8181a487bb01228c4ee0f6000a030c233 | SQL | nvanhai/tct2013 | /Source/Script_BC26_cac_don_vi_loi_view/RCV_V_BC26_AC.sql | UTF-8 | 689 | 2.609375 | 3 | [] | no_license | CREATE OR REPLACE VIEW QLT_NTK.RCV_V_BC26_AC AS
select
t1.hdr_id
, t1.so_tt
, t1.ten_HD
, t1.Mau_so
, t1.Ky_hieu_HD
, t1.Tong_so
, t1.Tu_so_ton_dk
, t1.Den_so_ton_dk
, t1.Tu_so_ps
, t1.Den_so_ps
, t1.Tu_so_SD_Mat_xoa
, t1.Den_so_SD_Mat_xoa
... | true |
8cfe416178eac3148a769653777d611de94bf1be | SQL | ke2low/bootcampx | /4_queries/cohorts_average_assistance_duration.sql | UTF-8 | 341 | 3.84375 | 4 | [] | no_license | SELECT avg(total_duration) FROM (
SELECT SUM(assistance_requests.completed_at - assistance_requests.started_at) as total_duration
FROM cohorts
JOIN students ON cohorts.id = students.cohort_id
JOIN assistance_requests ON students.id = assistance_requests.student_id
GROUP BY cohorts.name
ORDER BY total_duration
) as av... | true |
32e547c372fca86f898a0a6749f4b5df7ec83694 | SQL | Goryudyuma/kstmchat | /sql.sql | UTF-8 | 750 | 3.390625 | 3 | [] | no_license | create table board(
id INTEGER NOT NULL AUTO_INCREMENT,
title TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY(id),
FULLTEXT INDEX title(title)
) ENGINE = INNODB DEFAULT CHARSET=utf8;
create table user(
id INTEGER NOT NULL AUTO_INCREMENT,
name TEXT,... | true |
b2a40f492a0a9f79268c51808a8627f2b685ced3 | SQL | Am3ra/CS | /CS101/Bases de Datos/company.sql | UTF-8 | 1,239 | 3 | 3 | [
"Beerware",
"MIT"
] | permissive | -- CREATE DATABASE company;
-- Use company;
-- CREATE TABLE empleado (
-- `nss` varchar
-- (10) NOT NULL PRIMARY KEY,
-- nombre varchar
-- (10) not null,
-- direccion varchar
-- (10) not null,
-- salario float not null,
-- fecha_n date not null,
-- sexo varchar
-- (10) not null
-- );
-- CREATE TABLE departamento(
... | true |
266e1fdc57e89c4ee88d4dfa1076c145e4120b93 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day21/select0705.sql | UTF-8 | 273 | 3.03125 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='Thermometer' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['4028','6084','3100_4','3011','4044','3216','5100_5','3100_7','3032','2072'])
| true |
464d99c7ae047d574b83e663bc1ce39cc61d2e9f | SQL | AlexandraRyzvanovich/GiftCertificate | /dao/src/test/resources/create-tables.sql | UTF-8 | 603 | 3.78125 | 4 | [] | no_license | CREATE TABLE CERTIFICATE (
id SERIAL PRIMARY KEY ,
NAME VARCHAR(50) NOT NULL UNIQUE,
DESCRIPTION VARCHAR(200) NOT NULL,
PRICE NUMERIC NOT NULL CHECK(PRICE >0),
CREATION_DATE DATE NOT NULL,
MODIFICATION_DATE DATE,
VALID_DAYS INT CHECK (VALID_DAYS > 0)
);
CREAT... | true |
7cfc9c06b1ee41f4db3b39094fda052f94a18844 | SQL | ronaldos8/bpptik | /DB.sql | UTF-8 | 1,347 | 3.75 | 4 | [] | no_license | create database bpptik_lat1;
use bpptik_lat1;
create table role(
id_role int primary key auto_increment,
role_name varchar(25) not null
);
create table account(
account_id int primary key auto_increment,
username varchar(20) not null,
password varchar(32) not null,
role int(3) not null,
foreign key (role) refe... | true |
15a469e7d866d5403f7da47b7b3c97c8d9745aaa | SQL | yranibee/exercise | /thymeleaf/phase1_1/src/main/resources/assets/sql/admin_init.sql | UTF-8 | 2,293 | 2.625 | 3 | [] | no_license | -- ad_user
INSERT INTO ad_user (id, created_at, created_by, status, updated_by, updated_at, account, email, mobile, "name", password, telephone) VALUES(0, NULL, NULL, 0, NULL, NULL, 'admin', NULL, NULL, NULL, '707f8e47f7fab4f5cb2f7733e2a8afe017d64897e072ad09814d9fcc6fddcb440a2e8346a16a4c5a', NULL);
-- ad_role
INSERT IN... | true |
92096c25990eb8cea6b1fc53504b8a1d1471a5e9 | SQL | MikeTNewell/testing | /mike_scripts/sql/top_ten_users.sql | UTF-8 | 608 | 3.828125 | 4 | [] | no_license |
set pagesize 20
column user_name format a50
spool top_ten_users.out
select user_name, jobs from (
select substr(fu.user_name, 1, 50) user_name,
count(*) jobs, rank() over(order by count(*) desc) Ranking
from fnd_concurrent_requests fcr,
fnd_user fu
where fcr.... | true |
b68d26b17b1bd943a3f77577ca0a3f33d3e0a985 | SQL | peterlegrand/StudentUnion0105 | /StudentUnion0105/MasterDataScripts/StoredProcedures/PreferenceLeftMenuEditGetOtherMenus.sql | UTF-8 | 397 | 3.046875 | 3 | [] | no_license | CREATE PROCEDURE PreferenceLeftMenuEditGetOtherMenus (@CurrentUser nvarchar(50), @languageId int)
AS
SELECT
dbLeftMenuUser.Sequence Id
, dbLeftMenuLanguage.Name
FROM dbLeftMenuUser
JOIN dbLeftMenuLanguage
ON dbLeftMenuLanguage.LeftMenuId = dbLeftMenuUser.LeftMenuId
WHERE dbLeftMenuLanguage.LanguageId = @Language... | true |
0c6f5c9a7b9d7d103738523f6488330beb00839e | SQL | MEDHAT-ALHADDAD/one-million-arab-coder-data-analyst-path | /Parch_and_Posey5.sql | UTF-8 | 1,743 | 4.125 | 4 | [] | no_license | SELECT DATE_PART('year',o.o
ccurred_at) "year", DATE_PART('month',
o.occurred_at) "MONTH", SUM(o.gloss_amt_usd)
FROM orders o
JOIN accounts a
ON o.account_id = a.id
where a.name = 'Walmart'
GROUP BY 1 , 2
ORDER BY 3 DESC
LIMIT 1;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
SELECT a.name , ... | true |
4384f91a7122346228ec2719b12f9852969d4d00 | SQL | 5ymmetric/Queue-System | /schema.sql | UTF-8 | 614 | 3.359375 | 3 | [] | no_license | DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS teach;
DROP TABLE IF EXISTS pictures;
CREATE TABLE pictures (
imageId INT AUTO_INCREMENT PRIMARY KEY,
image varbinary(max)
);
CREATE TABLE users (
userId INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(250) NOT NULL,
password VARCHAR(250) NOT NULL,
pho... | true |
f395a8143aca3223198c7bc292792c63fcd0901e | SQL | yavindu99/MySQL-Sample-Work | /MySQL-Sample-Work/Mortuary_state_annual_report/Mortuary_state_annual_report.sql | UTF-8 | 4,501 | 3.15625 | 3 | [] | no_license | SELECT sag1.name,sag1.ou_name,
SUM(IFNULL(sag1.6067_1,0)) '6067_1',
SUM(IFNULL(sag1.6067_2,0)) '6067_2',
SUM(IFNULL(sag1.6067_3,0)) '6067_3',
SUM(IFNULL(sag1.6067_4,0)) '6067_4',
SUM(IFNULL(sag1.6067_5,0)) '6067_5',
SUM(IFNULL(sag1.6067_6,0)) '6067_6',
SUM(IFNULL(sag1.6067_7,0)) '6067_7',
SUM(IFNULL(sag1.6067_8,0)) '60... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.