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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
08f40f7f404bf5da03ba6d5960c8af1460a08642 | SQL | malikov-dm/HackerRank | /Sql/the-pads/the-pads.sql | UTF-8 | 274 | 3.03125 | 3 | [
"MIT"
] | permissive | select
concat(o.Name, N'(', left(o.Occupation, 1), N')')
from OCCUPATIONS o
order by o.Name
select
concat(N'There are a total of ', count(o.Occupation), N' ', lower(o.Occupation), 's.')
from OCCUPATIONS o
group by o.Occupation
order by count(o.Occupation), o.Occupation | true |
2823e78847cdef434925320860d14a1f96ccded7 | SQL | dario-podhorski/ticketing | /database/ticketing_users.sql | UTF-8 | 6,578 | 3.140625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: ticketing
-- ------------------------------------------------------
-- Server version 5.6.30
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS... | true |
0bf49a031d2b56682e899669ffc2d0364883c5ba | SQL | Thamish/Sparta_Project | /SQL/Populate_Tables.sql | UTF-8 | 1,661 | 2.859375 | 3 | [] | no_license | --//Insert data into tables
INSERT INTO Positions VALUES
('GoalKeeper'),
('Defender'),
('Midfielder'),
('Forward');
INSERT INTO Teams VALUES
('Arsenal'),
('Chelsea'),
('Liverpool'),
('Manchester City'),
('Manchester United');
INSERT INTO Players VALUES
('Bernd','Leno',1,'Germany','1992/03/04'),
('Héctor','Bellerin',... | true |
f40018375780d11de8b123d455d7d6063a404aa3 | SQL | NikkiE-Dev/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/14-my_genres.sql | UTF-8 | 372 | 4.09375 | 4 | [] | no_license | -- Lists all genres of the show Dexter.
-- The tv_shows table contains only one record where title = Dexter (but the id can be different)
SELECT tv_genres.name AS name
FROM tv_show_genres INNER JOIN tv_genres
ON tv_show_genres.genre_id = tv_genres.id
INNER JOIN tv_shows ON tv_shows.id = tv_show_genres.show... | true |
4d24158f4d8d4976db55f6060ba05bb2f2663ca1 | SQL | qyh/studio | /sqlscript/mysql/ssh.sql | UTF-8 | 5,080 | 3.03125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.1.40, for Win32 (ia32)
--
-- Host: localhost Database: ssh
-- ------------------------------------------------------
-- Server version 5.1.40-community
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;... | true |
b770692379b39acc266f471b080d14edeb022987 | SQL | japarado/zero2prod | /migrations/20210504171936_create_subscription_tokens_table.sql | UTF-8 | 188 | 2.6875 | 3 | [
"MIT"
] | permissive | CREATE TABLE subscription_tokens
(
subscription_token TEXT NOT NULL,
subscriber_id uuid NOT NULL
REFERENCES subscriptions (id),
PRIMARY KEY (subscription_token)
)
| true |
d47b2ec17008ac9bf9355e350272b0b3d637f739 | SQL | KarimHamod/softwareengineering | /learning/loginform.sql | UTF-8 | 2,031 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: May 02, 2021 at 03:10 PM
-- Server version: 8.0.22
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@... | true |
7f98a5ecd98a9ca8465d247bfc7cd77386edaa41 | SQL | DaniellKondoff/Databases----MS-SQL-Server | /08.ExamPreparation 16-OCT-2016/Section 3 Querying - 06. Customers From Home.sql | UTF-8 | 341 | 3.671875 | 4 | [] | no_license | Select c.CustomerID,
c.FirstName+' ' + c.LastName as FullName,
t.TownName as HomeTown
from Customers as c
JOin Towns as t
ON c.HomeTownID=t.TownID
JOIn Tickets as ti
ON ti.CustomerID=c.CustomerID
JOIN Flights as f
ON ti.FlightID=f.FlightID
JOIN Airports as a
ON f.OriginAirportID=a.AirportID and a.TownID=t.TownID
Where ... | true |
c95d37b792379d6705a4f46a7eafd7779d06639b | SQL | tihomirdimov/Databases | /01.DB Basics - MSSQL/01.Homeworks/05.TableRelations/0502.sql | UTF-8 | 867 | 3.421875 | 3 | [] | no_license | CREATE TABLE Manufacturers
(
ManufacturerID INT NOT NULL
CONSTRAINT PK_Manufacturers_ManufacturerID PRIMARY KEY,
Name NVARCHAR(150) NOT NULL,
EstablishedOn DATE NOT NULL);
CREATE TABLE Models
(
ModelID INT NOT NULL
CONSTRAINT PK_Models_ModelID PRIMARY... | true |
d3ca1cf9ccdde032a6fe85edbd031a3fa22f513f | SQL | pranaliyadav/Basic-Banking-System | /basic bank system Database.sql | UTF-8 | 1,597 | 3.421875 | 3 | [] | no_license |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
CREATE TABLE `transaction` (
`sno` int(3) NOT NULL,
`sender` text NOT NULL,
`receiver` text NOT NULL,
`balance` int(8) NOT NULL,
`datetime` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=ut... | true |
912d074578fd7a5ea72bec5ebc474cc6062c4210 | SQL | Djilali-Ma/AutoRentalWindowsApp_PracticeProject | /Docs/MSSQL/EZRentalDDLScript.sql | UTF-8 | 15,392 | 3.984375 | 4 | [
"MIT"
] | permissive | --CREATE THE DATABASE
CREATE DATABASE EZRentalDB;
--SET DEFAULT DATABASE TO USE
use EZRentalDB;
--CREATE CREDITCARD TABLE
CREATE TABLE CreditCard
(
CreditCardNumber CHAR(16) PRIMARY KEY,
OwnerName VARCHAR(80) NOT NULL,
MerchantName VARCHAR(50) NOT NULL,
ExpDate DATE NOT NULL,
AddressLine1 VARCHAR(50)... | true |
d57ee01e4ddb325bd6edf9aa4353692cab7c3f3b | SQL | marcelo-caux/Vistrails-Mysql | /vw_adc.sql | UTF-8 | 1,679 | 2.6875 | 3 | [] | no_license | CREATE
ALGORITHM = UNDEFINED
DEFINER = `root`@`localhost`
SQL SECURITY DEFINER
VIEW `vw_adc` AS
SELECT
`change_tbl`.`id` AS `id`,
`change_tbl`.`what` AS `what`,
`change_tbl`.`old_obj_id` AS `old_obj_id`,
`change_tbl`.`new_obj_id` AS `new_obj_Id`,
`change_tbl`.... | true |
be8cbb1ffb4d250356c13426a07ab2445f38a8ed | SQL | ShacharMarkovich/150225-5781-Databases | /3 queries/5.sql | UTF-8 | 324 | 3.5625 | 4 | [] | no_license | -- get takeoffdatetime from given src&dst firports name:
select flightid, model, takeoffdatetime
from (((flight natural JOIN Plane p)
INNER JOIN airport srcP ON srcP.Airportid = flight.srcairportid)
INNER JOIN airport dstP ON dstP.Airportid = flight.dstairportid)
where srcP.fullname = 'Duffy' and dstP.fullname = 'Ban... | true |
bd8446a6faf71c416570c0d2f0071d28a8d4c2d3 | SQL | snackjunio/snackjunio.github.io | /Python-Django/sever-start-command.sql | UTF-8 | 3,173 | 3.359375 | 3 | [] | no_license | --サーバー起動--
python manage.py runserver
--DB作成--
python manage.py runserver
--Private Key--
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAiNq+Wv8yEvRbkR//YVUI8sUv/SA7w/d7BF89pujm1QA9Z0FDa01g1/nmYc5lExj7txMAI9JZ6mrPYhubCvdzEGyC3cbab8kKAsHWtYpccoju+zTbfzhPRS5v+t8rDzgGqbED8yo95KUU2nWTi1ubAglB7+lcrNZah/dB1oTqA+d4KPLsRKb0SG1gSDZ8Duq... | true |
40c97fa653d96b23359b672baa07a7fc86db0629 | SQL | unrealmach/test | /docs/data.sql | UTF-8 | 1,297 | 2.671875 | 3 | [] | no_license | insert into tbl_categorias(codigo,descripcion) values ("CAMISETAS","Camisetas");
insert into tbl_categorias(codigo,descripcion) values ("VASOS","Vasos");
insert into tbl_categorias(codigo,descripcion) values ("COMICS","Comics");
insert into tbl_categorias(codigo,descripcion) values ("JUGUETES","Juguetes");
inser... | true |
75bddd89e71f63c8fa4f659fa2c0bd6ffe8a982e | SQL | RussellVaccaro5/sqlzoo | /SQLZoo-Section9.sql | UTF-8 | 3,575 | 4.40625 | 4 | [] | no_license | /*
SQLZoo Section 9 Self-Joins
*/
--#1
/*
How many stops are in the database.
*/
SELECT COUNT(*)
FROM stops;
--#2
/*
Find the id value for the stop 'Craiglockhart'
*/
SELECT id
FROM stops
WHERE name = 'Craiglockhart';
--#3
/*
Give the id and the name for the stops on the '4' 'LRT' service.
*/
SELECT id,name
FROM ... | true |
d26dbc1165da01b735b8dca1c62e909c1eb4d16d | SQL | CoderJu/WeChat | /src/main/resources/sql/book.sql | UTF-8 | 488 | 2.875 | 3 | [] | no_license | /*图书表*/
create table `book`(
`bid` INT NOT NULL AUTO_INCREMENT COMMENT '图书唯一主键',
`bname` VARCHAR(1000) NOT NULL COMMENT '图书名称',
`imageurl` VARCHAR(500) COMMENT '图片链接',
`bdesc` VARCHAR(4000) COMMENT '图书描述',
`author` VARCHAR(500) NOT NULL COMMENT '作者',
`cid` INT NOT NULL COMMENT '目录ID',
... | true |
67414f5d91010ac9eaa63ffb43dbabd0a65e8052 | SQL | alistairfink/Link-Shortener | /Migrations/Schema.sql | UTF-8 | 322 | 3 | 3 | [] | no_license | -- Table: public.link
-- DROP TABLE public.link;
CREATE TABLE public.link
(
id text COLLATE pg_catalog."default" NOT NULL,
link text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT link_pkey PRIMARY KEY (id)
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.link
OWNER to postgre... | true |
6fef9fb4f94eac6821c581325d46157b9d5c01ad | SQL | jpaguirre15/bts-airline-delays | /SQL Files/flight-analysis.sql | UTF-8 | 1,898 | 4 | 4 | [] | no_license | /* Query answers:
- Most Flights Origin Arriving in Las Vegas - Top 10
- Least Flights Origin Arriving in Las Vegas - Top 10
*/
SELECT origin_city_name, origin, COUNT(*) AS total
FROM flights2019
GROUP BY origin_city_name, origin
-- ORDER BY total DESC
ORDER BY total ASC
LIMIT 20;
/* Query answers:
- Most Delayed ... | true |
9a68d1cd894a1ba6e21a26ec005361f048d58797 | SQL | TeamLCStLou/finalproject | /SQLscripts/user_prog_status.sql | UTF-8 | 1,787 | 2.828125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.8.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 08, 2014 at 11:04 PM
-- Server version: 5.5.32-MariaDB
-- PHP Version: 5.5.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIE... | true |
5835068ca859b425fb4dcf0fcc3b05372f36d110 | SQL | hqottsz/MXI | /assetmanagement-database/src/upgrade/plsql/lib/liquibase/8/1/2/0/sql/api/view/acor_fnc_trx_wp_ac_info_v1.sql | UTF-8 | 460 | 3.03125 | 3 | [] | no_license | --liquibase formatted sql
--changeSet acor_fnc_trx_wp_ac_info_v1:1 stripComments:false
CREATE OR REPLACE FORCE VIEW ACOR_FNC_TRX_WP_AC_INFO_V1 AS
SELECT
-- Use '*' here because we want to get all columns from acor_fnc_trx_wp_info_v1 view.
-- If the column is changed in acor_fnc_trx_wp_info_v1, we don't need to ... | true |
39c7f7f33978d602e6ff1eba56655cafc52b9242 | SQL | B4KI/LBD | /practica5.sql | ISO-8859-10 | 10,593 | 2.953125 | 3 | [] | no_license | CREATE TABLE candidato
(
Id_candidato int identity(1,1) primary key,
nombre varchar(60) NOT NULL,
apellidoP varchar(60) NOT NULL,
apellidoM varchar(60) NOT NULL,
Curp varchar(13) NOT NULL,
correo_electronico varchar(60),
fecha_nac date,
num_telefono int not null
)
create table telefono
(
id_telefono int not null pri... | true |
127990b4a37ebfdbb8f0c3c6a5b0e8dc08f65538 | SQL | HugoRobineLanglois/Projet_API01 | /requetes_2.sql | UTF-8 | 3,092 | 3.390625 | 3 | [] | no_license |
-- drop table User;
-- CREATE TABLE User(
-- id_user int(10) unsigned NOT NULL auto_increment,
-- nom varchar(20),
-- adresse varchar(50),
-- telephone varchar(12) ,
-- dateCreation varchar(20),
-- statutCompte varchar(20),
-- mdp varchar(10),
-- PRIMARY KEY(id_user)
-- );
-- insert into ... | true |
66791b5e2b60642eff483c81abaf392462bdbda6 | SQL | ToeHead9913/bamazonDB | /server.sql | UTF-8 | 1,507 | 3.25 | 3 | [] | no_license | DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE bamazon;
USE bamazon;
CREATE TABLE products(
itemId INTEGER AUTO_INCREMENT NOT NULL,
productName VARCHAR(45) NULL,
departmentName VARCHAR(45) NULL,
price DECIMAL(10,2) NULL,
stockQuantity INTEGER(10) NULL,
PRIMARY KEY (id)
);
INSERT INTO products (product... | true |
95f247efec8281f509e5b35094ef3169766e795d | SQL | sylvhama/summer2015 | /finnair_summer2015.sql | UTF-8 | 2,152 | 3.515625 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Ven 03 Juillet 2015 à 13:55
-- Version du serveur: 5.5.37-0ubuntu0.14.04.1
-- Version de PHP: 5.5.9-1ubuntu4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_... | true |
f2c95bfcb442ddf219433728dfcd618df8799aac | SQL | jjosenaldo/contest-scoreboard-database | /scripts/index-btree.sql | UTF-8 | 119 | 2.546875 | 3 | [] | no_license | DROP INDEX IF EXISTS idx_submission_btree;
CREATE INDEX idx_submission_btree ON Submission USING btree (idsubmission);
| true |
e6c783a594945a61f03a62b951e2c9f0c69cc8fd | SQL | ashrafia/thesocialweb2015_G05_FinalAssignment | /facebook.sql | UTF-8 | 15,443 | 2.828125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 28, 2015 at 07:20 PM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
2e71b0a85c086251d8fc039e96d897c5c566f4d5 | SQL | sunnycd/propensity-modelling-demo | /processing-pipeline/a070_create_product_price.sql | UTF-8 | 213 | 2.671875 | 3 | [] | no_license | -- extracting individual unit price by dividing the total purchase amount by the quantity
-- overwrite "cleaned" table
SELECT
*,
purchaseamount/purchasequantity AS productprice
FROM
`PROJECT.DATASET.cleaned` | true |
aab7d841f069517dcecbc86ae2a2d6f255d41b11 | SQL | TKRCET/OnlineClassesConsentAug2020 | /ConsentOnlineClassesAug2020.sql | UTF-8 | 70,106 | 2.875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jul 29, 2020 at 08:24 PM
-- Server version: 5.6.45
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
5634d484044be2c6ac8f761ed73b3b49e0d12b99 | SQL | berodm/Banco_de_dados_MySQL | /28.09 -joins exemplos/Exercicio_plataforma/db_acougue_innerjoin.sql | UTF-8 | 1,325 | 4 | 4 | [] | no_license | create database if not exists db_cidade_das_carnes;
use db_cidade_das_carnes;
CREATE TABLE tb_categoria (
ID_categoria int PRIMARY KEY AUTO_INCREMENT,
tipo_carne enum ('Bovina', 'Suina', 'Aves'),
marca enum ('Friboi', 'Seara', 'Swift', 'Angus')
);
CREATE TABLE tb_produto (
nome varchar(45),
peso_peca double,
preco do... | true |
8adee995683af38f3a34b001c01f4ba9991e7c8e | SQL | adiwijaya/practice_sql | /aggregate_sql.sql | UTF-8 | 197 | 2.59375 | 3 | [] | no_license | DROP TABLE IF exists public.procedure_details_aggregate;
create table public.procedure_details_aggregate
as
select proceduretype,sum(price) sum_price from
procedure_details group by proceduretype; | true |
f2b995bb407aa9166648988ce9230b4487800cb4 | SQL | Vedant242/Online-Voting-System | /final.sql | UTF-8 | 17,625 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 25, 2020 at 07:35 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
36c3d7dfa1e0a64579a8dd189663a45b4bdf991e | SQL | ricehiroko/BDAD | /Trabalho/int3.sql | UTF-8 | 214 | 3.3125 | 3 | [] | no_license | .mode columns
.headers on
.nullvalue NULL
SELECT Nome, Codigo, Count(*) as numeroVendas FROM Produto, Transacao
WHERE (Codigo = CodigoProdutoTransacao)
GROUP BY Codigo
ORDER BY numeroVendas DESC
LIMIT 3;
| true |
d1bd78f4f52681bcf371a3152b93f53f8d8bdf40 | SQL | mundodron/arduino-bot-aurelio | /Querys/~ebEE83.sql | UTF-8 | 860 | 2.765625 | 3 | [] | no_license | Select to_date(to_char(data_servico,'yyyymmdd')||hora_inicio,'yyyymmddhh24:mi:ss') inicio_chamada,
to_date(to_char(data_servico,'yyyymmdd')||hora_inicio,'yyyymmddhh24:mi:ss') + ((duracao_real*60)/86400) fim_chamada,
substr(duracao_real,1,2)||':'||substr(duracao_real,3,2)||':'||substr(duraca... | true |
b0e3e51ce16a7129ad8a2e0d75e866c84c405462 | SQL | maxjcs/mote | /src/main/doc/oldTableAlert.sql | GB18030 | 833 | 2.765625 | 3 | [] | no_license | /*** teacher ***/
ALTER TABLE teacher ADD avatar_url varchar(200) COMMENT 'ͷurl';
ALTER TABLE teacher ADD gender int COMMENT 'Ա 1 2Ů';
ALTER TABLE teacher ADD star int COMMENT 'Ǽ';
ALTER TABLE teacher ADD teacher_identify int COMMENT 'ʦ 1:ʦ 2:ѧ';
ALTER TABLE teacher ADD point int COMMENT ... | true |
6cc08ece3232f1993a6d3b2407ac45951a9f5015 | SQL | kdw912001/kh | /DB/1월2일/DAY3.sql | UTF-8 | 13,033 | 4.34375 | 4 | [] | no_license | --DAY03
--SELECT 연습문제
--
--1. 부서코드가 90이면서, 직급코드가 J2인 직원들의 사번, 이름, 부서코드, 직급코드, 급여 조회함
-- 별칭 적용함
SELECT EMP_ID 사번, EMP_NAME 이름, DEPT_ID 부서코드, JOB_ID 직급코드, SALARY 급여
FROM EMPLOYEE
WHERE DEPT_ID = '90' AND JOB_ID = 'J2';
--2. 입사일이 '1982-01-01' 이후이거나, 직급코드가 J3 인 직원들의 사번, 이름, 관리자 사번, 보너스포인트 조회함
SELECT EMP_ID 사번, EMP_NAME... | true |
b44c29e482e8b0dbaaa4237731e1f95a638214ca | SQL | LanBao116/Takin-web | /takin-web-app/src/main/resources/db/migration/V430__4.3.0.sql | UTF-8 | 15,149 | 4.15625 | 4 | [] | no_license | -- 用户表(t_tro_user)
-- 字段添加
DROP PROCEDURE IF EXISTS change_field;
DELIMITER $$
CREATE PROCEDURE change_field()
BEGIN
DECLARE count1 INT;
SET count1 = (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_schema = DATABASE() AND TABLE_NAME = 't_tro_user' AND COLUMN_NAME = 'user_type');
IF count1 = 0 THEN
A... | true |
7428996ce2215d578f24e8bf4b44a912f1b2b770 | SQL | evgmolt/MySQL | /lesson10.sql | UTF-8 | 872 | 3.171875 | 3 | [] | no_license | use shop2;
ALTER TABLE `shop2`.`product`
ADD INDEX `fk_brand_product_idx` (`brand_id` ASC) VISIBLE;
;
ALTER TABLE `shop2`.`product`
ADD CONSTRAINT `fk_brand_product`
FOREIGN KEY (`brand_id`)
REFERENCES `shop2`.`brand` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
-- home work
ALTER TABLE `shop2`.`product` ... | true |
cb74abd11d42948222db1dc67ddb140a76c162f4 | SQL | Catfeeds/WholesaleTool | /PHP/db_sql.sql | UTF-8 | 505,631 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `os_admin1`;
CREATE TABLE `os_admin1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`username` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名',
`nickname` varchar(50) NOT NULL DEFAULT '' COMMENT '昵称',
`password` varchar(32) NOT NULL DEFAULT '' CO... | true |
b6bba991f9fd77fe3b87f556767fea2cee5f2ebe | SQL | silberov/inu-backend | /prisma/migrations/20210116065138_make_email_unique/migration.sql | UTF-8 | 262 | 2.640625 | 3 | [] | no_license | /*
Warnings:
- The migration will add a unique constraint covering the columns `[email]` on the table `Users`. If there are existing duplicate values, the migration will fail.
*/
-- CreateIndex
CREATE UNIQUE INDEX `Users.email_unique` ON `Users`(`email`);
| true |
3fd3c0f741d0d1dcb81f2d8848d7488ee99a5088 | SQL | nguye304/FinesseNails | /FinesseNailsApp/PriceTableCreationAndFill.sql | UTF-8 | 9,162 | 2.78125 | 3 | [] | no_license | use kevindb;
CREATE TABLE Prices(ItemID INTEGER(5) AUTO_INCREMENT NOT NULL, Type VARCHAR(100), Name VARCHAR(100), Price DECIMAL(10,2), Price2 DECIMAL(10,2), Description VARCHAR(255), CONSTRAINT PricesPK PRIMARY KEY(ItemID));
/*Manicure*/
INSERT INTO Prices(Type,Name,Price,Description)
VALUES("Manicure","Classic Mani... | true |
f4c890991e0a5f9ee9da16e5dd1aa6bb40dffefe | SQL | deekshaha/NITC-Project-Board | /nitcProjectBoard/project.sql | UTF-8 | 4,004 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 20, 2020 at 01:23 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 |
2671463fb888968dcd66edea4bb2df82bfa8c19f | SQL | ossc-db/pg_hint_plan | /sql/ut-J.sql | UTF-8 | 37,659 | 3.453125 | 3 | [
"PostgreSQL"
] | permissive | LOAD 'pg_hint_plan';
SET pg_hint_plan.enable_hint TO on;
SET pg_hint_plan.debug_print TO on;
SET client_min_messages TO LOG;
SET search_path TO public;
SET max_parallel_workers_per_gather TO 0;
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
----
---- No. J-1-1 specified pattern of the object na... | true |
0d2993fe3953cf83a89effa7e575e715bc3bfba1 | SQL | jakirdc1/sql | /jaki/evedence.sql | UTF-8 | 706 | 3.46875 | 3 | [] | no_license | part-1
create table student1(
user_id number(5) not null,
username varchar2(20) not null,
primary key (user_id)
);
PART-2
-- create procedure
create or replace procedure getStudentByUserId(
p_userid in student1.user_id%type,
p_username out student1.username%type
)
is
begin
select username
into p_username
from st... | true |
29053430f9deeb3c1947d86e7d820166e771bc03 | SQL | 7052roy/QuizGame | /quizgame.sql | UTF-8 | 4,566 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Gegenereerd op: 04 jun 2015 om 15:25
-- Serverversie: 5.6.24
-- PHP-versie: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101... | true |
aa88ec7d5feffb95b7d739963faa2b74fde50fc6 | SQL | Extibax/Back-End | /master-php/aprendiendo-sql/Funciones/matematicas.sql | UTF-8 | 881 | 3.515625 | 4 | [] | no_license | # Operadores Aritmeticos #
SELECT email, (4+7) FROM usuarios;
# Mostrar el valor absoluto de un numero #
SELECT ABS(7) AS 'Operacion' FROM usuarios;
# Redondeo al alza de un numero decimal #
SELECT CEIL(7.34) AS 'Operacion' FROM usuarios;
# Redondeo a la baja de un numero decimal #
SELECT FLOOR(7.34) AS 'Operacion' ... | true |
cb6eff86e751c634a675f3f3902e8c2588b28db6 | SQL | tt2031/Php | /NestedCommentsProject/Comments.sql | UTF-8 | 1,618 | 2.875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 13, 2016 at 01:16 AM
-- Server version: 5.7.13-0ubuntu0.16.04.2
-- PHP Version: 7.0.10-2+deb.sury.org~xenial+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET... | true |
92dd1bc4772865dc71a86633d1acb199ba4c57b9 | SQL | csabatini/leetcode-sql | /577_employee_bonus.sql | UTF-8 | 532 | 4.25 | 4 | [] | no_license | /*
* #577: Employee Bonus
* Write a query that outputs all employees with a bonus less than $1000
*/
WITH Employee AS
(
SELECT 3 AS empId, 'Brad' AS name, null AS supervisor, 4000 AS salary
UNION
SELECT 1, 'John', 3, 1000
UNION
SELECT 2, 'Dan', 3, 2000
UNION
SELECT 4, 'Thomas', 3, 4000
... | true |
39a0985879cc57dd8e2293e98b9e43e4840a836d | SQL | nizhamrifqi/Praktikum-Web--Dinamis | /Modul 5/id7882494_informatika.sql | UTF-8 | 3,349 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 10, 2018 at 05:04 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
28df0115a9f3c75a8488b9fc534959dacbcbb096 | SQL | Switcher05/wanderlust-open-travel-api | /src/main/resources/db/migration/V1__DML_wanderlust.sql | UTF-8 | 1,480 | 2.84375 | 3 | [] | no_license | INSERT INTO destinations
VALUES ((SELECT nextval('destinations_id_seq')), 'Quintessential Japan', 'Japan', 'Life-changing-experience');
INSERT INTO destination_facts VALUES
((SELECT currval('destinations_id_seq')),
'There are over 5.5 million vending machines in Japan selling everything from umbrellas and ciga... | true |
7165df6e6124fb9292e9c48a9e1ab4d9f65b393e | SQL | maxisme/transfermeit-backend | /sql/000001_init.up.sql | UTF-8 | 2,650 | 3.75 | 4 | [
"MIT"
] | permissive | create table if not exists user
(
id int auto_increment
primary key,
code varchar(255) collate utf8_bin null,
code_end_dttm datetime not null,
wanted_mins int default 10 null,
is_connected tinyint(1) default 0 not ... | true |
7138e3f35a0af417f305b3ebbd04628ee21cc15e | SQL | prirahman001/lkps | /database/lkps_lpm.sql | UTF-8 | 42,355 | 2.984375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 28, 2021 at 11:42 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
67aff4027fb0f3b73e3e89a3ad4b2afa54051e1e | SQL | alldatacenter/alldata | /olap/doris/regression-test/suites/tpch_unique_sql_zstd_p0/ddl/orders.sql | UTF-8 | 525 | 2.875 | 3 | [
"OpenSSL",
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-facebook-patent-rights-2",
"PSF-2.0",
"dtoa",
"MIT",
"GPL-2.0-only",
"LicenseRef-scancode-public-domain"
] | permissive | CREATE TABLE IF NOT EXISTS orders (
O_ORDERKEY INTEGER NOT NULL,
O_CUSTKEY INTEGER NOT NULL,
O_ORDERSTATUS CHAR(1) NOT NULL,
O_TOTALPRICE DECIMAL(15,2) NOT NULL,
O_ORDERDATE DATE NOT NULL,
O_ORDERPRIORITY CHAR(15) NOT NULL,
O_CLERK CHAR(15) NOT NULL,
O_SHIPPRIORITY... | true |
9c1f7ed1666274c1a2ffda631893e9d0ae352789 | SQL | Yasko1/JavaWeb | /FinalProject/Auction/sql/insert/example_painter.sql | UTF-8 | 2,750 | 2.921875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: example
-- ------------------------------------------------------
-- Server version 5.7.26-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESU... | true |
0eef5d705def949d51ee07313c3371afd58af132 | SQL | Brickhoff/Foodie_Final | /sql/foodie.sql | UTF-8 | 1,082 | 3.90625 | 4 | [] | no_license | DROP TABLE IF EXISTS comments;
DROP TABLE IF EXISTS restaurants;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE restaurants (
id INT NOT... | true |
3de8f072d54388d25b2f6bc25643d63d99df9bf3 | SQL | evfurio/scripts | /Doc/system_queries/All_Spark_NA.sql | UTF-8 | 503 | 3.71875 | 4 | [] | no_license |
/*
UPDATE AllSpark_NA.dbo.Token
SET IsUsed = 0
WHERE AllSparkID IN (31970, 22675, 33120)
*/
--522111/560001/520355
SELECT COUNT(*), AllSparkID, IsUsed
FROM AllSpark_NA.dbo.Token t (NOLOCK)
WHERE AllSparkID IN (31970, 22675, 33120)
GROUP BY AllSparkID, IsUsed
SELECT COUNT(*), t.AllSparkID, p.IsUsed
FROM AllSpark_NA... | true |
80210dc4f8ecb010fa64f57dcfad3e956060e734 | SQL | daanmeoj/CompleteSQLMastery | /56.theHavingClause.sql | UTF-8 | 173 | 3.234375 | 3 | [] | no_license | SELECT
client_id,
SUM(invoice_total) AS total_sales,
COUNT(*) AS number_of_invoices
FROM invoices
GROUP BY client_id
HAVING total_sales>500 AND number_of_invoices>5 | true |
0f7f7897fa53614c7bb40e29d904f5f9eccf5ef9 | SQL | JCarlosCL/SGAIJE | /SchemaSGAIJE/SchemaSGAIJE/CTZ/Tables/DetalleCotizacion.sql | UTF-8 | 1,230 | 2.8125 | 3 | [] | no_license | CREATE TABLE [CTZ].[DetalleCotizacion] (
[unqCtzDetalleCotizacionKey] UNIQUEIDENTIFIER CONSTRAINT [DF__DetalleCo__unqCt__2F10007B] DEFAULT (newsequentialid()) NOT NULL,
[unqCtzMastCotizacionLink] UNIQUEIDENTIFIER CONSTRAINT [DF__DetalleCo__unqCt__300424B4] DEFAULT (newsequentialid()) NOT NULL,
[unqGenArt... | true |
1c114080238cdb3cd6dbf0d201fdad30b0257d10 | SQL | CyberSys/qnx650 | /target/qnx6/etc/mm/sql/mmsync_iap2.sql | UTF-8 | 6,437 | 3.125 | 3 | [] | no_license | BEGIN EXCLUSIVE;
-- *******************************************************************************
-- *******************************************************************************
-- @table iap2_last_revision
--
-- The ipod_metadata contains metadata specific to ipod tracks.
--
-- @field rev The last s... | true |
8ca7ace4c4554912834dbe4300d3988abcec9ac1 | SQL | wade0564/repo | /notes/sql/1-6.sql | UTF-8 | 359 | 2.984375 | 3 | [] | no_license | select file_handler from asup.geninfo a where substring(file_handler, 0, 11) = '2014/01/06' and exists (select b.asupid from asup.kernel_ipv6 b where b.asupid =a.asupid)
select count(*) from asup.kernel_ipv6
select count(*) from asup.kernel_ipv6 where asupid in (select asupid from asup.geninfo where substring... | true |
629f7a453468931640db1920f17077a5a85f78ee | SQL | VoloviZzz/prokatmgn | /patches/used/2018_05_31 table-flowerassign.sql | UTF-8 | 1,984 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Хост: localhost
-- Время создания: Май 30 2018 г., 01:47
-- Версия сервера: 8.0.11
-- Версия PHP: 5.6.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SE... | true |
712b289157987c3c5e03c24f9c83a1cab0b556f0 | SQL | towardtruth/nbk | /db/nbk_db_schema.sql | UTF-8 | 15,788 | 2.9375 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 12.3
-- Dumped by pg_dump version 12.3
-- Started on 2021-05-18 09:59:08
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalo... | true |
cc49db5cb39166fd0353e6d14ee5e857d6832610 | SQL | ousophea/brand-tea-web-site | /Implement/Database/Olds/photo_product.sql | UTF-8 | 7,234 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 29, 2013 at 06:11 AM
-- Server version: 5.1.53
-- PHP Version: 5.3.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... | true |
827ae5b734ea366b78e9222f3610ff3cb21b9e2b | SQL | oggata/mixi_app_ramen | /cake/app/config/plsql/money.sql | UTF-8 | 1,784 | 3.28125 | 3 | [] | no_license | delimiter //
drop procedure money//
create procedure money(in local_member_code int,in local_event_code int)
begin
declare local_price int;
declare local_message_txt varchar(250);
declare local_added_price int;
declare local_target_point int;
declare local_txt varchar(250);
/*イベントを取得す... | true |
0390622ffda1e9f50c41ec33f228d017687cd54f | SQL | thanhhau98/C0421G1_PhanThanhHau_module3 | /case_study_database/case_study_task_7.sql | UTF-8 | 770 | 3.453125 | 3 | [] | no_license | -- 7. Hiển thị thông tin IDDichVu, TenDichVu, DienTich, SoNguoiToiDa, ChiPhiThue, TenLoaiDichVu của tất cả các loại dịch vụ đã từng được Khách hàng đặt phòng trong năm 2018 nhưng chưa từng được Khách hàng đặt phòng trong năm 2019.
select *
from dich_vu
left join loai_dich_vu on dich_vu.id_loai_dich_vu=loai_dich_vu.... | true |
2ffb2f40cf14addc12b51b82b944aada020f3cab | SQL | ErickJovanC/gravedadzero-registros | /gravedad.sql | UTF-8 | 5,645 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 03-04-2019 a las 21:19:17
-- Versión del servidor: 10.3.13-MariaDB
-- Versión de PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:... | true |
b865887a668120d173a01cb8c887ce5ce2f09888 | SQL | EdwardsTheo/Athena | /Main/Public/bdd/Athena.sql | UTF-8 | 16,700 | 3.390625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:8889
-- Généré le : jeu. 14 mai 2020 à 13:54
-- Version du serveur : 5.7.26
-- Version de PHP : 7.3.8
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... | true |
5c0526ecf926d7f33c88a316b780d9b0a1608627 | SQL | kudoji/taco-spring | /src/main/resources/schema.sql | UTF-8 | 1,136 | 3.90625 | 4 | [] | no_license | create table if not exists ingredients(
id varchar(4) primary key,
name varchar(25) not null,
type varchar(10) not null
);
create table if not exists tacos(
id identity,
name varchar(50) not null,
createdAt timestamp not null
);
create table if not exists tacos_ingredients(
tacos_id bigint... | true |
c5027a64ebb25683ec81f2c5f8128542a8184f9c | SQL | thevpc/dbclient | /modules/dbclient-plugins/dbsupport/dbsupport-postgresql/src/main/resources/org/vpc/dbclient/plugin/dbsupport/postgresql/sql/getSQLCreateView.sql | UTF-8 | 239 | 2.921875 | 3 | [] | no_license | Select
'CREATE VIEW ${view} AS \n' || v.definition as VIEW_DEFINITION,
'' as CATALOG_NAME,
v.schemaname as SCHEMA_NAME,
v.viewname as VIEW_NAME
From pg_catalog.pg_views v
where
v.schemaname Like ${schema?}
and v.viewname Like ${view?}
| true |
8c0af749bb3af75ce34ae57d4004c88f3e8a7bea | SQL | dvarrazzo/pgparts | /test/sql/onconflict.sql | UTF-8 | 1,853 | 3.125 | 3 | [] | no_license | \pset format unaligned
\pset footer off
\set VERBOSITY terse
create schema pconf;
set datestyle = 'ISO';
create extension pgparts with schema pconf;
-- No drop on conflict
create table conftbl0 (
id serial primary key,
day date not null,
data text unique);
select pconf.setup('conftbl0', 'day', 'monthly... | true |
3315778f19caf66b89cdac820ad496932956ec8b | SQL | zexliu/freight_czd | /spring-freight/src/main/resources/db/migration/V1__init.sql | UTF-8 | 19,877 | 2.734375 | 3 | [] | no_license | CREATE TABLE `am_audit_history` (
`id` bigint(11) NOT NULL,
`target_id` bigint(11) NULL,
`target_type` tinyint(4) NULL,
`snapshot` text NULL,
`status` tinyint(4) NULL,
`message` varchar(200) NULL,
`operator_id` bigint(11) NULL,
`operator_ip` varchar(100) NULL,
`create_at` datetime NULL DEFAULT CURREN... | true |
013c2eeb70ebb1ff1dc49947adfb853f2517c3b1 | SQL | nlfrey25/SRF | /PECAS/S28_aa/skim_conversion_for_sem_sov.sql | UTF-8 | 2,212 | 3.984375 | 4 | [] | no_license | drop table if exists {taz_skimtbl};
create table {taz_skimtbl} as
select a.origin as origin_taz, a.destination as destination_taz,
a.am_sov_tr_m_dist, a.am_sov_tr_m_time, a.am_sov_tr_m_tollcost,
b.luz as origin_luz, c.luz as destination_luz
from {tdm_skimtbl} a
join {taztbl} b on a.origin = b.tdm_taz
join {taztbl} c ... | true |
b748357e675204da38ae440b5bf178d75b97922b | SQL | tianxinphp/CI-XIN | /init/ci-xin.sql | UTF-8 | 9,125 | 2.96875 | 3 | [] | no_license | #图片类型表
DROP TABLE IF EXISTS `sys_picture_type`;
CREATE TABLE `sys_picture_type` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR (20) NOT NULL DEFAULT '',
`status` tinyint(1) NOT NULL DEFAULT 0,
`create_time` INT(11) NOT NULL DEFAULT 0,
`update_time` INT(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
)EN... | true |
4434683c55cd6eea928b55f97630e4e42dbff983 | SQL | MonDan93/HackatonZaawansowany | /baza.sql | UTF-8 | 752 | 2.921875 | 3 | [] | no_license |
DROP TABLE IF EXISTS "users";
CREATE TABLE "users"
(
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
"username" TEXT NOT NULL,
"password" TEXT NOT NULL,
"company" TEXT
);
DROP TABLE IF EXISTS "rides";
CREATE TABLE "rides"
(
"id" INTEGER NOT NULL PRIMARY KE... | true |
6ae126b858338e2293dae8b5f5ff6f08141320c2 | SQL | shubhammahajan308/DBT | /Assignment no 11.sql | UTF-8 | 847 | 4.21875 | 4 | [] | no_license | /*Sameer Dehadrai Page: 1
Assignment – 11
Subqueries.*/
/*1) Write a query that uses a subquery to obtain all orders
for the customer named Cisneros.
Assume you do not know his customer number (cnum).*/
select cnum from orders
where cnum=
(select cnum from customers
where cname='Cisneros');
/*2) Write a query that... | true |
f2a4e1c45c679123607b9f0f23e1010b3dc4678a | SQL | TonyStarch/NIUGradSchool | /CSCI 588/588/q6.sql | UTF-8 | 123 | 3.25 | 3 | [] | no_license | select F.Dept, F.name as "FACULTY", S.Name as "STUDENT"
from Faculty F, Student S
where
F.SpouseID = S.ID;
exit
| true |
2778ddfae092870307dd17b3056b53b267dee818 | SQL | librian1601/tugasproweb | /pemrogweb.sql | UTF-8 | 2,170 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jul 15, 2018 at 03:08 PM
-- Server version: 5.7.22-0ubuntu18.04.1
-- PHP Version: 7.2.7-0ubuntu0.18.04.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... | true |
d29aa4e1ce5939ede9de6fa0a77102bae66673d7 | SQL | Min-Hyeok-zz/samil-crud-board | /back/mvc.sql | UTF-8 | 4,135 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- 생성 시간: 19-05-23 04:58
-- 서버 버전: 10.1.31-MariaDB
-- PHP 버전: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_... | true |
29061169c7c564a33eb2a02ab0d57dc1a421fb95 | SQL | amdenne/SWGuildProjects | /BaseballLeague/SQLScripts/StoredProc/GetPlayerAndTeamInfo.sql | UTF-8 | 150 | 2.875 | 3 | [] | no_license | Create procedure GetPlayerAndTeamInfo
(
@playerID int
)AS
select * from Player p
join Team t on p.TeamID = t.TeamID
where p.PlayerID = @playerID | true |
0b1275786379a03c507ea5f103585c59f36227f2 | SQL | vkscorpio3/ATG_TASK | /Publishing/base/sql/db_components/db2/workflow_ddl.sql | UTF-8 | 8,470 | 3.359375 | 3 | [] | no_license |
-- @version $Id: //product/Publishing/version/10.0.3/pws/sql/xml/workflow_ddl.xml#2 $
-- Collective workflow process instances. These instances represent
-- all subjects (processes) going through the workflow process.
create table epub_coll_workflow (
id varchar(40) not null,
workflow_name varchar(2... | true |
cba16788e0da56a4b52f216d0cc00a90801796c2 | SQL | infinitizon/cleanup | /cleanup/home/migration.sql | UTF-8 | 11,672 | 2.84375 | 3 | [] | no_license | ###############################################
##Creates the migration table
###############################################
DROP TABLE IF EXISTS MIGRATION_;
CREATE TABLE MIGRATION_
SELECT pr.PARTYROLE_ID, p.PARTY_ID, pr.CUSTOMERID_, pr.TYPE_ID
, (SELECT ACCOUNTNUMBER_ FROM ACCOUNT_
WHERE PRODUCT_ID IN ('655... | true |
0decf5478ef60f18b514d91b8ef1c90ef45f14c2 | SQL | popvlovs/Esper-demo | /src/main/resources/epl/epl_case13_count_window.sql | UTF-8 | 473 | 3.296875 | 3 | [] | no_license | SELECT
count(*) as win_count,
min(A.event_id) as start_id,
max(A.event_id) as end_id,
min(A.occur_time) as start_time,
max(A.occur_time) as end_time,
A.event_name as event_name,
A.group_0, A.group_1, A.group_2,A.group_3, A.group_4, A.group_5,A.group_6, A.group_7, A.group_8,A.group_9
FROM
TestEvent().win:ext_timed_batch... | true |
ccfd77db8f090e04cbd9f913732c8ff24b84077d | SQL | wimiDev/mybatistest | /mybatis-05/init.sql | UTF-8 | 755 | 3.46875 | 3 | [] | no_license | CREATE table teacher(
id INT(10) NOT NULL,
name VARCHAR(30) DEFAULT NULL,
PRIMARY KEY(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT into teacher(id, name) VALUES(1, '李富贵');
CREATE table student(
id INT(10) NOT NULL,
name VARCHAR(30) DEFAULT NULL,
tid INT(10) DEFAULT NULL,
PRIMARY KEY(id),
... | true |
525995e8924e8d4f4f43dd1efccb97d30a6f3b95 | SQL | chebypax/DataBase_Course | /social_network_like.sql | UTF-8 | 2,414 | 2.953125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.13, for Win64 (x86_64)
--
-- Host: 192.168.1.6 Database: social_network
-- ------------------------------------------------------
-- Server version 8.0.13
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... | true |
dcb33485aeafc2f55cc350e3481d09468e55f8c7 | SQL | ginkogrudev/Databases-Basics-MS-SQL-Server-September-2017 | /16.October-Exam-Prep/16.October-Exam-Prep/01.DLLMine.sql | UTF-8 | 711 | 3.546875 | 4 | [
"MIT"
] | permissive | CREATE TABLE Flights(
FlightID INT PRIMARY KEY,
DepartureTime datetime NOT NULL,
ArrivalTime datetime NOT NULL,
Status VARCHAR(9) CHECK (Status IN ('Delayed','Departing','Arrived','Cancelled')),
OriginAirportID INT FOREIGN KEY REFERENCES Airports(AirportID) NOT NULL,
DestinationAirportID INT FOREIGN KEY REFERENCE... | true |
8c7c3b69efb30ca5cd3675ee960bbfc2811f1f3b | SQL | vierbergenlars/bareos_exporter | /development/mysql/03-issue-10.sql | UTF-8 | 1,171 | 3.0625 | 3 | [
"MIT"
] | permissive | -- Reproduction of https://github.com/vierbergenlars/bareos_exporter/issues/10
INSERT INTO FileSet (fileset, md5, createtime, filesettext)
VALUES
('FileSetX', 'd41d8cd98f00b204e9800998ecf8427e', NOW() - interval 14 day, ''),
('FileSetX', 'd41d8cd98f00b204e9800998ecf8427f', NOW() - interval 7 day, '... | true |
1513119d876160289912433f219a26904799bd75 | SQL | MaximilianGeorgiev/wrench-marketplace | /src/main/resources/sql/user_security.sql | UTF-8 | 1,076 | 3.546875 | 4 | [] | no_license | DROP TABLE IF EXISTS user_security;
CREATE DATABASE IF NOT EXISTS user_security;
USE user_security;
CREATE TABLE users (
username varchar(50) NOT NULL,
password char(68) NOT NULL,
enabled tinyint(1) NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO users
VALUES
('john',... | true |
545decf14630ec192685e40326b1f20eed9612f2 | SQL | Whys3-R/Store_DB | /Store_DB.SQL | UTF-8 | 1,170 | 3.171875 | 3 | [] | no_license | CREATE TABLE catalog (id INTEGER PRIMARY KEY, name TEXT, aisle INTEGER, price INTEGER, product_type TEXT);
INSERT INTO catalog VALUES(1, "Shirt", 3, 10, "Apparel");
INSERT INTO catalog VALUES(2, "Pants", 3, 15, "Apparel");
INSERT INTO catalog VALUES(3, "Earbuds", 1, 5, "Technology");
INSERT INTO catalog VALUES(4, "Pho... | true |
5a72f5ed98a987d28ba4975f0104af5fb0865f8d | SQL | CareerATG/Retail-Data-Warehouse-Analysis | /Alteryx/Alteryx jobs/adw_loadermysql.sql | UTF-8 | 24,155 | 3.3125 | 3 | [] | no_license | --
-- ER/Studio Data Architect SQL Code Generation
-- Project : DATA MODEL
--
-- Date Created : Wednesday, February 26, 2020 03:42:14
-- Target DBMS : MySQL 5.x
--
--
-- TABLE: Dim_Date
--
CREATE TABLE Dim_Date(
DateKey INT NOT NULL,
FullDateAlternateKey DATE,
DayNumbe... | true |
55ad601ff7155db5c6b1c72e6284fa6620618b45 | SQL | mojuncong/psi | /doc/99 SQL/01CreateTables.sql | UTF-8 | 31,931 | 3.53125 | 4 | [] | no_license | /*!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 */;
DROP TABLE IF EXISTS `t_biz_log`;
CREATE TABLE IF NOT EXISTS `t_biz_log` (
`id` bigint(20... | true |
b5a70c687c57ad40de1b466e6e39db4637fb6af4 | SQL | sophiaciocca/sql-imdb-practice | /scratchwork.sql | UTF-8 | 5,047 | 5.0625 | 5 | [] | no_license | //creating movies table
CREATE TABLE movies (
id integer PRIMARY KEY,
name text DEFAULT NULL,
year integer DEFAULT NULL,
rank real DEFAULT NULL
);
//creating actors table
CREATE TABLE actors (
id integer PRIMARY KEY,
first_name text DEFAULT NULL,
last_name text DEFAULT NULL,
gender te... | true |
c7dd569f07096bb7824c9645e7f1db538f3078cd | SQL | Vitra-Veri-Bilimi-Bootcamp/yilmaz_mert_akin | /Patika/Week1-SQL/odev12.sql | UTF-8 | 1,980 | 4.75 | 5 | [] | no_license |
--film tablosunda film uzunluğu length sütununda gösterilmektedir. Uzunluğu ortalama film uzunluğundan fazla kaç tane film vardır?
SELECT COUNT(*) FROM film
WHERE length >
(
SELECT AVG(length) FROM film
);
--film tablosunda en yüksek rental_rate değerine sahip kaç tane film vardır?
SELECT COUNT(*) FROM film
WHERE ... | true |
72ad053ed8c2dd0404990f66b904141b1dc77c84 | SQL | santhean/SQL_Advanced | /MOVIE_RATING.SQL | UTF-8 | 1,904 | 4.28125 | 4 | [] | no_license | Find the titles of all movies directed by Steven Spielberg.
select title from Movie where director='Steven Spielberg'
Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order.
select year from Movie where mID in (select mID from Rating where stars in (4,5)) order by year
... | true |
b5fd0937362b2d5b1517b2affe7063690359376a | SQL | james-cantrill/funda_components | /programs_manager/programs_manager_database/action_functions/test/test_action_change_program_user_visibility.sql | UTF-8 | 11,046 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | -- test_action_change_program_user_visibility.sql
/* _in_data: {
target_login: - the login of the defined user whose visi bility will be changed
program_id: - the ID of the defined program
program: - the name of the defined program
visible: -- booloean
changing_user_login:
... | true |
2be18a18844e3cdab4e21d1377c305eca4d88d75 | SQL | olpbruno/desafiofinal-academy | /models/staging/stg_salereason.sql | UTF-8 | 557 | 3.78125 | 4 | [] | no_license | with source_data as (
select
salesreasonid as id_motivo,
name as motivo,
reasontype as tipo_motivo,
modifieddate
from {{ source('adventure_works','salesreason') }}
),
source_with_sk as(
select *
, {{ dbt_utils.surrogate_key(['id_motivo']) }} as sk_motivo
from so... | true |
76dd8a198c863bf302b59ffc4ff3a56f2f2ffc56 | SQL | lizidemao/laravel-web | /web.sql | UTF-8 | 3,875 | 3.296875 | 3 | [
"MIT"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : web
Source Server Version : 50714
Source Host : localhost:3306
Source Database : web
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2018-07-11 17:00:30
*/
SET FOREIGN_KEY_CHECKS=0;
-- -----------... | true |
24bb7e1710027873a5dfd128e0a1ea4506d81548 | SQL | wencano/uplb-campus-street-view | /db/uplb_campus_view.sql | UTF-8 | 16,217 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 06, 2021 at 05:39 AM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.1.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
240fc4d2bb5cd3bac3fb0d359ca6126c312d24b2 | SQL | anastasiabolotnikova/regix | /db/create.sql | UTF-8 | 13,060 | 3.296875 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Пн 26 май 2014 16:51:30
-- Model: New Model Version: 1.0
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';
-- -----... | true |
42793ef56ca1450d7e15795e5e3f06afa5df0365 | SQL | daotran/yii2-advanced-api | /database/yii2advanced_10Nov2015.sql | UTF-8 | 2,768 | 3.15625 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 10, 2015 at 08:55 AM
-- Server version: 5.5.44
-- PHP Version: 5.6.14-1+deb.sury.org~precise+1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
598791935307019ef7437ade80e3a0d6edfb1ffd | SQL | jmruzafa/cd50-problem-set | /pset7/movies/6.sql | UTF-8 | 107 | 3.34375 | 3 | [] | no_license | SELECT avg(r.rating) as Average FROM ratings r
INNER JOIN movies m ON m.id = r.movie_id
WHERE year = 2012 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.