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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c1d444cf8b22c0fd409d6936021a52df97934a4b | SQL | mtiradorc/DemoAccount | /Base Datos/TABLES_ACCOUNT.SQL | UTF-8 | 739 | 3.734375 | 4 | [] | no_license | CREATE TABLE OWNER (
idOwner NUMERIC AUTO_INCREMENT primary key,
owner NUMERIC (50) NOT NULL
);
CREATE TABLE ACCOUNT (
idAccount NUMERIC AUTO_INCREMENT primary key,
account NUMERIC (50) NOT NULL,
balance DOUBLE NOT NULL,
amount DOUBLE NOT NULL,
createdAt date NOT NULL,
idOwner NUMERIC NOT NULL,
FOREIGN KEY (idOwner... | true |
0fff04df1178581978b14828709c6ac5707eff6b | SQL | jafidelis/go-kickstart-orm | /db/script.sql | UTF-8 | 321 | 3.03125 | 3 | [] | no_license | CREATE TABLE users (
id serial,
first_name varchar(60) NOT NULL,
last_name varchar(60) NOT NULL,
email varchar(40),
login varchar(20) NOT NULL,
password text NOT NULL,
created_at timestamp,
updated_at timestamp,
deleted_at timestamp,
CONSTRAINT users_pk PRIMARY KEY (id)
)... | true |
7be097b177c132697d50359f90ac495fa55e0826 | SQL | aioksu/test_billing | /docker/initial.sql | UTF-8 | 914 | 3.703125 | 4 | [] | no_license | DROP TABLE IF EXISTS logs;
DROP TABLE IF EXISTS customer;
DROP TABLE IF EXISTS wallet;
CREATE TABLE wallet(
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
creation_time DATETIME NOT NULL,
balance DECIMAL(10,2)
);
CREATE TABLE customer(
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
creation_time DATETIME ... | true |
4690c1114609a790bdf7c76930e65d12ff4145c0 | SQL | khjomaa/DevOpsArchitectrureProject | /DATABASE/projects/mysql-rds/sql_scripts/create_tables.sql | UTF-8 | 472 | 3.09375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `lines`
(
`id` VARCHAR(40) NOT NULL,
`object_path` VARCHAR(250) NOT NULL,
`date` DATETIME(100) NOT NULL,
`amount_of_lines` INT,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `words`
(
`id` INT NOT NULL AUTO_INCR... | true |
c53f016865beb03db5ecc5f89c8ebb132e4d5f07 | SQL | shivahaha/moclop123 | /Source/New Folder/SQLQuery.sql | UTF-8 | 2,701 | 3.734375 | 4 | [] | no_license | --Organization
Select o.OrganizationName,a.AddressLine,a.Postcode,(FirstName + SurName) AS [Full Name],o.IsActive from Organizations o inner join
Addresses a on o.AddressId = a.AddressId
inner join Contacts c on o.ContactId = c.ContactId
order by OrganizationName
------Supporting Materials
Select s.Url,Descrip... | true |
c439634f9293feb73168bf100a2f23b0d750293d | SQL | cavinneoh/theSTUNNER | /dcsmy.sql | UTF-8 | 11,969 | 2.796875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 31, 2016 at 04:57 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
5120c430674f5361586a0f08e782674c4383672c | SQL | darshan-majithiya/Twitter-Clone | /twitter.sql | UTF-8 | 4,010 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 22, 2018 at 01:16 AM
-- Server version: 5.7.21-log
-- PHP Version: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
09c8b6e97b3220861fe44de9c611be9e3dce9920 | SQL | RAKOTONDRAMELO/reservation-web-site-api-ExpressJs | /bdxamp.sql | UTF-8 | 3,699 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3308
-- Généré le : jeu. 12 nov. 2020 à 11:50
-- Version du serveur : 8.0.18
-- Version de PHP : 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... | true |
909f3cac4d5a84f8610933dac66d10fd4ebaeff5 | SQL | fedormoore/GeekBrains | /Level9/Lesson4/CREATE BASE.sql | UTF-8 | 4,329 | 3.640625 | 4 | [] | no_license | CREATE SCHEMA `cinema` ;
CREATE TABLE `cinema`.`movies` (
`movies_id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`duration` int NOT NULL,
PRIMARY KEY (`movies_id`),
UNIQUE KEY `movies_id_UNIQUE` (`movies_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;... | true |
634bfa69b2901aabef4055312e4329931720837b | SQL | LolitaDias/SQL-Employee-Database-Analysis | /EmployeeSQL/schema.sql | UTF-8 | 1,621 | 3.9375 | 4 | [] | no_license | --Schema/Table creation scripts
-- Drop table if exists
DROP TABLE dept_emp;
DROP TABLE dept_manager;
DROP TABLE salaries;
DROP TABLE titles;
DROP TABLE departments;
DROP TABLE employees;
--Create Table departments
CREATE TABLE departments(
dept_no VARCHAR PRIMARY KEY,
dept_name VARCHAR NOT NULL);
--Create Table empl... | true |
7d634daad79628b54c562c05a8e9549edd6ba72a | SQL | KStoilkov/SoftUni | /Level 3 - Databases/Exam 12.July.2015/08.Users-in-Games-with-Items.sql | UTF-8 | 418 | 4.28125 | 4 | [] | no_license | SELECT
u.Username,
g.Name AS Game,
COUNT(ugi.ItemId) AS [Items Count],
REPLACE(SUM(i.Price), ',','.') AS [Items Price]
FROM Users u
JOIN UsersGames ug
ON ug.UserId = u.Id
JOIN Games g
ON g.Id = ug.GameId
JOIN UserGameItems ugi
ON ugi.UserGameId = ug.Id
JOIN Items i
ON ugi.ItemId = i.Id
GROUP BY u.Username, g.N... | true |
ce28d1b317be82622744da4f90cae065f0154e1a | SQL | khu07c8/gcit-library | /GCIT/SQL_SCRIPTS/edit_branch_address.sql | UTF-8 | 237 | 2.78125 | 3 | [] | no_license | DELIMITER $$
CREATE PROCEDURE edit_branch_address(IN branch_id int, IN new_address VARCHAR(75))
BEGIN
UPDATE tbl_library_branch
SET tbl_library_branch.branchAddress = new_address
WHERE tbl_library_branch.branchId = branch_id;
END $$ | true |
f90982b7e26bbc77d8c42fdcb0f1c5bdbba29c9a | SQL | alejotaliento/BD1 | /TP ARREGLADO/ABM CON STORED PROCEDURES.sql | UTF-8 | 9,775 | 3.796875 | 4 | [] | no_license | -- PEDIDO ALTA
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `pedido_alta`(id int, concesionaria int, fecha datetime,out resultado int,out mensaje varchar(45))
BEGIN
declare nCantidad int;
select count(*) into nCantidad from pedido where idPedido=id;
IF (nCantidad > 0) then
select -1 INTO resultado;
selec... | true |
bde3063d07852308a13f88a68df7faa82367780e | SQL | benjamw/pharaoh | /install.sql | UTF-8 | 14,992 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 28, 2011 at 01:47 AM
-- Server version: 5.5.10
-- PHP Version: 5.3.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `iohelix_games`
--
-- -------------------------------... | true |
fc5324d6f722f72fc2c7a4dae9df9b4ef792953b | SQL | hxmn/WIM | /WIM/WIM_GATEWAY/WIM_ROLLUP/Archive/Ad Hoc Test Script.sql | UTF-8 | 506 | 2.53125 | 3 | [] | no_license | select rowid, wv.* from ppdm.well_version wv where uwi = '1000';
select rowid, w.* from ppdm.well w where uwi = '1000';
select rowid, wnv.* from ppdm.well_node_version wnv where ipl_uwi = '1000';
select rowid, wn.* from ppdm.well_node wn where ipl_uwi = '1000';
exec wim_rollup.well_rollup('1000');
select * fro... | true |
a4a0f8f02edd5bb87e6debdb35c6d786a397da8c | SQL | anne75/holbertonschool-higher_level_programming | /0x0D-SQL_more_queries/13-count_shows_by_genre.sql | UTF-8 | 345 | 3.6875 | 4 | [] | no_license | -- In db passed by argument hbtn_od_tvshows
-- List all genres and the number of times they are referenced
-- Use only one S clause
SELECT tv_genres.`name` AS 'genre', COUNT(tv_show_genres.genre_id) AS 'number_shows'
FROM tv_show_genres
INNER JOIN tv_genres on tv_genres.id = tv_show_genres.genre_id
GROUP BY tv_genres.... | true |
f57bb6712dc0773c54001609a3e405e8f8378096 | SQL | mpuzanov/otus-go | /calendar/scripts/initdb.sql | UTF-8 | 490 | 3.765625 | 4 | [] | no_license |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE if not exists events
(
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
"header" character varying(100) NOT NULL,
"text" text,
"start_time" timestamp without time zone NOT NULL,
"end_time" timestamp without time zone NOT NULL,
"user_id" ch... | true |
edde05cdbdde6912740d4e67552d6f1d8ad8ee31 | SQL | szaboeman/szakmaiErettsegi | /2006_kozismereti_februar_erettsegi/adatbaziskezeles/megoldas.sql | UTF-8 | 816 | 3.625 | 4 | [] | no_license | --1-2. feladat:
create database csaladfa default charset utf8 collate utf8_hungarian_ci;
--3. feladat:
select nev, mettol, meddig
from csaladtag
where nev like "%Péter%"
--4. feladat
select nev, meddig-mettol as "kor"
from csaladtag
where nev="György"
--5. feladat
select nev, mettol
from csaladtag
where mettol>=178... | true |
eb3ab6b0110f11586f6d0ae52e9607f7127a5dc6 | SQL | pierrecwchen/ConnectMySQL | /GameCharacter.sql | UTF-8 | 5,568 | 3.640625 | 4 | [] | no_license | #------------------------------------------------------
# Game Characters Database
# Auther: Ching Wen Chen (102921)
# Assignment 5
#
# There is NO engine support check constraint
# in mySQL, and only innodb support foreign keys.
#------------------------------------------------------
#-----------------------------... | true |
f9347805e617371b32245d7cebba2d9715866b26 | SQL | wucaiqiang/yundao-common | /src/main/resources/db/v1.0.0/ouyangli_init_sql/6-tenant_admin_user_init.sql | UTF-8 | 1,537 | 2.53125 | 3 | [] | no_license | set @_tenantId = 1;
set @_user_account_id1 = 1;
set @_user_username1 = 'liaofei';
set @_userMobile1 = '13751113926';
set @_user_role = 1;
INSERT INTO `user_account` (`id`, `tenant_id`, `username`, `mobile`, `email`, `password`, `is_lock`, `is_enabled`,`is_system`,`create_date`, `create_user_id`, `update_user_id`, `up... | true |
db0ca337df16e6f0d09f533ec9de42bdf0c342e2 | SQL | pranavpsv/recipeApp | /app/recipes/recipe_queries/sample_interaction_review.sql | UTF-8 | 849 | 2.8125 | 3 | [] | no_license | -- This query mimics the interaction queries generated by the backend that will fill the Interaction table
-- Triggers have been set up in the create_prod_tables script that will update the Recipe and User tables with the new rating and review
-- Below is a interaction where the user has rated a dish with a 5/5 and com... | true |
ee7f3d8f189ecbcf026bffc71c03b51bdf944d28 | SQL | MRManohar/Lab-DDL-command-prograd-kabbadi-league | /ddl-pkl.sql | UTF-8 | 1,668 | 3.765625 | 4 | [] | no_license | -- PROGRESSION - 1
-- 1. **Create table city**
create table city(
ID int,
name varchar(50)
);
-- 2. **Create table referee**
create table referee as(select * from city);
-- 3. **Create table innings**
create table innings(
id int,
innings_number int
);
-- 4. **Create table extra_type**
create table extra_type(
id in... | true |
d49dff827472983563f6d30e4b000638007fc917 | SQL | pedroArtico/Cinema-em-C- | /Untitled_mysql_create.sql | UTF-8 | 2,514 | 3.421875 | 3 | [] | no_license | CREATE TABLE `Sala` (
`ID_sala` INT NOT NULL,
`tipo` varchar NOT NULL,
`numPoltronas` INT NOT NULL,
PRIMARY KEY (`ID_sala`)
);
CREATE TABLE `Sessao` (
`ID_sessao` INT NOT NULL,
`precoBase` FLOAT NOT NULL,
`ID_sala` INT NOT NULL,
`ID_filme` INT NOT NULL,
PRIMARY KEY (`ID_sessao`)
);
CREATE TABL... | true |
0babf539894f32107a557608e079887480cd5a3b | SQL | wojtek960506/OldUniversityProjects | /2018_4thSem_SQL_FlightScheduleDatabase/Project/Inserts/LittleInserts.sql | UTF-8 | 2,503 | 3.375 | 3 | [] | no_license | --inserty do mniejszych tabel
--linie lotnicze
INSERT INTO airlines (airline_name, airline_country) VALUES ('TAP Portugal', 'Portugal');
INSERT INTO airlines (airline_name, airline_country) VALUES ('Iberia', 'Spain');
INSERT INTO airlines (airline_name, airline_country) VALUES ('Alitalia', 'Italy');
COMMIT;
--lotnisk... | true |
d4dfdca9838f3e6704df286a5a15733f2ac538ad | SQL | olegnysss/printing | /src/main/resources/database/indexes.sql | UTF-8 | 298 | 2.84375 | 3 | [] | no_license | CREATE INDEX user_index ON users (id);
CREATE INDEX order_index ON orders (id);
CREATE INDEX message_index ON message (id);
CREATE INDEX response_index ON responses (order_id, executor_id);
CREATE INDEX equipment_index ON equipment (equip_name);
CREATE INDEX material_index ON material (mat_title); | true |
e2542fa1fa28d507637346ce3d08d70a49724f5d | SQL | NAVADMC/NAADSM3_Archive | /gui/database_schemas/DBSchema3_1_20_GOLD.DDL | UTF-8 | 4,104 | 3.203125 | 3 | [] | no_license | -- This SQL DDL script was generated by manually
-- by Aaron Reeves <Aaron.Reeves@colostate.edu>
-- on January 7, 2009 at 2:48 PM.
create table `dynHerd_IM0` (
`herdID` Counter,
`productionTypeID` Long,
`latitude` Double,
`longitude` Double,
`initialStateCode` Char(1),
`daysLeftInInitialState` Long,
... | true |
0fd64881302bcb4a2a775b70ebea057ef836d902 | SQL | toannguyen71195/REMServer | /toannguyen.rem.dal/resources/SQL Script/5-Extra.sql | UTF-8 | 14,887 | 2.859375 | 3 | [] | no_license | use estate_manager;
insert into address(City, District, Ward, Address)
values('Hồ Chí Minh', 'Tân Phú', 'Hiệp Tân', '239 - 241 và 278 Hòa Bình');
insert into address(City, District, Ward, Address)
values('Hồ Chí Minh', '8', 'Căn hộ chung cư tại City Gate Towers', '');
insert into address(City, District, Ward, Ad... | true |
82e4beaefe15c40236dfc579fce6b28d4b8201f2 | SQL | LeonardRada/WEBPROG2 | /book-view/sql/db.sql | UTF-8 | 782 | 3.96875 | 4 | [] | no_license | CREATE DATABASE php_lesson_db;
USE php_lesson_db;
CREATE TABLE IF NOT EXISTS author (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255)
);
CREATE TABLE IF NOT EXISTS book (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255),
isbn VARCHAR(255),
author_id INT(6) UNSIGNED,
FO... | true |
e17bb2514d3454baaee5083585689c772b9bebde | SQL | gentjankolicaj/MyManager | /desktop/src/main/resources/liquibase/changelogs/08_insert_employees.sql | UTF-8 | 1,754 | 2.53125 | 3 | [
"MIT"
] | permissive | -- liquibase formatted sql
-- changeset liquibase:7
-- -----------------------------------------------------
-- Initial employees,for testing purposes,to be deleted after testing
-- -----------------------------------------------------
INSERT INTO employees ( employee_id,first_name,last_name,middle_name,birthday,bir... | true |
9420744d9691e029f660be33e3d1435cd9a6016b | SQL | Kaushik098/Oracle_sql_files | /sql_files/Mail Tasks/Mail_Task(Joins).sql | WINDOWS-1252 | 9,412 | 4.15625 | 4 | [] | no_license | 1 Fetch the country name for Seattle City
select c.COUNTRY_NAME
from countries c JOIN locations l
on (l.COUNTRY_ID = c.COUNTRY_ID)
where l.city = 'Seattle';
2 Fetch the count of employees in each department id
select e.DEPARTMENT_ID, count(e.EMPLOYEE_ID) count_of_employees
from employees e... | true |
64865e9defcbdaac61590a69bb4af2e581942ffb | SQL | JuanDaw/1daw | /badat/2trim/tema9/T9-Act6-afernandez.sql | UTF-8 | 906 | 2.5625 | 3 | [] | no_license | /* Apartado 1 */
INSERT INTO tipo
(cod_tipo, nom_tipo)
VALUES
(1, 'fijo');
INSERT INTO tipo
(cod_tipo, nom_tipo)
VALUES
(2, 'móvil');
INSERT INTO tipo
(cod_tipo, nom_tipo)
VALUES
(3, 'fax');
/* Apartado 2 */
INSERT INTO socio
(cod_socio, nombre, apellido1, apellido2, dni, fecha_nac)
VAL... | true |
452cda936c5717981da4343b9d9e0ac1873c2df0 | SQL | XIYECODE/ssm | /webshopplatform.sql | UTF-8 | 21,843 | 3.171875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 80016
Source Host : localhost:3306
Source Database : webshopplatform
Target Server Type : MYSQL
Target Server Version : 80016
File Encoding : 65001
Date: 2019-06-23 19:26:41
*/
SET FOREIGN_KEY_CHECKS=0;
... | true |
f4643da30ffca38154a82e4dfc2d270a1519b489 | SQL | daweifly1/xgit-shop-pom | /shop-server/src/main/java/doc/ALL_SQL.sql | UTF-8 | 3,685 | 3.078125 | 3 | [] | no_license | drop TABLE if exists t_goods;
-- 建表SQL
CREATE TABLE t_goods (
id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
brand_id bigint(20) NULL COMMENT '品牌ID',
goods_category_id bigint(20) NULL COMMENT '类目id',
feight_template_id bigint(20) NULL COMMENT '运费模板',
goods_a... | true |
506360798951dc0e531ead8592a4176d1f9869bf | SQL | garygriswold/SafeBible | /Server/aws/desktop/DDL_SQL/VideoViewsCreate.sql | UTF-8 | 865 | 3.15625 | 3 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | -- This SQL Files is used to create the VideoAnalytics table
-- This file is run manually as needed to create this table.
DROP TABLE IF EXISTS VideoViews;
CREATE TABLE VideoViews(
sessionId TEXT NOT NULL,
timeStarted TEXT NOT NULL,
mediaSource TEXT NOT NULL,
mediaId TEXT NOT NULL,
languageId TEXT NOT NULL,
sil... | true |
af2f200b6e56fc7e54053fb53bd0ecb9e8ed8df1 | SQL | sweetpand/Algorithms | /HackerRank/Solutions/SQL/Employee_Salaries.sql | UTF-8 | 261 | 3.046875 | 3 | [
"MIT"
] | permissive | /*
* Take advantage of boolean operators in the WHERE clause to filter the salary and months,
* and then use the ORDER_BY statement to order your results as specified.
*/
SELECT NAME FROM EMPLOYEE WHERE SALARY > 2000 AND MONTHS < 10 ORDER BY EMPLOYEE_ID ASC
| true |
76022d9401ecf540ea97b54e1539f1ff043c33f5 | SQL | cs-cena/mine | /sql-practice/company/week3/lecture3.sql | UTF-8 | 23,300 | 3.6875 | 4 | [] | no_license | ------------------------------------------------------------------------------------------------------------
作业
mysql 语法, impala里面不适用
1. convert (varchar(10),creationdate,120)
to_date(creationdate)
varchar(10)表示的是设置可以存储的最大字符串长度为10个字节
style数字在转换时间时的含义如下:
-----------------------------------------------... | true |
de8a8db79b304aa773825a0e4479e8ce6bfed3aa | SQL | AndyWolfZwei/sea_map_IPAC | /flaskr/schema.sql | UTF-8 | 916 | 3.546875 | 4 | [] | no_license | DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS post;
DROP TABLE IF EXISTS path_display;
DROP TABLE IF EXISTS path_transfer;
DROP TABLE IF EXISTS states;
CREATE TABLE post (
id INTEGER PRIMARY KEY AUTOINCREMENT,
author_id INTEGER NOT NULL,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
title TEXT NOT NU... | true |
bdd24525a30bfdba535ce42474611a577bf01afd | SQL | rd-dev-ukraine/demo-time-track | /database/LanceTrack.Database/Tables/ReadModels/DailyTimeData.sql | UTF-8 | 460 | 3.328125 | 3 | [
"MIT"
] | permissive | /*
* Read model (read model tables ends with Data)
* Contains hours reported per day by project and user
*
*/
create table DailyTimeData
(
Id int not null identity(1, 1),
ProjectId int not null,
UserId int not null,
Date date not null,
TotalHours decimal(18, 2) not null,
BilledHours decimal(18, 2) not null... | true |
6af4162e0a76b936384bfef13e4bbef126b34016 | SQL | ameysathaye/H1BApp | /Pig/Assignment/avgtotalsales.sql | UTF-8 | 1,540 | 3.078125 | 3 | [] | no_license | totalsales1 = Load '/home/hduser/2000.txt' USING PigStorage(',') as (categoryid:chararray,categoryname:chararray,jan:double,feb:double,mar:double,apr:double,may:double,jun:double,jul:double,aug:double,sep:double,oct:double,nov:double,dec:double);
totalmnth = foreach totalsales1 generate categoryid,categoryname,jan+feb... | true |
19c75b676a82f4237079a4cf595d845ed2cac243 | SQL | melaniehammad/FLATprotecc | /server_export.sql | UTF-8 | 627 | 3.375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `accounts` (
`id` int NOT NULL AUTO_INCREMENT,
`salt` char(24) NOT NULL,
`hashValue` char(24) NOT NULL,
`mail` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `mail` (`mail`)
);
CREATE TABLE IF NOT EXISTS `entry` (
`id` int NOT NULL AUTO_INCREMENT,
`acc_id` int NOT NULL... | true |
d95f37158feacf08eef0ed36d81b25e490aa9f84 | SQL | ShruKin/Database-Management-Systems-Lab | /WEEK-3/2.sql | UTF-8 | 340 | 2.578125 | 3 | [
"MIT"
] | permissive | -- Create a table workers with following schema:
-- (worker id, first_name, last_name, salary, Dept_no, Dept_name, Designation)
create table workers
(
worker_id VARCHAR2(5),
first_name VARCHAR2(15),
last_name VARCHAR2(15),
salary number(7),
Dept_no NUMBER(3),
Dept_name VARCHAR2(20),
Designa... | true |
5c59726a43926ec3cdd9d125b64b0e241b7da921 | SQL | jdcfandialan/ICS-SAIS | /database/tables/student_inbox.sql | UTF-8 | 183 | 2.515625 | 3 | [] | no_license | CREATE TABLE student_inbox(
sno VARCHAR2(10),
sidate DATE,
sisubject VARCHAR2(99),
sibody VARCHAR2(1000),
constraint si_sno_fk foreign key(sno) references student(sno)
);
| true |
4cdf15d7999348e7c3993bb4e7f1c2eb13fc14ba | SQL | Kwon-YoungSun/DataBase | /day06.sql | UHC | 14,567 | 3.953125 | 4 | [] | no_license | -- day06
/*
DML(Data Manipulation Language)
==> ó()ϴ
ȿ Insert, Update, Delete ɵ ԵǾ ִ.
--> DML ٷ ʴ´.
COMMIT ,
߰ DDL ,
Ǿ
ȴ.
1. INSERT
==> ο Էϴ
1 ] ---> ʵ Ͱ غǾִ
... | true |
d1b8369401f1c9e78122713ffea46ae41e6e7a35 | SQL | abrance/mine | /wait/setup2.sql | UTF-8 | 534 | 3.46875 | 3 | [
"MIT"
] | permissive |
-- 创建用户 metadata,密码是 anyun100
CREATE USER 'metadata'@'localhost' identified by 'anyun100';
-- 创建数据库,存在则不创建
CREATE DATABASE IF NOT EXISTS metadata8 CHARACTER SET utf8mb4;
-- 将数据库 metadata 的所有权限都授权给用户 metadata
GRANT ALL ON metadata8.* to 'metadata'@'localhost';
GRANT ALL ON metadata8.* to 'metadata'@'%';
-- 允许 metada... | true |
e734bd0ea266e69f832f5cae084776ec7a96e0ea | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day08/select0915.sql | UTF-8 | 264 | 2.796875 | 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['3224','4008','5214','2082','4039','1600','4221','3048','4091','3100_8'])
| true |
2947dd7547e4cfc672a2048025ab695ff441e86f | SQL | suleimanovayev/Internet-shop1 | /src/main/resources/init_db.sql | UTF-8 | 398 | 2.859375 | 3 | [] | no_license | CREATE SCHEMA `internetshop` DEFAULT CHARACTER SET utf8 ;
CREATE TABLE `internetshop`.`items` (
`item_id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`price` DECIMAL(6,2) NOT NULL,
PRIMARY KEY (`item_id`));
INSERT INTO `internetshop`.`items` (`name`, `price`) VALUES ('Iphone 11', '1100');
INSERT IN... | true |
27e23487d23c76263f446d2169b45c40824d3070 | SQL | Manan94/CS631_Project | /ProjectSchemaAndQueries.sql | UTF-8 | 11,219 | 3.328125 | 3 | [] | no_license | Create table CUSTOMER (
CID INT (10) PRIMARY KEY AUTO_INCREMENT,
FName VARCHAR (30) NOT NULL,
LName VARCHAR (30) NOT NULL,
Email VARCHAR (30),
Address VARCHAR (50),
Phone INT (10),
Status VARCHAR (5));
Create table PRODUCT (
PID INT (10) PRIMARY KEY AUTO_INCREMENT,
PType VARCHAR (5) NOT NULL,
PName VARCHAR (30) NOT NU... | true |
bd4f037ceb20f785ec6e53eb1a4a9027af3b3c79 | SQL | florx/dbt-snowflake-demo | /setup.sql | UTF-8 | 830 | 3.359375 | 3 | [] | no_license | use database citibike;
create or replace stage citibike_trips
url = 's3://snowflake-workshop-lab/citibike-trips';
create or replace table trips
(tripduration integer,
starttime timestamp,
stoptime timestamp,
start_station_id integer,
start_station_name string,
start_station_latitude float,
start_station... | true |
ceda51b10e69fd98813e9461be727a87ced30956 | SQL | radudilirici/FMI | /Year 3/Sem 1/SGBD/lab2PLSQL-332.sql | ISO-8859-13 | 15,712 | 3.484375 | 3 | [] | no_license | DECLARE
x NUMBER(1) := 5;
y x%TYPE := NULL;
BEGIN
IF x <> y THEN
DBMS_OUTPUT.PUT_LINE ('valoare <> null este = true');
ELSE
DBMS_OUTPUT.PUT_LINE ('valoare <> null este != true');
END IF;
x := NULL;
IF x = y THEN
DBMS_OUTPUT.PUT_LINE ('null = null este = true');
ELSE
DBMS_OUTPUT.PUT_LINE ('null = null este ... | true |
17dff0b2d979b6c75a45106f8b5086a81128445f | SQL | BHMauricio/oracle-18-01 | /Curso-bd2.sql | UTF-8 | 703 | 2.84375 | 3 | [] | no_license | --Clase del Sabado 07/10/2017
create table almacen (numero_almacen integer, ubicacion_almacen varchar2(80),
constraint pk_na primary key (numero_almacen));
--Procedimiento almacenado para guardar una entidad o registro de tipo Almacen
create or replace procedure guardar_almacen( mi_id I... | true |
eae3f569f5f0c5d3f8aead5ebc597638cae233cd | SQL | imendezca/PJInventario | /ScriptsDB/PJInventario_drop.sql | UTF-8 | 1,208 | 2.625 | 3 | [] | no_license | -- Created by Vertabelo (http://vertabelo.com)
-- Last modification date: 2019-02-18 17:12:55.88
-- foreign keys
ALTER TABLE Asignado DROP CONSTRAINT Asignado_Equipo1;
ALTER TABLE Asignado DROP CONSTRAINT Asignado_Equipo2;
ALTER TABLE Despacho DROP CONSTRAINT Despacho_Circuito;
ALTER TABLE Equipo DROP CONSTRAINT Eq... | true |
74b1bf0209f03875d861040de97983f4200f5c2b | SQL | wwjiang007/yugabyte-db | /managed/src/main/resources/db/migration/default_/common/V122__Create_XCluster_Tables.sql | UTF-8 | 1,448 | 3.484375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"OpenSSL"
] | permissive | -- Copyright (c) YugaByte, Inc.
create table if not exists xcluster_config (
uuid uuid,
config_name varchar(256) not null,
source_universe_uuid uuid not null,
target_universe_uuid uuid not null,
status var... | true |
97106f5c247b13aac2a9a204530a76436a8bc424 | SQL | malethr/moviesApi | /src/main/resources/db/create.sql | UTF-8 | 575 | 3.125 | 3 | [
"MIT"
] | permissive | SET MODE PostgreSQL;
CREATE TABLE IF NOT EXISTS movies (
id int PRIMARY KEY auto_increment,
title VARCHAR,
description VARCHAR,
myear VARCHAR,
director VARCHAR,
trailer VARCHAR,
intheaters VARCHAR
);
CREATE TABLE IF NOT EXISTS movietypes (
id int PRIMARY KEY auto_increment,
type VARCHAR
);
CREATE TABLE IF N... | true |
c7e19089ce980ef69307e9c244a998c4095c79d3 | SQL | fairfield-university-is510-fall2017/movies-tonight-parts-1-4-aagarwal07 | /MoviesTonightDML.sql | UTF-8 | 1,081 | 4.34375 | 4 | [] | no_license | USE movies_tonight;
#Populate MOVIES Table
INSERT INTO MOVIES (MTitle, Rating)
SELECT DISTINCT MTitle, Rating
FROM DATASHEET;
SELECT * FROM MOVIES;
#Populate THEATER Table
INSERT INTO THEATER (TName,Location,Phone)
SELECT DISTINCT TName, Location, Phone
FROM DATASHEET;
SELECT * FROM THEATER;
#Populate ARTIST Table... | true |
89c6b1549991a30673eebd57bda00ded09133356 | SQL | OrionJoshi/SQL | /Aggregate_Functions/problem18.sql | UTF-8 | 622 | 3.828125 | 4 | [] | no_license | -- 18. Write a SQL statement that counts all orders for a date August 17th, 2012
-- Sample table: orders
-- ord_no purch_amt ord_date customer_id salesman_id
-- ---------- ---------- ---------- ----------- -----------
-- 70001 150.5 2012-10-05 3005 5002
-- 70009 270.65 ... | true |
eb37eccd2282a653a82caf7177ccbd6892fad121 | SQL | MohameddAli/passport-mern-mysql | /schema.sql | UTF-8 | 756 | 3.59375 | 4 | [
"MIT"
] | permissive | -- DROP DATABASE IF EXISTS passportmern;
-- CREATE DATABASE passportmern;
-- USE passportmern;
set foreign_key_checks=0;
-- --------------------------------------------------------
CREATE TABLE users (
userId int(6) NOT NULL AUTO_INCREMENT,
username varchar(20) NOT NULL UNIQUE,
password varchar(255) NOT ... | true |
79be160f3cd1830a4d390cf3e9502f867f74afa4 | SQL | hopkeno/ECU-ICTN6845-Group2 | /id14923890_ictn6845_taskdb.sql | UTF-8 | 1,731 | 3.578125 | 4 | [] | no_license | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
CREATE DATABASE IF NOT EXISTS id14923890_ictn6845_taskdb;
use id14923890_ictn6845_taskdb;
-- --------------------------------------------------------
--
-- Database: `id14923890_ictn6845_taskdb` ... | true |
ee68bfde7af110a8603182a6042701dcd5a0392e | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day18/select1247.sql | UTF-8 | 191 | 2.734375 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-17T12:47:00Z' AND timestamp<'2017-11-18T12:47:00Z' AND SENSOR_ID='de5ba734_e279_4c72_bdf3_2337335aa00f'
| true |
a4955408d88417ee872457c672177436910b4712 | SQL | ingorewho/springcloud-develope | /db-server/src/main/resources/sql/ignore_user.sql | UTF-8 | 362 | 2.875 | 3 | [] | no_license | CREATE TABLE `ignore_user` (
`user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户id',
`age` int(3) NOT NULL COMMENT '用户年龄',
`name` char(10) NOT NULL COMMENT '印刷号码通常也叫投保单号',
PRIMARY KEY (`user_id`),
KEY `index_name` (`name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='用户表'; | true |
53407921a42d9596db494668ed9b4a4cc9eeb8ac | SQL | smson-euclid/mgp-tcn | /src/query/extract-55h-of-hourly-control-vital-series_ex1c_new_extend2.sql | UTF-8 | 8,756 | 3.390625 | 3 | [
"BSD-2-Clause"
] | permissive | /*
Extract 55 hours of vital time series of Control icustays (48 hours before 'control onset' and 7 hours after (buffer)).
---------------------------------------------------------------------------------------------------------------------
- MODIFIED VERSION
- SOURCE: https://github.com/MIT-LCP/mimic-code/blob/7ff270c... | true |
ce8af87ef6854fed7c46dbb862f2ce98438ddea1 | SQL | rastiehaiev/rastibot-user-service | /src/main/resources/db/migration/V1__initial_schema.sql | UTF-8 | 375 | 2.765625 | 3 | [] | no_license | CREATE TABLE user_table
(
id SERIAL PRIMARY KEY,
chat_id INT NOT NULL UNIQUE,
username VARCHAR(255) DEFAULT NULL,
first_name VARCHAR(255) DEFAULT NULL,
last_name VARCHAR(255) DEFAULT NULL,
locale VARCHAR(255) DEFAULT NULL
);
CREATE INDEX chat_id_idx ON user_table (chat_id);
A... | true |
f4d8633b7297388066c741b4de11d81a8a102a67 | SQL | ElderVivot/ConversorTron | /SQLs/analise/clientes.sql | UTF-8 | 1,261 | 3.28125 | 3 | [] | no_license | SELECT cli.CODEMP,
cli.CODEMPDES,
emp_geral.RAZSOCEMP,
emp_geral.INSEMP,
emp_geral.CODCID,
emp_geral.CODNATJUR,
emp_geral.INSMUNEMP,
emp_geral.INSESTEMP,
emp_geral.CODCLSATVCNADOI,
emp_geral.CODSUBCLSATVCNADOI,
emp_detalhe.nomfanemp,
emp_detal... | true |
9804bdd61768570e33f29aa866481b6896959a72 | SQL | JacobHorstmeier/Social-Analyzer | /db/update_user_info.sql | UTF-8 | 200 | 2.96875 | 3 | [] | no_license | -- Select bio, email, id FROM users
-- JOIN ON userInfo.id = users.id;
-- for the join write a query that joins then gets
UPDATE userInfo
SET bio = $2, email = $3
WHERE id = $1;
SELECT * FROM userInfo | true |
a0131efd53739d01ea6e0a76fc6ae9718d1c2173 | SQL | tsukaharakazuki/td | /agg_questionnaire/query/p01_search_query.sql | UTF-8 | 231 | 3.046875 | 3 | [] | no_license | SELECT
ARRAY_JOIN(
ARRAY_AGG(
column_name
),
','
) AS sql_contents
FROM
information_schema.columns
WHERE
table_schema = '${enq_db}'
AND table_name = 'loop_column_${enq_name}'
GROUP BY
table_name | true |
d7e3d7614715f47b7ce2ac277ca2326bdd625b0f | SQL | groiq/016-transport-management | /sql/transport-manager-setup.sql | UTF-8 | 15,196 | 4 | 4 | [] | no_license |
/* Database for transport management project */
drop database if exists transport_management;
create database transport_management;
use transport_management;
CREATE TABLE locations (
location_id INT PRIMARY KEY AUTO_INCREMENT,
name NVARCHAR(32),
latitude DECIMAL(8 , 6 ),
longitude DECIMAL(9 , 6 )
);
... | true |
5d1eca456cc3f7b0f8398e289effc44e9dd20bde | SQL | 24113000/p2016 | /sql/0000_initial_script.sql | UTF-8 | 1,890 | 3.484375 | 3 | [] | no_license | CREATE TABLE `File` (
`id` BIGINT NOT NULL UNIQUE,
`name` varchar(250) NOT NULL,
`path` varchar(250) NOT NULL,
`id_path` varchar(250) NOT NULL,
`parent_id` BIGINT,
`class` varchar(250) NOT NULL,
`owner_id` BIGINT NOT NULL,
`content_id` BIGINT,
`create_date` DATE NOT NULL,
`update_date` DATE NOT NULL,
PRIMARY... | true |
7ee50bdb25427ee3e70caee515256cf162263057 | SQL | fatmazaman/Emp_Dept | /src/main/resources/Department.sql | UTF-8 | 256 | 3.0625 | 3 | [] | no_license |
CREATE TABLE Department (
id int(10) NOT NULL,
name varchar(20) NOT NULL DEFAULT '',
min_sal_range int(20) DEFAULT NULL,
max_sal_range int(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE Department
ADD FOREIGN KEY (name));
| true |
503454b4c7af1dc69df6b99b69bf7b41b5591a30 | SQL | bkiers/sqlite-parser | /src/test/resources/crash8.test_13.sql | UTF-8 | 1,282 | 2.734375 | 3 | [
"MIT"
] | permissive | -- crash8.test
--
-- execsql {
-- PRAGMA journal_mode = persist;
-- CREATE TABLE ab(a, b);
-- INSERT INTO ab VALUES(0, 'abc');
-- INSERT INTO ab VALUES(1, NULL);
-- INSERT INTO ab VALUES(2, NULL);
-- INSERT INTO ab VALUES(3, NULL);
-- INSERT INTO ab VALUES(4, NULL);
-- I... | true |
b13b9048f9bb98e40e2ea967126aa4f9834852f7 | SQL | Tommydreamer57/cell | /db/create_channel_message.sql | UTF-8 | 247 | 2.578125 | 3 | [] | no_license | INSERT INTO cell_channel_messages
(text, author_id, channel_id, timestamp)
VALUES
(${text}, ${author_id}, ${channel_id}, ${timestamp});
SELECT id, text, timestamp, author_id, channel_id
FROM cell_channel_messages
WHERE channel_id = ${channel_id}; | true |
74f52f79033457dedafef155b00fb893bd8b0cb6 | SQL | brunocarvalhs/velhapp | /Database(Banco)/DB_velhinhos.sql | UTF-8 | 4,262 | 3.34375 | 3 | [] | no_license | create database db_velhinho;
use db_velhinho;
create table tb_tipo_evento(
cd_tipo_evento int not null,
nm_tipo_evento varchar(255) not null,
constraint pk_tipo_evento
primary key (cd_tipo_evento)
);
create table tb_tipo_contato(
cd_tipo_contato int not null,
nm_tipo_contato varchar(255) not null,
... | true |
e09dd440360fb0e77da1761688b5f11aa273577f | SQL | Secure-EX/343A3 | /q3.sql | UTF-8 | 1,331 | 4.4375 | 4 | [] | no_license | SET SEARCH_PATH TO carschema;
DROP TABLE IF EXISTS q3 CASCADE;
/*
Find the most frequently rented car model in Toronto, where the reservation started and was fully completed in the year 2017.
In this case, you're asked to return the model name (e.g. BMW X5, Chevrolet Spark, etc.).
You should order by the total number... | true |
4c996f5a018bb786a98f4e872cf3a37a5235cbf4 | SQL | plagu33/PizzaPlaneta | /pizzaPlaneta.sql | UTF-8 | 6,109 | 3.125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `pizzeria` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `pizzeria`;
-- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)
--
-- Host: localhost Database: pizzeria
-- ------------------------------------------------------
-- Server version 5.6.36
/*!40101 SET @OLD_CHARACTER_SET... | true |
623440f3ec4434642e0ddaa7c7ce98170676d7be | SQL | sebrown0/TestBenchDB | /SQL/Procedures/update_entity_issue_status_for_test_result.sql | UTF-8 | 666 | 3.640625 | 4 | [] | no_license | CREATE DEFINER=`root`@`localhost` PROCEDURE `update_entity_issue_status_for_test_result`(IN forTestStatus VARCHAR(20), IN setStatus TINYINT)
BEGIN
-- Set the issue status of an entity with a entity_test_result.test_passed
WITH cte AS (
SELECT ent.id
FROM entity ent
JOIN entity_test test
ON ent.id = test.en... | true |
88146e45ad369a6fdc572676d7b59842fc895369 | SQL | LucasH-Paz/mysql-one-for-all | /desafio5.sql | UTF-8 | 268 | 3.53125 | 4 | [] | no_license | CREATE VIEW top_2_hits_do_momento AS
SELECT
s.song_name AS cancao,
COUNT(u.user_id) AS reproducoes
FROM
SpotifyClone.user_history AS u
INNER JOIN SpotifyClone.songs AS s ON u.song_id = s.id
GROUP BY
u.song_id
ORDER BY
reproducoes DESC,
cancao
LIMIT
2;
| true |
d850fd6fa325f394b171f513dfb29f2455b9d7d3 | SQL | ZhaoYiChina/Flask-Project | /backup/schema.sql | UTF-8 | 1,834 | 3.265625 | 3 | [] | no_license | DROP TABLE IF EXISTS user;
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
nickname VARCHAR(20),
avatar_url VARCHAR(80),
email VARCHAR(20),
phone VARCHAR(20),
birthday DATE,
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_time DATETIME NOT NUL... | true |
d22c5e2ba21174b4d3c38b04b11a3191e3271788 | SQL | WHYHolly/CS562EMFandMFQueryProcessor | /StandardSQL/sql3.sql | UTF-8 | 744 | 4.375 | 4 | [] | no_license | -- for each customer and each month of 2004 the cust's avg sale before, during and after this month
with prev_mo as (
select y.cust, y.month, avg(x.quant) as prev_q
from sales as x, sales as y
where x.year = 2004 and y.year = 2004 and x.cust = y.cust and x.month < y.month
group by y.cust, y.month
),
cur_mo as (
s... | true |
254c642a948519ef75457dd1d04d789370fdf444 | SQL | seoul-metropolitan-archives/sda-engine | /base/src/test/resources/db/migration/V1.0.0__20170206.sql | UTF-8 | 14,571 | 2.9375 | 3 | [] | no_license | /**
######################################################################
##
## BGF 신한은행 위탁관리 :: Flyway 스크립트
##
######################################################################
## 장애관리 전문 관련 테이블
######################################################################
**/
/**
[테이블 생성]
## 01. atms_01001110 :: 장애... | true |
c0731b63472adb7ba862c68bc2c9447a3f366d5d | SQL | Aubin13/alx-higher_level_programming-1 | /0x0E-SQL_more_queries/10-genre_id_by_show.sql | UTF-8 | 275 | 3.6875 | 4 | [] | no_license | -- Script that lists all shows contained in hbtn_0d_tvshows that have at least one genre linked
SELECT shows.title,
show_gen.genre_id
FROM tv_shows AS shows
INNER JOIN tv_show_genres AS show_gen
ON shows.id = show_gen.show_id
ORDER BY shows.title, show_gen.genre_id;
| true |
d2f0b71777dab9c6af3d0b5af85de57136bdc859 | SQL | joemc9011/employeedatabase | /employee.sql | UTF-8 | 495 | 3.296875 | 3 | [] | no_license | create database trackerdb;
use trackerdb;
create table dept (
id integer not null auto_increment,
dept_name varchar (30) not null,
primary key (id)
);
create table role(
id integer not null auto_increment,
title varchar(30) not null,
salary decimal (10,2) not null,
department_id integer not null,
primary key (id)
);... | true |
57d68beaa66cb15c54bef6a7b08f0a8ac64c4351 | SQL | alexdawn/rollinghub | /rollinghub/schema.sql | UTF-8 | 3,943 | 4.1875 | 4 | [
"MIT"
] | permissive | drop table if exists "user" cascade;
drop table if exists collections cascade;
drop table if exists object_files cascade;
drop table if exists model cascade;
drop table if exists variant cascade;
drop table if exists liveries cascade;
drop table if exists companies cascade;
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM... | true |
298218ed6a5f1fe5386c90fc6b2acac65c9c4fe9 | SQL | edelaguila/Proyectos-UMG | /Scripts/Modelo Financiero 1.4.sql | UTF-8 | 20,165 | 3.078125 | 3 | [] | no_license |
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='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
-- -------------------------... | true |
59c71249084b2068c312c4565e57566354b7ffe4 | SQL | Deutsche-Digitale-Bibliothek/ddb-virtualexhibitions | /omeka/application/schema/search_texts.sql | UTF-8 | 506 | 3.140625 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE IF NOT EXISTS `%PREFIX%search_texts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`record_type` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
`record_id` int(10) unsigned NOT NULL,
`public` tinyint(1) NOT NULL,
`title` mediumtext COLLATE utf8_unicode_ci,
`text` longtext COLLATE utf8_unicode... | true |
8bb0fee241e5af7d7b04a6c5449ab3d2cdc8f355 | SQL | sahareslami/Spotify-Database | /querys/infoOfMusicInPlaylist(srch4).sql | UTF-8 | 154 | 2.640625 | 3 | [] | no_license | select m.musicName, phm.addedDate, m.duration
from palylisthavemusic as phm, music as m
where phm.playListId = 'shivaPlaylist' and phm.musicId = m.musicId | true |
f44db24eb58051942949dc4b8f84f551a921a826 | SQL | WillZWL/shop | /admincentre/dbv/data/schema/flex_pmgw_transactions.sql | UTF-8 | 1,101 | 2.859375 | 3 | [] | no_license | CREATE TABLE `flex_pmgw_transactions` (
`so_no` char(8) NOT NULL,
`payment_gateway_id` varchar(20) NOT NULL,
`txn_id` varchar(100) DEFAULT NULL COMMENT 'Transaction id',
`payment_type` varchar(2) NOT NULL COMMENT 'S = SETTLEED, C = CHARGEBACK, R=REFUND',
`txn_time` datetime NOT NULL,
`currency_id` char(3) N... | true |
c9fd92af9d0897dbe07c95c8d8e5e016fdffaad2 | SQL | rmurugaiyan1/mobydq | /db/init/07-indicator-group.sql | UTF-8 | 1,287 | 3.640625 | 4 | [
"Apache-2.0"
] | permissive | /*Connect to database*/
\connect mobydq
/*Create table indicator group*/
CREATE TABLE base.indicator_group (
id SERIAL PRIMARY KEY
, name TEXT NOT NULL UNIQUE
, created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
, updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
, created_by_id INTEGER DEFAULT base.get_cur... | true |
48479f8062e4c5baffdece69573e124b0229c72c | SQL | mmckinneyjr/ProjectAndPortfolio3 | /CE02_DatabaseConnectivity/ContactList_2019-03-14.sql | UTF-8 | 2,309 | 3.1875 | 3 | [] | no_license | # ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.23)
# Database: ContactList
# Generation Time: 2019-03-15 02:13:06 +0000
# *******************************************... | true |
2bd4a18b5e5b719c98d7d6714c942a34d49e50af | SQL | krirto12/WMS | /sql/DataImport/wms_db_wms_record_out.sql | UTF-8 | 2,775 | 2.734375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: 139.199.179.164 Database: wms_db
-- ------------------------------------------------------
-- Server version 5.7.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RES... | true |
75108fdfc1fb1cf3eaf655be07a3d8ac51b905ca | SQL | tschreiner/devOps-Learning | /powershell/Scripts/BIB_Local/SCCM/find-collectionMembership.sql | UTF-8 | 306 | 2.84375 | 3 | [] | no_license | SELECT SMS_Collection.name
FROM SMS_FullCollectionMembership, SMS_Collection
where name = ##PRM:sms_r_system.LastLogonUserName##
and SMS_FullCollectionMembership.CollectionID = SMS_Collection.CollectionID
and SMS_Collection.name LIKE 'Serveri%'
and SMS_Collection.name != 'Serveri svi koji se patch-uju' | true |
2fbd5b399e4ce54e5f688a2520a2e3fbdf06ca90 | SQL | cmichon/h2lander | /init.sql | UTF-8 | 273 | 2.96875 | 3 | [
"MIT"
] | permissive | DROP ALL OBJECTS;
CREATE TABLE TAXNUM (
TSN CHAR(6) PRIMARY KEY NOT NULL
, NAME VARCHAR(255) NOT NULL
, "TYPE" VARCHAR(255) NOT NULL
, PARENT CHAR(6)
);
INSERT INTO TAXNUM SELECT * FROM CSVREAD('taxnum.csv');
CREATE INDEX TAXNUM_ON_PARENT ON TAXNUM(PARENT); | true |
881188beec1fdc2b12f1c7ecfc1b3459357aed38 | SQL | nahmed23/git-github.com-Life-Time-Inc-database_udw | /ltdatabaseudw/marketing/Views/v_fact_mms_member_usage_member_club_summary.sql | UTF-8 | 2,019 | 3.890625 | 4 | [] | no_license | CREATE VIEW [marketing].[v_fact_mms_member_usage_member_club_summary]
AS select member.member_id,
club.club_id,
usage.all_checkins,
usage.current_month_checkins,
usage.current_week_checkins,
usage.today_checkins,
usage.last_checkin_dim_date_key,
usage.last_checkin_date_time,
case when today_dd.day_number_in_month = 2 ... | true |
39ba5f9cc07e8218a34e393df26ed31fdd90111d | SQL | JSQLParser/JSqlParser | /src/test/resources/net/sf/jsqlparser/statement/select/oracle-tests/groupby09.sql | UTF-8 | 535 | 2.9375 | 3 | [
"Apache-2.0",
"LGPL-2.1-only"
] | permissive | ---
-- #%L
-- JSQLParser library
-- %%
-- Copyright (C) 2004 - 2019 JSQLParser
-- %%
-- Dual licensed under GNU LGPL 2.1 or Apache License 2.0
-- #L%
---
select fact_1_id,
fact_2_id,
sum(sales_value) as sales_value,
grouping(fact_1_id) as f1g,
grouping(fact_2_id) as f2g
from dimension_tab... | true |
265cc16b6fd41c872625f9a8d839b252e44b8870 | SQL | david82213/php-laravel | /php_laravel.sql | UTF-8 | 7,717 | 3.1875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2014-12-02 04:57:56
-- 服务器版本: 5.6.20
-- PHP Version: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET... | true |
d34fd24b9a263bda4e1a9fb60e20eeedcb338c47 | SQL | maguon/sms_project | /db/sql/create_table.sql | UTF-8 | 3,245 | 3.5 | 4 | [] | no_license | SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for admin_user
-- ----------------------------
DROP TABLE IF EXISTS `admin_user`;
CREATE TABLE `admin_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '唯一自增ID',
`user_name` varchar(50) COLLATE utf8mb4_unicode_ci NO... | true |
24bfb18253bd9c71ef8b216a6c92b06990c7f562 | SQL | skuapso/psql | /sql/init_data/00.init.sql | UTF-8 | 7,299 | 3.078125 | 3 | [
"MIT"
] | permissive | set client_min_messages to 'notice';
do $$begin raise notice 'insert to options.data as %', current_user; end$$;
insert into options.data (name, value) values
('terminal_auto_add', 'true'),
('sim_auto_add', 'true'),
('sim_first_address', '10.0.0.0/32'),
('primary_dns', '8.8.8.8'),
('secondary_dns', '8.8.4.4')... | true |
f7b934a64dc72293a49f9a9a2fa10e98bf081158 | SQL | wai-doi/sql-drill | /chapter_5/8.sql | UTF-8 | 1,271 | 3.59375 | 4 | [] | no_license | SELECT
年月
, SUM(
CASE
WHEN p.CategoryID = 1 THEN s.Quantity * p.Price
ELSE 0
END
) AS Ct1
, SUM(
CASE
WHEN p.CategoryID = 2 THEN s.Quantity * p.Price
ELSE 0
END
) AS Ct2
, SUM(
CASE
WHEN p.CategoryID = 3 THEN s.Quantity * p.Price
ELSE 0
END
) AS Ct3
, ... | true |
07768b5af712b613677dbd43cc2a366b960fbd81 | SQL | gowebcl/database | /src/main/scripts/defintions/tables/application/service/srv_subcategories.sql | UTF-8 | 387 | 3.359375 | 3 | [] | no_license | drop table if exists srv_subcategories cascade;
create table if not exists srv_subcategories (
idf_subcategory numeric,
txt_subcategory text,
idf_category numeric,
constraint srv_subcategories_pk primary key (idf_subcategory),
constraint srv_subcategories_fk1 foreign key (idf_category) references srv_categor... | true |
ce80bdb1b84ff3a62a6aa9fe7a07e90968872e5b | SQL | omarjcm/ssp | /codigo/versiones/v4.7.1.1/procedures/ssp_existe_ministro.sql | UTF-8 | 507 | 3.25 | 3 | [] | no_license | DELIMITER $$
DROP PROCEDURE IF EXISTS `ssp`.`ssp_existe_ministro` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ssp_existe_ministro`(nombre_ VARCHAR(50), apellido_ VARCHAR(50), OUT mensaje VARCHAR(10))
BEGIN
DECLARE apellido_ministro VARCHAR(50);
SELECT apellido INTO apellido_ministro FROM Ministro WHERE nombre... | true |
0b9c69285449bc0b3213552210638bf255de0e1a | SQL | jstiago/sql | /tools/copy_grants.sql | UTF-8 | 522 | 3.078125 | 3 | [] | no_license | BEGIN
FOR rec IN (SELECT grantee, table_name, PRIVILEGE
FROM dba_tab_privs@tdblnd20
WHERE grantee IN ('TDB_UPDATE_ROLE', 'TDB_QUERY_ROLE'))
LOOP
BEGIN
EXECUTE IMMEDIATE 'GRANT '
|| rec.PRIVILEGE
|| ' ON '
... | true |
6542446c620ab0a976fae287fa5aee93d5387720 | SQL | timowlmtn/bigdataplatforms | /src/security/views/admin/create_view_SNOWFLAKE_USER_AUTHORIZATION_VIEW.sql | UTF-8 | 1,172 | 2.890625 | 3 | [
"CC-BY-3.0"
] | permissive | create or replace view ADMIN.SNOWFLAKE_USER_AUTHORIZATION_VIEW as
select su.name user_name,
srg.ROLE,
srg.PRIVILEGE,
srg.GRANTED_ON,
srg.name,
case when PRIVILEGE = 'OWNERSHIP' then 1 else 0 end OWNERSHIP_PRIVIL... | true |
3dfef3c8af83d76d6e176b7a2dc771ebd31984b7 | SQL | craig-gaskill/swkroa-service | /database/migration/v1/V20160908112300__Create-Role.sql | UTF-8 | 516 | 2.59375 | 3 | [] | no_license | CREATE TABLE role (
role_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
role_name VARCHAR(50) NOT NULL,
role_key VARCHAR(25) NOT NULL,
active_ind BOOLEAN DEFAULT 1 NOT NULL,
create_dt_tm DATETIME NOT NULL,
create_id BIGINT NOT NULL,
... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.