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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
fd1089b3f9c1c7b6d844fd3be8875b70fe1026e8 | SQL | AntonFagerberg/Kookies | /conf/evolutions/default/3.sql | UTF-8 | 230 | 2.875 | 3 | [] | no_license | # --- !Ups
CREATE TABLE unit(
abbreviation VARCHAR(2) PRIMARY KEY,
name VARCHAR(20) NOT NULL UNIQUE
);
INSERT INTO `unit` (`abbreviation`, `name`)
VALUES
('ml','milliliters'),
('g','grams');
# --- !Downs
DROP TABLE unit; | true |
359b0bac17c8c709a2e0a16ed94d51c7e2dc20cc | SQL | kluf/shop_rating_update | /www/schema/create.sql | UTF-8 | 3,361 | 3.75 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS shop_rating;
USE shop_rating;
CREATE TABLE IF NOT EXISTS `shops`(
`id` INT NOT NULL AUTO_INCREMENT COMMENT 'shop id',
`name` VARCHAR(30) NOT NULL COMMENT 'shop name',
`siteUrl` VARCHAR(30) NOT NULL,
`description` TEXT COMMENT 'some description',
`logo` INT COMMENT 'foreign key to ima... | true |
ef11d5b6dddac68ee36f7f28047d6e20e77bdf75 | SQL | hackert/una_vaina_loca | /protected/data/er-tancking.sql | UTF-8 | 13,428 | 3.625 | 4 | [] | no_license |
/* Drop Tables */
DROP TABLE IF EXISTS track.admision;
DROP TABLE IF EXISTS track.clientes;
DROP TABLE IF EXISTS track.receptor;
DROP TABLE IF EXISTS track.contacto;
DROP TABLE IF EXISTS track.maestro;
DROP TABLE IF EXISTS track.ruta_entrega;
DROP TABLE IF EXISTS track.sedes;
/* Drop Sequences */
D... | true |
dace12f1bf92ea2ddf85292cfb296b00f0e7f6b1 | SQL | Aram777/OnlineShoppingProject | /ProjectDocuments/New folder/OnlineShopping.sql | UTF-8 | 6,892 | 3.578125 | 4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 15/04/2018 01:52:50 */
/*==============================================================*/
alter table Discounts
drop foreign key FK_DISC... | true |
2d19a0f2977000c2f5e130964ab93050e49d7104 | SQL | amar-jagdale/SQL_Assignment | /SQLQuery_FUNCTIONS.sql | UTF-8 | 1,565 | 3.796875 | 4 | [] | no_license |
--================== SQL FUNCTIONS =======================
SELECT REPLACE('SQL Tutorial', 'T', 'M'); --Replace "T" with "M":
SELECT CONCAT('SQL', ' is', ' fun!');
SELECT REPLACE('SQL Tutorial', 'SQL', 'HTML'); --Replace "SQL" with "HTML":
SELECT LOWER('SQL Tutorial is FUN!'); --Lower the string
selec... | true |
7edfc9b3cdd1d345e675de1cdcb17bed6ab00583 | SQL | jonpratt/powerschool-customizations | /Online Registration/admin/portalupdates/annualagreements.sql | UTF-8 | 1,378 | 3.578125 | 4 | [] | no_license | SELECT
students.dcid as studentsDCID,
students.lastfirst as studentsName,
students.grade_level as studentsGradeLevel,
teachers.lastfirst as advisor,
CASE WHEN u_student_demographics.emergency_agree=1 THEN u_student_demographics.emergency_agree ELSE 0 END as emergencyValue,
CASE WHEN u_student_demographics.c... | true |
b5f955b610c9dede1867b66bbd3e26c5c716be38 | SQL | dineshkummarc/hijab-master | /assets/db/px_guest_book.sql | UTF-8 | 1,589 | 2.90625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 09, 2017 at 07:19 PM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
cd6839b2d309f2cabe2eb77c148ae42c8571784b | SQL | JANVI062/StockInvo | /database/grocery_db.sql | UTF-8 | 16,613 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 02, 2021 at 12:47 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
200eb73d04c5824aabb88b3bff6ee4ddc65a0fe6 | SQL | otto-dlh/ProyectoFinal | /database/sp_Cursos.sql | UTF-8 | 476 | 4.09375 | 4 | [] | no_license | USE `des`;
DROP procedure IF EXISTS `sp_Cursos`;
DELIMITER $$
USE `des`$$
CREATE PROCEDURE `sp_Cursos`(
pUsuario INT
)
BEGIN
SELECT
c.idCursos, c.Nombre, COUNT(dp.idCursos) TotalProyectos
FROM
cursos c
INNER JOIN
detallecurso dc ON c.idCursos = dc.idCurso
INNER JOIN
usuarios u ON dc.idUsuario = idUs... | true |
d388bffa4a1a0eb3e85d80ea04c1b057822108df | SQL | samuelg4133/BDIICinema | /Consultas.sql | UTF-8 | 6,037 | 4.1875 | 4 | [] | no_license | use cinema;
#3. Faça as seguintes consultas, e grave-as em um arquivo SQL para ser enviado.
#a) Obter o nome e o ano de todos os filmes cadastrados no banco de dados
select NomeFilme, AnoFilme from filme;
#b) Obter a nacionalidade dos atores cadastrados no BD
select distinct Nacionalidade from ator;
#c) Obter o... | true |
0a7c4a517d2d7b60472049b8f9b25245acccbc9f | SQL | ABOGABOGI/Biller_Adapter | /src/sql/biller.sql | UTF-8 | 1,723 | 2.75 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : Dolly
Source Server Version : 100120
Source Host : 192.168.180.156:3306
Source Database : switching
Target Server Type : MYSQL
Target Server Version : 100120
File Encoding : 65001
Date: 2017-08-29 10:25:38
*/
SET FOREIG... | true |
518d2c355aca278fa55acffa02460a04aff77fce | SQL | Deerluluolivia/education-highschool-public | /experiments/features/LOOKUP_feature_category.sql | UTF-8 | 273 | 2.75 | 3 | [
"MIT"
] | permissive | /* schema creation for feature lookup table _feature_category.csv */
CREATE TABLE wake._feature_category (
feature_name VARCHAR(255) NOT NULL,
table_name VARCHAR(255) NOT NULL,
feature_category_primary VARCHAR(255) NOT NULL,
exclude_when_modeling INTEGER NOT NULL
); | true |
5f430dccb872ce89c99e552c58320c02104601c8 | SQL | Ares7/2013-JUL-Module-7 | /Task 05/Anzhela_Papova_labwork05/dw/tables/t_countries/vl_countries.sql | UTF-8 | 1,054 | 3 | 3 | [] | no_license | --drop view dw.vl_countries;
--==============================================================
-- View: vl_countries
--==============================================================
create or replace view dw.vl_countries as
SELECT geo_id
, country_id
, country_code_a... | true |
0c5739d11c635c574a5439f09119bae016f312d5 | SQL | daidai21/Leetcode | /DataBase/178-Rank_Scores.SQL | UTF-8 | 406 | 4.25 | 4 | [] | no_license | SELECT
s1.score 'Score',
COUNT( DISTINCT s2.score) 'Rank'
FROM
Scores s1
INNER JOIN Scores s2
ON s1.score <= s2.score
GROUP BY
s1.id,
s1.score
ORDER BY
s1.score DESC;
SELECT
Score,
(
SELECT
COUNT( DISTINCT Score )
FROM
Scores
WHER... | true |
a6e58cc71ad80766f395dd7229ad906dc113da81 | SQL | PCinkusz/Python | /baza2.sql | UTF-8 | 786 | 3 | 3 | [] | no_license | create database baza;
create table Pupil (`pupil_id` int primary key , `name` varchar(45), `surname` varchar(45), `pesel` varchar(45), `class` varchar(45));
create table Teacher (`teacher_id` int primary key, `name` varchar(45), `surname` varchar(45), `pesel` int, `subject` varchar(45));
create table Subject (`subject_... | true |
300b6aa7b28a644e6d5e8c1fb81cf5f7244477e1 | SQL | hardaker-dev/sfgweb | /SaasFeeGuides/SaasFeeGuides.Database.Deploy/Scripts/33a_CreateTable_CustomerBookingAudit.sql | UTF-8 | 655 | 3.53125 | 4 | [] | no_license | set xact_abort on
BEGIN TRAN
CREATE TABLE [Activities].[CustomerBookingAudit](
[CustomerId] [int] NOT NULL,
[ActivitySkuDateId] int not null,
[HasConfirmed] bit not null,
[HasPaid] bit not null,
[HasCancelled] bit not null,
[NumPersons] int not null,
[PriceAgreed] float not null,
[Modified] datet... | true |
afad4878b9d7ea8dd296e5840251ab51433cc856 | SQL | bluefatty-hua/huajingtong | /jobs_sql/dw/bb/dw_bb_month.sql | UTF-8 | 1,761 | 3.90625 | 4 | [] | no_license | -- 汇总维度 月-公会—主播
-- 汇总指标 开播天数,开播时长,虚拟币收入
-- DROP TABLE IF EXISTS warehouse.dw_month_bb_anchor_live;
-- CREATE TABLE warehouse.dw_month_bb_anchor_live AS
DELETE
FROM warehouse.dw_bb_month_anchor_live
WHERE dt = '{month}';
INSERT INTO warehouse.dw_bb_month_anchor_live
(
`dt`,
`platform_id`,
`platform_name`,
`backe... | true |
ed5a2e7e5b641b919a8d7166e516e1ac46ab8f7b | SQL | KseniyaST/CakeLand | /cakeland.sql | UTF-8 | 8,350 | 3.359375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Апр 27 2018 г., 10:33
-- Версия сервера: 5.5.25
-- Версия PHP: 5.2.12
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4010... | true |
12595b930824b0eacaa54d180587de1192e2f35b | SQL | apoyl/LycPHP | /Test/messages.sql | UTF-8 | 1,340 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2011 年 03 月 22 日 07:57
-- 服务器版本: 5.1.36
-- PHP 版本: 5.2.2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_... | true |
00f503ec6eed2ad7aa6f6beb8d0310b32f89bcb9 | SQL | WWWWYYYY/fbs-lock | /mysql-lock/src/main/resources/db_lock.sql | UTF-8 | 637 | 2.671875 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : mac
Source Server Type : MySQL
Source Server Version : 50639
Source Host : localhost
Source Database : fbs_lock
Target Server Type : MySQL
Target Server Version : 50639
File Encoding : utf-8
Date: 05/11/2019 22:39:09 PM
... | true |
98f40d60520cead576102edfedb73cd934c16552 | SQL | HelloJasonZ/bank | /bankERP/bankerp.sql | UTF-8 | 20,812 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : MyTest
Source Server Version : 50704
Source Host : localhost:3306
Source Database : bankerp
Target Server Type : MYSQL
Target Server Version : 50704
File Encoding : 65001
Date: 2016-08-25 17:10:52
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... | true |
1bb0d3c0afe4644844d6fd9ee5b69208a4a83cd9 | SQL | benrodenhaeuser/LS_180 | /movies_5.sql | UTF-8 | 5,829 | 3.59375 | 4 | [] | no_license | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
ALTER TABLE ONLY public.films DROP CONSTRAINT films_direct... | true |
100b9cd24f1b62d33837c82517333a042a8725db | SQL | tygray6/Tech-Academy-Projects | /SQL Server Projects/SQLQuery1.sql | UTF-8 | 2,679 | 4.34375 | 4 | [] | no_license | /* All information from the habitat table. */
SELECT *
FROM tbl_habitat
/* Retrieve all names from the species_name column that have a species_order value of 3. */
SELECT species_name
FROM tbl_species
WHERE species_order = 3
/* Retrieve only the nutrition_type from the nutrition table that have a nutrition_cost... | true |
ad21f83bafee0e924be8910f03cd34c1b07826af | SQL | zhang555955/Django_studinfor_openpyxl | /SQLDATAtest/pro202.sql | UTF-8 | 16,484 | 3.296875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 80011
Source Host : localhost:3306
Source Database : pro202
Target Server Type : MYSQL
Target Server Version : 80011
File Encoding : 65001
Date: 2020-12-19 17:26:03
*/
SET FOREIGN_KEY_CHECKS=0;
-- ------... | true |
d6c5cdc9c72e37c6c64041df7a60bdefba7a06eb | SQL | artcom1/test | /#DB/struct/view/qv.powiazanietezkkw.sql | UTF-8 | 478 | 3.625 | 4 | [] | no_license | CREATE VIEW powiazanietezkkw AS
SELECT COALESCE(r.tel_idelemsrc, r.tel_idelemdst) AS tel_idelem,
COALESCE(wyk.kwh_idheadu, e.kwh_idheadu) AS kwh_idheadu
FROM ((public.tr_ruchy r
LEFT JOIN public.tr_nodrec wyk ON (((wyk.knr_idelemu = r.knr_idelemusrc) OR (wyk.knr_idelemu = r.knr_idelemudst))))
LEFT JOI... | true |
34bdd5d8ab37c18c471f72b33538038212872fd3 | SQL | not-notAlex/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/12-no_genre.sql | UTF-8 | 302 | 3.890625 | 4 | [] | no_license | -- lists all shows that do not have a genre link
SELECT tv_shows.title, tv_show_genres.genre_id
FROM tv_shows
LEFT JOIN tv_show_genres
ON tv_shows.id = tv_show_genres.show_id
WHERE tv_show_genres.genre_id IS NULL
ORDER BY tv_shows.title, tv_show_genres.genre_id ASC;
| true |
df6d98d75b3ad78d35cecc46abcb06f87e3b4fb2 | SQL | marcoshakuro/turma16java | /mySQL/Exercicio/exercicio3MySQL.sql | UTF-8 | 1,062 | 3.171875 | 3 | [] | no_license | create database db_registro_escolar;
create table tab_alunos(
id bigint auto_increment,
nome varchar (255),
idade int not null,
melhorMateria varchar (255),
nota int,
primary key (id)
);
select * from tab_alunos;
insert into tab_alunos (nome,idade,melhorMateria,nota) values ("Marcos",27,"Matematica",9);
insert into ... | true |
8bac774ddf7278e19dcb4facaa34161b5640f62d | SQL | nriqu322/sql_zoo_answers | /7_more_join_operations.sql | UTF-8 | 2,060 | 4.15625 | 4 | [] | no_license | SELECT id, title
FROM movie
WHERE yr = 1962;
SELECT yr
FROM movie
WHERE title = 'Citizen Kane';
SELECT id, title, yr
FROM movie
WHERE title LIKE '%Star Trek%'
ORDER BY yr;
SELECT id
FROM actor
WHERE name = 'Glenn Close';
SELECT id
FROM movie
WHERE title = 'Casablanca';
SELECT name
FROM actor... | true |
ed7e8ba5528f9e09f24e8609edf49253c2e06441 | SQL | mh44698/Python-work | /SQL/Groupby.sql | UTF-8 | 580 | 4.71875 | 5 | [] | no_license | -- GROUP BY Syntax
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
SELECT COUNT(CustomerID), Country
FROM Customers
GROUP BY Country;
--The following SQL statement lists the number of customers in each country, sorted high to low:
SELECT COUNT(CustomerID), Count... | true |
100eaf5c0fe5deb775027f3777102ec853d028e4 | SQL | sircanist/clipper | /clipper-cli/src/main/resources/sql/dlvdb_schema.sql | UTF-8 | 5,632 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive |
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
drop table if exis... | true |
f35f6f629f33da166a8fb3ea526f03030f5907f5 | SQL | radtek/Oracle-4 | /SQL/Administração/!Script Leandro/Priv_gera_script_priv_para_role_ou_usuario.sql | WINDOWS-1250 | 1,320 | 3.078125 | 3 | [] | no_license | Prompt #############################################################
Prompt # #
Prompt # Indica quais os grants de uma determinada role #
Prompt # #
Prompt #####################################... | true |
1f63746bcf76c6065bc4e4fe194388def4696c1a | SQL | rezamatrix/Telefake | /db.sql | UTF-8 | 4,868 | 2.921875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 03, 2021 at 05:05 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
5eb63b31ea87b353c7b8faca9d36e07cb6605160 | SQL | LupitaSantos4/Reinscripciones | /inscricionesAPI/tec.sql | UTF-8 | 4,817 | 3.203125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `tec` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `tec`;
-- MySQL dump 10.13 Distrib 5.6.17, for Win32 (x86)
--
-- Host: 127.0.0.1 Database: tec
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.34-MariaDB
/*!40101 SET @OLD_CHARACTER_SET... | true |
d67c5b00396b15564c2dc1ed92edfc95315d9e9e | SQL | edoardoc/openspcoop2ondocker | /openspcoop2img/dist/sql/OpenSPCoop2.sql | UTF-8 | 84,703 | 2.96875 | 3 | [
"MIT"
] | permissive |
-- OpenSPCoop2
-- OpenSPCoop2
-- **** Repository Buste ****
CREATE TABLE REPOSITORY_BUSTE
(
ID_MESSAGGIO VARCHAR(255) NOT NULL,
TIPO VARCHAR(255) NOT NULL,
MITTENTE VARCHAR(255) NOT NULL,
IDPORTA_MITTENTE VARCHAR(255),
TIPO_MITTENTE VARCHAR(255) NOT NULL,
IND_TELEMATICO_MITT VARCHAR(255),
DESTINATARIO VAR... | true |
baa7124b2e449f8581b509b3209f297272aa587b | SQL | gableisure/easy_personal | /backend/db/sql.sql | UTF-8 | 3,552 | 3.671875 | 4 | [] | no_license | CREATE TABLE tbl_usuario (
int_idausuario SERIAL PRIMARY KEY NOT NULL,
vhr_email VARCHAR(30) NOT NULL UNIQUE,
vhr_senha VARCHAR(60) NOT NULL,
vhr_nome VARCHAR(20) NOT NULL,
vhr_sobrenome VARCHAR(20) NOT NULL,
dtt_nascimento VARCHAR(20) NOT NULL,
int_genero INT NOT NULL,
vhr_whatsapp VARCHAR(20) NOT NULL... | true |
290ffd00ea47ad90a11754b5a94046d6cf5bfc23 | SQL | UCLALibrary/sql-scripts | /Voyager/Circulation/SEL Geology Circ Report -2 RR-627.sql | UTF-8 | 2,503 | 3.71875 | 4 | [] | no_license |
SELECT DISTINCT
mm.display_call_no,
ib.item_barcode,
--bt.bib_format,
--bt.record_status,
--bt.encoding_level,
bt.title,
mi.item_enum,
bt.author,
bt.pub_dates_combined as pub_date,
bt.series,
ucladb.getallbibtag(bt.bib_id, '650') AS subjects,
--bt.begin_pub_date as pub_date,
--bt.bib_id,
(SELECT REPLACE(normal_headin... | true |
860bfc6cce08e1fa9f8733de993b1caa5f35a770 | SQL | chenshanghao/RestartJobHunting | /Database Exercise/Leetcode181_Employees Earning More Than Their Managers /mySolution.sql | UTF-8 | 258 | 3.71875 | 4 | [] | no_license | # Write your MySQL query statement below
Select E3.Name as Employee
From
(
Select E1.Id, E1.Name, E1.Salary, E1.ManagerId, E2.Salary as ManagerSalary
From Employee E1 left join Employee E2
On E1.ManagerId = E2. Id
) as E3
Where E3.Salary > E3.ManagerSalary;
| true |
1cd9891a7dfdfee3d09f3ff54208dbcaeddbdf5d | SQL | ClickHouse/ClickHouse | /tests/queries/0_stateless/00586_removing_unused_columns_from_subquery.sql | UTF-8 | 2,629 | 3.765625 | 4 | [
"Apache-2.0",
"BSL-1.0"
] | permissive | SET any_join_distinct_right_table_keys = 1;
SET joined_subquery_requires_alias = 0;
DROP TABLE IF EXISTS local_statements;
DROP TABLE IF EXISTS statements;
CREATE TABLE local_statements ( statementId String, eventDate Date, eventHour DateTime, eventTime DateTime, verb String, objectId String, onCourse UInt8, courseId... | true |
1c23c1486bdacb61e31f38093248ef5d54d523d8 | SQL | iaueos/lang | /sql/GetAllAppQuery.sql | UTF-8 | 770 | 4.25 | 4 | [
"MIT"
] | permissive | SELECT
des.[program_name],
des.login_name,
des.host_name -- ,
, dec.most_recent_sql_handle
, t.text
-- COUNT(des.session_id) [Connections]
FROM sys.dm_exec_sessions des
INNER JOIN sys.dm_exec_connections DEC
ON des.session_id = DEC.session_id
CROSS APPLY
sys.dm_exec_sql_text(dec.most_recent_sql_handle) AS t
WHERE... | true |
2fc163871176e1741a37166294a41fe5e61e92b6 | SQL | MikolD/medaase | /twitter.sql | UTF-8 | 15,510 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 13, 2021 at 03:16 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
69d1f55dba48b63162e20fe1b32d727f93d0ee2c | SQL | KagisoRKA/SQL | /SQL scripts/Part2/Part2.sql | UTF-8 | 1,136 | 3.515625 | 4 | [] | no_license | --Part2: QUERYING A DATABASE
--01.
SELECT * FROM customers;
--02.
SELECT first_name FROM customers;
--03.
SELECT first_name, last_name FROM customers WHERE customerid=1;
--04.
UPDATE Customers SET first_name= 'Lerato', last_name= 'Mabitso'
WHERE customerid=1;
--05.
DELETE FROM customers WHERE customerid=2;... | true |
179d7a170084fba7f5e71f4124d5f89b2dcb75d5 | SQL | ninedev90/cit225 | /oracle/lab2/apply_oracle_lab2.sql | UTF-8 | 51,926 | 4 | 4 | [] | no_license | -- ----------------------------------------------------------------------
-- Instructions:
-- ----------------------------------------------------------------------
-- The two scripts contain spooling commands, which is why there
-- isn't a spooling command in this script. When you run this file
-- you first connect to... | true |
51afcdfa91709e377bca04043bcdeec4418b7573 | SQL | AlifJamain/kindergarten-result-system | /tadika.sql | UTF-8 | 13,360 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 24, 2019 at 09:55 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
ea639ea0c1061ce5160ffa688b464446f85dd766 | SQL | DrewTbay/Exercise_DB | /Tables/exercise.sql | UTF-8 | 13,264 | 3.03125 | 3 | [] | no_license | \c exercise_db;
DROP TABLE IF EXISTS exercises CASCADE;
DROP SEQUENCE IF EXISTS exercise_id_seq CASCADE;
-- Sequence: exercise_id_seq
CREATE SEQUENCE exercise_id_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1;
-- Table: exercises
CREATE TABLE exercises
(
exercise_id integer NOT NULL DEFA... | true |
1239454950f4dc84dacea047e90b590a9d40b45e | SQL | Komalpreet05/database | /query2.sql | UTF-8 | 281 | 4 | 4 | [] | no_license | -- shows the customer that saw the most expencive menu
SELECT sub.ClientName, MAX(sub.MenuPrice) AS 'Price of menu'
FROM (
SELECT a.ClientName, SUM(o.price) AS 'MenuPrice' FROM customersMenuName AS a, dishes AS o
WHERE a.menu_code = o.menu_code
GROUP BY a.Client_id
) AS sub
| true |
d8de7d0a474135a46e6d6275caec9c9a2ad06c11 | SQL | ramsreeram/Books | /PT/antognini_pt_scripts/chapter06/subquery_coalescing.sql | UTF-8 | 2,102 | 3.453125 | 3 | [] | no_license | SET ECHO OFF
REM ***************************************************************************
REM ******************* Troubleshooting Oracle Performance ********************
REM ************************* http://top.antognini.ch *************************
REM ***************************************************************... | true |
4fe7154177ee41228c64dc9800cebf20b2400918 | SQL | hyh-sherry/sql-homework | /sql_files/query.sql | UTF-8 | 2,470 | 4.5 | 4 | [] | no_license | --1. List the following details of each employee:
--employee number, last name, first name, gender, and salary.
select e.emp_no, e.last_name, e.first_name, e.gender, s.salary
from employees e
join salaries s
on e.emp_no = s.emp_no;
--2. List employees who were hired in 1986.
select * from employees
where extract(ye... | true |
25d3583b4a029c41c8a8a835bd1ff20b61b15642 | SQL | srivalli85/maascreen | /sql/movies 30-05-09/reviews.sql | UTF-8 | 1,853 | 3.140625 | 3 | [] | no_license | /*
SQLyog Enterprise - MySQL GUI v7.15
MySQL - 5.0.51a-community-nt : Database - maascreen
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
... | true |
fe735418bac06184ba39610c6fa483d9a6faa7fa | SQL | OLINSolutions/eiservices | /mysql/RTW-JD-Res.sql | UTF-8 | 443 | 4.03125 | 4 | [] | no_license | SELECT
jdres.*
, h.*
, r.*
FROM
jockeysresults jdres
inner join horses h on (h.horsesid = jdres.horsesid)
inner join races r on (r.racesid = h.racesid)
WHERE
jdres.jockeysresultsracetag like concat('%',date_format(curdate(),'%Y%m%d'),'%')
order by jdres.jockeysresultsracetag, h.horsesprogramnumber desc... | true |
2d9f3b4ebbbde4515d8e9f233e0b98eb817697fd | SQL | alexand1r/SoftUni-Databases-Advanced-Entity-Framework | /homework/FetchingResultsWithADONet/5.ChangeTownNameCasing/Update.sql | UTF-8 | 122 | 2.59375 | 3 | [] | no_license | use MinionsDB
UPDATE Towns
SET TownName = UPPER(TownName)
WHERE TownName <> UPPER(TownName)
AND CountryName = @country | true |
13df72245d5f76bfb12db54b071f3c4e568f21af | SQL | seanburns76/SQL-Scripts | /Mills Dashboards/cost1.sql | UTF-8 | 233 | 3.21875 | 3 | [] | no_license |
select
from vinvoiced
(select * from
(
select ROW_NUMBER() over (partition by sflitm,sflitm order by sfdate asc) as seq,
sfdate,
sflitm,
sfuncs
from vInvoiced
where sflitm <> '' and sfuncs > 0) as x where x.seq % 2 = 0) as even
| true |
892b0bdebe248e497c6cb49219b93fddc78771d2 | SQL | Luiz-valdameri/employees-api-java | /src/main/resources/sql/criacao_db.sql | UTF-8 | 553 | 3.46875 | 3 | [] | no_license | CREATE DATABASE employees;
CREATE TABLE employee
(
email character varying,
id serial NOT null,
name character varying(30),
surname character varying(50),
nis bigint NOT NULL,
CONSTRAINT employee_pkey PRIMARY KEY (id),
CONSTRAINT proper_email CHECK (email::text ~* '^[A-Za-z0-9._%-]+@[A-Za-z... | true |
4db68f61d66f087efa1a56a085f0aa07057f4c37 | SQL | levelsix/MercenaryInc | /notinuse/sqls/createdb.sql | UTF-8 | 455 | 2.90625 | 3 | [] | no_license | USE c_cs108_cchan91;
DROP TABLE IF EXISTS users;
-- remove table if it already exists and start from scratch
-- footlength is in inches for the person. not inches of the shoe
CREATE TABLE users (
ID int NOT NULL AUTO_INCREMENT,
username VARCHAR(64),
password VARCHAR(64),
PRIMARY KEY (ID)
);
ALTER T... | true |
df0beb5d93e64309ee4c1894cdd4ebd85c86e11b | SQL | gandhiabhishek7007/Stage1 | /SQL Programming/Mandatory Hands-on/885123/Customer using HDFC bank/subquery3bms.sql | UTF-8 | 250 | 3.59375 | 4 | [] | no_license | Select distinct USERS.NAME,USERS.ADDRESS
FROM USERS
JOIN BOOKINGDETAILS
ON USERS.USER_ID=BOOKINGDETAILS.USER_ID
WHERE USERS.USER_ID not in(SELECT BOOKINGDETAILS.USER_ID
FROM BOOKINGDETAILS
where BOOKINGDETAILS.NAME IN('HDFC'))
ORDER BY USERS.NAME;
| true |
43e93a9f3bcf8031baa4bf8e03a0ecc72250df9e | SQL | HunterHans/Crawl | /init/init_schema.sql | UTF-8 | 3,912 | 2.8125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS default_database_/*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */;
USE default_database_;
-- MySQL dump 10.13 Distrib 8.0.15, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: chi_med_baike_lll
-- ------------------------------------------------------
-- Server v... | true |
bfa7c4d953731344e5885bf4ed0cbbce2e30206b | SQL | APochiero/DatabaseCatenaRistorazione | /Trigger/Tavolo/ContrAggTavolo.sql | UTF-8 | 294 | 3.078125 | 3 | [] | no_license | DROP TRIGGER IF EXISTS AggiornaTavolo;
DELIMITER $$
CREATE TRIGGER AggiornaTavolo
BEFORE UPDATE ON Tavolo FOR EACH ROW
BEGIN
IF (New.NumeroPosti<2) THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT='Attenzione Il Numero Dei posti deve essere maggiore o uguale a 2 ';
END IF;
END $$
DELIMITER ;
| true |
4303b9c2f52a5a6621cc669081c440be4ed1dbc4 | SQL | MikeO7/DBProject | /CreateTables.sql | UTF-8 | 3,226 | 3.71875 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS Test;
USE Test;
DROP TABLE IF EXISTS Customers;
DROP TABLE IF EXISTS Employees;
DROP TABLE IF EXISTS Products;
DROP TABLE IF EXISTS Orders;
DROP TABLE IF EXISTS Invoices;
DROP TABLE IF EXISTS ProductDetails;
DROP TABLE IF EXISTS Shippers;
DROP TABLE IF EXISTS Payments;
DROP TABLE IF EX... | true |
9eff3bac68cf07a2dfac47bce574b39f3740b02d | SQL | rabinacathrine/Lab-DDL-command-prograd-kabbadi-league | /ddl-pkl.sql | UTF-8 | 1,659 | 2.84375 | 3 | [] | no_license | -- PROGRESSION - 1
-- 1. **Create table city**
create table city
( id number(11),
name varchar(50) not null,
primary key(id)
);
-- 2. **Create table referee**
create table referee
( id number(11),
name varchar(50) not null,
primary key(id)
);
-- 3. **Create table innings**
create table innings
( id nu... | true |
e334bf17b0c1e56865237c00494f5e649e65503c | SQL | BurstSword/DWES | /NominasSpringBootFinal/sql/nominas.sql | UTF-8 | 2,910 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 18-01-2021 a las 07:49:58
-- Versión del servidor: 10.4.14-MariaDB
-- Versión de PHP: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!... | true |
8efac63ae46e7f10ef9ebf42e173291bea895e63 | SQL | C-F-K/sql-surplus | /bb resources/works as-is/users_and_modules_accessed.sql | UTF-8 | 840 | 3.875 | 4 | [] | no_license | /* a lits of all users and the modules they have accessed */
/* Note, this may take a few minutes to run */
/* Note, this makes use of the BB_BB60_STATS.ACTIVITY_ACCUMULATOR so check you last date in that to see
what date this query will run upto */
SELECT C.USER_ID, C.FIRSTNAME, C.LASTNAME, B.COURSE_NAME, B.COURSE... | true |
034a13b1192bf265c937846ca23e6bea82b3d82b | SQL | hellobobo1982/wxRobot | /Config/create.sql | UTF-8 | 5,235 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- 主机: 127.0.0.1
-- 生成日期: 2019-05-30 23:54:29
-- 服务器版本: 10.1.38-MariaDB
-- PHP 版本: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTE... | true |
17369d61358a3a3b1e5c578d185a3be0e1c46ee8 | SQL | lsb/1984-dissociated-text-local | /dissociated-text.sql | UTF-8 | 411 | 3.21875 | 3 | [] | no_license | with recursive quadgrams(ttl, w1, w2, w3, w4) as
(select 150, null, 'WAR', 'IS', 'PEACE'
union all
select ttl-1, w2, w3, w4,
(select g4.word from words g1, words g2, words g3, words g4 where g2.id = g1.id + 1 and g3.id = g2.id + 1 and g4.id = g3.id + 1 and g1.word = w2 and g2.word = w3 and g3.word =... | true |
f6226357706d799e9dc717efd88e582fee75cbd1 | SQL | yuliankhadaffi/Managemen_HRD | /DB/manajemen_hrd.sql | UTF-8 | 2,148 | 3.140625 | 3 | [] | no_license | /*
SQLyog Enterprise v13.1.1 (64 bit)
MySQL - 10.4.6-MariaDB : Database - manajemen_hrd
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FO... | true |
95d08a085197b323301c72472e8f3956feec7203 | SQL | lakepower/cray-api | /migrations/sqls/20180815052049-card-table-up.sql | UTF-8 | 361 | 2.546875 | 3 | [] | no_license | -- ----------------------------------------------------------------------------
-- Table cray.cards
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `cray`.`cards` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` TEXT NULL DEFAULT NULL,
`description` TEXT NU... | true |
fe71d1340672b397434c478a8b9441c019fc5445 | SQL | jhankee/leagueTracker | /documentation/view_Creations.sql | UTF-8 | 1,707 | 3.625 | 4 | [] | no_license | CREATE or Replace VIEW v_all_rosters AS
select division.divisionName AS 'Division Name',
team.teamName AS 'Team Name',
concat(player.playerLastName,', ',player.playerFirstName) AS 'Player Name'
from ((player join team on((player.teamID = team.teamID)))
join division on((team.divisionID = division.divisionID)))
orde... | true |
acef68a43342bb59298514c73db5b02697d34b4b | SQL | trohr02/sqlplus-commands | /scripts/lsmv.sql | UTF-8 | 1,121 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | /*
Author: Tomas Rohr, rohr.tomas@gmail.com
Last change date: 2017-09-01
*/
SET VERIFY OFF
/*
Do not prompt for substitution variables values.
Use null as default value for substitution variable.
*/
COLUMN 1 NEW_VALUE 1
COLUMN 2 NEW_VALUE 2
SET FEEDBACK OFF
SELECT NULL "1", NULL "2" FROM DUAL WHERE 1=0;
... | true |
85dfa929f96fc210a3425b444896b8313f9f7e48 | SQL | wangyao2221/LeetCode | /src/Database/Second Highest Salary.sql | UTF-8 | 717 | 4.25 | 4 | [] | no_license | # Create table If Not Exists Employee (Id int, Salary int);
# Truncate table Employee;
# insert into Employee (Id, Salary) values ('1', '100');
# insert into Employee (Id, Salary) values ('2', '200');
# insert into Employee (Id, Salary) values ('3', '300');
# Write your MySQL query statement below
# 测试用例中可以发现当数据只有一条时... | true |
b7b0844e1280a14d6fb127853efd6738379b2e30 | SQL | Fancy2m/WebMulti2 | /datenbanken.sql | UTF-8 | 9,481 | 3.390625 | 3 | [] | no_license | drop table if exists rating;
drop table if exists film;
drop table if exists director;
drop table if exists benutzer;
create table benutzer(
user_ID int not null primary key auto_increment,
username varchar(30),
passwort varchar(30),
vorname varchar (30),
nachname varchar (30),
geburtstag date,
... | true |
818c7cce70643797e9643a0395ae2ad46711270d | SQL | mathi123/mitasco | /migrations/sqls/20160516194303-tblGroup-users-up.sql | UTF-8 | 390 | 3.859375 | 4 | [] | no_license | CREATE TABLE group_user
(
id SERIAL PRIMARY KEY NOT NULL,
group_id INTEGER NOT NULL,
user_id INTEGER NOT NULL,
CONSTRAINT group_user_groups_id_fk FOREIGN KEY (group_id) REFERENCES groups (id) ON DELETE CASCADE,
CONSTRAINT group_user_users_id_fk FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE C... | true |
4fcf208ff4a4f9e184c83b29c1bc14fafcca71c3 | SQL | brooh2121/MySQlScripts | /скрипты Oracle/какие то скрипты/по старому распределению.sql | WINDOWS-1252 | 2,310 | 3.34375 | 3 | [] | no_license | SELECT * FROM RSA_EOSAGO.PTS_DISTRIBUTION_OLD pdo;
SELECT * FROM RSA_EOSAGO.PTS_DISTRIBUTION_HISTORY_OLD pdho;
SELECT * FROM RSA_EOSAGO.PRINCIPAL_DETERMINE_OLD pdo;
SELECT * FROM RSA_EOSAGO.INS_COMPANY ic WHERE ic.INS_COMPANY LIKE '%%';
--352 " "" 20600000
SELECT
ic.INS_COMPANY,
pdo.CALCULATION_DATE,
pdo.PRINCIPAL_... | true |
88b93923a75c1a349b25925591c2ed7a3642f890 | SQL | sgerodes/ProgrammingChallenges | /Leetcode/sql/Customers Who Never Order.sql | UTF-8 | 105 | 2.921875 | 3 | [] | no_license | SELECT name AS 'Customers'
FROM customers
WHERE id NOT IN
(
SELECT DISTINCT customerid FROM orders
); | true |
c4e035bb869cdc2e285a3102fd3fd5abccd33705 | SQL | yapengsong/documet | /02设计开发/01设计草稿/变更脚本(2016.1.6起)/20170405-6月版本第一轮测试/updateSQL2017-03-07-SSH密钥-ECSC新增权限.sql | UTF-8 | 4,900 | 2.75 | 3 | [] | no_license | -- 新增二级目录
INSERT INTO `sys_selfpower` (`power_id`,`power_name`,`power_url`,`power_route`,`power_sort`,`parent_id`,`power_desc`,`power_icon`)
VALUES(
REPLACE (uuid(), '-', ''),
'SSH密钥','','',
(SELECT ss.power_sort FROM sys_selfpower ss WHERE ss.power_name = '安全' AND ss.parent_id = '')+2000,
(SELECT ss.power_id F... | true |
576353fffabcc6fe48ef8a1ff50164f70c85499f | SQL | Rashikaguna/restaurantapp | /foodorderingsystem/3.stock_view.sql | UTF-8 | 458 | 3.875 | 4 | [] | no_license | /* create view to view stocks*/
CREATE VIEW view_stockdetails AS
SELECT foodtype.meal,food.food_name,(food_stocks.quantity-SUM(food_transaction.quantity)) AS remaining
FROM food JOIN food_stocks ON food.id=food_stocks.foodid
JOIN foodtype ON food_stocks.mealid=foodtype.id
JOIN food_transaction ON food_stocks.foo... | true |
608f64459c401d34c2a16c2db920086973355be7 | SQL | akrommusajid/dynamic-inventory | /database/hostgroups.sql | UTF-8 | 1,966 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 18, 2017 at 09:41 PM
-- Server version: 10.0.29-MariaDB-0ubuntu0.16.04.1
-- PHP Version: 7.0.18-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 S... | true |
cf842a7a54951d5a89551535e7ee7c87d69fcc1f | SQL | CUBRID/cubrid-testcases | /sql/_13_issues/_12_1h/cases/bug_bts_6591.sql | UTF-8 | 1,356 | 3.453125 | 3 | [
"BSD-3-Clause"
] | permissive | select TRIM('foo' FROM 'foo'), TRIM('foo' FROM 'foook'), TRIM('foo' FROM 'okfoo');
select TRIM('fo' FROM 'aasdfoo');
select trim('/' from '/abcd//\/');
select trim(both '/' from '/abcd//\/');
select trim(leading '/' from '/abcd//\/');
select trim(trailing '/' from '/abcd//\/');
--insert
create table foo(a varchar... | true |
cd6f4c42794416857f4eda1c81fb83f8c8bc5ec1 | SQL | mklv13/C-Sharp-DB-SoftUni | /MSSQL/06. Indices and Data Aggregation/3rd Highest Salary.sql | UTF-8 | 363 | 4.125 | 4 | [] | no_license | USE SoftUni
SELECT DepartmentID, MaxSalary
FROM (SELECT e.DepartmentID,
MAX(e.Salary) AS MaxSalary,
DENSE_RANK() OVER (PARTITION BY DepartmentID ORDER BY e.Salary DESC)
AS SalaryRank
FROM Employees as e
GROUP BY e.DepartmentID, e.Salary) AS SalaryRankingQue... | true |
52380cbb7b4b82dee2019848715ab0a688524eca | SQL | andymush/portal | /db/power.sql | UTF-8 | 7,464 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 14, 2019 at 01:04 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
2ff898f0c60e15a56ad94b2eaba909eb5aaad0de | SQL | JaimeVilches87/employee-tracker | /db/seeds.sql | UTF-8 | 759 | 3.390625 | 3 | [] | no_license | use employees;
INSERT INTO department
(name)
VALUES
('Executive'),
('Engineering'),
('Sales'),
('HR');
INSERT INTO role
(title, salary, department_id) VALUES
('Sales', 20000, 1),
('Accountant', 4000, 1),
('Lead Engineer', 80000, 2),
('HR Rep', 90000, 2),
('Account Manager', 20... | true |
9da7a70df21fbffca2b7cb791da423a6e93d842a | SQL | j7ng/CLFY_SA | /SA/Tables/TABLE_INV_LOCATN.sql | UTF-8 | 3,781 | 3.140625 | 3 | [] | no_license | CREATE TABLE sa.table_inv_locatn (
objid NUMBER,
location_name VARCHAR2(40 BYTE),
location_descr VARCHAR2(80 BYTE),
reports_to_loc VARCHAR2(20 BYTE),
gl_acct_no VARCHAR2(20 BYTE),
owner_type NUMBER,
inv_type NUMBER,
location_type VARCHAR2(20 BYTE),
trans_auth NUMBER,
loc_serv_level VARCHAR... | true |
a611c7598a997119ebc0cd7286d1dda96eabc427 | SQL | pulliam/persephone | /unit_b/w07/d02/classwork/domain_modeling/hogwarts_schema.sql | UTF-8 | 321 | 2.734375 | 3 | [] | no_license | DROP TABLE IF EXISTS wizards;
DROP TABLE IF EXISTS spells;
DROP TABLE IF EXISTS spells_wizards;
CREATE TABLE wizards (
id INTEGER PRIMARY KEY,
name VARCHAR
);
CREATE TABLE spells (
id INTEGER PRIMARY KEY,
name VARCHAR,
is_deadly BOOLEAN
);
CREATE TABLE spells_wizards (
spell_id INTEGER,
wizard_id INTEGER
)... | true |
6ddbd81a9a231fa60ecc82fc726f232321b54cbf | SQL | VijayMVC/JCC-Data-Warehouse | /SQLDB/dbo/Views/AA_REP_POP_BATCHED_ORDERS_VIEW.sql | UTF-8 | 1,053 | 2.875 | 3 | [] | no_license | CREATE VIEW AA_REP_POP_BATCHED_ORDERS_VIEW
/*
** Written: 16/01/2006 RV
** Last Amended:
** Comments: returns batched purchase orders for self audit crystal reports
*/
AS
SELECT
POP_DETAIL.POD_ORDER_NO,
POP_DETAIL.POD_DATE,
POP_DETAIL.POD_ACCOUNT,
POP_DETAIL.POD_TYPE,
POP_DETAIL.... | true |
aeba9b03dc3b06063f6070313322a806b01c34da | SQL | fajarhq/weddings-API | /wedding.sql | UTF-8 | 5,082 | 2.9375 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : alldb
Source Server Type : MySQL
Source Server Version : 100413
Source Host : localhost:3306
Source Schema : wedding
Target Server Type : MySQL
Target Server Version : 100413
File Encoding : 65001
Date: 07/08/2020 09:2... | true |
56aae0cc9ee30235cda891d64a3037b2d3483429 | SQL | deoooo/airbyte-dbt-custom | /models/generated/airbyte_ctes/public/poke_pokemon_types_ab1.sql | UTF-8 | 720 | 2.984375 | 3 | [] | no_license | {{ config(schema="_airbyte_public", tags=["nested-intermediate"]) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
{{ unnest_cte('poke_pokemon', 'poke_pokemon', adapter.quote('types')) }}
select
_airbyte_poke_pokemon_hashid,
{{... | true |
d222a3d6ff20ca1fde43921b4949081305203d09 | SQL | srawlins/Kuali-Coeus-3.1-DB-Scripts | /KC-RELEASE-3_0-CLEAN/oracle/kcrelease/datasql/PROTO_CORRESP_TEMPL.sql | UTF-8 | 929,813 | 2.78125 | 3 | [] | no_license | TRUNCATE TABLE PROTO_CORRESP_TEMPL DROP STORAGE
/
INSERT INTO PROTO_CORRESP_TEMPL (COMMITTEE_ID,CORRESPONDENCE_TEMPLATE,FILE_NAME,OBJ_ID,PROTO_CORRESP_TEMPL_ID,PROTO_CORRESP_TYPE_CODE,UPDATE_TIMESTAMP,UPDATE_USER,VER_NBR)
VALUES ('DEFAULT',EMPTY_CLOB(),'DEFAULT-1-ApprovalLetter.xsl','9CD01EA17C569DADE040DC0A1F8A714D'... | true |
5dd2940ad64a895e158c91ae0a20dbde3d90df62 | SQL | SonuShaikh/Oracle-DBA | /SQL DEV/2019/AUDIT_TRIGGER.sql | UTF-8 | 1,244 | 3.46875 | 3 | [] | no_license | -- AUDIT TRIGGER
CREATE TABLE SUPERHEROS (sp_name VARCHAR2(30));
CREATE TABLE sp_audit(
new_name VARCHAR2(30),
old_name VARCHAR2(30),
user_name VARCHAR2(30),
opr_date VARCHAR2(30),
operation VARCHAR2(30));
-- TRIGGER
CREATE OR REPLACE TRIGGER superheros_audit
BEFORE INSERT OR DEL... | true |
fbca876cf9d4b83a37a65373393c04d1735b1957 | SQL | Needrima/mysql-scripts | /LIKE operator.sql | UTF-8 | 725 | 3.765625 | 4 | [] | no_license | -- the LIKE operator
-- used to get matches with a particular string
-- two commonly used characters with the LIKE operator are "%" and "_"
SELECT *
FROM customers
WHERE last_name
LIKE "b%"; -- give customers with last name starting from b(case insensitive)
-- "%d" results with specified field ending with "d"
-- "... | true |
86e783afb74e92d9a5f7fca67571a0aff966f3b8 | SQL | Bobert127/python_and_postgresql | /ownerlern/day4_2.sql | UTF-8 | 1,393 | 3.8125 | 4 | [] | no_license | CREATE DATABASE exercises_db_day4;
SELECT * FROM customer;
SELECT * FROM address;
SELECT * FROM customer, address;
SELECT * FROM customer, address WHERE customer.id = address.customer_id;
-- (SELECT * FROM) (customer, address) WHERE (customer.id = address.customer_id);
-- (SELECT * FROM) (customer JOIN address... | true |
973f1769494295206b52ebf7fb491339b34cb2cd | SQL | AgusVelez5/BaseDeDatos2 | /Clase6.sql | UTF-8 | 2,457 | 3.96875 | 4 | [] | no_license | -- Ejercicio 1
SELECT f1.last_name, f1.first_name
FROM actor f1
WHERE last_name IN(SELECT last_name
FROM actor f2
WHERE f1.last_name = f2.last_name AND f1.actor_id <> f2.actor_id)
ORDER BY 1
-- Ejercicio 2
SELECT first_name, last_name
FROM actor f1
WHERE f1.actor_id NOT IN(SELECT DISTINCT actor_id
F... | true |
46aecbf16cd17b584db9c61c0ca3db16420863c4 | SQL | prashantbhargava2311/SQL-country-club | /1584480990_SQLTasks_Tier_2.sql | UTF-8 | 10,980 | 4.28125 | 4 | [] | no_license | /* Welcome to the SQL mini project. You will carry out this project partly in
the PHPMyAdmin interface, and partly in Jupyter via a Python connection.
This is Tier 2 of the case study, which means that there'll be less guidance for you about how to setup
your local SQLite connection in PART 2 of the case study. This w... | true |
25e7a26845e3902fb9d67949bc1d1700717c7a36 | SQL | ankitsilaich/shiningfloor | /main_site/db/shiningfloor.sql | UTF-8 | 7,606 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 12, 2015 at 03:07 PM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... | true |
f7c7b941591c657f813d2f29468550f7c943453d | SQL | yamasy1549/akashi_cafeteria | /postgres/createdb.sql | UTF-8 | 333 | 2.625 | 3 | [] | no_license | /*
本番サーバでは既に実行済み
- user作成
- DB作成
- userのDBへの紐づけ
*/
\set db_name `echo "$DB_NAME"`
\set db_user `echo "$DB_USER"`
\set db_pass `echo "$DB_PASS"`
create user :db_user login password :'db_pass';
create database :db_name;
grant all privileges on database :db_name to :db_user;
| true |
b17ba3013561e2f8833f761615c1f3dc987e4fad | SQL | grouault/howto | /sgbd/sqlserver/how-to/how-to-format-date.sql | UTF-8 | 263 | 2.703125 | 3 | [] | no_license | -- convertir une date au format dd/mm/yyyy
CONVERT(char(10), co.date_cde, 103) as date_cmd,
-- convertir une date au format yyyy-MM-dd
SELECT CONVERT(NVARCHAR, GETDATE(), 23)
-- convertir une date au format dd/MM/yyyy
SELECT CONVERT(NVARCHAR, GETDATE(), 103) | true |
ccddb660679072e6f1c8b411538601e5521f1fb5 | SQL | ShartepStudy/SQL | /11.04.15/query/podzapros_4.sql | WINDOWS-1251 | 311 | 3.28125 | 3 | [] | no_license | -- , Odessa
USE Petrash
SELECT name FROM Products
WHERE id_producer IN (
SELECT id FROM Producer
WHERE id_address IN (
SELECT id FROM [Address]
WHERE id_city IN (
SELECT id FROM City
WHERE name Like 'Odessa'
)
)
) | true |
b889242eed63c68063b028add6866f337fc11018 | SQL | Jrtg97/Prueba | /usuarios/usuarios.sql | UTF-8 | 1,398 | 2.796875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 25-09-2018 a las 13:59:38
-- Versión del servidor: 5.7.19
-- Versión de PHP: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... | true |
425e5f96a511cc6ce8660f1c1396d44870927ff1 | SQL | JonathanJGQ/springbootRest | /algamoney-api/src/main/resources/db/migration/V02__criar_tabela_pessoa.sql | UTF-8 | 999 | 2.890625 | 3 | [] | no_license | CREATE TABLE pessoa (
codigo BIGSERIAL PRIMARY KEY,
nome VARCHAR(50) NOT NULL,
ativo BOOLEAN NOT NULL,
logradouro VARCHAR(150),
numero VARCHAR(10),
complemento VARCHAR(100),
bairro VARCHAR(50),
cep VARCHAR(50),
cidade VARCHAR(50),
estado VARCHAR(50)
);
INSERT INTO pessoa (nome,ativo,logradouro,numero,complem... | true |
e5c3103287be0b636671da75eb55754f74750986 | SQL | romana0819/ct-kea-2021-gr37 | /ddl_statements.sql | UTF-8 | 3,399 | 4.1875 | 4 | [] | no_license |
-- creating database named module4_quiz
CREATE SCHEMA IF NOT EXISTS `module4_quiz` DEFAULT CHARACTER SET utf8mb4 ;
-- using the newly created database
USE `module4_quiz`;
-- creating Table `user`, only in case it does not exist yet, with columns and specifying the data types
CREATE TABLE IF NOT EXISTS `module4_quiz`... | true |
6058e5c8093a8f373601658ab4db4fb81f2badc7 | SQL | pagotarane/program_for_reffer | /mysql/Demo/L10/fact.sql | UTF-8 | 448 | 3.453125 | 3 | [] | no_license | -- factorial of number
delimiter $$
drop procedure if exists fact $$
create procedure fact(num bigint)
begin
declare f bigint default 1;
declare i int default 1;
if (num < 0) then
select 'be +ve' as MSG;
elseif (num = 0 or num = 1) then
select 'fact = 1' as MSG;
else
aa :loop
begin
set f = f * i;
set i =... | true |
8ab21c79f312134b8daf7e27289f1aed1f8b809e | SQL | vijaydairyf/TimelyFish | /SolomonApp/dbo/Views/dbo.pjdirutl.sql | UTF-8 | 385 | 3.09375 | 3 | [] | no_license |
create view pjdirutl as
select a.employee employee,
a.fiscalno fiscalno,
round(sum(round(a.units,2)),2) units,
round(sum(round(a.cost,2)),2) cost,
round(sum(round(a.revenue,2)),2) revenue,
round(sum(round(a.adjustments,2)),2) adjustments
from pjutlrol a, pjuttype b
where a.utilization_type = b.utilization_... | true |
636f09b48c7280127e666478eb700022d3c4e48b | SQL | fadikamohamed/sqlP6 | /sqlP6.sql | UTF-8 | 496 | 3.484375 | 3 | [] | no_license | -- Affichage des frameworks qui ont une version 2.x (x etant un nombre)--
SELECT `id`, `framework`, `version`
FROM `frameworks`
WHERE `version`
LIKE '2.%';
-- Affichage des frameworks ayant pour id 1 et 3 --
SELECT `id`, `framework`, `version`
FROM `frameworks`
WHERE `id`='1'
OR `id`='3';
-- Affichage des frameworks ... | true |
23667cb4e46d2d0f9e61eaac88ed380db65296d5 | SQL | mtejas88/esh | /Projects_SotS_2017/upgrades/no_low_cost/dist_upgraded_at_no_low_cost.sql | UTF-8 | 444 | 3.453125 | 3 | [] | no_license |
select count(a.esh_id) from
public.fy2017_districts_deluxe_matr a
left join public.fy2016_districts_deluxe_matr b
on a.esh_id = b.esh_id
where
a.include_in_universe_of_districts = 'True'
and a.district_type = 'Traditional'
and a.upgrade_indicator = 'True'
and a.exclude_from_ia_analysis = 'False'
and a.exclude_from_ia_... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.