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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a37c7028385fe064e069df7c53acea5db05c8f3b | SQL | gnardini/paw-itba | /src/main/resources/update.sql | UTF-8 | 792 | 3 | 3 | [] | no_license | ALTER TABLE users ADD lastLogin timestamp;
ALTER TABLE users ADD enabled boolean;
ALTER TABLE users ADD lastPasswordChange timestamp;
ALTER TABLE restaurant ADD createdDate timestamp;
ALTER TABLE restaurant ADD closedDate timestamp;
ALTER TABLE restaurant ADD closedReason varchar(150);
UPDATE users SET enabled = true;... | true |
d71e3c2811b031fadfd9fd67c2eca3e101fe98f7 | SQL | chanukas/Shopping-Cart | /Shopping-cart.sql | UTF-8 | 1,098 | 3.5 | 4 | [] | no_license | DROP DATABASE SHOPPING_CART;
CREATE DATABASE SHOPPING_CART;
USE SHOPPING_CART;
CREATE TABLE ITEM_CATEGORY (
ID INT(50) NOT NULL AUTO_INCREMENT PRIMARY KEY,
DESCRIPTION VARCHAR(500) NOT NULL
);
INSERT INTO ITEM_CATEGORY(DESCRIPTION) VALUES
('LapTop Computer'),
('Desktop Computer');
CREATE TABLE ITEM(
ID I... | true |
b66d81ec1069ccc2cbd82184c3e8d1d4e508d89b | SQL | paul-lautier/Lepaule | /lepaule_db.sql | UTF-8 | 12,057 | 3.078125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.20, for Linux (x86_64)
--
-- Host: localhost Database: lepaule
-- ------------------------------------------------------
-- Server version 8.0.20-0ubuntu0.19.10.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SE... | true |
4cf79603b5e470e188ffd1178fe7963bec04f8f5 | SQL | mpiplani/CSCI-585-Database-course-at-USC | /hw2/Q1.sql | UTF-8 | 997 | 3.453125 | 3 | [] | no_license | --DB Software used livesql.oracle.com
CREATE TABLE ProjectRoomBookings
(roomNum INTEGER NOT NULL,
startTime INTEGER NOT NULL,
endTime INTEGER NOT NULL,
groupName CHAR(10) NOT NULL,
PRIMARY KEY (roomNum, startTime),
CONSTRAINT Check_time CHECK (startTime<endTime));
CREATE OR REPLACE TRIGGER roomcheck
BEFORE INSERT... | true |
377b3ce7eb7497361d3fb0702db5dc1ee8472331 | SQL | AlejandroArbelaez21/holbertonschool-web_back_end | /0x0C-MySQL_Advanced/0-uniq_users.sql | UTF-8 | 203 | 2.5625 | 3 | [] | no_license | -- 3 first students in the Batch ID=3
-- because Batch 3 is the best!
CREATE TABLE IF NOT EXISTS users (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE,
name VARCHAR(255))
| true |
110012030a153cf45b2e43acc509eb92280e6c4d | SQL | alessiodefabio/Encode-db | /Topics_table.sql | UTF-8 | 350 | 3.09375 | 3 | [] | no_license | create table if not exists encode.topics(
topic_id int,
topicMap_id int,
name varchar(20),
subjectLocator varchar(50),
subjectIdentifier varchar(50),
scope_id int,
occurrence_id int,
primary key(topic_id, topicMap_id),
foreign key(scope_id) references encode.scopes(scope_id),
foreign key(occurrence_id) references encod... | true |
e5424b3b0c3ade2d1b4ad75204f30f00543be96a | SQL | Look-in/plmarket | /player-persistence/src/main/resources/db/player/migration/V001__init.sql | UTF-8 | 752 | 3.984375 | 4 | [] | no_license | CREATE TABLE team
(
id uuid NOT NULL,
name varchar NOT NULL UNIQUE,
commission numeric(2, 1) NOT NULL,
CONSTRAINT team_pkey PRIMARY KEY (id),
CONSTRAINT team_commission_range_check CHECK (commission >= 0 AND commission <= 10)
);
CREATE TABLE player
(
id u... | true |
326ac8ae9c7af907b0ed328889c30974827b3a8b | SQL | Alvainds/Pemilos | /Sql Database/pemilos.sql | UTF-8 | 8,329 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 17 Okt 2021 pada 10.27
-- Versi server: 10.4.19-MariaDB
-- Versi PHP: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... | true |
573e13b6a764e140d976a3f19aae355c8558bc1d | SQL | wargodz009/vmv2 | /sql/vmv2_contents.sql | UTF-8 | 7,704 | 3.125 | 3 | [] | no_license | # --------------------------------------------------------
# Host: 127.0.0.1
# Server version: 5.5.16
# Server OS: Win32
# HeidiSQL version: 6.0.0.3603
# Date/time: 2014-06-20 00:19:17
# ---------------------------------------------... | true |
233df9dcde0268ed0f2b4290844d270f47cb9f11 | SQL | ShadowProg/testrab | /test.sql | UTF-8 | 1,435 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Окт 17 2019 г., 20:57
-- Версия сервера: 5.7.20
-- Версия PHP: 7.0.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... | true |
76db7ef3f7578b6b385748ea139367de166605ad | SQL | JordanMCode/Inspire-pairs-task | /inspire-pairedproject.sql | UTF-8 | 1,663 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 30, 2020 at 02:27 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
2c208c4ac395a0b35e25b7fe3e3e2159b48b0754 | SQL | shaima-mahmoud/gateways | /src/main/resources/data.sql | UTF-8 | 3,095 | 3.53125 | 4 | [] | no_license | DROP TABLE IF EXISTS device;
DROP TABLE IF EXISTS gateway;
CREATE TABLE gateway (
id INT AUTO_INCREMENT PRIMARY KEY,
serial_number VARCHAR(250) UNIQUE,
name VARCHAR(250),
address VARCHAR(15) NOT NULL
);
CREATE TABLE device (
id INT AUTO_INCREMENT PRIMARY KEY,
UID INT UNIQUE,
vendor VARCHAR(250),
create... | true |
ddecaf169ec3fe3747acb29212e0e7066d889775 | SQL | hristorusev/hRusevSwiftHW | /HW17_hristorusev/forum.sql | UTF-8 | 1,125 | 3.203125 | 3 | [] | no_license | -- Adminer 4.2.4 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
CREATE DATABASE `forum` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `forum`;
CREATE TABLE `comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`post_id` int(11) NOT NULL,
`comment` text NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRE... | true |
bac23c00b855b8caaf39ec7701667e79c013d2f6 | SQL | sengeiou/effect_platform | /hive/hive_fact/lz_fact_ep_etao_ownership.sql | UTF-8 | 4,612 | 2.71875 | 3 | [] | no_license | -- ##########################################################################
-- # Owner:luqian
-- # Email:luqian@taobao.com
-- # Date:2012/09/17
-- # ------------------------------------------------------------------------
-- # Description:计算etao效果页数据
-- # Input:lz_fact_ep_etao_visit_effect, lz_fact_ep_etao_trade_owne... | true |
ddbfbe0e5ebe115115ed8c7bf95fbcbb786557fa | SQL | dee-dee-raye/bike_project | /bike/DB/bike.sql | UTF-8 | 1,538 | 3.6875 | 4 | [] | no_license | CREATE DATABASE bike;
\c bike;
CREATE TABLE
bike
(
id SERIAL PRIMARY KEY,
contact BOOLEAN NOT NULL,
email VARCHAR,
model VARCHAR,
name VARCHAR,
phone VARCHAR,
purchase_date TIMESTAMP,
purchase_price NUMERIC,
serial_number VARCHAR
);
... | true |
3730e73b82830251a2e60f5ba15a0a2f759c3bc0 | SQL | busrabasaran/NTIER_DatabaseFirst | /NTIER.DAL/StoredProcedures/2- InsertPerson.sql | UTF-8 | 1,035 | 2.734375 | 3 | [] | no_license | ALTER PROC [Person].[usp_PersonInsert]
@BusinessEntityID int,
@PersonType nchar(2),
@NameStyle NameStyle,
@Title nvarchar(8) = NULL,
@FirstName Name,
@MiddleName Name = NULL,
@LastName Name,
@Suffix nvarchar(10) = NULL,
@EmailPromotion INT=0,
@AdditionalContactInfo xml = NULL,
... | true |
f172cadccb4c3314ea04162fc73921429d927ecd | SQL | dtchiong/JobList | /db/create.sql | UTF-8 | 656 | 3.46875 | 3 | [
"MIT"
] | permissive | DROP TABLE users CASCADE;
DROP TABLE lists CASCADE;
CREATE TABLE users (
PRIMARY KEY (user_id),
user_id VARCHAR(255) NOT NULL,
first_name VARCHAR(25),
last_name VARCHAR(25),
email VARCHAR(50)
);
CREATE TABLE lists (
UNIQUE (user_id, company_name, job_title, city),
user_id ... | true |
3cecf67ed1df96c9b70f4d2b0e7d347fc0049064 | SQL | nisshii0313/practiceSQL | /Self/8_1.sql | UTF-8 | 74 | 2.71875 | 3 | [] | no_license | /*How many stops are in the database.*/
SELECT COUNT(stops.id) FROM stops | true |
51a8a147d285a47c9dbd600a6eee1ec212a0e8bc | SQL | kirikiko5/Java-PostgreSQL | /Consultas/Consulta12.sql | UTF-8 | 364 | 3.609375 | 4 | [] | no_license | SELECT SUM(totalDinero) totalDinero
FROM (
SELECT SUM("Precio con IVA") totalDinero FROM public."Entradas"
WHERE "DNI" IS NULL
AND "Nombre de Usuario" IS NULL
UNION ALL
SELECT SUM("Precio con IVA") totalDinero FROM public."Entradas" "w1", public."Cliente Online" "w2"
WHERE w1."Nombre de Usuario" = w2."N... | true |
75f3e059dc14d001dba3a9fe610709f9a126e35b | SQL | e-muf/proyecto-base-de-datos | /3_scripts/s-01-usuarios.sql | UTF-8 | 601 | 2.9375 | 3 | [] | no_license | --@Autores: Emanuel Flores, Adolfo Barrero
--@Fecha creación: 01/12/2019
--@Descripción: Usuarios y roles del proyecto
prompt Creando a los usuarios
create user fb_proy_admin indentified by asdf quota unlimited on users;
create user fb_proy_invitado identified by asdf;
prompt Creando los roles
create role rol_admin;... | true |
80c1d5a7b833ad570f90045af93801c5f30b0064 | SQL | styleminions/contacts_project | /addressbook.sql | UTF-8 | 2,152 | 3.015625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 02, 2015 at 02:21 AM
-- Server version: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
80116634481681850c99a464c02ed731f2147248 | SQL | RollsKane/app_Gym | /other_documents/gimnasiogimnasio.sql | UTF-8 | 5,717 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Feb 25, 2020 at 11:22 AM
-- Server version: 5.7.26
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
25c07729e793c4e8bff3f03149d87f66d4d576d7 | SQL | rubenvigo/vvsTest | /src/sql/1-MySQLCreateTables.sql | UTF-8 | 3,208 | 3.890625 | 4 | [] | no_license | -- Indexes for primary keys have been explicitly created.
-- ---------- Table for validation queries from the connection pool. ----------
DROP TABLE PingTable;
CREATE TABLE PingTable (foo CHAR(1));
DROP TABLE ApuestaRealizada;
DROP TABLE UserProfile;
DROP TABLE OpcionApuesta;
DROP TABLE TipoApuesta;
DROP TABLE Event... | true |
8c35bc0943c5e081553f717d2cc85a2a45f2ff0a | SQL | pablee/SISE | /# Desarrollo BD/Diseño 13/C32_TABLA_bsd_direccion_CREATE.sql | UTF-8 | 2,002 | 3.53125 | 4 | [] | no_license | USE `sise_legal`;
CREATE TABLE IF NOT EXISTS `bsd_direccion`
(
`cod_direccion` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Clave primaria',
`domicilio` VARCHAR(1000) NOT NULL COMMENT 'Descripción referencial del domicilio',
`calle` VARCHAR(200) DEFAULT NULL COMMENT 'calle de la direccion',
`numero` VAR... | true |
9907d6ce6177cf910f2e58fff3556d50935518b3 | SQL | solaz0824/php-mvc-pattern-basics | /resources/database.sql | UTF-8 | 1,393 | 3.484375 | 3 | [] | no_license | DROP DATABASE IF EXISTS mvc_pattern_basics;
CREATE DATABASE IF NOT EXISTS mvc_pattern_basics;
USE mvc_pattern_basics;
/* CREATE TABLES */
CREATE TABLE employees (
emp_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NUll,
gender ENUM('M', 'F') NOT ... | true |
66720b8637c62d8d5c3c2ac7f08be42078a8aaaa | SQL | chunchiYen/SpringJPA | /SpringJpa_Schema.sql | UTF-8 | 19,566 | 3.609375 | 4 | [] | no_license | -- safe update mode
-- SET SQL_SAFE_UPDATES=0; --關閉
-- SET SQL_SAFE_UPDATES=1; --開啟
-- TRUNCATE table Bookstore;
-- ALTER TABLE Bookstore modify COLUMN Price DECIMAL(10,2) default 0.00 not null ;
-- My SQL 更新、刪除時若無where 或 limit 或沒有包含key Column 的條件,會無法運行
-- 更新或刪除前 將 SQL_SAFE_UPDATES 關閉,即可執行更新作業。
-- 0 閉閉 1: 打開
DROP... | true |
753dee38b761e56801a97472a365dbe372236b5f | SQL | GianNugraha/pendaftaransekolah | /db/daftar_sekolah.sql | UTF-8 | 7,093 | 2.953125 | 3 | [] | no_license | /*
SQLyog Community v13.1.5 (64 bit)
MySQL - 10.4.11-MariaDB : Database - daftar_sekolah
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY... | true |
b9d091b8f65149076c8811576aabce5d2f3ff8f3 | SQL | abd612/database-engineering-lab | /mysql-workspace/lab-6.sql | UTF-8 | 2,987 | 4.1875 | 4 | [] | no_license | CREATE SCHEMA BOAT_DB;
CREATE TABLE SAILOR
(sid int NOT NULL,
sname varchar(20),
rating int,
age FLOAT,
PRIMARY KEY (sid));
CREATE TABLE BOAT
(bid int NOT NULL,
bname VARCHAR(20),
color VARCHAR(10),
PRIMARY KEY (bid));
CREATE TABLE RESERVE
(sid int NOT NULL,
bid int NOT NULL,
day DATE,
FOREIGN KEY (sid) REFERENCES S... | true |
dfffd0223c9de9fa9844f658ca8ad8994f2ce1d0 | SQL | marthinsalakory/kominfo_sumsel | /Database/kominfo.sql | UTF-8 | 8,646 | 3.015625 | 3 | [
"CC-BY-3.0",
"CC-BY-4.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Inang: 127.0.0.1
-- Waktu pembuatan: 27 Jun 2021 pada 15.53
-- Versi Server: 5.5.27
-- Versi PHP: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!401... | true |
0bc3d719fafd522dadca4a5fa5473a7b6e25a04e | SQL | G3ra1d0/Java-MVC | /Banco/dump-padaria-201911251840.sql | UTF-8 | 5,966 | 3.234375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
--
-- Host: localhost Database: padaria
-- ------------------------------------------------------
-- Server version 5.7.21-1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... | true |
59f2fa22c9b308c3eaa2ab1d199e1ed608f3c1d1 | SQL | LuCeser/hodor-union-platform | /SQL/fact_recognition_result.sql | UTF-8 | 683 | 2.671875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Database : hodor
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2019-01-11 14:37:47
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for fact_recognition_result
-- ---------------------------... | true |
562b8642d31cb41cec949787fdefe9b4ea207ba7 | SQL | pepikrastev/SoftUni--CSharp-DB | /MS SQL - September 2019/04.Data Aggregation - Exercise/14.EmployeesMinimumSalaries.sql | UTF-8 | 170 | 3.453125 | 3 | [] | no_license | SELECT e.DepartmentId ,
MIN(e.Salary) AS [MinimumSalary]
FROM Employees AS e
WHERE e.DepartmentId IN (2, 5, 7)
AND HireDate > '01/01/2000'
GROUP BY e.DepartmentId
| true |
75ac3f0c05683019e3cea9b4a331ed8fb954a914 | SQL | undertakingyou/eventboard-example-api-app | /eventboard-example-api-app/schema.sql | UTF-8 | 960 | 3.03125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause"
] | permissive | drop table if exists credentials;
create table credentials (
id integer primary key autoincrement,
client_id text not null,
client_secret text not null,
access_token text not null,
token_type text,
expires_in integer not null,
update_datetime integer,
refresh_token text not null
);
INSER... | true |
6dca5ffd5c3a4aded8f9be7c4dc0225b5e4b0553 | SQL | caueda/GRRecurso | /deploy/grrecurso.sql | UTF-8 | 17,730 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 31, 2016 at 05:27 PM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
5ea4ce02396f7fa4f15eef549e7dc104f19d7565 | SQL | theblaggy/GamesAndFriends | /spiele_projekt.sql | UTF-8 | 4,693 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Erstellungszeit: 10. Feb 2020 um 23:23
-- Server-Version: 10.1.21-MariaDB
-- PHP-Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA... | true |
6344fb1a2823994347c1cd20aad67e76dd194f71 | SQL | ninjabattler/bootcampx | /1_queries/7_studentRollover.sql | UTF-8 | 185 | 3.421875 | 3 | [] | no_license | SELECT students.startDate, cohorts.name, cohorts.startDate, students.startDate
FROM students
JOIN cohorts ON students.cohortId = cohorts.id
WHERE cohorts.startDate > students.startDate; | true |
71ac5f77534608b91db997d9f03d53662a84e0f1 | SQL | hchoaf/COMP3311_HKUST | /Project/Task 2/task220473370/task2query.sql | UTF-8 | 3,395 | 4.53125 | 5 | [] | no_license | /* Name: CHO, Hangsun | Student ID: 20473370*/
/* task2query.sql */
/*
1.
For FYPs that have 2 supervisors,
find the title and category of the FYP as well as the names of the supervisors.
Order the result first by category ascending, then by title ascending, and finally by name ascending.
*/
select title, cat... | true |
813de05032122ab79caf3a9e685906b9e14ffa94 | SQL | Nirfan2306/rental_mobil | /dbrental.sql | UTF-8 | 6,475 | 3.390625 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : a
Source Server Type : MySQL
Source Server Version : 100411
Source Host : localhost:3306
Source Schema : dbrental
Target Server Type : MySQL
Target Server Version : 100411
File Encoding : 65001
Date: 26/04... | true |
921271483e7b3e2c7e02cf2d0dcc53032f616948 | SQL | Gabrielagm/GourmetStore | /Script_PoblarGourmetStore_Stg.sql | ISO-8859-1 | 3,267 | 4.0625 | 4 | [] | no_license |
use GourmetStore_Stg
--limpiar tablas
DELETE FROM Ventas_Stg;
DELETE FROM Producto_Stg;
DBCC CHECKIDENT(Producto_Stg, RESEED, 0);
DELETE FROM Categoria_Stg;
DBCC CHECKIDENT(Categoria_Stg, RESEED, 0);
DELETE FROM Transportista_Stg;
DBCC CHECKIDENT(Transportista_Stg, RESEED, 0);
DELETE FROM Cliente_Stg;
DBCC CHECKIDEN... | true |
61941f00f847aa02a844add97ebc989078a6551f | SQL | todofirst/database_practice | /sql/dataprc.sql | UTF-8 | 34,214 | 3.421875 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 50730
Source Host : localhost:3306
Source Schema : dataprc
Target Server Type : MySQL
Target Server Version : 50730
File Encoding : 65001
D... | true |
67571a688315d85b01a9c19dbc2e794394280882 | SQL | jsj1510/woowahan-agile-codingtest | /sql/woorim/join/오랜-기간-보호한-동물.sql | UTF-8 | 178 | 3.515625 | 4 | [
"MIT"
] | permissive | SELECT i.NAME AS NAME, i.DATETIME AS DATETIME
FROM ANIMAL_INS AS i
LEFT JOIN ANIMAL_OUTS AS o
ON i.ANIMAL_ID = o.ANIMAL_ID
WHERE o.ANIMAL_ID is NULL
ORDER BY i.DATETIME
LIMIT 3;
| true |
b55cb44a80d2cccb8a31ca16dfff587e36a19f68 | SQL | elaspic/elaspic-rest-api | /src/elaspic_rest_api/scripts/local2.sql | UTF-8 | 4,099 | 2.984375 | 3 | [
"MIT"
] | permissive |
-- === elaspic_sequence_local ===
CREATE OR REPLACE VIEW uniprot_sequence AS
SELECT
protein_id,
protein_name,
description,
organism_name,
gene_name,
protein_existence isoforms,
sequence_version,
db,
uniprot_sequence seq
-- === elaspic_core_model ===
CREATE OR REPLACE VIEW elaspic_core_model AS
SELECT
-- domain
... | true |
f7e4007f9e174478204777e662aa4ad4f6b2f41f | SQL | cnsaturn/swf-docs-generator | /install/db.sql | UTF-8 | 1,476 | 2.859375 | 3 | [
"MIT"
] | permissive | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.5.27 - MySQL Community Server (GPL)
-- Server OS: Win32
-- HeidiSQL version: 7.0.0.4053
-- Date/time: 2012-11-01 15:12:43
-- -... | true |
4b9d5c8969c48ea7138e58edae204a248ef042ab | SQL | WilliamZhangWD/YuKuAndroidSys | /Server/sql/session.sql | UTF-8 | 272 | 2.75 | 3 | [] | no_license | drop table if exists session;
create table session
(
user_id varchar(50) not null,
skey varchar(50),
session_key varchar(30),
create_time timestamp,
last_login_time timestamp,
primary key (user_id)
);
| true |
4ca4b81cff30ddc1f88924d03b769dfb77521cc9 | SQL | frenata/todo-postgrest | /db/create-todos.sql | UTF-8 | 508 | 3.125 | 3 | [] | no_license | create schema api;
create table api.todos (
id serial primary key,
done boolean not null default false,
task text not null,
due timestamptz
);
create role web_anon nologin;
grant web_anon to postgres;
grant usage on schema api to web_anon;
grant select on api.todos to web_anon;
create role t... | true |
2699264bc48f5015e647baf9c3cbe0dab3229d3d | SQL | jonamuen/sql-reduce | /test/sqlsmith/sqlite/2606.sql | UTF-8 | 226 | 2.609375 | 3 | [
"MIT"
] | permissive | select
ref_0.name as c0,
case when ref_0.name is not NULL then ref_0.id else ref_0.id end
as c1,
ref_0.id as c2,
ref_0.name as c3
from
main.t0 as ref_0
where (ref_0.name is not NULL)
and (1)
limit 160;
| true |
e50230559dd59d43d1fddf1d676cdcd71920f3c8 | SQL | zhangcy11/zcytest | /DDL DML/dml.sql | UTF-8 | 273 | 2.65625 | 3 | [] | no_license | /*2.DML*/
-- 插入记录 --
insert into student values
('003','王五',24,'男');
-- 修改记录 --
update student set name='赵六' where id = '003';
-- 删除记录 --
delete from student where id = '003';
-- 查询记录 --
select * from student where id = '002'; | true |
3216073fea1307acfb6482c1568b6d5183b8622d | SQL | SatyaWeb006/SQL | /professional_sql/ToolWatch/INPSB/PROD/costcode_location_tracking_V2.sql | UTF-8 | 2,537 | 4.5 | 4 | [] | no_license | /*
PINKARD TOOL REPORTING (V2)
Cole Dixon :: Copyright 2020
NOTES:
-- added COALESCE() to SELECT in order to filter NULLS for cleaner data return
-- added CASE WHEN THEN to SELECT to further filter the NULLS from the TO Header to TO line for CostCodes
-- aliased all JOINS and added (NOLOCK)
-- changed filt... | true |
a7a51c7c41582a6ad792b58e611ab7e07ab9672b | SQL | aynuwangcong/DormitoryApp | /src/main/db/dorm.sql | UTF-8 | 8,329 | 3.296875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost1
Source Server Version : 50540
Source Host : localhost:3306
Source Database : dorm
Target Server Type : MYSQL
Target Server Version : 50540
File Encoding : 65001
Date: 2021-01-06 20:55:42
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... | true |
d4da50f6ae008b7fedc25fc55b66db3b13aa3170 | SQL | duswl13/MovieWeb-TmdbAPI | /movie2019/WebContent/sql/rating_star.sql | UTF-8 | 997 | 3.71875 | 4 | [] | no_license | DROP TABLE RATING_STAR;
CREATE TABLE RATING_STAR(
MOVIE_ID NUMBER REFERENCES MOVIE (MOVIE_ID),
USER_ID VARCHAR2(40) REFERENCES USERS (USER_ID),
RATING_STAR_value NUMBER CHECK (RATING_STAR_value IN(1,2,3,4,5)),
RATING_STAR_DATE DATE,
CONSTRAINT RATING_STAR_primarykey PRIMARY KEY (MOVIE_ID, USER_ID)
);
INSERT INTO R... | true |
e4da3077604f7e480a88852015674a20bfb5d6be | SQL | marswudk/dungeons-1 | /doc/schema/file.sql | UTF-8 | 785 | 2.75 | 3 | [] | no_license |
CREATE TABLE base_file (
id INTEGER NOT NULL PRIMARY KEY,
parent_id INTEGER NULL,
type INTEGER NOT NULL, -- 1:目錄, 2:檔案
name TEXT NOT NULL,
path TEXT NULL UNIQUE,
size BIGINT NULL,
hash TEXT ... | true |
168a54d2836c3f6846876d8504c7ddcbb43ee3fa | SQL | dhamotharang/SvnGit | /Custom/NDNW/InquiryDetails/Database/Scripts/InsertScriptGlobalCodes_XPRIORITYLEVEL.sql | UTF-8 | 3,999 | 3.34375 | 3 | [] | no_license | /********************************************************************************************
Author : SuryaBalan
ModifiedDate : 04 March 2015
Purpose : Insert/Update script to modify existing GlobalCodes.CodeName[Priority Level] as per the clients requirement for Task 5 Client Inquiries-New Directions ... | true |
58ba01aef1b699b3968f65f3fc87e7cdd2860e35 | SQL | rmainhar/CRUD_1 | /techEdClasses.sql | UTF-8 | 3,327 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 30, 2018 at 07:52 PM
-- Server version: 5.5.57-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... | true |
69b85c964856ad4f851d5d51e5fbb6a7194e7584 | SQL | brendan0913/CS143-Project3 | /load.sql | UTF-8 | 1,926 | 3.234375 | 3 | [] | no_license | DROP TABLE IF EXISTS Laureate;
DROP TABLE IF EXISTS Person;
DROP TABLE IF EXISTS Birth;
DROP TABLE IF EXISTS Organization;
DROP TABLE IF EXISTS Affiliation;
DROP TABLE IF EXISTS Prize;
-- Laureate(lid, nid)
-- Person(lid, givenName, familyName, gender)
-- Organization(lid, orgName)
-- Birth(lid, date, city, country) /... | true |
cfcc3c634340042582268dbc3f4083c722bdc758 | SQL | kitajima213/ecsite | /src/sql/ecsite2.sql | UTF-8 | 6,155 | 2.984375 | 3 | [] | no_license | drop database if exists ecsite2;
create database if not exists ecsite2;
use ecsite2;
drop table if exists login_user_transaction;
create table login_user_transaction(
id int not null primary key auto_increment,
login_id varchar(16) unique,
login_pass varchar(16),
user_name varchar(50),
insert_date dateti... | true |
9b0beb8fef70c5dee7568fad50a0f2316e8711ad | SQL | cs-fullstack-2019-spring/sql-join-cw-autumn-ragland | /Ex7.sql | UTF-8 | 185 | 3.828125 | 4 | [
"Apache-2.0"
] | permissive | -- SQL
-- Show the number of times each person moved.
select name, count(updatedate) as "Number of Times Moved"
from people
inner join address
on address.id = people.id
group by name;
| true |
49d1c2f24768dbe790b6a048a48e554c97a4a4d4 | SQL | pericabartulovic/e-Pernica | /e-Pernica/fpmoz262019.sql | UTF-8 | 8,529 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 01, 2020 at 03:04 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
68d9f15823ae974e267c127920221117cb898758 | SQL | karolsitkowski/Library_mySQL_JDBC | /src/main/resources/data.sql | UTF-8 | 8,567 | 2.78125 | 3 | [] | no_license | INSERT INTO addresses (address, city, postal_code ) VALUES
('Krzesinka 117', 'Poznań', '61-324');
INSERT INTO authors (address_id, first_name, last_name) VALUES
((SELECT LAST_INSERT_ID()), 'Róża', 'Zając');
INSERT INTO addresses (address, city, postal_code ) VALUES
('Rondo Kujawskie 4', 'Bydgoszcz', '85-146');... | true |
9f1d9d113f7ddbb1eca5d4fa18085bce42467359 | SQL | yuriyShevchuk/magnit | /dump.sql | UTF-8 | 57,593 | 3.234375 | 3 | [] | no_license | --
-- PostgreSQL database cluster dump
--
SET default_transaction_read_only = off;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
--
-- Drop databases
--
DROP DATABASE gis;
DROP DATABASE template_postgis;
--
-- Drop roles
--
DROP ROLE postgg;
DROP ROLE postgres;
... | true |
4d879ff46c9ff5ec8c71ebe5cb10538fb02ee7e8 | SQL | rainkid/cron-mysql | /doc/task.sql | UTF-8 | 730 | 2.859375 | 3 | [] | no_license | CREATE TABLE `mk_timeproc_log` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`task_id` int(10) NOT NULL DEFAULT '0',
`result` tinyint(3) NOT NULL DEFAULT '1',
`msg` text NOT NULL,
`run_time` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE `mk_timeproc` (
`id` int(10) ... | true |
7b10c3f26d8f92a3aa2eed664a4befb17b7b48ac | SQL | markkimsal/cognifty | /setup/upgrades/0009_0010/03_new_account.mysql.sql | UTF-8 | 1,422 | 3.3125 | 3 | [
"BSD-3-Clause"
] | permissive | DROP TABLE IF EXISTS `cgn_account`;
CREATE TABLE `cgn_account` (
`cgn_account_id` integer (11) unsigned NOT NULL auto_increment,
`cgn_user_id` integer (11) unsigned NOT NULL,
`firstname` varchar (100) NOT NULL default '',
`lastname` varchar (100) NOT NULL default '',
`title` varchar (12) NOT NULL default '',
... | true |
331c832eccf8739fed02294399ebd9aa1791275d | SQL | Columbia-CRIS/violation-data-analysis | /DataMining/preprocess.mysql | UTF-8 | 2,443 | 4.03125 | 4 | [
"Apache-2.0"
] | permissive | '''This assumes the following tables are downloaded:
1. osha_violation
2. osha_inspection
3. gjf_data (this is their master file shared with us)
4. All corpwatch tables esp. companies.sql, company_info.sql
5. msha_inspection
6. msha_violation
7. msha_assssd_violat... | true |
c3cc3570e7f803f1f392aa9164a13cddd98899d5 | SQL | Shyamswami/cscripts | /sql/sql_patch_tombstones_20180228.sql | UTF-8 | 2,516 | 3.328125 | 3 | [] | no_license | ----------------------------------------------------------------------------------------
--
-- File name: sql_patch_tombstones_20180228.sql
--
-- Purpose: SQL Patch first_rows hint into queries on tombstones table(s).
--
-- Author: Carlos Sierra
--
-- Version: 2018/02/28
--
-- Usage: Execute connec... | true |
cf2c31a196ad7054c50c5fea7a430b2fa430798b | SQL | normyx/myaccount | /src/main/resources/sql/select_monthly_report_data_where_category_between_month-H2.sql | UTF-8 | 3,064 | 4.1875 | 4 | [] | no_license | SELECT
CONCAT(br.account_id,
'-',
br.category_id,
'-',
br.month) AS id,
br.account_id AS account_id,
br.month AS month,
br.category_id AS category_id,
br.category_name AS category_name,
br.budget_amount AS budget_amount,
opr.amount ... | true |
8a7539a4a9b351c1bf18bd905df82bc1cce4d1db | SQL | DerejeDesta/Queen_Anne_Wizard_Shop_SQL | /QAWS-CreateTable.sql | UTF-8 | 6,686 | 4.0625 | 4 | [] | no_license | DROP DATABASE IF EXISTS QAWS ;
CREATE DATABASE QAWS;
USE QAWS;
DROP TABLE IF EXISTS PERSON;
CREATE TABLE PERSON(PersonID INT NOT NULL,
isEmployee CHAR(4) NOT NULL,
isCustomer CHAR(4) NOT NULL,
LastName CHAR(25) NOT NULL,
Fi... | true |
38244f1a081831215be6b089fdeca0b28480b3e0 | SQL | zsbahtiar/mainduluaja | /manajemen/ahptopmm.sql | UTF-8 | 10,803 | 3.09375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 29, 2020 at 08:34 PM
-- Server version: 10.3.22-MariaDB-cll-lve
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... | true |
92ad4d7a70b2c9ed226b9b44c2877968f417c84a | SQL | dmitry212/spendanalysis | /cleanup and labeling.sql | UTF-8 | 4,207 | 3.953125 | 4 | [] | no_license | --set propoer dt format in trans_dt
update transactions set trans_dt =
case
when length(Date) < 10 then
substr(Date,6) || '-0' || substr(Date,1,1) || '-' || substr(Date,3,2)
else
substr(Date,7) || '-' || substr(Date,1,2) || '-' || substr(Date,4,2)
end;
select * from transactions where OriginalDescription like 'Payme... | true |
51478bcbae1069a47e7090779ec9814dd4fd33da | SQL | Darras/PWE | /controledelivros.sql | UTF-8 | 2,651 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 06-Set-2017 às 04:21
-- Versão do servidor: 10.1.10-MariaDB
-- PHP Version: 7.0.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
d55ee01f9d883ab5bec88367365c8e68f2ae295c | SQL | whyndson/pwebtein | /banco/sql.sql | UTF-8 | 539 | 3.109375 | 3 | [] | no_license | create database quiz;
use quiz;
create table usuario(
id int auto_increment,
idade int not null,
peso float not null,
altura float not null,
curso varchar(50) not null,
facilidade varchar(50) not null,
frequenciaCardiaca float not null,
primary key(id)
);
create table re... | true |
220f048f48628d417e4f723a4bd7209976713a97 | SQL | soeun1365/dbstudy | /workspace/spring/src/sql/members.sql | UTF-8 | 636 | 3.421875 | 3 | [] | no_license | drop table boards;
drop table members;
create table members
(
mno number, --회원번호 (시퀀스사용)
mid varchar2(30) not null, --아이디
mname varchar2(30), --이름
memail varchar2(100), --이메일
mdate date --가입일
);
alter table members add constraint members_pk primary key(mno);
alter table members add constraint members_mid_uq... | true |
8f17beb361f2a27c878b5fad12ee845c2a62d4a4 | SQL | bsrafael/sobreareeo | /sobreaereo/sql/2.sql | UTF-8 | 576 | 3 | 3 | [] | no_license |
DROP TABLE IF EXISTS `login`;
CREATE TABLE `login` (
`login_id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(200) NOT NULL,
`password` varchar(32) NOT NULL,
`user_type` varchar(1) NOT NULL DEFAULT 'C',
PRIMARY KEY (`login_id`),
UNIQUE KEY `login_id_UNIQUE` (`login_id`)
) ENGINE=MyISAM AUTO_INCREM... | true |
d66fb46b4a6e205f003cf97312cc1ce4136b8b06 | SQL | Thor-Herman/DatabaseProsjekt | /Filmdb/FilmDBEntries.sql | UTF-8 | 1,002 | 3.09375 | 3 | [] | no_license | alter table skuespiller auto_increment = 1;
alter table selskap auto_increment = 1;
alter table video auto_increment = 1;
alter table person auto_increment = 1;
alter table bruker auto_increment = 1;
alter table episode auto_increment = 1;
insert into bruker (Navn) values ('Per');
insert into bruker (Navn) values ('Ol... | true |
cb66ed390465779c6c3a585efc06a60cb2af1565 | SQL | fenago/Oracle12cCourse | /ora12labs/CR8TBS.SQL | UTF-8 | 559 | 2.796875 | 3 | [] | no_license | /* Create three tablespaces for use by the bigpart.sql script.
-- USER_DATA: Create user sets this as the default tablespace
-- TOOLS: Needed for partitioned table bigpart
-- JERINDX: For indexes
connect system/password
create tablespace user_data
datafile '/depot/user_data01.dbf' size 70M reuse autoextend on
... | true |
4f8a5430ad1cf5e2bfed766bae0253f1016faf25 | SQL | joaquin-martinez/2DAW-DWES-UD3-FILMOGRAFIA | /logins.sql | UTF-8 | 716 | 3.15625 | 3 | [] | no_license | drop database if exists cine ;
create database cine ;
use cine ;
create table peliculas (
id int AUTO_INCREMENT primary key ,
director varchar(128) not null ,
titulo varchar(128) not null ,
fecha datetime not null );
insert into peliculas (director , titulo , fecha ) values ('joaquin','pelicula joaquin parte1','2... | true |
26b115485509d8fa87dd0c4d36181b4f59afa899 | SQL | FELLSAT/Procedimientos | /Procedimientos/Parte 7/H3i_GUARDAR_DX_CONTRAREF.sql | UTF-8 | 496 | 2.578125 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE H3i_GUARDAR_DX_CONTRAREF
-- =============================================
-- Author: FELIPE SATIZABAL
-- =============================================
(
v_CODIGO IN NUMBER,
v_DXPRINCIPAL IN VARCHAR2,
v_DXRELA IN VARCHAR2
)
AS
BEGIN
INSERT INTO CONTRAREF_DIAGNOSTICO
... | true |
53d2f7b98910bb51483ee7d9022ea3e7a8091000 | SQL | BFa-y/algorithm | /学习sql/sql.sql | UTF-8 | 2,425 | 3.90625 | 4 | [] | no_license | use DATEBASE; 选择数据库。
set names utf8; 设置字符集。
-- sql 功能
SQL 面向数据库执行查询
SQL 可从数据库取回数据
SQL 可在数据库中插入新的记录
SQL 可更新数据库中的数据
SQL 可从数据库删除记录
SQL 可创建新数据库
SQL 可在数据库中创建新表
SQL 可在数据库中创建存储过程
SQL 可在数据库中创建视图
SQL 可以设置表、存储过程和视图的权限
-- sql 命令
SELECT - 从数据库中提取数据
SELECT column_name,column_name FROM table_name; --根据字段查询
SELECT * FROM table... | true |
7bd51f25643fab682da507be2797034735ae9da8 | SQL | flash8627/icustom-boot | /documents/db script/SYS_HTML_AREA_T.sql | GB18030 | 1,941 | 3.546875 | 4 | [
"Apache-2.0"
] | permissive |
-- Drop SEQUENCE
declare
v_num number;
begin
select count(*)
into v_num
from user_sequences
where sequence_name = 'SYS_HTML_AREA_S';
if v_num > 0 then
execute immediate 'drop SEQUENCE SYS_HTML_AREA_S';
end if;
end;
/
-- Create sequence
create sequence SYS_HTML_AREA_S
minvalue 1
maxvalue 99999... | true |
3df6c98acbe71a09adb58094f9349bcfa6a29026 | SQL | SophiaL1024/BootcampX | /3_queries_group_by/2_large_cohorts.sql | UTF-8 | 203 | 4.03125 | 4 | [] | no_license | SELECT cohorts.name as cohort_name,count(students.*) as student_count
FROM cohorts
JOIN students ON students.cohort_id=cohorts.id
GROUP BY cohort_name
HAVING count(students.*)>=18
ORDER BY student_count; | true |
49bb097a28d0f858aa0df2db41cd471c5b637b68 | SQL | swhufnagel/Bamazon | /bamazon.sql | UTF-8 | 972 | 3.640625 | 4 | [] | no_license | DROP DATABASE IF EXISTS amazon;
CREATE DATABASE amazon;
USE amazon;
CREATE TABLE products(
item_id INT AUTO_INCREMENT,
product_name VARCHAR(30) NOT NULL,
department_name VARCHAR(30) NOT NULL,
price DEC(10,2) NOT NULL,
stock_quantity INT NOT NULL,
PRIMARY KEY(item_id)
);
INSERT INTO products(product_name,department_... | true |
f4552dcff3826dad83e9dd9ff58865b971e46fa2 | SQL | tdarkscorpion/Talisman-server-files-clean | /DB__/db_account.sql | UTF-8 | 13,381 | 2.6875 | 3 | [] | no_license | # MySQL-Front 3.2 (Build 6.2)
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET CHARACTER SET 'utf8' */;
# Host: 192.168.52.128 Database: db_acc... | true |
d5613acee1c637ddbfe7e16d1101283beca5c2dc | SQL | vitalij-vladimirov/custom-skeleton-with-permissions-control | /src/database/Migration/003_create_role_permission_table.sql | UTF-8 | 648 | 3.703125 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS `role_permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uuid` varchar(36) NOT NULL,
`role_id` int(11) NOT NULL,
`permission` varchar(128) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP(),
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE... | true |
cf6a76a03e91873cfc4bbd2084c495f7e98a5bb9 | SQL | Annilla/TSQL20181022 | /20181022/5.SELECT.sql | UTF-8 | 595 | 3.265625 | 3 | [] | no_license | USE TSQL;
SELECT companyname, country
FROM Sales.Customers;
SELECT * FROM Sales.Customers;
SELECT unitprice, qty, unitprice * qty AS total
FROM Sales.OrderDetails;
SELECT empid, lastname, hiredate, YEAR(hiredate) AS yr
FROM HR.Employees;
SELECT country
FROM Sales.Customers;
SELECT DISTINCT country
FROM Sales.Cus... | true |
f88a565a0b10025d52f82fd9bc35175ae9e6b188 | SQL | corinaceausu04/Database-Project | /spital.sql | UTF-8 | 8,163 | 2.984375 | 3 | [] | no_license | CREATE TABLE Saloane (
numar_salon int,
tip varchar(10) not null,
nr_locuri int,
PRIMARY KEY (numar_salon)
);
CREATE TABLE Asistenti (
id_asistent int,
nume varchar(30) not null,
prenume varchar(30) not null,
email varchar(50) not null unique,
nr_telefon varchar(10) not null unique,
da... | true |
d25fedd542a4f804a5576de72a1bd3e878e80248 | SQL | mariocelic/Tecaj | /vrtic0805.sql | UTF-8 | 948 | 3.484375 | 3 | [] | no_license | drop database if exists vrtic;
create database vrtic default character set utf8;
use vrtic;
create table odgajateljica(
sifra int not null primary key auto_increment,
osoba int not null,
strucna_sprema varchar(50) not null,
iban char(34)
);
create table osoba(
sifra int not null primary key auto_increment,
ime varcha... | true |
219b916fc40801209f224bec1099f76ffabc6b4a | SQL | pranjaldeka/csc540-dbms-library | /packages/renew_pkg.sql | UTF-8 | 4,354 | 3.5 | 4 | [] | no_license | /***********************************************************************************
renew_pkg.sql : Renew a resource if no one in queue for that resource for that library
*************************************************************************************/
set serveroutput on;
CREATE OR REPLACE PACKAGE renew_pkg AS ... | true |
d531f2d6780b78c7b504f8e99d9308bbb533d2c5 | SQL | AjinkyaBangale2/Leetcode-SQL-Solutions | /1709 Biggest Window Between Visits.sql | UTF-8 | 837 | 4.40625 | 4 | [
"MIT"
] | permissive | # https://leetcode.com/problems/biggest-window-between-visits/
-- sort the dates for each user_id -> find diff of day between each consecutive visit
-- if next date is null then sub the date from '2021-01-01'
-- find the max of dates
SELECT user_id, max(wind) as biggest_window
FROM (SELECT
user_id,
IFNULL(DAT... | true |
6453011bb8ddd4c94cba79ff72aa390d9948978b | SQL | IDS-V-Quangpt/hrms | /src/main/resources/ddl/leave.sql | UTF-8 | 434 | 2.546875 | 3 | [] | no_license | CREATE TABLE `leave` (
`id` INT NOT NULL AUTO_INCREMENT,
`user_id` INT NOT NULL,
`leave_day` DATE NOT NULL,
`from` FLOAT NOT NULL,
`to` FLOAT NOT NULL,
`comment` VARCHAR(2000) CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_vietnamese_ci' NULL,
`approve` BOOLEAN,
`approve_user_id` INT,
`approve_comment` VARC... | true |
ead81435ef1a0cb0d7996c75d961c89a79a237fd | SQL | carolkes/AulaDia1 | /Script_SQL/ExercicioSalarioFuncionario/SQLQuery2.sql | UTF-8 | 423 | 2.59375 | 3 | [] | no_license | insert into Salarios -- aqui adicionamos o salário que cada funcionario
-- cadastrado anteriormente recebeu nos meses 7,8,9
(FuncionarioId,Valor,DataCriacao)
values
(2,1200,'07/05/2019'),(2,1250,'08/07/2019'),(2,1160,'09/06/2019'), -- Caroline
(3,1230,'07/05/2019'),(3,1150,'08/07/2019'),(3,1155,'09/06/2019'), -- Cami... | true |
bd9e59991cf2b994ceab35c2766641420d5fafb1 | SQL | alecrmeyer/Fall2020 | /Fall2020/COMS363/Homework2/alecrm4Q1.sql | UTF-8 | 1,375 | 4.1875 | 4 | [] | no_license | -- Alec Meyer
-- part a.
SELECT
COUNT(*) AS numOfIngredient
FROM ingredient;
-- part b.
SELECT f.fid, f.fname
FROM food f
INNER JOIN recipe r ON f.fid = r.fid
INNER JOIN ingredient i ON r.iid = i.iid
WHERE i.iname = 'Green Onion' AND f.fid IN
(SELECT f.fid
FROM food
INNER JOIN recipe r ON f.fid = r.fid
INN... | true |
35299d22e7f24a84d073225ddcefcdf8637f4079 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day21/select0315.sql | UTF-8 | 267 | 3.140625 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='Thermometer' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['5019','2054','6046','4072','5202','4028','3066','4029','2064','6066'])
| true |
80ba2fcd95483bb36a75cdb380e5bacabdfdee58 | SQL | point/cassea | /docs/ltc/ltc.sql | UTF-8 | 515 | 2.96875 | 3 | [] | no_license | SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Table structure for table `ltc`
--
DROP TABLE IF EXISTS `ltc`;
CREATE TABLE IF NOT EXISTS `ltc` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`language` int(11) NOT NULL,
`key` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
`value` ... | true |
5286faea30987ef8e0ebefbe832929f543ddd7c2 | SQL | alexendrios/automacao | /ath-projeto-webscrap-sonar/criacao_db_projetos_qa.sql | UTF-8 | 879 | 3.125 | 3 | [] | no_license |
drop database qa_bb_projetos_sonar;
CREATE DATABASE qa_bb_projetos_sonar;
use qa_bb_projetos_sonar;
create table qa_projetos(
ID int auto_increment not null,
SIGLA varchar(10) not null,
QA varchar(50) not null,
DATA_EXTRACAO varchar(10) not null,
HORA_EXTRACAO varchar(10) not null,
PROJETO varcha... | true |
0cdabd1d59788c6a10e16856f491940cc9fce270 | SQL | jkusner/cse241-databases-finalproject | /sql/procedures/finish_online_transaction.sql | UTF-8 | 1,666 | 3.28125 | 3 | [] | no_license | create or replace procedure finish_online_transaction
( trans_id in number,
tax_rate in number,
pmt_mthd_id in number,
est_arrival_date in timestamp,
pickup_order_name in varchar,
pickup_order_loc in number,
shipping_address in number,
track_num in varchar,
tot out nu... | true |
207facb5a0cf3c49fcd29412e48c278e6c9ab8ac | SQL | a-218/BootcampX | /3_queries_group_by/average_completion_time.sql | UTF-8 | 246 | 3.859375 | 4 | [] | no_license | SELECT students.name as student, AVG(duration) as average_assignment_duration
FROM assignment_submissions
JOIN students ON students.id = assignment_submissions.student_id
WHERE end_date IS NULL
GROUP BY students.name
ORDER BY AVG(duration) DESC; | true |
3289d3aab53430a3168a80c0f2bcedd1ada5026e | SQL | aerwemi/SQL_Sakila-database-queries | /SQL_Sakila-database-queries.sql | UTF-8 | 9,580 | 4.5625 | 5 | [] | no_license | USE sakila;
-- * 1a. Display the first and last names of all actors from the table `actor`.
SELECT first_name, last_name
from actor;
-- * 1b. Display the first and last name of each actor in a single column in upper case letters. Name the column `Actor Name`.
SELECT CONCAT(first_name, ' ', last_name) AS ... | true |
c6571cf693020afd4b6a2f9d3253b3a6b80d58de | SQL | b3b0y/wlcfilerepository | /Database/repository.sql | UTF-8 | 18,201 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 03, 2015 at 06:21 PM
-- Server version: 5.5.8
-- PHP Version: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SE... | true |
6d51e0c9c4eabe7dff20b918f0f0bdbe2b7a70c4 | SQL | thistimeonly32/fastcode | /fastcode/src/main/resources/fast_code.sql | UTF-8 | 1,449 | 2.78125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Oct 02, 2018 at 06:46 AM
-- Server version: 5.7.23-0ubuntu0.18.04.1
-- PHP Version: 7.2.10-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
b7d4f06fe14b65e5b167da27b926d27cf04ef1d5 | SQL | puzzlecollector/hackerrank | /sql/weather_observation_station_9.sql | UTF-8 | 309 | 2.640625 | 3 | [] | no_license | /*
Enter your query here.
*/
SELECT
DISTINCT CITY
FROM
STATION
WHERE
LEFT(CITY,1) != 'a' AND LEFT(CITY,1) != 'e' AND LEFT(CITY,1) != 'i' AND LEFT(CITY,1) != 'o'
AND LEFT(CITY,1) != 'u' AND LEFT(CITY,1) != 'A' AND LEFT(CITY,1) != 'E' AND LEFT(CITY,1) != 'I' AND LEFT(CITY,1) != 'O' AND LEFT(CITY,1) != 'U'
| true |
18c055a0989adb061fb938113f95bed307d15cbf | SQL | lunf/lois | /src/main/resources/start_up_script.sql | UTF-8 | 2,387 | 3.484375 | 3 | [] | no_license | DROP TABLE IF EXISTS lf_user;
CREATE TABLE IF NOT EXISTS lf_user (
id BIGINT primary key GENERATED ALWAYS AS IDENTITY,
username VARCHAR(1024) NOT NULL UNIQUE,
first_name VARCHAR(128),
last_name VARCHAR(128)
);
INSERT INTO lf_user (username, first_name, last_name) VALUES ('john.doe@domain.com', 'John'... | true |
d6c0ab0d9d2c0407a8c64524b02223dd1cacc79d | SQL | mars1317/Cassandra-laboratory-works | /Laboratory1/work.cql | UTF-8 | 11,670 | 3.46875 | 3 | [] | no_license | // 3.1 CREATE DATA
insert into dbbuilder.users (username, password) values ('artemkovtun', '5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5');
insert into dbbuilder.users (username, password) values ('supermario', '5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5');
insert into dbbui... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.