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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c312a320cb796801ca39a462aa983d866aa80072 | SQL | KwstasKaska/Database2_Ceid-BigData-Analytics- | /indexing.sql | UTF-8 | 340 | 2.828125 | 3 | [] | no_license | /*
The indexing below helps in the optimization of the first, third, fourth and sixth select query
*/
CREATE INDEX INDEX1 ON "USER02.YELPBUSINESS"(ISOPEN);
CREATE INDEX INDEX02 ON "USER02.YELPBUSINESS" (SATURDAY!='None' AND SUNDAY!='None');
CREATE INDEX INDEX03 ON "USER02.YELPBUSINESS" (OPEN24HOURS=’True’ OR SMOKI... | true |
393e70417f99b83bb76c7e06f87da2cee23345e5 | SQL | sangdon1984/sql | /SQL 기본 사용법 03 설명.sql | UTF-8 | 2,414 | 4.125 | 4 | [] | no_license | # select : 데이터베이스 테이블에서 원하는 정보를 조회하기 위한 명령어
# where 절을 사용하여 사용자가 원하는 정확한 정보만을 골라서 조회할 수 있음
# where을 사용하지 않으면 지정한 테이블의 모든 정보를 출력
# select 절의 컬럼은 원하는 이름으로 변경이 가능
# select 출려할 컬럼1, 출력할 컬럼2, 출력할 컬럼n from 테이블명 where 검색조건; - 기본형태
# select 절에 * 을 입력하면 해당 테이블의 모든 컬럼을 출력함
# where : 출력될 결과를 필터링하는 기능alter
# where 은 select, u... | true |
d2abcd6c9e4d3a43e766cf387243677cd2b4a9c1 | SQL | juancollsoler/ex.tv.player.app.v2 | /MediaPortal-1-master/Common-MP-TVE3/External/Gentle.NET/Source/Gentle.Framework.Tests/Database Scripts/PostgreSQL.sql | UTF-8 | 3,451 | 3.828125 | 4 | [] | no_license |
/* Use these scripts to create and populate the database tables required for
running the test cases included with Gentle.NET. There is a separate script
for every supported database.
The database in which these tables are created must exist. Also remember
to edit the configuration file to include the required k... | true |
0f5b8cd73f51bfef53998039933e0e8a3134a7b8 | SQL | hanuz06/LightBnB | /1_queries/3_property_listings_by_city.sql | UTF-8 | 664 | 3.609375 | 4 | [] | no_license | SELECT
properties.id,
properties.title,
properties.cost_per_night,
AVG(property_reviews.rating) as average_rating
FROM
properties
JOIN property_reviews ON property_id = properties.id
WHERE
properties.city LIKE '%Vancouver'
GROUP BY
properties.id
HAVING
AVG(property_reviews.rating) >= 4
ORDER BY
pro... | true |
677607d5cd6ea7c166f0b71f6b81a0cc2882a8d2 | SQL | openhive-network/psql_tools | /src/hive_fork_manager/context_rewind/data_schema.sql | UTF-8 | 2,507 | 4.0625 | 4 | [] | no_license | CREATE SCHEMA IF NOT EXISTS hive;
DO
$$
BEGIN
CREATE DOMAIN hive.context_name AS TEXT;
EXCEPTION
WHEN duplicate_object THEN null;
END
$$;
DO
$$
BEGIN
CREATE TYPE hive.trigger_operation AS ENUM( 'INSERT', 'DELETE', 'UPDATE' );
EXCEPTION
WHEN duplicate_object... | true |
ea880b1eec4d22a81b8f338d3e252cb3b63abf6b | SQL | DavidRutqvist/social-cookbook-api | /data/install/version4.sql | UTF-8 | 268 | 3.4375 | 3 | [] | no_license | CREATE TABLE Favorites (
UserId BIGINT NOT NULL,
RecipeId INT NOT NULL,
CreationTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (UserId, RecipeId),
FOREIGN KEY (UserId) REFERENCES Users(Id),
FOREIGN KEY (RecipeId) REFERENCES Recipes(Id)
);
| true |
cb1d3eb43a7985074560131db7cae6cb2553b2f4 | SQL | akolander22/prime_solo_joins | /joins-solutions.sql | UTF-8 | 1,246 | 4.25 | 4 | [] | no_license | 1. Get all customers and their addresses.
SELECT * FROM customers JOIN addresses ON customers.id = addresses.customer_id;
2. Get all orders and their line items.
SELECT * FROM orders LEFT JOIN line_items ON orders.id = line_items.order_id;
3. Which warehouses have cheetos?
SELECT w.warehouse FROM products AS p
JOIN w... | true |
de9db82743d98d780ec8d053c839907bf0649481 | SQL | ChunWarayut/VIP-FITNESS | /vip_fitness (4).sql | UTF-8 | 15,955 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 08, 2019 at 09:15 PM
-- Server version: 5.7.17-log
-- 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_SET_CLIEN... | true |
4e4b53cc43eca9d286b6d6b835e92596105cf2b7 | SQL | HarrisonWelch/MyHackerRankSolutions | /sql/Weather Observation Station 17.sql | UTF-8 | 318 | 3.5625 | 4 | [] | no_license | -- Query the Western Longitude (LONG_W)where the smallest Northern Latitude
-- (LAT_N) in STATION is greater than 38.7780. Round your answer to decimal places.
SELECT ROUND(LONG_W,4) FROM
(
SELECT
*
FROM
STATION
WHERE
LAT_N > 38.7780
ORDER BY
LAT_N
)
WHERE ROWNUM=1;
| true |
e36334174baa26addcecea7cbe9e905a3de30f81 | SQL | MichaelWangenstein/MAMPTutorial | /database.sql | UTF-8 | 3,668 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: May 04, 2020 at 05:53 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
622b981f7afae1989020835c4bffd338793e6ad3 | SQL | JonathanAbrego/Programacion | /FundamentosBaseDatos/308043305_Proyecto/script/TablasParqueJurasico.sql | UTF-8 | 4,246 | 3.1875 | 3 | [] | no_license | /*
* Creación de las tablas
*/
CREATE TABLE Escuela(
Clave varchar(10) PRIMARY KEY,
Nombre varchar(50) NOT NULL,
Entidad varchar(20) NOT NULL,
Localidad varchar(40) NOT NULL,
Calle varchar(40) NOT NULL,
Numero varchar(20) DEFAULT'S/N'
);
CREATE TABLE Telefono(
Clave varchar(10),
Telefono varchar(15),
FOREIGN... | true |
decf159439237f44a9813be03c49059dc2882091 | SQL | lbleal1/CS165-MP | /MP_Phase4.sql | UTF-8 | 1,115 | 4.125 | 4 | [] | no_license |
DROP DATABASE IF EXISTS leal;
CREATE DATABASE leal;
USE leal;
# -- added DDL statement
CREATE TABLE policies_(
id INT not null,
number INT not null,
week_date DATE not null,
primary key (id)
);
# -- added DDL statement
CREATE TABLE WSC_People (
wsc_id INT not null,
wsc_name varchar(50) not null,
pr... | true |
83cee9cffbfee0ecf1248764b7aab6144491cd4d | SQL | ggreenleaf/school-backup | /summer15/4347/project/CS4347-Deliverable1-JeanieHandler-GeoffreyGreenleaf/Pet_Store_Insert.sql | UTF-8 | 2,132 | 2.796875 | 3 | [] | no_license | INSERT INTO PET_STORE VALUES (10, '5555 test1 dr', '5555555555','TX', 'Allen'),
(1, '5555 test2 ln', '6666666666', 'OK', 'Oklahoma City'),
(2, '6060 test3 ln', '1111111111', 'MA', 'Boston'),
(3, '1000 drive st', '0000001111', 'MN', 'Saint Paul'),
(4, '10 park ln', '0001111234', 'TX', 'Austin'),
(5, '2020 fi... | true |
0a74a830c509e074999e5f7e1bbb3a3451742229 | SQL | ghostprotocol99/FedWireBatchFileCreator | /FedWire Batch File Creator/SQL Queries/Batches_WireSummary.sql | UTF-8 | 435 | 3.875 | 4 | [] | no_license | SELECT
Batch.BatchID,
Batch.Opened_User,
Batch.Opened_Time,
COUNT(WireMain.WireID) AS "Number of Wires",
SUM(CAST(MandatoryFields.WireAmount AS float)) AS "Total Wire Amt",
Batch.OFAC_Verified
FROM Batch
INNER JOIN WireMain
ON Batch.BatchID = WireMain.FK_BatchID
INNER JOIN MandatoryFields
ON WireMain.Wir... | true |
d7a7b2686baa10eb13020f98ff697ea90cf21f61 | SQL | vikky-lin/spiderman | /spider_monitor_database/spiderdb.sql | UTF-8 | 3,116 | 3 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | /*
Source Server Type : MySQL
Source Server Version : 50723
Source Host : localhost:3306
Source Schema : spiderdb
Target Server Type : MySQL
Target Server Version : 50723
File Encoding : 65001
Date: 07/04/2019 00:08:37
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ---... | true |
29a6a54c1b60f4d1cf9773e203bc2ab7d70e54f3 | SQL | ariefsetya/radzran_chat | /Server - Hosting/SQL/database.sql | UTF-8 | 1,487 | 2.765625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10.6
-- http://www.phpmyadmin.net
--
-- Inang: localhost
-- Waktu pembuatan: 07 Des 2014 pada 11.51
-- Versi Server: 5.5.40-cll
-- Versi PHP: 5.4.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
9d9e36299704eeec63b85042d8839e35ea1c9756 | SQL | maxmasudafarkas/assignment-01-intro-to-geographic-queries | /query08.sql | UTF-8 | 340 | 3.5 | 4 | [] | no_license | /*
Give the five most popular starting stations between 7am and 10am in 2019.
*/
-- Enter your SQL query here
SELECT
start_station,
COUNT(*) AS number_of_trips
FROM public.indego_trips_2019_q2
WHERE EXTRACT(HOUR FROM start_time) > 7 and EXTRACT(HOUR FROM start_time) < 10
GROUP BY start_station
ORDER BY number_of... | true |
dae8a55cb6b50587ba00dc3793a99f035440e2c3 | SQL | yushiwh/springboot1forspringsecurity | /db/mysql/springboot1springsecurity.sql | UTF-8 | 5,915 | 3 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50719
Source Host : localhost:3306
Source Schema : springboot1springsecurity
Target Server Type : MySQL
Target Server Version : 50719
File Encoding : 65001
D... | true |
a02517e67ce3986a7002b34be39ad5b8baa7a1c2 | SQL | p4535992/delta | /common/etc/ppa_live_merge/delta_2012-2013_to_2014/ppa_live_delta_2012-2013_to_2014_merge_imports.sql | UTF-8 | 19,374 | 3.125 | 3 | [] | no_license | drop table if exists tmp_delta_node_inheritspermissions;
drop table if exists tmp_delta_node_permission;
drop table if exists tmp_nodes_deleted_on_merge;
drop table if exists tmp_alf_namespace;
drop table if exists tmp_alf_qname;
drop table if exists tmp_import_alf_node;
drop table if exists tmp_import_alf_node_e... | true |
24e88410ba26a7f4f4b710fc1a73ece60a33bce3 | SQL | MuteBard/PostgreSQL | /restaurantv2.sql | UTF-8 | 2,179 | 4.03125 | 4 | [] | no_license | CREATE DATABASE restaurant_db2;
-- use \c <name> to load database
CREATE TABLE restaurant(
id serial primary key,
name varchar,
address varchar,
catagory varchar
);
CREATE TABLE reviewer(
id serial primary key,
name varchar,
email varchar,
karma integer,
CHECK (karma > 0 and karma <= 7)
);
CREATE TAB... | true |
917f81adc47fd0ebfac6da4adc0da637832323b2 | SQL | Evan-acg/InnoTecCommonSQL | /2017-09-20.sql | WINDOWS-1252 | 1,546 | 3 | 3 | [] | no_license | SELECT T1.MFGNUM_0,
T2.ROUNUM_0,
T3.ITMDES2_0,
T4.STU_0,
T4.CPLQTY_0,
T1.MFGTRKDAT_0,
T1.MFGTRKNUM_0,
T7.SOHNUM_0,
T9.BPCNAM_0
FROM MFGHEADTRK T1
LEFT JOIN MFGHEAD T2 ON T1.MFGNUM_0 = T2.MFGNUM_0
LEFT JOIN ITMMASTER T3 ON T2.ROUNUM_0 = T3.ITMREF_0
LEFT JOIN MFGITMTRK T4 ON T1.MFGNUM_0 = T4.MFGNUM_0
... | true |
84d7d1492eb93ba90d13e410bb21736ea4ab819d | SQL | weldi0811/projectakhir-BE | /database_ithink.sql | UTF-8 | 3,915 | 3.703125 | 4 | [] | no_license | use ithink3;
select*from product;
select*from cart;
select * from users;
select * from checkout;
select * from checkout_details;
select * from admin;
drop table admin;
alter table checkout_details add column created_at timestamp not null default current_timestamp ;
select checkout.id, checkout.order_awb, users.ema... | true |
c1ca6381e99866e4a8b81fdc789ed22697f91be2 | SQL | matthewpoletin/clickhouse-docker-dictionary | /actions.sql | UTF-8 | 683 | 4 | 4 | [] | no_license | -- Create database
DROP DATABASE IF EXISTS test;
CREATE DATABASE IF NOT EXISTS test;
-- Create first table
DROP TABLE IF EXISTS test.first;
CREATE TABLE IF NOT EXISTS test.first
(
id UInt64,
timestamp DateTime,
name String
)
ENGINE = MergeTree()
PARTITION BY toYYYYMMDDhhmmss(timestamp)
ORDE... | true |
a4c03a3a6c38c41332d432f15821cb7e694b41a7 | SQL | RafaelSantosBraz/Banco-de-Dados | /Agrupamentos/funcoes de grupo.sql | UTF-8 | 2,703 | 4.21875 | 4 | [] | no_license | -- tudo que não for função de agragação deve estar no group by
-- média
select avg (nota_final)
from aluno_na_disc;
select d.cod_curso, avg (ad.nota_final) Media_por_curso
from aluno_na_disc ad, disciplina d
where d.cod_disc = ad.cod_disc
group by d.cod_curso
order by d.cod_curso;
select d.cod_curso, d.cod_disc, avg... | true |
db23254a3840f59bc41ed6e4b6c9db49a32431a5 | SQL | RabotaDime/Delphi7-Test | /sql-examples/ADO/my-code-1.sql | UTF-8 | 1,096 | 3.90625 | 4 | [] | no_license | SELECT * FROM Customer;
/*
-- SELECT * FROM Customer -- вывод всей таблицы
-- SELECT * FROM Customer WHERE Country = "US" -- вывести только записи у которых страна = US
-- SELECT * FROM Customer WHERE Country = 'US' OR Country = 'Canada'
-- SELECT * FROM Customer WHERE Country IN ('US', 'Can... | true |
ee4df70018bbc6aca34eeacb128e54be6b65a16b | SQL | GuilhermeLaraRusso/Trybe-MySQL | /Bloco 20/Dia1/DATES.sql | UTF-8 | 1,140 | 3.984375 | 4 | [] | no_license | SELECT CURRENT_DATE(); -- YYYY-MM-DD
SELECT NOW(); -- YYYY-MM-DD HH:MM:SS
-- 30, ou seja, a primeira data é 30 dias depois da segunda
SELECT DATEDIFF('2020-01-31', '2020-01-01');
-- -30, ou seja, a primeira data é 30 dias antes da segunda
SELECT DATEDIFF('2020-01-01', '2020-01-31');
-- -01:00:00, ou seja, há 1 hora ... | true |
698626d08dd4031fd5004f923cc9aaab6c65b046 | SQL | fritids/whistlergolf | /db/development_structure.sql | UTF-8 | 11,012 | 3.25 | 3 | [] | no_license | CREATE TABLE `blog_categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `blog_posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`b... | true |
f9d9d5599157d937d86418eef3f46866914ed3f7 | SQL | pierreolivier/nodejs-url-shortener | /database.sql | UTF-8 | 1,333 | 3.484375 | 3 | [
"MIT"
] | permissive | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
CREATE DATABASE IF NOT EXISTS `url_shortener` /*!40100 DEFAULT CH... | true |
b3385999db5c3640d5bccd674fd2d0e777618936 | SQL | johnreysarabia/ToolRoomManagementSystem | /sql/toolroom.sql | UTF-8 | 2,662 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 25, 2019 at 02:41 PM
-- Server version: 10.1.34-MariaDB
-- 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... | true |
55045d70b4d8b1d4eebcd058a49defe75726ee1e | SQL | markosaur/group-grub | /db/find_user.sql | UTF-8 | 115 | 2.734375 | 3 | [] | no_license | select u.users_id, username, hash
from users u
join users_login ul on u.users_id = ul.users_id
where username = $1; | true |
d58e4668b6938d2e7fc515e909d64e945c5c12b5 | SQL | erjan/coding_exercises | /stratascratch/hard/Best Selling Item.sql | UTF-8 | 614 | 3.828125 | 4 | [
"Apache-2.0"
] | permissive | Find the best selling item for each month (no need to separate months by year) where the biggest total invoice was paid. The best selling item is calculated using the formula (unitprice * quantity). Output the description of the item along with the amount paid.
with h as(
select
*,
extract(month from invoicedate) a... | true |
8a80392355374328ff5c2df66e7f57b3cbbb34b6 | SQL | Kapok-chen/supperMarket | /system_book.sql | UTF-8 | 2,717 | 3.109375 | 3 | [] | no_license | /*
MySQL Data Transfer
Source Host: localhost
Source Database: system_book
Target Host: localhost
Target Database: system_book
Date: 2020/4/10 9:06:31
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for system_book_category
-- ----------------------------
CREATE TABLE `syst... | true |
6350a0e77df6c5032fa23879085d11d46e874830 | SQL | kyle7401/cleanbank | /src/main/resources/static/db/Dump20160318/baekmin_TB_JSERVICE.sql | UTF-8 | 2,691 | 2.859375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: cleanbank
-- ------------------------------------------------------
-- Server version 5.5.47-0+deb7u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... | true |
2772e0a947f7b24ead6d7c2956ef605ffef8a814 | SQL | dajofischer/Datacamp | /Joining_Data_in_SQL/E02_Inner_join_2.SQL | UTF-8 | 124 | 3.203125 | 3 | [] | no_license | SELECT c.code AS country_code, name, year, inflation_rate
FROM countries AS c
INNER JOIN economies as e
ON c.code = e.code;
| true |
dd8e6a18849ce59411da4bd2f3ec4e04decde625 | SQL | bzsinger/swe-study | /test-2/sql/column_calculations.sql | UTF-8 | 930 | 4.1875 | 4 | [] | no_license | /* assume tables:
Student
sID int not null, primary key
sName text
GPA float
*/
/* ------------------------------------------------------------------------ */
/* count - returns number of non-null rows
produces single value, can't use for projection */
select count(sName)
from Student
/* min - ... | true |
3978c478163e410afef67c7bdbafe909b4a40906 | SQL | 2019yq/Lims2019FB | /src/main/webapp/config/dataScripts/team_person.sql | UTF-8 | 5,607 | 2.84375 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : sample
Source Server Type : MySQL
Source Server Version : 50725
Source Host : localhost:3306
Source Schema : lims2019dba
Target Server Type : MySQL
Target Server Version : 50725
File Encoding : 65001
Date:... | true |
db9420c91470a034753e2f7b615e8df7e98b1a14 | SQL | Semantive/cassandra-trainings-scripts | /x2-ADM/adm-def_ks.cql | UTF-8 | 1,734 | 3.5 | 4 | [] | no_license | /**
* 1. Create cluster with 2 nodes
*/
-- ccm create c311_2 -v 3.11.1 -n 2 -s
/**
* 2. Create keyspace with RF = 2
*/
-- ccm node1 cqlsh
CREATE KEYSPACE IF NOT EXISTS def_ks
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 2 };
/**
* 3. Create table destination table. Turn off random re... | true |
0bcf35ac791692c9ccfb67515022ea3d701a2394 | SQL | wPaniagua/Compra-y-venta-de-toda-papada-Back | /Procedimientos/SP_INDEX_ADMIN.sql | UTF-8 | 1,193 | 2.703125 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE SP_CANTIDAD_ADMIN(
IN accion VARCHAR(45),
OUT mensaje VARCHAR(100))
SP:BEGIN
DECLARE conteo INT;
DECLARE id INT;
DECLARE tempMensaje VARCHAR(100);
SET autocommit=0;
SET tempMensaje='';
START TRANSACTION;
IF accion='' THEN
SET tempMensa... | true |
38d7560d68a7bbaa6564b28cf744d055223ef77b | SQL | JoaoAlvaroFerreira/FEUP-BDAD | /Entrega/gatilho2_verifica.sql | UTF-8 | 1,341 | 3.234375 | 3 | [] | no_license | PRAGMA foreign_keys=ON;
SELECT "#### Gatilho 2 - Verificacao - INICIO ####";
INSERT INTO QualidadeModelo VALUES ("QualidadeTeste");
INSERT INTO Marca VALUES ("MarcaTeste");
INSERT INTO Modelo VALUES ("ModeloTeste1", 50, NULL, "TipoTeste", "MarcaTeste");
INSERT INTO Modelo VALUES ("ModeloTeste2", 100, NULL, "TipoTest... | true |
7c506985379737213889ff70ef17254a9008f917 | SQL | alincc/twmicroservices | /invoice-service/src/main/resources/db/migration/V9__Added_cascade_delete_to_inoviceitem.sql | UTF-8 | 244 | 2.984375 | 3 | [] | no_license | ALTER TABLE invoicemanager.invoiceitems DROP FOREIGN KEY invoiceitems_invoices_uuid_fk;
ALTER TABLE invoicemanager.invoiceitems
ADD CONSTRAINT invoiceitems_invoices_uuid_fk
FOREIGN KEY (invoiceuuid) REFERENCES invoices (uuid) ON DELETE CASCADE; | true |
1603c6a95acc223b02421a0d25ffb87a17bcf69d | SQL | sqlbish/9dt | /Warehouse/DT_LARGE.sql | UTF-8 | 334 | 2.625 | 3 | [] | no_license | USE ROLE SYSADMIN;
CREATE OR REPLACE WAREHOUSE DT_LARGE
WITH
WAREHOUSE_SIZE = 'LARGE'
WAREHOUSE_TYPE = 'STANDARD'
AUTO_SUSPEND = 600
AUTO_RESUME = TRUE
MIN_CLUSTER_COUNT = 1
MAX_CLUSTER_COUNT = 2
SCALING_POLICY = 'STANDARD';
ALTER WAREHOUSE "DT_LARGE" SUSPEND;
GRANT OWNERSHIP ON WAREHOUSE DT_LARGE TO... | true |
6be12f3eb7c5014dae8f66e549b479d4212b68ee | SQL | karrthikmca/StudyNotesAndProjects | /OracleNotes/Exceptions.sql | UTF-8 | 1,553 | 3.6875 | 4 | [] | no_license |
select myexceptiontest from dual
create or replace function practiceexception(num number) return number as
v_name employee.empname%type;
myexception exception;
pragma exception_init(myexception,-20002);
begin
if num=1 then
select empname into v_name from employee where empcode ='novalue'; -- NO_DATA_FOUND
elsif... | true |
ae4446b82f6663cde2c120497892788bba6cdf30 | SQL | DMilmont/mode | /Mode/roadster/spaces/Team SALES OPS/Salesforce __ Dealer_Admin Errors that must be fixed.2798ada0f427/3) State doesn't match.a6915cd3e918.sql | UTF-8 | 521 | 3.765625 | 4 | [] | no_license | -- Returns first 100 rows from public.dealer_partners
SELECT sf.integration_manager "Integration Manager",
admin.State as "Admin State [please fix]",
sf.State as "Salesforce State",
admin.dpid as "Admin DPID",
admin.name as "Admin Dealer Name",
sf.status as "Salesforce Status... | true |
2ef3823b6d11a89060460140464f3d534f33b07c | SQL | mmmmm2016/PLSQL | /labs/plpu/code_ex/code_ex_11.sql | UTF-8 | 4,334 | 3.25 | 3 | [] | no_license | --This is the SQL Script to run the code_examples for Lesson 11
--Uncomment the code below to execute the code on slide 08_sa
/*
DESCRIBE USER_PLSQL_OBJECT_SETTINGS;
*/
--Uncomment the code below to execute the code on slide 09_sa
/*
SELECT name, type, plsql_code_type AS CODE_TYPE, plsql_optimize... | true |
572b34de95fb7ca9c127896b45bcef846bcb8dd0 | SQL | patriziosbr/my-app | /src/services/db/DB_captured_table.sql | UTF-8 | 559 | 2.921875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `watched` (
`id` int(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
`name` varchar(255) NOT NULL,
`watched` boolean NOT NULL,
`imgUrl` text NOT NULL,
`type` varchar(255) NOT NULL,
`created_at` timestamp,
`updated_at` timestamp
);
-- CREATE TABLE IF NOT EXISTS `captured` (
-- `id` in... | true |
0e271c51023aae5634e2beddde1f5b7182065e1a | SQL | hqottsz/MXI | /assetmanagement-database/src/upgrade/plsql/lib/liquibase/8/1/2/0/sql/opr/OPER-1611.sql | UTF-8 | 1,601 | 3.09375 | 3 | [] | no_license | --liquibase formatted sql
--changeSet OPER-1611:1 stripComments:false
--
-- Add new 0-level task classes for AD and SB (class mode = reference document).
--
INSERT INTO
ref_task_class
(
task_class_db_id, task_class_cd, bitmap_db_id, bitmap_tag, desc_sdesc, desc_ldesc, unique_bool, workscope_bool, auto_co... | true |
946fbafed8ed2eacdcb292434cca83a387b2b417 | SQL | nenerbener/cs-review | /Servers/Scripts/Script.sql | UTF-8 | 2,685 | 4.40625 | 4 | [] | no_license | use ecommerce;
-- drop the databases
DROP table orders;
DROP table customers;
DROP table products;
-- customer database
create table customers (
customer_id MEDIUMINT not null auto_increment primary key,
first_name VARCHARACTER(45),
middle_name CHARACTER,
last_name VARCHARACTER(75)
);
-- product database
create tab... | true |
8dc1becafa843c1f0200300401ebf2fa890ce91f | SQL | DimolSPA/Dimol-Fix-Carteras | /Dimol.Carteras/Dimol.Carteras.Database/dbo/Stored Procedures/Procs2/Delete_Documentos_Diarios_Estados.sql | UTF-8 | 738 | 2.6875 | 3 | [] | no_license |
Create Procedure Delete_Documentos_Diarios_Estados(@dde_codemp integer, @dde_sucid integer, @dde_anio smallint,
@dde_numdoc numeric (15), @dde_edcid integer, @dde_fecproc datetime) as
DELETE FROM documentos_diarios_estados ... | true |
8038b735d5db3bf11b6446b5135a60423387c210 | SQL | ArtsAnton/DE_hm | /data_marts/DDL.sql | UTF-8 | 3,617 | 2.875 | 3 | [] | no_license | create external table country_codes_external (
COUNTRY varchar(100),
ISO3 varchar(3),
PHONE varchar(8),
CURRENCY varchar(3)
) as copy from '/tmp/input/system_of_records/country_codes/*.parquet' parquet;
CREATE TABLE code AS SELECT * FROM country_codes_external ORDER BY COUNTRY;
CREATE EXTERNAL TABLE ... | true |
0022f1cb554bdfedcbb15883240bc6f007e0890c | SQL | phillips1021/phillips_spring_examples | /SpringJDBCExamplesExecuteBatch/src/test/resources/edu/ku/it/si/springjdbcexamples/dao/schema_test.sql | UTF-8 | 232 | 2.6875 | 3 | [] | no_license | drop table personTbl if exists;
create table personTbl (personId INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1, increment by 1) PRIMARY KEY, personFirstName varchar(50) not null, personLastName varchar(50) not null );
| true |
0ed357e77a9e425248388003a00bd380de6a66b2 | SQL | jeffrey2423/crud-nodejs | /crud-node/database/db.sql | UTF-8 | 357 | 3.0625 | 3 | [] | no_license | --creando la base de datos
CREATE DATABASE crudnode;
--utilizando la base de datos
USE crudnode;
--creando una tabla
CREATE TABLE customer(
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
address VARCHAR(100) NOT NULL,
phone VARCHAR(15)
);
--mostramos todas las tablas
SHOW TABLES;
--de... | true |
d14194cf6f86b153a575a0f1c1b0584107b65562 | SQL | polarbear611/LeetCode | /rising_temperature.sql | UTF-8 | 135 | 3.265625 | 3 | [] | no_license | select Weather.id as 'Id'
from Weather join Weather w
on datediff(Weather.date, w.date) = 1
and Weather.temperature > w.temperature;
| true |
2961347925831840fdfaf8359810d575a665ac8f | SQL | bitcoin-sv/merchantapi-reference | /src/MerchantAPI/APIGateway/APIGateway.Database/APIGateway.Database/Scripts/Postgres/08/03_AddColumnsTxTableForResubmit.sql | UTF-8 | 508 | 2.59375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | -- Copyright (c) 2022 Bitcoin Association.
-- Distributed under the Open BSV software license, see the accompanying file LICENSE
-- Add nullable PolicyQuoteId column
ALTER TABLE Tx ADD COLUMN IF NOT EXISTS policyQuoteId BIGINT;
ALTER TABLE Tx ADD COLUMN IF NOT EXISTS okToMine BOOLEAN NOT NULL DEFAULT false;
ALTER TA... | true |
f77bb102a0bb277dd31f589b095ceef77b1d8a41 | SQL | winnab/pairing-with-chucky | /data/ChinookDBQueries/query1.sql | UTF-8 | 524 | 3.8125 | 4 | [] | no_license | select
track.Name
, genre.Name as Genre
, artist.Name as ArtistName
, album.Title as AlbumTitle
, invoiceline.TrackId as InvoiceLine
, sum(case when invoiceline.TrackId is null then 0 else 1 end) as PurchaseCount
, count(invoiceline.TrackId) /* equal to sum above */
from track
inner join genre on track.GenreId ... | true |
d50e91dec13a7467b72e95ea678cace29081f0f4 | SQL | MohdAzzam/Last | /sportShop/db/sportshop.sql | UTF-8 | 8,405 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 18, 2020 at 11:37 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
2704168fe9d3e5342c90de4ebd3a22dd174c9732 | SQL | ShalaQweghen/project_sql | /6.sql | UTF-8 | 1,644 | 4.25 | 4 | [] | no_license | # http://sqlzoo.net/wiki/The_JOIN_operation
# Q1
SELECT matchid, player
FROM goal
WHERE teamid = 'GER';
# Q2
SELECT id,stadium,team1,team2
FROM game
WHERE id = 1012;
# Q3
SELECT player, teamid, stadium, mdate
FROM game JOIN goal
ON id = matchid
WHERE teamid = 'GER';
# Q4
SELECT team1, team2, player
FROM game... | true |
09c02940627acc22978fed1d33de93f3afeddb4f | SQL | NeotomaDB/Neotoma_SQL | /function/ti/getgeopolunitbyrank.sql | UTF-8 | 436 | 3.15625 | 3 | [
"MIT"
] | permissive | CREATE OR REPLACE FUNCTION ti.getgeopolunitbyrank(_rank integer)
RETURNS TABLE(geopoliticalid integer, geopoliticalname character varying, geopoliticalunit character varying, rank integer, highergeopoliticalid integer)
LANGUAGE sql
AS $function$
SELECT geopoliticalid, geopoliticalname, geopoliticalunit, rank, hi... | true |
30d2b852ff33f03fb77741382cf74a41f9086748 | SQL | Iinformatica/Canales | /Documentos pendientes de firma o visado.sql | UTF-8 | 436 | 3.015625 | 3 | [] | no_license | SELECT ex.dboid as expdboid,fs.DBOID,fs.NOMBRE_DOCUMENTO,fs.FECHA_INICIO,
fs.ASUNTO,fs.ORIGEN, fs.INTERESADO, fs.CATEGORIA, fs.ASIGNADO_A
from fwk_fsolicv fs, til_exp_expedientes ex
WHERE fs.ESTADO=2 and
ex.ejercicio||'/'||ex.numero||'-'||ex.identificador=trim((CASE WHEN INSTR(fs.origen, ' ') = 0 THEN fs.origen ELSE SU... | true |
b10a2c3574af894995b8ee81498cc7fc0ec4c97d | SQL | gintsgints/ora_if_exists | /user/create_user.sql | UTF-8 | 494 | 3.390625 | 3 | [] | no_license | DECLARE
V_COUNT INTEGER;
V_USER VARCHAR2(100);
V_PASSWORD VARCHAR2(100);
V_CURSOR_NAME INTEGER;
V_RET INTEGER;
BEGIN
V_USER := 'USERNAME';
V_PASSWORD := 'PASS';
SELECT COUNT(1) INTO V_COUNT FROM ALL_USERS WHERE USERNAME = V_USER;
IF V_COUNT = 0 THEN
V_CURSOR_NAME := DBMS_SQL.OPEN_CURSOR;
DBMS... | true |
910d79473ce36d493c55ac37c2999e0c9bfc0371 | SQL | nkahile/IUPUI_Server_Side | /GenerateSchedule.sql | UTF-8 | 956 | 3.59375 | 4 | [] | no_license | delimiter //
create or replace procedure GetScheduleCost()
begin
create or replace procedure GenerateSchedule()
begin
declare judge_num int;
declare num_judges int;
declare day date;
declare last_day date;
declare project int;
/* for each day */
select CONVERT(date, MIN(StartTime)) into day from Session;
s... | true |
fbe4c888725fa7dc254bcaa675ef683914f55991 | SQL | anjingxw/microt | /src/main/resources/sql/sysRole.sql | UTF-8 | 343 | 2.65625 | 3 | [] | no_license | DROP TABLE IF EXISTS `sysRole`;
CREATE TABLE `sysRole` (
`RoleID` int(4) NOT NULL AUTO_INCREMENT,
`CompanyID` int(4) NOT NULL,
`RoleName ` nvarchar(20) NOT NULL,EFAULT NULL,
PRIMARY KEY (`RoleID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO 'sysRole' {'RoleID', 'CompanyID','RoleName'} VALU... | true |
e12e5cbb3c564828c6891c59b97135441a73080e | SQL | fcabanilla/educacionIT | /02-introduccionBBDDSQL/clase02/sql/02-anexo.sql | UTF-8 | 4,094 | 3.34375 | 3 | [] | no_license | -- -------------
-- Anexo Parte 2
-- -------------
-- ------------------
-- Tipo de datos Enum
-- ------------------
use cursomysql;
create table postulantes(
numero int unsigned auto_increment,
documento char(8),
nombre varchar(30),
estudios enum('ninguno','primario','secundario', 'terciario','universitario'... | true |
519c0487c25b1a39d261772604f049d437fbe0bc | SQL | houssemDevs/msdn-code-gallery-community-0-9-non-alphabetic | /3 Tier ASP.NET C# ADO/[C#]-3 Tier ASP.NET C# ADO/C#/SQL Query/AspNet_CSharp_3T.sql | UTF-8 | 1,029 | 3.671875 | 4 | [
"Apache-2.0"
] | permissive | create database AspNet_CSharp_3T;
use AspNet_CSharp_3T;
create table product(
Id int identity(100, 1) primary key,
Name varchar(100),
Price decimal(10,2),
Stock Int
);
CREATE PROCEDURE sp_Product_Insert(
@name varchar(100),
@price decimal(10,2),
@stock Int)
AS
BEGIN
INSERT INTO product (Name, Price, Stock) VALU... | true |
53849bd6f80ecd3427aed64d5304252578e81d1e | SQL | ThriledLokki983/dev | /web-dev/cs50/intro-comp-science/Problem-sets/pset7/movies/9.sql | UTF-8 | 155 | 3.3125 | 3 | [] | no_license | SELECT name
FROM people
WHERE id IN (
SELECT DISTINCT(person_id)
FROM stars
WHERE movie_id IN (
SELECT id
FROM movies
WHERE year is 2004))
ORDER BY birth;
| true |
081269eed55792a5040928c4974d21bf8deee265 | SQL | xueyou2000/dubbo-study | /customer/customer-server/src/main/resources/schema/customer-server-schema.sql | UTF-8 | 1,311 | 3.21875 | 3 | [] | no_license | /*==============================================================*/
/* DBMS NAME: MYSQL 5.0 */
/* CREATED ON: 2020/09/27 星期日 15:32:42 */
/* UPDATE ON: 2020/09/27 星期日 15:32:42 */
/*======================================================... | true |
b44e37c2eb09fa72355f956cd9c6e7173b5cadfd | SQL | IrsyadProject/Kamus-With-Login-Irsyad | /kamus.sql | UTF-8 | 1,745 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 12, 2018 at 06:04 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
c8810e649800a1b6ae2478752f272a537a98e372 | SQL | tdevine1/PMAP | /Prototypes and Outdated Material/queries/answerExsistanceQuery.sql | UTF-8 | 160 | 2.734375 | 3 | [] | no_license | #returns 1 if UCA and assesmentName combination is located #
Select if( uca is not null , 1, 0) as NewResult
From answers
where uca = ? and assessmentName = ?
| true |
a9e8b5ae84e7c44d2799f856d34d1eedd5d55538 | SQL | Talentica/HungryHippos | /vagrant_automation_hadoop_spark/ddl/old/V1__setup_initial_tables.sql | UTF-8 | 3,358 | 3.625 | 4 | [
"Apache-2.0"
] | permissive | CREATE DATABASE IF NOT EXISTS hungryhippos_tester;
CREATE TABLE `hungryhippos_tester`.`user` (
`user_id` INT NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(45) NOT NULL,
`last_name` VARCHAR(45) NOT NULL,
`email_address` VARCHAR(45) NOT NULL,
`password` VARCHAR(15) NOT NULL,
PRIMARY KEY (`user_id`));
CR... | true |
a1d8d3c9bea4542c28c855da7dda245bc6a1e774 | SQL | alexdgarland/spring-in-action | /taco-cloud/src/main/resources/data.sql | UTF-8 | 683 | 2.734375 | 3 | [] | no_license |
INSERT INTO ingredient (ingredient_id, ingredient_name, ingredient_type)
VALUES
('FLTO', 'Flour Tortilla', 'WRAP'),
('COTO', 'Corn Tortilla', 'WRAP'),
('GRBF', 'Ground Beef', 'PROTEIN'),
('CARN', 'Carnitas', 'PROTEIN'),
('TMTO', 'Diced Tomatoes', 'VEGGIES'),
('LETC',... | true |
63266df36413a9e007626bf20d00ead5e6d57eb3 | SQL | sunny0826/pipeline-example-maven | /src/main/java/com/springsource/greenhouse/database/upgrade/v3/CreateUserConnectionTable.sql | UTF-8 | 503 | 2.921875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | drop table UserConnection if exists;
create table UserConnection (userId varchar not null,
providerId varchar not null,
providerUserId varchar,
rank int not null,
displayName varchar,
profileUrl varchar,
imageUrl varchar,
accessToken varchar not null,
secret varchar,
re... | true |
7ae7e217cdd8656a425ef276a043fd8a941ba4a6 | SQL | randallhelms/other_courses | /BigQuery/array_struct_example.sql | UTF-8 | 422 | 4.125 | 4 | [] | no_license | WITH TitlesAndScores as (
SELECT
ARRAY_AGG(STRUCT(title,score)) AS titles,
EXTRACT(DATE FROM time_ts) as date
FROM `bigquery-public-data.hacker_news.stories`
WHERE score IS NOT NULL
AND title IS NOT NULL
GROUP BY date)
SELECT date,
ARRAY(SELECT AS STRUCT title, score
FROM UNNEST... | true |
3a7e43ec9f6f57364edcf02f3fbb586cbab9fef6 | SQL | michaelcunningham/oracledba | /admin/post_restore/ExtractVistaAdminData.sql | UTF-8 | 7,412 | 2.921875 | 3 | [] | no_license | /********************************************************************************/
/* Requires parameters (in this order) */
/* DatabaseName (e.g. combodev) */
/* schema name (e.g. vistaprd) ... | true |
7ae75e3b7d9731a6549291f29ba7486015c66131 | SQL | Kinnect/Salary_Analysis | /SQL_3.sql | UTF-8 | 370 | 4.15625 | 4 | [] | no_license | SELECT
e.gender,
d.dept_name,
ROUND(AVG(s.salary),2) as salary,
YEAR(s.from_date) as calender_year
FROM
t_salaries s
JOIN
t_employees e ON s.emp_no = e.emp_no
JOIN
t_dept_emp de ON de.emp_no = e.emp_no
JOIN
t_departments d ON d.dept_no = de.dept_no
GROUP BY d.dept_no, e.gender, calender_year
... | true |
47557479902329de720417ff7466266de7c2e1d5 | SQL | vSzemkel/Manam | /PostScript/TQx2019/CreateTQx_2019.sql | WINDOWS-1250 | 17,018 | 2.75 | 3 | [] | no_license | --@d:\Velvet\PS\Paginy\TQx2019\CreateTQx_2019.sql
declare
vfun_xx number;
vmak_xx number;
vtyp_xx number;
vdrw_xx number;
vis_wzorzec number := 0;
vnazwa_typu varchar2(64) := 'TQx-2019';
vnazwa_paginy varchar2(32) := '>Reklama';
vnazwa_produktu varchar2(6) := 'TQB BY';
vnaglowek varchar2(15) ... | true |
af7b2982d0a6c76ca7e7aeaf402aea6d78a76a47 | SQL | PORTAFOLIO-PROYECTOS/SISTEMA_ADMINISTRACION_ESCUELA | /scripts/TABLE_Schools.sql | UTF-8 | 203 | 2.625 | 3 | [
"MIT"
] | permissive | create table Schools(
school_id int,
addres_id int foreign key references Addresses(address_id),
school_name varchar(500),
school_principal bit,
other_school_details varchar(max)
primary key(school_id)
) | true |
65bdfb9945d0034134a81770cac4b22dc81c6785 | SQL | BrenoHM/training-system | /amppl450_training_system.sql | UTF-8 | 34,928 | 2.8125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : AMPPLIE
Source Server Version : 50641
Source Host : 108.179.253.175:3306
Source Database : amppl450_training_system
Target Server Type : MYSQL
Target Server Version : 50641
File Encoding : 65001
Date: 2019-02-08 10:42:12
*/
SET FOREIG... | true |
1713041aa44579cd6cbc80d536d8de6c3f401fe6 | SQL | MatthewHird/2019Spring | /csci311/greysiteProject/database/sql/greysiteER Create.ddl | UTF-8 | 2,888 | 3.515625 | 4 | [] | no_license | CREATE TABLE AccountPermission (
account_type_id tinyint(1) NOT NULL,
permission_id tinyint(1) NOT NULL,
PRIMARY KEY (account_type_id,
permission_id));
CREATE TABLE AccountType (
account_type_id tinyint(1) NOT NULL,
account_type_name tinytext NOT NULL,
PRIMARY KEY (account_type_id));
CREATE TABLE... | true |
9513b6a175884c790b048dc477428bcaafd32998 | SQL | Egor420/Egor_Shirokikh | /DB_1.sql | UTF-8 | 6,348 | 4.21875 | 4 | [] | no_license | --Однотабличные запросы
--1
select st.name, st.surname
from students st
where st.score>=4 and st.score<=4.5;
select st.name, st.surname
from students st
where st.score between 4 and 4.5;
select st.name, st.surname
from students st
where not st.score<4 and not st.score>4.5;
--2
select st.name, st.sur... | true |
8e1ac7e7a259baf377d3ec08048e2001966dd5a3 | SQL | NikolayShaliavski/SoftUni | /02.Databases_Fundamentals_2016/01.Databases_Basics/08.MySQL_Exam_Preparation/Bank _Database_Script.sql | UTF-8 | 16,086 | 3.140625 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.15-log - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.3.0.4984
-- --------------------------------------------------------... | true |
be230e72d9d3e46347885723dc142e250da1b128 | SQL | Mahesh-j-hub/Web-developer-task-1 | /bank_system.sql | UTF-8 | 2,299 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 07, 2021 at 12:54 PM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 8.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
edfb9857d0dea0cafed2de7268dc99131a5c925b | SQL | NazmulHossain24/agriculture | /agriculture.sql | UTF-8 | 22,266 | 3.140625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 03, 2018 at 11:26 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
7f8ffbb5a0c6959cf78dc713bdd7bec5ffc13d31 | SQL | Vyper333/Fee_Management | /FeePayment/FeePayment/SQLQuery2.sql | UTF-8 | 685 | 2.703125 | 3 | [] | no_license |
create table NewStudent(
NAID int NOT NULL IDENTITY(1,1) primary key,
rollno varchar(10) not null,
stuname varchar(250) not null,
dept varchar(250) not null,
yr varchar(50) not null,
sem varchar(10) not null,
div varchar(10) not null,
yoa varchar(50) not null,
sex varchar(50) not null,
guarname varchar(25... | true |
02e166f326bdf49ef9a8d9fcf1aa58bfcc5d4e2e | SQL | FSandroK/Accessori_Auto | /Accessori_Auto/SQL/Accessori_Auto.ddl.sql | UTF-8 | 1,002 | 3.71875 | 4 | [] | no_license | DROP DATABASE IF EXISTS ACCESSORI_AUTO;
CREATE DATABASE ACCESSORI_AUTO;
USE ACCESSORI_AUTO;
CREATE TABLE Automobile(
Id INT AUTO_INCREMENT PRIMARY KEY,
Casa_Automobilistica VARCHAR(16) NOT NULL,
Modello VARCHAR(16) NOT NULL,
Anno YEAR NOT NULL,
Numero_Porte INT NOT NULL,
CHECK( Numero_Porte IN... | true |
053738af3bb98b55f2bd134ac3ba45ffc7e77d9b | SQL | crislargo/PruebaCristian | /database/prueba.sql | UTF-8 | 3,337 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 27-03-2021 a las 04:03:08
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.2.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... | true |
1e2cbdbf2d4ff4b34ced8b1ba353d6ea9a5ebbc7 | SQL | Juanpablocede/Scripts | /nomina (SNO)/sigesp_SNO/script_asignacion_concepto_personal.sql | UTF-8 | 963 | 3.59375 | 4 | [] | no_license | SELECT
sno_constantepersonal.codper,
RTRIM(sno_personal.apeper)||' '||RTRIM(sno_personal.nomper) AS nombres,
sno_constantepersonal.codcons,
sno_concepto.nomcon,
sno_constantepersonal.moncon,
sno_conceptopersonal.aplcon,
sno_constantepersonal.codnom
FROM
sno_constantepersonal,
sno_conceptopersonal,
sno_conce... | true |
380c23f42a0c65ed99a0dfe4d0cd961ceb3f273e | SQL | southpolekat/tpch_dg | /load/count_tables.sql | UTF-8 | 505 | 2.6875 | 3 | [] | no_license | -- Usage:
-- psql tpch -f count_tables.sql -v schema=tpch_zlib
\set ON_ERROR_STOP on
SET search_path = :schema;
select 'region', count(*) from :schema.region;
select 'nation', count(*) from :schema.nation;
select 'customer', count(*) from :schema.customer;
select 'supplier', count(*) from :schema.supplier;
select ... | true |
271c366510048931db2b0fe2f5b3cbb85a30f3d8 | SQL | salirajr/xpert | /xeai/nightly/eai/eai-xyscrib/pglistener-tgr/tgr_rms_aircraft_stand_parking_op.sql | UTF-8 | 1,937 | 2.9375 | 3 | [] | no_license | /* CREATION */
CREATE TRIGGER after_delete_rms_aircraft_stand_parking_op AFTER DELETE ON "public"."rms_aircraft_stand_parking_op" FOR EACH ROW EXECUTE PROCEDURE notify_after_delete();
CREATE TRIGGER after_insert_rms_aircraft_stand_parking_op AFTER INSERT ON "public"."rms_aircraft_stand_parking_op" FOR EACH ROW EXECUTE ... | true |
011fa0af7b04a9e22b1d306553b6b340b7df33d5 | SQL | aidanmccoy/Databases_Lab_5 | /AIRLINES/AIRLINES-setup.sql | UTF-8 | 694 | 3.609375 | 4 | [] | no_license | -- aimccoy
CREATE TABLE Airlines (
Id INTEGER NOT NULL PRIMARY KEY,
Airline VARCHAR(22),
Abbreviation VARCHAR(13),
Country VARCHAR(5)
);
CREATE TABLE Airports (
City VARCHAR(22),
AirportCode VARCHAR(6) NOT NULL PRIMARY KEY,
AirportName VARCHAR(50),
Country VARCHAR(16),
CountryAbbrev VARCHAR(5),
UNIQUE (Airp... | true |
60d9fda627412ba7c4228a482e97d6049b3a8e6a | SQL | chib31/quackstats-sba | /database/FixturePatches/2019/railway_taverners.sql | UTF-8 | 5,534 | 3.1875 | 3 | [] | no_license | WITH t AS (
SELECT t.id FROM team t WHERE name = 'Plastics CC'
),
f AS (INSERT INTO fixture VALUES
(default,(SELECT id FROM t),'2019-06-02',(SELECT id FROM team WHERE LOWER(name) LIKE '%railway taverners%'),1,'North Middlesex CC','Limited Overs',40,default,null,FALSE,(SELECT id FROM result_type WHERE name = 'lost'... | true |
4801744e3e8851312e293b00c8f6b10fbc2ec0bb | SQL | Arsenii020194/lexus | /db/2-data.sql | UTF-8 | 1,634 | 2.9375 | 3 | [] | no_license | insert into list.group (id, code, name)
values (1, 'ADMIN', 'ADMIN');
insert
into list.group (id, code, name)
values (2, 'TRAINER', 'TRAINER');
insert into list.group (id, code, name)
values (3, 'USER', 'USER');
insert into md."user" (id, date_birth, id_group, image, name, "password")
values (1, cast('1994-01-02' as da... | true |
5a4523ddea1825fbb630dc548d6c298032e4669b | SQL | Tariod/kpi-labs | /course_03/olap/lab_01/solution/ip71_mykhailov_lab_01_build_market.sql | UTF-8 | 16,309 | 3.890625 | 4 | [
"MIT"
] | permissive | CREATE TYPE CUSTOMER_CONTACT_TYPE AS ENUM (
'Email',
'Telephone number'
);
CREATE TYPE EMPLOYEE_CONTACT_TYPE AS ENUM (
'Email',
'Telephone number'
);
CREATE TABLE discounts (
"Id" VARCHAR(13) UNIQUE,
"Status" BOOLEAN DEFAULT false,
"Discount" ... | true |
dcdc58e8f44909c699a1ceb197ff131c94bfbb0b | SQL | JeaWoonLee/lohyup | /lohyup_sql_script/schema/market/category/SECOND_CATEGORY.sql | UTF-8 | 5,747 | 3.5 | 4 | [] | no_license | DROP TABLE SECOND_CATEGORY;
CREATE TABLE SECOND_CATEGORY(
FIRST_CATEGORY_NO NUMERIC(10),
SECOND_CATEGORY_NO NUMERIC(10),
CATEGORY_NAME VARCHAR(100),
CATEGORY_KOR_NAME VARCHAR(100),
CONSTRAINT PK_SECOND_CATEGORY
PRIMARY KEY (SECOND_CATEGORY_NO, CATEGORY_NAME),
CONSTRAINT FK_SECOND_CATEGO... | true |
f8ffcd907225611b4976987726ea10a5feb561b3 | SQL | KodakBrax/CS50 | /pset7/movies/9.sql | UTF-8 | 155 | 3.359375 | 3 | [] | no_license | SELECT DISTINCT(name) FROM people WHERE id IN
(SELECT person_id FROM stars WHERE movie_id IN
(SELECT id FROM movies WHERE year = 2004))
ORDER BY birth; | true |
33bb864ddda533e5064aab446147919ba3031a31 | SQL | STRVIRTU/tcc-2017 | /banco/projetol_tcc.sql | UTF-8 | 11,421 | 3.4375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 29-Nov-2017 às 03:21
-- Versão do servidor: 10.1.22-MariaDB
-- PHP Version: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
d0a5d0995acc339ca25606b9e4a33a847a2f6ab1 | SQL | gzuSeepen/SQL-_postgresql- | /SQL_ClassicalCases_ch12-Apendix.sql | UTF-8 | 2,954 | 4.5 | 4 | [] | no_license | ----------------ch12-------------
-- 把若干行直接合成一行(列转行)
select
sum(case when deptno=10 then 1 else 0 end) as deptno_10, -- 直接统计出现的次数
sum(case when deptno=20 then 1 else 0 end) as deptno_20,
sum(case when deptno=30 then 1 else 0 end) as deptno_30
from emp;
group by deptno;
-------把结果集转化为多行
select m... | true |
68684d113e46041f5aaf70529c73c16b7fb5f62b | SQL | tptarun/dbt_5X | /models/Death_Rate.sql | UTF-8 | 260 | 3.046875 | 3 | [] | no_license | CREATE TABLE Death_Rate AS
(SELECT
Location, SUM(Total_Deaths/Population)*100 Death_Rate
FROM
FIVETRAN_INTERVIEW_DB.GOOGLE_SHEETS.COVID_19_INDONESIA_TARUN_PRAJAPATI
WHERE NOT Location = 'Indonesia'
GROUP BY Location
ORDER BY Death_Rate DESC
)
| true |
c0871feb76cc22f0faa08e360ee2510a7f40266a | SQL | AmulyaProdduturi/HospitalManagement | /sql scripts/table creation script.sql | UTF-8 | 293 | 2.59375 | 3 | [] | no_license |
Create Table PatientDetails(
patient_id int(30) NOT NULL AUTO_INCREMENT PRIMARY KEY,
Password VARCHAR(50) NOT NULL,
patientName Varchar(50),
Gender varchar(10),
DOB DATE,
Age int(10),
Mobile Varchar(30),
Email varchar(30) unique,
maritalstatus varchar(10));
select * from PatientDetails;
| true |
9d6bfe6cffd0ca35d022fdf248600b0bd4afc6f5 | SQL | payals/mysql2plpgsql | /func.sql | UTF-8 | 799 | 3.484375 | 3 | [] | no_license | #test
delimiter //
CREATE PROCEDURE simpleproc (OUT param1 INT)
BEGIN
SELECT COUNT(*) INTO param1 FROM t;
END//
#ignore
<some code then comment> # mysql function
DELIMITER $func$
CREATE FUNCTION hello_world()
RETURNS text
LANGUAGE sql
BEGIN
# sample query
SELECT name from test where `lastname` = "singh";
... | true |
999bae7a31ebb23da65fcdbe4adff4edc75212b1 | SQL | kbmg28/ws-pessoa | /src/main/resources/data.sql | UTF-8 | 8,250 | 3.140625 | 3 | [] | no_license | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
drop table if exists pessoa_fisica;
drop table if exists pessoa_juridica;
drop table if exists email;
drop table if exists endereco;
drop tab... | true |
7f9ce9611ee69852028d6ce80b5bbb7b254e9dd2 | SQL | NachiMK/mssql | /DBA/MDF File Sizes.sql | UTF-8 | 259 | 3.0625 | 3 | [] | no_license | SELECT DatabaseName = DB_NAME(database_id)
--,physical_name
,SizeInGB = SUM(( ( size * 8 ) / 1024.00 ) / 1024.00)
FROM sys.master_files
WHERE database_id > 4
AND type = 0
GROUP BY
DB_NAME(database_id)
ORDER BY
DB_NAME(database_id)
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.