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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
549cd4866d5d2bbffa473fe678776bcb32de4909 | SQL | upretip/fakelist | /fakelist/Auth/SQL.sql | UTF-8 | 2,069 | 4.03125 | 4 | [
"MIT"
] | permissive | -- create database
CREATE database if not exists fakerdb;
-- use fakerdb
USE fakerdb;
-- create new user and grant all access
CREATE USER if not exists 'lamp'@'localhost' identified by '1';
GRANT ALL PRIVILEGES ON * . * TO 'lamp'@'localhost';
FLUSH PRIVILEGES;
-- create login table
CREATE ... | true |
a34a7ab3b40306113e234a92f7986afc9e35be52 | SQL | sunjava2006/202102 | /plsql/plsql.sql | GB18030 | 3,622 | 3.890625 | 4 | [] | no_license | set serveroutput on;
declare
i number;
j number := 1;
k varchar2(20 char);
begin
k := 'hi';
dbms_output.put_line(k);
i := 90;
i := i + j;
dbms_output.put_line(i);
--null;-- PL/SQLп
end;
/
--==================̿========================
--=================if.... then..... else..... end if;========... | true |
73159a27328dc26a81b9ceb2184481b97af6429a | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day19/select1843.sql | UTF-8 | 178 | 2.625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-18T18:43:00Z' AND timestamp<'2017-11-19T18:43:00Z' AND temperature>=16 AND temperature<=49
| true |
33c68538a2b687c712944302740c0c0bd5d0d447 | SQL | jetalai3/vvsvintsitsky.testing | /Test_Schema_1111111_postgres_create (12).sql | UTF-8 | 4,024 | 3.5625 | 4 | [] | no_license | CREATE TABLE "account_profile" (
"id" serial NOT NULL,
"first_name" character varying(100),
"last_name" character varying(100),
CONSTRAINT account_profile_pk PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "account" (
"id" serial NOT NULL,
"password" character varying(100),
"email" character varying(... | true |
289920c178235dfeb81570fd1f3a726041a5b4cb | SQL | rjagadishsingh/CMS | /projeto/SQL/Permissao-has-Rules.sql | UTF-8 | 1,429 | 2.546875 | 3 | [] | no_license | /*
SQLyog Enterprise - MySQL GUI v7.12
MySQL - 5.0.92-community-log : Database - alertaaz_bdTendencia
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHE... | true |
2a44516d93fd2f53680a465ab2c38a210fa4e026 | SQL | cuzik/code-bits-challenge | /_data_base/create_db.sql | UTF-8 | 693 | 3.453125 | 3 | [] | no_license | -- Comandos de Criação de um Banco de Dados com os principais comados do mysql
-- Criação do Banco de Dados:
drop database CodeBits;
create database CodeBits DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
-- Abrir um BD
use CodeBits
-- Criar tabelas dentro do BD aberto
-- Usuário
create table user(
user_cod i... | true |
1fcb2466d260a91f879ee1f518ce72cac8bb75a6 | SQL | makeTaller/node-db3-project | /queries.sql | UTF-8 | 1,010 | 4.1875 | 4 | [] | no_license | -- Multi-Table Query Practice
-- Display the ProductName and CategoryName for all products in the database. Shows 77 records.
SELECT p.ProductName, c.CategoryName
FROM Product as p
JOIN Category as c on p.CategoryId = c.Id;
-- Display the order Id and shipper CompanyName for all orders placed before August 9 2012. Sh... | true |
78618de3d86d5b6c42ad3d05c0aaa277985dd09c | SQL | yzmaya/basedatos2 | /Tarea.sql | UTF-8 | 1,734 | 3.453125 | 3 | [] | no_license | CREATE TABLE PAISES (ID_PAIS VARCHAR(4),
NOMBRE VARCHAR2(120),
HABITANTE INTEGER,
IDIOMA VARCHAR2(40),
CONSTRAINT PK_ID_PAIS PRIMARY KEY(ID_PAIS));
INSERT INTO PAISES VALUES('MX','México',9000000,'español');
INSERT INTO PAISES VALUES('eua',... | true |
062f168dccc974bfe6746688e5af9f51863648b4 | SQL | pmirand6/soliris | /base_datos/diego_local/rel_medico_documentos.sql | UTF-8 | 1,784 | 3.125 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 5.6.11-log - MySQL Community Server (GPL)
-- SO del servidor: Win64
-- HeidiSQL Versión: 11.0.0.5919
-- -------------------------------------------------------... | true |
9a4d6b5be15e1f214d58f51c8057ebf85449ddb9 | SQL | jdgriswo/Alphon | /SQLStuff/structure-and-data.sql | UTF-8 | 9,650 | 3.359375 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : Local Dev
Source Server Type : MySQL
Source Server Version : 100122
Source Host : localhost:3306
Source Schema : buh
Target Server Type : MySQL
Target Server Version : 100122
File Encoding : 65001
Date: 22/10/2017 13:2... | true |
fdf496ab126e3e07aededbdb5ce1ad40a6b9698a | SQL | khannasarthak/DMProject | /query/perfect correlated.sql | UTF-8 | 133 | 2.953125 | 3 | [] | no_license | SELECT
booking.e_id
FROM
booking
WHERE
price > (SELECT
AVG(booking.price)
FROM
booking) | true |
740138a1078f3ba0c1e7621c9f88ceeea839dc45 | SQL | deepen1987/DATABASE-DESIGN-AND-IMPLEMENTATION-FOR-BUSINESS | /Class/Labs/2/Section1.sql | UTF-8 | 2,333 | 4.125 | 4 | [] | no_license | CREATE TABLE pizza (
pizza_id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(32) NOT NULL,
date_available DATE NOT NULL,
price DECIMAL(4,2) NOT NULL,
PRIMARY KEY(pizza_id));
CREATE TABLE toppings (
topping_id INT NOT NULL AUTO_INCREMENT,
topping_name VARCHAR(64) NOT NULL,
pizza_id INT NULL,
PRIMARY KEY(topping_id),
FOREIGN... | true |
25577cc66d30ab5ebf2e2dd9b1c29355fce16f1d | SQL | ua-eas/kfsdbupgrade | /src/main/resources/upgrade-files/3.0.1_4.0/country_code_updates/country_code_sql/convert_CM_EQPLNRTRN_DOC_T_countryCode.sql | UTF-8 | 30,581 | 2.859375 | 3 | [] | no_license | --
-- Copyright 2010 The Kuali Foundation
--
-- Licensed under the Educational Community License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.opensource.org/licenses/ecl2.php
--
-- Unless required by applica... | true |
f175617b87c1e8b5740b84d4939fb9fd4ac829a8 | SQL | gjk287/metagg | /LOL/src/query/view_query_odds.sql | UTF-8 | 2,643 | 4.09375 | 4 | [] | no_license | -- odds_by_match -- only over_under
CREATE OR REPLACE VIEW view_odds_by_match AS
SELECT
odds_match.match_id, ((((ou.bet_name)::text || ':'::text) || (ou.threshold)::text) || ':'::text) || (ou.over_under)::text AS bet_column,
odds_match.odds, odds_match.betting_site_id, odds_match.bet_type, odds_match.saved_time
... | true |
79b0d60fe1835bb6b9d9f32afc36a25711ea5f31 | SQL | admblack97/pc | /pc.sql | UTF-8 | 3,294 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 22 Des 2018 pada 02.20
-- Versi server: 10.1.32-MariaDB
-- Versi PHP: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
a1731a21f810b3f495fd80ddcec86407e2215138 | SQL | thoninumad/cc-master | /expresib_bj_monitoring.sql | UTF-8 | 407,716 | 2.828125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Waktu pembuatan: 03 Sep 2019 pada 10.23
-- Versi server: 10.1.41-MariaDB-cll-lve
-- Versi PHP: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 S... | true |
5f88890ebda2a9d0ed9cee11140dc587bf176ae0 | SQL | jcohy/jcohy-docs | /hibernate-orm/src/docs/asciidoc/zh-cn/chapters/domain/extras/basic/mapping-column-formula-persistence-example.sql | UTF-8 | 226 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | INSERT INTO Account (credit, rate, id)
VALUES (5000.0, 0.0125, 1)
SELECT
a.id as id1_0_0_,
a.credit as credit2_0_0_,
a.rate as rate3_0_0_,
a.credit * a.rate as formula0_0_
FROM
Account a
WHERE
a.id = 1 | true |
dd9296d97d4555a32feff766a73ee7e7a44ee3e6 | SQL | PythonMyLife/mysql | /activity3/activity3/func_version1.sql | UTF-8 | 12,352 | 4.0625 | 4 | [] | no_license | USE version1;
SET SQL_SAFE_UPDATES=0;
DROP TABLE IF EXISTS playing_list;
CREATE TABLE playing_list (
player1 varchar(50),
player2 varchar(50)
) ENGINE=MEMORY;
DROP FUNCTION IF EXISTS relative_ranking;
DELIMITER $$
CREATE FUNCTION relative_ranking(player_name VARCHAR(50))
RETURNS INT
DETERMINISTIC
BEGIN
DECLARE p... | true |
a515c3be39f22804af0b3f16314c6842f2eb707b | SQL | pdvmoto/binsql | /info08_v8.sql | UTF-8 | 1,156 | 2.765625 | 3 | [] | no_license | doc
info08_v8.sql
Tablespace Parameters and Usage
Note: Segment space management column does not exists in Version 8 dba_tablespaces
And plugged in tablespace is only possible from 8i on (Not displayed now!)
#
set head on
set linesize 110
set pages 100
col tablespace_name format a12 head ... | true |
822be750450e07ecfccc7dc7d4fd2c3de982d325 | SQL | luohua13/charts-examples | /tsf-region/tsf-mysql/tsf-mysql/mysql/sql/1.0.0/init_tsf_auth.sql | UTF-8 | 1,547 | 3.828125 | 4 | [] | no_license | -- Create tsf_auth schema
DROP SCHEMA IF EXISTS `tsf_auth`;
CREATE SCHEMA `tsf_auth` ;
-- Create Account
DROP USER IF EXISTS `tsf_auth`;
CREATE USER `tsf_auth`@'%' IDENTIFIED BY 'Tcdn@2007';
GRANT ALL PRIVILEGES ON tsf_auth.* TO 'tsf_auth'@'%' IDENTIFIED BY 'Tcdn@2007';
FLUSH PRIVILEGES;
-- Create Tables of tsf_auth
... | true |
d843fccffdf6caa3c3627023d1c2df4265f5a79e | SQL | DominiqueTromp/oramigrate | /sql_tutorial/duplicate.sql | UTF-8 | 550 | 2.609375 | 3 | [
"MIT"
] | permissive | DROP TABLE P;
DROP TABLE SP;
CREATE TABLE P
(
PNO VARCHAR2(15) NOT NULL,
PNAME VARCHAR2(15) NOT NULL
);
CREATE TABLE SP
(
SNO VARCHAR2(15) NOT NULL,
PNO VARCHAR2(15) NOT NULL
);
INSERT INTO P (PNO, PNAME) VALUES ( 'P1', 'Screw');
INSERT INTO P (PNO, PNAME) VALUES( 'P1', 'Screw');
INSERT INTO P (PNO... | true |
a806aa48fa33f25ba4e809e4809e5e5b75c0d74d | SQL | AlphaHinex/mysql2h2-converter | /src/test/resources/scripts/create-table-with-constraint-on-delete.sql | UTF-8 | 758 | 3.546875 | 4 | [
"MIT"
] | permissive |
CREATE DATABASE /*!32312 IF NOT EXISTS*/`empty` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `empty`;
CREATE TABLE `user` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`NAME` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='A sample user table.';
CREATE TABLE `sample` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT... | true |
650efad6b6127f46ca0bdd91e42444c09ca1d8a1 | SQL | dbauz/sugtrad | /suggestion Xfury/suggestion sd2 mangos 2792.sql | UTF-8 | 1,043 | 2.640625 | 3 | [] | no_license | -- Zarithrian Spawn Stalker
DELETE FROM creature WHERE id=39794;
INSERT INTO creature (id,map,spawnMask,phaseMask,modelid,equipment_id,position_x,position_y,position_z,orientation,spawntimesecs,spawndist,currentwaypoint,curhealth,curmana,DeathState,MovementType) VALUES
(39794, 724, 15, 1, 0, 0, 3043.97, 419.88, 87.0399... | true |
2c7a80a4c158064d0ebeb0663d1b4b9977267d28 | SQL | droconnel22/QuestionSet_CSharp | /AP_QuestionSet_CSharp/SQLQuestions/QuestionFour.sql | UTF-8 | 1,271 | 3.703125 | 4 | [] | no_license | Select UA.UserId,
(CASE
WHEN
DATEDIFF (minute,
(SELECT UA2.Timestamp
from dbo.UserActivity UA2
WHERE UA.UserId = UA2.UserId and UA2.Action ='LoggedIn'),
(select UA1.Timestamp
from dbo.UserActivity UA1
where UA.UserId = UA1.UserId and UA1.Action = 'Clicked')
) IS NULL
THEN
... | true |
c7776feee37b9c78669cfb3a9b4cde63a7b907e2 | SQL | aminriqky/mara | /src/mara.sql | UTF-8 | 43,646 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 04 Nov 2020 pada 05.12
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.3.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
ff40076c6785df52a9f68de702639c3deb0fc086 | SQL | flbpinto/Coursera-ASU-Database | /solution_Assing1.sql | UTF-8 | 2,162 | 3.796875 | 4 | [] | no_license | -- Cousera - ASU - Data in Database
-- Assignment 1: Create Movie Recommendation Database
-- Fernando L B Pinto
-- clearing the database
drop table users cascade ; drop table movies cascade ; drop table taginfo cascade ; drop table genres cascade ;
drop table ratings cascade ; drop table tags ... | true |
f4a58ffa03604315294c1274dde24d15e76fa471 | SQL | delprks/product-services-prototype | /migration/001-offer.sql | UTF-8 | 656 | 3.40625 | 3 | [
"MIT"
] | permissive | CREATE TABLE public.offer
(
id INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
user_id INT NOT NULL,
title VARCHAR(255) NOT NULL,
description VARCHAR(755) NOT NULL,
headline VARCHAR(40),
condition VARCHAR(40) NOT NULL,
available_from TIMESTAMP NOT NULL,
available_to TIMESTAMP NOT NULL,
... | true |
3dd3d7ec324b1ae3c4acbdae1c62a81bd4cebbe7 | SQL | DAITJESTKO/TOPM2 | /htdocs/Selena/db/v_t_inet.sql | UTF-8 | 1,396 | 2.703125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.1
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Июн 06 2011 г., 17:30
-- Версия сервера: 5.0.67
-- Версия PHP: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101... | true |
bb0ea1b99a4bcf2e7b3db95a0a47183af20c309b | SQL | ErwanDB/lab-mysql | /your-code/create.sql | UTF-8 | 1,054 | 3.5625 | 4 | [] | no_license | "Create database"
CREATE DATABASE LabMySQL;
"Use database"
USE LabMySQL;
"Create table Cars"
CREATE TABLE Cars (ID INT auto_increment, VIN VARCHAR(20) NOT NULL, Manufacturer VARCHAR(20) NOT NULL, Model VARCHAR(30) NOT NULL, Car_Year INT(4) NOT NULL, Color VARCHAR(20), primary key(ID));
"Create table Customers"
CREAT... | true |
c1e53fa43a3c51f0d00be076d917c501777ad8bf | SQL | remdex/hppg | /doc/database/update_25.sql | UTF-8 | 351 | 2.640625 | 3 | [] | no_license | ALTER TABLE `lh_gallery_pallete_images` DROP PRIMARY KEY ,ADD PRIMARY KEY ( `pallete_id` , `pid` );
ALTER TABLE `lh_gallery_pallete_images` ADD INDEX(`pid`);
ALTER TABLE `lh_gallery_pallete_images` CHANGE `pallete_id` `pallete_id` SMALLINT( 3 ) NOT NULL;
ALTER TABLE `lh_gallery_pallete_images` CHANGE `count` ... | true |
235545d90b30b2456b61536c831fa1bd14688772 | SQL | radtek/Telecommunication | /K7/DataBase/TABLES/REPORT_PHONE_INACTIVE.sql | UTF-8 | 2,074 | 3.203125 | 3 | [] | no_license | CREATE TABLE REPORT_PHONE_INACTIVE
(
LOGIN VARCHAR2(30 CHAR),
PHONE_NUMBER_FEDERAL VARCHAR2(10 CHAR),
CONTRACT_DATE DATE,
BALANCE NUMBER(15,2),
PHONE_IS_ACTIVE VARCHAR2(25 CHAR),
DOP_STATUS_NAME VARCHAR2(100 CHAR),
LAST_CHECK_DATE_TIME DATE,
DATE_CREAT... | true |
fa274f32d030a586ae4679f2eb70c7d44888c9a4 | SQL | biosan11/bidata | /bidata/sql/211_ft_81_expenses.sql | UTF-8 | 4,780 | 3.265625 | 3 | [] | no_license | -- ----------------------------------程序头部----------------------------------------------
-- 功能:bidata层费用明细表
-- ----------------------------------------------------------------------------------------
-- 程序名称:bidata.XXX_ft_81_expenses.sql
-- 目标模型:bidata.ft_81_expenses
-- 源 表:edw.x_account_fy
-- -----------------------... | true |
af286ee8f5a767fc00b1404dcb0a69944de3971a | SQL | Bader1011/hw-w04d04-NBA-SQL | /nba_seed.sql | UTF-8 | 679 | 3.109375 | 3 | [] | no_license | ----------------------------------
-- Part 1
-- Drop DB if exists
--DROP DATABASE IF EXISTS nba_db;
-- Create DB nba_db
--CREATE DATABASE nba_db;
-- Connect to nba_db
\c nba_db;
-- Create table here
create table players (id serial, name text , age int , team text , games int , points int);
-- Insert player here
I... | true |
b65306438467f63aec3b08c6e06869edf573c71b | SQL | Jose-N/Launch-Academy-Week-5 | /sql-marathon/schema.sql | UTF-8 | 326 | 3.484375 | 3 | [] | no_license | DROP TABLE movies CASCADE;
DROP TABLE category CASCADE;
CREATE TABLE category (
id SERIAL PRIMARY KEY,
type varchar(255)
);
CREATE TABLE movies(
id SERIAL PRIMARY KEY,
title varchar(255),
year integer,
category_id integer
);
CREATE UNIQUE INDEX ON category (type);
CREATE UNIQUE INDEX ON movies (title, y... | true |
fa27c5f15429348dfdaba49eadc70be33c2121e9 | SQL | adrienstankovic/Facebook-Database-PostgreSQL | /Script SQL/Tables creation/Q3.sql | UTF-8 | 4,931 | 3.796875 | 4 | [] | no_license | -- Question 3 : Tables creation
------------------------------------------------------------
-- Script Postgre
------------------------------------------------------------
------------------------------------------------------------
-- Table: Groupes
----------------------------------------------------------... | true |
9c5514455e92bdbf4aec6b8d7f9f9f69ea3675cb | SQL | coco-bigdata/x-smart-kettle-server | /doc/database/MySql/资源库脚本/create.sql | UTF-8 | 10,593 | 3.0625 | 3 | [
"MIT"
] | permissive | create table r_cluster
(
ID_CLUSTER bigint not null
primary key,
NAME varchar(255) null,
BASE_PORT varchar(255) null,
SOCKETS_BUFFER_SIZE varchar(255) null,
SOCKETS_FLUSH_INTERVAL varchar(255) null,
SOCKETS_COMPRESSED tinyint(1) null,
DYNAMIC_CLUSTER tinyint(1) null
)
;
create table r_cluster_slave
(
ID_CLUS... | true |
6f3c6c9a91e36f8298cff976ee5aa7cd3c0c493d | SQL | radtek/abs3 | /sql/mmfo/bars/Table/dpu_proc_dr.sql | WINDOWS-1251 | 4,392 | 2.984375 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Table/DPU_PROC_DR.sql =========*** Run *** =
PROMPT =====================================================================================
PROMPT *** ALTER_POLICY_INFO... | true |
7ddc45a2cccf617db647c22a457c42e2a470414c | SQL | hi-matschi/books | /src/main/java/fr/afpa/matschi/book/dao/database.sql | UTF-8 | 1,156 | 3.734375 | 4 | [] | no_license | -- UP
CREATE DATABASE java_book;
CREATE TABLE author (
id_author INT NOT NULL AUTO_INCREMENT,
firstname VARCHAR(250),
lastname VARCHAR(250)
);
INSERT INTO author (firstname, lastname) VALUES
('Steve','McConnell'),
('J.K.', 'Rowling'),
('Mark', 'Yerger'),
('Thierry', 'Courtin');
CREATE TABLE book (
id_book I... | true |
1e84d95ec246b0c1743634acb9fefafdeeed7f0a | SQL | PingItProject/PingItWebsite | /PingItWebsite/Stored Procedures/GetAvgDomainLoadtime.sql | UTF-8 | 252 | 3.25 | 3 | [] | no_license | CREATE DEFINER=`root`@`%` PROCEDURE `GetAvgDomainLoadtime`(IN domain VARCHAR(100))
BEGIN
SELECT website,
AVG(total) as total
FROM PingIt.websites
WHERE domain = 'null'
OR website LIKE concat('%', domain, '%')
GROUP BY website;
END | true |
565572c1170b81b601cf3c41b1095385733af2a0 | SQL | PetrBalej/nalezovka | /public/db-struktura.sql | UTF-8 | 2,406 | 3.5625 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Počítač: 127.0.0.1:3306
-- Vytvořeno: Čtv 12. pro 2019, 06:21
-- Verze serveru: 10.4.10-MariaDB
-- Verze PHP: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Databáze: `ge... | true |
dfc6fecd05b6a4e3810c8188b5f52af81de52092 | SQL | hayate891/opencast | /modules/matterhorn-asset-manager-impl/src/test/resources/mysql-assetmanager-schema.sql | UTF-8 | 2,407 | 3.59375 | 4 | [
"ECL-2.0",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-unknown",
"LicenseRef-scancode-free-unknown"
] | permissive | CREATE TABLE `mh_assets_snapshot` (
`mediapackage_id` varchar(128) NOT NULL,
`version` bigint(20) NOT NULL,
`organization_id` varchar(128) NOT NULL,
`mediapackage_xml` longtext NOT NULL,
`archival_date` datetime NOT NULL,
`id` bigint(20) NOT NULL,
`availability` varchar(32) NOT NULL,
`series_id` varchar... | true |
7429bf9f3afb9b3a19aa4b39f21d972e36ea3041 | SQL | SoulApps/CrossPlatformLearning | /Primero/Bases de datos/Primero/Recuperación/ejer2.sql | UTF-8 | 391 | 3.09375 | 3 | [] | no_license | CREATE DEFINER=`root`@`localhost` TRIGGER `recuperacion`.`viviendas_AFTER_UPDATE` AFTER UPDATE ON `viviendas` FOR EACH ROW
BEGIN
DECLARE a INT DEFAULT 0;
DECLARE mensaje VARCHAR(200);
SET mensaje='Ese valor no es válido';
IF
NEW.tipo_viv!='B'
THEN SET a=a+1;
END IF;
IF
a>0
T... | true |
4e4d0a1b1f9e60d7a9b49ff33ec596f0ff7df353 | SQL | pratyushjava/SQL-PLSQL | /PLSQL/ex4/num4_7.sql | UTF-8 | 479 | 2.640625 | 3 | [] | no_license | create or replace procedure printnum(num number)
as
temp number:=num;
d number;
rev number:=0;
word varchar2(7);
begin
while(temp<>0)
loop
d:=mod(temp,10);
rev:=(rev*10)+d;
temp:=floor(temp/10);
end loop;
while(rev<>0)
loop
d:=mod(rev,10);
rev:=floor(rev/10);
select decode(d,0,'zer... | true |
514e412e3d7f2e5ff9fb91b9ace119b5fd62cd3e | SQL | Linliquan/springboot-music | /springboot-music/ss/game.sql | UTF-8 | 47,729 | 2.796875 | 3 | [
"MIT"
] | permissive | /*
Navicat Premium Data Transfer
Source Server : y_liquan
Source Server Type : MySQL
Source Server Version : 50724
Source Host : localhost:3306
Source Schema : game
Target Server Type : MySQL
Target Server Version : 50724
File Encoding : 65001
Date: 15/03/2020 14:13:... | true |
f69ac6d221b0b9745294a6864cb162db93f32dc5 | SQL | l-Legacy-l/Petclinic-backend | /petclinic-core/src/resources/db-migration/sprint_1/populate.sql | UTF-8 | 1,469 | 2.921875 | 3 | [] | no_license | --liquibase formatted sql
--changeset fabio:3
USE petclinic;
INSERT INTO vet (lastname, firstname, speciality) VALUES ("James", "James", "none");
INSERT INTO vet (lastname, firstname, speciality) VALUES ("Helen", "Helen", "radiology");
INSERT INTO vet (lastname, firstname, speciality) VALUES ("Linda", "Linda", "sur... | true |
c9b44056dcab35995764306efdc434407b2d0ae7 | SQL | radtek/abs3 | /sql/mmfo/barsupl/Table/upl_file_param_values.sql | WINDOWS-1251 | 3,199 | 3.296875 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARSUPL/Table/UPL_FILE_PARAM_VALUES.sql ======
PROMPT =====================================================================================
PROMPT *** Create table UPL_FI... | true |
935b6360fca088dc5ba1946142cbadaa6eb5cb1d | SQL | SkinnyCoders/Simple-Blog | /myblog.sql | UTF-8 | 4,104 | 3.21875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 29 Agu 2019 pada 05.22
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... | true |
d1c5b7efeabb97f0a2e35812017ed4e693db262a | SQL | ahmed-ahmed/ez-books-back-end | /src/main/resources/db/migration/default/V1__init_schema.sql | UTF-8 | 4,844 | 3.03125 | 3 | [] | no_license | SET IGNORECASE 1;
CREATE SEQUENCE "PUBLIC"."SYSTEM_SEQUENCE_A649BE84_B443_46D6_8100_95E818414F39" START WITH 1 BELONGS_TO_TABLE;
CREATE SEQUENCE "PUBLIC"."SYSTEM_SEQUENCE_5D6A6CED_114C_4C6D_ACA3_25CF7714F097" START WITH 10 BELONGS_TO_TABLE;
CREATE SEQUENCE "PUBLIC"."SYSTEM_SEQUENCE_FFE6A045_E955_4DD9_9ED9_EDDB5527C76E... | true |
1b35a7d9c8a87c65a54e9da88b53de4a8a86d68f | SQL | MrErin/PythonExercises | /Regular/SQLChinook/11.sql | UTF-8 | 306 | 3.359375 | 3 | [] | no_license | -- `line_items_per_invoice.sql`: Looking at the InvoiceLine table, provide a query that COUNTs the number of line items for each Invoice. HINT: [GROUP BY](http://www.sqlite.org/lang_select.html#resultset)
SELECT l.InvoiceId, COUNT(l.InvoiceLineId) as 'LineItems'
FROM InvoiceLine l
GROUP BY l.InvoiceId | true |
86f325be7199819eb459459b3a9f9fb0405589b2 | SQL | pelletier2017/sql-homework | /Homework 9-8.11.2020.sql | UTF-8 | 1,981 | 3.890625 | 4 | [] | no_license | CREATE TABLE [Course] (
[CourseID] Int,
[Coursename] varchar(30),
[CourseCredits] Int,
PRIMARY KEY ([CourseID])
);
CREATE TABLE [Major] (
[MajorID] Int,
[Name] varchar(30),
[CreditsToGrad] Int,
PRIMARY KEY ([MajorID])
);
CREATE TABLE [Student] (
[StudentID] Int,
[MajorID] Int,
[FirstName] varcha... | true |
687b44d2750ccecec81b4553438e10160128652c | SQL | Last-Mile-Health/LMD-Databases | /lastmile_report/view/view_odk_position_id_cha_sick_child.sql | UTF-8 | 654 | 3.390625 | 3 | [] | no_license | use lastmile_report;
drop view if exists lastmile_report.view_odk_position_id_cha_sick_child;
create view lastmile_report.view_odk_position_id_cha_sick_child as
select
year( a.manualDate ) as year_report,
month( a.manualDate ) as month_report,
trim( a.chwID ) as position_id,
cou... | true |
4c6ff679a4e0a8b19767e92926ac29f3f3e7689d | SQL | frick405/mysql_tutorial | /chapter_one/tutorial_2.sql | UTF-8 | 412 | 3.390625 | 3 | [] | no_license | # SELECT command can get items what you input name for column
# FROM command make SELECT command refer table that input FROM
SELECT lastName
FROM employees;
# and multiple items can be brought by input multiple column names
SELECT
lastName,
firstName,
jobtitle
FROM employees;
# if you use *(asterisk), then ... | true |
c25829098897f58e17514b47a3fcbec5bad64149 | SQL | HuddleSports/calendar-events-processor | /src/main/resources/database/AddTables.sql | UTF-8 | 1,772 | 3.296875 | 3 | [] | no_license | CREATE TABLE `JdoValue` (
`key` varchar(255) NOT NULL PRIMARY KEY,
`binaryData` varbinary(1000) DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
);
CREATE TABLE `Location` (
`id` int(11) NOT NULL AUTO_IN... | true |
812d8060ae30a45168e1600ff190b1377655e94e | SQL | Jim6561/RadRunningStats | /usefulScripts/CreateTables.sql | UTF-8 | 1,138 | 3.390625 | 3 | [] | no_license | -- Table: public."race"
-- DROP TABLE public."race";
CREATE TABLE public."race"
(
race_id serial,
event_date date NOT NULL,
distance character varying(255) NOT NULL COLLATE pg_catalog."default",
location character varying(255) COLLATE pg_catalog."default",
race_name character varying(255) NOT N... | true |
60136aaeb75cb3493d7a27f8657d79ace95bb545 | SQL | bmeadows/acs-journal | /app/webroot/acs/2011/includes/db/create_country.sql | UTF-8 | 12,140 | 2.796875 | 3 | [] | no_license | drop table if exists country;
create table if not exists country (
id integer primary key,
name text
);
insert into country values (1, 'Afghanistan');
insert into country values (2, 'Albania');
insert into country values (3, 'Algeria');
insert into country values (4, 'American Samoa');
insert into country values ... | true |
6fa81a47af4c0ff17a62d6a4a1f498cdae64fcf9 | SQL | pingcap/tispark | /core/src/test/resources/tpcds-sql/q99.sql | UTF-8 | 1,166 | 3.484375 | 3 | [
"Apache-2.0",
"GPL-1.0-or-later"
] | permissive | --q99.sql--
select
substr(w_warehouse_name,1,20), sm_type, cc_name
,sum(case when (cs_ship_date_sk - cs_sold_date_sk <= 30 ) then 1 else 0 end) as `30 days`
,sum(case when (cs_ship_date_sk - cs_sold_date_sk > 30) and
(cs_ship_date_sk - cs_sold_date_sk <= 60) then 1 else 0 end ) as `31-60... | true |
b32e31fa1a5850ab84507df09796c66645705b27 | SQL | EvanZha0/springboot-ureport | /src/main/resources/sql/init.sql | UTF-8 | 604 | 3 | 3 | [] | permissive | /** 建表 sql */
CREATE TABLE `ureport_file_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`path` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`name` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '报表名称',
`content` mediumblob COMMENT '报表内容',
`tenant_id` varchar(128) COLLATE utf8_bin DEFAULT '' COMMENT '租户字段',
... | true |
be99c415132e1f4c0647965dd78d4769e059cf67 | SQL | tokyojack/Gradeify | /routes/staff/teacher/queries/findAssignment.sql | UTF-8 | 330 | 3.546875 | 4 | [] | no_license | SELECT students.firstName FROM studentAssignments
LEFT JOIN students
ON students.studentNumber = studentAssignments.studentNumber
LEFT JOIN assignments
ON assignments.id = studentAssignments.assignmentId
WHERE students.firstName=? AND students.lastName=? AND assignments.name=? AND studentAssignments.... | true |
799830dc5aff9a6544be1854d7c4a64bc8f2a6ac | SQL | MyrionSC/P10 | /SQL/pg_routing_setup.sql | UTF-8 | 1,078 | 3.390625 | 3 | [] | no_license | CREATE TABLE maps.routing AS
SELECT
segmentkey,
startpoint,
endpoint,
segmentgeo::geometry as segmentgeom
FROM maps.osm_dk_20140101;
CREATE TABLE maps.routing2 AS
SELECT
segmentkey,
startpoint,
endpoint,
segmentgeo::geometry as segmentgeom
FROM maps.osm_dk_20140101 osm1
UNION
SELECT
segmentkey,
end... | true |
b8e400aa9666b33dd147d38ff442b0bf71f3e72a | SQL | lauranor/Tsoha-Bootstrap | /sql/add_test_data.sql | UTF-8 | 781 | 2.953125 | 3 | [] | no_license | --INSERT INTO Student (name, email) VALUES ('Pirkko', 'mina@email.fi');
INSERT INTO Counsellor (username, password) VALUES ('tarmo.tietaja@email.com', 'salasana123');
INSERT INTO Counsellor (username, password, administrator) VALUES ('pirkko.parempi@email.com', '1972', true);
INSERT INTO Category (category_name) VAL... | true |
c1202bbff3a759071f120b5be9b1bac3c5a52a5b | SQL | brynjaranalytica/SEP4 | /ThermalAnalysis/WeatherMocking/MockWeatherRead.sql | UTF-8 | 613 | 3.5 | 4 | [
"MIT"
] | permissive | /* This script fetches a weather data row from the transformed weather data for
* each weather station to create a mock of an actual read.
*
* The mock is made to pick the weather closest to the date and time of which
* the largest concentration of logs have, in hopes of creating a most optimal
* visualization.
*... | true |
9d8645c393de5b1d993c76a68678356ee9bf82a9 | SQL | YTYS99/BooksManger | /library.sql | UTF-8 | 21,082 | 2.96875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50508
Source Host : localhost:3306
Source Database : library
Target Server Type : MYSQL
Target Server Version : 50508
File Encoding : 65001
Date: 2019-06-14 10:48:01
*/
SET FOREIGN_KEY_CHECKS=0;
-- --... | true |
ed0f976b235b939cdde39e9eda9b425c79425b33 | SQL | xonatis-academy/wf3-cda-ibm-260721 | /code/dump/patissor.sql | UTF-8 | 2,846 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : lun. 27 sep. 2021 à 14:23
-- Version du serveur : 8.0.21
-- Version de PHP : 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... | true |
47b7593c2fff937d119544a2abd8355f2c1c4cb6 | SQL | FelixPriori/side-quests | /back-end/db/seeds/test.sql | UTF-8 | 1,484 | 2.96875 | 3 | [] | no_license | INSERT INTO users (username, first_name, last_name, email, password, avatar, adventurer, bio)
VALUES
(
'BobRobertson', 'Bob', 'Robertson', 'bob@example.com', '$2b$10$xPttDUv.c13m9X1ni9CqEOFk1P5exXZeq.2LL.YrztVIWMxi4FTVm', '/images/defaultAvatar.png', true, ''
),
( --2
'AlAlbertson', 'Al', 'Albertson', 'al... | true |
cbcb6562b6066fd2463226983c3227070c47701b | SQL | postgres-ai/postgres-checkup-tests | /master/json_reports/1_2019_05_23T10_02_22_+0000/K_query_groups/10_1.sql | UTF-8 | 239 | 2.5625 | 3 | [] | no_license | -- queryid: 2527906257619262000
-- NOTICE: the first 50k characters
-- NOTICE: current query size (bytes): '126'
create table t_with_redundant_idx as select id, id as f1, id as f2, id as f3, id as f4 from generate_series(1, 1000000) _(id)
| true |
4391cb780717da79ac9d29c075714763a629e7f4 | SQL | Solaris-star/MySQL-HackerRank-PersonalSolutions | /Aggregations Challenges/Weather Observation Station 20.SQL | UTF-8 | 351 | 3.640625 | 4 | [] | no_license | CHALLENGE LINK:
https://www.hackerrank.com/challenges/weather-observation-station-20/problem
SOLUTION:
SELECT ROUND(S.LAT_N,4)
FROM STATION AS S
WHERE(SELECT COUNT(LAT_N)
FROM STATION
WHERE LAT_N < S.LAT_N) = (SELECT COUNT(LAT_N)
FROM STATION
... | true |
137f20d2c2fc514a237ef37e9c6e71e2fd9a4859 | SQL | veer1525/EaseCentralCode | /Queries.sql | UTF-8 | 1,351 | 4.59375 | 5 | [] | no_license |
--Display People and their Phone numbers
SELECT PEOPLE_NAME, PHONE_NUMBER
FROM TABLE_PEOPLE
INNER JOIN TABLE_PHONE
ON PK_PEOPLE_ID = FK_PEOPLE_ID
--Display People and their addresses
SELECT PEOPLE_NAME,
ADDRESS_LINE_1 + ' ,' + ADDRESS_LINE_2 + ' ,' + CITY + ' ,' + STATE + ' ,' + ZIP [ADDRESS]
FROM TABLE... | true |
3a8edaf4e1d10f4c4cf274050c2564a1321c7df6 | SQL | sansbacon/sql_examples | /extra_dfs_draft_prior.sql | UTF-8 | 3,946 | 3.796875 | 4 | [
"MIT"
] | permissive | -- extra_dfs_draft_prior.sql
-- puts DRAFT.com data dump on prior seasons into tables
-- https://blog.draft.com/2018/03/12/attention-nerds-prior-raw-best-ball-data/
-- Only 4 positions allowed in DRAFT.com drafts
DROP TYPE IF EXISTS extra_dfs_draft_prior.drpos;
CREATE TYPE extra_dfs_draft_prior.drpos AS ENUM
('QB',... | true |
c63d6413ff98838372d58c1016778555d2d6491d | SQL | mirfishe/PKD-and-Me-Server | /sql/titleURLs.sql | UTF-8 | 1,025 | 3.890625 | 4 | [] | no_license |
-- https://stackoverflow.com/questions/11731655/how-to-do-a-count-on-a-union-query
SELECT urls.linkName, COUNT(*) AS linknamecount
FROM (
SELECT REPLACE(category, ' ', '-') AS linkname FROM categories
UNION ALL
SELECT REPLACE(media, ' ', '-') AS linkname FROM media
UNION ALL
SELECT "titleURL" AS linkname FROM tit... | true |
a75b64e59cd5d393eb57582cf3286d22b58c6b0b | SQL | HEEJU-a/DB | /6월 15일.sql | UTF-8 | 1,281 | 3.9375 | 4 | [] | no_license | create database apartment default character set utf8 collate UTF8_GENERAL_CI;
CREATE TABLE location_code(
cd INT UNSIGNED PRIMARY KEY,
local_nm nvarchar(5) NOT NULL,
external_cd CHAR(5) NOT NULL
);
SELECT cd, local_nm, external_cd FROM location_code;
INSERT INTO location_code
(cd, local_nm, external_cd)... | true |
d6d8e12302f696fdbc258d6d4b8b7360812323e9 | SQL | arellanod/Integration-2d | /FND.02.01/install/sql/XXFND_COMMON_INT_DML.sql | UTF-8 | 1,277 | 2.625 | 3 | [] | no_license | /****************************************************************************
**
** $HeadURL: $
**
** Purpose: Populate interface sources table with unique data sources.
**
** Author: DXC RED ROCK
**
** $Date: $
**
** $Revision: $
**
** History: Refer to Source Control
**
*****************************************... | true |
5ee32a6b4f879128d9ea331c17d963ce6dc8a203 | SQL | tsayjunior/base-polleria | /rosticeria/consultas.sql | UTF-8 | 7,840 | 4.53125 | 5 | [] | no_license | -- 1.- Mostrar la cantidad total de pedidos de todo un día
select producto.nombre, sum(detalle_pedido.cantidad)
from pedido, detalle_pedido, producto
where pedido.cod_pedido=detalle_pedido.cod_pedido and detalle_pedido.cod_producto= producto.cod_producto
and fecha_hora between '2021-06-08' and '2021-06-09'
group by p... | true |
d41098d264bf20616efd87a6e900cacd46f0f6a6 | SQL | nattawatsakubol/std6102041520050-database | /property_for_ren.sql | UTF-8 | 433 | 2.625 | 3 | [] | no_license | CREATE TABLE `property_for_rent` (
`property_no` varchar(5) NOT NULL,
`street` text,
`city` varchar(100) NOT NULL,
`postcode` varchar(10) DEFAULT NULL,
`type` varchar(10) NOT NULL,
`rooms` int(2) NOT NULL,
`rent` int(4) NOT NULL,
`owner_no` varchar(5) NOT NULL,
`staff_no` varchar(5) DEFAULT N... | true |
ec8f546b2dcf5b94b6254cf9ed576124d00f9691 | SQL | devlemire/RESTful-APIs-2018 | /db/contact/schema.sql | UTF-8 | 532 | 3.0625 | 3 | [] | no_license | -- DDL generated by Postico 1.4.2
-- Not all database features are supported. Do not use for backup.
-- Table Definition ----------------------------------------------
CREATE TABLE contact (
contact_id SERIAL PRIMARY KEY,
first_name text NOT NULL,
last_name text NOT NULL,
email text,
company text,... | true |
065ffb684b576cd6e47427c80fab7aeaad244edd | SQL | emanuelanechei/Oracle-Email-Reports | /sql/errors-Nonshelving_With_Shelving_FC.sql | UTF-8 | 623 | 3.03125 | 3 | [] | no_license |
select msi.segment1
, planner_code
, item_type
, attribute7 eau
, cat.category_concat_segs
from mtl_system_items_b msi
, mtl_item_categories_v cat
where msi.organization_id = 85
and msi.organization_id = cat.organization_id(+)
and inventory_item_status_code = 'Active'
-- and planner_code ... | true |
ec1f7a712123ad9fd6221aa9cab7cbf31713e1de | SQL | silvioedu/HackerRank-SQL-Practice | /basicSelect/WeatherObservationStation12.sql | UTF-8 | 86 | 2.515625 | 3 | [
"MIT"
] | permissive | SELECT DISTINCT City
FROM Station
WHERE REGEXP_LIKE(City, '^[^AEIOU].*[^aeiou]$');
| true |
0d93ca2a96ef9b6bda60ba96c6e739bbbcc274fb | SQL | y-tomimoto/CleanArchitecture | /part9/db/mysql/init/001.sql | UTF-8 | 336 | 2.609375 | 3 | [
"MIT"
] | permissive | ---- drop ----
DROP TABLE IF EXISTS `test_table`;
---- create ----
create table
IF not exists `test_table`
(
`memo_id` INT
(20) AUTO_INCREMENT,
`memo` VARCHAR
(20) NOT NULL,
`memo_author` VARCHAR
(20) NOT NULL,
`memo_user_agent` VARCHAR
(500) NOT NULL,
PRIMARY KE... | true |
fc1cb4aac710b41340e79909930baf9f6f07324c | SQL | hopana/springboot-web | /sql/sql.sql | UTF-8 | 5,319 | 3.375 | 3 | [] | no_license | /*
SQLyog Ultimate v12.5.0 (64 bit)
MySQL - 5.7.21 : Database - test
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY... | true |
48d247081cb1ad3127a502322eec9b4e340099f8 | SQL | sou59/php | /Exemples/Exemples/chapitre7/1-rappel/jeu-requetes.sql | UTF-8 | 827 | 3.796875 | 4 | [] | no_license | -- Création d'un table de test
CREATE TABLE coucou (
id INTEGER
);
-- Insérer des données dans la table
INSERT INTO coucou (id) VALUES (1), (2);
-- Modifier des données
UPDATE coucou SET id=100 WHERE id=1;
-- Supprimer des données
DELETE FROM coucou WHERE id=2;
-- Extraire la totalité des données de la TABLE
SEL... | true |
7a7d4b67103273e9154108bc8c680545c9d7b463 | SQL | Vagnata/Zeus-Coders | /SqlScripts/IndiceAprovacao.sql | UTF-8 | 245 | 2.78125 | 3 | [
"MIT"
] | permissive | select top(10)
NomeMunicipio,
sum(MatriculasTotal) as MatriculasTotal,
sum(Aprovados) as Aprovados,
ROUND(((sum(Aprovados)*100)/sum(MatriculasTotal)),2) as Porcentagem
from MatriculasConsolidadas
group by NomeMunicipio
order by Porcentagem desc | true |
6966b027a0baa7a4c94d6e240376308d2061d166 | SQL | yanyang/training | /demo/demo.mybatis/sql/schema.sql | UTF-8 | 332 | 3.234375 | 3 | [] | no_license | drop table if exists users;
create table users (
id int auto_increment,
name varchar(50) not null,
role int not null default 0,
last_login_time timestamp default current_timestamp,
primary key(id),
unique key(name)
);
insert into users(id, name) values
(1, 'tom'),
(2, 'jerry'),
(3, 'alice'),
(4... | true |
210af96330948326263f5c6f17c04993cfc909f4 | SQL | markuszabel/dv_sql | /invoices_audit_2016_ax.sql | UTF-8 | 255 | 2.640625 | 3 | [] | no_license | Select
Invoiceid, CurrencyCode, Invoiceamount, Sumtax, SalesBalance, cast(InvoiceDate as Date) as "InvoiceDate"
From
"AX.PROD_DynamicsAX2012.dbo.CustInvoiceJour" as cij
Where
dataareaid = 'deag' and invoicedate between '2016-04-01' and '2016-12-31' | true |
3a134ba6f9dd84f712341d05b98e184c05ba7a17 | SQL | AnnotatedBooksOnline/AnnotatedBooksOnline | /application/sqlscripts/updates/update29_30.sql | UTF-8 | 422 | 3.296875 | 3 | [] | no_license | BEGIN TRANSACTION;
-- Create a special user representing all deleted users and insert its ID into the settings table.
INSERT INTO "Users"("username", "passwordHash", "email", "active", "banned", "rank")
VALUES ('<deleted user>', '', '', '1', '1', 0);
INSERT INTO "Settings" ("settingName", "settingValue")
VAL... | true |
118ed935078fc23f299e1c74e5233065620f33f5 | SQL | castboy/anchytec-test | /sql/order.sql | UTF-8 | 2,353 | 3.390625 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : mac mysql
Source Server Type : MySQL
Source Server Version : 80015
Source Host : localhost:3306
Source Schema : symbol
Target Server Type : MySQL
Target Server Version : 80015
File Encoding : 65001
Date: 23/05/2019 11:... | true |
be85730c7a98469f6a6a574807cbb3c2ce3018e9 | SQL | adrian21456/Retailed-Water-POS-Systems | /water (1).sql | UTF-8 | 10,360 | 3.015625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 22, 2019 at 12:31 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 |
5f7af26b3c135c9c7bcdef1ccd479fe8272a574f | SQL | brian-holsters/lulo | /sql_templates/_default/select/join_with_many_to_many.twig.sql | UTF-8 | 1,071 | 3.5 | 4 | [
"MIT"
] | permissive | {# Many-to-Many relationship #}
{% set condition_i = 0 %}
{# Number of nexus tables #}
{% set num_junctions = relationship["attributes"]["junctions"]|length %}
{% for junction in relationship["attributes"]["junctions"] %}
LEFT OUTER JOIN {{junction}} ON (
{% for src_attr,dest_attr in relationship["attributes"]["co... | true |
ae801521fe596771ca4267e178226400fb6365fe | SQL | Shweta2016/Databases | /2.DatabaseCreation/q9.sql | UTF-8 | 608 | 3.828125 | 4 | [] | no_license | /* 9. Print the names of all actors who have starred in all movies in which
Al pacino has starred in (it’s ok to report the name of Al pacino in the result;
also, it is ok if these actors have starred in more movies than Al pacino has played in). */
/* List of all the movies of Al Pacino */
CREATE VIEW ALPACINO_MOVI... | true |
3c0d3fd80b0a33e14f954ff12c5c91e971464fc9 | SQL | yxxhero/3n1b.com | /dbstructure/college.sql | UTF-8 | 1,747 | 2.8125 | 3 | [] | no_license | # MySQL-Front 3.2 (Build 14.8)
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='SYSTEM' */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
/*!40101 SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
/*!40103 SET SQL_NOTES=... | true |
88c88b93b96d7cf84b2981ea582ae88ee67ac5f2 | SQL | epickrram/romero-build | /src/main/resources/romero.schema.sql | UTF-8 | 253 | 3.15625 | 3 | [] | no_license | CREATE TABLE job_run (
id INT NOT NULL AUTO_INCREMENT,
identifier VARCHAR(255) NOT NULL,
start_timestamp BIGINT NOT NULL,
end_timestamp BIGINT NOT NULL,
primary key (id)
);
CREATE INDEX idx_job_run_identifier ON job_run(identifier); | true |
8a8cd28cc17ecfed94651169326da90f566942f8 | SQL | lakshitha1629/Marriage-Proposal-Web-Application | /marriage.sql | UTF-8 | 15,297 | 2.671875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : newcon
Source Server Version : 50617
Source Host : localhost:3306
Source Database : marriage
Target Server Type : MYSQL
Target Server Version : 50617
File Encoding : 65001
Date: 2019-01-31 13:48:38
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... | true |
d448e93085b0cf75d14bd90b7d05c9012a2817aa | SQL | varhenri/TeachTips | /Migrations/V21.04.09.19.28_Create_table_Tip.sql | UTF-8 | 280 | 2.609375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS public."Tip"
(
"Id" bigserial,
"TipText" character varying(5000),
"TipTitle" character varying(500),
"TimeStamp" timestamp without time zone,
CONSTRAINT Tip_pkey PRIMARY KEY ("Id")
);
ALTER TABLE public."Tip"
OWNER to postgres;
| true |
a719a957fa70095ac23a9a33d7bf28cf8bd101a6 | SQL | awslabs/aws-well-architected-labs | /static/Cost/300_CUR_Queries/Code/Compute/outposts_ec2runninghours.sql | UTF-8 | 2,483 | 3.765625 | 4 | [
"Apache-2.0",
"MIT-0",
"CC-BY-SA-4.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- modified: 2021-07-07
-- query_id: outposts_ec2runninghours
-- query_description: This query will provide the Amazon EC2 software costs (like Windows, RHEL or others) on AWS Outposts. These software fees are not included with the cost of the AWS Outposts racks and are billed separately here. The output will include d... | true |
60950ea373b083918a511d2df29051357735da06 | SQL | csdojo/NoteTaker | /db/schema.sql | UTF-8 | 263 | 2.84375 | 3 | [] | no_license | DROP DATABASE IF EXISTS noteTaker_db;
CREATE DATABASE noteTaker_db;
USE noteTaker_db;
-- Create the tables table
CREATE TABLE notes
(
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR (255) NOT NULL,
text VARCHAR (255) NOT NULL,
PRIMARY KEY(id)
); | true |
2a44633f86eb5e5e11fa72ebe1ee452a497cbf8b | SQL | MariaPereira1/Tenis_Oficina_DB | /Oficina/querys_oficina.sql | UTF-8 | 5,144 | 4.40625 | 4 | [] | no_license | -- a. Quais as peças com custo unitário inferior a 10€ e cujo código contém '98'?
SELECT
*
FROM
pecas
WHERE
custo < 10
AND codigo LIKE '%98%';
-- b. Quais as matrículas dos carros que foram reparados no mês de Setembro de 2010, i.e., cuja reparação terminou nesse mês?
SELECT
carros.matricula
FROM
reparacoes
INN... | true |
acd3a676992dd7c8c46e4f51d2f7a69fc03ff5c1 | SQL | cHolzberger/sag-akademie | /sag-akademie.de/lib/db/mysql/dbupdate/07-fix-neuigkeiten.sql | UTF-8 | 814 | 2.578125 | 3 | [] | no_license | UPDATE IGNORE neuigkeit SET datum = "1970-01-01 00:00:00" WHERE datum = "0000-00-00 00:00:00";
UPDATE IGNORE neuigkeit SET geaendert = "1970-01-01 00:00:00" WHERE geaendert = "0000-00-00 00:00:00";
UPDATE IGNORE neuigkeit SET deleted_at = "1970-01-01 00:00:00" WHERE deleted_at = "0000-00-00 00:00:00";
ALTER TABLE ... | true |
bcb28becabd95f917a0acd2433a91027fe9cccb3 | SQL | checksams/serenepayroll | /get_user_roles_list.sql | UTF-8 | 340 | 3.046875 | 3 | [] | no_license | DROP PROCEDURE IF EXISTS `serenehrdb`.`get_user_roles_list`;
DELIMITER $$
CREATE PROCEDURE `get_user_roles_list`(v_usr_code bigint)
begin
SELECT `ur_code`,`ur_name`,`ur_desc`
FROM `serenehrdb`.`shr_user_roles`
where ur_code not in (select usg_ur_code from `shr_user_roles_granted`
where usg_usr_code = v_usr_code);... | true |
a1c4d801184193b92882d029e25a9888f6055586 | SQL | sjwyates/sql-challenge | /EmployeeSQL/sql/query.sql | UTF-8 | 1,375 | 4.15625 | 4 | [] | no_license | -- query 1
SELECT
e.emp_no,
e.last_name,
e.first_name,
e.sex,
s.salary
FROM employees AS e
JOIN salaries AS s
ON e.emp_no = s.emp_no;
-- query 2
SELECT
first_name,
last_name,
hire_date
FROM employees
WHERE EXTRACT(YEAR FROM CAST(hire_date AS DATE)) = 1986;
-- query 3
SELECT
d.dept_no,
d.dept_name,
e.emp_... | true |
7348f5e39ba06d1e2c8a5478e3f4e523de2d1270 | SQL | rfangjiayou/vue_elementUI_koa2_HSDemo | /sql/hsdemo.sql | UTF-8 | 2,458 | 3.0625 | 3 | [] | no_license | /*
SQLyog Ultimate v11.11 (64 bit)
MySQL - 5.5.5-10.1.19-MariaDB : Database - hsdemo
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FORE... | true |
bd71ea941682c59fa8ef502d8bd01b2cd164179b | SQL | vrengifo/videochat | /app/modelo/videochatSybase.sql | UTF-8 | 7,164 | 3.109375 | 3 | [
"MIT"
] | permissive | /* ============================================================ */
/* Database name: VIDEOCHAT */
/* DBMS name: Sybase AS Anywhere 6 */
/* Created on: 06/11/2005 23:45 */
/* =============================================... | true |
74cf3f5cdcb805dea80bfe43932328f10d3bdd27 | SQL | 0o0o00o0o0/spider-py-bt | /mysql.sql | UTF-8 | 523 | 2.71875 | 3 | [] | no_license | DROP TABLE IF EXISTS search_item;
DROP TABLE IF EXISTS search_content;
CREATE TABLE search_item (
uid INT (4) PRIMARY KEY NOT NULL auto_increment,
content VARCHAR (32) NOT NULL
);
CREATE TABLE search_content (
id VARCHAR (32) ,
NAME VARCHAR (256) ,
url VARCHAR (256) ,
type VARCHAR (32) ,
time VARCHAR (32) ,
... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.