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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5c3ba1c7813cec541bcbf88f62def7bd307cfcdb | SQL | AntaresAlbiorix/python_pool_report | /opt_info_per_poolz.sql | WINDOWS-1251 | 1,461 | 3.4375 | 3 | [] | no_license | select plst.pool_id,
olst.status,
--to_char(round(str.coupon, 0)) coupon, --
olst.isin,
to_char(otrs.transaction_date) transaction_date,
to_char(round(otrs.option_price*100,3)||'%') option_price,
to_char(nvl(oclc.reporting_date, oclc.valuation_date)) calc_date,
t... | true |
3b26f7afedc0e7f9f04248f449278f0a7f33b712 | SQL | bartscheers/gsm | /gsm/db/functions/create.function.getAssocParamsRunCat.sql | UTF-8 | 2,031 | 3.25 | 3 | [
"BSD-3-Clause"
] | permissive | create function getAssocParamsRunCat(ixtrsrc_id INT
,ixtrsrcid INT
) RETURNS TABLE (assoc_distance_arcsec DOUBLE
,assoc_r DOUBLE
,assoc_log_lr D... | true |
958d05d2ad0887355b6422e1960bcd16f9b0c30d | SQL | ProgRB/SalProject | /AddRetention/Queries/SelectReportSetting.sql | UTF-8 | 482 | 2.65625 | 3 | [] | no_license | declare
begin
open :c1 for
select
report_setting_id,
code_payment,
NAME_PAYMENT
from {1}.REPORT_SETTING join {1}.payment_type using (payment_type_id)
where report_group_id=:p_report_group_id;
open :c2 for select subdiv_id, code_subdiv, subdiv_name from {1}.REPORT_SETTING_SUBDIV join {0}.subdiv... | true |
dca58adfa42e192400d00e842baa4256cdb9272f | SQL | gurpreet19/ec198392_wht | /Database/configuration/03_02_headless_tool/Delta_WST/SourcePackageDefinitions/EC_GENERATE_STREAM_BODY.sql | UTF-8 | 11,014 | 2.515625 | 3 | [] | no_license | CREATE OR REPLACE PACKAGE BODY ec_generate_stream IS
/**************************************************************
** Package : ec_generate_stream, body part
**
** Revision : $Revision: 1.4 $
**
** Purpose : Generates code for derived streams.
**
** Documentation : www... | true |
ea1efb4ee7dee44a95e213c79f5ce9b780371529 | SQL | MelhorQueSVN/DSS | /ConfiguraFacil/dados/scriptConfi.sql | UTF-8 | 13,913 | 3.46875 | 3 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTI... | true |
0300389c98779a4f0a81faf43af1ed15aecd02f4 | SQL | yareda/backoffice | /Database/ClearOffice.Database/Schema Objects/Schemas/payroll/Views/payroll.qry_get_overtime.view.sql | UTF-8 | 404 | 3.3125 | 3 | [] | no_license | CREATE VIEW [payroll].[qry_get_overtime]
AS
SELECT SUM(payroll.payroll_current.amount) AS OTAmount, payroll.payroll_current.employee_id
FROM payroll.payroll_current INNER JOIN
payroll.payroll_parameter ON payroll.payroll_current.param_id = payroll.payroll_parameter.param_id
WHERE ... | true |
5b30e350b4d7aa37c4b229f77625d2a187826459 | SQL | uyarburak/etuophia | /etuophia/populate.sql | UTF-8 | 2,172 | 2.671875 | 3 | [] | no_license | insert into member values (null, 0, '', 'buyar@example.com', 'Burak', 'pass');
insert into member values (null, 1, '', 'blabla@example.com', 'Emel', 'pass');
insert into member values (null, 2, 'https://randomuser.me/api/portraits/men/91.jpg', 'blabla2@example.com', 'Hoca', 'pass');
insert into student (member_id, stu... | true |
2a84c8d95337bb103d78c6e1cd03cbb9012aaa8e | SQL | Coachmeister/OPN-F19 | /Database/init.sql | UTF-8 | 168 | 2.515625 | 3 | [] | no_license | CREATE DATABASE db;
use db;
CREATE TABLE persons (
PersonID int NOT NULL AUTO_INCREMENT PRIMARY KEY,
Firstname VARCHAR(255) NOT NULL,
Lastname VARCHAR(255)
);
| true |
d194c9b5c70b31ac6dcfed4fdbf0da2629660500 | SQL | hirotatsuuu/maven_sample | /src/main/resources/create.ddl | UTF-8 | 400 | 2.5625 | 3 | [] | no_license | drop database if exists maven_sample;
create database if not exists maven_sample;
connect maven_sample;
drop table if exists fruits;
create table fruits(
id integer primary key,
name varchar(20),
price integer
);
insert into fruits(id, name, price) values (1, 'apple', 120);
insert into fruits(id, name, price) values (2... | true |
278ddedf68fb3a7f4dd2f01c00060b9bfdbb0eff | SQL | Teeeeu/Projeto | /projetopw.sql | UTF-8 | 2,269 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 05-Out-2019 às 03:17
-- Versão do servidor: 10.1.33-MariaDB
-- PHP Version: 7.2.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
295f70fa3492952a8a09f57677c4d800dc297f01 | SQL | qeqs/Monitoring | /vnfSQLscript.sql | UTF-8 | 2,571 | 3.5 | 4 | [] | no_license | create table vnf(
id varchar(255) not null primary key,
createdat timestamp not null,
modifiedat timestamp,
name varchar(45),
username varchar(255)
);
create table network(
id varchar(255) not null primary key,
createdat timestamp not null,
modifiedat timestamp,
name varchar(45),
id_openstack varchar(100),
project_id v... | true |
61e45ea93e19005e72e6e42e3b87c0330836750e | SQL | brax-waller-mscs/BWaller | /bWaller2A/SQLQuery1.sql | UTF-8 | 3,536 | 3.78125 | 4 | [] | no_license | -- Brax Waller
-- Exercise 2A
-- PropertyManager db
-- 1) Building, Apartment Tables, ?BuildingId ?ApartmentNum
SELECT Building.BuildingId, Building.BuildingName, Apartment.ApartmentNum, Apartment.Rent
FROM Apartment INNER JOIN
Building ON Apartment.BuildingId = Building.Bui... | true |
55a368d11bc2fd93ffb2768fd76e334310b70945 | SQL | Airat-asd/save-to-XML | /src/main/resources/db/migration/V1__initial_schema.sql | UTF-8 | 449 | 2.96875 | 3 | [] | no_license | create table IF NOT EXISTS Department
(
id serial primary key,
dep_code varchar(20),
dep_job varchar(100),
description varchar(255),
unique(dep_code, dep_job)
);
insert into Department (dep_code, dep_job, description) values
('10', 'analyst', 'test comment'),
('1', 'SEO', 'test comment'),
('23', 'C... | true |
d7b4f01c7b856b94d31b68fcc26d02557e3f6327 | SQL | FALLENxGaLaXie5/Databases | /Lab4/Query_PilotRatings.sql | UTF-8 | 311 | 3.359375 | 3 | [] | no_license | select CONCAT(EMP_TITLE, ' ', EMP_FNAME, ' ', EMP_LNAME) as 'Employee Name', RTG_NAME as 'Rating', "Josh" as 'Query Executor', now() as 'Query Date'
from employee
join earnedrating on employee.EMP_NUM = earnedrating.EMP_NUM
join rating on earnedrating.RTG_CODE = rating.RTG_CODE
order by employee.EMP_LNAME asc; | true |
075ab8b50d092cc3c19ded3f7ae800569b3fea98 | SQL | alexcurnow/sql-practice | /SQL_Practice.sql | UTF-8 | 2,013 | 4.15625 | 4 | [] | no_license | --SELECT
--song.Id as SongId,
--Title,
--ArtistId,
--artist.ArtistName
--FROM Song song
--JOIN Artist artist on Song.ArtistId = artist.Id
--SELECT
--ArtistName,
--Title,
--Genre.Label
--FROM Artist
--JOIN Album on Artist.Id = Album.ArtistId
--JOIN Genre on Album.GenreId = Genre.Id
--WHERE Genre.Label = null;
--SELE... | true |
065679e14b6612d41785468a8c1336c584a0eb0d | SQL | InverseLina/search | /src/main/webapp/WEB-INF/sql/org/02_index_columns.sql | UTF-8 | 4,077 | 3.1875 | 3 | [] | no_license | -- SCRIPTS
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relname = 'contact_ex_idx_resume_gin'
AND n.nspname = current_schema
) THEN
CREATE INDEX contact_ex_idx_resume_gin ON jss_contact USING gin(resume_tsv);
... | true |
53154b2c60ab87f9fcc77c148b09884dd2841c2d | SQL | Mr-DoubleM/jspweb | /WEB/sql/OVERWATCH.sql | UHC | 3,595 | 3.171875 | 3 | [] | no_license | --------------------------------------------------------
-- - ȭ-9-29-2020
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Table OVERWATCH
--------------------------------------------------------
CREATE TABLE "SCOTT"."OVERWATCH"... | true |
4d1532ba7effedc73973cc37c22875be6371a78e | SQL | kelespring/spring-boot-demo2 | /src/main/resources/db/migration/V20190116_1411__xframe_data.sql | UTF-8 | 2,179 | 3.21875 | 3 | [] | no_license | -- 学生表
INSERT INTO student(sno,sname,ssex,sbirthday,class) VALUES (108 ,'曾华' ,'男' ,'1977-09-01',95033);
INSERT INTO student(sno,sname,ssex,sbirthday,class) VALUES (105 ,'匡明' ,'男' ,'1975-10-02',95031);
INSERT INTO student(sno,sname,ssex,sbirthday,class) VALUES (107 ,'王丽' ,'女' ,'1976-01-23',95033);
INSERT INTO student(sn... | true |
5e9c06c8c88a91eb1ed31aec351807d2963b405d | SQL | ErsyaRin9/UAS_GIS_ANDROID_TI6MA_1811500076 | /db_aplikasiku1811500076.sql | UTF-8 | 4,470 | 2.984375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 05 Agu 2021 pada 16.27
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
f8d615e5895b8db688dfed8f13fccc1cf485be88 | SQL | shimy8617/gestion-ecommerce-a | /db.sql | UTF-8 | 1,724 | 2.84375 | 3 | [] | no_license | CREATE TABLE PRODUCTO(
codpro int not null AUTO_INCREMENT,
nompro varchar(50)null,
despro varchar(100)null,
prepro numeric (6,2)null,
estado int null,
CONSTRAINT pk_producto
PRIMARY KEY (codpro)
);
alter table PRODUCTO add rutimapro varchar(100) null;
INSERT INTO PRODUCTO (nompro,despro,prepro,est... | true |
b72668696b2f4b160dbb8e6b6f3c124dfd7395a9 | SQL | mtikoian/km-all-projects | /UAS/Databases/UAS/UAS_DB/dbo/Stored Procedures/e_TransformAssign_SourceFileID.sql | UTF-8 | 289 | 3.3125 | 3 | [] | no_license | CREATE PROCEDURE e_TransformAssign_SourceFileID
@SourceFileID int
AS
BEGIN
set nocount on
SELECT DISTINCT ta.*
FROM TransformAssign ta With(NoLock)
JOIN TransformationFieldMap fm With(NoLock) ON ta.TransformationID = fm.TransformationID
WHERE fm.SourceFileID = @SourceFileID
END | true |
bcc74c47147fedcb53bd2fb3fe42815d1376c094 | SQL | svetlyoek/DB | /MS SQL Server/Data aggregation/DepositCharge.sql | UTF-8 | 217 | 2.765625 | 3 | [] | no_license | SELECT DepositGroup,
MagicWandCreator,
MIN(DepositCharge) AS [MinDepositCharge]
FROM WizzardDeposits
GROUP BY DepositGroup,
MagicWandCreator
ORDER BY MagicWandCreator,
DepositGroup; | true |
69ab137bf715e606a3cec8fddca57b16d33cb52b | SQL | HyperDevil/ntp-python-stats | /ntp.sql | UTF-8 | 293 | 2.984375 | 3 | [] | no_license | CREATE TABLE `clients` (
`time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`ip` int(10) UNSIGNED NOT NULL,
`version` int(1) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
ALTER TABLE `clients`
ADD UNIQUE KEY `ip` (`ip`),
ADD KEY `time` (`time`),
ADD KEY `version` (`version`);
| true |
36578506868795816056aff7939ecc9a1626f4fc | SQL | DQinYuan/fakerpp | /fakerpp-core/src/test/resources/models/user_shop/schema.sql | UTF-8 | 517 | 2.796875 | 3 | [] | no_license | create table shop
(
id int auto_increment primary key,
name varchar(255),
owner varchar(255),
);
create table user
(
id int auto_increment primary key,
name varchar(255),
sex varchar(6),
age int
);
create table user_detail
(
id int auto_increment primary key,
name varchar(255),
sex varchar(... | true |
51db6710fce06316f5571db5be632e7218f0ac97 | SQL | ThiagoPederzolli/trybe-exercises | /modulo_back-end/bloco_20/dia_3/query4.sql | UTF-8 | 139 | 2.75 | 3 | [] | no_license | no banco sakila na tabela film, quero filtrar os filmes com duração maior que 50min.
```
SELECT * FROM sakila.film
WHERE length > 50;
``` | true |
b93cfa247029234bd0105e77d6e1fc292f4d3f96 | SQL | rdelcast/natured | /database/schema.sql | UTF-8 | 1,303 | 3.59375 | 4 | [] | no_license | \c natureDB
DROP TABLE IF EXISTS products CASCADE;
DROP TABLE IF EXISTS users CASCADE;
DROP TABLE IF EXISTS categories CASCADE;
DROP TABLE IF EXISTS cart CASCADE;
DROP TABLE IF EXISTS shipping_address CASCADE;
DROP TABLE IF EXISTS states CASCADE;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQ... | true |
9357c68407e4ebfdef770f7d685d254dd9ceef0d | SQL | Mikhail-Mikhail/eShop_repo | /mysql_DB_models/eshop_db_v6/My_Test_Scripts/test_eshop_db.sql | UTF-8 | 2,773 | 2.75 | 3 | [] | no_license | DROP DATABASE eshop_db;
SET GLOBAL local_infile = true;
USE eshop_db;
/*----------------------------------------------*/
DELETE FROM customer;
DELETE FROM address;
DELETE FROM phone;
DELETE FROM orders;
DELETE FROM category;
DELETE FROM order_components;
DELETE FROM units;
DELETE FROM package;
DELETE FROM resistor;
D... | true |
c4597b09e6bbe8ebeb7a0c0f3c4ad0dc685087f1 | SQL | cristiancastrodc/Mama-Canguro | /db/migrations/2016-12-01-18-23-edit_procedimiento_guardar_historial.sql | UTF-8 | 767 | 2.890625 | 3 | [] | no_license | DROP PROCEDURE `sp_tadetalle_historia_insertar`;
CREATE PROCEDURE `sp_tadetalle_historia_insertar`(IN `pdni` CHAR(8), IN `pnro` INT(11), IN `pfecha` DATE, IN `pdiag` VARCHAR(500), IN `ptra` VARCHAR(500), IN `pNroatencion` INT, IN `pdni_atiende` CHAR(8), IN `pCita` DATE, IN `pAnamnemesis` VARCHAR(500))
BEGIN
INSERT IN... | true |
9415b87e214e6c2a5a075a08350df13d46683fcf | SQL | cckmit/xinfu | /ccms/WebContent/WEB-INF/action/project/fitness/wx/mc/myziyuan/gustinfo/followrecord/query-record.sql | UTF-8 | 531 | 3.46875 | 3 | [] | no_license | select
cc_comm.nexttime as shijian,
cc_comm.remark as vc_remark,
(case cc_comm.commresult when '0' then '免打扰'
when '1' then '下次电话提醒'
when '2' then '预约到店' else '成交' end)as call_result,
(select name from hr_staff where userlogin=cc_comm.createdby) as vc_iuser
from cc_comm
left join cc_guest on cc_comm.guestcode=cc... | true |
f5224b818266ca318d17568bd7c638879ab6c79e | SQL | redhawk96/Budget-Analyzer | /budget_cal.sql | UTF-8 | 4,029 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 21, 2019 at 07:28 AM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
abe3eb2782a470cc44e5c4b5f97d19b1a0ef06c3 | SQL | HarrickZeke/PHPForum | /sample.sql | UTF-8 | 5,800 | 3.65625 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Client: 127.0.0.1
-- Généré le: Mar 19 Mars 2013 à 22:36
-- Version du serveur: 5.5.27-log
-- Version de PHP: 5.4.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
837a0d6423ceb22f7135805085c899f6a9f5d7b9 | SQL | fajaralmu/backend-organizatization-management | /ddl.sql | UTF-8 | 3,926 | 3.640625 | 4 | [] | no_license | -- Drop table
-- DROP TABLE mpimedianet_management.dbo.division
CREATE TABLE mpimedianet_management.dbo.division (
name varchar(100) NOT NULL,
description varchar(1000) NULL,
institution_id int NOT NULL,
created_date datetime NULL,
id int IDENTITY(1,1) NOT NULL,
CONSTRAINT division_PK PRIMARY KEY (id),
CONSTRA... | true |
45b4fef3d8f72b62fd13a0c959c1973772c101db | SQL | XingXing2019/LeetCode | /Database/LeetCode 1398 - CustomersWhoBoughtProductsAandBbutNotC/CustomersWhoBoughtProductsAandBbutNotC_MySQL.sql | UTF-8 | 287 | 3.5 | 4 | [] | no_license | select customer_id, customer_name from customers
where customer_id in (select customer_id from orders where product_name = 'A')
and customer_id in (select customer_id from orders where product_name = 'B')
and customer_id not in (select customer_id from orders where product_name = 'C') | true |
902dcc68e8823393893c34911ea5716ba1abad16 | SQL | strogo/Dream | /dream.sql | UTF-8 | 62,833 | 2.984375 | 3 | [] | no_license |
-----------------------------------------------------------------------------
-- TURBINE_PERMISSION
-----------------------------------------------------------------------------
DROP TABLE TURBINE_PERMISSION;
DROP SEQUENCE TURBINE_PERMISSION_SEQ;
CREATE SEQUENCE TURBINE_PERMISSION_SEQ;
CREATE TABLE TURBINE_PERMISS... | true |
319f27f96a8163111896721948bb0adb7b2652b2 | SQL | mngerasimenko/bank | /src/main/resources/bank.sql | UTF-8 | 3,347 | 3.578125 | 4 | [] | no_license | DROP TABLE IF EXISTS bk_schedule;
DROP TABLE IF EXISTS bk_offer;
DROP TABLE IF EXISTS bk_bank;
DROP TABLE IF EXISTS bk_credit;
DROP TABLE IF EXISTS kredit;
DROP TABLE IF EXISTS bk_client;
CREATE TABLE IF NOT EXISTS bk_client
(
client_id UUID not null,
fio VARCHAR(100) not null,
telephone VARCHAR(15),... | true |
5cf9d4451dd0a1fcfcfefde694b816587c8d4ca8 | SQL | ludars/Data_Warehouse | /MV_rm_staff_assignments.sql | UTF-8 | 1,536 | 3.203125 | 3 | [] | no_license | /*
BEGIN
dbms_snapshot.REFRESH('c_rm_staff_assignments');
END;
*/
CREATE MATERIALIZED VIEW LOG ON h_rm_staff_assignments;
CREATE MATERIALIZED VIEW c_rm_staff_assignments refresh fast ON demand
AS
SELECT PIDM
, BANNER_ID
, NAME_SORT
, ENTITY_CODE
, PRIMARY_IND
, ACTIVE_IND
, STAFF_TYPE_CODE
, STAFF_TY... | true |
eade955df2b24000c1a8fe08b101f05c9d27438b | SQL | jewon/etri_sql_practice | /study01_0717.sql | UHC | 8,956 | 3.890625 | 4 | [] | no_license | /*
0717: View
*/
-- ִ ÷ ?
select * from temp_c;
alter table temp_c drop column use_yn; -- ȴ
drop table temp_c;
/*
?: ̺̳ ٸ 並 ʷ ̺, (Ǹ )
*/
grant create view to scott;
--scott
--
create view emp_20
as select * from emp where deptno = 20;
-- Ī ϸ ÷
create view emp_30
as select empno emp_no, enam... | true |
8d8103ed827d4a8d9edf8cc6625b6c99e6b5c0e5 | SQL | bartschs/sql_admin | /xplscntr.sql | UTF-8 | 2,224 | 3.0625 | 3 | [] | no_license | rem NAME
rem plscntr.sql
rem FUNCTION
rem gets info about user's contracts
rem NOTE
rem start from specified user
rem MODIFIED
rem 11.01.99 SBartsch - made it
rem
set verify off
set linesize 100
set arraysize 4
set long 10000
set maxdata 30000
set pagesize 22;
set heading off
set feedback off
clear columns
c... | true |
2b363899633e14a1986de1d2a2fd43f3410f1bec | SQL | nss-day-cohort-44/chinook-silaslowe | /invoice_37_line_item_count.sql | UTF-8 | 245 | 3.71875 | 4 | [] | no_license | SELECT
COUNT(il.invoicelineid)
FROM InvoiceLine il
JOIN Invoice i
ON il.invoiceid = i.invoiceid
WHERE i.InvoiceId = 37;
Select COUNT(il.InvoiceId)
From
InvoiceLine il,
Invoice i
ON i.InvoiceId = il.InvoiceId
WHERE i.InvoiceId = 37 | true |
509fc1c2187914cb06d93df26367428d05b206fe | SQL | jsj1510/woowahan-agile-codingtest | /sql/woorim/group-by/입양-시각-구하기(2).sql | UTF-8 | 178 | 3.140625 | 3 | [
"MIT"
] | permissive | SET @hour := -1;
SELECT
(@hour := @hour + 1) AS HOUR,
(SELECT COUNT(DATETIME) FROM ANIMAL_OUTS WHERE HOUR(DATETIME) = @hour) AS COUNT
FROM ANIMAL_OUTS
WHERE @hour < 23;
| true |
5038405da0d7a8229273a544801e1ed1cda82cd3 | SQL | dodomira/hello-world | /daily metrics with native flag.sql | UTF-8 | 10,184 | 4.125 | 4 | [] | no_license | //DAU
SELECT
DD, native_jp, count(distinct(dau.account_id))
FROM
(select account_id, date(create_datetime + interval '17 hours' ) as DD
FROM staging.audit_player_game_statistics where realm_id = 62 group by account_id, DD) DAU
LEFT OUTER JOIN
(select c.ACCOUNT_ID, (case when c.native_jp = 1 and D.ping ... | true |
59dea5c7a0e29cd9ca5c3feb0f0a849a8b3fe583 | SQL | lamfalusy/pizza-saloon | /core/src/main/resources/db/schema/V1_20160916151659__CreateOrderItem.sql | UTF-8 | 646 | 3.625 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS `pizza_saloon`.`order_item` (
`id` BIGINT AUTO_INCREMENT NOT NULL,
`order_id` BIGINT NOT NULL,
`pizza_id` BIGINT NOT NULL,
PRIMARY KEY (`id`),
INDEX `order_item_to_order_idx` (`order_id` ASC),
INDEX `order_item_to_pizza_idx` (`pizza_id` ASC),
CONSTRAINT `order_item_to_order`
... | true |
bddc956b510bbc8b11ae1db54d7a57b0e907835e | SQL | erickang7/nosql | /scylla/script/tutorial.cql | UTF-8 | 711 | 3.40625 | 3 | [] | no_license | CREATE KEYSPACE ks WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 2};
CREATE TABLE ks.users (
userid uuid,
name text,
email text,
country text,
PRIMARY KEY (userid)
);
INSERT INTO ks.users (userid, name, email, country) VALUES (uuid(), 'Bondie Easseby', 'beassebyv@house.gov', 'France... | true |
229c3cea7dfa75a864d1f32c122bada95c0251cc | SQL | UNLSiteMaster/site_master | /data/database.sql | UTF-8 | 25,354 | 3.59375 | 4 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 02, 2022 at 10:56 AM
-- Server version: 5.5.68-MariaDB
-- PHP Version: 7.4.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
0c7b7c44aeed669e9f8bd76bf11ef9f504d3f29b | SQL | H571531/2019-DAT109-Modelldrevet-utvikling-13 | /EXPO Applikasjon/Expo/DBScripts/Database1_190505_151237.sql | UTF-8 | 5,655 | 3.46875 | 3 | [] | no_license | -- Group [Group]
create table `group` (
`oid` integer not null,
`groupname` varchar(255),
primary key (`oid`)
);
-- Module [Module]
create table `module` (
`oid` integer not null,
`moduleid` varchar(255),
`modulename` varchar(255),
primary key (`oid`)
);
-- Admin [User]
create table `admin... | true |
3ddf35e52747b0e18ef4e9503c90e2670df219ca | SQL | grondinjc/RecepeBook | /bin/model.sql | UTF-8 | 1,423 | 3.515625 | 4 | [] | no_license | BEGIN TRANSACTION;
DROP TABLE IF EXISTS Recepe;
DROP TABLE IF EXISTS Tag;
DROP TABLE IF EXISTS RecepeTagAssoc;
COMMIT;
-- ------------------
-- ----- Tables -----
-- ------------------
BEGIN TRANSACTION;
CREATE TABLE Recepe (
id INTEGER NOT NULL,
name VARCHAR(200) ... | true |
756c6820e5fba635f0790964a09cf26311d5a266 | SQL | max7one/expressjs-news | /news.sql | UTF-8 | 3,297 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2016-02-10 15:49:32
-- 服务器版本: 10.1.10-MariaDB
-- PHP Version: 7.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!401... | true |
604bf091a131b71be250f50583a53f39e493be67 | SQL | daniiel/ora-scripts | /seq.sql | UTF-8 | 1,275 | 2.9375 | 3 | [] | no_license | set verify off
--------------------------------------------------------------------------------------------------------------
-- Script: Seq | Shows info of the sequences of a schema.
-- Author: Orlando Olguin Olvera | oranswer.wordpress.com | orlandoolguin.wordpress.com
-- Dates: 21/06/2010 | Creation
-- 12/1... | true |
65aa10d529a2c83b2a45226aa7dd586dcda0de3b | SQL | yemelianova-a/bd2014 | /5/INDIV_TASK1.sql | UTF-8 | 750 | 3.484375 | 3 | [] | no_license | CREATE PROCEDURE INDIV_TASK1 (
startdate date not null,
enddate date not null,
d1 date not null,
d2 date not null,
countt integer)
as
declare variable userid_to_update integer;
declare variable enaid integer;
begin
SELECT first 1 eb.ena_id FROM enable_blog eb
WHERE eb.ena_to_comment=1 AND... | true |
2d7fa43d21a897f19cc8112b80c3935bd357a97a | SQL | CUBRID/cubrid-testcases | /sql/_24_aprium_qa/_02_sql_extension/issue_9414_lag/cases/lag_numeric.sql | UTF-8 | 7,821 | 3.28125 | 3 | [
"BSD-3-Clause"
] | permissive | -- test with numeric data types and normal cases
-- syntax: LEAD(expr, offset, default)
create table lag_num(
col1 int not null,
col2 short auto_increment,
col3 bigint default 10000000,
col4 numeric(10, 5),
col5 float unique,
col6 double primary key,
col7 monetary shared 500
);
insert into lag_num values(1... | true |
14b2df3002d7fc2a0f20f13fedf1429889d5f525 | SQL | zht1933/jmrt-frame | /src/main/resources/db/migration/V1_0_5__cube_mysql_innodb.sql | UTF-8 | 2,086 | 2.875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50528
Source Host : localhost:3306
Source Database : webside
Target Server Type : MYSQL
Target Server Version : 50528
File Encoding : 65001
Date: 2017年2月21日
*/
DROP TABLE IF EXISTS... | true |
2c4bfe422b22b1666701cf094972dfa71c695e88 | SQL | thomasjacobbeck/InspirationalPeopleRepository | /InspirationalPeopleDBCreate.sql | WINDOWS-1252 | 5,475 | 3.6875 | 4 | [] | no_license |
CREATE TABLE People
(
PersonID INT,
PersonName VARCHAR(30),
PageNumber INT
);
INSERT into People VALUES(1,'Teddy Roosevelt',1);
INSERT INTO People
VALUES (2, 'Toby Fox', 1);
INSERT INTO People
VALUES (3, 'Ben Franklin', 1);
CREATE TABLE Pictures
(
PersonID INT,
ImgSrc VARCHAR(... | true |
e6a6296be6376d92d5186671e421f4c356f31255 | SQL | SayidJarrah/movieland | /src/main/resources/init_db.sql | UTF-8 | 7,139 | 3.359375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Tue Nov 20 20:56:33 2018
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=''O... | true |
a10b0b9ee07279830cde10f78cf224bd1590d0af | SQL | ztcnrh/fetch | /round_1_coding_exercise/q1_schema_and_erd/schema.sql | UTF-8 | 4,842 | 3.4375 | 3 | [] | no_license | -- Exported from QuickDBD: https://www.quickdatabasediagrams.com/
-- NOTE! If you have used non-SQL datatypes in your design, you will have to change these here.
CREATE TABLE "Receipts" (
"id" VARCHAR NOT NULL,
"bonus_points_earned" INT,
"bonus_points_earned_reason" VARCHAR,
"create_date" T... | true |
1f93669d3a131057d885b8cd66d7c6ca387a46cd | SQL | lebatuananh/Example-SQL | /16- Group By/16.sql | UTF-8 | 488 | 3.453125 | 3 | [] | no_license | USE [C:\DOCUMENTS AND SETTINGS\FABRICE\APPLICATION DATA\LINQPAD\SAMPLES\LINQ IN ACTION\NORTHWND.MDF]
SELECT
s.Country,
COUNT(SupplierID) AS Total
FROM Suppliers s
GROUP BY Country ORDER BY COUNT(SupplierID)
SELECT * FROM Orders
SELECT * FROM [Order Details]
SELECT * FROM Shippers
SELECT * FROM Employees
SELECT E.... | true |
d9efaa8b18442f6b21d5c1279d5bb5ef340446ac | SQL | jeremybeaucousin/GarageApi | /initialize_db.sql | UTF-8 | 502 | 3.625 | 4 | [] | no_license | CREATE TABLE public.garage (
id serial NOT null,
"name" varchar NOT NULL,
address text NOT NULL,
creation_date date NOT NULL,
max_car_capacity integer NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE public.car (
licence_id varchar NOT NULL,
id serial NOT NULL,
brand varchar NOT NULL,
model varchar NO... | true |
81cd3d369ec2aadaddef977ba3a45704a427e735 | SQL | coojee2012/SccinAgi | /VenusCRM/Install/baseSqlData/manageDepartments.sql | UTF-8 | 2,453 | 2.828125 | 3 | [
"MIT"
] | permissive | -- MySQL dump 10.13 Distrib 5.5.28, for Linux (i686)
--
-- Host: localhost Database: autodial
-- ------------------------------------------------------
-- Server version 5.5.28-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
... | true |
63d7954c6033a3515bafa3276a53b820535ea229 | SQL | vrathi0/dirtywind | /sql/merge_results.sql | UTF-8 | 933 | 3.8125 | 4 | [
"MIT"
] | permissive | /*
Merge aggregated air parcel trajectories with AOD data
*/
create schema if not exists results;
drop table results.aod_kentucky;
create table if not exists results.aod_kentucky as (
with aod_2006 as (
select site_corrected,
date,
time,
timestamp,
year,
mean as mean_aod
fro... | true |
3c78e63efef29cf9fb027352822420e9e3d63fe0 | SQL | jonatasx/Sistema_SportsXtreme | /sql/Antigos/db_extreme1.sql | UTF-8 | 4,785 | 3.609375 | 4 | [] | no_license |
CREATE SCHEMA IF NOT EXISTS `db_extreme` DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
USE `db_extreme` ;
-- -----------------------------------------------------
-- Table `db_extreme`.`Usuario_Aluno`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `db_extreme`.`Us... | true |
4f78bc5dfe5ea9cbb5d44af67ad011ecf5055da6 | SQL | borysl/WebNetwork | /db/get_frame_services.sql | UTF-8 | 1,618 | 3.71875 | 4 | [] | no_license | DROP FUNCTION IF EXISTS public.get_frame_services(
_service_layer_id integer,
x1 double precision,
y1 double precision,
x2 double precision,
y2 double precision);
DROP TYPE IF EXISTS serviceVM;
CREATE TYPE serviceVM as (
service_id integer,
name character varying(255),
input_ass... | true |
77e70cf5761fc1a24f467062ab222747511e23b4 | SQL | arman1507/Maps_api_key_Rating_php | /wp_grp_google_place.sql | UTF-8 | 2,542 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 15, 2019 at 03:54 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
626aab68b2a1f7660234ef7a361b603ce48ae0ff | SQL | Holldike/collector | /dump.sql | UTF-8 | 425 | 3.03125 | 3 | [] | no_license | CREATE TABLE `ips` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`ip` varchar(232) NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
CREATE TABLE `ports` (
`id_ip` int(11) NOT NULL,
`port` int(5) NOT NULL,
`service` varchar(32) DEFAULT NULL... | true |
2fec8997bc92b9bd692a851e3e8f8d85c8973dce | SQL | soulscreme/data-engineering | /ls-data-eng-app/conf/evolutions/default/4.sql | UTF-8 | 309 | 3.078125 | 3 | [] | no_license | # --- !Ups
CREATE SEQUENCE order_id_seq;
CREATE TABLE orders (
id integer NOT NULL DEFAULT nextval('order_id_seq'),
purchaser_id integer NOT NULL REFERENCES purchasers (id),
item_id integer NOT NULL REFERENCES items (id),
quantity integer,
);
# --- !Downs
DROP TABLE orders;
DROP SEQUENCE order_id_seq; | true |
dd0372b4187da7ad0fdb7641a67416fb0c7f5ab6 | SQL | ZuleicaGadar98/Universidad | /5to Semestre/DBD/3er Parcial/Triggers.sql | UTF-8 | 2,571 | 4.34375 | 4 | [] | no_license | -- EJEMPLO 1 --
CREATE TABLE account
(acct_num INT AUTO_INCREMENT,
amount DECIMAL(10,2),
Primary key (acct_num)
);
CREATE TRIGGER ins_sum BEFORE INSERT ON account
FOR EACH ROW SET @sum = @sum + NEW.amount;
SET @sum = 0;
INSERT INTO account VALUES(137,14.98),(141,1937.50),(97,-100.00);
SELECT @sum AS 'Total amount ins... | true |
9d6d63f77f1e5e89ab2ced772101e19397f3ff67 | SQL | green-fox-academy/abdallahgeha | /week-07/day-4/reddit-backend/reddit.sql | UTF-8 | 2,616 | 2.984375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.18, for Win64 (x86_64)
--
-- Host: localhost Database: rapgod
-- ------------------------------------------------------
-- Server version 8.0.18
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!4... | true |
9081b6ad2fe9aa6a76b7a545271d0707d5e7b76b | SQL | Jaime-Barillas/DBAS-PressStart | /db/queries/repairs_search_by_id.sql | UTF-8 | 730 | 3.390625 | 3 | [] | no_license | SELECT tbl_repair_invoices.repair_invoice_id AS repair_id,
tbl_repair_invoices.repair_invoice_description AS repair_description,
(tbl_members.member_first_name || ' ' || tbl_members.member_last_name) AS repair_member_name,
(tbl_employees.employee_first_name || ' ' || tbl_employees.employee_last_name) AS rep... | true |
68e149367468754dfb6f2d18427ee22f5580f553 | SQL | jabautista/GeniisysSCA | /src/main/resources/sql/dml/giis_parameters/GIIS_PARAMETERS-insert-ALLOW_MC_DEP_BY_FMV.sql | UTF-8 | 977 | 2.953125 | 3 | [] | no_license | /* Created by : Dren Niebres
* Date Created : 06.08.2016
* Remarks : SR-5278
*/
SET SERVEROUTPUT ON
DECLARE
v_exist NUMBER := 0;
BEGIN
SELECT 1
INTO v_exist
FROM cpi.giis_parameters
WHERE param_name = 'ALLOW_MC_DEP_BY_FMV';
IF v_exist = 1
THEN
DBMS_OUTPUT.put_line
... | true |
2c9d662950d56f9d64958556a60f61b1fa15f8d3 | SQL | auwfar/AdminLTE-CRUD-With-Sails-JS | /database/crud.sql | UTF-8 | 5,038 | 3.125 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.13-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Version: 9.4.0.5169
-- ------------------------------------------------... | true |
25b6163f78b90c8c3f87a32e5413945efd378720 | SQL | samdolson/SQL_Practice | /Codesignal/Q39/dateFormatting.sql | UTF-8 | 187 | 2.5625 | 3 | [] | no_license | CREATE PROCEDURE dateFormatting()
BEGIN
/* Write your SQL here. Terminate each statement with a semicolon. */
SELECT DATE_FORMAT(date_str, '%Y-%m-%d') AS date_iso FROM documents;
END | true |
330f589ee7c57b822e034e34eb5ff0e9ec338ee6 | SQL | gered/mtgcoll | /resources/migrations/00006_card_prices_table.up.sql | UTF-8 | 567 | 3.84375 | 4 | [
"MIT"
] | permissive | CREATE TABLE card_prices (
id SERIAL PRIMARY KEY,
card_id TEXT NOT NULL,
source TEXT NOT NULL,
online BOOLEAN NOT NULL,
price DECIMAL(10, 2) NOT NULL,
last_updated_at TIMESTAMP NOT NULL,
UNIQUE (card_id, source, online)
);
ALTER TA... | true |
b743a799375360bfbb2355e9e3e0de5e27a0af29 | SQL | mpsathya93/sample-quiz-php | /questions.sql | UTF-8 | 3,022 | 3.40625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 07, 2014 at 07:44 PM
-- Server version: 5.5.25a
-- PHP Version: 5.4.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*... | true |
a43c92dd2bcc14523744a7d19c2938ae4873e17c | SQL | velrest/K307 | /data/swissnotes.sql | UTF-8 | 1,572 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.11.1deb2+deb7u2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 15. Mrz 2016 um 12:41
-- Server Version: 5.5.47
-- PHP-Version: 5.6.18-1~dotdeb+7.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA... | true |
5ad273d11b78cb88271c600e8b67904e6c3d29d8 | SQL | milhamh95/golang-clean-code-v2 | /driver/mariadb/migrations/1567821859_create_department_table.up.sql | UTF-8 | 425 | 2.890625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `departments` (
`id` varchar (50) NOT NULL,
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`description` varchar(250) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`created_time` timestamp NULL,
`updated_time` timestamp NULL,
PRIMARY KEY (`id`),
... | true |
ee6554742a1e1683b439f00b372937e1793a166b | SQL | techtronics/upa | /Insidencias/reportes/nuevas/gestion matricula/estadistica por carrera.sql | UTF-8 | 4,579 | 3.5 | 4 | [] | no_license | select d.emat_ccod,a.pers_ncorr, e.carr_ccod, c.peri_ccod, cast(pers_nrut as varchar)+'-'+cast(pers_xdv as varchar) as rut,
pers_tape_paterno + ' ' + pers_tape_materno + ', '+ pers_tnombre as nombre,
pers_fnacimiento,protic.es_nuevo_carrera(a.pers_ncorr,e.carr_ccod,c.peri_ccod) as nuevo,
isnull(protic.AN... | true |
4152e57aae94495c252e78d1390035040ce22ba7 | SQL | maflorvega/Redash_queries | /queries_versioned/343_Old external clicks.sql | UTF-8 | 679 | 2.984375 | 3 | [] | no_license | /*
Name: Old external clicks
Data source: 4
Created By: Admin
Last Update At: 2016-03-15T19:35:30.743768+00:00
*/
SELECT date(date_time) AS date
FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal,'CONCAT(REPLACE(table_id,"_","-"),"-01") BETWEEN STRFTIME_UTC_USEC("{{startdate}}", "%Y-%m-01") and STRFTIME_UTC_USEC... | true |
98fa29f8110220cd16d0b3ea31873f3d5e63c3fe | SQL | valkrhlan/FoodDonorWebservice | /FoodDonorWS/vanjsko/fdonor.sql | UTF-8 | 12,964 | 2.78125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 26, 2016 at 08:14 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.5.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
0bf257e123d3e4b70a55ca20a7aca127603a12ac | SQL | niveknaheehs/Prism_Anonymisation | /anonymisation_perf/db_tables1.sql | UTF-8 | 166,167 | 3.1875 | 3 | [] | no_license | set verify on
--------------------------------------------------------
PROMPT Creating Table NON_HOLDER_CA
--------------------------------------------------------
CREATE TABLE &&ANON_OWNER..NON_HOLDER_CA
( CASH_ACCOUNT_ID NUMBER(*,0),
COMP_CODE VARCHAR2(4 CHAR),
HOLDER_NAME_ID NUMBER(*,0)
) SEGMENT CREA... | true |
1a354e411bd0ea29a23cab2fc4bb522cad7b07ab | SQL | yuliyaSokhrannaya/aviso | /target/odessa2013-1.0-SNAPSHOT.war/WEB-INF/classes/db/migration/005__contract.sql | UTF-8 | 624 | 3.234375 | 3 | [] | no_license | CREATE SEQUENCE seq_contract START WITH 5;
CREATE TABLE Contract
(contractId INTEGER GENERATED BY DEFAULT AS SEQUENCE seq_contract NOT NULL PRIMARY KEY,
clientId INTEGER NOT NULL FOREIGN KEY REFERENCES client(client_id) ON DELETE CASCADE,
productId INTEGER NOT NULL FOREIGN KEY REFERENCES product_name(name_id) ON DELE... | true |
7c6fb81ae8452d0055eabc5906e1c5376560d121 | SQL | erikpacheeco/BandTec-Trabalho_Individual-CCO-2021-1 | /BancoDeDados/BD_AniNexus.sql | UTF-8 | 1,849 | 3.640625 | 4 | [] | no_license | create database AniNexus;
use AniNexus;
create table tbNoticia (
idNoticia int primary key auto_increment,
dataNotica varchar(45),
tituloNoticia varchar(50),
textoNoticia varchar(1000)
);
create table tbGuiaTemporada (
idTemporada int primary key auto_increment,
thumbnailTemporada varchar(45),
... | true |
6d2fe067444e585066cede992ab3cc5e80b308e2 | SQL | ArnaudW29/projet1TBonbon | /BACKEND/scripts-web-service/procedure-verifIdentifiant.sql | UTF-8 | 611 | 3.0625 | 3 | [] | no_license |
CREATE PROCEDURE "DBA"."proc_verifIdentifiant" (IN id VARCHAR(50))
RESULT(identifiant VARCHAR(50))
BEGIN
call sa_set_http_header('Access-Control-Allow-Origin','*');
call sa_set_http_header('Content-Type','application/json');
select clientIdentifiant from tbClient
where id = clientIdentifiant
END;
---... | true |
cbfb7291f5244371333d8130f6f6cf7557be69eb | SQL | vaidehip-optimus/sql_induction | /TEST_SOLUTION.sql | UTF-8 | 1,686 | 4.28125 | 4 | [] | no_license |
/*1ST*/
SELECT
D.DeptName,
GENDER,
COUNT(ID) AS NO_OF_EMPLOYEE
FROM EMPLOYEE
LEFT JOIN
DEPARTMENT D
ON EMPLOYEE.DEPTID=D.DeptID
GROUP BY D.DeptName,GENDER
ORDER BY DeptName
/*2ND QUERY*/
SELECT A.DEPTNAME,A.NO_OF_EMPLOYEE,
A.TOTAL_SALARY,
B.HIGHEST_GROSS
FROM
(
SELECT E... | true |
492de7ec4bac566900a5ed4b3d8254ab792f9d26 | SQL | iJasonCui/big_database | /MySQL/sproc/Accounting/wsp_consumeFreeCredits.mysql | UTF-8 | 1,442 | 3.0625 | 3 | [] | no_license | DELIMITER ;;
DROP PROCEDURE IF EXISTS wsp_consumeFreeCredits;
CREATE DEFINER='root'@'10.10.26.21' PROCEDURE wsp_consumeFreeCredits (
/******************************************************************************
**
** CREATION:
** Author: Mike Stairs
** Date: October 2004
** Description: insert row into Acco... | true |
87a70a1aba4d254c2dc0b24eb7e63315bfe85e52 | SQL | bpollockATX/sql-challenge | /EmployeeSQL/SQL/Job_00200_Assignment.sql | UTF-8 | 2,370 | 4.78125 | 5 | [] | no_license |
--
-- Get Employee Number, lName, fName, Salary
--
Select
a.emp_no
,a.last_name
,a.first_name
,a.gender
,b.salary
FROM employees a
join salaries b
on a.emp_no = b.emp_no
order by a.emp_no;
--
-- Find employees hired in 1986
--
Select emp_no
,first_name
,last_name
,hire_date
From employees
where hir... | true |
3cc57fbe0cc9bb02d4efc426499939ebde2d4c42 | SQL | i2r-csz/ps | /web/protected/data/java9.sql | UTF-8 | 5,150 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 30, 2012 at 04:20 PM
-- Server version: 5.1.44
-- PHP Version: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... | true |
ee0c16b5520cf6661a920a3df3ca306d4bd07dc0 | SQL | devevandro/curso-fullstack | /heldesk-api/src/main/resources/db/migration/V02__create_tables_enum.sql | UTF-8 | 318 | 2.625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS perfis (
codigo INTEGER PRIMARY KEY AUTO_INCREMENT,
descricao VARCHAR(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO perfis (descricao) values ('ROLE_ADMIN');
INSERT INTO perfis (descricao) values ('ROLE_CLIENTE');
INSERT INTO perfis (descricao) values ('ROLE_TECNICO');
| true |
168fd1de4ad3af15ff6987c725dd948d0920ec15 | SQL | alamedacomedy/alameda-comedy-api | /migrations/001.do.create_users.sql | UTF-8 | 244 | 2.515625 | 3 | [] | no_license | CREATE TABLE users (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY UNIQUE,
full_name TEXT NOT NULL,
email TEXT NOT NULL,
pw TEXT NOT NULL,
date_created TIMESTAMP NOT NULL DEFAULT NOW(),
administrator BOOLEAN
); | true |
1c9291b9da2c76098ae0660ee5ba3878321d8c65 | SQL | mn22nw/1DV408_Projekt | /musiclogbook.sql | UTF-8 | 3,228 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.4
-- http://www.phpmyadmin.net
--
-- Värd: 127.0.0.1
-- Tid vid skapande: 25 okt 2014 kl 03:59
-- Serverversion: 5.6.15-log
-- PHP-version: 5.4.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
bebcda7badced099746c2e939a245e2b74ccbece | SQL | WakoItoh/resourcereservationsystem | /insert.sql | UTF-8 | 2,829 | 2.75 | 3 | [] | no_license |
/* Insert Sample Data */
insert into users(id, password, last_name, first_name, user_level, phone, email) values ('u0000001', 'pa55w0rd', '仲町台', '太郎', 2, '0123456789', 'u0000001@example.com');
insert into users(id, password, last_name, first_name, user_level, phone, email) values ('u0000002', 'pa55w0rd', '都築', '花... | true |
29b4dfbcb69a79186f9d6a04aa5555c817ce0e14 | SQL | digideskio/ijambo | /misc/make_word_list.sql | UTF-8 | 604 | 3.9375 | 4 | [] | no_license | -- Queries a Kumva database for suitable words:
-- * Nouns
-- * No flags
-- * Length between 5 and 12 characters
-- * First meaning between 2 and 16 characters
--
SELECT * FROM (
SELECT
r.entry_id,
CONCAT_WS('', `prefix`, `lemma`) as `word`,
SUBSTRING_INDEX(m.`meaning`, ',', 1) AS `meaning`
FROM `... | true |
17d06435f18e4ef379315ce61cb07d4d76fef194 | SQL | cose451-asu/chat-server | /scripts/init.sql | UTF-8 | 2,588 | 3.90625 | 4 | [] | no_license | CREATE USER chatserver;
CREATE DATABASE chat;
GRANT ALL ON DATABASE chat TO chatserver;
SET DATABASE = chat;
DROP TABLE IF EXISTS chatroom_snapshots;
DROP TABLE IF EXISTS chatroom_events;
DROP TABLE IF EXISTS chatroom_participants;
DROP TABLE IF EXISTS chatrooms;
DROP TABLE IF EXISTS refresh_tokens;
DROP TABLE IF EXI... | true |
e629708910e12c7898895f275cd480957e108fb4 | SQL | KsuZZ/SQL | /.gitignore/No.2рус.sql | UTF-8 | 1,457 | 3.25 | 3 | [] | no_license |
CREATE TABLE препараты
(
название_п VARCHAR(50) PRIMARY KEY,
форма_выпуска VARCHAR(50),
доступность VARCHAR(50),
дата_выпуска DATE,
срок_годности smallint
);
CREATE TABLE фирмы
(
название_ф VARCHAR(50) PRIMARY KEY,
качество VARCHAR(50),
год_создания date,
страна VARCHAR(50),
адрес VARCHAR(50),
телефон inte... | true |
d88039c3b013d9a37e7512a7621b557bba640f32 | SQL | krukovden/MyProjects | /C#/Graphics/ADO/Simple_Staff_in_Sportgym/Kursach.sql | WINDOWS-1251 | 3,756 | 3.421875 | 3 | [] | no_license | create database Kursach_sport;
create table Users (id int Primary key Identity(1,1),
name varchar(100),
number_card int ,
birthday date,
gender varchar(10),
email varchar(20),
tel varchar(20)
);
create table Client(id int Identity(1,1) Primary key,
id_abonement int not null,
... | true |
54cff465db6ec0ed7126301726781c948b5c5b07 | SQL | getemboy/Cinema_MySQL | /kino_1_SELECT_3.sql | UTF-8 | 1,061 | 3.671875 | 4 | [] | no_license | -- Селекти
-- Изкарва програмата по дата, ден и име на филм, при които възрастовото ограничение е
-- под 16 години и датата е между 2019-11-11 и 2019-11-13
USE kino_1;
SELECT
p.pg_date AS p_data,
DAYNAME(pg_date) AS den,
m.m_name AS ime_na_film
FROM tbl_programa p
LEFT JOIN tbl_movies m ON p.m_id = m.m_id;
... | true |
c543e5ffa5f2ae4916305426450400cf02c6b9e9 | SQL | philiplehmann/next-bootstrap | /prisma/migrations/20210713142600_init/migration.sql | UTF-8 | 2,394 | 3.78125 | 4 | [
"MIT"
] | permissive | -- CreateTable
CREATE TABLE "Account" (
"id" UUID NOT NULL,
"userId" UUID NOT NULL,
"providerType" VARCHAR(255) NOT NULL,
"providerId" VARCHAR(255) NOT NULL,
"providerAccountId" VARCHAR(255) NOT NULL,
"refreshToken" VARCHAR(255),
"accessToken" VARCHAR(255),
"accessTokenExpires" TIMESTAMP... | true |
b5e583cf5e57f862dc3213aaec0ae3ba1e6802e1 | SQL | thinkful-ei-gecko/JamesL-Trippie-Server | /migrations/002.do.create_trips.sql | UTF-8 | 157 | 2.6875 | 3 | [] | no_license | CREATE TABLE trips (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
trip_title TEXT NOT NULL,
user_id INTEGER REFERENCES trippie_users(id)
); | true |
7c5ff0f7b2cbc27a27fab214eb5b847df51fdb1a | SQL | zandev/postadmin | /src/default-schema.mysql | UTF-8 | 1,121 | 3.34375 | 3 | [] | no_license | -- From http://workaround.org/ispmail/lenny/preparing-the-database
CREATE TABLE `virtual_domains` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `virtual_users` (
`id` int(11) NOT NULL auto_increment,
`domain_id` in... | true |
07b0059b87cbd980a6bbb0b7ca1870d68a9d7ca0 | SQL | rodriguesmafalda/talkdesk_project | /calls/target/classes/db/migration/V20210707230649__init_db.sql | UTF-8 | 491 | 3.203125 | 3 | [] | no_license |
CREATE TABLE call (
id bigint NOT NULL,
callee_number character varying(255) NOT NULL,
caller_number character varying(255) NOT NULL,
end_time timestamp,
start_time timestamp,
status character varying(255),
type character varying(255) NOT NULL,
PRIMARY KEY(id)
);
ALTER TABLE call ALTER... | true |
d9ab6f9e5b0297acd7532dc3b39a296b8f82ad2f | SQL | amojohn/ETL | /07_BI_DEPLOY/5_DMR/TABLES/DMR_OV_RGN_PROVINCE_RELA.sql | UTF-8 | 483 | 2.578125 | 3 | [] | no_license | DROP TABLE IF EXISTS DMR.DMR_OV_RGN_PROVINCE_RELA;
CREATE TABLE IF NOT EXISTS DMR.DMR_OV_RGN_PROVINCE_RELA(
RGN_NAME STRING COMMENT '大区名称',
PROVINCE_NAME STRING COMMENT '省份名称',
RGN_FLAG STRING ... | true |
8e330d693be4ff8472a5e1b33da166322f01fd13 | SQL | SwapnilNawale18/SQL-3 | /SQLQuery-3.sql | UTF-8 | 3,485 | 4.21875 | 4 | [] | no_license | create Database Student;--CREATES DATABASE
use Student;--SWITCHES TO DATABSE
CREATE TABLE Admissions (
GR INT PRIMARY KEY,
StudentID VARCHAR (50),
JoiningDate DATETIME
);-- CREATES A TABLE
INSERT INTO Admissions(GR, StudentID, JoiningDate)
VALUES (1001, 'S005', 10-10-2000);--INSERTS A RECORD
INSERT INTO... | true |
3906f2bee1735524da3ba1b88ec864a926dd77c3 | SQL | tekerrr/skillbox_prod | /db/db.sql | UTF-8 | 32,615 | 3.3125 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Sat Jul 13 20:56:56 2019
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.