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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7b2eae4f108e1958e0a6323e4081acd4d786fad4 | SQL | ldealessandro/NetflixBootcamp | /target/test-classes/tvshow.sql | UTF-8 | 423 | 2.828125 | 3 | [] | no_license | INSERT INTO CATEGORIES(ID, NAME) VALUES
(1, 'TERROR'),
(2, 'otra');
INSERT INTO TV_SHOWS(ID, NAME, SHORT_DESC, LONG_DESC, YEAR, RECOMMENDED_AGE) VALUES
(1, 'TvShow1', 'Descripción corta', 'Descripción larga', '2012', 16),
(2, 'TvShow2', 'Descripción corta', 'Descripción larga', '2012', 16);
INSERT INTO TV_SHOW... | true |
5b2ddeec6a0025e78a86f9753e85e63c080ef08f | SQL | veggiemonk/simple-rest-api | /tmp/sql_query.sql | UTF-8 | 1,562 | 4.375 | 4 | [
"MIT"
] | permissive | ALTER TABLE `MOVIES` AUTO_INCREMENT =1;
SELECT * FROM users WHERE id_user = 990;
INSERT INTO RENTALS (id_user, id_movie, cost) VALUES ('1','2','20');
UPDATE RENTALS SET DATE = CURRENT_TIME WHERE id_movie LIKE '%';
ALTER TABLE `RENTALS` ADD CONSTRAINT RENTALS UNIQUE(`id_user`, `id_movie`);
SELECT date_format(DAT... | true |
baf3e69f98eaef3f45500a327f3ffb0d213f33ea | SQL | GabrielSCardoso/Materias-BandTec | /BD-Alex/Scripts/SQL/CantoresGravadora.sql | UTF-8 | 1,277 | 3.046875 | 3 | [] | no_license | create database ArtistasMusicais;
use Artistasmusicais;
create table Cantores (
idCantores int primary key auto_increment,
Cantor varchar(50),
CidadeNasc varchar(50),
EstiloMusical varchar (50),
TempoCarreira varchar (3)
) auto_increment = 1;
select * from Cantores;
insert into cantores (Cantor,CidadeNasc,EstiloMus... | true |
9b331d5ce186cdff0320d6648fce5b6e20c3d95e | SQL | alexeil/Application-FKBF | /Application FKBF/sql/application_fkbf_without_FK.sql | UTF-8 | 3,913 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 26, 2014 at 09:46 PM
-- Server version: 5.5.20
-- PHP Version: 5.3.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
dacd76bd4f7625051590547d30455b22639e99b6 | SQL | MRSL00/mohammad_reza_shirani_hw16_maktab45 | /MySql/blogdb/blog.sql | UTF-8 | 6,322 | 3.25 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.23, for Win64 (x86_64)
--
-- Host: localhost Database: blog
-- ------------------------------------------------------
-- Server version 8.0.23
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!401... | true |
d36aa13398bb3af7a481737f76fc02671c8cd169 | SQL | chenkaibin/ovirt-engine | /packaging/dbscripts/upgrade/04_01_0570_add_vm_affinity_to_host_structure.sql | UTF-8 | 1,086 | 3.46875 | 3 | [
"Apache-2.0"
] | permissive | SELECT fn_db_rename_column('affinity_groups', 'positive', 'vm_positive');
SELECT fn_db_rename_column('affinity_groups', 'enforcing', 'vm_enforcing');
SELECT fn_db_add_column('affinity_groups', 'vds_positive', 'BOOLEAN NOT NULL DEFAULT true');
SELECT fn_db_add_column('affinity_groups', 'vds_enforcing', 'BOOLEAN NOT NULL... | true |
d58ba5828d7578fedac97dc9f5ba2bae294708bc | SQL | TransfrApp/transfr-backend | /migrations/schema.sql | UTF-8 | 3,687 | 3.234375 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 10.3
-- Dumped by pg_dump version 10.3
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', fal... | true |
174b32093b30060d3fd62842a2312d8c77f9ce25 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day27/select0527.sql | UTF-8 | 263 | 2.953125 | 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='WeMo' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['2052','6215','6042','6218','3100_10','3224','3052','4211','2008','1429'])
| true |
3cb00d1eee1cfbd5af1b2f4f2680ea8039a83ca1 | SQL | SaFabi/Rutas | /Base de datos/Procedimientos Rutas/Procedimiento Orden completa Credito.sql | UTF-8 | 1,531 | 3.890625 | 4 | [] | no_license | use marquesada;
DROP PROCEDURE IF EXISTS terminarVentaCredito;
/*PROCEDIMIENTO PARA TERMINAR UNA VENTA A CREDITO*/
DELIMITER //
CREATE PROCEDURE terminarVentaCredito(In folio varchar(200),In abono int)
BEGIN
/* CONSULTA PARA SACAR EL ID DE LA ORDEN*/
SET @ordenid := (SELECT o.id FROM orden o WHERE o.folio = f... | true |
3e4b2073dac3f9847822a5d4d2161b5086ec31b9 | SQL | crisuvas/SQL_Server_Sentences | /StoredProcedure2.sql | UTF-8 | 531 | 3.640625 | 4 | [] | no_license | CREATE PROCEDURE insert_update_customer @CustomerID nchar(5), @CompanyName nvarchar(40), @ReturnID nchar(5) OUTPUT
AS
BEGIN
INSERT INTO Customers (CustomerID, CompanyName) VALUES (@CustomerID, @CompanyName)
IF(@@ERROR <> 0)
BEGIN
UPDATE Customers
SET CustomerID=@CustomerID,
CompanyName=@CompanyName... | true |
5cb4563d5b7c5ec9cc0a0bd5f3470712dec9754a | SQL | MarcioJoseGnatkowski/conexaoJDBC | /CriacaoBanco.sql | UTF-8 | 1,762 | 3.671875 | 4 | [] | no_license | DROP DATABASE `lojavirtual`;
CREATE SCHEMA `lojavirtual` ;
USE lojavirtual;
CREATE TABLE `lojavirtual`.`produto` (
`idProduto` int(11) NOT NULL AUTO_INCREMENT,
`Nome` varchar(255) DEFAULT NULL,
`descricao` varchar(255) DEFAULT NULL,
PRIMARY KEY (`idProduto`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COL... | true |
50ed5a52edf281b57f9ba4d6aa75034718707143 | SQL | StephenZhu1120/travel-manage | /sql/菜单sql文件/orderBasic_SaleDeptMenu.sql | UTF-8 | 2,251 | 2.59375 | 3 | [
"MIT"
] | permissive | -- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('订单门市部', '2002', '1', 'orderBasic_SaleDept', 'travel/orderBasic_SaleDept/index', 1, 0, 'C', '0', '0', 'travel:orde... | true |
9173de29f1ea5d5cc2e4208405b9acf3603e8445 | SQL | 1sebas234/proyecto414 | /127_0_0_1.sql | UTF-8 | 1,681 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 25-06-2021 a las 01:58:32
-- Versión del servidor: 10.4.19-MariaDB
-- Versión de PHP: 7.3.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
0b52f05da19304f3948bf9022430d317c7041c9a | SQL | Marcos311/MRP-MYSQL | /SacodeCarvao/BancodeDados/MRP-schema.sql | UTF-8 | 5,307 | 3.40625 | 3 | [] | no_license | DROP DATABASE IF EXISTS SacodeCarvao;
CREATE DATABASE SacodeCarvao;
USE SacodeCarvao;
CREATE TABLE PRODUTO (
idProduto int primary key AUTO_INCREMENT,
modeloProduto varchar(100) not null,
descrProduto varchar(1000),
valorProduto decimal(10,2),
qtdeMinEstoque int,
qtdeMaxEstoque int,
qtdeAtualEstoque int,
esta... | true |
615b284acef2567ed200b82ad9fd6c74e40934c3 | SQL | AgResearch/brdf | /schema/agrbrdf/alt.ob.sql | UTF-8 | 503 | 2.65625 | 3 | [] | no_license | --
-- Name: ob_pkey; Type: CONSTRAINT; Schema: public; Owner: agrbrdf; Tablespace:
--
ALTER TABLE ONLY ob
ADD CONSTRAINT ob_pkey PRIMARY KEY (obid);
--
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: agrbrdf
--
ALTER TABLE ONLY ob
ADD CONSTRAINT "$1" FOREIGN KEY (obtypeid) REFERENCES obtype(obtype... | true |
7a9ee75df0c79964bca32ad28dd5f6f44d633c27 | SQL | james-fu/wangqiwen | /work/gd/session/bin/hive_jobs/log/log_client/split_client.sql | UTF-8 | 878 | 3.1875 | 3 | [] | no_license | use log_session;
set date;
set date_str;
set hive.exec.dynamic.partition.mode=nonstrict;
create table if not exists log_client_rest like log_client;
-- 2014-7-24 warren log_merge -> log_rest
insert into table log_client_rest partition (dt)
select x.uid,x.sessionid,x.stepid,x.time,x.position,x.source,x.action,x... | true |
fae6f46fbedc0bd0d3aab3af7c61dea245a9b50d | SQL | jabautista/GeniisysSCA | /src/main/resources/sql/dml/giis_parameters/GIIS_PARAMETERS-insert-allow_allied_more_than_basic.sql | UTF-8 | 1,037 | 3.234375 | 3 | [] | no_license | SET SERVEROUTPUT ON
DECLARE
v_exist NUMBER := 0;
BEGIN
SELECT 1
INTO v_exist
FROM cpi.giis_parameters
WHERE param_name = 'ALLOW_ALLIED_MORE_THAN_BASIC';
IF v_exist = 1
THEN
DBMS_OUTPUT.put_line
('ALLOW_ALLIED_MORE_THAN_BASIC underwriting parameter already exist... | true |
76a9c637cf16c348be4c54e7cd0038caeeffcf88 | SQL | kieranmacrae/ibcClientRelations | /DatabaseConfig/DatabaseDump.sql | UTF-8 | 80,382 | 3.046875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)
--
-- Host: ibc-crm.cefmu4oqb0dd.ap-southeast-2.rds.amazonaws.com Database: ibc_crm
-- ------------------------------------------------------
-- Server version 5.6.27-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_... | true |
637f1495b8bc136ad44e97bae6044ba1e809e991 | SQL | Airotra/back-end-mybatisplus | /src/sql/2021-6-24(coupon).sql | UTF-8 | 2,430 | 3.546875 | 4 | [] | no_license | /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2021/6/24 12:24:33 */
/*==============================================================*/
drop table if exists admin_coupon_provide;
drop ta... | true |
0b35facb1e98187be82860cff9a3600195243223 | SQL | a-yeranosyan/vr360.globalvision.dev | /globalvision_vr360.sql | UTF-8 | 3,769 | 3.1875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jan 13, 2018 at 09:24 PM
-- Server version: 5.7.20-0ubuntu0.16.04.1
-- PHP Version: 7.1.13-1+ubuntu16.04.1+deb.sury.org+1
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0... | true |
31d9fa7f91479c11514813d0c62acd93d48a651b | SQL | majamaja/PriorityCoachRepository | /src/main/sql/structure.sql | UTF-8 | 8,283 | 3.765625 | 4 | [] | no_license | -- Authentication and users
CREATE TABLE native_users (
id CHAR(36) PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE,
password CHAR(64)
) engine = InnoDB;
CREATE TABLE facebook_users (
id CHAR(36) PRIMARY KEY,
fb_id ... | true |
f5733ba8beb3a5bc2df0c908f1259836bdccdb84 | SQL | yanru-jasmine/LeetCode-SQL-Summary | /Subquery/Advanced-Subquery/585_Investments_in_2016.sql | UTF-8 | 657 | 4.15625 | 4 | [] | no_license | -- Solution 1: Window Function, Subquery
SELECT CAST(SUM(TIV_2016) AS DECIMAL(10,2)) AS TIV_2016
FROM (
SELECT TIV_2016,
COUNT(*) OVER (PARTITION BY TIV_2015) AS count_2015,
COUNT(*) OVER (PARTITION BY LAT, LON) AS count_loc
FROM insurance
) tb1
WHERE count_2015 > 1 AND count_loc = 1;
-- Solu... | true |
f1f0ef652549b828c99447e0089fce322ebf57e1 | SQL | rashedcs/LAB | /DBMS/Lab 3/create table.sql | UTF-8 | 544 | 2.6875 | 3 | [] | no_license |
create table employee
(
employee_name varchar(30),
street varchar(30),
city varchar(30),
primary key (employee_name)
);
create table works
(
employee_name varchar(30),
company_name varchar(30),
salary numeric(4,0),
primary key(employee_name)
);
create table c... | true |
eb9b1e9492727fe32524db731803f8e95201edac | SQL | abvn/DB | /oracle1/建表.sql | UTF-8 | 1,596 | 3.640625 | 4 | [] | no_license | -- 创建学生表
CREATE TABLE Student(
SNO NVARCHAR2(20),
SNAME NVARCHAR2(20),
SAGE NUMBER(3),
SSEX VARCHAR2(2)
)
-- 插学生表数据
INSERT INTO Student(SNO,SNAME,SAGE,SSEX) VALUES ('1' , '张三' , 20 , '男' );
INSERT INTO Student(SNO,SNAME,SAGE,SSEX) VALUES ('2' , '李四' , 19 , '女' );
INSERT INTO Student(SNO,SNAME,SAGE,SSEX) VALUES ('3... | true |
c89afbb9cffdbea80fe3aa60af4e66564e7b1838 | SQL | YChanHuang/LeetCode | /SQL/1113. Reported Posts.sql | UTF-8 | 231 | 3.46875 | 3 | [
"MIT"
] | permissive | SELECT
extra AS report_reason,
COUNT(distinct post_id) AS report_count
FROM
Actions
WHERE
datediff('2019-07-05', action_date) = 1 and
extra is NOT NULL and
action = 'report'
GROUP BY
report_reason | true |
d6b59f56bb9a9da44d7ce3d1acaffe386ba3f030 | SQL | nhabongo/WED-sql | /WED-engine/Install/WED_control.sql | UTF-8 | 18,981 | 3.828125 | 4 | [] | no_license | --CREATE LANGUAGE plpython3u;
--CREATE EXTENSION pgrowlocks;
--CREATE ROLE wed_admin WITH superuser noinherit;
--GRANT wed_admin TO wedflow;
--SET ROLE wed_admin;
--Insert (or modify) a new WED-atribute in the apropriate tables
------------------------------------------------------------------------------------------... | true |
69dfb58a9f5850969782e49cadeeb8ea27db8d19 | SQL | alexocarneiro/tecweb2 | /rest-api/src/banco/db_nutricao_final.sql | UTF-8 | 11,150 | 2.71875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: 11-Nov-2018 às 10:18
-- Versão do servidor: 5.7.19
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
064dcff38202038d263e2ea35c85b3879383be04 | SQL | Stavros25/data_analytics_class_assignments | /June29CaseExer.sql | UTF-8 | 2,010 | 4.375 | 4 | [
"MIT"
] | permissive | /* For the prompts 1, and 2 use the Pronto Bike share trip table.
For prompts 3, 4, and 5 use the airline on-time data.
Examples of the data returned by the queries in this exercise are available in this document.
Instructions:
1. Using the Pronto Bike share trip table, create a query that returns the columns start ti... | true |
8542157ca6e8c7101adce44d7780b2491b5cc1ed | SQL | jacksonlmp/Agencia_Bancaria | /querys.sql | UTF-8 | 1,407 | 4.34375 | 4 | [] | no_license | #Ache os nomes de todas as agências que possuem ativos maiores do que
#aqueles de pelo menos uma agência localizada no Brooklyn.
SELECT nome_agencia
FROM agencia
WHERE ativos > ANY (SELECT ativos FROM agencia WHERE cidade_agencia = 'Brooklyn');
#Ache a soma de todos os empréstimos do cliente Peter em todas as agência... | true |
52ea1b23ebb30c45028f6b8b1588c50ab26a8a50 | SQL | fredthekid/NBARankingBackendScripts | /schemas/GAMELOG.sql | UTF-8 | 659 | 2.71875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS GAMELOG_2015(
id INTEGER PRIMARY KEY AUTO_INCREMENT,
season_id INTEGER,
player_id INTEGER,
game_id INTEGER,
game_date DATE,
home_away BOOLEAN,
team VARCHAR(20),
opp_team VARCHAR(20),
win_loss BOOLEAN,
min INTEGER,
fgm INTEGER,
fga INTEGER,
fg_pct FLOAT,
fg3m INTEGE... | true |
b8f2dcca195ff1d63174498b8ac38919f9841c01 | SQL | neel2811/Java | /JDBC/JDBCCallableStatementDemoinputparam-mysql-App/getCitiesBasedOnCountryCode.sql | UTF-8 | 294 | 2.703125 | 3 | [] | no_license | DELIMITER $$
CREATE PROCEDURE world.getCitiesBasedOnCountryCode (IN CITY_COUNTRY_CODE_INPUT CHAR(35))
BEGIN
SELECT * from city where CountryCode=CITY_COUNTRY_CODE_INPUT;
END$$
DELIMITER ;
CALL `getCitiesBasedOnCountryCode`('IND');
CALL `getCitiesBasedOnCountryCode`('PAK');
| true |
84d568529f1c73da2c974da3173d2767a1fa95d9 | SQL | joellemaximin/MichMuch | /react/ourbackend/Models/cinema00.sql | UTF-8 | 15,785 | 3.359375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : lun. 27 mai 2019 à 08:49
-- Version du serveur : 8.0.15
-- Version de PHP : 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... | true |
1cf1941ca52f6552ffb99f68b0e8ba61e532e8aa | SQL | acekiseki/Lab10 | /Ex1/setupDatabase.sql | UTF-8 | 330 | 3.484375 | 3 | [] | no_license | CREATE TABLE People
(
user_id varchar(255) NOT NULL,
PRIMARY KEY (user_id)
);
CREATE TABLE Posts
(
post_id int NOT NULL AUTO_INCREMENT,
content varchar(60000) NOT NULL,
author_id varchar(255) NOT NULL,
PRIMARY KEY (post_id),
FOREIGN KEY (author_id) REFERENCES People(user_id) ON DELETE ... | true |
94c8a8dddb61b8dd2504feae5c2fb8db679966cd | SQL | fandashtic/arc_chennai | /Sivabalan-SQL/SQL_STORED_PROCEDURE/sp_list_rec_Claims_DocLU.sql | UTF-8 | 523 | 3.0625 | 3 | [] | no_license | CREATE PROCEDURE sp_list_rec_Claims_DocLU (@FromDocID int, @ToDocID int)
AS
SELECT ClaimsNoteReceived.ClaimId, ClaimsNoteReceived.ClaimDate,
ClaimsNoteReceived.CustomerID, Customer.Company_Name, ClaimsNoteReceived.ClaimId,
ClaimsNoteReceived.Status, 0, ClaimsNoteReceived.ClaimValue
FROM Claim... | true |
13aecdae16c70fccca28387c877bbd0fc0c518d8 | SQL | smithHE98/phpforum | /data/init.sql | UTF-8 | 1,378 | 3.875 | 4 | [] | no_license | CREATE TABLE users (
user_id INT(8) NOT NULL AUTO_INCREMENT,
user_name VARCHAR(30) NOT NULL,
user_pass VARCHAR(255) NOT NULL,
user_email VARCHAR(255) NOT NULL,
user_date DATETIME NOT NULL,
user_level INT(8) NOT NULL,
UNIQUE INDEX user_name_unique (user_name),
PRIMARY KEY (user_id)
) ;
CREATE TABLE categories (
cat_i... | true |
63b92f501587d0179ac1643b401a2c23991cc62e | SQL | jfontestad/HHC_CDW | /Projects/DataWarehouse/CDW/V_FACT_RESULTS.sql | UTF-8 | 1,179 | 3.375 | 3 | [] | no_license | CREATE OR REPLACE VIEW v_fact_results AS
SELECT
-- 22-Feb-2018, OK: created
r.network,
r.visit_id,
r.event_id,
r.result_report_number,
r.multi_field_occurrence_number,
r.item_number,
e.date_time AS result_dt,
v.patient_key,
NVL(pef.facility_key, p.facility_key) AS proc_facility_key,
p.proc_key,
e... | true |
5dc2ca358a98bfe17655d5d563cc71138b8fef47 | SQL | geoff-maddock/events-tracker | /database/queries/Events-by-Tag-By-Year.sql | UTF-8 | 265 | 4.5625 | 5 | [
"MIT"
] | permissive | # counts events with each tag by year
select tags.name, COUNT(*), year(start_at)
from events join event_tag on (events.id = event_tag.event_id)
join tags on (event_tag.tag_id = tags.id)
group by tags.name, year(start_at)
order by year(start_at) desc, tags.name asc; | true |
3d1540c1618141cae226cca5d0a72ed48fc4dae9 | SQL | appirio-tech/direct-app | /components/deliverable_management/test_files/dbschema.sql | UTF-8 | 11,238 | 3.546875 | 4 | [] | no_license | CREATE TABLE project (
project_id INTEGER NOT NULL,
PRIMARY KEY(project_id)
);
CREATE TABLE phase_type_lu (
phase_type_id INTEGER NOT NULL,
PRIMARY KEY(phase_type_id)
);
CREATE TABLE project_phase (
project_phase_id ... | true |
da73f21a1edb0088f09aeb1f6a689aa0d8f400bb | SQL | AptudeJNMG/Aptude_KBX_SLN | /Aptude_KBX_DB/Foreigns/FK_ShDetails_WHouses2.sql | UTF-8 | 170 | 2.609375 | 3 | [] | no_license | ALTER TABLE [SCH_Aptude_KBX].[TBL_ShipDetails]
ADD CONSTRAINT [FK_ShDetails_WHouses2]
FOREIGN KEY (IdWarehouseTo)
REFERENCES [SCH_Aptude_KBX].[TBL_WareHouses] (Id)
| true |
ea08ab82c00ef30a30c08d47e1639e9fb9c29450 | SQL | vsergione/dbapiator | /test.sql | UTF-8 | 268 | 3.1875 | 3 | [] | no_license | SELECT users.id, users.username, users.fname, users.lname, users.department
FROM users AS users WHERE 1 ORDER BY 1 LIMIT 0, 10
SELECT assets.id, assets.type, assets.vendor, assets.model, assets.owner
FROM assets AS assets
WHERE assets.owner = '1' ORDER BY 1 LIMIT 0,
| true |
e3c485024858e53e68fb08468478294bc9d22b11 | SQL | MarharytaMykytenko0/dbisworkshops | /Маргарита Микитенко/workshop4/sql/constraints.sql | UTF-8 | 841 | 3.125 | 3 | [] | no_license |
alter table student_database
add constraint student_check1 CHECK (LENGTH(login) >= 5);
alter table student_database
add constraint student_check2 CHECK (LENGTH(student_pass) >= 5);
alter table sudent_database
add constraint sudent_unique UNIQUE (sudent_mail, login);
alter table student_database
... | true |
cfab1359beffaee0b8e633a14c17a14633a5f5e5 | SQL | yefc/CBOE | /subprojects/Classic/ChemInv/config/oracle_install_scripts/Create_blank_ChemInv_DB/sql/Patches/Patch 9SR4/9SR4_to_10/PLSQL/Packages/pkg_XMLUtils_Body.sql | UTF-8 | 3,607 | 2.609375 | 3 | [] | no_license | CREATE OR REPLACE
PACKAGE BODY XMLUtils
AS
FUNCTION transformXML(pXSLT IN CLOB, pDoc IN CLOB, pParser IN DBMS_xmlparser.Parser, pEngine IN DBMS_xslprocessor.Processor)
RETURN CLOB
IS
--vEngine DBMS_xslprocessor.Processor := DBMS_xslprocessor.newProcessor;
--vParser DBMS_xmlparser.Parser := DBMS_xmlparser.newParser;
... | true |
caf64b9b2e650a89e2932153a75bf6f48144a087 | SQL | splitbrain/TheBankster | /db/0003.sql | UTF-8 | 208 | 2.609375 | 3 | [
"MIT"
] | permissive | CREATE INDEX "idx_rule_category_id" ON "rule" ("category_id");
CREATE INDEX "idx_tranaction_category_id" ON "transaction" ("category_id");
CREATE INDEX "idx_transaction_account" ON "transaction" ("account");
| true |
f1801662126a0a4405fb80b1d8e954dc92d8229d | SQL | manuelsanchez9/Oracle | /taller2vistas.sql | UTF-8 | 2,104 | 4.125 | 4 | [] | no_license | /* --- PUNTO 1 --- */
--Creacion de la vista medios_pago_clientes
create or replace view medios_pago_clientes
as
select cli.persona_id as cliente_id,
pers.nombre || ' ' || pers.apellido as nombre_cliente,
mdp.id as medio_pago_id, mdp.tipo_medio as tipo, mdp.datos_adicionales as detalles_medio_pago,
... | true |
8e55104d8e6972691c22cbbd6a29e24e5400599a | SQL | shlin/AboutSQL | /MSSQL_Command_CountOfRowsAndColumns.sql | UTF-8 | 292 | 3.78125 | 4 | [] | no_license | SELECT
O.NAME '資料表',
MAX(C.ORDINAL_POSITION) '欄位數',
MAX(P.ROWS) '資料總筆數'
FROM SYS.SYSOBJECTS O
INNER JOIN SYS.PARTITIONS P ON O.ID = P.OBJECT_ID
INNER JOIN INFORMATION_SCHEMA.COLUMNS C ON O.NAME = C.TABLE_NAME
WHERE
O.NAME LIKE 'SKS%'
GROUP BY O.NAME
| true |
748a18ef989c362a60b60ea7a726b9907a9f4924 | SQL | xiaoyi68/python-challenge | /SQL/queries.sql | UTF-8 | 2,392 | 4.59375 | 5 | [] | no_license | select * from titles;
select * from departments;
select * from employees;
select * from dept_emp;
select * from dept_manager;
select * from salaries;
-- 1. List the following details of each employee: employee number, last name, first name, gender, and salary.
SELECT employees.emp_no,employees.first_name, employees.la... | true |
9a893b0324e10d21142b57464093af681a1518be | SQL | ldenneau/mopsng | /mysql/detections.sql | UTF-8 | 2,894 | 3.578125 | 4 | [] | no_license | /* Detections. */
drop table if exists detections;
create table detections(
det_id bigint not null auto_increment comment 'Auto-defined MOPS internal detection ID',
field_id bigint comment 'Source field ID containing this detection',
ra_deg real not null ... | true |
62ac2ac5658ed0a4e720c1be980d22eaad507a31 | SQL | pubnative/docker-images | /prestodb/scripts/metrics.sql | UTF-8 | 472 | 2.984375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0"
] | permissive | select
user
, query_id
, node_id
, source
, state "state::multi-filter"
, created created_at
, started created_at
, "end" ended_at
, date_diff('millisecond', started, "end") duration
, queued_time_ms
, analysis_time_ms
, distributed_planning_time_ms
from system.runtime.q... | true |
57ee49f63df5f2ed7dec4498615e9e22bfa5dbf4 | SQL | VogtLeJato/lista_04_pc | /atv_prt_042_bd.sql | UTF-8 | 1,709 | 2.796875 | 3 | [] | no_license | - despejo do SQL do phpMyAdmin
- versão 4.6.6deb5
- https://www.phpmyadmin.net/
-
- Anfitrião: localhost: 3306
- Tempo de geração: 20/08/2019 às 16:48
- Versão do servidor: 5.7.24-0ubuntu0.18.04.1
- Versão do PHP: 7.2.13-1 + ubuntu18.04.1 + deb.sury.org + 1
SET SQL_MODE = " NO_AUTO_VALUE_ON_ZERO " ;
SET time_zone = ... | true |
27e9a600c335dc25531171daf23d8b46b1c063f4 | SQL | vanderstark/TugasPemprogramanInternet | /E-Kostanku/database/kosan.sql | UTF-8 | 3,672 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Waktu pembuatan: 10. Januari 2016 jam 11:47
-- Versi Server: 5.5.8
-- Versi PHP: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_... | true |
9a4e8e646b329b52c8bf59cf2a68a213d4feba4c | SQL | ClickHouse/ClickHouse | /tests/queries/0_stateless/01047_window_view_parser_inner_table.sql | UTF-8 | 9,884 | 3.625 | 4 | [
"Apache-2.0",
"BSL-1.0"
] | permissive |
SET allow_experimental_analyzer = 0;
SET allow_experimental_window_view = 1;
DROP DATABASE IF EXISTS {CLICKHOUSE_DATABASE:Identifier};
set allow_deprecated_database_ordinary=1;
CREATE DATABASE {CLICKHOUSE_DATABASE:Identifier} ENGINE=Ordinary;
DROP TABLE IF EXISTS {CLICKHOUSE_DATABASE:Identifier}.mt;
DROP TABLE IF EXI... | true |
d0083934d88cd5003fefb5ee3a29ba4ab110c3c5 | SQL | PeterGeorgeVlahos/sql_challenge | /Instructions/EmployeeSQL/query_employee.sql | UTF-8 | 2,463 | 4.53125 | 5 | [] | no_license | --1. List the following details of each employee: employee number, last name, first name, sex, and salary.
--Perform inner join on Employees and Salaries
SELECT e.emp_no, e.last_name, e.first_name, e.sex, s.salary
FROM employees AS e, salaries as s
WHERE e.emp_no=s.emp_no;
--2. List first name, last name, and hire da... | true |
a3a4004b369dfe2007965a63ae5dea574b76ced2 | SQL | derric-d/holbertonschool-higher_level_programming | /0x0D-SQL_introduction/15-groups.sql | UTF-8 | 132 | 2.59375 | 3 | [] | no_license | -- select and count, then group and order
SELECT score, count(*) as 'number'
from second_table
group by score
order by number desc;
| true |
3501cf76349ca2e8cf08ff237390db4049d5672a | SQL | sampathBhat/SQLnDatabase | /Movie-DataBase/create.sql | UTF-8 | 1,197 | 3.859375 | 4 | [] | no_license | CREATE TABLE MOVIE(
id number primary key,
title varchar(256),
year number,
rating float,
numOfRating number);
CREATE TABLE ACTORS(
movie_id number not null,
actor_id varchar(256),
actor_name varchar(256),
ranking number,
foreign key (movie_id) references MOVIE(id) ON DELETE CASCADE);
CREATE TABLE COUNTRY(
movie_id n... | true |
197b5bfedfab045388465c0a6e95209ae99c040b | SQL | kozakjefferson/bigquery-etl | /udf/combine_adjacent_days_28_bits.sql | UTF-8 | 732 | 3.515625 | 4 | [] | no_license | /*
Combines two bit patterns. The first pattern represents activity over a 28-day
period ending "yesterday". The second pattern represents activity as observed
today (usually just 0 or 1). We shift the bits in the first pattern by one to
set the new baseline as "today", then perform a bitwise OR of the two patterns.
... | true |
ac6a5716fe0e723b3c8553743f4af64790510566 | SQL | yugan3/Metros-Teradata-SQL | /6月兑换预测.sql | UTF-8 | 3,205 | 3.28125 | 3 | [] | no_license | --points >= 2
select a.home_store_id,count(*) as points
from chnccp_dwh.dw_mcrm_loy_member a
inner join chnccp_dwh.dw_mcrm_loy_mem_balance b
on a.loy_mem_row_id = b.loy_mem_row_id
where a.loy_mem_parent_ind = 0
and b.loy_mem_num_available_pts >= 2
group by a.home_store_id
order by a.home_store_id;
--雪碧
... | true |
f7a57635c03579afb9fb0f52597a1a1c97799049 | SQL | rdesannicolas/DataScienceProjects | /Data Manipulation at Scale/Assignment2 - SQL/sql_1a.sql | UTF-8 | 110 | 2.6875 | 3 | [] | no_license | .output part_a.txt
SELECT count(*) FROM (
SELECT *
FROM frequency f
WHERE f.docid = "10398_txt_earn"
);
| true |
506e6b367f0b5391c7c028d51028d6ae5d0ba4fa | SQL | gianose/prct | /db/sql/source_files.sql | UTF-8 | 1,046 | 3.671875 | 4 | [] | no_license | /**
* The PRCT.source_files table will house information on each data-set's corresponding source data file.
* @primary_key source_file_id INTEGER Utilized in order to uniquely identify each source_files recored.
* @column filename VARCHAR The filename of the corresponding source file.
* @column file_mod_date DA... | true |
1c436c30c638f0801f0e2b529537c64b656235d4 | SQL | opengauss-mirror/openGauss-server | /src/test/regress/sql/redis_proc_ut14.sql | UTF-8 | 417 | 2.640625 | 3 | [
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference",
"PostgreSQL",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-unicode",
"LicenseRef-scancode-warranty-disclaimer",
"curl",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"CC-BY-4.0",
... | permissive | /*
* UT14: 1)redis_proc get the access exclusive lock
* 2)IUD wait until redis_proc finish
* 3)truncate partition wait until IUD finish
*/
START TRANSACTION;
select current_timestamp;
LOCK TABLE ptx IN ACCESS EXCLUSIVE MODE;
select current_timestamp;
select pg_sleep(3);
insert into cmpts values(... | true |
e54773ad494e4c6d0ee7ae16090ca0823a3a6cb2 | SQL | WeiWill0605/sql | /check_sql/wikimedia_PRI.sql | UTF-8 | 902 | 3.484375 | 3 | [] | no_license | SELECT * FROM srs.wikimedia_article order by 1 desc;
SELECT count(1), rundate FROM srs.wikimedia_article group by rundate order by 2 desc;
SELECT count(1), count(distinct article, category) FROM srs.wikimedia_article;
SELECT count(1), count(distinct article) FROM srs.wikimedia_article;
SELECT * FROM srs.wikimedia_... | true |
d4cb669c70155a764e7c5ae16fe3db2c5924ff86 | SQL | delta94/talk4free-1 | /talk4free-backend/database_setup.sql | UTF-8 | 1,621 | 3.625 | 4 | [
"MIT"
] | permissive | CREATE DATABASE IF NOT EXISTS talk4freeDB;
USE talk4freeDB;
CREATE TABLE IF NOT EXISTS rooms(
id INT UNIQUE AUTO_INCREMENT NOT NULL,
session_id VARCHAR(256) NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
lang VARCHAR(256) NOT NULL,
lvl VARCHAR(256) NOT N... | true |
ef31bf143e02427906e6e38ffcc5ed008a446f99 | SQL | SahabatTugas/Pinjam-musik | /almus.sql | UTF-8 | 5,374 | 3.375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 11 Jan 2021 pada 02.56
-- Versi server: 10.4.17-MariaDB
-- Versi PHP: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... | true |
7d429627e93641c044fbedb4e2744db6c36936f6 | SQL | leedonghu/jsp-web | /WebContent/WEB-INF/sql/CONSTRAINT02.sql | UTF-8 | 707 | 3.625 | 4 | [] | no_license | CREATE TABLE MyTable9
(
id int UNIQUE,
name VARCHAR(255)
);
INSERT INTO MyTable9
(id, name)
VALUES
(3, 'good');
INSERT INTO MyTable9
(id, name)
VALUES
(4, 'good');
INSERT INTO MyTable9
(name)
VALUES
('better');
select * from MyTable9;
drop table MyTable10;
CREATE TABLE MyTable10
(
id int UNIQUE not null,
name VARC... | true |
16cd19d3e9ea0c413ae81ed61e93c6a13e6d8ca3 | SQL | Vgehlot1999/CS363 | /Project 1A/InsertRecords.sql | UTF-8 | 2,859 | 2.953125 | 3 | [] | no_license | insert into
students(snum, ssn, name, gender, dob, c_addr, c_phone, p_addr, p_phone)
values
('1001', '654651234', 'Randy', 'M', '2000-12-01', '301 E Hall', '5152700988', '121 Main', '7083066321'),
('1002', '123097834', 'Victor', 'M', '2000-05-06', '270 W Hall', '5151234578', '702 Walnut', '7080366333'),
('1003', '978... | true |
a5c5c11df51d0a40e57a5c4c26cb48fd8202792b | SQL | nicklondhe/survey.me | /localhost.sql | UTF-8 | 2,674 | 3.421875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 14, 2013 at 09:10 AM
-- Server version: 5.5.8
-- PHP Version: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SE... | true |
16942f357dc411dc16bcd3c022d93280edcf9793 | SQL | zss3/WorkoutBuilder | /final-capstone/java/database/exercise data.sql | UTF-8 | 1,451 | 3.359375 | 3 | [] | no_license | drop table Exercise;
create table body_target (
body_target_id serial PRIMARY KEY unique,
body_target varchar(64) NOT NULL);
CREATE table Exercise (
id serial PRIMARY KEY unique,
exercise_name varchar(64) NOT NULL,
des... | true |
a921a4445a5fb8f6bce4ec2da3f47caa71807984 | SQL | eyelverton/dhis2-2021-sc | /scripts/sample_data_query.sql | UTF-8 | 1,065 | 4.03125 | 4 | [
"MIT"
] | permissive | select
de.dataelementid,
de."name" de_name,
pe.startdate,
dv.value,
ou.organisationunitid,
ou."name" facility_name,
ou3.organisationunitid district_orgunitid,
ou3."name" district_ou_name
from dataelement de
join datavalue dv on de.dataelementid = dv.dataelementid
join "period" pe on dv.periodid = pe.periodid
jo... | true |
8314cc2022522e1aa9760cefcab8d9f964aef195 | SQL | gladiopeace/digital-data-syn | /documents/oms/TB_HRBAF.sql | GB18030 | 2,266 | 3.171875 | 3 | [] | no_license | /*
================================================================================
ṹ:TB_HRBAF
ṹ:ͳñ
ṹĿ:
================================================================================
*/
drop sequence SEQ_TB_HRBAF;
drop index AK_TB_HRBAF;
drop table TB_HRBAF;
create table TB_HRBAF (
HRBAF_ID INTEGER ... | true |
0b2840da6a2b2973a7fdda7cab6404c60fec30f1 | SQL | Wlyssesr/Quiz | /TrabalhoQuiz2/questionario.sql | UTF-8 | 931 | 3 | 3 | [] | no_license | # Host: localhost (Version: 5.6.24-log)
# Date: 2017-07-20 20:53:15
# Generator: MySQL-Front 5.3 (Build 4.187)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "pergunta"
#
CREATE TABLE `pergunta` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`descricao` varchar(80) DEFAULT NULL,
`comentario` varchar... | true |
c86bd361e785b0be78d8c574d6bcb06f9b808723 | SQL | HouzhiLi/ETL_study | /Plsql_Notes/02-流程控制语句.sql | GB18030 | 7,200 | 4.25 | 4 | [] | no_license | 1.̿
(1) if
if ʽ; then
plsql 䣨sql̿䣩
end if
ʽʱthenend֮Ĵ
--жϱǷڣڣ
--ڣһdept_sumܲµƽʣܹʣ߹ʣ
declare
--һѯ
n number(1);
begin
--жݿǷdept_sumű
--ͨѯݿֵͼж
--select count(table_name) from user_tables where table_name = 'dept_num'; -->0ʾ
select count(1) into n from user_tables where table_name = 'dept_sum';
if ... | true |
ae03e77b0f90f938b4d118eb133f4a621b511c52 | SQL | igotgithub362/Assignment-1-SQL-and-Tableau | /part1.sql | UTF-8 | 1,842 | 4.59375 | 5 | [] | no_license | #How many airplanes have listed speeds? What is the minimum listed speed and the maximum listed speed?
SELECT COUNT(speed) FROM planes;
SELECT MAX(speed) FROM planes;
SELECT MIN(speed) FROM planes;
#What is the total distance flown by all of the planes in January 2013?
SELECT COUNT(*) AS 'Number of Flights', SUM(dis... | true |
f219d54e3cc309e7ccfa7d473eb7d2ecd7e82a6d | SQL | gjiang3/LetItRide | /SQL script/All_In_One.sql | UTF-8 | 8,415 | 3.625 | 4 | [] | no_license | drop database if exists letitridesystem;
create database letitridesystem;
use letitridesystem;
drop table if exists rut;
drop table if exists cit;
drop table if exists dit;
create table rut
(
UserID int(64) zerofill not null auto_increment,
Email varchar(40) not null,
Password varchar(30) not null,
Name varchar(255)... | true |
650bddb02a3d84e6ce835401ff1b52e2d4899197 | SQL | rezarubik/laravel_unpas | /database/wpu_laravel.sql | UTF-8 | 5,313 | 3.171875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 04, 2020 at 05:56 PM
-- 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 |
7f63eed9d9042d70c456c5fcf0401b75e36ed849 | SQL | wrivera97/Cliente_Matriculacion_NovemberJR | /IGNUG Session.sql | UTF-8 | 228 | 3 | 3 | [
"Apache-2.0"
] | permissive | SELECT
asignaturas.nombre,
asignaturas.id,
docente_asignaturas.docente_id
FROM asignaturas
JOIN docente_asignaturas ON asignaturas.id = docente_asignaturas.asignatura_id
select * from asignaturas
where asignaturas.id=16
| true |
3f866bb196212cb75a747d8e0b7ceb8110f982c4 | SQL | tgooden01/SnowConvertDDLExportScripts | /Redshift/output/specialoffer.sql | UTF-8 | 843 | 3.25 | 3 | [] | no_license | --DROP TABLE adventureworks2012_sales.specialoffer;
CREATE TABLE IF NOT EXISTS adventureworks2012_sales.specialoffer
(
specialofferid INTEGER NOT NULL DEFAULT "identity"(144607, 0, '1,1'::text) ENCODE az64
,description VARCHAR(765) NOT NULL ENCODE zstd
,discountpct NUMERIC(10,4) NOT NULL DEFAULT 0.00 ENCODE az64
,... | true |
9dbb2d9100291c98bca87b52c7ac0711a42d3767 | SQL | Sebasrs/SOAP2 | /DBScripts/SQL/dataBaseScript.sql | UTF-8 | 4,387 | 3.640625 | 4 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema soa
-- --... | true |
eb55cefaece6519af5e34b89846e6e739105b2c4 | SQL | Nickyg56/trax-server | /migrations/006.do.create_join_requests_table.sql | UTF-8 | 237 | 2.59375 | 3 | [] | no_license | create table join_requests (
id serial primary key,
project_id integer
references projects(id) on delete cascade not null,
message text,
user_id integer
references users(id) on delete cascade not null,
user_name text
); | true |
abedf4eb35e923d3841d5fcf99172f1e7d07c96f | SQL | malexC137/db-hotel | /query-group-by.sql | UTF-8 | 855 | 3.796875 | 4 | [] | no_license | -- 1. Conta gli ospiti raggruppandoli per anno di nascita
SELECT YEAR(`date_of_birth`), COUNT(`date_of_birth`)
FROM `ospiti`
GROUP BY (YEAR(`date_of_birth`));
-- 2. Somma i prezzi dei pagamenti raggruppandoli per status
SELECT `status`, SUM(`price`)
FROM `pagamenti`
GROUP BY `status`;
-- 3. Conta quante volte è sta... | true |
53e9120a8796951a20037ef12f8a07327d3de61d | SQL | desarrollocorrales/PedidosCocina | /AbastecedoraPreparadosPedidos/AbastecedoraPreparadosPedidos/bin/Debug/Data/ControlTortas.sql | UTF-8 | 3,746 | 2.875 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `control_tortas` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci */;
USE `control_tortas`;
-- MySQL dump 10.13 Distrib 5.6.17, for Win32 (x86)
--
-- Host: localhost Database: control_tortas
-- ------------------------------------------------------
-- Server version 5.0.51b... | true |
748922adfb06bee1b8223be3360b8cc84fb4f2b3 | SQL | leoguilen/aspnetcore-repository-dapper | /Scripts/CreateUserTableSqlServer.sql | UTF-8 | 229 | 2.5625 | 3 | [] | no_license | CREATE TABLE Users
(
Id UNIQUEIDENTIFIER PRIMARY KEY NOT NULL,
FullName VARCHAR(30) NOT NULL,
Email VARCHAR(100) NOT NULL,
Pass VARCHAR(30) NOT NULL,
CreatedAt DATETIME DEFAULT(GETDATE())
) | true |
0e3248b42cec785b0ff26563335eb40dc4f04aa6 | SQL | martinpinto/Veto | /server/src/config/schemas.sql | UTF-8 | 6,836 | 3.609375 | 4 | [
"Apache-2.0"
] | permissive | DROP DATABASE Veto;
CREATE DATABASE IF NOT EXISTS Veto;
USE Veto;
CREATE TABLE IF NOT EXISTS Party (
py_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
py_name VARCHAR(500) NOT NULL,
py_logo VARCHAR(500) DEFAULT NULL,
py_link VARCHAR(500) DEFAULT NULL,
PRIMARY KEY(py_id)
);
CREATE TABLE IF NOT EXISTS U... | true |
d6344a3e1c36dfca1919b58d680dc642a57492eb | SQL | qiuhai1989/doc | /企读相关/proc_排行榜统计存储过程参考.sql | UTF-8 | 2,773 | 3.59375 | 4 | [] | no_license | CREATE DEFINER=`EAP_DEV_DEV`@`%` PROCEDURE `wicsg_app_dev_30d1`.`proc_eread_rank_personal`(
par_act_id BIGINT
)
BEGIN
DECLARE errno TINYINT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN SET errno=1;END;
CALL proc_runing_log('proc_eread_rank_personal','执行开始!','','info');
DELETE FROM eread_rank_pers... | true |
2a73b9d53b5c27b554dfdb3b8ae0b43428600ed3 | SQL | orrpaz/Pokemon-Battle | /src/main/resources/schema.sql | UTF-8 | 1,156 | 3.71875 | 4 | [] | no_license | CREATE TABLE POKEMON (ID INT PRIMARY KEY,
NAME VARCHAR(25),
TYPE VARCHAR(25) );
CREATE TABLE TRAINER (ID INT PRIMARY KEY,
NAME VARCHAR(25),
LEVEL INT);
--CREATE TABLE POKEMONTRAINER (TRAINER_ID INT ,
-- POKEMON_ID INT ,... | true |
39623480224074d264846ce606dcefc72cf762b5 | SQL | Dirpyth/concoursesuitecrm-community | /src/sql/db2/new_custom_field.sql | UTF-8 | 4,127 | 3.4375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | CREATE SEQUENCE module_field__tegorylin_id_seq AS DECIMAL(27,0);
CREATE TABLE module_field_categorylink(
id INTEGER NOT NULL,
module_id INTEGER NOT NULL REFERENCES permission_category(category_id),
category_id INTEGER NOT NULL UNIQUE,
"level" INTEGER DEFAULT 0,
description CLOB(2G) NOT LOGGED,
... | true |
6624e6b960b8469740834749897a31400d701fe9 | SQL | gstearmit/EshopVegeTable | /Data_Sql/tbl_customer.sql | UTF-8 | 2,457 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 06, 2015 at 11:46 AM
-- Server version: 5.6.20
-- PHP Version: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
7854e598276e0e97c775cff17430e2d485864e89 | SQL | ansaworks/sqlserver | /tsql/dml/update-with-join.sql | UTF-8 | 174 | 2.75 | 3 | [] | no_license | UPDATE t1
SET
t1.column1 = t2.column_from_t2,
t1.column2 = 'some new value'
FROM
table1 t1
JOIN table2 t2 ON t1.id = t2.id
WHERE
t2.is_deleted = 0 | true |
4d62315092ecc34cf21a060108c4ae3f70c4cae8 | SQL | Cookiee-monster/estate_analysis_project | /src/sql/OTODOM_STATUS_ddl.sql | WINDOWS-1250 | 1,705 | 2.9375 | 3 | [] | no_license | --------------------------------------------------------
-- File created - pitek-padziernika-02-2020
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Table OTODOM_STATUS
--------------------------------------------------------
CREATE TA... | true |
25571e3c58ea0f26b2c1e850af55901c47569d07 | SQL | SpiderBeaver/rockstore-server | /prisma/migrations/20210706070215_add_client_model/migration.sql | UTF-8 | 571 | 3.625 | 4 | [
"MIT"
] | permissive | /*
Warnings:
- Added the required column `clientId` to the `Order` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "Order" ADD COLUMN "clientId" INTEGER NOT NULL;
-- CreateTable
CREATE TABLE "Client" (
"id" SERIAL NOT NULL,
"name" TEXT NOT N... | true |
11e8015ed5c1fd50616be13fbdc5e30615e5e60c | SQL | JavaZWT/demo | /src/main/sql/user.sql | UTF-8 | 1,004 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : 本地数据库(local)
Source Server Version : 50725
Source Host : localhost:3306
Source Database : test1
Target Server Type : MYSQL
Target Server Version : 50725
File Encoding : 65001
Date: 2021-07-30 18:20:04
*/
SET FOREIGN_KEY_CHECKS=0;
-- ... | true |
f8e9f6728539c42084e0697031abf4d9a833c2cb | SQL | v0v41k92/Testphone1 | /Testphone/f0519999_testphone.sql | UTF-8 | 5,413 | 2.96875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Хост: 10.0.0.57
-- Время создания: Мар 12 2021 г., 11:10
-- Версия сервера: 5.7.31-34
-- Версия PHP: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... | true |
d2c96388f47e9add1ee633de3961535dde8c8236 | SQL | dmprabath/ecommerce_system_for_nesmo | /admin/backup/db_1578745291.sql | UTF-8 | 37,401 | 2.875 | 3 | [
"Unlicense"
] | permissive |
CREATE TABLE `tbl_backup` (
`backup_id` int(11) NOT NULL AUTO_INCREMENT,
`backup_date` date NOT NULL,
`backup_time` time NOT NULL,
`file_name` varchar(200) NOT NULL,
`user_id` varchar(10) NOT NULL,
`backup_status` tinyint(1) NOT NULL,
PRIMARY KEY (`backup_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
... | true |
add321b62cdb11773a803ebc79cd7aaf6e01afc5 | SQL | sonalinajera/lab-book-server | /migrations/002.do.create_lab_experiments.sql | UTF-8 | 334 | 2.8125 | 3 | [] | no_license | DROP TABLE IF EXISTS experiments;
CREATE TABLE experiments
(
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
experiment_title TEXT NOT NULL,
hypothesis TEXT NOT NULL,
date_created TIMESTAMPTZ NOT NULL DEFAULT now(),
variable_name TEXT NOT NULL,
user_id INTEGER REFERENCES users(id) ON DELETE CASCA... | true |
4626c1d6f422f89a4374cacbfc3f69f25dcdac57 | SQL | Pavelchak/JDBCtest | /src/main/resources/DataBase.sql | UTF-8 | 2,997 | 4.28125 | 4 | [] | no_license | CREATE SCHEMA IF NOT EXISTS `DB_JDBC` DEFAULT CHARACTER SET utf8;
USE `DB_JDBC`;
CREATE TABLE City
(
City VARCHAR(25) NOT NULL,
PRIMARY KEY (City)
) ENGINE = InnoDB;
CREATE TABLE Person
(
IDPerson INT NOT NULL AUTO_INCREMENT,
Surname VARCHAR(25) NOT NULL,
`Name` VARCHAR(25) NOT NULL,
City VARCHAR(25) N... | true |
41246acda3bbe1abb3476a2df41aa25469a98480 | SQL | rixe99/CorkExpress | /base_dados/corkexpress .sql | UTF-8 | 6,331 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 10-Set-2018 às 04:19
-- Versão do servidor: 10.1.31-MariaDB
-- PHP Version: 7.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
726ec83a33004d2f23540f38f21aebbb4a41ffdc | SQL | gladiopeace/digital-data-syn | /documents/oms/TB_PMTMB.sql | GB18030 | 3,255 | 3.28125 | 3 | [] | no_license | /*
================================================================================
ṹ:TB_PMTMB
ṹ:ȯŵ
ṹĿ:
================================================================================
*/
drop sequence SEQ_TB_PMTMB;
drop index AK_TB_PMTMB;
drop table TB_PMTMB;
create table TB_PMTMB (
PMTMB_ID INTEGER ... | true |
6e08c388a136d0ab09326a1ef99cbc21124be430 | SQL | 20113261/p_m | /serviceplatform_data/sql/first_images.sql | UTF-8 | 469 | 2.890625 | 3 | [] | no_license | CREATE TABLE `first_images` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`source` VARCHAR(64) NOT NULL,
`source_id` VARCHAR(128) NOT NULL,
`first_img` VARCHAR(96) DEFAULT NULL,
`utime` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
PRIMA... | true |
8e5abea504f229f10349913202039d18f5c97784 | SQL | lol768/tabula | /config/scripts/schema/migrations/2014-10-01 - store multiple teaching departments for modules and routes.sql | UTF-8 | 1,477 | 3.34375 | 3 | [
"ISC"
] | permissive | -- TAB-2589
create table ModuleTeachingInformation(
id nvarchar2(255) not null,
department_id nvarchar2(255) not null,
module_id nvarchar2(255) not null,
percentage number(6, 2),
constraint pk_modteachinginfo primary key (id)
);
create index idx_modteachinginfo_dept on ModuleTeachingInformation(department_id... | true |
52d422efc162da9ed1e3e20ce556191c74f21fc9 | SQL | sanjukz/FIL | /FIL.Database.Migration/Data/Roles.sql | UTF-8 | 562 | 2.84375 | 3 | [] | no_license | --KzSuite Admin
IF NOT EXISTS(SELECT * FROM Roles WHERE RoleName = 'Admin' AND PermissionId = 15 AND ModuleId = 6)
BEGIN
INSERT INTO Roles (RoleName,PermissionId,ModuleId,IsEnabled,CreatedUtc,CreatedBy)
VALUES ('Admin', 15, 6, 1, GETUTCDATE(), 'C043DDEE-D0B1-48D8-9C3F-309A77F44781')
END
IF NOT EXISTS(SELECT * FROM R... | true |
84313d947ed23d55bd6e5eb76ccf1606e8f84149 | SQL | cmnajs/croogo | /app/config/sql/install.sql | UTF-8 | 14,830 | 2.96875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 2.11.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 15, 2009 at 05:41 AM
-- Server version: 5.0.51
-- PHP Version: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `p_cms`
--
-- -------------------------------------------------... | true |
2559e55b9b6b3b1abad9a2a03373dd0bc9086930 | SQL | noelnamai/kent | /src/hg/makeDb/genbank/src/ccds/createTables.sql | UTF-8 | 8,308 | 3.40625 | 3 | [] | no_license | DROP TABLE IF EXISTS AccessionRejectionCriteria;
CREATE TABLE AccessionRejectionCriteria (
acc_rejection_uid int PRIMARY KEY NOT NULL ,
name varchar (64) NOT NULL ,
description text NULL
)
;
DROP TABLE IF EXISTS Accessions;
CREATE TABLE Accessions (
accession_uid int PRIMARY KEY NOT NULL ,
nuc_acc varchar (64... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.