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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
683d07e5cfae96c8af764248bbead84dc206eb9c | SQL | brentgroves/bpgsql | /howto/mssql/count_distinct.sql | UTF-8 | 453 | 3.46875 | 3 | [] | no_license | --https://www.w3resource.com/sql/aggregate-functions/count-with-distinct.php
/*
*
*/
SELECT COUNT ( DISTINCT cust_code ) AS "Number of employees"
FROM orders;
select ap.pcn,ap.Plexus_Customer_Code,ap.report_date,ap.Part_No,ap.revision,
count(distinct Unit_Price) price_count,
count(*) po_count,
min(Unit_Price) ... | true |
dffd7893c9e13e7d6e6114ca08b93aaa378f99a2 | SQL | Kalyse/zf2-sandbox | /docs/fullschema.sql | UTF-8 | 721 | 3.171875 | 3 | [] | no_license | -- These schemas are actually provided in the respective modules.
-- This schema file is just for convenience.
CREATE TABLE user (
user_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(255) NOT NULL,
display_name VARCHAR(255) NOT NULL,
password CHAR(128) NOT NULL,
salt BINARY(16) NOT NU... | true |
b250e146ebf95d1cdc107cd160429d0e3ca2d044 | SQL | bananenklops/festbon | /sqlFiles/festbon_m_bestellung_menue.sql | UTF-8 | 933 | 3.046875 | 3 | [] | no_license | CREATE TABLE festbon.m_bestellung_menue
(
id_bestellung int(11) NOT NULL,
id_menue int(11) NOT NULL,
menge int(11),
CONSTRAINT m_bestellung_menue_t_bestellung_id_bestellung_fk FOREIGN KEY (id_bestellung) REFERENCES t_bestellung (id_bestellung),
CONSTRAINT m_bestellung_menue_t_menue_id_menue_fk FOREI... | true |
e34f4ebf29cff5f5ded2a3dd0d1ada7cefec0ef0 | SQL | koreahong/bigquery | /ch04/08.sql | UTF-8 | 298 | 2.6875 | 3 | [] | no_license | SELECT
INSTNM
, ADM_RATE_ALL
, FIRST_GEN
, MD_FAMINC
, MD_EARN_WNE_P10 , SAT_AVG
FROM
ch04.college_scorecard
WHERE
SAFE_CAST(SAT_AVG AS FLOAT64) > 1300
AND SAFE_CAST(ADM_RATE_ALL AS FLOAT64) < 0.2
AND SAFE_CAST(FIRST_GEN AS FLOAT64) > 0.1
ORDER BY
CAST(MD_FAMINC AS FLOAT64) ASC | true |
6581477aa936b4364b74c28ec5894c38dc290b08 | SQL | quql/beautiful_country | /country.sql | UTF-8 | 61,220 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : 14term
Source Server Version : 50711
Source Host : 127.0.0.1:3306
Source Database : country
Target Server Type : MYSQL
Target Server Version : 50711
File Encoding : 65001
Date: 2017-08-17 23:38:52
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... | true |
f2b8a5e34ef961ac7e0b6ec42bd31f07a1cfae32 | SQL | Everton-Oliver/banco_de_dados | /MySQL/lista_01/Exercicio1.sql | UTF-8 | 1,132 | 3.46875 | 3 | [] | no_license |
create table colaboradores
(id_pessoa integer PRIMARY KEY AUTO_INCREMENT,
nome varchar(30),
data_nascimento date,
sexo enum ("M", "F", "A"),
cargo varchar (30),
salario decimal (7,2)
)engine = innodb;
;
insert into colaboradores (nome,data_nascimento,sexo,cargo,salario)values (
"Cassia Rosário",
"1988-04-04",
"F", ... | true |
deaa238590e3a6a370c0015f476cf1b324d67615 | SQL | tatiana-martinez/248_Repo | /Labs/module_1/MySQL-Select/solutions.sql | UTF-8 | 1,299 | 4.3125 | 4 | [] | no_license | #challenge1
select a.au_id as 'AUTHOR ID', a.au_lname as 'LAST NAME', a.au_fname as 'FIRST NAME', t.title as 'TITLE', p.pub_name as 'PUBLISHER'
from authors a
inner join titleauthor ta on a.au_id = ta.au_id
inner join titles t on ta.title_id = t.title_id
inner join publishers p on p.pub_id = t.pub_id;
#challenge2
se... | true |
b2bf0d77c0495eafea76d7d7f1f4c615c71204b0 | SQL | justindelatorre/ls_180 | /sql_fundamentals/easy_1/3_insert_data.sql | UTF-8 | 497 | 2.859375 | 3 | [] | no_license | /*
* Add five records to this database so that our data looks like:
* id | name | age | species
* ----+----------+-----+---------
* 1 | Charlie | 3 | Finch
* 2 | Allie | 5 | Owl
* 3 | Jennifer | 3 | Magpie
* 4 | Jamie | 4 | Owl
* 5 | Roy | 8 | Crow
* (5 rows)
*/
INSERT INTO bi... | true |
4b59815c30f21f6866633b17c8dbb056c440e350 | SQL | aleksgor/t1 | /pm/sql/ss.sql | UTF-8 | 576 | 3.296875 | 3 | [] | no_license | //INSERT INTO test ( blob, secondChildId, childId, name, id, data ) VALUES (? ,? ,? ,? ,? ,? )
CREATE TABLE test (
id INT4 NOT NULL,
name TEXT,
childid INT4,
secondChildId INT4,
blobField BLOB,
data DATE
);
CREATE UNIQUE INDEX test_pkey ON test (id ASC);
ALTER TABL... | true |
29bca8417a95c7afe11f7f6744a2743c0770b2fb | SQL | Mchilders14/sql-instruction | /MYSQL/BmDb/Homework-Query.sql | UTF-8 | 326 | 3.265625 | 3 | [] | no_license | -- Select all movies and sort by title
SELECT * from movie ORDER BY TITLE;
-- Select all movies and sort by Year asc
SELECT * from movie ORDER BY year asc;
-- Select all actors sorted by birthdate desc
SELECT * from actor ORDER BY Birthdate desc;
-- Select scarlet Johansson's record by id
SELECT * from actor WHERE I... | true |
4bdbf25fef6620b0638c7ffa7d6e8ae6c9cbba3f | SQL | SERG-Delft/evosql | /instrumented-hsqldb/testrun/sqltool/vars.sql | UTF-8 | 1,288 | 3.4375 | 3 | [
"Apache-2.0"
] | permissive | /*
* $Id: vars.sql 5406 2014-10-13 20:53:18Z unsaved $
*/
* mt1 =
* mt2 =
-- Following line has trailing white space, but that should have no effect.
* mt3 =
* - un1
* - un2
* if (*unsetA != **NULL) \q Never used variable is not **NULL
* if (*un1 != **NULL) \q Explicitly unset variable is not **NULL
* if (*unset... | true |
8354adea299002d31ce05e31ee2f741157010076 | SQL | SCMcLaughlin/EQP | /bin/db/schema.sql | UTF-8 | 6,654 | 3.3125 | 3 | [] | no_license |
-- Enable WAL mode
PRAGMA journal_mode = WAL;
CREATE TABLE login (
username TEXT PRIMARY KEY,
password BLOB,
salt BLOB
);
CREATE TABLE parameter (
key TEXT PRIMARY KEY,
value
);
INSERT INTO
parameter (key, value)
VALUES
('eqBaseUnixSeconds', strftime('%s', 'now')),
... | true |
5789e73d342bbab1ce556109a3550121fddab704 | SQL | srgioar/UD25 | /src/main/resources/data.sql | UTF-8 | 1,156 | 3.421875 | 3 | [] | no_license | DROP TABLE IF EXISTS ARTICULOS;
DROP TABLE IF EXISTS FABRICANTES;
CREATE TABLE FABRICANTES (
Codigo INT AUTO_INCREMENT PRIMARY KEY,
Nombre VARCHAR(100));
CREATE TABLE ARTICULOS (
Codigo INT AUTO_INCREMENT PRIMARY KEY,
Nombre VARCHAR(100),
Precio INT(20),
CodigoFabricante INT,
KEY (CodigoFabricante),
FOREIGN KEY (Codi... | true |
5f75cb757ede4efe8a926ee77a402e8977898dc1 | SQL | gonzalezorocio/portobello | /portobello.sql | UTF-8 | 3,479 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 30-11-2018 a las 00:45:52
-- Versión del servidor: 10.1.30-MariaDB
-- Versión de PHP: 7.2.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
d8634651eca0457daf870340562ff0a4890866a5 | SQL | aHuiaa/BlockchainNotes | /cloudnote.sql | UTF-8 | 746 | 2.859375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50723
Source Host : localhost:3306
Source Database : cloudnote
Target Server Type : MYSQL
Target Server Version : 50723
File Encoding : 65001
Date: 2019-06-18 18:23:00
*/
SET FOREIGN_KEY_CHECKS=0... | true |
b159d079a6bb1a83db22c71ad29c147aaa93191c | SQL | diiina/database_course_2020 | /Chekanov_Kirill/hw7/dau.sql | UTF-8 | 742 | 3.984375 | 4 | [] | no_license | WITH RECURSIVE dates(date) AS (
SELECT CAST(MIN(begin_dttm) AS DATE) date
FROM sessions
UNION ALL
SELECT date + INTERVAL 1 DAY FROM dates
WHERE date + INTERVAL 1 DAY <=
(
SELECT CAST(MAX(begin_dttm) AS DATE)
FROM sessions
)
)
SELECT dates.date 'Date',
COUNT(DISTINCT sessions.user_id) DAU
FROM date... | true |
f41b3fb86744fad5d2734c8423da068822963dff | SQL | szgajewski/bms-projekt-grupowy | /BMS/DataModel/bazadanych.sql | UTF-8 | 1,156 | 3.390625 | 3 | [] | no_license | create table czujniki{--temperatura, okna, oswietlenie
id_cz serial primary key,
nazwa_cz varchar[30]
};
create table funkcje_p{
id_f serial primary key,
nazwa_f varchar[30]
};
create table pomiary{
id_p serial,
id_pom integer references czujniki,
czas timestamp,
wartosc real,
primary key(id_czuj,... | true |
b21d1d167a73774c2daf5d12b2731e44c0001c3d | SQL | lcapriles/GenDtl | /DB/PROC_GEN_GENERAL_2.sql | ISO-8859-1 | 2,377 | 2.71875 | 3 | [] | no_license | --------------------------------------------------------
-- Archivo creado - viernes-julio-24-2015
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Package PROC_GEN_GENERAL
--------------------------------------------------------
CREATE... | true |
4aa7f9f54de6ed21e9cefdd6b5b856d56c1870b7 | SQL | aderty/inside | /sql/proc.sql | UTF-8 | 42,350 | 3.125 | 3 | [] | no_license | -- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- Select AddConges(1, 'N', 'CP',STR_TO_DATE('12/12/2013', '%d/%m/%Y'), STR_TO_DATE('19/12/2013', '%d/%m/%Y'), '');
-- CALL AddConges(1,... | true |
414bbfa412548134de7aa5e7805e70206f976981 | SQL | fleetmack/mines | /me/clean_ups/parent_child_cwid/identify_those_who_need.sql | UTF-8 | 1,160 | 3.328125 | 3 | [] | no_license | TRUNCATE TABLE adv_work_ids;
/
/***
create table ADV_WORK_IDS(
Header varchar2(117),
id_number varchar2(10),
xsequence Number(10,0),
xtype varchar2(3),
other_id varchar2(20),
added ... | true |
a9aeb48c0a3ab7f90cf0809a3e5b76020607f269 | SQL | maplelafe/ssm-study | /doc/init.sql | UTF-8 | 776 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | #create database ssm_study;
--drop table blog_posts;
CREATE TABLE IF NOT EXISTS `blog_posts` (
`post_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`author_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`post_content` longtext NOT NULL,
`post_title... | true |
c9dd9f76f765de8268e34854a86cb98fced99f63 | SQL | danielalbertozv/WalmartInterview | /8. SQL Example/modify-databases.sql | UTF-8 | 960 | 4.03125 | 4 | [] | no_license | -- ***** MODIFY ******************************
DROP DATABASE walmart_example; -- Deletes database with name
DROP TABLE locations; -- Deletes table with name
DROP TABLE distances;
ALTER TABLE locations -- Modify a table
ADD name_location VARCHAR(255) AFTER id;
ALTER TABLE distances ... | true |
a5f4e9af692f1bd6624d67a6b20c46f819967a9f | SQL | robert-czwartosz/sklep-internetowy | /skrypty/vm/2ATABuzytkownikNDOL.sql | UTF-8 | 1,152 | 3.375 | 3 | [] | no_license | /*CREATE TABLESPACE TB_SPACE_HOST DATAFILE '\\VBoxSvr\orcl\TBSPACE_HOST.DBF' SIZE 55M
EXTENT MANAGEMENT LOCAL AUTOALLOCATE;
ALTER USER "SYS" QUOTA UNLIMITED ON TB_SPACE_HOST;
GRANT UNLIMITED TABLESPACE TO "SYS" WITH ADMIN OPTION;
GRANT dba TO "SYS";
select * from dba_sys_privs where grantee='SYS';
*/
create table robe... | true |
1a121416fa0d78c6d0adfbb854fecc1d0d8e2331 | SQL | dibley1973/StoredProcedureFramework | /Examples/Dibware.StoredProcedureFramework.Examples.Database/app/Stored Procedures/TenantGetAll.sql | UTF-8 | 431 | 2.671875 | 3 | [
"MIT"
] | permissive |
-- =============================================
-- Author: Duane Wingett
-- Create date: 2015/08/10
-- Description: Gets all the Tenants
-- =============================================
CREATE PROCEDURE [app].[TenantGetAll]
AS
BEGIN
-- Insert statements for procedure here
SELECT [TenantId]
, ... | true |
265288007e3cf6f549481e510649b161ea4d5374 | SQL | ChristabelleFT/ASKookie-backend | /posts.sql | UTF-8 | 4,814 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 24, 2020 at 03:58 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
e048aac66d7066e120636a761f9c02871e8dc0b3 | SQL | zheng1/openpitrix | /pkg/db/schema/app/V0_9__app_version_type.sql | UTF-8 | 122 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | ALTER TABLE app_version
ADD COLUMN type VARCHAR(50) NOT NULL;
CREATE INDEX app_version_type_idx
ON app_version (type); | true |
c1e38dc2176cd483a962171ff837b645e3b0e668 | SQL | animal104/SQL_Samples | /DBMS110/M05B_SaineMichael_InsertInto.sql | UTF-8 | 1,807 | 3.15625 | 3 | [] | no_license | /*
Mickey Saine
DBMS 110 - M05B Lab Assignment: Populating the Database
2/21/2021
M05B_SaineMichael_InsertInto.sql
This will cumulate in the realization of my dream to have a database populated that doesn't involve Jedi Survivors
*/
-- Adds Tables into the ProjDept table
INSERT INTO "ProjDept" VALUES ('1001'... | true |
24649bbc67106a7bc6565ed213bd1b1450017e15 | SQL | rektide/eve-db | /sql/views/rp/rpagent.coreinfo.sql | UTF-8 | 413 | 3 | 3 | [] | no_license | -- View: agent_coreprices
DROP VIEW if exists rpagent_coreinfo;
CREATE OR REPLACE VIEW rpagent_coreinfo AS
SELECT agent.agentid, core.skillname, market.sell_price, market.buy_price, core.itemid, core.skillid
FROM agtresearchagents agent
JOIN rp_skill_item_map core ON agent.typeid = core.skillid
JOIN... | true |
d7d23f303c9742e7fbad9f80bf052834521e3b20 | SQL | xinpengfei520/iMoneyJavaWeb | /ssm.sql | UTF-8 | 4,589 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50625
Source Host : localhost:3306
Source Database : ssm
Target Server Type : MYSQL
Target Server Version : 50625
File Encoding : 65001
Date: 2017-07-05 16:37:56
*/
SET FOREIGN_KEY... | true |
8cf047a25e2a6c9ef943a0b3d5e6a611468adae2 | SQL | luckyatomboy/Yj-Food | /web/sql/basic2.6.sql | UTF-8 | 3,381 | 3.375 | 3 | [] | no_license | ALTER TABLE `ss_menu_items` CHANGE published published VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '1';
ALTER TABLE `ss_products` CHANGE introduction introduction TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL;
ALTER TABLE `ss_articles` CHANGE intro intro TEXT CHARACTER SET utf8 COLLAT... | true |
e2db38f73ab338658e76f55e2ae657ab5bfbf9b4 | SQL | lbovolini/vaccine-api | /database/create-database.sql | UTF-8 | 738 | 3.6875 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS `vaccine`;
CREATE TABLE IF NOT EXISTS `vaccine`.`user` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL,
`email` VARCHAR(100) NOT NULL,
`cpf` VARCHAR(11) NOT NULL,
`birthday` DATE NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `cpf_UNIQUE` (`cpf` ASC) VISIBLE,
... | true |
29d24c294feaf86c7312fb41a5aa7f8fb601e354 | SQL | zerojuls/b2b | /SQL/SUBCONCEPTO_GET.sql | UTF-8 | 685 | 3.84375 | 4 | [] | no_license | DELIMITER $$
DROP PROCEDURE IF EXISTS SUBCONCEPTO_GET$$
CREATE PROCEDURE `SUBCONCEPTO_GET`(
IN P_SConceptoId CHAR(10),
IN P_opcion INT
)
BEGIN
CASE P_opcion
WHEN '1' THEN
SELECT
C.id_sconcepto,
C.c_scodigo,
C.c_sconcepto,
C.id_concepto,
C.c_estado AS Estado,
P.c_concepto
... | true |
fd122c9887cd17e6743b1338879651ea26a8c0ad | SQL | J22Pregbaha/was-a-mistake | /myauthdb.sql | UTF-8 | 2,302 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 05, 2021 at 02:32 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 |
c301d9db95b20c29adfb217a781bb1c287f7f5f7 | SQL | darkflag/celerio | /celerio-maven/bootstrap-maven-plugin/src/main/resources/sqlconf/inheritance/01-create.sql | UTF-8 | 1,336 | 3.5 | 4 | [
"Apache-2.0"
] | permissive | DROP ALL OBJECTS;
CREATE SEQUENCE hibernate_sequence START WITH 1000;
CREATE TABLE USER (
id int not null IDENTITY,
username varchar(100) not null,
password varchar(100) not null,
is_enabled bool not null default true,
version ... | true |
8db233912ca262fdf903927b059625e5eb007db6 | SQL | BZEEE/CMPUT_291 | /assignment2/2.sql | UTF-8 | 301 | 3.21875 | 3 | [] | no_license | .print Question 2 - bjzukows
Select b2.fname, b2.lname
From births As b1, births As b2
Where b2.fname != 'Michael' And b2.lname != 'Fox' And
b1.fname = 'Michael' And b1.lname = 'Fox' And
(b1.f_fname = b2.f_fname And b1.f_lname = b2.f_lname) And (b1.m_fname = b2.m_fname And b1.m_lname = b2.m_lname)
| true |
4619aa2be17788462e49e687e0a06b698c20f822 | SQL | mrmeihem/GB-MySQL | /MY COURSE WORK/selects.sql | UTF-8 | 1,024 | 4.59375 | 5 | [] | no_license | -- 1
SELECT s.id AS 'id', s.storyname AS 'name of the story', u.username AS 'autor', c.name AS 'category' FROM stories s
JOIN (users u, categories c)
ON (s.users_id = u.id AND s.categories_id = c.id);
-- 2
SELECT name FROM tags
WHERE id IN (
SELECT tags_id FROM storytags
WHERE stories_id = (
SELECT id FROM users... | true |
4e4731d06026fce330368e6f25ff7d1027be232a | SQL | radtek/abs3 | /sql/mmfo/bars/Procedure/p_edit_oznaka.sql | WINDOWS-1251 | 1,482 | 2.8125 | 3 | [] | no_license | PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Procedure/P_EDIT_OZNAKA.sql =========*** Run
PROMPT =====================================================================================
PROMPT *** Create procedure P_E... | true |
28f8f320a956d57aef3fa995ed2e9e0e6013074b | SQL | 34499980/TestDB | /TestDB/Scripts/UP/37-INSERT-IMPRESORAS-ADEMANDA-CAJA.sql | WINDOWS-1250 | 1,344 | 3.5625 | 4 | [] | no_license | --Para agregar nuevas impresoras INSERT INTO ImpresorasADemandaCaja (IdImpresora,IdCaja) VALUES (x,y) ver documentacin, por defecto se configuran las impresoras para la sucursal 414
--Se agrega la impresora 1 para la caja 1 y la caja 2
INSERT INTO ImpresorasADemandaCaja
(IdImpresora,IdCaja)
Select 1,IdCaja
from Cajas ... | true |
c04ab4a6ed1c83263d0a6bedd02588857e68290f | SQL | vimc/montagu-db | /migrations/sql/V2020.02.27.1616__RemoveReportRoles.sql | UTF-8 | 757 | 3.203125 | 3 | [
"MIT"
] | permissive | /* the previous migration has a mis-spelling of the role names so nothing got deleted */
DO $$
declare reader_id int;
declare scoped_reader_id int;
declare reviewer_id int;
begin
SELECT id INTO reader_id from role where name = 'reports-reader' and scope_prefix is null;
SELECT id INTO scoped_reader_i... | true |
81ce46fd1625f26cde370a115e597e9a9d2718de | SQL | alstjd0051/SQL | /oracle_workspace/실습문제/20210128.sql | UTF-8 | 1,952 | 4.46875 | 4 | [] | no_license | -- @실습문제 : join
--@chun계정으로 실행
--1. 학번, 학생명, 학과명 조회
-- 학과 지정이 안된 학생은 존재하지 않는다.
select S.student_no 학번,
S.student_name 학생명,
D.department_name 학과명
from tb_student S
inner join tb_department D
on s.department_no = d.department_no;
--2. 수업번호, 수업명, 교수번호, 교수명 조회... | true |
618d3a23dd90e6623e052d2520b6e5cc4ffb3e07 | SQL | bellmit/origin | /family_order/sql/TI_R_ORDERDATA_DOWN/SEL_BY_RECORDDATE.sql | UTF-8 | 513 | 2.828125 | 3 | [] | no_license | SELECT A.RECORDID ARRIVAL_ID, A.RECORDID ORDER_ID,
A.PURCHASEPROJECTNO PURCHASE_NO, A.ORDERNO ORDER_NO, A.ORDERTYPE ORDER_TYPE, A.VENDORCODE VENDOR_CODE,
A.PROVINCEID PROVINCE_ID, A.ORDERDATE ORDER_DATE, A.MATERIALCODE MATERIAL_CODE, A.QUANITY QUANTITY,
A.COLOR COLOR_DESC, A.PRICE PURCHASE_PRICE, '0' ORDER_SR... | true |
88257b6219498a7b07b9dff44f70d444b1a7a45a | SQL | TristinDavis/SpringBoot_Project | /springboot-mybatis/src/main/resources/mybatis/sql/userInfo.sql | UTF-8 | 444 | 2.921875 | 3 | [] | no_license | create table if not exists user_info(
id INTEGER NOT NULL AUTO_INCREMENT,
user_name varchar(50) not null,
pass_word varchar(30),
user_sex varchar(2),
nick_name varchar(50),
birthday date ,
jobs varchar(50),
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
insert into user_info (id,user_name,pa... | true |
c46385959e6ae306613a0c3fb7478ca199e56441 | SQL | CREpitech/Reporeporepo | /mySQL/ex_17/ex_17.sql | UTF-8 | 126 | 2.6875 | 3 | [] | no_license | select title, length( title )
from coding.movies
where length( title ) = ( select max( length( title ) ) from coding.movies ); | true |
e5956710518a7341ebbd1ee948181feb03f27f6a | SQL | sebamartinez10/Tecnisoft_prueba2 | /Tecnisoft_prueba2/src/model/Scrip.sql | UTF-8 | 2,139 | 3.390625 | 3 | [] | no_license | CREATE DATABASE Prueba_2;
use Prueba_2;
/*
drop database Prueba_2;
*/
CREATE TABLE tipoUsuario(
id INT AUTO_INCREMENT PRIMARY KEY,
tipo VARCHAR(30)
); -- SELECT * FROM tipoUsuario;
INSERT INTO tipoUsuario VALUES(NULL,'admin');
INSERT INTO tipoUsuario VALUES(NULL,'vendedor');
--INSERT INTO tipoUsuario VALUE... | true |
a33d659dab183df77edfdbc141c4cef743aa7125 | SQL | felicityzhao99/Movie-Platform | /stored-procedure.sql | UTF-8 | 2,063 | 4.3125 | 4 | [] | no_license | drop function add_movie;
DELIMITER $$
CREATE function add_movie ( title1 VARCHAR(100),
year1 INT,
director1 VARCHAR(100),
genre1 VARCHAR(32),
star1 VARCHAR(100))
RETURNS VARCHAR(100)
deterministic
BEGIN
DECLARE genreId1 INT;
DECLARE starId1 ... | true |
124edbcc0e399b77dad9f3e4ae46cb6d213213db | SQL | BenjaEspinoza99/Proyecto-A-S-grupo-2 | /bibliotecaa end.sql | UTF-8 | 13,037 | 3.140625 | 3 | [] | no_license | create database biblioteca;
use biblioteca;
create table if not exists Usuarios(
id_usuario varchar(45) not null,
nombre varchar(45) not null,
edad int not null,
id_tipousuario int unsigned not null,
primary key(id_usuario));
create table if not exists Multas(
id_multa int unsigned not null,
estado_mul... | true |
7ccdc9a99795f511b719738f969efd74fbb66c18 | SQL | AscenKeeprov/Database-Basics | /Exercise1-DataDefinitionAndDataTypes/CarRental/PopulateTables.sql | UTF-8 | 1,435 | 2.84375 | 3 | [
"MIT"
] | permissive | INSERT INTO Categories (CategoryName, DailyRate, WeeklyRate, MonthlyRate, WeekendRate) VALUES
('Exotic', 4, 14.5, 51.33, 7.9),
('Off-Road', 3.1, 13, 49.6, 5.8),
('SUV', 2.45, 11.85, 47, 4.7)
INSERT INTO Cars (PlateNumber, Manufacturer, Model, CarYear, CategoryId, Doors, Condition, Available) VALUES
('TK61368J', 'Subar... | true |
f9b8149c26ea1532154a82076177c5d5f7df95b3 | SQL | France-ioi/AlgoreaBackend | /db/migrations/1910030549_drop_column_groups_items_additional_time.sql | UTF-8 | 685 | 3.484375 | 3 | [
"MIT"
] | permissive | -- +migrate Up
ALTER TABLE `groups_items` DROP COLUMN `additional_time`;
-- +migrate Down
ALTER TABLE `groups_items`
ADD COLUMN `additional_time` time DEFAULT NULL
COMMENT 'Time that was attributed (can be negative) to this group for this item (typically, for time-limited items)'
AFTER `cached_man... | true |
a198bfc6490ebbc9c463f04db29b69cde728b5c9 | SQL | nevermindlp/lpandfriends | /catofdestruction/jiawa/seckill/src/main/sql/schema.sql | UTF-8 | 2,693 | 4.0625 | 4 | [] | no_license | -- 数据库初始化脚本
-- 创建数据库
CREATE DATABASE seckill;
-- 使用数据库
USE seckill;
-- 创建秒杀库存表;
CREATE TABLE seckill(
seckill_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '商品库存id',
name VARCHAR(120) NOT NULL COMMENT '商品名称',
number INT NOT NULL COMMENT '库存数量',
start_time TIMESTAMP NOT NULL COMMENT '秒杀开启时间',
end_time TIMESTAMP NOT NULL CO... | true |
7f0e324ed9e9904286f87c61ee37ebfdaa275297 | SQL | caiyunfan123/sales-prj | /src/main/azkabanjob/b-2-2-put_customer_address.sql | UTF-8 | 796 | 3.546875 | 4 | [] | no_license | INSERT INTO dim_customer
SELECT
t.customer_number,
t.customer_number,
t.customer_name,
t.customer_street_address,
t.customer_zip_code,
t.customer_city,
t.customer_state,
t.version,
t.effective_date,
t.expiry_date
FROM(SELECT
t2.customer_number customer_number,
t2.customer_name customer_name,
t2.customer_street_address ... | true |
3da16824c559dcd7c2f3c25a167476a796a259b7 | SQL | gayanlanke/microgrid | /dev/mysql/sql/load_microgrid.sql | UTF-8 | 2,211 | 3.296875 | 3 | [] | no_license | /******************************************************************************
* load_microgrid.sql
* SQL script for loading tables in sagrid database from data files
* (microgrid project):
* mg_feed.dat
*****************************************************************************/
\! echo "USE sagrid"
USE sagr... | true |
0579b35e37b49c9a5ae25bce9860ed04f97537d1 | SQL | lluchs/ocstats | /knüppeln-champs.sql | UTF-8 | 178 | 3 | 3 | [] | no_license | -- output: name of champ | selection count
select
json_each.key champ, sum(json_each.value)
from
games g, json_each(g.statistics, '$.Statistics_ChampSelection')
group by champ
| true |
2fb72ab5f55ddb7605f7700b0cecdcbe88764d78 | SQL | Simp1ezZz/highWayTollStation | /out/artifacts/_war_exploded/WEB-INF/highwaytollmanager.sql | UTF-8 | 14,715 | 3.0625 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : Database
Source Server Type : MySQL
Source Server Version : 80017
Source Host : localhost:3306
Source Schema : highwaytollmanager
Target Server Type : MySQL
Target Server Version : 80017
File Encoding : 65001
Date: 28/... | true |
58749982162ef8c5c0d86eaf38eaf271c69b055f | SQL | thinkcares/thinkcares | /BigQuery/Querys/ExtraeDatos_zimpfact.sql | UTF-8 | 1,444 | 3.265625 | 3 | [] | no_license | --15063
select
zf.*
-- , d.id_divisa
, d.desc_divisa
-- , fp.id_forma_pago
, fp.desc_forma_pago
--, r.id_rubro
, r.desc_rubro
--, cj.id_caja
, cj.desc_caja
, case
when zf.estatus= 'I' then 'IMPORTADO'
when zf.estatus= 'R' then 'RECHAZADO'
else 'N/A'
end as Estatus_zf
--... | true |
a2fd77843094a3a280691f04b00f708222fcfbce | SQL | more03625/NewMathsGame | /RAHUL/SqlFiles/quiz2.sql | UTF-8 | 6,238 | 3.015625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Oct 19, 2019 at 07:35 PM
-- Server version: 5.7.27-0ubuntu0.18.04.1
-- PHP Version: 7.2.19-0ubuntu0.18.04.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
987c528827f40ae002d0f1f7e00534a38bb722c4 | SQL | thonhotels/fishtoggles | /scripts/create_table.sql | UTF-8 | 293 | 3.078125 | 3 | [
"MIT"
] | permissive | IF (NOT EXISTS (SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Toggles'))
BEGIN
CREATE TABLE [Toggles] (
[Id] nvarchar(450) NOT NULL,
[Value] nvarchar(max) NULL,
CONSTRAINT [PK_Toggles] PRIMARY KEY ([Id])
);
END; | true |
9bb1e17193212ae3390db30c88c396629bc02874 | SQL | hrynt/sql | /duplicate valid_to & transaction_amount.sql | UTF-8 | 454 | 3.546875 | 4 | [] | no_license | WITH data AS (
SELECT
orderline_id,
valid_to_date_key,
transaction_amount,
paymentgateway_cost,
ROUND(SUM(publisher_revenue_share), 4) AS publisher_revenue_share
FROM
f_buffet_estimated_revenue
GROUP BY
orderline_id,
valid_to_date_key,
transaction_amount,
paymentgateway_cost
ORDER BY
orderline_id
)
S... | true |
862c225cfec357f371597a173602b08419ad0135 | SQL | happyjianguo/cap-root | /cap-manager/db/sys_role_oracle.sql | UTF-8 | 662 | 3.5625 | 4 | [] | no_license | drop table SYS_ROLE;
-- Create table
create table SYS_ROLE
(
ID NUMBER(11),
ROLE VARCHAR2(30 CHAR),
DESCRIPTION VARCHAR2(120 CHAR),
AVAILABLE NUMBER(4)
);
-- Add comments to the table
comment on table SYS_ROLE
is '系统角色信息登记簿';
-- Add comments to the columns
comment on column SYS_ROLE.ID
i... | true |
547fe7681f2f28121639f5ad92288e50f337e408 | SQL | annegolladay/sql-basics-lab | /employee.sql | UTF-8 | 820 | 4.1875 | 4 | [] | no_license | -- Table - employee
-- Create a file called employee.sql and write out the code for the following problems:
-- 1. List all employee first and last names only that live in Calgary.
select first_name, last_name from employee
where city = 'Calgary';
-- 2. Find the birthdate for the youngest employee.
select MAX(birth... | true |
8212d500034334b57038da2432a3bec24ea29173 | SQL | cjl1001/food0315 | /db_food.sql | UTF-8 | 6,761 | 3.359375 | 3 | [] | no_license | drop table TbAddress CASCADE;
drop table TbCategory CASCADE;
drop table TbMenuSummary CASCADE;
drop table TbMerchant CASCADE;
drop table TbOrder CASCADE;
drop table TbOrderDetail CASCADE;
drop table TbSale CASCADE;
drop table TbUsers CASCADE;
/*==============================================================*/
/... | true |
6aac4c0539b0b8403c9c6e4decdb8be4034f2855 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day24/select1120.sql | UTF-8 | 178 | 2.640625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-23T11:20:00Z' AND timestamp<'2017-11-24T11:20:00Z' AND temperature>=34 AND temperature<=46
| true |
3d43395a0378b9d93b8df98af0e61eefbf883853 | SQL | nemanjalukic/BazaProjektni | /build/classes/sql/trigeri.sql | UTF-8 | 3,782 | 3.53125 | 4 | [] | no_license | DELIMITER $$
CREATE TRIGGER azuriraj_nakon_nabavke AFTER INSERT ON stavka_nabavke FOR EACH ROW
BEGIN
-- povećaj ukupan iznos nabavke novom stavkom
UPDATE faktura_nabavka n
SET n.UkupanIznos = n.UkupanIznos + new.NabavnaCijena * new.Kolicina
WHERE n.BrojFakture = new.BrojFakture;
-- dodaj proizvod... | true |
41174f47d0f221ee514a43ff0d3499307bf530b5 | SQL | chermehdi/money-transfer-api | /src/main/resources/schema.sql | UTF-8 | 3,126 | 3.9375 | 4 | [] | no_license | DROP TABLE IF EXISTS user
;
DROP TABLE IF EXISTS transaction
;
DROP TABLE IF EXISTS account
;
DROP TABLE IF EXISTS transfer
;
CREATE TABLE account
(
id INT NOT NULL AUTO_INCREMENT,
identifier varchar(255) NOT NULL,
currency VARCHAR(10) NOT NULL,
amount decimal(19, 4),
CONST... | true |
e574662e434227d906e382cfde84539cc375cfe6 | SQL | devjothish/SmartCity-A-Job-Portal | /portal/portal.sql | UTF-8 | 7,437 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 22, 2020 at 03:40 AM
-- Server version: 10.1.40-MariaDB
-- PHP Version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
5a3208c8387ba135dacc11dc71c2d2483cf0cd89 | SQL | Olzhas-kh/Project_Oracle | /project_code.sql | WINDOWS-1252 | 9,168 | 3.703125 | 4 | [] | no_license | Cursor: 1
SET SERVEROUTPUT ON;
declare
cursor book_genre(v_genre books.categories%TYPE) is
select title, authors, average_rating
from books
where categories = v_genre;
v_title books.title%TYPE;
v_authors books.authors%TYPE;
v_average_rating books.average_r... | true |
0a08506727143e8ede750d57d081cc28a1072510 | SQL | MateuxLucax/prove | /Old/Banco de Dados/prove_sistema_avaliacao.sql | UTF-8 | 20,416 | 3.34375 | 3 | [
"MIT"
] | permissive | -- MySQL Script generated by MySQL Workbench
-- Fri Jun 14 21:02:50 2019
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TR... | true |
6fe23f1d63a1570bab153ae1278df82938818847 | SQL | krishars/Introduction-to-SQL-Server-Datacamp | /2.Groups, strings, and counting things/Left and right.sql | UTF-8 | 289 | 3 | 3 | [] | no_license | -- Select the first 25 characters from the left of the description column
SELECT
LEFT(description, 25) AS first_25_left
FROM
grid;
-- Amend the query to select 25 characters from the right of the description column
SELECT
RIGHT(description, 25) AS last_25_right
FROM
grid;
| true |
baa33ac967f54ac7c7ccf31b705bf1c2b9419f97 | SQL | wenniannian/yypro | /vue_app_server/db.sql | UTF-8 | 5,718 | 2.859375 | 3 | [
"MIT"
] | permissive | #1、进入库 xz
USE xz;
#2、创建表 xz_news
#技巧1:库名;表名;列表;全英文小写字母
create table xz_news(
id int primary key auto_increment,#id号
title varchar(50),#新闻标题
ctime datetime,#新闻时间
point int,#点击率
img_url varchar(255),#图片路径
content varchar(255)#新闻内容
);
#货币 小数计算误差
#价格 购物车合计
#double decimal(10,2)
#严格 将货币转换 分单位 1.99->1... | true |
074cedf78d178815138e2c90e2140479867b0099 | SQL | sorachin/AppleMango | /backend/db/restaurant_register_requests.sql | UTF-8 | 573 | 2.53125 | 3 | [] | no_license | Dump of table user
# ------------------------------------------------------------
DROP TABLE IF EXISTS `RestaurantRegisterRequests`;
CREATE TABLE `RestaurantRegisterRequests` (
`id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
`user_id` varchar(31) NOT NULL,
`restaurant_info` JSON,
FOREIGN KEY (`user_id`) REFERENC... | true |
522e00d9e3ac2bda11b87fdbaf4ad4bfc99f22d9 | SQL | dfc201692/proyecto-final | /localhost (1).sql | UTF-8 | 17,085 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 23-08-2019 a las 18:50:10
-- Versión del servidor: 5.5.16
-- Versión de PHP: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER... | true |
6994b341fc3da7070e8b5f1af977047719e1ec42 | SQL | vishwmalakar91/Programmes | /SQL/ms2.sql | UTF-8 | 824 | 3.421875 | 3 | [
"Apache-2.0"
] | permissive | drop table orders;
drop table Employee;
create table Employee
(
Employee_ID int NOT NULL,
Employee_Name char(50) NOT NULL,
Employee_Email char(50) NOT NULL,
Manager_ID int NOT null,
PRIMARY KEY (Employee_ID)
);
select * from Employee;
################ Adding extra column #######################
ALTER TABLE Emplo... | true |
5a57b2dc3a22c2160f992cb60c0db3634052fdd8 | SQL | anneri51/ContainerSave | /20190519/lokal/Flugzeugvermietung/Flugzeugvermietung_DEV/f119_Vermietung_Vermieter.sql | UTF-8 | 517,959 | 2.75 | 3 | [] | no_license | --------------------------------------------------------
-- Datei erstellt -Montag-Mai-20-2019
--------------------------------------------------------
set define off verify off feedback off
whenever sqlerror exit sql.sqlcode rollback
--------------------------------------------------------------------------------
... | true |
b9c522e6d875352bfb6f3ecba31bba1170507cba | SQL | xwang-saj/alto-boot | /src/main/resources/db/migration/V1_1__init.sql | UTF-8 | 1,143 | 4.15625 | 4 | [] | no_license | CREATE TABLE corpora
(
corpus_id SERIAL NOT NULL PRIMARY KEY,
corpus_name VARCHAR(50) NOT NULL UNIQUE
);
CREATE TABLE users
(
user_id SERIAL NOT NULL PRIMARY KEY,
user_name VARCHAR(50) NOT NULL UNIQUE
);
CREATE TABLE tagging_sessions
(
session_id uuid NOT NULL PRIMARY KEY,
start_date timestamp... | true |
142513cd7c2f97caa29d49bb2adfb5e8b3dae1b9 | SQL | fru1tstand/hcde-fanfiction-study | /mysql_new/tables/scrape.sql | UTF-8 | 983 | 3.3125 | 3 | [] | no_license | # SCRAPE_CATEGORY
# DEMO : change `SUFFIX` to whatever that fit e.g. metadata, user, review, story ...
CREATE TABLE `scrape_[SUFFIX]` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`session_id` int(11) NOT NULL,
`date` int(10) NOT NULL,
`url` varchar(2000) NOT NULL,
`content` mediumtext,
PRIMARY KEY (`id`... | true |
7f4ac5979a41762296b926092f90cedaffc4ea74 | SQL | zhengyangqiu/JAVAWeb-Project | /BOS物流系统/bos.sql | UTF-8 | 24,345 | 2.75 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : Mysql
Source Server Version : 50720
Source Host : localhost:3306
Source Database : bos
Target Server Type : MYSQL
Target Server Version : 50720
File Encoding : 65001
Date: 2018-04-03 13:58:12
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---------... | true |
4e78b27f8d8ab4008b2eb36ca820736a6b71c03b | SQL | chen09/docker-db-demo | /db/mysql_init/01_demo.sql | UTF-8 | 2,963 | 2.734375 | 3 | [] | no_license | -- MariaDB dump 10.17 Distrib 10.4.12-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: demo.chen09.xyz Database: demo
-- ------------------------------------------------------
-- Server version 10.3.22-MariaDB-1ubuntu1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_... | true |
682768b3daf2fb30d6b60750fc23391cf29c78fd | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day13/select1356.sql | UTF-8 | 265 | 2.890625 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='WiFiAP' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['4100_10','5088','4044','3211','3054','3074','5066','6212','2212','1425'])
| true |
d2fbdbc22f666f37086a9409230d1fb289d2db8f | SQL | aschaetzle/S2RDF | /QueryTranslator/WatDivQuerySet/SQL/WatDiv1M_Basic/S1-5--SO-OS-SS-VP__WatDiv1M.sql | UTF-8 | 5,505 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | SELECT tab0.v1 AS v1 , tab1.v0 AS v0 , tab6.v7 AS v7 , tab4.v5 AS v5 , tab3.v4 AS v4 , tab5.v6 AS v6 , tab2.v3 AS v3 , tab8.v9 AS v9 , tab7.v8 AS v8
FROM (SELECT obj AS v0
FROM gr__offers$$2$$
WHERE sub = 'wsdbm:Retailer46'
) tab1
JOIN (SELECT sub AS v0 , obj AS v5
FROM gr__validFrom$$5$$
) tab4
... | true |
89b347fb06549e419212dd5a9e7068abb8155a45 | SQL | team30pythian/diag_collect | /create_tables.sql | UTF-8 | 3,865 | 3.46875 | 3 | [] | no_license | ----------------------------------------------------------
--
-- SQL to install DIAG_COLLECT schema - tables
--
-- History
--
-- Version 1.0 Create 11 Oct 2017 - Luke
--
-- Version 1.1 Added on 13 Nov 2017 - Luke
-- Added tables
-- collect_latchholders
-- ... | true |
b14adf76e232a178a65e17ecd06d139882385e44 | SQL | yurijmikhalevich/db-lectures | /lecture-3/with_driver.sql | UTF-8 | 640 | 3.390625 | 3 | [] | no_license | CREATE TABLE color (
id INTEGER PRIMARY KEY,
name TEXT UNIQUE NOT NULL
);
CREATE TABLE model (
id INTEGER PRIMARY KEY,
name TEXT UNIQUE NOT NULL
);
CREATE TABLE driver (
id INTEGER PRIMARY KEY,
firstname VARCHAR (64),
middlename VARCHAR (64),
lastname VARCHAR (64) NOT NULL,
passport_data VARCHAR (2... | true |
3dd5838b4ee1939295f61ffe4413d723a247a73a | SQL | taylor67469/eTracker | /develop/eTracker.sql | UTF-8 | 470 | 3.109375 | 3 | [] | no_license | DROP DATABASE IF EXISTS eTracker_db;
CREATE database eTracker_db;
use eTracker_db;
CREATE TABLE department(
id INT NOT NULL AUTO_INCREMENT,
d_name VARCHAR(30) NOT NULL,
PRIMARY KEY(id)
);
CREATE TABLE role(
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(30),
salary DECIMAL,
department_id INT,
PRIMARY KEY(id)
);
CREATE T... | true |
39537ec8f2497575f2f2d724b93546e179d0cfe1 | SQL | TakeActionNow/OSM | /Ronin/Database1/contact/Tables/conversation_participant_permission_rel.sql | UTF-8 | 791 | 3.421875 | 3 | [] | no_license | CREATE TABLE [contact].[conversation_participant_permission_rel] (
[conversation_participant_permission_id] INT IDENTITY (1, 1) NOT NULL,
[conversation_participant_id] INT NOT NULL,
[permission_id] INT NOT NULL,
CONSTRAINT [PK_conversation_participant_permission_rel]... | true |
fb686e072d2cf32bd988bbb805c0817a5821dbc0 | SQL | longye321/civism-sso | /sql/sso.sql | UTF-8 | 1,563 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | #系统表
CREATE TABLE `civism-sso`.`sso_product`
(
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`grd_delete` TINYINT(1) NOT NULL COMMENT '逻辑删除 0 正常1删除',
`gmt_create` DATETIME NOT NULL,
`gmt_modified` DATETIME NOT NULL,
PRIMARY KEY (`id`)
);
#用户... | true |
b3a4901dcc6bd9b47142c612424b9e2511eb2fb2 | SQL | nxtmemo/nxtmemo | /html/protected/data/schema.sql | UTF-8 | 2,209 | 3.25 | 3 | [
"Unlicense"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 31. Aug 2014 um 00:40
-- Server Version: 5.5.38-0ubuntu0.14.04.1
-- PHP-Version: 5.5.9-1ubuntu4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
fbb6030150235a348370f13bc3ab20e4d83a2724 | SQL | mjmanoj/data-act-broker-backend | /dataactvalidator/config/sqlrules/a4_appropriations.sql | UTF-8 | 299 | 2.75 | 3 | [
"CC0-1.0"
] | permissive | SELECT
row_number,
status_of_budgetary_resour_cpe,
obligations_incurred_total_cpe,
unobligated_balance_cpe
FROM appropriation
WHERE submission_id = {}
AND COALESCE(status_of_budgetary_resour_cpe,0) <> COALESCE(obligations_incurred_total_cpe,0) + COALESCE(unobligated_balance_cpe,0)
| true |
a38a522f6e857c1ee40532346a9f726a0dc6ffb5 | SQL | jongvin/werp | /werp/erpw/general/t_web/sql/Procedure/SP_T_ACC_TAX_BILL_BATCH02.sql | UHC | 1,394 | 3.03125 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE Sp_T_Acc_Tax_Bill_Batch02
(
AR_COMP_CODE VARCHAR2,
AR_WORK_NO NUMBER,
AR_CRTUSERNO VARCHAR2
)
IS
/**************************************************************************/
/* 1. id : SP_T_ACC_TAX... | true |
e7a0566bf80314b98164081a76b6556e6d0f950a | SQL | unica-open/siacdbimpl | /src/sql/postgres/siopeplus/create_table_giocassa_siopeplus_10112017.sql | UTF-8 | 5,454 | 2.875 | 3 | [] | no_license | /*
*SPDX-FileCopyrightText: Copyright 2020 | CSI Piemonte
*SPDX-License-Identifier: EUPL-1.2
*/
-- 10.11.2017 Sofia SIOPE PLUS
-- DDL creazione e adeguamento struttura dati
-- da rilasciare in all.sql
CREATE TABLE mif_t_giornalecassa (
mif_t_giornalecassa_id SERIAL,
flusso_elab_mif_id INTEGER,
codice_abi_bt VAR... | true |
84874b465b04f5014675db3137cb7866695b1eaa | SQL | shadoo77/rest-full-app | /src/shadi.sql | UTF-8 | 3,876 | 3.125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64)
--
-- Host: localhost Database: shadi
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40... | true |
3c59382a2f7b6076ec55d1ef5c3d04c9a9f3d02f | SQL | sushaoxiang911/Database | /eecs484p1/createTables.sql | UTF-8 | 4,199 | 3.53125 | 4 | [] | no_license | CREATE TABLE PUBLIC_USER_INFORMATION AS (SELECT * FROM SINGHMK.PUBLIC_USER_INFORMATION);
CREATE TABLE PUBLIC_ARE_FRIENDS AS (SELECT * FROM SINGHMK.PUBLIC_ARE_FRIENDS);
CREATE TABLE PUBLIC_PHOTO_INFORMATION AS (SELECT * FROM SINGHMK.PUBLIC_PHOTO_INFORMATION);
CREATE TABLE PUBLIC_TAG_INFORMATION AS (SELECT * FROM SINGHMK... | true |
085d4bca618156f5b423d227f017e8c2e1b7fe14 | SQL | NikoLindborg/mealshare | /mealshare-sql.sql | UTF-8 | 6,066 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: mysql.metropolia.fi
-- Generation Time: 07.05.2021 klo 11:31
-- Palvelimen versio: 10.1.48-MariaDB
-- PHP Version: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER... | true |
d6c50c377207c92eb97480281dd02939c8536b74 | SQL | tran0202/thuviendulieu | /scripts/AFC Asian Cup/aac_china2004.sql | UTF-8 | 7,429 | 3.375 | 3 | [] | no_license | # Insert new tournament
# Replace all the tournament_id
# 2004 AFC Asian Cup China
INSERT INTO tournament (name, start_date, end_date, tournament_type_id, logo_filename, golden_goal_rule, points_for_win)
VALUES ('2004 AFC Asian Cup China', '2004-07-17', '2004-08-07', 15, 'aac_2004.png', null, null);
INSERT INTO grou... | true |
d62e061e47d6979607160a7f1b08ac4b183d77d4 | SQL | Soulashura/OLvoyage | /report_06.sql | WINDOWS-1252 | 1,798 | 3.75 | 4 | [] | no_license | set markup HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF HEAD "<style type='text/css'> -
body { -
font:10pt Arial,Helvetica,sans-serif; -
color:black; background:white; -
text-align: center; } -
p { -
font:8pt Arial,sans-serif; -
color:grey; background:white; } -
table,tr,td { -
font:10pt Arial,Helvetica,sans-serif; -
text-... | true |
2112fb274589f0d9255438637e04437cac1e03bf | SQL | rafapolo/tribuna | /scripts/sql_load_csv/load_receitas_2014.sql | UTF-8 | 6,582 | 3.375 | 3 | [] | no_license | use tse;
# "C�d. Elei��o";"Desc. Elei��o";"Data e hora";"CNPJ Prestador Conta";"Sequencial Candidato";"UF";"Sigla Partido";"Numero candidato";"Cargo";"Nome candidato";"CPF do candidato";"Numero Recibo Eleitoral";"Numero do documento";"CPF/CNPJ do doador";"Nome do doador";"Nome do doador (Receita Federal)";"Sigla UE d... | true |
389d27c5f5d89690c894fbe2d9b381fed40ac11c | SQL | russellshaq/habr-backend | /src/main/resources/data.sql | UTF-8 | 3,674 | 2.875 | 3 | [] | no_license | delete from comments;
delete from posts_topics;
delete from posts;
delete
from topics;
delete from users_stats;
delete
from users_roles;
delete
from users;
insert into users(id, email, first_name, last_name, password, image_url)
values (1, 'shakirovusa@gmail.com', 'Ruslan', 'Shakirov', '{noop}123456', 'avatars/avatar.... | true |
7160466e867d46e24e715e5c18c448c7a617b118 | SQL | ZhrChaos/personalProject | /db/find_message.sql | UTF-8 | 223 | 2.859375 | 3 | [] | no_license | select a.account_id, account_name, account_img, message_content, message_id, g.guild_id, guild_img, guild_name
from message m
inner join account a
on m.account_id = a.account_id
inner join guild g
on m.guild_id = g.guild_id | true |
97793e4cdd968f39ad27bac1448d4f4152d2b255 | SQL | lalithh24/Olympics-Analysis | /SQL Data exporation.sql | UTF-8 | 1,869 | 4.375 | 4 | [] | no_license | --Dataset exploration
select avg(Age) --Avg age of people
from athletes_event_results
select count(Id) -- total IDS
from athletes_event_results
select *
from athletes_event_results
select sum(
case when Height is null then 1 -- total nulls
else 0 end)
as total
from athletes_event_results
select... | true |
a9ed4be161fee4175fedb457657e2b33d0c78e41 | SQL | siddharth232/SnapIt | /photography.sql | UTF-8 | 6,411 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 02, 2019 at 10:32 PM
-- Server version: 10.1.39-MariaDB
-- PHP Version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
f9fde4d06a0a12f673c394b39819c39fd1848a3b | SQL | EdgardoZepeda/DMD-Guia-3--ZL180073--GC180313 | /db_cliente.sql | UTF-8 | 406 | 2.53125 | 3 | [] | no_license | create database db_cliente
use db_cliente
create table cliente
(
idcliente integer not null primary key,
idtipocliente integer not null,
codigo_cliente varchar(15) not null,
dui varchar(9) not null,
nit varchar(14) not null,
apellidos varchar(250) not null,
nombres varchar(250) not null,
sexo c... | true |
61cfe4c517d62fe3187886ba3c95a703b67981d8 | SQL | puneetchugh/SQL-Server-codes | /InlineFunction.sql | UTF-8 | 424 | 3.65625 | 4 | [] | no_license |
-- Wrtie an Inline-Table Value Function that returns Person's Full Name, ContactID and Phone Number
-- of all the People whose last name starts with a given alphabet.
CREATE FUNCTION dbo.PeopleInfo(@varLastName as nvarchar(90))
RETURNS TABLE
AS
RETURN
(
SELECT ContactId,
FirstName + LastName as FullName,
... | true |
ed79128036dfef72d006581e8d5f311a360f976e | SQL | timmatteson/ProgrammingProblems | /Codewars/Primes.sql | UTF-8 | 499 | 4.03125 | 4 | [] | no_license | /*
Write a SELECT query which will return all prime numbers smaller than 100 in ascending order.
Your query should return one column named prime.
https://www.codewars.com/kata/59be9f425227ddd60c00003b
*/
WITH RECURSIVE primes AS
(
SELECT
2 AS prime
UNION ALL
SELECT
prime + 1
FROM p... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.