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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
eda811eab83cb5b197b14d9871364493fbd4dae1 | SQL | toufu66/syanai_kensyu_SQL | /ensyu2/ensyu2_2.sql | UTF-8 | 158 | 2.734375 | 3 | [] | no_license | #ensyu2-2 各大陸ごとの人口の一覧データ。
use world;
select continent, sum(population) as Pop from country group by continent order by Pop desc; | true |
63ebba23fb8cbbd8503d97ea9bc6accb4e2666b8 | SQL | davidpop/shoppers5 | /fifth.sql | UTF-8 | 15,554 | 3.21875 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost
-- Généré le : jeu. 31 jan. 2019 à 16:59
-- Version du serveur : 5.7.25-0ubuntu0.16.04.2
-- Version de PHP : 7.2.13-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTI... | true |
8a322050c6a7f977f37a3a6e1bff441f83b89cfc | SQL | cavp28/feibu | /src/java/edu/pucmm/pw/database/FeibuFix.sql | UTF-8 | 15,247 | 3.625 | 4 | [] | no_license | CREATE TABLE Paises(
idPais int(3) PRIMARY KEY auto_increment,
nombre varchar(100) not null
);
CREATE TABLE Ciudades(
idCiudad int(12) PRIMARY KEY auto_increment,
nombre varchar(100) not null,
idPais int(3) not null,
FOREIGN KEY(idPais) REFERENCES Paises(idPais)
);
CREATE TABLE Roles(
idRol int(2) PRIMARY... | true |
eec236b9b73d6acd21652fbdcb4cdfe5878c526e | SQL | Isko00/DataGrip | /Ospanov_Islam_lab9_DataBases.sql | UTF-8 | 3,310 | 4.21875 | 4 | [] | no_license | CREATE DATABASE lab9;
CREATE TABLE salesman (
salesman_id SERIAL PRIMARY KEY,
name VARCHAR(50),
city VARCHAR(30),
commission REAL
);
CREATE TABLE customers (
customer_id SERIAL PRIMARY KEY,
cast_name VARCHAR(50),
city VARCHAR(30),
grade INTEGER,
salesman_id INTEGER REFERENCES salesman
);
CREATE TAB... | true |
6103196e73d1d391a96ff4096b3312377cb8e90d | SQL | wafec/testing-framework | /openstack-client-server/database-source/OSNetwork.sql | UTF-8 | 215 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive |
CREATE TABLE OS_NETWORK (
id int not null auto_increment,
uid text,
name text,
project_uid text,
test_id int not null,
PRIMARY KEY (id),
FOREIGN KEY (test_id) REFERENCES OS_TEST (id)
); | true |
b506e93b37b38490c8ebcd69ab1bd9a0cc91d3c2 | SQL | racko/EveIndustryPlanner | /emdr_db/script.sql | UTF-8 | 917 | 3.765625 | 4 | [] | no_license | create table orders2 (
orderID integer primary key,
typeID integer not null,
bid integer not null,
price float not null check(price >= 0),
volRemaining integer not null check(volRemaining >= 0),
stationID integer not null,
availableUntil integer not null check(availableUntil >= 0)
);
CREATE TABLE last_up... | true |
77d7981ff788c1debb4b6b0ca8c9359786d75e70 | SQL | stevenzearo/iblog | /backend/stock-service-db-migration/src/main/resources/db/migration/R__records.sql | UTF-8 | 898 | 2.796875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `records`
(
`id` INT NOT NULL AUTO_INCREMENT,
`code` VARCHAR(50) NOT NULL,
`name` VARCHAR(50) NOT NULL,
`record_type` VARCHAR(50) NOT NULL,
`date` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`latest` ... | true |
e5c54d614a31e6e5ddf8d5fb923eff75255d2e13 | SQL | uka27182/TestService | /src/main/resources/db/mysql/initDB.sql | UTF-8 | 327 | 2.53125 | 3 | [] | no_license | -- my sql
-- DROP TABLE task IF EXISTS;
CREATE TABLE IF NOT EXISTS task (
uuid VARCHAR(40)
,action VARCHAR(30)
,userName VARCHAR(30)
,args VARCHAR(100)
,state INTEGER
,result VARCHAR(200)
,post_dt timestamp
,solved_dt TIMESTAMP
,solving_dt TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_uuid ON task (uu... | true |
f342448ac6d77a6975497cdf734d2b2664f023a8 | SQL | gcmastra/Pewlett-Hackard-Analysis | /queries.sql | UTF-8 | 11,078 | 4.65625 | 5 | [] | no_license | -- create tables
CREATE TABLE departments (
dept_no VARCHAR(4) NOT NULL,
dept_name VARCHAR(40) NOT NULL,
PRIMARY KEY (dept_no),
UNIQUE (dept_name)
);
CREATE TABLE employees (
emp_no INT NOT NULL,
birth_date DATE NOT NULL,
first_name VARCHAR NOT NULL,
last_name VARCHAR NOT NULL,
gender VARCHAR ... | true |
5fda18126ca2cfda83f1c657b73e5faf0b1f59ce | SQL | joao-rafael/databases2018 | /P2/p2.sql | UTF-8 | 89 | 2.96875 | 3 | [] | no_license | select title from film where film.length
in(select max(length) from film)
order by title; | true |
158eb9394bdd9d650a2b0ef7c92e36928a1855ff | SQL | alexbvart/jolleriastyls | /styls.sql | UTF-8 | 10,277 | 3.265625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 17-12-2020 a las 22:48:05
-- Versión del servidor: 5.7.24
-- Versión de PHP: 7.2.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
4c638ea1f44688be4aefced8782de74679d3abfb | SQL | josepitteloud/VESPA | /ad_hoc/V114 Barclays/full code part 2 ver 0.1.sql | WINDOWS-1252 | 26,415 | 3.3125 | 3 | [] | no_license |
/*------------------------------------------------------------------------------
Project: Barclays Cash ISA Campaign
Version: v1.
Created: 23/10/2012
Lead: Sarah Moore
Analyst: Harry Gill
SK Prod: 4
Milestone: 4 **
Introduction
This code is p... | true |
2480f313bbcde99d16b8d1035cd1fb21d2f99409 | SQL | exxcellent/swt2-bsa-backend | /bogenliga/bogenliga-application/src/main/resources/db/migration/all/V10_0__update_configuration.sql | UTF-8 | 2,042 | 3.109375 | 3 | [
"MIT"
] | permissive | ALTER TABLE configuration ADD COLUMN configuration_id INTEGER;
DROP SEQUENCE IF EXISTS configuration_1;
CREATE SEQUENCE configuration_1 START 1;
ALTER TABLE configuration ALTER COLUMN configuration_id SET DEFAULT nextval('configuration_1');
UPDATE configuration SET configuration_id = nextval('configuration_1');
alter ... | true |
be35e17e7f3c35aabac09d37342637ade685555a | SQL | LittleDecorator/JointPurchase | /src/main/resources/db/migration/V12_alter_update.sql | UTF-8 | 1,497 | 2.953125 | 3 | [] | no_license | -- меняем обязательное поле
ALTER TABLE subscribers ALTER COLUMN subject_id DROP NOT NULL
ALTER TABLE subscribers ALTER COLUMN email set not null;
-- добавляем пару полей
alter table instagram_posts add column wrong_post boolean;
alter table instagram_posts add column show_on_main boolean DEFAULT false;
-- убираем со... | true |
a98b7b913c93a7e61a8b3496d7570c1f4049727b | SQL | robertjustjones/service-registry | /scripts/schema/setup/farscape_15_create_initial_cfs.cql | UTF-8 | 627 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | USE farscape;
-- KEY is tenantId
CREATE COLUMNFAMILY accounts (
KEY ascii PRIMARY KEY
);
-- KEY is tenantId
CREATE COLUMNFAMILY services (
KEY ascii PRIMARY KEY
);
-- KEY is tenantId
CREATE COLUMNFAMILY configuration_values (
KEY ascii PRIMARY KEY
);
-- KEY is tenantId
CREATE COLUMNFAMILY events (
KEY ascii... | true |
815402a6b4caf615bd6a32889f4e3bdbce802a2e | SQL | cflems/activies-svr | /likes.sql | UTF-8 | 144 | 2.765625 | 3 | [] | no_license | CREATE TABLE likes (
id INT(255) NOT NULL PRIMARY KEY AUTO_INCREMENT,
uid INT(255) NOT NULL,
pid INT(255) NOT NULL,
UNIQUE(uid, pid)
);
| true |
7d6d5aba95cb9730c8ba8aa89d2d7ecc523e2ad8 | SQL | silverthreadk/leetcode | /sql/1965_Employees_With_Missing_Information.sql | UTF-8 | 256 | 3.40625 | 3 | [] | no_license | # Write your MySQL query statement below
SELECT employee_id FROM Employees
WHERE employee_id NOT IN (SELECT employee_id FROM Salaries)
UNION
SELECT employee_id FROM Salaries
WHERE employee_id NOT IN (SELECT employee_id FROM Employees)
ORDER BY employee_id; | true |
96468f718315d2a31d03c27050bf0e6e102da51a | SQL | joelgenter/cosc_481_programming_eagles | /ProteinSim.sql | UTF-8 | 4,074 | 3.265625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: ProteinSim
-- ------------------------------------------------------
-- Server version 5.7.17-0ubuntu0.16.04.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER... | true |
95d2772846cc4830ddffac76152c957dc746be4a | SQL | bellmit/flexdb | /2.HOST/3.Procedure/cf0013.sql | UTF-8 | 8,580 | 3.59375 | 4 | [] | no_license | CREATE OR REPLACE PROCEDURE cf0013 (
PV_REFCURSOR IN OUT PKG_REPORT.REF_CURSOR,
OPT IN VARCHAR2,
BRID IN VARCHAR2,
F_DATE IN VARCHAR2,
T_DATE IN VARCHAR2,
PV_CUSTODYCD IN VARCHAR2,
PV_AFACCTNO IN VARCHAR2,
SYMBOL ... | true |
fd2d25a85e3ccabb200412cdd2bab91bf10c5820 | SQL | ybm0934/springHerb | /springherb/src/main/webapp/dbsql/reboardDelete.sql | UHC | 960 | 3.3125 | 3 | [] | no_license | --reboardDelete.sql
create or replace procedure reboardDelete --ν ̸
(
--Ű
p_no number,
p_groupNo number,
p_step number
)
is
--
cnt number;
begin
--ó
--
if p_step=0 then
select count(*) into cnt from reboard
where groupno=p_groupno;
--[1] 亯... | true |
6cf29d1c36d300373b9fe2352665ab88fd6d23f0 | SQL | 495447865/book-manage-vuetify | /scripts_mysql.sql | UTF-8 | 2,295 | 3.359375 | 3 | [] | no_license | CREATE TABLE `book` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'Id',
`name` varchar(100) NULL COMMENT 'Name',
`price` int NULL DEFAULT 0 COMMENT 'Price',
`brief` varchar(100) NULL COMMENT 'Brief',
`single_tag` int NULL DEFAULT 0 COMMENT 'SingleTag',
`multi_tag` varchar(100) NULL COMMENT 'MultiTa... | true |
b7be00c60d3147b82f5820a81168c0eb84f1c4ce | SQL | shivakarna2991/kkphpcode_with_old_features | /vadata.sql | UTF-8 | 22,098 | 3.109375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.5.41, for debian-linux-gnu (x86_64)
--
-- Host: vadata.crllkva3db2t.us-west-2.rds.amazonaws.com Database: vadata
-- ------------------------------------------------------
-- Server version 5.6.27-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_C... | true |
f04b00d4ec9c86534b88251b08a83eac01f6df81 | SQL | Nithanaroy/almanac.httparchive.org | /sql/2020/fonts/04_20.icon_fonts.sql | UTF-8 | 992 | 3.703125 | 4 | [
"Apache-2.0"
] | permissive | #standardSQL
#icon_fonts
CREATE TEMPORARY FUNCTION checksSupports(css STRING)
RETURNS ARRAY<STRING> LANGUAGE js AS '''
try {
var reduceValues = (values, rule) => {
if (rule.type == 'stylesheet' && rule.supports.toLowerCase().includes('icon')) {
values.push(rule.supports.toLowerCase());
... | true |
f0870a2953dcdea4d06e079b3e18e8e3076ee091 | SQL | saitohtm/webk | /old_data/smf_category.sql | UTF-8 | 2,320 | 2.75 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.8.2.4
-- http://www.phpmyadmin.net
--
-- ホスト: localhost:3306
-- 作成の時間: 2013 年 1 月 13 日 01:41
-- サーバーのバージョン: 5.0.77
-- PHP バージョン: 5.2.6
--
-- データベース: `waao`
--
-- --------------------------------------------------------
--
-- テーブルの構造 `smf_category`
--
CREATE TABLE `smf_categor... | true |
f441860c3e96b55f49e71a99136a7dd37d1f8397 | SQL | UnCarro/crud_node | /db script/TestDBSQL.sql | UTF-8 | 1,536 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 24-07-2021 a las 06:09:12
-- Versión del servidor: 10.4.20-MariaDB
-- Versión de PHP: 8.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
94d4d22bfd9fb819ad2180ce875027ea8151247d | SQL | martinhbramwell/vue-offlinefirst-spa-pwa | /packages/database/mariaDB/GetPersonBottlesMoves.sql | UTF-8 | 773 | 3.78125 | 4 | [
"MIT"
] | permissive | SELECT
CONCAT(
JSON_OBJECT(
"_id", concat("PersonBottleMovement_1_", lpad(p.partner_id, 16, 0))
, "data", JSON_OBJECT(
"person", p.partner_id
, "type", "person_bottle_move"
, "bottle_movements", JSON_ARRAYAGG(IFNULL(s.movement_id, 0))
)
), ","
)
FROM
tb_partn... | true |
c00ce437d5b101b63fc41fbfa396293ad03e0a45 | SQL | it-gro/PIT | /PIT/tools/check_has_object_privilege.sql | UTF-8 | 557 | 2.71875 | 3 | [
"MIT"
] | permissive | prompt &h2.Check whether &INSTALL_USER. has privilege &1. on &2.
declare
l_has_priv pls_integer;
begin
select count(*)
into l_has_priv
from dba_tab_privs
where grantee = '&INSTALL_USER.'
and privilege = upper('&1.')
and table_name = upper('&2.');
if l_has_priv = 0 then
... | true |
97c1687b9438fa0c56358aca7034449c883f62b0 | SQL | Gagnavinnsla/hopaverk2 | /make_defult.sql | UTF-8 | 326 | 3.078125 | 3 | [] | no_license | create table movies (
movie_id int ,
title varchar(255),
genres varchar(255) ,
PRIMARY KEY(movie_id));
create table ratings (
user_id int ,
movie_id int REFERENCES movies(movie_id),
rating float
);
create table tags (
user_id int ,
movie_id int REFERENCES movies(movie_id),
tag varchar(255)
)... | true |
f544e348b08e3a1cc2595035427ccdb99d148adf | SQL | jbernier51/Datawarehouse | /Datawarehouse/Datawarehouse/Harsco/Views/FactARAging_Aggr.sql | UTF-8 | 1,010 | 3.5625 | 4 | [] | no_license |
--DROP VIEW [Harsco].[FactARAging_Aggr]
CREATE VIEW [Harsco].[FactARAging_Aggr] AS (
SELECT
--TOP (100)
D.Country,
D.Location,
A.AsOfDate,
A.AgingDateKey,
--A.AgingType,
B.AccountCustomerKey,
B.OrganizationKey,
--C.CustomerName,
A.ExchangeRateKey,
SUM(A.TOTALOPENAMOUNT) TotalOpenAmount,
SUM(A.CurrentAmount) Current... | true |
fa51296c7bcf4ef7eae58020088e003c495d1c26 | SQL | sirasao2/XLNX | /DB/comms.sql | UTF-8 | 920 | 3.78125 | 4 | [] | no_license | //noc_join
//creates a table which joins ID values with simulation data
CREATE TABLE noc_join AS SELECT NOC2.id, NOC.src_instance, NOC.src_port, NOC.sync_instance, NOC.sync_port, NOC2.time, NOC2.pkt_id, NOC2.header, NOC2.vc, NOC2.src, NOC2.dest FROM NOC INNER JOIN NOC2 ON NOC.id = NOC2.id;
SELECT * FROM noc_join;
//F... | true |
8cacc0c483a4aac59fc51c3aee4a6cc3a6277cf3 | SQL | ViElectronicEntertainment/NatureSpa | /schema.sql | UTF-8 | 604 | 2.84375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS naturespa;
USE naturespa;
CREATE TABLE `citas` (
`id` int(11) NOT NULL,
`hora` varchar(50) COLLATE utf8mb4_spanish2_ci NOT NULL,
`nombre` varchar(50) COLLATE utf8mb4_spanish2_ci NOT NULL,
`servicio` varchar(50) COLLATE utf8mb4_spanish2_ci NOT NULL,
`valor` int(50) COLLATE utf8mb... | true |
a2ac6f57b28fc9e09195d58e8c32bd6b47fffbbb | SQL | prodigasistemas/gsan-migracoes | /comercial/scripts/20191015191832_tabela_coluna_novos_campos_recadastramento.sql | UTF-8 | 890 | 2.515625 | 3 | [] | no_license | -- // tabela coluna novos campos recadastramento
-- Migration SQL that makes the change goes here.
INSERT INTO seguranca.tabela_coluna VALUES (nextval('seguranca.seq_tabela_coluna'), 661, now(), 'imac_qtd_nos_fundos', 'Qtd Nos Fundos', 2, 'QtdFundos', null, 2, 2);
INSERT INTO seguranca.tabela_coluna VALUES (nextval('... | true |
78bc5be7c3f4c18ac262efa353ae23132d1ec370 | SQL | sightlife-capstone/database | /data_insertion/edc.sql | UTF-8 | 411 | 2.84375 | 3 | [] | no_license | CREATE TABLE edc_data_dump (
edcDataDumpID SERIAL PRIMARY KEY,
eye_bank_id INTEGER NOT NULL,
metric_id INTEGER NOT NULL,
date_start DATE NOT NULL,
date_end DATE NOT NULL,
edc_num NUMERIC
);
INSERT INTO eyebank_metric(eyebankid, metricid, startdate, enddate, measure... | true |
25924db8ec3bd3d45fdf30db61a7ad6072de5ad3 | SQL | k13jolai/COEN-178-Intro-to-Databases | /labs_and_finalproject/lab4/part3.sql | UTF-8 | 878 | 3.53125 | 4 | [] | no_license | /*
* Exercise 5
*/
-- A PLSQL block of code to extract Customer Name,city and display them.
set serveroutput on
DECLARE
-- Variable Declarations
l_name Cust_5.custname%type;
l_city Cust_5.city%type;
-- executable part from BEGIN to END
BEGIN
SELECT custname, city
INTO l_name, l_city
FR... | true |
830126541b2888f609cdb0ebd0f16a737dc5498f | SQL | altamira/visualstudio | /Sistema de Informação Altamira/DBALTAMIRA.Database/dbo/Stored Procedures/SPCO_BOBINA_ALTERAR.sql | UTF-8 | 1,081 | 2.875 | 3 | [] | no_license |
/****** Object: Stored Procedure dbo.SPCO_BOBINA_ALTERAR Script Date: 23/10/2010 13:58:21 ******/
CREATE PROCEDURE [SPCO_BOBINA_ALTERAR]
@CodFornecedor char(14),
@CodPrestador char(14),
@CodBobina char(14),
@NumeroDaCorrida char(15),
@NormaDoAco char(40),
@TipoDoAco char(8),
@Acabamento... | true |
831de8d7426975c4154680025b6339acecac36d1 | SQL | nastia1998/ORACLE_CINEMA | /KP/scripts/cinema_user.sql | WINDOWS-1251 | 2,303 | 3.1875 | 3 | [] | no_license | begin
--cinema_admin.book_place ('nastia2211', '', '., - , 13', '', '', '04-01-2019', 1, 2, '01-01-2019');
cinema_admin.book_place ('nastia2211', '', '., - , 13', '', ' ', '04-01-2019', 5, 10, '03-01-2019');
commit;
exception
when others then dbms_output.put_line('Code: ' || SQLCODE || ' Error: '... | true |
2a60855672ee1f8c4bf81b94a964d76b8f8e0363 | SQL | tweeze/tweeze | /sql/archive/sample_mysql.sql | WINDOWS-1250 | 979 | 4.15625 | 4 | [] | no_license | # TWEEZE
# MYSQL DATABASE tweeze
# CREATE DATABASE
create database if not exists tweezy default character set latin1;
# SET PRIVILEGES
grant all on tweeze.* to 'tweeze'@'localhost' identified by 'password' with grant option;
grant select on tweeze.* to 'user'@'localhost' identified by 'password' with grant op... | true |
2fcd582eb9f12a4ef3ac7e95dce1f0523f4a5372 | SQL | jjdblast/Principle-of-Urban-Informatics | /week7/drp354_assignment_6/query4.sql | UTF-8 | 507 | 3.625 | 4 | [] | no_license | -- ################################################
-- #****CUSP Principle of urban informatic class**#
-- #-----Dimas R.Putro / drp354@nyu.edu-----------#
-- ################################################
-- Principle of urban informatics assignment 6
SELECT RTRIM(t1.name) AS 'station_with_largest_increase'
FROM ... | true |
362338db0fbb1414b4ccdc09f68506f15e68304b | SQL | Gluck-mz/JavaDeveloperCourse | /src/main/java/module1/task2/2.sql | UTF-8 | 226 | 3.890625 | 4 | [] | no_license | SELECT project_name, sum(salary) FROM projects p
INNER JOIN developer_project a ON p.project_id = a.project_id
INNER JOIN developers d ON a.developer_id = d.developer_id
GROUP BY project_name
ORDER BY sum(salary) DESC
LIMIT 1; | true |
35169c40a2cf1b9ffcef2c9b35211910711e4526 | SQL | batsuev/yesql4j | /yesql4j-maven-plugin/src/test/resources/combined_file.sql | UTF-8 | 416 | 3.21875 | 3 | [] | no_license |
-- name: the-time
-- This is another time query.
-- Exciting, huh?
SELECT CURRENT_TIMESTAMP
FROM SYSIBM.SYSDUMMY1;
-- name: sums
-- Just in case you've forgotten
-- I made you a sum.
SELECT
:a + 1 adder,
:b - 1 subtractor
FROM SYSIBM.SYSDUMMY1;
-- name: edge
-- And here's an edge case.
-- Comments in the mi... | true |
b45d92698b7ba8c137ca39328e78ddbc7cc917af | SQL | Cristianmartinezl/Asociados_web | /Scripts/Asociados.sql | UTF-8 | 293 | 2.890625 | 3 | [] | no_license | CREATE TABLE Asociado(
Nombre VARCHAR(20),
PRIMARY KEY (Nombre)
);
CREATE TABLE Registradora(
Id INTEGER NOT NULL,
Id_asociado VARCHAR(20),
Fecha DATE,
PRIMARY KEY (Id),
FOREIGN KEY (Id_asociado) REFERENCES Asociado(nombre)
);
| true |
57a488474ef23b4ca5b28192891efba36e60fc32 | SQL | yasirbhutta/oracle-queries | /dml/savepoint.sql | UTF-8 | 1,739 | 3.578125 | 4 | [] | no_license | --Example 3–9 Rolling Back a Transaction to a Savepoint
--
--Check REGIONS table before transaction:
--
SELECT * FROM REGIONS
ORDER BY REGION_ID;
--
--Check countries in region 4 before transaction:
--
SELECT COUNTRY_NAME, COUNTRY_ID, REGION_ID
FROM COUNTRIES
WHERE REGION_ID = 4
ORDER BY COUNTRY_NAME;
--
--Check countr... | true |
8d2aeb70aec317e7f310a4ad3205dca20c22e7cd | SQL | SimonFM/SQL-Project | /Rugby_Union.sql | UTF-8 | 28,476 | 3.671875 | 4 | [] | no_license | create table rugby_union
(
union_id int primary key,
union_name varchar(100) not null,
union_country varchar(100) not null,
yearFounded date not null,
numberOfMembers int not null,
constraint check_numOfMems check (numberOfMembers > 0),
constraint check_unionID check (union_id > 0 )
);
/*-----------------... | true |
55e401eb0887cab1ef6662f99e663c6f4956479a | SQL | farkh/11-502_Farkh_HW_2_Y | /AutoVito - DB/target/classes/Inserts.sql | UTF-8 | 605 | 2.734375 | 3 | [] | no_license | INSERT INTO colors VALUES ('Red');
INSERT INTO colors VALUES ('Blue');
INSERT INTO colors VALUES ('Green');
INSERT INTO colors VALUES ('Black');
INSERT INTO colors VALUES ('White');
INSERT INTO colors VALUES ('Grey');
INSERT INTO colors VALUES ('Yellow');
INSERT INTO types VALUES ('New');
INSERT INTO types VALUES ('Wi... | true |
bbe529b695d05471af2957b1ba89ef3491224fa2 | SQL | sumedhm/fakebook | /MYSQL tables/vote.sql | UTF-8 | 2,054 | 2.828125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.5.29, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: PHOTO
-- ------------------------------------------------------
-- Server version 5.5.29-0ubuntu0.12.10.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHA... | true |
069381443b513e927eed06d1aac49affcf5dc9e9 | SQL | scott-anderson-wc/minerva | /sql/ztest.sql | UTF-8 | 147 | 2.640625 | 3 | [] | no_license | select month(rtime)<6 as grp, avg(isf) as mean, stddev(isf) as sd,count(isf) as n
from isf_details
where year(rtime)=2018
group by month(rtime)<6;
| true |
0422594ee9a8ce2f44ef447136c5dc9aee75d6d9 | SQL | seanreed1111/sql_quiz_problem | /answers.sql | UTF-8 | 242 | 2.96875 | 3 | [] | no_license | Create an answers.sql that will display
all the answers for a particular question.
Select questions.id, question_content,choices.id,choice_content
from questions
join choices
on choices.question_id = questions.id
WHERE choices.bool = "T" | true |
a2604ce4c865921ea453c170ab5c4e6798efcf95 | SQL | MicroKnight11/TubesPBO | /TUBES/TubesPBO.sql | UTF-8 | 3,005 | 3.375 | 3 | [] | no_license | create table mahasiswa(
nim varchar2(255) not null constraint mahasiswa_pk primary key,
nama_mhs varchar2(255),
tgl_lahir varchar2(255)
);
create table mata_kuliah(
kode_mk VARCHAR2(10) not null constraint mata_kuliah_pk primary key,
nama_mk VARCHAR2(255),
sks number(11)
nid varch... | true |
5e0d0346740436e3ef03d48859fe6cd77fe345fe | SQL | DavidBorstner/FaksNalogePreverjanja | /2. letnik 18_19/Podatkovne baze 2/Naloga02/SQLstavki.sql | UTF-8 | 21,028 | 3.359375 | 3 | [] | no_license | drop view artikli;
drop view artikli_vrste;
drop view narocila;
DROP TRIGGER dodajanje_artikla;
alter table Artikel
drop constraint FK_ARTIKEL_VRSTA_ART_VRSTA_AR;
alter table Artikel_narocilo_rel
drop constraint FK_ARTIKEL__ARTIKEL_N_ARTIKEL;
alter table Artikel_narocilo_rel
drop constraint FK_ARTIKEL__ARTI... | true |
bd78119d21c8b677a25f96af5357086ec3862e27 | SQL | MrD0079/portal | /sql/beg_routes_ts_list.sql | UTF-8 | 360 | 2.703125 | 3 | [] | no_license | /* Formatted on 07/04/2015 11:34:32 (QP5 v5.227.12220.39724) */
SELECT DISTINCT u.tn, u.fio, u.pos_name
FROM routes r, user_list u, departments d
WHERE r.tab_number = u.tab_num
AND u.dpt_id = :dpt_id
AND u.datauvol IS NULL
AND u.is_ts = 1
AND d.manufak = r.country
... | true |
ec5e928240b59fd6ffb0d400c040f3c667e75eb3 | SQL | satheeshkris/SQLScripts | /Important-Queries/Performance Troubleshooting/Find Costly Queries from Logging.sql | UTF-8 | 2,573 | 4.21875 | 4 | [] | no_license | use tempdb
/*
-- Step 3: Query the resultset
SELECT TOP 10 * FROM tempdb..WhoIsActive_ResultSets r with (nolock)
WHERE CAST(r.collection_time AS DATE) = CAST(GETDATE() AS date)
ORDER BY collection_time DESC;
-- Find size of collected Data
SELECT
t.NAME AS TableName,
p.rows AS RowCounts,
CONVERT(DECI... | true |
c648f8abf18270ec51d38b215113f4144e38dd7f | SQL | DarkoStojanovic2725/IT255Repo | /IT255-DZ10-Darko-Stojanovic-2725/it255dz10.sql | UTF-8 | 1,308 | 2.765625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 16, 2017 at 04:15 PM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
b25b0b6c169fdc288242eaa84df7650f6a6ebc37 | SQL | thanakrit07/DBWebsite | /db/iCanQ-StoreRoutine.sql | UTF-8 | 3,687 | 3.640625 | 4 | [] | no_license | USE icanq;
/*1*/
DROP Procedure IF EXISTS getMenu;
DELIMITER //
CREATE PROCEDURE getMenu (IN ShopID VARCHAR(20))
BEGIN
SELECT Menu,ShopRec,Rating
FROM Foodlist
WHERE SID = ShopID;
END //
DELIMITER ;
/*2*/
DROP Procedure IF EXISTS getFoodinfo;
DELIMITER //
CREATE PROCEDURE getFoodinfo (IN ShopID VARCHAR(20... | true |
b68df0f6b04fea7f98ce011502cd8d2cd25156a1 | SQL | wei2060i/java | /jwt/tbl_department.sql | UTF-8 | 853 | 2.625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : admin
Source Server Version : 50553
Source Host : localhost:3306
Source Database : mybatis
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2019-10-16 22:58:29
*/
SET FOREIGN_KEY_CHECKS=0;
-- -----... | true |
5a28ec9d27ac160061f3d79f4ee9917dd4d34adf | SQL | mcgidev/mPortal | /Portal/WebSystem/WCMS.Framework.SqlDabase/dbo/Stored Procedures/FileIdentity_Get.sql | UTF-8 | 578 | 3.15625 | 3 | [
"MIT"
] | permissive | CREATE PROCEDURE dbo.FileIdentity_Get
(
@Id int = -1,
@LibraryId int = -1,
@ObjectId int =-1,
@RecordId int =-1,
@FilePath nvarchar(4000) = NULL,
@Name nvarchar(500) = NULL
)
AS
SET NOCOUNT ON
SELECT Id, ObjectId, RecordId, LibraryId, FilePath, Name
FROM FileIdentity
WHERE (... | true |
6fa0fbaa7916d2963816012d2feeeaa0f08397dc | SQL | DaviLack/MySQL | /frutrasverduras .SQL | UTF-8 | 4,259 | 4.0625 | 4 | [] | no_license | create database compras;
use compras;
create table categoria(
nome varchar(60) not null primary key
);
create table fornecedor(
nome varchar(60) not null primary key
);
create table produtos(
codigo varchar(6) not null primary key,
descricao varchar(30) not null,
categoria varchar(60) not null,
fornecedor ... | true |
468425a0edf2458ea11402e96500f45ca5aea695 | SQL | chiranjeevjain/securePHP | /user_db.sql | UTF-8 | 2,905 | 3.359375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 17, 2014 at 11:56 AM
-- Server version: 5.5.20
-- PHP Version: 5.3.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
5a7d290c0ed860429cee35a7101141a1c2907092 | SQL | Dd141314/HubinoRestApiCRUD | /src/main/resources/HubinoDb.SQL | UTF-8 | 3,727 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 26, 2020 at 12:10 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
f67daa23d737fbf5820c2d12ccee58049c37e9d9 | SQL | ggbbest/poly-bridge | /sql/query_token.sql | UTF-8 | 281 | 2.875 | 3 | [] | no_license | use polyswap;
set @tname='cat1';
select * from token_basics where name=@tname;
select * from tokens where name=@tname;
select * from token_maps
where
src_token_hash in (select hash from tokens where name=@tname) or
dst_token_hash in (select hash from tokens where name=@tname);
| true |
ba94ee71d8011391063d6e51f91ee80d7cd32369 | SQL | Dlayer/dlayer | /private/database/tables/structure/user_site_form_setting.sql | UTF-8 | 578 | 3.015625 | 3 | [
"MIT"
] | permissive |
CREATE TABLE `user_site_form_setting` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`site_id` int(11) unsigned NOT NULL,
`form_id` int(11) unsigned NOT NULL,
`width` int(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Minimum form display width',
`legend` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Fields... | true |
a23ffa811dfc9155f38e85724ce055e63dba3ad5 | SQL | ludars/Data_Warehouse | /MV_rm_ratings.sql | UTF-8 | 1,326 | 3.484375 | 3 | [] | no_license | /*
BEGIN
dbms_snapshot.REFRESH('c_rm_ratings');
END;
*/
CREATE MATERIALIZED VIEW LOG ON h_rm_ratings;
CREATE MATERIALIZED VIEW c_rm_ratings refresh fast ON demand
AS
SELECT PIDM
, BANNER_ID
, ENTITY_CODE
, NAME_SORT
, PRIMARY_IND
, RATE_TYPE_CODE
, RATE_TYPE_DESC
, RATING_CODE
, RATING_DESC
, SCRE... | true |
0355d93ce4badd503529f52185b56a06a68ebc2a | SQL | andrelopes1977/python-exercicios | /Python exercicios/script02.sql | UTF-8 | 992 | 3.0625 | 3 | [
"MIT"
] | permissive | /*
CREATE TABLE `escola_curso`.`alunos_cursos` (
`id_alunos_cursos` INT NOT NULL AUTO_INCREMENT,
`id_aluno` INT NOT NULL,
`id_curso` INT NOT NULL,
PRIMARY KEY (`id_alunos_cursos`),
INDEX `fk_id_aluno_idx` (`id_aluno` ASC) VISIBLE,
INDEX `fk_id_curso_idx` (`id_curso` ASC) VISIBLE,
CONSTRAINT `fk_id_aluno`
... | true |
5c15446f706c8cf6a411e3a8d8b86e7516c73b1e | SQL | serban-petrescu/spring-re-jcm | /src/main/resources/db/migration/V1__Initial_database_structure.sql | UTF-8 | 583 | 3.265625 | 3 | [
"MIT"
] | permissive | CREATE CACHED TABLE university(
id int auto_increment primary key,
name varchar(32)
);
CREATE CACHED TABLE specialization(
id int auto_increment primary key,
name varchar(32),
university_id int not null,
foreign key (university_id) references university(id)
);
CREATE CACHED TABLE candidate(
... | true |
a5005a9cd42aa5ace4edd7d25ea48f03b03584ca | SQL | CrafterKolyan/mmp-practicum-sql-fall-2019 | /task2/Nakhodnov_2_3.sql | UTF-8 | 248 | 3.265625 | 3 | [] | no_license | select
timestampdiff(year, cd_customers.birth_dt, current_date()) as age,
count(*)
from srcdt.cd_customers as cd_customers
where cd_customers.valid_to_dttm = '5999-01-01 00:00:00'
group by age
having age between 15 and 80
order by age desc
| true |
19a239b995018971485cbf71cd83f46b285bf390 | SQL | Jonily/JAVA | /OrderingSystem/src/main/db.sql | UTF-8 | 1,044 | 4.125 | 4 | [] | no_license | create database order_system;
use order_system;
drop table if exists dishes;
create table dishes(
dishId int primary key auto_increment,
name varchar (50)unique ,
price int -- 以分为单位,使用int表示,尽量不用double
);
drop table if exists user;
create table user(
userId int primary key auto_increment,
name var... | true |
afd79b42a8094f63fbc80c4e813ecc222b666544 | SQL | gusevgithub/app-js-php | /table_data.sql | UTF-8 | 3,775 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Июл 15 2020 г., 22:57
-- Версия сервера: 10.3.22-MariaDB
-- Версия PHP: 7.1.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
6d96f8a0effc2c925abfc9a40e24f11a4b95b44a | SQL | mdazaz/sportyshoes | /shoestore_db_dump/shoestore_size.sql | UTF-8 | 2,300 | 2.84375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.26, for Win64 (x86_64)
--
-- Host: localhost Database: shoestore
-- ------------------------------------------------------
-- Server version 8.0.11
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULT... | true |
959244aa51dfd4ff0a41c57993c0bf283c6d9eb2 | SQL | eschwert/Breakbulk | /org.openanzo.jdbc/src/main/resources/nodecentric/postgres/xmlsql/node.sql | UTF-8 | 2,106 | 3.03125 | 3 | [] | no_license | <?xml version="1.0" encoding="UTF-8"?>
<!--
#*******************************************************************************
# Copyright (c) 2004, 2007 IBM Corporation and Cambridge Semantics Incorporated.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of th... | true |
223c39cd23dbd45c2f36f7c6da67e9389138ad37 | SQL | RagazziMoscow/db_tables_links | /airport_query.sql | UTF-8 | 199 | 2.59375 | 3 | [] | no_license | select * from company
full join trip on company.id_comp = trip.id_comp
full join pass_in_trip on trip.trip_no = pass_in_trip.trip_no
full join passenger on passenger.id_psg = pass_in_trip.id_psg;
| true |
ebb33923b83bb7dd0c67e6e9084c0843d87ce2f1 | SQL | arthaszeng/fuckwheelers | /db/migrations/scripts/20140428105545_create_account_role.sql | UTF-8 | 299 | 2.796875 | 3 | [] | no_license | -- // create account role
-- Migration SQL that makes the change goes here.
CREATE TABLE account_role
(
role_id SERIAL PRIMARY KEY,
account_name CHARACTER VARYING(255) NOT NULL,
role CHARACTER VARYING(255) NOT NULL
);
-- //@UNDO
-- SQL to undo the change goes here.
DROP TABLE account_role;
| true |
2345dc812361a3660515f963dc2318fad24baaed | SQL | FujishigeTemma/isucon9-qualify | /sql/00_create_database.sql | UTF-8 | 477 | 2.625 | 3 | [] | no_license | DROP DATABASE IF EXISTS `isucari`;
CREATE DATABASE `isucari`;
DROP USER IF EXISTS 'isucari'@'localhost';
CREATE USER 'isucari'@'localhost' IDENTIFIED BY 'isucari';
GRANT ALL PRIVILEGES ON `isucari`.* TO 'isucari'@'localhost';
DROP USER IF EXISTS 'isucari'@'%';
CREATE USER 'isucari'@'%' IDENTIFIED BY 'isucari';
GRANT ... | true |
f68af6a4e88bb0190d90a6fbef2d6c7585ef5e2d | SQL | AIESEC-Egypt/aiesec-identity | /aiesec-identity.sql | UTF-8 | 5,385 | 3.4375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 31. Mai 2016 um 02:49
-- Server-Version: 10.1.9-MariaDB
-- PHP-Version: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... | true |
b36b18ecadca5052931dc06dba02dfcfffbd6161 | SQL | ajpahl1008/SQL | /honeypot/reports.sql | UTF-8 | 234 | 2.703125 | 3 | [] | no_license | DESC HONEYPOT;
select * from HONEYPOT limit 1;
SELECT ATTEMPTED_ID, COUNT(*)
FROM
HONEYPOT
GROUP BY ATTEMPTED_ID;
SELECT INET_ATON('109.230.148.219');
select * from IP2LOCATION where 1843827931 > ip_from and 1843827931 < ip_to; | true |
25f8b0f7a3bf4ad65f5b84f54aa85301cfb1b41e | SQL | OlafMd/MedCon1.0 | /mm-docconnect-dataimporter/DataImporter/DataImporter/DBMethods/Case/Atomic/Retrieval/SQL/cls_Get_Submitted_NonError_CaseIDs.sql | UTF-8 | 1,311 | 3.609375 | 4 | [] | no_license |
SELECT
hec_cas_case_billcodes.HEC_CAS_Case_RefID
FROM
hec_cas_case_billcodes
INNER JOIN hec_bil_billposition_billcodes ON hec_cas_case_billcodes.HEC_BIL_BillPosition_BillCode_RefID =
hec_bil_billposition_billcodes.HEC_BIL_BillPosition_BillCodeID AND
hec_bil_billposition_billco... | true |
7b5161e7acf6a065686441b21f1f9a4c7b438475 | SQL | rodnyco/goto-bot | /database/setup.sql | UTF-8 | 1,005 | 2.8125 | 3 | [] | no_license | SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for main
-- ----------------------------
# USE main;
USE nc2dawboee9zeb7r;
# DROP TABLE IF EXISTS `main`;
CREATE TABLE IF NOT EXISTS `places` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL,
`description` t... | true |
9a338549d46a6403f34de937745cb9b18643e2c3 | SQL | fmengmii/ie-validation | /sql/annotation-schema-sqlserver.sql | UTF-8 | 14,494 | 3.578125 | 4 | [] | no_license |
CREATE TABLE SCHEMA."annotation" (
"id" int NOT NULL,
"document_namespace" varchar(500) NOT NULL,
"document_table" varchar(500) NOT NULL,
"document_id" bigint NOT NULL,
"document_name" varchar(100) DEFAULT NULL,
"annotation_type" varchar(500) DEFAULT NULL,
"start" int DEFAULT NULL,
"end" i... | true |
59dcd2e9d5adede983a9762a176be5096b7f09cd | SQL | apache/derby | /java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/lang/wisc_setup.sql | UTF-8 | 79,630 | 3.59375 | 4 | [
"Apache-2.0",
"LicenseRef-scancode-unicode",
"LGPL-2.0-or-later",
"CPL-1.0",
"CDDL-1.0",
"MIT",
"LicenseRef-scancode-other-copyleft",
"NAIST-2003",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"CC-BY-SA-3.0",
"LicenseRef-scancode-generic-export-compliance"
] | permissive | --
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
-- (the "License")... | true |
9d577e298fdf0c47f7d6ba96c06a621860b72c9f | SQL | yy556023/Project | /SQL/實作_06_view.sql | UTF-8 | 2,770 | 3.8125 | 4 | [] | no_license |
-- 6.檢視表(Views) 的設計與實作
-- 6-1:使用 CREATE VIEW 建立檢視表物件
-- 6-2:如何查詢某一檢視表原始定義的內容
-- 6-3:如何修改檢視表、刪除檢視表
--- SQL Server 2017/2019
-- p 11-3 檢視表的優缺點
-- p 11-5 建立檢視表
-- p 11-7 建立檢視表(使用指令)
-- 10. 先將 Northwind 資料庫的 Employees 搬移至 Lab 資料庫中
-- 複習:select .. into ..
SELECT * ... | true |
87d0ce42ebf2c73137b1e7439dd0bfcd7bc2ac4f | SQL | aaltmark/sql_class | /notes/statement_fundamentals/select_count.sql | UTF-8 | 514 | 3.96875 | 4 | [] | no_license | -- Select Count
-- Returns the number of input rows that match a specific condition of a query
-- Basic Example Syntax;
SELECT COUNT (name) FROM table_name; -- how many rows are in column
-- Each column should have same amount of rows
SELECT COUNT(*) FROM table_name; -- will give same an... | true |
c0383c6db6301a67dcce6d55c33e151b291c2874 | SQL | chaesiong/rtp-database | /production/PIBICSDM2/tables/tmp_sync_mas_policorganize.sql | UTF-8 | 635 | 2.609375 | 3 | [] | no_license | CREATE TABLE "PIBICSDM2"."TMP_SYNC_MAS_POLICORGANIZE"
( "ORG_SEQNO" NUMBER,
"ORGCD" CHAR(4 CHAR),
"ORGNM" VARCHAR2(60 CHAR),
"ACTFLAG" CHAR(1 CHAR),
"EXTFLAG" CHAR(1 CHAR),
"CREATE_BY" VARCHAR2(20 CHAR),
"CREATE_DATE" TIMESTAMP (6),
"UPDATE_BY" VARCHAR2(20 CHAR),
"UPDATE_DATE" TIMESTAMP (6)... | true |
7bbf69b1653d028470a4f10fb5f66c5fa55f569b | SQL | iLori-Jiang/12306_Railway_System | /SQL_database/project_02_public_travel.sql | UTF-8 | 704 | 3.15625 | 3 | [] | no_license | create table travel
(
travel_id serial
constraint travel_pk
primary key,
train_id varchar not null
constraint travel_train_train_id_fk
references train
);
create unique index travel_travel_id_uindex
on travel (travel_id);
-- INSERT INTO public.travel (travel_id, tr... | true |
47a9ecd2314b7bc95e596556730ef99967c2020a | SQL | qt-web/SecuCarServer | /DB/_secucar.sql | UTF-8 | 1,466 | 3.53125 | 4 | [] | no_license | PRAGMA foreign_keys = ON;
DROP TABLE IF EXISTS samples;
DROP TABLE IF EXISTS devices;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS tracks;
CREATE TABLE `samples` (
`idSample` INTEGER NOT NULL,
`idTrack` INTEGER NOT NULL,
`timestamp` timestamp NOT NULL,
`coordinates` TEXT NOT NULL,
`speed` INTEGER NOT NU... | true |
81faddc7fb728c2764cbc573c06ef1223e026cdb | SQL | gimena-lopez/BD2 | /exercicios-1/Exercicio41_BD2.sql | UTF-8 | 240 | 3.296875 | 3 | [] | no_license | USE world;
SELECT country.*, countrylanguage.language, countrylanguage.IsOfficial FROM country
INNER JOIN countrylanguage
ON country.Code = countrylanguage.CountryCode
WHERE countrylanguage.language LIKE 'Spanish' AND IsOfficial LIKE 'T';
| true |
880442974045a0d1b097339d8baf695bacdba1a6 | SQL | Catfeeds/51ehw | /web/9thleaf_51ehw_2018-05-04.sql | UTF-8 | 230,082 | 3.28125 | 3 | [] | no_license | # ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 192.168.10.139 (MySQL 5.7.12)
# Database: 9thleaf_51ehw
# Generation Time: 2018-05-04 07:00:33 +0000
# ************************************... | true |
272f5a3f82567b717380524e8a9a81440bed0a88 | SQL | jrjr-randy/backoffice | /sql/table/login_requirement_types.table.sql | UTF-8 | 1,063 | 3.546875 | 4 | [] | no_license | DROP PROCEDURE IF EXISTS login_requirement_types_schema;
DELIMITER //
CREATE PROCEDURE login_requirement_types_schema()
BEGIN
IF NOT EXISTS (SELECT * FROM `information_schema`.`columns` WHERE `table_schema` = (SELECT DATABASE()) AND `table_name` = 'login_requirement_types') THEN
CREATE TABLE `login_r... | true |
a0b97c74bd9d7b2eb75e90530a82f79dd39256bf | SQL | uazhlt-ms-program/ling-508-su2021-final-project-phgoddard | /data/init.sql | UTF-8 | 672 | 3.265625 | 3 | [] | no_license | CREATE DATABASE cxdata;
ALTER DATABASE cxdata CHARACTER SET utf8 COLLATE utf8_unicode_ci;
use cxdata;
CREATE TABLE study (
studyname VARCHAR(128),
study_id int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (study_id)
);
CREATE TABLE file
( file_name VARCHAR(128),
file_id int not null auto_increment,
stud... | true |
cc160572b2e67929da716b0561cadd65d47d0e91 | SQL | EduardoJBarraa/Documents | /Github/Bd en partes/Creación de tabla producto.sql | UTF-8 | 206 | 2.578125 | 3 | [] | no_license | create table if not exists Producto (
idproducto integer not null auto_increment,
tipo_producto varchar (100) not null,
es varchar (100) not null,
primary key (idproducto)
);
-- creación de tabla producto | true |
ed4b1511049ca8afd9e0053142726828c1228c80 | SQL | haqnawazwgbm/REST_APIS | /db/transaction.sql | UTF-8 | 9,490 | 3.1875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 20, 2019 at 07:58 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.1.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
1d7bf6797eedfa817c987755dc9e5f6b258e7588 | SQL | elizioalmeida/scramble | /teste5.sql | UTF-8 | 236 | 3.453125 | 3 | [] | no_license | INSERT INTO controle_itemdesenvolvimento ( IT.concluido )
SELECT SUM((TR.participacao*TR.status)/100)
FROM controle_tarefas TR
LEFT JOIN controle_itemdesenvolvimento IT ON TR.itdes_id = IT.id
WHERE IT.id=TR.itdes_id
GROUP BY IT.id; | true |
6c7b5783c2b95178355db3714ac8a9df4c5118b1 | SQL | cHolzberger/sag-akademie | /sag-akademie.de/lib/db/mysql/99-batch.sql | UTF-8 | 1,628 | 3.5 | 4 | [] | no_license | -- Mysql sort order and optimisation
ALTER TABLE `buchung` ORDER BY `datum`;
ALTER TABLE `akquise_kontakt` ORDER BY `firma`;
ALTER TABLE `hotel` ORDER BY `name`;
ALTER TABLE `hotel_preis` ORDER BY `datum_start`;
ALTER TABLE `kontakt` ORDER BY `firma`;
ALTER TABLE `kontakt_kategorie` ORDER BY `name`;
ALTER TABLE ... | true |
3218ee8e9273420c7c9d28a1427f74cdc0b38f45 | SQL | shagstone/yesimo_work_repo | /staging/tables/stg_suppl_product_invent.sql | UTF-8 | 1,760 | 3.6875 | 4 | [] | no_license |
-- -----------------------------------------------------
-- Table stg_suppl_product_invent
-- -----------------------------------------------------
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='T... | true |
dd6b55f2d5dbe9e3c6e3393a2328d6afe0c26c30 | SQL | akshata96/CS611-Startwell | /DB/CustomerMacroSurvey.sql | UTF-8 | 9,347 | 2.765625 | 3 | [] | no_license | /* Bucket Type */
INSERT INTO StartwellDB.Bucket (BucketType,BucketDesc) VALUES ('Customer','General to all Customer');
/* Cateogry Type */
INSERT INTO StartwellDB.SCategories (CategoryID,BucketType,CatDesc) VALUES ('CustomerMacroSurvey','Customer','Macropreference survey asked to users for matching');
/* Survey */... | true |
29b201171e27025756cfa544708504417c8e0fb3 | SQL | mariocrugar/ProyectoFinal-PDC | /realsuk/sql/to_semantic.sql | UTF-8 | 632 | 2.984375 | 3 | [] | no_license | create table if not exists semantic.entities as (
select distinct
uid,
postcode,
propert_type,
old_new,
street,
locality,
town_city,
district,
county
from
cleaned.hmlr_prices
);
create table if not exists semantic.events as (
select ... | true |
5a0511ed759baceeb59590d92586632f6c00c59c | SQL | Marcos314/desafio-magrathealabs | /queries/pergunta2.sql | UTF-8 | 831 | 3.890625 | 4 | [] | no_license | -- Mostre qual os top 3 produtos mais importados por estado entre 2017 e 2019
SELECT
*
FROM (
SELECT
uf AS estado,
produto,
ano,
COUNT(produto) AS qtd_produtos_importados,
RANK() OVER(PARTITION BY uf, ano ORDER BY COUNT(produto) DESC) produto_rank
FROM
`visualizacao-de-dados.desafioMagra... | true |
52c2c6c55a98878eb4997c08e0d0a2911b850cd2 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day21/select2024.sql | UTF-8 | 177 | 2.609375 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-20T20:24:00Z' AND timestamp<'2017-11-21T20:24:00Z' AND temperature>=9 AND temperature<=82
| true |
f4cfa64070383e662020dd85e5b66761bf81fdb4 | SQL | Mbaey/Java | /小项目/DingDang/doc/SQL.sql | UTF-8 | 174 | 3.375 | 3 | [
"Apache-2.0"
] | permissive | CREATE VIEW ScoreJoin AS
select t.name stuName, s.Sid , s.Cid, c.name as coursename,s.score, c.term
from stus as t ,scores as s, courses as c
where t.id=s.sid and c.id=s.cid; | true |
b152f8ae9522481e46d9d499556fa0dbf30e99a9 | SQL | alexuryumtsev/mvc-php | /mvc.sql | UTF-8 | 4,998 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 13, 2018 at 04:23 PM
-- Server version: 5.7.21-0ubuntu0.16.04.1
-- PHP Version: 7.2.3-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!401... | true |
41188ed9016af5e146bf6c9e639facfeaa887764 | SQL | alexjavabraz/NotasSpringAPI | /db_export/Dump20180308.sql | UTF-8 | 2,361 | 2.6875 | 3 | [
"MIT"
] | permissive | -- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: teste
-- ------------------------------------------------------
-- Server version 5.7.21-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_... | true |
ddd923f8ffcf9176cc55facbecc18da2971a039b | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day23/select0810.sql | UTF-8 | 274 | 3.09375 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='Thermometer' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['3002','5100_6','5202','3100_3','1600','2086','2084','6056','5100_10','3013'])
| true |
73c4c482444879345031221dfda560c276c4f623 | SQL | iu-msis/ds-hw1-cshudak | /public/data/hw-stub.sql | UTF-8 | 355 | 2.59375 | 3 | [] | no_license | CREATE TABLE Homework (
id INT AUTO_INCREMENT,
comment VARCHAR(80) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO Homework (id, comment)
VALUES (1, 'life is good');
INSERT INTO Homework (id, comment)
VALUES (2, 'after you');
INSERT INTO Homework (id, comment)
VALUES (3, 'complete the core');
INSERT INTO Homework (co... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.