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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1b4aac06848974686a0302815b669565cd9365f0 | SQL | VEuPathDB/WDK | /Model/lib/sql/guestsCounts.sql | UTF-8 | 6,902 | 4.28125 | 4 | [
"Apache-2.0"
] | permissive | ---------------------------------------------------------------------------------------
-- GUESTS COUNTS -- parameter: maxdate: eg: '01-APR-17' (April 1 2017)
-- run: @guestsCounts 01-MAY-17 where 01-MAY-17 is the cutoff date (upper limit)
----------------------------------------------------------------------------... | true |
d092dc68e01f9805870dabfe634e5235bf223465 | SQL | santiagovazquez/gcba-opendata-1 | /db/migrate/populate_search_table.sql | UTF-8 | 509 | 3.265625 | 3 | [] | no_license | TRUNCATE autocomplete_search;
INSERT INTO autocomplete_search(results, text, original_text)
SELECT conteo, upper(unaccent_string(texto)) as text, texto as original_text from
((
(select tipo2 as texto, count(tipo2) as conteo
from parcelas_data where smp in (select smp from parcelas_geometries)
and length(tipo2) > 2 grou... | true |
382e6940d19badcb281358b03dc46255a4537898 | SQL | ye740891000/ssm_rbac | /sql/role_rp_ref_permission.sql | UTF-8 | 2,395 | 2.796875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50540
Source Host : localhost:3306
Source Database : ssm_fin
Target Server Type : MYSQL
Target Server Version : 50540
File Encoding : 65001
Date: 2017-07-17 15:35:22
*/
SET FOREIGN_KEY_CHECKS=0;
... | true |
959204ec32c56f2a870c827351761efa77931620 | SQL | MestrieEsteban/2d0 | /prisma/migrations/20210312075241_uuid/migration.sql | UTF-8 | 484 | 2.890625 | 3 | [] | no_license | /*
Warnings:
- The migration will change the primary key for the `user` table. If it partially fails, the table could be left without primary key constraint.
- Changed the type of `id` on the `user` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the... | true |
074abfb77b8a711bc6624b248afba0b8000ff0b1 | SQL | snandar/CS377 | /ProjectOne/2j.sql | UTF-8 | 239 | 3.109375 | 3 | [] | no_license | /*5 points) How many reviews have been written after January 1st, 2017 for a business in Wisconsin(WI)?*/
SELECT count(id)
FROM review
WHERE business_id IN (SELECT id FROM business WHERE state='WI')
AND date > '2017-01-01';
| true |
8864b361ff86428a21fc7781ad8e64a58394a221 | SQL | varunsalian/telebrid | /src/main/resources/data.sql | UTF-8 | 1,008 | 3.625 | 4 | [] | no_license | DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS authentication;
DROP TABLE IF EXISTS client;
DROP TABLE IF EXISTS token;
CREATE TABLE authentication (
id INT AUTO_INCREMENT PRIMARY KEY,
device_code VARCHAR(250) NOT NULL,
user_code VARCHAR(250) NOT NULL,
time_interval INT,
expires_in INT,
verification_url ... | true |
99e41e18e8d8a9fcb6007b9f69bb12f59205eb52 | SQL | kolbe/tools | /base32.sql | UTF-8 | 2,153 | 3.4375 | 3 | [] | no_license | delimiter //
drop function if exists base32_encode//
create function base32_encode
(hash varchar(255) character set latin1)
returns varchar(255) character set latin1
no sql begin
declare len tinyint /* static */ unsigned default length(hash); -- length of string
declare chu tinyint /* static */ ... | true |
12bb330288bafef501b156a0c34db503f647422f | SQL | demada/albadar-1.1 | /albadar.dump.sql | UTF-8 | 13,739 | 3.015625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- MySQL dump 10.13 Distrib 5.7.15, for Linux (x86_64)
--
-- Host: localhost Database: albadar
-- ------------------------------------------------------
-- Server version 5.7.15-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SE... | true |
33d2b5378666f22a77ce52a8aa7f70dfa16dd20b | SQL | ofishstein/CS3200 | /project/reports.sql | UTF-8 | 3,952 | 4.28125 | 4 | [] | no_license | /*
Report: 1
Purpose: Find a user's top 3 movie studios that they've ordered from
Usefulness: This can be useful as users may want to order from their most popular studios again
Complexity:
>= 3 tables join -> 1 point
1 subquery -> 1 point
Aggregate Functions -> 1 point
Grouping -> 1 point
WHERE/HAVING -> 1 point
O... | true |
a760fcb5cf4362711934de2ce38b0f2f5f41f1be | SQL | isabel2296/Back-End-Web | /sqlFiles/timelines.sql | UTF-8 | 1,218 | 3.359375 | 3 | [] | no_license | -- timeline sql for database
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
ATTACH DATABASE 'c:\silva_proj2\userAPI\var\clients.db' as users;
DROP TABLE IF EXISTS post;
CREATE TABLE post(
postID INTEGER primary key AUTOINCREMENT,
userName VARCHAR NOT NULL,
postText TEXT,
postTimestamp TIMESTAMP DEFAULT CURRENT_TI... | true |
e20c43d778f5af1811c399e009387a962a52a21c | SQL | kimnam6988/namil | /SQL Server Management Studio/모델링 6주차/GROUP_BY.sql | UHC | 3,543 | 4.15625 | 4 | [] | no_license | SELECT COUNT(JOB) AS ' '
FROM EMPLOYEE
SELECT COUNT(DISTINCT JOB) AS ' '
FROM EMPLOYEE
/*Ҽ μ ϱ*/
SELECT AVG(SALARY) AS 'μ '
FROM EMPLOYEE
GROUP BY DNO
/*Ҽ μ μȣ */
SELECT AVG(SALARY) AS 'μ ' , DNO
FROM EMPLOYEE
GROUP BY DNO
/*Ҽ μ Ѿװ */
SELECT SUM(SALARY) AS 'μ Ѿ' , AVG(SALARY) ... | true |
6cb3bb3e32239e8c87259c58139825fd6df14c47 | SQL | mxpy99/javaee-sshcard | /spring+hibernate修改前(修改后的可能部分注释乱码)/sshcard/card_user.sql | UTF-8 | 2,872 | 2.59375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: card
-- ------------------------------------------------------
-- Server version 5.6.26-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS... | true |
1ba0b1dea6433ff3d7914606920fa81463323b12 | SQL | mcteague/campusEatsdb-DSBA6160-Group3 | /Queries_Scripts/trigger-audit_log.sql | UTF-8 | 4,037 | 4.3125 | 4 | [] | no_license | USE `Campus_Eats_Fall2020`;
-- Creating Audit Table which is a common table to store all audit logs --
-- Table attributes are --
-- audit_id : auto increment PK --
-- audit_action : this is the database action INSERT/UPDATE/DELETE --
-- audit_details : more details on the database action --
-- audit_table : This is t... | true |
4b438082193cf5d198db469d624c65867880a818 | SQL | RashmiJenamani/FCUBS143_PROD | /MAIN/TABLE/STTM_PII_PROP_DET.DDL | UTF-8 | 1,283 | 2.828125 | 3 | [] | no_license | PROMPT PROCESSING FOR STTM_PII_PROP_DET
CREATE TABLE STTM_PII_PROP_DET
(
MASK_TYPE VARCHAR2(1) ,
TABLE_NAME VARCHAR2(30) ,
COLUMN_NAME VARCHAR2(30) ,
DATA_TYPE VARCHAR2(128) ,
DATA_LENGTH NUMBER ,
MASKVALUE VARCHAR2(10) ,
FROM_POSITION NUMBER ,
TO_POSITION NUMBER ,
TOKENIZE VARCHAR2(1) ,
PII_GROUP VARCHAR... | true |
c2cb1deb18611bc24e78f99f6e9d25e2ef93c79d | SQL | wamuir/go-jsonapi-server | /graph/sqlite3/statements/InsertEdge.sql | UTF-8 | 212 | 2.953125 | 3 | [
"MIT"
] | permissive | INSERT INTO edges(from_rowid, to_rowid, key, position, meta)
SELECT a.rowid,
b.rowid,
?,
?,
?
FROM vertices a,
vertices b
WHERE (a.type=? AND a.id=? AND b.type=? AND b.id=?)
| true |
0b3b0d339930da7adc9a81bc991b57a82404c241 | SQL | uoregon-libraries/newspaper-curation-app | /src/cmd/migrate-database/_sql/20160301084706_issues_processed.sql | UTF-8 | 729 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | -- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
DROP TABLE IF EXISTS `issues_processed`;
CREATE TABLE `issues_processed` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`issue_key` TIN... | true |
7c1e7a0f2afeb8a746c7ebc1c45255b9df3eb8c5 | SQL | postgres/postgres | /contrib/pageinspect/pageinspect--1.10--1.11.sql | UTF-8 | 1,570 | 3.21875 | 3 | [
"PostgreSQL"
] | permissive | /* contrib/pageinspect/pageinspect--1.10--1.11.sql */
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION pageinspect UPDATE TO '1.11'" to load this file. \quit
--
-- Functions that fetch relation pages must be PARALLEL RESTRICTED,
-- not PARALLEL SAFE, otherwise they ... | true |
81aa59f3e44fd5fed2b443d5513d74ce18b247a2 | SQL | reetahan/ears | /Database/course_insert.sql | UTF-8 | 562 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | DELIMITER //
DROP PROCEDURE IF EXISTS COURSE_INSERT;
CREATE PROCEDURE COURSE_INSERT(
courseName_ VARCHAR(200),
professor_ VARCHAR(100),
meetingTime_ VARCHAR(20),
userId_ INT
)
BEGIN
SET @convertedDate = STR_TO_DATE(meetingTime_ , "%m-%d-%Y %H:%i") ;
INSERT INTO Course(CourseName, Professor, ... | true |
22b83e4a45b535bfc6dc5c3bb60670ae3e117c93 | SQL | Wils-Kris5/database-exercises | /Aliases_Lecture.sql | UTF-8 | 781 | 4.0625 | 4 | [] | no_license | -- Aliases = used to temporarily control output for column / table names
USE employees;
SELECT CONCAT(first_name, ' ', last_name) AS full_name
FROM employees
LIMIT 25;
-- Multiple aliases
SELECT first_name AS 'First Name', last_name AS 'Last Name'
FROM employees;
-- Multiple column data for one alias
SELECT CONCA... | true |
3cf34879738c1ce19e90a194c4a92ec2e5484f63 | SQL | SushilChelsea/spring-in-action-practice | /chapter-3/src/main/resources/schema.sql | UTF-8 | 1,143 | 3.46875 | 3 | [] | no_license | create table if not exists Ingredient (
id varchar(4) not null,
name varchar(25) not null,
type varchar(10) not null
);
create table if not exists Taco (
id identity,
name varchar(50) not null,
created_at timestamp not null
);
create table if not exists Taco_Ingredients (
taco_id bigint not null,
ingredients_id... | true |
c6452618def35fdaee363ef08771628687a83661 | SQL | Larstack/CodeicusChallenge-Back | /DbScript.sql | UTF-8 | 750 | 3.4375 | 3 | [] | no_license | --createdb codeicus_tareas_db
--createuser -s -P -e codeicus
create schema maestro;
create table maestro.tarea(
id serial,
titulo varchar(100) not null,
descripcion varchar(500) not null,
es_urgente boolean not null default false,
fecha_alta timestamp not null default now(),
fecha_estimada_finalizacion date n... | true |
84ac83bed82fb812c10cb1216c0a3997d0611c04 | SQL | mauriiciobarbosa/BDII_2013.1 | /DML/Execucao dos casos de testes/Selects simples.sql | UTF-8 | 1,303 | 3.8125 | 4 | [] | no_license | SELECT * FROM dbo.uf
SELECT * FROM dbo.unidade
SELECT * FROM dbo.secretaria
SELECT * FROM dbo.grupo WHERE desc_grupo = 'Grupo TA criado para teste do banco'
SELECT * FROM dbo.familia WHERE desc_familia = 'Familia 12'
SELECT * FROM dbo.produto
SELECT * FROM dbo.produtos_licitacao
SELECT * FROM dbo.licitacaodbo.fornecedo... | true |
1818e51ecc9e32de9b1f3c73891973c40c48b011 | SQL | Eclipse972/Gestion_Resources | /BD/nature_recette.sql | UTF-8 | 1,331 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.1.5
-- http://www.phpmyadmin.net
--
-- Serveur: gestion.resources.sql.free.fr
-- Généré le : Sam 02 Janvier 2021 à 03:23
-- Version du serveur: 5.0.83
-- Version de PHP: 5.3.9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
33fcea5ef39f0e56dabd65e6a5a6bae6ff41835a | SQL | webermn15/prp_api | /db/migrations.sql | UTF-8 | 1,699 | 3.84375 | 4 | [] | no_license | CREATE DATABASE prp_dev;
\c prp_dev
CREATE TYPE scope AS ENUM ('international', 'national', 'regional', 'local');
CREATE TABLE users(
user_id SERIAL PRIMARY KEY,
username TEXT NOT NULL
);
CREATE TABLE regions(
region_id SERIAL PRIMARY KEY,
region_name TEXT NOT NULL,
region_alias TEXT NOT NULL,
level scope NOT... | true |
9de510a33fc645bc13238b1934fcc0e573d8df0b | SQL | CodeLuoJay/JavaNotesCode | /mybatis-dynamic-sql-advanced/src/main/resources/springdb.sql | UTF-8 | 1,219 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | /*
Source Server : 本机
Source Server Type : MySQL
Source Server Version : 50642
Source Host : localhost:3306
Source Schema : springdb
Target Server Type : MySQL
Target Server Version : 50642
File Encoding : 65001
Date: 10/05/2021 22:33:57
*/
SET NAMES utf8mb4;
SET FORE... | true |
5542cdb1c39eaf034c87908c619ebae71718d2be | SQL | SmirnovaAlina/MySQL | /SQL scripts/6b.sql | UTF-8 | 241 | 3.6875 | 4 | [] | no_license | Select s.first_name, s.last_name, sum(p.amount) as 'total amount', month(payment_date) as in_month
from staff s left join payment p
on s.staff_id = p.staff_id
group by s.first_name, s.last_name, month(payment_date)
having in_month = 8;
| true |
8a1c41d4accded3f019820656154dde78cc4dfb6 | SQL | stevenschwenke/workLifeBalance | /src/main/resources/changelog.sql | UTF-8 | 416 | 3.5 | 4 | [] | no_license | --liquibase formatted sql
--changeset steven:1
create table DAY_RECORDS (
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
date date not null unique
);
create table TIME_RECORDS (
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
hours int not null,
day_record_id int not null,
... | true |
1aff1edc73e23db0e343ff14e9beb715dd5d827e | SQL | margaritamatulenkortu/Car-parking | /ipm-project-master/roomz-app/backend/src/main/resources/db/migration/postgresql/V2_1__PostgresqlSetup.sql | UTF-8 | 1,221 | 3.640625 | 4 | [] | no_license | create TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
surname VARCHAR(50) NOT NULL,
email VARCHAR(80) NOT NULL,
password VARCHAR(80) NOT NULL,
position VARCHAR(80) NOT NULL,
image VARCHAR(250),
is_adm... | true |
1a610c778dd85eb3bf7adef48f7d3773a2820a3d | SQL | lalmeras/bbgraph | /bbgraph-core/src/main/resources/db/migration/common/V1_1_2__GraphModel.sql | UTF-8 | 861 | 3.203125 | 3 | [] | no_license | -- Figure model
create table ${schema}.Figure (id int8 not null, jps text, name text, savedOn timestamp, template text, author_id int8, primary key (id));
alter table ${schema}.Figure add constraint FKbiwbagjaurhhtqk5pe5flqi1a foreign key (author_id) references ${schema}.BasicUser;
create sequence ${schema}.Figure_id_... | true |
e65154d99b2905746e883b23d87caa717e4e7c68 | SQL | jmcgover/DatabaseCreation | /CSU/CSU-info.sql | UTF-8 | 3,067 | 4.03125 | 4 | [] | no_license | -- Jeff McGovern
-- jmcgover@calpoly.edu
-- CSU 1
SELECT Campus
FROM campuses
WHERE County="Los Angeles"
ORDER BY Campus
;
-- CSU 2
SELECT deg.Year, deg.Degrees
FROM campuses camp, degrees deg
WHERE camp.campus = "California Maritime Academy" && camp.Id = deg.Campus
&& deg.Year >= 1994 && deg.Yea... | true |
83edfce7e4f8ee73bf7e5fa896c75e5758505214 | SQL | jveltrie/Burger | /db/schema.sql | UTF-8 | 229 | 2.984375 | 3 | [] | no_license | create database burgers_db;
use burgers_db;
create table burgers(
id int(10) NOT NULL AUTO_INCREMENT,
burger_name VARCHAR (255) NOT NULL,
devoured BOOLEAN DEFAULT false,
dt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
primary key(id)
); | true |
4f2fbc3f1a77afc50d99de4356f3cb9208f53c14 | SQL | jd-create/garage-backend-2020 | /src/main/resources/data.sql | UTF-8 | 784 | 2.78125 | 3 | [] | no_license | INSERT INTO client (first_name, last_name, telephone_number)
VALUES
('Peter', 'Anema', '06-12345678'),
('Truus', 'Jansen', '06-87654321'),
('Jan', 'Jansen', '06-12348765');
INSERT into address ( street_name, house_number, house_number_add, postal_code, home_town, client_id)
VALUES
('Spijkerstraat', '2', 'a', '1400 XX'... | true |
73f114d5f1b0296ad8f536a353d763c1b8d7885d | SQL | inf512/contabilidad | /documento/cnBanco.sql | UTF-8 | 907 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | /* ---------------------------------------------------- */
/* Generated by Enterprise Architect Version 12.1 */
/* Created On : 08-Nov.-2017 10:00:16 p. m. */
/* DBMS : PostgreSQL */
/* ---------------------------------------------------- */
/* Drop Sequences for Autonumber Columns */
DROP SEQUEN... | true |
874c11fcca565a1d3d3be0b556c38952127a44e6 | SQL | Inhealthcare/open-inhealthcare | /open-inhealthcare-core/src/main/resources/smsclogdb/SMSPResponse Create.sql | UTF-8 | 363 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | -- Table: "SMSPResponse"
DROP TABLE "SMSPResponse";
CREATE TABLE "SMSPResponse"
(
id serial NOT NULL,
"timestamp" character(29),
"conversationId" character(36),
"responseCode" character(10),
"response" character varying(4096),
CONSTRAINT "SMSPResponse_pkey" PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER... | true |
20eca437a8885236ce016704e03bdbf9386b2b55 | SQL | ssociopath/knowBlog | /module-data/src/main/resources/MYSQL.sql | UTF-8 | 1,852 | 3.34375 | 3 | [] | no_license | create table user (
id int primary key auto_increment,
account varchar(20) not null unique,
password varchar(80) not null,
username varchar(20) not null,
role_id int not null,
user_face varchar(255) null,
date_register datetime not null
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
create table... | true |
5e847b747f7504db71293bf1a4419c0576421d32 | SQL | pallay/giftlist | /others/sql/v_bridegroom_orders.sql | UTF-8 | 486 | 3.5625 | 4 | [] | no_license | CREATE VIEW `shaadigiftlist_development`.`v_bridegroom_orders` AS
SELECT p1.first_name AS p1_first_name,
p2.first_name AS p2_first_name,
p1.order_id,
p1.customer_number,
p1.id AS p1_id,
p2.id AS p2_id,
p1.last_name AS p1_last_name,
p2.last_name AS p2_last_name
FROM... | true |
43c425ae7543031fff71312b52921fb35acd5e8e | SQL | GAMST12/TestProjectWeb | /src/main/resources/schema.sql | UTF-8 | 3,000 | 3.796875 | 4 | [] | no_license |
DROP TABLE IF EXISTS User;
DROP TABLE IF EXISTS Kind_Sport;
DROP TABLE IF EXISTS Tournament;
DROP TABLE IF EXISTS Team;
DROP TABLE IF EXISTS Item;
DROP TABLE IF EXISTS Bet;
CREATE TABLE IF NOT EXISTS User (
usr_user_id INT NOT NULL AUTO_INCREMENT,
usr_login VARCHAR(50) NOT NULL,
usr_first_name VARCHAR(256) NOT N... | true |
2421da064513747c7d42661da05c9b19ea9f3e41 | SQL | AlbertOttosen/cubegenerator | /createtables.sql | UTF-8 | 838 | 2.828125 | 3 | [] | no_license | --commands for creating tables
CREATE TABLE RawCards(
oracle_id UUID PRIMARY KEY,
uri varchar(255) NOT NULL,
name varchar(255) NOT NULL,
type_line varchar(255) NOT NULL,
cmc float NOT NULL,
mana_cost varchar(50),
oracle_text varchar(1000),
power varchar(10),
toughness varchar(10),
... | true |
7592cf096545d1547e0c8e76781df1d0a5b649d8 | SQL | syrus-ru/amficom | /AMFICOM/v1/database/schema/administration/object/permissionattributes.sql | UTF-8 | 797 | 3.109375 | 3 | [] | no_license | -- $Id: permissionattributes.sql,v 1.2 2006/04/25 07:45:14 arseniy Exp $
CREATE TABLE PermissionAttributes (
id NUMBER(19),
created DATE NOT NULL,
modified DATE NOT NULL,
creator_id NOT NULL,
modifier_id NOT NULL,
version NUMBER(19) NOT NULL,
--
domain_id,
parent_id NUMBER(19) NOT NULL,
module_code VARCHAR2(6... | true |
516fbd3ada8f3f102aa1d000e16b90622200eff6 | SQL | EbereUzodufa/DFND | /Project 3 - SQL for Data Analysis/chinook_db/Length of Album songs wrt sales.sql | UTF-8 | 300 | 3.75 | 4 | [] | no_license | select a.Title album_name, count(t.AlbumId) song_no, sum(t.Milliseconds) album_length, sum(iL.Quantity) amt_sold, sum(iL.UnitPrice * iL.Quantity) amt_gen
from Album a
join Track t
on t.AlbumId = a.AlbumId
join InvoiceLine iL
on iL.TrackId = t.TrackId
group by a.AlbumId
order by amt_gen desc | true |
6b4d3aab3631f020b53e7bc9105b4c9bb7d0e3e3 | SQL | wangyx0055/IoT | /data/data.sql | UTF-8 | 2,182 | 3.078125 | 3 | [
"MIT"
] | permissive | create table if not exists `devices` (
`id` int(11) NOT NULL AUTO_INCREMENT primary key,
`type` tinytext not null,
`name` tinytext not null,
`value` tinytext not null,
`description` tinytext not null
)DEFAULT CHARSET=utf8;
insert into `devices` (`id`, `type`, `name`, `value`, `... | true |
052247c7a5007f36d55f1c5a74a3a7eda945bf06 | SQL | agotlin/lumo | /CS230 Documents/sql-code/may_18_deliverable.sql | UTF-8 | 8,321 | 3.734375 | 4 | [] | no_license | /* ##########################
Training Instances (First Pass)
CS 230
Sal Calvo
Adam Gotlin
Mike Hittle
This script populates a new SQL table called "cs230_training_instances", which contains a re-arranged version of the
"time_series_all" table Jessica and Rachel built. Where each row of that table contains the Lumo a... | true |
d3ea08f088412f8297a11b110a71c578a610246b | SQL | tiagniuk/dictlearn | /db/dictlearn.sql | UTF-8 | 8,792 | 2.9375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS word (
`word_id` INTEGER PRIMARY KEY ASC AUTOINCREMENT,
`word` VARCHAR NOT NULL DEFAULT '<none>',
`word2` VARCHAR NULL,
`word3` VARCHAR NULL,
`lang_id` INTEGER NOT NULL DEFAULT 0,
`partofspeech_id` INTEGER NOT NULL D... | true |
02635163da06f6b1589b611576cfd3765df9cb1b | SQL | sudsk/hr | /database/HR/Views/VW_REGIONS.sql | UTF-8 | 174 | 2.515625 | 3 | [] | no_license | CREATE OR REPLACE FORCE VIEW hr.vw_regions (region_id,region_name) AS
select "REGION_ID","REGION_NAME" from regions
union all
select "REGION_ID","REGION_NAME" from regions2; | true |
7dfba1bf9e56664ece2b6d89caa9fc72e996309f | SQL | gina-alaska/imiq-database | /python/sql/veiw2table/create_monthly_precip_all.sql | UTF-8 | 1,011 | 3.5625 | 4 | [] | no_license |
CREATE TABLE tables.monthly_precip_all_2 AS
SELECT p.siteid,
date_part('year'::text, p.utcdatetime) AS year,
date_part('month'::text, p.utcdatetime) AS month,
sum(p.datavalue) AS monthlytotal,
count(*) AS total
FROM tables.daily_precip p
GROUP BY p.siteid, date_part('year'::text, p.utcdatetime)... | true |
de220e799fda21c50a83970a20983c0afc2c22bf | SQL | bradsmialek/lab-11-book-app | /data/schema.sql | UTF-8 | 1,334 | 3.34375 | 3 | [] | no_license | DROP TABLE IF EXISTS books;
CREATE TABLE books (
id SERIAL PRIMARY KEY,
title VARCHAR(255),
author VARCHAR(255),
isbn VARCHAR(255),
image_url VARCHAR(255),
description TEXT,
bookshelf VARCHAR(255)
);
INSERT INTO books (title, author, isbn, image_url, description, bookshelf)
VALUES('Game', 'Paul Gei... | true |
97ed2980488c00bcd02921389014be37f87a0a28 | SQL | GradedJestRisk/db-training | /RDBMS/ORACLE/SQL/pseudo_columns.sql | UTF-8 | 570 | 3.828125 | 4 | [] | no_license | -- Identify a row without PK (ROWID)
SELECT
t.ROWID row_id,
t.*
FROM ref_batch t
;
-- Do work for table
-- Does NOT work for views, intermediate results (WITH, GROUP BY ..)
-- Limit number rows retrieved (RONWUM)
WITH
rqt AS
(
SELECT 'CREATE UNIQUE INDEX ndx_alter_logi_hst_svg_id_alt ON alt_alert_logi_... | true |
a3038a25df6c28ec948de3c7857a8b1bcaa497e6 | SQL | Mahkii900/personal-project-fullstack | /db/get_phone_by_room_id.sql | UTF-8 | 87 | 2.625 | 3 | [] | no_license | SELECT phone FROM rooms
JOIN users ON rooms.user_id = users.user_id
WHERE room_id = $1; | true |
56f2a8dbb1e77301df58c54db9f7c8a412d59ec3 | SQL | night417/dulcet-music-mid | /Coupon/coupon2.sql | UTF-8 | 3,028 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.3
-- https://www.phpmyadmin.net/
--
-- 主機: localhost:8889
-- 產生時間: 2020 年 04 月 29 日 08:36
-- 伺服器版本: 5.7.26
-- PHP 版本: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARA... | true |
82f2b7458c41f5ece98515f9c51a9700c44d1720 | SQL | mkarasurmeli/OnlineSinavUygulamasi | /onlinesinav.sql | UTF-8 | 7,024 | 3.21875 | 3 | [
"MIT"
] | permissive | /*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 100128
Source Host : localhost:3306
Source Schema : onlinesinav
Target Server Type : MySQL
Target Server Version : 100128
File Encoding : 65001
Date: 14/03/2... | true |
9e26f4e0a48f1edb8547ff6d15000b48c70b50d0 | SQL | nazrul-github/University-Course-and-Result-Management-System | /View for student & course.sql | UTF-8 | 387 | 3.828125 | 4 | [] | no_license | SELECT * FROM studentDepartment;
SELECT * FROM tbl_Course;
SELECT * FROM tbl_Enrollment;
CREATE VIEW studentCourse
AS
SELECT ST.StudentID, ST.StudentName,ST.MobileNumber,ST.EmailAddress,ST.DepartmentName,CS.CourseName,EN.EnrollmentDate FROM studentDepartment AS ST INNER JOIN tbl_Enrollment AS EN ON
ST.StudentID = EN.... | true |
0c8b5817c230719f09fd35196c79ab1f1dec0f0e | SQL | mayrie73/udacity_sql_queries | /Lesson1_Basic_SQL/lesson10.sql | UTF-8 | 1,634 | 4.34375 | 4 | [] | no_license | /*Questions using AND and BETWEEN operators
Write a query that returns all the orders where the standard_qty is over 1000, the poster_qty is 0, and the gloss_qty is 0.*/
SELECT *
FROM orders
WHERE standard_qty >1000 AND poster_qty =0 AND gloss_qty = 0;
/*Using the accounts table, find all the companies whose names ... | true |
5838d03da34fc2b633698f940383c00b6415d229 | SQL | BOGGspotter/m151 | /T1/PDO_V1/08storedprocedureoutparameter/storedprocedure.sql | UTF-8 | 523 | 3.1875 | 3 | [] | no_license | DELIMITER $$
CREATE PROCEDURE GetCustomerLevel(
in p_customerNumber int(11),
out p_customerLevel varchar(10))
BEGIN
DECLARE creditlim double;
SELECT creditlimit INTO creditlim
FROM customers
WHERE customerNumber = p_customerNumber;
IF creditlim > 50000 THEN
SET p_customerLevel = '... | true |
f7ce4286fd2c51158bb1bd39a9ff5d4786a750df | SQL | ivan4otopa/SoftUni | /Databases/Exams/DatabasesExam22JuneFootball/3.CountriesAndCurrencyEurzone.sql | UTF-8 | 154 | 3.25 | 3 | [] | no_license | SELECT
CountryName,
CountryCode,
(CASE WHEN CurrencyCode = 'EUR' THEN 'Inside' ELSE 'Outside' END) AS Eurozone
FROM Countries
ORDER BY CountryName | true |
fb11d672a10161c1ec14ca3c4c25e08a8e5f2a28 | SQL | laaksomavrick/note-app-api | /lib/db/migrations/0003-create_users_table.sql | UTF-8 | 414 | 3.46875 | 3 | [] | no_license | DROP TABLE IF EXISTS users CASCADE;
CREATE TABLE IF NOT EXISTS users (
id serial PRIMARY KEY,
email VARCHAR(64) NOT NULL,
password VARCHAR(128) NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
ALTER SEQUENCE users_id_seq RESTART WITH 1;
CREATE TRIGGER... | true |
333b5113d2ff33d8035d1dbd50a07f4cacdaf140 | SQL | tubtim13/TheRestForLife | /TheRestForLifeDB.sql | UTF-8 | 6,675 | 3.546875 | 4 | [] | no_license | CREATE TABLE Users( userId int GENERATED ALWAYS AS IDENTITY not null primary key,
fname varchar(150) not null,
lname varchar(150) not null,
email varchar(100) not null,
password varchar(20) not null,
address varchar(255) not null,
tel varchar(15) not null);
CREATE TABLE Orders (
Ord... | true |
7829ac9a28be1f578e7e8860bd6a55db7ec3f683 | SQL | IanDanner/Python-MySQL | /MySQL Countries.sql | UTF-8 | 2,616 | 4.5 | 4 | [] | no_license | -- 1. Get all countries that speak Slovene. Return country_name, language, language_percent. Arranged by language_percent descending order.
-- SELECT countries.name, languages.language, languages.percentage FROM countries
-- JOIN languages ON countries.code = languages.country_code
-- WHERE language LIKE "Slovene"
--... | true |
eceec3a1f0aaad9f59a28351a8fc28973988cbe9 | SQL | irinatsiryapkina/work | /WESyS/epa-biogas-rin-HTL-TEA/data/old/raw data for db/postgres/fuel price setup.sql | UTF-8 | 4,446 | 2.859375 | 3 | [] | no_license | CREATE TABLE fuel_prices.retail_cng_hist
(
survey_start_date date,
gasoline numeric,
e85 numeric,
cng numeric,
propane numeric,
diesel numeric,
b2_b5 numeric,
b99_b100 numeric,
electricity numeric,
load_date date NOT NULL DEFAULT ('now'::text)::date
)
WITH (
OIDS=FALSE
);
ALTER TABLE fuel_prices.... | true |
b04e3cc78198977c576ebbe1003025ed2f14586a | SQL | tfpmonteiro/AceleraPizza | /ScriptBanco/Create DB e Tabelas - v2.sql | UTF-8 | 1,414 | 3.453125 | 3 | [] | no_license | --create database ACELERAPIZZA
use ACELERAPIZZA
CREATE TABLE Cliente(
IdCliente uniqueidentifier CONSTRAINT [PK_IdCliente] PRIMARY KEY,
Nome varchar(100) NOT NULL,
CPF varchar(14) NOT NULL,
Telefone varchar(11) NOT NULL,
DataNascimento smalldatetime NOT NULL,
Endereco varchar(500) NULL
);
CREATE TABLE Ingre... | true |
135f51315f40169e71877809b35b6c4f8855b548 | SQL | coledixon/Tech_Academy_coding_drills_2015 | /SQL_drills/SUBQUERIES/query(employees-salary-higherthan-).sql | UTF-8 | 160 | 3.125 | 3 | [] | no_license | SELECT first_name, last_name
FROM employees
WHERE salary > ( SELECT salary
FROM employees
WHERE employee_id=163);
| true |
2e9fe305e1a90390ed33d1054dcc96b361c5e7ad | SQL | Frost2019/Library-Practice-Database | /SQL_Script_A2.sql | UTF-8 | 6,727 | 3.59375 | 4 | [] | no_license | create table SUPPLIERS(
SupplierID CHAR(1) NOT NULL,
CompanyName VARCHAR(15),
ContactLN VARCHAR(15),
ContactFN VARCHAR(15),
Phone VARCHAR(13),
primary key (SupplierID));
create table BOOKS(
BookID CHAR(1) NOT NULL,
Title VARCHAR(50),
Unit_Price DECIMAL(4,2),
Author VARCHAR(15),
UISTOCK INT,
Suppli... | true |
f46ab367232278161ee33c811bbd8280b01d92f9 | SQL | atanasng/Oracle-Sql | /Aggregation/HR7.sql | UTF-8 | 150 | 3.109375 | 3 | [] | no_license | SELECT DEPARTMENT_ID, COUNT(*)
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID
HAVING DEPARTMENT_ID > 10 AND DEPARTMENT_ID < 100
ORDER BY DEPARTMENT_ID ASC; | true |
e5f19561b2590cfd6720e9b4e8826f49835c3ded | SQL | bravesoftdz/migrate-blanks-account-print | /DATA/FMS_DB13.sql | UTF-8 | 3,419,979 | 3.578125 | 4 | [] | no_license | /* SQL Manager 2010 Lite for InterBase and Firebird 5.2.1.3 */
/* -------------------------------------------------------- */
/* Host : localhost */
/* Database : C:\DEVELOP\FMS\DATA\FMS_DB.FDB */
CREATE DATABASE '127.0.0.1/gds_db:C:\DEVELOP\FMS\DATA\FMS_DB.FDB'... | true |
bb7f3af5778fb392d0c239f599da2efaa8cf1a86 | SQL | pac0n/tienda | /DataBase/store.sql | UTF-8 | 10,198 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 15-11-2017 a las 21:07:54
-- Versión del servidor: 5.7.14
-- Versión de PHP: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... | true |
9ed1384aeb0a4be25f734c4eae794ae16e74e23d | SQL | ALrehailiAbdulrahman/JSF-Inventory-Managament-System | /Data Base/inventory_invoice.sql | UTF-8 | 2,329 | 3.03125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: inventory
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... | true |
2d599bf33f652d485e6119719c6ac3f7d52e8ecd | SQL | dirkstrong1/soccer_stats | /sql/03_matches_2011_rain.sql | UTF-8 | 670 | 3.796875 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- store 2011 matches data that now contains rain flag
CREATE TABLE matches_2011_weather
AS (
SELECT match_id,
div,
season,
weather.date,
weather.rain,
hometeam,
awayteam,
fthg,
ftag,
ftr
FROM matches
JOIN (
-- join rain flag on... | true |
de10c2ed0435b2a696ff90b9a968bb1b13cc4e19 | SQL | aegrant08/Employee-Tracker | /seeds.sql | UTF-8 | 2,270 | 3.3125 | 3 | [
"ISC"
] | permissive | /* Seeds for SQL table. We haven't discussed this type of file yet */
USE cms;
/* Seeds for department table */
INSERT INTO department (name)
VALUES ("Human Resources"), ("Sales"), ("Marketing"), ("Admin");
/* Seeds for position table */
INSERT INTO position (title, salary, department_id)
VALUES ("Director", 75000, 1... | true |
cf837a90d58e14dc74214b091e994888b7afdd93 | SQL | tchrys/mini-reddit | /backend/Docker/init_db.sql | UTF-8 | 6,703 | 3.375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS categories (
id serial PRIMARY KEY,
name varchar NOT NULL UNIQUE
);
CREATE TABLE IF NOT EXISTS topics (
id serial PRIMARY KEY,
name varchar NOT NULL,
category_id integer REFERENCES categories(id)
);
CREATE TABLE IF NOT EXISTS questions (
id serial PRIMARY... | true |
191bf4385c9a2759ee7fafc7df49dd027d31561e | SQL | gtienle/DBS | /Create_Table_Befehleneu.sql | UTF-8 | 580 | 3.03125 | 3 | [] | no_license | Aufgabe 1
election=#
1)
CREATE TABLE Tweets
(T_ID INT NOT NULL , handel CHAR(20), text CHAR(300),is_retweet CHAR(5) NOT NULL, original_author CHAR(40), time CHAR(20), retweet_count INT, favorit_count INT);
ALTER TABLE Tweets
ADD PRIMARY KEY (T_ID);
2)
CREATE TABLE Hashtag
(H_ID INT, H_Name CHAR(20)
);
ALTER TAB... | true |
0dd37736dcc3134081fa23f27d8893e69d45a1ae | SQL | BugsUK/FindApprenticeship | /src/SFA.Apprenticeships.Data/Schemas/Reference/Tables/Reference.Occupation.sql | UTF-8 | 523 | 3.109375 | 3 | [
"MIT"
] | permissive | CREATE TABLE [Reference].[Occupation]
(
[OccupationId] INT NOT NULL,
[OccupationStatusId] INT NOT NULL,
[CodeName] NCHAR(3) NOT NULL,
[ShortName] NVARCHAR(MAX) NOT NULL,
[FullName] NVARCHAR(MAX) NOT NULL,
[ClosedDate] DATETIME2 NULL,
CONSTRAINT [PK_Reference_Occupation] PRIMARY KEY ([Occupa... | true |
52b26701f37d9cc69a9a13a4d6976e91871174f1 | SQL | styusuf/Serenity | /sql_files/ingredient_units.sql | UTF-8 | 248 | 3.1875 | 3 | [] | no_license | select * into ingredient_units from (select A.ing as id, json_agg(DISTINCT lower(A.unit))
as units from (select jsonb_array_elements(ingredients)->>'id' as ing, jsonb_array_elements(ingredients)->>'unitLong'
as unit from recipes)A group by A.ing)B; | true |
5ffd7a6d7c707eec3be244e7cb1257150c62aac6 | SQL | smithdk/barbershop | /SQL/operations_insert.sql | UTF-8 | 2,276 | 2.890625 | 3 | [] | no_license | /*progect name: BARBERSHOP1*/
-- Скрипт добавления записей в таблицу operations
-- !!! Обратить внимание на поле obj_id, должно соответствовать
-- obj_id парикмахерской
-- $MyTimeZone='Asia/Yekaterinburg'; //Часовой пояс
-- $MyDateTimeFormat="Y-m-d H:i:s";
-- запуск скрипта: mysql -uroot [-prootpassword] < operat... | true |
7b7bcf79d33cfc6a8906d744bc16b933a4e1b9b0 | SQL | js-virdi/go-workbook | /db-experiment/sql/script.sql | UTF-8 | 381 | 2.609375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS todos
(
id serial PRIMARY KEY,
username VARCHAR(128) NOT NULL,
title VARCHAR(128) NOT NULL,
description TEXT NULL DEFAULT NULL,
deadline timestamptz NULL,
is_important BOOLEAN NULL,
budget_amount FLOAT NULL,
created_at timestamptz NOT NULL DEFAULT... | true |
fb254acca203de7df2cc5ac9be94981acc12c2bc | SQL | zvika77/zvika_env | /Vertica/Sql/show_longest_trx.sql | UTF-8 | 652 | 3.984375 | 4 | [] | no_license | select (select TO_CHAR(min(time),'dd/mm/yy hh24:mi') from dc_transaction_starts )as min_time,TO_CHAR(st.time,'dd/mm/yy hh24:mi:ss') AS sta_time
,TO_CHAR(en.time,'dd/mm/yy hh24:mi:ss')||'('||sysdate-en.time||')' "end_time(before)",en.time-st.time dur,en.transaction_id
,en.user_name,number_of_statements as num_stm
,d... | true |
0faa757aad92efc6b69cca240f315b6dbafc6630 | SQL | timostrating/ponypicpy | /opdatcht1/opdracht1.sql | UTF-8 | 1,149 | 4.125 | 4 | [] | no_license | CREATE VIEW view1 AS
SELECT
HOUR(datum) AS uur,
DAYNAME(datum) AS dag,
WEEK(datum) AS week,
DAY(datum) AS dagnummer
FROM aanmeldingen
WHERE f_media(aanmeldingen.datum) > 0;
SELECT * FROM view1;
CREATE VIEW view2 AS
SELECT
datum,
HOUR(datum) AS uur,
DAYNAME(datum) AS dag,
WEEK(datum) AS wee... | true |
0b606b46a59c0237573dd83a974635e97d11e876 | SQL | zhengjr/bis | /sql/krasrielt/mysql/install/012_create_table_DESIGNS.sql | WINDOWS-1251 | 1,437 | 4 | 4 | [] | no_license | /* */
CREATE TABLE /*PREFIX*/DESIGNS
(
DESIGN_ID VARCHAR(32) NOT NULL,
NAME VARCHAR(100) NOT NULL,
DESCRIPTION VARCHAR(250),
NUM VARCHAR(10) NOT NULL,
PRIMARY KEY (DESIGN_ID)
)
--
/* */
CREATE VIEW /*PREFIX*/S_DESIGNS
AS
SELECT * FROM /*PREFIX*/DESIGNS
--
/* */
CREATE PROCEDURE /*PREFIX*/I_D... | true |
d019a5be910bb067cccde62543c30fa3cb30717d | SQL | SootheDataTeam/ml_project | /SQL Backup/common sql/client_last_session_date.sql | UTF-8 | 749 | 3.578125 | 4 | [] | no_license | #client_last_session_date
select user_id,
case timezone
when 'Europe/London' then
date(max(CONVERT_TZ(session_time,'UTC','Europe/London')))
when 'Australia/Sydney' then
date(max(CONVERT_TZ(session_time,'UTC','Australia/Sydney')))
when 'America/Chicago' then
date(max(CONVERT_TZ(session_time,'UTC','America/Chicago... | true |
e0716769305e46d00666e4bee3177996a228693a | SQL | otech47/STREDM3 | /artistsFinalBackup.sql | UTF-8 | 8,215 | 2.59375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.8
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 25, 2014 at 03:37 PM
-- Server version: 5.5.32-cll-lve
-- PHP Version: 5.3.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
c62df90069e5cad8fd3d20716dbd55f29a41dbef | SQL | KatSou/Fichier-afpa | /Semaine 4/Developper des composants d'acces/Exercices/CAS EXEMPLE/Exercice sur exemple1.sql | WINDOWS-1252 | 6,118 | 3.625 | 4 | [] | no_license | Use exemple1
-- N1
Select * from employe
-- N2
Select * from dept
-- N3
SELECT nom AS Employe FROM employe
-- N4
SELECT nom AS "Nom de l'employ" FROM employe
-- N5
SELECT titre from employe
-- N6
SELECT DISTINCT titre FROM employe
-- N7
SELECT noemp,nom,nodep FROM employe
WHERE titre = 'Secretaire'
-- N8
SELE... | true |
4247dae2b40dfa8d0d603c18115da2a93377e2fb | SQL | subjectseeker/subjectseeker | /sql/issue-116-patch.sql | UTF-8 | 3,293 | 3.359375 | 3 | [] | no_license | /*==============================================================*/
/* This file is not intended to be run as part of SubjectSeeker */
/* installation. It is only to be run on databases that */
/* before Issue 94 was addressed, as a patch to their schema. */
/*==================================================... | true |
02f23c489ac2c98654836cebd4c86b698748f1bc | SQL | iloveloveyou/sql | /statspWaitEvTimeBreakdown.sql | UTF-8 | 3,526 | 3.703125 | 4 | [] | no_license | alter session set nls_numeric_characters=',.';
create table tmp_mediana(x number);
truncate table tmp_mediana;
create function tmp_median(p_pct in number default 1) return number as
v_median number;
begin
select x into v_median
from ( select rownum rn, x from (select x from tmp_mediana where x is not n... | true |
d950243bea12991a66f2580da31b9d24e70ba960 | SQL | VladimirZhdanov/javaSQL | /src/main/resources/tablesCreation.SQL | UTF-8 | 687 | 3.75 | 4 | [] | no_license | CREATE table if not exists groups (
group_id serial primary key not null,
group_name varchar(250));
CREATE table if not exists students (
student_id serial primary key not null,
group_id int,
first_name varchar(250),
last_name varchar(250));
CREATE table if not exists courses (
course_id serial primary key not null,
... | true |
44c740f4d1250fc5d256eff6cfeafb2f49d0ec76 | SQL | chyuck/leet-code | /src/main/sql/DepartmentHighestSalary.sql | UTF-8 | 457 | 4.5625 | 5 | [
"MIT"
] | permissive | -- Solution for https://leetcode.com/problems/department-highest-salary/ problem
WITH maxSalaries AS
(
SELECT MAX(Salary) AS Salary, e.DepartmentId
FROM Employee e
GROUP BY e.DepartmentId
)
SELECT
d.Name AS Department,
e.Name AS Employee,
e.Salary
FROM Employee e
JOIN Department d ON d.Id = e.De... | true |
f4b0a0e261a5f4e2c0c451c804c25c56b5e05575 | SQL | DylanOlney/MediScreen-Server-Side-Content | /mediscreendb.sql | UTF-8 | 11,345 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 16, 2019 at 08:28 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
f08df16862dbb916e3f764569f0da8d692f307ee | SQL | bishdj22/ETL_Project_HousingData | /pgAdmin/mergedzillowtablequery.sql | UTF-8 | 1,873 | 3.75 | 4 | [] | no_license | Select * FROM zillow_2018_db;
Select * FROM zillow_db;
ALTER TABLE zillow_db RENAME COLUMN "2016_avghomevalue" TO avghomevalue2016;
ALTER TABLE zillow_2018_db RENAME COLUMN "2018_avghomevalue" TO avghomevalue2018;
SELECT zillow_db.zipcode, zillow_db.city, zillow_db.state,
zillow_db.metro, zillow_db.countyname,... | true |
c09acfa28fa58ceb28643aa32106273b269341eb | SQL | moonstar3109/DBMS | /1021/국기반연습HR계정~2.sql | UHC | 1,413 | 3.890625 | 4 | [] | no_license | -- ̱
declare
--DBMS_RANDOM.value() 0~10̸ Ǽ
v_num number := round( DBMS_RANDOM.value(0,10) ); --round 0 ~ 10
begin
DBMS_OUTPUT.PUT_LINE(v_num);
end;
-- IF
declare
v_num1 number := 1;
v_num2 number := 2;
begin
IF v_num1 > v_num2 THEN
DBMS_OUTPUT.PUT_LINE(v_num1 || ' ū ');
ELSE
... | true |
9e9574fc50596dbfac53825dc74284e4f26567c7 | SQL | cmanuelbernalb/example_pl_sql_rent_cars | /packages/PK_ALQUILER_TALLER_B.sql | UTF-8 | 6,062 | 3.734375 | 4 | [] | no_license | /*-----------------------------------------------------------------------------------
Proyecto : Reservas de vehículos. Curso BDII
Descripcion: Implementación de los procedimientos y funciones declarados en la cabecera
del paquete pk_reservas_taller
Autor: Cristian Manuel Bernal Bernal.
------------------... | true |
701e63423f49a901ea3cbec6c48340b41fcacd41 | SQL | tsebal/JavaRushTasks | /3.JavaMultithreading/src/com/javarush/task/sql/task03/task0329/query.sql | UTF-8 | 146 | 3.015625 | 3 | [] | no_license | -- Write your code here:
SELECT c.customer_id
, o.order_status
FROM customers AS c
JOIN orders AS o ON c.customer_id = o.customer_id | true |
991351edee2b9c947df75d157b9c4d018bf89b4d | SQL | apremalal/product-la | /modules/features/org.wso2.carbon.la.database.feature/src/main/resources/dbscripts/mysql.sql | UTF-8 | 410 | 2.890625 | 3 | [] | no_license | -- LOG_GROUPS --
CREATE TABLE IF NOT EXISTS LA_LOG_GROUPS(
LOG_GROUP_ID BIGINT AUTO_INCREMENT,
NAME VARCHAR(100),
TENANT_ID INT,
USER_NAME VARCHAR(255),
PRIMARY KEY(LOG_GROUP_ID,NAME)
)DEFAULT CHARACTER SET = utf8;
-- LOG_STREAMS --
CREATE TABLE IF NOT EXISTS LA_LOG_GROUPS(
LOG_GROUP_ID BIGINT AUTO_INCREME... | true |
cb94fa61abac7036f30207b23e26cf1cba5fcd1d | SQL | seasarorg/gusuku | /Gusuku/WEB-INF/src/org/seasar/gusuku/dao/ProjectDao_findByDto.sql | UTF-8 | 387 | 3.453125 | 3 | [] | no_license | SELECT
P.ID,P.NAME,P.KEY,P.SEQ,P.LEADERID,P.URL,P.SDATE,P.EDATE,P.DESCRIPTION,A.NAME AS NAME_0
FROM
PROJECT P LEFT OUTER JOIN ACCOUNT A ON P.LEADERID = A.ID AND A.DELFLAG = FALSE
WHERE
/*IF dto.name != null && dto.name != "" */P.NAME LIKE /*dto.likeName*/ AND/*END*/
/*IF dto.key!= null && dto.key != "" */P.KEY ... | true |
f2534fe195be4a0a73ee49e8400a0f27ec41c78c | SQL | Izzyharvin/Node.js-MySQL | /bamazon_db.sql | UTF-8 | 1,493 | 3.21875 | 3 | [] | no_license | DROP DATABASE IF EXISTS bamazon_db;
CREATE DATABASE bamazon_db;
USE bamazon_db ;
CREATE TABLE products (
id INTEGER AUTO_INCREMENT NOT NULL,
product_name VARCHAR(100) NOT NULL,
department_name VARCHAR(45) NOT NULL,
price INTEGER NOT NULL,
stock_quantity INTEGER NOT NULL,
PRIMARY KEY (id)
);
... | true |
89d027df17dafa52644f2fcf7b7a125d458fe3cd | SQL | dingjinhui821/julive_database | /sql/julive_dim/dim_project_info.sql | UTF-8 | 9,757 | 3.171875 | 3 | [] | no_license |
-- --------------------------------------------------------------------------------------------------------
-- --------------------------------------------------------------------------------------------------------
-- ---------------------------------------------------------------------------------------------------... | true |
2b4433a0b7dbc655d046d04aaeb0095968e90734 | SQL | cckmit/xinfu | /ccms/WebContent/WEB-INF/action/ccms/module/subject/copy/insert/query-report.sql | UTF-8 | 129 | 2.515625 | 3 | [] | no_license | select
t.tuid as old_report_id
,${seq:nextval@seq_report} as report_id
from
t_report t
where
t.subject_id = ${fld:subject_id} | true |
08322fb46e4f79e40dbba8cebe82a9eacdd3bd87 | SQL | solomonfrank/PropertyPro-Lite | /model/create.sql | UTF-8 | 752 | 2.890625 | 3 | [
"MIT"
] | permissive |
CREATE TABLE IF NOT EXISTS
users(
id SERIAL PRIMARY KEY,
firstName VARCHAR(120) NOT NULL,
lastName VARCHAR(120) NOT NULL,
gender VARCHAR (20) NOT NULL,
email VARCHAR(120) UNIQUE NOT NULL,
password VARCHAR(128) NOT NULL,
phoneNumber VARCHAR(120) NOT NULL,
address VARCHAR(128) NOT NULL,
isAdmin BO... | true |
0b1f7bc55524f444dd86673b343966a97ced2949 | SQL | gerken/h00ters | /database/php_db1.sql | UTF-8 | 903 | 2.59375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Machine: localhost
-- Genereertijd: 17 Feb 2011 om 14:43
-- Serverversie: 5.1.53
-- PHP-Versie: 5.3.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESU... | true |
4c7d364fcf3e30450b7125f7ca77aa44fd159c9f | SQL | dheer1998meena/AddressBookSystem-UC12ToUC13 | /UC6_RetrieveDetailsOfPersonBelongingToGivenStateOrCityInTheTable.sql | UTF-8 | 277 | 3.28125 | 3 | [] | no_license | --UC 6 : Ability to retrieve person belonging to a city or state from address book table
use AddressBook_System;
select * from Address_Book;
--Retrieve details of people belonging to either city Agra or state UP
select * from Address_Book where StateName='UP' or City='Kanpur'; | true |
3d6fe6a1e19e24769d93600c35350410cd3a2ff2 | SQL | rkammer/production-sql | /_notinuse/wga/wga_deal_type_set_list.sql | UTF-8 | 1,217 | 3.609375 | 4 | [] | no_license | DELIMITER //
CREATE PROCEDURE deal_type_set_list(
INOUT deal_type_id INTEGER,
IN deal_type_abreviation CHAR(2),
IN deal_type_name CHAR(50),
IN deal_type_created_by VARCHAR(30),
IN deal_type_updated_by VARCHAR(30),
IN deal_type_status ... | true |
a52656509eca320f506f23b6bd7d52a4161de72c | SQL | towczare/awesome-movies-api | /src/main/resources/db/migration/V17__add_new_movies_data_from_csv.sql | UTF-8 | 147,870 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | ALTER TABLE movie
ALTER COLUMN Director DROP NOT NULL;
INSERT INTO movie (id, title, poster_link, overview, critics_rate)
VALUES (19404,
'Dilwale Dulhania Le Jayenge',
'https://image.tmdb.org/t/p/w300_and_h450_bestv2//uC6TTUhPpQCmgldGyYveKRAu8JN.jpg',
'Raj is a rich, carefree, happy-go-lucky ... | true |
247a161d89a1ff8e5213799e0f8a434697a52825 | SQL | bellmit/researchmeng2 | /derby/468102_DERBY-1377/from/dml099.sql | UTF-8 | 2,540 | 2.90625 | 3 | [] | no_license | --
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
-- (the "Lice... | true |
c9a0233e519662ce1a8420507a58e3e8bf7a1992 | SQL | Elcaretes/WebForMe | /sql/forme_create_user.sql | UTF-8 | 780 | 2.78125 | 3 | [] | no_license | -- --------------------------------------------------------
-- 호스트: 58.79.19.99
-- 서버 버전: 5.7.32 - MySQL Community Server (GPL)
-- 서버 OS: Linux
-- HeidiSQL 버전: 10.3.0.5771
-- --------------------------------------------------------
... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.