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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
cf8301f6a2a711d7a06ee7413b7ad4a6d222f1c5 | SQL | nzou-credit-sesame/user-experience-analytics | /new-capone-tradelines/sql.sql | UTF-8 | 4,431 | 3.90625 | 4 | [] | no_license |
select date_trunc('month', acct_registration_complete_datetime) as registration_month
, count(distinct usertoken)
from (
select a.usertoken
, idhash
, acct_registration_complete_datetime
from
(
select usertoken
, idhash
, dateopened
from credit_report_tradelines
where creditor ilike '%CA... | true |
558c43b2078c8f675dbd875f2743625709bf85d5 | SQL | barry2018118/ytsale201910 | /code/src/main/resources/doc/captial/t_enterprise_account_log.sql | UTF-8 | 1,078 | 2.921875 | 3 | [] | no_license | USE `yt_sale`;
DROP TABLE IF EXISTS `t_enterprise_account_log`;
CREATE TABLE `t_enterprise_account_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`child_id` int(11) DEFAULT NULL COMMENT '下级企业Id',
`parent_id` int(11) DEFAULT NULL COMMENT '上级企业Id',
`action_type` int(11) DEFAULT NULL COMMENT '业务行为类型',
`action_id... | true |
a8e2a6233cb1e2ca9eb87c52d55d9170dac7bb00 | SQL | galid1/JY_Commerce | /src/sql/initCategory.sql | UTF-8 | 7,149 | 3.15625 | 3 | [] | no_license | -- ================ Root 카테고리
insert into categories(category_name, parent_id) values ('패션', 0);
insert into categories(category_name, parent_id) values ('가전/디지털', 0);
insert into categories(category_name, parent_id) values ('도서', 0);
insert into categories(category_name, parent_id) values ('식품', 0);
-- =============... | true |
48845546089b0ef30c5e862ce3b2f541a478d69c | SQL | vanxuanty95/tiki | /build/init_database.sql | UTF-8 | 1,775 | 3.75 | 4 | [
"MIT"
] | permissive | CREATE DATABASE IF NOT EXISTS `booking`;
USE `booking`;
CREATE TABLE IF NOT EXISTS `user` (
`id` varchar(50) NOT NULL,
`password` varchar(200) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `screen` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`numb... | true |
6fc3aed0545b13466f4c0cef4b1e7a752fe1929a | SQL | msmet/EAA-SQL-Reports | /State Reporting/Course Settings.sql | UTF-8 | 1,451 | 3.828125 | 4 | [] | no_license | SELECT
c.dcid
, '<a href=/admin/courses/edit.html?cn='||c.course_number||'&frn=002'||c.dcid||' target=_blank>Link</a>'
, c.id
, c.course_name
, c.course_number
, NVL(ps_customfields.getcf('Courses',c.id,'MI_Subject_Area_Code'),'NULL')
, NVL(ps_customfields.getcf('Courses',c.id,'MI_Course_ID'),'NULL')
, NVL(ps_c... | true |
ff8ff5b0092d9f4d15a36c013d7a4f779df2b14b | SQL | Cauchy-NY/LeetCode | /src/main/java/Hard/Question185.sql | UTF-8 | 285 | 4.1875 | 4 | [] | no_license | SELECT D.Name as Department, E.Name as Employee, E.Salary
FROM Department D, Employee E, Employee E2
WHERE D.ID = E.DepartmentId and E.DepartmentId = E2.DepartmentId and
E.Salary <= E2.Salary
group by D.ID,E.Name having count(distinct E2.Salary) <= 3
order by D.Name, E.Salary desc | true |
ae4fac58561e9a705e2e9ce9ba3ec5ae94e5979f | SQL | Pokham/grand_grocery | /branch.sql | UTF-8 | 955 | 3.703125 | 4 | [] | no_license | CREATE TABLE branch
(
Branch_ID varchar(100) DEFAULT NULL,
Address varchar(100) DEFAULT NULL,
City varchar(100) DEFAULT NULL,
Zip_Code varchar(100) DEFAULT NULL,
Phone varchar(100) DEFAULT NULL
);
INSERT INTO branch(Branch_ID, Address, City, Zip_Code, Phone)VALUES
(1000, '652 Raspberry Dr.','Houston', 7... | true |
ce0c161f11421a98a7059dfec41ccc70ab253c50 | SQL | 9998546789/firstpart | /db/lesson5/lesson5.sql | UTF-8 | 3,283 | 4.5 | 4 | [] | no_license | use vk;
-- 1 Пусть в таблице users поля created_at и updated_at оказались незаполненными. Заполните их текущими датой и временем.
ALTER TABLE profiles ADD COLUMN updated_at DATETIME DEFAULT NOW();
UPDATE profiles
SET
updated_at = NOW(),
created_at = NOW()
;
-- 2 Таблица users была неудачно спроектирована. З... | true |
151c4bd933be446ac996093c6b98d419728e5080 | SQL | marinfotache/Polyglot-Persistence-and-Big-Data | /03 Graph databases. Neo4j/03-04a0_export_chinook__pg_to_neo4j.sql | UTF-8 | 10,070 | 4.03125 | 4 | [] | no_license | --############################################################################
--### Export `chinook` database from PostgreSQL to Neo4j
--#############################################################################
-- last update: 2022-05-10
-- I.
-- Connect to PgAdmin
-- create and populate database `chinook`... | true |
c6ec0dc09f6b795df6a877d030d69e4c4f3c743a | SQL | danthomas/DTS.Framework | /DTS.Music.SqlServer/Schemas/Main/Tables/Artist.g.sql | UTF-8 | 203 | 2.6875 | 3 | [] | no_license | create table [Main].[Artist]
(
[ArtistId] smallint NOT NULL IDENTITY (1, 1)
, [Name] varchar(50) NOT NULL
, CONSTRAINT [PK_Artist] PRIMARY KEY ([ArtistId])
, CONSTRAINT [AK_Artist_Name] UNIQUE ([Name])
) | true |
1f66bcf3dc0e40aaf70c6ae2d36f550af5c28e92 | SQL | stephenmccready/CMS_MONMEMD | /Create_AdjustmentReasonCode.sql | UTF-8 | 4,575 | 2.734375 | 3 | [] | no_license | If OBJECT_ID('tempdb..#AdjustmentReasonCode') Is Not Null Drop Table #AdjustmentReasonCode
Select '00' As AdjustmentReasonCode, Cast('Prospective Payment Components' As VarChar(128)) As AdjustmentReason Into #AdjustmentReasonCode
Insert Into #AdjustmentReasonCode Select '01','Notification of Death of Beneficiary'
Inser... | true |
e781738987ebdce06eedb080d89011dce51760ec | SQL | Lord-Gusarov/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/16-shows_by_genre.sql | UTF-8 | 565 | 4.1875 | 4 | [] | no_license | -- Task: Write a script that lists all shows, and all genres linked to that show, from the database hbtn_0d_tvshows.
-- If a show doesn’t have a genre, display NULL in the genre column
-- Each record should display: tv_shows.title - tv_genres.name
-- Results must be sorted in ascending order by the show title and genre... | true |
b44eb78df730eae42869ce409137593f2566bb68 | SQL | minorimpact/uravo | /config/db-update-0.0.10.sql | UTF-8 | 533 | 2.609375 | 3 | [] | no_license | USE uravo;
INSERT INTO `monitoring_default_values` (`id`, `AlertGroup`, `AlertKey`, `description`, `yellow`, `red`, `disabled`, `mod_date`, `create_date`) VALUES (NULL,'inode_size',NULL,'Maximum percentage of inodes in use.',75,90,0,NOW(),NOW());
ALTER TABLE recurring_alert DROP INDEX recurring_alert_idx;
DELETE FROM... | true |
477ba8559798aa880214c4082cc9ac65b0617db3 | SQL | Satyakm/Indepth-JPA-with-SpringBoot2 | /spring-boot-jdbc-basic/src/main/resources/data.sql | UTF-8 | 436 | 3.171875 | 3 | [] | no_license | create table person(
id integer not null,
name varchar(255) not null,
location varchar(255) not null,
birth_date timestamp,
primary key(id));
INSERT INTO person (ID, NAME, LOCATION, BIRTH_DATE)
VALUES(10001, 'Paul', 'New York', sysdate());
INSERT INTO person (ID, NAME, LOCATION, BIRTH_DATE)
VALUES(10002, 'Ron', 'Berl... | true |
b51b1754a077fa89c4ec38be744ec9db8aeae8d1 | SQL | KEACS/DAT14W | /2nd_semester/10_sql_queries_join/10_SUB_queries.sql | UTF-8 | 2,644 | 4.25 | 4 | [] | no_license | /* ------------------------------------------ */
/* -- Sub queries (scalar)------------------- */
/* ------------------------------------------ */
-- only fileds from the out select are shown
-- scalar
-- List the staff working in a Brach at “163 Main street”
SELECT staffNo, fName, lName, position
FROM Staff
WHERE bra... | true |
31e6c0fc01ca37d096f7c56fc5c1d67578bcd8f3 | SQL | SergioEstebanPi/Mundocente | /base de datos/mundocente (1).sql | UTF-8 | 43,928 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.0.2
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 10-04-2016 a las 06:51:09
-- Versión del servidor: 10.0.17-MariaDB
-- Versión de PHP: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
7b1620d8fea1c4d99062a52b54ba178cfc3c51cd | SQL | mjheitland/tfaurora | /connection_test.sql | UTF-8 | 2,041 | 3.5 | 4 | [] | no_license | -- # In AWS console, go to RDS instance / Connectivity and change master password (on db instance, modify, tick 'apply immediatedly', save).
-- # Get endpoint and update the one below in the psql command.
-- # login to db jumpbox (check that sg_jumpbox allows ingress on port 22 for your jumpbox ip, e.g. 54.239.6.185/3... | true |
a57a724018e9d0b149a3d0e57b56b47267b3480c | SQL | shinichitaniguchi/sql | /exportSUPPLIER_ENTRY_LIST.sql | UTF-8 | 498 | 2.921875 | 3 | [] | no_license | -- Project Name : BASE1 TO CSV SUPPLIER ENTRY CORPLIST DATA
-- Author : Sakuma Eiji
-- Modified by :
-- Date : 2008/09/17
-- DBMS : Oracle 10g
--
set linesize 10000
set pagesize 0
set trimspool on
set feedback off
spool /home/sag/daf/import_csv/importSupLIST.tmp
--データを出力
select CC.corp_id
f... | true |
c92706131b120415e181247322b27c4788bcbca7 | SQL | Jaimin09/PixHarbor | /pixharbor.sql | UTF-8 | 4,407 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 03, 2020 at 03:34 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
2de739baaa7daae9d599998aa0272e7715f1c56b | SQL | AliakseiLasevich/telegram_bot_city_advice | /mysql_dump/city_bot_advice.sql | UTF-8 | 2,200 | 2.890625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.18, for Win64 (x86_64)
--
-- Host: localhost Database: city_bot
-- ------------------------------------------------------
-- Server version 8.0.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... | true |
f1f3a1784be11da7c797137206fb6caf1516877f | SQL | web91magic/retail | /retailcrm/bundle/sql/update_item.sql | UTF-8 | 804 | 3.203125 | 3 | [] | no_license | UPDATE s_purchases
# данные будут обновляться в двух таблицах одновременно
JOIN s_orders ON s_purchases.order_id = s_orders.id
# устанавливаем общую сумму заказа
SET s_orders.total_price = IF(:summ IS NOT NULL, :summ, 0),
# устанавливаем сколько уже заплачено
s_orders.paid = IF(:purchaseSumm IS NOT... | true |
88874c82ed0f5c3515af99de115d15bf73a816f4 | SQL | bluedreamer/FoodData | /schema/table_nutrient_analysis_details.sql | UTF-8 | 2,484 | 2.96875 | 3 | [
"MIT"
] | permissive | -- MariaDB dump 10.17 Distrib 10.4.13-MariaDB, for Linux (x86_64)
--
-- Host: eagle Database: usda
-- ------------------------------------------------------
-- Server version 10.4.13-MariaDB-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SE... | true |
0d77d3113ab28f57ebfac6a479329334358c8bc8 | SQL | xiaozhongliu/spring-api-seed | /api/src/main/resources/database/init_20180101.sql | UTF-8 | 1,764 | 3.671875 | 4 | [
"MIT"
] | permissive | -- CREATE DATABASE "test" ----------------------------------
-- DROP DATABASE IF EXISTS `test`;
CREATE DATABASE IF NOT EXISTS `test`
CHARACTER SET utf8
COLLATE utf8_general_ci;
USE `test`;
-- ---------------------------------------------------------
-- CREATE TABLE "account" ----------------------------------
CRE... | true |
2b60e3f2672a075208ea29274a84696511f63349 | SQL | joekennerly/student-exercises | /student-exercise-3.sql | UTF-8 | 2,409 | 4.09375 | 4 | [] | no_license | CREATE TABLE Cohort (
CohortId INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
Name TEXT NOT NULL UNIQUE
);
CREATE TABLE Student_Exercise (
Id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
StudentId INTEGER NOT NULL,
ExerciseId INTEGER NOT NULL,
FOREIGN KEY(StudentId) REFERENCES Student(StudentId),
FOR... | true |
1c8d3bc010794c1957a56600d9c3b987e7107b78 | SQL | mhyrka/vols_recruiting_info | /scripts/get_underperfomers.sql | UTF-8 | 218 | 2.859375 | 3 | [] | no_license | COPY (
SELECT
*
FROM
player_data
WHERE
result IN ('NFL', 'CFL', 'GRAD', 'UDFA')
AND games_played < 20)
TO '/Users/sallywhite/teamscraper/data/results/underperformers.csv' WITH CSV DELIMITER ',';
| true |
620f9cea55303160fa0f1d2a8fad08fbcf6b0839 | SQL | shmiko/MASTER_SQL | /PWIN175.sql | UTF-8 | 7,345 | 2.96875 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE EOM_TMP_CTN_FEES_IC (
p_array_size IN PLS_INTEGER DEFAULT 1000
,start_date IN ST.ST_DESP_DATE%TYPE
,end_date IN ST.ST_DESP_DATE%TYPE,
sCust IN RM.RM_CUST%TYPE,
sAnalysis IN RM.RM_ANAL%TYPE
-- sCust IN RM.RM_CUST%TYPE
)
IS
TYPE ARRAY IS TABLE OF... | true |
f1e79299db4be04a67054f559f14d323421b3ea4 | SQL | bayuihsan/management | /uploads/settings.sql | UTF-8 | 1,457 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 10 Feb 2018 pada 23.45
-- Versi Server: 10.1.25-MariaDB
-- 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 |
50922076dde2352300bed3e9220e9ec716867ee0 | SQL | tkionshao/Cov_Push_Tool | /sp_history/SP_Sub_Generate_Dominat_Cell.sql | UTF-8 | 7,934 | 3.078125 | 3 | [] | no_license | DELIMITER $$
USE `gt_gw_main`$$
DROP PROCEDURE IF EXISTS `SP_CreateDB_LTE`$$
CREATE DEFINER=`covmo`@`%` PROCEDURE `SP_Sub_Generate_Dominat_Cell`(IN GT_DB VARCHAR(100), IN KIND VARCHAR(20), IN VENDOR_SOURCE VARCHAR(20),IN GT_COVMO VARCHAR(100))
BEGIN
DECLARE RNC_ID INT;
DECLARE O_GT_DB VARCHAR(100) DEFAULT GT_DB;
DEC... | true |
5c13d71f56e27d7f93eb171de9056d13915ccf15 | SQL | vasiliy-ignatov/yeticave | /schema.sql | UTF-8 | 973 | 3.890625 | 4 | [] | no_license | CREATE DATABASE yeticave
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
USE yeticave;
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(128),
email VARCHAR(128) UNIQUE,
password VARCHAR(64),
avatar VARCHAR(150),
contact TEXT NOT NULL,
rates_id INT
);
CREATE INDEX user... | true |
54e1997a820df0cec0fb2a8b444b254654cd83c2 | SQL | dgyurov/SASS | /security.sql | UTF-8 | 3,270 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Vært: 127.0.0.1
-- Genereringstid: 24. 03 2015 kl. 08:20:00
-- Serverversion: 5.6.17
-- PHP-version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
5c69262f807c9c424e6fdcc62a231d626ac90a62 | SQL | jkstill/oracle-script-lib | /sql/latency_eventmetric.sql | UTF-8 | 1,238 | 3.53125 | 4 | [
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive |
/* wait event latency last minute
output looks like
NAME TIME_WAITED WAIT_COUNT AVGMS
------------------------- ----------- ---------- ----------
log file parallel write 2.538 4 6.345
log file sync 2.329 1 23.287
db fi... | true |
7f7333a8b0862a9e59b49d39d7a7ed7cddb9d166 | SQL | medy13/dbshell | /normal_shell/BAK_EX_CONTRACT_LIST.sql | UTF-8 | 1,013 | 2.71875 | 3 | [] | no_license | \echo ------------------BAK_EX_CONTRACT_LIST----------------
select now();
\timing
insert into BAK_EX_CONTRACT_LIST_GPTMP (CMD_TYPE,MANUAL_NO, CONTR_ITEM) select CMD_TYPE,MANUAL_NO, CONTR_ITEM from BAK_EX_CONTRACT_LIST_INC_EXT;
delete from BAK_EX_CONTRACT_LIST using BAK_EX_CONTRACT_LIST_GPTMP where BAK_EX_CONTRACT_LIS... | true |
313f714c3892f6b4856e96adda2adbad4ff234ac | SQL | zhaoyul/git-data | /resources/migrations/20200329191617-base-table.up.sql | UTF-8 | 3,888 | 3.171875 | 3 | [] | no_license | --;; 公司信息
CREATE TABLE `t_company` (
`company_id` varchar(40) NOT NULL COMMENT '主键',
`company_name` varchar(100) NOT NULL COMMENT '公司名称',
`company_store_name` varchar(500) NOT NULL DEFAULT '' COMMENT '公司门店名称',
`company_no` varchar(40) DEFAULT NULL COMMENT '公司编码',
`company_logo` varchar(100) DEFAULT NULL COMMENT '... | true |
8fb66b178f671a4f70d7542e9aee37e6a34aff30 | SQL | neclaakalin/Metu-Homeworks | /Ceng352-DatabaseManagementSystems/MiniProject2/Submission/task_3_5.sql | UTF-8 | 315 | 4.1875 | 4 | [] | no_license | select a."name" as "name", count(*) as collab_count
from author a,
(select distinct a2.author_id as f, a3.author_id as s
from authored a2, authored a3
where a2.author_id != a3.author_id and
a2.pub_id = a3.pub_id) as n
where a.author_id = n.f
group by n.f, a."name"
order by count(*) desc, a."name"
limit 1000 | true |
992d9f08932e8bdb09f4878ea86b88aa10a3e262 | SQL | Curtin-Open-Knowledge-Initiative/citation-diversity | /report_data_processing/sql_processed/summary_stats_by_year_all_papers.sql | UTF-8 | 2,814 | 4.40625 | 4 | [] | no_license | /*
## Summary
Generates summary statistics for the overall data (including those with fewer than 2 citations)
## Description
Creates a table that records overall DOI counts, DOI counts across OA categories, and corresponding total citation
counts, for each publication year. This includes all papers regardless of citat... | true |
bb2d56c2e18ac4341e9ebfbf4ee33aa3ce4bef70 | SQL | ytc8723/Answers-to-SQL-for-Data-Science-Coursera | /Module3-Practice-Quiz.sql | UTF-8 | 1,359 | 4.3125 | 4 | [] | no_license | /* Practice Quiz - Writing Queries */
/* 1. How many albums does the artist Led Zeppelin
have? */
SELECT Name,
numAlbums
FROM (
SELECT Name,
artists.artistid,
COUNT(albumid) as numAlbums
FROM artists LEFT JOIN albums ON artists.artistid = albums.artistid
GROUP BY Name)
WHERE Name = 'Led... | true |
4a8068c11f0467b76116968a582d7ad4d00076df | SQL | ljy607/drugstore | /sql/计算.sql | UTF-8 | 170 | 2.8125 | 3 | [] | no_license | //SELECT * FROM T_FUNCS WHERE FUNTP = 4;
//SELECT SPBH, SUM(SHUL)
//FROM T_LSHZB
//WHERE FGSBH = '101' AND LSRQ BETWEEN '2005-01-01' AND '2005-03-31'
//GROUP BY SPBH; | true |
625d972f4fdb5a1a0e9971f6b8fb202115080a31 | SQL | maheryy/frameworkless-cms | /app/config/db_structure.sql | UTF-8 | 10,912 | 3.25 | 3 | [
"MIT"
] | permissive | DROP TABLE IF EXISTS `{PREFIX10}_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `{PREFIX10}_role`
(
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)... | true |
fcdbe84b2a4ee9d66334913022d5eb98b47a1d42 | SQL | jepez90/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/102-rating_shows.sql | UTF-8 | 214 | 3.625 | 4 | [] | no_license | -- lists all shows from hbtn_0d_tvshows_rate by their rating.
SELECT s.title
,SUM(sr.rate) AS rating
FROM tv_shows s
INNER JOIN tv_show_ratings sr
ON s.id = sr.show_id
GROUP BY s.id
ORDER BY rating DESC;
| true |
7249f66d0ee6b9a86c7a6b355de885d5a6b0a004 | SQL | atuinsh/atuin | /atuin-server-postgres/migrations/20230315224203_create-deleted.sql | UTF-8 | 276 | 3.4375 | 3 | [
"MIT"
] | permissive | -- Add migration script here
alter table history add column if not exists deleted_at timestamp;
-- queries will all be selecting the ids of history for a user, that has been deleted
create index if not exists history_deleted_index on history(client_id, user_id, deleted_at);
| true |
6ab88dccef2d643ac4bc5f6a462eb726bc7b427d | SQL | cyclefortytwo/knockturn-allee | /migrations/2019-02-19-223604_create_txs/up.sql | UTF-8 | 400 | 2.78125 | 3 | [] | no_license | CREATE TABLE txs (
slate_id TEXT PRIMARY KEY,
created_at TIMESTAMP NOT NULL,
confirmed BOOLEAN NOT NULL DEFAULT 'f',
confirmed_at TIMESTAMP,
fee int8,
messages TEXT[] NOT NULL,
num_inputs int8 NOT NULL DEFAULT 0,
num_outputs int8 NOT NULL DEFAULT 0,
tx_type TEXT NOT NULL,
order_id uuid NOT NULL,
u... | true |
f1eb0e3aa642187c67a72e829457b5fde0a84afa | SQL | cs-fullstack-2019-spring/sql-outer-join-cw-MelaatiJ | /exercise4.sql | UTF-8 | 373 | 3.390625 | 3 | [] | no_license | -- ### Exercise 4:
-- Create a Join that lists ONLY Departments that have Employees
select departments.department_name, employees.employee_name
from departments
right join employees
on employees.department_id = departments.department_id
where employees.department_id notnull;
--
-- results:
-- Sales Bette Nicholson
... | true |
292ec9f27616980122d309b755e5bafb0f541179 | SQL | Alex-YuZ/Deforestation-Exploration-Using-SQL | /forestation.sql | UTF-8 | 12,837 | 4.71875 | 5 | [] | no_license | -- Create the VIEW
DROP VIEW IF EXISTS forestation;
CREATE VIEW forestation AS
SELECT f.country_code country_code,
f.country_name country_name,
f.year,
f.forest_area_sqkm,
l.total_area_sq_mi*2.59 total_area_sq_km,
100*f.forest_area_sqkm/(l.total_area_sq_mi*2.59) pct_forest... | true |
1df6f7fa89b081f81a8c3ad7a35a72de307f6038 | SQL | sowcow/help-translate | /db/structure.sql | UTF-8 | 10,873 | 3.0625 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_cat... | true |
4a82ae4e93776b313e2803b9f64e9c160d862a89 | SQL | AndreyPAN/HotelData | /Notes fo project/Methods.sql | UTF-8 | 988 | 2.625 | 3 | [] | no_license | ModelClient.InsertClient ()
ModelClient.SelectClients ()
ModelClient.SelectClients (string param)
ModelClient.SelectClient (int id_client)
ModelClient.UpdateClient (int id_client)
ModelCalendar.InsertDays (int year)
ModelCalendar.SetHoliday (string day)
ModelCalendar.DelHoliday (string day)
ModelRoom.SelectRooms ()
Mod... | true |
116c08ffad3ff42028120480d116a5e64ce3e14f | SQL | PedroSousax3/lista-negra- | /backend/script.sql | UTF-8 | 472 | 2.6875 | 3 | [] | no_license | create database bd_lista;
use bd_lista;
create table tb_lista (
id_lista int primary key auto_increment,
nm_pessoa varchar(150),
ds_motivo varchar(150),
ds_local_convivio varchar(80),
dt_inclusao datetime,
ds_foto varchar(200)
);
select * from bd_lista.tb_lista;
dotnet ef dbcont... | true |
40c263cb57a934f77559fb528cbfc1632c282f33 | SQL | karavokyrismichail/VoteGR | /project_code/VoteGR-DB/votegr_positions.sql | UTF-8 | 2,401 | 3.03125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: localhost Database: votegr
-- ------------------------------------------------------
-- Server version 8.0.18
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!4... | true |
6977d07768f7c2fecec400eb4145941cc9ad4c02 | SQL | Rockhorse/Spring-Boot-Book | /10/ShiroJpaMysql/book.sql | UTF-8 | 4,363 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50553
Source Host : localhost:3306
Source Database : book
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2019-05-07 17:52:29
*/
SET FOREIGN_KEY_CHECKS=0;
-... | true |
040090257f8733a73f9577253b686a2968d0b5ff | SQL | kronsi/howtogetanerd | /session-5/select.sql | UTF-8 | 211 | 2.765625 | 3 | [] | no_license | SELECT * FROM `webshop`;
SELECT * FROM `stock`;
SELECT * FROM `webshop_extension`
INNER JOIN customers ON webshop_extension.customer_id = customers.id
INNER JOIN stock ON webshop_extension.stock_id = stock.id; | true |
441575874abf1c8d1e0132a699e432f130bd11c3 | SQL | huberemanuel/ds-introduction | /Aula 1/assets/movies.sql | UTF-8 | 473 | 3.40625 | 3 | [] | no_license | /* Script para recriar a base de dados */
CREATE TABLE IF NOT EXISTS movies (
user_id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
release_year INT,
genre TEXT
);
INSERT INTO movies (name, release_year, genre) VALUES
("LOTR: The Fellowship of the Ring", 2001, "fantasy"),
("LOTR: The Two Towers", 2002... | true |
90e45c39b592a36fda7efd8311c36422792d0efd | SQL | evolaric/p2-storefront-backend | /src/tests/sql-orders-seed.sql | UTF-8 | 2,519 | 2.78125 | 3 | [] | no_license | INSERT INTO
categories (category)
VALUES
('General Products'),
(' Category 1 '),
(' Category 2 '),
(' Category 3 '),
(' Category 4 '),
(' Category 5 ');
INSERT INTO
users (
user_name,
first_name,
last_name,
password_digest
)
VALUES
(
'test... | true |
6c97659f4c20769301ab1299a5e0eb40805a9d28 | SQL | sofia-bobbiesi/databases | /Lab2/world-schema.sql | UTF-8 | 1,687 | 3.515625 | 4 | [] | no_license | USE world;
-- PARTE I:
drop table if exists country;
CREATE TABLE IF NOT EXISTS country (
Code VARCHAR(3),
PRIMARY KEY (Code),
Name VARCHAR(250),
Continent VARCHAR(52),
Region VARCHAR(250),
SurfaceArea INTEGER,
IndepYear INTEGER,
Population INTEGER,
LifeExpectancy INTEGER,
GNP I... | true |
5a057cdec71751ac2e59c04ec3db0336954e23c1 | SQL | lucianobajr/banco | /lista-07/scripts/3-g.sql | UTF-8 | 324 | 3.40625 | 3 | [
"MIT"
] | permissive | SELECT DISTINCT paciente.NM_PAC,paciente.DT_NASC,convenio.DESC_CONVENIO
FROM paciente
JOIN atendimento ON paciente.CD_PAC=atendimento.CD_PAC
JOIN convenio ON paciente.CONV_PAC=convenio.COD_CONVENIO
GROUP BY paciente.NM_PAC,paciente.DT_NASC,convenio.DESC_CONVENIO
ORDER BY paciente.DT_NASC
LIMI... | true |
c2fd1378ecab3dd9a879503c3acbeadd69d01f69 | SQL | jihyunle/practiceSQLs | /mySQLs/customers2.sql | UTF-8 | 1,578 | 4.03125 | 4 | [] | no_license | create database pets2;
use pets2;
CREATE TABLE person (
id INTEGER PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
age INTEGER
);
CREATE TABLE pet (
id INTEGER PRIMARY KEY,
name VARCHAR(50),
breed VARCHAR(50),
age INTEGER,
dead INTEGER
);
CREATE TABLE person_pet (
person_id... | true |
93bae5a4c336d07f08aa59be6bda57485cae97c2 | SQL | servo1/postgres-queries-to-api | /tablesandviews.sql | UTF-8 | 3,478 | 4.0625 | 4 | [] | no_license | with tblviews as (with thetables as (SELECT DISTINCT 'table' as type, info.table_schema AS SCHEMA, info.table_name AS TABLE_NAME,
info.column_name AS name, info.domain_name, info.ordinal_position AS POSITION,
info.is_nullable::boolean AS NULLABLE, CASE
WHEN info.data_type = 'USER-DEFINED' THEN info.udt_name
ELSE in... | true |
f4059d93baddc94ad2efcdf9168ce867ee4573f5 | SQL | hn2441/jspProject | /jspProject/src/bean_whn/whn.sql | UTF-8 | 12,570 | 2.8125 | 3 | [] | no_license | create table adv(
no serial,
sid varchar(50),
title varchar(500),
price varchar(50),
content varchar(5000),
img varchar(500)
);
create table review(
no serial,
mid varchar(50),
sid varchar(50),
adno int,
content varchar(5000),
starsc int,
date varchar(20)
);
create table cart(
mid varchar(50),
ad... | true |
8ac1724940a745cddd8e5610daba1d9b7d5d5b48 | SQL | bjavier9/tesis | /sp/sp_marcar.sql | UTF-8 | 6,518 | 3.90625 | 4 | [] | no_license | use asistencia;
drop procedure if exists marcar
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `marcar`(in cuenta int(11))
begin
declare hora_inicio time;
declare dia Varchar(10);
declare mensaje varchar(50);
declare hora_final time;
declare hora_actual time;
declare hora_ealm... | true |
59b1fb2ac8ce9c8d810aa5a4102d0ac089a8b1a6 | SQL | ngoton/hackerrank | /SQL/OllivandersInventory.sql | UTF-8 | 391 | 3.859375 | 4 | [] | no_license | SELECT w.id, wp.age, w.coins_needed, w.power
FROM Wands w
JOIN Wands_Property wp ON w.code = wp.code
WHERE wp.is_evil = 0
AND w.coins_needed = (SELECT MIN(coins_needed)
FROM Wands w2
JOIN Wands_Property wp2 ON w2.code = wp2.code
WHERE w.powe... | true |
a2789566d460ae838e7fd4955fdd78f6358ed266 | SQL | Neituos/CRUD_into_Multiple_tables | /Solution_ressources/List_request_for_create_bdd.sql | UTF-8 | 772 | 3.28125 | 3 | [] | no_license | --
-- Database: `EcfDb`
--
-- --------------------------------------------------------
CREATE DATABASE EcfDb;
--
-- Table structure for table `Customers`
--
-- --------------------------------------------------------
Create TABLE Customers
( CustomerID int identity(1,1) NOT NULL,
name varchar(25) NOT NULL... | true |
b09776587a642b404e64a475c5b21b6f67956a2b | SQL | Alex-Bond/YiiGitterBot | /data/mysql.sql | UTF-8 | 1,773 | 3.296875 | 3 | [] | no_license | SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `Achievements`
-- ----------------------------
DROP TABLE IF EXISTS `Achievements`;
CREATE TABLE `Achievements` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`key` varchar(64) NOT NULL,
`title` varchar(256) NOT NULL,
... | true |
db56cb0d6c90bab91c7f40a35dcb77d5a30f762a | SQL | U1timat/web | /sql.sql | UTF-8 | 2,393 | 3.296875 | 3 | [] | no_license | //скрипт для автоматического создания базы данных для данного сайта
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----... | true |
3bae258aec4849d469c20f167fde55835a9adf6f | SQL | asbelov2/SQLmodule | /Блок1/10_10.sql | UTF-8 | 203 | 2.71875 | 3 | [] | no_license | CREATE TABLE #ProductSummary
(ProdId INT IDENTITY,
ProdName NVARCHAR(20),
Price MONEY)
INSERT INTO #ProductSummary
VALUES ('Nokia 8', 18000),
('iPhone 8', 56000)
SELECT * FROM #ProductSummary | true |
da32cfe577cac54a5405d996a48ece34bd005909 | SQL | Elninho3/Rohit-s-Checkpint2-AID | /ticket.sql | UTF-8 | 5,408 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 16, 2017 at 02:47 PM
-- Server version: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
6728cf17493ba6e9745bae36f6241da470112857 | SQL | 18918090402/MZJF_Work | /MZJF_Work/0038 网贷机构数据上报/SQL_20190611/4.1.5 初始债权.sql | GB18030 | 4,465 | 3.734375 | 4 | [] | no_license |
--4.1.5 ʼծȨ
----impala
drop table if exists msc.tmp_debt_operation_log ;
create table msc.tmp_debt_operation_log
as
SELECT irm.bo_id, dea.id, sum(ibau.price_principal) trans_price
from pdw.invt_receipt_msg_reportbak20190610 irm
LEFT JOIN pdw.invt_borrows_accept_unpaid_reportbak20190610 ibau
on... | true |
422909bc15f8ce654765af45ed9c97567bcd9858 | SQL | rask0ne/Hotel | /src/main/resources/dbschema.sql | UTF-8 | 572 | 3.453125 | 3 | [
"Apache-2.0"
] | permissive | DROP TABLE IF EXISTS AUTHORITIES;
DROP TABLE IF EXISTS USER;
DROP TABLE IF EXISTS LOG;
--USER TABLE
CREATE TABLE IF NOT EXISTS USER (
IDUSER INT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1) NOT NULL,
USERNAME VARCHAR(255) NOT NULL PRIMARY KEY,
PASSWORD VARCHAR(255) NOT NULL,
ENABLED... | true |
b880ef73e7ab7b8ca0bff03a700e95bf2b9a8d3b | SQL | anna2serg/otus-java-hw | /hw16-messagingSystem/MessageSystemApp/src/main/resources/db/migration/V1__initial_schema.sql | UTF-8 | 504 | 3.234375 | 3 | [] | no_license | create table client
(
id bigserial not null primary key,
name varchar(255) not null check (name <> '')
);
create table address
(
id bigserial not null primary key,
street varchar(255) not null check (street <> ''),
client_id bigint not null constraint fk_client_address references client(id)
);
create... | true |
747f332b2afb947d9b44c0ede02e689d70de9611 | SQL | jampaniuday/ABROracle | /orajdbclink_o2a/samples.sql | UTF-8 | 5,361 | 3.40625 | 3 | [
"Apache-2.0"
] | permissive | -- configure MYSQLSRV datasource with jtds jdbc driver (http://jtds.sourceforge.net/)
Insert into JDBC_DBLINK (DATA_SOURCE_NAME,URL,DBUSER,DBPASSWORD,DRIVER) values ('MYSQLSRV','jdbc:jtds:sqlserver://mysqlsrv.mydomain:1433/mydatabase','myuser','mypwd','net.sourceforge.jtds.jdbc.Driver');
commit;
-- test jcursor
decl... | true |
ee996c9b891acde9c4cae192940ad51783e32554 | SQL | chloride-management/chloride-management | /scripts/item-cl-conversions.sql | UTF-8 | 324 | 2.5625 | 3 | [
"MIT"
] | permissive | -- Create item chloride conversions table and load selected conversions
DROP TABLE IF EXISTS itemclconversions CASCADE;
CREATE TABLE itemclconversions
(
itemid INT NOT NULL,
uom VARCHAR(30),
meq_multiplier DOUBLE PRECISION
);
\copy itemclconversions FROM 'chloride_conversions.csv' DELIMITER ',' CSV HEADER NULL ... | true |
e8a6392890be7584bdfa89319dd361d68c625033 | SQL | maoaiz/MiniSQL-Compiler | /examples/SQL/test4-all.sql | UTF-8 | 381 | 2.9375 | 3 | [] | no_license | CREATE SCHEMA AUTHORIZATION JOHNL
CREATE TABLE Foods(
name CHAR(8) NOT NULL,
type CHAR(5),
flavor CHAR(6),
PRIMARY KEY (name)
)
SELECT Foods.name, Foods.flavor from Foods WHERE Foods.type = "fruit";
create table Cliente(
Dni VARCHAR(10),
Nombre VARCHAR(10),
Apellido VARCHAR(10),
PRIMARY KEY (Dni)
)ENGINE=Inno... | true |
9d39ab68487087a897f7a58c3a397da6d5a72393 | SQL | vimc/montagu-db | /migrations/sql/V2019.03.28.1347__ResponsibilitiesReadForAdminAndMembersOnly.sql | UTF-8 | 867 | 3.078125 | 3 | [
"MIT"
] | permissive | DO $$
DECLARE user_role INT;
DECLARE member_role INT;
DECLARE funder_role INT;
DECLARE admin_role INT;
DECLARE developer_role INT;
BEGIN
SELECT id INTO user_role FROM role WHERE name = 'user';
SELECT id INTO member_role FROM role WHERE name = 'member';
SELECT id INTO funder_role FROM role WHERE name = '... | true |
7de4c788c83bdd82108dd8d2b729615a692a8883 | SQL | turtletse/cmcms | /SQL/sp_examination_result_lv4_get.sql | UTF-8 | 389 | 2.84375 | 3 | [] | no_license | DROP procedure if EXISTS sp_examination_result_lv4_get;
delimiter $$
CREATE PROCEDURE sp_examination_result_lv4_get (IN in_lv1 INT, IN in_lv2 INT, IN in_lv3 INT)
BEGIN
SELECT result_code, result_desc
FROM examination_results_list
WHERE lv1 = in_lv1 AND lv2 = in_lv2 AND lv3 = in_lv3 AND lv4<>0
ORDER BY lv4;... | true |
6596b7fec17a62aa988e8c28a878b95e8534e06f | SQL | MigBap/Online-courses-and-tutorials | /SQL/LinkedIn - Advanced SQL for Data Scientists/Exercise Files/Ch02/Query-5_Preparing Data for Analytics Tools (tips).sql | UTF-8 | 538 | 2.890625 | 3 | [] | no_license | -- 6. Preparing Data for Analytics Tools
------------------------------------------------------------------------------------------------------------------------
-- Tips for using SQL for Data Science
--1) Don't underestimate the time needed to collect and prepare data
--2) Use aggregate and statistic functions to ... | true |
47f9bf0753b6689d89e8426689974e82ece1797c | SQL | rossenhansen/PostreSQL | /Scripts/PostgreSQL/create_table_raw_currency_exchange.sql | UTF-8 | 514 | 3.03125 | 3 | [] | no_license | --drop table raw_currency_exchange
create table raw_currency_exchange (
id int generated by default as identity primary key
,currency varchar
,local_to_AUD varchar
,AUD_to_local varchar
,currency_code varchar
,synched_at timestamp not null default now()
,currency_rate_id int
);
create index raw_currency_exchan... | true |
1b59688dff18ae6e9b9737ca840021684b72e6dc | SQL | cleyvison777/mft-postgressql | /create d05_lista_especie.sql | UTF-8 | 444 | 3.03125 | 3 | [] | no_license | create table d05_lista_especie(
d05_cdlistaesp bigserial not null primary key,
d05_cdempresa bigserial,
d05_nmlistaesp varchar(100)
);
======================
ALTER TABLE d03_especie
ADD CONSTRAINT FK_d03_especie_d05_lista_especie1
FOREIGN KEY (d03_cdlistaesp)
REFERENCES d05_lista_especie(d05_cdlistaesp)
ON DELETE CASC... | true |
21108caaf70ded136c54a8d9b5be827fe9bf392d | SQL | urinieto/struct_experiments | /Precision_vs_Recall_exp/www/database.sql | UTF-8 | 7,614 | 2.796875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.6
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 07, 2014 at 05:31 AM
-- Server version: 5.5.33
-- PHP Version: 5.5.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `urinieto_boundaries_experiment2`
--
-- -----------... | true |
2fa8443452969cb76fab3f06ce5792f68ad19120 | SQL | BacNTb/ShopLed | /Admin/mvc.sql | UTF-8 | 11,724 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th10 14, 2020 lúc 05:16 PM
-- Phiên bản máy phục vụ: 10.4.14-MariaDB
-- Phiên bản PHP: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
77ba228dafcedf729bd0717c9ab0139cdd3c7827 | SQL | leoCardosoDev/database-mysql | /04-Operadores-Logicos-SQL/01-Operadores-Logicos.sql | UTF-8 | 788 | 2.828125 | 3 | [] | no_license | /* | LIVRO | AUTOR | SEXO | PAGINAS | EDITORA | VALOR | UF | ANO | */
/* or - ou */
SELECT NOME, SEXO, ENDERECO FROM CLIENTE WHERE SEXO = 'M' OR ENDERECO LIKE '%RJ';
SELECT NOME, SEXO, ENDERECO FROM CLIENTE WHERE SEXO = 'M' AND ENDERECO LIKE '%RJ';
SELECT NOME, SEXO, ENDERECO FROM CLIENTE WHERE SEXO = 'F' OR ENDEREC... | true |
874ec71e4928b8691359c92c80df3cb093a78447 | SQL | viszi/codes | /CodeWars/7kyu/SQL/007-sql-basics-simple-join.sql | UTF-8 | 398 | 3.96875 | 4 | [
"MIT"
] | permissive | -- https://www.codewars.com/kata/5802e32dd8c944e562000020
-- For this challenge you need to create a simple SELECT statement that will return all columns from the products table, and join to the companies table so that you can return the company name.
SELECT p.id, p.name, p.isbn, p.company_id, p.price, c.name AS compa... | true |
e534a1d70773b7aaaa2b8e53790cac84a7989f0d | SQL | Martin-BG/SoftUni-DatabaseBasics-MySQL | /04. Built-in Functions/Built-in Functions Lab.sql | UTF-8 | 1,608 | 4.5625 | 5 | [] | no_license | -- Download from the course instance and get familiar with the book_library database.
-- You will use it in the following exercises.
USE `book_library`;
-- 01. Find Book Titles
-- Write a SQL query to find books which titles start with “The”.
-- Order the result by id.
SELECT
`title`
FROM
`books`
WHERE
... | true |
65131089ac5f430dd0894a0fb8cadde95b1800aa | SQL | ymaldor/Famiday | /famiday (1).sql | UTF-8 | 8,395 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.5.1
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Mer 05 Avril 2017 à 12:13
-- Version du serveur : 5.7.11
-- 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=@@CHARACTER_SE... | true |
dc6511be5333cf350411d977c4a414e9a37965f5 | SQL | JocsaPB/rest_api_client_example | /bancosql.sql | UTF-8 | 634 | 3.21875 | 3 | [] | no_license | CREATE DATABASE RESTAPIPROJECT;
USE RESTAPIPROJECT;
CREATE TABLE CLIENTE(
IDCLIENTE INT PRIMARY KEY AUTO_INCREMENT,
NOME VARCHAR(50) NOT NULL,
DTNASCIMENTO TIMESTAMP,
SEXO CHAR(1),
DHCRIACAO datetime NOT NULL,
DHATUALIZACAO datetime NOT NULL,
STATUSREGISTRO INT(1) NOT NULL
);
CREATE TABLE C... | true |
9bece90926090f4537849b6e165e40a0bb1518b9 | SQL | verysuper/wda_php_train | /wda/php0626/board_log.sql | UTF-8 | 2,160 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- 主機: 127.0.0.1
-- 產生時間: 2018-06-26 07:47:57
-- 伺服器版本: 10.1.31-MariaDB
-- PHP 版本: 5.6.35
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... | true |
0258990735eb2b272ad460abb9fd425b49724379 | SQL | baysptr/E-STNK | /DB.sql | UTF-8 | 4,018 | 2.640625 | 3 | [] | no_license | -- MySQL dump 10.16 Distrib 10.1.30-MariaDB, for Win32 (AMD64)
--
-- Host: localhost Database: web_rizal
-- ------------------------------------------------------
-- Server version 10.1.30-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHA... | true |
1219c7a5dae565f30f83fb42bf77f11ecc1fe609 | SQL | btwindoanthang/home | /libs/database.sql | UTF-8 | 1,524 | 2.8125 | 3 | [] | no_license | CREATE TABLE user
(
id VARCHAR(100) CHARSET utf8 primary key,
pass VARCHAR(100) CHARSET utf8,
name VARCHAR(100) CHARSET utf8,
email VARCHAR(100) CHARSET utf8,
delete_flg VARCHAR(100) CHARSET utf8
);
insert into user values('admin','admin','thang','123@gmail.com','1');
CREATE TABLE category
(
id integer AUTO_INCREM... | true |
fc953eea2fdb99b96b8dc8ae73b7f0e960dfddb3 | SQL | doctorviolence/Powerlifting-tracker | /src/main/resources/powerlifting_tracker.sql | UTF-8 | 911 | 3.3125 | 3 | [] | no_license | create table users
(
user_id int not null,
username varchar(30) not null,
is_male boolean,
is_female boolean,
pw varchar(30) not null,
primary key(user_id)
);
create table bench_lifts
(
bench_id int not null auto_increment,
reps int,
sets int,
weight_lifted int,
date_lifted date,
is_bench boolean,
user_id... | true |
d652dfa63e8a05300d93d7fa34e47be7cd28b4c1 | SQL | DalavanCloud/hawq | /src/test/regress/sql/join.sql | UTF-8 | 16,410 | 4.15625 | 4 | [
"MIT",
"BSD-4-Clause-UC",
"BSD-3-Clause",
"ISC",
"bzip2-1.0.6",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"BSD-4-Clause",
"Artistic-2.0",
"PostgreSQL",
"LicenseRef-scancode-unknown"
] | permissive | --
-- JOIN
-- Test JOIN clauses
--
CREATE TABLE J1_TBL (
i integer,
j integer,
t text
);
CREATE TABLE J2_TBL (
i integer,
k integer
);
INSERT INTO J1_TBL VALUES (1, 4, 'one');
INSERT INTO J1_TBL VALUES (2, 3, 'two');
INSERT INTO J1_TBL VALUES (3, 2, 'three');
INSERT INTO J1_TBL VALUES (4, 1, 'four');
INSE... | true |
6a7ccf1f4deb079c4a04a9885954be566901e5fc | SQL | changhakim/HOME_SQL | /연습3.sql | UHC | 1,713 | 4.5 | 4 | [] | no_license | -- *******
-- 001.
-- HR Ű ̺ ?
-- *******
SELECT * FROM TAB;
-- *******
-- 002.
-- HR Ű ̺ ?
-- *******
SELECT COUNT(*) FROM TAB;
-- *******
-- 003.
-- , , ̸?
-- *******
SELECT EID ,LNAME ,FNAME
FROM EMP;
-- *******
-- 004.
-- ̸ s ̸ ?
-- *******
SELECT FNAME
FROM EMP
WHERE FNAME LIKE '%s';
-- *******
-- 005.... | true |
c446d713f91e5a8e24f4c0a81f25530236f12155 | SQL | rcolbert30/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/14-my_genres.sql | UTF-8 | 262 | 3.65625 | 4 | [] | no_license | -- lists all genres of the show dexter
SELECT tv_genres.name FROM tv_shows_genres INNER JOIN tv_genres
ON tv_show_genres.genre_id = tv_genres.id
INNER JOIN tv_shows ON tv_show_genres.show_id = tv_shows.id
WHERE tv_shows.title = 'Dexter' ORDER BY tv_genres.name;
| true |
0dabea79804a46f3302bc147899139ce072f55f4 | SQL | planetfederal/signal | /resources/sql/input.sql | UTF-8 | 780 | 3.546875 | 4 | [
"Apache-2.0"
] | permissive | -- name: input-list-query
-- Gets list of all active processors
SELECT * FROM signal.inputs WHERE deleted_at IS NULL
-- name: find-input-by-id-query
-- gets a processor by its uuid/primary key
SELECT * FROM signal.inputs WHERE deleted_at IS NULL AND id = :id
-- name: insert-input<!
-- inserts a new input definition
I... | true |
a3c526dc81450423b7c9e33bc07cd4d4ac08bfa2 | SQL | dreamingodd/casarover | /docs/sql/previous_deployment/20160217_wechat_index.sql | UTF-8 | 580 | 3.171875 | 3 | [] | no_license | use casarover;
alter table wechat_article add column series smallint default 0 after type;
drop table if exists wechat_series;
create table wechat_series (
id smallint primary key auto_increment,
type smallint default 0,
name varchar(16) not null
);
insert into wechat_series values(null, 2, '探庐·临安');
insert into wec... | true |
c28828020499695e1c1ae16396ea17de85f61691 | SQL | LindomarReitz/estudo-de-caso-tcc | /script.sql | UTF-8 | 1,759 | 3.53125 | 4 | [] | no_license | create table usuarios (id serial primary key, nome varchar(50) not null, data_nascimento date not null,
login varchar(50) not null, senha varchar(50) not null);
insert into usuarios(nome, data_nascimento, login, senha) values ('João da Silva', '1992-05-12', 'admin', 'teste');
create table bancos (id serial prim... | true |
a0137b7422f17e2c409b60e54eb71f2a877e67b8 | SQL | Theodorulus/PLSQL-Cinema | /Tudorache_Alexandru-Theodor_SQL.sql | UTF-8 | 26,311 | 4 | 4 | [] | no_license | --EX. 4
CREATE TABLE ACTORS (
actor_id INT PRIMARY KEY,
last_name varchar(255) NOT NULL,
first_name varchar(255) NOT NULL,
birth_date DATE NOT NULL
);
CREATE TABLE MOVIES (
movie_id INT PRIMARY KEY,
movie_name varchar(255) NOT NULL,
director_name varchar(255) NOT NULL,
release_date DAT... | true |
7325ca21a74572ba4de0202f5b7e4767ea229455 | SQL | kennyweche/Payment-Gateway-UI | /resources/views/reports/queries.sql | UTF-8 | 3,115 | 4.375 | 4 | [
"MIT"
] | permissive |
/*=================================================*/
/*All transactions from source clientID to destinationclientID*/
/*=================================================*/
select source,
(select clientName from clients c inner join client_channels_reference ccr on c.clientID=ccr.destinationClientID where ccr.code = d... | true |
33fc7a1e86c04ec090854eb0886cfa2104f44834 | SQL | isaacSolano/proyecto_bases_de_datos | /scripts/consultas_prederinidas/slt_canciones_musico.sql | UTF-8 | 130 | 3.375 | 3 | [] | no_license | select count(idcancion) cant_canciones, m.nombre
from canciones c
join musicos m on (c.idmusico = m.idmusico)
group by m.nombre
/
| true |
243045363b398cb3d046fb4f5f58094d9f3bb753 | SQL | syahrilhidayat/karya_ciledug | /karya_ciledug.sql | UTF-8 | 7,987 | 2.828125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 06 Mar 2020 pada 04.26
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... | true |
23f26544b55cace382debe738466d67de8916c49 | SQL | The-Software-Guild/guess-the-number-assessment-jaykye | /src/main/java/GuessTheNumber/initializeDataBase.sql | UTF-8 | 358 | 3.140625 | 3 | [] | no_license | DROP DATABASE IF EXISTS GuessTheNumberDB;
CREATE DATABASE GuessTheNumberDB;
USE GuessTheNumberDB;
CREATE TABLE game(
id INT PRIMARY KEY AUTO_INCREMENT,
answer CHAR(4),
finished BOOLEAN);
CREATE TABLE gameRound(
id INT PRIMARY KEY AUTO_INCREMENT,
guess CHAR(4),
timeOfGuess DATETIME,
result VARCHAR(20),
gameId INT,
FORE... | true |
c73d5a9f7a3946dcb5c91af037bd77e376fb505c | SQL | bryanlvenable/databases | /server/schema.sql | UTF-8 | 1,420 | 3.59375 | 4 | [] | no_license | DROP DATABASE IF EXISTS chat;
CREATE DATABASE chat;
USE chat;
-- Input
-- ---
-- Table 'username'
-- users and IDs
-- ---
-- DROP TABLE IF EXISTS `username`;
-- CREATE TABLE `username` (
-- `id` INTEGER(10) NULL,
-- `username` VARCHAR(20) NULL,
-- PRIMARY KEY (`id`)
-- ) COMMENT 'users and IDs';
-- ---
--... | true |
77cd7c99b41a7fab35b71ac27b457a1b5fd74c47 | SQL | bobmorane02/wf3-032017 | /SQL/03-Bibliothéque/requetes_bibliotheque.sql | UTF-8 | 8,234 | 4.25 | 4 | [] | no_license | -- ********************************************
-- Création de la BDD
-- ********************************************
CREATE DATABASE bibliotheque;
USE bibliotheque;
-- copie/colle le contenu de bibliotheque.sql dans la console
-- ********************************************
-- Exercices
-- *************************... | true |
6432522f07e2f5946944703b7e84ef0677dec3d2 | SQL | SanjanaKoka/DoctorsNote | /Database/Add Doctors.sql | UTF-8 | 1,058 | 3.609375 | 4 | [] | no_license | -- -----------------------------------------------------
-- Table `DoctorsNote`.`Doctor`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DoctorsNote`.`Doctor` (
`doctorID` INT NOT NULL AUTO_INCREMENT,
`systemID` INT NULL,
`Name` VARCHAR(45) NULL,
`Location` VARCHAR(45) NULL,... | true |
271c90ff011e7caa306fe6255edb83fed6f8210b | SQL | jonahvimahi/sql-2-lab | /subqueries.sql | UTF-8 | 238 | 3.09375 | 3 | [] | no_license | SELECT *
FROM invoice i
WHERE invoice_id IN(
SELECT invoice_id
FROM invoice_line il
WHERE il.unit_price > .99
);
SELECT *
FROM playlist_track pt
WHERE playlist_id IN(
SELECT playlist_id
FROM playlist p
WHERE p.name = 'Music'
);
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.