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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22b55158326c71ffc8b2ab10ef25bcbce3b3969e | SQL | KDCuong/LapTrinhJava | /professionaltoeic.sql | UTF-8 | 16,468 | 3.125 | 3 | [] | no_license | /*
SQLyog Community v12.5.0 (64 bit)
MySQL - 5.7.22-log : Database - professionaltoeic
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CH... | true |
03fcb4e290816d4d278718c89d803f514c7dc4c0 | SQL | ksm4319/sumin_rep | /2020-01-14.sql | UHC | 15,066 | 4.15625 | 4 | [] | no_license | -- 迭(INDEX BY ̺)
--Į: Į ¥
--ڵ: Į
set serveroutput on;
declare
--Ÿ
--PLS_INTEGER BINARY_INTEGER NUMBER
type enameArr is table of
employees.last_name%type
index by PLS_INTEGER;
type enameArr2 is table of
employees.last_name%type
index by BINARY_INTEGER;
type enam... | true |
1f496a5e8d8f1e5c4bdc477473d9405db3da968c | SQL | Cefigueredo/SQL-Project | /Proyecto/Iteracion 3/Insertar_datos_para_pruebas.sql | ISO-8859-1 | 23,593 | 2.890625 | 3 | [] | no_license | --@Estados posibles
INSERT INTO ESTADOS_POSIBLES (ID, DESCRIPCION)
VALUES (1, 'EN_ESPERA');
INSERT INTO ESTADOS_POSIBLES (ID, DESCRIPCION)
VALUES (2, 'PENDIENTE_DE_CONTACTAR');
INSERT INTO ESTADOS_POSIBLES (ID, DESCRIPCION)
VALUES (3, 'NO_QUIERE_VACUNARSE');
INSERT INTO ESTADOS_POSIBLES (ID, DESCRIPCION)
VALUES (4, ... | true |
c227c611d10f3d6a37711e0be1261a1538dd59c7 | SQL | jorgelizandro/messaging-app | /sql/testdb.sql | UTF-8 | 1,117 | 3.625 | 4 | [] | no_license | -- Create database
CREATE DATABASE testdb;
\connect testdb;
-- Create tables
CREATE TABLE user_account (
uid SERIAL PRIMARY KEY,
nickname VARCHAR(50) UNIQUE NOT NULL,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE message (
... | true |
60c96d37f84f9e3167c7909bccc82d5f78261034 | SQL | avmakarenko/test-project-robofinance | /src/main/resources/db/address.sql | UTF-8 | 543 | 3.375 | 3 | [] | no_license | --liquibase formatted sql
--changeset init:address runOnChange:true
--preconditions onFail:MARK_RAN
--preconditions-sql-check expectedResult:0 select count(1) from information_schema.tables WHERE table_schema = 'public' AND table_name = 'address'
CREATE TABLE address (
id bigserial NOT NULL,
country varchar(255),... | true |
7d60d0c000d57e634a13f34b5fbdb8df0e3bc49b | SQL | kjkraus/CS6252-Web-Technologies-II | /CS 6252 Web Technologies II/Lab Creating Database Tables/little_library.sql | UTF-8 | 5,995 | 3.375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 07, 2018 at 03:09 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
d288f25fda8fd7c169b4e250b8f909e22f740c91 | SQL | Cubaka14/Baza-sluzba-iznosenja-smeca | /Vozac_AUPD.sql | UTF-8 | 251 | 2.953125 | 3 | [] | no_license | CREATE DEFINER = CURRENT_USER TRIGGER `mydb`.`Vozac_AFTER_UPDATE` AFTER UPDATE ON `Vozac` FOR EACH ROW
BEGIN
IF new.zauzet <> old.zauzet
THEN
UPDATE Kamion k
SET k.zauzet=new.zauzet
WHERE new.Kamion_idKamion = k.idKamion;
END IF;
END | true |
de5586cede531f855204adca9c9749605207c7d5 | SQL | KatrinKurii/lab3_bd | /create3.sql | UTF-8 | 433 | 2.625 | 3 | [] | no_license | delimiter $$
create procedure upd()
begin
update facts set amount=floor(rand()*10) where fid=18;
end;
$$
delimiter $$
create trigger trig1 before update on ware
for each row begin
update facts set amount=OLD.wid where facts.wid=OLD.wid;
end;
$$
delimiter $$
create event evnt1 on schedule every 1 minute
do
call upd();
... | true |
ac40487b1e20a4a341b91047cecede13f00eec94 | SQL | brookinsconsulting/remoting | /examples.amfphp/recordset/table.sql | UTF-8 | 726 | 2.59375 | 3 | [] | no_license | CREATE TABLE person (
first_name varchar(20),
last_name varchar(20),
age int(3),
uid int(2),
PRIMARY KEY (uid)
);
INSERT INTO person ( first_name, last_name, age, uid )
VALUES ( 'Dupond', 'Lajoie', 55, 1 );
INSERT INTO person ( first_name, last_name, age, uid )
VALUES ( 'Julie', 'Petite... | true |
bc9d7bbd1600a52b7addacd3fe4f56e2e89e934e | SQL | dinukanadeeshan/LandRegistry-V-1.1- | /Others/database.sql | UTF-8 | 8,435 | 3.59375 | 4 | [] | no_license | /* Version 1.2 */
create database LandRegistry;
use LandRegistry;
create Table Notry(
notryCode varchar(15) not null,
appointedFileNo varchar(20) ,
name varchar(50) not null,
privateAddress varchar(100),
officeAddress varchar(100) not null,
notryOrJudge varchar(10),
dateOfAppointment date,
mobileNo varchar(10),... | true |
2ed594a633ad79f084224b72689478e98c8bff9e | SQL | hqottsz/MXI | /assetmanagement-database/src/upgrade/plsql/lib/liquibase/8/1/0/0/sql/OPER-215.sql | UTF-8 | 1,299 | 3.34375 | 3 | [] | no_license | --liquibase formatted sql
--changeSet OPER-215:1 stripComments:false
-- Adding ALT_ID UUID to INV_LOC_STOCK
/*************************************************************************
* Addition of UUIDs for entities required by views for report
*************************************************************************... | true |
bb949e8ab1a335aaaa3b1329a32701064bf1853b | SQL | Don-Stevenson/LightBnB | /1_queries/all_my_reservations.sql | UTF-8 | 450 | 3.828125 | 4 | [] | no_license | SELECT properties.id, properties.title, properties.cost_per_night, reservations.start_date, avg(property_reviews.rating) as average_rating
FROM reservations
JOIN properties ON reservations.property_id = properties.id
JOIN property_reviews ON properties.id = property_reviews.property_id
WHERE reservations.guest_id ... | true |
5fa8511a8ad589b9c996c631e2e04a665c8ad304 | SQL | tataroluu/I2I-INTERNSHIP-APPLICATIONS | /PL-SQL/UNI&PROCEDURE.sql | UTF-8 | 1,028 | 3.1875 | 3 | [] | no_license | DECLARE
vs_first_name SUMMER_INTERN.FIRST_NAME%TYPE;
vs_university_name SUMMER_INTERN.UNIVERSITY_NAME%TYPE;
BEGIN
vs_first_name :='SERVET';
SELECT
UNIVERSITY_NAME
INTO
vs_university_name
FROM
SUMMER_INTERN
WHERE
FIRST_NAME = vs_first_name;
DBMS_OUTPUT.PUT_LINE
(
'universit... | true |
39a47bad23612202fda65f8971e1651e834d00f7 | SQL | nir-sopher/incubator-trafficcontrol | /traffic_ops/experimental/server/db/schema.sql | UTF-8 | 31,562 | 3.140625 | 3 | [
"Apache-2.0",
"ISC",
"GPL-1.0-or-later",
"OFL-1.1",
"X11",
"LicenseRef-scancode-unknown-license-reference",
"WTFPL",
"MIT",
"BSD-3-Clause",
"LGPL-2.0-or-later"
] | permissive | /*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distri... | true |
a71e5f1b9e30a3e81469f64cb6d9afa30dc2a8df | SQL | captainabap/SQLScript_for_SAP_HANA | /Listings/Chapter 2/EN_Listing 2.3.sql | UTF-8 | 756 | 2.875 | 3 | [] | no_license | -- Listing 2.3.sql
-- Example for literals in the sourcecode
SELECT 'Jörg' AS string,
N'Jörg' AS unicode,
x'fff' AS binary,
-10 AS integer,
- 1.2345 AS decimal,
... | true |
61959afff6e95ebf63e0343b15a073d2831508f8 | SQL | Pushpanayak/Hospital-Managament-System | /hms.sql | UTF-8 | 13,106 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 25, 2019 at 10:49 AM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
f444e26b92c97f5f26c5419d8c4c3b91f7663c45 | SQL | paul-rogers/drill-test-framework | /framework/resources/Functional/limit0/functions/data/case.sql | UTF-8 | 1,781 | 3.78125 | 4 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | select
case when substr(o.c_varchar, 1, 2) = '00' then 'x' else cast(null as varchar(10)) end,
case when substr(r.c_varchar, 1, 2) = '00' then 'y' else cast(null as varchar(10)) end,
coalesce(case when substr(o.c_varchar, 1, 2) = '00' then 'x' else cast(null as varchar(10)) end,
case when substr(r.... | true |
1bee1ac393004f7fb58cd1dca04858a61ad38b15 | SQL | Mark-Kamitz/FE21-CR11-MarkusKamitz | /SQL/fswd13_cr11_petadoption_markuskamitz.sql | UTF-8 | 5,701 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Erstellungszeit: 21. Aug 2021 um 16:43
-- Server-Version: 10.4.20-MariaDB
-- PHP-Version: 8.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... | true |
2804b842672f4ce632e84a3816325451625145c9 | SQL | ontargetrepo/onTargetAPI | /src/DB/trigger_addition(18 Oct)/triggers.sql | UTF-8 | 14,008 | 3.65625 | 4 | [] | no_license | /*
SQLyog Ultimate v11.33 (64 bit)
MySQL - 5.5.43-0ubuntu0.14.04.1 : Database - ontarget
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD... | true |
f95af7a80c1c655d9dc8840c2f779a412f21b6b6 | SQL | omeround3/OracleDB_Course_Project | /DB_Files/Views/APARTMENTS_TOTAL_RATES.sql | UTF-8 | 537 | 3.15625 | 3 | [] | no_license | --------------------------------------------------------
-- File created - Friday-September-03-2021
--------------------------------------------------------
--------------------------------------------------------
-- DDL for View APARTMENTS_TOTAL_RATES
--------------------------------------------------------
CR... | true |
8c424ffbeea0af20f5d541be6a40d8cd81f4c7dc | SQL | Akhila499/BootcampX | /4_queries/total_student_assistance_request.sql | UTF-8 | 206 | 3.515625 | 4 | [] | no_license | SELECT students.name AS name, count(assistance_requests.id) AS total_assistances
FROM assistance_requests
JOIN students ON students.id = student_id
GROUP BY students.name
HAVING students.name = 'Elliot Dickinson';
| true |
efbf7f885f420ec080e5eb706aa54db1ec67a59c | SQL | giserh/Simple-Taxi-Database-System | /Database/SQL Queries/SQLQuery4.sql | UTF-8 | 199 | 3.03125 | 3 | [] | no_license | SELECT c.cID, c.cTitle, c.cFirstName, c.cLastName, j.jID, j.jPickupAddressLine1, j.jPickupAddressLine2, j.jPickupCity, j.jPickupPostcode
FROM Customer c, Job j
WHERE c.cID=j.cID AND c.cTitle='mr'; | true |
6ff8d4665f29d5b23b3dab62b2888ce9f9b0d8b7 | SQL | Abhinav-db/toolbox | /top_seg_history.sql | UTF-8 | 2,618 | 4.40625 | 4 | [] | no_license | -- for the current top 10 segments (by size) list the history of the space used / allocated delta per day for the past month.
-- as dba_hist_seg_stat does not contain all segments, but only the ones that oracle determines to to be interesting, the history may be lacking or incomplete for some of the segments
-- also, d... | true |
e24a1c6864dfa105e7597a584acc8db4118f2519 | SQL | JeremyDps/todolist_php_ajax | /todo-list.sql | UTF-8 | 2,688 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : Dim 07 juin 2020 à 13:19
-- Version du serveur : 5.7.26
-- Version de PHP : 7.2.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... | true |
0f0baead8587c908185a840aad2cb7035b26a903 | SQL | BaobabHealthTrust/migration_imports | /triggers/states_after_insert.sql | UTF-8 | 2,516 | 4.125 | 4 | [] | no_license | DELIMITER $$
DROP TRIGGER IF EXISTS `states_after_insert`$$
CREATE TRIGGER `states_after_insert` AFTER INSERT
ON `patient_state`
FOR EACH ROW
BEGIN
SET @patient_id = (SELECT patient_id FROM patient_program
LEFT OUTER JOIN patient_state ON patient_program.patient_program_id = patient_state.patient_program... | true |
4e3145febcf9a538fe109d855af3fa2cb286e3c0 | SQL | cianfich1016/Employee-Management-System | /db/schema.sql | UTF-8 | 1,467 | 4.53125 | 5 | [
"MIT"
] | permissive | --Delete database if exists and create new--
DROP DATABASE IF EXISTS employee_db;
CREATE DATABASE employee_db;
--Use this database--
USE employee_db;
--Delete table if exists and create table with two parameters id and department_name and primary key id--
DROP TABLE IF EXISTS department;
CREATE TABLE department (
... | true |
ef85720ce365db1df3bda444a084ed64dda06d7c | SQL | developerzone/EurekaClientServerZuul | /catalog/src/main/resources/data.sql | UTF-8 | 574 | 2.640625 | 3 | [] | no_license | --Inserting into USER Table
--INSERT INTO
-- T_PRODUCT (id, type,name,description)
--VALUES
-- ('BOOK_1', 'BOOK','Book1','Book1 Description'),
-- ('BOOK_2', 'BOOK','Book2','Book2 Description'),
-- ('BOOK_3', 'BOOK','Book3','Book3 Description'),
-- ('BOOK_4', 'BOOK','Book4','Book4 Description'),
-- ('BOOK_5', ... | true |
3a66370ab06f8c8348d1cfdca1eb601ac69059eb | SQL | RyanMKrol/SkyTracker | /Go/sql/database_setup/FrequencyLookup.sql | UTF-8 | 298 | 2.609375 | 3 | [] | no_license | DROP TABLE FrequencyLookup;
CREATE TABLE FrequencyLookup (
FLID int NOT NULL AUTO_INCREMENT,
FLDays INT NOT NULL UNIQUE,
PRIMARY KEY(FLID)
);
INSERT INTO FrequencyLookup (FLDays) VALUES (1);
INSERT INTO FrequencyLookup (FLDays) VALUES (7);
INSERT INTO FrequencyLookup (FLDays) VALUES (30);
| true |
cb37bcaed80da01c24f0e6aba73a42611ae1f9ef | SQL | raularias86/TSQL-Normal | /Pagos de Boleta en Efectivo.sql | UTF-8 | 785 | 3.203125 | 3 | [] | no_license |
select A.FCH_PROC, A.TRAVDM MES, A.TRAVDD DIA, A.TRABTH LOTE_PORTAL, A.TRAACC NO_CUENTA,
TRACDE NMONICO_PORTAL, TRANEM TIPO_TRX, TRAAMT MONTO_TRX, --max(fch_proc)
B.ESTATUS, B.FECHA_CREACION, B.PRODSIG, B.DESCPRODSIG, B.NUMUNICO, C.BD_CLIENTE,
BK_AREA_FINANCIERA, BD_AREA_FINANCIERA, BK_EJE... | true |
90a2b9826bc7262c4fc604447fca6f992a8a903c | SQL | kevin820422/practice | /pro_cherchef.sql | UTF-8 | 10,519 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- 主機: 127.0.0.1
-- 產生時間: 2019 年 03 月 15 日 10:50
-- 伺服器版本: 10.1.37-MariaDB
-- PHP 版本: 7.1.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... | true |
beeeb1a8a6403eff72160ba47528e3b51469de8c | SQL | ClickHouse/ClickHouse | /tests/queries/0_stateless/01109_sc0rp10_string_hash_map_zero_bytes.sql | UTF-8 | 542 | 3.5 | 4 | [
"Apache-2.0",
"BSL-1.0"
] | permissive | -- Test that the string hash map works properly with keys containing zero
-- bytes.
-- Keys with no central '1' are mostly duplicates. The unique keys
-- in this group are '', '\0', ...., '\0 x 34', to a total of 35. All other
-- keys are unique.
select count(*) = 18 * 18 * 17 + 35
from (
select key
from (
... | true |
8d7d9a994002de71ae7a74fc91cfb3986461865d | SQL | VB6Hobbyst7/vault_repo | /DalWorth/Server/Dalworth.Server/Database/Alter/2009-01-14.sql | UTF-8 | 213 | 2.6875 | 3 | [] | no_license | ALTER TABLE `Task` ADD COLUMN `ReadyDate` DATETIME default NULL AFTER `DiscountPercentage`;
update Task
set ReadyDate = Modified
where TaskTypeId = 2 and TaskStatusId = 1 and IsReady = 1 and DumpedTaskId is null; | true |
96d794225a9f0804cf0be4ba4f34ca12bf552fbf | SQL | kevinchan987/csci4140project | /test/chatroom.sql | UTF-8 | 3,966 | 3.046875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- 主機: 127.0.0.1
-- 產生時間: 2019-05-15 20:10:26
-- 伺服器版本: 8.0.16
-- PHP 版本: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
7f8341b05de2f7567193672265872a06d8c94cf1 | SQL | terminological/etl-analysis | /ordercomms-analysis/sql/tmpRequestResultXmap.sql | UTF-8 | 4,121 | 4 | 4 | [] | no_license | Use ordercomms_review;
-- THIS is investigations into how to map requests to results
-- actually I dont need to do this, as the analysis doesn't require it.
-- basically this set of queries show that the id_from_lims and id_from_source
-- are preserved for microbiology but not for blood tests
-- clinician ids a... | true |
3e1838206356c7dafd06e80c96bede54cc8c90bc | SQL | jonhpowell/samples | /misc_code/sql/bigquery/acct_work_type_last_period_dur.sql | UTF-8 | 11,982 | 4.3125 | 4 | [] | no_license | #standardSQL
# Initial Account History Features, V1: ticket DURATION for last 1, 4, 16 and 30 weeks for the same acccount
# Start by getting the difference from 2016-06-01 in hours (some rounding, but not as bad as weeks) and
# then go back that many hours counting.
#
# Algorithm:
# 1. Build acct name, work type,... | true |
3c03fe0efd96314bc00e30d294f7a0194888e58c | SQL | datafaust/pitapal-db | /database/init.sql | UTF-8 | 6,761 | 3.5625 | 4 | [] | no_license | CREATE DATABASE pitapaldb;
USE pitapaldb;
SET SQL_SAFE_UPDATES = 0;
ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY 'password';
flush privileges;
CREATE TABLE city (
id int,
city_name varchar(255),
zip_code int
);
INSERT INTO city (id, city_name, zip_code)
VALUES
(1,'New York', 11368),
(1,'New York... | true |
44995d490de326719c64434c541a744450bed703 | SQL | Ruiruiruix3/SQL_Tutorial | /SQL_Alex The Analyst_Tutorial.sql | UTF-8 | 9,019 | 4.03125 | 4 | [] | no_license | /*Create table for employee demographic and salary*/
CREATE TABLE EmployeeDemographics (
EmployeeID int,
FirstName varchar(50),
LastName varchar(50),
Age int,
Gender varchar(50)
)
CREATE TABLE EmployeeSalary(
EmployeeID int,
Jobtitle varchar(50),
Salary int
)
/*Insert info into each tables*/
INSERT ... | true |
f499a2ceb8fa9e034cebdf2da6eda1f0e870c1bd | SQL | faithcomesbyhearing/dbp-etl | /database/Logging.sql | UTF-8 | 1,058 | 2.9375 | 3 | [
"MIT"
] | permissive |
CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL,
`argumen... | true |
143bab2bf9da0c30cfeafa663a086ddf4d755cbb | SQL | Andrew174194/S21_DataBases_group2-9 | /Week 6/queries.sql | UTF-8 | 846 | 4.21875 | 4 | [] | no_license | -- first query
explain (verbose, analyze) select title from film where ((rating='R' or rating='PG-13') and film_id in (select film_id from film_category where (category_id=11 or category_id=14)) and film_id not in (select film_id from inventory where inventory_id in (select inventory_id from rental)));
-- second query... | true |
9e074ea01008e48ea89cdcb1d3d2d0a89f5eea29 | SQL | jdmonroyr/py_demo_amx | /scripts/triggers.sql | UTF-8 | 933 | 3.21875 | 3 | [] | no_license | --Script for trigger creation
CREATE TRIGGER "EMPLOYEE_CREATE"
AFTER INSERT ON "EMPLOYEE"
REFERENCING NEW AS NEW_EMP
FOR EACH ROW
INSERT INTO "EVENTS" (OBJECT_KEY, OBJECT_VERB, OBJECT_NAME, EVENT_PRIORITY, EVENT_TIME, EVENT_STATUS, EVENT_COMMENT)
VALUES (NEW_EMP.EMPLOYEEID, 'CREATE', 'EMPLOYEE', 1, (SELECT... | true |
e4e6442cf687e91b0b7d9e2795fa5fe90603f959 | SQL | JeongYunu/SQL | /Ex/Ex02.sql | UTF-8 | 5,154 | 4.21875 | 4 | [] | no_license | /*where절*/
--NULL
select first_name,
salary,
commission_pct,
salary*commission_pct
from employees
where salary between 13000 and 15000;
select first_name,
salary,
commission_pct
from employees
where commission_pct is not null;
--예제) 커미션비율이 있는 사원의 이름과 연봉 커미션비율을 출력하세요
... | true |
39874273c5ea62c2cd81f6bb32b63745528a6955 | SQL | ramanza/Cookies | /setup/create_db.sql | UTF-8 | 7,318 | 3.71875 | 4 | [] | 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='TRADITIONAL';
DROP SCHEMA IF EXISTS `Webshop` ;
CREATE SCHEMA IF NOT EXISTS `Webshop` DEFAULT CHARACTER SET utf8 ;
USE `Webshop` ;
-- ---------------... | true |
e1c53bff905d792742fdb70fb94016383ca2e49c | SQL | jarcherTechtonic/Competencies-Demo | /insert.sql | UTF-8 | 1,813 | 2.765625 | 3 | [] | no_license | -- INSERT STATEMENTS for the drinks table
INSERT INTO chez_moose.drinks (drink_id, drink_type, drink_name, expires, number_of_units)
VALUES ("1", "alcohol", "Mooses IPA", "2021-09-30", "30");
INSERT INTO chez_moose.drinks (drink_id, drink_type, drink_name, expires, number_of_units)
VALUES ("2", "juice", "OJ", "2021-... | true |
8bfa13941621419fc16cb25597964daaa99580fa | SQL | pthanasou/texlog | /base.sql | UTF-8 | 4,574 | 3.140625 | 3 | [] | no_license |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Βάση: `base`
--
... | true |
aac9aacaeb69ed24637e8462a6f56f4da0f2781b | SQL | ramjanali-dsi/authorization_service | /init-script/foreign_key.sql | UTF-8 | 1,471 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | alter table dsi_user add constraint UK_userEmail unique (email);
alter table dsi_api add constraint FK_apiSystemId foreign key (system_id) references dsi_system (system_id);
alter table dsi_default_api add constraint FK_defaultApiId foreign key (api_id) references dsi_api (api_id);
alter table dsi_menu_api add cons... | true |
08fcc3c38d28d86e21b385c80f17087e23f7a8d9 | SQL | vmmrahul/2k19-projects | /SQL/restaurantbilling (1).sql | UTF-8 | 6,095 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 22, 2020 at 07:14 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
94a9c7320320668df25febad55776b201b3059dd | SQL | lsm2333/leetcode-solution | /src/main/mysql/182-duplicate-emails.sql | UTF-8 | 235 | 3.484375 | 3 | [] | no_license | #https://leetcode-cn.com/problems/duplicate-emails/description/
select Email
from Person
group by Email
having count(distinct Id)>1
#select distinct p1.Email
#from Person p1
#join Person p2
#on p1.Email = p2.Email
#and p1.Id <> p2.Id
| true |
9124d193323c86bea10fc0976373830efa82bb7d | SQL | Zidanermn/web_gumcode | /db_gumcode.sql | UTF-8 | 7,413 | 3.015625 | 3 | [
"MIT"
] | permissive | -- Adminer 4.7.8 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `about`;
CREATE TABLE `about` (
`about_id` int(11) NOT NULL AUTO_INCREMENT,
`keterangan` text NOT NULL,
PRIMARY KEY (`about_id`)
) ENGINE=InnoDB DEFAULT ... | true |
a225d92979d57cab360d033efafba45535cd912c | SQL | mdlulim/eis | /admin/model/extension/mail/template/install/install.sql | UTF-8 | 7,197 | 2.921875 | 3 | [] | no_license | DROP TABLE IF EXISTS `oc_emailtemplate`;
CREATE TABLE `oc_emailtemplate`(
`emailtemplate_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`emailtemplate_key` varchar(64) NOT NULL,
`emailtemplate_label` varchar(255) NOT NULL,
`emailtemplate_type` enum('','customer','affiliate','order','admin') NOT NULL,
`em... | true |
d4712153ef8c4b918d2372bdc05aac1195af0b95 | SQL | carincon93/adsi1132816 | /sql/backup.sql | UTF-8 | 4,523 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 16-03-2017 a las 13:35:55
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLI... | true |
00bf08166a34d87de3fc6c95861216a93bbad963 | SQL | ReneNyffenegger/PL-SQL-Parser | /tables/type_attribute.sql | UTF-8 | 694 | 2.71875 | 3 | [] | no_license | --create table nd_type_attribute (
-- id number(8) not null primary key,
-- identifier_1 varchar2(30) not null,
-- -- identifier_1 might be:
-- -- o collection variable
-- -- o cursor variable
-- -- o db table or view
-- -- o object
-- -- o record variab... | true |
99f9714044ecf706cf607ce7958cd178ae963524 | SQL | kangarap/easyboot | /src/main/resources/db/migration/V1.0.0__init.sql | UTF-8 | 46,705 | 3.6875 | 4 | [
"Apache-2.0"
] | permissive | /*
Navicat Premium Data Transfer
Source Server : easyboot
Source Server Type : MySQL
Source Server Version : 80022
Source Host : localhost:3306
Source Schema : easyboot
Target Server Type : MySQL
Target Server Version : 80022
File Encoding : 65001
Date: 20/12/2020 20... | true |
4c43273e2c14a355ce89ddfd88ed88954a8ff588 | SQL | rafin007/CabService | /cab_service.sql | UTF-8 | 8,403 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 28, 2017 at 05:06 AM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
7666a5dfb42d756a5c375430dd1ac61b1a96a644 | SQL | cli4dev/oms | /omscli/sql/mysql/dds_dictionary_info.sql | UTF-8 | 495 | 3.34375 | 3 | [] | no_license | drop table dds_dictionary_info;
create table dds_dictionary_info(
id bigint not null PRIMARY KEY AUTO_INCREMENT comment '编号',
name varchar(64) not null comment '名称' ,
value varchar(32) not null comment '值',
type varchar(32) not null comment '类型',
sort_no bigint not null default 0 comment '排序值',
status t... | true |
1016476bb944d70f6a7668250eca25305bfe3ec2 | SQL | dbswl2324/Jsp | /WebContent/guestbook/table.sql | UTF-8 | 630 | 2.734375 | 3 | [] | no_license | create table tblJoin(
id char(20) primary key,
pwd char(20) not null,
name char(20) not null,
email char(30),
hp char(40),
grade char(2) default '0'
)COLLATE='euckr_korean_ci';
create table tblGuestBook(
num int primary key auto_increment,
id char(20) not null,
contents text,
ip char(15) not nul... | true |
4904b18f7befff4c7822b7b186a01e5ebef78804 | SQL | TatjaZ/Python | /upd3102/All28_sql/AddCardType.sql | WINDOWS-1251 | 242 | 2.5625 | 3 | [] | no_license | if not exists(select 1 from DiscountTypes where ID=8) then
insert into DiscountTypes (ID,Comments,OnOff,IsDiscount,ChSum)
values (8,' 10 ',1,1,0)
end if
/ | true |
d885666eec32bff91c0ece82a5fd51b610721eaf | SQL | lgcarrier/AFW | /5.2.3/Database/Constraints/AFW_11_ENTIT_FK1.sql | UTF-8 | 180 | 2.828125 | 3 | [
"MIT"
] | permissive | SET DEFINE OFF;
ALTER TABLE AFW_11_ENTIT ADD (
CONSTRAINT AFW_11_ENTIT_FK1
FOREIGN KEY (REF_VERSN)
REFERENCES AFW_11_VERSN (SEQNC)
ON DELETE CASCADE
ENABLE VALIDATE)
/
| true |
c8b71567c959dea405772dadf42f6d8923d7ecfd | SQL | andradesdiego/sql_practices | /Alter_Paises.sql | ISO-8859-1 | 3,010 | 3.953125 | 4 | [] | no_license | USE VinosDenominaciones;
--Selecciona el ltimo valor de la columna id de la tabla Paises
SELECT MAX(id) FROM dbo.Paises;
--Modifica la tabla paises; elimina la columna "id"
ALTER TABLE dbo.Paises
DROP COLUMN id;
--Modifica la tabla paises; crea una columna "id" autoincremental.
--Slo puede haber una colu... | true |
e5c08729a9417231c447f98e287434433ac80ac1 | SQL | maan81/kantipur | /kantipur.sql | UTF-8 | 742 | 2.71875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 31, 2018 at 10:34 PM
-- Server version: 5.5.59-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `kantipur`
--
-- ... | true |
7852b1873ae50992768675449f35982159f13bef | SQL | tynr426/fire | /src/main/resources/mysql/initData.sql | UTF-8 | 1,305 | 2.546875 | 3 | [] | no_license |
truncate table com_menu;
/*!40000 ALTER TABLE `com_menu` DISABLE KEYS */;
INSERT INTO `com_menu` VALUES (1,'基础信息','','sys',NULL,NULL,0,1,NULL,NULL,1,NULL),
(2,'管理信息','','zone',NULL,NULL,0,1,NULL,NULL,1,NULL),
(3,'统计信息','','store',NULL,NULL,0,1,NULL,NULL,1,NULL),(101,'基础信息','','',NULL,NULL,1,2,NULL,NULL,1,NULL),
(... | true |
04fc336819a4766b4e750e969c3bd2d98a6e5cd8 | SQL | felipesv/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/8-cities_of_california_subquery.sql | UTF-8 | 127 | 3.296875 | 3 | [] | no_license | -- query with two tables
SELECT b.id, b.name
FROM states AS a, cities AS b
WHERE a.id = b.state_id
AND a.name = "California";
| true |
d58793f767064016013245673c3240f8144ba587 | SQL | prateek-karanpuria/krish-training | /ref/m2-ee-to-ce-SQLs/sales/sales_order_status.sql | UTF-8 | 610 | 2.90625 | 3 | [] | no_license | SET GLOBAL FOREIGN_KEY_CHECKS=0;
INSERT INTO m231_studentkare.sales_order_status
(
m231_studentkare.sales_order_status.status,
m231_studentkare.sales_order_status.label
)
SELECT
m231_studentkare_live_22112019.sales_order_status.status,
m231_studentkare_live_22112019.sales_order_status.label
FROM m231_studentkare_live_... | true |
30b4303acdc81737a3e061344ae60f6ceddeded4 | SQL | jreades/LandRegistry | /SQL/Load/Quarterly.sql | UTF-8 | 9,058 | 3.578125 | 4 | [] | no_license | SET search_path = landreg, os, public;
-- PC
-- DROP MATERIALIZED VIEW IF EXISTS landreg.pc_quarterly_fct;
-- CREATE MATERIALIZED VIEW pc_quarterly_fct AS
-- SELECT
-- pc,
-- property_type_cd,
-- extract(year from completion_dt) as completion_year,
-- ceil(extract(month from completion_dt)/3.0) as quarter,
... | true |
2725c6255dadf56a19631d30c707b42ac48befbd | SQL | CEN3031-SIT-WEB-APP/ufInfoSec_webapp | /db/schema.sql | UTF-8 | 7,724 | 2.953125 | 3 | [] | no_license | CREATE TABLE `account` (
`id` INT NOT NULL AUTO_INCREMENT,
`full_name` varchar(100) NOT NULL,
`email` varchar(254) NOT NULL,
`ufl_email` varchar(254) NOT NULL,
`verification_level` INT NOT NULL DEFAULT '0',
`permissions` TEXT NOT NULL,
`password` varchar(200) NOT NULL,
`registration_ip` varchar(40) NOT NULL,
`... | true |
e264048083f6e417ab5d823fc86d5657059f5f7b | SQL | Guifamelo/DB_MySQL | /28out2020/db_cidade_das_carnes.sql | UTF-8 | 2,662 | 3.65625 | 4 | [] | no_license | create database db_cidade_das_carnes;
use db_cidade_das_carnes;
create table tb_categoria (
id bigint(5) auto_increment,
categoria varchar(50) not null,
disponivel boolean not null,
primary key(id)
);
select * from tb_categoria;
insert into tb_categoria (categoria, disponivel)
values ("bovinos", true);
ins... | true |
ed05b7974c3f573c160197b2ee27dee65423a6b2 | SQL | AhTiKo/SoftUni | /MySQL/15.soft_uni.sql | UTF-8 | 887 | 4.09375 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS soft_uni;
USE soft_uni;
CREATE TABLE towns (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(20) NOT NULL
);
CREATE TABLE addresses(
id INT PRIMARY KEY AUTO_INCREMENT,
address_text VARCHAR(100) NOT NULL,
town_id INT,
CONSTRAINT fk_town_id
FOREIGN KEY (town_id) REFEREN... | true |
5168b77e5e3fc1fec74586c7043dcfe4ea286e64 | SQL | cheonsoo/kbsn | /src/main/resources/sql/create_table.sql | UTF-8 | 1,088 | 3.03125 | 3 | [] | no_license | CREATE DATABASE KBSN
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
-- DAILY_PROG_TABLE
CREATE TABLE `KBSN`.`DAILY_PROG_TABLE` (
`DAILY_PROG_TABLE_KEY` INT NOT NULL AUTO_INCREMENT,
`UUID` VARCHAR(50) NULL,
`CHANNEL_NAME` VARCHAR(100) NULL,
`LIVE` VARCHAR(1) NULL,
`START_TIME` VARCHAR(20) NUL... | true |
32bcf5aa1383de09c3f8f2d69e530a5dc7883550 | SQL | ReneNyffenegger/oracle-patterns | /Installed/dbms/xa/setup.sql | UTF-8 | 3,011 | 3.0625 | 3 | [] | no_license | @drop_if_exists tq84_xa
create table tq84_xa (
txt varchar2(40)
);
@drop_if_exists tq84_xa_result_to_string
create function tq84_xa_result_to_string(res number) return varchar2 as
begin
return
case res
when sys.dbms_xa.xa_ok then 'OK'
when sys.dbms_xa.xa_rbbase then 'XA_R... | true |
558d8c5c8e93127f83329d4ef8298e3419a81dc3 | SQL | jsonlog/sqlserver | /9/9/SQLQuery.sql | UTF-8 | 96 | 2.984375 | 3 | [] | no_license | USE db_2012
SELECT * FROM Student
WHERE EXISTS
(SELECT Sno FROM SC WHERE Student.Sno = SC.Sno)
| true |
5f4a1cb6095b6c6633fd680de5ceb69232c8c872 | SQL | wchen308/practice_db | /monthly_transactions_i_1193_join_groupby.sql | UTF-8 | 2,322 | 4.90625 | 5 | [] | no_license | /*
Write an SQL query to find for each month and country, the number of transactions and their total amount, the number of approved transactions and their total amount.
The query result format is in the following example:
Transactions table:
+------+---------+----------+--------+------------+
| id | country | state... | true |
1d75ddb0bf2db9c2bed11e94d23573429a0a78a1 | SQL | alexgathuri/Hire-purchase-system | /database/system.sql | UTF-8 | 11,415 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 28, 2017 at 10:56 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
a943fc5a9b5ec61b24bedbdde9c5f8b870fddf58 | SQL | Jingciii/Restaurant-Management-System | /Wang_final_project.sql | UTF-8 | 73,302 | 3.34375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `RestaurantDB` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `RestaurantDB`;
-- MySQL dump 10.13 Distrib 8.0.21, for macos10.15 (x86_64)
--
-- Host: 127.0.0.1 Database: RestaurantDB
-- -------------------------------------... | true |
c2f5f97cf8cca435644b6d18ca36784ab61c8d8e | SQL | michaelmmcrae1/VaultSql | /Hub_Product_Instance/UpdateProductInstance_LOAN.sql | UTF-8 | 867 | 3.640625 | 4 | [] | no_license | /*
UpdateProductInstance_LOAN.sql
Michael McRae
July 7, 2014
Adds entries from SYM.LOAN to Hub_Product_Instance which are not already there. Specifies 'L' for Loan
Because these Product Instances will only be from SYM.LOAN. Needs PRODUCT_TYPE
of 'LOAN' because product instances from SYM.LOAN may have the same P... | true |
1d7d33e45caa3de1f2b97f38b40100824d8349df | SQL | tangyoucheng/drrp | /drrp/src/cn/com/prescription/leshan/rpc/data/RPC00105Dao_selectOutpatientInfo.sql | UTF-8 | 1,171 | 3.359375 | 3 | [] | no_license | /*
*
*/
/**
* 门诊信息表DAOIF ソート処理
* RPC00103Dao_selectOutpatient.sql
*/
/*
* 新規作成
* DATE: 2012.02.13 NAME: gl
*/
SELECT
outpatient.*,
patient.user_id,
patient.user_name,
patient.birthday,
patient.sex_id,
patient.post_number,
patient.addr,
patient.phone_number,
... | true |
3c60e3e01bc94f0c461d1da6ae2ac9f53c55ecd5 | SQL | Pranatha-Rao/data-warehouse-and-business-intelligence | /chinook-database-master/assignment query MySQL.sql | UTF-8 | 436 | 3.796875 | 4 | [] | no_license | select g.name, i.total
from genre g
join track t on t.GenreId = g.GenreId
join invoiceline iv on iv.TrackId = t.TrackId
join invoice i on i.InvoiceId = iv.InvoiceId
group by Name
order by i.total desc;
select a.title, max(i.total) as sales
from album a
join track t on a.AlbumId = t.AlbumId
join invoiceline iv on iv.T... | true |
25c4c7dbcf866a78c5dce05484edc1f4d4721bb9 | SQL | HTTPArchive/almanac.httparchive.org | /sql/2021/markup/html_lang.sql | UTF-8 | 1,280 | 3.640625 | 4 | [
"Apache-2.0"
] | permissive | #standardSQL
# page almanac metrics grouped by device and html lang
# returns all the data we need from _almanac
CREATE TEMPORARY FUNCTION get_almanac_html_lang(almanac_string STRING)
RETURNS STRING LANGUAGE js AS '''
try {
var almanac = JSON.parse(almanac_string);
if (Array.isArray(almanac) || typeof almana... | true |
37fd1624fe50e6f8ba7801e8dffb6d5aa98a165c | SQL | srini-nathan/backend-nft | /prisma/migrations/20210523091048_reset_token/migration.sql | UTF-8 | 381 | 3.078125 | 3 | [] | no_license | /*
Warnings:
- A unique constraint covering the columns `[resetToken]` on the table `User` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE "User" ADD COLUMN "resetToken" TEXT;
ALTER TABLE "User" ADD COLUMN "resetTokenExpiryAt" DATETIME;
-- CreateIndex
CREATE UN... | true |
5a7179703757ae26ddc413a2900c7e6321369019 | SQL | kjhf/sendou.ink | /prisma/migrations/20210126194128_add_detailed_map/migration.sql | UTF-8 | 2,829 | 3.71875 | 4 | [
"MIT"
] | permissive | /*
Warnings:
- You are about to drop the column `date` on the `LadderMatch` table. All the data in the column will be lost.
- You are about to drop the column `links` on the `LadderMatch` table. All the data in the column will be lost.
- You are about to drop the column `detailedStats` on the `LadderMatch` tab... | true |
d5ccfb8cbb24647b497afc3adfd16ce10149b1d5 | SQL | wqdchn/leetcode | /database/department_highest_salary.sql | UTF-8 | 645 | 4.5625 | 5 | [] | no_license | # Write your MySQL query statement below
SELECT
D.Name AS Department,
E.Name AS Employee,
E.Salary
FROM
Employee E,
(SELECT DepartmentId, max(Salary) as max FROM Employee GROUP BY DepartmentId) T,
Department D
WHERE
E.DepartmentId = T.DepartmentId
AND E.Salary = T.max
AND E.DepartmentId... | true |
7494309fab121a6ea5779eb48435427ec5c18d9b | SQL | MegiantoAS/Tubes-Provis | /kemahasiswaan_10119060_10119077.sql | UTF-8 | 10,257 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 04, 2021 at 05:56 PM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 7.4.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
9a1b9941b8db0f32d6b07f0a919287d648f421ca | SQL | rodrigoieh/embedded-container | /StandaloneEJBWithDBUnitTest/src/testDataDerby.sql | UTF-8 | 478 | 3.453125 | 3 | [] | no_license | DROP TABLE EJB_TEST.EMPLOYEE;
DROP TABLE EJB_TEST.DEPARTMENT;
DROP SCHEMA EJB_TEST RESTRICT;
CREATE SCHEMA EJB_TEST;
CREATE TABLE EJB_TEST.DEPARTMENT (
DEPT_ID INT NOT NULL,
NAME VARCHAR(20) NOT NULL,
PRIMARY KEY (DEPT_ID)
);
CREATE TABLE EJB_TEST.EMPLOYEE (
EMP_ID INT NOT NULL,
FNAME VARCHAR(20) NOT NULL,
LNA... | true |
0c4fdec72adeadf855115e6d47cca5a036654c56 | SQL | Enin/mysql_training | /thinkSQL/생각대로SQL3 - 문제리스트.sql | UHC | 8,591 | 3.9375 | 4 | [] | no_license | 1) ⺻ , id, ̸, , ̸ϰ Բ ּ address, district, postal_code, phone ȣ Բ ּ. Ǯ
SELECT * FROM customer c ;
SELECT * FROM address a ;
-- ADDRESS Ӽ JOIN
SELECT C.CUSTOMER_ID, C.FIRST_NAME, C.LAST_NAME, C.EMAIL ,
A.ADDRESS, A.DISTRICT, A.POSTAL_CODE, A.PHONE
FROM CUSTOMER C
JOIN ADDRESS A
ON C.ADDRESS_ID = A.ADDRESS_ID ;
2)... | true |
cf2050915c53992d4c8d2cb9fe42a6329b100e6e | SQL | manishkrm6/EY-SOD-Tool-Final | /uploads/sql/Proc/Role_Analysis.sql | UTF-8 | 22,241 | 3.5 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | CREATE DEFINER=`root`@`localhost` PROCEDURE `usp_role_analysis`(var_proc varchar(1000))
BEGIN
/*This proc is updated on 01-Jul-2013 to add conflicts additional checks and exceptions for roles.*/
declare done,var_ce,var_cac,var_stat int;
declare rnam varchar(50);
declare var_auth,log_stat varchar(12);
declare var_tcod... | true |
bad692707a4ffa488ca3acca96a687f70b9d1fe3 | SQL | facugon/megaconector | /DOCS/tabla_site.sql | UTF-8 | 2,551 | 2.984375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.1.41, for debian-linux-gnu (i486)
--
-- Host: localhost Database: digitalus
-- ------------------------------------------------------
-- Server version 5.1.41-3ubuntu12.6
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARAC... | true |
22615e0b001270ac57df2b86d3c861e9daffb43b | SQL | jangridwan/uas-web-service | /uas-web.sql | UTF-8 | 2,581 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 06, 2016 at 02:35 PM
-- Server version: 5.5.46
-- PHP Version: 5.3.10-1ubuntu3.21
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTE... | true |
47e3e5b854b774350a760a261e9a89f03ec781c4 | SQL | GuoooooJing/Database-Project-CS-425 | /SQLDDLScript.sql | UTF-8 | 2,017 | 4.28125 | 4 | [] | no_license | /* This is the SQL DDL Script for the database creation */
/* Airport relation */
CREATE TABLE Airport
(
IATA CHAR(3),
Name VARCHAR(50),
Country VARCHAR(50),
PRIMARY KEY (IATA)
);
/* Customer relation*/
CREATE TABLE Customer
(
Email_Address VARCHAR(100),
Name VARCHAR(50),
Home_Airport CHAR(3),
PRIMARY... | true |
f3841789c86bae8007f321d7576f607b1d0fb3a1 | SQL | ryan-houpt/database-exercises | /where_exercises.sql | UTF-8 | 512 | 3.21875 | 3 | [] | no_license | USE employees;
SELECT * FROM Employees;
SELECT first_name, last_name, hire_date
FROM employees
WHERE first_name IN ('Irena', 'Vidya', 'Maya');
SELECT first_name, last_name, hire_date
FROM employees
WHERE last_name LIKE ('E%');
SELECT first_name, last_name, hire_date
FROM employees
WHERE hire_date BETWEEN '1990-01-0... | true |
fccfc183030bff94dccf900ebbfde77a104d3fcd | SQL | Yag1r0/hikers-final | /Social network/Database/soc_net2.sql | UTF-8 | 12,980 | 2.671875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 07, 2019 at 05:51 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
74241a005e021a6d859ef89f00f4e6d4d6158fff | SQL | gpipperr/OraDBASQLScripts | /my_tab_rights.sql | UTF-8 | 534 | 2.859375 | 3 | [] | no_license | --==============================================================================
-- GPI - Gunther Pippèrr
--
-- get my table rights on this database
--
--==============================================================================
set linesize 130 pagesize 300
column table_schema format a20
column table_name fo... | true |
e2085028e2af4ca782ac5b96eb4b4b9180a0291c | SQL | jampaniuday/ABROracle | /sql/plsql_simple_loop.sql | UTF-8 | 360 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | SET serveroutput ON
BEGIN
FOR u IN
(SELECT username
FROM dba_users
WHERE upper(username) LIKE '%'
AND upper(username) NOT IN ( 'SYS','SYSTEM','DBSNMP' ,'OUTLN','CTXSYS','EXFSYS' ,'XDB','ODMRSYS','WMSYS' )
)
LOOP
DBMS_OUTPUT.put_line(u.username);
-- EXECUTE IMMEDIATE 'GRANT ROLE_ASRLIST_RW TO ' || ... | true |
5d234cfc62fbf87da35e04f4f36c9a2a7a4de547 | SQL | deic-dk-retired/ddosapi | /.sql/rules/activeRulesCount.sql | UTF-8 | 255 | 3.15625 | 3 | [] | no_license | select distinct count(*)
FROM flow.flowspecrules f
where f.flowspecruleid in
(
SELECT DISTINCT flowspecruleid
FROM flow.flowspecrules AS x
WHERE coalesce(srcordestport,'') = coalesce(destinationport,'')
)
AND isactivated = TRUE
AND isexpired = FALSE | true |
bf566bdad99d28950e142fcc3556252dba197f74 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day11/select0422.sql | UTF-8 | 267 | 3.03125 | 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='WeMo' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['4214','3100_4','4232','1431','6034','5074','3100_9','4100_10','3099','5044'])
| true |
2bc5581e85d4d38629a3cf3cea4909a3a1664b24 | SQL | sinisatesic/database-exercises | /group_by_exercises.sql | UTF-8 | 750 | 3.984375 | 4 | [] | no_license | use employees;
SELECT DISTINCT title
FROM titles;
SELECT last_name, COUNT(last_name)
FROM employees
WHERE LEFT(last_name, 1) IN ('E') AND RIGHT(last_name, 1) IN ('E')
GROUP BY last_name;
SELECT first_name, last_name, COUNT(last_name)
FROM employees
WHERE LEFT(last_name, 1) IN ('E') AND RIGHT(last_name, 1) IN ('E')
GR... | true |
6d31ca52edc060afa288c068f7c197c1e872e96b | SQL | rainty02/JavaTheorem | /SQL/20210610_sql_practice4.sql | UTF-8 | 2,313 | 4.4375 | 4 | [] | no_license | -- 32. EQUI 조인을 사용하여 SCOTT 사원의 부서번호와 부서 이름을 출력하시오.
SELECT E.ENAME, D.DEPTNO, D.DNAME
FROM EMP E, DEPT D
WHERE E.ENAME = 'SCOTT' AND E.DEPTNO = D.DEPTNO
;
-- 33. INNER JOIN과 ON 연산자를 사용하여
-- 사원 이름과 함께 그 사원이 소속된 부서이름과 지역 명을 출력하시오.
SELECT E.ENAME, D.DNAME, D.LOC
FROM EMP E INNER JOIN DEPT D
ON E.DEPTNO = D.DEPTNO
;
-- 3... | true |
40844863292933d8ebf328011af42e0422f5cc98 | SQL | Kraysky/SQL-Danny-s-Dinner-Case-Study | /8weekssql.sql | UTF-8 | 5,246 | 4.59375 | 5 | [] | no_license | /* --------------------
Case Study Questions
--------------------*/
-- 1. What is the total amount each customer spent at the restaurant?
-- 2. How many days has each customer visited the restaurant?
-- 3. What was the first item from the menu purchased by each customer?
-- 4. What is the most purchased item on ... | true |
dc6c597abf75647049cec6a6e79a5bc50a02a438 | SQL | ldelbel/SQL-Zoo_tutorial | /9-SELF-JOIN.sql | UTF-8 | 3,066 | 4.4375 | 4 | [] | no_license | -- 1. How many stops are in the database
SELECT COUNT(*)
FROM stops
-- 2. Find the id value for the stop 'Craiglockhart'
SELECT id FROM stops
WHERE name = 'Craiglockhart'
-- 3. Give the id and the name for the stops on the '4' 'LRT' service.
SELECT stops.id, stops.name
FROM route JOIN stops ON stops.id = stop
WHER... | true |
44e54dd7f2919a20804e0898235fe27f07d5a6e8 | SQL | TerahJennaGumm/DataMgmt_TJG | /DataMgmt_IT/CONCUR_MinalC/Views/Outtask_SAs_ActiveBusinessCustomer_IndirectORTMCAccounts.sql | UTF-8 | 649 | 3.5625 | 4 | [] | no_license | CREATE VIEW [CONCUR\MinalC].Outtask_SAs_ActiveBusinessCustomer_IndirectORTMCAccounts
AS(
SELECT DISTINCT ac.id_acc, ac.nm_login,c.business_login --, c.secondary_biz_login
, ac.c_CBSFAID, ac.c_CBAgencyID, c_CBMasterAcct
, ocls.*
FROM [$(DataMgmt_Metranet)].dbo.rpt_v_account ac
JOIN [$(DataMgmt_Metranet)].dbo.[vw_MN_Cu... | true |
01230e71aaebec2e0ebe4fd8c1940ffa25741fcf | SQL | sfcjasonspencer/DS-DBA-General-Operation | /Job_Information/List of all the jobs currently running on server.sql | UTF-8 | 399 | 3.671875 | 4 | [] | no_license | -- List of all the jobs currently running on server
SELECT distinct name,
job.job_id,
notify_level_email,
enabled,
description,
step_name,
command,
server,
database_name
FROM
msdb.dbo.sysjobs job
INNER JOIN
msdb.dbo.sysjobsteps steps
ON
job.job_id = steps... | true |
5eb3459d235c13fa35aa0578c758a101cef434f3 | SQL | jonathanthen/OLET1301-CodeDump | /w2q5.sql | UTF-8 | 166 | 3.328125 | 3 | [] | no_license | SELECT COUNT(*), AVG(air_temp)
FROM Observations
WHERE obsdate >= '2017-04-01'
AND obsdate <= '2017-04-30'
AND wind_speed >= 10
AND city = 'Brisbane'; | true |
1f81258986e923455e8f12c3573f40df4ae0c2d2 | SQL | HryBot/EvrazSearch | /evraz(1).sql | UTF-8 | 7,354 | 3.390625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1
-- Время создания: Ноя 21 2019 г., 10:17
-- Версия сервера: 10.4.6-MariaDB
-- Версия PHP: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.