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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
40ba1d8001d59029e815709cae67e6823ce2bd06 | SQL | Greta741/lePets | /database/roles.sql | UTF-8 | 1,880 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 13, 2016 at 01:24 PM
-- Server version: 5.6.25
-- PHP Version: 5.6.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
ff54c6f0d544bbd7dd975c61fadefd2948376cc6 | SQL | PavelRavvich/NLPCoach | /src/main/resources/db.sql | UTF-8 | 437 | 2.625 | 3 | [] | no_license | CREATE DATABASE nlp ENCODING 'UTF8';
CREATE TABLE IF NOT EXISTS comment (
);
CREATE TABLE IF NOT EXISTS phrases (
id SERIAL NOT NULL ,
x INTEGER NOT NULL ,
y TIMESTAMP NOT NULL ,
PRIMARY KEY (id)
);
INSERT INTO phrases (id, jsonPhrase)
VALUES (DEFAULT , '{"jsonPhrase":{"I ":false,"do not ":f... | true |
a1ed685c4d46203db48e25d3e4a90b84e7c78c44 | SQL | BurntLeftovers/cs50 | /pset7-movies/7.sql | UTF-8 | 162 | 3.578125 | 4 | [] | no_license | SELECT movies.title, ratings.rating
FROM movies
INNER JOIN ratings ON movies.id = ratings.movie_id
WHERE movies.year = '2010'
ORDER BY ratings.rating DESC, title; | true |
0eed55d4eaf8385637a5a87726a7d12ec0b28b7e | SQL | 3280382/rdesj | /schema/oracle/system/Dictionary.sql | UTF-8 | 859 | 2.953125 | 3 | [] | no_license | drop table SYS_DICTIONARY;
create table SYS_DICTIONARY
(
ID number(12) not null primary key,
PARENT_ID number(12),
NODES_TYPE varchar(10),
PARENT_KEY varchar(200),
KEY varchar(200) not null,
ALIAS varchar(200),
VALUE varchar(200),
VALUETYPE varchar(200),
VALIDATION varchar(1000),
VALU... | true |
37be598a27e3aa37d06a27199fa7ce3d5e2430bf | SQL | j7ng/CLFY_SA | /SA/Tables/BATCH_JOB_EXECUTION_PARAMS.sql | UTF-8 | 418 | 2.703125 | 3 | [] | no_license | CREATE TABLE sa.batch_job_execution_params (
job_execution_id NUMBER(19) NOT NULL,
type_cd VARCHAR2(6 BYTE) NOT NULL,
key_name VARCHAR2(100 BYTE) NOT NULL,
string_val VARCHAR2(250 BYTE),
date_val TIMESTAMP,
long_val NUMBER(19),
double_val NUMBER,
identifying CHAR NOT NULL,
CONSTRAINT job_exec... | true |
1d7fb98c182f4024b02a96ae7cfae8b3a6111f73 | SQL | vyasishanatc194/property-api-php | /property_system.sql | UTF-8 | 2,027 | 3.421875 | 3 | [] | no_license | -- Adminer 4.6.3 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
SET NAMES utf8mb4;
DROP TABLE IF EXISTS `property_type`;
CREATE TABLE `property_type` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(20) COLLATE utf8mb4_unic... | true |
18b270b5eb2422b586ffc2a077c6bbb187bf9e0b | SQL | LGalassi/cs50-2020-psets | /psets/pset7/movies/10.sql | UTF-8 | 215 | 3.53125 | 4 | [] | no_license | SELECT DISTINCT name
FROM people
JOIN directors
ON people.id = directors.person_id
JOIN movies
ON directors.movie_id = movies.id
JOIN ratings
ON movies.id = ratings.movie_id
WHERE rating >= 9.0; | true |
8aac7f4626438b3d2159c93721e62b1ab88c0f8b | SQL | Melanjnk/egg | /docker/local/mysql/dump/egg.sql | UTF-8 | 3,535 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Хост: db
-- Время создания: Дек 28 2020 г., 11:04
-- Версия сервера: 10.5.8-MariaDB-1:10.5.8+maria~focal
-- Версия PHP: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_... | true |
899d940bc723287ddfef326ee1571d89c3fd386d | SQL | Shebara/ship-app | /db.sql | UTF-8 | 5,190 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 06, 2020 at 02:43 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.2.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
cfeeb691aff696f1b6c95afcdf04910479d8047c | SQL | chejuho/itfreeswebapp | /Kankokujin/sql/create_category.sql | UTF-8 | 674 | 2.859375 | 3 | [] | no_license |
DROP TABLE IF EXISTS t_category;
CREATE TABLE t_category (
user_id varchar(20) NOT NULL DEFAULT '',
code varchar(4) NOT NULL DEFAULT '',
name varchar(200) NOT NULL DEFAULT '',
level int(2) NOT NULL DEFAULT '0',
orderNo int(3) NOT NULL DEFAULT '0',
oya_code varchar(4) DEFAULT NULL,
PRIMARY KEY (u... | true |
b9558e7a71346c4389912d5742574ad0af8587d2 | SQL | clsr0901/clsr-blog | /src/main/resources/schema.sql | UTF-8 | 3,364 | 3.671875 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS blog.t_user (
id bigint(20) NOT NULL AUTO_INCREMENT,
avatar varchar(200) NOT NULL DEFAULT '' COMMENT '用户头像',
email varchar(50) DEFAULT '' COMMENT '用户邮箱',
password varchar(50) NOT NULL COMMENT '密码',
username varchar(100) NOT NULL COMMENT '用户名',
phone varchar(11) DEFAULT '' COMMENT ... | true |
bc35eb7e4dbe4213cf81c68ef865d7822816ff7f | SQL | J-N/swganh | /data/sql/galaxy/scripts/guild.sql | UTF-8 | 759 | 3.421875 | 3 | [
"MIT"
] | permissive | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET FOREIGN_KEY_CHECKS=0 */;
DROP TABLE IF EXISTS `guild`;
CREATE TABLE IF NOT EXISTS `guild` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`tag` tinytext,
`guild_list` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
K... | true |
6791786d1b0a75d11ee7d0c1c0d5513b4f65eee7 | SQL | leedabee/databricks-forum-support-notebooks | /db-forum-20881/db-forum-20881-unable-to-handle-columns-enclosed-by-characters.sql | UTF-8 | 3,706 | 3.59375 | 4 | [] | no_license | -- Databricks notebook source
select "hello"
-- COMMAND ----------
-- MAGIC %python
-- MAGIC
-- MAGIC # This is demonstrating the use of 'magic' commands in databricks, allowing you to switch between languages in one notebook. Since you created the notebook as SQL, that's the default language for a block. You overr... | true |
a2adcc82a0081b36f26f3cdcf89128ba089f128d | SQL | ochukai/green-apple | /sql/table.sql | UTF-8 | 4,569 | 2.78125 | 3 | [
"MIT"
] | permissive | -- Table "public.doctor_bound_info"
-- Column | Type | Modifiers
-- -----------------+-----------------------------+----------------------------------------------------------------
-- id | integer ... | true |
a9ec3b5579011ae1ad59feefc5bfb5f421b405ed | SQL | LeoCavalcante07/BugsBunny_modulo_2 | /back_up_bugsBunny/db_bugs_bunny_tbl_fale_conosco.sql | UTF-8 | 2,594 | 2.984375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64)
--
-- Host: localhost Database: db_bugs_bunny
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... | true |
3df7af5632e085dbfaacbc267f149b08bf958595 | SQL | Dev-Davis/candy_tracker_api | /create_tables.sql | UTF-8 | 3,804 | 3.640625 | 4 | [] | no_license |
IF not exists (SELECT * FROM sys.tables WHERE [name] = 'Candy')
BEGIN
CREATE TABLE [Candy]
(
[Id] UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(),
[Name] NVARCHAR(255) not null,
[TypeId] INT not null,
[Size] INT not null,
[ImgUrl] NVARCHAR(max) not null
)
END
ELSE
PRINT 'Candy table already exists'
IF no... | true |
45750b3c573a104938fe08cef647c04f599cdb46 | SQL | Diyatho/FlashCard-Study-App | /backend/database/cardschema.sql | UTF-8 | 1,169 | 4.125 | 4 | [] | no_license | BEGIN TRANSACTION;
DROP TABLE IF EXISTS deck_cards;
DROP TABLE IF EXISTS card_keyword;
DROP TABLE IF EXISTS deck;
DROP TABLE IF EXISTS keyword;
DROP TABLE IF EXISTS cards;
DROP TABLE IF EXISTS subject;
CREATE TABLE subject (
subject_id serial PRIMARY KEY,
subject_name varchar (50)
);
CREATE TABLE cards (
card_id... | true |
d64ad48fcbb5ea7f21fdefe6b87d4db8d824cde1 | SQL | openit/Oracle_SQL_Scripts | /rc_rman_cont.sql | UTF-8 | 679 | 2.515625 | 3 | [] | no_license | PROMPT ##############################################################################
PROMPT Run the rc_rman_info_all.sql First to get the details needed for this script
PROMPT ##############################################################################
select btype, btype_key, session_key, session_recid, db_nam... | true |
c9ba0afc03671cdd1797625f0a0b6e91e1d768db | SQL | KPess/SQL-Afternoon-1 | /sql-1-afternoon.sql | UTF-8 | 3,519 | 3.734375 | 4 | [] | no_license | CREATE TABLE person (
person_id SERIAL,
name VARCHAR(100),
age INT,
height INT,
city VARCHAR(100),
favorite_color VARCHAR(100)
);
INSERT INTO person (
name,
age,
height,
city,
favorite_color
) VALUES (
'Kevin Pessetto', 31, 185, 'Dallas', 'Blurquoise');
INSERT INTO person... | true |
c3632691c2d423702b7eb8e6df1e8ab2cdcf4dda | SQL | kmulligan01/Bamazon | /bamazon.sql | UTF-8 | 949 | 3.375 | 3 | [] | no_license | -- Create a database called 'bamazon' and switch into it for this activity --
CREATE DATABASE bamazon;
USE bamazon;
-- Create a table called 'product' which will contain the store inventory --
CREATE TABLE product (
item_id INT(11) AUTO_INCREMENT NOT NULL,
product_name VARCHAR(30) NOT NULL,
department_name VARCHAR(... | true |
571f1b520a0c78188d3ee9c8b6c4b86b793948b3 | SQL | cmehta1/Retail-Business-Management-System | /app/1.sql | UTF-8 | 745 | 2.6875 | 3 | [] | no_license |
/*Here we have created sequence pur_# to get value os purchase id starting from 100000 and incremented by 1 every time we need to enter value of it into the table*/
create sequence pur_# minvalue 100000 maxvalue 999999 start with 100000 increment by 1;
/*Here we have created sequence sup_# to get value os supplier id... | true |
abdece3467f933d9ac6796e233b748c7a79e7859 | SQL | lcagney/MSDS-Practicum-2 | /Code/combine_dataset.sql | UTF-8 | 621 | 3.421875 | 3 | [] | no_license | --dataset from https://data.world/kcmillersean/billboard-hot-100-1958-2017, combined with the following sql
SELECT a.weekid as weekid,week_position,a.song as song,a.performer as performer,weeks_on_chart,peak_position
,spotify_track_duration_ms,spotify_track_explicit,danceability,energy,c.key,loudness,mode,speechiness
... | true |
d79576eb4270924a747ddca5c88c328d6ca331bf | SQL | adityatoshniwal/pgadmin4 | /web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_int_identity.sql | UTF-8 | 555 | 2.578125 | 3 | [
"PostgreSQL"
] | permissive | -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_3_$%{}[]()&*^!@""'`\/#";
ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN IF NOT EXISTS "col_3_$%{}[]()&*^!@""'`... | true |
107b94e2895d2d102ca9f335f7f1d61628749bf3 | SQL | cannli/vue-dianshang | /apiLearn-master/sql/db/exapp.sql | UTF-8 | 6,518 | 2.9375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : exapp
Source Server Version : 50709
Source Host : localhost:3306
Source Database : exapp
Target Server Type : MYSQL
Target Server Version : 50709
File Encoding : 65001
Date: 2020-05-23 23:12:38
*/
SET FOREIGN_KEY_CHECKS=0;
-- -------... | true |
949ec3dd92742d177b5cb31097857e9f4985afa1 | SQL | dbillue/AV | /AV/SQL Scripts/PLSQL/Package_Mng_Dept_Projects_Procs_Function_Calls.sql | UTF-8 | 1,961 | 3.75 | 4 | [] | no_license | /*****************************
Author: Duane Billue / Oracle
Date: 2019-11-05
Description: PACKAGE manage_dept_proj proc and function calls
*****************************/
-- Query nested table using TABLE function
SELECT t1.DEPT_ID, t1.NAME, t1.BUDGET, t2.*
FROM DEPARTMENT t1,
TABLE(t1.Projects) t2 OR... | true |
b8171132386efafdf6d9ae91dfa1398249ab2e83 | SQL | laughing1990/aplan-fork | /aplanmis-data-exchange/sql/多规三张表视图.sql | UTF-8 | 1,834 | 3.5625 | 4 | [] | no_license | -- 3.4.3地方项目用地红线界址信息表
CREATE VIEW spgl_xmydhxjzxxb_view
AS
SELECT `file`.`SYS_FILE_ID` AS `DFSJZJ`, '000000' AS `XZQHDM`, `file`.`xmdm` AS `XMDM`, `file`.`SYS_FILE_ID` AS `JZWJXH`, `file`.`FILE_NAME` AS `JZWJMC`
, `file`.`CMP` AS `JZWJSM`, `file`.`ejz` AS `JZWJFJ`, 1 AS `SJYXBS`, `file`.`CDT` AS `MODIFY_TIME`
FROM `sy... | true |
eb17c6977a7c9d7a665454b34bef1c1164d8211b | SQL | Xinli0623/Streaming-Finance-Data-with-AWS-Lambda | /query.sql | UTF-8 | 173 | 2.640625 | 3 | [] | no_license | SELECT name,hour,max(high) AS max_high
FROM
(SELECT *,SUBSTRING(Datetime,12,2) AS hour
FROM project3.sta9760xinliproject3)
GROUP BY name,hour
ORDER BY name, hour; | true |
1fad32b272cb4d757a0508b44bd263a413ec7754 | SQL | codegdo/portal | /express/src/database/entities/portal.table.sql | UTF-8 | 6,760 | 3.984375 | 4 | [] | no_license | -- dbo
CREATE TABLE IF NOT EXISTS dbo.feature (
id SERIAL NOT NULL,
name VARCHAR(45) NOT NULL,
price NUMERIC(8,2),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
--
PRIMARY KEY(id)
);
CREATE TABLE IF NOT EXISTS dbo.feature_module (
feature_id INT NOT NUL... | true |
627ae013d7fd50e364ed34825f9fddd9afd57cda | SQL | kongshuaifu/Deploy_CobubRazor | /sql_script/razor_dw.sql | UTF-8 | 267,158 | 3.625 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2017-07-25 17:25:53
-- 服务器版本: 5.6.26
-- PHP Version: 5.6.12
use razor_dw;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
1dbe238ddd0e8109a5234eb28ebea09e32a021fc | SQL | enedyboy/Senin_141111251_FerikEnedyWijaya | /Senin_141111251_FerikEnedy/project.sql | UTF-8 | 10,982 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 27, 2016 at 06:44 AM
-- Server version: 5.5.39
-- PHP Version: 5.4.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
c14f1e4d3ce7c8efa11a8a11ca4f3d27aa522ca7 | SQL | ducrz/Curso-Oracle-Developer-SQL-e-PL-SQL. | /conteudo/modulo2/temporaria.sql | UTF-8 | 1,901 | 4.03125 | 4 | [] | no_license | -- Sequencia exemplo 1
--A clausula indica que os dados devem ser excluidos no final da transacao ou no final da sessao.
-- criando tabela temporaria
CREATE GLOBAL TEMPORARY TABLE minha_temp (
id NUMBER,
nome VARCHAR2(20)
)
ON COMMIT DELETE ROWS;
-- Inserindo, mas nao realizando commit, .
INSE... | true |
1e599810872821a1f92f209573c367bb8576b0a0 | SQL | Psayta/Jump_Data_Project | /DataNorm.sql | UTF-8 | 469 | 3.703125 | 4 | [] | no_license | --identifying duplicates
SELECT movie_name, language, year_of_release, COUNT(*)
FROM amazon_movie2
GROUP BY movie_name, language, year_of_release
HAVING COUNT(*) > 1;
--deleted duplicates
DELETE FROM Amazon_Movies2 WHERE movie_name IN (
SELECT max(MOVIE_NAME)
FROM AMAZON_MOVIES2
GROUP BY MOVIE_... | true |
ead4655cdfaa960cbb7951318697d7a7409a2f0c | SQL | kHeNoTbB/Oracle | /PLSQL/07_PLSQL_Table.sql | UTF-8 | 1,705 | 3.84375 | 4 | [] | no_license | /******************************************************************
PL/SQL 테이블
* 일종의 배열이라고 생각하면 이해하기 쉬움
* 테이블 크기에 제한이 없으며, 행의 크기는 데이터가 들어옴에 따라 자동 증가함
* Binary_integer 타입의 인덱스 번호가 순서대로 정해짐
* 하나의 테이블에 한 개의 컬럼 데이터를 저장함
TYPE prdname_table IS TABLE OF varchar2(30)
INDEX BY BINARY_INTEGER;
prdname_tab prdname_tabl... | true |
615a69c4192d8c5f4864b2644d6d22a121a159d7 | SQL | simsim466/foodcourt | /target/classes/db/initDB.sql | UTF-8 | 2,551 | 4.125 | 4 | [] | no_license | DROP TABLE user_roles IF EXISTS;
DROP TABLE meals_dishes IF EXISTS;
DROP TABLE votes IF EXISTS;
DROP TABLE dishes IF EXISTS;
DROP TABLE meals IF EXISTS;
DROP TABLE restaurants IF EXISTS;
DROP TABLE users IF EXISTS;
DROP SEQUENCE global_seq IF EXISTS;
CREATE SEQUENCE GLOBAL_SEQ AS INTEGER START WITH 1000;
CREATE TABLE... | true |
880d6610a78505a1d80cdfe604f049d22ba01ca7 | SQL | Ikinglong/Teacher_Salary | /web/Sql_Script/Constant_parameter.sql | UTF-8 | 300 | 2.65625 | 3 | [] | no_license | drop table if exists constant_parameter;
create table constant_parameter(
id int primary key not null COMMENT '参数id',
item_name varchar(16) not null COMMENT '参数名称',
value double not null comment '参数值'
) comment ='常量参数表,包括五险比例、公积金比例'; | true |
eeddd976744acf95c62bdd1bee5690c2e915c727 | SQL | Bootz/IceCreamdb | /arctic_world/auctionhouse.sql | UTF-8 | 2,951 | 2.703125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : arcticdev
Source Server Version : 50509
Source Host : localhost:3306
Source Database : arctic_world
Target Server Type : MYSQL
Target Server Version : 50509
File Encoding : 65001
Date: 2012-04-04 17:26:12
*/
SET FOREIGN_KEY_CHECKS=0;
... | true |
3aee4e5aa38153ff0dd0b2df6c66b7f8d9ca94a0 | SQL | Ekirapapaul/possible-config | /openmrs/reports/Nutrition_Program/Integrated_Management_of_Acute_Malnutrition_IMAM_Program.sql | UTF-8 | 5,319 | 4.125 | 4 | [] | no_license |
SELECT
final.`Age Group` AS 'Age Group',
final.`Sex` AS 'Sex',
sum(final.`Children at End of Last Month`) AS 'Children at End of Last Month',
sum(final.`New Admission`) AS 'New Admission',
sum(final.`Re-admission`) AS 'R... | true |
7989c25cd4d728cce075a4c5ec7946203cd3b65e | SQL | mozilla/marketing-analytics | /telemetry/snippetReporting/tempExploreAssaRouterEventsDailyTable.sql | UTF-8 | 534 | 3.09375 | 3 | [] | no_license | -- Used to pull data by client_id to load into pyspark for comparison to mainsummary aDAU / DAU Pulls
SELECT
date,
impression_id as client_id,
release_channel,
SUM(CASE WHEN event = 'IMPRESSION' THEN 1 ELSE 0 END) as impressions,
SUM(CASE WHEN event = 'CLICK_BUTTON' THEN 1 ELSE 0 END) as clicks,
... | true |
8f080ffef5afc7e2d29e5fa015b415e709a48c60 | SQL | neskoc/databas | /skolan/ddl_more_tables.sql | UTF-8 | 1,393 | 3.796875 | 4 | [] | no_license | --
-- file: dml_join.sql
-- Joina tabell.
-- By necu20 for course databas.
-- 2021-01-30
--
USE skolan;
SET NAMES 'utf8';
--
-- Update table larare and larare_pre to use same charset
-- and collation.
--
ALTER TABLE larare CONVERT TO CHARSET utf8 COLLATE utf8_swedish_ci;
ALTER TABLE larare_pre CONVERT TO CHARSET utf8... | true |
75f584f5b4f7fd65e70883af899e36b20cda35d9 | SQL | ZveroBoy340/Japan_Form | /japan.sql | UTF-8 | 2,281 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Фев 02 2021 г., 17:30
-- Версия сервера: 5.7.29
-- Версия PHP: 7.3.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... | true |
428ecbca58e6b2b0b33cc3e4280dae817d2577e0 | SQL | agliznetsov/insert-demo | /src/main/resources/alter-table.sql | UTF-8 | 3,553 | 4.09375 | 4 | [] | no_license | select name, setting from pg_settings where name like '%wal_size%' or name like '%checkpoint%' order by name;
-- 150M
SELECT reltuples, relname FROM pg_catalog.pg_class WHERE relname = 'attributes_copy';
-- 1m 31s
ALTER TABLE attributes_copy ADD CONSTRAINT fk_attributes_1 FOREIGN KEY (type) REFERENCES attribute_type... | true |
4bfb59c1fc226034625de12868faf52a72f5b9f4 | SQL | dhirutech/HexadLMServices | /postgresql_hdb_schemas.sql | UTF-8 | 2,573 | 3.984375 | 4 | [] | no_license | CREATE SCHEMA hexad;
CREATE TABLE hexad.user (
user_id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY,
user_name text NOT NULL,
password text NOT NULL,
first_name text NOT NULL,
las_name text NOT NULL,
email text NOT NULL,
phone text NULL,
address text NOT NULL,
dob timestamp NULL,
isactive bool NOT NULL D... | true |
0209de3a518fdd163f30e56183babd5d7c7fda37 | SQL | mutedalien/conspect | /PHP_2/less_8/ДЗ new/untitled8/test.sql | UTF-8 | 3,876 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Фев 28 2019 г., 21:06
-- Версия сервера: 5.6.41
-- Версия PHP: 5.5.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... | true |
7e5e4461308179617dfe805f5493b651235c0c67 | SQL | AlexandraSova/Homework | /DataBase/CreateDataBase/create_tables.sql | UTF-8 | 2,582 | 3.6875 | 4 | [] | no_license |
--CREATE DATABASE shop1;
CREATE TABLE address
(
id serial NOT NULL,
country character varying(100) NOT NULL,
region character varying(100) NOT NULL,
city character varying(100) NOT NULL,
street character varying(100) NOT NULL,
house character varying(10)NOT NULL,
flat character varying(10)NOT NULL,
C... | true |
b729b5645e3fbd3a52900d62aa0375cf6393a3e4 | SQL | ricokritzer/TriasAnalyser | /Studienarbeit/Data/SQL/select/SELECT_CancelledHours.sql | UTF-8 | 514 | 3.703125 | 4 | [] | no_license | DROP TABLE CancelledHours;
CREATE TABLE CancelledHours(
id int PRIMARY KEY,
cancelled decimal(8),
total decimal(8),
percentage decimal(8,5));
INSERT INTO CancelledHours(id, total) SELECT HOUR(Stop.timetabledTime) h, count(*) FROM Stop GROUP BY h;
UPDATE CancelledHours SET cancelled = ... | true |
55a0e08f724740f7f7b0fb26c20dfcf32b194549 | SQL | binoymvee/thunderbuild | /db/thunder_cloud_specification.sql | UTF-8 | 2,104 | 2.953125 | 3 | [] | no_license | --
-- Dumping data for table `thunder_cloud_specification`
--
INSERT INTO `thunder_cloud_specification` (`id`, `role_id`, `spec_category`, `spec_name`, `spec_column`, `default_value`) VALUES
(NULL, 1, 'keystone', 'Openstack Endpoint Host', 'openstack::endpoints::host', 'controller'),
(NULL, 1, 'messaging_server', 'Me... | true |
23afbb21eb5bf3397d98f646867d05b09fecc08e | SQL | devtb12/sql-2-afternoon | /Answers/1-Solution.sql | UTF-8 | 2,916 | 2.671875 | 3 | [] | no_license | -- `$/
-- __ O$
-- _.-" ) $'
-- .-"`. .-": o ___ ($o
-- .-".- .' ,st+. .' , \ ($
-- :_..-+"" : T "^T=... | true |
e33a4a2f5d7e8f751da572e09b40efc8549a034d | SQL | ghassanbasrak/ch_clients_portal | /DB/code4.sql | UTF-8 | 13,228 | 3.28125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 22, 2021 at 01:32 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
926a63817b7388e221bc4bc73f74354536ada358 | SQL | winter111/web | /02_PHP/day06/xuezi/xuezi.sql | UTF-8 | 1,096 | 2.765625 | 3 | [] | no_license | SET NAMES UTF8;
DROP DATABASE IF EXISTS xuezi;
CREATE DATABASE xuezi CHARSET=UTF8;
USE xuezi;
#创建笔记本型号表
#创建笔记本表xz_laptop
#创建笔记本图片表xz_laptop_pic
#创建用户信息表xz_user
CREATE TABLE xz_user(
uid INT PRIMARY KEY AUTO_INCREMENT,
uname VARCHAR(32) UNIQUE NOT NULL,
upwd VARCHAR(32),
email VARCHAR(64),
... | true |
fd142a76f3e2741936a18a7db173adb00f9f994d | SQL | hammer-mt/ViralAnalytics | /services/extract.sql | UTF-8 | 3,529 | 3.1875 | 3 | [] | no_license | -- Retrieves the latest document change events for all live documents.
-- timestamp: The Firestore timestamp at which the event took place.
-- operation: One of INSERT, UPDATE, DELETE, IMPORT.
-- event_id: The id of the event that triggered the cloud function mirrored the event.
-- data: A raw JSON payload of t... | true |
0dce5f176966fd3848c01ab0934a88cd4f9dbacf | SQL | OnePlc/PLC_X_Room | /data/data_furniture.sql | UTF-8 | 2,648 | 3.171875 | 3 | [
"BSD-3-Clause"
] | permissive |
--
-- -- Core Form - Furniture Form Fields
--
INSERT INTO `core_form_field` (`Field_ID`, `type`, `label`, `fieldkey`, `tab`, `form`, `class`, `url_view`, `url_list`, `show_widget_left`, `allow_clear`, `readonly`, `tbl_cached_name`, `tbl_class`, `tbl_permission`) VALUES
(NULL, 'select', 'Article', 'article_idfs', 'roo... | true |
619430b41f99501d5b3f6be2d88881d01b18083b | SQL | larsjohanssonblank/dbt-utils-sqlserver | /integration_tests/models/cross_db_utils/test_date_trunc.sql | UTF-8 | 659 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive |
with data as (
select * from {{ ref('data_date_trunc') }}
)
{% if target.type == 'sqlserver' %}
select
{{dbt_utils_sqlserver.date_trunc('day', 'updated_at') }} as actual,
day(day) as expected
from data
union all
select
{{ dbt_utils_sqlserver.date_trunc('month', 'updated_at') }} as actual,
... | true |
50cfb510fd558499b82b77244fa17bbce70020e7 | SQL | AbelSpecs/gripecita-china | /Entrega 02 - Final/Funciones, Modulos y Simulaciones.sql | UTF-8 | 24,039 | 3.359375 | 3 | [] | no_license | -----------------------------------------------------------------------------------------------------------------------------
-- Funciones
-----------------------------------------------------------------------------------------------------------------------------
create or replace function edad_a (fecha_nac date) retu... | true |
b33fcf28055b650be36ba59dd0696e503d3ce127 | SQL | cvick32/mastery-with-sql | /chapter_4_exercises.sql | UTF-8 | 3,951 | 4.59375 | 5 | [] | no_license | -- 4.1 Write a query to return the total count of customers in the customer table and the count of how many customers provided an email address
select count(*) as "# customers", count(email) as "# customers with email" from customer;
-- 4.2 Building on the previous exercise, now return an additional result showing th... | true |
03a8f2e42803e48f59dab462adad03ba6d1db37a | SQL | oncicaradupopovici/Pet | /Pet.Migrations/SqlScripts/Views/003.vwExpenseByCategory.sql | UTF-8 | 418 | 3.859375 | 4 | [] | no_license | create view vwExpenseByCategory
as
select
agg.ExpenseMonth,
agg.ExpenseCategoryId,
agg.value,
c.Name as ExpenseCategoryName,
row_number() over (order by agg.ExpenseMonth, agg.ExpenseCategoryId) as Id
from (
select ExpenseMonth, ExpenseCategoryId, sum(value) as value
from Expense
group by ExpenseMonth, Expe... | true |
fe414b77f88e1a4156cbdbb9dbe1abc45df3dcf8 | SQL | gchandra10/dbpracticequeries | /hashingexample.sql | UTF-8 | 1,015 | 3.6875 | 4 | [] | no_license | drop table users;
CREATE TABLE users (
id INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'UNSIGNED means cannot take negative values'
,first_name VARCHAR(50) NOT NULL
,last_name VARCHAR(50) NOT NULL
,email VARCHAR(255) DEFAULT 'noname@noname.com' NOT NULL
,full_name VARCHAR(150) AS (concat(fi... | true |
c32f21cd8d2020c77242022f6a08f1777d03bb12 | SQL | nemesis-umbrella/HorarioAPI | /sql/Postgres/s_asistencia_postgres.sql | UTF-8 | 3,555 | 3.765625 | 4 | [
"MIT"
] | permissive | -- SQLite
--
-- Creación de la BD s_asistencia
--
-- Creación de tablas catalogo
--
CREATE TABLE ct_estado(
id_estado INTEGER PRIMARY KEY,
descripcion VARCHAR(50)
);
CREATE TABLE ct_carrera(
clave_carrera CHAR(5) PRIMARY KEY,
descripcion VARCHAR(50)
);
CREATE TABLE ct_materia(
... | true |
daea315a5f4ec6afd8af5c9c95a0e4796ee6c092 | SQL | MarcceloSelv/DBA | /Performance/Top20Queries2/IO.sql | UTF-8 | 1,528 | 3.96875 | 4 | [] | no_license | ;with high_io_queries as
(
select top 20
query_hash,
sum(total_logical_reads + total_logical_writes) io,
sum(execution_count) executionCount
from sys.dm_exec_query_stats
where query_hash <> 0x0
and execution_count > 15
group by query_hash
order by sum(total_logical_reads + tota... | true |
05afb15eeba0ebdd8e21abd985dace0f3c6cc34e | SQL | seanxinhao/DBFinalProject | /partB/partB-8.sql | UTF-8 | 2,689 | 3.53125 | 4 | [] | no_license | clear column
set linesize 300
column id format A2
column "employee name" format A20
column JAVA1 format 9
column JAVA2 format 9
column J2EE format 9
column SQL1 format 9
column SQL2 format 9
column PRJM1 format 9
column PRJM2 format 9
column RUBY format 9
column PYTHO format 9
column MOBDA format 9
column "Latest Date ... | true |
aaa88b8a3af7937fb42cd8ddda38ed407e035512 | SQL | oshiete-karen/bot | /config/migration.sql | UTF-8 | 1,022 | 3.5 | 4 | [] | no_license | CREATE DATABASE oshiete_karen DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE user (
id MEDIUMINT unsigned NOT NULL AUTO_INCREMENT,
mid VARCHAR(36) NOT NULL,
name VARCHAR(36) NOT NULL, -- LINEの名前って何バイトまでだっけ
google_credentials_json TEXT,
PRIMARY KEY (`id`)
);
ALTER TABLE user
MODIFY COLUMN... | true |
7203efcdb00606c77c5af95358494280d4539e68 | SQL | iumairhasan/SQLPractise | /views.sql | WINDOWS-1252 | 1,394 | 3.9375 | 4 | [] | no_license |
/*
Create a view to include the encryption and
schemabinding options. Encryption protects the
view query definition. Schemabinding means the
definition of the database object(s) on which
the view is defined can not be changed without
first dropping the view.
*/
CREATE VIEW vwEmployeeContactInfo1
WITH ENCRYPTION, SCHE... | true |
24078e19ce00e9dc2fedf60cdddceac6175e60fd | SQL | humber42/tyke-backends | /schoolar-management-service/src/main/resources/db/migration/V11__adding_career_to_group.sql | UTF-8 | 184 | 2.921875 | 3 | [] | no_license | ALTER TABLE public.grupo ADD id_carrera int NULL;
ALTER TABLE public.grupo
ADD CONSTRAINT grupo_carrera_id_fk
FOREIGN KEY (id_carrera) REFERENCES public.carrera (id) ON DELETE CASCADE; | true |
c9c55f373a4413f22bf4f45c71f17938199c5e9c | SQL | Bpara001/CS_UCR | /cs166/lab3/excercise1.sql | UTF-8 | 1,208 | 2.984375 | 3 | [] | no_license | RESTRICT=No ACTION=defualt
CREATE TABLE Professor (ssn INTEGER NOT NULL,
name text,
age INTEGER,
rank text,
specialty text,
PRIMARY KEY(ssn)
ON DELETE NO ACTION
));
CREATE TABLE Dept ( dno INTEGER NOT NULL,
dname text,
office text,
ssn INTEGER,
PRIMARY KEY... | true |
33730cb33fb047f6e49ab6757b68a27fb8bf6476 | SQL | wladko0/sql-scripts-macola-wisys-epicor | /PO-AllPurchaseOrders-Updated_4_19_12.sql | UTF-8 | 1,890 | 3.375 | 3 | [] | no_license | SELECT CASE WHEN PL.qty_received < PL.qty_ordered THEN 'OPEN'
ELSE 'RECEIVED'
END AS [Status], PH.ord_no AS [PH.ord_no], PH.vend_no AS [PH.vend_no], AP.vend_name AS [AP.vend_name], PH.ord_dt AS [PH.ord_dt], PL.vend_no AS [PL.vend_no],
PL.item_no AS [PL.item_no], PL.vend_item_no AS [PL.vend_item_... | true |
f479db72ea4fe5e196feb8b211af9bff38407e22 | SQL | Niyati16/it635 | /libproject.sql | UTF-8 | 4,375 | 3.375 | 3 | [
"MIT"
] | permissive | -- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
--
-- Host: localhost Database: libproject
-- ------------------------------------------------------
-- Server version 5.7.21-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER... | true |
83b6e458e269d64c048d10de7c403fe7b1e6428b | SQL | Nokias34/node-auth-jwt-3 | /testdb2.sql | UTF-8 | 6,229 | 3.21875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.30, for Linux (x86_64)
--
-- Host: localhost Database: testdb2
-- ------------------------------------------------------
-- Server version 5.7.30-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SE... | true |
0c44955749f488028182f573eeb09a2b3b7de6a0 | SQL | twickatwk/codingchallenges | /Leetcode/SQL/getSecondHighestSalary.sql | UTF-8 | 185 | 3.515625 | 4 | [] | no_license |
-- this query will return the second highest salary from the employee table
select max(salary) as "SecondHighestSalary"
from employee
where salary < (select max(salary) from employee) | true |
be387adbe1810e6aee09d04d9657ba1497e61761 | SQL | manickaa/cs340-Final-Project | /queries/DML.sql | UTF-8 | 16,594 | 4.03125 | 4 | [
"BSD-3-Clause"
] | permissive | -- Name: GROUP-25 Aishwarya Manicka Ravichandran and Amy Robertson
-- Description: Data Manipulation queries for tourism database
----------------------------------------
--------- Queries for Customer ---------
-----------------------------------------
--
-- SELECT query for `customers` display
--
SELECT customers.cus... | true |
2c1460243f26dfc9353cafeca894fbced2ac467e | SQL | Easy-Dojo/Java-Backend-Template | /src/main/resources/db/migration/V1__product.sql | UTF-8 | 408 | 2.890625 | 3 | [] | no_license | CREATE TABLE PRODUCT
(
ID VARCHAR(32) NOT NULL,
NAME VARCHAR(50) NOT NULL,
PRICE DECIMAL NOT NULL,
DESCRIPTION VARCHAR(100) DEFAULT NULL,
CREATED_AT TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
UPDATE_AT TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURR... | true |
9229107ed13cb52f785fca629540e49e67d36576 | SQL | mikerodionov/ps-scripts | /SQL/SQL/DmvConnectionSessionInfo.sql | UTF-8 | 770 | 3.609375 | 4 | [
"MIT"
] | permissive | -- More details: http://buildingbettersoftware.blogspot.ru/2016/04/using-dmvs-to-find-sql-server.html
-- Requires SQL Server 2012 or newer
SELECT
database_id,
session_id,
status,
login_time,
cpu_time,
memory_usage,
reads,
writes,
logical_reads,
host_name,
program_name,
... | true |
5242ae49258aaaba9ed5855624e11da7aa331eef | SQL | chaksaray/rdb | /asvawat.sql | UTF-8 | 26,879 | 3.109375 | 3 | [
"MIT"
] | permissive | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.38 - MySQL Community Server (GPL)
-- Server OS: Linux
-- HeidiSQL Version: 10.3.0.5771
-- --------------------------------------------------------
/... | true |
0db02a5cb556635f1f1fd61e4ba30bef004eec63 | SQL | utagaiby/bigsoft-store | /migrations/003_cart.sql | UTF-8 | 621 | 4.15625 | 4 | [
"MIT"
] | permissive | CREATE TABLE `carts` (
`id` INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`));
CREATE TABLE `cart_items` (
`id` INT NOT NULL AUTO_INCREMENT,
`cart_id` INT NOT NULL,
`product_id` INT NOT NULL,
PRIMARY KEY (`id`),
INDEX `fk_cart_items_carts_idx` (`cart_id` ASC),
INDEX `fk_cart_items_products_idx` (`produc... | true |
61d569d85dd330b78f85b9e243ecbda7bc3f60d1 | SQL | sarziv/php_environment | /sites/html/Php_mysql/MySql_joints/UNION/Database_joints.sql | UTF-8 | 2,226 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 10, 2017 at 07:25 AM
-- Server version: 5.5.57-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... | true |
cdd0450fbfdfb6c85a4d0ad5a9fce86f399079fb | SQL | Rthompson2548/postgres-final-assignment | /src/grants-total.sql | UTF-8 | 225 | 3.234375 | 3 | [] | no_license | -- INSTRUCTIONS:
-- write the SQL to query the grants table
-- for the total dollar amount of all grants in the table
-- BASIC SYNTAX:
-- SELECT SUM(column_name)
-- FROM table_name
SELECT sum(amount)
FROM grants | true |
81ab237deb355172ef882b06659fe4ef733b6447 | SQL | djccarew/get-started-java-icp | /docker/derby/init.sql | UTF-8 | 263 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | connect 'jdbc:derby:demo;create=true';
create schema derbyuser;
CREATE TABLE DERBYUSER.VISIT (VISITID SMALLINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) NOT NULL,FIRSTNAME VARCHAR(64) NOT NULL, VISITED TIMESTAMP NOT NULL,PRIMARY KEY(VISITID));
| true |
075b57648906dd4b2d33ac9c7601e848266f6d66 | SQL | Fury26/DBLAB2 | /queris.sql | UTF-8 | 669 | 3.1875 | 3 | [] | no_license | -- deleting club example
DELETE FROM club_stadium WHERE club_id = 6;
DELETE FROM clubs_tournaments WHERE club_id = 6;
DELETE FROM match WHERE home_club_id = 6 OR away_club_id = 6;
UPDATE player SET club_id = NULL WHERE club_id = 6;
DELETE FROM club WHERE id = 6;
SELECT * FROM club;
-- deleting from stadiun
DELETE FRO... | true |
10e687c2222e5b18118f32dc68c1b315ed12c758 | SQL | hi-noikiy/project | /91ns/schemas/web/20151103/pre_lucky_gift_configs幸运礼物配置表修改.sql | UTF-8 | 984 | 2.984375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50621
Source Host : localhost:3306
Source Database : 91ns
Target Server Type : MYSQL
Target Server Version : 50621
File Encoding : 65001
Date: 2015-11-03 16:32:11
*/
SET FOREIGN_KEY_CHECKS=0;
--... | true |
230c71dc5249e878bb0a30e3f03b894df796122b | SQL | s20151/jaz-java | /app/src/main/resources/db.changelog/20210124_allezon_final_4.sql | UTF-8 | 1,475 | 3.609375 | 4 | [] | no_license | DROP TABLE users CASCADE;
DROP TABLE category CASCADE;
DROP TABLE section CASCADE;
DROP TABLE auction CASCADE;
DROP TABLE auction_photo CASCADE;
DROP TABLE parameter CASCADE;
DROP TABLE auction_parameter CASCADE;
CREATE TABLE users
(
id BIGSERIAL NOT NULL PRIMARY KEY,
username varchar(40) not null,
password char(60... | true |
ecbd3c424f9331d51b144fdf0ce0a2a2b02a1753 | SQL | sambacha/OsmBigQueryLoader | /sql-etl/dml/relations1_iterate.sql | UTF-8 | 2,109 | 3.953125 | 4 | [] | no_license | WITH relbox AS (
SELECT relboxpoint.id,
MIN(edge_left) AS edge_left,
MIN(edge_bottom) AS edge_bottom,
MAX(edge_right) AS edge_right,
MAX(edge_top) AS edge_top
FROM
(
SELECT
rel.id,
members.id AS m_id,
ST_X(COALESCE(rel.bounding_box.top_left, way.bounding_box.top_left, node.... | true |
78488a878ed252e27c798949eb0939c09dfc265d | SQL | KristinaJelyazkova/Databases | /seminar6-mixed.sql | UTF-8 | 3,066 | 4.34375 | 4 | [] | no_license | -- 1. За всеки актьор/актриса изведете броя на различните студиа,
-- с които са записвали филми, включително и за тези, за които
-- нямаме информация в кои филми са играли.
use movies;
select NAME, count(distinct v.STUDIONAME) as count_studios
from MOVIESTAR m left join starsin s on m.NAME = s.STARNAME
... | true |
6366fff5727571bdcf96185660c9fe666d0b813a | SQL | Niicksan/SoftwareUniversity | /Professional Modules/C# DB Fundamentals/Databases Basics - MS SQL Server/Exercises/05. Table Relations - Exercise/01. One-To-One Relationship.sql | UTF-8 | 730 | 3.640625 | 4 | [] | no_license | CREATE TABLE Persons (
PersonID INT NOT NULL,
FirstName VARCHAR(50),
Salary MONEY,
PassportID INT
);
CREATE TABLE Passports(
PassportID INT NOT NULL,
PassportNumber VARCHAR(50)
);
INSERT INTO Persons (PersonID, FirstName, Salary, PassportID) VALUES
(1, 'Roberto', 43300.00, 102),
(2, 'Tom', 56100.00, 103),
(3, ... | true |
872263cd22f48fad7ac8390790434d85cd75c7b1 | SQL | Nishtha003/JD-Extensions | /jd_tourshowcase - pro/packages/com_jdtoursshowcase/administrator/sql/install.mysql.utf8.sql | UTF-8 | 2,224 | 2.75 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `#__jdtoursshowcase_tours` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL ,
`tour_type` VARCHAR(255) NOT NULL ,
`alias` VARCHAR(255) NOT NULL ,
`ordering` INT(11) NOT NULL ,
`state` TINYINT(1) NOT NULL ,
`checked_out` INT(11) NOT NULL ,
`checked_out_time... | true |
fddcd0d915556a59265ba4ace1a128f5a73f37c3 | SQL | ferow2k/yii-i18n-columns | /tests/db/test.sql | UTF-8 | 1,044 | 3.625 | 4 | [] | no_license |
CREATE TABLE `image` (
`id` BIGINT(20) NOT NULL ,
`path` VARCHAR(255) NULL DEFAULT NULL ,
`created` DATETIME NULL DEFAULT NULL ,
`modified` DATETIME NULL DEFAULT NULL ,
PRIMARY KEY (`id`) );
CREATE TABLE `book` (
`id` BIGINT(20) NOT NULL ,
`title` VARCHAR(255) NULL DEFAULT NULL ,
`slug` VARCHAR(255)... | true |
ecb93b63ed0af0c57da5fc4b27b32de7281bfbfe | SQL | bowema/sql | /leetcode/550.sql | UTF-8 | 351 | 3.828125 | 4 | [] | no_license | SELECT ROUND(COUNT(DISTINCT CASE WHEN b.event_date IS NOT NULL THEN a.player_id ELSE null END)::numeric
/
COUNT(DISTINCT a.player_id), 2)
FROM lc.activity_550 a
LEFT JOIN lc.activity_550 b
ON a.player_id = b.player_id AND
a.event_date = b.event_date - 1;
-- https://zqt0.gitbook.io/leetcode/sql/550.-g... | true |
618f0c523a8ea3fc8a649265873b8b8712243368 | SQL | nocaway/yugabyte-db | /src/postgres/src/test/regress/sql/yb_pg_namespace.sql | UTF-8 | 1,839 | 3.984375 | 4 | [
"PostgreSQL",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"OpenSSL"
] | permissive | --
-- Regression tests for schemas (namespaces)
--
CREATE SCHEMA test_ns_schema_1
CREATE UNIQUE INDEX abc_a_idx ON abc (a)
CREATE VIEW abc_view AS
SELECT a+1 AS a, b+1 AS b FROM abc
CREATE TABLE abc (
a serial,
b int UNIQUE
);
-- TODO(dmitry): Re... | true |
1bf6ce4bdd154c3c481b5c7f6bdd787f99998cd4 | SQL | zzfengxia/spring-demo | /springboot-demo/src/main/resources/import.sql | UTF-8 | 1,310 | 2.984375 | 3 | [] | no_license |
CREATE TABLE `tm_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(128) NOT NULL COMMENT '用户名',
`realname` varchar(128) DEFAULT NULL COMMENT '姓名',
`password` varchar(255) DEFAULT NULL,
`salt` varchar(64) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL COMMENT 'email',
`jobuuid` varchar(... | true |
158e0602b79917d78c5da94299f8b4d76814ebee | SQL | IM4rk/SQLT | /run/my_query.sql | UTF-8 | 6,354 | 3.296875 | 3 | [] | no_license | alter session set nls_date_format = 'yyyy-mm-dd/hh24:mi:ss'
/
INSERT INTO casemgr.search_results (case_id, target_date, drafter_target_date, drafter_target_days, case_number,case_year, case_ref, cases_count, total, number_string
, oe_list, forename, surname, am_forename, am_surname, pm_forename, pm_surname, stag... | true |
f19753e4ee1c78bb267d74265e6496b7327f8e33 | SQL | maqianqiandegithup/project1 | /sql文件/shop_car.sql | UTF-8 | 2,075 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2018 年 09 月 21 日 14:34
-- 服务器版本: 5.6.12-log
-- PHP 版本: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACT... | true |
78d344027ae241c69a6f20af3b657ad61a8bc805 | SQL | VariousImpressCMSModulesBox/formulaire | /formulaire/sql/mysql.sql | UTF-8 | 4,860 | 2.796875 | 3 | [] | no_license | CREATE TABLE form_id (
id_form smallint(5) NOT NULL auto_increment,
desc_form varchar(60) NOT NULL default '',
admin varchar(5) default NULL,
groupe varchar(255) default NULL,
email varchar(255) default NULL,
expe varchar(5) default NULL,
url varchar(255) default NULL,
help text default NULL,
send var... | true |
7513032cbe1dc7b155fc48de785542734effed34 | SQL | parkseoeun5322/Class_Example | /Oracle/수업자료/연습문제2-1-문제.sql | UHC | 3,737 | 4.5625 | 5 | [] | no_license | -----------------------------------------------------------------------------------------------
--ǽ
--01. μڵ 30, 40, 60 μ
--, , μڵ, ȸϿ Ѵ.
SELECT employee_id, first_name || ' ' || last_name name, department_id, salary
FROM employees
WHERE department_id IN(30, 40, 60)
ORDER BY name;
--02. Ŀ̼ , , , Ŀ̼ǿ ȸϿ
--Ŀ̼ǿ... | true |
f6ae2e328f22d6ca332f6951987474d2e5a2ca1f | SQL | ngweihow/info20003_proj2 | /828472.sql | UTF-8 | 4,827 | 4.375 | 4 | [] | no_license | /*SQL Queries Database Systems Project 2
*Code written by Wei How Ng (828472)
*/
/*Q1*/
SELECT name, COUNT(Student.firstname) AS NumberOfStudents
FROM Course INNER JOIN Student ON Course.id = Student.course
GROUP BY name
ORDER BY name, NumberOfStudents;
/*Q2*/
SELECT code, COUNT(Student.firstname) AS NumberOfStuden... | true |
c6ce68c8e1a1219f61fcc5bed4432a65a7139730 | SQL | angenalZZZ/database | /Database_Files/MySQL/基本语句.sql | UTF-8 | 1,167 | 3.140625 | 3 | [] | no_license | -- DB数据库列表
show databases;
-- 1.DB连接池中保持的最大空闲连接 Command='Sleep';
-- 2.DB查询Query正常连接 Command='Query';
show processlist;
-- 连接缺省值
show variables like '%packet%'; --包大小限制:默认max_allowed_packet=4M,建议16×1024×1024;前后端管道建立的时候用作参数使用;
-- 修改密码
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('HGJ766GR767FKJU0');
SET PASSWORD FO... | true |
f7d93682b530e2ae7b83d3164c77c0fb4fc8a9c3 | SQL | illuminocracy/illuminocracy | /queries2.sql | UTF-8 | 14,176 | 3.40625 | 3 | [] | no_license | INSERT INTO ads_daily (ad_id,
delivery_day,
funding_entity,
affiliation_party,
affiliation_brexit,
page_id,
page_name,
spend_gbp_lower,
spend_gbp_upper,
spend_gbp_mid,
impressions_lower,
impressions_upper,
impressions_mid,
age,
gender,
added_date_time,
uploaded)
SELECT
A.id, D.day,... | true |
632a1b2238e0719651e79e68c34c20b82c5c90fe | SQL | kolamor/aiohttp_site | /init.sql | UTF-8 | 2,108 | 3.578125 | 4 | [] | no_license | create table post (
id serial,
title varchar(255) not null,
body text
);
create table user_d (
id serial primary key,
login varchar(40) not null unique,
password text not null,
email text not null unique ,
admin_privilege boolean default false
);
insert into user_d (login, password, email, admin_privile... | true |
132dfe116bc4990cf6e4ad700781cda098d39057 | SQL | blackbeltandre/qibla_swarm | /server/db/migrations/20201114181842-create_table_user_tour_purchases.sql | UTF-8 | 1,199 | 2.71875 | 3 | [] | no_license | -- +migrate Up
CREATE TABLE IF NOT EXISTS "user_tour_purchases"
(
"id" char(36) PRIMARY KEY NOT NULL DEFAULT (uuid_generate_v4()),
"tour_package_id" char(36) NOT NULL,
"customer_name" varchar(50) NOT NULL,
"customer_identity_type" char(3),
"id... | true |
4539ea59dae14402c3a3d44a31abe543cdf7d928 | SQL | matmic/gerenciador-financeiro | /protected/data/ihc.sql | UTF-8 | 7,363 | 3.375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 29-Jun-2016 às 21:55
-- Versão do servidor: 10.1.13-MariaDB
-- PHP Version: 5.6.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
bdd2c39bc473f22eee5b279a221ac00691560fe2 | SQL | spiralout/Tracks | /schema/event_store-mysql.sql | UTF-8 | 748 | 3.15625 | 3 | [] | no_license | --
-- MySQL schema for event store
--
-- @author Sean Crystal <sean.crystal@gmail.com>
-- @copyright 2011 Sean Crystal
-- @license http://www.opensource.org/licenses/BSD-3-Clause
-- @link https://github.com/spiralout/Tracks
--
CREATE TABLE IF NOT EXISTS entity (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
guid c... | true |
4a88a8a328959a038f185cfc2bf4ba574ce13b3b | SQL | xbackupx/peqXdb | /Development/Player_Tables/hackers.sql | UTF-8 | 518 | 2.6875 | 3 | [] | no_license |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for hackers
-- ----------------------------
CREATE TABLE `hackers` (
`id` int(4) NOT NULL auto_increment,
`account` text NOT NULL,
`name` text NOT NULL,
`hacked` text NOT NULL,
`zone` text,
`date` timestamp NOT NULL default CURRE... | true |
cea20cb2c143618f825316cd04946681bbb1efde | SQL | phukeiei/dev | /swm_table/swm_cost_pool.sql | UTF-8 | 2,288 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 15, 2019 at 02:38 PM
-- Server version: 8.0.17
-- 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 @OLD_CHARAC... | true |
aeb2e5a5f2cd6f88742d609d73c651fc4011842f | SQL | theatheistboi/COMP-228_Assignments | /RodrigoJanuarioDaSilva_COMP228_003_W18_V4/database/Version_4.sql | UTF-8 | 429 | 2.9375 | 3 | [] | no_license | DROP TABLE Tools;
CREATE TABLE Tools (
toolID INT NOT NULL GENERATED ALWAYS AS IDENTITY,
price INT NOT NULL,
category VARCHAR (20) NOT NULL,
toolType VARCHAR (20) NOT NULL,
brand VARCHAR (20) NOT NULL,
PRIMARY KEY (toolID)
);
INSERT INTO Tools (price, category, toolType, brand)
values
(50, 'garden... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.