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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
30a55826b8574ad56082d519191e189a09c63ada | SQL | surachai-tw/bpk | /BOP/SQL/Crontab/BOP_Crontab_BOP_UpdateCost.sql | UTF-8 | 786 | 2.59375 | 3 | [] | no_license | UPDATE item SET unit_price_cost='0' WHERE trim(unit_price_cost)='';
UPDATE item SET unit_price_cost='0' WHERE unit_price_cost='NaN';
UPDATE item SET unit_price_cost='0' WHERE isnumeric(unit_price_cost)=FALSE;
UPDATE stock_mgnt SET unit_price='0' WHERE trim(unit_price)='';
UPDATE stock_mgnt SET unit_price='0' WHERE uni... | true |
76ae172365f45b6806e2ebc1425e6577ff6c73a0 | SQL | mtroot/top9 | /src/main/resources/db/populateDB.sql | UTF-8 | 313 | 3.015625 | 3 | [] | no_license | DELETE FROM user_roles;
DELETE FROM users;
ALTER SEQUENCE global_seq RESTART WITH 100000;
INSERT INTO users (name, email, password)
VALUES
('Admin', 'admin@mail.ru', 'password'),
('User', 'user@mail.ru', '12345');
INSERT INTO user_roles (user_id, role)
VALUES
(100000, 'ROLE_ADMIN'),
(100001, 'ROLE_USER');
| true |
92a84c7ee9a6e29d7ad8e31d9a9474301150c8b6 | SQL | SantyagoSeaman/Kaggle-Expedia-Hotel-Recommendations | /sql/fill_train_data_countries_popularity.sql | UTF-8 | 1,151 | 3.796875 | 4 | [] | no_license |
INSERT INTO train_data_countries_popularity
SELECT hotel_country, hotel_market, search_season, hotel_cluster,
ceil(SUM((is_booking*11 + 1)*((date_time_year-2013)*1 + 1))) as search_qty,
0 as search_freq
FROM train_data
WHERE search_season > 0
GROUP BY hotel_country, hotel_market, search_season, hotel_cluster;
U... | true |
588827648cd1585b85a47afaa088944effb0de5d | SQL | mthandoh9/TalkApp | /talkapp.sql | UTF-8 | 7,013 | 2.6875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 04, 2018 at 10:47 PM
-- Server version: 5.6.26
-- PHP Version: 5.5.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
4d1dda2fddcacf0eb6800b77f2f4884f393e3916 | SQL | thenicoleyu/tvShowDatabase | /tv_shows.sql | UTF-8 | 3,100 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 02, 2016 at 01:07 AM
-- Server version: 5.6.28
-- PHP Version: 7.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `tv_shows`
--
-- --------------------------... | true |
574e920e79506eb85a2fdd9edbf283b1c73436c7 | SQL | ousamasama/SQL-Exercise-16-Chinook | /answers/top_5_tracks.sql | UTF-8 | 213 | 3.828125 | 4 | [] | no_license | SELECT Track.Name, COUNT(*) as "Total" FROM Invoice
JOIN InvoiceLine ON InvoiceLine.InvoiceId = Invoice.InvoiceId
JOIN Track ON InvoiceLine.TrackId = Track.TrackId
GROUP BY Track.Name
ORDER BY "Total" DESC LIMIT 5 | true |
7e1cfee2b3498bdadf3f728f80d6ea9ec2c1bd0f | SQL | ArrettB/omni-workspace | /servicetrax/dbscripts/views/REPORT_TO_TYPES_V.sql | UTF-8 | 462 | 3.484375 | 3 | [] | no_license | CREATE VIEW dbo.REPORT_TO_TYPES_V
AS
SELECT TOP 100 PERCENT dbo.LOOKUPS.LOOKUP_ID, dbo.LOOKUPS.NAME, dbo.LOOKUPS.CODE, dbo.LOOKUPS.SEQUENCE_NO
FROM dbo.LOOKUP_TYPES INNER JOIN
dbo.LOOKUPS ON dbo.LOOKUP_TYPES.LOOKUP_TYPE_ID = dbo.LOOKUPS.LOOKUP_TYPE_ID
WHERE (dbo.LOOKUP_TYPES.C... | true |
b82a6c0bab07a272291024a09dbdeea347d5a768 | SQL | radtek/abs3 | /sql/mmfo/bars/Procedure/p_lic24.sql | WINDOWS-1251 | 7,258 | 3.21875 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Procedure/P_LIC24.sql =========*** Run *** =
PROMPT =====================================================================================
PROMPT *** Create procedure... | true |
39d1b332776b318ba061ac4f0c0917b4e9e5117a | SQL | lucascostaaa/ControleDeTarefaseCompromissos | /SQLQuery1.sql | UTF-8 | 362 | 3 | 3 | [] | no_license | SELECT * FROM TB_Tarefas
SELECT [ID],[TITULO],[DATACONCLUSAO],[PERCENTUAL],[PRIORIDADE] FROM TB_Tarefas WHERE [PERCENTUAL] = 100
UPDATE TB_Tarefas
SET
[TITULO] = 'teste atualizacao2',
[DATACONCLUSAO] = '05/06/2021',
[PERCENTUAL] = 90,
[PRIORIDADE] = 'alta'
WHERE
[ID] = 8
DELETE FROM TB_Tarefas
WHER... | true |
479745dcf182271dc3a6b29f700c418e8565f22e | SQL | ITelligence-BSIT-3B/Meryenda-cravesZC-app | /meryendacraves.sql | UTF-8 | 6,112 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 04, 2021 at 04:51 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
2b69ba334453a674ef525b25fb55dc4072bdc2f3 | SQL | miwes/SQL | /list_security_rights_tables.sql | UTF-8 | 783 | 3.8125 | 4 | [] | no_license | SELECT
state_desc
,permission_name AS [Permission]
,so.name AS [Table]
,sdpr.name
COLLATE LATIN1_General_CI_AS as [Permissions T-SQL]
FROM SYS.DATABASE_PERMISSIONS AS sdp
JOIN sys.objects AS so
ON sdp.major_id = so.OBJECT_ID
JOIN SYS.SCHEMAS AS ss
ON so.SCHEMA_ID = ss.SCHEMA_ID
JOIN SYS.DATABASE_PRINCIPA... | true |
87bebdb3d009473c0fc55266c3b7d9d57b9920ba | SQL | jotapsa/BDAD-FEUP | /int8.sql | UTF-8 | 256 | 3.296875 | 3 | [] | no_license | .mode columns
.headers on
.nullvalue NULL
.width 20 10
/*INTERROGACAO 8 - Quantidade de jogadores para cada posicao */
SELECT posicaoPref, count(posicaoPref) AS num
FROM Jogador INNER JOIN Pessoa
ON Jogador.idPessoa=Pessoa.idPessoa
GROUP BY posicaoPref;
| true |
b196c263322f353641a97d1fc0bbad02e97b7697 | SQL | unmtransinfo/cerner-tools | /sql/old/hf_lab_codes.sql | UTF-8 | 312 | 3.0625 | 3 | [] | no_license | -- Health Facts labs
--
SELECT
dlp.lab_procedure_id,
dlp.lab_procedure_mnemonic,
dlp.lab_procedure_name,
dlp.lab_procedure_group,
dlp.lab_super_group,
dlp.loinc_code,
dlp.loinc_ind,
du.unit_display,
du.unit_desc
FROM
hf_d_lab_procedure dlp
JOIN
hf_d_unit du ON dlp.result_units_id = du.unit_id
;
--
| true |
3e7f85f8ac4cc2f72dd52cc632c5294c9303f4a6 | SQL | radam-herman/database-exercises | /3.8.3_subqueries_exercises.sql | UTF-8 | 3,647 | 4.09375 | 4 | [] | no_license | -- 3.8.3_subqueries_exercises.sql
-- 1 Find all the employees with the same hire date as employee 101010 using a sub-query.69 Rows
-- tables employees
select e.emp_no, e.first_name, e.last_name, e.hire_date
from employees as e
where e.hire_date in (
select e.hire_date
from employees
where e.emp_no =... | true |
1384b7fc584ce3152f9f21e39f4e1e9683b9a2a8 | SQL | CUBRID/cubrid-testcases | /sql/_13_issues/_12_1h/cases/bug_bts_5921.sql | UTF-8 | 786 | 2.875 | 3 | [
"BSD-3-Clause"
] | permissive | CREATE TABLE types
(
short_col SHORT DEFAULT 1,
int_col INTEGER DEFAULT 2,
bigint_col BIGINT DEFAULT 3,
numeric_col NUMERIC(10,5) DEFAULT 123.45,
float_col FLOAT DEFAULT 6.2,
double_col DOUBLE DEFAULT 5.74,
MONETARY_col MONETARY DEFAULT 3.402823466E+38,
date_col DATE DEFAULT '2012-01-01',
time_col TIME DEF... | true |
dfa495f9aaf6a5be8f4bc3b96db655f02f5ebca3 | SQL | radtek/abs3 | /sql/mmfo/bars/Table/PRVN_DEL_MAX.sql | UTF-8 | 1,610 | 3.125 | 3 | [] | no_license | PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Table/PRVN_DEL_MAX.sql =========*** Run *** ======
PROMPT =====================================================================================
exec bars.bpa.alter_policy_i... | true |
5a8cec32e0b6cb090ee56c63994804e1b4437c6b | SQL | hofmannedv/wazimap-za | /sql/energyorfuelforlighting.sql | UTF-8 | 1,247,189 | 2.859375 | 3 | [
"MIT"
] | permissive | --
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.2
-- Dumped by pg_dump version 9.6.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = publi... | true |
00a2acd2dc1d62b7acd5060a3f18abb35c2708bf | SQL | edsonfervo16mx/MySQL-Procedures-and-testing | /Procedures/InsertarEmpleado.sql | UTF-8 | 1,014 | 3.234375 | 3 | [] | no_license | CREATE PROCEDURE `InsertarEmpleado` (
in Nombre varchar(140),
in ApellidoPaterno varchar(140),
in ApellidoMaterno varchar(140),
in FechaNacimiento date,
in Departamento varchar(100)
)
BEGIN
insert into empleado(nombre,apellido_paterno,apellido_materno,fecha_nacimiento,departamento) values (Nombre,A... | true |
00de33c42c8f2edf600fb902a6da0731e035ce73 | SQL | qwat/qwat-data-model | /ordinary_data/installation/od_installation_pressurecontrol.sql | UTF-8 | 661 | 3.15625 | 3 | [] | no_license | /*
qWat - QGIS Water Module
SQL file :: installation pressure control
*/
/* CREATE TABLE */
CREATE TABLE qwat_od.pressurecontrol ();
/* specific to pressurecontrol */
ALTER TABLE qwat_od.pressurecontrol ADD COLUMN id integer NOT NULL REFERENCES qwat_od.installation(id) PRIMARY KEY ;
ALTER TABLE qwat_od.pressurecon... | true |
7287146284bd41da19beb58c0bca552e03a04241 | SQL | rposhala/Data-Models-n-Query-Languages | /textbook/quiz/q13.sql | UTF-8 | 742 | 4.0625 | 4 | [] | no_license |
WITH RECURSIVE promotion_paths AS (
WITH direct_promotion AS (
SELECT a.title AS src , b.title AS dst
FROM
titles a, titles b
WHERE a.from_date < b.from_date AND a.to_date = b.from_date AND a.emp_no = b.emp_no
GROUP BY a.title , b.title
)
SELECT * FROM direct_promotion
UNION DISTINCT
SELECT promotio... | true |
6bab8c7078879613485a890eafedbcfbd66bec44 | SQL | MrArturtleNSCDS/Adam | /selleryshower.sql | UTF-8 | 2,592 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 09, 2020 at 04:49 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
5a3d16b740d50981784ee4a843ed4278d17de6ae | SQL | zsxdmsr115/jiangbin | /JavaWEB/BBS/Cteacher-S2-PJB-bbs/build/classes/首页.sql | GB18030 | 3,050 | 3.90625 | 4 | [] | no_license | INSERT INTO tbl_topic(title,content,publishtime,modifytime,uid,boardid)
VALUES('java good','ܺ',NOW(),NOW(),3,8);
INSERT INTO tbl_topic(title,content,publishtime,modifytime,uid,boardid)
VALUES('java very good','dz',NOW(),NOW(),3,8);
INSERT INTO tbl_reply (title,content,publishtime,modifytime,uid,topicid)
VALUE... | true |
1b559238210d039c33bd7495dfa0f1d82f774dd7 | SQL | pkriger/sql-challenge | /EmployeeSQL/create_tables.sql | UTF-8 | 1,270 | 3.921875 | 4 | [] | no_license |
CREATE TABLE public.titles
(
title_id varchar(10),
title varchar(50),
PRIMARY KEY (title_id)
);
CREATE TABLE public.departments
(
dept_no varchar(5) NOT NULL,
dept_name varchar(50) NOT NULL,
PRIMARY KEY (dept_no)
);
CREATE TABLE public.employees
(
emp_no integer NOT NULL,
emp_title_id... | true |
2d46ffab1b88c9d23f78e2664fba830d06198f77 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day23/select1141.sql | UTF-8 | 178 | 2.671875 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-22T11:41:00Z' AND timestamp<'2017-11-23T11:41:00Z' AND temperature>=41 AND temperature<=83
| true |
be8ff31e5bb1dc9d433ef81e8c3b3372bfa96dd7 | SQL | ulosturedge/Filelog | /assets/judicial_ci _final.sql | UTF-8 | 27,899 | 2.796875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 03, 2017 at 03:54 AM
-- Server version: 5.7.17-log
-- PHP Version: 7.1.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
d41df4f18c28a4963967ee8542d63f949a7e96c1 | SQL | asqwasqw12/vehicleCenter_back | /vehicleCenter3/src/main/resources/vehicle_center.sql | UTF-8 | 47,890 | 3.375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50720
Source Host : localhost:3306
Source Database : vehicle_center
Target Server Type : MYSQL
Target Server Version : 50720
File Encoding : 65001
Date: 2019-01-22 14:49:38
*/
SET FOREIGN_KEY_CHECKS=0... | true |
26da2b4b1ef63ed150efcad312bba8c5d5400121 | SQL | KwakYeongCheol/bit-jx359-2 | /blog/src/main/resources/sql/schema-notification.sql | UTF-8 | 940 | 2.796875 | 3 | [] | no_license | CREATE TABLE notification (
id bigint NOT NULL,
blogId VARCHAR(50) NOT NULL,
contents VARCHAR(1024) NOT NULL,
dateCreated timestamp NOT NULL,
isPublic CHAR(5) NOT NULL,
PRIMARY KEY(id)
);
INSERT INTO notification (id, blogId, contents, dateCreated, isPublic)
VALUES(1, '1', '공개 알림 샘플 ######', now(), 'true')... | true |
d605a59951f1bd48797847068f8c186f9e389d32 | SQL | PratikMahobiya/PVT_data | /3RI_SQL_Scripts/foreign_key.~sql | UTF-8 | 1,204 | 3.328125 | 3 | [] | no_license | insert into customer(c_id,c_name,mobile)
values(106,'sham',7999456987);
select * from customer;
commit;
rollback;
create table product(p_id number(3) primary key,
p_name varchar2(10) not null,
p_cost number(6),
c_id number(3) references customer(c_id));
... | true |
587d5b37f43fc212d270653a9e7c5d4003aae93d | SQL | OlliPerikanta/PHP-oppimistehtava | /a1500916.sql | UTF-8 | 1,861 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 16.12.2018 klo 19:09
-- Palvelimen versio: 10.1.36-MariaDB
-- PHP Version: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
ec23931e962c4232ff9cdddda80ee17f518da452 | SQL | lesnikovskiy/documentmanager | /database.sql | UTF-8 | 325 | 2.53125 | 3 | [] | no_license | use `test`;
CREATE TABLE `documents` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`description` text NOT NULL,
`filename` varchar(200) NOT NULL,
`content` mediumblob NOT NULL,
`content_type` varchar(255) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id... | true |
aa329dc52d7cef6902be264a3c9e025dc1dd918d | SQL | indratbg/code | /SPR_LOAN_ASSET_STOCK.sql | UTF-8 | 13,251 | 3.1875 | 3 | [] | no_license | create or replace PROCEDURE SPR_LOAN_ASSET_STOCK(
P_BAL_DATE DATE,
P_TRX_DATE DATE,
P_PRICE_DATE DATE,
P_BGN_MARGIN VARCHAR2,
P_END_MARGIN VARCHAR2,
P_BGN_CLIENT VARCHAR2,
P_END_CLIENT VARCHAR2,
P_BGN_BRANCH VARCHAR2,
P_END_BRANCH VARCHAR2,
P_BGN_RE... | true |
9795266ccf9fdc3edd49ef20c902d9e5990be1d0 | SQL | Steelnox/UD14_DDL_Team6 | /T14_Ej5.sql | UTF-8 | 267 | 2.8125 | 3 | [] | no_license | use T14_Ej5;
CREATE TABLE Almacenes(
codigo int IDENTITY (1,1) PRIMARY KEY,
lugar varchar(100),
capacidad int
)
CREATE TABLE Cajas(
numReferencia char(5) PRIMARY KEY,
contenido varchar(100) NOT NULL,
valor int,
almacen int FOREIGN KEY REFERENCES Almacenes(codigo)
) | true |
b9f142eda797ba4c014012433d09855d506d31aa | SQL | mdpangilinan/cmsc191data | /012500-025000.sql | UTF-8 | 2,572,253 | 2.59375 | 3 | [] | no_license | /* 012501-025000 Raymond */
INSERT INTO customer(customerid,fname,lname,email,gender,country) VALUES
(12501,'Fair','Mullany','fmullany0@go.com','Male','Sweden'),
(12502,'Eward','Kelso','ekelso1@tuttocitta.it','Male','China'),
(12503,'Marice','Woolpert','mwoolpert2@disqus.com','Female','Bulgaria'),
(12504,'Lu','Cornil... | true |
690a45a55597915920f548fd8195a615e1d979bd | SQL | GauthamPR/Database-Lab | /Exp_5/b.sql | UTF-8 | 552 | 3.578125 | 4 | [] | no_license | set verify off;
set serveroutput on;
SELECT * FROM employee;
DECLARE
p_id employee.id%type;
p_salary employee.salary%type;
PROCEDURE incr IS
BEGIN
SELECT id, salary INTO p_id, p_salary FROM employee WHERE salary > 10000;
UPDATE employee
SET salary = salary + ((salary/100)*6)
WHERE... | true |
75cb3fabd7e09aa851e07ffa2788fd4b2ba7648e | SQL | zhchzh10000/Crowd | /xionghao/test.sql | UTF-8 | 39,774 | 3.21875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : win
Source Server Version : 50639
Source Host : localhost:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50639
File Encoding : 65001
Date: 2018-05-11 19:28:15
*/
SET FOREIGN_KEY_CHECKS=0;... | true |
ff6fac0385a795d7349bd42068272d4c959de891 | SQL | mmurdock95/csc365-Database-Systems | /Lab4/STUDENTS-info.sql | UTF-8 | 705 | 3.890625 | 4 | [] | no_license | USE students;
SELECT FirstName, LastName FROM list
WHERE classroom = 111
ORDER BY LastName;
SELECT DISTINCT grade, classroom FROM list
ORDER BY classroom DESC;
SELECT DISTINCT t.First, t.Last, t.classroom FROM teachers t
INNER JOIN list ON t.classroom = list.classroom
WHERE list.grade = 5
ORDER BY... | true |
c26729192f204af22007698116ebbc3e10d3ae64 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day22/select2330.sql | UTF-8 | 265 | 2.875 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='WiFiAP' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['1403','4206','5069','6084','5100_10','4221','6036','3011','5059','4019'])
| true |
aa3a8954635fffc5269206dff388fc1df4a67be0 | SQL | wdaweb/resume-teagle8614 | /db/resume_jobcondition.sql | UTF-8 | 2,064 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- 主機: 127.0.0.1
-- 產生時間: 2020-07-08 18:37:51
-- 伺服器版本: 10.4.11-MariaDB
-- PHP 版本: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTE... | true |
5bcb061bec4f4dc2c5ea3158d492dd734be0d60e | SQL | amanlakra97/RESULT-MANAGEMENT | /result/report.sql | UTF-8 | 21,325 | 2.8125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 22, 2021 at 01:14 PM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
456f72c309a26982a1563db1ce8419d3820b9ff7 | SQL | ReneRaube/dataV2-labs | /module-1/MySQL-Select/mysql select.sql | UTF-8 | 1,460 | 4.09375 | 4 | [] | no_license | SELECT*
FROM publishers;
SELECT*
FROM authors;
SELECT*
FROM titles;
select * from publications.titles limit 3;
select * from publications.publishers limit 3;
/*question1*/
SELECT authors.au_id, authors.au_lname, authors.au_fname, titles.title, publishers.pub_name
FROM authors
INNER JOIN titleauthor
ON titleauthor.a... | true |
a23d7223d66f86f265eee27d95b60c671207b5a7 | SQL | mason00/ElasticGrid | /SQL/Q10_2.sql | UTF-8 | 140 | 3.28125 | 3 | [] | no_license | select name
from (select salesperson.name, rank() over (order by salesperson.salary desc) as r
from salesperson) as temp
where temp.r = 3 | true |
bd134b9ae3a55924611370ffbfe453504e6cf688 | SQL | EBS-IT-GIT/REPOSITORIO_MYDASHBOARD | /public/DF_ARTICULO_CORREGIR.sql | UTF-8 | 8,641 | 3.421875 | 3 | [] | no_license | select a.carta_porte_id+9000000,a.* from apps.xx_tcg_asocia_pedido_venta a where a.carta_porte_id in (
438853)
-- DF
-- CAMBIA EL NRO DE ID
update apps.xx_tcg_asocia_pedido_venta set carta_porte_id = carta_porte_id+9000000 where carta_porte_id = 438853
--9438853
UPDATE xx_po_asocia_remitos xpar
SET clave_nro = '... | true |
9f4925b1590f2818f515cad642e35691b5253299 | SQL | TRINHThaiSon/TRINHThaiSon | /BDD/SQL/EVALUATION BDD/exo1.sql | UTF-8 | 1,231 | 3.625 | 4 | [] | no_license | DROP DATABASE IF EXISTS exo1;
CREATE DATABASE exo1;
USE exo1;
CREATE TABLE Client(
cli_num Int NOT NULL ,
cli_nom Varchar (50) NOT NULL ,
cli_adresse Varchar (50),
cli_tel Varchar (30),
CONSTRAINT Client_PK PRIMARY KEY (cli_num)
);
CREATE TABLE Commande (
com_nu... | true |
b59559308bdd12ad98e7486950f8e92c04e12b1f | SQL | yunzhiclub/yunzhicms | /sql/yunzhi_content.sql | UTF-8 | 1,843 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : 本地
Source Server Version : 50505
Source Host : localhost:3306
Source Database : yunzhicms
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2016-09-30 11:20:58
*/
SET FOREIGN_KEY_CHECKS=0;
-- ------... | true |
55a07c9279c0c144934a9a07036b0d21cfed7676 | SQL | joyjas77/Teaching-Web-Building | /IST251/U9L7/baseball.sql | UTF-8 | 2,794 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.5
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Feb 27, 2014 at 03:35 PM
-- Server version: 5.5.27
-- PHP Version: 5.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... | true |
455131f526626675f95a3cdc9c22bcf23c40278a | SQL | Vasilesk/quotes-posting | /extra/db.sql | UTF-8 | 665 | 3.65625 | 4 | [
"MIT"
] | permissive | CREATE TABLE authors (
id serial PRIMARY KEY,
value text NOT NULL
);
CREATE TABLE sources (
id serial PRIMARY KEY,
value text NOT NULL
);
CREATE TABLE quotes (
id serial PRIMARY KEY,
author_id integer REFERENCES authors (id) ON DELETE CASCADE,
source_id integer REFERENCES sources (id) ON D... | true |
e9bcb527d3b7cfd31f4fdb270062e85f8a4b7587 | SQL | cckmit/emswz | /万州查询.sql | GB18030 | 65,281 | 3.765625 | 4 | [] | no_license | -- ͳ
select distinct et.NameM ¼ ,pc.,pc.,t.¼, ,a. into #dis
from AuSp120.tb_AcceptDescriptV a
left outer join AuSp120.tb_TaskV t on a.¼=t.¼ and a.=t.
left outer join AuSp120.tb_EventV e on t.¼=e.¼
left outer join AuSp120.tb_PatientCase pc on pc.=t. and pc.=t.
left outer join AuSp120.tb_DEventType et on et.... | true |
c9d9b66537bb82aa05a70de4622e54dbf6afe44b | SQL | danielchungara1/dch | /script-procedures.sql | UTF-8 | 718 | 3 | 3 | [
"MIT"
] | permissive | /**************************************************
***************Stored Procedures*******************
***************************************************/
delimiter $$
DROP procedure IF exists SP_EliminarProducto;
CREATE PROCEDURE `SP_EliminarProducto`(id_producto int)
BEGIN
/*Eliminar Fotos Caracteristicas Public... | true |
32a932d08bf057830d2ac92b6e0a9bdc83738538 | SQL | rayailieva/Database-Basics---MySQL | /08.Exams/25Feb2018/p16.FilterExtensions.sql | UTF-8 | 281 | 3.140625 | 3 | [] | no_license | DELIMITER $$
CREATE PROCEDURE udp_findbyextension(extension VARCHAR(20))
BEGIN
SELECT f.id,
f.name AS 'caption',
CONCAT(f.size, 'KB') AS 'user'
FROM files AS f
WHERE f.name LIKE (CONCAT('%',extension))
ORDER BY f.id;
END $$
CALL udp_findbyextension('html'); | true |
06348f8d98a647a4a02191728b6b145ebe5106fe | SQL | AjinkyaBangale2/Leetcode-SQL-Solutions | /1077 Project Employees III.sql | UTF-8 | 937 | 4.5 | 4 | [
"MIT"
] | permissive | # https://leetcode.com/problems/project-employees-iii/
-- join project + employee
-- get max exp_years of every project_id
-- filter 1 based on 2
WITH CTE AS (SELECT
p.project_id,
e.employee_id,
e.experience_years
FROM Project p LEFT JOIN Employee e US... | true |
07df8066d71979b5c9edb3a79f6815fe76119e2b | SQL | yanhengxu98/CSC3170Project | /Project.sql | UTF-8 | 13,245 | 3.53125 | 4 | [] | no_license | drop database LGUAirline;
CREATE DATABASE LGUAirline;
USE LGUAirline;
CREATE TABLE PLANEMODEL
( ModelID VARCHAR(7) NOT NULL,
MaxCapacity Integer NOT NULL,
MaxMileage Integer NOT NULL,
MinAirLevel CHAR(2) NOT NULL,
PRIMARY KEY(ModelID)
);
CREATE TABLE AIRPORT
( FCCCode CHAR(3) NOT NULL,
AirLevel CHAR(2) NOT N... | true |
f0c7591c101b43366a6c6737eedc4a482c961078 | SQL | dongshaohui/ansible_pre_script | /playbooks/config/midas/sql/MySQL-1_57__add_investment_request_vouchers.sql | UTF-8 | 350 | 3.25 | 3 | [] | no_license | CREATE TABLE INV_REQ_VOUCHERS (
ID BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
INV_REQ_ID BIGINT NOT NULL,
VOUCHER_ID BIGINT NOT NULL,
FOREIGN KEY (INV_REQ_ID) REFERENCES INVESTMENT_REQUESTS (ID)
ON UPDATE CASCADE
ON DELETE RESTRICT,
FOREIGN KEY (VOUCHER_ID) REFERENCES VOUCHERS (ID)
ON UPDATE CAS... | true |
73d3129e2091228977d52b7ec344c62984aa1b4e | SQL | alexurumov/MySql | /Lecture5/3.sql | UTF-8 | 212 | 3.421875 | 3 | [] | no_license | SELECT
starting_point AS 'route_starting_point',
end_point AS 'route_ending_point',
leader_id,
concat(first_name, ' ', last_name) AS 'leader_name'
FROM routes AS r
JOIN campers AS c
ON r.leader_id = c.id; | true |
d0b9fe24f64313bd9020e895b912b5e83dc65174 | SQL | GeorgeNikou/mySQL_workspace | /Module 2/Labs/Lab 2/extras/practice-PrepState.sql | UTF-8 | 3,154 | 4.03125 | 4 | [] | no_license | SET @price = 7;
SET @catDog = 'dog';
SELECT @catDog;
SELECT @test1 := 42;
SELECT @price;
SET @columns = 'name, dob, current_name';
SELECT @columns
FROM animal a
JOIN species s
ON a.species_id = s.id
WHERE s.current_name = @catDog AND a.id = @price;
PREPARE quickName
FROM 'SELECT name, dob FROM animal';
EXECUTE ... | true |
d63ea23e89136f0a0f0baf5a88f57cfdd670f8b5 | SQL | gladiopeace/digital-data-syn | /documents/oms/TB_PMTID.sql | GB18030 | 1,807 | 3.296875 | 3 | [] | no_license | /*
================================================================================
ṹ:TB_PMTID
ṹ:ȯ
ṹĿ:
================================================================================
*/
drop sequence SEQ_TB_PMTID;
drop index AK_TB_PMTID;
drop table TB_PMTID;
create table TB_PMTID (
PMTID_ID INTEGER ... | true |
e6575a0545776b25beda621b89c48f3a4b1cac01 | SQL | oneeyedjames/gnosis | /src/assets/sql/rel.user_exercise.sql | UTF-8 | 262 | 2.921875 | 3 | [] | no_license | ALTER TABLE `user_exercise`
ADD CONSTRAINT `ue_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `ue_exercise` FOREIGN KEY (`exercise_id`) REFERENCES `exercise` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
| true |
1d901cd1ed0070e4641225839718c06fa1f33a7f | SQL | salescube/SalesCube | /WEB/SalesCube/src/main/java/jp/co/arkinfosys/entity/sql/sales/CountQuantityByProductCodeAndSalesDate.sql | UTF-8 | 410 | 3.890625 | 4 | [] | no_license | SELECT
SUM(LINE.QUANTITY) AS QUANTITY
FROM
SALES_SLIP_TRN_/*$domainId*/ SLIP
INNER JOIN SALES_LINE_TRN_/*$domainId*/ LINE ON SLIP.SALES_SLIP_ID = LINE.SALES_SLIP_ID
/*BEGIN*/
WHERE
/*IF productCode != null */
AND LINE.PRODUCT_CODE = /*productCode*/''
/*END*/
/*IF salesDate != null */
AND SLIP.SALES_D... | true |
5bb73dcb77280a3a6984861ac424179879630c6e | SQL | Thiagoaraujo4/ProjetoLoja | /db/consultas.dbloja.sql | UTF-8 | 3,534 | 3.828125 | 4 | [] | no_license | use dbloja;
select * from usuario;
insert into usuario(nomeusuario, senha, foto)
values( 'admin',md5('123'), 'imgusuario/admin.png');
select * from contato;
insert into contato(telefone, email)
values ('11-95424-4657', 'admin@admin.com.br');
select * from endereco;
insert into endereco(logradoura, numero, comple... | true |
eacee3a75d235b85e3e39c575d04e584be9c6097 | SQL | haraldvt/hahoau | /flaskr/schema.sql | UTF-8 | 791 | 3.46875 | 3 | [] | no_license | DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS schedule;
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE post (
id INTEGER PRIMARY KEY AUTOINCREMENT,
author_id INTEGER NOT NULL,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIME... | true |
21ce0bb188273b9c0380640ff25c1075b6c89e6c | SQL | dataaivu/Bootcamp_Lab_Solutions | /week3/LabSQLmultjoin.sql | UTF-8 | 1,992 | 4.34375 | 4 | [
"CC0-1.0"
] | permissive | USE sakila;
#Write a query to display for each store its store ID, city, and country.
SELECT s.store_id, a.address, c.city, co.country FROM store s
LEFT JOIN address a
ON s.address_id = a.address_id
LEFT JOIN city c
ON a.city_id = c.city_id
LEFT JOIN country co
ON c.country_id = co.country_id;
#Write a query to di... | true |
c217e4088a5db6c7748ced5193e34c03e2ffda79 | SQL | raihanul-2k15/SalesDBProject | /09. run sql queries.sql | UTF-8 | 776 | 4.21875 | 4 | [] | no_license | -- List all customer and their account balance
select c.name, a.accountno, a.balance
from customer c
join account a
on c.customerid = a.ownerid;
-- Find all servers Lee is/was using
select serverid, os, ram, storage
from server
where serverid in (
select serverid
from is_using
where customerid in (
select custome... | true |
91606289ac3a8d414bdb3518cc3fa11ebbdb0f64 | SQL | WildRom/trader | /sql/trader0.sql | UTF-8 | 3,620 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Aug 02, 2020 at 09:17 AM
-- Server version: 5.7.31-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
f3f1f835f3809e9837bd76c9902e8ceb652a86ea | SQL | JoeIXX/php2 | /mydb.sql | UTF-8 | 4,717 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- 主機: 127.0.0.1
-- 產生時間: 2020-11-20 08:47:26
-- 伺服器版本: 10.4.13-MariaDB
-- PHP 版本: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... | true |
34d4a0d943dc090766dd7759e294b45e3882656b | SQL | yefc/CBOE | /subprojects/Database/Registration/Oracle_Install_Scripts/sql/Patches/Patch 12.5.2/PickListDomainFeature.sql | UTF-8 | 3,365 | 3.578125 | 4 | [] | no_license | -- Add columns to tables:
/* Add a new column LOCKED,ACTIVE,SORTORDER to PICKLISTDOMAIN,PICKLIST*/
alter table &&schemaName..PICKLISTDOMAIN add("LOCKED" NCHAR(1) DEFAULT 'F' );
alter table &&schemaName..PICKLISTDOMAIN add("EXT_SQL_SORTORDER" VARCHAR2(200));
alter table &&schemaName..PICKLIST add(ACTIVE NCHAR(1) DEFAU... | true |
ab41d5836da7c5378c13613b4aedb6238c22f704 | SQL | balanbogdan94/LicentaTest | /mssql-persistence/src/main/db/SearchByFirstName.sql | UTF-8 | 281 | 3.234375 | 3 | [] | no_license | alter procedure SearchByFirstName
(
@FirstName varchar(25)
)
as
begin
select p.FirstName, p.LastName, p.DateOfBirth, pac.BloodType, pac.RH
from dbo.Pacient pac
inner join dbo.Person p on pac.PersonID=p.ObjectID
where p.FirstName=@FirstName
end
exec SearchByFirstName Marius | true |
cd46e4e6bd70e36deab3f2d3b3c3d70c1547e027 | SQL | myui/gridool | /gridool/src/examples/psql/tpch/03map.sql | UTF-8 | 531 | 3.59375 | 4 | [] | no_license | select
l_orderkey,
sum(l_extendedprice * (1 - l_discount)) as C2,
o_orderdate,
o_shippriority
from
customer,
orders,
lineitem
where
(lineitem._hidden & 2) = 2 -- partition by orderkey
and (orders._hidden & 2) = 2 -- partition by orderkey
and (customer._hidden & 18) <> 0 -- partition by orderkey or custkey
a... | true |
7c44bb87f9933e0f4a3dbee7f7aa19859ed8accd | SQL | shushrutsharma/18CSC303J-DBMS | /8-Set Opeartors/code.sql | UTF-8 | 1,163 | 3.640625 | 4 | [] | no_license | create table EMP049 (Ename varchar2(20), DeptId number(2));
create table Department049 (DeptId number(2), DeptName varchar(15));
desc EMP049;
desc Department049;
EMP
INSERT INTO EMP049 VALUES ('Baby Yoda', 01);
INSERT INTO EMP049 VALUES ('Din Djarin', 21);
INSERT INTO EMP049 VALUES ('Boba Fett', 02);
INSERT INTO EMP049... | true |
35024e3baddbeaa34578665a7faea0c76b8171d3 | SQL | bossenti/ShareTool | /data/sql/get_all_shares.sql | UTF-8 | 144 | 3.203125 | 3 | [] | no_license | SELECT
share."ID",
companie.company_name
FROM
entities.shares share
JOIN
entities.companies companie on companie."ID" = share."company_ID" | true |
d6fcce39acf414c80a0a5098b5218c6c999c75df | SQL | FITCommunity/Baze-Podataka-2 | /Ispiti/2015-07-04/BP2_2015-07-04_Postavka.sql | UTF-8 | 3,327 | 3.515625 | 4 | [] | no_license | /*1.
Kreirati bazu podataka koju ćete imenovati Vašim brojem dosijea. Fajlove baze smjestiti na sljedeće lokacije:
- Data fajl -> D:\DBMS\Data
- Log fajl -> D:\DBMS\Log
*/
/*2.
U bazi podataka kreirati sljedeće tabele:
a. Klijenti
- JMBG, polje za unos 13 karaktera (obavezan unos i jedinstvena vrijednost),
- Ime, po... | true |
36c5ba4e908020c77f0afa68b6c926604c33816a | SQL | dpolirov/ingos_copy | /storage_adm/v_rep_subacc4dept.sql | UTF-8 | 842 | 3.09375 | 3 | [] | no_license | create or replace view storage_adm.v_rep_subacc4dept
(
CODE,
DEPTISN,
SUBACCISN,
SHEETTYPE,
STATCODE,
UPDATED,
UPDATEDBY,
ISN,
RPTGROUPISN,
SAGROUP,
DATEEND
)
as
(
select s.code,
s.deptisn,
s.subaccisn,
s.sheettype,
Round(s.statcode) statcode,
... | true |
a2ec294f3df137ef0b627376c0e4d356dec927a2 | SQL | RedRevenge94/szh | /szh_dbscripts/V008__addingVariety.sql | UTF-8 | 411 | 3.375 | 3 | [] | no_license | CREATE TABLE cultivation.variety(
id SERIAL PRIMARY KEY,
name VARCHAR(25),
plant INT NOT NULL
);
alter table cultivation.variety
add constraint variety_plants_fk foreign key (plant) references cultivation.plants(id);
alter table cultivation.cultivation add column variety int;
alter table cultivation.cultivation
add ... | true |
c117604cdc3aa891f63af98f117110bb15166232 | SQL | Laurigit/flAImme | /scripts/mysql/CREATE BREAKAWAY_BET.sql | UTF-8 | 214 | 2.65625 | 3 | [] | no_license | use flaimme;
#drop table BREAKAWAY_BET;
create table BREAKAWAY_BET (
TOURNAMENT_NM char(50),
TEAM_ID int,
CYCLER_ID int,
GAME_ID int,
FIRST_BET int,
SECOND_BET INT,
PRIMARY KEY (TOURNAMENT_NM, TEAM_ID, GAME_ID));
| true |
a3317e200dce3dfe6f07e708f09a2434c78008ba | SQL | zz0733/op-gbsql | /sites/V1.0.1.0979__C_fee_account_relation.sql | UTF-8 | 550 | 3.0625 | 3 | [] | no_license | -- auto gen by steffan 2018-09-13 11:21:20
CREATE TABLE if not exists "fee_account_relation" (
"id" serial NOT NULL,
"fee_schema_id" int4,
"pay_account_id" int4,
CONSTRAINT "fee_account_relation_pkey" PRIMARY KEY ("id")
)
WITH (OIDS=FALSE)
;
COMMENT ON TABLE "fee_account_relation" IS '手续费方案与账户关系表 - martin';
COMMEN... | true |
d08fdec03e2fccc30a7d768ce47cb01755522f41 | SQL | maxposher/code_backup | /DB Query/New_Buyer_deterioration_labels.sql | UTF-8 | 11,332 | 2.796875 | 3 | [] | no_license |
--Create tiers on d-day
--Buyer D1
SELECT buyer.user_id, buyer.reg_app, date(buyer_activated_at) - date(joined_at) + 1 AS buyer_d_day,
CASE WHEN (buyer.joined_at < '2014-10-01' and buyer.acq_channel not in ('rip')) THEN 'not_rip'
WHEN (buyer.acq_channel IN ('rip') OR buyer.is_referred_with_code in ... | true |
f975097a22b5cf3068322056274e4d6b507c2ec1 | SQL | JakubGiedrojc/covidsimulator | /src/main/resources/data.sql | UTF-8 | 675 | 3.03125 | 3 | [] | no_license | create table if not exists ENTRY_SIMULATION (
ID NUMBER(19,0) PRIMARY KEY,
NAME VARCHAR2(50),
P NUMBER(19,0),
I NUMBER(19,0),
R NUMBER(19,2),
M NUMBER(19,2),
TI NUMBER(19,0),
TM NUMBER(19,0),
TS NUMBER (19,0)
);
create table if not exists SIMULATION_OUTPUT (
ID NUMBER (19,0)... | true |
064f8ba8e8d2f4c1865a1c56f8cba7782d336025 | SQL | taniadruzh/teacherHelper | /src/main/resources/task2.sql | UTF-8 | 2,467 | 2.75 | 3 | [] | no_license | INSERT INTO teacher_helper.student (idstudent,name, ser_name, phone, email) VALUES (1,'bim', 'frick', '+380503456785', 'bim@mail.ru');
INSERT INTO teacher_helper.student (idstudent,name, ser_name, phone, email) VALUES (2,'doberman', 'dog', '+380503456787', 'doberman@gmail.com');
INSERT INTO teacher_helper.student (idst... | true |
7ac1827904c398aa1b92f0398f478e1b99e29e43 | SQL | jmatysczak/SqlServerPOCs | /SortingAndPagingPerformance/04 - RowCount - RowNumber.sql | UTF-8 | 411 | 2.859375 | 3 | [
"Unlicense"
] | permissive | CHECKPOINT; DBCC DROPCLEANBUFFERS; DBCC FREEPROCCACHE;
SET STATISTICS IO ON
SET STATISTICS TIME ON
SELECT *,
irn + rn - 1 TotalRows
FROM (
SELECT ROW_NUMBER() OVER (ORDER BY Title ASC) irn,
ROW_NUMBER() OVER (ORDER BY Title DESC) rn,
*
... | true |
2a1fe9b55372aa32b331a4fd55157648b8103681 | SQL | mschneid0207/spring-jdbc-jpa | /src/main/resources/data.sql | UTF-8 | 1,930 | 3.34375 | 3 | [] | no_license | /*create table person
(
id integer not null,
name varchar(255) not null,
location varchar(255),
birth_date timestamp,
primary key (id)
);*/
insert into course (id, name, updated_date, created_date)
values (1001, 'JPA in 50 steps', sysdate(), sysdate());
insert into course (id, name, updated_date, created_dat... | true |
5d2d419dab4d60aae532b4de2eb33c8be5b845c1 | SQL | ginius4ginius/Ajax | /tp/tpAJAX/tpAJAX/tableEtablissement/etablissements.sql | UTF-8 | 66,780 | 2.734375 | 3 | [] | no_license | create database bdetablissement;
use bdetablissement;
CREATE TABLE etablissement (
code varchar(5),
nom varchar(30) ,
genre varchar(20),
arrondissement varchar(2) ,
adresse varchar(50),
PRIMARY KEY (code)
) ;
insert into etablissement values('01002','ARBRE SEC','ELEMENTAIRE','01','15 RUE DE L ARBRE SEC 75001... | true |
91c08888de3df11ad3fb165c679480d01c999a7c | SQL | MauricioRobayo/SQLZOO | /8+_Numeric_examples.sql | UTF-8 | 2,545 | 4.5 | 4 | [] | no_license | -- https://sqlzoo.net/wiki/NSS_Tutorial
-- 1. Check out one row
-- Show the the percentage who STRONGLY AGREE
SELECT A_STRONGLY_AGREE
FROM nss
WHERE question='Q01'
AND institution='Edinburgh Napier University'
AND subject='(8) Computer Science';
-- 2. Calculate how many agree or strongly agree
-- Show the institu... | true |
a3aa77eb84fbd07d3559ecb2352f0a92a99f76e1 | SQL | gh6141/gsession2 | /WEB-INF/plugin/circular/sql/createtable/CIR_BIN.sql | UTF-8 | 162 | 2.6875 | 3 | [] | no_license | create table CIR_BIN
(
CIF_SID integer not null,
BIN_SID bigint not null,
primary key (CIF_SID, BIN_SID)
) ; | true |
080482e287131bfde68651ba93ab9239da6ba9dc | SQL | Ivajkin/Puls | /taxi/forum/install=/schemas/mysql_40_schema.sql | UTF-8 | 40,491 | 3.34375 | 3 | [] | no_license | #
# $Id: mysql_40_schema.sql 10462 2010-01-28 23:15:25Z bantu $
#
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (
attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
in_message t... | true |
2ea278a642fffec509619d789dbaa18b33519d10 | SQL | willco21/postgis-eva | /init/002_create_basic_table.sql | UTF-8 | 1,087 | 2.65625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS public.matter_info (
matter_id serial
);
SELECT AddGeometryColumn ('public','matter_info','origin_coordinates',2451,'POINT',3);
CREATE TABLE IF NOT EXISTS public.human_location (
human_coordinates_id serial,
trajectory_id int,
matter_id serial,
timestamp timestamp
);
SELECT AddGeometryC... | true |
55aa7c5878fad2c85f7c7a9a744db1ab2a40a775 | SQL | jwang93/hive | /application_workloads/Yujie_workload/query/query.sql | UTF-8 | 1,371 | 4.03125 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS income (
age INT,
workclass STRING,
fnlwgt INT,
education STRING,
education_num INT,
marital_status STRING,
occupation STRING,
relationship STRING,
race STRING,
sex STRING,
capital_gain INT,
capital_loss INT,
hours_per_week INT,
native_country STRING)
ROW FORMA... | true |
cbe1967a2dabb6ed40b099a6bbc7d5fcb155044b | SQL | Dumiy/Sql-Scripts | /First part.sql | UTF-8 | 1,433 | 3.765625 | 4 | [] | no_license | declare
dep_name departments.department_name%TYPE;
employ int ;
BEGIN
select department_name,count(department_name)
into dep_name,employ
from employees e, departments d
where e.department_id = d.department_id
group by department_name
having count(*) = (select max (count (*))
from ... | true |
7dd2e000bdb37c9553b707245afa9f7ae01da874 | SQL | zhackerx/WorkIndia_api_round | /test.sql | UTF-8 | 1,727 | 2.875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 21, 2020 at 08:04 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
0e4573e39f66d1cd586b577365b2e1065a5d6afe | SQL | nporter1/Team-925-ITEC-3870-Spr.-21- | /EXCEPTION TABLE Testing Script.sql | UTF-8 | 718 | 3.171875 | 3 | [] | no_license | #Simple JOIN print example between LDAP and Training
SELECT COURSE_ID, USERNAME
FROM ldap.t_temp_orait_ggc_ldap l JOIN ldap.t_temp_orait_ggc_training_export t
ON l.FIRST_NAME = t.FIRST_NAME;
#Quick TRUNCATE script to empty table
TRUNCATE exception_table;
#Insert into Exception Table example
Insert into exception_tabl... | true |
d60463c35d4e4f7ff5405663a89050412d2d20b5 | SQL | zsomborjoel/PL-SQL | /Triggers.sql | UTF-8 | 1,624 | 4.03125 | 4 | [] | no_license | --This Trigger dont let the user drop any schema.
CREATE OR REPLACE TRIGGER undroppable_schema
BEFORE DROP ON SCHEMA
BEGIN
RAISE_APPLICATION_ERROR(-20000,'You cannot drop schema in production database');
END;
--This trigger dont let the user drop, insert, or increase salary for those employees whos salary is hig... | true |
fc4f84d6952c30453c299ff2d7b0eeda0392bf02 | SQL | yefc/CBOE | /subprojects/Classic/DocManager/config/oracle_install_scripts/Scripts/indexingworkaround.sql | UTF-8 | 1,190 | 3.78125 | 4 | [] | no_license |
prompt 'Creating chemical structure index...'
DECLARE
PROCEDURE createCartridgeIndex(iName IN varchar2, tName IN varchar2, fName IN varchar2) IS
n NUMBER;
BEGIN
select count(*) into n from user_indexes where Upper(index_name) = iName AND Upper(table_owner)= '&&schemaName';
if n = 1 then
execute immedi... | true |
13607024f903bce59fb9ae884781c14cee88a5b0 | SQL | shlhs/wuxi_simufiled_docs | /sql_back/simufiled_stru.sql | UTF-8 | 2,231 | 2.703125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `simufiled` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `simufiled`;
-- MySQL dump 10.13 Distrib 5.6.19, for osx10.7 (i386)
--
-- Host: 114.215.90.83 Database: simufiled
-- ------------------------------------------------------
-- Server version 5.6.31-0ubuntu0.14.04.2
/*!40101 SET @... | true |
2e23297ae7c4e9bda58ac9f6004ed973d99b44d4 | SQL | ArneDHont/stage1 | /Code/Database/Inspect.Database/dbo/Stored Procedures/USP_WY_BBBYLREG_UPDATE.sql | UTF-8 | 298 | 2.65625 | 3 | [] | no_license |
CREATE PROC dbo.[USP_WY_BBBYLREG_UPDATE]
@ID_BYLG_REG int,
@ID_REG int=NULL,
@PLA_BYLG varchar(50)=NULL,
@Original_ID_BYLG_REG int --Primary Key Field
AS
SET NOCOUNT OFF
UPDATE [BBBYLREG] SET
[ID_REG] = @ID_REG,
[PLA_BYLG] = @PLA_BYLG
WHERE [ID_BYLG_REG] = @Original_ID_BYLG_REG
| true |
e9c1f1023f80469a55511be36db4d3ed6e83a1cd | SQL | DKarthik2222/All-code | /Quinnox/Class Codes/quinnox dbms classs codes/SQL Database for Beginners_Code/9298OS_Code/chapter6/Chapter 6/6.1/Code/groupby.sql | UTF-8 | 493 | 2.96875 | 3 | [] | no_license | select * from person
select managerid
from person
group by managerid
select count(*) from person
select managerid, count(*)
from person
group by managerid
select left(firstname,1) initial, count(*)
from person
group by initial
//doesn't work
select initial, count(*)
from person
group by left(firstname,1) initial
... | true |
90ba03c63e886078738b5095bfa371107adf7d17 | SQL | MDBValada/assignment10-bamazon | /schemabamazon.sql | UTF-8 | 1,559 | 3.1875 | 3 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE bamazon;
USE bamazon;
CREATE TABLE products(
item_id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(100) NOT NULL,
department_name VARCHAR(100) NOT NULL,
price DECIMAL(10,2) NULL,
stock_quantity INT NULL,
product_sales INT,
PRIMARY KEY (item_id)
);
INSERT INTO p... | true |
108c997baf50bd860283b722fd600089f1e918e9 | SQL | Software-Engineering-Course-Design/Online-Programming-Platform | /online-programming-platform/server/flaskr/schema.sql | UTF-8 | 1,927 | 3.6875 | 4 | [] | no_license | DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS question;
DROP TABLE IF EXISTS comment;
DROP TABLE IF EXISTS code;
DROP TABLE IF EXISTS interview;
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
usertype boolean,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE question (
ques... | true |
997b8d9a7d31b560056522af4e6087713227ac35 | SQL | ServusAndy/tutorial_db | /DB/11111.sql | UTF-8 | 400 | 4.40625 | 4 | [
"MIT"
] | permissive | SELECT t.name,t.phone,t.city,GROUP_CONCAT(t.model),GROUP_CONCAT(t.manufc_name), MAX(t.price)
FROM(SELECT cus.name,cus.phone,cus.city,c.model AS model, m.name AS manufc_name,SUM(c.price) AS price FROM customer cus
JOIN customer_cars cc ON cus.id = cc.customer_id
JOIN cars c ON cc.cars_id = c.id
JOIN manu... | true |
c0a34516acd5a4228119fffd640a20d5c9ff22e6 | SQL | AMHlocal/sql-challenge | /SQL_files/TableSchema.sql | UTF-8 | 1,276 | 3.765625 | 4 | [] | no_license | --Data Engineering
--Easier to type it all out then to use GenMyModel, also is good practice
CREATE TABLE Employees (
emp_no INTEGER NOT NULL,
emp_title_id VARCHAR(30) NOT NULL,
birth_date DATE NOT NULL,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
sex VARCHAR (10) NOT NULL,
hire_date DATE N... | true |
470e6aa1657cda84bb2c518e194a8aaa86516242 | SQL | deepakorantak/DotNet | /DAFTriggerUtility/Output/trg_tbm_apn_research.sql | UTF-8 | 15,099 | 2.640625 | 3 | [] | no_license | DELIMITER $$
Use `daf2` $$
DROP TRIGGER IF EXISTS `tbm_apn_research_RAI` $$
CREATE
TRIGGER `tbm_apn_research_RAI`
AFTER INSERT ON `tbm_apn_research`
FOR EACH ROW
BEGIN
DECLARE operation_value... | true |
b39b3aad486ce0bc807380ced06c65cff26f5116 | SQL | yuanzy97/Maui-Smart-Grid | /sql/meco_v1/tables/Reading.sql | UTF-8 | 2,628 | 3.296875 | 3 | [
"BSD-3-Clause"
] | permissive | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: Readin... | true |
c40129df92ac893e7cdaf49063b28dc9655490bd | SQL | Civil-Service-Human-Resources/civil-servant-registry-service | /src/main/resources/db/migration/mysql/V1.13__agency.sql | UTF-8 | 1,374 | 3.578125 | 4 | [
"MIT",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | CREATE TABLE IF NOT EXISTS `agency_domain`
(
`id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
`domain` VARCHAR(150) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
CREATE TABLE IF NOT EXISTS `agency_token`
(
`id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
`tok... | true |
63447d26f612e81dcdb6347b887a0c19578f4509 | SQL | AES0P/SSM_SimpleDemo | /src/main/SQL/ssm_user.sql | UTF-8 | 992 | 3.015625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 80018
Source Host : localhost:3306
Source Database : ssm
Target Server Type : MYSQL
Target Server Version : 80018
File Encoding : 65001
Date: 2019-11-22 13:14:25
*/
SET FOREIGN_KEY_CHECKS=0;
-- -----... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.