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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4bb303592b325f017a35a325ef9de986a70079b6 | SQL | GerMorales/ADoc4U | /sql/heroku-database.sql | UTF-8 | 8,222 | 2.875 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `heroku_83c89d7d77e295e` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `heroku_83c89d7d77e295e`;
-- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: us-cdbr-east-04.cleardb.com Database: heroku_83c89d7d77e295e
-- ------------------------------------------------------
-- S... | true |
c63807878a479e465777a93a94c8fab4421a9670 | SQL | php-recipe/php-recipe-2nd | /htdocs/php-recipe/08/02/create_example_mysql.sql | UTF-8 | 266 | 2.671875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `example` (
`id` INT(11) NOT NULL auto_increment,
`language` VARCHAR(10),
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
INSERT INTO `example` (`id`, `language`) VALUES
(1, 'PHP'), (2, 'Java'), (3, 'Ruby'), (4, 'Python'), (5, 'Perl');
| true |
cf6063ca9f78a21de9a6b35dc995db397da1c9e0 | SQL | Zahidsqldba07/CodeSignal-Databases-solution | /15_expressionsVerification.sql | UTF-8 | 751 | 3.359375 | 3 | [] | no_license | CREATE PROCEDURE expressionsVerification() BEGIN
/* The CASE statement goes through conditions and returns a value when the first condition is met
(like an if-then-else statement).So, once a condition is true, it will stop reading and return
the result. If no conditions are true, it returns the value in the ELSE cla... | true |
26b02c54fbd44b642f9739aa6b2f06a8033e5ce6 | SQL | philthiewes/SQL-Scripts | /quickly_deleted_uploads.sql | UTF-8 | 1,142 | 4.34375 | 4 | [] | no_license | --Documents uploaded and deleted within 24 hours with page counts
WITH creates AS (
SELECT project_id, metadata_id, event_date_time
FROM merrill.prod_us_dbt.audit_events_content_change_view
WHERE event_name = 'CONTENT_UPLOAD_CREATE'),
deletes AS (
SELECT project_id, metadata_id, event_date_time
FROM... | true |
a47f0fecf65f8a4e1bb4d77ed7a0f6dbe246bd49 | SQL | srilakshmivemulapalli/portal | /PortalWebApp/portal-web-app/src/main/resources/dbscripts/DDL/componentsRoleMapping.sql | UTF-8 | 1,212 | 3.484375 | 3 | [] | no_license | CREATE TABLE portal.Components(
component_id int NOT NULL,
component_name varchar(22) NOT NULL,
PRIMARY KEY (component_id)
);
INSERT INTO `portal`.`Components` (`component_id`,`component_name`) VALUES ('1', "Questions");
INSERT INTO `portal`.`Components` (`component_id`,`component_name`) VALUES ('2', "Blog");
INSERT ... | true |
9308df816c9325d56407757518de0dfa2bdd91ad | SQL | sytt8/ProgramaInventarios | /src/Recursos/Basededatos.sql | UTF-8 | 3,798 | 3.484375 | 3 | [] | no_license | create database curso_inventario;
use curso_inventario;
create table usuario(
id int not null auto_increment primary key,
nombre varchar(70) ,
clave varchar(150) ,
fecha datetime,
usuario_id int,
tipo ENUM('cajero','administrador','supervisor') default 'cajero',
visible boolean DE... | true |
11b22b1a55c6710bd8f8d069fccd75152cdea607 | SQL | yethuaungptu/nodejs-ejs-mysql-blank | /sql/ddl.sql | UTF-8 | 745 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | DROP SCHEMA db_blank;
DROP USER 'user_blank'@'localhost';
CREATE SCHEMA `db_blank` CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'user_blank'@'localhost' IDENTIFIED BY 'Zikimi95';
GRANT ALL PRIVILEGES ON `db\_blank`.*TO 'user_blank'@'localhost' WITH GRANT OPTION;
CREATE TABLE db_blank.users (
`uid` int(1... | true |
11fedfd23525aaaf39333e49f600280fe4ad13d2 | SQL | Mehrafruz/ios_project | /flask-server/flaskr/schema.sql | UTF-8 | 6,513 | 3.421875 | 3 | [] | no_license | DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS post;
DROP TABLE IF EXISTS timecafe;
DROP TABLE IF EXISTS timecafe_image;
DROP TABLE IF EXISTS feature;
DROP TABLE IF EXISTS timecafe_feature;
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREAT... | true |
a3c9ce4a3628495225174dc9a5198050573bee16 | SQL | HRR43-Team-Leia-SDC/Reviews | /db/Cassandra/schema.cql | UTF-8 | 377 | 3.109375 | 3 | [] | no_license | DROP KEYSPACE IF EXISTS reviews;
CREATE KEYSPACE reviews WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
USE reviews;
DROP TABLE IF EXISTS reviews;
CREATE TABLE review (
dbId int,
urlId int,
username text,
datePosted date,
imageUrl text,
avatarImgUrl text,
text text,
rating... | true |
081aadaa196cb6b645482b6039095653c0e13947 | SQL | duskat92/sql | /select_ikura.sql | UTF-8 | 738 | 3.890625 | 4 | [] | no_license | with pro as (
select
'Ikura' as product_name),
ie as (
select
e.employee_id as id
from
eshop.products as p
join eshop.order_details as od on
od.product_id = p.product_id
and p.product_name ~ (
select *
from
pro)
join eshop.orders as o on
o.order_id = od.order_id
join eshop.employees as e on
e.employee_id = ... | true |
a907ca976f4fc26c5d54f41fb3f3883d23584e73 | SQL | gabrielatijerina/database-exercises | /case_exercises.sql | UTF-8 | 5,178 | 4.65625 | 5 | [
"MIT"
] | permissive | #Create a file named case_exercises.sql and craft queries to return the results for the following criteria:
#1 Write a query that returns all employees (emp_no), their department number, their start date, their end date, and a new column 'is_current_employee' that is a 1 if the employee is still with the company and 0... | true |
dda44c25f86a9b32124e314ab4c13c11b0f6d4d7 | SQL | deepen1987/DATABASE-DESIGN-AND-IMPLEMENTATION-FOR-BUSINESS | /Class/Labs/4/section1.sql | UTF-8 | 7,898 | 3.65625 | 4 | [] | no_license |
CREATE TABLE IF NOT EXISTS `person`
(
`person_id` INT(12) PRIMARY KEY NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(32) NOT NULL,
`last_name` VARCHAR(32) NOT NULL,
`username` VARCHAR(20) NOT NULL
);
CREATE TABLE IF NOT EXISTS `post`
(
`post_id` INT(12) PRIMARY KEY NOT NULL AUTO_INCREMENT,
`person_id... | true |
bd0615bfbadad85985d37b6f3500ec9e1c165fc9 | SQL | clnc/RSSReader | /DB/rss_reader.sql | UTF-8 | 3,460 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Gazda: localhost
-- Timp de generare: 21 May 2015 la 18:31
-- Versiune server: 5.5.24-log
-- Versiune PHP: 5.3.13
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
9c1d5b29da396da370042bc10f026cb7d701ce8d | SQL | W4LT3RJUN10R/SGS | /exercicios/4.3.sql | UTF-8 | 265 | 3.578125 | 4 | [] | no_license | SELECT descricao, solicitacoes FROM Tipo INNER JOIN (
SELECT tipo, count(*) as solicitacoes FROM Solicitacao INNER JOIN Produto
ON Solicitacao.produto = Produto.codigo
INNER JOIN Tipo
ON Tipo.codigo = tipo
GROUP BY tipo
) ON Tipo.codigo = tipo;
| true |
ece0ced1d227d4de061e8f970a848446cece21fc | SQL | azimemory/oracle | /DB수업자료/b_join/04_JOIN.sql | UHC | 13,040 | 4.5 | 4 | [] | no_license | ------------------------------------------------------------------------------------------------------------------------------------------------------
-- JOIN
-- ϳ ̻ ̺ ȸϱ .
-- ϳ Result Set .
/*
- ͺ̽ SQL ̿ ̺ '' δ .
- ͺ̽ ּ ̺ ־
ϴ ̺ ȸϷ ̻ ̺ о; Ǵ 찡 .
̶, ƴ ̺ 谡 ξ ؾ Ѵ.
--> 'JOIN' ̸ .
*/
------... | true |
21412ad8a453bb095c9061edde9a6e322d550535 | SQL | digital-justice-lab/woundPerson | /data-model.sql | UTF-8 | 3,591 | 3.234375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Tue Jul 16 14:40:48 2019
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TR... | true |
5b139e229464925bffe3cb930b5b51c222c45297 | SQL | ClickHouse/ClickHouse | /tests/queries/0_stateless/01710_projection_row_policy.sql | UTF-8 | 315 | 3.125 | 3 | [
"BSL-1.0",
"Apache-2.0"
] | permissive | DROP TABLE IF EXISTS t;
CREATE TABLE t(a UInt32, b UInt32) ENGINE = MergeTree PARTITION BY a ORDER BY a;
INSERT INTO t SELECT number % 10, number FROM numbers(10000);
CREATE ROW POLICY OR REPLACE rp ON t FOR SELECT USING 0 TO ALL;
SELECT count(), min(a), max(a) FROM t;
DROP ROW POLICY rp ON t;
DROP TABLE t;
| true |
7a2d1ffa938b6f45318be5442d18ebdcfdf0e1d9 | SQL | teduFanechka/jeecg | /src/main/java/com/jeecg/wuyesfgl/dao/WuyeSfglFjsfxmszDao_findList.sql | UTF-8 | 279 | 2.921875 | 3 | [] | no_license | select f.id,(select g.glqmc from wuye_glq g where g.id = f.glqid) glqmc,f.glqid,
f.lyid,f.fjid,
f.fwxxid,f.sfxmid,f.yhlx,f.yhbl,f.bz,s.xmdm,s.xmmc,s.sffs,s.jfdj,s.sfbz,s.jfzq,s.jfzqdw
from wuye_sfgl_sfxmsz s
join wuye_sfgl_fjsfxmsz f on s.id = f.sfxmid where f.fjid = :fjid
| true |
bdf046862b432f22bb3935eb188618a57ca68868 | SQL | JessRG/database-exercises | /functions_exercises.sql | UTF-8 | 559 | 4.3125 | 4 | [] | no_license | USE employees;
# Duplicate the previous query and update it to find all employees whose last name starts and ends with 'E' — 899 rows.
SELECT CONCAT(first_name, ' ', last_name) AS 'Full Name'
FROM employees
WHERE last_name LIKE 'e%e'
ORDER BY emp_no;
# Find all employees hired in the 90s and born on Christmas — 362 r... | true |
1f9ccd1a86b8e0786dad35666be191207030ab58 | SQL | JeffFirmin/Projects | /Site Sportify/sportify/src/main/resources/sportify_database_1.sql | UTF-8 | 2,868 | 4.28125 | 4 | [] | no_license |
--- Important: Primary key can't be modified since we used GENERATED ALWAYS, i don't see why we would change a primary key, but in case if we want to, change ALWAYS with BY DEFAULT
-- A club can have many types of coachs, so we define a new domain
CREATE DOMAIN COACH_POST AS VARCHAR CHECK (
VALUE IN ('main', 'secon... | true |
db7a508fa1801d66e2b12f5e42d172411b9f02e6 | SQL | alex3kv/DataBase | /Lesson5/Topic_3_task_1-5.sql | UTF-8 | 3,741 | 4.1875 | 4 | [] | no_license | -- 1. Пусть в таблице users поля created_at и updated_at оказались незаполненными. Заполните их текущими датой и временем.
DESC users;
SELECT * FROM users LIMIT 10;
UPDATE users u SET u.created_at = NOW(), u.updated_at = NOW();
-- 2. Таблица users была неудачно спроектирована. Записи created_at и updated_at были зад... | true |
b791fdcb1b6f0566e9789a39721685c5e3a7f2c4 | SQL | oburakevych/Integration-Connectors | /sql/mysql/0005-dropbox_tradeshft_connector.sql | UTF-8 | 751 | 3.203125 | 3 | [] | no_license | use `connector`;
CREATE TABLE dropbox_tradeshift_connector (
id VARCHAR(40) PRIMARY KEY,
dropbox_account_id VARCHAR(40) NOT NULL,
tradeshift_account_id VARCHAR(40) NOT NULL,
CONSTRAINT FOREIGN KEY
cn_dropbox_tradeshift_accountid_fk (dropbox_account_id)
REFERENCES dropbox_account (id),
CONSTRAINT ... | true |
ff98b7257c476097241ba183b6900d6c7e20be4c | SQL | djerem02/SchoolIn | /sql/schoolIn.sql | UTF-8 | 12,067 | 2.890625 | 3 | [
"CC-BY-4.0",
"Apache-2.0",
"LicenseRef-scancode-other-permissive"
] | permissive | /*←
phpMyAdmin
AccueilDocumentation de phpMyAdminDocumentationActualiser le panneau de navigation
RécentesPréférées
Tout réduireSupprimer la liaison au panneau principal
Nouvelle base de données
Développer/réduireOpérations sur base de donnéesinformation_schema
Développer/réduireOpérations sur base de donnéesmysql
Déve... | true |
e061f430c5c307bfccd8face52fe6f95c8281ff7 | SQL | cghnassia/BD50_TourDeFrance | /Conception/Import/Dump/ETAPE_REFCONSTRAINT.sql | UTF-8 | 623 | 2.5625 | 3 | [] | no_license | --------------------------------------------------------
-- Ref Constraints for Table ETAPE
--------------------------------------------------------
ALTER TABLE "G11_FLIGHT"."ETAPE" ADD CONSTRAINT "FK_ETAPE_TOUR" FOREIGN KEY ("TOUR_ANNEE")
REFERENCES "G11_FLIGHT"."TOUR" ("TOUR_ANNEE") ENABLE;
ALTER TABLE ... | true |
3f14e7805309d204083528a4b9fa36070b6278ff | SQL | ofpisnotdead-com/OFP-Game-Schedule | /GS_table_structure.sql | UTF-8 | 11,652 | 3.015625 | 3 | [] | no_license | ALTER TABLE `users` ADD `timezone` VARCHAR(255) NOT NULL DEFAULT 'Europe/Warsaw';
UPDATE `settings` SET `us_css3` = '../usersc/css/custom.css' WHERE `settings`.`id` = 1;
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 25, 2021 at 12:32 AM
-- Server v... | true |
f4f1f433b40c20e3e8ae0243cf372ad7d591a9c8 | SQL | ProfDema/uam | /pam/examples/anon_data/student18/a2.sql | UTF-8 | 2,254 | 4.125 | 4 | [] | no_license | -- Add below your SQL statements.
-- You can create intermediate views (as needed). Remember to drop these views after you have populated the result tables.
-- You can use the "\i a2.sql" command in psql to execute the SQL commands in this file.
-- Query 1 statements
SET search_path TO A2;
create view q1 as (select *... | true |
13419b352d72ada7729c7cb86e318c15952cf347 | SQL | MunizDev/trybe-exercises | /modulo_3/bloco_21/dia_2/exercicio8.sql | UTF-8 | 658 | 4.28125 | 4 | [] | no_license | --6a. Use JOIN to display the first and last names, as well as the address, of each staff member. Use the tables staff and address:
--6b. Use JOIN to display the total amount rung up(sum) by each staff member in August of 2005. Use tables staff and payment.
SELECT stf.first_name, stf.last_name, adr.address, adr.distri... | true |
6705e4fa608ad7b551f7eafe886bd222602bea92 | SQL | soleimygomez/node_proyect | /simulador_credito (1).sql | UTF-8 | 2,829 | 3.015625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 18-10-2021 a las 02:44:33
-- Versión del servidor: 10.4.14-MariaDB
-- Versión de PHP: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
a8e943efb21d1c9520d587d63e625780b9ca824d | SQL | HaogeNj/HiveApp | /DDL.sql | UTF-8 | 1,645 | 3.4375 | 3 | [] | no_license | --表创建
CREATE TABLE SCHEMA.TSSA_TABLE1(
DETAIL_ID BIGINT,
ETL_TIME STRING
)
PARTITIONED BY (STATIS_DATE string)
STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
--分区处理
use SCHEMA;
alter table TSSA_TABLE1 drop if exists partiti... | true |
917b875c968f6db1d8b58f91f95dd1c5021465c7 | SQL | yassineaboub/holbertonschool-web_back_end | /0x0C-MySQL_Advanced/3-glam_rock.sql | UTF-8 | 207 | 3.296875 | 3 | [] | no_license | -- SQL script that lists all bands with Glam rock as their main style
SELECT band_name, (if(split, split, 2020) - formed) as lifespan
FROM metal_bands
WHERE style LIKE '%Glam rock%'
ORDER BY lifespan DESC;
| true |
53ef60d39990e49c0b5447e63c8bef26f203a401 | SQL | serdnah2/estrellame | /backend/Scripts_DB/CONSTRAINTS.sql | UTF-8 | 2,249 | 3.703125 | 4 | [] | no_license | --- USERS_TBL
ALTER TABLE USERS_TBL DROP PRIMARY KEY;
ALTER TABLE USERS_TBL DROP CONSTRAINT IF EXISTS NN_USERS_NAME;
ALTER TABLE USERS_TBL DROP CONSTRAINT IF EXISTS NN_USERS_LASTNAME1;
ALTER TABLE USERS_TBL DROP CONSTRAINT IF EXISTS NN_USERS_EMAIL;
ALTER TABLE USERS_TBL DROP INDEX IF EXISTS U_USERS_EMAIL;
ALTER TABLE ... | true |
afe2cb19c301bbba1c3e5476cbdb65f69a9b3103 | SQL | kgtdbx/OracleScript | /create_dblink.sql | UTF-8 | 1,471 | 3.296875 | 3 | [] | no_license | --select * from global_name
/*
Names for Database Links
Typically, a database link has the same name as the global database name of the remote database it references. For example, if the global database name of a database is SALES.US.ORACLE.COM, then the database link is also called
SALES.US.ORACLE.COM.
When you se... | true |
0306a5fa67165d0c50fd3aeb86c2749e48512650 | SQL | apache/madlib | /examples/gpce/sketches.sql | UTF-8 | 1,586 | 3.015625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-warranty-disclaimer",
"MPL-2.0",
"mif-exception",
"LGPL-2.0-or-later",
"BSD-3-Clause",
"GPL-2.0-only",
"LicenseRef-scancode-free-unknown",
"BSL-1.0",
"MIT",
"GPL-2.0-or-later",
"Python-2.0",
"BSD-2-Clause"
] | permissive | \qecho =================================================================
\qecho === Running: sketches ===========================================
\qecho =================================================================
\qecho
\qecho === CM : count ==================================================
SELECT pronamespace... | true |
9b029459a33333b98fa0204b8d0c326f2229badb | SQL | yatikbudhrani/dbms_lab_2020 | /lab04/lab_sol.sql | UTF-8 | 2,725 | 4.125 | 4 | [] | no_license | -- import database.sql
source database.sql;
--Q1
select oisbn from OrderBook GROUP BY oisbn HAVING COUNT(*) > 2;
--Q2
select ocid from OrderBook WHERE qty > 4;select qty_in_stock from Book where qty_in_stock
<any(select qty_in_stock from Book)
--Q3
select ocid from OrderBook GROUP BY ocid HAVING timestampdiff(ye... | true |
ad41a8838379f335459d5781e582cf46804baa0e | SQL | GlynWDavies-2017/student-registration | /db/studentDB.sql | UTF-8 | 65,659 | 3.203125 | 3 | [] | no_license | /* ------------------------------------------------------------------- */
/* ------------------------------ TO DO ------------------------------ */
/* ------------------------------------------------------------------- */
/* Check for camelCase */
/* Revisit data types ... | true |
b6f35a2b950158ddc01cf753c3bd5a45fe92c193 | SQL | glayyiyi/heshuo | /modules/borrow/borrow.sql | GB18030 | 4,950 | 3.109375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `{borrow}` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`site_id` int(11) NOT NULL DEFAULT '0' COMMENT 'վ',
`user_id` int(11) NOT NULL DEFAULT '0' COMMENT 'û',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`status` int(2) NOT NULL DEFAULT '0' COMMENT '״̬',
`order`... | true |
69779b74c1f5abc83dd9804fe205b12d20e3797f | SQL | akolev82/SkiPrj | /ski/sql/tables/schools.sql | UTF-8 | 6,861 | 4.15625 | 4 | [] | no_license | create table `contact_types` (
`ContactTypeID` int(15) unsigned NOT NULL AUTO_INCREMENT,
`caption` varchar(255) NOT NULL,
primary key PK_CONTACT_TYPES(`ContactTypeID`),
constraint UQ1_CONTACT_TYPES unique (`caption`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into contact_types(ContactTypeID, caption) values(... | true |
e84920f9cb1ad42513559bf025c050ca6e684665 | SQL | vanlong20it/backend2 | /database1 (1).sql | UTF-8 | 6,295 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Oct 17, 2019 at 08:56 AM
-- Server version: 5.7.21
-- PHP Version: 5.6.35
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
04be324571a83593a2606c9f36ce5fc540849c67 | SQL | radtek/abs3 | /sql/mmfo/bars/ForeignKey/acc_over_mdate.sql | UTF-8 | 1,364 | 3.09375 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/Bars/ForeignKey/ACC_OVER_MDATE.sql =========*** R
PROMPT =====================================================================================
PROMPT *** Create constrain... | true |
dd1ce7f090fea28803f81de24803ac349d2774c4 | SQL | jdrew1303/sqlgenerate | /test/spec_sql/official-suite/tabfunc01-1.sql | UTF-8 | 1,108 | 3.234375 | 3 | [
"MIT"
] | permissive | -- original: tabfunc01.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
SELECT *, '|' FROM generate_series WHERE start=1 AND stop=9 AND step=2
;SELECT *, '|' FROM generate_series LIMIT 5
;SELECT * FROM generate_series(1,9,2)
;SELECT * FROM generate_series(1,9)
;SELECT * FROM generate_series(1,10) WH... | true |
7132c8eb1448a97a832ff75269f09f576ca405ee | SQL | rossfcowie/ToDoList | /src/main/resources/test-schema.sql | UTF-8 | 372 | 3 | 3 | [] | no_license | drop table if exists `step` CASCADE;
drop table if exists `task` CASCADE;
create table `step` (
step_id integer generated by default as identity,
complete boolean not null,
name varchar(255), fk_task_id integer,
primary key (step_id)
);
create table `task` (
id integer generated by default as identity,
description v... | true |
127d3311c761946ec84c77090d7e52ef8546c48b | SQL | doesdoing/open-nodejs-express-demo | /test.sql | UTF-8 | 3,460 | 2.890625 | 3 | [] | no_license | /*
Navicat MariaDB Data Transfer
Source Server : 15.17
Source Server Version : 50560
Source Host : 192.168.15.129:3306
Source Database : test
Target Server Type : MariaDB
Target Server Version : 50560
File Encoding : 65001
Date: 2019-07-19 12:16:40
*/
SET FOREIGN_KE... | true |
435fa2dbe23b2e3287186aacb039e7182570eb82 | SQL | uoregon-libraries/newspaper-curation-app | /src/cmd/migrate-database/_sql/20200728070500_errors_as_actions.sql | UTF-8 | 584 | 3.34375 | 3 | [
"Apache-2.0"
] | permissive | -- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
INSERT INTO actions (created_at, object_type, object_id, action_type, user_id, message)
SELECT '2020-07-31', 'issue', issues.id, 'unfixable-error', -1, issues.error
FROM issues
WHERE
issues.error <> '' AND
issues.ignored = 0 AN... | true |
c8afe1bc906a6f5586598fbdfce40fc6f8990072 | SQL | histefanov/SoftUni-DB | /Subqueries and Joins/MinAverageSalary.sql | UTF-8 | 137 | 3.59375 | 4 | [] | no_license | SELECT
MIN(a.AvgSalary) AS MinAverageSalary
FROM
(
SELECT Avg(Salary) AS AvgSalary
FROM Employees
GROUP BY DepartmentID
) AS a | true |
3d2fa9d32beb6ccc15024770e9bd38024503816c | SQL | rohilreddevil/PL_SQL_Oracle | /LABS/Lab5.sql | UTF-8 | 5,910 | 4.0625 | 4 | [] | no_license | --Lab5
--Question 1)
set serveroutput on;
set verify off;
set autoprint on;
create or replace function get_descr(p_section_id section.section_id%type) return varchar2 is
v_description course.description%type; --local variable to store the description
v_message varchar2(150);
begin
select c.description into v_des... | true |
088cbd1b436bc61b3354a0cdda3b8114b9704856 | SQL | blackfoxgdl/pulzos | /diversas_tablas/estado.sql | UTF-8 | 170,054 | 2.765625 | 3 | [] | no_license | CREATE TABLE `estado` (
`id` smallint(6) unsigned NOT NULL auto_increment,
`id_pais` smallint(6) unsigned NOT NULL default '0',
`nombre` varchar(150) NOT NULL default '',
`x` float(13,10) NOT NULL default '0.0000000000',
`y` float(13,10) NOT NULL default '0.0000000000',
PRIMARY KEY (`id`,`id_pais`)
... | true |
da18e619121c8d4e92af3d647e88e241cb828df0 | SQL | ldferrari/sd-05-mysql-vocabulary-booster | /desafio12.sql | UTF-8 | 468 | 3.75 | 4 | [] | no_license | SELECT CONCAT(EM1.FIRST_NAME, ' ', EM1.LAST_NAME) AS 'Nome completo funcionário 1',
EM1.SALARY AS 'Salário funcionário 1', EM1.PHONE_NUMBER AS 'Telefone funcionário 1',
CONCAT(EM2.FIRST_NAME, ' ', EM2.LAST_NAME) AS 'Nome completo funcionário 2',
EM2.SALARY AS 'Salário funcionário 2', EM2.PHONE_NUMBER AS 'Telefone funci... | true |
5215194a4cd4cf3adb73e0d12f762787a59b7095 | SQL | Malaxor/MySQL | /books/exercises2.sql | UTF-8 | 1,550 | 4.40625 | 4 | [] | no_license |
-- 1) Select titles that contain the word "stories"
SELECT title FROM books WHERE title LIKE '%stories%';
-- ===================================================================================
-- 2) Find the longest book; print out the title and page count
SELECT title, pages FROM books ORDER BY pages DESC LIMIT 1... | true |
8c0ef2fc7701f5e5e895290b40113fb1b74ca37c | SQL | jrpark07/adopt-me | /server/db/schema.sql | UTF-8 | 501 | 3.09375 | 3 | [] | no_license | DROP TABLE IF EXISTS pet_types CASCADE;
CREATE TABLE pet_types (
id SERIAL PRIMARY KEY,
type VARCHAR(255) NOT NULL,
img_url TEXT NOT NULL,
description TEXT
);
DROP TABLE IF EXISTS adoptable_pets;
CREATE TABLE adoptable_pets (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
img_url TEXT NOT NULL,
age ... | true |
0c1624f416b81fad0cf84188bee3bf5f8ec83527 | SQL | aidenchiavatti/eriegarbage | /db.sql | UTF-8 | 3,967 | 3.359375 | 3 | [] | no_license | SET DB_CLOSE_DELAY -1;
;
CREATE USER IF NOT EXISTS SA SALT 'cd09c0bea30e6a02' HASH 'a52ffb2734f2f7873b2fdf1e8553afc154d6f0184ce6a1adf7c1bbce2b37bd16' ADMIN;
CREATE SEQUENCE PUBLIC.HIBERNATE_SEQUENCE START WITH 7;
CREATE MEMORY TABLE PUBLIC.ACCOUNT(
ACCOUNTID INTEGER NOT NU... | true |
9071ca86e29cde1bb9cb1756d2e0a9e94c8a5546 | SQL | pdadhich/hbc-ddw-o5 | /SQL/sfcc_prod_sku_delta.sql | UTF-8 | 8,802 | 3.328125 | 3 | [] | no_license | set echo off
set linesize 10000
set pagesize 0
set sqlprompt ''
set timing on
set heading off
set trimspool on
WHENEVER OSERROR EXIT FAILURE
WHENEVER SQLERROR EXIT FAILURE
DECLARE
CURSOR cur IS
select pd.PRODUCT_ID,pd.UPC,Decode(pd.attribute_name,'Size','Siz',pd.attribute_name) attribute_name,pd... | true |
8e586791403501db1a07eae85420112d25c1ff3b | SQL | ReneNyffenegger/oracle-patterns | /DatabaseObjects/Tables/identity-column/example-01.sql | UTF-8 | 772 | 2.796875 | 3 | [] | no_license | create table tq84_identity (
id number generated as identity,
txt varchar2(10)
);
insert into tq84_identity (txt) values ('one' );
insert into tq84_identity (txt) values ('two' );
insert into tq84_identity (txt) values ('three');
insert into tq84_identity (txt) values ('four' );
insert into tq84_identity (txt) ... | true |
ef0c6b95809f41111dd7bb391c6466d2622a7937 | SQL | siddiquiarsh/pixel6_assignment | /database/pixel6_assignment.sql | UTF-8 | 3,327 | 3.1875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 04, 2021 at 08:38 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.3.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
437324d8e3421aba630ad5f2998b88bf5ad6a92f | SQL | mokbat/mysql | /outerjoin.sql | UTF-8 | 400 | 3.15625 | 3 | [] | no_license | #########################
# Outer Join Statement #
#########################
# The below statement does an outer (left) join between tables, mytest and ssn on roll_no
SELECT * FROM mytest LEFT JOIN ssn ON mytest.roll_no = ssn.roll_no;
# The below statement does an outer (right) join between tables, mytest and ssn o... | true |
cbb3aa38e265b1770cbc49559ec2589ba388cd40 | SQL | godlovesdavid/LooneyLimericks | /config/setup.sql | UTF-8 | 2,164 | 3.515625 | 4 | [] | no_license | flush privileges;
CREATE DATABASE if not exists looneylimericks;
GRANT ALL PRIVILEGES ON looneylimericks.* To 'pat'@'localhost' IDENTIFIED BY 'secret';
use looneylimericks;
DROP TABLE IF EXISTS poems;
CREATE TABLE poems (
id INT(15) PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(30),
author VARCHAR(30),
timestamp in... | true |
26cb92ec921794043670d988c37d8c80e6dff100 | SQL | PNNL-Comp-Mass-Spec/DBSchema_PgSQL_DMS | /dms/v_filter_set_members_by_analysis_tool.sql | UTF-8 | 1,125 | 3.359375 | 3 | [
"Apache-2.0"
] | permissive | --
-- Name: v_filter_set_members_by_analysis_tool; Type: VIEW; Schema: public; Owner: d3l243
--
CREATE VIEW public.v_filter_set_members_by_analysis_tool AS
SELECT fs.filter_type_id,
fs.filter_type_name,
fs.filter_set_id,
fs.filter_set_name,
fs.filter_set_description,
fs.filter_criteria_g... | true |
8cc846357fe535568ca0113e71fff385707f18c8 | SQL | chrystelle-hub/alpha | /appli_stage.sql | UTF-8 | 11,533 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mer. 11 mars 2020 à 16:19
-- Version du serveur : 5.7.26
-- Version de PHP : 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... | true |
96453ce1bd66bbf79a159a23b8b2ebb98a2f2191 | SQL | mrson92/program_study | /sqlite3/schema.sql | UTF-8 | 3,920 | 3.1875 | 3 | [] | no_license | CREATE VIRTUAL TABLE mail_attach using fts3 (
attach_content text, tokenize=porter );
CREATE TABLE 'mail_attach_content'(docid INTEGER PRIMARY KEY, 'c0attach_content');
CREATE TABLE 'mail_attach_segdir'(
level INTEGER,
idx INTEGER,
start_block INTEGER,
leaves_end_block INTEGER,
end_block INTEGER,
root BL... | true |
11df95cf0a51ac5942e94c91abe9f9e2201ad356 | SQL | auze217/DatabaseProject | /docker-entrypoint-initdb.d/install.sql | UTF-8 | 1,063 | 3.859375 | 4 | [] | no_license | drop table if exisits Customer cascade;
drop table if exisits Car cascade;
drop table if exisits Owns cascade;
drop table if exisits Phonenumbers cascade;
create sequence cust_id_seq;
create table Customer
(
cust_id int DEFAULT nextval('cust_id_seq') NOT NULL,
name VARCHAR(60) NOT NULL,
address VARCHAR(256) NOT NUL... | true |
17f50cafad478fa63f1d22e28711beb31d58a42a | SQL | LittleControl/DataStructure | /LeetCode_db/1070.sql | UTF-8 | 1,786 | 3.90625 | 4 | [] | no_license | -- 每个销售产品第一年的信息
-- Sales
-- +-------------+-------+
-- | Column Name | Type |
-- +-------------+-------+
-- | sale_id | int |
-- | product_id | int |
-- | year | int |
-- | quantity | int |
-- | price | int |
-- +-------------+-------+
--
-- Product
-- +--------------+---------+
-- | Col... | true |
e8df4ab75b5bf07afdc8b726d72f11f589fd382a | SQL | trajan4k6/acv | /models/l20_marts/presentation/fact_paid_feed_subscriber_monthly.sql | UTF-8 | 513 | 3.40625 | 3 | [] | no_license | {{ config(
materialized = 'view',
unique_key = [],
tags = []
) }}
SELECT
fct.date_key,
fct.dimension_firm_key,
fct.dimension_product_key,
fct.dimension_asset_class_key
FROM {{ ref('fact_paid_subscriber_daily') }} fct
JOIN {{ ref('dimension_date') }} d
ON fct.date_key = d.date_key
JOIN ... | true |
55cd4da116ec201f1de63429bf8872a7a0450452 | SQL | swungpoet/Partidas | /backend/app/website/sql/query.sql | UTF-8 | 2,297 | 3.515625 | 4 | [] | no_license | SELECT
kit.partida,
kit.descripcion,
kit.instructivo,
ISNULL(pki.costoPieza,0.00) as costoPieza,
ISNULL(pki.costoMano,0.00) as costoMano,
ISNULL(pki.costo,0.00) as costo,
(SELECT ISNULL(pkiw.costo,0.00) FROM dbo.ProveedorCotizacion pcow
LEFT JOIN dbo.ProveedorKit pkiw ON pkiw.idProveedorCo... | true |
c9beab1584784598f426d021399078d7bcf2ed7b | SQL | krameroliver/etl_airflow_janna_olli | /project/dags/SQL/CreateTable/disposition.sql | UTF-8 | 696 | 2.71875 | 3 | [] | no_license | CREATE TABLE SRC.disposition(
disp_id VARCHAR(10),
client_id VARCHAR(10),
account_id VARCHAR(10),
user_type VARCHAR(6),
disposition_hk CHAR(32),
processing_valid_from DATE,
processing_valid_to DATE,
systemtime_start timestamp,
systemtime_end timestamp,
processing_date_start DATE,
processing_date_end DATE,
systemtime ... | true |
2a06e024279f1b93a6b26f0491f47aaee81f4514 | SQL | kimhongsik33/plsql | /No12_1.sql | SHIFT_JIS | 642 | 2.609375 | 3 | [] | no_license | --No12-1.Recordgp
SET SERVEROUTPUT ON
DECLARE
TYPE emp_type IS RECORD(
empno NUMBER(4) NOT NULL := 0,
ename emp.ename%TYPE,
job VARCHAR2(9)
);
v_emp emp_type;
BEGIN
v_emp.empno := 9000;
v_emp.ename := 'HONG';
v_emp.job := 'Engineer';
DBMS_OUTPUT.PUT_LINE('EMPNO='||v_e... | true |
6ff95920909b25783a3eff6418e8824b9e8cca26 | SQL | DimolSPA/Dimol-Fix-Carteras | /Dimol.Carteras/Dimol.Carteras.Database/dbo/Stored Procedures/Procs2/Delete_Giros.sql | UTF-8 | 353 | 2.59375 | 3 | [] | no_license |
Create Procedure Delete_Giros(@gir_codemp integer, @gir_girid integer) as
DELETE FROM giros_idiomas
WHERE ( giros_idiomas.gii_codemp = @gir_codemp ) AND
( giros_idiomas.gii_girid = @gir_girid )
DELETE FROM giros
WHERE ( giros.gir_codemp = @gir_codemp ) AND
( ... | true |
5673430acd7abb14743233905681fe0f54d6bfdc | SQL | GW2Treasures/gw2treasures.com | /packages/database/prisma/migrations/20230503075323_add_provider_tokens/migration.sql | UTF-8 | 373 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
Warnings:
- You are about to drop the column `token` on the `UserProvider` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "UserProvider" DROP COLUMN "token",
ADD COLUMN "accessToken" TEXT,
ADD COLUMN "accessTokenExpiresAt" TIMESTAMP(3),
ADD COLUMN "refreshToken" TEXT,
... | true |
6610f88be1c2b8409d26e8f88e24648344f05081 | SQL | shika-sophia/sophia2021 | /webPractice/reference/sqlPractice.sql | UTF-8 | 1,433 | 3.515625 | 4 | [] | no_license | -- SQL practice / 2021-02-03
create table house_account (
id int primary key auto_increment,
date Date not null,
thing varchar(20),
memo varchar(100),
income int,
export int
);
show columns from practice;
show columns from house_account;
+--------+--------------+------+-----+---------+-------... | true |
9e4b50a4003841b85fa91c5b7f8b686baedf884f | SQL | circular-dark/backend | /sql/create_tables.sql | UTF-8 | 2,753 | 3.75 | 4 | [] | no_license | /* The root user table. */
CREATE TABLE UserInfo (
UserID BIGINT PRIMARY KEY AUTO_INCREMENT,
GID BIGINT NOT NULL,
Email VARCHAR(200) UNIQUE,
PhoneNumber VARCHAR(200) UNIQUE,
WechatID VARCHAR(200) UNIQUE,
WeboID VARCHAR(200) UNIQUE,
HashedPassword VARCHAR(300),
IsConfirm TINYINT NOT NULL,
IsActive TINYINT NOT NULL,
Name... | true |
d5f7572f96e943a2a4eacd25b378a876aaba396c | SQL | omobus/omobus-1Cv7.7 | /sp_create_recl.sql | WINDOWS-1251 | 13,555 | 3.015625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /* -*- SQL -*- */
/* This file is a part of the omobus-1Cv7.7 project.
* Copyright (c) 2006 - 2010 ak-obs, Ltd. <info@omobus.ru>.
* Author: George Kovalenko <george@ak-obs.ru>.
*/
if OBJECT_ID('SP_CREATE_RECL') is not null drop procedure [dbo].[SP_CREATE_RECL]
GO
/****** Object: StoredProcedure [dbo].[SP_CREATE_R... | true |
2e36dd2e41e1026cf3c63d6412c3ab124ae73bae | SQL | rashedcs/LAB | /DBMS/Lab 3/query 2.sql | UTF-8 | 289 | 3.4375 | 3 | [] | no_license | --Find the names, street address, and cities of residence of all em-ployees who work for First Bank Corporation
--and earn more than $2500
select * from employee
where employee_name
in(select employee_name from works where company_name = 'First Bank Corporation' and salary > 2500);
| true |
aa9d6b5a89fae384f01122a054b26c204f0ab343 | SQL | Tryford/MP_MODSPACK_VPJFD | /Mods/(JFD-4) JFD's Rise to Power (v 33)/Components/Claims/Core/Claims_Buildings.sql | UTF-8 | 34,415 | 2.796875 | 3 | [] | no_license | --==========================================================================================================================
-- BUILDING CLASSES
--==========================================================================================================================
-- BuildingClasses
-------------------------------... | true |
6b14a4b1b4aaf5ec3b9538030b7cc7fd6971b094 | SQL | jessie28/dead-link | /content_url.sql | UTF-8 | 3,795,128 | 2.71875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 180.235.132.66
Source Server Version : 50167
Source Host : localhost:3306
Source Database : cga_union_bak
Target Server Type : MYSQL
Target Server Version : 50167
File Encoding : 65001
Date: 2016-11-30 18:39:48
*/
SET FOREIGN_KEY_CHEC... | true |
91e8a6843d910c1e239dd48de12d68134e3fa8f7 | SQL | cqframework/cqf-tooling | /tooling/src/test/resources/org/opencds/cqf/tooling/stu3/input/pagecontent/cql/EXM506_FHIR3-2.0.000.cql | UTF-8 | 9,282 | 2.890625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | library EXM506_FHIR3 version '2.0.000'
using FHIR version '3.0.0'
include MATGlobalCommonFunctions_FHIR3 version '4.0.000' called Global
include FHIRHelpers version '3.0.0' called FHIRHelpers
include SupplementalDataElements_FHIR3 version '1.0.0' called SDE
codesystem "Diagnosis Role": 'http://hl7.org/fhir/diagnosis... | true |
f528e52d9248c426200338f2f2c44d26b7a825be | SQL | pavgra/WebAPI-legacy | /src/main/resources/db/migration/postgresql/V1.0.0.10__schema_create_common_model.sql | UTF-8 | 975 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | ALTER TABLE ${ohdsiSchema}.COHORT_DEFINITION
ADD guid VARCHAR,
ADD organization VARCHAR NOT NULL DEFAULT 'OHDSI',
ADD model_version VARCHAR NOT NULL DEFAULT '5.1',
ADD model_type VARCHAR NOT NULL DEFAULT 'CDM',
ADD version VARCHAR,
ADD author_username VARCHAR,
ADD author_name VARCHAR;
COMMENT ON COLUMN $... | true |
b53158ad1be127bd0dda756fa0c5869e601e58d1 | SQL | SaNo345/HibernateCrud | /sql/hibernateCrudDb.sql | UTF-8 | 1,364 | 3.59375 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS hibernatecrudDb;
USE hibernatecrudDb;
create table company
(
companyid int(100) auto_increment
primary key,
name varchar(50) null,
hvhh varchar(50) null,
areaofspace double(8,3) default '0.000' null,
factualAddress varchar(255) null
)
;
create table payorder... | true |
6940ce3528cbb9706061454dc24015ebbffb9cde | SQL | VijayEluri/SBAM-Dev | /dbschema/goconversionscripts/query_find_truncucn_conflicts.sql | UTF-8 | 194 | 3.359375 | 3 | [] | no_license | select a.truncucn, a.ucn, b.ucn, a.ship_to_code, b.ship_to_code
from truncated_ucn a, truncated_ucn b
where a.truncucn = b.truncucn
and a.ucn <> b.ucn
order by a.truncucn,a.ucn,a.ship_to_code | true |
86114ffb2574328030992e2d1137aa988d79e6a0 | SQL | oumaharuki/soraReptiles | /sql/sora_v1.sql | UTF-8 | 3,231 | 3.4375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- 主机: 127.0.0.1
-- 生成日期: 2019-07-19 12:48:11
-- 服务器版本: 10.3.16-MariaDB
-- PHP 版本: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... | true |
e1ace8b6c5e962b835341ea239347e861ab9b5cf | SQL | cashgithubs/BI | /年终结转处理/just_do_it_1.SQL | GB18030 | 1,536 | 3.34375 | 3 | [] | no_license | --裺
--1.T09_GL_ITEM_DYNAM_HIS ݽбݣΪ1230T09_GL_ITEM_DYNAM_HIS_1230
-- ԻȡͬԱݣ
CREATE TABLE BDSDATA.T09_GL_ITEM_DYNAM_HIS_1230 (LIKE BDSDATA.T09_GL_ITEM_DYNAM_HIS);
INSERT INTO BDSDATA.T09_GL_ITEM_DYNAM_HIS_1230 SELECT * FROM BDSDATA.T09_GL_ITEM_DYNAM_HIS;
CREATE TABLE ADSDATA.C05_FIRST_ITEM_DAY_SUM_1230 (LIKE ADSDATA.C0... | true |
7e99e75a2c45be329fc5bb4b007581f8c6ae7874 | SQL | tlvb25/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/15-comedy_only.sql | UTF-8 | 229 | 3.53125 | 4 | [] | no_license | -- ONLY COMEDY
SELECT tv_shows.title
FROM tv_show_genres
LEFT JOIN tv_shows
ON tv_show_genres.show_id=tv_shows.id
LEFT JOIN tv_genres
ON tv_show_genres.genre_id=tv_genres.id
WHERE tv_genres.name='Comedy'
ORDER BY tv_shows.title;
| true |
c43b3ebcb1246ff33eb1b3ccce0e2b7939555eec | SQL | shishirmax/sql-queries | /SQLQuery_Count.sql | UTF-8 | 861 | 3.84375 | 4 | [] | no_license | --https://stackoverflow.com/questions/46902242/count-in-sql-statement
create table companyData(
comp varchar(100),
id varchar(100),
name varchar(100),
type varchar(100))
insert into companyData
values
('AAA','D2222','Jon','BR11'),
('AAA','D2222','Jon','BR12'),
('AAA','D2865','Toe','BR11'),
('BBB','D4151','Sue'... | true |
0a0beed7d6b840fcd0a0da68b32786620e9d6e9a | SQL | web91magic/retail | /retailcrm/bundle/sql/categories.sql | UTF-8 | 389 | 3.203125 | 3 | [] | no_license | SELECT
`right`.id AS `id`,
`right`.parent_id AS `parent_id`,
`left`.name AS `parentName`,
`right`.name AS `categoryName`,
CONCAT_WS('/', `left`.name, `right`.name) AS url
FROM s_categories `right`... | true |
d6dbd0e7ee028f9c38e08f1d02bf1a57fd2b9648 | SQL | kettbi/mon_premier_ctf | /ctf-sqli/mysql/init_db_mccoy.sql | UTF-8 | 1,074 | 2.515625 | 3 | [] | no_license | CREATE DATABASE dbmccoy;
USE dbmccoy;
CREATE TABLE users (id INT NOT NULL AUTO_INCREMENT, login VARCHAR(45) NULL, passwd VARCHAR(35) NULL, PRIMARY KEY (id));
insert into users (login,passwd) values ('admin',md5('lambay'));
insert into users (login,passwd) values ('john',md5('doe'));
insert into users (login,passwd) val... | true |
7b4d1a14938c00389a5eec5fae2d0dcc872d190c | SQL | hoseinfattahian/DataScienceTrainings | /MySQL/MySQL Cheatsheet.sql | UTF-8 | 5,658 | 3.875 | 4 | [] | no_license | ----------- Browsing
SHOW DATABASES;
SHOW TABLES;
SHOW FIELDS FROM table / DESCRIBE table;
SHOW CREATE TABLE table;
SHOW PROCESSLIST;
KILL process_number;
----------- Select
SELECT * FROM table;
SELECT * FROM table1, table2;
SELECT field1, field2 FROM table1, table2;
SELECT ... FROM ... WHERE condition
SELECT ... FROM... | true |
951a7af37751df454f552cde26a5b0ef8fcd401f | SQL | permadiekapermana/sipdapap | /database/db_sipdapap.sql | UTF-8 | 42,215 | 3.09375 | 3 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS db_sipdapap;
CREATE DATABASE db_sipdapap;
USE db_sipdapap;
DROP TABLE IF EXISTS agama;
CREATE TABLE agama
(
id_agama VARCHAR(7) NOT NULL PRIMARY KEY,
agama VARCHAR(30) NOT NULL
);
DELETE FROM agama;
INSERT INTO agama VALUES
('AGM.001', 'Islam'),
('AGM.002', 'Kristen Protestan'),
('AGM.003',... | true |
c6f383610ef16581a5e2c60c0c056c5ad1365049 | SQL | Gmlife/RPGTask | /rpgtask.sql | UTF-8 | 5,088 | 3.734375 | 4 | [] | no_license | create table if not exists blog
(
blog_id int auto_increment,
blog_title varchar(200) null comment '博客标题',
blog_text longtext null comment '博客正文',
blog_commit text null comment '博客留言id',
verify_state bit default b'0' not null comment '审核状态',
constraint blog_blo... | true |
788b9eb354bbe36b26c2f9b0412a2b5a09b469b2 | SQL | dougbthompson/WC | /database/wc.ziptables.sql | UTF-8 | 9,904 | 2.65625 | 3 | [] | no_license |
drop table if exists wc_zip_argos;
create table wc_zip_argos (
wc_id varchar(64) not null,
date integer not null,
deploy_id varchar(64) null,
ptt integer null,
instrument_family var... | true |
3424b13a0af1c76ab7fdb53f3541a4746e8d765a | SQL | dwikydiasl/Restodepo | /sql jangan ikut diupload/restodepo2_bawah_12_10_2018.sql | UTF-8 | 66,180 | 3.140625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 12, 2018 at 03:27 AM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.0.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
186065400aa3d4c4019752218295e4c19b318e4a | SQL | lgomezp4/pruebaTecnicaConcatel | /resources/Datebase.sql | UTF-8 | 495 | 2.859375 | 3 | [] | no_license | /**
* Author: Luis Gómez
* Created: 23-jun-2019
*/
CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'testpsw';
CREATE DATABASE BackEndExam3
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
GRANT SELECT, INSERT, UPDATE, DELETE ON BackEndExam3.* TO 'testuser'@'localhost';
USE BackEndExam3;
CREAT... | true |
55bc1013bc4103354b34fd12d827c82db26235cd | SQL | lgcarrier/AFW | /5.2.3/Database/Constraints/AFW_07_VALR_AUDIT_SA_FK1.sql | UTF-8 | 229 | 2.8125 | 3 | [
"MIT"
] | permissive | SET DEFINE OFF;
ALTER TABLE AFW_07_VALR_AUDIT_STRUC_APLIC ADD (
CONSTRAINT AFW_07_VALR_AUDIT_SA_FK1
FOREIGN KEY (REF_AUDIT_STRUC_APLIC)
REFERENCES AFW_07_AUDIT_STRUC_APLIC (SEQNC)
ON DELETE CASCADE
ENABLE VALIDATE)
/
| true |
e9cb3c0dd91e3e2c99adfb6916c6c8cbd007c57a | SQL | sbishop7/DojoAssignments | /Python/MySQL/LeadGenBusiness/08_clientsSitesLeads.sql | UTF-8 | 1,272 | 4.5625 | 5 | [] | no_license | # 8. What query would you run to get a list of client names and the total # of leads we've generated
# for each of our clients' sites between January 1, 2011 to December 31, 2011?
# Order this query by client id. Come up with a second query that shows all the clients,
# the site name(s), and the total number of ... | true |
0032f9e669149d5896c29594c0fe6f5b90b29bfd | SQL | eulerto/wal2json | /sql/bytea.sql | UTF-8 | 950 | 2.84375 | 3 | [] | permissive | \set VERBOSITY terse
-- predictability
SET synchronous_commit = on;
SET extra_float_digits = 0;
DROP TABLE IF EXISTS xpto;
DROP SEQUENCE IF EXISTS xpto_rand_seq;
CREATE SEQUENCE xpto_rand_seq START 11 INCREMENT 997;
CREATE TABLE xpto (
id serial primary key,
rand1 float8 DEFAULT nextval('xpto_rand_seq'),
bincol ... | true |
0f77a91704882327ec58d609b9da4b3153721b90 | SQL | altamira/visualstudio | /Sistema de Informação Altamira/EGISSQL.Database/dbo/Stored Procedures/Procs1/pr_consulta_pesquisa_credito_vencida.sql | UTF-8 | 1,669 | 3.4375 | 3 | [] | no_license |
-------------------------------------------------------------------------------
--pr_consulta_pesquisa_credito_vencida
-------------------------------------------------------------------------------
--GBS Global Business Solution Ltda 2004
---------------------------------------... | true |
60b373b7b91dc996806e34f97b3a533fd917704d | SQL | stew2003/UptownID-jquery | /create_DB.sql | UTF-8 | 2,257 | 3.6875 | 4 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS uptown_id;
CREATE DATABASE uptown_id DEFAULT CHARACTER SET utf8;
USE uptown_id;
CREATE TABLE colors (
cid INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
friendlyName VARCHAR(255) NOT NULL,
icon_path VARCHAR(255) NOT NULL,
PRIMARY KEY(cid)
);
CREATE TABLE materials (
... | true |
c72e777c6af522d4e174d843ee79e4bd2444d73a | SQL | fujita0622/-WriteTypeSqlDrill | /cap1/1_13_4.sql | UTF-8 | 2,061 | 4.21875 | 4 | [] | no_license | 1-13 問4 著者-書籍情報テーブル(author_books)で、著者ごとの書籍数を求めてみましょう。その際、書籍数が4冊以上の著者は「多い」、2冊以上4冊未満の著者は「普通」、2冊未満の著者は「少ない」と出力します。
また、出力列の名前は先頭から「著者ID」「カウント数」「評価」とします。
[回答]
-- FROMで指定したテーブルからauthor_idと著者(author_id)ごとのカウント数を取得
-- ASキーワードでauthor_id列は'著者ID'、著者(author_id)ごとのカウント数の列は'カウント数'と別名をつける
SELECT author_id AS 著者ID, COUNT(*) AS カウント数... | true |
83f7f2f89e610e87849c57b582b10f0b532c5e00 | SQL | JCON3DEV/LightBnB | /1_queries/property_listings_by_city.sql | UTF-8 | 512 | 3.359375 | 3 | [] | no_license | SELECT properties.*, avg(property_reviews.rating) as average_rating
FROM properties
JOIN property_reviews ON property_id = properties.id
WHERE city LIKE '%ancouv%'
GROUP BY properties.id
HAVING avg(property_reviews.rating) >= 4
ORDER BY cost_per_night ASC
LIMIT 10;
-- SELECT properties.id, title, country, city, street... | true |
9eaec736a8d4bf0872e38189316cb35620d5cb22 | SQL | niucongcong/miaosha | /miaosha.sql | UTF-8 | 18,391 | 3.234375 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : miaosha
Source Server Type : MySQL
Source Server Version : 80021
Source Host : localhost:3306
Source Schema : miaosha
Target Server Type : MySQL
Target Server Version : 80021
File Encoding : 65001
Date: 03/01/2021 21:2... | true |
279209e7cbb422cb798b62ba6900d8264410f09c | SQL | daniellekeefe/bamazon | /schema.sql | UTF-8 | 475 | 3.625 | 4 | [] | no_license | -- products
-- create/drop DB in mysql
DROP DATABASE if exists bamazon;
CREATE DATABASE bamazon;
-- command to use the bamazon DB
USE bamazon;
-- product table creation
CREATE TABLE products(
-- auto assigmed product ID
id INT NOT NULL AUTO_INCREMENT,
-- product details
product_name varchar(40) not null,
de... | true |
7e73eff3dbe550a08a49f32c09ee75bc0c428bfb | SQL | KronosSolucionesTIC/MDC | /scripts/categoria.sql | UTF-8 | 1,677 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 04-10-2019 a las 09:45:31
-- Versión del servidor: 5.5.62-cll-lve
-- Versión de PHP: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:0... | true |
bae3e38e8094bc7fed512853d92f5c1677c8ebb6 | SQL | renjieliu/leetcode | /database/1651.SQL | UTF-8 | 10,051 | 4.0625 | 4 | [] | no_license | /*
1651. Hopper Company Queries III
Table: Drivers
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| driver_id | int |
| join_date | date |
+-------------+---------+
driver_id is the primary key for this table.
Each row of this table contains the driver's ID and th... | true |
91e304889aa568b197d0fa06cd7af643c57574cd | SQL | jcarlosbatista/script | /consumo_mem2.sql | UTF-8 | 768 | 3.609375 | 4 | [] | no_license | select inst_id, sid, serial, username,round(total_user_mem/1024/1024,2) "MEM_USADA(MB)",round(100 * total_user_mem/total_mem,2) "MEMORIA(%)"
from
(select b.inst_id inst_id, b.sid sid,b.serial# serial, nvl(b.username,p.name) username, sum(value) total_user_mem
from sys.v_$statname c, sys.v_$sesstat a, sys.gv$sess... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.