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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3c0b5ece182536539a46299ecb0aac9e748b89cf | SQL | vctrmarques/interno-rh-sistema | /rhServer/src/main/resources/db/migration/V1_2019_10_17_14_27__ALTER_TABLE_FOLHA_PAGAMENTO_CONTRACHEQUE_VERBA.sql | UTF-8 | 783 | 2.96875 | 3 | [] | no_license | -- Flávio Silva
-- Alteração da tabela folha_pagamento_contracheque_verba excluir a coluna situacao e adicionar a coluna folha_pagamento_contracheque_id.
if col_length('folha_pagamento_contracheque_verba', 'folha_pagamento_contracheque_id') is null
begin
alter table folha_pagamento_contracheque_verba add f... | true |
de7f1f356c4713f0543c41737dc460a70f31daaa | SQL | jQSfire125/price-transparency-tx | /src/migrations/public/V0002__hospital.sql | UTF-8 | 508 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE hospital
(
hospital_id BIGINT NOT NULL,
hospital_name VARCHAR(500),
hospital_npi VARCHAR(15),
city VARCHAR(50) NULL,
state VARCHAR(2) NULL,
affiliation VARCHAR(100) NULL,
pricing_url VARCHAR(500) NULL,
designati... | true |
42bf88974d4fb5bc47e6f19d4ec0ebed5106f727 | SQL | Zeke-Y-Liu/StreetRanger | /Ranger/collector/src/main/resources/scripts/initial.sql | UTF-8 | 4,806 | 3.703125 | 4 | [] | no_license | SET PASSWORD FOR 'root'@'localhost' = PASSWORD('dilip987');
SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('dilip987');
CREATE DATABASE IF NOT EXISTS `ranger`;
CREATE USER 'rangeruser'@'%' IDENTIFIED BY PASSWORD '*ACBBAB38251D9F16850BC013ECFD77F4B063346A';
CREATE USER 'rangeruser'@'localhost' IDENTIFIED BY PASSWO... | true |
1bc50905f4955013a7f1dbc1179f0b11b4ef0018 | SQL | gregeng/model-kickstarter | /joins.sql | UTF-8 | 1,556 | 4.53125 | 5 | [] | no_license | -- Select the titles of all projects and their pledge amounts.
SELECT projects.title, SUM(pledges.amount) AS 'total project pledge amount' FROM projects
JOIN pledges ON projects.id = pledges.project_id
GROUP BY projects.title;
-- Select the user name, age, and pledge amount for all pledges.
SELECT pledges.id AS 'ple... | true |
6af89fa540f30ab405ef224410649dca98f320ba | SQL | sir-omoreno/sql-challenge | /import_data_query.sql | UTF-8 | 757 | 2.90625 | 3 | [] | no_license |
-- Importing data from csv files locally. FUll path for reference.
COPY employees
FROM 'C:\Users\Oswaldo Moreno\Desktop\homework\sql-challenge\data\employees.csv'
DELIMITER ','
CSV HEADER;
COPY departments
FROM 'C:\Users\Oswaldo Moreno\Desktop\homework\sql-challenge\data\departments.csv'
DELIMITER ','
CSV HEADER;
C... | true |
15b9b49c5a0df4cbc5e03131a6ad7152e05eff48 | SQL | rn0614/SQL_ORACLE | /OUTER JOIN 예제.sql | UHC | 679 | 3.625 | 4 | [] | no_license | -- (LEFT)
SELECT *
FROM client C
LEFT OUTER JOIN bookSale BS ON C.clientNo = BS.clientNo
ORDER BY C.clientNo;
SELECT*FROM CLIENT
-- (RIGHT)
SELECT *
FROM client C
RIGHT OUTER JOIN bookSale BS ON C.clientNo = BS.clientNo
ORDER BY C.clientNo;
-- FULL OUTER JOIN
SELECT *
FROM client C
... | true |
aa01ff8f4159721ff4c7c34c96cacef5ea50df11 | SQL | pandyagunjan/jpa-entity-manager-pandyagunjan | /src/cd.sql | UTF-8 | 1,453 | 2.546875 | 3 | [] | no_license | create table cd (
id INT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(50),
description VARCHAR(100),
yearofrelease INT,
artist VARCHAR(50),
price INT
);
insert into cd (title, description, yearofrelease, artist, price) values ('Sonair', 'Sonair Music CD.', 1986, 'Pierce', 24);
insert into cd (title, description, yea... | true |
446230d8e4c33bbd0b839aec316913897ce6b787 | SQL | csteelatgburg/K1000-Database-Queries | /ticket counts per top level category.sql | UTF-8 | 266 | 3.75 | 4 | [] | no_license | -- Count of tickets per top level categories
SELECT SUBSTRING_INDEX(HD_CATEGORY.NAME, "::", 1) AS TopCategory, COUNT(HD_TICKET.ID) FROM ORG1.HD_TICKET
JOIN HD_CATEGORY ON HD_CATEGORY.ID = HD_TICKET.HD_CATEGORY_ID
WHERE HD_TICKET.HD_QUEUE_ID = 2
GROUP BY TopCategory
| true |
74b79713bf98da95867621c2c71f2be635bca05b | SQL | Western-OWL/sakai | /config/sql/202-owl61-to-223-owl1-oracle-conversion-step-2.sql | UTF-8 | 821 | 2.828125 | 3 | [
"ECL-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"GPL-1.0-or-later",
"LicenseRef-scancode-generic-cla"
] | permissive | -----------------------------------------------------------------------
-- STEP 2: Oracle conversion script for OWL 20.2-owl6.1 to 22.3-owl1 --
-----------------------------------------------------------------------
-- You must run the poll order backfill job before running this script --
-- OWL: clean up remaining or... | true |
cbedd2bffc84e4f5a6e7d6b89569ae6bbd37b382 | SQL | RobertDurfee/Flights | /Schedule/SelectArrivalSchedules.sql | UTF-8 | 725 | 3.75 | 4 | [
"MIT"
] | permissive | USE `Schedule`;
SELECT `Flight`.`ICAONumber` AS `FlightNumber`,
`Schedule`.`Status` AS `Status`,
`Departure`.`ICAOCode` AS `Departure`,
`Arrival`.`ICAOCode` AS `Arrival`,
`Departure`.`ScheduledTime` AS `ScheduledDeparture`,
`Arrival`.`ScheduledTime` AS `ScheduledArrival`,
`Dep... | true |
c750c4097214f80f7b9e7bcfa4e8e72ead0547aa | SQL | nedsanchezca/ProyectoBases2 | /BDBank/SchemaBank.sql | UTF-8 | 954 | 2.625 | 3 | [] | no_license | /* ---------------------------------------------------- */
/* BANCO BDBANCO */
/* sentencias para la creación del esquema */
/* Ejecutar usando un usuario DBA como system */
/* ---------------------------------------------------- */
CREATE TABLESPACE DEF_BDBANC... | true |
ec42dc61e619e349b7055e0c7c57b6fe4211d973 | SQL | 83Fer/EjemploApi | /cliente.sql | UTF-8 | 2,242 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 06-06-2017 a las 23:07:14
-- Versión del servidor: 10.1.10-MariaDB
-- Versión de PHP: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... | true |
62e77987aaee6a36fc8c3070bd28e2149ff040c9 | SQL | ykrsm/MYM | /mysql/dbproject-triggers.sql | UTF-8 | 710 | 3.5625 | 4 | [] | no_license | DELIMITER |
create trigger pastappt
after update on Appointments
for each row
begin
if (new.date_time < now())
delete from Appointments
where date_time = new.date_time;
end if;
end;
DELIMITER ;
DELIMITER //
create trigger insAgent
before insert on Agent
for each row
begin
if (select * from User where ne... | true |
9e71c0b0905204dc67b11ce9197e5be1085edc3b | SQL | etudes-inc/etudes-lms | /gradebook/app/business/src/sql/mysql/sakai_gradebook_2.2..x_to_2.3.sql | UTF-8 | 481 | 2.65625 | 3 | [
"ECL-1.0",
"Apache-2.0"
] | permissive | -- Gradebook table changes between Sakai 2.2.* and 2.3.
-- Add spreadsheet upload support.
create table GB_SPREADSHEET_T (
ID bigint(20) NOT NULL auto_increment,
VERSION int(11) NOT NULL,
CREATOR varchar(255) NOT NULL,
NAME varchar(255) NOT NULL,
CONTENT text NOT NULL,
DATE_CREATED datetime NOT NULL,
GRA... | true |
2b02ded8221ae349e7a7dc1fb7d830ebf29b93bc | SQL | AdrianMladenov/Databases-Basics- | /01.Data Definition and Datatypes/Car-Rental-Database.sql | UTF-8 | 2,876 | 3.640625 | 4 | [] | no_license | CREATE TABLE Categories
(
Id INT PRIMARY KEY IDENTITY,
CategoryName NVARCHAR(100) NOT NULL,
DailyRate MONEY NOT NULL,
WeeklyRate MONEY NOT NULL,
MonthlyRate MONEY NOT NULL,
WeekendRate MONEY NOT NULL
)
CREATE TABLE Cars
(
Id INT PRIMARY KEY IDENTITY,
PlateNumber NVARCHAR(MAX) NOT NULL,
Manufacturer NVARCHAR(MAX) NOT N... | true |
4fa1e3ef9f603f280b18bec09b20f85143c54a8d | SQL | KainyRyu/CodeLab-Nest-Prisma | /prisma/migrations/20210527102548_/migration.sql | UTF-8 | 1,043 | 3.796875 | 4 | [] | no_license | -- CreateTable
CREATE TABLE `Booklist` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`label` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Book` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`title` VARCHAR(191) NOT NULL,
... | true |
54878b6d050cbaf1698ddb711ffed3f5d8adcd20 | SQL | chu3sao/SQL | /zszq_SQL/嘉扬/02 人员发展/24 业绩考核/pVW_pEMPTrgtRspCntrMM.sql | UTF-8 | 1,458 | 3.796875 | 4 | [] | no_license | -- pVW_pEMPTrgtRspCntrMM
select a.TRCMonth as TRCMonth,a.ProcessID as ProcessID,a.EID as EID,b.Badge as Badge,b.Name as Name,a.KPIID as KPIID,b.CompID as CompID,b.DepID1st as DepID1st,b.DepID2nd as DepID2nd,b.JobTitle as JobTitle,a.TRCBeginDate,a.TRCEndDate,
c.TRCKPI,d.TRCKPIActual
from pEMPTrgtRspCntrMM a
inner join ... | true |
261c5635975e85e2e3ad2385586841bbc18bdb4d | SQL | mattermost/mattermost-data-warehouse | /transform/mattermost-analytics/models/staging/salesforce/stg_salesforce__user.sql | UTF-8 | 1,100 | 3.125 | 3 | [] | no_license |
with source as (
select * from {{ source('salesforce', 'user') }}
),
renamed as (
select
id as user_id,
-- Foreign keys
managerid as manager_id,
profileid as profile_id,
userroleid as user_role_id,
-- Personal info
name,
firstname as first_n... | true |
0c84b25c341b40a6306bbabe2371104e45975f06 | SQL | real-chiu/SQl-Base-english-2019-10-12-6-15-6-811 | /sql.sql | UTF-8 | 1,096 | 3.953125 | 4 | [] | no_license | CREATE TABLE student (
id int NOT NULL,
name varchar(255) NOT NULL,
age INT NOT NULL,
sex VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO student VALUES (001, 'zhangsan', 18, 'male');
INSERT INTO student VALUES (002, 'lisi', 20, 'female');
CREATE TABLE subject (
id int NO... | true |
01edd9de822f3fab5f94d457edb8e72aac3f20a4 | SQL | johndpope/spy611scripts | /script/horiz.sql | UTF-8 | 2,596 | 4.53125 | 5 | [] | no_license | --
-- ~/spy611/script/horiz.sql
--
-- I use this script to demo how to get horizontal distance from 52wk max.
-- I Start by getting the value of the 52wk max for each day in the past.
DROP TABLE h10;
CREATE TABLE h10 AS
SELECT
ydate
,closing_price cp
,MAX(closing_price) OVER (ORDER BY ydate ROWS BETWEEN 250 PRECEDI... | true |
94e8953ccb8d5869c492fc09c3e894957684d406 | SQL | geekyouth/ClickHouse | /tests/queries/0_stateless/00500_point_in_polygon_non_const_poly.sql | UTF-8 | 5,363 | 3.421875 | 3 | [
"Apache-2.0"
] | permissive | DROP TABLE IF EXISTS polygons;
SELECT 'Const point; No holes';
create table polygons ( id Int32, poly Array(Tuple(Int32, Int32))) engine = Log();
INSERT INTO polygons VALUES (1, [(0, 0), (10, 0), (10, 10), (0, 10)]);
INSERT INTO polygons VALUES (2, [(-5, -5), (5, -5), (5, 5), (-5, 5)]);
SELECT pointInPolygon((-10, 0... | true |
2ff29271d79e2c2a41390319671941715b12a5a7 | SQL | emailbox/attached_app | /schema.sql | UTF-8 | 765 | 3.453125 | 3 | [] | no_license |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS `f_collections` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`key` varchar(255) CHARACTER SET latin1 NOT NULL,
`created` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `url` (`key`),
KEY `user_id` (`user_id`)
) ENG... | true |
052294f4bc0e5cd2d00903e25c2d3ebd72076ae2 | SQL | Luis310C/add1 | /id.sql | UTF-8 | 1,030 | 3.578125 | 4 | [] | no_license | CREATE TABLE Menu(
Codigo_Menu bigInt Primary Key,
Nombre text Not Null,
UNIQUE(Nombre)
);
CREATE TABLE Perfil(
Codigo_Perfil bigInt Primary Key,
perfil text,
Codigo_menu bigint REFERENCES menu(Codigo_Menu),
);
CREATE TABLE OpcionesMenu(
Codigo_OpcionesMenu bigInt Primary Key,
OpcionesMenu text not null,
codigo_menu... | true |
43ef01d65f3b8e756a55112020477c23bf9e0b2f | SQL | AlexandraLup/M | /pachete/operatii_angajati.sql | UTF-8 | 7,826 | 2.9375 | 3 | [] | no_license | -- package destinat mnagementului angajatilor
create or replace package operatii_angajati as
function add_angajat(p_id_angajat in angajati.id%TYPE, p_nume_angajat angajati.nume%TYPE, p_prenume_angajat angajati.prenume%TYPE, p_functie angajati.functie%TYPE, p_adresa_magazin angajati.id_magazin%TYPE,p_salariu angajati.... | true |
f59e0ed2cc08e3d3f189526d184a2e7e271a88bb | SQL | owarodomo99/projectxxx | /complete-blog-php.sql | UTF-8 | 5,133 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 28, 2020 at 04:27 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
0df9912b00f8ef7c1775c3ab1c4816393f1ec755 | SQL | mrtasln/Social_Network_Site | /veritabanı tablo kodları/giris.sql | UTF-8 | 1,377 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Anamakine: localhost
-- Üretim Zamanı: 07 Ara 2013, 15:03:00
-- Sunucu sürümü: 5.6.12-log
-- PHP Sürümü: 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 |
f84f5c0bbc9635172985a2d4e866c6c7f75a86b2 | SQL | Nor348303/GroupProjectICT602 | /server_side/location/db.sql | UTF-8 | 6,144 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 28, 2021 at 01:18 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
6a6e6e17d6ce7ad29350a82652f86c24ffb6a7f2 | SQL | mariatsji/pubchess_web | /conf/evolutions/default/1.sql | UTF-8 | 252 | 2.734375 | 3 | [] | no_license | # Player schema
# --- !Ups
CREATE SEQUENCE player_id_seq;
CREATE TABLE player (
id integer NOT NULL DEFAULT nextval('player_id_seq'),
name varchar(255),
currentElo float
);
# --- !Downs
DROP TABLE player;
DROP SEQUENCE player_id_seq;
| true |
bc10f8b4b73db6e66a75027156ba21dcde660b0e | SQL | lxqlx/cs4221_generator | /cs4221_data.sql | UTF-8 | 63,388 | 2.859375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 25, 2015 at 11:32 PM
-- Server version: 5.5.41-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... | true |
91d6ce8515a20c2decd39155cb7307e237900f86 | SQL | Archangelix/dummyLibrary | /db/DCR_USERADMIN.sql | UTF-8 | 990 | 2.796875 | 3 | [] | no_license | DELETE FROM USER_ROLE WHERE SEQNO IN (1,2);
INSERT INTO USER_ROLE (SEQNO, NAME, CREATE_USERCODE, CREATE_TIMESTAMP, AUDIT_USERCODE, AUDIT_TIMESTAMP, AUDIT_REASON)
VALUES (1, 'ADMINISTRATOR', 'ADMIN', now(), 'ADMIN', now(), 'INITDB');
INSERT INTO USER_ROLE (SEQNO, NAME, CREATE_USERCODE, CREATE_TIMESTAMP, AUDIT_USERCO... | true |
cff23dd38083530c94374d6867850194487e92a7 | SQL | gcoronelc/UCV_PROG-OO_2017-2 | /Sem07/SQLQuery1.sql | UTF-8 | 226 | 3.015625 | 3 | [] | no_license | select * from tarifa;
select * from curso;
select c.IdCurso, t.IdTarifa, t.Descripcion nomtarifa,
c.NomCurso, t.PrecioVenta, t.Horas, t.PagoHora
from Tarifa t join Curso c
on t.IdTarifa = c.IdTarifa
where t.IdTarifa = 'C';
| true |
dbd49f810f23ccd6cb6a4bf99e6b12be06b4dd74 | SQL | yashshah1/workshop | /part-ii/commands.sql | UTF-8 | 666 | 2.96875 | 3 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS `workshop`;
CREATE DATABASE IF NOT EXISTS `workshop` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `workshop`;
DROP TABLE IF EXISTS `tasks`;
CREATE TABLE IF NOT EXISTS `tasks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`task` varchar(128) NOT NULL,
`status` int(11) NOT ... | true |
1dc41969688fc04f2e788049bcf3e5a7208b9501 | SQL | xIntegro/xIntegro-Core | /application/modules/setup/sql/012_1.4.0.sql | UTF-8 | 2,698 | 3.234375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # Discounts
ALTER TABLE `xc_quotes`
ADD COLUMN `quote_discount_amount` DECIMAL(20, 2) NOT NULL DEFAULT 0
AFTER `quote_number`,
ADD COLUMN `quote_discount_percent` DECIMAL(20, 2) NOT NULL DEFAULT 0
AFTER `quote_discount_amount`;
ALTER TABLE `xc_quote_item_amounts`
ADD COLUMN `item_discount` DECIMAL(20, 2) NOT NULL DEFA... | true |
6c3295f5ce5c9b87dedb9fb46e57a8d8b2d38de4 | SQL | chuyal/Interactuando-con-Bases-de-Datos | /Version PHP/nextu_agenda_db.sql | UTF-8 | 3,077 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 20-08-2018 a las 04:15:59
-- Versión del servidor: 10.1.34-MariaDB
-- Versión de PHP: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
b5e7b520e073d43ad8503aca97f565072c37205a | SQL | batego/db_fintra | /fintra/etes/Tables/etes.tipo_novedad.sql | UTF-8 | 626 | 3.3125 | 3 | [] | no_license | -- Table: etes.tipo_novedad
-- DROP TABLE etes.tipo_novedad;
CREATE TABLE etes.tipo_novedad
(
id serial NOT NULL,
reg_status character varying(1) NOT NULL DEFAULT ''::character varying,
dstrct character varying(4) NOT NULL DEFAULT 'FINV'::character varying,
id_proserv integer NOT NULL,
descripcion character... | true |
0c5d0bf8040ac658f4bbe6dc4ce226dd36862c79 | SQL | SanjanaKoka/DoctorsNote | /Database/Conversation_has_User.sql | UTF-8 | 620 | 3.15625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `DoctorsNote`.`Conversation_has_User` (
`conversationID` INT(11) NOT NULL,
`userID` INT(11) NOT NULL,
PRIMARY KEY (`conversationID`, `userID`),
CONSTRAINT `fk_Conversation_has_User_Conversation1`
FOREIGN KEY (`conversationID`)
REFERENCES `DoctorsNote`.`Conversation` (`conversa... | true |
979e2378519a019534818e41e3631740b898e719 | SQL | kimhongsik33/plsql | /No14_1.sql | SHIFT_JIS | 1,174 | 3.4375 | 3 | [] | no_license | --No14-1.EXECUTE IMMEDIATESQLʂϐɕۑ
SET SERVEROUTPUT ON
DECLARE
v_query CONSTANT VARCHAR2(200) := 'SELECT empno, ename FROM emp WHERE empno=7788';
TYPE emp_type IS RECORD(
empno emp.empno%TYPE,
ename emp.ename%TYPE
);
v_rec emp_type; -- Record Variable
v_empno emp.empno%TYPE; ... | true |
59b91608fb6eedb94f3fe3c59cd19d1a838b80fc | SQL | edxuanlen/EDplatform | /files/database.sql | UTF-8 | 6,577 | 3.3125 | 3 | [] | no_license | CREATE TABLE user_info(
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_id VARCHAR(64) NOT NULL UNIQUE,
username VARCHAR(32) NOT NULL,
password VARCHAR(128) NOT NULL,
signature VARCHAR(128) COMMENT '个性签名',
phone VARCHAR(11),
mail VARCHAR(140),
birthday VARCHAR(20),
sex TINYINT,
school_name VARCH... | true |
0ec276ce11f4e5f163a21b4f9756a5d5b375b5ba | SQL | ramsreeram/Books | /PT/antognini_pt_scripts/chapter15/px_calibrate_io.sql | UTF-8 | 2,224 | 3.109375 | 3 | [] | no_license | SET ECHO OFF
REM ***************************************************************************
REM ******************* Troubleshooting Oracle Performance ********************
REM ************************* http://top.antognini.ch *************************
REM ***************************************************************... | true |
e75e5339efe1db39889ffd1479c49910bf9881e6 | SQL | Jingo88/movieLister | /app/db/schema.sql | UTF-8 | 337 | 2.921875 | 3 | [] | no_license | CREATE TABLE users(
id INTEGER PRIMARY KEY,
username TEXT,
password TEXT
);
CREATE TABLE movies(
id INTEGER PRIMARY KEY,
title TEXT
);
CREATE TABLE favorites(
id INTEGER PRIMARY KEY,
user_id INTEGER REFERENCES users,
movie_id INTEGER REFE... | true |
690d05b2e76104bdabd651b9d242a7c17aade1ca | SQL | buithuongtinh/C0421G1_BuiThuongTinh_Module_3 | /case_study/task2345.sql | UTF-8 | 2,197 | 4.3125 | 4 | [] | no_license | use khu_nghi_duong_furama;
-- task 2
-- Hiển thị thông tin của tất cả nhân viên có trong hệ thống có tên bắt đầu là một trong các
-- ký tự “H”, “T” hoặc “K” và có tối đa 15 ký tự.
select *
from nhan_vien
where (ho_ten like 't%' or ho_ten like 'k%' or ho_ten like 'h%' ) and length(ho_ten) <= 15;
-- task 3
-- Hiển th... | true |
45ae53e15a8e565b26fbbb5df1cf8bd8553e43ce | SQL | 2XUID/FIT2094-FIT3171 | /ASSIGNMENT/ASSIGNMENT 2A 10%/Sample/T1-ml-drop.sql | UTF-8 | 529 | 2.75 | 3 | [] | no_license | --****PLEASE ENTER YOUR DETAILS BELOW****
--T1-ml-drop.sql
--Student ID: Sample Solution
--Student Name:
--Tutorial No:
/* Comments for your marker:
*/
-- 1.2 Add Drop table statements for ALL table below (not just those created
-- in this script)use ONLY
-- DROP TABLE tblname PURGE
-- syntax DO NOT use CAS... | true |
e83bc8b619cebc1d9bff5550fcc71bd8c43d65eb | SQL | k-bigboss99/PHP-MySQL | /本書範例程式/database/students.sql | UTF-8 | 1,848 | 3.375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- 主機: localhost
-- 產生時間:
-- 伺服器版本: 8.0.17
-- PHP 版本: 7.3.10
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_CLIENT */;
/*!40101 S... | true |
f41d5a12208dc8a73e14f0c4855ae7b573d1a5fa | SQL | maorjuela73/SQL-CD | /files/sql_utilidades.SQL | UTF-8 | 4,689 | 3.9375 | 4 | [] | no_license | -- TIPOS DE DATOS
--- Numéricos
----- Seriales
CREATE SEQUENCE s START 1;
CREATE TABLE stuff(id bigint DEFAULT nextval('s') PRIMARY KEY, name text);
INSERT INTO stuff (name) VALUES ('Primero');
INSERT INTO stuff (name) VALUES ('Segundo');
SELECT nextval('s');
INSERT INTO stuff (name) VALUES ('Tercer');
SELECT * FROM ... | true |
5f14e4e1d643d275290d222115119700bff75f2f | SQL | 4rtcraft/s4 | /database.sql | UTF-8 | 542 | 2.921875 | 3 | [] | no_license | CREATE TABLE `s4`.`sclass` (
`id` INT NOT NULL AUTO_INCREMENT,
`classname` VARCHAR(45) NULL,
`status` TINYINT NULL,
PRIMARY KEY (`id`));
CREATE TABLE `s4`.`student` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`lastname` VARCHAR(45) NOT NULL,
`status` VARCHAR(45) NULL,
... | true |
e6d227d73a1a9e90bb03d9d0f1931d8cc588f702 | SQL | Sumitkr220/AddressBookDB | /SQLQueryUC2.sql | UTF-8 | 256 | 2.640625 | 3 | [] | no_license | Select * from sys.databases
CREATE DATABASE address_book;
use address_book
CREATE TABLE AddressBook
(
FIRSTNAME VARCHAR(25),
LASTNAME VARCHAR(25),
ADDRESS VARCHAR(100),
CITY VARCHAR(20),
ZIP BIGINT,
PHONENUMBER BIGINT,
EMAIL VARCHAR(40)
)
| true |
2a9400e68b90467eec765a8ba045fb09ef1b9c39 | SQL | vicentedelira/tiendaonline | /tienda.sql | UTF-8 | 31,145 | 2.921875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 11-11-2019 a las 03:11:06
-- Versión del servidor: 10.4.6-MariaDB
-- Versión de PHP: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... | true |
c6bbf692d84f57230c0464cba23e9006429aecbb | SQL | blackcat0828/study | /Database/DB예제 풀이.sql | UTF-8 | 16,885 | 4.3125 | 4 | [] | no_license | use fintech;
-- 1. 실습에 사용될 EMP 테이블의 구조를 검색하라
desc emp;
-- 2. 부서의 부서코드와 부서명을 검색하라
select deptno, dname from dept;
-- 3. 부서의 부서명과 지역을 검색하라
select dname, loc from dept;
-- 4. 사원들의 급여와 커미션을 검색하라
select sal, comm from emp;
-- 5. 사원들의 입사일자를 중복을 제거하고 검색하라
select distinct hiredate from emp;
-- 6. 사원들의 매니저를 중복을 제거하고 검색하라
select... | true |
c1f0a6674c0f5b95437c39303f43d67447457bb2 | SQL | Prime-CARS/CARS | /CARS.sql | UTF-8 | 5,399 | 2.953125 | 3 | [] | no_license | --DB setup, copy, paste and CMD+ENTER for blankDB slate
--Create a DB called CARS_DB
--Tables for CARS_DB
--New Users
CREATE TABLE users (
"id" serial PRIMARY KEY,
"username" text,
"password" text,
"role" text
);
--New Customer
CREATE TABLE "customer_info" (
"customer_id" serial PRIMARY KEY,
"name" text NOT ... | true |
3cfc5e78b13bb279504dce3aaddd08ba070d5ca7 | SQL | benceBortnyak/NorthwindQuerys | /task5.sql | UTF-8 | 292 | 3.484375 | 3 | [] | no_license | SELECT * FROM(
SELECT DISTINCT ON (company_name) company_name AS company, product_name AS product, unit_price AS price FROM suppliers
INNER JOIN products ON products.supplier_id = suppliers.supplier_id
ORDER BY company_name, price DESC ) As foo
ORDER BY price DESC, product, company ; | true |
21ad1fecf0bf296e1751fe08675203cade9ea0a0 | SQL | wujungit/seenda_project | /basic-member-service/src/main/resources/sql/member.sql | UTF-8 | 809 | 2.890625 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : dev
Source Server Type : MySQL
Source Server Version : 50722
Source Host : localhost:3306
Source Schema : member
Target Server Type : MySQL
Target Server Version : 50722
File Encoding : 65001
Date: 29/09/2020 21:31:49
... | true |
d32fd7ed454857ab9a2c5d05349c0de82c68d12b | SQL | pepeul1191/ruby-padrino-gestion | /archivos/migrations/20180813222240_create_videos.sql | UTF-8 | 305 | 3.125 | 3 | [] | no_license | -- migrate:up
CREATE TABLE videos (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
nombre VARCHAR(45) NOT NULL,
duracion TIME NOT NULL,
anio INTEGER NOT NULL,
archivo_id INTEGER,
FOREIGN KEY (archivo_id) REFERENCES archivos(id) ON DELETE CASCADE
);
-- migrate:down
DROP TABLE IF EXISTS videos;
| true |
7cf83cdd259318017e438f07f534ac806e2f017a | SQL | nickdonnelly/horus-server | /migrations/2018-06-30-080150_add_resource_count_to_license_key/up.sql | UTF-8 | 674 | 3.15625 | 3 | [] | no_license | -- Your SQL goes here
ALTER TABLE horus_licenses ADD COLUMN resource_count integer NOT NULL default 0;
-- Images
UPDATE horus_licenses SET resource_count = resource_count + (SELECT COUNT(*) FROM horus_images WHERE owner = horus_licenses.owner);
-- Videos
UPDATE horus_licenses SET resource_count = resource_count + (S... | true |
53ea2cbe29b84ec4fb6e9c7a1c2ad9047a60fc57 | SQL | atherdon/forder | /docs/sql/foodordersql/foodorder_table_mt_category.sql | UTF-8 | 2,235 | 2.75 | 3 | [] | no_license |
-- --------------------------------------------------------
--
-- Table structure for table `mt_category`
--
CREATE TABLE `mt_category` (
`cat_id` int(14) NOT NULL,
`merchant_id` int(14) NOT NULL,
`category_name` varchar(255) NOT NULL,
`category_description` text NOT NULL,
`photo` varchar(255) NOT NULL,
... | true |
7a1e720a038c0644c168923592780294e9d5d613 | SQL | josephramsay/nz.co.kakariki.WNMSExtract | /WNMSExtract/sql/rule/vct_borg_ap_rl.sql | UTF-8 | 294 | 2.703125 | 3 | [] | no_license | create or replace rule vct_borg_ap_rl as
on insert to log_process
where new.tablename like 'rncap_borg'
do (
delete from report_borg_daily_t;
insert into report_borg_daily_t(id,ap,dy,aocc)
select id,ap,dy,aocc
from report_borg_daily_spare
where dy<now()::timestamp-interval'1day';
);
| true |
78c79707b361c1320c786242c2482ade673defb0 | SQL | josemlozano/accesoDatosSV2016 | /tema02-accesoABasesDeDatos/039b-baseDeDatosResidentesAlt.sql | UTF-8 | 653 | 3.4375 | 3 | [] | no_license | -- MONICA ESTEVE
-- Forma alternativa de crear las claves primarias y ajenas
create table personaS
(
cod varchar(10) PRIMARY KEY,
nombre varchar(30),
apell varchar(60)
);
create table paisES
(
cod varchar(2) primary key,
nombre varchar(30)
);
Create table residir
(
cod_pers varchar(10),
cod_pais varchar(4),
desde ... | true |
83915eecbd5a4597b052cc94c84ffb9217e4b2a5 | SQL | cristiandd/learning_sandboxes | /sql/basic.sql | UTF-8 | 967 | 3.578125 | 4 | [] | no_license | # Cria um banco de dados
CREATE SCHEMA `dbphp7` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
# Seleciona o banco de dados
USE teste;
# Cria tabelas
CREATE TABLE tb_usuarios(
# Criação das colunas da tabela
idusuario INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
deslogin VARCHAR(56) NOT NULL,
dessenha VARC... | true |
60dc044a3aa69b4fc942931d1cbad320c41c6e47 | SQL | kimxuanhuynh21/CoSoDuLieuPhanTan | /Script_Shop001/View_shop001.sql | UTF-8 | 271 | 2.9375 | 3 | [] | no_license | --28. Là người bán hàng ở các chi nhánh, tôi muốn xem các chương trình khuyến mãi đang có
CREATE VIEW [current sale] AS
SELECT * FROM Company.ThoiTrang_CSDL.dbo.sale
WHERE YEAR(fromTime) = YEAR(GETDATE()) AND MONTH(fromTime) = MONTH(GETDATE())
| true |
6b5db1157c25ad3440ab111e2019230f0a24d052 | SQL | EricZs1995/LAN002 | /LAN002/DAL/Sql/groupbyscond.sql | UTF-8 | 122 | 2.5625 | 3 | [] | no_license | select Seconds,COUNT(*)as count, SUM(rt.FrameLen) as sumlen
from dbo.rt_data as rt
group by rt.Seconds
order by rt.Seconds | true |
5f43f7e202da773de62e4b737b2ed7fabb0ae0b2 | SQL | strumica/Nice-Restreamer | /db_login.sql | UTF-8 | 5,458 | 2.9375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.23, for Linux (x86_64)
--
-- Host: localhost Database: db_login
-- ------------------------------------------------------
-- Server version 5.7.23-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_S... | true |
eaf92637ac5045d48fae0e81a4d7c299266de310 | SQL | naviddianati/FEC | /src/mysql/create_index_state_addresses.sql | UTF-8 | 662 | 2.90625 | 3 | [] | no_license | -- This script is a patch to fix old <state>_address tables. New ones are already created with the index
-- I ended up regenerating all <state>_addresses tables from scratch, so didn't need to run this script.
create index TRAN_INDEX on newyork_addresses (TRAN_ID,CMTE_ID);
create index TRAN_INDEX on massachusetts_addr... | true |
6cd53e9a61c229576a7346d03e2756d90ebc84b5 | SQL | jevasQ/cmcs128a7l-backend | /database/db_schema.sql | UTF-8 | 3,606 | 4 | 4 | [] | no_license | -- DATABASE SCHEMA
-- TOTAL TABLES: 9
DROP DATABASE IF EXISTS 128a7l;
CREATE DATABASE 128a7l;
USE 128a7l;
#REGISTRATION COMMITTEE:
CREATE TABLE regcomm(
regcommid int NOT NULL AUTO_INCREMENT,
username varchar(256) NOT NULL,
password varchar(256) NOT NULL,
position varchar(20) NOT NULL,
CONSTRAINT regcomm_re... | true |
9864398899c12fca7842db1e0948ddf2243021a5 | SQL | neantonio/supply | /modules/core/db/update/postgres/18/180620-2-updateBills01.sql | UTF-8 | 200 | 3.234375 | 3 | [] | no_license | alter table SUPPLY_BILLS add constraint FK_SUPPLY_BILLS_ON_SUPPLIER foreign key (SUPPLIER_ID) references SUPPLY_SUPPLIERS(ID);
create index IDX_SUPPLY_BILLS_ON_SUPPLIER on SUPPLY_BILLS (SUPPLIER_ID);
| true |
6444b8a447d5c70e95d19a8ad2cafd116f24e657 | SQL | AdrianFelipeAT/flights-php---poo- | /bd_flights.sql | UTF-8 | 2,026 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 01-11-2020 a las 05:59:16
-- Versión del servidor: 10.1.37-MariaDB
-- Versión de PHP: 5.6.39
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... | true |
7f6f1b03d8ac9c05cd61ec03c7c5c56f0cb16f35 | SQL | shaiksarpa/Skool | /source/sql/create.ddl.sql | UTF-8 | 405 | 3.46875 | 3 | [] | no_license |
DROP TABLE IF EXISTS USER CASCADE;
CREATE TABLE USER
(ID INT PRIMARY KEY AUTO_INCREMENT,
USERNAME VARCHAR(20) UNIQUE,
PASSWORD VARCHAR(15) NOT NULL
)ENGINE=INNODB AUTO_INCREMENT=0;
DROP TABLE IF EXISTS CLASS_DETAILS CASCADE
create table CLASS_DETAILS
(ID int primary key auto_increment,
CLASS varchar(5) not nul... | true |
d03deb2422c33d4a0d96f3d513433bf63dd4301c | SQL | pensadorramm/propellerhead-master | /src/main/resources/schema.sql | UTF-8 | 978 | 3.609375 | 4 | [] | no_license | DROP TABLE IF EXISTS customerRecord;
CREATE TABLE customerRecord (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(100) NOT NULL,
address VARCHAR (255) NOT NULL,
email VARCHAR (100) NOT NULL,
phone VARCHAR (100),
PRIMARY KEY (id));
DROP TABLE IF EXISTS productRecord;
create table productRecord (id integer... | true |
c7d45812b6f6529d3152218c87ed32f78cc413ed | SQL | bebo-eggo/compiere-eggo | /compiere-custo-eurocenter/.svn/pristine/73/735212c6cc5933d00ebc0d22d17e87af1c9a7820.svn-base | UTF-8 | 902 | 3.234375 | 3 | [] | no_license | ALTER TABLE C_Order ADD XX_IsSAV CHAR(1);
CREATE OR REPLACE VIEW ZRV_TAUX_QUALITY as
Select AD_Client_ID, AD_Org_ID, DocumentNo, POReference, XX_ISSAV, XX_SAV_DATE, C_DOCTYPETARGET_ID from
C_Order where IsSotrx = 'Y' and (XX_ISSAV is not null OR XX_SAV_DATE is not null);
CREATE TABLE XX_TAUX_QLT_HISTO (AD_Client_ID NU... | true |
9e3cca13b6b3bac68e2cbd53201e57b9e9f21062 | SQL | benzen/bottin | /src/main/resources/db/migration/V9__add_telephone.sql | UTF-8 | 269 | 3.203125 | 3 | [] | no_license | create table telephone (
id serial,
type text,
number text,
CONSTRAINT "telephone_primary_key" PRIMARY KEY ("id")
);
create table contact_telephones (
contact_id bigint references contact(id),
telephone_id bigint references telephone(id),
"order" int
);
| true |
397d0ed5efccf7ddd4adcee58aba5771cff87dff | SQL | primebread/primebread.github.io | /primebread.sql | UTF-8 | 7,297 | 2.75 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 23 Agu 2021 pada 04.42
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... | true |
0cea918269beb0403fb9546c9c2b251aa7e9f6d1 | SQL | vishalchitrala2020/BikeStores | /BikeStores/BikeStores/Brands.sql | UTF-8 | 309 | 3.125 | 3 | [] | no_license | CREATE TABLE [production].[brands](
[brand_id] [int] IDENTITY(1,1) NOT NULL,
[brand_name] [varchar](255) NOT NULL,
PRIMARY KEY CLUSTERED
(
[brand_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] | true |
95894e8530ff5780e9979e9c3a2aa4d88e5df213 | SQL | rahulyhg/bigstint | /db/db-update.sql | UTF-8 | 248 | 2.515625 | 3 | [] | no_license | CREATE TABLE `pages` (
`page_id` int(11) NOT NULL AUTO_INCREMENT,
`pageTitle` varchar(150) DEFAULT 'No Title ',
`content` text,
`status` int(11) DEFAULT '1',
PRIMARY KEY (`page_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 | true |
0c5d4029868e871071243c7fda1a85bdee15df1e | SQL | shortjared/passwordManager | /conf/install_mysql.sql | UTF-8 | 499 | 2.71875 | 3 | [] | no_license | create table passwords (
id int not null auto_increment primary key,
password_service char(200) not null,
password_text char(200) not null
);
create table groups (
id int not null auto_increment primary key,
group_name char(200) not null
);
create table group_users (
id int not null auto_increment primary key,
... | true |
264fed8954b4f0448c6fbe6df09e27cdae938d54 | SQL | bacilones/historify-api | /sql/create_tables.sql | UTF-8 | 3,274 | 3.640625 | 4 | [] | no_license | CREATE TABLE "user" (
id SERIAL,
username VARCHAR(255),
password VARCHAR(255),
email VARCHAR(255),
facebook_id VARCHAR(255),
twitter_id VARCHAR(255),
google_id VARCHAR(255),
photo_url VARCHAR(255),
created_at TIMESTAMP,
updated_at TIMESTAMP,
CONSTRAINT "user_pk" PRIMARY KEY ("id")
);
CREATE TAB... | true |
4eb6c73aa2caa8cac1cee01ab0c496401c1956d5 | SQL | KennethS0/Judicial-Record-System | /SQL - Scripts/GE/DDL/Keys/Office Keys.sql | UTF-8 | 326 | 3.3125 | 3 | [] | no_license | -- PRIMARY KEYS
ALTER TABLE office
ADD CONSTRAINT office_id_pk PRIMARY KEY(id)
USING INDEX
TABLESPACE ge_index PCTFREE 20
STORAGE (INITIAL 10k NEXT 10k PCTINCREASE 0);
-- FOREIGN KEY
ALTER TABLE office
ADD CONSTRAINT office_circuit_fk FOREIGN KEY(judicial_circuit_id) REFERENCES judicial_circuit... | true |
a1b1c76469b6e5225f35d35ed5dd751c053e7df5 | SQL | dstreev/big-data-apps | /apps/credit_card/cdc/cc-acct-update.sql | UTF-8 | 2,119 | 4 | 4 | [
"Apache-2.0"
] | permissive | set hive.query.name="CC_ACCT ACID Update";
-- set hive.session.id="CC_ACCT ACID Update";
USE ${DATABASE};
-- Account Datasets: 2022-08-01 to 2022-08-10
-- Small Files on 2022-08-05
set tez.grouping.min-size = ${TEZ_GROUP_MIN_SIZE};
set tez.grouping.max-size = ${TEZ_GROUP_MAX_SIZE};
-- EXPLAIN FORMATTED
MERGE
INTO
... | true |
d14b73f03e02b096e3e86a36f37c2146ab115772 | SQL | s18006/Oracle_SQL_DB | /1220/1220.4.sql | UTF-8 | 427 | 3.21875 | 3 | [] | no_license | select
e.job_id "JOB ID",
(select min(e1.salary) from employees e1 where e1.job_id = e.job_id) "MINIMUM",
(select max(e1.salary) from employees e1 where e1.job_id = e.job_id) "MAXIMUM",
(select sum(e1.salary) from employees e1 where e1.job_id = e.job_id) "SUM",
(select round(avg(e1.salary)) from emp... | true |
664e29e30ccc7753fb0b7d33fd51b19db5de7bc9 | SQL | briancorr/das-employerapprenticeshipsservice | /src/SFA.DAS.EmployerApprenticeshipService.HMRC.Database/StoredProcedures/ProcessPaymentDataTransactions.sql | UTF-8 | 890 | 3.515625 | 4 | [
"MIT"
] | permissive | CREATE PROCEDURE [levy].[ProcessPaymentDataTransactions]
AS
INSERT INTO levy.TransactionLine
select mainUpdate.* from
(
select
x.AccountId as AccountId,
GETDATE() as DateCreated,
null as submissionId,
Max(pe.CompletionDateTime) as TransactionDate,
3 as TransactionType,
null as LevyDeclared,
... | true |
9fbc405f58d51718f0098c0fd948353350bcccef | SQL | andrzejchalobka/TheWebOnlineClinicProject | /src/main/resources/data.sql | UTF-8 | 691 | 2.671875 | 3 | [] | no_license | REPLACE INTO `role` VALUES (2,'USER');
REPLACE INTO `role` VALUES (1,'ADMIN');
-- insert into user values (1, 1, 'szalupka@wp.pl', 'Chalobka', 'Andrzej', '$2a$10$Y7uXYNorbMsH9UKuJwb8z.3EUFtyXvzyS7.nxiBKWvHWzyl8F22E2'),
-- (2, 2, 'user@wp.pl', 'Userek', 'Userowski', '$2a$10$Y7uXYNorbMsH9UKuJwb8z... | true |
28221a463fbc151f9820945ca2f816ea567bd4d3 | SQL | cHolzberger/sag-akademie | /sag-akademie.de/lib/db/mysql/misc/newsletter_anmeldung_neu.sql | UTF-8 | 1,503 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 10, 2010 at 08:34 PM
-- Server version: 5.1.37
-- PHP Version: 5.2.12
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTE... | true |
b86ea0f894416a0404d6d7b34443845b432d1035 | SQL | dujianc/MSSQL_Learning_Activities | /LA4_2.sql | ISO-8859-1 | 3,535 | 4.375 | 4 | [] | no_license | --Learning Activity 4.2: Data Retrieval from Single Table
--Run the create_ap.sql script to create the database.
--1. Write a SELECT statement that returns three columns from the Vendors table: VendorContactFName, VendorContactLName, and VendorName.
--Sort the result set by last name, then by first name.
SELECT Ven... | true |
6ed6cf53fcd369f1ac3eb6a030ce7af8515ee913 | SQL | IvayloIV/Java | /MySQL/May-2019/Table_Relations/Exercise/09.Peaks_in_Rila.sql | UTF-8 | 193 | 3.640625 | 4 | [
"MIT"
] | permissive | SELECT m.mountain_range, p.peak_name, p.elevation AS 'peak_elevation'
FROM peaks AS p
JOIN mountains AS m ON p.mountain_id = m.id
HAVING m.mountain_range = 'Rila'
ORDER BY peak_elevation DESC; | true |
ded8a0ad04b3390142c46e4892ee8d1622798c48 | SQL | digidudu06/SQL | /create_view_emp.sql | UTF-8 | 866 | 3.328125 | 3 | [] | no_license | CREATE VIEW EMP AS
SELECT
EMPLOYEE_ID EID,
FIRST_NAME FNAME,
LAST_NAME LNAME,
EMAIL,
HIRE_DATE HDATE,
JOB_ID JID,
SALARY SAL,
COMMISSION_PCT COMM,
MANAGER_ID MID,
DEPARTMENT_ID DID
FROM EMPLOYEES;
DESC JOBS;
CREATE VIEW JOB AS
SELECT
JOB_ID JID,
JOB_TITLE TITLE,
MI... | true |
9b761aa161a902151ef94e9446ffccafb33aeb06 | SQL | lolozanova/SoftUni-Homeworks | /Database MS SQL/03 Table Relations/09. Peaks in Rila.sql | UTF-8 | 157 | 3.515625 | 4 | [] | no_license | SELECT m.MountainRange,p.PeakName, p.Elevation
FROM PEAKS as p
JOIN Mountains as m ON m.ID =MountainID
WHERE MountainRange = 'Rila'
ORDER BY Elevation DESC | true |
bcb01430c104493d17a343b19814c6b54a205653 | SQL | hleb-straltsou-by/cataloguer | /sql/procedures.sql | UTF-8 | 564 | 3.296875 | 3 | [] | no_license | drop procedure get_user;
delimiter //
create procedure get_user(IN _login varchar(40), IN _password varchar(40),
OUT _id_user int, OUT _role varchar(20), OUT _name varchar(50))
comment "returns user according login and password and then returns its id_user and role"
begin
select id_user into _id_user from users whe... | true |
90403d830098122df453d75c67d6d124b8fcb991 | SQL | Zhangxunming/Project3 | /DBfile/Project3.db.sql | UTF-8 | 2,402 | 3.1875 | 3 | [] | no_license | BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "Users" (
"Username" TEXT,
"Password" TEXT,
"Fullname" TEXT,
"Usertype" INTEGER,
"CustomerID" INTEGER,
PRIMARY KEY("Username","Password")
);
CREATE TABLE IF NOT EXISTS "Purchase" (
"purchaseid" INTEGER NOT NULL,
"customerid" INTEGER NOT NULL,
"productid... | true |
f34bb7b008d417a840c1d4ed13031abc2544d64d | SQL | OMR5221/dbt_project | /target/compiled/airflow_dbt/count_providers_by_state.sql | UTF-8 | 123 | 2.84375 | 3 | [] | no_license | select
state_name,
count(distinct npi) as count_providers
from "airflow"."public"."npi_with_state" n
group by state_name | true |
96de34ae41ac835db9d65b4b8105272846a159aa | SQL | tjddhd/School | /IST3423/HW7/VRG_sql/test.sql | UTF-8 | 739 | 3.234375 | 3 | [] | no_license | SELECT *
FROM VRG_CUSTOMER
WHERE ROWNUM < 6;
SELECT *
FROM VRG_ARTIST;
SELECT *
FROM VRG_CUSTOMER_ARTIST_INT;
SELECT *
FROM VRG_WORK
WHERE Copy = 'Unique';
SELECT *
FROM VRG_TRANS;
CREATE VIEW CustomerStateView AS
SELECT VRG_CUSTOMER.State
FROM VRG_CUSTOMER;
CREATE VIEW CustomerInfo_CA_View... | true |
36a0a2f7fedc9831fde19da4e5829a98021e6267 | SQL | Little-Pancake/odps_book | /sql/src/tmall.sql | UTF-8 | 7,532 | 4.4375 | 4 | [] | no_license | -- [NOTE] SQL does not support comment line, we use it here only for clearity
DROP TABLE IF EXISTS tmall_user_brand;
CREATE TABLE tmall_user_brand (
user_id string,
brand_id string,
type string COMMENT "click-0, buy-1, collect-2, shopping_cart-3",
visit_datetime string
);
-- 1) get to know data
SELECT dis... | true |
6da4c4a7eca9c82f7f016d78b4d47a39c5c80f9b | SQL | ivanlandinez1994/Ort | /BD/TPBD.sql | WINDOWS-1252 | 8,175 | 3.796875 | 4 | [] | no_license | --1
select [TITULO], [AUTOR] from dbo.LIBRO where tipo='no'
--2
select [NRO_LIBRO], [PRECIO_ORI], [EDICION] from dbo.LIBRO where tipo='no' or PRECIO_ORI>21 or EDICION>1985
--3
select [AUTOR],[EDICION] from LIBRO where AUTOR like 'L%'
--4
select [AUTOR],[EDICION] from libro where not autor like 'G%'
--5
select ... | true |
3ad47e2a92ba97be889315862f3072cb0d602b75 | SQL | Nackeey/Database-basics-and-EF | /Database - basics/04. Joins, Subqueries, CTE and Indices/join queries 1-10.sql | UTF-8 | 2,585 | 4.5 | 4 | [] | no_license | --01. Employee Address
SELECT TOP 5 e.EmployeeID, e.JobTitle, e.AddressID, a.AddressText
FROM Employees AS e
JOIN Addresses AS a ON a.AddressID = e.AddressID
ORDER BY a.AddressID
--02. Addresses with Towns
SELECT TOP 50 e.FirstName, e.LastName, t.Name, a.AddressText
FROM ((Employees AS e
JOIN Addresses AS a ON a... | true |
3c5f3089750f02919e3f6d87d9a2fc210c16eff2 | SQL | CodeWall-EStudio/SZone | /docs/szone.sql | UTF-8 | 10,801 | 3.46875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.5.8.2
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2013 年 12 月 24 日 12:05
-- 服务器版本: 5.1.71-log
-- PHP 版本: 5.3.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- 数据库: `szone`
--
-- --------------------------------------------------------
--
-- 表的结... | true |
2c54742a1364f3ca399ceeafc5d1475f1e3f2186 | SQL | TransferORM/tests | /resources/sql/postgresql.sql | UTF-8 | 17,663 | 3.03125 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON SCHEMA public IS 'Standard p... | true |
10e48c54b1f44ca33b1ef30ccce217a6852188c5 | SQL | pnapper/ToDoList-ManyToMany | /todo_test.sql | UTF-8 | 5,333 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Nov 02, 2017 at 10:52 PM
-- Server version: 5.6.35
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
c8405de360107cc0029cacc85b6b3720c70a3d87 | SQL | raghavaallianceit/databasebackup | /test/CX_CVCIQ_V3/Procedures/PROC_BRIEFING_MANAGER.sql | UTF-8 | 4,055 | 3.0625 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE cx_cvciq_v3.proc_briefing_manager (
out_chr_err_code OUT VARCHAR2,
out_chr_err_msg OUT VARCHAR2,
out_tab OUT return_briefing_manager_arr,
in_from_date IN DATE,
in_to_date I... | true |
6f3d47bca8f865f70c99dfc10a309c1b64eef4d7 | SQL | Hokath/More-Unique-Components-for-VP | /TempMoreUC/Inca/Inca - Tambo&Coca/TamboCode.sql | UTF-8 | 4,875 | 2.75 | 3 | [] | no_license | --------------------------------
-- Civilization_BuildingClassOverrides
--------------------------------
INSERT INTO Civilization_BuildingClassOverrides
(CivilizationType, BuildingClassType, BuildingType)
VALUES ('CIVILIZATION_INCA', 'BUILDINGCLASS_CARAVANSARY', 'BUILDING_TAMBO');
--=====================... | true |
1fdbecc61a5b6a3d678fcac06410542bb072c6e2 | SQL | mirabitl/SDHCAL | /SlowControl/DB/geometry.sql | UTF-8 | 1,406 | 2.84375 | 3 | [] | no_license | DROP DATABASE GEOMETRY;
CREATE DATABASE GEOMETRY;
USE GEOMETRY;
CREATE TABLE VERSIONS (
IDX INTEGER PRIMARY KEY AUTO_INCREMENT,
TESTNAME VARCHAR(256) DEFAULT "NONE" ,
QUALITY INTEGER DEFAULT 0,
DEBUT TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FIN TIMESTAMP DEFAULT 0,
VALID BOOLEAN DEFAULT 1
);
CREATE TABLE RUNS (
IDX INTEGE... | true |
cfeb66a9840f9c621af5d30f680d8c82e3c7797e | SQL | brunnpa/summaries | /DAB1 - Datenbank 1/Labs/Praktikum13_LoesungenBRP.sql | UTF-8 | 2,213 | 4.09375 | 4 | [] | no_license |
-- 1.) Finden Sie alle verschiedenen Teilefarben/Teilestädte-Kombinationen.
-- (Mit “alle“ ist gemeint “alle, die zur Zeit in der DB gespeichert sind“, und nicht alle überhaupt möglichen.)
SELECT distinct
Farbe, Stadt
FROM
t;
-- 2.) Finden Sie alle Lieferantennummern/Teilenummern/Projektnummern-Kombinationen, ... | true |
5ceb6b853bbabb99a4f4e81099958935e81b0d2c | SQL | borisbotev/SoftUni | /Databases Basics/06.JoinsSubqueries/09.EmployeeManager.sql | UTF-8 | 160 | 3.3125 | 3 | [
"MIT"
] | permissive | SELECT e.EmployeeID,
e.FirstName,
e.ManagerID,
ep.FirstName
FROM Employees as e
JOIN Employees as ep
ON e.ManagerID = ep.EmployeeID
WHERE e.ManagerID IN (3, 7) | true |
0485768e590ca5816165f0a1305c826e5286600b | SQL | DijkstraEdsger/probar_agendamiento | /agendamiento.sql | UTF-8 | 17,103 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 22-05-2019 a las 20:04:19
-- Versión del servidor: 10.1.37-MariaDB
-- Versión de PHP: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
0b0bb2d944baffa883d585124e16ef71cbb163ce | SQL | thebravoman/elsys-db-practices | /exam2016/exam20160218/b/Konstantin_Kostov_B_21/database1.sql | UTF-8 | 5,954 | 3.171875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.28, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: exam
-- ------------------------------------------------------
-- Server version 5.6.28-0ubuntu0.15.10.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHAR... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.