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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1c5f36259dbbce6ae667158c911e94690500bccb | SQL | nabilhayet/sql-crowdfunding-lab-onl01-seng-pt-032320 | /lib/create.sql | UTF-8 | 387 | 2.71875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | create table projects (id INTEGER PRIMARY KEY,
title TEXT, category TEXT, funding_goal INTEGER,
start_date date, end_date date);
create table users (id INTEGER PRIMARY KEY,
name TEXT, age INTEGER);
create table pledges (id INTEGER PRIMARY KEY, amount IN... | true |
72f9c6c2e04931e6790334718c48e06db241772a | SQL | RScicomp/Library-Loans-Database | /q12.sql | UTF-8 | 162 | 3.390625 | 3 | [] | no_license | SELECT count(memberloans) as nummembers
FROM (SELECT DISTINCT member.mid FROM member INNER JOIN loan ON member.mid = loan.mid AND loan.fine > 0) as memberloans;
| true |
40f1f0f920dd63ff2af2c56273caef12dba50046 | SQL | amirul1000/drag-drop-multiple-picture-upload-in-dropzone | /dropzone.sql | UTF-8 | 40,957 | 2.71875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 28, 2020 at 10:19 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.5.37
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
13de7f128c8b12abaab4c7be91a9a0027100beca | SQL | xenogenesis45/app_tareas | /db_tareas.sql | UTF-8 | 4,141 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 15-02-2021 a las 15:04:23
-- Versión del servidor: 10.4.17-MariaDB
-- Versión de PHP: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
d947d0c3838d40ccccffb0ef6c015a8c1b06fccd | SQL | redtreex/driveQ | /ridetable.sql | UTF-8 | 85,928 | 2.765625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 04, 2021 at 06:35 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
99af8d445f7bb5a0dad4ef62e6310372b3d2f874 | SQL | ssnarkar/SQL | /HackerRank/Weather_Observation_Station_21.sql | UTF-8 | 203 | 3.375 | 3 | [] | no_license | Q Query the smallest Northern Latitude (LAT_N) from STATION that is greater than . Round your answer to decimal places.
Ans mysql
select round(min(lat_n),4) from station
where lat_n > 38.7780
| true |
0cc35ed5180f83021214bd305b4e2681ee655b85 | SQL | RaihanBagasNugraha/SI-Kepegawaian | /kepegawaian.sql | UTF-8 | 5,266 | 2.78125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 13, 2018 at 03:23 PM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.1.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
b2787917f12743fb3300140a3a09091739a2c3f9 | SQL | borisbotev/SoftUni | /Databases Basics/05.TableRelations/05.OnlineStore.sql | UTF-8 | 1,496 | 4.09375 | 4 | [
"MIT"
] | permissive | CREATE TABLE Orders (
OrderID INT IDENTITY,
CustomerID INT NOT NULL
)
CREATE TABLE Customers (
CustomerID INT IDENTITY,
Name VARCHAR(50) NOT NULL,
Birthday DATE NOT NULL,
CityID INT NOT NULL
)
CREATE TABLE Cities (
CityID INT IDENTITY,
Name VARCHAR(50) NOT NULL
)
CREATE TABLE OrderItems (
OrderID INT NOT NU... | true |
dc7bd671c7a39b8e2bca52b053a7f6154a95b4ec | SQL | Ana-Carolline/Bloco-II | /SQL/Exercicio1.sql.sql | UTF-8 | 912 | 3.328125 | 3 | [] | no_license | create database db_recursosHumanos;
use db_recursosHumanos;
create table tb_funcionaries(
id bigint auto_increment,
nome varchar (30) not null,
cargo varchar (30) not null,
salario decimal (10,2),
primary key (id)
);
insert into tb_funcionaries (nome, cargo, salario) values ("Guilherme Bueno", "Op... | true |
9cad8a371d49eabd8fca26673308ab409dbbe988 | SQL | ZJayes/employee-tracker | /seed.sql | UTF-8 | 860 | 3.734375 | 4 | [] | no_license | DROP DATABASE IF EXISTS employeetracker_DB;
CREATE DATABASE employeetracker_DB;
USE employeetracker_DB;
CREATE TABLE department(
id INT (100) NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NOT NULL,
PRIMARY KEY(id)
);
CREATE TABLE role (
id INT (100) NOT NULL AUTO_INCREMENT,
title VARCHAR(30) NOT NUL... | true |
38131bd6672f3ce6aaeb402e09fdbc00852d6225 | SQL | HoangNhatVo/Clever | /database_scripts/dumps/mod_20191127.sql | UTF-8 | 538 | 3.578125 | 4 | [] | no_license | DELIMITER $$
USE `clever`$$
DROP PROCEDURE IF EXISTS `GetActiveCourseList`$$
CREATE PROCEDURE GetActiveCourseList(in pageNth int)
BEGIN
declare o int default 0;
set o = 12*(pageNth-1);
if (pageNth < 1) then set pageNth = 1; end if;
select * from courses join accounts join co_ac join subjects where courses_sta... | true |
b6cbc10f73f018b46e4182023f30c911ebaedd28 | SQL | lychristy/SQL | /PostgreSQL/Find the total revenue of each facility.sql | UTF-8 | 469 | 4.03125 | 4 | [] | no_license | --Produce a list of facilities along with their total revenue. The output table should consist of facility name and revenue, sorted by revenue. Remember that there's a different cost for guests and members!
SELECT name,
sum(slots * CASE
WHEN memid = 0 THEN guestcost
... | true |
ab1b23401ec7e218feede4cbccd88ab25d284a54 | SQL | Hunter275/Ghost-Plugin-Repo | /ghost_2014-06-20.sql | UTF-8 | 2,351 | 3.09375 | 3 | [] | no_license | # ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 192.168.1.94 (MySQL 5.5.37-0ubuntu0.14.04.1)
# Database: ghost
# Generation Time: 2014-06-21 03:40:05 +0000
# *******************************... | true |
adf2a1d1299e17bfd4713616bfc407d9ebeef569 | SQL | timsengit/php | /jinling/db/createNews.sql | UTF-8 | 286 | 2.84375 | 3 | [] | no_license | use jinlingdb;
#新闻
CREATE table if not EXISTS news(
id int auto_increment PRIMARY KEY comment '主键',
name VARCHAR(10) not NULL comment '新闻标题',
news text comment '新闻内容',
adder VARCHAR (10) ,
addTime INT comment '添加时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| true |
08455cf16f0bdd441fa3dbfa5bdc8899c596708e | SQL | gong782008371/Acmore_OJ | /mysql/test_without_data.sql | UTF-8 | 6,012 | 2.96875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.5.44, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 5.5.44-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHAR... | true |
608d688ac13cf06f88f882577be893b06991f29a | SQL | federdjpg/conList | /base/ConList.sql | UTF-8 | 1,593 | 3.28125 | 3 | [] | no_license |
CREATE TABLE cursos(
idCurso INT(10) PRIMARY KEY,
Nombre VARCHAR(100),
Duracion VARCHAR(100),
Precio FLOAT(10,2),
Vacantes INT(10),
Disponibilidad VARCHAR(50),
Fecha_inicio DATE,
Fecha_final DATE
);
CREATE TABLE gastos(
idGastos int(10) PRIMARY KEY,
idCurso INT(10),
Insumo ... | true |
e2282ea4186e6831b57f6f426964d4dba7e8dec0 | SQL | realtymaps/map | /migrations/old/main/2016-10-19__mls_agent_stuff.sql | UTF-8 | 5,049 | 3.046875 | 3 | [] | no_license |
-- change the mls listings task config
UPDATE jq_task_config
SET name = '<mlsid>'
WHERE name = '<default_mls_config>';
UPDATE jq_task_config
SET
name = name||'_listing',
blocked_by_tasks = ('["'||name||'_photo","'||name||'_agent"]')::JSONB
WHERE description = 'Refresh mls data';
-- change the mls photos task c... | true |
8c8e7f0fcd75ff70b3c8259396975b66967f5ffa | SQL | kr1tz/JavaHospitalManagement | /hms_db.sql | UTF-8 | 1,537 | 3.140625 | 3 | [] | no_license | /*
-- Dumping data for table `doctor`
*/
DROP TABLE IF EXISTS `doctor`;
CREATE TABLE `doctor`(
`DoctorID` int(10) NOT NULL,
`FirstName` varchar(20) default null,
`LastName` varchar(20) default null,
`Gender` varchar(1) default null,
`Address` varchar(100) default null,
`Email` varchar(30) default nu... | true |
db29b09b1c27a0e30148f17b128081d5cb21fd05 | SQL | radtek/abs3 | /sql/mmfo/barsupl/Script/uploading_pathes#59/08_data_upl_file_560.sql | WINDOWS-1251 | 5,735 | 3.515625 | 4 | [] | no_license | -- ***************************************************************************
set verify off
set define on
-- sfile_id
-- ssql_id ( , )
define sfile_id = 560
define ssql_id = 560,1560
begin
dbms_output.put_line(to_char(sysdate(), 'dd.mm.yyyy hh24:mi:ss') ||': Process for upload file: &&sfile_id... | true |
0044942b5b848a7f8fb3040cafbc6fddc1a3b7d8 | SQL | komsic/HNG-stage1 | /hotels.sql | UTF-8 | 737 | 3.421875 | 3 | [] | no_license |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE DATABASE IF NOT EXISTS hotels;
USE hotels;
CREATE TABLE `hotels` (
`h_id` int(11) NOT NULL,
`h_name` varchar(255) NOT NULL,
`h_state` varchar(150) NOT NULL,
`h_stars` int(11) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1... | true |
7986a2b53d0fea5735479e8c5a82d416db87543a | SQL | theWakeningDog/mysql | /schooltask/查询2017.03.16/生成表.sql | UTF-8 | 4,594 | 3.734375 | 4 | [] | no_license | #药品
create table if not exists drug (
id varchar(128) primary key,
no varchar(20) not null comment '药品编号',
origin varchar(255) comment '产地',
unit varchar(30) comment '单位',
number int(11) comment '数量',
purchase double(10, 2) comment '进价',
retail double(10, 2) comment '零售价',
period date comment '有效期',
... | true |
5dffaac44a3356010964ca54ee2443fea1bf9c92 | SQL | iGakki/UTS-BScienceIT | /31253 Database Programming Autumn 2012/Assignment 1/DBP Ass 1 David Evans 10601514.sql | UTF-8 | 8,828 | 4.03125 | 4 | [] | no_license | /* Assignment 1 - David Evans - 10601514 - devans
Purpose: to clean the data from the helens_data table and migrate it to either
dbp_clients or dbp_client_exceptions. */
-- (STEP 1) To execute the program:
DECLARE
BEGIN
clean_helens_data;
END;
-- (STEP 2) To view all records of the new dbp_clients table (s... | true |
67771f164a679278e302592dccd55da0e86f9d33 | SQL | zoltanec/optmgn | /dcms/modules/users/sql/structure.sql | UTF-8 | 5,402 | 3.21875 | 3 | [] | no_license | DROP TABLE IF EXISTS mmg_users_pm;
CREATE TABLE mmg_users_pm ( msgid INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,/*идентификатор сообщения*/
uid_from INT UNSIGNED NOT NULL DEFAULT 0,/*идентификатор первого пользователя*/
uid_to INT UNSIGNED NOT NULL DEFAULT 0,/*иденти... | true |
1eede1575d27047a1228314bece7ef72d1db5996 | SQL | bellmit/flexdb | /1.BDSHOST/1.4.5.0/001_BDSHOST_INSERT_ALLCODE.sql | UTF-8 | 693 | 2.6875 | 3 | [] | no_license | -- SELECT * FROM ALLCODE WHERE CDNAME='CATYPE' AND CDVAL='028' and cdtype='CA';
DELETE FROM ALLCODE WHERE CDNAME='CATYPE' AND CDVAL='028';
insert into ALLCODE (CDTYPE, CDNAME, CDVAL, CDCONTENT, LSTODR, CDUSER, EN_CDCONTENT)
values ('CA', 'CATYPE', '028', 'Chi trả lợi tức chứng quyền', 28, 'Y', 'Payout of the warrant ... | true |
707d8e4979e87747a4b581716ecf711cfd5e3aef | SQL | alejojperez/final_project | /src/main/resources/database.sql | UTF-8 | 2,485 | 3.078125 | 3 | [] | no_license | # ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.12)
# Database: library_project
# Generation Time: 2016-11-17 16:28:30 +0000
# ***************************************... | true |
e41ef2cfe4c3ddd8a5f256bfb58084e0d0107eae | SQL | renchao1110/ssm-shiromanage | /src/main/resources/sql/course.sql | UTF-8 | 1,304 | 2.890625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : test
Source Server Version : 50051
Source Host : localhost:3306
Source Database : ssmdemo
Target Server Type : MYSQL
Target Server Version : 50051
File Encoding : 65001
Date: 2017-05-16 15:53:47
*/
SET FOREIGN_KEY_CHECKS=0;
-- ------... | true |
52f104b306c4805ac61781a63d0cc8191fed3b91 | SQL | radtek/abs3 | /sql/mmfo/bars/Procedure/finmon_import_files.sql | WINDOWS-1251 | 3,729 | 3.0625 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Procedure/FINMON_IMPORT_FILES.sql =========*
PROMPT =====================================================================================
PROMPT *** Create procedure... | true |
4cb6b807dffd69716853bed0a12b3c5dd84438b1 | SQL | MaksimZavitaev/MediaProNet | /task2.sql | UTF-8 | 411 | 4.15625 | 4 | [] | no_license | SELECT
id1 AS 'FROM',
id3 AS 'TO'
FROM
(
SELECT
t1.id AS id1,
t2.id AS id2,
(
SELECT
id
FROM
test t3
WHERE
t3.id > t1.id
ORDER BY
id
LIMIT
1
) AS id3
FROM
test t1
LEFT JOIN test t2... | true |
98526256826c9473886be7e1a899247dfa2c36c9 | SQL | ekaanresangsya/antrian | /antrian.sql | UTF-8 | 15,591 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 11, 2017 at 10:50 AM
-- Server version: 5.7.20-0ubuntu0.16.04.1
-- PHP Version: 7.0.22-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
ebc998270f436a7ed5389c58bd502c4ce3b2c006 | SQL | AlexDarin/bookstore | /src/main/resources/data.sql | UTF-8 | 1,026 | 3.875 | 4 | [] | no_license | DROP TABLE IF EXISTS books;
DROP TABLE IF EXISTS authors;
DROP TABLE IF EXISTS books_authors;
DROP SEQUENCE IF EXISTS book_id_seq;
DROP SEQUENCE IF EXISTS author_id_seq;
CREATE TABLE books (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
isbn VARCHAR(255) NOT NULL
);
CREATE TABLE authors... | true |
5ea87fded363a19317a0f0941663694514f42f7b | SQL | dha01/IS | /SQL/Task_18/create Cathedra.cathedra.sql | UTF-8 | 400 | 3.734375 | 4 | [] | no_license | -- Создание схемы "Cathedra"
create schema Cathedra
-- Создание таблицы "cathedra"
create table Cathedra.cathedra
(
cathedra int identity (1,1) not null,
full_name varchar(255) not null,
short_name varchar(30) not null,
faculty int,
constraint PK__cathedra primary key (cathedra),
constraint FK__cathedra__faculty... | true |
70f4a68cd7ac11122bbf1b75707350eded6e7a71 | SQL | tylor-pelletier/database-exercises | /albums_migration.sql | UTF-8 | 366 | 2.984375 | 3 | [] | no_license | SHOW DATABASES;
USE codeup_test_db;
DROP TABLE IF EXISTS albums;
CREATE TABLE albums(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
artist VARCHAR(255) NOT NULL,
album_name VARCHAR (255) NOT NULL,
release_date INT UNSIGNED NOT NULL,
sales FLOAT NOT NULL,
genre VARCHAR (255),
PRIMARY KEY (id)
);
SHOW TABLES... | true |
983ade5a1e60904e0d3cfa93ce9a705e0e16db8c | SQL | vijaydairyf/jeff-farm | /jeff-farm-ws/src/main/sql/functions/can-delete/can_delete_farm.sql | UTF-8 | 236 | 2.96875 | 3 | [
"MIT"
] | permissive | CREATE OR REPLACE FUNCTION can_delete_farm
( IN id INT
, OUT can_delete BOOLEAN
)
AS
$body$
SELECT CASE WHEN COUNT(*) = 0 THEN TRUE ELSE FALSE END
FROM hives AS h
WHERE h.farm_id = can_delete_farm.id;
$body$
LANGUAGE SQL;
| true |
5990fbdd1cca584fe2bc09dd345b106af7856dc1 | SQL | syamhaque/Senior-Year-Work | /EECS 116/mini project/Query 7.sql | UTF-8 | 280 | 3.640625 | 4 | [] | no_license | select distinct A.name, B.name
from blurt_analysis Ab, blurt_analysis Bb, user A, user B
where Ab.email != Bb.email and Ab.email = A.email and Bb.email = B.email and Ab.topicid = Bb.topicid
and Ab.email not in (select follow.follower from follow where follow.followee = Bb.email); | true |
abd1d7332b612a57e596db8d2d1500ff119122c4 | SQL | HesamMohammadian/apex-flowsforapex | /src/views/flow_subflows_vw.sql | UTF-8 | 2,272 | 3.453125 | 3 | [
"MIT",
"LicenseRef-scancode-bpmn-io"
] | permissive | create or replace view flow_subflows_vw
as
select sbfl.sbfl_id
, sbfl.sbfl_sbfl_id
, sbfl.sbfl_prcs_id
, coalesce( prcs.prcs_name, to_char(sbfl.sbfl_prcs_id)) as sbfl_process_name -- flow instance ref
, prcs.prcs_dgrm_id as sbfl_dgrm_id
, sbfl.sbfl_dgrm_id as sbfl_sbfl_dgrm_i... | true |
9a40e04e4a1e9686110a80a0564931ee3bb6d2af | SQL | runnz121/4th-Generation-big-data-edu | /0722오후 공식과제.SQL | UTF-8 | 4,537 | 4.15625 | 4 | [] | no_license | 1]
1. 직원정보에서 부서별,채용 구분 별로 SALARY의 합계, 대상건수, 평균을 구해오는 쿼리
SELECT
SUM(SALARY) OVER (PARTITION BY DEPT_CODE,EMP_TYPE ORDER BY SALARY) SUM,
COUNT(SALARY) OVER (PARTITION BY DEPT_CODE, EMP_TYPE ORDER BY SALARY) COUNT,
AVG(SALARY) OVER (PARTITION BY DEPT_CODE,EMP_TYPE ORDER BY SALARY) AVG
FROM TEMP
;
--
S... | true |
19eff2f17189af743aaefae7a4e538d5f2486383 | SQL | KiraLSN/controle_estoque | /db.sql | UTF-8 | 2,192 | 3.046875 | 3 | [] | no_license | CREATE DATABASE `bi_server` /*!40100 DEFAULT CHARACTER SET latin1 */;
DROP TABLE IF EXISTS `bi_server`.`srs_category`;
CREATE TABLE `bi_server`.`srs_category` (
`id` int(10) unsigned NOT NULL auto_increment,
`nome` varchar(45) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT... | true |
078cdfc17564792e8e55d367f85bc539f0faf3a2 | SQL | iknowed/elect | /avalos/tools/sql/eth.sql | UTF-8 | 885 | 2.9375 | 3 | [] | no_license | create table ethnicities (
eid integer unique not null default nextval('ethnicities_eid_seq'),
ethnicity varchar(20)
);
create table eth (
voter_id integer,
affidavit char(13),
eid integer,
FOREIGN KEY (eid) REFERENCES ethnicities(eid)
);
insert into ethnicities (ethnicity) values ('Filipin... | true |
90d577f1d500486944bd7342349267f9643df2ed | SQL | k7d/codo_todo | /src/codo/model/scripts/update00.01.sql | UTF-8 | 271 | 2.875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS Action (
id INTEGER PRIMARY KEY,
ordering INTEGER,
status VARCHAR(16),
statusTimestamp DATE,
name TEXT NOT NULL,
flags TEXT
);
CREATE TABLE IF NOT EXISTS ActionFlag (
actionId INTEGER,
flag VAHRCHAR(16),
PRIMARY KEY(flag,actionId)
); | true |
0ce243504782bd837e0976cd212e1d35851c4fe7 | SQL | JoamirS/primeiros-passos-mysql | /Chapter 02/Class_010.sql | UTF-8 | 848 | 3.875 | 4 | [] | no_license | -- Quando precisamos que o resultado de nossa consulta a uma tabela seja fornecido em uma ordem específica, de acordo com um determinado critério,
-- devemos usar a cláusula ORDER BY que, como o próprio nome diz, considera uma certa ordem para retornar os dados de uma consulta.
-- A sintaxe padrão é a seguinte: SELECT... | true |
d61d16e762960480a2ceed043841425baedb59b2 | SQL | Fattouche/Oscar_ER | /helper_scripts/milestone_demo_db_generator.sql | UTF-8 | 2,185 | 3.671875 | 4 | [] | no_license | DROP SCHEMA IF EXISTS `m3demo` ;
CREATE SCHEMA IF NOT EXISTS `m3demo`;
USE `m3demo`;
CREATE TABLE `advertising_initiative` (
`project_name` varchar(20) NOT NULL,
`country` varchar(20) NOT NULL,
PRIMARY KEY (`project_name`,`country`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `assigned_computers` (
`na... | true |
fbfa4b3d4416c73ddace1f98c023439dab747786 | SQL | ssoper-usgs/schema-wqp-core | /stewards/tables/resultSum/resultSum.sql | UTF-8 | 5,912 | 2.640625 | 3 | [] | no_license | create table result_sum_swap_stewards
(data_source_id number
,data_source varchar2(8 char)
,station_id number
,site_id varchar2(4000 char)
,event_date date
,analytical_method varchar2(4000 char)
,p_code ... | true |
84261e62f03198c89dcf934c83fcac6d6035eed7 | SQL | vijaydairyf/TimelyFish | /SolomonApp/dbo/Stored Procedures/dbo.ED850SDQ_FreeFormQtyCheck.sql | UTF-8 | 557 | 2.890625 | 3 | [] | no_license | CREATE Proc ED850SDQ_FreeFormQtyCheck @CpnyId varchar(10), @EDIPOID varchar(10)
As
Select LineId From ED850SDQ
Where Exists (Select * From ED850SubLineItem
Where ED850SubLineItem.CpnyId = @CpnyId And
ED850SubLineItem.EDIPOID = @EDIPOID And
ED850SubLineItem.LineId = ED850SDQ.LineId) And
CpnyId = @CpnyI... | true |
279325aed56eef36084922e1b534d40046a26bff | SQL | joshdmiller/emergenesis.com | /conf/evolutions/default/1.sql | UTF-8 | 259 | 2.734375 | 3 | [] | no_license | # Posts schema
# --- !Ups
create table posts (
post_id SERIAL PRIMARY KEY,
title varchar(140) not null,
slug varchar(140) not null,
author varchar(20) not null,
modified_at date,
body text
);
# --- !Downs
DROP TABLE posts;
| true |
0890398856957967155a07cb962ecd5a616bbc0d | SQL | LogLaDog/DatabaseSystemsProject | /examples/ddl.sql | UTF-8 | 1,040 | 3.3125 | 3 | [] | no_license |
CREATE TABLE albums_bak (
AlbumId INTEGER,
Title NVARCHAR(160),
ArtistId INTEGER
);
DROP TABLE albums_bak;
DROP TABLE albums_backup;
-- Proof SQLite doens't care...
INSERT INTO albums (Title, ArtistId) VALUES ("Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphiokarabomelito... | true |
9435cc437caa5bb7a4775dd984b0d8f1c0fcbfaf | SQL | rminder/MHS | /Database/OdsStaging/SF/Stored Procedures/DeleteServiceMaxRmaShipmentLine.sql | UTF-8 | 957 | 3.578125 | 4 | [] | no_license | -- ===============================================================
-- Author: Randy Minder
-- Create Date: 3-Sept, 2018
-- Description: Delete rows from Ods.SL.ServiceMaxRmaShipmentLine
-- that are contained in OdsStaging.SL.ServiceMaxRmaShipmentLine.
--
-- ServiceMaxRmaShipmentLine: The name of this stored proc... | true |
a3c46b9276fc33de957cc3551440592d8417a91a | SQL | Juanpablocede/Scripts | /nomina (SNO)/sigesp_SNO/script_antiguedad_disponibilidad.sql | UTF-8 | 1,388 | 3.609375 | 4 | [] | no_license | SELECT
sno_personal.codper,
RTRIM(sno_personal.nomper)||' '||RTRIM(sno_personal.apeper) AS Nombres,
COALESCE((SELECT
SUM(sno_fideiperiodo.apoper)
FROM
sno_fideiperiodo
WHERE
sno_fideiperiodo.codper=sno_personal.codper),0) +
COALESCE((SELECT
SUM(sno_deudaanterior.monpreant)
FROM
sno_deudaanterior
W... | true |
3ba0bd9aa526ef5f874068ae08fb01ebf8d27ca9 | SQL | dnmitev/Databases | /ExamPreparation/ToyStore/Databases files/SecondQuery.sql | UTF-8 | 205 | 3.859375 | 4 | [] | no_license | SELECT m.Name,
(SELECT COUNT(*)
FROM Toys t
INNER JOIN AgeRanges ar
ON t.AgeRangeId = ar.Id
WHERE ar.MinimalAge >= 5 AND ar.MaximumAge <= 10 AND m.Id = t.ManufacturerId) as [Count]
FROM Manufacturers m
| true |
f309ba83d30b8af24b07c068f2b0ec856eb1edf5 | SQL | mbilaliqbal/Big-Data-Analysis-of-Twitter-Events-Data | /Scripts/q6.sql | UTF-8 | 494 | 3.71875 | 4 | [] | no_license | --game 36
select
cast(unix_timestamp(created)/60 as bigint)
, count(tweet_id)
from tweets_consolidated
where
cast(unix_timestamp(tweets_consolidated.created)/60 as bigint)
>
cast(unix_timestamp('2017-12-02 17:30:00.0')/60 as bigint)
and
cast(unix_timestamp(created)/60 as bigint)
<
cast (unix_timestamp('2017-12... | true |
d62e5567e1bc9031bdc3157ca9e4ca001f0b2802 | SQL | midwayjs/sandbox-docker | /mariadb/docker-entrypoint-initdb.d/sandbox_ui_dashboards.sql | UTF-8 | 862 | 3.09375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS sandbox;
CREATE TABLE `sandbox`.`sandbox_ui_dashboards` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`gmt_create` datetime NOT NULL COMMENT 'Create Time',
`gmt_modified` datetime NOT NULL COMMENT 'Last Modify Time',
`scope` varchar(128) NOT NULL COMMENT 'Applic... | true |
cc277c1191f88f8d1f7f959a530a8e98ba9112d8 | SQL | ErickBRAlessi/MS-Study | /productapi/src/main/resources/schema.sql | UTF-8 | 469 | 3.609375 | 4 | [] | no_license | CREATE SCHEMA IF NOT EXISTS products;
DROP TABLE IF EXISTS products.product;
DROP TABLE IF EXISTS products.category;
create table products.category (
id bigserial primary key,
nome varchar(100) not null
);
create table products.product (
id bigserial primary key,
product_identifier varchar not null,
... | true |
5ffe731cce92f301885fa20dec5d27bbb00f96e4 | SQL | rmulder/MySQL | /47. Exercise 18.sql | UTF-8 | 261 | 3.15625 | 3 | [] | no_license | USE sql_invoicing;
CREATE TABLE invoices_archived AS
SELECT i.invoice_id, i.number, c.name AS client, i.invoice_total, i.payment_total, i.invoice_date, i.payment_date, i.due_date
FROM invoices i
JOIN clients c
USING (client_id)
WHERE payment_date IS NOT NULL | true |
5521bffb4f688941cb5024d23e68d5b10c335c22 | SQL | RenataAssuncao/AdventureWorks | /models/Staging/stg_salesreason.sql | UTF-8 | 172 | 2.5625 | 3 | [] | no_license | with source as(
select distinct
salesreasonid
, name
, reasontype
from {{ source('adventureworkselt','salesreason')}}
)
select *
from source | true |
0c64b7cae2171cada41b650efe7723692740e9e5 | SQL | RuslanFajziev/job4j_design | /src/main/java/ru/job4j/postgre/helpdesk/join.sql | UTF-8 | 2,717 | 3.8125 | 4 | [] | no_license | create table departments(
id serial primary key,
name varchar(255)
);
create table emploees(
id serial primary key,
name varchar(255),
id_departments int references departments(id)
);
insert into departments(name) values('departments_1');
insert into departments(name) values('departments_2');
inse... | true |
1038148a186b809a5bb320810a4b6592e435d7db | SQL | jiangyukai/demo | /src/main/resources/SQL/user.sql | UTF-8 | 1,544 | 3 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50533
Source Host : localhost:3306
Source Database : ssmtest
Target Server Type : MYSQL
Target Server Version : 50533
File Encoding : 65001
Date: 2018-09-13 10:46:41
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... | true |
fc8082b59df64622f9bf60141338093084d7c55f | SQL | RikTheunis/cloud-native-practical | /shopping-list/src/main/resources/db/migration/V0.8__Add_Spring_Security_Schema.sql | UTF-8 | 294 | 3.3125 | 3 | [] | no_license | CREATE TABLE USERS (
USERNAME TEXT NOT NULL PRIMARY KEY,
PASSWORD TEXT NOT NULL,
ENABLED BOOLEAN NOT NULL
);
CREATE TABLE AUTHORITIES (
USERNAME TEXT NOT NULL,
AUTHORITY TEXT NOT NULL,
CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME)
);
| true |
e511b9321c9da79f90d1ff03eb46684e4b056214 | SQL | naveenkod22/MySQL | /Query/8-Stored Procedures/8.8 Output Parameters.sql | UTF-8 | 1,023 | 3.421875 | 3 | [
"MIT"
] | permissive | -- 8.8 Output Parameters
USE `sql_invoicing`;
DROP procedure IF EXISTS `get_unpaid_invoices_for_clients`;
DELIMITER $$
USE `sql_invoicing`$$
CREATE PROCEDURE get_unpaid_invoices_for_clients
(
client_id int
)
BEGIN
select count(*), sum(invoice_total)
from invoices i
where i.client_id = client_id
and payme... | true |
cb9d6681b3d45462f0e93fbf077936b4e7865467 | SQL | Tognolia/SQL | /self_cross_join.sql | UTF-8 | 583 | 4.375 | 4 | [] | no_license | # Inspect the database structure and find the best-fitting table to analyse for the next task.
select * from actor;
select * from film_actor;
# Display all pairs of actors that worked together in a movie.
select * from film_actor fa1
join film_actor fa2
on fa1.actor_id <> fa2.actor_id
and fa1.film_id = fa2.film_id
o... | true |
6dd9d0ede33e42cbc97319644099cd9e0bc28581 | SQL | RyanTech/yueji | /tools/db/outsource/snow/install/install_oracle_in_centos.sql | UTF-8 | 8,485 | 2.515625 | 3 | [] | no_license | ssh -X admin@58.215.221.214
##--ssh -X admin@58.215.221.22
#编辑/home/oracle/.bash_profile
db_name=snow
######################################################
##
## db_name string yueji
## db_unique_name string slave
## global_names boolean FALSE
## instance_name string slave
##
####... | true |
560e9058b3ace78733496855e161ae76475a37a2 | SQL | GrowinScala/OverSite | /flyway/sql/V1__create_tables.sql | UTF-8 | 1,906 | 3.4375 | 3 | [
"MIT",
"CC0-1.0"
] | permissive | create table Chats (
CHATID varchar(100) not null,
HEADER varchar(256) not null,
PRIMARY KEY(CHATID)
);
create table Emails (
EMAILID varchar(100) not null,
CHATID varchar(100) not null,
FROMADDRESS varchar(100) not null,
DATEOF date not null,
HEADER varchar(256) null, -- In an email a ... | true |
635dcd18fb02794008c8ca0658c6d45105601b37 | SQL | taonlyt/webcore | /src/main/resources/com/bamboo/module/db/sequence/dao/TS_SEQUENCE-CURRVAL.sql | UTF-8 | 522 | 2.890625 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Author: luotao
* Created: 2017-3-7
*/
CREATE DEFINER=`root`@`localhost` FUNCTION `currval`(seq_name VARCHAR(50)) RETURNS int... | true |
8bc761e60fa257bdd4311142f0887e5b8df38155 | SQL | QAMinn2468/SQL-Zoo | /SqlZoo-9.sql | UTF-8 | 2,692 | 4.28125 | 4 | [] | no_license | --------------------------------------------------------------------------------
-- Self JOIN
--------------------------------------------------------------------------------
-- 1. Total stops
SELECT COUNT(id) FROM stops;
-- 2. ID for 'Craiglockhart'
SELECT id FROM stops
WHERE name=... | true |
8ebb10ecffa55cc362b509a669b4d76990b99228 | SQL | asteph/Database_Exercises | /limit_exercise.sql | UTF-8 | 437 | 3.328125 | 3 | [] | no_license |
SELECT last_name
FROM employees
GROUP BY last_name DESC
LIMIT 10;
SELECT concat(first_name, ' ', last_name) AS full_name
FROM employees
WHERE hire_date LIKE '199%'
AND birth_date LIKE '%-12-25'
ORDER BY birth_date ASC, hire_date DESC
LIMIT 5;
SELECT concat(first_name, ' ', last_name) AS full_name
FROM employees
WHE... | true |
135734e1f0d99d1a8fef130417c9de50de52e51b | SQL | chuchenglong/family | /src/main/resources/sql/001_t_data_info.sql | UTF-8 | 798 | 3.140625 | 3 | [] | no_license | -- ------------------------------
-- 数据字典信息表
-- ------------------------------
drop table if exists t_data_info;
create table t_data_info(
id int(10) not null auto_increment comment '数据字典id,主键' primary key,
parent_code varchar(50) not null comment '父节点ID',
data_code varchar(50) not null comment 'CODE',
data_na... | true |
e2673e29bcade4df3dde4a6089bf020b1aeda8cd | SQL | sixstorm/redditstats | /finddups.sql | UTF-8 | 79 | 2.515625 | 3 | [] | no_license | select title, dtp, count(*)
from Reddit
group by title, dtp
having count(*) > 1 | true |
df957c377d74a56c38cf054e83e8934062ad3f52 | SQL | ibtissamemme/script-sql | /Archives/Scripts_ORCL/Mise_a_jour_schema/76_S_ORCL_2012_08_24.sql | UTF-8 | 1,114 | 2.9375 | 3 | [] | no_license | ALTER TABLE PROFIL_CTRL ADD PROFIL_CTRLID_EXT VARCHAR(50) ;
COMMIT;
UPDATE PROFIL_CTRL SET PROFIL_CTRLID_EXT=PROFIL_CTRLID;
COMMIT;
UPDATE PROFIL_CTRL SET PROFIL_CTRLID_EXT=PROFIL_CTRLID ;
COMMIT;
CREATE TABLE PROFIL_CTRL_LECTEUR (
PROFIL_CTRL_LECTEURID INTEGER PRIMARY KEY,
CTRLREADER VARCHAR2(50),
CTRLREADERID V... | true |
ced4b3e73bb146c80bfcd547ed2654b16420dc59 | SQL | ConnorSullivan10/Chinook | /NSS-Chinook-InClass.sql | UTF-8 | 1,925 | 4.25 | 4 | [] | no_license | select Name as artistname
from Artist
--where id > 100
-- where Name like '%john%'
--where name in (
--'AC/DC',
--'Marcos Valle',
--'Os Mutantes',
--'Olodum'
--)
--and ArtistId > 100
-- artists that have matching albums
select Artist.Name as ArtistName, Album.Title as AlbumName
from Artist
-- implicit inner join
join... | true |
e9ce027694aa84429de31809864a701de14c291f | SQL | nabinsharma/dbclass-stanford | /sql/SQLMovieRatingQueryCoreSet.sql | UTF-8 | 3,144 | 4.84375 | 5 | [] | no_license | /* Question 1: Find the titles of all movies directed by Steven Spielberg.
*/
select title
from movie
where director = 'Steven Spielberg';
/* Question 2: Find all years that have a movie that received a rating of
4 or 5, and sort them in increasing order.
*/
select distinct year
from movie, rating
where Movie.mID = ... | true |
6e474f4620da19b2a5c506fce14ed7a6d941ad62 | SQL | gonerkong/sqlzoo_solutions | /JOIN.sql | UTF-8 | 4,228 | 4.40625 | 4 | [] | no_license | /*
#1
Q:
The first example shows the goal scored by a player with the last name 'Bender'.
The * says to list all the columns in the table - a shorter way of saying matchid, teamid, player, gtime
Modify it to show the matchid and player name for all goals scored by Germany. To identify German players, check for:... | true |
be391c28be5b3e696672ce83598f2abeab9eeae4 | SQL | beabreccia/Adventureworks | /models/adventureworks/mart/dim_products.sql | UTF-8 | 2,351 | 3.421875 | 3 | [] | no_license | {{ config(materialized='table') }}
with
products as (
select *
from {{ ref('stg_products') }}
)
,category as (
select *
from {{ ref('stg_product_category') }}
)
,subcategory as (
select *
from {{ ref('stg_product_subcategory') }}
... | true |
a2cb03662ecf9cdb11e1efda8e7671f4898fa19d | SQL | hgsilva/edscripts | /LYCEUM/CAPTAÇÃO/03_CONVOCADOS.SQL | UTF-8 | 1,127 | 3.046875 | 3 | [] | no_license | -- GERANDO OS CANDIDATOS CONVOCADOS ACUMULADOS
-- GERA LOG
INSERT INTO IE_CANDIDATO_CONVOCADO_ACUMULADO_V3_LOG
SELECT *, GETDATE()DT_LOG
FROM IE_CANDIDATO_CONVOCADO_ACUMULADO_V3
where ano IN (
SELECT DISTINCT ANO
FROM [POLARIS02\BDIESBPROD].LYCEUM.DBO.IE_LY_OPCOES_APP
WHERE APLICACAO in ( 'VESTIBULAR',... | true |
ba3362132aa906e6fe9cca01a68a783923b699c2 | SQL | copydark/studentProject | /src/sql/jnflsic_sch_info.sql | UTF-8 | 4,879 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 18, 2018 at 03:26 PM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
0cc01a023f39795af72803278cebf8b393688628 | SQL | ExtaSoft/extacrm | /src/main/resources/db/migration/V0.2.0__MigrationFromGAE.sql | UTF-8 | 11,768 | 3.390625 | 3 | [
"Apache-2.0"
] | permissive | SET foreign_key_checks = 0;
ALTER TABLE FORM_TRANSFER_NUMS DROP FOREIGN KEY FK_FORM_TRANSFER_NUMS_FormTransfer_ID;
ALTER TABLE A7_FORM CHANGE CREATED_BY CREATED_BY VARCHAR(50);
ALTER TABLE A7_FORM CHANGE ID ID VARCHAR(50);
ALTER TABLE A7_FORM CHANGE MODIFIED_BY MODIFIED_BY VARCHAR(50);
ALTER TABLE A7_FORM CHANGE OWNER... | true |
619f0753f78fd4afbc91d2bdccbb836a476f02c6 | SQL | sudarshanmurthy/car_rental | /DBMS20-38-1475-SUDARSHAN-QUERIES.sql | UTF-8 | 3,039 | 3.625 | 4 | [] | no_license | --QUERIES
--1
select offer_details.Promo_code,Description,Promo_Type,Tot_Amount
from offer_details inner join reservation
on reservation.Promo_code=offer_details.Promo_code;
--2
select car_user.license_no,Fname,Lname,Rental_Amount,Insurance_Amount,Tot_Amount
from reservation inner join car_user
on ca... | true |
aa7eb5d252326bdad5e5bf5646f685e848bdc74b | SQL | jhueliankg3/MySQLHW | /MySQLHW.sql | UTF-8 | 6,531 | 4.875 | 5 | [] | no_license | -- Use Database
USE sakila;
-- Display first and last name of all actors
SELECT first_name, last_name
FROM actor;
-- Display first and last name of each actor in a single column
SELECT UPPER(CONCAT(first_name,' ', last_name)) AS 'Actor Name'
FROM actor;
-- Find ID number, first name, and last name of whom you only k... | true |
73e24112f5c09ee78adb00aee35edda24e9c4bc4 | SQL | DanielMuthupandi/FAST | /FAST/vsql/APTTUS/AT_Apttus_Config2__OrderLineItem__c.sql | UTF-8 | 33,331 | 3.234375 | 3 | [] | no_license | /****
****Script Name : AT_Apttus_Config2__OrderLineItem__c.sql
****Description : Incremental data load for AT_Apttus_Config2__OrderLineItem__c
****/
/* Setting timing on**/
\timing
\set ON_ERROR_STOP on
CREATE LOCAL TEMP TABLE Start_Time_Tmp ON COMMIT PRESERVE ROWS AS select count(*) count, sysdate st from "swt... | true |
f37e2d33629c3ab006c9c0ac82c0e2e5fce8a132 | SQL | Heaven-zhw/EnglishOnline | /English_Crawler/engonline3(有基本信息).sql | UTF-8 | 171,782 | 3.21875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50553
Source Host : localhost:3306
Source Database : engonline3
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2019-05-26 11:48:11
*/
SET FOREIGN_KEY_CHECKS=... | true |
b2229de5fb202a427ce6ad519de1987373fb0ba2 | SQL | LeoGalleguillos/Website | /sql/test/website/create.sql | UTF-8 | 610 | 2.9375 | 3 | [] | no_license | CREATE TABLE `website` (
`website_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`domain` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
`environment_id` tinyint(1) DEFAULT NULL,
`google_analytics_tracking_id` varchar(16) DEFAULT NULL,
... | true |
6e90f875184a2a552e8efec97cc02eba5d1cebda | SQL | sondraycabana/employee-app-backend | /src/main/resources/db/insert.sql | UTF-8 | 437 | 2.625 | 3 | [] | no_license | --SET FOREIGN_KEY_CHECKS = 0;
--
--truncate table employees
--
--
--insert into employees(`id`,`first_name`,`last_name`,`email_id`)
--values(1,'ade','dosunmu','a@gmail.com'),
----(2,'monsura','ganduje','28'),
----(3,'sulaimon','donzada','21');
--
----insert into hospital(`id`,`name`,`registered_no`)
----values(1,'lago... | true |
d6b5654e89f052edc82f15b396e535d6c57b3cbd | SQL | KNIGHTTH0R/HeadlineNewsScraper | /database.sql | UTF-8 | 401 | 2.6875 | 3 | [] | no_license | -- Adminer 4.3.1 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `news`;
CREATE TABLE `news` (
`hash` varchar(255) NOT NULL,
`site` varchar(255) NOT NULL,
`title` text NOT NULL,
`created_at` int(11) NOT NULL,
PRIMA... | true |
007d5bb31a937f96bcbe627357ee1252331d9f78 | SQL | barcagirl/user_registration | /purchases.sql | UTF-8 | 6,171 | 2.640625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 03, 2020 at 02:42 AM
-- 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 |
152feacb3ac883497b71d2d5884a4785d1113959 | SQL | chrissimusokwe/compare-warehouse-distributions | /test_queries/08_more_addresses/obt.sql | UTF-8 | 306 | 3.609375 | 4 | [] | no_license | WITH
cte AS (
SELECT
ca_state
, COUNT(*) total_in_state
FROM dbt.one_big_table
GROUP BY
ca_state
)
SELECT
obt.ca_state
, ca_zip
, COUNT(*) / total_in_state
FROM dbt.one_big_table obt
LEFT JOIN cte
ON obt.ca_state = cte.ca_state
GROUP BY
obt.ca_state
, total_in_state
, ca_zip
| true |
160ea168b045991af01f21eae1d70a2ea500d7cf | SQL | patriziocannoni/CepWebService | /CepWebServiceSQL/MySQL55/sp_sel_logradouro_por_nome_e_uf.sql | UTF-8 | 796 | 3.78125 | 4 | [] | no_license | DELIMITER $$
DROP PROCEDURE IF EXISTS sp_sel_logradouro_por_nome_e_uf;
CREATE DEFINER=root@localhost PROCEDURE sp_sel_logradouro_por_nome_e_uf (IN paramNome varchar(70), IN paramUf varchar(2))
BEGIN
select
log_log.LOG_NOME as logradouro,
concat(log_log.LOG_TIPO_LOGRADOURO, ' ', log_log.LOG_NO) as endereco,
log... | true |
16f9cad74b702ca0ccc6c2fcf7be2cd196a1403f | SQL | IwantBeJavaDev/bookstore | /src/main/resources/db/migration/V20190301094748__V3.sql | UTF-8 | 1,071 | 3.984375 | 4 | [] | no_license | CREATE TABLE bookstore.AUTHOR
(
ID_AUTHOR int8 NOT NULL,
FIRST_NAME varchar(100) NOT NULL,
LAST_NAME varchar(100) NOT NULL,
DESCRIPTION text NOT NULL,
CONSTRAINT pk_AUTHOR PRIMARY KEY (ID_AUTHOR)
);
CREATE INDEX in_author_first_name on bookstore.AUTHOR USING btree(FIRST_NAME);
CREATE IND... | true |
0d670fe8bbe956eed60482f963115989ec3c460a | SQL | flyation/jpa | /src/main/resources/sql/test.sql | UTF-8 | 1,992 | 3.453125 | 3 | [] | no_license | /*
SQLyog Ultimate v13.1.1 (64 bit)
MySQL - 5.5.62 : Database - test
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY... | true |
f62fe335b35c0919e45cf668b784875a0452ec8f | SQL | cofcdelab/sfsqlcode | /dbo.decofc_createtempticketstosync.sql | UTF-8 | 2,394 | 3.5625 | 4 | [] | no_license | CREATE procedure decofc_createtempticketstosync @startdate datetime, @enddate datetime as
begin
drop table temptickets
select ticode,tipricetype,tifullprice,eveventdate, shcode, tilcode, timailinglist,titransactnum,
(select top 1 ptdescr from recieptbase inner join paytype on rcbPayType = ptcode where rcbtransa... | true |
cdd3d4bc048aec28c3bb774bae5b1c0af88a391f | SQL | louksky/php-api---users-managment-articels | /php api - by louk/PHPLearning.sql | UTF-8 | 2,388 | 3.90625 | 4 | [] | no_license |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
-- ARTICLE DDL
CREATE TABLE article (
id int(11) NOT NULL,
title varchar(255) NOT NULL,
content varchar(2054) NOT NULL,
id__autor int(11) not null,
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP O... | true |
478b5dd3a45d6ff551ef46de5b349c4c0066afa1 | SQL | thona-seguros/Repositorio-Sicas | /Objetos-BD/Paquetes/oc_asistencias_asegurado.sql | WINDOWS-1250 | 13,567 | 2.703125 | 3 | [] | no_license | --
-- OC_ASISTENCIAS_ASEGURADO (Package)
--
-- Dependencies:
-- STANDARD (Package)
-- STANDARD (Package)
-- DBMS_STANDARD (Package)
-- OC_DETALLE_POLIZA (Package)
-- ASEGURADO_CERTIFICADO (Table)
-- ASISTENCIAS_ASEGURADO (Table)
-- CONFIG_ASISTENCIAS_PLANCOB (Table)
-- OC_ENDOSO (Package)
-- OC_AS... | true |
ed21cf59ccf2ac2ca091549919908e88aab2ed2f | SQL | shadhini/curw_helpers | /db_stored_procedures/curw_fcst/get_nearest_d03_station.sql | UTF-8 | 634 | 3.609375 | 4 | [] | no_license | CREATE DEFINER=`routine_user`@`%` PROCEDURE `get_nearest_d03_station`(
IN lat DECIMAL(9,6),
IN lng DECIMAL(9,6)
)
BEGIN
SELECT ordered_stations.id AS id, ordered_stations.name AS name, ordered_stations.latitude AS latitude, ordered_stations.longitude AS longitude
FROM
(SELECT
id, name, latitude, longitude,
... | true |
924c9a7a7ac1be42585e0ba8c4fc3de94c2d8e07 | SQL | luribec/docs | /ScriptSemana2ok.sql | UTF-8 | 2,724 | 3.5 | 4 | [] | no_license | DROP DATABASE IF EXISTS Semana2;
CREATE database Semana2;
use Semana2;
CREATE TABLE IF NOT EXISTS Aeropuertos (
Id_Aeropuerto INT AUTO_INCREMENT,
Ciudad Varchar(25) NOT NULL,
Nombre VARCHAR(25) NOT NULL,
PRIMARY KEY (Id_Aeropuerto)
);
CREATE TABLE IF NOT EXISTS Avion (
Id_Avion INT,
Capacid... | true |
54ed9d69e0dd7f1d7747621481729d9ac49a7248 | SQL | julian955/Curso.Programacion.Web.FullStack-EGG | /2. My SQL/Ejercicios/EJ 1.sql | UTF-8 | 1,550 | 3 | 3 | [] | no_license | /*insert into creador values (1,'Marvel');
insert into creador values (2,'DC Comics');
select* from creador;*/
/*insert into personajes values (1,'Bruce Banner','Hulk',160,'600 mil',75,98,1962,'Fisico Nuclear',1);
insert into personajes values (2,'Tony Stark','Iron Man',170,'200 mil',70,123,1963,'Inventor Industrial'... | true |
a75b9a05229970fd624429e98df8d6108a03a0d3 | SQL | Kipitup/PHP_pool | /d05/ex11/ex11.sql | UTF-8 | 286 | 3.421875 | 3 | [] | no_license | SELECT
UPPER(`last_name`) AS `NAME`,
`first_name`,
`price`
FROM
`member`
INNER JOIN `user_card` ON member.id_user_card = user_card.id_user
INNER JOIN `subscription` ON member.id_sub = subscription.id_sub
WHERE
price > 42
ORDER BY
`last_name` ASC, `first_name` ASC;
| true |
2e3f732c2988b8722ab56036cb2eeb0aa4d27566 | SQL | ithansiyeon/material | /oracle/ex22_view.sql | UTF-8 | 3,232 | 3.984375 | 4 | [] | no_license | --ex22_view.sql
/*
뷰, View
- DB Object 중 하나(테이블, 시퀀스, 제약사항, 뷰)
- 가상 테이블, 테이블의 복사본, 뷰 테이블
- 실제 테이블처럼 취급하는 객체
- select 문 자체를 저장하는 객체(*******) 퀴리 자체를 저장하는 객체
뷰의 용도
- 가독성 향상
- 자주 사용하는 select를 저장해 놓는 객체(***)
*/
create view vwInsa
as
select * from tblInsa;
select * from vwInsa; -- 호출이 되어서 그 순간 select * from t... | true |
c0b5089be2718560fceb39597a238b4b7d907dbd | SQL | DjordjeStefanovic/spring-boot-jpa-sql-rest | /src/test/mysql/concretetable.sql | UTF-8 | 1,302 | 3 | 3 | [] | no_license | create database concretepage;
use concretepage;
create table article (
id int not null auto_increment,
article_id varchar(20),
title varchar(200),
category varchar(200),
primary key (id));
insert into article (article_id, title, category) values (
'1122', 'Start coding in java spring jpa', 'java/spri... | true |
40b90b8ab27fdec40015043b0e1523dc77769741 | SQL | ManuBedoya/holbertonschool-higher_level_programming | /0x0D-SQL_introduction/11-best_score.sql | UTF-8 | 127 | 2.703125 | 3 | [] | no_license | -- Print the best scores that are greaters than 10
SELECT score, name FROM second_table WHERE score >= 10 ORDER BY score DESC;
| true |
39d56ca2bda0fdf636a33fe3ed515edc0d804131 | SQL | IVSEZ/mysqlbis | /RCB/dailyscript-load/load RCB_TICKETS.sql | UTF-8 | 2,063 | 3.015625 | 3 | [] | no_license | -- SET SESSION sql_mode = '';
LOAD DATA LOW_PRIORITY LOCAL INFILE 'C:\\ProgramData\\MySQL\\MySQL Server 5.7\\Uploads\\rcbill\\AllTickets-04122017.csv'
REPLACE INTO TABLE `rcbill`.`rcb_tickets` CHARACTER SET UTF8 FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\r\n'
IGNORE 1 L... | true |
44bb4e22bab6d369acd79e8759279a61ea9c87ba | SQL | raulsilveirajr/poc_financas_pessoais | /back-end/db.sql | UTF-8 | 793 | 3.53125 | 4 | [] | no_license | CREATE DATABASE myfinances;
CREATE SCHEMA finance;
DROP TABLE IF EXISTS finance.user;
CREATE TABLE finance.user
(
id bigserial NOT NULL PRIMARY KEY,
name character varying(150),
email character varying(100),
password character varying(100),
insert_date date DEFAULT NOW()
);
DROP TABLE IF EXISTS finance.re... | true |
e3c468a2463d1f44c38b6e7da14690b5f35ba447 | SQL | XiaoZhengZhong1/repro1 | /day29/SQL数据库练习笔记/sqlyog29_4SQL所有内容总结复习.sql | UTF-8 | 2,716 | 4.25 | 4 | [] | no_license | -- 复习SQL所有类容
CREATE DATABASE d926;-- 1 建库
USE d926;-- 2 使用库.
CREATE TABLE text2(-- 3创建表
tid INT PRIMARY KEY AUTO_INCREMENT,
tname VARCHAR(10),
weight DOUBLE
);
SHOW TABLES;-- 4查询库中所有的表
DESC text2;-- 5:查询指定表详细结构信息
INSERT INTO text2(tid,tname,weight)VALUES(1,'海',135);-- 增 insert into 表名(列名)values(值)
INSERT INTO text2(t... | true |
cb55846e044fdf777c6e7e19cfe95232a107f6a2 | SQL | a-nigredo/recruiting-system | /src/main/resources/db/migration/V23__Init_vacancy_snapshot_table.sql | UTF-8 | 1,562 | 3.390625 | 3 | [] | no_license | CREATE TABLE `vacancies_snapshot` (
`id` VARCHAR(50) NOT NULL,
`creation_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`author_id` BIGINT(20) NOT NULL,
`project` TEXT NOT NULL,
`description` TEXT NOT NULL,
`requirements` TEXT NOT NULL,
`owner_id` BIGINT(20) NOT NULL,
`quantity`... | true |
092d58ac0c7e8dc92bc9194170afe8f4c2678cf1 | SQL | mundodron/arduino-bot-aurelio | /Querys/~ebDA4A.sql | UTF-8 | 171 | 2.515625 | 3 | [] | no_license | select * from bill_invoice where bill_ref_no in (315905303,315905103)
select bill_ref_no,statement_date,payment_due_date from bill_invoice where account_no in (2724640) | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.