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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2273742bb87467076079cd6f8ff2bf02e74dc877 | SQL | moutainhigh/eis | /stat/src/com/maicard/sp/basic/remove_relate_product.sql | UTF-8 | 503 | 2.953125 | 3 | [] | no_license | DELIMITER $$
CREATE
PROCEDURE `remove_relate_product`(productId int)
BEGIN
SET @product_id = productId;
SET @udid = (SELECT udid FROM document WHERE document_code in (SELECT product_code FROM product where product_id = @product_id));
DELETE FROM tag_object_relation WHERE udid = @udi... | true |
fd1a114442968734830a68eb5af5969c4bdacf7b | SQL | artifacthub/hub | /database/migrations/schema/040_keep_views_on_delete.sql | UTF-8 | 877 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | alter table package_views alter column package_id drop not null;
alter table package_views alter column version drop not null;
alter table package_views drop constraint package_views_package_id_version_fkey;
alter table package_views add constraint package_views_package_id_version_fkey
foreign key (package_id, vers... | true |
81b7897c66853b5f4b7ba90aab004a1f6f66735f | SQL | merewall/Employee-Tracker | /db/schema.sql | UTF-8 | 1,126 | 4.25 | 4 | [
"MIT"
] | permissive | /* Drop/create database */
DROP DATABASE IF EXISTS companyDB;
CREATE database companyDB;
USE companyDB;
/* Creating table of departments */
CREATE TABLE departments (
id INT UNSIGNED AUTO_INCREMENT,
name VARCHAR(30) UNIQUE NOT NULL,
PRIMARY KEY (id)
);
/* Creating table of roles */
CREATE TABLE role (
id INT... | true |
d679343830479e241d4d21a064572692dcaa4e68 | SQL | ECipolatti/Bases-de-Datos | /Practica Tuco/G6/E 1.sql | UTF-8 | 127 | 2.5625 | 3 | [] | no_license | CREATE PROC sp_ObtenerPrecio
AS
SELECT price
FROM titles
WHERE title_id = 'PS2091'
RETURN
EXEC sp_ObtenerPrecio | true |
706c9030c3ec0feba3c816f24f0d6d8e56434672 | SQL | FirebirdSQL/jira-attachments | /CORE/CORE-230/10082_startingWithBug.sql | UTF-8 | 617 | 3.484375 | 3 | [] | no_license |
CREATE DATABASE 'C:\test.fdb' USER 'SYSDBA' PASSWORD 'masterkey';
DROP PROCEDURE good;
DROP PROCEDURE bad;
RECREATE TABLE t (
id INTEGER NOT NULL PRIMARY KEY,
s VARCHAR(50)
);
CREATE INDEX idx ON t(s);
INSERT INTO t VALUES (1, '');
INSERT INTO t VALUES (2, 'X');
SET TERM ;; ;
CREATE OR ALTER ... | true |
fa1e269029397259464912414848768d411f0941 | SQL | rocketeerbkw/DNA | /Production/Source/Databases/The Guide/storedprocedures/getnamespacesforsite.sql | UTF-8 | 145 | 2.796875 | 3 | [] | no_license | CREATE PROCEDURE getnamespacesforsite @siteid INT
AS
SELECT NameSpaceID, SiteID, [Name] FROM dbo.NameSpaces WITH(NOLOCK) WHERE SiteID = @siteid | true |
602c0dee0b061d1621f3fd5117743e2b49b8ccff | SQL | FinOCE/CP2404 | /Week 9/queries/39.sql | UTF-8 | 182 | 3.15625 | 3 | [] | no_license | SELECT
BOOK.PAT_ID,
BOOK_NUM,
PAT_FNAME,
PAT_LNAME,
BOOK_TITLE
FROM BOOK
JOIN PATRON ON BOOK.PAT_ID = PATRON.PAT_ID
ORDER BY
Upper(PAT_LNAME),
BOOK_TITLE; | true |
1b43be0ee23b782c5091cb9597159a0519b966a4 | SQL | gammaseeker/Web-Dev-Reboot | /Spring Final Project/Excel Data/nyccoordinates.sql | UTF-8 | 1,271 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 29, 2016 at 02:03 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
c66a71f21795ec940a941cdc59ef9fd499772d5f | SQL | akami76/rank | /src/main/resources/schema/init.sql | UTF-8 | 527 | 2.96875 | 3 | [] | no_license | //drop table if exists tb_word;
//drop table if exists tb_word_hist;
CREATE TABLE tb_word (
id integer PRIMARY KEY,
portal varchar(10) NOT NULL,
type varchar(10) NOT NULL,
crawler_time TIMESTAMP NOT NULL,
rank_index int,
search_word varchar(100),
relation_word varchar(200)
);
CREATE TABLE tb_word_his... | true |
ca2ddd9bf174c927d23904a78179caf7569f5b3e | SQL | ShadeSlider/onPHP-Inception | /db/sql/onphp_log_2014_07_22.sql | UTF-8 | 6,878 | 3.203125 | 3 | [] | no_license |
CREATE TABLE "backend_user" (
);
CREATE SEQUENCE "backend_user_id_seq";
ALTER TABLE "backend_user" ADD COLUMN "id" INTEGER NOT NULL default nextval('backend_user_id_seq');
ALTER TABLE "backend_user" ADD PRIMARY KEY("id");
ALTER TABLE "backend_user" ADD COLUMN "created_at" TIMESTAMP WITH TIME ZONE NULL;
ALTER ... | true |
e745a59f5a4955d051f22db32a631a0e7b5ee41e | SQL | foundling108/Well-Written | /db/characters/delete_character.sql | UTF-8 | 132 | 2.828125 | 3 | [] | no_license | DELETE FROM characters
WHERE character_id = $2
AND user_id = $1;
SELECT *
FROM characters
WHERE user_id = $1
ORDER BY character_id; | true |
c858dbd849fa12b0a589d7b2d6dadae95d62e213 | SQL | CarlosPeluffo/HelpDesk | /database/help_desk.sql | UTF-8 | 19,125 | 3.59375 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 25-06-2021 a las 02:00:34
-- Versión del servidor: 10.1.38-MariaDB
-- Versión de PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
79cd5e6b68f7f4a162ce726b2c793da4ea03d678 | SQL | akileecn/web | /src/main/resources/sql/mysql-ddl.sql | UTF-8 | 1,481 | 3.484375 | 3 | [] | no_license | /*2016-03-31*/
/**
* 用户
*/
create table user(
id int primary key auto_increment
,username varchar(32) not null unique
,password varchar(32) not null
);
/**
* 角色
*/
create table role(
id int primary key auto_increment
,name varchar(32) not null unique
,remark varchar(50)
);
/**
* 用户角色关系
*/... | true |
b8f50d929a573450ead6c02473b479dcbad71a58 | SQL | nikitaDanilenko/foodie | /conf/db/migration/default/V6__allow_multiple_reference_maps.sql | UTF-8 | 1,330 | 3.875 | 4 | [] | permissive | create table reference_map
(
id uuid not null,
name text not null,
user_id uuid not null
);
alter table reference_map
add constraint reference_map_pk primary key (id),
add constraint reference_map_user_id_fk foreign key (user_id) references "user"(id) on delete cascade;
create table refere... | true |
7184d05d15d8845b3503eacaa5837ff89b49ff75 | SQL | VedangJoshi/MySQL_Queries | /Trigger_Update.sql | UTF-8 | 3,150 | 3.109375 | 3 | [] | no_license | delimiter $
create Trigger Check_Building_Name
before update on room
for each row
begin
if( substring(new.room_no,4,-1)!=old.building ) then
signal sqlstate '10102'
set message_text='Room_no literal should be the same as first letter in Building Name';
end if;
end;$
delimiter ;
... | true |
4e2f7c5a2f77388a9adbeb41c9cde270c30da9b8 | SQL | Mazharul-Hoque-Naumy/Mazharul_shop | /categories.sql | UTF-8 | 1,239 | 2.828125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 29, 2017 at 04:39 PM
-- Server version: 5.5.27
-- PHP Version: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
78fa8223c6f00ee3e49290ea5762a3a90d777dc4 | SQL | dianadecena/IoT-supermarket-data-analysis | /Data/.ipynb_checkpoints/star_schema_ventas-checkpoint.sql | UTF-8 | 1,153 | 3.6875 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS sucursal(
id_sucursal integer,
ubicacion varchar(20) not null,
primary key (id_sucursal)
);
CREATE TABLE IF NOT EXISTS producto(
id_producto integer,
nombre varchar(20) not null,
categoria varchar(20) not null,
precio integer,
primary key (id_producto)
... | true |
41b684d3379b432cb6e8dafc71db524d57125d95 | SQL | YuriiGevtsi/twitter-clone-app | /src/main/resources/db/migration/V4__add_subscriptions_table.sql | UTF-8 | 166 | 2.765625 | 3 | [] | no_license | create table user_subscriptions(
chanel_id int8 not null references users,
subscriber_id int8 not null references users,
primary key (chanel_id,subscriber_id)
) | true |
f0fb087496d9e62083b6b0c53b3a165e89e87478 | SQL | vitorfelipep/store-sale | /store-app/src/main/resources/db/migration/V1_003__create_relationship_store_order_to_store.sql | UTF-8 | 116 | 3.296875 | 3 | [] | no_license | ALTER TABLE store_order
ADD CONSTRAINT FK_store_order_to_store
FOREIGN KEY (store_id) REFERENCES store(id);
| true |
d51dc34df22ca2c1979c54c2ca71804a4266eaa2 | SQL | eads/fosas-gatsbyv1 | /sql/views/pgr_centroids.sql | UTF-8 | 622 | 3.515625 | 4 | [
"MIT"
] | permissive | create materialized view if not exists pgr_centroids as
WITH cte AS (
SELECT
substring(munid FROM 3 FOR 2) AS cve_ent,
substring(munid FROM 5 FOR 3) AS cve_mun,
d.*
FROM
mapasdata_flat d
WHERE substring(munid, 1, 2) = '00'
)
SELECT
m.nom_mun,
e.nom_ent,
c.*,
cas... | true |
8c715f9b9c385aa579d08eefa6149a36d4d6ba95 | SQL | dcheng1290/databases | /server/schema.sql | UTF-8 | 995 | 3.8125 | 4 | [] | no_license | DROP DATABASE IF EXISTS chat;
CREATE DATABASE chat;
USE chat;
CREATE TABLE users (
id integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
username VARCHAR(20) NOT NULL
);
CREATE TABLE rooms (
id integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
roomname VARCHAR(20) NOT NULL
);
CREATE TABLE messages (
id integer A... | true |
06cd09daf975ac94bf312e121d807853a3bdc0ef | SQL | xxdoc/SampleVBCode | /TSQL_Scripts_2000/Stored Procedures/dbo.z_spsGetCatInfo.PRC | UTF-8 | 7,701 | 3.796875 | 4 | [] | no_license | SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[z_spsGetCatInfo]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[z_spsGetCatInfo]
GO
/******************************************************************
*
* Description: Cat... | true |
09a1252c0a44ea7548ab6b98f36c285de1d57322 | SQL | devhmac/Hypocenter | /express-back-end/db/schema/04_comments.sql | UTF-8 | 256 | 3.140625 | 3 | [] | no_license | DROP TABLE IF EXISTS comments CASCADE;
CREATE TABLE comments (
id SERIAL PRIMARY KEY NOT NULL,
content TEXT NOT NULL,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
earthquake_id VARCHAR(255) REFERENCES earthquakes(id) ON DELETE CASCADE
); | true |
e51816fdcc7932fbe8bbc845da2e0574aea993d5 | SQL | brianwilsonotweyo/talkteach | /datadump.sql | UTF-8 | 20,718 | 3.171875 | 3 | [] | no_license | -- MariaDB dump 10.17 Distrib 10.4.14-MariaDB, for Win64 (AMD64)
--
-- Host: localhost Database: teachtalk
-- ------------------------------------------------------
-- Server version 10.4.14-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTE... | true |
a5fd3bfb2be6884a6ad83c2128fcae6e8fb135ce | SQL | teefranklin/PHP-Tool-Management-System | /Database/library(1).sql | UTF-8 | 75,367 | 2.875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 15, 2019 at 01:57 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
ae783d93513ce855523cf3c49d5a7575546f1c09 | SQL | george518/HaoPipi | /TestDb.sql | UTF-8 | 11,071 | 3.171875 | 3 | [] | no_license | --演示数据库 by George Hao
create database zxkm;
SET NAMES UTF8;
use zxkm;
CREATE TABLE IF NOT EXISTS `zxkm_member_base` (
`member_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '会员id',
`nick_name` varchar(50) NOT NULL DEFAULT '' COMMENT '昵称',
`member_img` varchar(128) DEFAULT NULL COMMENT '用户头像',
`mobile` ... | true |
aed449eaea7241998f7c2b79d1bcb360e0a1b788 | SQL | TarparaDhruv/Data-Warehouse-Assignments | /Assignment 1/database after normalization/assignment1_aquaculture_county.sql | UTF-8 | 2,333 | 2.9375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
--
-- Host: localhost Database: assignment1
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESU... | true |
b12bbefed25304096e83bb833a21c2f264658298 | SQL | justinlettau/sql-source-control-example | /_sql-database/tables/Production.ProductDescription.sql | UTF-8 | 801 | 3.734375 | 4 | [] | no_license | IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[Production].[ProductDescription]') AND type = 'U')
CREATE TABLE [Production].[ProductDescription]
(
[ProductDescriptionID] int NOT NULL IDENTITY(1, 1),
[Description] nvarchar(400) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[rowguid] ... | true |
a36719ea8c337b5aa16fef859af1bb1ee5e58d14 | SQL | 4aiNik/epixxPHP | /epixx.sql | UTF-8 | 2,552 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Авг 13 2016 г., 20:18
-- Версия сервера: 10.1.10-MariaDB
-- Версия PHP: 7.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT *... | true |
4c21a2b2805fa20101d4bd86d4ddb19eb2c31b10 | SQL | danilotaira/isfood | /src/main/resources/db/migration/V014__create_table_user_restaurant_responsible.sql | UTF-8 | 390 | 3.125 | 3 | [] | no_license | create table restaurant_user_responsible (
restaurant_id bigint not null,
user_access_id integer not null
);
alter table if exists restaurant_user_responsible add constraint fk_restaurants_users foreign key (user_access_id) references user_access;
alter table if exists restaurant_user_responsible add constraint f... | true |
9798e3b7ed72f88d607dbd5aea3ad9b9248c088f | SQL | forest611/Man10Market | /src/main/sql/table.sql | UTF-8 | 3,292 | 4.21875 | 4 | [] | no_license | create table order_table
(
id int auto_increment,
player varchar(16) null,
uuid varchar(36) null,
item_id varchar(32) not null,
price double null,
buy boolean default 0 null,
sell boolean default 0 ... | true |
77b66f23dbb4ddb9b68e7589f4982f14e3d7e9c2 | SQL | AbdullahiAbdulkabir/CMS | /widget_corp.sql | UTF-8 | 2,249 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.1.3.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 19, 2017 at 09:13 PM
-- Server version: 5.1.33
-- PHP Version: 5.2.9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER... | true |
08f076bdd360f7185ffd0c2014d1670bc05f20d3 | SQL | helpdotcom/goose | /db/migrations/002_no_transactions.sql | UTF-8 | 293 | 2.890625 | 3 | [
"MIT"
] | permissive | -- NO TRANSACTIONS --
-- +goose Up
-- +goose StatementBegin
CREATE TABLE post (
id int NOT NULL,
title text,
body text,
PRIMARY KEY(id)
);
INSERT INTO post (id, title, body) VALUES(1, 'test post', 'this is a test post');
-- +goose StatementEnd
-- +goose Down
DROP TABLE post; | true |
55d965d7325f0681ffe6e4685d3c1a7fed7acc33 | SQL | mbg17/superlist | /mysql/day1.sql | UTF-8 | 2,015 | 4.21875 | 4 | [] | no_license | CREATE TABLE class (
cid INT auto_increment PRIMARY KEY,# 自增主键
caption VARCHAR(20)
) ENGINE = INNODB DEFAULT CHARSET utf8;# 支持原子性操作,默认编码为UTF8
CREATE TABLE student(
sid INT auto_increment PRIMARY KEY,
sname varchar(20),
gender enum('男', '女'),# 枚举值
class_id int,
constraint fk_sid_cid FOREIGN KEY(class_i... | true |
522e7484d4a0b1c6dba7d0ed847ca164ac8349e1 | SQL | luckypig3400/SQL_Practice_for_1092DataBaseManagementSystem | /20210510_HW3/HW1_SelectDB.sql | UTF-8 | 2,237 | 4.28125 | 4 | [] | no_license | /*
問題3 - 新增資料表與更新關聯 (合計共110分)
以SELECT語法查詢經過CreateDB.sql以及AlterDB.sql執行後的資料庫,,規則說明如下
3. SelectDB.sql: 規格:
- 3.1 使用SELECT查詢語法進行跨資料表查詢,並顯示以下欄位
(1) "姓氏 + 名字" (姓與名中間要1個空白), (2) 生日與性別,
(3)城市, 國籍 (4)帳號 (5) 分行名稱 (6) 餘額。
其中(1), (2), (3)顯示結果,兩個欄位數值中間需要有一個','符號等
作為區隔需分兩欄位的數值 (1:15分、2-3: 10分,4-6: 5分,
合計: 15x1 + 10x3 + 5x3... | true |
59b5e829c23c902008de7fee4bdd77c624e8144c | SQL | LakshmiDeviPalanivelu/College-Transport-Management-System | /college.sql | UTF-8 | 9,884 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 28, 2017 at 07:01 AM
-- Server version: 5.5.32
-- PHP Version: 5.4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
1e91cf59d8ca030bd09c7427c815cff28dc9db73 | SQL | e-muf/Proyecto-Ventas-Auto-BDD | /scripts/s-05-autos-rfp-s2-vistas-blob.sql | UTF-8 | 1,037 | 3.359375 | 3 | [
"MIT"
] | permissive | --@Author: Emanuel Flores Martinez
--@Fecha de creacion: 20/01/2021
--@Descripcion: Creacion de vistas que requieren manejo de datos BLOB
-- para el sitio rfpbd_s2
Prompt creando vistas que requieren acceso remoto
-- auto
create or replace view auto as
select q1.auto_id,... | true |
90107820411fcc24eb2b6e79d0dc1e2e75ff4c98 | SQL | allenPro99/LBD2019 | /visualizzaArea.sql | UTF-8 | 6,991 | 2.828125 | 3 | [] | no_license | create or replace procedure visualizzaArea(id_sessione int default 0, nome varchar2, ruolo varchar2, idRiga int) is
-- Parametri dell'autorimessa corrente
area Aree%ROWTYPE;
-- Indirizzo dell'autorimessa di riferimento
indirizzo_autorimessa Autorimesse.Indirizzo%TYPE;
-- ID e indirizzo della sede di... | true |
c951aefe581ce1b8ec6cc9b03d7064c19f381986 | SQL | WagnerBragaBispo/SQL_Oracle | /RetidoDigitalResidencial.sql | WINDOWS-1252 | 1,897 | 3.234375 | 3 | [] | no_license |
/*Segue abaixo o exemplo de trazer quais canais de atendimentos esto cadastrados aps a tag origem*/
-- EXEMPLO PARA EXTRAIR E VERIFICAR OS CAMPOS DO
SELECT /*+parallel (12)*/ DISTINCT TRIM(SUBSTR(NM_DESC_PEDIDO,INSTR(NM_DESC_PEDIDO,'|origem:')+8)) AS TESTE
FROM INN.EXT_ADMINSITE
WHERE TRUN... | true |
f2de8369884b054135b8d858e07a85eb7037065c | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day25/select2141.sql | UTF-8 | 498 | 3.625 | 4 | [] | no_license |
SELECT obs.sensor_id, avg(counts)
FROM (SELECT sensor_id, date_trunc('day', timestamp), count(*) as counts
FROM WeMoObservation WHERE timestamp>'2017-11-24T21:41:00Z' AND timestamp<'2017-11-25T21:41:00Z' AND SENSOR_ID = ANY(array['6f0cabfe_e3b9_4b97_be68_9abbc83be74f','3142_clwa_2059','8dc102b2_58f4_48b9_a3f5_... | true |
1a8d0d556bb9ea94e8ea36c8f321bfeefee9f2fb | SQL | kostaskougios/mapperdao | /src/test/resources/sql/UseCaseHierarchicalCategoriesSuite.h2.sql | UTF-8 | 215 | 3.1875 | 3 | [] | no_license | [ddl]
create table Category (
id serial primary key,
name varchar(100) not null,
parent_id int,
constraint FK_Category_Parent foreign key (parent_id) references Category(id) on delete cascade on update cascade
) | true |
dec610e3b6827964238da1bbbc9d3fd35cc346a9 | SQL | Prosp3r/oshop | /db/migrations/2_create_products_table.up.sql | UTF-8 | 565 | 2.53125 | 3 | [] | no_license | CREATE TABLE products(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100),
details JSON CHECK(JSON_VALID(details)),
dateadded TIMESTAMP on update current_timestamp NOT NULL,
quantity INT(9),
itemstatus VARCHAR(10)
);
INSERT INTO poducts (id, title, details, dateadded, quantity, item... | true |
d40d579497fd26c6e69c802da74ff224246d2c90 | SQL | prateeknayak/postgresql-vagrant-box | /bin/vagrant-data/sql/test_schema.sql | UTF-8 | 316 | 3.0625 | 3 | [] | no_license | CREATE USER test_user WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE test_db to test_user;
CREATE TABLE public.test_table
(
name character varying(255) NOT NULL,
created_timestamp timestamp without time zone DEFAULT now(),
CONSTRAINT test_table_pkey PRIMARY KEY (name)
)
WITH (
OIDS=FALSE
);
| true |
aa7de48033606a6e1cec6f02f6df76ef03acb5a2 | SQL | IrvingW/leetcode_problems | /182.查找重复的电子邮箱.sql | UTF-8 | 1,017 | 3.5 | 4 | [] | no_license | --
-- @lc app=leetcode.cn id=182 lang=mysql
--
-- [182] 查找重复的电子邮箱
--
-- https://leetcode-cn.com/problems/duplicate-emails/description/
--
-- database
-- Easy (79.68%)
-- Likes: 275
-- Dislikes: 0
-- Total Accepted: 151.7K
-- Total Submissions: 190.4K
-- Testcase Example: '{"headers": {"Person": ["Id", "Email"]},... | true |
cd7c0e191e786c3ccedf8e19446d79c770c3c0a1 | SQL | xyuae/biteman | /order.sql | UTF-8 | 1,273 | 2.828125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- 主机: 127.0.0.1
-- 生成日期: 2016-11-18 20:31:36
-- 服务器版本: 5.5.50-0ubuntu0.14.04.1
-- PHP 版本: 5.5.9-1ubuntu4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
fe0318f2f2787cc16df7dcd2dadbf3108f6b877f | SQL | NehaPatil98/SQL | /PROJECT/NEHA_PATIL_MS_SQL_SERVER_CREATE.sql | UTF-8 | 1,970 | 3.890625 | 4 | [] | no_license | use OnlineShopping
CREATE TABLE Customer (
customer_id INT PRIMARY KEY IDENTITY(1,1),
cust_name VARCHAR (255) NOT NULL,
contact_add INT NOT NULL,
address VARCHAR(max),
);
--for trigger
CREATE TABLE customer_audit (
customer_id INT PRIMARY KEY IDENTITY(1,1),
cust_name VARCHAR (255) NOT NULL,
... | true |
6116b92743df63e06695ecd2aa018bf6ae9f6119 | SQL | marcelobojikian/Cash-House-Backend-Java | /core/src/main/resources/db/migration/V1__createSchema.sql | UTF-8 | 3,711 | 3.84375 | 4 | [
"MIT"
] | permissive |
DROP TABLE IF EXISTS USERS CASCADE;
DROP TABLE IF EXISTS DASHBOARD_CASHIER;
DROP TABLE IF EXISTS DASHBOARD_FLATMATE;
DROP TABLE IF EXISTS DASHBOARD_GUEST;
DROP TABLE IF EXISTS DASHBOARD_TRANSACTION;
DROP TABLE IF EXISTS DASHBOARD;
DROP TABLE IF EXISTS TRANSACTION;
DROP TABLE IF EXISTS CASHIER;
DROP TABLE IF EXISTS FL... | true |
78268d579b220817ada6cfb9c668f6d11bba2ba3 | SQL | Rodrigo-Novas/Transacr-Sql | /EducacionItAdWorks/EducacionItAdWorks/Joins.sql | ISO-8859-1 | 2,685 | 4.03125 | 4 | [] | no_license | /*Mostrar los empleados que tambin son vendedores
Tablas: HumanResources.Employee, Sales.SalesPerson
Campos: BusinessEntityID*/
SELECT
*
FROM HumanResources.Employee E
JOIN Sales.SalesPerson S
on E.BusinessEntityID = S.BusinessEntityID
/*Mostrar los empleados ordenados alfabticamente por apellido y por no... | true |
8e3e26df33efba8a1e979ca6422830fb0755de7f | SQL | ifeomi/i4 | /server/structure.sql | UTF-8 | 11,050 | 3.0625 | 3 | [] | no_license | /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `db_CaseInfo` (
`CaseInfoID` int(11) NOT NULL AUTO_INCREMENT,
`ClientID` int(11) NOT NULL DEFAULT '0',
`CaseTypeID` int(11) NOT NULL DEFAULT '0',
`Date` datetime DEFAULT NULL,
`CategoryID` ... | true |
e34a02fe47d8e60c99df94bb5b083750d8f8cea8 | SQL | datalytyx/dlx-test-sources | /mysql-flex/world_x/world_x.sql | UTF-8 | 386,147 | 3 | 3 | [
"Apache-2.0"
] | permissive | -- MySQL dump 10.13 Distrib 5.7.22, for Linux (x86_64)
--
-- Host: localhost Database: world_x
-- ------------------------------------------------------
-- Server version 5.7.22-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;... | true |
9ef3d0d3ed429d55a194235f69b86558bf0ef527 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day24/select0525.sql | UTF-8 | 178 | 2.71875 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-23T05:25:00Z' AND timestamp<'2017-11-24T05:25:00Z' AND temperature>=34 AND temperature<=74
| true |
ea89f3dc26d67d0707dc060c3a1dd1e81667ccf9 | SQL | ivchip/exam_mercado_libre | /.docker/setup.sql | UTF-8 | 281 | 2.890625 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS db_mutant DEFAULT CHARACTER SET utf8;
USE db_mutant;
CREATE TABLE IF NOT EXISTS person (
id BIGINT NOT NULL AUTO_INCREMENT,
dna VARCHAR(1000) NOT NULL,
mutant TINYINT NOT NULL,
PRIMARY KEY (id),
UNIQUE INDEX dna_UNIQUE (dna ASC)); | true |
656dc7c0f76dba69f1ac4637f567c4c6ada1682d | SQL | DarNattp/Geting_Start_SQL_BY_DataRockie | /practice_sql/Assigment15.sql | UTF-8 | 217 | 3.703125 | 4 | [] | no_license | SELECT DISTINCT
A.first_name,
A.last_name,
B.address,
B.postal_code
FROM customer A
JOIN address B ON A.address_id = B.address_id
JOIN rental C ON A.customer_id = C.customer_id
WHERE C.return_date IS NULL
ORDER BY 1;
| true |
b147884fcd719316f191b0e19d56453e7d7e0a6f | SQL | CECHitsolctr/StudentSuccessDashboard | /src/SSD.Integration.Database/SSD/Tables/Category.sql | UTF-8 | 281 | 3.375 | 3 | [] | no_license | CREATE TABLE [SSD].[Category] (
[CategoryId] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (255) NOT NULL,
CONSTRAINT [PK_SSD.Category] PRIMARY KEY CLUSTERED ([CategoryId] ASC),
CONSTRAINT [UX_Category_Name] UNIQUE NONCLUSTERED ([Name] ASC)
);
| true |
4f47d9ebab8d1153b5b251d47d579f385a66b523 | SQL | hillerlab/CESAR2.0 | /kent/src/hg/lib/snpOrthoPanPonRhe.sql | UTF-8 | 2,054 | 3.109375 | 3 | [
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-proprietary-license",
"MIT"
] | permissive | # snpOrthoPanPonRhe.sql was originally generated by the autoSql program, which also
# generated snpOrthoPanPonRhe.c and snpOrthoPanPonRhe.h. This creates the database representation of
# an object which can be loaded and saved from RAM in a fairly
# automatic way.
#Orthologous alleles in chimp, orangutan and rhesus... | true |
f6c7928dc918f6c21ab0aab5c2eacaf6ec7bbeab | SQL | caiyunfan123/sales-prj | /src/main/azkabanjob/b-2-3-put_customer_name.sql | UTF-8 | 926 | 3.625 | 4 | [] | no_license | DROP TABLE IF EXISTS tmp;
CREATE TABLE tmp AS
SELECT a.customer_sk,
a.customer_number,
b.customer_name,
a.customer_street_address,
a.customer_zip_code,
a.customer_city,
a.customer_state,
a.version,
a.effective_date,
a.expiry_date
FROM dim_customer a
JOIN sales_rds.customer b ON a.customer_number = b.customer_number
Whe... | true |
9e3512fcf41964ad27fe1e2b298b42946929ba9e | SQL | ipmcgrat/OCFR_Project | /app/data/schema-OCFR.sql | UTF-8 | 1,381 | 3.34375 | 3 | [] | no_license | USE ocfr26;
CREATE TABLE Staff (
radionumber VARCHAR(64) PRIMARY KEY,
firstname VARCHAR(64),
lastname VARCHAR(64),
station VARCHAR(64),
phone VARCHAR(64),
email VARCHAR(64)
);
INSERT INTO Staff (radionumber, firstname, lastname, station, phone, email) VALUES
("1213","Taylor", "McManus", "North 2", "111-2... | true |
f40234d8bedf2fbe8718cb476ee6d462b8051edb | SQL | johndimm/dishes | /db/business_stars.sql | UTF-8 | 335 | 3.5625 | 4 | [] | no_license | #
# Set the rating for a business to the average
# over all dish ratings.
#
SET SQL_SAFE_UPDATES = 0;
update business as b1
join (
select b.id, avg(pr.rating) as stars
from business as b
join photo as p on p.business_id = b.id
join photo_review as pr on pr.photo_id = p.id
group by b.id
) as t on t.id = b1.id
set b1.sta... | true |
2c098d91063905cbde31f839ff718d3d49c23988 | SQL | Allyson1602/myUpload | /upload.sql | UTF-8 | 1,515 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Tempo de geração: 22-Nov-2019 às 22:26
-- Versão do servidor: 10.3.16-MariaDB
-- versão do PHP: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101... | true |
834f154cc871b694cd546b42425b118970df5e6c | SQL | manjitwaikhom/SPRING-HIBERNATE | /SpringWithHibernate/setup.sql | UTF-8 | 291 | 2.5625 | 3 | [] | no_license | CREATE TABLE PERSON (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(20) NOT NULL DEFAULT '',
phone varchar(20) NOT NULL DEFAULT '',
address varchar(20) NOT NULL DEFAULT '',
email varchar(20) NOT NULL DEFAULT '',
country varchar(20) DEFAULT NULL,
PRIMARY KEY (id)
);
commit; | true |
ba76e6dde2380a5d76373f290563c21bedf5c98c | SQL | Gandalf-pro/WebContentScraper | /Sql/Torrent_types.sql | UTF-8 | 410 | 2.640625 | 3 | [] | no_license | drop type if exists MovieTorrent;
drop type if exists ShowTorrent;
CREATE TYPE MovieTorrent AS (
url text,
hash text,
quality character varying(10),
type text,
seeds integer,
peers integer,
size text,
size_bytes integer,
date_uploaded timestamp without time zone,
date_uploaded_unix bigint
);
CREATE ... | true |
5b85a7367389ab2ac272448619aa27dd5a192f96 | SQL | wildflower/SCMTurboCharge | /sunrise_Count_pricecode.sql | UTF-8 | 253 | 2.859375 | 3 | [] | no_license | /* query to find listof pricecodes and count of records with those price codes */
select pricecode,fixedvariable,
count(pricecode)
as count from scm.champion_eiep1
where reportmonth = '201112'
and retailer = 'PUNZ'
group by pricecode order by count | true |
c6fe6a887e8f03cf4eb5157869c4b17d315d30fc | SQL | shrikantmaliparge/demo | /src/main/resources/schema.sql | UTF-8 | 711 | 2.9375 | 3 | [] | no_license | create table Login_Database
(
id integer not null,
Email_id varchar(255) not null,
Name varchar(255) not null,
Password varchar(255) not null,
Autoization_Key varchar2(250 Char) not null,
primary key(id),
CONSTRAINT unk_Email_id UNIQUE (Email_id)
);
create table Available_Services
(
User_Name v... | true |
7d4f85e54ff504b6827b74f772f9c47e00ff0597 | SQL | MAttFernando777/ProyectoCalidadC5 | /Dump20210815/bbdddevcell_celular.sql | UTF-8 | 2,275 | 2.9375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.23, for Win64 (x86_64)
--
-- Host: localhost Database: bbdddevcell
-- ------------------------------------------------------
-- Server version 8.0.23
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;... | true |
a06691ea5f9317e9bef92ff60b64289b313d4527 | SQL | anilawasthi/Personal | /Smita_JPA/JPA/02_Demos/JPM_131_JPA_ObjectLifeCycle/greet.sql | UTF-8 | 329 | 2.765625 | 3 | [] | no_license | Drop TABLE greet;
CREATE TABLE greet(message_Id number(5) PRIMARY KEY,
message VARCHAR2(25));
CREATE SEQUENCE greet_seq;
select * from greet;
Drop TABLE student_master;
CREATE TABLE student_master
(student_id NUMBER(6) PRIMARY KEY,
student_name VARCHAR2(25));
CREATE SEQUENCE student_seq;
select * from student... | true |
bc11b316d8dc88da6e931ae35adfbbcdb2c1df48 | SQL | unhcr/PSR-Database | /SQL/Build/PLSQL/Test/test_LANGUAGE.sql | UTF-8 | 12,623 | 3.40625 | 3 | [] | no_license | -- Test set-up
-- ===========
define eh = "exception when others then dbms_output.put_line('-- ' || sqlerrm)"
variable VERSION_NBR number
variable SEQ_NBR number
set echo on serveroutput on feedback off recsepchar "." sqlprompt "" sqlnumber off
column LONG_TEXT format A150
spool test_LANGUAGE.log
-- Set languages... | true |
3f8a4871516c99a639047eea356147f179054aa5 | SQL | fcocascales/CursoServidorWebFTN2017 | /bd/dia02/user_dos.sql | UTF-8 | 400 | 2.9375 | 3 | [] | no_license | /*DROP DATABASE IF EXISTS bd_dos;*/
CREATE DATABASE IF NOT EXISTS bd_dos
CHARACTER SET utf8
COLLATE utf8_general_ci;
/*DROP USER 'user_dos'@'localhost';*/
CREATE USER IF NOT EXISTS 'user_dos'@'localhost'
IDENTIFIED BY '123';
/*REVOKE ALL PRIVILEGES
ON bd_dos.*
FROM 'user_dos'@'localhost';*/
GRANT AL... | true |
9abc7f840be3055a20e92e7f725b4c6623bb692e | SQL | millaaprillya/week6-web6-intermediateBackend | /etc/pos_app.sql | UTF-8 | 4,623 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 29, 2020 at 10:05 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.1.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
c025016b0d5a7d5e6afd73490fea129bb43b047b | SQL | campudus/tableaux | /src/main/resources/schema/schema_v4.sql | UTF-8 | 196 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | ALTER TABLE system_table
ADD COLUMN
ordering BIGINT;
UPDATE system_table
SET ordering = table_id;
ALTER TABLE system_table
ALTER COLUMN ordering
SET DEFAULT currval('system_table_table_id_seq'); | true |
f8c6744d362b7486e11436e7d5ff344cf0bc3edb | SQL | p-shelke/Leetcode_Database_Solutions | /175. Combine Two Tables.sql | UTF-8 | 321 | 3.59375 | 4 | [] | no_license | Write a SQL query for a report that provides the following information for each person in the Person table, regardless if there is an address for each of those people:
FirstName, LastName, City, State
SELECT a.FirstName, a.LastName, b.City, b.State
FROM Person a
LEFT JOIN Address b
ON a.PersonId = b.PersonId;
... | true |
4b58127bfba2f8568d6461d497083b6d57717d39 | SQL | rcargnelutti/larafood | /database/larafood2_2021_31_05.sql | UTF-8 | 12,043 | 2.953125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: mysql
-- Tempo de geração: 31/05/2021 às 04:52
-- Versão do servidor: 8.0.23
-- Versão do PHP: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... | true |
b78e5ff3ed88f2b2ff47cfa9d19be3a5e59630ec | SQL | OleksiiTimofieiev/SQL | /MySQL Essential/001_Intro_MySQL/001_Samples/003_SELECT.sql | UTF-8 | 2,385 | 3.53125 | 4 | [] | no_license | USE CarsShop;
SELECT * FROM cars;
-- Ïðîèçâîäèì âûáîðêó äàííûõ èç ñòîëáöà FstName, òàáëèöû MyFriends
SELECT mark FROM cars;
-- Ïðîèçâîäèì âûáîðêó äàííûõ èç ñòîëáöà LstName, òàáëèöû MyFriends
SELECT model FROM cars;
SELECT speed FROM cars;
-- Ïðîèçâîäèì âûáîðêó äàííûõ èç ñòîëáöîâ FstName è LstName, òàáëèöû MyF... | true |
617c67b24faa907859c44df121507e3fb24d2078 | SQL | hz2657/SQL-everyday | /HackerRank/Basic join.sql | UTF-8 | 636 | 3.640625 | 4 | [] | no_license | ---Asian Population
----- use WHERE CITY.CountryCode = COUNTRY.Code
SELECT SUM(CITY.POPULATION)
FROM CITY, COUNTRY
WHERE CITY.CountryCode = COUNTRY.Code AND COUNTRY.CONTINENT = 'Asia';
---African Cities
----- WHERE CITY.CountryCode = COUNTRY.Code
SELECT DISTINCT CITY.NAME
FROM CITY, COUNTRY
WHERE CITY.CountryCode =... | true |
7387bafc87c2b5cdd8b7efd8172a2226cad13686 | SQL | dfranco416/mySecondSQL | /myFirstSQLFile.sql | UTF-8 | 1,467 | 4.3125 | 4 | [] | no_license | -- Delete the entire table
-- DROP TABLE students;
CREATE TABLE students(
id INTEGER PRIMARY KEY,
firstName VARCHAR(100),
lastName VARCHAR(100),
age INTEGER
);
-- ALTER TABLE students ADD email VARCHAR(100);
CREATE TABLE courses(
id INTEGER PRIMARY KEY,
title VARCHAR(100)
);
-- Through/ join table
-- FO... | true |
b3e67e6728c300937eef52ea0f5e501e9b806b8f | SQL | geosconsulting/sql_bonanza | /viste_su_hotspots.sql | UTF-8 | 694 | 3.796875 | 4 | [] | no_license | SELECT a0.id,a0.name_en,a1.id,a1.country_id,a1.name_en
FROM public.admin_level_0 a0, public.admin_level_1 a1
WHERE a1.country_id = a0.id
ORDER BY a0.name_en;
--Select points.*, polygons.* from points
--inner join polygons on
--st_intersects(points.geom,polygons.geom);
DROP VIEW hs_province_albania;
CREATE VIEW rda... | true |
0dd89f38a64fff1b823a8ac30f2a9320323fa517 | SQL | mechanoid/food-control | /migrations/defecations.sql | UTF-8 | 581 | 2.5625 | 3 | [
"MIT"
] | permissive | -- -------------------------------------------------------------
-- TablePlus 3.8.0(336)
--
-- https://tableplus.com/
--
-- Database: d1lcc3mpc2581n
-- Generation Time: 2020-09-09 21:52:48.3470
-- -------------------------------------------------------------
-- This script only contains the table creation statements ... | true |
9b36a0a64454885a0cb2cc23dcc28b25fb56c5d2 | SQL | daehyeonhong/Oracle | /och01/src/sql/ch15_exam.sql | UTF-8 | 1,478 | 3.796875 | 4 | [
"MIT"
] | permissive | --ex01.커미션이 null이 아닌 상태의 사원번호,이름,급여 ..이름 기준으로 오름차순 정렬결과
--저장하는 프로시져
drop table emp_sal;
select*from emp_sal;
create table emp_sal as select eno,ename,salary from employee where 1<>1;
--프로시져 생성
create or replace procedure sp_commission
is
cursor c1 is select*from employee where commission is not null;
begin
dbms_outp... | true |
2fdc23beac911265d3b1bc9a53de4fdae80bc163 | SQL | aholowko/cassandra-trainings-scripts | /FEIT-BigData/07-CQL/Ex06-deletes.cql | UTF-8 | 1,156 | 3.203125 | 3 | [] | no_license | USE songbrowser;
/** Delete a song */
DELETE FROM songs_by_albums
WHERE id = 08634794-c526-4c6a-8f0e-832319651315 AND release_year = 2005 AND album_title = 'Mezmerize' AND track_no = 1;
DELETE FROM songs_by_artists
WHERE id = c6ca5434-86ac-4c4a-aa66-4feac34777d5 AND release_year = 2005 AND album_title = 'Mezmerize'... | true |
64fe57a28fff4f0de1724eec46d272ae9d22e9fa | SQL | amrit-sahoo/Oracle11g-Project | /Library_Information_System/201310030/REPORT3.SQL | UTF-8 | 729 | 3.078125 | 3 | [] | no_license | SET LINESIZE 120
SET PAGESIZE 60
SET TERMOUT OFF
COLUMN SYSDATE NEW_VALUE C_DATE
SELECT SYSDATE FROM DUAL;
SET TERMOUT ON
REPHEADER CENTER 'FINE DETAILS' SKIP 1 CENTER 'National Institute of Science and Technology' SKIP 1 CENTER 'Palur Hills, Berhampur- 761008' LEFT && C_DATE
REPFOOTER RIGHT 'PAGE NO:- 'SQL.PNO
BREAK ... | true |
8fb75097232d6dd5b9e049938cfe004d488e6066 | SQL | triptorahman/Online_photo_selling_site_NodeJS | /photodata.sql | UTF-8 | 3,996 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 12, 2019 at 05:33 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 5.6.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
7ff2d87a8f59a8145c60edc68b55c215bc900dc9 | SQL | hmotta/sql | /ingresossolicitud.sql | UTF-8 | 258 | 2.734375 | 3 | [] | no_license | CREATE TABLE ingresossolicitud
(
ingresosolid serial not null,
solicitudprestamoid integer REFERENCES solicitudprestamo(solicitudprestamoid),
ingresoid integer,
tipoingreso integer,
primary key (ingresosolid)
--unique (ingresoid,tipoingreso)
);
| true |
e0fec81eadaa6dd25ef7ab8aa2d0dc80e8a5ee56 | SQL | SmarterApp/AP_ItemAuthoring | /sbac-iaip/java/scripts/incremental/01_v1.0/25_US1189.sql | UTF-8 | 2,002 | 3.5 | 4 | [
"Apache-2.0"
] | permissive | ALTER TABLE `user` ADD COLUMN `u_title` VARCHAR(4) NOT NULL DEFAULT '' AFTER `u_review_type` , ADD COLUMN `u_first_name` VARCHAR(35) NOT NULL DEFAULT '' AFTER `u_title` , ADD COLUMN `u_middle_name` VARCHAR(35) NOT NULL DEFAULT '' AFTER `u_first_name` , ADD COLUMN `u_last_name` VARCHAR(35) NOT NULL DEFAULT '' AFTER ... | true |
0a93d95180506621467eb34768cc8cec096fbadf | SQL | Boturkhonov/Sportsman-Registration | /src/database/script.sql | UTF-8 | 876 | 3.71875 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS `SportTitle`
(
`Id` int AUTO_INCREMENT NOT NULL,
`Name` varchar(255) NOT NULL,
PRIMARY KEY (`Id`)
);
CREATE TABLE IF NOT EXISTS `Sport`
(
`Id` int AUTO_INCREMENT NOT NULL,
`Name` varchar(255) NOT NULL,
PRIMARY KEY (`Id`)
);
CREATE TABLE IF NOT EXISTS ... | true |
483d2f53cb71cd518cb15bccbcd6464cd9805cd0 | SQL | MasterH12/INFO261 | /ejercicios notebook 2/Ejercicio 5.3 inner join.sql | UTF-8 | 216 | 2.84375 | 3 | [] | no_license | /*Ejercicio 5.1*/
use sakila;
show tables;
describe film;
SELECT first_name ,last_name, city from customer as t1 inner join address as t2 on t1.address_id=t2.address_id inner join city as t3 on t2.city_id=t3.city_id; | true |
233715359b9ae30b999b4617b24399f59169ce31 | SQL | RegemLux/VialManager | /SQL/Script_POSTGRESQL/VialManager2_8.sql | UTF-8 | 14,277 | 2.921875 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 9.2.9
-- Dumped by pg_dump version 9.2.9
-- Started on 2020-07-18 12:48:00
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- TOC e... | true |
c42c2267e59082939065b70a44cb8092ec57a96b | SQL | simolex/testdb | /reference/kind.sql | UTF-8 | 472 | 3.296875 | 3 | [] | no_license | -- Create table
create table OTHERGKN.VER_KINDS
(
id NUMBER not null,
name VARCHAR2(200) not null
)
tablespace OTHERGKN_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter ta... | true |
e890e9158b85bdc9e846629bc7141579e6e6fe09 | SQL | allenxws/snacks | /snacks/src/main/resources/database/snacks/product_comment.sql | UTF-8 | 706 | 3.40625 | 3 | [] | no_license | CREATE TABLE `product_comment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`user_id` bigint(20) NOT NULL COMMENT '关联user.id',
`product_id` bigint(20) NOT NULL COMMENT '关联product.id',
`content` varchar(1000) DEFAULT NULL COMMENT '评论内容',
`score` decimal(10,2) DEFAULT NULL COMMENT '评分',
`is_delet... | true |
19edf1a77ecafb138330ff99e2646c8a48f1d072 | SQL | muziyongshixin/WaterMarking | /watermarking.sql | UTF-8 | 5,313 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2017-09-16 11:27:47
-- 服务器版本: 5.5.54-0ubuntu0.14.04.1
-- PHP 版本: 5.5.9-1ubuntu4.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
8d988b101ebda20c807035a7f48b662be4884ff4 | SQL | bblldave/ISTA-420 | /tests/Iteration-02-Test.sql | UTF-8 | 660 | 3.171875 | 3 | [] | no_license | --Name:David Harris
--File: test1.sql
--Date: 6/16/2017
-- Guests can view teams and info
select * from Teams;
--Guests can view team rosters for atlanta
select p.firstname, p.lastname, p.position
from dbo.players as p
where team = 'ATL'
--Guests can view Player stats
select p.firstname, p.lastname, s.*
from dbo.sta... | true |
3b977097170061d435670edbd1858f14b632b303 | SQL | VinayB490/Mark_In_Idea-Discussion_Forum | /ipproject.sql | UTF-8 | 3,854 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 07, 2020 at 03:24 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
f20476d7c8dca9cbd0249e8e3636b99c9368b5dd | SQL | Rodrigo54099/SITE_Weekly_Assignment_3 | /life-tracker-api/life-tracker-schema.sql | UTF-8 | 1,276 | 3.484375 | 3 | [] | no_license | CREATE TABLE users (
id SERIAL PRIMARY KEY,
password TEXT NOT NULL,
email TEXT NOT NULL UNIQUE CHECK (POSITION('@' IN email) > 1),
is_admin BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMP NOT NULL DEFAULT NOW()
);
CREATE TABLE sleep... | true |
eb87d14b1c894765ab5cae72e53ba40a13784200 | SQL | Yrp/explorer | /model/src/main/resources/trxplorer/db/migration/common/trigger/R__contract_freeze_balance.sql | UTF-8 | 581 | 3.453125 | 3 | [] | no_license | DELIMITER $$
DROP TRIGGER IF EXISTS contract_freeze_balance_AFTER_INSERT$$
CREATE DEFINER = CURRENT_USER TRIGGER `contract_freeze_balance_AFTER_INSERT` AFTER INSERT ON `contract_freeze_balance` FOR EACH ROW
BEGIN
insert ignore into sync_account(address,date_created,origin,tx_timestamp) values(new.owner_address,now(),... | true |
b012f3645e71abee1012177c6ab7ce95d39741ce | SQL | libaceta/selfieHouseSOA | /Webserver/db_selfiehouse.sql | UTF-8 | 5,720 | 3.078125 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 5.6.32-log - MySQL Community Server (GPL)
-- SO del servidor: Win32
-- HeidiSQL Versión: 9.4.0.5125
-- --------------------------------------------------------... | true |
5021418f0808dca882bab4cea9ae20c607529f16 | SQL | mahimaholla/Gym-management-system | /gym.sql | UTF-8 | 8,072 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 06, 2019 at 02:04 PM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.1.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
828a74c3689ba8b00af1633becb3a0fcf4520711 | SQL | intellivoid/Intellivoid-API | /database/intellivoid_api_table_request_records.sql | UTF-8 | 2,054 | 3.421875 | 3 | [
"Unlicense"
] | permissive |
-- --------------------------------------------------------
--
-- Table structure for table `request_records`
--
CREATE TABLE `request_records` (
`id` int(255) NOT NULL COMMENT 'The unique internal database ID for this record',
`reference_id` varchar(255) DEFAULT NULL COMMENT 'The public reference ID for this re... | true |
d50bb9492eea33ae96ab1b042a13253d16635b3d | SQL | rahmatmaftuh/learnSQL | /10maxmin.sql | UTF-8 | 245 | 3.234375 | 3 | [] | no_license | MAX & MIN = To find rows that have min or max value
MAX(column_name)
MIN(column_name)
example
SELECT MAX(price)
FROM purchases;
SELECT MIN(price)
FROM purchases;
SELECT MAX(price)
FROM purchases;
WHERE character_name = "Ken the Ninja" | true |
5e4ec5d33204015af1dbe98c76fd9cf3616e43b3 | SQL | YiffyC/GKSQL | /AutesExemples.sql | ISO-8859-1 | 246 | 3.296875 | 3 | [] | no_license | --Ingenieurs non affects
SELECT I.NOM, I.PRENOM, A.CODPRO
FROM INGENIEUR I LEFT OUTER JOIN AFFECT A
ON I.MLE = A.MLE
WHERE CODPRO IS NULL;
--Test du all
SELECT *
FROM INGENIEUR
WHERE VILLE = ALL (SELECT VILLE FROM PROJET);
-- | true |
6ab998c2f87d36a63e46a4f180a51fa25184c88b | SQL | JosephSchlach/prime-solo-sql | /database.sql | UTF-8 | 1,756 | 3.984375 | 4 | [] | no_license | -- How do you get all users from Chicago?
SELECT * FROM "accounts" WHERE "city" = 'chicago';
-- How do you get all users with usernames that contain the letter a?
SELECT * FROM "accounts" WHERE "username" LIKE '%a%';
-- The bank is giving a new customer bonus! How do you update all records
SELECT * FROM "ac... | true |
8700b05686c5facfc9bf33f3d64239f25d38d8f1 | SQL | adri95cadiz/DDSI_UGR | /Proyecto de Prácticas/Implementación/Procedimientos/RegistrarCritica.sql | UTF-8 | 1,653 | 3.65625 | 4 | [] | no_license | CREATE OR REPLACE
PROCEDURE RegistrarCritica(
puntuacion CRITICA.PUNTUACION%TYPE,
votacion CRITICA.VOTACION%TYPE,
analisis CRITICA.ANALISIS%TYPE,
idprod CRITICA.IDPRODUCTOCRIT%TYPE,
iduser CRITICA.IDUSUARIOCRIT%TYPE
)
IS
PROD_NO_EXISTS EXCEPTION;
USER_NO_EXISTS EXCEPTION;
CRIT... | true |
4b88cf5d9a76a6f3fc69cbe727d974b9ae703a67 | SQL | Nithanaroy/almanac.httparchive.org | /sql/2019/cdn/17_10.sql | UTF-8 | 352 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | #standardSQL
# 17_10: Percentage of responses with vary header
SELECT
_TABLE_SUFFIX AS client,
_cdn_provider AS cdn,
COUNTIF(resp_vary != '') AS freq,
COUNT(0) AS total,
ROUND(COUNTIF(resp_vary != '') * 100 / COUNT(0), 2) AS pct
FROM
`httparchive.summary_requests.2019_07_01_*`
GROUP BY
client,
... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.