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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2ab838cf5df8c4cde38eb1479e74d7cabe84863c | SQL | cin-lawrence/sqlcookbook | /commander/commands/chapter12/06.sql | UTF-8 | 479 | 3.59375 | 4 | [] | no_license | -- 12.6 Pivoting a Result Set to Facilitate Inter-Row Calculations --
select d20_sal - d10_sal as d20_10_diff, d20_sal - d30_sal as d20_30_diff
from (
select
sum(
case
when deptno = 10 then sal
end
) as d10_sal,
sum(
case
when deptno = 20 then sal
... | true |
6af214797727b6b8892d5640a34281c982b87464 | SQL | jgarzonext/packages | /paquete body/PAC_IAX_AGE_DATOS.sql | ISO-8859-2 | 25,678 | 2.859375 | 3 | [] | no_license | --------------------------------------------------------
-- DDL for Package Body PAC_IAX_AGE_DATOS
--------------------------------------------------------
CREATE OR REPLACE EDITIONABLE PACKAGE BODY "AXIS"."PAC_IAX_AGE_DATOS" AS
/******************************************************************************
NOMB... | true |
d2d3a92907a18153f2f07c479309843f79e70b94 | SQL | danielwcosta/Projeto-Cursos | /data-base/aula3.sql | UTF-8 | 2,067 | 4.03125 | 4 | [] | no_license | SELECT * FROM projeto_cursos.usuarios;
SELECT COUNT(*) FROM usuarios; /* 13 USUARIOS*/
SELECT COUNT(*) FROM usuarios
WHERE tipo_usuario_fk = 3; /* 9 alunos */
SELECT * FROM cursos;
SELECT AVG(preco)
FROM cursos; /* média de preço: 267.5*/
SELECT MIN(preco)
FROM cursos; /* valor minimo 50*/
SELECT MAX(preco)
FROM ... | true |
29e1f38a8370e4a3805d1d7e91a7dd09cee81ac9 | SQL | Hobbi5g/4win | /siteditor/query/editgame2.sql | UTF-8 | 416 | 3.40625 | 3 | [] | no_license | rates.`netmode4`,
longreports.gameid,
longreports.report,
longreports.checked,
members.author,
members.userid,
members.login
FROM games
INNER JOIN members ON (members.userid = $gameid)
INNER JOIN longreports ON (longreports.gameid = $gameid)
INNER JOIN rates ON ... | true |
222317f0d2d5ff7640e3753651777dbb12b079de | SQL | aiminho/spring-boot-oauth2 | /document/db/initDB.sql | UTF-8 | 3,550 | 3.25 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50719
Source Host : localhost:3306
Source Database : oauth2_test
Target Server Type : MYSQL
Target Server Version : 50719
File Encoding : 65001
Date: 2017-11-16 15:41:56
*/
SET FOREIGN_KEY_CHECKS=0;
... | true |
b19d0f9d47a347ce30e13076da298adb7ca88ee6 | SQL | PetePhx/relational-databases | /exercises/DML_DDL_DCL/03.sql | UTF-8 | 342 | 2.9375 | 3 | [] | no_license | -- DML/DDL/DCL Part 3
--
-- Does the following statement use the DDL or DML component of SQL?
CREATE TABLE things (
id serial PRIMARY KEY,
item text NOT NULL UNIQUE,
material text NOT NULL
);
Answer:
Creating a table and the associated schema responsible for defining the data
structure is part of the Data ... | true |
b6fc142f8fa0f36cc347f0d2a881d96ce963ce30 | SQL | requiem958/JO | /req.sql | UTF-8 | 1,105 | 3.046875 | 3 | [] | no_license | <<<<<<< HEAD
INSERT INTO LesSportifs values (:num,:nom,:prenom,:pays,:cat,:date);
INSERT INTO LesEquipes values (:numS,:numE);
INSERT INTO LesLocataires values (:numS,:nLog,nBat);
-- Affichage des logements disponibles
with X as (
select NomBat, nlogement, count( nSportif) as occupe,capacite from lesLogements n... | true |
327eb3228ed38fc0caa24e06fd8e6f882a45dcc1 | SQL | felipemm/site-seed-template | /docs/generate calendar table mysql.sql | UTF-8 | 2,964 | 4.28125 | 4 | [] | no_license | -- create staging table to generate dummy rows
create table ints(i tinyint);
insert into ints values(0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-- create staging table
create table dates (
dia date primary key
);
-- put initial date value
insert into dates values ('1986-01-01');
-- create view to generate subsequent d... | true |
943792ed69091745b39e68ebf9f9771065792505 | SQL | GustavoCostella/bd1 | /equipes.sql | UTF-8 | 2,939 | 3.984375 | 4 | [] | no_license | /*Comandos em psql
psql -U postgres -h localhost -d postgres
\c nome_banco conecta no banco
\d mostra as tabels do nome_banco
\d nome_tabela mostra a tabela especifica
insert into nome_tabela (lista de colunas separadas por virgula) value (valores)
select * from nome_tabela mostra os valores da tabela
id serial constra... | true |
e0e584f7bc1a64371d88f48b767c8cffca719892 | SQL | jeffmcbride/TestDomePracticeProblems | /SQL/Enrollment.sql | UTF-8 | 384 | 3.078125 | 3 | [] | no_license | /*A table containing the students enrolled in a yearly course has incorrect data in records with ids between 20 and 100 (inclusive).
TABLE enrollments
id INTEGER NOT NULL PRIMARY KEY
year INTEGER NOT NULL
studentId INTEGER NOT NULL
-- Write only the SQL statement that solves the problem and nothing else.
*/
UPD... | true |
f127297bf2a7e201f5598be73f2cc473d87b79db | SQL | dael-victoria-reyes/data-act-broker-backend | /dataactvalidator/config/sqlrules/b7_object_class_program_activity_1.sql | UTF-8 | 376 | 3.34375 | 3 | [
"CC0-1.0"
] | permissive | -- GrossOutlaysDeliveredOrdersPaidTotal (FYB) = USSGL 4908. This applies to the program activity and object class level.
SELECT
row_number,
gross_outlays_delivered_or_fyb,
ussgl490800_authority_outl_fyb
FROM object_class_program_activity
WHERE submission_id = {0}
AND COALESCE(gross_outlays_delivered_or_... | true |
d515bf5da40fcc1208508e3122a73f0c61f9d7c8 | SQL | ashishbijlani/npm-analysis | /sql-queries/licenseViolation.sql | UTF-8 | 384 | 3.421875 | 3 | [
"MIT"
] | permissive | SELECT main
FROM packages
WHERE name = "aws-sdk";
SELECT l.package, l.type, d.package, dl.type
FROM (SELECT package, type FROM license WHERE type LIKE "GPL%") as l
JOIN (SELECT package, name
FROM dependencies) as d JOIN (SELECT package, type FROM license) as dl on d.name = l.package AND d.package = ... | true |
3ba16a0d18ca0b0eaac902dfd02447076b082bdf | SQL | nattawatsakubol/std6102041520050-database | /staff.sql | UTF-8 | 363 | 2.734375 | 3 | [] | no_license | CREATE TABLE `staff` (
`staff_no` varchar(5) NOT NULL,
`first_name` varchar(300) NOT NULL,
`last_name` varchar(300) NOT NULL,
`position` varchar(50) NOT NULL,
`sex` varchar(1) NOT NULL,
`dob` date DEFAULT NULL,
`salary` int(7) NOT NULL,
`branch_no` varchar(5) DEFAULT NULL,
PRIMARY KEY (`staff... | true |
c9f5b89e1154bec0c699c73251810b72aa736118 | SQL | damanic/ls1-module-shop | /updates/d786fef.sql | UTF-8 | 368 | 2.515625 | 3 | [] | no_license | CREATE TABLE `shop_paymentmethods_customer_groups` (
`shop_payment_method_id` int(11) NOT NULL DEFAULT '0',
`customer_group_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`shop_payment_method_id`,`customer_group_id`),
KEY `shop_payment_method_id` (`shop_payment_method_id`),
KEY `customer_group_id` (`customer_... | true |
3e3b6e6cec11d599fe1c2dd599080afa308b3779 | SQL | dalzinho/Codeclan-Work | /w3/Thursday/jedi/joins.sql | UTF-8 | 331 | 2.796875 | 3 | [] | no_license | -- SELECT l.colour FROM lightsabers l;
SELECT j.name, l.colour, l.hilt_metal FROM jedi j
INNER JOIN lightsabers l
ON j.id = l.owner_id;
SELECT j.name, l.colour, l.hilt_metal FROM jedi j
LEFT JOIN lightsabers l
ON j.id = l.owner_id;
SELECT j.name, l.colour, l.hilt_metal FROM jedi j
RIGHT JOIN lightsabers l
ON j.id = ... | true |
f985d3820a7f5646523bbbc58fa8376524a500dc | SQL | MykexMP/redsocial | /redsocial-war/res/datos.sql | UTF-8 | 1,978 | 2.859375 | 3 | [] | no_license | use redsocial;
insert into visibility values (1, 'Public');
insert into visibility values (2, 'Private');
insert into visibility values (3, 'Friends');
insert into visibility values (4, 'Group');
insert into user values(1, 'Ignacio','nachojaime@redsocial.es', '1234', 'nacho', '2010-10-10');
insert into user values(2,... | true |
a81a8a99fbdd35e4321458e8c6f038f242e60c14 | SQL | EgiH/SIAK | /UAS/Sistem Informasi Akademik/siak.sql | UTF-8 | 2,518 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 21, 2017 at 09:13 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... | true |
4a8d2549c3ff49b24cf0e9d99ace549720c5eae2 | SQL | HarshDivecha/sql_coding_questions | /opt_queries.sql | UTF-8 | 947 | 4.40625 | 4 | [] | no_license | SELECT a.name "account_name",
a.primary_poc "poc_name",
s.name "sales_rep_name"
FROM accounts a
LEFT JOIN sales_reps s
ON a.sales_rep_id = s.id
AND a.primary_poc < s.name;
-- SELF JOINS
SELECT we1.id AS we_id,
we1.account_id AS we1_account_id,
we1.occurred_at AS we1_occurred_a... | true |
91ce6693e6b7ca2b9421eb3ce785bfe42314674c | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day19/select0107.sql | UTF-8 | 191 | 2.796875 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-18T01:07:00Z' AND timestamp<'2017-11-19T01:07:00Z' AND SENSOR_ID='2bea4741_bb38_43aa_a73d_152523e93790'
| true |
564a686e320bdff3353ded875f7ab5119e7d5709 | SQL | tuanhuytruong/dtgk-dwh | /purchased.sql | UTF-8 | 1,892 | 3.546875 | 4 | [] | no_license | #Purchased
CREATE OR REPLACE EXTERNAL TABLE staging.purchased
(
branch STRING
, inbound_id STRING
, created_at STRING
, col4 STRING
, col5 STRING
, col6 STRING
, supplier_id STRING
, supplier_name STRING
, phone_number STRING
, address STRING
, filler STRING
, creator STRING
, col13 STRING
, col14 STRING
, col15 STRING... | true |
e6d9fa247d8fab303b25209cdb009937c3215cee | SQL | ImamRifaah/UAS---Imam-Rifa-ah | /akademik.sql | UTF-8 | 1,627 | 3.015625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 25, 2021 at 06:03 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
79fc0992903eb2f691e1a9d2b815aa0b17f14c65 | SQL | JihyeHwang09/spring-boot-demo-api | /src/main/resources/data.sql | UTF-8 | 770 | 2.625 | 3 | [] | no_license | INSERT INTO T_BOARD
(
TITLE,
CONTENTS,
CREATOR_ID,
CREATED_DATETIME)
VALUES
(
'인사',
'안녕하세요. 인사드립니다.',
'adimin',
NOW()
);
INSERT INTO T_BOARD
(
TITLE,
CONTENTS,
CREATOR_ID,
CREATED_DATETIME)
VALUES
(
'환영합니다.',
'환영해요. 반갑습니다!',
'user1',
NOW()
);
INSERT I... | true |
61abb3fc291a237565fbd8e6613da31127a311d4 | SQL | OvidiuEDSgrup/TET | /OBIECTE/130227/SQLQuery2.sql | UTF-8 | 120 | 2.6875 | 3 | [] | no_license | select * from rulaje r
where r.Data<='2012-01-01' and r.Cont like '4428%'
order by r.data,r.Rulaj_credit, r.Rulaj_debit | true |
e0ffb6bfc22d19b11fe0ad323d8fc9996300ecd6 | SQL | csdev19/smiledu-trabajo | /scripts.sql | UTF-8 | 2,058 | 2.75 | 3 | [] | no_license | INSERT INTO public.clientes(
nombres, apellidos, fecha_nacimiento, correo, direccion)
VALUES ('cristian', 'sotomayor gonzales', to_date('1998-12-19', 'YYYY-MM-DD'), 'cristiansotomayor1913@gmail.com', 'Las Lilas mzn B lote 5'),
VALUES ('luis', 'sotomayor rivera', to_date('1950-04-24', 'YYYY-MM-DD'), 'cristiansotomayo... | true |
11f8f5daf47b4fabaf6df1454e99e7b9673070f7 | SQL | matt-winkler/demo-subdirectories | /dbt/tests/models/staging/tpch/stg_tpch_customers.sql | UTF-8 | 412 | 2.953125 | 3 | [] | no_license | with source as (
select * from {{ source('tpch', 'customer') }}
),
renamed as (
select
c_custkey as customer_key,
c_name as name,
c_address as address,
c_nationkey as nation_key,
c_phone as phone_number,
c_acctbal as account_balance,
c_mktsegment... | true |
990cd9595c458592f98272274bc6dc9fba6a2558 | SQL | jeremyke/PHPBlog | /Mysql/MySQL基础+高级篇-尚硅谷学习笔记/随堂资料/code/day4/子查询经典案例.sql | UTF-8 | 4,248 | 4.34375 | 4 | [
"MIT"
] | permissive | # 1. 查询工资最低的员工信息: last_name, salary
#①查询最低的工资
SELECT MIN(salary)
FROM employees
#②查询last_name,salary,要求salary=①
SELECT last_name,salary
FROM employees
WHERE salary=(
SELECT MIN(salary)
FROM employees
);
# 2. 查询平均工资最低的部门信息
#方式一:
#①各部门的平均工资
SELECT AVG(salary),department_id
FROM employees
GROUP BY department_id
#②查询... | true |
7545d4f840ee9ac614bf57059b83b822a4a6a4ab | SQL | txteam/tsc | /dbscript/mysql/01basisScript/operator/tables/OPER_OPERATOR.sql | UTF-8 | 689 | 2.84375 | 3 | [] | no_license | DROP TABLE OPER_OPERATOR;
CREATE TABLE OPER_OPERATOR(
id varchar(64) not null,
valid smallint DEFAULT 1 NOT NULL,
pwdErrCount smallint,
historyPwd varchar(255),
organizationId varchar(64),
password varchar(255),
invalidDate datetime,
lastUpdateDate datetime not null default now(),
pwdUpdateDate datet... | true |
66a9d518cf79c2cb9bb724410b030ca74bb510a1 | SQL | stacycjohnson/database-exercises | /3.6_functions_exercises.sql | UTF-8 | 2,930 | 4 | 4 | [] | no_license | -- Exercise Goals
-- 1. Copy the order by exercise and save it as 3.6_functions_exercises.sql.
USE employees;
-- 2. Update your queries for employees whose names start and end with 'E'.
-- Use concat() to combine their first and last name together as a single column named full_name.
SELECT first_name, last_name, CONCA... | true |
dc3002fbb3b20e32ffd026657f707bd9f516d015 | SQL | jabautista/GeniisysSCA | /src/main/resources/sql/procedures/deferred_extract2_prior_dtl.prc | UTF-8 | 54,272 | 3.1875 | 3 | [] | no_license | DROP PROCEDURE CPI.DEFERRED_EXTRACT2_PRIOR_DTL;
CREATE OR REPLACE PROCEDURE CPI.Deferred_Extract2_Prior_Dtl(p_ext_year NUMBER,
p_ext_mm NUMBER,
p_year NUMBER,
... | true |
9b5a10d31a0ca7b7b64c54b0945e6e7a23994ce2 | SQL | KulR/technotrack_bd | /3_lect/3_lect.sql | UTF-8 | 412 | 3.390625 | 3 | [] | no_license | USE track_lect2;
select * from users inner join (
select user_id
from payments
group by user_id
order by sum(payment_sum) desc
limit 3)
using(user_id);
-- user_id login reg_dttm
-- 82 login_82 2018-09-28 15:17:46
-- 38 login_38 2018-09-23 20:27:39
-- 85 login_85 2018-08-27 02:36:25
select (select count(*) from ... | true |
464b3f8526734503b98735ad04fe2c14dc5e06a3 | SQL | tilemapjp/OpenTileMap | /sql/sqlite.sql | UTF-8 | 3,559 | 3.390625 | 3 | [
"MIT"
] | permissive | CREATE TABLE IF NOT EXISTS sessions (
id CHAR(72) PRIMARY KEY,
session_data TEXT
);;
CREATE TABLE IF NOT EXISTS users (
user_id INTEGER PRIMARY KEY AUTOINCREMENT,
site varchar(20) NOT NULL,
site_id varchar(100) NOT NULL,
user_name varchar(100) NOT NULL
);;
CREATE INDEX IF NOT E... | true |
8a78d3d92dacbb90688da962dbf0d44def3169e0 | SQL | zavh/cdrconverter | /webcdr.sql | UTF-8 | 3,306 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 04, 2019 at 10:31 PM
-- Server version: 5.7.25-0ubuntu0.16.04.2
-- PHP Version: 7.1.27-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!... | true |
b0e1866366b11b5be37e7de04e1b0146b2334ce5 | SQL | laudarch/shopmobapp | /shopmoba_sma.sql | UTF-8 | 6,517 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jul 11, 2020 at 06:11 PM
-- Server version: 10.3.23-MariaDB-cll-lve
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... | true |
d1b0e58605ee6bf119836b1db3dd2110c8136a6c | SQL | jhassan/shoes | /db/party_name.sql | UTF-8 | 1,301 | 2.875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 08, 2016 at 06:20 PM
-- Server version: 5.6.12-log
-- 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 |
e27bfce99edf89f63f96c275748cd2618c91374c | SQL | hermitAT/devtips-midterm | /db/schema/01_schema.sql | UTF-8 | 1,740 | 3.796875 | 4 | [] | no_license | DROP TYPE IF EXISTS type CASCADE;
CREATE TYPE type as enum('link', 'image', 'video', 'markdown', 'code');
DROP TABLE IF EXISTS users CASCADE;
DROP TABLE IF EXISTS tags CASCADE;
DROP TABLE IF EXISTS resources CASCADE;
DROP TABLE IF EXISTS resources_tags CASCADE;
DROP TABLE IF EXISTS comments CASCADE;
DROP TABLE IF EXIS... | true |
87fae319b05bf5ea7706ac1b4dbdfc904728753e | SQL | Yabdil/Postgis | /Inner_polygon_query.sql | UTF-8 | 698 | 3.640625 | 4 | [] | no_license | -- We had multiple iner polygons inside our polygons, the goal was to find a query removing the iner polygon
SELECT ST_GeomFromText(polygone) as geom
from (
SELECT st_astext(ST_MakePolygon(linear)) as polygone
from (
SELECT st_astext
((ST_dump
(st_boun... | true |
985891ab3a141f662cb5cb0f9d176a1fc2b19489 | SQL | f2h2h1/unprofitable_00 | /teaching/db.sql | UTF-8 | 5,993 | 2.796875 | 3 | [] | no_license | /*
SQLyog Community Edition- MySQL GUI v6.54
MySQL - 5.5.25a : Database - teaching
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL... | true |
45bcb77315c142e82759cb2f9cd2f138b4061725 | SQL | vanevskidarko/Homeworks | /Homework57/courses_hiking.sql | UTF-8 | 671 | 4.375 | 4 | [] | no_license | CREATE TABLE clients(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
client_name VARCHAR(100),
project_id INT;
CREATE TABLE projects(
id INT NOT NULL PRIMARY KEY,
client_id INT NOT NULL,
project_lead_id INT NOT NULL
);
CREATE TABLE employees (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(50),
last_nam... | true |
2e6858550c8831c2116e3315238662a7597b91da | SQL | elrey99/Mintic22-Java | /Reto4/reto4.sql | UTF-8 | 1,612 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 24-08-2021 a las 19:36:03
-- Versión del servidor: 10.4.16-MariaDB
-- Versión de PHP: 7.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
60b0af99205367ca9f54fe199c3388951ed3cb4f | SQL | MrChozo/misc-code-snippets | /SQL/handy-postgresql.sql | UTF-8 | 3,439 | 4 | 4 | [] | no_license | /* Handy PostgreSQL statements */
-- Add a column
ALTER TABLE forms ADD COLUMN is_deleted boolean;
-- Remove a column
ALTER TABLE forms DROP COLUMN fileobject_id;
-- Set data in a column
UPDATE forms SET is_deleted = FALSE;
UPDATE users
SET is_admin = TRUE
,status = 10
WHERE id = 1;
-- Set data in a column by a... | true |
c866eee2985e27e0c8ecdc6ee5f250bd18309638 | SQL | alexey-zayats/pass-migrations | /migrations/20200415121123_constraints.down.sql | UTF-8 | 3,914 | 2.703125 | 3 | [] | no_license |
-- транспортные пропуска
-- passes
ALTER TABLE passes DROP FOREIGN KEY fk_passes_created;
ALTER TABLE passes DROP KEY idx_passes_district;
ALTER TABLE passes DROP KEY idx_passes_lastname;
ALTER TABLE passes DROP KEY idx_passes_created;
ALTER TABLE passes DROP KEY idx_passes_bid;
ALTER TABLE passes MODIFY COLUMN id IN... | true |
85aefbca4bfcf9ecbf4b5b1a062027232cf32410 | SQL | bao-bao/CSE-560 | /create.sql | UTF-8 | 5,551 | 3.5 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS order_track_user(
otu_id INT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL,
otu_user_name VARCHAR(32) NOT NULL UNIQUE,
otu_password VARCHAR(32) NOT NULL,
otu_name VARCHAR(128) NOT NULL,
otu_role SMALLINT NOT NULL,
otu_is_active BOOLEAN NOT NULL,
otu_change_time TIMESTAMP... | true |
dbde2d193839c342fffa5ec923e06bc88fe94bc1 | SQL | saturnkr/tezis_Directory | /modules/core/build/db/30-thesis/update/postgres/04/04-460-updateStartDateTimeFactTask.sql | UTF-8 | 380 | 3.09375 | 3 | [] | no_license | --$Id: 04-460-updateStartDateTimeFact.sql 4121 2012-04-04 14:06:08Z subbotin $
update tm_task t set start_datetime_fact = (select max(create_ts) from wf_assignment a where a.name = 'Started' and a.card_id = t.card_id)
where t.card_id in (select tin.card_id from tm_task tin inner join wf_card c on c.id = tin.card_id wh... | true |
bd51580654c8194203ef92ba52c8084fb9ceb9fa | SQL | JhonnyHGoulart/curso-postgreSQL-alura | /scripts-curso/aluno3.sql | UTF-8 | 832 | 3.453125 | 3 | [] | no_license |
create table aluno(
id serial,
nome varchar(255),
cpf char(11),
obs text,
idade integer,
salario numeric,
altura real,
ativo boolean,
data_nascimento date,
hora_aula time,
data_matricula timestamp
);
select * from aluno;
insert into aluno(
nome,
cpf,
obs,
idade,
salario,
altura,
ativo,
dat... | true |
af8c5a383f102b4e969f4ed2e48785997cfb3442 | SQL | envolute/base | /_joomla/_applications/agecefpb/transactionsInvoices/transactionsInvoices.sql | UTF-8 | 4,583 | 4.09375 | 4 | [] | no_license | --
-- Estrutura da tabela `cms_agecefpb_transactions_invoices`
--
CREATE TABLE IF NOT EXISTS `cms_agecefpb_transactions_invoices` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`due_date` date NOT NULL,
`description` varchar(30) NOT NULL,
`custom_desc` varchar(30) NOT NULL,
`note` varchar(255) NOT NULL,
`state` t... | true |
ad47a049a737c113eae4cca3902bc044b51aa834 | SQL | Vinnys2/projeto_final | /jurassic_park_ajax .sql | UTF-8 | 5,039 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.9
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tempo de Geração: 18/11/2019 às 17h51min
-- Versão do Servidor: 5.5.20
-- Versão do PHP: 5.3.9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
49c2c56f05aedfea88af8f604568a4b002beaff3 | SQL | a335252661/myssm | /src/main/resources/mysql/maventest.sql | UTF-8 | 8,226 | 3.265625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50717
Source Host : localhost:3306
Source Database : maventest
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2019-03-07 16:10:06
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... | true |
2b12c18102e023a8405d4381b645e9b8e1881722 | SQL | devry12/FP-Baper2-Library | /DB/library.sql | UTF-8 | 4,510 | 2.921875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3307
-- Generation Time: May 29, 2018 at 09:01 PM
-- Server version: 10.2.14-MariaDB
-- PHP Version: 5.6.35
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... | true |
b049e6a297bf263a71ad9dd09dce930fd2179d8b | SQL | yiwocao2017/cswstdmall | /docs/schema/schema_std_mall.sql | UTF-8 | 17,281 | 3.625 | 4 | [] | no_license | DROP TABLE IF EXISTS `tduijie_caigopool`;
CREATE TABLE `tduijie_caigopool` (
`code` varchar(32) NOT NULL COMMENT '编号',
`name` varchar(255) DEFAULT NULL COMMENT '名称',
`type` varchar(4) DEFAULT NULL COMMENT '类型',
`rate` decimal(18,8) DEFAULT NULL COMMENT '1个三方币,兑换rate个菜狗币',
`amount` bigint(20) DEFAULT NULL COM... | true |
95ed4fa8200c02bc25ad3851a6515339af90495b | SQL | sergtimosh/TwitterDB | /queries/4_usersWithAtLeastOneFollower.sql | UTF-8 | 222 | 3.875 | 4 | [] | no_license | SELECT u.user_id, u.username users_with_followers, COUNT(f.followed_by_id) followers_number
FROM user u
JOIN follower f
ON f.user_id = u.user_id
GROUP BY f.user_id
HAVING followers_number >=1
ORDER BY followers_number; | true |
c09e04cb79cc8b46947badc3c22f30c7a42f6406 | SQL | mysql-gr-jp/old | /mysqlml/mysql/msg/4168/2/nss-mysql.sql | UTF-8 | 1,495 | 2.96875 | 3 | [] | no_license | # MySQL dump 8.13
#
# Host: localhost Database: nss_mysql
#--------------------------------------------------------
# Server version 3.23.37-Max-log
#
# Table structure for table 'groups'
#
DROP TABLE IF EXISTS groups;
CREATE TABLE groups (
group_id int(11) NOT NULL auto_increment,
group_name varchar(30) defau... | true |
70cb9d893d9b71ccf065e396493f3b1ba79fe3d6 | SQL | zzzpp1/python | /sql/ddl.sql | UTF-8 | 964 | 3.5625 | 4 | [] | no_license | -- **数据库级别:**
-- 显示所有数据库
show databases;
-- 进入某个数据库
use student_sys;
-- 创建一个数据库
create database student_sys;
-- 创建指定字符集的数据库
create database student_sys character set utf8;
-- 显示数据库的创建信息
show create database student_sys;
-- 修改数据库的编码
alter database student_sys character set gb2312;
-- 删除一个数据库
dro... | true |
67482163b4a4a4923faecd5d19a57b8517d64a91 | SQL | kazexu12/HuaheeKaraoke | /src/main/resources/SQL/TABLE_SCHEMA.sql | UTF-8 | 4,121 | 3.25 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS Songs (
song_id TEXT,
name TEXT,
artist TEXT,
album TEXT,
genre TEXT,
duration INTEGER,
date_created NUMERIC,
date_modified NUMERIC,
PRIMARY KEY(song_id)
);
CREATE TABLE IF NOT EXISTS Users (
user_id TEXT,
privillage INTEGER,
name TEXT,
pw_hash TEXT,
first_name TEXT,
la... | true |
18a94e914f74051dc32c0034bc8e45cd480bc4ff | SQL | amethystdragon/cs386-lab5 | /import.sql | UTF-8 | 2,408 | 3.265625 | 3 | [] | no_license | --
-- Database: `mydb`
--
--
-- Dumping data for table `ability`
--
INSERT INTO `ability` (`ability_ID`, `name`, `description`, `level_requirement`) VALUES
(0, 'None', 'This item has no special ability.', 0),
(1, 'Electricity', 'Strikes the opponent with electricity with each hit', 900),
(2, 'Fire', 'Flame ON!', 25),
(... | true |
2b68b440518c6b2c135164ab029d5e3fe70a0f62 | SQL | daniiel/cursos | /Oracle 11g - Introduction to SQL/courselabs/plpu/solns/sol_09_02_b.sql | UTF-8 | 886 | 3.203125 | 3 | [] | no_license | CREATE OR REPLACE PACKAGE BODY jobs_pkg IS
TYPE jobs_tab_type IS TABLE OF jobs%rowtype
INDEX BY jobs.job_id%type;
jobstab jobs_tab_type;
PROCEDURE initialize IS
BEGIN
FOR rec_job IN (SELECT * FROM jobs)
LOOP
jobstab(rec_job.job_id) := rec_job;
END LOOP;
END initialize;
FUNCTION get_m... | true |
980275f09b5fb47384e9695bb8e172eb8ae0fd1d | SQL | groya52/sqlserver | /Security/_Scripts/CREATE USER FOR LOGIN.sql | WINDOWS-1251 | 759 | 2.984375 | 3 | [] | no_license | /*
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-user-transact-sql
CREATE USER user_name
[
{ FOR | FROM } LOGIN login_name
]
[ WITH <limited_options_list> [ ,... ] ]
[ ; ]
<limited_options_list> ::=
DEFAULT_SCHEMA ... | true |
5c5f1372492fe8fa433e3e5f4609a1334f93686f | SQL | BackupTheBerlios/osgirepo | /thirdparty-osgi/cayenne/cayenne-1.1RC3/doc/tutorials/cayenne-tapestry-app/tutorialdb.sql | UTF-8 | 2,916 | 3.765625 | 4 | [
"Apache-2.0",
"BSD-2-Clause"
] | permissive |
# Uncomment these if you already have ARTIST, GALLERY and PAINTING tables.
# DROP TABLE ARTIST;
# DROP TABLE GALLERY;
# DROP TABLE PAINTING;
CREATE TABLE ARTIST (
DATE_OF_BIRTH DATE NULL,
ARTIST_ID INT NOT NULL,
ARTIST_NAME CHAR(254) NOT NULL,
PRIMARY KEY (ARTIST_ID)
);
CREATE TABLE GALLERY (
GALLERY_ID IN... | true |
33f8b9be4d979d11925fb45ef8e33bb8150bd7c2 | SQL | phamxuansang241/Database-Assigment | /Stored Procedure/SQL script/insert_student.sql | UTF-8 | 381 | 3.15625 | 3 | [] | no_license | DELIMITER ??
CREATE PROCEDURE insert_student (
IN new_ID VARCHAR(5),
IN new_name VARCHAR (20),
IN new_deptname VARCHAR (20),
IN new_totcred DECIMAL(3,0)
)
BEGIN
INSERT INTO student (ID, name, dept_name, tot_cred)
VALUES (new_ID, new_name, new_deptname, new_totcred);
END ??
DELIMITER ;
CALL insert_student... | true |
c50c6a2755167eece007e42d4887b696be880d48 | SQL | gonghs/cooperate-blog | /blog-server/sql/table.sql | UTF-8 | 1,781 | 3.25 | 3 | [] | no_license | create table user_info
(
id varchar(32) default '' comment '主键'
primary key,
username varchar(50) not null comment '用户名',
account varchar(50) not null comment '账号',
password varchar(50) not null comment '密码',
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
create_user_id varchar(32) not ... | true |
f830f1b0e69dfce46ec460164db4b110de652aed | SQL | akash1968/Day25_ER-Diagram-Employee-Payroll-Problem-UC8--UC12 | /UC8_AddedNewColumns_Dept_PhoneNo_Address.sql | UTF-8 | 381 | 2.875 | 3 | [] | no_license |
--UC 8 : Ability to extend employee_payroll data to store employee information like employee phone, address and department
use payroll_services;
select * from employee_payroll;
--Adding new columns
alter table employee_payroll add
PhoneNo bigint,
Address varchar(600) not null default 'ADDRESS NOT AVAILABLE',
Departm... | true |
ba6d6e519d46e233883c8a52ef00d9b463c7b8cb | SQL | mafru/orfograf | /install.sql | UTF-8 | 409 | 2.59375 | 3 | [] | no_license | DROP TABLE IF EXISTS `{#}complaints`;
CREATE TABLE IF NOT EXISTS `{#}complaints` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`orfo` varchar(300) NOT NULL,
`comment` varchar(255) DEFAULT NULL,
`url` varchar(255) NOT NULL,
`author` varchar(50) NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP O... | true |
8d623582887fb36b3a6dcb78efd24738e164f6a9 | SQL | TadeunASCIImento/java | /Jdbc/src/daos/script_banco.sql | UTF-8 | 422 | 3.078125 | 3 | [] | no_license |
create database bdloja;
use bdloja;
create table Usuario(
id int auto_increment primary key,
nome varchar(100) not null,
cpf varchar(20) not null unique,
usuario varchar(20) not null unique,
senha varchar(10) not null unique
);
create table Cupom(
id int auto_increment primary key,
codigo int not ... | true |
202a8db9a647c9ec35ac22579e406414e754fbd1 | SQL | CbGeSky/Datathon2019 | /extract_data_test.sql | UTF-8 | 2,230 | 3.8125 | 4 | [
"MIT"
] | permissive | -- extract data
-- na in table labitems itemid=50983
SET search_path to mimiciii;
SELECT
subject_id,hadm_id,min(charttime) as chartime_new,valuenum
FROM labevents
where itemid = 50983 and valuenum > 145
GROUP BY subject_id,hadm_id,valuenum limit 100 ;
--查询指定项目
SELECT COUNT(DISTINCT subject_id) FROM chartevents
WH... | true |
77f742923afd13125dfb40e044ddd0658ece1117 | SQL | amirkhaniansev/some-csharp | /SQL_Queries_With_AdventureWorks_Database/SQLQuery5.sql | UTF-8 | 283 | 3.234375 | 3 | [
"MIT"
] | permissive | --Puts the results into groups after retrieving only the rows
--with list prices greater than $900.
use [AdventureWorks2]
select ProductModelID,sum([Weight]) as WeightSum from Production.Product
as GroupedSubTableOfProducts
where ListPrice > 900
group by ProductModelID
| true |
5733a225934427b889a9df6197c5320ed549324a | SQL | opengauss-mirror/openGauss-server | /src/test/regress/sql/ce_drop_schema.sql | UTF-8 | 624 | 2.703125 | 3 | [
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference",
"PostgreSQL",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-unicode",
"LicenseRef-scancode-warranty-disclaimer",
"curl",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"CC-BY-4.0",
... | permissive | \! gs_ktool -d all
\! gs_ktool -g
CREATE SCHEMA ce_drop_schema;
SET SEARCH_PATH TO ce_drop_schema;
CREATE CLIENT MASTER KEY cmk1 WITH ( KEY_STORE = gs_ktool , KEY_PATH = "gs_ktool/1" , ALGORITHM = AES_256_CBC);
CREATE COLUMN ENCRYPTION KEY cek1 WITH VALUES (CLIENT_MASTER_KEY = cmk1, ALGORITHM = AEAD_AES_256_CBC_HMAC_S... | true |
acf38f3f069f3e9a81f176abdb8e71c8bfe0676c | SQL | WalissonPires/postgres-replication | /pg-logical-rep/init.sql | UTF-8 | 3,183 | 3.171875 | 3 | [] | no_license | -- Micro 1
CREATE DATABASE micro1;
\c micro1;
CREATE TABLE public.categories(
id SERIAL PRIMARY KEY,
name varchar(50) NOT NULL
);
CREATE TABLE public.brands(
id SERIAL PRIMARY KEY,
name varchar(50) NOT NULL
);
CREATE TABLE public.products(
id SERIAL PRIMARY KEY,
description varcha... | true |
7016e83d06b4be4232c0132a4051ab025324b58d | SQL | luphuowng/web-ban-hang | /store.sql | UTF-8 | 4,412 | 3.921875 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS `store`;
USE `store`;
DROP TABLE IF EXISTS `categories`;
CREATE TABLE `categories`
(
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`active` tinyint(1) DEFAULT '1',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
... | true |
3e0b967d64868b67b781abaa1918ebc50253b149 | SQL | VizualAbstract/NostalgiaEQ-Database | /cust_ext_hist_lockouts.sql | UTF-8 | 57,329 | 2.6875 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.0.21-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 11.3.0.6295
-- -----------------------------------------------... | true |
52e7d824ec7db8bbf876c8f91733c4ac7ae839e4 | SQL | federicodonner/midosis_api | /midosis.sql | UTF-8 | 7,302 | 2.875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Aug 18, 2020 at 11:40 PM
-- Server version: 5.7.26
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
f925a1ab1ca5d40bdfa0268deb3215e3f0864024 | SQL | JoyJoke/Fantastic-Shopping-System | /shopping/src/main/resources/sql/Orders.sql | UTF-8 | 551 | 3.703125 | 4 | [] | no_license | -- auto Generated on 2019-05-23
-- DROP TABLE IF EXISTS orders;
CREATE TABLE orders (
order_id INT(11) NOT NULL AUTO_INCREMENT
COMMENT 'id',
user_id INT(11) NOT NULL DEFAULT -1
COMMENT 'userId',
`number` VARCHAR(50) NOT NULL DEFAULT ''
COMMENT 'number',
create_time DATE NOT NULL D... | true |
ebac42134bd12be524f3915fec9cf46d82beafdd | SQL | NCIP/BEMT | /bemt_grails_app/sql/non-nih user accounts.sql | UTF-8 | 2,400 | 3.21875 | 3 | [
"BSD-3-Clause"
] | permissive | select id, version, email, name_first, name_last, password, date_created, date_modified, expiration_date, notification_sent
from bemtuser
where email not in ('abhi@gmail.com','david.tabor@nih.gov','benjamin.fombonne@nih.gov','fombonnebe@mail.nih.gov','jonathan.dill@nih.gov','b.fombonne@gmail.com','sailaja.mareedu@n... | true |
aaca2f33b1dba13a975cd596a2d88cca5474f131 | SQL | BulldogDrummond/etmod | /database/etlegacy/player_admin.sql | UTF-8 | 2,331 | 2.8125 | 3 | [] | no_license | -- -------------------------------------------------------------------
-- ET Database
-- -------------------------------------------------------------------
-- Table : player_admin
-- Filename : etlegacy/player_admin.sql
-- DB Version : 1.0
-- -------------------------------------------------------------------... | true |
d9610e3332e579a32a2e3ebe6f98ac2b7951ae11 | SQL | hasansami75/Patient-Information-System | /sql/pis.sql | UTF-8 | 6,694 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 27, 2018 at 10:17 PM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
70701152fe25d27d7eba955c77c333c3d76dafc4 | SQL | abhaloo/CharacterBuilder- | /characterbuilder.sql | UTF-8 | 5,886 | 3.265625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 14, 2019 at 09:11 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
c47a3c9fe23cd24f7164ccbfc603587b0f1e3034 | SQL | MR-TY/aop_mybatis | /optimistic-lock-master/src/main/resources/db/optimisticlock.sql | UTF-8 | 1,391 | 3.140625 | 3 | [
"MIT"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50720
Source Host : localhost:3306
Source Database : optimisticlock
Target Server Type : MYSQL
Target Server Version : 50720
File Encoding : 65001
Date: 2019-03-25 16:41:55
*/
SET FOREIGN_KEY_CHECKS=0... | true |
8f5b19036d5c2dbc5fcbfd28851ada22e249f74b | SQL | microsoft/pgtoolsservice | /pgsmo/objects/role/templates/9.1_plus/variables.sql | UTF-8 | 926 | 3.265625 | 3 | [
"MIT"
] | permissive | {#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2017, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#}
SELECT
split_part(rolconfig, '=', 1) AS name, replace(rolconfig, split_part(rolconfig, '=', 1) || '=', '') AS value, NULL::text AS database
FROM
(SELECT
... | true |
ce6a965b97feefd28bd90c6470b30d4231c99c6d | SQL | ayuvi/sql_commands | /UNIQUE INDEX.sql | UTF-8 | 807 | 3.84375 | 4 | [] | no_license | 1. konsep dasar unique index
2. membuat unique index bersama create table
3. membuat unique index dengan alter table
4. membuat unique index dengan create unique index
5. unique index di mysql bisa menyimpan null leih dari 1
---------------------------------------------------------
-- cara dengan create
create table ... | true |
e0706c42179bde3859746639cb38cff5606abeca | SQL | meta-kritikgarg/DBMSSession2 | /assignment4/showResult.sql | UTF-8 | 141 | 3.78125 | 4 | [] | no_license | Select c.zipcode , c.city_name , s.state_name
FROM cities c
LEFT JOIN states s
ON s.idstate = c.idstate
ORDER BY s.state_name , c.city_name; | true |
4ce9926d968920419ae25eb9d124ef83742d7656 | SQL | alldatacenter/alldata | /dts/chunjun/chunjun-examples/sql/elasticsearch6/es2es.sql | UTF-8 | 638 | 2.859375 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | permissive | CREATE TABLE es6_source(
id int
, phone bigint
, qq varchar
, wechat varchar
, income decimal(10,2)
, birthday timestamp
, today date
, timecurrent time
)
WITH(
'connector' ='es-x',
'hosts' ='localhost:9200',
'index' ='mowen',
'document-type' = '_doc');
CREATE TABLE es6_sink(
id ... | true |
8349d6c703acc8896dd46003c9937880596c92c2 | SQL | mebelousov/antlr_psql | /src/test/resources/sql/create_view/c6369c6f.sql | UTF-8 | 166 | 2.546875 | 3 | [
"MIT"
] | permissive | -- file:create_view.sql ln:104 expect:true
CREATE VIEW v4_temp AS
SELECT t1.a AS t1_a, t2.a AS t2_a
FROM base_table t1, temp_table t2
WHERE t1.id = t2.id
| true |
f4b01e90ae07b58474399350721e5232b0757fe7 | SQL | brycemcwhirter/DatabasesProject | /modifications.sql | UTF-8 | 1,217 | 3.125 | 3 | [] | no_license | DROP TABLE IF EXISTS `user`;
SET character_set_client = utf8mb4;
CREATE TABLE `user` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`password_hash` varchar(128) NOT NULL,
`favoriteTeam` varchar(50) DEFAULT NULL,
`favoriteYear` int(11) DEFAUL... | true |
c09e2106f9dbd0cd526486af1822861d46b702e6 | SQL | jtcasper/listening.to | /migrations/createPlaying.sql | UTF-8 | 250 | 3.078125 | 3 | [] | no_license | CREATE TABLE PLAYING (
ACCOUNT_ID TEXT NOT NULL,
TRACK_ID TEXT NOT NULL,
AT_TIME TIMESTAMP NOT NULL,
PRIMARY KEY(ACCOUNT_ID, TRACK_ID, AT_TIME),
FOREIGN KEY(ACCOUNT_ID) REFERENCES ACCOUNT(ID),
FOREIGN KEY(TRACK_ID) REFERENCES TRACK(ID)
)
| true |
ae85a331dac98cf1e09871b6a42fcdc4bc9b1e65 | SQL | zhangshuo1996/oracle_learn | /3_1.sql | UTF-8 | 647 | 3 | 3 | [] | no_license | desc emp;
select empno, ename, job, sal
from dept
where sal >= 1500
order by job, sal desc;
select ename
from emp
-- 3-16
select empno, ename, job, sal
from emp
where sal >= 1500
order by job, sal desc
-- 3-21
select empno, ename, job, sal
from dept
where sal >= 1500
order by job, sal desc
--3-25
select empno, ena... | true |
bfa3f10da7eea492447651eb77d2cee5e898eb47 | SQL | pescador-consulting/hunelect | /dbscripts/Table/county_results.sql | UTF-8 | 293 | 2.90625 | 3 | [] | no_license | CREATE TABLE gerry.county_results
(
id serial NOT NULL,
district_id int REFERENCES gerry.district(id),
election_id int REFERENCES gerry.election(id) ON DELETE CASCADE,
pname varchar(8000) null,
orderrank int null,
results int null,
CONSTRAINT county_results_pkey PRIMARY KEY (id)
) | true |
26d1a6a202652a3b45fbbb0a6d18c1982d3311e0 | SQL | Xiedlq/PassiveRadar-2 | /init.sql | UTF-8 | 269 | 2.953125 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS info (
id INTEGER PRIMARY KEY AUTOINCREMENT,
client TEXT,
ap TEXT,
tag TEXT,
rssi INTEGER,
snr INTEGER,
x REAL,
y REAL,
date DATE
);
CREATE INDEX IF NOT EXISTS idx_comb ON info(client, ap, date); | true |
8865107ec263fcfda63550db9aae045045d2f6fb | SQL | francisco-filho-educ/Scripts-SQL | /ensino_medio_noturno_regular_ago_2021.sql | UTF-8 | 2,483 | 3.609375 | 4 | [] | no_license | with qualif as (
select
ci_turma,
1 fl_qualifica
from academico.tb_turma tt
join academico.tb_turmadisciplina ttd on ttd.cd_turma = tt.ci_turma
join academico.tb_disciplinas td on td.ci_disciplina = ttd.cd_disciplina
where
tt.nr_anoletivo::int = 2021
and tt.cd_prefeitura::int = 0
and tt.fl_tipo_seriacao = 'RG'
and... | true |
5ef0582488f85d988ca33a04a325e368500e862d | SQL | Deniscapp/web-scripting-php-rails | /database.sql | UTF-8 | 3,381 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.10
-- http://www.phpmyadmin.net
--
-- Host: localhost:8889
-- Generation Time: Feb 22, 2016 at 06:34 AM
-- Server version: 5.5.42
-- PHP Version: 5.6.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `denis`
--
-- ------------------------------... | true |
c7d5bd4f1a86370d069a840fbdc14b27f00d6c5e | SQL | Orobel99/Master | /Consultas_Customers.sql | UTF-8 | 1,369 | 4.03125 | 4 | [] | no_license |
--Se requiere consultar todos los clientes con más de 5 contactos--
SELECT H.CUSTOMER_ID, H.CUSTOMER_NAME1,H.RFC_ID,H.CUSTOMER_EMAIL
FROM Customer_Header H
WHERE (SELECT COUNT(HC.CONTACT_ID)
FROM Customer_Header HC
WHERE H.CONTACT_ID = HC.CONTACT_ID) > 5;
--Se requiere conocer a los cont... | true |
9be5d1594d159a3b55a8bce3d6ba9fa5bbbb09d9 | SQL | ActualSailorCat/CIVITAS-Sassanid-Release | /Archives/CIVITAS Sassanid v3.01 092919 1353233980 All Leaders/CIVITAS_Sassanid_Leader_Settings.sql | UTF-8 | 1,691 | 2.9375 | 3 | [] | no_license | --==========================================================================================================================
--
-- .
-- |\
-- | \
-- | \
-- | \
-- | \ CIVITAS Sassanid Leader Settings
-- | \ CREDIT AND THAN... | true |
7435920405b8882f31bd21986a9a10dfeae1a83b | SQL | mlucasuriceredubr/pindura | /banco.sql | UTF-8 | 3,160 | 3.15625 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- qua 18 nov 2020 13:48:47
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON... | true |
1d9b55d68f3e7d26f3d6db02f32d80e70a3827e0 | SQL | wormeno/jpa-CanchasDePaddle | /schema.sql | UTF-8 | 3,072 | 3.1875 | 3 | [] | no_license |
create table Canchas (
id bigint generated by default as identity (start with 1),
esta_iluminada boolean,
nombre varchar(255),
color_codigo bigint,
primary key (id)
)
create table Colores (
codigo bigint generated by default as identity (start with 1),
... | true |
e22b412d6a8be4249ae8da02d9dff339da188c82 | SQL | PhysTony/asd9823j9das_MFBI_and_DA | /Section_13_MySQL-Aggregate_functions/IFNULL() and COALESCE().sql | UTF-8 | 1,503 | 4.0625 | 4 | [] | no_license | /* IFNULL() and COALESCE() do not make any changes to the data
set. They merely create and output where certain data values
appear in place of NULL values.
*/
USE employees;
SELECT
*
FROM
departments_dup;
/* IFNULL(expression_1, expression_2):
returns the first of the two indicated values if the data va... | true |
1a7ac2464d3093d10fd3415665a4480908cafbe8 | SQL | kityre/gsb_hugoD | /gsb_hugoD.sql | UTF-8 | 13,600 | 3.375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mar. 15 jan. 2019 à 22:16
-- Version du serveur : 5.7.23
-- Version de PHP : 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... | true |
1d0f4912ecbd605847ae38eba5f5f09624dfcb16 | SQL | griha01/Code_library | /Базы данных/3-я работа Вариант 02.sql | UTF-8 | 6,232 | 3.890625 | 4 | [] | no_license | Create database var2 COLLATE='utf8_unicode_ci';
use var2;
DROP TABLE IF EXISTS `Ингредиенты`;
DROP TABLE IF EXISTS `Рецепты`;
DROP TABLE IF EXISTS `Продукты`;
CREATE TABLE `Продукты`(
`№ позиции` INT NOT NULL,
`Наименование продукта` VARCHAR(20) NOT NULL,
`Единицы измерения` VARCHAR(10) NOT NULL,
PRIMARY KEY (`№ п... | true |
6abba6c2025c928fb770832392b33c454e4fa68f | SQL | tchiluanda/caixa | /MJ_1_Mov_Lim_Saque.sql | UTF-8 | 2,990 | 3.21875 | 3 | [] | no_license | select a11.ID_ANO_LANC ID_ANO,
a11.ID_MES_LANC ID_MES,
a11.ID_DIA_LANC ID_DIA,
max(a110.NO_DIA_COMPLETO) NO_DIA_COMPLETO,
a14.ID_ITEM_INFORMACAO ID_ITEM_INFORMACAO,
max(a116.NO_ITEM_INFORMACAO) NO_ITEM_INFORMACAO,
max(a116.CO_ITEM_INFORMACAO) CO_ITEM_INFORMACAO,
a19.ID_FONTE_RECURSO ID_FONTE_RECURSO,
ma... | true |
cd69107be99bc6155e82fb7efea3db1d1a29fb8c | SQL | cgimazane/cours-php1 | /sql/createTables.sql | UTF-8 | 320 | 3.03125 | 3 | [] | no_license | CREATE TABLE personne (
nom VARCHAR (255),
prenom VARCHAR (255),
sexe VARCHAR (1),
naissance date,
lunettes BOOLEAN,
bureau VARCHAR (255),
PRIMARY KEY(nom,prenom),
FOREIGN KEY (bureau) REFERENCES bureau(nom)
);
CREATE TABLE bureau (
nom VARCHAR (255) ,
batiment VARCHAR (1),
etage int,
PRIMARY KEY (nom)
);
| true |
2178fc41549aad14887dd5f49d9853ff21873dee | SQL | cd1996/Modules | /SQLQuery_TaskJoins.sql | UTF-8 | 682 | 3.421875 | 3 | [] | no_license | select * from Staff_Master;
select * from Department_master;
select staff.staff_name,staff.salary,dept.Dept_code,dept.dept_name
from staff_master staff inner join Department_master dept
on staff.Dept_Code=dept.Dept_code where staff.salary>20000
select staff.staff_name,dept.Dept_code,dept.dept_name
from staff_ma... | true |
0cac908b0556ab431ecf0b2b64f2480915c37965 | SQL | iteleshov/JavaRushTestTask_By_IvanTeleshov | /user.sql | UTF-8 | 3,496 | 2.765625 | 3 | [] | no_license | -- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия сервера: 5.7.7-rc-log - MySQL Community Server (GPL)
-- ОС Сервера: Win64
-- HeidiSQL Версия: 9.1.0.4867
-- -------------------------------------------------... | true |
62aac870f41747340f8ace784d9ff076f20a5499 | SQL | Nicolas-62/IBdoc | /bdd/fuji_flush_V2_partie_2.sql | UTF-8 | 2,783 | 3.390625 | 3 | [] | no_license | use fuji_flush_V2;
# ajout nouveaux joueurs
insert into Joueur(nom, prenom, password) values('trump', 'donald', 'azerty'); # 4eme joueur, id = 4, il va créer la partie
# création partie 2
insert into Partie(dateCrea, Joueur_id) values('20190901', 4); # 2eme partie donc id = 2
insert into EstJoue(Partie_id, Joueur_id)... | true |
292c69810f7d0cc251bec6a53038e4489c79ea0f | SQL | chrpin/MIRROR | /examples/mysql/example_university.sql | UTF-8 | 4,817 | 3.5625 | 4 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50525
Source Host : localhost:3306
Source Database : example_university
Target Server Type : MYSQL
Target Server Version : 50525
File Encoding : 65001
Date: 2015-06-09 17:25:33
*/
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.