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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5d34875ba422abdf21ae7f4ab4b080e9a010aafe | SQL | radtek/abs3 | /sql/mmfo/bars/Data/error/mod_csh.sql | WINDOWS-1251 | 3,163 | 3 | 3 | [] | no_license | PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/Bars/Data/Err/mod_CSH.sql =========*** Run *** ==
PROMPT =====================================================================================
PROMPT *** Create/replace ERR C... | true |
790e949ffe5cec91a8002f28faf43a9df1dbcd62 | SQL | FrancisMario/CCMs | /club.sql | UTF-8 | 5,403 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 24, 2017 at 05:58 PM
-- 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 |
359a2d203fcce64bc590b61e187283c14ae30125 | SQL | powellcattle/ec-city | /data/cattle/open_charolais.sql | UTF-8 | 288 | 3.171875 | 3 | [] | no_license | SELECT a.ear_tag AS "EAR TAG"
FROM cattle.animal AS a, cattle.breeds AS b
WHERE a.status='ACTIVE' AND a.animal_type='COW' AND (a.breed_id = b.id AND b.name = 'CHAROLAIS') AND current_breeding_status != 'PREGNANT'
ORDER BY a.ear_tag_prefix, a.ear_tag_year_desig, a.ear_tag_color;
| true |
ba6c05ce387e6771538cb829da99c7dff9832e43 | SQL | valerizaykov/blogsimpleDemo | /SQL_Import/forge.sql | UTF-8 | 4,212 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 8 март 2018 в 21:54
-- Версия на сървъра: 10.1.29-MariaDB
-- PHP Version: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
7c77d746b51999618a3697bba7d72fddae7b8c28 | SQL | gioagu/3dcitydb_simulation_pkg | /test_data/Simulation_PKG_Test_Data.sql | UTF-8 | 7,591 | 2.796875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- Simulation package v. 0.1 for the 3D City Database
--
-- May 2018
--
-- 3D City Database: http://www.3dcitydb.org/
--
-- Copyright 2018
-- Austrian Institute of Technology G.m.b.H., Austria
-- Center for Energy - Smart Cities and Regions Research Field
-- http://www.ait.a... | true |
2d36d3e2e7bf9477ec512b7315563cfb153a8364 | SQL | Felipe-P/Veterinaria | /persistencia/veterinaria.sql | UTF-8 | 18,547 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 25-03-2020 a las 05:37:35
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
a3c73cf2eb66b4da8610a851d0fe548fd54a5b9c | SQL | 3amrA7med/matches-reservation-system | /match_reservation_system.sql | UTF-8 | 1,666 | 4 | 4 | [] | no_license | CREATE SCHEMA `match_reservation_system` ;
CREATE TABLE `match_reservation_system`.`team` (
team_name varchar(255) NOT NULL,
PRIMARY KEY(team_name)
);
CREATE TABLE `match_reservation_system`.`user` (
username varchar(255),
pw varchar(255) NOT NULL,
fname varchar(255) NOT NULL,
lname varchar(255) NOT NULL,
dob date NO... | true |
e79b725311d1c6c4fd7da25a99c98116578fc1e7 | SQL | ytry0121/blog-with-php | /DB/setting.sql | UTF-8 | 290 | 2.640625 | 3 | [] | no_license | CREATE DATABASE blog;
CREATE TABLE `posts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(50) NOT NULL DEFAULT '',
`content` varchar(200) NOT NULL,
`author` varchar(20) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ;
| true |
8de777a2a787e54b09c7d557fcb0bbedd5c0b3c7 | SQL | quocbao13/C0920G1-Tran_Huynh_Quoc_Bao | /Module3/src/_05_sql_view_index_and_storedprocedure/practice/chi_muc/thuchanh.sql | UTF-8 | 313 | 3.09375 | 3 | [] | no_license | -- select thông thường
SELECT * FROM customers WHERE customerNumber = 175;
-- select tăng tốc
EXPLAIN SELECT * FROM customers WHERE customerNumber = 175;
-- select chỉ mục
ALTER TABLE customers ADD INDEX idx_customerNumber(customerNumber);
EXPLAIN SELECT * FROM customers WHERE customerNumber = 175; | true |
b07015518ea0b2ac401e6b6803213b5eb0055db3 | SQL | zhangjq-sss/system_code | /backend-api/database/mysql/C01-system-tables.sql | UTF-8 | 55,012 | 3.015625 | 3 | [] | no_license | SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
drop table if exists system_address;
drop table if exists system_code;
drop table if exists system_configuration;
drop table if exists system_credit_card;
drop table if exists system_element_category;
drop table if exists system_element_reference_item;
drop table if exists ... | true |
18bf7371f80909139cc94f389e3ea4fac89c919e | SQL | xpgitcup/lims2018CB | /src/main/webapp/scripts/system_user.sql | UTF-8 | 6,852 | 2.90625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : sample
Source Server Version : 50722
Source Host : localhost:3306
Source Database : lims2018bdb
Target Server Type : MYSQL
Target Server Version : 50722
File Encoding : 65001
Date: 2019-01-12 18:02:01
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... | true |
c550e549e27107aed76e1cfa72e87de8fa1daad5 | SQL | omorapatterson/shopping-api | /sql/shopping.sql | UTF-8 | 58,515 | 3.53125 | 4 | [
"MIT"
] | permissive | /*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 80021
Source Host : localhost:3306
Source Schema : shopping
Target Server Type : MySQL
Target Server Version : 80021
File Encoding : 65001
Date: 25/09/2... | true |
e1033242b297e3ffde72d98d5162e1b126c5787f | SQL | cesar-gonzalez-sf/DesktopFX | /Deploy/config/Database/Empleados/PostgreSQL/EMP_Data.sql | UTF-8 | 3,555 | 2.9375 | 3 | [] | no_license | --------------------------------------------------------------------------------
-- Copyright (c) OBCOM INGENIERIA S.A. (Chile). All rights reserved.
--
-- All rights to this product are owned by OBCOM INGENIERIA S.A. and may only be
-- used under the terms of its associated license document. You may NOT copy,
-- mo... | true |
6b45ae89e7dfd6448ea9eeef191552816a2543b5 | SQL | moiroca/wlc-old | /database/wlcinventory-old.sql | UTF-8 | 9,699 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.11.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 28, 2015 at 02:16 AM
-- Server version: 5.0.51
-- PHP Version: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_... | true |
f06941836d0542532ead8196b5e1d2f0e9e33a08 | SQL | FU626/- | /数据库/创建表.sql | GB18030 | 3,760 | 4 | 4 | [] | no_license |
--SC,Student,Course
DROP TABLE IF EXISTS SC
DROP TABLE IF EXISTS Student
DROP TABLE IF EXISTS Course
CREATE TABLE Student
(
Sno CHAR(9) PRIMARY KEY, /* мԼ,Sno*/
Sname CHAR(20) UNIQUE, /* SnameȡΨһֵ*/
Ssex CHAR(2),
Sage SMALLINT,
Sdept CHAR(20)
);
CREATE TABLE ... | true |
1caa5abf7042e32f9012c20080a2eddb20f4fbaf | SQL | avignesh95/hackerrank_solutions | /Binary_Tree_Nodes_SQL_Hackerrank.sql | UTF-8 | 951 | 4.4375 | 4 | [] | no_license | //Question: You are given a table, BST, containing two columns: N and P, where N represents the value of a node in Binary Tree, and P is the parent of N.
//Write a query to find the node type of Binary Tree ordered by the value of the node. Output one of the following for each node:
//Root: If node is root node.
//Lea... | true |
69ed86d85e5869d41ec12107b9436b85d4105c25 | SQL | mohssin19/2019-09-c-sharp-labs | /labs/SQL/SQL_EXAM1.sql | UTF-8 | 1,567 | 3.8125 | 4 | [
"MIT"
] | permissive | ----1.1
--select * from Customers where City = 'Paris' or City = 'London'
----1.2
--select * from Products where QuantityPerUnit like '%bottle%'
----1.3
--select Suppliers.CompanyName, Suppliers.Country, * from Products
--inner join Suppliers on Products.SupplierID = Suppliers.SupplierID
--where QuantityPerUnit like ... | true |
40803d7c39bf3ee6db3652f7e004233001f49508 | SQL | shub-naik/CanteenFoodOrderingSystem | /ip_project.sql | UTF-8 | 3,759 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Aug 30, 2020 at 07:51 AM
-- Server version: 5.7.26
-- PHP Version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
fbed4940f23af1e8a8077940491b8410ac7b0cdc | SQL | lilyren8/Leetcode | /1173. Immediate Food Delivery I.sql | UTF-8 | 268 | 3.0625 | 3 | [] | no_license | SELECT ROUND(AVG(customer_pref_delivery_date = order_date) *100, 2) AS immediate_percentage
FROM Delivery;
-- true is 1, false is 0
--can also use sum
SELECT ROUND(SUM(customer_pref_delivery_date = order_date)/COUNT(*) *100, 2) AS immediate_percentage
FROM Delivery;
| true |
4f66fd8f051560bbe84498eb1633f90a2f5dab50 | SQL | iceywhite/traceability- | /Database/DB_Building_SQL/DB_ID.sql | UTF-8 | 33,008 | 3.6875 | 4 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 8.0.26 - MySQL Community Server - GPL
-- Server OS: Win64
-- HeidiSQL Version: 11.3.0.6295
-- --------------------------------------------------------
/... | true |
cb07a8a065e322620dcd6e6169c33b0eac811ce6 | SQL | sfjwarriors/warriors | /BD/tablas.sql | UTF-8 | 904 | 3.078125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | create table "user"(
"id" serial,
"name" VARCHAR(120) not NULL,
"lastname" VARCHAR(120) not NULL,
"email" VARCHAR(120) not NULL,
"password" VARCHAR(120) not NULL,
"rol" VARCHAR(4) not NULL,
"address" VARCHAR(120) not NULL,
"image" VARCHAR(120) not NULL,
"cash" INTEGER not null
);
... | true |
30dff372b6c3fa326a002f06bfab80e09a9e0de0 | SQL | Gisiqueira96/turma30java | /MySQL/Exemplos/ExemoloVoo/Aviao.sql | UTF-8 | 1,581 | 3.796875 | 4 | [] | no_license |
#Criação do banco de dados
create database voo321;
#Criação da tabela
use voo321;
create table aviao (
id_aviao int(11) not null,
modelo varchar(50) not null,
primary key (id_aviao)
)
engine=InnoDB;
desc aviao;
show tables;
create table tripulantes (
id_tripulantes int(11) not null,
nome varchar(50) not null,
g... | true |
53ea48a08859dcbd6cf7f542365beca01a00c732 | SQL | ttibensky/hackme | /resources/hackme.sql | UTF-8 | 3,199 | 3.078125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.5.35, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: hackme
-- ------------------------------------------------------
-- Server version 5.5.35-0ubuntu0.13.10.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CH... | true |
4098bc117c884eb77f9490915b3c3f8941fdea15 | SQL | VitorAlfeu/SullyWS | /src/main/resources/Templates/Scripts do MySQL/Select de Lancamentos.sql | UTF-8 | 276 | 3.65625 | 4 | [] | no_license | select u.nome as nome, u.login as usuario, l.data_hora, l.pago, l.valor, ud.nome as nome_devedor, ud.login as usuario_devedor
from lancamentos l
inner join usuarios u on u.id = l.usuario_id
inner join usuarios ud on ud.id = l.usuario_devedor_id
where u.id = 1
order by u.id; | true |
d9033f850fcab26d4252080463e06c5056f03cbc | SQL | nohchanghwan/Java_study | /oraclePJT_0710/bin/javac_select_join_0712.sql | UHC | 6,130 | 4.625 | 5 | [] | no_license |
--0712
--ֿԼ
[SUM]
SELECT SUM(SALARY),SUM(DISTINCT SALARY)
FROM EMPLOYEE
WHERE DEPT_ID = '50' OR DEPT_ID IS NULL;
[AVG]
SELECT AVG(BONUS_PCT) AS ⺻,
AVG(DISTINCT BONUS_PCT) AS ߺ,
AVG(NVL(BONUS_PCT,0)) AS NULL
FROM EMPLOYEE
WHERE DEPT_ID IN ('50','90') OR DEPT_ID IS NULL;
[COUNT]
SELECT COUNT(BONUS_PCT... | true |
968cc71838d45596a1aade190c08d1691ff5bbf7 | SQL | Sfjklm/eDnevnik_mvc_2019 | /primaryschool.sql | UTF-8 | 38,692 | 3.40625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Sep 23, 2019 at 09:29 AM
-- Server version: 5.7.19
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
98f94797c4ae004d4ec2b64689b8ea5dcc314bd0 | SQL | rcls/terpine | /soft/db.sql | UTF-8 | 1,313 | 3.609375 | 4 | [] | no_license | -- match rows: run/unit/cycle id, count, sha1
CREATE TABLE multiplicity(
value CHARACTER(20) NOT NULL PRIMARY KEY,
count INTEGER NOT NULL);
CREATE INDEX multiplicity_by_count ON multiplicity(count);
CREATE TABLE samples(
id INTEGER NOT NULL,
count INTEGER NOT NULL,
va... | true |
a7617fff9bae73399e3599415a415c5bcc577e3f | SQL | reutlevy/Portfolio | /Data_Bases_SQL/DB_Applications_Triggers_Views/Triggers & Views.sql | UTF-8 | 1,471 | 4.125 | 4 | [] | no_license | CREATE VIEW ConstructorEmployeeOverFifty AS
SELECT Employee.*,ConstructorEmployee.CompanyName,ConstructorEmployee.SalaryPerDay
FROM (Employee JOIN ConstructorEmployee
ON Employee.EID = ConstructorEmployee.EID AND (date('now')-Employee.BirthDate)>=50);
CREATE VIEW ApartmentNumberInNeighborhood AS
SELECT Neighborhood.... | true |
10cf7f4b8fc1357f19e3d1683e841e02e5fcf3fc | SQL | catriel10/grupo_4_ecommerce | /library/retro/#6/grupo4.sql | UTF-8 | 6,442 | 3.578125 | 4 | [] | no_license | /* Creacion de BD */
DROP DATABASE IF EXISTS grupo4;
CREATE DATABASE grupo4;
USE grupo4;
/* Creacion de tablas */
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
name VARCHAR(255) NOT NULL,
lastname VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) N... | true |
9ed34c447057ab2f1c43c5cd1d33ef3578c09350 | SQL | kszucs/ibis | /ci/schema/clickhouse.sql | UTF-8 | 2,852 | 3.5625 | 4 | [
"Apache-2.0"
] | permissive | -- NB: The paths in this file are all relative to /var/lib/clickhouse/user_files
CREATE OR REPLACE TABLE diamonds ENGINE = Memory AS
SELECT * FROM file('parquet/diamonds/diamonds.parquet', 'Parquet');
CREATE OR REPLACE TABLE batting ENGINE = Memory AS
SELECT * FROM file('parquet/batting/batting.parquet', 'Parquet');
... | true |
dd345b2dd019c664bc0c712f2cd26c98ead7c3a4 | SQL | Uwe-Wan/DSG | /DSG/Database/CreateScript.sql | UTF-8 | 1,136 | 3.90625 | 4 | [] | no_license | DROP TABLE IF EXISTS DominionExpansion
DROP TABLE IF EXISTS [Card]
DROP TABLE IF EXISTS Cost
CREATE TABLE DominionExpansion(
[Id] INT NOT NULL IDENTITY(1,1),
[Name] VARCHAR(50) NOT NULL
)
ALTER TABLE DominionExpansion ADD CONSTRAINT PK_DominionExpansion PRIMARY KEY(Id)
CREATE TABLE Cost(
[Id] INT NOT NULL IDENTITY(1... | true |
4b60490d8d6345dde5088990800a637d258ef209 | SQL | zjjnewman/mysql | /MySQL19v04/04-mysql高级-夏磊-2019/replication(主从复制)/slave_and_master.sql | UTF-8 | 471 | 2.546875 | 3 | [] | no_license | -- -- master
grant replication slave on *.* to 'jin'@'%' identified by '123';
-- -- 建立完主从后
create database mscopytest;
create table mstest
(
ms_id int not null auto_increment,
ms_name char(50) not null,
primary key (ms_id)
);
-- -- slave
change master to master_host='101.132.178.15',
master_user='jin'... | true |
d0bf0d29a39e92b3c8be8f5d4ab2581a0f197493 | SQL | lianhy/springboot-quartz-memory | /src/main/resources/sql/quartz_job.sql | UTF-8 | 1,730 | 3.546875 | 4 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50626
Source Host : localhost:3306
Source Schema : ssm
Target Server Type : MySQL
Target Server Version : 50626
File Encoding : 65001
Date: 15/10/2019 18:46:... | true |
b981148c91d27a3629fe23fcfe43bc45272f6e1d | SQL | dmwm/DDM | /DataPopularity/popdb.crab/collector/config/db/CreateRawTable.sql | UTF-8 | 3,920 | 3.171875 | 3 | [] | no_license | CREATE TABLE "RAW_FILE"
(
InsertTime Date DEFAULT to_date('2011/01/01 12:00:00am', 'yyyy/mm/dd hh:mi:ssam') NOT NULL,
FileName VARCHAR2(400 BYTE) DEFAULT 'unknown' NOT NULL,
FILEEXITFLAG NUMBER(1,0) DEFAULT 0 NOT NULL ,
Filesize NUMBER(38,0) DEFAULT 0 NOT NULL,
FILETYPE VARCHAR2(100 BYTE) DEFAULT 'unknown' NOT NULL... | true |
8e5e6c566da50fa9b31c69f5130caa77005ac207 | SQL | zacharylong/m6-docker-aws | /init/create_tables.sql | UTF-8 | 463 | 2.640625 | 3 | [] | no_license | create table users (username varchar(100) not null primary key, password varchar(100), full_name varchar(200), admin boolean DEFAULT false);
insert into users values ('fred', 'foo', 'Fred Flintstone', false);
insert into users values ('barney', 'blah', 'Barney Rubble', false);
insert into users values ('wilma', 'bedro... | true |
53a541421bfe9671d4547773d97b77b59b71eeb2 | SQL | Barvius/Android_2_2 | /PHP/db.sql | UTF-8 | 2,320 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Фев 13 2019 г., 16:41
-- Версия сервера: 5.7.24-0ubuntu0.16.04.1
-- Версия PHP: 7.0.32-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
912b1e667898b2473e82d05615870cab58c30ffb | SQL | jannunzi/quiz-maker | /src/db-design/query/join/fill-blanks/sql/GROUP_BY_COUNT_FILL_BLANKS_2.sql | UTF-8 | 1,825 | 3.703125 | 4 | [] | no_license | -- create table SE
USE QUIZ_MAKER;
DROP TABLE IF EXISTS SE;
CREATE TABLE SE (
SEID INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(SEID),
SE1 VARCHAR(45),
SE2 INT,
SE3 FLOAT);
-- insert into SE
USE QUIZ_MAKER;
INSERT INTO SE
(SEID,SE1,SE2,SE3)
VALUES ('676','ATFva','6522','6041.44');
INSERT INTO SE
(SEID,SE1,SE2,SE3)
VALUES (... | true |
3cb18e03e17506650256248f2cbfb0ed9faee0d5 | SQL | mithileshpatra/myfile | /sample_sql/Cart_15_ORDER_BY_with_NULLs_last.sql | UTF-8 | 672 | 2.640625 | 3 | [] | no_license | /* Chapter 8: The ORDER BY Clause */
/* ORDER BY price, with NULLs last */
SELECT
name
, price
FROM
items
ORDER BY
CASE WHEN price IS NULL
THEN 2
ELSE 1
END
, price
;
/* Results should look like this --
name price
bric-a-brac 2.00
folderol 4.00
gewgaw ... | true |
fa14bf975a09c4bf5107434c4bdb4346ff3bd856 | SQL | erickvs/CS157BTeamProject | /src/populateStarSchema.sql | UTF-8 | 9,493 | 3.546875 | 4 | [] | no_license | USE Groceries;
DROP TABLE IF EXISTS `Sales_Fact`;
-- ------------------------------------------------------------
-- ------------------------- Create Schema of PROMOTION table -
-- ------------------------------------------------------------
DROP TABLE IF EXISTS `Promotion`;
CREATE TABLE `Promotion` (
`promotio... | true |
9def21cae630d768b44950b5a877b3bee77594bc | SQL | Jaewon0702/Jaewon0702-2021_1st_semestry | /database/20210427 수업.sql | UTF-8 | 695 | 3.875 | 4 | [] | no_license | use pubs;
select title
from titles
where pub_id not in(
select pub_id
from publishers
where pub_name = "New Moon Books");
select t.title
from titles t natural join publishers p
where p.pubs_name = "New Moon Books";
/*select s.name from student s where s.gpa > (select max(ct.grade))
from course_taken c1 where;*/
s... | true |
13f0c971bc9e2473222e233d8bf4c0341e13b3e1 | SQL | eyeonechi/software-database-analysis | /src/Question3.sql | UTF-8 | 806 | 3.359375 | 3 | [
"MIT"
] | permissive | -- -----------------------------------------------------
-- Question 3
-- -----------------------------------------------------
-- Creates a new Location instance
INSERT IGNORE INTO Location Values (
DEFAULT,
123,
"",
"Fake",
"Street",
"Fakeville",
"Melbourne",
"Victoria",
"9999",
"Australia"
);
SET @LID = L... | true |
10c81e972071e49099ecd03878e1eb34ab30d47b | SQL | stea1th/pizza-online | /person-service/src/main/resources/db/populateDB.sql | UTF-8 | 665 | 3.09375 | 3 | [] | no_license |
DELETE FROM person;
DELETE FROM address;
ALTER SEQUENCE global_seq
RESTART WITH 997;
INSERT INTO address(street, zip, city, country)
VALUES ('Hauptstrasse 6', '12345', 'Essen', 'Deutschland'),
('Schobertweg 3', '45678', 'München', 'Deutschland'),
('Sedulinos 7', '23452', 'Ignalina', 'Litauen');
IN... | true |
ac065b079ed9472161f8f27067ed6cb82ab021a8 | SQL | vabhishek1289/Fifth-Sem | /DBMS/dbms ass/ass2-2partA.sql | UTF-8 | 4,694 | 3.8125 | 4 | [] | no_license | create table Emp (eid integer Primary Key,ename varchar(20),age integer,salary_$ integer);
create table Department (did integer Primary Key,dname varchar(20),budjet integer,M_id integer);
create table Works (eid integer,did integer,hrs integer,Primary Key (eid,did),Foreign Key (eid) references Emp(eid),Foreign Key (did... | true |
3fb976e2ace0fd0b1c4d4cf18c38a3a0f814069b | SQL | ArierLin/myAppBeta3_UserService | /myAppBeta3_web/src/main/webapp/sql/init.sql | UTF-8 | 6,126 | 3.15625 | 3 | [] | no_license | -- CREATE DATABASE demo;
-- USE demo;
--
-- DROP TABLE IF EXISTS demo;
use myapp_beta1;
DROP TABLE IF EXISTS role_authority_relation;
DROP TABLE IF EXISTS role;
DROP TABLE IF EXISTS authority;
CREATE TABLE authority(
id INT(32) NOT NULL AUTO_INCREMENT ,
name VARCHAR(32) NOT NULL ,
ddesc VARCHAR(255) ,
parent_id... | true |
49ff7545067a522978c02646ec17ae89ef5e6fbe | SQL | kowoohyuk/newdeal-artgo | /artgo/src/main/webapp/resources/doc/artgo-table.sql | UTF-8 | 9,207 | 3.65625 | 4 | [] | no_license | -- 파일
DROP TABLE IF EXISTS FILE RESTRICT;
-- 인증
DROP TABLE IF EXISTS AUTH RESTRICT;
-- 후기
DROP TABLE IF EXISTS REVIEW RESTRICT;
-- 즐겨찾기
DROP TABLE IF EXISTS FAVORITE RESTRICT;
-- 결제 내역
DROP TABLE IF EXISTS PAYMENT RESTRICT;
-- 전시회
DROP TABLE IF EXISTS BOARD_EXHIBITION RESTRICT;
-- 게시판
DROP TABLE IF EXISTS BOARD R... | true |
9d0871277a08b60b2a8c0974fb3b79943b33d7b5 | SQL | deic-dk-retired/ddosapi | /.influxql/qf-top-10-out-pps.sql | UTF-8 | 267 | 3.140625 | 3 | [] | no_license | /**
* show top 10 ip addresses by incoming pps value
* in the last 30m
*/
select top(value,10) as y, time as x, cidr, resource
from graphite.autogen.hosts
where resource='pps'
and time < now() - 0m
and time > now() - 30m
and direction='outgoing'
order by time desc | true |
48c7ec33199272af5616278f23c2b1e52c82dfe4 | SQL | rahulvdev/UniBuddy | /unibuddy server/unibuddy.sql | UTF-8 | 1,391 | 2.65625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 17, 2017 at 04:44 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... | true |
5a3558acb3072dfea299d835cd3cebca122193fc | SQL | maflorez14/Accedo_prueba | /Pokemon/login.sql | UTF-8 | 1,143 | 2.53125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 08-12-2020 a las 09:05:24
-- Versión del servidor: 10.4.17-MariaDB
-- Versión de PHP: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
497a8044d21c51b1de5d890cb9526f6df56b8546 | SQL | bcraig2612/WPX-13_SQL_II_Afternoon_Project | /SQL2-Practice/PracticeGroupBy/GroupBy.sql | UTF-8 | 496 | 3.984375 | 4 | [] | no_license | ------------------------------------ STEP 4 (GROUP BY) ------------------------------------
-- (1)
SELECT COUNT(*), g.name
FROM track t
JOIN genre g ON t.genre_id = g.genre_id
GROUP BY g.name;
-- (2)
SELECT COUNT(*), g.name
FROM track t
JOIN genre g ON g.genre_id = t.genre_id
WHERE g.nam... | true |
8a79c72f1a07df9e57d4554aaf097ba54fb305d7 | SQL | ahmmedzakaria/Student-Attendance-Management | /db_school_attendance 20180426 2039.sql | UTF-8 | 7,742 | 3.640625 | 4 | [] | no_license | -- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.0.45-community-nt
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CO... | true |
608e15b872d8c699055bbd618800a99c99c590a3 | SQL | ethanshancn/ibd | /ibd.sql | UTF-8 | 19,401 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.0
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2016-04-30 22:49:58
-- 服务器版本: 5.6.26
-- PHP Version: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @... | true |
64e3a2ca4094a168a5fa7cac22593d0690e8639c | SQL | derekprovance/BiometricsAPI | /database.sql | UTF-8 | 5,739 | 3.1875 | 3 | [] | no_license | --
-- Table structure for table `blood_sugar`
--
DROP TABLE IF EXISTS `blood_sugar`;
CREATE TABLE `blood_sugar` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`datetime` datetime DEFAULT CURRENT_TIMESTAMP,
`mg_dL` int(11) NOT NULL,
`notes` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT... | true |
a21f6375b7c22edeae5d962d5dff19157c539fd5 | SQL | pmmarambio/Telerik-Controls | /pruebasphp.sql | UTF-8 | 2,188 | 3.328125 | 3 | [] | no_license | /*
SQLyog Ultimate v11.33 (64 bit)
MySQL - 5.7.17-log : Database - pruebasphp
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY... | true |
d76a474fc903957969e5fd7853a2f6e0e3e783e9 | SQL | LifebellAI/mimiciv-queries | /BigQuery/4_hourly_vitals_flat.sql | UTF-8 | 1,306 | 3.34375 | 3 | [] | no_license | CREATE OR REPLACE TABLE `physionet.hourly_vitals_flat` AS
SELECT
subject_id,
hadm_id,
stay_id,
DATETIME_TRUNC(charttime, HOUR) AS chart_hour,
valuenum AS value,
valueuom AS units,
label
FROM `physionet-data.mimic_icu.chartevents`
JOIN `physionet-data.mimic_icu.d_items`
USING(itemid)
WHERE label IN
('RR per min', -- Re... | true |
15d3466caa1bb17ac772b5e17c53301c2de06976 | SQL | viniciuscsf1/turma30java | /MySQL/exercicios.19.08.2021/Atividade_1_querry_compilado.sql | UTF-8 | 1,978 | 4.28125 | 4 | [] | no_license | -- Criando o banco de dados
create database db_generation_game_online;
-- Selecionando o banco de dados criado
use db_generation_game_online;
-- Criando as tabelas
create table tb_classe(
id_classe int(3) auto_increment,
classe varchar(25) not null,
tipoataque varchar(15) not null,
primary key (id_classe)) engin... | true |
5a947b3b88f74148763cf18ca8e73d81059b9c2d | SQL | ErdemBaysal/takeaway | /DWH_Checks/Check-2.sql | UTF-8 | 581 | 3.78125 | 4 | [] | no_license | -- provides list of products that have inconsistency for also_bought and also_viewed data
-- expectation, all the products in also_bought should appear in also-viewed
select
ab.product_sk,
ab.relative_product_sk
from
(
select product_sk, relative_product_sk
from lnk_relative_product
where relative_type... | true |
d5a7ee84b8a26ce1968ee71e58ba9037ac0ffeca | SQL | maybe-william/holbertonschool-higher_level_programming | /0x0D-SQL_introduction/103-max_state.sql | UTF-8 | 163 | 3.296875 | 3 | [] | no_license | -- Max temperatures
-- Group temperatures by state and then take the max
SELECT state, MAX(value) AS max_temp FROM temperatures GROUP BY state ORDER BY state ASC;
| true |
7390ce66bf41b509558a9e8af63ea608cb612118 | SQL | ralfyao/TLTCA-System | /eval2.sql | UTF-8 | 170,141 | 3.03125 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : 35.229.183.207
Source Server Type : MySQL
Source Server Version : 80018
Source Host : 35.229.183.207:3306
Source Schema : eval2
Target Server Type : MySQL
Target Server Version : 80018
File Encoding : 65001
... | true |
5646ea3c05a9805cd69ab27e5dcf7136d8d63351 | SQL | bdmlai/analytics_engineering_marts | /data_model/ddl/Snowflake_ddl/fds_kntr/Views/VW_AGGR_KNTR_WEEKLY_WWE_PROGRAM_RATING_DDL.sql | UTF-8 | 939 | 3.1875 | 3 | [] | no_license | CREATE VIEW VW_AGGR_KNTR_WEEKLY_WWE_PROGRAM_RATING
AS
select week_start_date,
src_country,src_channel,
series_name,src_demographic_group,src_demographic_age,hd_flag ,
rat_value,
viewing_hours,
duration_hours,
count_telecast,
Weekly_Cumulative_Audience as average_weekly_cumulative_audience_000
from
(
select week_star... | true |
3641f51c6dd47b2d443d3bb207dbad62e5aed113 | SQL | mohamadihsan/mutiara_packaging | /database(sql)/mutiara_packaging (data kosong).sql | UTF-8 | 7,564 | 2.8125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 24, 2016 at 03:57 PM
-- Server version: 5.7.9
-- PHP Version: 5.6.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
874f097a354360029e9933c3a63e71838d0bbeed | SQL | NeotomaDB/Neotoma_SQL | /function/ti/getcollunitbyidv2.sql | UTF-8 | 879 | 3 | 3 | [
"MIT"
] | permissive | CREATE OR REPLACE FUNCTION ti.getcollunitbyidv2(_collectionunitid integer)
RETURNS TABLE(collectionunitid integer, handle character varying, siteid integer, colltypeid integer, depenvtid integer, collunitname character varying, colldate character varying, colldevice character varying, gpslatitude double precision, gps... | true |
76ecf4c8acf6f537fd033edbeda15eb42fa24a4a | SQL | HaiBoHan/XinBaoBeiShuJu | /WEB/Script/DeleteNullData.sql | UTF-8 | 633 | 3.578125 | 4 | [] | no_license |
/*
create table hbh_tmp_T_Menu_15011901
select *
from T_Menu
;
create table hbh_tmp_T_AgeGroup_15011901
select *
from T_AgeGroup
;
insert into T_Menu
select *
from hbh_tmp_T_Menu_15011901
*/
-- 删除空的菜单
delete from T_Menu
where 1=0
-- 没有序号
or (Sequence is null or Sequence = '')
-- 没有年龄段
or (AgeGroupName is null o... | true |
db7ec60099dd58ba058aacb465b545e689d27061 | SQL | kovidomi/Zoo-App | /database/zoo.sql | UTF-8 | 11,541 | 2.765625 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 12.0
-- Dumped by pg_dump version 12.0
-- Started on 2019-10-30 22:20:41
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 |
25937fb00e54326a5c288c2c300ef106874e17b3 | SQL | Linupo/LibraryProject | /Database/dbo/Tables/Vacations.sql | UTF-8 | 269 | 2.921875 | 3 | [] | no_license | CREATE TABLE Vacations
(
Id int IDENTITY(1, 1) NOT NULL PRIMARY KEY,
StartDate date NOT NULL,
EndDate date NOT NULL,
IsAccepted bit NOT NULL,
EmployeeId int NOT NULL,
FOREIGN KEY (EmployeeId) REFERENCES Employees (Id)
ON DELETE CASCADE
ON UPDATE CASCADE
); | true |
f652b0fea7c07967862aab79ee6daa64da852529 | SQL | SSBTI/SSBTI | /exec/Lambda/RDS/procedure.sql | UTF-8 | 317 | 2.984375 | 3 | [] | no_license | DROP PROCEDURE IF EXISTS updateMbti;
DELIMITER $$
CREATE PROCEDURE updateMbti
(IN inputType varchar(20))
BEGIN
start transaction;
update mbti set count = count+1 where type = inputType;
select sum(count), (select count from mbti where type=inputType) from mbti;
commit;
END $$
DELIMITER ; | true |
b387f89dba9a4222d1980ee4a5d4a2053967e8c2 | SQL | Moinketroa/ProjetBDD | /script_creation/3-creation_vues_triggers_obelix.sql | UTF-8 | 4,530 | 3.390625 | 3 | [] | no_license | /*--*/
ALTER SESSION SET "_ORACLE_SCRIPT"=true;
/*-----------------------*/
/* ETAPE 1 : REPLICATION */
/*-----------------------*/
/* creation de vues materialisees pour dupliquer les donnees disponibles chez panoramix */
CREATE MATERIALIZED VIEW etape1_village_vue_mat REFRESH FAST WITH PRIMARY KEY ON DEMAND
AS
SELE... | true |
3447d32e2bfaec3e313124f98495e264baa4af91 | SQL | Ankit2509/Learning_Aid | /teachers.sql | UTF-8 | 4,511 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 23, 2017 at 12:55 PM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
cf72448a4b9eee6ea1e05819240d040b9014a516 | SQL | cop5725/Database-Schema | /MovieProduction.sql | UTF-8 | 197 | 2.84375 | 3 | [] | no_license | CREATE TABLE MovieProduction(
CompanyID integer,
MovieID integer,
FOREIGN KEY (MovieID) REFERENCES Movie(MovieID),
FOREIGN KEY (CompanyID) REFERENCES ProductionCompany(CompanyID)
); | true |
353c6fedd6b0ef6799291fade3ea3a3600d663ca | SQL | RT28/php_sample | /sql/course_reviews_ratings.sql | UTF-8 | 2,612 | 3.28125 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 23, 2016 at 09:36 PM
-- Server version: 5.6.24
-- PHP Version: 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 */;
... | true |
9e19629b4cf05756c1ebd93d2fb5ea6769db931e | SQL | BugsUK/FindApprenticeship | /src/SFA.Apprenticeships.Data/Schemas/Reference/Scripts/Reference.Sector.Upsert.sql | UTF-8 | 1,281 | 3.34375 | 3 | [
"MIT"
] | permissive | MERGE INTO [Reference].[Sector] AS Target
USING (VALUES
(1, N'Actuarial'),
(2, N'Aerospace'),
(3, N'Automotive'),
(4, N'Automotive retail'),
(5, N'Butchery'),
(6, N'Conveyancing and probate'),
(7, N'Defence'),
(8, N'Dental health'),
(9, N'Digital Industries'),
(10, N'Electrotechnical'),
(... | true |
2db750a56e47808e6fd7089b96c1edbad2b6bcb9 | SQL | jaguuuar/CheckPoint4-rev-SQL | /queries.sql | UTF-8 | 818 | 4.25 | 4 | [] | no_license | select name from customers where gender = 'Female';
select round(sum(net_value + (net_value * tax_rate/100)), 2) as money_spent from sales;
select * from customers where strftime('%Y','now') - birthyear > 18;
select * from customers order by surname;
select * from sales where product_name like '%a%';
select * fr... | true |
01840cfa4d72a2e556efb59027021031f1baa6d1 | SQL | mcgidev/mPortal | /Portal/WebSystem/WCMS.Framework.SqlDabase/dbo/Stored Procedures/IncidentType_Del.sql | UTF-8 | 141 | 2.671875 | 3 | [
"MIT"
] | permissive | CREATE PROCEDURE dbo.IncidentType_Del
(
@Id int
)
AS
SET NOCOUNT ON
IF(@Id > 0)
DELETE FROM IncidentType
WHERE Id=@Id;
RETURN | true |
e7646e91f96f70e4862da866b7efaeaea0bd04b9 | SQL | MrRegisB/ProjetKeysoft | /kysoft.sql | UTF-8 | 2,887 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.4
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Mer 18 Septembre 2019 à 12:54
-- Version du serveur : 5.6.15-log
-- Version de PHP : 5.5.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... | true |
8c6ba6127116bffd12d78ec377e4975b7fc96643 | SQL | erxTesting/influxdb-sqlserver | /sqlscripts/getperfcounters.sql | UTF-8 | 4,221 | 4.0625 | 4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
IF OBJECT_ID('tempdb..#PCounters') IS NOT NULL DROP TABLE #PCounters
CREATE TABLE #PCounters
(
object_name nvarchar(128),
counter_name nvarchar(128),
instance_name nvarchar(128),
cntr_value bigint,
cntr_type INT,
Primary Key(object_name, counter_n... | true |
52df17ce20202d02179ff1239f0b959d71cf3975 | SQL | Nightwind0/void_terminal_server | /void_rev/sql/create_mob.sql | UTF-8 | 247 | 3.0625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | CREATE TABLE Mob(
sname varchar(30) PRIMARY KEY,
npersonality integer,
nhomesector integer REFERENCES Sectors(nsector),
ndest integer REFERENCES Sectors(nsector),
CHECK (npersonality >=0 and npersonality <= 6)
);
GRANT ALL ON Mob to void;
| true |
299f867df309d8a940ab749a9b0344d6ba8dba18 | SQL | so-glad/factors | /src/main/plpgsql/so/glad/common/charset.sql | UTF-8 | 1,297 | 3.640625 | 4 | [
"MIT"
] | permissive | CREATE SEQUENCE public.table_charset_id_seq
INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1;
ALTER SEQUENCE public.table_charset_id_seq OWNER TO soglad;
-- Table: public.charset;
-- DROP TABLE public.charset;
CREATE TABLE public.charset (
id BIGINT NOT NULL DEFAULT nextv... | true |
ace55cbf514748afaae369e70fead719787abd44 | SQL | OnalChaudhari/Create-A-Basic-Banking-System-Project-Of-The-Sparks-Foundation-webdevelopment-main | /Create-A-Basic-Banking-System-Project-Of-The-Sparks-Foundation-webdevelopment-main/sql/basic_bank_system_database.sql | UTF-8 | 2,506 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 13, 2021 at 10:35 AM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 5.6.37
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
3617aea36ab990363b324d465ec40c18b3e653f6 | SQL | filipenatanael/Homework | /Transact-SQL/Exercises/SQL_Exercise_L111_AO_L118.sql | WINDOWS-1252 | 5,047 | 4.53125 | 5 | [] | no_license | -- Verifique a estrutura atual da tabela Produto. Crie um campo de nome codigoForn, tipo INT.
-- -- Definir este campo como chave estrangeira da tabela Fornecedor
sp_help Produto
ALTER TABLE Produto ADD codigoForm INT
-- Definir este campo como chave estrangeira da tabela Fornecedor
ALTER TABLE Fornecedor ADD PRIMARY ... | true |
ff7744e17c9c39609eaf2077f00f8a784fbd3b2c | SQL | pntalari/DataGrip.PokemonSqlLab | /LabAnswers.sql | UTF-8 | 3,402 | 4.8125 | 5 | [] | no_license | #PART 2: Simple Selects and Counts
# What are all the types of pokemon that a pokemon can have?
select name as Name
from types;
# What is the name of the pokemon with id 45?
select name
from pokemon.pokemons
where id = 45;
# How many pokemon are there?
select count(*)
from pokemon.pokemons;
# How many types are ther... | true |
28b759bf9c131b21e0238c19541549abc8f0b1ff | SQL | Clamant96/crud-java-puro | /desario_flashsafe_usuario.sql | UTF-8 | 250 | 2.59375 | 3 | [] | no_license | CREATE DATABASE desafio_flashsafe;
USE desafio_flashsafe;
CREATE TABLE usuario (
id bigint auto_increment,
nome VARCHAR(255) NOT NULL,
idade int(11) NOT NULL,
sexo varchar(1) NOT NULL,
constraint pk_usuario primary key (id)
); | true |
769f8ccfb2e7e2aacb8f1e872a599f14ea6de9a7 | SQL | vinodhabiradar17b21/dst-sp | /deleteBundleRequestTrackingRecordsOneByOne.sql | UTF-8 | 847 | 3.421875 | 3 | [] | no_license |
DELIMITER //
create procedure deleteBundleRequestTrackingRecordsOneByOne()
begin
DECLARE ItemId int;
-- Declare variables used just for cursor and loop control
DECLARE no_more_rows BOOLEAN DEFAULT FALSE;
-- Declare the cursor
DECLARE BundleItemIdList_cur CURSOR FOR
select id from bund... | true |
b273ca3087297eab0b90925f1e2721f1b6ff5adf | SQL | daviddlhz/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/8-cities_of_california_subquery.sql | UTF-8 | 128 | 2.53125 | 3 | [] | no_license | -- script that lists all the cities of California that can be found
SELECT cities.id, cities.name FROM cities WHERE state_id=1;
| true |
aee94c18eebb9f609657749b909bf95c21f06d39 | SQL | Goran202/Speck-Academy-2019-Project | /DB/fill_DB.sql | UTF-8 | 1,747 | 2.625 | 3 | [] | no_license | INSERT INTO halls (hall_id, name, address, capacity)
VALUES
('e150df09-aa40-4466-944b-56989539e29a', 'OŠ Ljudevita Modeca Križevci', 'Potočka ul. 27, Križevci', 10000);
('b2aa69a6-0d07-48b1-a7e8-5cb32a972bbc', 'OŠ Vladimir Nazor', 'Ul. bana Josipa Jelačića 23, Križevci', 1000),
('50e7f0c4-b4a5-4e50-a29... | true |
38fce6fa19f07e96d0b32341784bb73b6e9240c2 | SQL | Tent-Dev/OurMorse-Game | /SQL_FILE/our_morse.sql | UTF-8 | 5,212 | 2.875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.15.9
-- https://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 23, 2020 at 12:53 PM
-- Server version: 5.6.37
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... | true |
3fafcd3e633eb4979e55d8cceccd9538f71bcb33 | SQL | j7ng/CLFY_SA | /SA/Tables/TABLE_GBKP_CAT.sql | UTF-8 | 985 | 3.015625 | 3 | [] | no_license | CREATE TABLE sa.table_gbkp_cat (
objid NUMBER,
title VARCHAR2(30 BYTE),
"RANK" NUMBER,
last_mod_time DATE,
dev NUMBER,
gbkp_cat2gbkp_set NUMBER(*,0)
);
ALTER TABLE sa.table_gbkp_cat ADD SUPPLEMENTAL LOG GROUP dmtsora1206267825_0 (dev, gbkp_cat2gbkp_set, last_mod_time, objid, "RANK", title) ALWAYS;
... | true |
e3a5c6f9f9ee6119f3b67419a147e209b54cc38d | SQL | SchlottS1/IT2351 | /Assignment3EScript.sql | UTF-8 | 977 | 4.71875 | 5 | [] | no_license | /* I used a select function to get category name, product name and quantity. I used if grouping to change the null values for category name and product name to grand total
and category total respectively. I used as functions to get the column names as Category, Product and Orders respectively. I used sum to get the tot... | true |
72abbbc180462dcfa864feb0296bee51a06b63d4 | SQL | waffle-iron/9tique-backend | /out/production/9tique-backend/import.sql | UTF-8 | 5,260 | 2.5625 | 3 | [] | no_license | INSERT INTO category(main, sub, created_at) VALUES ('OUTER', 'JACKET', CURRENT_TIMESTAMP());
INSERT INTO category(main, sub, created_at) VALUES ('OUTER', 'COATS', CURRENT_TIMESTAMP());
INSERT INTO category(main, sub, created_at) VALUES ('OUTER', 'JUMPER', CURRENT_TIMESTAMP());
INSERT INTO category(main, sub, created_at... | true |
537ffb9e8f35f26d9f571ef19605decf9042047f | SQL | neeteshbhardwaj/hunt_the_wumpus | /db/schema.sql | UTF-8 | 398 | 2.96875 | 3 | [] | no_license | CREATE DATABASE HUNT_THE_WUMPUS;
CREATE TABLE HUNT_THE_WUMPUS.PLAYERS (
EMAIL VARCHAR(100) NOT NULL,
WINS INT NOT NULL DEFAULT 0,
LOSES INT NOT NULL DEFAULT 0,
LAST_PLAYED_DATE DATE NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (EMAIL(100))
) ENGINE = InnoDB;
CREATE TABLE HUNT_THE_WUMPUS.WUMPUS... | true |
cb6ed91377a3bce7d944adc9f981e8db7526d0c0 | SQL | korvblad/SN14 | /SQL LABb/Labb1TH.sql | ISO-8859-1 | 9,255 | 4.0625 | 4 | [] | no_license | USE AdventureWorks2012;
--*** LABB 1 ***--
--1.1--
SELECT ProductID
, Name
, Color
, ListPrice
FROM Production.Product;
--1.2--
SELECT ProductID
, Name
, Color
, ListPrice
FROM Production.Product
WHERE ListPrice > 0;
--1.3--
SELECT ProductID
, Name
, Color
, ListPrice
FROM Production.Product
WHERE Co... | true |
9dab9615ec44fa97517ee89357fdbe8906de4d05 | SQL | lordmarkm/pyxis | /pyxis-app/src/main/resources/db/migration/V5__user_account.sql | UTF-8 | 995 | 3.46875 | 3 | [
"MIT"
] | permissive | CREATE TABLE `user_account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`created_by` varchar(250) DEFAULT NULL,
`created_date` datetime DEFAULT NULL,
`deleted` char(1) DEFAULT NULL,
`updated_by` varchar(250) DEFAULT NULL,
`updated_date` datetime DEFAULT NULL,
`password` varchar(255) NOT NULL,
`username` ... | true |
4de4e3bcce06833affee02ef3af2c62f5c8a97a3 | SQL | JavaScalaDeveloper/Java20190715 | /JavaWeb/src/MySQL/TeacherNotes/12-约束和分页.sql | UTF-8 | 4,754 | 4.53125 | 5 | [] | no_license | # 约束和分页
# 1. 约束(constraint)
# 约束:对表中列(或字段)的强制规定
# 常见的约束:
# 非空约束(not null)
# 唯一性约束(unique)
# 主键约束(primary key)
# 外键约束(foreign key)
# 检查约束(check)
# 默认值约束(default)
# 约束的分类:①根据约束数据列的限制:单列约束 vs 多列约束
# ②约束的作用范围:列级约束 vs 表级约束
# 通常,我们都是在create table的时候,给相应的列声明约束。
# 同时,我们还可以通过alter table 的方式,删除或添加列的约束
# 1.1 非空... | true |
04551451ab200aa896c3db98d069c810603fa6e2 | SQL | Voytella/DatabaseProject | /gamingStore_db.sql | UTF-8 | 7,123 | 3.34375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Tue Dec 4 14:15:39 2018
-- Model: New Model Version: 1.0
-- 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_M... | true |
d6a65425f1d8546421063a1cab3c091dd8ae9c41 | SQL | vsaraminev/Databases-Basics-MS-SQL-Server-09.2017 | /Exams/15 December 2016/1. Database Design.sql | UTF-8 | 1,106 | 3.9375 | 4 | [] | no_license | CREATE TABLE Locations
(
Id INT PRIMARY KEY IDENTITY,
Latitude FLOAT,
Longitude FLOAT
)
CREATE TABLE Chats
(
Id INT PRIMARY KEY IDENTITY,
Title VARCHAR(32),
StartDate DATE,
IsActive BIT
)
CREATE TABLE Credentials
(
Id INT PRIMARY KEY IDENTITY,
Email VARCHAR(30),
Password VARCHAR(20)
)
CREATE TABLE Users
(
Id INT PR... | true |
0f6711920db509e1f09b73b2f38fcabb9fc6b4c4 | SQL | pressly/goose | /tests/e2e/testdata/postgres/migrations/00003_c.sql | UTF-8 | 393 | 2.75 | 3 | [
"MIT",
"CC-BY-3.0"
] | permissive | -- +goose Up
-- +goose StatementBegin
INSERT INTO owners(owner_name, owner_type)
VALUES ('james', 'user'), ('pressly', 'organization');
INSERT INTO repos(repo_full_name, repo_owner_id)
VALUES ('james/rover', 3), ('pressly/goose', 4);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DELETE FROM... | true |
577803cf9879e3cf7008768f98a76b0e13690442 | SQL | valergrad/oraclescripts | /StatisticsHistoryWorksheet.sql | UTF-8 | 929 | 3.5 | 4 | [] | no_license | -- get retention interval
select dbms_stats.get_stats_history_availability, dbms_stats.get_stats_history_retention from dual;
-- get update time for stats
select owner
,table_name
,partition_name
,stats_update_time
from dba_tab_stats_history
where owner = :cur_user
and table_name ... | true |
39427fdad710e87179fd9550a8317619c87fdeb8 | SQL | Aleksiysh/stepic_trenager_SQL | /1.6.10.sql | UTF-8 | 1,261 | 3.859375 | 4 | [] | no_license | /*
Задание
Вывести сумму суточных (произведение количества дней командировки и размера суточных)
для командировок, первый день которых пришелся на февраль или март 2020 года.
Информацию отсортировать сначала в алфавитном порядке по фамилиям сотрудников,
а затем по убыванию суммы суточных.
*/
/*
Пояснение.
1. В SQ... | true |
abe8b912cfdf54e670b3404189ed70b8a3511af1 | SQL | ABarranco95/express_recap_and_sql_zoo | /sqloo_results.sql | UTF-8 | 5,790 | 4.1875 | 4 | [] | no_license | -- 0 SELECT basics
--1.
SELECT population FROM world
WHERE name = 'Germany'
--2.
SELECT name, population FROM world
WHERE name IN ('Sweden', 'Norway', 'Denmark');
--3.
SELECT name, area FROM world
WHERE area BETWEEN 200000 AND 250000
-- 1 SELECT name
SELECT name FROM world
WHERE name LIKE 'Y%'
-- 1.
SELECT ... | true |
2f197f986c6eb4bf5b19c939f09e918bae5f06f1 | SQL | pavdem2012/oracle_SQL | /TXT_CODE/task3.sql | UTF-8 | 3,307 | 4.40625 | 4 | [] | no_license | /*Вывести детали зёлёного и голубого цветов. Названия столбцов: "Номер", "Название", "Цвет";
Вывести детали вес которых от 12 до 16 грамм. Название столбцов: "Вес", "Город";
Вывести все записи в которых название города начинается с "Красно";
Вывести количество деталей в каждом городе. Название столбцов: "Город", "Колич... | true |
a6c05646921c5ffa6faf9f4c876d5ff035a255e7 | SQL | CollCrom/Guild-Website-Back-End | /db/migrations.sql | UTF-8 | 533 | 2.546875 | 3 | [
"MIT"
] | permissive | CREATE DATABASE guildy;
\c guildy
CREATE TABLE guild (
id SERIAL PRIMARY KEY,
name TEXT,
about TEXT,
lf_mythic TEXT,
lf_heroic TEXT,
lf_pvp TEXT,
about_mythic TEXT,
about_heroic TEXT,
about_pvp TEXT
);
CREATE TABLE mythic (
id SERIAL PRIMARY KEY,
player_name TEXT,
img_link TEXT,
note TEXT,
role TEXT
);... | true |
095e3ea9487847abbc691245d87928e50d2186f4 | SQL | hnm/formgen | /src/var/etc/formgen/install.my.sql | UTF-8 | 8,095 | 3.203125 | 3 | [
"MIT"
] | permissive | DROP TABLE IF EXISTS `formgen_bool_form_option`;
CREATE TABLE IF NOT EXISTS `formgen_bool_form_option` (
`id` int(11) NOT NULL,
`default` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `formgen_ci_dynamic_form`;
CREATE TABLE IF NOT EXISTS `form... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.