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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
48949571148160b43714da9981a8be4e71ae1ff5 | SQL | pinardy/Booklink | /sql_codes.sql | UTF-8 | 2,959 | 4 | 4 | [] | no_license | # Find "# Check" to find the positions that needs to be checked
# Find "# TODO" to find work undone
# Check how should we store the id? Should we use CHAR or INT, currently it uses VARCHAR
# VARCHAR is more efficient if there is no need for numeric operations
# TODO implementation of cardinality within the script
# CH... | true |
952da7a228c49a48ebcffeaf56ae5902b8e02b80 | SQL | rsanttos/bancodedados-sql | /Questão_01-4.sql | UTF-8 | 206 | 3.75 | 4 | [] | no_license | SELECT e.fname, e.minit, e.lname FROM company.employee e
INNER JOIN company.works_on wo
ON e.ssn = wo.essn
GROUP BY e.ssn
HAVING count(e.ssn) = (SELECT COUNT(DISTINCT p.pnumber) FROM company.project p); | true |
1005103f280d8f2110e363f36037e31530d25f8e | SQL | landpeople/landpeople | /Scripts/sketchbook.sql | UTF-8 | 5,533 | 4.03125 | 4 | [] | no_license | -- 스케치북 관련 쿼리
CREATE TABLE LPSKETCHBOOK(
SKETCH_ID VARCHAR2(20),
USER_EMAIL VARCHAR2(50),
SKETCH_TITLE VARCHAR2(50),
SKETCH_THEME VARCHAR2(20),
SKETCH_SHARE CHAR(1),
SKETCH_DELFLAG CHAR(1),
SKETCH_BLOCK CHAR(1),
SKETCH_SPATH VARCHAR2(100),
);
CREATE TABLE LPUSER(
USER_EMAIL VARCHAR2(50) NOT NUL... | true |
5f4e87460b6acb0375bc32d813ff2032a4e9295b | SQL | Z0etrope/FIT3171--Database-SQL | /Tuts/Tut08/week8_sqlbasic_part_b.sql | UTF-8 | 3,491 | 4.15625 | 4 | [] | no_license | SPOOL week8_sqlbasic_part_b_output.txt
/* 1.List all the unit codes, semesters and names of chief examiners for all the units that are
offered in 2020. Order the output by semester then by unit code.
*/
SELECT
o.unitcode,
semester,
stafffname,
stafflname
FROM
uni.offering o
JOIN uni... | true |
4e21c624f8e36986f8069c8b97c9627504ecc123 | SQL | juanOspina13/plsql-files | /Estandares/Estandares/OSS/Plantillas/Product/Nombre_Modulo/server/sql/02tbls/nombreTabla/04fkey/crFK_NombreCortoTablaOrigen_NombreCortoTablaDestinoNN.sql | ISO-8859-3 | 933 | 3.015625 | 3 | [] | no_license | --
-- Propiedad intelectual de OPEN International Systems Ltda
--
-- Archivo : crFK_<TablaOrigen>_<TablaDestino><NN>.sql
-- Autor : <Nombre Apellido del Autor> ( Autor inicial del archivo )
-- Fecha : <DD-MM-YYYY HH24:MI:SS> ( Fecha creacin )
--
-- Descripcion : Creacion de llave foranea tabla <... | true |
323fc6f51923ccaf94697229c5cd01bdcb36572e | SQL | lucyclevelromeeler/ezmodeler-svn-to-git | /branch/webapp/src/app/installation.sql | UTF-8 | 18,767 | 3.484375 | 3 | [] | no_license | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `mydb`;
-- ----------------------------... | true |
2e8052e7bc633ebc4205bc07653d371090774a00 | SQL | shaque21/studentManagementSystem.github.io | /database/student_management.sql | UTF-8 | 3,025 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 01, 2020 at 07:40 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.3.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
d759bf9b67801e2ad6b745d4ae7f65534eea9df7 | SQL | yanoandri/SalesOrder-Pro | /PFSHelper.DataAccessLayer/dbFrameworkPFS/dbFrameworkPFS/dbo/Stored Procedures/uspPSC_ExceptionFormList.sql | UTF-8 | 4,063 | 3.390625 | 3 | [] | no_license |
/***********************************************************************************************************************
Copyright (c) 2015 PT Profescipta Wahanatehnik. All Rights Reserved.
This software, all associated documentation, and all copies
DESCRIPTION
Name : uspPSC_ExceptionFormList
Desc ... | true |
6f6d645666ef02693d28d4161b19ee807ee30ed0 | SQL | beaulirl/photoalbum | /photoalbum.sql | UTF-8 | 2,733 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Мар 20 2016 г., 18:57
-- Версия сервера: 5.6.24
-- Версия PHP: 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 */;
/*!40... | true |
08568708d213a6129628703d774018e571974790 | SQL | tomseng/Mission1-Registre-de-WebService | /BDD/mission1bdd.sql | UTF-8 | 1,192 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Ven 20 Mai 2016 à 15:31
-- Version du serveur : 10.1.10-MariaDB
-- Version de PHP : 7.0.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... | true |
8991205f2dc5853d380c23c10bc84c81e49f7599 | SQL | HyunupKang/StudySQLServer | /210518/Test3.sql | UHC | 282 | 3.109375 | 3 | [] | no_license | SELECT b.Idx
, CONCAT(' : ', b.Names) AS Names
, CONCAT(' > ', b.Author) AS Author
, FORMAT(b.ReleaseDate,'yyyy MM dd') AS ''
, b.ISBN
, CONCAT(FORMAT( b.Price, 'N0', 'en-us'), '') AS ''
FROM bookstbl AS b
ORDER BY b.Idx DESC
| true |
a54c41ab22a2e7684703ee2791e6059ed07b3e63 | SQL | ManuelPrandini/SanitarySystemProject | /DBScripts/HospitalDB_190619_113002.sql | UTF-8 | 5,586 | 3.3125 | 3 | [] | no_license | -- Group [Group]
create table `group` (
`oid` integer not null,
`groupname` varchar(255),
primary key (`oid`)
);
-- Module [Module]
create table `module` (
`oid` integer not null,
`moduleid` varchar(255),
`modulename` varchar(255),
primary key (`oid`)
);
-- User [User]
create table `user` ... | true |
bd99d998720f3c62b0a8b0ea56c7fc687135be20 | SQL | Bouyonteknolojik/kamizay | /000 DB/2018.03.11.dev.kamizay.sql | UTF-8 | 5,287 | 3.0625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Mar 11, 2018 at 07:14 AM
-- Server version: 5.7.19
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
f0b86636883ebb02bf4d6c278915c92464a0d84c | SQL | as12334/xy-creditbox | /tools/i8nSql/新增新语言站点前.sql | UTF-8 | 1,575 | 3.34375 | 3 | [] | no_license | /**
* 以下脚本均在gb-companies库, 请注意修改对应语言(语言代号,货币代号)
*/
-- 字典:支持货币
INSERT INTO sys_dict ("module", "dict_type", "dict_code", "order_num", "remark", "parent_code", "active")
SELECT 'common', 'currency', 'JPY', '4', '货币代码:JPY日元', NULL, TRUE WHERE NOT EXISTS (SELECT "id" FROM sys_dict WHERE dict_type = 'currency' AND dict_co... | true |
e2a544ca5c29b40e58aa120c6afbe62dd2732f68 | SQL | pedrobonifacio/api_favoriteBooks | /database/createDB.sql | UTF-8 | 334 | 3.296875 | 3 | [] | no_license | create database book;
use book;
CREATE TABLE tb_book (
cd_book INT NOT NULL AUTO_INCREMENT,
vl_rankPosition INT NOT NULL unique,
nm_book VARCHAR(300) NOT NULL,
url_bookCover VARCHAR(2000) NOT NULL,
PRIMARY KEY (`cd_book`)
)ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;
select * from tb_book
order by vl_ran... | true |
73bc68626cc74c35242571999f8a6d9eba5fab84 | SQL | nss-day-cohort-18/chinook-taylorperkins | /line_item_track_artist.sql | UTF-8 | 304 | 3.8125 | 4 | [] | no_license | /*
Provide a query that includes the purchased track
name AND artist name with each invoice line item.
*/
SELECT t.Name TrackName, a.Name ArtistName
FROM InvoiceLine il, Track t, Artist a, Album al
WHERE il.Trackid = t.TrackId
AND t.AlbumId = al.AlbumId
AND al.ArtistId = a.ArtistId
ORDER BY a.Name | true |
e0802153b2b40d70a140c12344a371f5dee46e78 | SQL | lehdarren/PL-SQL | /Cursors2.sql | UTF-8 | 465 | 3.328125 | 3 | [] | no_license | DECLARE
lv_total bb_basket.total%TYPE;
BEGIN
SELECT total
INTO lv_total
FROM bb_basket
WHERE idBasket = 17; --throws error
IF SQL%ROWCOUNT > 0 THEN
DBMS_OUTPUT.PUT_LINE('The total is: ' || lv_total);
ELSIF SQL%NOTFOUND THEN
DBMS_OUTPUT.PUT_LINE('Co... | true |
885be3f2a414bd1e66ec44f1ddcfcee074da457e | SQL | TihomirIvanovIvanov/SoftUni | /C#DBFundamentals/DB-Basics-MS-SQL-Server/04BuiltInFunctions/BuiltInFunctions/12. Games From 2011 and 2012 Year.sql | UTF-8 | 145 | 3.53125 | 4 | [
"MIT"
] | permissive | SELECT TOP 50 Name, FORMAT(Start, 'yyyy-MM-dd') AS Start
FROM Games
WHERE YEAR(Start) BETWEEN '2011' AND '2012'
ORDER BY Games.Start, Games.Name | true |
827117a1d4f2ceaa31cfec3b2b2174ad1efdeb55 | SQL | Dungcode/Railway19 | /SQL/Assignment 1/Testing_System_Assignment_2.sql | UTF-8 | 8,825 | 3.921875 | 4 | [] | no_license | -- Testing_System_Assignment_2
-- =============>>> Question 1: Tối ưu lại assignment trước ====================
-- =============>>> Question 2: Thêm các constraint vào assignment trước =======
DROP DATABASE IF EXISTS TESTINGMANAGEMENT;
CREATE DATABASE TESTINGMANAGEMENT;
USE TESTINGMANAGEMENT;
-- TABLE 1: Department... | true |
c52ec061d794dbd1b08af479884c872ddd7968d5 | SQL | DeserveL/taotao | /taotao-dao/src/main/resources/sql/tb_item_desc(商品描述).sql | UTF-8 | 575 | 3.09375 | 3 | [] | no_license | SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for tb_item_desc
-- ----------------------------
DROP TABLE IF EXISTS `tb_item_desc`;
CREATE TABLE `tb_item_desc` (
`item_id` bigint(20) DEFAULT NULL COMMENT '商品ID',
`item_desc` text COMMENT '商品描述',
`created` TIMESTAMP NOT NULL DEFAULT ... | true |
42590f57136b47297378c29f2008290e7ec3ff5b | SQL | DavidAlphaFox/casino_server | /game_server/db/create_table_smxx/task_daily.sql | GB18030 | 957 | 3.359375 | 3 | [] | no_license | -- ----------------------------
-- Table structure for `task_daily`
-- ----------------------------
DROP TABLE IF EXISTS `task_daily`;
CREATE TABLE `task_daily` (
`uid` bigint(20) NOT NULL DEFAULT 0 COMMENT 'id' ,
`type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '' ,
`state` tinyint(4) NOT NULL DEFAULT 0 COMMENT '״̬' ,
... | true |
18b12e865b1adc467e6cda67a3d26dacd8f875fc | SQL | TAAPArthur/SouthwestBot | /Install/Southwest.sql | UTF-8 | 4,148 | 3.78125 | 4 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 28, 2017 at 01:14 AM
-- Server version: 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";
CREATE USER 'south... | true |
c0feb3a057d5546431c579cb95d5c3924245a215 | SQL | acoussemaeker/BibliothequeAudio | /Autre/BDD/bibliothequeaudio.sql | UTF-8 | 3,406 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Jeu 01 Octobre 2015 à 14:26
-- Version du serveur : 5.6.17
-- Version de PHP : 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_... | true |
8f23efe0fe1f7a89cfc4d8674567c552a8e95620 | SQL | mehedisayed/Laravel_Project | /sql/laravelproject.sql | UTF-8 | 7,811 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 26, 2020 at 07:10 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
bc007a9d6f447f3f189bcf9d1bdc5002dc716f62 | SQL | ahnan4arch/blimp | /ddl/file_elements.ddl | UTF-8 | 402 | 2.8125 | 3 | [] | no_license | CREATE TABLE file_elements (
file_id INTEGER PRIMARY KEY,
location_id INTEGER NOT NULL REFERENCES indexed_locations(location_id) ON UPDATE RESTRICT ON DELETE RESTRICT,
content_id INTEGER NOT NULL REFERENCES file_contents(content_id) ON UPDATE RESTRICT ON DELETE RESTRI... | true |
190daedb681b7d23dbc11e2f84d62c230fcd51d3 | SQL | LannyYao/partition | /src/main/resources/db/migration/V1_3__key.sql | UTF-8 | 285 | 2.921875 | 3 | [] | no_license | create table IF NOT EXISTS user_key_partition(
id int,
name varchar(10),
PRIMARY KEY (id)
)
PARTITION BY KEY()
PARTITIONS 2;
-- 基于给定的分区个数,将数据分配到不同分区,HASH分区只能对整数进行分区,对于非整型字段只能通过表达式转为整型 | true |
e322eef3b6c9f03e9c743d2430ff3e239b51de31 | SQL | eeszy/movie-website | /queries.sql | UTF-8 | 540 | 3.890625 | 4 | [] | no_license | SELECT DISTINCT CONCAT(first,' ', last) as actorname from Actor as a, Movie as m, MovieActor as ma where a.id = ma.aid and m.id = ma.mid and m.title = 'Death to Smoochy';
SELECT COUNT(id) from (SELECT id ,count(mid) from Director join MovieDirector on id = did group by id having COUNT(mid) >= 4) as T;
-- all the titl... | true |
d8b87e2330cdd18dacb2bfeafe657b0eb6c5bbb8 | SQL | winea/Joblist_PHP_OOP | /libs/joblist_sqlExemplo.sql | UTF-8 | 798 | 4.03125 | 4 | [] | no_license | drop TABLE tbl_categories;
CREATE TABLE tbl_categories(id_categ int(11) PRIMARY KEY AUTO_INCREMENT, name varchar(255) NOT NULL);
CREATE TABLE tbl_jobs(id_job int(11) PRIMARY KEY AUTO_INCREMENT, company varchar(255) NOT null, job_title varchar(255) NOT NULL,
description varchar(255) NOT null, salary ... | true |
4e4593bf3cb1ae52b459910e94f3c46d82ba9db4 | SQL | lsh0721/springboot-demo | /doc/table.sql | UTF-8 | 1,361 | 3.359375 | 3 | [] | no_license | CREATE TABLE `city_info`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(32) DEFAULT NULL,
`state` varchar(32) DEFAULT NULL,
`country` varchar(32) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
INSERT INTO `city_info` (`name`, `state`, `country`)
VALUE... | true |
b37bd26d79b2021a9fb7950955aaa1db03216b95 | SQL | radtek/oracle-administration-scripts | /recommended_min_undo_size_for_that_moment.sql | UTF-8 | 345 | 3.140625 | 3 | [] | no_license | --ALTER SYSTEM SET UNDO_RETENTION = 9000;
SELECT ((UR*(UPS*DBS))+(DBS*24))/1048576 AS "Recomended UNDO TBS SIZE in MB" FROM (SELECT value AS UR FROM v$parameter WHERE name='undo_retention'),
(SELECT (SUM(undoblks)/SUM(((end_time-begin_time)*86400))) AS UPS FROM v$undostat),
(SELECT value AS DBS FROM v$parameter WHERE... | true |
de300f20c4bd5f1e93766c3d7f3ee63a1cd11151 | SQL | bebo-eggo/compiere-eggo | /compiere-custo-eurocenter/.svn/pristine/de/de300f20c4bd5f1e93766c3d7f3ee63a1cd11151.svn-base | UTF-8 | 3,277 | 3.421875 | 3 | [] | no_license | CREATE OR REPLACE FORCE VIEW "AD_TAB_V"
AS
SELECT t.AD_Tab_ID AS AD_Tab_ID,
t.AD_Window_ID AS AD_Window_ID,
t.AD_Table_ID AS AD_Table_ID,
t.AD_CtxArea_ID AS AD_CtxArea_ID,
uw.AD_Role_... | true |
017bbd6f99a5faabf17d9b2e3c196cb5e3775944 | SQL | qumino2/Git_Your_SQL | /SQL_Advanced_book_MICK/Ch1/1-2_Self_Join/分地区排序.sql | UTF-8 | 718 | 4.1875 | 4 | [] | no_license | -- P36 练习题1-2-2
--窗口函数解法
select
district,
name,
price,
rank() over (partition by district
order by price desc) as rank_1
from DistrictProducts
--标量子查询解法
select
P1.district,
P1.name,
P1.price,
(select
count(P2.price)
from DistrictProducts P2
whe... | true |
2641c0c2c9c31b787d86d25fc4ce574e9d0fefe6 | SQL | HustinKava/Employee-Tracker | /DB/seed.sql | UTF-8 | 4,795 | 3.21875 | 3 | [
"MIT"
] | permissive | -- Departments
INSERT into department (name) VALUES ("Finance & Accounting");
INSERT into department (name) VALUES ("Human Resources");
INSERT into department (name) VALUES ("Contracts");
INSERT into department (name) VALUES ("Purchasing");
INSERT into department (name) VALUES ("Planning");
INSERT into department (name... | true |
b7171043708e4a546613e93c2e01843d8e2008a5 | SQL | VadimAcosta/dvdrental_questions | /dvd_db_intermediate_questions/dvd_db_intermediate_question_1.sql | UTF-8 | 379 | 4.1875 | 4 | [] | no_license | -- Find the names and the payment amounts for customers
-- with a lifetime purchase amount of greater than $150
SELECT
(customer.customer_id),
customer.first_name ||' '||customer.last_name as "customer_name",
SUM (payment.amount)
FROM customer
LEFT JOIN payment
ON customer.customer_id = payment.customer_id
GROU... | true |
5a571db416160d56d0f93b3b0fcb9b6b3e1353c1 | SQL | radwanromy/github-upload | /PLSQL BFILE 02.sql | UTF-8 | 495 | 2.515625 | 3 | [] | no_license | /* Formatted on 25/Oct/21 10:45:43 PM (QP5 v5.287) */
CREATE OR REPLACE PROCEDURE load_emp_bfile (p_file_loc IN VARCHAR2)
IS
v_file BFILE;
v_filename VARCHAR2 (16);
v_file_exists BOOLEAN;
CURSOR emp_cursor IS
BEGIN
FOR emp_record IN emp_cursor LOOP
v_filename := emp_record.first_name ... | true |
73b49c3e3a91479f73f2cd9250c6b3a51e8dd319 | SQL | liumiaowilson/world | /data/import_quest.sql | UTF-8 | 584 | 3.078125 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `quest_defs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`content` varchar(200) NOT NULL,
`pay` int(11) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
ALTER TABLE quest_defs ADD INDEX (name);
CREATE TABLE IF NOT EXISTS `quests` (
... | true |
22af7af4fdd94e96fa35c1c03ff623d4598263e0 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day12/select2116.sql | UTF-8 | 191 | 2.734375 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-11T21:16:00Z' AND timestamp<'2017-11-12T21:16:00Z' AND SENSOR_ID='7cd2eb1a_bec5_4e3f_ba5b_779b1517b4d9'
| true |
3e270d93f6f5c44fc902461f37c5679b4ed57518 | SQL | zou333/zouchu | /www.333.com/0201_shop_db.sql | UTF-8 | 24,968 | 3.09375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 0201
Source Server Version : 50617
Source Host : localhost:3306
Source Database : 0201_shop_db
Target Server Type : MYSQL
Target Server Version : 50617
File Encoding : 65001
Date: 2017-06-16 13:10:56
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... | true |
c03634eb69b6a4bf8d1e2f8e80d3b422ad6ad3ef | SQL | Tahanima/sqlbolt-solutions | /sql_lesson12_order_of_execution_of_a_query.sql | UTF-8 | 461 | 4.28125 | 4 | [] | no_license | -- Exercise 12 — Tasks
-- 1. Find the number of movies each director has directed
SELECT director,
Count(*) AS number_of_movies
FROM movies
GROUP BY director;
-- 2. Find the total domestic and international sales that can be attributed to each director
SELECT m.director,
Sum (bo.domestic_sales + bo.i... | true |
50082ef79b5a5f3b5f42f232d3e0e170c7df6df5 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day20/select1153.sql | UTF-8 | 178 | 2.671875 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-19T11:53:00Z' AND timestamp<'2017-11-20T11:53:00Z' AND temperature>=47 AND temperature<=73
| true |
bdd353a9ed30f47b1300ef4abcc0df268edfd3f9 | SQL | ahavanur/yelp-networks | /assets/sql/yelp_schema.sql | UTF-8 | 7,204 | 3.375 | 3 | [] | no_license | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema yelp_db
-- --------------------------------------... | true |
09d3a793aee3c010d86a2ad257a34ea9e85d9d73 | SQL | cuissto59/ServiceCar | /db/servicecar.sql | UTF-8 | 14,507 | 3.28125 | 3 | [] | no_license | Drop DATABASE IF EXISTS `servicecar`;
CREATE DATABASE IF NOT EXISTS `servicecar`/*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `servicecar`;
-- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: servicecar
-- -----------... | true |
4b043f309927da6cde0a65a398a7d6f7693228c4 | SQL | CrazyIvanftw/EDAF20_Database | /KrustyKookies/sql_folder/Krusty_Kookies_DB_Init.sql | UTF-8 | 9,564 | 3.109375 | 3 | [] | no_license | -- Delete the tables if they exist. To be able to drop
-- them in arbitrary order, disable foreign key checks.
-- Turn of key checks
set foreign_key_checks = 0;
-- Drop tables in arbitrary order
drop table if exists Cookies;
drop table if exists Ingredients;
drop table if exists Recipes;
drop table if exist... | true |
5edf1aa778e47efbe349e71fc240431d6af70a8e | SQL | klimsava/students | /db/students_db.sql | UTF-8 | 3,434 | 3.46875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Nov 23, 2020 at 09:06 PM
-- Server version: 5.7.26
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
22c8ecb8ee66208e7b5e5758ded4f0f4eb718ff8 | SQL | laurisuurvali/training-app | /src/test/resources/db/data.sql | UTF-8 | 1,417 | 2.984375 | 3 | [] | no_license | INSERT INTO ROLE (status, name)
VALUES ('ACTIVE', 'ROLE_USER'),
('ACTIVE', 'ROLE_ADMIN');
INSERT INTO APP_USER (status, first_name, last_name, username, password)
VALUES ('ACTIVE', 'Stanislav', 'Ratsinski', 's.ra@hotmail.com', '$2a$04$AM7ufAiabz8axmplAVXUI.95FpvD1o33zQMJ... | true |
a6d90154d39946eb76e698c4bcd5ab08a569f620 | SQL | octonion/cricket | /ipl/sos/test_random.sql | UTF-8 | 245 | 3.078125 | 3 | [] | no_license | select npl.parameter,npl.type,npl.level,nbf.estimate
from ipl._parameter_levels npl
left outer join ipl._basic_factors nbf
on (nbf.factor,nbf.level,nbf.type)=(npl.parameter,npl.level,npl.type)
where npl.type='random'
order by parameter,level;
| true |
591562b3a0a3f062e70a09a1dedef4d3746014d2 | SQL | grooves/engineer_training | /KIRAryo1/sql_drill/Pra_update_subquery_e2.sql | UTF-8 | 409 | 3.828125 | 4 | [] | no_license | UPDATE
Salary AS k
SET
k.Amount = k.Amount + (
SELECT
SUM(u.Quantity * p.Price) * 0.03
FROM
Sales AS u
JOIN
Products AS p
ON p.ProductID = u.productID
WHERE
k.EmployeeID = u.EmployeeID
GROUP BY
u.EmployeeID
)
WHERE
PayDate = '2007-08-25'
AND
EXISTS
(
SELECT
'X'
FROM
Sales... | true |
efc0a06282292218b36bdd7d74ee6ce8d0819064 | SQL | puritanlife/ApplyNow | /ApplyNow/TaskHosting/Stored Procedures/CancelJob.sql | UTF-8 | 299 | 2.984375 | 3 | [] | no_license |
-- Cancel Job SP
CREATE PROCEDURE [TaskHosting].[CancelJob]
@JobId uniqueidentifier
AS
BEGIN
IF @JobId IS NULL
BEGIN
RAISERROR('@JobId argument is wrong.', 16, 1)
RETURN
END
SET NOCOUNT ON
UPDATE TaskHosting.Job SET IsCancelled = 1 WHERE JobId = @JobId
END | true |
2282d50a1e5564e2d670e15e45bad6b0d46bfc4a | SQL | Woodu/sg_f | /fox_sv/socialsv/.svn/pristine/22/2282d50a1e5564e2d670e15e45bad6b0d46bfc4a.svn-base | UTF-8 | 313 | 3.171875 | 3 | [] | no_license | -- フレンドコード
DROP TABLE IF EXISTS friend_code_data;
CREATE TABLE friend_code_data (
friend_code INTEGER AUTO_INCREMENT PRIMARY KEY, -- フレンドコード
user_id INTEGER NOT NULL, -- ユーザーID
create_ts TIMESTAMP NULL DEFAULT NULL, -- 作成時間
INDEX (user_id)
);
| true |
3a8841d2a26cea4a2ec4476ab16786657e4817d3 | SQL | fazrinhafiz97/lecturer-student-database | /lecturer/register.sql | UTF-8 | 1,888 | 2.921875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 02, 2020 at 12:02 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
63b15dbb54629a94a738b810584105902e322180 | SQL | aidaerfanian/itemsonsale | /target/classes/db/migration/V0004__orders.sql | UTF-8 | 770 | 3.203125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Author: aida.erfanian
* Created: Nov. 13, 2020
*/
CREATE TABLE `orders` (
`order_id` int NOT NULL auto_increment,
`... | true |
f06fac15e33b30159352465f3f51234bd69fbafa | SQL | rtilersmith/DNDCombatTracker | /db/addToList.sql | UTF-8 | 242 | 2.6875 | 3 | [] | no_license | INSERT INTO COMBATANTS (Character_ID, Current_HP, Current_Init, room)
VALUES (${Character_ID}, ${health}, ${init}, ${room});
SELECT * FROM CombatantInfo ci
LEFT JOIN Combatants c
ON ci.ID = c.Character_ID
where C.Character_ID=${Character_ID}; | true |
c6275d523e854a1e1fddb013b767da16dd98a098 | SQL | fedspendingtransparency/data-act-broker-backend | /dataactvalidator/config/sqlrules/c27_award_financial.sql | UTF-8 | 3,846 | 3.890625 | 4 | [
"CC0-1.0"
] | permissive | -- The File C GrossOutlayAmountByAward_CPE balance for a TAS, DEFC, program activity code + name, object class code,
-- direct/reimbursable flag, and Award ID combination should continue to be reported in subsequent periods during the
-- FY, once it has been submitted to DATA Act, unless the most recently reported outl... | true |
1282a30bd1fd4f9f38abc3aa6ce71d22dc619605 | SQL | Aubin13/alx-higher_level_programming-1 | /0x0D-SQL_introduction/11-best_score.sql | UTF-8 | 166 | 2.953125 | 3 | [] | no_license | -- Script that lists all records with a score >= 10 in the second_table of hbtn_0c_0
SELECT score, name
FROM second_table
WHERE score >= 10
ORDER BY score DESC;
| true |
efbac9c2bccd977f02687fe6e8b8e63e1ef2ccff | SQL | hmailserver/hmailserver | /hmailserver/tools/Scripts/DeliveryLog/DeliveryLog.MSSQL.sql | UTF-8 | 664 | 2.90625 | 3 | [] | no_license | create table hm_deliverylog
(
deliveryid int identity (1, 1) not null ,
deliveryfrom varchar(255) not null,
deliveryfilename varchar(255) not null,
deliverytime datetime not null,
deliverysubject nvarchar(255) not null,
deliverybody ntext not null
)
ALTER TABLE hm_deliverylog ADD CONSTRAINT hm_deliverylog_p... | true |
b8547361ca9433da3c2e70fd78b62ee78b527f8a | SQL | marcohern/daily.marcohern.com | /sql/tables/daily.sql | UTF-8 | 826 | 3.296875 | 3 | [] | no_license | DROP TABLE IF EXISTS daily;
CREATE TABLE daily(
id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
day DATE NOT NULL,
processed ENUM('true','false') NOT NULL DEFAULT 'false',
transport NUMERIC(20,2) NOT NULL,
food NUMERIC(20,2) NOT NULL,
purchases NUMERIC(20,2) NOT NULL,
sortie NUMERIC(20,2) NOT NULL,
oth... | true |
990e29cf0d5a0da5c57f979f7994c11fff6788fe | SQL | figofosandy/repobaru | /week3/day5/materisql.sql | UTF-8 | 2,551 | 3.890625 | 4 | [] | no_license | -- create keyword
-- buat database
create database coba;
show databases;
-- buat table
use coba;
create table cobaTable(cobaColumn int(3));
show tables;
-- alter keyword
-- nambah column baru
use coba;
alter table cobaTable add columnBaru int(5);
desc cobaTable;
-... | true |
e1b941cf3509ada09ddddc6967f8d1ea363a8044 | SQL | VICRODRIMA/CaseTecnico | /SQL/exec1.sql | UTF-8 | 323 | 3.375 | 3 | [] | no_license | /*
Com base no modelo acima, escreva um comando SQL que liste a quantidade de registros por
Status com sua descrição.
*/
SELECT COUNT(1) AS ContadorDeRegistros, b.dsStatus AS Descricao
FROM tb_Processo a
INNER JOIN tb_Status b on a.idStatus = b.idStatus
GROUP BY b.dsStatus
ORDER BY ContadorDeRegistros DESC ... | true |
21a4fd08a3ffa12e024c7e43527d09520dda704d | SQL | OVazquezVillegas/Complex-knowledge-repository | /Data/SQL/SQL course/sql-crash-course-master/Labs/01 Lab One - SQL Queries/First_query.sql | UTF-8 | 1,496 | 4.53125 | 5 | [
"MIT"
] | permissive |
--1)How many files are in the inventory
SELECT COUNT (*) AS file_count
FROM film
--2)What does a sample input of the film look like?
SELECT *
FROM film
LIMIT 100
-- 3) What files are longer than three hours? Order by title
--reverse alphabetic order
SELECT title, release_year, rental_duration, rating
FROM film
WHERE... | true |
db70f33b2dcf9b66ca2108ecced583f384838dda | SQL | chboschiero/mpjp | /mySql/s11.sql | UTF-8 | 362 | 3.546875 | 4 | [] | no_license | -- check null
select first_name, last_name
from employees
where commission_pct is not null;
-- null in operations
select first_name, last_name, 12 * salary * commission_pct
from employees;
-- what if null
select first_name, last_name, 12 * salary * ifnull(commission_pct, 0) -- se è null mette commission_pct a 0 (che ... | true |
5562f0109c4be8be0d81d18a3dc234cf01794eb7 | SQL | chrissienoodle/Gestionnaire-de-Clefs | /out/artifacts/web_war_exploded/WEB-INF/classes/dao/dbcreation.sql | UTF-8 | 5,506 | 3.046875 | 3 | [] | no_license | -- Reconstruction de la base de données
DROP DATABASE IF EXISTS gesttrousseau;
CREATE DATABASE gesttrousseau;
USE gesttrousseau;
-- tables
CREATE TABLE fonctions
(
code int(4) PRIMARY KEY AUTO_INCREMENT,
libelle varchar(255) NOT NULL
) ENGINE = INNODB;
INSERT INTO fonctions (libelle) VALUE ('Develo... | true |
c4ebc54d93d3554f289f1200ba0a810955d21fbc | SQL | RonLandagan/RamenDataAnalysis | /RamenPortfolio.sql | UTF-8 | 2,117 | 4.3125 | 4 | [] | no_license | -- Sanity Check
SELECT *
FROM RamenRatings
ORDER BY Stars DESC
-- Find how many 5 star reviews belong to each country of origin
SELECT Country, COUNT(1) AS NumberOf5Stars
FROM RamenRatings
WHERE Stars=5
GROUP BY Country
ORDER BY NumberOf5Stars desc
-- Find which brand produces the most ramen varieties
SE... | true |
b15a75daa33be7067396b9844b719b93b618a4ed | SQL | chokvn/SQL---Hackerrank | /Aggregation/Weather Observation Station 02.sql | UTF-8 | 160 | 2.8125 | 3 | [] | no_license | /*
Challenge reference:
https://www.hackerrank.com/challenges/weather-observation-station-2
*/
SELECT ROUND(SUM(LAT_N), 2), ROUND(SUM(LONG_W),2) FROM station;
| true |
799e11c8c00573c415755e014d7c9321f091145d | SQL | MLQX/my_simple_blog | /create_table.sql | UTF-8 | 232 | 2.59375 | 3 | [] | no_license | drop table if exists entries;
create table entries(
[id] integer primary key autoincrement,
[title] string not null unique,
[content] TEXT not null,
[createtime] TimeStamp NOT NULL DEFAULT (datetime('now','localtime'))
);
| true |
6ce0bd4de2e703fa16480d6eee8d99723b29b88c | SQL | xiaofenduier/hardware | /hardware/src/main/resources/sql/probe.sql | UTF-8 | 934 | 2.78125 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80012
Source Host : localhost
Source Database : hardware
Target Server Type : MySQL
Target Server Version : 80012
File Encoding : utf-8
Date: 09/27/2019 18:11:... | true |
35ef1cbdd91e8adf17a3112567b14aeb4a3893dc | SQL | MORourke3/DataSytemsLabs | /Lab 6.sql | UTF-8 | 1,597 | 4.25 | 4 | [] | no_license | -- 1 --
select distinct customers.name, customers.city
from customers
where city in (
select city
from (
(select products.city, count(products.city)
from products
group by products.city
order by count DESC
limit 1))
as X)
-- 2 --
select products.name
from products
where priceUSD < (
select avg(priceUSD)
... | true |
fdf06ee5e8a41725bb98cd1b4f8864dd09e88a89 | SQL | youngarifswag6690/vapezone-tubes-native | /db_vape.sql | UTF-8 | 4,754 | 2.796875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 01, 2019 at 02:51 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.0.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
34efe77499bd11da5ce142552798bcadc3fbad04 | SQL | daizhongde/authority | /src/person/daizhongde/authority/config/AuthorityUrrelation.sql | UTF-8 | 2,756 | 2.75 | 3 | [] | no_license | /** Effective config begin there **/
--@JavaScript var AuthorityUrrelation = {};
--@JavaScript AuthorityUrrelation.query = {};
--@JavaScript AuthorityUrrelation.Add = {};
--@JavaScript AuthorityUrrelation.Update = {};
--@JavaScript AuthorityUrrelation.read = {};
--@JavaScript AuthorityUrrelation.Del = {};
--@JavaScr... | true |
02a873e1dbde7748e94c13ea5d8ec8b44e4f4f46 | SQL | demidielon/geekbrains-mysql | /stream1/2/5ad5db872e27476ef3e2f69b0f75106b9ec96526.sql | UTF-8 | 2,288 | 3.25 | 3 | [] | no_license | ALTER TABLE `world`.`country`
DROP FOREIGN KEY `fk_capital`;
ALTER TABLE `world`.`country`
DROP COLUMN `IsDeleted`,
DROP COLUMN `DateUpdate`,
DROP COLUMN `Population`,
DROP COLUMN `Langudge`,
DROP COLUMN `CapitalCity`,
DROP COLUMN `Founded`,
DROP COLUMN `TextCode`,
DROP COLUMN `NumCode`,
CHANGE COLUMN `ID` `id` INT N... | true |
4116fa7b0e4e2ef863f8646313a5a6d287159fb0 | SQL | LucaROC/I8AO3 | /Sprint 7 Opdrachten/SQL/Subqueries/[4] Eventful countries (Niet volgens opdracht, nog ff naar kijken).sql | UTF-8 | 192 | 3.546875 | 4 | [] | no_license | USE WorldEvents
SELECT
CountryName
FROM
tblCountry INNER JOIN tblEvent ON
tblCountry.CountryID = tblEvent.CountryID
GROUP BY
CountryName
HAVING
COUNT(EventName) > 8
| true |
492628bbd2bc6704c3f24c930d1e1e70a4387420 | SQL | jhon-int/SQL | /Jhonatan Dantas - P2.sql | UTF-8 | 3,440 | 3.890625 | 4 | [] | no_license | /*1- insert itens_nfv*/
DELIMITER //
DROP TRIGGER IF EXISTS valor_prod //
CREATE TRIGGER valor_prod
BEFORE INSERT ON itens_nfv
FOR EACH ROW
BEGIN
IF ((SELECT produtos.estoque FROM produtos WHERE produtos.id_produto = new.id_produto) > 100) THEN
SET new.valor = (SELECT produtos.venda*0.95 FROM produtos WHE... | true |
9e520edacabf811add3a9ebf25e5f5485ebe7598 | SQL | sonminho/spring-project | /movie/test.sql | UTF-8 | 2,366 | 3.109375 | 3 | [] | no_license | <<<<<<< HEAD
DROP TABLE MEMBER;
CREATE TABLE MEMBER(
USER_ID VARCHAR2(10 CHAR) PRIMARY KEY,
PASSWORD VARCHAR2(256 CHAR),
NAME VARCHAR2(20 CHAR), SALT VARCHAR2(16),
USER_LEVEL VARCHAR2(20 CHAR),
EMAIL VARCHAR2(40 CHAR),
PHONE VARCHAR2(20 CHAR),
ADDRESS VARCHAR2(200 CHAR),
REG_DATE... | true |
2657b1eff3b133025bbff408a00daa8d5fb959ff | SQL | Mongker/htdocs | /K3Office/database/visa.sql | UTF-8 | 2,199 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 31, 2019 at 06:28 PM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.1.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
bc3942e2e03e5ac07189ad93084cdf2c395ceb75 | SQL | Last-Mile-Health/LMD-Databases | /lastmile_chwdb/views/training/view_trainingStaffCompletedByRows.sql | UTF-8 | 994 | 3.625 | 4 | [] | no_license | use lastmile_chwdb;
drop view if exists view_trainingStaffCompletedByRows;
create view view_trainingStaffCompletedByRows as
select
t.staffID,
t.firstName,
t.lastName,
t.gender,
t.datePositionBegan,
t.datePositionEnded,
t.title,
t.trainingType,
p.participant... | true |
7f8714ea478edab8f99aec6e4d6cc8491c094ec2 | SQL | JayDeeJaye/activity-logger | /database/ACTIVITY_TRACKER_db.sql | UTF-8 | 2,331 | 3.5625 | 4 | [
"Apache-2.0"
] | permissive | --
-- Database for the ActivityTracker application
--
-- To install on your server
-- Update the options below to match your environment
-- Run this script as your MySQL administrator
-- Create an application user with SELECT, UPDATE, DELETE, INSERT
-- on all tables
-- Updated connectvars.p... | true |
5fcb16c7a5a2d0d4984ad94402f1b5ed40cde645 | SQL | faiz-anwar4749/EmployeePayrollDB | /UC7-AggregateFunctions_PayrollService.sql | UTF-8 | 585 | 3.375 | 3 | [] | no_license | --UC7-aggregate function
USE payroll_service
SELECT * FROM employee_payroll
SELECT SUM(salary) AS Total_Salary FROM employee_payroll GROUP BY gender;
SELECT AVG(salary) AS Average_Salary FROM employee_payroll GROUP BY gender;
SELECT MIN(salary) AS Minimum_Salary FROM employee_payroll GROUP BY gender;
SELECT MAX(salary)... | true |
939b9988aecad814d721ba012850fbaf0bca081d | SQL | BenRKarl/WDI_work | /w03/d03/Dmitry_Shamis/homework/domain_modeling/grocery.sql | UTF-8 | 417 | 2.703125 | 3 | [] | no_license | -- Notes
CREATE DATABASE grocery;
\c grocery
CREATE TABLE libations
(
id serial4 PRIMARY KEY,
libations_type varchar(255)
);
CREATE TABLE comestibles
(
id serial4 PRIMARY KEY,
comestibles_type varchar(255)
);
CREATE TABLE food_types
(
id serial4 PRIMARY KEY,
category varchar(255),
food_type_id intege... | true |
91f95afdfeaf5f0c3bd70010b4a9b55cabd5089c | SQL | brentrichards/MIMIC-IV-Win | /concepts_PG_local/comorbidity/charlson_pg.sql | UTF-8 | 11,846 | 3.484375 | 3 | [
"MIT"
] | permissive | -- ------------------------------------------------------------------
-- This query extracts Charlson Comorbidity Index (CCI) based on the recorded ICD-9 and ICD-10 codes.
--
-- Reference for CCI:
-- (1) Charlson ME, Pompei P, Ales KL, MacKenzie CR. (1987) A new method of classifying prognostic
-- comorbidity in longi... | true |
b3910dcdee6be8f2ddf538759996dadd6a131e13 | SQL | liwen666/lw_code | /tempcode/src/main/java/commons/execscript/sql/bgt/common/common_164_.sql | GB18030 | 685 | 2.84375 | 3 | [] | no_license | declare
v_n1 number(8) := 0;
begin
select count(1)
into v_n1
from user_views
where upper(view_name) = 'BGT_T_CUSTOMSORT';
if v_n1 = 0 then
execute immediate Q'{create table BGT_T_CUSTOMSORT(ID VARCHAR2(32) default SYS_GUID() not null,GUID VARCHAR2(32) default SYS_GUID() not null,
TABLEID VARCHA... | true |
916863bdb22e273fc0b7c7bd0ff03d28ad0b8d3e | SQL | iosiginer/AGAST2.0 | /GameUI/Model/DAL/QueryResources/QuestionQueries/q12_false.sql | UTF-8 | 292 | 3.5625 | 4 | [] | no_license | #12false
#Which of the songs made by a band?
SELECT track.name AS 'false_answer'
FROM track JOIN artist_credit_name JOIN artist
WHERE track.artist_credit=artist_credit_name.artist_credit
AND artist_credit_name.artist=artist.id
#type 2 is a band
AND NOT artist.type=2
ORDER BY RAND()
limit 3; | true |
50a1e5876d89d245fb4d8406f72472c940c06448 | SQL | AyshaHamna/Hotel-Reservation | /contact.sql | UTF-8 | 2,077 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jul 18, 2020 at 07:43 AM
-- Server version: 5.7.23
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
244094e64c6c498158c8aaf9e605fd2282d0faf7 | SQL | fpugh/DWMgmt | /DWMgmt_SQL_Code/DWMgmt_SQL_DEV_Scripts/20150304_Adhoc_Query_Capture.sql | UTF-8 | 640 | 3.640625 | 4 | [] | no_license |
/* This is a direct method to attach code to query plans,
however produces far too much volume, and too slowly.
Perhaps can adapt for asynchronous query using freetext
methods??
*/
WITH HandleBars (plan_handle, use_counts, objtype, text)
AS (
SELECT t1.plan_handle, t1.usecounts, t1.objtype, t2.text
FROM sys.dm_... | true |
cbff35436046aea1a2da38f8c86863b46ec11be4 | SQL | bigdatalyn/bigdatalyn.github.io | /12cR2MultitenantHOLCookbook/HOL/app_containers/whereami.sql | UTF-8 | 1,695 | 3.265625 | 3 | [
"MIT"
] | permissive | -- =========================================================================
--
-- File: whereami.sql
-- Author: Patrick G. Wheeler
-- $Revision: 1 $
-- $Date: 2/4/17 7:53p $
-- $Author: PWheeler $ of last update
--
-- Copyright (C) 2017 Oracle Corporation, All rights reserved.
--
-- Purpose:
-- Provid... | true |
58aa3d23a8843d0afcfd01c0896967b94df93cc7 | SQL | Briareos/Stevo | /schema.sql | UTF-8 | 397 | 3.125 | 3 | [] | no_license | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
DROP TABLE IF EXISTS `company`;
CREATE TABLE `company` (
`id` int(11) NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `company`
ADD PRIMARY KEY (`id`);
ALTER TA... | true |
84e7d170273e1ad962d5c5c1c0aa676358c44d5a | SQL | H-daniel00/utn-frc-dlc-2011-liberal-peker-1 | /DLC/clases practica/scripts-comentario/01. estructura.sql | UTF-8 | 1,768 | 3.203125 | 3 | [] | no_license | -- =============================================================================
-- WORD
-- =============================================================================
DROP SEQUENCE IF EXISTS sq_Word CASCADE;
CREATE SEQUENCE sq_Word;
DROP TABLE IF EXISTS Word CASCADE;
CREATE TABLE Word (
id_Word INTEGER ... | true |
331969220995c6aba30b843e786f763021972880 | SQL | sasabrina/covid-db-v2 | /api-flask/src/db/covid19.sql | UTF-8 | 4,763 | 3.390625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.21, for Linux (x86_64)
--
-- Host: localhost Database: covid19
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!... | true |
930d8d88522b3e94b5bb7f22a997839a20c26705 | SQL | gruter/tajo-elasticsearch | /tajo-core/benchmark/simple/groupby2.sql | UTF-8 | 169 | 2.65625 | 3 | [
"Apache-2.0",
"PostgreSQL",
"BSD-3-Clause",
"MIT"
] | permissive | select
l_orderkey, l_linenumber, sum(l_quantity) as sum_qty, max(l_quantity) as max_qty, min(l_quantity) as min_qty
from
lineitem
group by
l_orderkey, l_linenumber | true |
1f3d5e7e326d87b7624307c2bc939a1d5976e81e | SQL | eltonmesquita87/test | /jose-typescript-nodejs-authentication/sql/schedule/billing_center/45-Duplicated Coverage after new policy change.sql | UTF-8 | 1,633 | 3.921875 | 4 | [] | no_license | select distinct policynumber
from
( select
pp.PolicyNumber,
ii.InstallmentNumber,
iic.removed,
ci.CoverageID,
cpc.PolicyChangeType_GCS,
bi.id,
count(1) as 'qtd'
from bc_invoice ivc with (nolock)
left join bctl_invoicestatus ivcs with (nolock) on ivc.status = ivcs.id
inner j... | true |
6f932652ad3bbdecbe7118feaa474f01a2118f1a | SQL | nadf/JP23 | /dz/urar_silvija.sql | UTF-8 | 1,977 | 3.859375 | 4 | [] | no_license | # 9. Urar Silvija
# Urar popravlja satove.
# Jedan korisnik može uraru donijeti više satova na popravak dok jedan sat može biti više puta na popravku.
# Urar ima šegrta koji sudjeluje u određenim popravcima satova.
# win+r, upisi cmd te zalijepi sljedecu liniju (prilagoditi putanje - diskove)
# c:\xampp\mysql\bin... | true |
74cf1e21d942e0e832fd9f1f75f71bf6b93cbf89 | SQL | wally-wally/TIL | /05_DB/Programmers_SQL/05_JOIN/오랜 기간 보호한 동물1.sql | UTF-8 | 344 | 4.1875 | 4 | [] | no_license | -- [1]LEFT JOIN 사용
SELECT A.NAME, A.DATETIME
FROM ANIMAL_INS A LEFT JOIN ANIMAL_OUTS B ON A.ANIMAL_ID = B.ANIMAL_ID
WHERE B.ANIMAL_ID IS NULL
ORDER BY A.DATETIME
LIMIT 3
-- [2]NOT IN 사용
-- SELECT NAME, DATETIME
-- FROM ANIMAL_INS A
-- WHERE A.ANIMAL_ID NOT IN ( SELECT B.ANIMAL_ID FROM ANIMAL_OUTS B )
-- ORDER BY A.DAT... | true |
2f522e0c2d9ea1aee3f32900a58ca0c93e53e30a | SQL | KalyaniPatil23/BluepineappleAssignments | /7 June/customers.sql | UTF-8 | 2,572 | 3.703125 | 4 | [] | no_license | CREATE TABLE Customer (
CustomerId integer,
Customername TEXT,
Contactname TEXT,
Address TEXT,
City TEXT,
PostalCode TEXT,
Country TEXT,
MarketCap double
);
INSERT INTO Customer VALUES
(1, 'Patil Grp', 'Sanket Patil', 'Patil Estate Bhor', 'Pune', '411001', 'India', 2789432879),
(2, 'Nikhar Brothers', 'Rahul Nikhar', '... | true |
c63ca35039fbc73c5b5472a1a934cc4f974489af | SQL | daniel2483/NextUExercises | /DesarrolloWeb/Modulo_7-InteractuandoConBasesDeDatos/Unidad_1-EstructuraSQL_NoSQL/Ejercicio4-LenguajeSQL-DML/ejercicio/codBase.sql | UTF-8 | 7,110 | 3.65625 | 4 | [] | no_license | CREATE DATABASE golf_db
WITH
OWNER = postgres
ENCODING = 'UTF8'
CONNECTION LIMIT = -1;
CREATE TABLE public.paises
(
id integer NOT NULL,
nombre character varying(45) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE public.ciudades
(
id integer NOT NULL,
... | true |
b975f915abc5042cdc671c7ae6d357ddb9b18c8b | SQL | PPXComputer/Still_Believe_ | /mysqlStudy/MySQL学习总结/08存储过程和函数/updateSql.sql | UTF-8 | 1,004 | 3.703125 | 4 | [] | no_license | -- 更新学生id,返回空
DROP FUNCTION IF EXISTS update_student_id;
DELIMITER $$
CREATE FUNCTION update_student_id() RETURNS varchar(2)
BEGIN
DECLARE cnt int;
SELECT COUNT(*) FROM student WHERE id=1004 INTO cnt;
IF cnt>2 THEN
UPDATE student SET name="hello" WHERE id=1004;
ELSE
UPDATE student SET name="world" WHER... | true |
f4deb1b417070bc2bdc90239f6f06f329d07dde6 | SQL | Milagro12090/Employee-management-system | /db/seed.sql | UTF-8 | 955 | 3.34375 | 3 | [] | no_license | USE employee_management_db;
INSERT INTO department (name)
VALUES ("IT"),
("Production"),
("Engineering"),
("Accounting"),
("Sales");
INSERT INTO role (title, salary, department_ID)
VALUES ("Manager", 65000, 1),
("IT Tech", 50000, 1),
("Manager", 50000, 2),
("Team Lead", 40000, 2),
("Operator", 30000, 2),
("... | true |
8bef275176db9a40d1e54618c59cc13d44ff298e | SQL | ptrckbnck/SQLChecker | /examples/minimal/Abgaben/abgabe_test_uebung_ok.sql | UTF-8 | 760 | 3.171875 | 3 | [] | no_license | /*%%%%head%%
{
"name": "test_uebung",
"type": "submission",
"authors": [["author1","dfg@yahoo.de","6363484"],["author2","dfg@gmx.de","6083479"]]
}%%*/
/*%%1%%*/
insert into plane
values (5, 2, 'Cessna', 'Cessna 162 Skycatcher');
/*%%2%%*/
CREATE TABLE `crewhotel`
(
`ID` int(11) NOT NULL,
`Name` ... | true |
256a4c11207136850dc840d0a299096c65e5f884 | SQL | ecommercedatabasedesign/Final-Project | /1343Projecgt2_Group5.sql | UTF-8 | 7,459 | 3.9375 | 4 | [] | no_license | CREATE TABLE "Store" (
"StoreID" INTEGER PRIMARY KEY NOT NULL,
"Store Name" VARCHAR(20) UNIQUE NOT NULL,
"Contact" VARCHAR(30) NOT NULL
);
CREATE TABLE "Product"(
"ID" CHAR(10) NOT NULL,
"StoreID" INTEGER NOT NULL,
"Price" NUMBER NOT NULL,
"Description" TEXT,
"Inventory" NUMBER,
"Name" CHAR(30),
... | true |
a1796dc75b7fc2c91a1df9f8de30421d4de65b23 | SQL | da99/megauni | /src/megauni/Conversation/postgresql/020.table.conversation.sql | UTF-8 | 249 | 2.796875 | 3 | [
"MIT"
] | permissive |
SET ROLE db_owner;
CREATE TABLE "conversation" (
id BIGSERIAL PRIMARY KEY,
author_id BIGINT NOT NULL, -- screen name id
title VARCHAR(180),
body TEXT,
created_at timestamptz NOT NULL DEFAULT NOW()
);
COMMIT;
| true |
8d92f137cf83b402695cebf82a08a674a6b0293c | SQL | Blackset/Cdi18 | /cdi /exo sql/SQLQuery12.sql | ISO-8859-1 | 136 | 2.71875 | 3 | [] | no_license | select nom_employ, pn_employ,date_embauche
from employ
where datediff(dd,date_embauche, cast ('24/03/1991' as datetime)) < 0
| true |
1daa6728f29500353eb401593d6b9f356e601dbb | SQL | 996949805/BCGit | /Application/fundsapp/Controller/test.sql | UTF-8 | 2,191 | 3.953125 | 4 | [] | no_license | select ft.category,ft.titlename,a1.titleid,
(a1.sum_month+a2.sum_month+a3.sum_month+a4.sum_month) sum_month,
a1.sum_month a1_sum_month,
a2.sum_month a2_sum_month,
a3.sum_month a3_sum_month,
a4.sum_month a4_sum_month,
(a1.day25+a2.day25+a3.day25+a4.day25) sum_yestod... | true |
01625a871c7f690c17f6c7cbcd43a0b6cc0ab12d | SQL | rtrice1/coplink | /db/create_podata_stored_proc.sql | UTF-8 | 4,960 | 3.640625 | 4 | [] | no_license | Drop Procedure if exists GetPodataCriticalSpareDiffs;
DELIMITER //
CREATE PROCEDURE GetPodataCriticalSpareDiffs()
BEGIN
drop table if exists podata_critical_spares_tmp;
/* Get a current view of what's going on */
CREATE TEMPORARY TABLE podata_critical_spares_tmp (cop_id varchar(30) default 'noid')
... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.