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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9bc9687087ec3042a36816a56149976f006032f2 | SQL | marcelosdm/oracle-sql | /Tasy/busca-relatorio-funcao.sql | UTF-8 | 414 | 3.609375 | 4 | [] | no_license | SELECT distinct c.DS_FUNCAO,
a.DS_TITULO,
a.CD_RELATORIO,
b.IE_EXIGE_PERFIL
FROM RELATORIO_FUNCAO b, RELATORIO_PERFIL d, PERFIL e,
RELATORIO a,
funcao c
WHERE a.NR_SEQUENCIA = b.NR_SEQ_RELATORIO
AND b.CD_FUNCAO = c.CD_FUNCAO
and a.NR_SEQUENCIA = d.NR_SEQ_RELATORIO
and d.CD_PERFIL= e.CD_PERFIL
and e.CD_ES... | true |
4645d8cf5908f89c9804bda9e2ba2b340485aacc | SQL | CBIIT/cadsr-db | /scripts/meta/JIRA-612-FOOTER/MDSR_BIROW_QC_FOOTER_TR.sql | UTF-8 | 484 | 2.9375 | 3 | [] | no_license | set serveroutput on size 1000000
SPOOL FORMBUILD-612.log
CREATE OR REPLACE TRIGGER SBREXT.MDSR_BIROW_QC_FOOTER_TR
BEFORE INSERT ON SBREXT.QUEST_CONTENTS_EXT
FOR EACH ROW
WHEN (NEW.QTL_NAME='FOOTER')
DECLARE
cnt NUMBER(3);
BEGIN
SELECT COUNT (*)
INTO cnt
FROM SBREXT.QUEST_CONTENTS_EXT
WHERE QTL_N... | true |
75965869ad92c5801e970afdc5a6e7224987bad5 | SQL | ivan4otopa/SoftUni | /Databases/Exams/DatabasesSampleExamAds/16.4.UpdateTownToHamburg.sql | UTF-8 | 115 | 2.671875 | 3 | [] | no_license | UPDATE Ads
SET TownId =
(SELECT Id FROM Towns
WHERE Name = 'Hamburg')
WHERE DATENAME(WEEKDAY, Date) = 'Thursday' | true |
743d40dbf0d2abe3c84f492e569062bce75b1d1c | SQL | bioub/Formation_PHP_Objet_Prepavenir_2015_12 | /Exemple_ecole_create.sql | UTF-8 | 7,911 | 3.515625 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Client: 127.0.0.1
-- Généré le: Mer 25 Septembre 2013 à 16:30
-- Version du serveur: 5.5.32
-- Version de PHP: 5.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_C... | true |
165c4d6b73ed12a4c722f13f8e1f60114b3f8b9e | SQL | NCIP/catissue-core | /software/caTissue/db/db-upgrade/Oracle/rename_constraint.sql | UTF-8 | 706 | 3.65625 | 4 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- Rename Constraint
DECLARE
isConstraintPresent PLS_INTEGER;
sqlStmt VARCHAR2(200);
BEGIN
SELECT COUNT(*)
INTO isConstraintPresent
FROM all_constraints
WHERE constraint_name = 'FK_CATISSUE_COLL_PROT_EVENT'
AND table_name='CATISSUE_SPECIMEN_COLL_GROUP' AND owner = USER;
IF isConstraintPresen... | true |
81ff28876b93be01f5a30d90ab1909872dc8aba7 | SQL | dkmansion/PSLansweeper | /Resources/Reports/Monitor Information.sql | UTF-8 | 949 | 3.390625 | 3 | [
"MIT"
] | permissive | Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblMonitor.MonitorManufacturer As [Manufacturer Monitor],
tblMonitor.MonitorModel,
tblMonitor.SerialNumber,
tblMonitor.ManufacturedDate,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
... | true |
6c88a3b9e5b0812bd2487a4093b931783e9b9205 | SQL | hemmati/STVR | /src/sql/view/create_desktop_firefox_steps_results.sql | UTF-8 | 357 | 2.890625 | 3 | [] | no_license | CREATE VIEW desktop_firefox_steps_result AS SELECT desktop_firefox_steps.instruction,desktop_firefox_steps.version,execution_result.status,desktop_firefox_steps.product_name
FROM desktop_firefox_steps,execution_stepresult,execution_result
WHERE desktop_firefox_steps.id = execution_stepresult.step_id
and execution_stepr... | true |
71be2f09fafa6644ed95f46099e9da4e7c5801f6 | SQL | sk-sharif/angular-dashboard | /ch1-2-migration/schema/bidwise_new.sql | UTF-8 | 7,103 | 3.703125 | 4 | [] | no_license | drop table if exists addotnet.bidwise_mb_stats;
CREATE TABLE addotnet.bidwise_mb_stats
(
`source` String,
`category` String,
`clicks` Int64,
`spend` Float64,
`cpc` Float64,
`referrer_domain` Nullable(String),
`category_id` UInt64 DEFAULT toI... | true |
18ed31f7aa6c14ff519deda3b609abadd03b6e88 | SQL | claudiabm777/CentralDeAbastos | /CabAndes/docs/sql/creacion.sql | UTF-8 | 12,752 | 3.5625 | 4 | [] | no_license | DROP TABLE PRODUCTO_PRECIO_VENTA;
DROP TABLE PRODUCTO_PEDIDO;
DROP TABLE PRODUCTO_LUGAR_ALMAC;
DROP TABLE VENTA;
DROP TABLE MOVIMIENTO;
DROP TABLE NOTIFICACION_BODEGA_PED;
DROP TABLE BODEGA_PEDIDO;
DROP TABLE PEDIDO;
DROP TABLE OFERTA_PROVEEDOR;
DROP TABLE LICITACION;
DROP TABLE PROVEEDOR;
DROP TABLE LOCAL;
DROP TABLE ... | true |
2396870f7617c8ebbeb27dac9d31c64291ea826c | SQL | SSilvaGustavo/xbox-backend | /prisma/migrations/20210930224108_init/migration.sql | UTF-8 | 2,560 | 3.78125 | 4 | [
"MIT"
] | permissive | -- CreateTable
CREATE TABLE `User` (
`idUser` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL,
`surname` VARCHAR(191),
`email` VARCHAR(191) NOT NULL,
`password` VARCHAR(191) NOT NULL,
`cpf` VARCHAR(191) NOT NULL,
UNIQUE INDEX `User_email_key`(`email`),
UNIQUE INDEX `User_c... | true |
073740c822986de628ffa142294e0a74c7186064 | SQL | geovanneoliveira/Prontuario | /src/main/resources/db/migration/V01__criar_banco.sql | UTF-8 | 1,262 | 3.546875 | 4 | [] | no_license | CREATE TABLE FUNCIONARIO (
ID BIGINT(20) PRIMARY KEY AUTO_INCREMENT,
NOME VARCHAR(50) NOT NULL,
CARGO VARCHAR(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
CREATE TABLE PACIENTE (
ID BIGINT(20) PRIMARY KEY AUTO_INCREMENT,
NOME VARCHAR(50) NOT NULL,
IDADE INTEGER NOT NULL,
SEXO VARCHAR(... | true |
a6d6351ae6e3cb31be5c3b0f33ca903d49d6a4eb | SQL | sicmmar/Proyecto-Compi2 | /entrada.sql | UTF-8 | 7,043 | 3.640625 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS test
OWNER = 'root'
MODE = 1;
USE test;
CREATE TABLE tbusuario (
idusuario integer NOT NULL primary key,
nombre varchar(50),
apellido varchar(50),
usuario varchar(15) UNIQUE NOT NULL,
password varchar(15) NOT NULL,
fechacreacion date
);
CREATE TABLE tbroles (
idrol... | true |
854938efcef2f560275ad23826b2f46703d62a92 | SQL | Mart1nDimtrov/Practical-SQL | /13. Mining Text to Find Meaningful Data/FindReplaceTextForPublishingCompany.sql | UTF-8 | 823 | 3.21875 | 3 | [] | no_license | /*
1.The style guide of a publishing company you’re writing for
wants you to avoid commas before suffixes in names.
But there are several names like Alvarez, Jr. and Williams,
Sr. in your database. Which functions can you use to remove the comma?
Would a regular expression function help?
How would you capture j... | true |
400f6b969d2f9c37159618bb949ad73a81fbd0c6 | SQL | joaoAndradeJr/MySql-vocabulary-booster | /desafio16.sql | UTF-8 | 906 | 3.9375 | 4 | [] | no_license | -- Crie uma função chamada buscar_quantidade_de_empregos_por_funcionario no banco de dados hr que, ao receber o email de uma pessoa funcionária, retorne a quantidade de empregos presentes em seu histórico
-- Crie uma função chamada buscar_quantidade_de_empregos_por_funcionario que, ao receber o email de uma pessoa func... | true |
0ee7e8beb9e08699eef1858a2c627a35efbaed56 | SQL | kissarat/example-crud | /server/schema.sql | UTF-8 | 794 | 3.265625 | 3 | [] | no_license | create table tblUsers (
usrID int auto_increment primary key,
usrName varchar(128) not null,
usrPassword varchar(128) not null
) engine=INNODB;
create table tblToken (
tknID char(96) not null primary key,
tkn_usrID int not null,
foreign key (tkn_usrID) references tblUsers(usrID)
on upda... | true |
5e1aaee33d06d5a76e3ae2de96190c3c3ac4d2f1 | SQL | tvkoooo/accc | /MySQL/test/xunhuan.sql | UTF-8 | 340 | 2.8125 | 3 | [] | no_license | use easydb;
/* Procedure structure for procedure `dowhile_say` */
/*!50003 DROP PROCEDURE IF EXISTS `dowhile_say` */;
DELIMITER $$
/*!50003 create procedure dowhile_say(
OUT `_COMBACK` char(20),
IN `_dotimes` int
)
begin
declare i int;
set i = 1;
while i < _dotimes do
set _COMBACK=i;
set i = i +1;
end while;
... | true |
cafbe51ad7e0093b3fad8ef24578a87a22d070d1 | SQL | mebelousov/antlr_psql | /src/test/resources/sql/select/afaf29be.sql | UTF-8 | 322 | 3.109375 | 3 | [
"MIT"
] | permissive | -- file:opr_sanity.sql ln:959 expect:true
SELECT a.aggfnoid::oid, p.proname, ptr.oid, ptr.proname
FROM pg_aggregate AS a, pg_proc AS p, pg_proc AS ptr
WHERE a.aggfnoid = p.oid AND
a.aggmtransfn = ptr.oid AND ptr.proisstrict AND
a.aggminitval IS NULL AND
NOT binary_coercible(p.proargtypes[0], a.aggmtranstype... | true |
3a963a9d447a7551f7ed93ddce2a2950111c4a38 | SQL | SakuraMatrix/p1-OlenkaQuispeHuanca | /src/main/resources/schema.cql | UTF-8 | 2,331 | 3.578125 | 4 | [] | no_license | -- Create a keyspace
CREATE KEYSPACE IF NOT EXISTS p2plender WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor' : '1'};
--create tables
CREATE TABLE IF NOT EXISTS p2plender.loans(
loan_id int,
loan_amount double,
interest_rate double,
loan_duration text,
lender_id int,
borrowe... | true |
10476dc025e73322d3799a1f579cccb4cf0b1466 | SQL | bellmit/java-zk-pipeline-spo | /spo/spoConf/src/db/14/SPO-14.35.sql | UTF-8 | 1,358 | 2.953125 | 3 | [] | no_license | declare
counter int;
report_num int;
begin
report_num := 216;
select count(*) into counter from report_template where id_template = report_num;
if counter = 0 then
insert into report_template(id_template, template_name, type, filename, system, full_hierarchy, template_data)
values(report_num, 'Шаблон у... | true |
3a81d5cdd6e4eb512a7b9cd57f481114aa7e3c3d | SQL | evgeniyv6/gb_db_mysql | /homework/exercise10/Script-10_optimization.sql | UTF-8 | 968 | 3.375 | 3 | [] | no_license | use vk;
DROP TABLE IF EXISTS logs;
CREATE TABLE logs (
created_at DATETIME NOT NULL,
table_name VARCHAR(45) NOT NULL,
key_id BIGINT(20) NOT NULL,
name_val VARCHAR(45) NOT NULL
) ENGINE = ARCHIVE;
DROP TRIGGER IF EXISTS watchdog_users;
delimiter //
CREATE TRIGGER watchdog_users AFTER INSERT ON users
FOR EACH ROW
B... | true |
a16902ca824014ace8625842e9200b7ebabe340c | SQL | deshengio/kpi | /config/datapool_table.sql | UTF-8 | 334 | 2.59375 | 3 | [
"MIT"
] | permissive | -- Table: datapool
-- DROP TABLE datapool;
CREATE TABLE datapool
(
id SERIAL Primary Key,
ThingName text NOT NULL,
ValueStreamName text NOT NULL,
KeyPropertyName text NOT NULL,
lastid integer UNIQUE,
lasttime timestamp with time zone NOT NULL,
closed boolean Default false
);
ALTER TABLE datapool
OWNER... | true |
5f22d4e8dd15d8aca6babbdcea480b5948a6b7b1 | SQL | zuhairhd/TelephoneDirectory | /database/newdatabase.sql | UTF-8 | 622 | 2.71875 | 3 | [] | no_license | SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
CREATE DATABASE `dir` DEFAULT CHARACTER SET... | true |
cfe2751fb3ba88330b012a35a740224278c7edde | SQL | ErosMLima/Training-Jan-2021 | /Modules/SQL/Day5/Nihar Sodhaparmar/practice.sql | UTF-8 | 1,735 | 4.0625 | 4 | [] | no_license | USE AdventureWorks2012;
-- INNER JOIN
SELECT pc.Name AS 'CategoryName'
, ps.Name AS 'SubCategoryName'
, pc.ProductCategoryID AS 'PC-ProductCategoryId'
, ps.ProductCategoryID AS 'PS-ProductCategoryId'
FROM Production.ProductCategory AS pc
INNER JOIN Production.ProductSubcategory AS ps ON pc.ProductCategoryID = ps.P... | true |
b1a1dec15403b102739a6c7038c00515fa634f45 | SQL | virithagk/leisproject | /LEISProject/leisdb schema setup/LEIS_DB.sql | UTF-8 | 1,759 | 3.390625 | 3 | [] | no_license | CREATE TABLE MANUFACTURER (MF_ID INT AUTO_INCREMENT, MF_NAME VARCHAR(40) NOT NULL, PRIMARY KEY (MF_ID));
CREATE TABLE EQUIPMENT_TYPE (TYPE_CODE VARCHAR(2), TYPE_NAME VARCHAR(15) NOT NULL, PRIMARY KEY (TYPE_CODE));
CREATE TABLE FUNDING_SOURCE (FS_ID INT AUTO_INCREMENT, FS_AGENCY_NAME VARCHAR(40) NOT NULL, FS_PROGRAM VAR... | true |
0756af7cababeacaf0b1374bcbac1f0029fb2f84 | SQL | mdepuydt/travel-app | /api/schema.sql | UTF-8 | 643 | 2.953125 | 3 | [] | no_license | drop table if exists articles;
create table articles (
id integer primary key autoincrement,
title text not null,
creationDate text not null,
content text,
photoName text,
latitude real,
longitude real
);
drop table if exists users;
create table users (
id integer primary key AUTOINCREMENT,
username ... | true |
fe15427f6a060fa9e909387683eaead3d02e70a8 | SQL | 777it/poi | /build/classes/main/META-INF/poi/domain/dao/ArticleTDao/selectArticleByUsernameAndDeletedAt.sql | UTF-8 | 178 | 2.6875 | 3 | [] | no_license | select
id
,title
,body
,category
,level
,updated_at
from
article_t
where
username = /* username */'poi' and
deleted_at is null
order by updated_at desc | true |
d378fd71bda26f612c66b98daa8a33e39a0f62aa | SQL | patrickdicks/IC_Food_Checker | /food_db.sql | UTF-8 | 2,007 | 3.8125 | 4 | [
"MIT"
] | permissive | --
-- Author: Patrick Dicks
-- Title: IC Food Checker
-- Objectives:
-- Create database
-- Write CREATE queries to build tables
-- Write INSERT queries to populate tables with data from ICN food list
-- Write SELECT queries to return foods appearing from the ICN food list with information... | true |
425113750a94e0d1da11552b79d8f07685eaf5db | SQL | RahmaNiftaliyev/SQL | /aggregation/weather_observation_station_15.sql | UTF-8 | 354 | 3.890625 | 4 | [] | no_license | --Problem Statement
/*
Query the Western Longitude (LONG_W) for the largest Northern Latitude (LAT_N) in STATION that is less than . Round your answer to decimal places.
Input Format
The STATION table is described as follows:
*/
--Solution
SELECT ROUND(LONG_W,4)
FROM STATION
WHERE LAT_N = (SELECT MAX(LAT_N) FRO... | true |
910047e29745c6f7cda7b051f9fbb69c92ccde3e | SQL | Silas-Ricky/kenyaemrMigration | /DML_4_Datasets/DML_Relationship.sql | UTF-8 | 770 | 3.546875 | 4 | [] | no_license | exec pr_OpenDecryptedSession
Select
P.PersonId as Index_Person_Id,
PR.PersonId as Relative_Person_Id,
CAST(DECRYPTBYKEY(R.FirstName) as varchar(100)) RelativeFirstName,
CAST(DECRYPTBYKEY(R.MidName) as varchar(100)) as RelativeMiddleName
,CAST(DECRYPTBYKEY(R.LastName) as varchar(100)) as RelativeLastName... | true |
ae2a9b5fe435d029e508a87aafeb2ee10c923cfb | SQL | mbarretogit/sql | /BASE_PREDIÇÃO.sql | UTF-8 | 843 | 3.21875 | 3 | [] | no_license | SELECT DISTINCT
ANO,
SEMESTRE,
STATUS_FTC,
NOME_UNIDADE_ENSINO_ALUNO,
NOME_CURSO,
ALUNO,
SERIE_CALCULADA AS SERIE,
SOLICITOU_PLANO,
SOLICITOU_HIST,
QTD_INADIMP,
INDICE_REPROVACAO,
PERC_FALTAS,
BOLSISTA,
TURNO,
TIPO_FINAN,
TIPO_INGRESSO,
VALOR_MENSALIDADE,
ANTECIP_FINAN,
P.... | true |
b144c7997cfaac5302fe0a6c937219149e715c28 | SQL | OscarAlpe/htdocs | /m3/u1/ejercicios/20200114/hoja10/videoteca p10 p11.sql | UTF-8 | 4,812 | 3.5625 | 4 | [] | no_license | CREATE DATABASE VIDEOTECA;
SET NAMES 'utf8';
--
-- Set default database
--
USE videoteca;
--
-- Definition for table actor
--
DROP TABLE IF EXISTS actor;
CREATE TABLE actor (
id INT(11) NOT NULL AUTO_INCREMENT,
nombre VARCHAR(64) NOT NULL,
apellidos VARCHAR(64) NOT NULL,
imdb VARCHAR(32) NOT NULL DEFAULT '',... | true |
b9b3745fd323eee7b380e22c6d221c68f1f19a20 | SQL | SlabkoKonstantin/HackerRank | /SQL/Advanced select/Occupations.sql | UTF-8 | 2,011 | 3.921875 | 4 | [] | no_license | CREATE TABLE RF.OCCUPATIONS
(
name VARCHAR2(100),
occupation VARCHAR2(100)
)
TABLESPACE QUORUM_DATA
STORAGE (
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
NOMONITORING
/
Insert into RF.OCCUPATIONS (NAME, OCCUPATION) Values ('Ashely','Professor');
Insert i... | true |
2cf84f653344c63cd5c831b6a38561509e124f7e | SQL | whyttte/BootcampX | /4_queries/13_name_of_teachers_and_number_of_assistances.sql | UTF-8 | 368 | 4 | 4 | [] | no_license | SELECT DISTINCT teachers.name AS teacher, cohorts.name AS cohort, COUNT(assistance_requests.teacher_id) AS total_assistances
FROM cohorts
JOIN students ON cohort_id = cohorts.id
JOIN assistance_requests ON student_id = students.id
JOIN teachers ON teacher_id = teachers.id
WHERE cohorts.name = 'JUL02'
GROUP BY tea... | true |
aba6a6b207d270d23277c5732584cd2fb1c7f673 | SQL | awill248/421_Project | /421Project.sql | UTF-8 | 2,642 | 3.5625 | 4 | [] | no_license | use awill248;
drop table if exists symptom;
drop table if exists vital;
drop table if exists appointment;
drop table if exists patient;
drop table if exists doctor;
drop table if exists nurse;
drop table if exists clinic;
create table clinic
(clinic_id int not null unique,
clinic_name varchar(15) not nu... | true |
e323a0395f7bad1ce8548344b8eae487c859fd4b | SQL | DAM-UEM-1819/ud8-tarea-11-pi-funcional-roberto-aprende-linux | /doc/Consultas 07-05-2019 final.sql | UTF-8 | 9,480 | 4.15625 | 4 | [] | no_license |
REM ********************************* INFORMES ***************************************
--NÚMERO DE HORAS DE ACTIVIDAD
--TOTALES
select count(cod_registro) * A.horas_actividad as "Horas actividad"
from registro R, actividad A
where A.nombre = R.actividad_nombre and R.fecha BETWEEN TO_DATE ('01/09/2018', 'dd/mm/yyyy')... | true |
99d6aeaa5c788f54d05b78f9334fc8e44c1d200c | SQL | work-ronmichael/mwp-migration | /USERS/3. MWP_USERS_PICTURE.SQL | UTF-8 | 194 | 2.921875 | 3 | [] | no_license | INSERT
INTO MWP_USERS_PICTURE
(
USER_PICTURE_USER_ID,
TEMP_PATH
)
SELECT
mwp.USERID,
prt.USER_PICTURE
FROM USERS mwp
LEFT JOIN PORTAL.TBL_USERS prt on mwp.USERNAME = prt.USER_NAME;
| true |
b424c62409ca7aef3608ffd3a2db7b95d008680e | SQL | taufiqr13/testphpdatabase | /database/db_testwadas.sql | UTF-8 | 2,573 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 11, 2021 at 11:44 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
2763f3be27b90e9afdb9de4c4e49e4b6d349f574 | SQL | taylor-tokareff/agg-lab | /exercise-3/exercise-3.sql | UTF-8 | 507 | 4.34375 | 4 | [] | no_license | -- the average rental amount by country
-- include the country name and avg amount
-- use AVG to average the amount
SELECT country,
AVG(amount)
FROM country
INNER JOIN city ON country.country_id = city.country_id
INNER JOIN address ON city.city_id = address.city_id
INNER JOIN customer ON address.address_id = cu... | true |
c8c41e3b915ca2dd32d7e7e680968a21505212dd | SQL | cari1928/TAPW_PROYECTO2_2 | /vuelos.sql | UTF-8 | 20,467 | 3.046875 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS ... | true |
27083708929734ebd49d5a949b7fd2d3b6da9657 | SQL | rahurkar/trm | /queries/flow_optimize.sql | UTF-8 | 842 | 3.59375 | 4 | [] | no_license | # Example address: bc1qzw7g6sns7rcxr7xsgtqwhcpkygyc8l8v39egl5
WITH data as (
SELECT
sender,
receiver,
SUM(value) AS value,
CASE sender
WHEN 'bc1qzw7g6sns7rcxr7xsgtqwhcpkygyc8l8v39egl5' THEN 1
ELSE 0
END AS outflow,
CASE receiver
WHEN 'bc1qzw7g6sns7rcxr7xsgtqwhcpkygyc8l8v39eg... | true |
e3813d6f20020ae2fb35e28e39bfe109739fbe83 | SQL | XoopsModulesArchive/subscription | /sql/upgrade-0.7x-0.85.sql | UTF-8 | 3,238 | 3.609375 | 4 | [] | no_license |
CREATE TABLE XOOPS_subscription2_type (
subtypeid int(11) not null auto_increment ,
primary key(subtypeid),
psid int(11) default '0',
type varchar(50) not null,
groupid int(11) default '0'
) TYPE=MyISAM;
CREATE TABLE XOOPS_subscription2_interval (
subintervalid int(11) NOT NULL auto_increment,
name varchar(2... | true |
d731f90f51f25375ad1f372db30c52ae8902de73 | SQL | wordpressramu/SQL-1 | /L608_Tree_Node.sql | UTF-8 | 1,073 | 4.15625 | 4 | [] | no_license | Given a table tree, id is identifier of the tree node and p_id is its parent node's id.
+----+------+
| id | p_id |
+----+------+
| 1 | null |
| 2 | 1 |
| 3 | 1 |
| 4 | 2 |
| 5 | 2 |
+----+------+
Each node in the tree can be one of three types:
Leaf: if the node is a leaf node.
Root: if the node is t... | true |
154c1557f016e096d176da6bfec6d5aba39622ff | SQL | APet74/cseProject | /db/InvoiceDB.sql | UTF-8 | 666 | 3.28125 | 3 | [] | no_license | /* Assignment 4 - (Phase III) -DDL statements
Author(s):
Date:
Instructions:
Include all the necessary SQL queries to create your database.
Make sure to:
-Use conditional DROP TABLE IF EXISTS statements to clear out old versions of tables with the same name.
-Do NOT include a “USE database” statement: we will b... | true |
107693b47d621004c0a71a7b2ba94c35c8573075 | SQL | TsvetomirAleksandrov/Software-University | /Databases Basics - MS SQL Server - May 2020/05.DataAggregation/05.DataAggregation/19.SalaryChallenge.sql | UTF-8 | 287 | 3.4375 | 3 | [] | no_license | SELECT TOP 10
e.FirstName,
e.LastName,
e.DepartmentID
FROM Employees e
WHERE e.Salary > (SELECT AVG(es.Salary)
FROM Employees es
WHERE e.DepartmentID = es.DepartmentID)
ORDER BY e.DepartmentID | true |
a9dde02be1432befec1cb90c1874c8c69aa2933a | SQL | moutainhigh/server-3 | /sql/eshop_statistics/20170703新建投放收益统计表.sql | UTF-8 | 1,280 | 3.328125 | 3 | [] | no_license | CREATE TABLE `report_earnings_daily` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`ad_point` decimal(10,6) unsigned NOT NULL DEFAULT '0' COMMENT '广告总投放积分',
`user_point` decimal(10,6) unsigned NOT NULL DEFAULT '0' COMMENT '用户总收益',
`love_point` decimal(10,6) unsigned NOT NULL DEFAULT '0' COMMENT '爱心账户总... | true |
1d8f932153d51c7ae06cc9ae9e0fcbe7f566fcf5 | SQL | kkkkang1009/leetcode | /leetcode_176.sql | UTF-8 | 150 | 3.21875 | 3 | [] | no_license | -- 176. Second Highest Salary
SELECT MAX(Salary) AS SecondHighestSalary
FROM Employee
WHERE Salary NOT IN(
SELECT MAX(Salary)
FROM Employee ) | true |
52a0b3a29687499616ba0d02a34b1f996cdf6740 | SQL | vprof/php_tasks | /vprof.sql | UTF-8 | 1,562 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Июн 02 2015 г., 07:49
-- Версия сервера: 5.6.17
-- Версия PHP: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4... | true |
54197753c54995b73fc8a22aa94da6bcac6acd0a | SQL | deepak-po/solar-estimator | /seed/01-tables.sql | UTF-8 | 642 | 3.25 | 3 | [] | no_license | CREATE TABLE owners (
id SERIAL PRIMARY KEY,
username VARCHAR(40) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
hashed BYTEA NOT NULL,
firstname VARCHAR(40) ,
lastname VARCHAR(40) ,
pic VARCHAR(500),
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE projects (
id SERIAL PRIMARY KEY,
owne... | true |
929da8ac547698c155dd3de0321655f337c2e7f2 | SQL | mattrosstaylor/springboot-carpark | /src/main/resources/data.sql | UTF-8 | 765 | 2.78125 | 3 | [] | no_license | insert into driver (name, address, phone_number, date_of_birth) values
("Matt R Taylor", "Cornwall, UK", "0525 843713", str_to_date("October 16 1983", "%M %d %Y")),
("Peachie Pie", "Henan, China", "0525 134355", str_to_date("November 10 1988", "%M %d %Y")),
("Annie Xu", "Henan, China", "0525 962541", str_to_date(... | true |
16379119728487c02405852cd0720d3368bd9b05 | SQL | gicadmin/allo | /PHENIX/Packages/VSA_PACK.sql | UTF-8 | 3,166 | 2.828125 | 3 | [] | no_license | CREATE OR REPLACE PACKAGE phenix.VSA_PACK AS
PROCEDURE INIT_RECORD_PROC(
p_rec OUT NOCOPY vendor_sales_agreements%ROWTYPE);
FUNCTION GET_FULL_FUNC(
p_vsa_code IN vendor_sales_agreements.vsa_code%TYPE,
p_vsa_rec OUT NOCOPY vendor_sales_agreeme... | true |
84b71a66cdabeb54ec7498b709188123a7e127eb | SQL | alexcr-telecom/cisco-directory | /phonebook.sql | UTF-8 | 1,672 | 2.9375 | 3 | [
"BSD-2-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Окт 22 2019 г., 17:39
-- Версия сервера: 5.7.27-0ubuntu0.16.04.1
-- Версия PHP: 7.0.33-0ubuntu0.16.04.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
b52b218be9621675787d5d9b5e50529fb3226d67 | SQL | Belobog/Projet-.net | /SQLQuery3.sql | UTF-8 | 329 | 3.078125 | 3 | [] | no_license | SELECT aspnet_Document.DocumentName, aspnet_Users.UserName
FROM aspnet_Document,aspnet_DocumentInUsers,aspnet_Users
Where aspnet_Document.DocumentId = aspnet_DocumentInUsers.DocumentId
AND aspnet_DocumentInUsers.UsersId = aspnet_Users... | true |
d560dd45f1105a398daa4fce36f5b5eb2be20307 | SQL | JPG-Consulting/financialanalysis | /Analyst_sln/FinancialAnalyst.DAC/EdgarSEC/sql/scripts/create SP_GET_DIMENSIONS_KEYS.sql | UTF-8 | 153 | 2.65625 | 3 | [
"MIT"
] | permissive | CREATE PROCEDURE SP_GET_DIMENSIONS_KEYS
@datsetid int
AS
BEGIN
select DimensionH [key],Id
from EdgarDatasetDimensions where DatasetId = @datsetid;
END | true |
e716eb3c0ee3d3c3e24882b7dc1872d610efa951 | SQL | Kommandotolken/labman-final | /sql/ddl.sql | UTF-8 | 2,920 | 4.21875 | 4 | [] | no_license | -- use the right database
use lab;
--
-- Drop all table in order
--
DROP TABLE IF EXISTS booking;
DROP TABLE IF EXISTS eqkategori;
DROP TABLE IF EXISTS kategori;
DROP TABLE IF EXISTS equipment;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS log;
--
-- Create tables in right order
--
CREATE TABLE users (
id VARCHAR... | true |
d5bb1f4dfdaf7f0b5a52d4fd5f4b3ce2f4054815 | SQL | chanwit/employee | /db/migration/V4__Create_Email_table.sql | UTF-8 | 455 | 2.90625 | 3 | [] | no_license | CREATE TABLE EMAIL
(
ID BIGINT AUTO_INCREMENT PRIMARY KEY NOT NULL,
EMAIL_ADDRESS VARCHAR(200) NOT NULL,
EMPLOYEE_ID BIGINT NOT NULL,
);
ALTER TABLE PUBLIC.EMAIL ADD FOREIGN KEY (EMPLOYEE_ID) REFERENCES EMPLOYEE (ID);
INSERT INTO PUBLIC.EMAIL (ID, EMA... | true |
f1cf20eb7277c8d220e8925e470613b94892f332 | SQL | motherfather/sql | /select-basic/null관련함수.sql | UTF-8 | 794 | 3.421875 | 3 | [] | no_license | -- null 관련 함수
select nvl(null, 0) from dual;
select nvl(123, 0) from dual;
select employee_id, nvl(commission_pct, 0), nvl(commission_pct, 0)*salary from employees;
select nvl2(null, 10, 0) from dual;
select nvl2(123, 10, 0) from dual;
select employee_id, nvl2(commission_pct, commission_pct*salary, 0) fro... | true |
e255607c1e9f539365b6afab0aa13a2b277a8412 | SQL | happyxiaoxiong/track-record | /dao/src/main/resources/track-record.sql | UTF-8 | 18,237 | 2.9375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `track_record` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `track_record`;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 192.168.224.176 Database: track_record
-- ------------------------------------------------------
-- Server version 5.7.21-0ubuntu0.16.04.1
/*!... | true |
6b8952617be3f4e479b3e5ea3431dd1fb02f50b4 | SQL | bryan7zhang/T-SQL_Fundamentals | /BookStore/PART-II/SQLQuery4.sql | UTF-8 | 1,070 | 4.625 | 5 | [] | no_license | /* Using the UNION command, calculate new prices for the books based on the year-to-date
sales for each book in the TITLES table. If the year-to-date sales are less than $2500, add
15% to the price; if the year-to-date sales are greater than or equal to $2500 and less than or
equal to $10000, add 10% to the price of th... | true |
1505de3861c1b3081361595bb976ea49720bad00 | SQL | OleksZamkovyi/RestSpringApi_2.0 | /src/main/resources/create.sql | UTF-8 | 6,505 | 3.59375 | 4 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema rest_spri... | true |
a31a10f0a380ac2e8fd1c745fef1ee70db87e61e | SQL | AlJelaliHaifa/SEMAINE-17 | /MongoDB/create_insert_find_delete_update.sql | UTF-8 | 9,180 | 2.640625 | 3 | [] | no_license | -- creation de la base de donnée gescom_afpa
use gescom_afpa
-- creation de la collection categories
db.createCollection("categories")
-- Insertion d'éléments dans la collection categories
db.categories.insertOne({
"cat_id": 2,
"cat_name": "Outillage manuel",
... | true |
14f2b428e03be083c6650b2a2b18469b0412e131 | SQL | PrincyChauhan/Covid_TMS | /database/covidtmsdb.sql | UTF-8 | 7,727 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 11, 2021 at 07:34 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
9d994b50be602df51a32a104ec6c41c1ad294bd8 | SQL | foozbat/fzb-framework | /db.mysql.sql | UTF-8 | 457 | 2.59375 | 3 | [
"MIT"
] | permissive | CREATE TABLE `test` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`last_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`name` varchar(255) DEFAULT NULL,
`city` varchar(25) DEFAULT NULL,
`state` char(2) DEFAULT NULL,
... | true |
d8d5d0cb069722ccb8a752211dfd6e989200ef64 | SQL | claudiacalderas/to-doList | /todoList.sql | UTF-8 | 359 | 3.140625 | 3 | [] | no_license |
/* Weekend challenge #3
TO DO Application */
CREATE TABLE "lists" (
"list_id" SERIAL PRIMARY KEY,
"list_name" VARCHAR(30) NOT NULL
);
CREATE TABLE "tasks" (
"task_id" SERIAL PRIMARY KEY,
"task_description" VARCHAR(30) NOT NULL,
"priority" INT,
"list_id" INT REFERENCES "lists",
"done" BOOLEAN NOT NULL,
"du... | true |
c4973d00ed76ee3b03e77884efc811882fb9efbb | SQL | Trev0N/carrental | /src/main/resources/db/migration/V5__car_detail_create.sql | UTF-8 | 880 | 3.609375 | 4 | [] | no_license | DROP TABLE IF EXISTS carrental.car_detail;
DROP SEQUENCE IF EXISTS carrental.car_detail_seq_id;
CREATE SEQUENCE carrental.car_detail_seq_id;
CREATE TABLE carrental.car_detail (
"id" BIGINT NOT NULL DEFAULT nextval('carrental.car_detail_seq_id'),
... | true |
c0aed4e8bf48fc47f16653dd33b994f3109ea7a1 | SQL | jianfeiZhao/SQL_exercises | /q8.sql | UTF-8 | 1,562 | 4.46875 | 4 | [] | no_license | /*For this challenge use engagement-data.csv
Data in this file looks like this
<LECTURE><STUDENT NAME><POINTS SCORED in THAT LECTURE>
L02,Olga Shiligin ,8
L02,Sudhan Maharjan ,2
here in L02, Olga Shiligin,scored 8 points in L02.
And Sudhan Maharjan scored 2 points in L02.
*/
/* create table engage*/
DROP table IF E... | true |
230d415226c4d247e78215cdcb2f2275bdd15352 | SQL | StephenImp/SpringBootBasisAndPromote | /SpringBootSecurity/src/main/resources/sql/springboot2.sql | UTF-8 | 6,787 | 3.171875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 203
Source Server Version : 50719
Source Host : 192.168.0.203:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50719
File Encoding : 65001
Date: 2018-04-12 15:20:05
*/
SET FOREIGN_KEY_CHECKS=0;
-- ------... | true |
b5deb2f0f535e68269fe952479a7adb23bc7d574 | SQL | 1i0n0/nowcoder-Solutions | /sql/nowcoder_sql67-71.sql | UTF-8 | 2,919 | 4.5625 | 5 | [] | no_license | -- ----------------------------
-- https://www.nowcoder.com/activity/oj?tab=1
-- ----------------------------
-- SQL67 牛客每个人最近的登录日期(二) (每个用户最近登录日期及设备)
SELECT u.name AS u_n,
c.name AS c_n,
l1.date AS date
FROM login l1
JOIN user u ON l1.user_id = u.id
JOIN client c ON l1.client_id = c.id
WHERE l1.date = ... | true |
9d736191ed481b937bcc3731ae5fec25491bc404 | SQL | jip1984/Full-Stack-Project-Assessment | /database/myTube.sql | UTF-8 | 1,407 | 3.03125 | 3 | [] | no_license | CREATE TABLE videos (
id SERIAL PRIMARY KEY,
title VARCHAR(100) NOT NULL,
url VARCHAR(100) NOT NULL,
rating INT
);
INSERT INTO videos (title, url, rating)
VALUES ('Cracking Enigma in 2021 - Computerphile','https://www.youtube.com/watch?v=RzWB5jL5RX0', 111);
INSERT INTO videos (title, url, rating)
V... | true |
21ba441e7773f3447e039a0a4b6d4a309b66169f | SQL | Slooowpoke/wolffia | /database/wolffia.sql | UTF-8 | 3,770 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 27, 2018 at 07:49 PM
-- Server version: 10.3.9-MariaDB-1:10.3.9+maria~stretch
-- PHP Version: 7.0.31-1+0~20180910100529.3+stretch~1.gbp90e89d
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0... | true |
bc82656fa3202aeb94a4ec076a02cf55a485e97d | SQL | vcappugi/ADESVENCA | /migration/352a-353a/oracle/306_FR2151667.sql | UTF-8 | 36,701 | 2.859375 | 3 | [] | no_license | SET DEFINE OFF
SET SQLBLANKLINES ON
-- 07.10.2008 17:27:16 EEST
-- -
UPDATE AD_Column SET AD_Element_ID=53245, ColumnName='PP_Product_BOM_ID', Description='BOM & Formula', EntityType='EE01', FieldLength=10, Help=NULL, Name='BOM & Formula',Updated=TO_DATE('2008-10-07 17:27:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WH... | true |
a22d0b3da134e3b2ebd72c3a6aff5386035dcd5f | SQL | limelier/pl-sql-hell | /lab4/lili.sql | UTF-8 | 1,749 | 3.9375 | 4 | [] | no_license | -- Adaugati o coloana noua la tabelul studenti cu denumirea “lista_medii” de tip nested table in care se vor adauga mediile semestriale ale studentilor (din anul 1 sem 1, an 1 sem 2, an 2 sem 1 etc.). Campul de medii va fi extins doar cat este necesar (nu va contine decat locatii pentru mediile existente si nu 6 pentru... | true |
c39c4ce88a4388fcb06564ba752770f33041e57c | SQL | PhilippeHeer/Music | /queries/l.sql | UTF-8 | 628 | 3.6875 | 4 | [] | no_license | SELECT Name
FROM Genre
WHERE Genre_id NOT IN (
SELECT g.Genre_id
FROM Artist a, is_genre i, Genre g
WHERE a.Artist_id = i.Artist_id AND i.Genre_id = g.Genre_id AND a.Gender_id = 'Male'
)
UNION
SELECT Name
FROM Genre
WHERE Genre_id NOT IN (
SELECT g.Genre_id
FROM Artist a, is_genre i, Genre... | true |
f07abc4569e5bbbbae49556bf97b5472992df101 | SQL | rahulnagure/Practice | /Practice/scripts/roombooking.sql | UTF-8 | 4,496 | 3.703125 | 4 | [] | no_license | create table room(
room_id BIGINT AUTO_INCREMENT PRIMARY KEY,
name varchar(255),
description varchar(255));
create table amenity(
amenity_id BIGINT NOT NULL AUTO_INCREMENT,
name_of_amenity varchar(50),
description varchar(255),
CONSTRAINT u_amenity_id_name UNIQUE KEY (amenity_id,name_of_ameni... | true |
07d833c0633672e25405a3eda6f830a71b4e5f7a | SQL | pythianbalistoy/ScriptRepository | /Avail/Client Reports/STATPRO Investigation.sql | UTF-8 | 925 | 3.859375 | 4 | [
"MIT"
] | permissive | SELECT m.p_id "CR",
min(to_char(date_created,'DD-MON-YYYY')) "Date Created",
max(to_char(date_updated,'DD-MON-YYYY')) "Last Updated",
max(substr(m.p_title,1,70)||decode(sign(length(m.p_title)-110),1,'...')) "CR Title",
Max(m.dba_id) DBA,
sum(hours_worked) "Hours Worked",
Max(... | true |
aae60d332e9c49be343d7aeaf105f64e9d7411fc | SQL | dtesfai/fall-sublet-finder | /apartments_db.sql | UTF-8 | 4,142 | 3.171875 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 11.2 (Debian 11.2-1.pgdg90+1)
-- Dumped by pg_dump version 11.2 (Debian 11.2-1.pgdg90+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_stri... | true |
79053c6cc5a51d2157058d60b0938ef336e91ffb | SQL | AndresGelves-Inc/Reto5 | /DB/TRANSMISIONES.sql | UTF-8 | 1,269 | 2.953125 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS transmisiones(
id_transmisiones int auto_increment,
username varchar(50) not null,
titulo_contenido varchar(100) not null,
fecha datetime not null,
primary key(id_transmisiones),
foreign key(username) references usuarios(id_usuario)
);
insert into transmisiones(username, ti... | true |
00d5eb420b68fec4120bdae2f72e9f71f2514d0c | SQL | keep2iron/daydream-server | /daydream.sql | UTF-8 | 464 | 2.734375 | 3 | [] | no_license | create database daydream;
use daydream;
CREATE TABLE Persons (
PersonID int default null comment 'id',
NickName varchar(63) default '' comment '昵称',
Avatar varchar(255) default '' comment '头像'
);
CREATE TABLE Movies (
MovieName varchar(255) default '' comment '电影名称',
MovieCover varchar(255) default '' c... | true |
aed2b573b0a07e68af03b085f01c3abaf95f1be3 | SQL | university-smb/RadioLondre | /db.sqlite3.sql | UTF-8 | 2,003 | 2.859375 | 3 | [] | no_license |
CREATE TABLE "radio_studioradio" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"messageCourant_text" varchar(255) NOT NULL
);
CREATE TABLE"radio_posteradio" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"messageCourant_text" varchar(255) NOT NULL,
"StudioRadio_id_id" bigint NOT NULL,
FOREIGN KEY("Stu... | true |
a4f6d7a8615260c477cf99f2af544bd4a1ba3d28 | SQL | DanyZurita/SQL | /P07.sql | UTF-8 | 6,284 | 4.0625 | 4 | [] | no_license | /* 0. */
/* looking for a hotel room, more or less */
/* 1. */
/* Drawing of the entity relational model */
/* 2. */
/* postgres@DBVMPC:~$ createdb bookings -O booking
postgres=# create user booking with password 'alualualu'; */
/* 3. */
create table customers (id int, lastname text, firstnam... | true |
c5f96acbd261bcfe5a1aaec2e0b81f1be1339211 | SQL | pennsignals/dsdk | /assets/postgres/predictions/insert.sql | UTF-8 | 583 | 3.125 | 3 | [
"MIT"
] | permissive | with i_predictions as (
insert into predictions (
run_id,
subject_id,
score
)
select
%(run_id)s,
%(subject_id)s,
%(score)s
returning *
), i_evidence as (
insert into features (
id,
is_animal,
is_vegetable,
is_mineral,
... | true |
551ba63936d6c25aed28d6e54f024dffbe96f2a3 | SQL | stamhe/mincms | /packages/install.sql | UTF-8 | 6,174 | 3.515625 | 4 | [] | no_license |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- 数据库: `mincms`
--
... | true |
af351bf3618d6d0f41d509aaa668a72044951138 | SQL | Kanishk-kumar399/Employee_Payroll_DB | /Payroll_Service.sql | UTF-8 | 4,588 | 4.3125 | 4 | [] | no_license | #Payroll_Service
#See existing databases
show databases;
#Creating a new database
create database payroll_service;
#To work on a database
USE payroll_service;
#To select database
SELECT DATABASE();
#ability to add table and describe it
CREATE TABLE employee_payroll
(
id INT unsigned NOT NULL AUTO_INCRE... | true |
82970d4a94f2dd8a96ab085ca2387da9cac3b4a8 | SQL | rsrobinett/GuardianAngel | /scripts/queries.sql | UTF-8 | 847 | 3.859375 | 4 | [] | no_license | CREATE TABLE Guardian
(
id INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
username VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL
);
CREATE UNIQUE INDEX Username ON Guardian (username);
CREATE TABLE device
(
Id INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
Name VARCHAR(255) NOT NULL
);
CREATE TABLE Devi... | true |
fd2758fca193e55631d323155023b23d40bb172c | SQL | ayeshashafquat/other-work | /A1.sql | UTF-8 | 1,753 | 3.984375 | 4 | [] | no_license | /* Assignment #1 - INST327 - Answer Key - DO NOT DISTRIBUTE */
/*Answer 1*/
USE om;
SELECT CONCAT(customer_last_name, ', ', customer_first_name) AS 'Customer Name',
CONCAT('Contact #: ', right(customer_phone,3) , "-" , mid(customer_phone,4,3) , "-", right(customer_phone,4)) AS 'Customer Contact Number',
CONCAT(custome... | true |
bff2def5adc018b730930fc28b09ba1eb14ad00d | SQL | shiyicode/oj-web | /scripts/sql/oj.sql | UTF-8 | 8,900 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE `problem` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`user_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '题目提供者',
`difficulty` varchar(40) NOT NULL DEFAULT '' COMMENT '题目难度',
`case_data` varchar(200) NOT NULL DEFAULT '' COMMENT '测试数据',
`title` varchar(100) NOT NULL DE... | true |
47301cf288bc3071ef2fd87cd481fd51d83d88c7 | SQL | SaitoTech/saito-lite | /mods/appstore/sql/modules1.sql | UTF-8 | 301 | 2.59375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS modules (
id INTEGER,
name TEXT,
description TEXT,
categories TEXT,
version TEXT,
image TEXT,
publickey TEXT,
unixtime INTEGER,
bid INTEGER,
bsh TEXT,
tx BLOB,
featured INTEGER DEFAULT 0,
UNIQUE (version),
UNIQUE (tx),
PRIMARY KEY (id ASC)
);
| true |
458214ca066019c865921d7002a76af1c03ef53b | SQL | winf-hsos/winf-hsos.github.io | /databricks-notebooks/applied-analytics/Template - Campusbier Verkäufe.sql | UTF-8 | 3,274 | 3.234375 | 3 | [] | no_license | -- Databricks notebook source
-- MAGIC %md
-- MAGIC # Vorbereitung: Daten einmalig anlegen
-- MAGIC ---
-- MAGIC Den Block unten müsst ihr einmalig ausführen, um die Daten in eurem Databricks-Account anzulegen. Danach könnt ihr Abfragen auf der neuen Tabelle `beer_orders` durchführen und damit die Fragen aus der Fallst... | true |
05c94d699750f4a768d9bc3815f1c25d26a36d9b | SQL | jasnzhuang/18rj_CI318 | /cidb.sql | UTF-8 | 4,930 | 3.40625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
Navicat Premium Data Transfer
Source Server : localMySQL
Source Server Type : MySQL
Source Server Version : 50718
Source Host : localhost:3306
Source Schema : cidb
Target Server Type : MySQL
Target Server Version : 50718
File Encoding : 65001
Date: 14/06/2018 16:4... | true |
9af09382bf391efad7761c3b3a4af33c30c8dfa5 | SQL | aprilianta/DrugStore | /gowok.sql | UTF-8 | 17,184 | 3.359375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 23, 2019 at 10:07 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
a6809fcae4d215500952126f4533fc7188a696a9 | SQL | gpipperr/OraDBASQLScripts | /oem/get_target_oracle_home.sql | UTF-8 | 2,043 | 3.59375 | 4 | [] | no_license | --==============================================================================
-- GPI - Gunther Pippèrr
-- get the Oracle Home of a target
--==============================================================================
set verify off
set linesize 130 pagesize 300 recsep off
define TARGET_NAME = '&1'
prompt
prompt... | true |
ccea9645161aa22739160cddf64447e6e567da80 | SQL | exyangbang/learngit | /utp-manage-ht/utp-manage-api/src/main/resources/ddl/bankaccounttransdetail/BankAccountTransDetail.ddl | UTF-8 | 2,133 | 3.421875 | 3 | [] | no_license | drop table if exists t_bank_account_trans_detail;
create table t_bank_account_trans_detail (
id int(6) NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID'
,user_create varchar(250) COMMENT '创建用户'
,gmt_create datetime COMMENT '创建时间'
,user_modified varchar(250) COMMENT '修改用户'
,gmt_modified datetime COMMENT '修改时间... | true |
8f0f369e74255665427c1ce4d020f9262118479b | SQL | hellathuy/programming_practice | /SQL/easy/japanese_cities.sql | UTF-8 | 126 | 2.828125 | 3 | [] | no_license | /* https://www.hackerrank.com/challenges/japanese-cities-name/problem */
SELECT NAME FROM CITY
WHERE COUNTRYCODE = 'JPN';
| true |
c079b80310261195dfed3dba1bcf432235477f3e | SQL | Carleto04/lab-mysql | /your-code/seeding.sql | UTF-8 | 1,094 | 2.828125 | 3 | [] | no_license | USE lab_mysql;
INSERT INTO cars (model, Yr, Color, City, City_ID, Car_ID, ECO)
VALUES ('Peugeot', '2018', 'Silver', 'Cartagena', '00212999', '123456789', '0');
INSERT INTO customer (Customer_l_name, Customer_f_name, Customer_ID, Age, Phone, Email, Address, City, City_ID, State_Province, ZIP_Postal_Code, Number_visits,... | true |
24b087dd36766ab2135d71cf9ae5805e6772d84c | SQL | bbk0529/java | /webdev/WebContent/board/board.sql | UTF-8 | 1,798 | 3.96875 | 4 | [] | no_license |
/* Drop Tables */
DROP TABLE tb_board CASCADE CONSTRAINTS;
/* Drop Sequences */
DROP SEQUENCE seq_board;
/* Create Sequences */
CREATE SEQUENCE seq_board;
/* Create Tables */
CREATE TABLE tb_board
(
no number NOT NULL,
name varchar2(20) NOT NULL,
title varchar2(100) NOT NULL,
content varchar2(4000) N... | true |
07d279a59a642fa94e83d6caa8ce616cf8a299e6 | SQL | HackathonH/VMT | /final1/vehicle.sql | UTF-8 | 8,753 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 06, 2018 at 06:11 AM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 5.6.36
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... | true |
65d516f88f412437b846189c5bab5f5372383728 | SQL | eduardofischer/trab_final_fbd | /instancias.sql | UTF-8 | 10,570 | 2.71875 | 3 | [] | no_license | -- Usuários
insert into Usuarios (nome_de_usuario, email, nacionalidade, hash_senha, glicko_rapid)
values ('magnus', 'magzzy@gmail.com', 'NO', '234fdsa86t2', 2780);
insert into Usuarios (nome_de_usuario, email, nacionalidade, hash_senha, glicko_rapid)
values ('caruana', 'fabi@outlook.com', 'ITA', '2dcfdsa86t3', 2690... | true |
c229b3732b0f14774ab7010fac8aa1af94fd2e05 | SQL | Holid-creator/PPDB-Online | /ppdb_online.sql | UTF-8 | 15,562 | 2.953125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 08, 2021 at 04:55 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
fa8424e71f02ccf1efafa1c71a0fa525e0088857 | SQL | lperez0/Login-App | /src/test/resources/data.sql | UTF-8 | 635 | 3.421875 | 3 | [] | no_license | DROP TABLE IF EXISTS customer;
DROP TABLE IF EXISTS agent_role;
DROP TABLE IF EXISTS agent;
DROP TABLE IF EXISTS role;
CREATE TABLE customer (
customer_id INT PRIMARY KEY,
ip_address VARCHAR(250),
alias VARCHAR(250)
);
CREATE TABLE agent (
agent_id int PRIMARY KEY,
agent_name VARCHAR(250),
fir... | true |
a321877dd298011afdfd28ce344c9ecbef149ef9 | SQL | colingmurney/Restaurant | /MySQL/create_db.sql | UTF-8 | 7,976 | 3.875 | 4 | [] | no_license | # create database
DROP DATABASE IF EXISTS restaurant;
CREATE DATABASE restaurant;
USE restaurant;
# create province table and insert data
DROP TABLE IF EXISTS province;
CREATE TABLE province (
province_id tinyint,
province_name varchar(25) not null,
PRIMARY KEY (province_id)
)ENGINE=InnoDB;
INSERT INTO province... | true |
d71e43eb8689fc65659001764bd3c4ba64584ade | SQL | topkung157/ProjectCoffee-TopsCode | /Coffee TsC/coffee.sql | UTF-8 | 5,451 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 01, 2020 at 11:21 AM
-- Server version: 8.0.17
-- PHP Version: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.