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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6bd22938e2200bbff828acdc9234727acb6877af | SQL | Scholanova/mon_dashboard_meteo | /src/main/resources/db/schema/001_insert_in_bdd.sql | UTF-8 | 794 | 3.09375 | 3 | [] | no_license | --liquibase formatted sql
--changeset scholanova:1
-- TRUNCATE TABLE public.USER;
-- TRUNCATE TABLE public.LOCATION;
-- not for authentification // because pasword encdde must not be respect
--INSERT INTO public.USER (lastname, firstname, username, password,ACCOUNT_NON_EXPIRED,ACCOUNT_NON_LOCKED,CREDENTIALS_NON_EXPI... | true |
cbe64ee41d6e621cc6d66102e0d06e78612ac14c | SQL | zhengjr/bis | /sql/ball/install/300_create_procedure_CLEAR_TICKETS.sql | WINDOWS-1251 | 278 | 2.796875 | 3 | [] | no_license | /* */
CREATE PROCEDURE /*PREFIX*/CLEAR_TICKETS
(
TIRAGE_ID VARCHAR(32)
)
AS
BEGIN
DELETE FROM /*PREFIX*/TICKETS
WHERE TIRAGE_ID=:TIRAGE_ID;
END;
--
/* */
COMMIT | true |
6fa69ad1b1c86d38708b949a645bfc587f0ac829 | SQL | cncf/devstats-reports | /sql/all_companies_count.sql | UTF-8 | 854 | 3.96875 | 4 | [
"Apache-2.0"
] | permissive | select
count(distinct sub.company_name) as num_companis
from (
select
af.company_name
from
gha_events e,
gha_actors_affiliations af
where
e.actor_id = af.actor_id
and af.dt_from <= e.created_at
and af.dt_to > e.created_at
and af.company_name not in ('Independent', 'Unknown', 'NotFoun... | true |
51ca9ed74427cd36104172f0a39c336d7e466fb8 | SQL | liangdev/shopinterest | /quickstart/application/configs/account.v37.sql | UTF-8 | 1,137 | 2.9375 | 3 | [] | no_license |
alter table `mycoupons` add column `is_deal` tinyint(4) not null default '0' after `is_sale`;
alter table `mycoupons` add column `operator` varchar(20) NOT NULL default 'merchant' after `is_deal`;
CREATE TABLE `amazon_products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`status` tinyint(4) NOT NULL DEFAULT '0',
`a... | true |
a7c18f5c7f278ef97b3add3d70663cdaab33d7bf | SQL | Refaat-alktifan/sql-cheat-sheet | /trigger.sql | UTF-8 | 2,064 | 4 | 4 | [] | no_license | -- create log table
DROP TABLE IF EXISTS log; CREATE TABLE log (
log_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
v_table VARCHAR(30),
name VARCHAR(30),
v_old VARCHAR(30),
v_new VARCHAR(30),
action VARCHAR(30),
who VARCHAR(30),
when DATE
);
-- trigger before insert
DROP TRIGGER IF EXIST... | true |
a4afec19ca1ee8ca410455c74353bfb6588a546b | SQL | jgarzonext/plsql-testing | /script_plsql/bd_iaxis/script/tables/PPPC_CONF.sql | WINDOWS-1250 | 3,993 | 2.96875 | 3 | [] | no_license | --------------------------------------------------------
-- DDL for Table PPPC_CONF
--------------------------------------------------------
CREATE TABLE "AXIS"."PPPC_CONF"
( "CEMPRES" NUMBER(2,0),
"FCALCUL" DATE,
"SPROCES" NUMBER,
"CRAMDGS" NUMBER(4,0),
"CRAMO" NUMBER(8,0),
"CMODALI" NUMBER(2,0),
"... | true |
2f86b31658ebc5d1c130b23e1a155625e9136b82 | SQL | sjksathishkumar/website-2 | /pris/DB/payroll.sql | UTF-8 | 51,480 | 3.1875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 12, 2013 at 07:19 AM
-- Server version: 5.5.8
-- PHP Version: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SE... | true |
d2acb13af65d0c43bb58e4d7ecee737137d4f024 | SQL | 0megaga/PPE-Ecommerce | /two.sql | UTF-8 | 11,875 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Client : 127.0.0.1
-- Généré le : Dim 03 Juin 2018 à 22:00
-- Version du serveur : 5.7.14
-- Version de PHP : 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... | true |
efdac1687402d4a0d27b490d70593e101822786f | SQL | jzinnick/My-Code | /Notes/SQL/LIB User Product.sql | UTF-8 | 394 | 2.984375 | 3 | [] | no_license | [select /*dlytrn.usr_id,*/
count(dlytrn.trnqty),
sum(dlytrn.trnqty)
/*dlytrn.devcod,
dlytrn.prtnu*/
from dlytrn
where dlytrn.wh_id = 'WMD1'
and (dlytrn.actcod = 'PCEPCK' or dlytrn.actcod = 'CASPCK')
and (dlytrn.fr_arecod = 'LB01' or dlytrn.to_arecod = 'LB02')
and dlyt... | true |
802896b37b3052401ac8d6faaada9a676ce496f7 | SQL | nikcur/misa_lihvarcek | /sql_code/select_8_like.sql | UTF-8 | 321 | 2.59375 | 3 | [] | no_license | SELECT *
FROM my_contacts;
/*Any number of unknown character before 'CA'*/
SELECT *
FROM my_contacts
WHERE location LIKE '%CA';
/*Any number of unknown character before 'a'*/
SELECT *
FROM my_contacts
WHERE first_name LIKE '%a';
/*Just one character before 'om'*/
SELECT *
FROM my_contacts
WHERE first_name LIKE '_om'... | true |
f642e389a9920d9fd30b3db48b6fc28fddbeabd4 | SQL | tbiaglow/bamazon | /bamazonSchema.sql | UTF-8 | 499 | 3.25 | 3 | [] | no_license | DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE bamazon;
USE bamazon;
CREATE TABLE products (
item_id INTEGER(11) AUTO_INCREMENT NOT NULL,
product_name VARCHAR(30) NOT NULL,
department_name VARCHAR(30) NOT NULL,
price DECIMAL(10, 2),
stock_quantity INTEGER(11),
product_sales DECIMAL(10, 2),
PRIMARY KEY (item_id)
);... | true |
66606127e513544a3930a975227fa01517d15092 | SQL | gagraham/mysql_examples | /user_login_date.sql | UTF-8 | 319 | 3.046875 | 3 | [] | no_license |
SHOW
CREATE PROCEDURE `INS_USER_LOGIN_DATA_GENERATOR`;
SELECT count(*) from sample_staff.user_login;
SHOW EVENTS;
SELECT user_id,login_dt,DATE(login_dt) from sample_staff.user_login LIMIT 10;
SELECT user_id,login_dt,NOW() from sample_staff.user_login
where DATE(login_dt) < (NOW() - INTERVAL 10 MINUTE)
LIMIT 10; | true |
7321f88ef4218c032a17c24a4ad10e00dfa66372 | SQL | phamthanhnghia/shop-ban-giay | /database.sql | UTF-8 | 6,542 | 3.34375 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th5 04, 2018 lúc 02:13 PM
-- Phiên bản máy phục vụ: 10.1.30-MariaDB
-- Phiên bản PHP: 7.1.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... | true |
483b89e9c118d05a143350f2d0876c21b4b415b9 | SQL | Enterprise-System-Management-Solutions/CLM | /dwhnode02/database/procedures/P_CUSTOMER_ANALYTICS_23_MANUAL.sql | UTF-8 | 954 | 3.546875 | 4 | [] | no_license | --
-- P_CUSTOMER_ANALYTICS_23_MANUAL (Procedure)
--
CREATE OR REPLACE PROCEDURE DWH_USER.P_CUSTOMER_ANALYTICS_23_MANUAL (P_PROCESS_DATE VARCHAR2) IS
VDATE_KEY VARCHAR2(4);
VDATE DATE := TO_DATE(TO_DATE(P_PROCESS_DATE,'YYYYMMDD'),'DD/MM/RRRR');
BEGIN
SELECT DATE_KEY INTO VDATE_KEY
... | true |
e86ad664cd9bc3298f71da7c25583f7846fc75bc | SQL | maduhu/MARLO-CIAT | /marlo-ciat/marlo-ciat-web/src/main/resources/database/migrations/V1_0_0_20161111_1130__OutcomeInSectionStatus.sql | UTF-8 | 258 | 2.78125 | 3 | [] | no_license | ALTER TABLE `section_statuses`
ADD COLUMN `reserach_outcome_id` int(11) NULL AFTER `research_program_id`;
ALTER TABLE `section_statuses` ADD CONSTRAINT `section_research_outcome_fk` FOREIGN KEY (`reserach_outcome_id`) REFERENCES `research_outcomes` (`id`); | true |
7a9a7ee3be895f97983a1628d3a47694d3d4e611 | SQL | psp0001060/LearnServlet | /HR_JavaEE/WebContent/hr_sql.sql | WINDOWS-1252 | 2,894 | 3.421875 | 3 | [] | no_license | ------------------------------------------------------
-- Export file for user ICSSHR --
-- Created by Administrator on 2017/10/16, 14:15:16 --
------------------------------------------------------
spool hr_sql.log
prompt
prompt Creating table ADMIN
prompt ====================
prompt
create tabl... | true |
fbb9644fe880305d1418414e5bb77ca204bce639 | SQL | Ankit-k-karan/SQL-Common | /SQL Script/RFP 2019/RFP Data/Master data insert.sql | UTF-8 | 4,341 | 3.4375 | 3 | [] | no_license |
--Query 1 NSDC_SDMS_TP_DETAIL
--truncate table NSDC_SDMS_TP_DETAIL;
insert into NSDC_SDMS_TP_DETAIL(TP_Name,TP_SDMS_ID,TP_SMART_ID,TP_SPOC_Name,TP_SPOC_Mobile_No,TP_SPOC_Email_Id,IS_Threshold )
select distinct ltrim(rtrim(Partner_Name))tp ,PartnerID ,Smart_TP_ID,ltrim(rtrim(TP_Spoc_Name))spoc , ltrim(rtrim(str(Tp_Spo... | true |
bf1f987406cc13454a4fb6d2fce6fcc8c9eb5196 | SQL | juandavidvallejo/ocds | /MigrationDocs/Query/Package Metadata.sql | UTF-8 | 1,358 | 3.5625 | 4 | [] | no_license | SELECT
CONCAT('/consultas/detalleProceso.do?numConstancia=', PROCESO.NUM_CONSTANCIA) AS uri,
PROCESO.FECHA_ULT_ACTUALIZACION AS publishedDate,
-- buyer
-- buyer _ identifier
-- buyer _ identifier - id
ENTIDAD.NIT_ENTI AS ident,
-- buyer _ identifier - legalName
ENTIDAD.NOMB_ENTI AS legalName,
-- buyer - name
... | true |
390b4b5597ea0a7ee6a7fd8aa658f0467383c8c3 | SQL | lfbettcher/Launch-Academy | /java-pet-tracker/src/main/resources/db/migration/V1__create_pets.sql | UTF-8 | 430 | 2.828125 | 3 | [] | no_license | DROP TABLE IF EXISTS pets;
CREATE TABLE pets (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
species VARCHAR(255) NOT NULL,
breed VARCHAR(255) NOT NULL,
age INTEGER NOT NULL,
neutered BOOLEAN NOT NULL
);
INSERT INTO pets (name, species, breed, age, neutered) VALUES ('Rory', 'Dog', 'Golden Retriever',... | true |
f873b39041cebb063325eecd2b4db02e78623596 | SQL | mullerpaul/DBAstuff | /warehouse/resources/migration/iqprodm/2017Q1/insert_iqnlabs_benchmarks_marketing_assistant.sql | UTF-8 | 352 | 2.5625 | 3 | [] | no_license | insert into rate_and_ttf_benchmarks
select s.benchmark_type, s.std_occupation_id,
dm.std_place_id, s.unit, s.benchmark_25_percentile,
s.benchmark_50_percentile,
s.benchmark_75_percentile,
s.load_date, s.effective_date, s.end_date
from SOS_IQNLABS_MA_BENCH s, dm_places dm
where dm.cmsa_code = s.cmsa_code
/
COMMIT
/
drop... | true |
8d0884af0a286ee6e6cc3c4d74db5ff742ca3f9f | SQL | betovicentini/duckewiki | /www/duckewiki/functions/mysql_functions/traitvalueonly.sql | UTF-8 | 2,785 | 4.03125 | 4 | [] | no_license | CREATE FUNCTION traitvalueonly(tvariation varchar(500),ttid int(10),trunit char(100), tunit char(100), somedia BOOLEAN, somax BOOLEAN) RETURNS varchar(500) CHARSET UTF8
BEGIN
DECLARE statesids INT DEFAULT 0;
DECLARE ncatstep INT DEFAULT 1;
DECLARE ncat INT DEFAULT 0;
DECLARE statename CHAR(255) DEFAULT '';
DECLARE sta... | true |
4ffdb0d87a405858b775a9fcad05b67bb1d04833 | SQL | TomaszM81/SandboxDatabaseManager | /SandboxDatabaseManager/SandboxDatabaseManagerDB/dbo/Stored Procedures/StoreCountersData.sql | UTF-8 | 964 | 4.03125 | 4 | [
"MIT"
] | permissive | CREATE PROCEDURE dbo.StoreCountersData
(
@CountersToStore dbo.CountersData READONLY
)
WITH EXECUTE AS OWNER
AS
SET NOCOUNT ON
INSERT INTO dbo.ServerFriendlyName
SELECT DISTINCT ServerFriendlyName FROM @CountersToStore C
WHERE NOT EXISTS (SELECT 1 FROM dbo.ServerFriendlyName WHERE dbo.ServerFriendlyName.ServerFriendl... | true |
643e655f55eddeafa9863a0610c5111e6b92ae64 | SQL | ResShark/Night-Of-Paradise-V1 | /[Gc_Phone]/esx_cartesim/sim_card.sql | UTF-8 | 509 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE `sim_card` (
`owner` varchar(255) CHARACTER SET utf8 NOT NULL,
`phone_number` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `sim_card`
ADD PRIMARY KEY (`phone_number`);
INSERT INTO `items` (`name`, `label`, `limit`, `rare`, `can_remove`) VALUES
... | true |
2dc8588e56761c131d30bad9e829352da84ee8a9 | SQL | sprokushev/Delphi | /MASTER/_DATABASE/Views/V_DESIGNER_PRIMARY_KEYS.sql | UTF-8 | 553 | 3.71875 | 4 | [] | no_license | --
-- V_DESIGNER_PRIMARY_KEYS (View)
--
CREATE OR REPLACE FORCE VIEW MASTER.V_DESIGNER_PRIMARY_KEYS
(TAB_NAME, PK_NAME, COL_NAME, POSITION, COL_TYPE)
AS
SELECT DISTINCT UC.TABLE_NAME AS tab_name, UC.CONSTRAINT_NAME AS index_name,C.COLUMN_NAME AS col_name,C.POSITION, CC.DATA_TYPE
FROM SYS.USER_CONSTRAINTS UC, SYS.USE... | true |
1b67cf05916da3ce759837e4c782d6289d231d82 | SQL | angeloluciani/db | /TABLESPACE.sql | UTF-8 | 1,141 | 3.84375 | 4 | [] | no_license |
DROP TABLESPACE X_BLOB
INCLUDING CONTENTS
AND DATAFILES
cascade constraints
-- Identify the segments :
select segment_name from dba_segments
where tablespace_name ='X_BLOB'
and segment_type like '%LOB%';
--Identify the table_name owning the LOB segment
select OWNER, TABLE_NAME, SEGMENT_NAME from dba_lob... | true |
0bea8afcc24be2be999df1fe4120be1a0f91aced | SQL | Quentin3819/POO_Evaluation | /database.sql | UTF-8 | 5,073 | 3.171875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
--
-- Host: localhost Database: Agenda_db
-- ------------------------------------------------------
-- Server version 5.7.28-0ubuntu0.16.04.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_... | true |
9c8d79ba2c9214d776cfa3e596bd28fd819d34fd | SQL | Sneg654/module-flyway | /src/main/resources/db/migration/V4__Create_company_user_table.sql | UTF-8 | 268 | 3.03125 | 3 | [] | no_license | -- Create company script
-- DDL
CREATE TABLE company_user(
company_id INT NOT NULL,
user_id INT NOT NULL,
CONSTRAINT FK_company_id FOREIGN KEY (company_id) REFERENCES company(id),
CONSTRAINT FK_user_id FOREIGN KEY (user_id) REFERENCES test_user(id)
); | true |
29f4dca572921abb95a8dceaa716d02a187a38fc | SQL | marcelnagm/gda2 | /db_updates/update38.sql | UTF-8 | 1,051 | 3.078125 | 3 | [] | no_license | --alteração da tabela tbloadaluno
drop table tbloadaluno;
create table tbloadaluno (
matricula bigint NOT NULL,
nome character varying(100),
sexo character(1),
rg character varying(20),
rg_org_exped character varying(10),
cpf character varying(11),
id_versao_curso integer NOT NULL,
id_tipo_ingresso in... | true |
a7b4910fa40faf038208377c218d2e54a04af7d9 | SQL | frblazquez/BD | /Practicas/Practise 4/crear_tablas.sql | UTF-8 | 1,298 | 3.53125 | 4 | [] | no_license | -- FRANCISCO JAVIER BLÁZQUEZ MARTÍNEZ ~ frblazqu@ucm.es
-- MANUEL ORTEGA SALVADOR ~ manuor01@ucm.es
--
-- Doble grado Ingeniería informática - Matemáticas
-- Universidad Complutense de Madrid.
--Para eliminar las tablas creadas con el mismo nombre:
--DROP TABLE Empleados;
--DROP TABLE Domici... | true |
a042ae4bdf4c7a0ff8556be8324100c6337d8c9c | SQL | adace123/SQL | /sqlzoo solutions/tutorials/selectwithinselect.sql | UTF-8 | 1,489 | 4.34375 | 4 | [] | no_license | --1
SELECT name FROM world
WHERE population >
(SELECT population FROM world
WHERE name='Russia')
--2
SELECT name
FROM world
WHERE gdp/population >
(SELECT gdp/population FROM world WHERE name = 'United Kingdom')
AND continent = 'Europe'
--3
SELECT name, continent
FROM world
WHERE continent IN (SE... | true |
93f27a98381dde88967f798dc5c66a9530fa71ce | SQL | adrianmeneses1234/ProyectoDAW | /ProyectoDaw Base De Datos/PROYECTO FINAL/ProyectoFinal(V1).sql | UTF-8 | 12,681 | 3.5 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS m_Proyecto;
USE m_Proyecto;
CREATE TABLE Elementos (
`CodigoE` INTEGER(10) NOT NULL,
`Nombre` VARCHAR(25) DEFAULT NULL,
`Descripcion` VARCHAR(150) DEFAULT NULL,
`Stock` NUMERIC(10) DEFAULT NULL,
`Precio` NUMERIC(10) NOT NULL,
`Categoria` VARCHAR(20) DEFAULT NULL,
P... | true |
032d37c1671c14c9c8f979af4d83d1245dc227d5 | SQL | SUHYUNSHIM/SQL_-oracle | /sql_files/hr1.sql | UHC | 3,695 | 3.671875 | 4 | [] | no_license | show user;
grant select ,insert(id,name) on modi_col to babo, hong;
select * from modi_col;
set serveroutput on
create or replace procedure inc_salary
is
employee_id varchar2(20);
begin
update employees
set salary = salary * 1.1
where employee_id >= 120; ... | true |
abdd30ca084cb3b25848e831ef453770a5a2ac03 | SQL | Ki8888/DataB | /relation.sql | UTF-8 | 1,745 | 3.671875 | 4 | [] | no_license | -- SQLite
CREATE TABLE DEPARTMENT
(
DEPARTMENT_ID TEXT NOT NULL,
NAME TEXT NOT NULL,
PRIMARY KEY (DEPARTMENT_ID)
);
CREATE TABLE MEMBER
(
MEMBER_ID TEXT NOT NULL,
NAME TEXT(65535) NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR(50) NULL ,
SALARY ... | true |
f7d02538f756136d5fd3fd4bef533b74d7b76076 | SQL | velopert/velog-server | /prisma/migrations/20230402090409_external_integration/migration.sql | UTF-8 | 769 | 3.875 | 4 | [] | no_license | -- CreateTable
CREATE TABLE "external_integrations" (
"id" UUID NOT NULL DEFAULT uuid_generate_v4(),
"code" VARCHAR(64) NOT NULL,
"is_consumed" BOOLEAN NOT NULL DEFAULT false,
"created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"fk_user_id" UUID NOT NULL,
CONSTRAINT "external_integr... | true |
f9266cb911f15919b5f92f67a32cb171a780fe24 | SQL | cuba-platform/saml-addon | /modules/core/db/init/oracle/create-db.sql | UTF-8 | 2,319 | 3.578125 | 4 | [
"Apache-2.0"
] | permissive | -- begin SAMLADDON_SAML_CONNECTION
create table SAMLADDON_SAML_CONNECTION (
ID varchar2(32) not null,
CREATE_TS timestamp,
CREATED_BY varchar(50),
VERSION integer,
UPDATE_TS timestamp,
UPDATED_BY varchar(50),
DELETE_TS timestamp,
DELETED_BY varchar(50),
--
NAME varchar2(255) not ... | true |
cc455016396ceadb3cd54802e851e3b774d0bc6c | SQL | MarkiiMedia/frozen | /SQL_DUMP/frozen_db.sql | UTF-8 | 3,487 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Vært: 127.0.0.1:3306
-- Genereringstid: 11. 12 2019 kl. 00:23:00
-- Serverversion: 5.7.24
-- PHP-version: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
726c02e01cb8a50bbfa597d7eb23011ee51f5925 | SQL | apache/cloudstack | /engine/schema/src/main/resources/META-INF/db/schema-301to302-cleanup.sql | UTF-8 | 1,736 | 2.515625 | 3 | [
"GPL-2.0-only",
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"GPL-1.0-or-later",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-unknown"
] | permissive | -- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may... | true |
558a7d09e10f1cbc6654b731645bd8afaea193f1 | SQL | IvanKhadasevitch/coffee-02 | /script/coffee.sql | UTF-8 | 3,052 | 3.90625 | 4 | [] | no_license | --
-- Изменяйте типы для тестовой БД.
-- Для MySQL юзайте InnoDB
--
-- !!!: Сохраняйте регистр в мэппингах для Hibernate (на mysql под linux это важно).
--
# drop database coffee;
create database coffee;
# show databases;
use coffee;
--
-- Сорт кофе
--
create table CoffeeType (
id int not null auto_increment,... | true |
7c3b5495e65024496608c39985a5d769c62fbfb0 | SQL | moti1992/restaurantApp | /db_sync_files/27Dec2020_create_restaurant.sql | UTF-8 | 489 | 2.75 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `squadcast`.`restaurant` (
`restaurant_id` INT NOT NULL,
`name` VARCHAR(64) NULL,
`url` VARCHAR(256) NULL,
`cuisines` VARCHAR(256) NULL,
`image` VARCHAR(256) NULL,
`address` VARCHAR(512) NULL,
`city` VARCHAR(64) NULL,
`rating` FLOAT NULL,
`veg` BOOLEAN DEFAULT FALSE NULL,
... | true |
fdd172083ea9dd2d1802084a67905fcb0f220583 | SQL | dimitar521/Softuni-Java-Web-Developer-Program | /Java DB Fundamentals/Java Databases Basics/Java Databases Basics - Exercises/Basic CRUD - Exercise/03. Find Salary of Each Employee.sql | UTF-8 | 230 | 2.953125 | 3 | [] | no_license | -- Problem 3: Update Employees Salary
-- Update all employees' salaries whose job_title is "Manager" by adding 100.
-- Retrieve information about salaries from table employees.
SELECT first_name,last_name,salary FROM employees;
| true |
67f34179b1382ffffbc999842cb5fc3aad7ec7a1 | SQL | Mikael639/TP_BDD_SQL | /TP1/Exercice 3/ex_03_02.sql | UTF-8 | 118 | 2.59375 | 3 | [] | no_license | SELECT
EMPLOYEE_ID,
LAST_NAME,
SALARY,
ROUND(SALARY+((15.5/100)*SALARY),0) AS "New Salary"
FROM
EMPLOYEES
; | true |
60666e1b5428bc377955ca9eb301ea376f526017 | SQL | stophin/NanoWeb | /sql/gameplaza/na_gameuser.sql | UTF-8 | 5,017 | 2.765625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : RAMS
Source Server Version : 50712
Source Host : localhost:3306
Source Database : na_gameplaza
Target Server Type : MYSQL
Target Server Version : 50712
File Encoding : 65001
Date: 2018-03-04 15:25:14
*/
SET FOREIGN_KEY_... | true |
2122622a0a7b7a584c8229ba9d395ee54ef9ed89 | SQL | TrevorHolcomb/PAML-Watchdog | /WatchdogDatabaseAccessLayer.Tests/DummyData/dbo.Merged.sql | UTF-8 | 1,865 | 2.984375 | 3 | [] | no_license | SET IDENTITY_INSERT dbo.SupportCategories ON;
INSERT INTO SupportCategories (Id, Name, [Description]) VALUES (1, 'senior project team', 'generated by dbo.Merged.sql');
SET IDENTITY_INSERT dbo.SupportCategories OFF;
SET IDENTITY_INSERT dbo.AlertTypes ON;
INSERT INTO dbo.AlertTypes (Id, Name, [Description]) VALUES (1, '... | true |
cbc0b86782f4a3c2a7f6e9d55a3f69be2a4f0147 | SQL | mitesh183/DB5-SQL-Stanford-Course | /Extra_Social_Network_Query_Exercises.sql | UTF-8 | 2,321 | 4.5625 | 5 | [
"MIT"
] | permissive | -- Extra SQL Social Network Query Exercises
-- https://lagunita.stanford.edu/courses/DB/SQL/SelfPaced/courseware/ch-sql/seq-exercise-sql_social_query_extra/
-- Question 1:
-- For every situation where student A likes student B, but student B likes a different student C, return the names
-- and grades of A, B, and C.
S... | true |
232786f9c54081d7448812b771b0b65089735774 | SQL | Dog-Foot-Cat-Foot/HW_DFCF | /EunJi/2021.06.25/README.sql | UTF-8 | 5,251 | 4.1875 | 4 | [] | no_license | ## Q1. customer 테이블에서 고객번호, 고객이름, 고객나이, 담당직원번호(null일 때 '없음'으로 표시)를 검색!(단! 나이가 많은 사람이 먼저!)
## Q2. 부서번호, 직원번호, 직원이름, 직급, 연봉, '-'를 포함은 주민번호, '-'를 포함한 핸드폰번호 검색!!(직급이 높은 사람이 먼저!)
## Q3. 직원번호, 직원이름, 부서이름, 직급, 입사년도, 나이, 연봉, 직속상관번호, 직속상관이름 검색!(나이가 높은 사람이 먼저!)
### Q1
select
cus_no ... | true |
49f340dacef90329807ee8085c2dabfb71647535 | SQL | riveramatthew/ra_data_warehouse | /models/warehouse/w_crm/bigquery/wh_contact_web_event_history.sql | UTF-8 | 573 | 3.453125 | 3 | [
"Apache-2.0"
] | permissive | {{config(enabled = target.type == 'bigquery')}}
{% if var("crm_warehouse_contact_sources") and var("product_warehouse_event_sources") %}
{{config(alias='contacts_web_event_history_xa')}}
SELECT
c.contact_pk,
e.blended_user_id as contact_email,
e.web_event_pk,
e.event_type,
e.event_ts,
e.event_details,
e.... | true |
3b2cac8c8cd0f7a8fd14970696d296684a4370b4 | SQL | Starfloat/SQLZOO-AdventureWorks-Solutions | /AdventureWorks-hard-questions-solutions.sql | UTF-8 | 2,346 | 4.65625 | 5 | [] | no_license | /*https://sqlzoo.net/wiki/AdventureWorks_hard_questions*/
--11.
/*For every customer with a 'Main Office' in Dallas show AddressLine1 of the 'Main Office' and AddressLine1 of the 'Shipping' address - if there is no shipping address leave it blank.
Use one row per customer.
*/
SELECT CompanyName,
CASE WHEN AddressType... | true |
713862f86c0e14fed622244a5feb71c387e74477 | SQL | hasan282/Java-ApotikNusantara | /nusantara.sql | UTF-8 | 2,936 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 03, 2019 at 05:38 AM
-- Server version: 10.1.39-MariaDB
-- PHP Version: 7.2.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
99fb39c28a9ab140c2e52a6e323ccf5704cda908 | SQL | rignizio/OracleScripts | /locks/findBlockingLock.sql | UTF-8 | 795 | 3.703125 | 4 | [] | no_license | select dbs.inst_id
,dbs.sid holding_sid
,dbs.serial# holding_serial#
,dbs.username holding_user
,dbs.machine blocking_machine
,(select count(sid) from gv$session where blocking_session = dbs.sid and inst_id=dbs.inst_id) sessions_blocked
,dbs.sql_id holding_sql_id
,dbs.wait_clas... | true |
288a70b17f6fe7d3877d0a753f85e2dbfe26f49b | SQL | caio-farias/trab-nosql | /cass.sql | UTF-8 | 815 | 3.8125 | 4 | [] | no_license | -- Este arquivo está em CQL(Cassandra Query Language)
USE musicapp;
CREATE TABLE songs(
id uuid PRIMARY KEY,
title text,
album text,
artist text,
);
CREATE MATERIALIZED VIEW songs_by_title AS
SELECT * FROM musicapp.songs WHERE title IS NOT NULL PRIMARY KEY(title, id);
CREATE MATERIALIZED VIEW songs_by_album AS
SELECT ... | true |
177c082f0044393a4e8101f76f678cf055a75656 | SQL | masterjino72/loginValidado | /bd/tributos_ultimo.sql | UTF-8 | 8,845 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 07-02-2020 a las 23:33:47
-- Versión del servidor: 5.7.14
-- Versión de PHP: 5.6.25
CREATE DATABASE TRIBUTOS;
USE TRIBUTOS;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!4... | true |
afa69d559d3defffead0047af187d1ff566b0d52 | SQL | javadev/LeetCode-in-Kotlin | /src/main/kotlin/g1201_1300/s1251_average_selling_price/script.sql | UTF-8 | 325 | 3.671875 | 4 | [
"MIT"
] | permissive | # Write your MySQL query statement below
# #Easy #Database #2023_06_10_Time_1371_ms_(76.11%)_Space_0B_(100.00%)
SELECT p.product_id,
ROUND(SUM(p.price * u.units) / SUM(u.units), 2) AS average_price
FROM
Prices AS p
NATURAL JOIN
UnitsSold AS u
WHERE
u.purchase_date BETWEEN p.start_date AND p.end_date
GROUP BY p.product... | true |
0cf687d4f45fe9bc450ea4179949b8ca4b85094d | SQL | ani9282/MYSQL-Code | /Mysql/Mongo DB/aa/Mysql/f1.sql | UTF-8 | 6,174 | 3.75 | 4 | [] | no_license | /*
drop procedure if exists pro1;
delimiter $
create procedure pro1()
lbl1:begin
declare y varchar(10);
declare x varchar(10) default 'IET';
set y := 'Hello';
select concat(y,' ' , x) as Message;
end lbl1 $
delimiter ;
*/
drop procedure if exists pro1;
delimiter $
create procedure pro1(x int, in y int)
lbl1:begin
... | true |
9a1fbabc8d7a67e1ddd35d305c3e335a34176fc3 | SQL | SDC-PepperJack/Pepperjack-checkout-service | /pgDb/postgres.sql | UTF-8 | 1,194 | 2.921875 | 3 | [] | no_license | CREATE TABLE productDetails (
id SERIAL PRIMARY KEY,
productId INT NOT NULL,
sellerId INT NOT NULL,
sellerName VARCHAR(50),
averageReviewScore INT NOT NULL,
numberReviews INT NOT NULL,
itemName VARCHAR(50) NOT NULL,
freeShipping BOOLEAN,
personalization BOOLEAN,
availableQuantity INT NOT NULL,
onO... | true |
a7ff5bd5d83afaaa09b71fcdd43ec5142b37c6e8 | SQL | BaronMa/Leetcode | /Database/Activity Participants.sql | UTF-8 | 2,103 | 4.53125 | 5 | [] | no_license | Create table If Not Exists Friends (id int, name varchar(30), activity varchar(30))
Create table If Not Exists Activities (id int, name varchar(30))
Truncate table Friends
insert into Friends (id, name, activity) values ('1', 'Jonathan D.', 'Eating')
insert into Friends (id, name, activity) values ('2', 'Jade W.', 'Sin... | true |
3db1fc134f4ca914bd4dca045fe8c1d144bce0fb | SQL | bonseong11/sql | /2021-03-19.sql | UTF-8 | 6,896 | 4.34375 | 4 | [] | no_license | SELECT
DECODE(deptno,
10, 'ACCOUNTING',
20, 'RESEARCH',
30, 'SALES',
40, 'OPERATIONS','DDIT') sal_bonus_decode , MAX(sal), MIN(sal), ROUND(AVG(sal), 2), SUM(sal), count(sal), count(mgr), count(*)
FROM emp
GROUP BY deptno;
grp3
emp 테이블을 이용하여 다음을 구하시오... | true |
dfd90dbb3f71bdae3a320d944be1ec643a808ed4 | SQL | rayanc/Pecuniaus | /Database/Stored Procedures/avz_proc_CheckprocessorNameExist.sql | UTF-8 | 672 | 3.1875 | 3 | [] | no_license | use Pecuniaus;
drop procedure if exists avz_proc_CheckprocessorNameExist;
DELIMITER $$
create PROCEDURE avz_proc_CheckprocessorNameExist(
iNName nvarchar(100),
iNProcessorId int
)
BEGIN
if exists(SELECT processors.`Name` FROM lkp_tb_processorlist as processors WHERE processors.`Name` = iNName) then
begin
if(iNProces... | true |
7bc4592f422a3dd41a21bcad45ee30166dbb8993 | SQL | ramsreeram/Books | /PT/antognini_pt_scripts/chapter04/system_activity_setup.sql | UTF-8 | 5,406 | 3.53125 | 4 | [] | no_license | SET ECHO OFF
REM ***************************************************************************
REM ******************* Troubleshooting Oracle Performance ********************
REM ************************* http://top.antognini.ch *************************
REM ***************************************************************... | true |
139ca23b81ef009b58a4d899692f20bdc4ea4178 | SQL | NAVY-GreenArrow/2moons-xterium | /SQL_INSTALLATION/xterium_portal_type/xterium_portal_db.sql | UTF-8 | 25,454 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : mer. 28 nov. 2018 à 18:16
-- Version du serveur : 5.7.24-0ubuntu0.16.04.1
-- Version de PHP : 7.1.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:0... | true |
cab4b721892d5e3fb51e953a8d477be012d221d8 | SQL | nigelwilli/sql-workbook-karynboyd74 | /StoredProcedures.sql | UTF-8 | 622 | 3.15625 | 3 | [] | no_license | /* In this section you will be creating and executing stored procedures. You will be creating various types of stored procedures that take input and output parameters.
4.1 Basic Stored Procedure
Task – Create a stored procedure that selects the first and last names of all the employees.
4.2 Stored Procedure Input Par... | true |
05ce028c67c72970e176867f046003a4a0a0df58 | SQL | hebeiqing/ManagementSystem | /build/classes/ManagementSystem.sql | GB18030 | 2,826 | 3.46875 | 3 | [] | no_license | --ݿ
CREATE DATABASE IF NOT EXISTS ManagementSystem DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
--û --Ա
CREATE TABLE `t_user` (
`id` varchar(32) NOT NULL,
`username` varchar(32) NOT NULL,
`password` varchar(32) NOT NULL,
`sex` varchar(10) DEFAULT NULL,
`mobile` varchar(11) NOT NULL,
`create_time` datetime... | true |
36fc49858db0866a73f6ee50b13597683748eace | SQL | fhmanwar/store | /database/db_store.sql | UTF-8 | 16,540 | 3.171875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- --------------------------------------------------------
-- Host: localhost
-- Server version: 5.7.24 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.5.0.5332
-- --------------------------------------------------------
/*... | true |
6f5ba4ae72d9baf9dffbf5d15f6161d00738071b | SQL | mickeyshi/not-imdb | /queries.sql | UTF-8 | 1,254 | 4.09375 | 4 | [] | no_license | /*Find all actors in the movie 'Die Another Day'.*/
SELECT CONCAT (a.first, ' ', a.last)
FROM Movie AS m, MovieActor AS ma, Actor AS a
WHERE m.title = 'Die Another Day' AND ma.mid = m.id AND ma.aid = a.id;
/*All actors who worked in multiple movies.*/
SELECT COUNT(DISTINCT ma1.aid)
FROM MovieActor as ma1, Mov... | true |
162f875f0c62b26763dbd163a9667b6d69978902 | SQL | Siqi-Shan/303_Workspace | /Labs/Lab_8/Lab_8.sql | UTF-8 | 2,234 | 4.15625 | 4 | [] | no_license | /* Create a view mpeg_tracks that displays all tracks with MPEG audio file format. Display track name (track_name)
artist name (artist_name), composer, album title (album_title), and media type (media_type). Sort results in
alphabetical order by track name. */
CREATE OR REPLACE VIEW mpeg_tracks AS
SELECT trac... | true |
3700c0fd52025fda066295d9e3940843d0487646 | SQL | HenriqueLimas/sample-feed-pwa | /db/tables.postgres.sql | UTF-8 | 1,771 | 3.328125 | 3 | [] | no_license | CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TYPE name AS (
first_name text,
last_name text
);
CREATE TYPE location AS (
lat bigint,
lon bigint
);
CREATE TYPE image AS (
url text,
description text
);
CREATE TYPE encoding AS (
encoding text,
height int,
width int,
bit_rates text[]
);
CREAT... | true |
7d87bbce1eb297b0c2dc663b7c27b4e6cdb4f77b | SQL | Moiseng/Site-hopital | /bdd.sql | UTF-8 | 630 | 3.171875 | 3 | [] | no_license | /* Création de la table services */
CREATE TABLE services(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
content TEXT(100000) NOT NULL,
what_we_do TEXT(100000) NOT NULL,
procedure TEXT(100000) NOT NULL,
PRIMARY KEY (id)
)
/* Création de la table doctors */
CREATE TABLE d... | true |
370794c89b318bf699c2c4529b684c442accdd74 | SQL | Lucasdeg/Project-3 | /sql/crime_rotterdam.sql | UTF-8 | 79,255 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Gegenereerd op: 18 apr 2017 om 11:35
-- Serverversie: 10.1.21-MariaDB
-- PHP-versie: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... | true |
c6aba8b70c069e1013682ec15a09c4547ec1fa21 | SQL | jayraikhere/clubs-iiti | /sql/populate.sql | UTF-8 | 22,848 | 3.15625 | 3 | [] | no_license | INSERT INTO
approvals(Mail_Id, Club_Name, CurrentStatus)
VALUES('cse190001015@iiti.ac.in', 'Programming Club', 'U'),(
'cse190001030@iiti.ac.in',
'DEVELOPER STUDENT Club',
'U'
),(
'cse180001001@iiti.ac.in',
'DEVELOPER STUDENT Club',
'U'
),('cse190001061@iiti.ac.in', 'Dance Club', 'U'),(
... | true |
b4729614b6044dce7968fc8ea4d9b2a906ea6c8f | SQL | AleqCorrea/Contas_Projeto | /loja.sql | UTF-8 | 6,522 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4.2
-- http://www.phpmyadmin.net
--
-- Máquina: localhost
-- Data de Criação: 27-Nov-2019 às 00:31
-- Versão do servidor: 5.6.13
-- versão do PHP: 5.4.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIE... | true |
167b7de96b89731fdbb1f8257c89c4bb8c9a41f1 | SQL | lsooun/mall-course | /src/main/resources/db/migration/V20200811173805__create_ums_permission_table.sql | UTF-8 | 934 | 3.3125 | 3 | [] | no_license | -- ----------------------------
-- Table structure for ums_permission
-- ----------------------------
DROP TABLE IF EXISTS `ums_permission`;
CREATE TABLE `ums_permission` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`pid` bigint(20) DEFAULT NULL COMMENT '父级权限id',
`name` varchar(100) DEFAULT NULL COMMENT '名称',... | true |
22d6f227c4c59d327a588cdfe442294a74f57075 | SQL | kyejune/commonlife-frontend | /backend/src/main/resources/sql/iok/homeiot_cp_USR_INFO.sql | UTF-8 | 3,286 | 3.03125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)
--
-- Host: iotdev.cjrhbxndfnvb.ap-northeast-2.rds.amazonaws.com Database: homeiot_cp
-- ------------------------------------------------------
-- Server version 5.5.5-10.0.24-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40... | true |
d0bdc5be57d08200fb9cf7b0dd3a02032354b35a | SQL | Neeraj30917/Oracle | /4.sql | UTF-8 | 320 | 2.578125 | 3 | [] | no_license | create table orgCoordinator(
id varchar2(10),
fname varchar2(15),
lname varchar2(15),
dob date,
sex char(1),
doj date,
qualification varchar2(17) check (qualification in ('MATRIC' , 'HIGH SCHOOL' , 'GRADUATE' ,'POST GRADUATE') ) ,
contactno number(10),
salary number(6) default 2000,
constraint pkOrg Primary Key(id)
)
| true |
83f010c98bd29254e0e3de6602374be20e52253d | SQL | Naym0/phpAssignment | /php assignment/users.sql | UTF-8 | 2,699 | 2.8125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 15, 2018 at 06:22 PM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
ff5240a0680ef62e6641316e65899ac1032ff16d | SQL | PauloCarneiro99/Processamento-Analitico-de-Dados | /src/sqls/tempo.sql | UTF-8 | 150 | 2.5625 | 3 | [] | no_license |
CREATE TABLE IF NOT EXISTS SCHEMA_INDI_SOCIAIS.TEMPO (
ANO INT,
SECULO INT,
DECADA INT,
CONSTRAINT SCHEMA_INDI_ PRIMARY KEY (ANO)
); | true |
64ed8ec9ef161f648f5ee0aa2fad0e4ead58283e | SQL | rickt25/php-juststore | /juststore.sql | UTF-8 | 27,273 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 22, 2020 at 05:18 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 |
71f4496f5ea03089497f7156e9f35a7015f457f0 | SQL | JennyBarrett7/Work_Examples | /Instagram/solutions_copy0.sql | UTF-8 | 4,059 | 4.46875 | 4 | [] | no_license | # ***Exercise 1: Find 5 oldest (earliest) users of Instagram
# SELECT username
# FROM users
# ORDER BY created_at
# LIMIT 5;
# =========Colt's Solution==========
# SELECT *
# FROM users
# ORDER BY created_at
# LIMIT 5;
# |||||||||||||||||||||||||||||||||||||||||||||||||||
# ||||||||||||||||||||||||||||||||||||||||... | true |
c343803b70817199921bcb33d50983b814df67f6 | SQL | Haga-z/final-exam | /src/main/resources/db/migration/V3__create_review_table.sql | UTF-8 | 370 | 3.21875 | 3 | [] | no_license | use `exam`;
CREATE TABLE IF NOT EXISTS `reviews`(
`id` int auto_increment NOT NULL,
`text` varchar(500) NOT NULL,
`mark` double not null ,
`date` datetime not null ,
`user_id` int NOT NULL ,
`place_id` int NOT NULL ,
PRIMARY KEY (`id`),
foreign key (user_id)references `users`(id),
f... | true |
a1b3a93b7423f036692dc49348fe4c36247e9a5a | SQL | chtimi59/restjson | /setup.sql | UTF-8 | 290 | 2.734375 | 3 | [] | no_license | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
DROP TABLE IF EXISTS `assets`;
CREATE TABLE IF NOT EXISTS `assets` (
`id` varchar(255) NOT NULL,
`creation` timestamp,
`lastChange` timestamp,
`data` TEXT, PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | true |
803f463913a757b2f00949327dbb90915f69102d | SQL | dvarubla/tracker-server | /src/main/resources/db/migration/V0_0_1__createSchema.sql | UTF-8 | 1,463 | 4 | 4 | [] | no_license | create table role (
id int not null primary key,
name text not null,
alias text not null,
constraint role_unique_name unique (alias)
);
create sequence role_id_seq start with 1 increment by 1;
create table privilege (
id int not null primary key,
name text not null,
alias text not null,
constraint pri... | true |
288d469ee7f8bb71c5727410a9289c89089b0285 | SQL | exastro-suite/it-automation | /ita_install_package/install_scripts/version_up/1.6.0/base_sql_en_US.sql | UTF-8 | 92,243 | 3.09375 | 3 | [
"Apache-2.0",
"LGPL-3.0-only",
"MIT"
] | permissive | ALTER TABLE A_SEQUENCE ADD COLUMN MENU_ID INT AFTER VALUE;
ALTER TABLE A_SEQUENCE ADD COLUMN DISP_SEQ INT AFTER MENU_ID;
ALTER TABLE A_SEQUENCE ADD COLUMN NOTE VARCHAR (4000) AFTER DISP_SEQ;
ALTER TABLE A_SEQUENCE ADD COLUMN LAST_UPDATE_TIMESTAMP DATETIME(6) AFTER NOTE;
ALTER TABLE A_ACCOUNT_LIST ADD COLUMN ACCESS_AUT... | true |
125003e8104f1bebcba94a6276ffb8910f6ccaab | SQL | bsakers/launch_week_five | /sql-marathon/queries.sql | UTF-8 | 674 | 4.0625 | 4 | [] | no_license | SELECT movies.title, movies.year, movies.category
FROM movies
WHERE movies.year < 2000;
SELECT categories.name
FROM categories;
SELECT movies.title
FROM movies
WHERE movies.id = 4
SELECT movies.title, movies.year
FROM movies
ORDER BY movies.year;
SELECT movies.title, movies.year
FROM movies
ORDER BY movies.title;
... | true |
a418bb6645ec96fa916f0d860dd5907d3bf6a2d0 | SQL | ghostjat/fluid-simpletrading | /sql/model.sql | UTF-8 | 4,363 | 3.1875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14.8
-- http://www.phpmyadmin.net
--
-- Client : db578.1and1.fr
-- Généré le : Sam 30 Septembre 2017 à 00:26
-- Version du serveur : 5.5.57-0+deb7u1-log
-- Version de PHP : 5.4.45-0+deb7u11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
65c59657ea0428f1645df3f77ed8d008b012ced5 | SQL | josegoyo10/CVE | /calcula_impuestos_store_procedure.sql | UTF-8 | 2,654 | 3.828125 | 4 | [] | no_license | DELIMITER $$
DROP PROCEDURE IF EXISTS `cvecoltest`.`calculo_impuestos` $$
CREATE PROCEDURE `cvecoltest`.`calculo_impuestos` (IN idoe INTEGER)
BEGIN
DECLARE ivacoti,reicacoti,reterentacoti,totalcoti,totreterenta,totreteica,total,totalciva,idcotizacion,activareteiva integer;
DECLARE datosencoe CURSOR FOR SELECT id_coti... | true |
e79fdccf41cc975cf7b846d88d5cc88fbabe0bdd | SQL | Moscow12/HEALTH | /version1/assets/Query.sql | UTF-8 | 1,566 | 3.1875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | CREATE VIEW dr_profile_view as SELECT users.id, users.name, users.email, doctor.sex,
doctor.professional, doctor.dob, doctor.phone, doctor.region,
doctor.district, doctor.ward, doctor.lessen, doctor.experience, doctor.address, doctor.pic,
doctor.dept_id FROM users inner JOIN doctor WHERE users.id=doctor.user_id;
CRE... | true |
77d433dac809f2bcb321e4a5b86021226a8e16a2 | SQL | lucass-freed/ProjetoFinal | /TABLES_pontoDePartida/SQL/ticket_tags.sql | UTF-8 | 167 | 3.09375 | 3 | [] | no_license | CREATE TABLE tickets_tags(
id_tickets INT NOT NULL,
id_tags INT NOT NULL,
FOREIGN KEY (id_tickets) REFERENCES tickets(id),
FOREIGN KEY (id_tags) REFERENCES tags(id)
); | true |
eedcb92ea825ae68ea444ecbbc50f94fc24addb4 | SQL | cjaragon/turn_tbl | /db/delete_album.sql | UTF-8 | 205 | 3.0625 | 3 | [] | no_license | DELETE FROM user_album
WHERE album_id = $1;
DELETE FROM song
WHERE album_id = $1;
DELETE FROM album
WHERE id = $1;
SELECT * FROM album a
JOIN user_album ua
ON a.id = ua.album_id
WHERE ua.user_id = $1; | true |
05144b08516330281e72d5a67233ce41c8f1796b | SQL | dataplusplace/DORA-DevOps-Metrics-Automation | /weekly_dora_metrics.sql | UTF-8 | 6,141 | 4.34375 | 4 | [] | no_license | WITH dates_cte AS
(
SELECT LAG(week_start, 1) OVER (ORDER BY order_num) AS last_week_start
,LAG(week_end, 1) OVER (ORDER BY order_num) AS last_week_end
,LAG(week_start, 2) OVER (ORDER BY order_num) AS prev_week_start
,LAG(week_end, 2) OVER (ORDER BY order_num) AS prev_week_end
,to_char(now() AT time zone 'America/N... | true |
872120bf4bee61f9a848c58692de85dea8169d96 | SQL | Rronaldo/uas_pbo | /db_uas_15312413.sql | UTF-8 | 1,884 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 03, 2017 at 11:53 AM
-- Server version: 5.5.27
-- PHP Version: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
9c5231e488bde336e9a05fe76a413832c604ad80 | SQL | janikhans/thepartsninja | /db/views/search_records_v02.sql | UTF-8 | 569 | 3.34375 | 3 | [] | no_license | SELECT ROW_NUMBER() OVER () AS id, *
FROM (
SELECT id as searchable_id, 'CheckSearch' as searchable_type, search_type, user_id, vehicle_id, comparing_vehicle_id, category_id, category_name, fitment_note_id, results_count, created_at, updated_at
FROM
check_searches
UNION
SELECT id as searchable_id, 'Compat... | true |
c2e59bb3107b6b6efe657c4f08224c5d794b76f3 | SQL | BojanP85/school-classes-management | /baza/projekat.sql | UTF-8 | 8,680 | 3.453125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jul 05, 2019 at 04:16 PM
-- Server version: 5.7.23
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
fc16c1bc3d6bcc83641ea46ff151140cc7aa76f9 | SQL | idmitrov/Databases | /SQL Advanced/Problem03.sql | UTF-8 | 272 | 4.09375 | 4 | [] | no_license | SELECT e.FirstName + ' ' + e.LastName
AS [Full Name],
e.Salary,
d.Name
FROM Employees e, Departments d
WHERE Salary =
(
SELECT MIN(Salary)
FROM Employees
WHERE DepartmentID = e.DepartmentID
) AND d.DepartmentID = e.DepartmentID
ORDER BY e.DepartmentID
| true |
f7fe215f2c4393abead02ce3f19a673468ea0c12 | SQL | Nikita-str/sql-postgres--some-code | /transaction_01_0.sql | UTF-8 | 3,039 | 3.625 | 4 | [] | no_license | --first run:
--#1:
BEGIN /*; SET*/ TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -- the same as READ COMMITED
UPDATE player_participation SET rating_change = rating_change + 1 WHERE player_id = 25 AND tournament_id = 7;
UPDATE chess_player
SET first_name = 'REAL PLAYER', second_name = 'actually no'
WHERE player... | true |
f8db16aba315e31f0bbcd570a98f1221748e26ea | SQL | MichaelPereira31/Marketplace-Kariri | /insert_command.sql | UTF-8 | 1,915 | 3.84375 | 4 | [] | no_license | INSERT INTO usuarios
(nome, email, username, contato)
VALUES
('José Pedro da Silva Gomes', 'jgomes@marketplace.com', 'jgomes', '(88) 0 00000000'),
('Michael Pereira da Silva', 'mpereira@marketplace.com', 'mpereira', '(88) 0 00000000'),
('João Gabriel da Silva', 'jgabriel@marketplace.com', 'jgabriel', '... | true |
ba209e8f5e18203e140719866fead2b3d46d25e4 | SQL | hpetru/read_FEC | /fecreader/formdata/sql/OtherLine.sql | UTF-8 | 592 | 3.828125 | 4 | [
"BSD-2-Clause"
] | permissive |
-- SQL to deal with indexes:
-- First drop all the indexes that django creates by default for a primary key:
alter table formdata_otherline drop constraint formdata_otherline_pkey;
-- We need a way to get rows without a table scan, though, so we're gonna have one index per row on the filing number.
-- We're cutting... | true |
f8ecab7027c9564b17eba84761a1c42c8506a73a | SQL | Wall-Of-Shame/backend | /prisma/migrations/20210922161556_add_vote_model/migration.sql | UTF-8 | 1,200 | 3.65625 | 4 | [] | no_license | -- CreateTable
CREATE TABLE "Vote" (
"challengeId" TEXT NOT NULL,
"victimId" TEXT NOT NULL,
"accuserId" TEXT NOT NULL
);
-- CreateIndex
CREATE UNIQUE INDEX "Vote_challengeId_victimId_accuserId_key" ON "Vote"("challengeId", "victimId", "accuserId");
-- AddForeignKey
ALTER TABLE "Vote" ADD CONSTRAINT "Vote_... | true |
b4fa66de0834d93864788b46a45d8cc77fb31bff | SQL | shitterlmj2016/SQL_Tutorial | /11.join.sql | UTF-8 | 665 | 3.296875 | 3 | [] | no_license | -- Add the extra branch
INSERT INTO branch VALUES(4, "Buffalo", NULL, NULL)
-- Combine rows based on colunms, inner join
SELECT employee.emp_id, employee.first_name, branch.branch_name
FROM employee
JOIN branch -- inner join
ON employee.emp_id = branch.mgr_id;
-- Combine rows based on colunms, inner join
SELECT em... | true |
d645acc2045726baa7251500059260b88bbd5836 | SQL | aukanslk/Assignments | /Homework BKI IIN/assignment from p'bow/1.create procedure and re-check null/health_benefit_condition.sql | UTF-8 | 513 | 2.78125 | 3 | [] | no_license | TRUNCATE table actuarial_health_benefit ;
select a.package_code, a.package_plan, a.pattern_cd, a.package_desc, a.product_id, a.*
select count(distinct a.policy_number)
from actuarial_health_benefit a
where a.package_code is null
or a.package_plan is null
or a.pattern_cd is NULL
or a.package_desc is NULL
or a.product_... | true |
c55a32f0ce4a1a278516b4ef80458479451c55d7 | SQL | titibrown/DWWM-2005 | /12 -mysql/ExerciceMrChatelot/manip.sql | UTF-8 | 1,956 | 4.15625 | 4 | [
"Unlicense"
] | permissive |
-- QUESTION 1 : Donner nom, job, numéro et salaire de tous les employés, puis seulement des employés du département 10
-- SELECT `ENAME`,`JOB`,`EMPNO`FROM `emp` ;
-- SELECT `ENAME`,`JOB`,`EMPNO`FROM `emp` WHERE `DEPTNO`=10 ;
-- QESTION 2 : Donner nom, job et salaire des employés de type MANAGER dont le salai... | true |
3a5a58237c898d672d9c71512c68db3237209288 | SQL | adamslizm/bamazon | /bamazon.sql | UTF-8 | 1,547 | 3.171875 | 3 | [] | no_license |
DROP DATABASE IF EXISTS bamazon_DB;
CREATE database bamazon_DB;
use bamazon_DB;
CREATE TABLE products(
item_id VARCHAR(100) NOT NULL,
product_name VARCHAR(100) NOT NULL,
department_name VARCHAR(100),
price integer(255),
stock_quantity integer(255)
);
use bamazon_DB;
INSERT INTO products(item_id, product_name, depa... | true |
554b8be902fb253232f6bb409d805ca57f13a575 | SQL | caroolnascimento/Fullstackeletro-Nodejs-Front | /src/bd.sql | UTF-8 | 2,811 | 2.734375 | 3 | [] | no_license | create database fullstackeletro;
use fullstackeletro;
create table if not exists produto(
id_produto INTEGER PRIMARY KEY AUTO_INCREMENT,
categoria varchar(45) NOT NULL,
descricao VARCHAR(150) NOT NULL,
imagem VARCHAR(200) UNIQUE,
precoantigo varchar(40),
precofinal VARCHAR (40)
);
insert into pro... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.