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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
041edd98d9e3d2ccb4f3dc3d998f38bd7cc15a6f | SQL | ddhoang21/Employee-Tracker | /schema.sql | UTF-8 | 653 | 3.765625 | 4 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS employees_db;
CREATE DATABASE employees_db;
USE employees_db;
CREATE TABLE department (
id INTEGER AUTO_INCREMENT NOT NULL,
name VARCHAR(50) NULL,
PRIMARY KEY (id)
);
CREATE TABLE role (
id INTEGER AUTO_INCREMENT NOT NULL,
title VARCHAR(50) NULL,
salary DECIMAL(10, 2) NULL,... | true |
7abb57996931e8d9f6ab5e992d4bd5fee67a2ad8 | SQL | kendrawalker/sharper-image-salon | /sharper_image_salon.sql | UTF-8 | 455 | 2.953125 | 3 | [] | no_license |
DROP TABLE IF EXISTS customer_requests;
DROP TABLE IF EXISTS profile_pics;
CREATE TABLE customer_requests (
id SERIAL primary key,
first_name VARCHAR(250) not null,
last_name VARCHAR(250) not null,
email_address VARCHAR(250) UNIQUE not null,
note TEXT,
gender VARCHAR(250),
phone_number VA... | true |
5d64d32a8dceb2ba9ab081d9036ece0fd313c706 | SQL | tlwt/paperyard | /paperyard/updates/sqlite/000000005.sql | UTF-8 | 1,231 | 3.3125 | 3 | [
"MIT"
] | permissive | --
-- Update config_regexTemplates table to meet requirements of github issue #30
--
-- begin transaction
BEGIN TRANSACTION;
-- step one create tmp table with new format
CREATE TABLE "tmp_rule_archive"(
"id" Integer PRIMARY KEY AUTOINCREMENT,
"toFolder" Text,
"isActive" Integer NOT NULL DEFAULT 1,
"company" Text,... | true |
cdb5a7648c11f7f94519e0ae7668695e3f10c0c8 | SQL | gbax/xml-parser-exporter | /src/main/resources/db/init.sql | UTF-8 | 599 | 3.09375 | 3 | [] | no_license | CREATE SEQUENCE IF NOT EXISTS SEQ_TEST_TABLE_TABLE;
CREATE TABLE TEST_RECORD (
ID INT DEFAULT (NEXT VALUE FOR SEQ_TEST_TABLE_TABLE) PRIMARY KEY NOT NULL,
DEP_CODE VARCHAR(20) NOT NULL,
DEP_JOB VARCHAR(100) ... | true |
d79abfeb365dcd1253e0331e26cdb81e95e143f7 | SQL | conelo03/bolu-kukus-siliwangi | /database/db_siliwangi.sql | UTF-8 | 24,235 | 2.734375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 02, 2021 at 06:15 PM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.2.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
8421e39c9f3c6370b6f8a3aefea9c8d9a98d8f0c | SQL | Rockelarre/Desafio-Top-100 | /desafio-top100.sql | UTF-8 | 1,719 | 4.46875 | 4 | [] | no_license | -- 1. Crear base de datos llamada películas.
-- CREATE DATABASE 'peliculas';
-- 2. Cargar ambos archivos a su tabla correspondiente.
CREATE TABLE peliculas (
id SMALLINT PRIMARY KEY,
pelicula VARCHAR(100),
anio_estreno VARCHAR(4),
director VARCHAR(50)
);
CREATE TABLE reparto (
id SMALLINT,
actor VARCHAR(50),
F... | true |
33f318ea448f652bd756ce9ebc7a6e72bd827e7d | SQL | vernonnaidoo/chef-hello-world | /ponies.sql | UTF-8 | 430 | 2.734375 | 3 | [] | no_license | create database demo;
use demo;
CREATE TABLE IF NOT EXISTS ponies (
id INT(11) NOT NULL AUTO_INCREMENT,
name VARCHAR(45) DEFAULT NULL,
description VARCHAR(200) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB
INSERT INTO ponies VALUES
(NULL, "Twilight", NULL),
(NULL, "Fluttershy", NULL),
(NUL... | true |
d44a2babca0cd63a0a03d27827baf74b06cd5446 | SQL | nickyvo8910/Napier_WDD | /databse/wine2door.sql | UTF-8 | 10,377 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Nov 27, 2019 at 05:24 AM
-- Server version: 5.7.26
-- PHP Version: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `wine2door`
--
CREATE DATABASE IF NOT EXIST... | true |
18abb809266b382b49a0462a7920b74076e68c1d | SQL | yasushi-jp/samplesource | /javaee7tettei_sample/サンプルデータ/data4JSF.sql | SHIFT_JIS | 4,737 | 3.15625 | 3 | [] | no_license | --
DELETE FROM CATEGORY_HAS_KNOWLEDGE;
DELETE FROM CATEGORY;
DELETE FROM KNOWLEDGE_COMMENT;
DELETE FROM KNOWLEDGE;
DELETE FROM ACCOUNT;
-- JeS\
INSERT INTO CATEGORY (ID, NAME) VALUES (1, 'Java');
INSERT INTO CATEGORY (ID, NAME) VALUES (2, 'DB');
INSERT INTO CATEGORY (ID, NAME) VALUES (3, 'FMW');
-- AJEg\
INSERT INTO... | true |
6b2ee95b1dc618629a77327f16b65cc419a0890b | SQL | SaruXuan/ntag213creator | /database.sql | UTF-8 | 7,156 | 3.265625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- 主機: 127.0.0.1
-- 產生時間: 2020-06-11 09:22:51
-- 伺服器版本: 10.4.11-MariaDB
-- PHP 版本: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... | true |
a8e6b50327f2c133b07da2cbc9ebfae7057d9725 | SQL | lmaldonado93/SQL_HW | /schema.sql | UTF-8 | 1,171 | 3.53125 | 4 | [] | no_license | DROP TABLE IF EXISTS departments;
DROP TABLE IF EXISTS dept_emp;
DROP TABLE IF EXISTS dept_manager;
DROP TABLE IF EXISTS employees;
DROP TABLE IF EXISTS salaries;
DROP TABLE IF EXISTS titles;
CREATE TABLE departments (
dept_no VARCHAR NOT NUll,
dept_name VARCHAR Not NULL
);
CREATE TABLE dept_emp (
emp_no INTEGER N... | true |
9d03a140f4ace81cbb6b212e843f59c173b09009 | SQL | jhong1016/Employee-Tracker | /schema.sql | UTF-8 | 662 | 3.375 | 3 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS employee_DB;
CREATE DATABASE employee_DB;
USE employee_DB;
----- Create Department Table -----
CREATE TABLE department (
id INT auto_increment PRIMARY KEY NOT NULL,
name VARCHAR(30) NOT NULL
);
----- Create Role Table -----
CREATE TABLE role (
id INT auto_increment PRIMARY KEY NO... | true |
8807b44149a06dab3b4a271170149ec0a69564ea | SQL | ehuieric/Employee-tracker | /employee.sql | UTF-8 | 598 | 3.46875 | 3 | [] | no_license | DROP DATABASE IF EXISTS employee_db;
CREATE DATABASE employee_db;
USE employee_db;
CREATE TABLE department (
id INTEGER(10) AUTO_INCREMENT NOT NULL,
name VARCHAR(30) NOT NULL,
PRIMARY KEY (id),
);
CREATE TABLE role (
id INTEGER(10) AUTO_INCREMENT NOT NULL,
title VARCHAR(30) NOT NULL,
salary DECIM... | true |
65850566e347318776ccab96b3b7eb835cc0f6b2 | SQL | gosuvigi/doodle | /server/src/main/resources/db/migration/h2/V2__data.sql | UTF-8 | 1,398 | 2.53125 | 3 | [] | no_license | INSERT INTO players (name, email, phone, active, subscriber)
VALUES ('Lionel Messi', 'messi@messi.com', '00801', TRUE, TRUE);
INSERT INTO players (name, email, phone, active, subscriber)
VALUES ('Neymar Jr', 'neymar@neymar.com', '00802', TRUE, TRUE);
INSERT INTO players (name, email, phone, active, subscriber)
VALUES (... | true |
6087b817391802b0c9e2d58989e23d70b85e41ee | SQL | jrikhsan/Pemrograman-Web-Praktikum-Latihan | /Tugas Akhir/toko_online/toko_online.sql | UTF-8 | 6,035 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 08, 2020 at 04:45 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
8603d0320e2219b75c206e23518cb7a61053b963 | SQL | tomsmith1204/openForumPHP | /mysql/openForumDB.sql | UTF-8 | 1,546 | 3.390625 | 3 | [] | no_license | /*
*****CREDITS: PLEASE DO NOT DELETE*****
* Written by Thomas Smith *
* 2015 *
* tomsmith1204@gmail.com *
***************************************
*/
CREATE DATABASE openForumDB;
USE openForumDB;
CREATE TABLE USERS (
... | true |
0937c074433b253ff8c9c48b256072e353dfd4b7 | SQL | mnarowski/inzynieria | /Migrations/0006.sql | UTF-8 | 16,186 | 2.796875 | 3 | [] | no_license | --
-- postgresql database dump
--
-- dumped from database version 9.2.2
-- dumped by pg_dump version 9.2.2
-- started on 2013-01-14 21:31:27
set statement_timeout = 0;
set client_encoding = 'utf8';
set standard_conforming_strings = on;
set check_function_bodies = false;
set client_min_messages = warning;
--
-- toc ... | true |
339ccd35cc91a70263ea714ea3b1301f846394b0 | SQL | youavang/Database-Design-SQL | /MarcusDeliverableSelectStatements.sql | UTF-8 | 8,846 | 4.0625 | 4 | [] | no_license | /* The following SQL query generates the Project Information shown in Part C of Exhibit B */
Select ProjectId, ProjectLocation, Description
from Project
where ProjectId = 'WA-PIN-335-005';
/* The following SQL query generates the Hours by Job, Gender, Minority Information shown in Part D of Exhibit B */
/*Note We assu... | true |
697457f1eac3405493aa5a77a49c32e69d128dc0 | SQL | eggplantpasta/oracle-data-dictionary-doc | /sql/extras/data_documentaion.sql | UTF-8 | 908 | 3.90625 | 4 | [
"MIT"
] | permissive | -- Table and column documentation
--
-- Use the following select statements to create code templates for the creation of table and column comments for the current user's tables.
-- Where a comment exists the code generated is pre-populated to re-create it, but the whole statement is commented out by default.
select nv... | true |
f33537fb4849fc213593c3b4182a088505716abd | SQL | csiro-rds/data-migration | /steps/sql/mysql/collectionOne/collectionOne_collecting_team_view.sql | UTF-8 | 803 | 3.75 | 4 | [
"MIT"
] | permissive | CREATE OR REPLACE VIEW CMS_TEAM_MEMBERSHIP_SORTED_V AS
SELECT *
FROM CMS_TEAM_MEMBERSHIP_V tm
ORDER BY tm.LEGACYID_CTM, tm.MEMBERTYPE, tm.TEAMORDER;
CREATE OR REPLACE VIEW CMS_COLLECTING_TEAM_W_MEMBERS_V AS
SELECT
t.LEGACYID_CTM,
t.PRIMARYNAME,
t.OTHERNAME,
t.CREATEDBY,
t.CREATEDATE,
t.UPDATEDBY,
t.UP... | true |
e8f09e8a0219225a69da40588565803dce6ee018 | SQL | JongjinYoon/sql | /practice/practice04.sql | UTF-8 | 6,163 | 4.78125 | 5 | [] | no_license | -- 문제1.
-- 현재 평균 연봉보다 많은 월급을 받는 직원은 몇 명이나 있습니까?
select count(emp_no)
from salaries
where to_date = '9999-01-01'
and salary > (
select avg(salary)
from salaries
where to_date = '9999-01-01');
-- 문제2.
-- 현재, 각 부서별로 최고의 급여를 받는 사원의 사번, 이름, 부서 연봉을 조회하세요. 단
-- 조회결과는 연봉의 내림차순으로 정렬되어 나타나야 합니다.
select a.emp_no, concat... | true |
5e17be6db58e074afe0f5784ff0d6f96c9997e84 | SQL | trungdc-ha/Java-Web-Back-end-Development-2.0 | /_1_Co_So_Du_Lieu_Quan_He/MyQuery.sql | UTF-8 | 736 | 3.703125 | 4 | [] | no_license |
/* Lấy tất cả thông tin của table customers */
SELECT * FROM customers
/* Lấy tất cả thông tin cột customername, phone, city, country của table customers */
SELECT customerName, phone, city, country FROM customers
/* hiển thị thông tin khách hàng có tên là Atelier Graphique. */
SELECT * FROM customers WHERE custome... | true |
1df3549a9fff097801b9159aab18e2f0a3331bec | SQL | SeyhZamani/game-app | /sql_scripts/step3-create-event-store-table.sql | UTF-8 | 639 | 3.578125 | 4 | [] | no_license | CREATE TABLE public.event_store (
aggregate_uuid uuid NOT NULL,
aggregate_type_id integer NOT NULL,
event_type_id integer NOT NULL,
event_data json,
create_time timestamp without time zone NOT NULL,
CONSTRAINT fk_event_store_event_type FOREIGN KEY (event_type_id) REFERENCES public.event_type (id) MATCH SIMP... | true |
c3aec166c92835f8d2771eea9c74664cb51a1b53 | SQL | imedsaoud/TodoList | /db/Db_todos.sql | UTF-8 | 731 | 3.078125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS todos ;
USE todos;
CREATE TABLE IF NOT EXISTS `todo` (
id INT UNSIGNED AUTO_INCREMENT,
task VARCHAR(50) NOT NULL,
url VARCHAR(255) NOT NULL,
category VARCHAR (50) NOT NULL,
priority VARCHAR(50) NOT NULL,
status VARCHAR(50) NOT NULL,
PRIMARY KEY(id)
) DEFAULT CHARSET=utf8mb4 COLLA... | true |
a2ba01fc5ee7ab6c3cdda301357d98da3293cc74 | SQL | nate-hughes/dba-scripts | /execute-as.sql | UTF-8 | 498 | 2.59375 | 3 | [] | no_license |
--Display current execution context
SELECT SUSER_NAME(), USER_NAME();
--Scope of impersonation is at the server level
EXECUTE AS LOGIN = 'SomeLogin';
----Scope of impersonation is restricted to the current database
--EXECUTE AS USER = 'SomeLogin';
--Display current execution context
SELECT SUSER_NAME(), USER_NAME(... | true |
6cdfb87049c5f19a8cae8ef95333cd1a709c3341 | SQL | brancoisrael/itspay | /migracao-bahamas/001-cadastro/script racional - 10072020.sql | UTF-8 | 10,934 | 3.046875 | 3 | [] | no_license |
--inicio 192.345
select count(*.)
from cadastral.conta_pagamento cpag
where cpag.id_instituicao = 1201
and cpag.id_status_conta not in (63, 64)
--fim
--inicio 152.041
select count(*.)
from cadastral.conta_pagamento cpag
inner join cadastral.conta_pagamento_fat cpaf on cpaf.id_con... | true |
0946f561da104c718bab23b7101f5ae6877f9070 | SQL | shinow/smartwall | /smartwall-question_bank/src/main/resources/db/migration/V1.1.1__init_medical_kind_category.sql | UTF-8 | 858 | 2.609375 | 3 | [] | no_license | alter table EXAM_MEDICAL_KIND add show_index number(10);
insert into exam_medical_kind (guid, name, modify_time, modify_flag,show_index) values ('61AEAB78A7CD3671E050840A063959A8', '医生资格', sysdate, 1,1);
insert into exam_medical_kind (guid, name, modify_time, modify_flag,show_index) values ('61AEAB78A7CE3671E050840A0... | true |
6904ffc952b1f555e5e0b1371c292dc8b50192b0 | SQL | gustafl/lexeme | /src/server/mysql/populate_database.sql | UTF-8 | 1,723 | 3.015625 | 3 | [] | no_license | USE `lexeme`;
INSERT INTO `grammatical_category`
VALUES
(1,'gender',1,3),
(2,'number',1,2),
(3,'case',1,2),
(4,NULL,1,1),
(5,NULL,1,1),
(6,NULL,1,1),
(7,'collective noun',1,1),
(8,'mass noun',1,1),
(9,'tense',2,2),
(10,'mood',2,2),
(11,'voice',2,2);
INSERT INTO `grammeme`
V... | true |
a5319def020866bdb46676c0389e7a552a02dd48 | SQL | mauriciogrs1/MySQL | /Atividade Revisão MySQL/db_game.sql | UTF-8 | 1,958 | 3.640625 | 4 | [] | no_license | create database db_generation_game_online;
use db_generation_game_online;
create table tb_classe(
id bigint auto_increment primary key not null,
tipo varchar(30) not null,
propriedade varchar(20) not null);
insert into tb_classe (tipo, propriedade) values ("Assassino","Dark");
insert into tb_classe (tipo, propriedade... | true |
d1211aadbfff801562700051759f55ee7e814b7e | SQL | FabLabAvignon/FabPayForm | /lib/sql-init.sql | UTF-8 | 692 | 2.578125 | 3 | [
"MIT"
] | permissive | CREATE TABLE `fab-pay-form` (
`paymentId` varchar(32) NOT NULL COMMENT 'PayPal payment id. (Usually 19 characters)',
`gender` int(11) NOT NULL COMMENT '0 => Man, 1 => Woman',
`lastName` varchar(64) NOT NULL,
`firstName` varchar(64) NOT NULL,
`emailAddr` varchar(64) NOT NULL,
`membershipType` int(11) NOT NUL... | true |
3c65203b67c824efcfd0e181f66495a882e7126d | SQL | gialnet/collect_tax | /700_AVISOS.SQL | ISO-8859-1 | 4,361 | 3.78125 | 4 | [] | no_license | -- -----------------------------------------------------
-- Euro. Revisado el 5-12-2001. Lucas Fernndez Prez
-- No se han realizado cambios.
-- -----------------------------------------------------
CREATE OR REPLACE FUNCTION JEFE_ZONA(xZONA IN CHAR)
RETURN CHAR
AS
xUSUARIO CHAR(30);
BEGIN
-- AVERIGUAR QUIEN ES EL ... | true |
07e84a02e9eb08ebe499226476696a1140941d41 | SQL | adishap/blog. | /blog.sql | UTF-8 | 2,857 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.6
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 07, 2014 at 09:05 AM
-- Server version: 5.5.36
-- PHP Version: 5.4.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
0696ce2256dddc9ffabf7fcc1aea8b0b6d4d5967 | SQL | SayantoRoy/PRATIBHAPOP | /PRATIBHAPOP/TRN/SalesMaterial.sql | UTF-8 | 4,535 | 2.9375 | 3 | [] | no_license | CREATE TABLE [TRN].[SalesMaterial] (
[Id] VARCHAR (30) NOT NULL,
[SalesId] VARCHAR (10) NOT NULL,
[MaterialMasterId] VARCHAR (30) NOT NULL,
[ArticleId] VARCHAR (10) NULL,
[TaxAmount] ... | true |
47ec7ca44f13fc38fa545e7b16e6de691fb49259 | SQL | lizwerther/SeniorProject2020 | /SPDB1.sql | UTF-8 | 764 | 3.140625 | 3 | [] | no_license |
DROP TABLE Profiles CASCADE CONSTRAINTS
DROP TABLE Post CASCADE CONSTRAINTS
DROP TABLE Interests CASCADE CONSTRAINTS
--Users--
CREATE TABLE Profiles (
profileID int not null,
fname varchar (25) not null,
lname varchar (25) not null,
email varchar (30) not null,
phonenumber int not null,
username varchar (20) no... | true |
6abe6ee0418245c956e76b5e68ffeab00e3c36a8 | SQL | zhiji6/Sql | /Tables - Template Method.sql | UTF-8 | 7,548 | 2.984375 | 3 | [] | no_license | -- drop table template_method
CREATE TABLE template_method
(
idtemplate_method serial primary key,
num_version int2,
cod_template_method varchar(20),
cod_repetition int2, -- 1:simple, 2:duplicado, 3:triplicado, 4:cuadruplicado, 8:octuplicado
title varchar(200),
abbreviation varchar(15),
name_method ... | true |
722305606cea9594974cdebf7bb85ef55442ea05 | SQL | david99cartagena/burguerlandia | /Carrito/cart_product.sql | UTF-8 | 1,559 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 16-03-2018 a las 16:06:18
-- Versión del servidor: 5.7.11
-- Versión de PHP: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... | true |
6371caf90275cf15d85e6ff3e25e054465db5a21 | SQL | intCCP/CCP | /Application/Viste/v_cl_controlli_punto6.sql | UTF-8 | 516 | 2.890625 | 3 | [] | no_license | /* Formatted on 21/07/2014 18:31:21 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_CL_CONTROLLI_PUNTO6
(
FLG_CAMBIO_STATO,
PRIMA_STORICIZZAZIONE,
ULTIMA_STORICIZZAZIONE,
QUANTI
)
AS
SELECT a.flg_cambio_stato,
a.prima_storicizzazione,
a.ultima_storicizzazione,
... | true |
d819e1d38036f474c406e50d44105f64a0169180 | SQL | dmitrii-adamian-at-epam/clickhouse-training-materials | /queries/aggregate_sum/4_query_with_partitioning_subquery.sql | UTF-8 | 317 | 3.40625 | 3 | [] | no_license | SELECT C_NATION, P_CATEGORY, sum(LO_ORDTOTALPRICE)
FROM
customer
JOIN (SELECT * FROM lineorder_partition_by_year WHERE D_YEAR = 1997) AS lineorder_year ON LO_CUSTKEY = C_CUSTKEY
JOIN part ON LO_PARTKEY = P_PARTKEY
JOIN supplier ON LO_SUPPKEY = S_SUPPKEY
GROUP BY C_NATION, P_CATEGORY;
| true |
7a518a79dffbed83b8ae7a617dfccbed5ce4bc8e | SQL | ReportsAdmin/MissLEgypt | /models/Missl_Egypt/Tables/fProductImage.sql | UTF-8 | 796 | 3.59375 | 4 | [] | no_license | select *except(rank) from (
select *,row_number() over(partition by product_id order by image desc) rank from (
select cast(entity_id as string) as Product_id,concat(value,'catalog/product',val) as Image,'MissLEgypt' Halo_Country from(
select * from
(select value,'1' joinvalue from `noted-computing-279322.halo_1_1_Egy... | true |
e27daa157f2ca9f4e80abf7a883b6a32cd57c607 | SQL | tcawus/siwozspring | /src/main/resources/db/data/db-schema.sql | UTF-8 | 3,506 | 3.875 | 4 | [] | no_license | DROP TABLE IF EXISTS `Visit`;
DROP TABLE IF EXISTS `HistoricalVisit`;
DROP TABLE IF EXISTS `VisitDescription`;
DROP TABLE IF EXISTS `Employee`;
DROP TABLE IF EXISTS `Patient2Company`;
DROP TABLE IF EXISTS `Company`;
DROP TABLE IF EXISTS `Patient`;
DROP TABLE IF EXISTS `User_roles`;
DROP TABLE IF EXISTS `Users`;
DROP TA... | true |
353b7d532e2930d0670efbea79951b6c2dc7be09 | SQL | boulaypa/pyAWR | /sql/io_histogram.sql | UTF-8 | 852 | 3.953125 | 4 | [] | no_license | with hist as (
select
sn.snap_id,
sn.dbid,
to_char(trunc(cast(begin_interval_time as date ))+ (ROUND ((cast(begin_interval_time as date) - TRUNC (cast(begin_interval_time as date))) * 24) / 24), 'YYYYMMDDHH24MI') btime,
h.event_name,
h.wait_time_milli,
h.wait_count
from d... | true |
fc10d47df5026f4ff8ecc3ab5d7ea2a2b4f4867c | SQL | pescaru98/repoIASS | /SQL/views.sql | UTF-8 | 917 | 3.46875 | 3 | [] | no_license | CREATE OR REPLACE VIEW vw_cart_product AS
SELECT
cp.cart_product_id,
cp.user_id,
cp.product_id,
cp.units as cart_units,
p.name,
p.price_per_unit,
p.picture,
p.units as product_units,
p.tag
from cart_product cp
JOIN users u ON u.user_id = cp.user_id
JOIN product p on p.product_id = cp.product_id;
CREATE OR REPLACE V... | true |
23a39e30c030086311f6ccfb4e725289473751ef | SQL | OrionJoshi/SQL | /Wildcard-special-operators/problem5.sql | UTF-8 | 682 | 3.8125 | 4 | [] | no_license | -- 5. Write a SQL statement to find those salesmen with all information who gets the commission
-- within a range of 0.12 and 0.14.
-- Sample table: salesman
-- salesman_id | name | city | commission
-- -------------+------------+----------+------------
-- 5001 | James Hoog | New York | ... | true |
f25438fda83e03dabb6ae0f797fcca1541f296dd | SQL | Matt0912/Databases | /dbvm/hovsoc.sql | UTF-8 | 1,540 | 3.8125 | 4 | [] | no_license | DROP TABLE IF EXISTS Attends;
DROP TABLE IF EXISTS Event;
DROP TABLE IF EXISTS Has_Skill;
DROP TABLE IF EXISTS Skill;
DROP TABLE IF EXISTS Committee;
DROP TABLE IF EXISTS Member;
CREATE TABLE Member (
email VARCHAR(100) NOT NULL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
student_number INTEGER... | true |
8fc2fe47c837f043073e79a4b5b09c78c7eeb794 | SQL | Crra1234/basesdatos2 | /MODULO PEDIDO/MODULO_PEDIDO.SQL | UTF-8 | 20,360 | 3.53125 | 4 | [] | no_license | CREATE OR REPLACE PROCEDURE REALIZAR_PEDIDO(CodSumi NUMBER, CodArea NUMBER, NomSumi VARCHAR2, CodCen number)
IS
DistriCovax NUMBER(38,0);
CodPais NUMBER;
UltimoPedido NUMBER;
CodOrgaCovax NUMBER;
CantidadNece NUMBER;
NumRandom NUMBER(38,0);
CantNecePedi NUMBER;
MontoTotal NUMBER;
Fecha_Inicio DATE;
Fecha_Final DATE;
Pa... | true |
4fe6c1a2970cc32f7e6739747c36c574dcf313a1 | SQL | 314894831/oomall | /addressservice/src/main/resources/schema.sql | UTF-8 | 15,844 | 2.90625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: localhost Database: oomall_other
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... | true |
08d6d0e490aa7917e79198181b54ac068b292308 | SQL | castell9000/hocheon_back | /backup_hocheon.sql | UTF-8 | 4,234 | 2.953125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- MySQL dump 10.16 Distrib 10.1.20-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: localhost
-- ------------------------------------------------------
-- Server version 10.1.20-MariaDB-1~xenial
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET... | true |
73fd225f76919e8d28592bc3b6b27bea300c9e53 | SQL | arcorck/DUT-AS | /S2/BD/tp3/tp3.sql | UTF-8 | 7,574 | 3.453125 | 3 | [] | no_license | -- TP 3
-- Nom: Bazire , Prenom: Fabrice
-- +------------------+--
-- * Question 1 : --
-- +------------------+--
-- Ecrire une requête qui renvoie les informations suivantes:
-- Combien y a-t-il de personnes dans la table SONDE?
-- Voici le début de ce que vous devez obtenir.
-- ATTENTION à l'ordre des colonnes... | true |
572d3f2674784686abb0a08ecc5610fdcdea8cf9 | SQL | patricestar/SQL | /logic/exercise_logic.sql | UTF-8 | 1,282 | 4.1875 | 4 | [] | no_license | -- Print books written before 1980
SELECT *
FROM books
WHERE released_year <= 1980;
-- Print books written by Eggers or Chabon
SELECT *
FROM books
WHERE author_lname = 'Eggers' || author_lname = 'Chabon';
-- Print all books written by Lahiri published after 2000
SELECT *
FROM books
WHE... | true |
61d150da5ff37173b1f8a7805ab3a62def48e690 | SQL | littlebigbot/waywardrobot.com | /api/resources/sql/schema.sql | UTF-8 | 2,353 | 3.046875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | CREATE TABLE comics (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title VARCHAR NOT NULL,
subtitle VARCHAR NOT NULL,
post_date DATE NOT NULL,
post_content VARCHAR,
slug VARCHAR NOT NULL,
comic_thumb VARCHAR NOT NULL,
comic_medium VARCHAR NOT NULL,
comic_full VARCHAR NOT NULL
);
i... | true |
1dccee1a7f8ae5882f6f88e68993262c33f6bab1 | SQL | Mrhjklslg/javaWeb-master | /out/production/day17_case/resource/webAPP.sql | UTF-8 | 1,782 | 2.9375 | 3 | [] | no_license | CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT ,
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`gender` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`age` int(11) NULL DEFAULT NULL ,
`address` varchar(32) CHARACTER SET utf8 COL... | true |
c2d8d833ab8d7f429f4a1adb3bb67e057bad9764 | SQL | bellmit/park | /sql/tables_task_attract_task_xz.sql | UTF-8 | 2,202 | 3.625 | 4 | [] | no_license | -----------------每日任务表---------
CREATE SEQUENCE seq_yq_task_attract_task
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE seq_yq_task_attract_task
OWNER TO park;
CREATE TABLE t_yq_task_attract_task
(
id BIGINT NOT NULL DEFAULT nextval('seq_yq_task_attract_task' :: REGC... | true |
cfda1c5857236ada5ff5dd0d5fc61194fb9a944f | SQL | m-kempa/Database-Systems | /podstawy podzapytań.sql | UTF-8 | 2,506 | 3.796875 | 4 | [] | no_license | --Zadanie 1
--SELECT nazwisko, etat, id_zesp FROM pracownicy WHERE id_zesp = (SELECT id_zesp FROM pracownicy where nazwisko = 'BRZEZINSKI') order by nazwisko;
--Zadanie 2
--SELECT p.nazwisko, p.etat, z.nazwa FROM pracownicy p left OUTER JOIN ZESPOLY z ON z.id_zesp = p.id_zesp WHERE p.id_zesp = (SELECT id_zesp FROM p... | true |
1e817ca6882748a1c4e9bc0c844c4fc4c050ee5b | SQL | coe3/crime-in-chicago | /db/script/crime_queries.sql | UTF-8 | 5,060 | 4.4375 | 4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- Crime max by year
select max(*) max from crimes whee date_part('year', occurred_at) = :year
-- Crime count by ward for year.
select ward, count(*) from crimes where date_part('year', occurred_at) = 2011 and trim(ward) != '' group by ward order by ward::integer;
-- Crime count by date for year and ward.
select date... | true |
0d6e327af17c6d5861a329c4f8fe48279c9f7df4 | SQL | regisgomes/sctransporte | /SCTransporte/banco_dados/alteracoes_tabelas.sql | UTF-8 | 6,765 | 3.28125 | 3 | [] | no_license |
CREATE SEQUENCE public.marca_id_seq_1;
CREATE TABLE public.marca (
id BIGINT NOT NULL DEFAULT nextval('public.marca_id_seq_1'),
nome VARCHAR NOT NULL,
CONSTRAINT marca_pk PRIMARY KEY (id)
);
ALTER SEQUENCE public.marca_id_seq_1 OWNED BY public.marca.id;
CREATE TABLE ... | true |
af6e2d1768f0e8973f7ea2cf5949ac2ee7b68de6 | SQL | JZuegg/CastDB_SQL | /DataModel/Cmp_Tbl_Compound.sql | UTF-8 | 3,966 | 3.15625 | 3 | [] | no_license | -- ====================================================================
-- Definition
-- ====================================================================
@../Schema/CastDB_Define.sql
--------------------------------------------------
-- Table Definition
--------------------------------------------------
DEFINE xTa... | true |
4e9d1c77af433d7e3338f1aa422dc22e08b4e54f | SQL | MauroDataMapper/mc-to-mdm-migration | /migration/sql/4_security/4_securable_resource_group_role_user_group.sql | UTF-8 | 10,168 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | /*
Classifier
*/
INSERT INTO maurodatamapper.security.securable_resource_group_role(id, version, securable_resource_id, user_group_id, date_created,
securable_resource_domain_type, last_updated, group_role_id,
... | true |
543fa4d29b2445c2dac3efce92de26cbbb8ea107 | SQL | raamon147/SQL-Files | /AULA.sql | UTF-8 | 1,729 | 3.84375 | 4 | [] | no_license | select ename, job, deptno
from emp
where job='CLERK';
SELECT ENAME, SAL, COMM
FROM EMP
WHERE SAL<=COMM;
DESC EMP
SELECT DEPTNO, ENAME,SAL
FROM EMP
WHERE DEPTNO = 20;
SELECT EMPNO, ENAME, JOB, SAL
FROM EMP
WHERE EMPNO = 7788;
SELECT * FROM EMP
WHERE ENAME ='JAMES';
SELECT ENAME, JOB, SAL
FR... | true |
47fac739f536d111eaf5b0cbddbffeba717e3c75 | SQL | partnerccz/clothing-web | /bak/clothing.sql | UTF-8 | 24,482 | 3.359375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50717
Source Host : localhost:3306
Source Database : clothing
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2018-10-01 00:52:44
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... | true |
eaf985446f9f490ff1bb38242f855149d57f4bc5 | SQL | ludoaubert/linkedboxdraw | /select_document.sql | UTF-8 | 6,463 | 3.96875 | 4 | [
"Apache-2.0"
] | permissive | WITH cte_diagram AS (
SELECT id FROM diagram WHERE guid='a8828ddfef224d36935a1c66ae86ebb3'
) ,cte_bool (bit, boolValue) AS (
SELECT 0, 'false' UNION ALL
SELECT 1, 'true'
) ,cte_fields AS (
SELECT boxPosition,
json_group_array(
CASE
... | true |
c249c3d2332b0f45e3c32e2d9bb258e7998cf5fb | SQL | GreenwichCodeZero/InterimReport | /CodeZeroDatabase.sql | UTF-8 | 41,038 | 3.125 | 3 | [] | no_license | -- STRUCTURE AND DATA SQML DUMP FROM PHPMYADMIN FOR THE CODEZERO TEAM DATABASE
-- WARNING: DATA FROM THE FILES TABLE IS EXCLUDED DUE TO FILE SIZE, SO THERE WILL BE
-- FOREIGN KEY ERRORS IMPORTING THIS AS A RESULT
-- phpMyAdmin SQL Dump
-- version 3.2.5
-- http://www.phpmyadmin.net
--
-- Host: mysql.cms.gre.ac.uk
-... | true |
d2fda23866ff9f1c2655a29a8431283573b759f9 | SQL | prakrutijoshi/Training-Aug-21 | /SQL/Prakruti Joshi/Day2/Update_Queries.sql | UTF-8 | 988 | 3.59375 | 4 | [] | no_license | SELECT * FROM Employees
SELECT * FROM Departments
-- update1
UPDATE Employees
SET Email='not available'
--update2
UPDATE Employees
SET Email='not available', CommissionPct=0.10
--update3
UPDATE Employees
SET Email='not available', CommissionPct=0.10
WHERE DepartmentID=110
--update4
UPDATE Employees
SET Email='no... | true |
aaf7d5feaf218d32469aa249ac7b4a24edc5bde9 | SQL | sevdalin/Software-University-SoftUni | /CSharp-DB-Fundamentals/Databases Basics - MS SQL Server/09. Additional Exercises/Additional Exercises/02. All Users in Games.sql | UTF-8 | 391 | 3.765625 | 4 | [
"MIT"
] | permissive | SELECT g.Name AS [Game],
gt.Name AS [Game Type],
u.Username,
ug.Level,
ug.Cash,
c.Name AS [Character]
FROM Users AS [u]
INNER JOIN UsersGames AS [ug] ON ug.UserId = u.Id
INNER JOIN Games AS [g] ON g.Id = ug.GameId
INNER JOIN GameTypes AS [gt] ON gt.Id = g.GameTypeId
INNER JOIN Characters AS [... | true |
d855a77b2ff0c499e8bafa5604c2a49fbb0d6bea | SQL | bjayanta/django-project | /doc/django_project.sql | UTF-8 | 17,433 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 03, 2020 at 02:47 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
c007dae4bdd579dd919588f353647e395d23df38 | SQL | Wilfrido235/Proyecto-Mensajeria | /dumps/bd sms.sql | UTF-8 | 9,656 | 2.953125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `database_sms` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `database_sms`;
-- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: localhost Database: database_sms
-- -------------------------------------... | true |
661c056cca0918612d51558fcee23e9ee15f7964 | SQL | ahshahid/bocapdx | /sql/src/test/resources/diff-joins/4.sql | UTF-8 | 369 | 3 | 3 | [
"Apache-2.0"
] | permissive | IMPORT FROM CSV FILE 'src/test/resources/diff-joins/R4.csv' into R(A1 string);
IMPORT FROM CSV FILE 'src/test/resources/diff-joins/S4.csv' into S(A1 string);
IMPORT FROM CSV FILE 'src/test/resources/diff-joins/T4.csv' into T(A1 string, state string);
SELECT * FROM DIFF (SELECT * FROM R NATURAL JOIN T), (SELECT * FROM S... | true |
c17f6dc3ca27be1c769dee239cee6207965e5101 | SQL | mhxie/AcaPush | /doc/database/create_db.sql | UTF-8 | 1,338 | 3.609375 | 4 | [] | no_license | drop table college;
drop table news;
drop table notice;
drop table newsComment;
drop table studentInfo;
create table college (
id serial,
name varchar(255) not null,
address varchar(255) not null,
primary key(id)
);
create table news (
id serial,
collegeId int not null,
title varchar(255) not null,
time date ... | true |
f8a93504dedaee8f935abb1ad533587fab548fdf | SQL | ryanoley/ram | /data/ram_sql_tables/ram_index_pricing.sql | UTF-8 | 1,104 | 3.765625 | 4 | [] | no_license | /*
Equity Indexes
SP500
-----
Index (SPX): 27002
Growth (SGX): 32795
Value (SVX): 32796
RUSSELL 1000
------------
Index (RUI): 202
Growth (RLG): 205
Value (RLV): 204
RUSSELL 2000
------------
Index (RUT): 6590
Growth (RUO): 87
Value (RUJ): 89
RUSSELL 3000
------------
Index (RUA): 206
Growth (RAG): 80115
Value (RAV... | true |
b7fe2872320b2d14e759e1dbfe68d9555a77fe99 | SQL | mark-artim/EmployeeTracker | /db/schema.sql | UTF-8 | 1,147 | 3.984375 | 4 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS emptracker_db;
CREATE DATABASE emptracker_db;
USE emptracker_db;
CREATE TABLE employee (
id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(30) NULL,
last_name VARCHAR(30) NULL,
role_id INT NULL,
manager_id INT NULL,
PRIMARY KEY (id)
);
INSERT INTO employee (first_name, last_name, ... | true |
25062f490530a90f63dfbd6460f5372f99f3b302 | SQL | RyGuy-89/PortfolioProjects | /Covid Query.sql | UTF-8 | 4,939 | 4.125 | 4 | [] | no_license | SELECT *
FROM CovidProject..coviddeaths
WHERE continent is not null
ORDER BY 3,4
--SELECT *
--FROM CovidProject..covidvaccinations
--ORDER BY 3,4
SELECT Location, Date, Total_cases, new_cases, total_deaths, population
FROM CovidProject..coviddeaths
WHERE continent is not null
ORDER BY 1,2
-- Total... | true |
a2c5514c050199e72468cb2d0b50026abc7119fd | SQL | bellmit/myprojects | /illegaladvertback/schema/ad-back.sql | UTF-8 | 4,690 | 3.71875 | 4 | [] | no_license | drop table if exists t_sys_user;
create table t_sys_user
(
user_id varchar(36) comment '主键id',
nick_name varchar(32) comment '昵称',
account varchar(32) comment '账号',
pwd varchar(32) comment '密码',
status tinyint(3) comment '状态(0:无效 1:有效)',
create_time datetime comm... | true |
4897da4f949898181d7950636394273b12f860b3 | SQL | xinzeyang/data-src1 | /analy/数据挖掘统计脚本/opreation_analy.sql | UTF-8 | 44,832 | 3.015625 | 3 | [] | no_license |
-- -- 天表加工
-- drop table if exists tmp_user_app_yy_d;
-- create table tmp_user_app_yy_d as
-- select t.*,
-- t1.device_number device_number1
-- from
-- (select pt_days,
-- appname,
-- device_number,
-- pv
-- from
-- user_action_app_d
-- wh... | true |
e1b54515d13eea412e887e23795385c1891451ea | SQL | SCM-SISTEMA/scm | /documentos/scripts/sql_notificacao.sql | UTF-8 | 1,581 | 3.6875 | 4 | [
"BSD-3-Clause"
] | permissive | -- Table: public.tab_andamento
-- DROP TABLE public.tab_andamento;
CREATE TABLE public.tab_andamento
(
cod_andamento bigint NOT NULL DEFAULT nextval('tab_notificacao_cod_notificacao_seq'::regclass),
cod_assunto_fk bigint, -- attributo valor do assunto que é a notificação
dt_inclusao timestamp without time zone... | true |
a6d02e244cf82477c5b1ce87e69e7c48fd735279 | SQL | PerDalsten/MusicLibraryTools | /src/main/resources/musiclibrary-hsqldb.sql | UTF-8 | 979 | 3.75 | 4 | [] | no_license | CREATE TABLE artist
(
id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1, INCREMENT BY 1) NOT NULL PRIMARY KEY,
artist_name VARCHAR(255) NOT NULL UNIQUE
);
CREATE TABLE album
(
id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1, INCREMENT BY 1) NOT NULL PRIMARY KEY,
artist_id INTEGER NOT NULL ... | true |
5d82f8e7666c3402f7e6b989b953180ab88e2892 | SQL | akuelker/advanced_sql_class | /Adv SQL Bill Aug/AdvSQL_Solns/AdvEx5Soln.sql | UTF-8 | 830 | 3.421875 | 3 | [] | no_license | --Adv SQL Ex5
select * from burgers
--Part 1
SELECT empname, hours
FROM burgers
UNION
select empname+' Total', SUM(hours)
FROM burgers
GROUP BY empname
ORDER BY empname
--Extra
SELECT empname, hours
FROM burgers
UNION
select empname+' Total', SUM(hours)
FROM burgers
GROUP BY empname
UNION
SELECT '... | true |
a80740f871b227d3ad54bfa41c69778180552b5c | SQL | Vijayakumar1992/cs313-php | /db/database.sql | UTF-8 | 2,825 | 4.1875 | 4 | [] | no_license | -- to view a table -- select * from (name of the table);
-- to create a table -- copy and paste the table
-- \i database.sql to drop and create the tables runs the script
-- heroku pg:psql -- connect to heroku database
-- to view table just type ;
DROP TABLE appointment;
DROP TABLE customer;
DROP TABLE service_type... | true |
135d65d67b692efae88e077e0c7005f2f512a9d8 | SQL | EvaMad/WsPhpBDD | /TransactionUpdatePrix.sql | UTF-8 | 258 | 2.5625 | 3 | [] | no_license | -- on desactive l'autocommit du moteur InnoDB :
SET autocommit = 0;
-- on demarre une nouvelle transaciton :
START TRANSACTION;
-- on effectue une requete :
UPDATE produits SET prix = prix + 5 WHERE solde = 1;
-- on valide la transaction
COMMIT; | true |
cd1ee109ccce8010accf6a1db6530b9a5ae9f88a | SQL | caok/blog_node_mysql | /sql/blog.sql | UTF-8 | 629 | 3.328125 | 3 | [] | no_license | -- 主机: localhost
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- 数据库: `blog_mysql`
--
CREATE database blog default character set utf8;
use blog;
-- --------------------------------------------------------
--
-- 表的结构 `users`
--
CREATE TABLE users ( id int(11) NOT NULL AUTO_INCREMENT,
name var... | true |
eabe0d9a0450ea80e72eaa028c1255f49fbee819 | SQL | ferax99/aerolinea | /Base.sql | UTF-8 | 14,705 | 3.140625 | 3 | [] | no_license | #
# TABLE STRUCTURE FOR: Aerolinea
#
create database Vuelos;
use Vuelos;
DROP TABLE IF EXISTS `Aerolinea`;
CREATE TABLE `Aerolinea` (
`idAereolinea` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`hub` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY ... | true |
a52a196e056af499aa5defefdced3070f71b24a3 | SQL | parhatpiko/PHP-project | /SchoolWeb/common/Sql/item.sql | UTF-8 | 2,149 | 2.53125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50716
Source Host : localhost:3306
Source Database : news
Target Server Type : MYSQL
Target Server Version : 50716
File Encoding : 65001
Date: 2017-09-08 18:00:58
*/
SET FOREIGN_KEY_CHECKS=0;
--... | true |
9951f97ca59568a59b99359be50d58f8ab0702e2 | SQL | WatPro/Tutorials | /202004_SQL/L596_MySQL.sql | UTF-8 | 157 | 2.84375 | 3 | [] | no_license | # Tested on MySQL Community Server - GPL, 8.0.21
SELECT
`class`
FROM
`courses`
GROUP BY
`class`
HAVING
COUNT(DISTINCT `student`) >= 5
;
| true |
60e86525dcd7365c4871de59247394453f56c99c | SQL | sjflores01/subconsultas | /Consultas.sql | UTF-8 | 10,193 | 4.34375 | 4 | [] | no_license | -- 1) Listar todos los datos de todos los libros cuya cantidad de páginas sea superior al promedio.
SELECT * FROM Libros WHERE
LIBROS.Paginas > (SELECT AVG(LIBROS.Paginas) FROM Libros)
ORDER BY Paginas
-- 2) Listar el nombre de todos los libros que tengan la valoración más baja.
SELECT L.Titulo, LXB.Valoracion FROM L... | true |
baf1594e88d7c07917605a1b5a13c21c58a04887 | SQL | gordonpn/web-career-portal-clone | /sql/init/2-triggers.sql | UTF-8 | 8,638 | 3.859375 | 4 | [
"MIT"
] | permissive | DELIMITER $$
CREATE TRIGGER paymentMadeEmail
AFTER INSERT
ON Payments
FOR EACH ROW
BEGIN
INSERT INTO Emails(userID, content, title)
VALUES ((SELECT userID
FROM Payment_Methods
WHERE NEW.paymentMethodID = Payment_Methods.paymentMethodID),
concat('Payment made of... | true |
b9a2a17afa670694c2a788d5947d9ca7ee53a418 | SQL | brslv/software-university | /Databases/HW04_SQLIntroduction/24.All-employees-in-sales-finance-hired-between-two-years.sql | UTF-8 | 281 | 4.0625 | 4 | [] | no_license | SELECT
e.FirstName,
e.LastName,
e.HireDate,
d.Name
FROM Employees e
INNER JOIN Departments d
ON e.DepartmentID = d.DepartmentID
WHERE
(
d.Name = 'Sales'
OR
d.Name = 'Finance'
)
AND
e.HireDate BETWEEN '01-Jan-1995' AND '01-Jan-2005'
ORDER BY e.HireDate ASC | true |
b88775306b64f75abbe3f23064a5dba005c5e7c6 | SQL | gfccosta/devdataprod | /extract.sql | UTF-8 | 1,741 | 4.09375 | 4 | [] | no_license | select md5(a.matricula) as id, a.cr, coalesce(a.saida,'') as Saida,
if(a.CursoNome='Bacharelado Interdisciplinar em Ciência e Tecnologia', 'Science and Technology',
if(a.CursoNome='Bacharelado Interdisciplinar em Saúde', 'Health',
if(a.CursoNome='Bacharelado Interdisciplinar em Humanidades', 'Humanities',
if(a.Curs... | true |
da8106dee3517290f95a321de3fad749c691e850 | SQL | ALandazabal/prueba-Gluky | /data_cliente.sql | UTF-8 | 260,101 | 2.78125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 18, 2020 at 05:46 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
3040a06647eea04333f6de09f3626a56744401b4 | SQL | uiop860/Opgaver | /cph-1st-w47/More queries.sql | UTF-8 | 599 | 2.71875 | 3 | [] | no_license | -- More queries
-- a
-- insert into actor (first_name,last_name) values ("Oliver","Stæhr");
-- b
-- insert into film_actor (actor_id,film_id) values (201,342);
-- insert into film_actor (actor_id,film_id) values (201,503);
-- insert into film_actor (actor_id,film_id) values (201,764);
-- insert into film_actor (actor_i... | true |
16dfeaab1a730d410c2cfd34a4193243ff925028 | SQL | Audrie8a/BD1_Practica3 | /MySQL/CargaTemporal.sql | UTF-8 | 2,862 | 3.03125 | 3 | [] | no_license | create database p3_bases1;
use p3_bases1;
SET GLOBAL local_infile=1;
drop TABLE TEMPORAL;
CREATE TABLE IF NOT EXISTS TEMPORAL(
iso_code VARCHAR(150),
continent VARCHAR(150),
locations VARCHAR(150),
dates VARCHAR(150),
total_cases VARCHAR(150),
new_cases VARCHAR(150),
new_cases_smoothed V... | true |
00b1e60216688a8c64f0596bab563adc6bd6f086 | SQL | RkGdeveloper/xyz | /After Module Data/135652_Govind Prajapati -Module 1/Section 3 Oracle PLSQL/1 Ques/getStudentStatus.sql | UTF-8 | 1,278 | 3.46875 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE getStatus IS
CURSOR stud_cur is
SELECT m.studNo,s.studName,m.module1,m.module2,m.module3,m.module4 FROM Marks m, Student s WHERE s.studno = m.studno;
stud_rec stud_cur%ROWTYPE;
STATUS VARCHAR2(20);
BEGIN
OPEN stud_cur;
DBMS_OUTPUT.PUT_LINE('----------------------------... | true |
91c8af4812f66064bbc01eb12a25c6d704a3ad37 | SQL | Adeonita/scriptsSql | /aula21.sql | UTF-8 | 2,827 | 2.6875 | 3 | [] | no_license | SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tableName';
insert into clientes (id, nome, sexo, email, cpf) values (null, 'ade', 'f', 'ade@test.com', '06448');
insert into clientes (id, nome, sexo, email, cpf) values (null, 'junior', 'm', 'jj@teste.com', '98776');
insert into clientes (id, no... | true |
47598efc80a52a7b17a88c3144c4d8180d006e1d | SQL | Franc6s/Pewlett-Hackard-Analysis | /Employee_Challenge_starter_code.sql | UTF-8 | 970 | 4.5 | 4 | [] | no_license | DROP TABLE retirement_challenge_info CASCADE;
-- Use Dictinct with Orderby to remove duplicate rows
SELECT DISTINCT ON (______) _____,
______,
______,
______
INTO nameyourtable
FROM _______
ORDER BY _____, _____ DESC;
--1) Retrieve data from employees table
SELECT emp_no
,first_name
,last_name
FROM employees_2
--2) ... | true |
5f3f052a448a8b489b0f819407b0673c1560719b | SQL | adesinataiwoolajide/jLearning | /jlearning.sql | UTF-8 | 6,143 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 27, 2019 at 01:41 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.2.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
5ff2f31b01fe93bb064a37f33166ca5d71c21e2d | SQL | Tanner-Mindrum/school-database-lab-assignments | /Lab Assignments/Lab 1 - First Records.sql | UTF-8 | 587 | 3.171875 | 3 | [] | no_license | CREATE TABLE teamMembers (
tLastName VARCHAR(20) NOT NULL,
tFirstName VARCHAR(20) NOT NULL,
tEmail VARCHAR(20),
tCellPhone VARCHAR(20) NOT NULL,
tTeamTask VARCHAR(50),
tDueDate DATE,
CONSTRAINT teamMembers_pk PRIMARY KEY (tCellPhone)
);
-- Add initial row
INSERT INTO teamMembers (tLastName... | true |
5c8b34958decfd97ad040d2f77322ea8b293e0cc | SQL | shubham19336/DBMS-MidSem-Project | /Database/mydb_music_group.sql | UTF-8 | 2,325 | 3.171875 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `mydb` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `mydb`;
-- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: mydb
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @O... | true |
7f2031d5423a75dcf35a316601213a392598aa56 | SQL | SIDDHARTHA-18/sql-scenarios | /scenario.sql | UTF-8 | 2,519 | 4.28125 | 4 | [] | no_license | create database scenario1;
show databases;
use scenario1;
create table customer(cust_id int(10) primary key,cust_name varchar(20));
create table items(item_id int(10) primary key,item_name varchar(10),price int(10));
create table sales(bill_no int(10),bill_date date,cust_id int(10) references customer(cust_id),ite... | true |
302e238378324f40e30c004d54ce09a66a6c2ffb | SQL | feesa/easyrec-parent | /easyrec-core/src/main/resources/sql/core/types/AssocType.sql | UTF-8 | 561 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | ###############################################################
# $Author: pmarschik $
# $Revision: 18118 $
# $Date: 2011-04-12 17:48:41 +0200 (Di, 12 Apr 2011) $
###############################################################
# ATTENTION: do not add other sql statements than the CREATE TABLE statement
CREATE TABLE a... | true |
46232a32058efdc16894d2dae73cecf7c13745cb | SQL | DerekSpachman/Java3 | /src/bankOfSpachman/tables.sql | UTF-8 | 719 | 3.21875 | 3 | [] | no_license | /*
*
*
* Author: Derek Spachman
* Created: Sep 30, 2019
*/
create table user (
uid int auto_increment primary key,
aid int not null,
first_name varchar(15) not null,
last_name varchar(15) not null,
email varchar(40) not null,
username varchar(15) not null,
password varchar(15),
... | true |
2544b57cd05938fa1ca6aa11ff40adb622da9f09 | SQL | guruputran/CakePhp4BlogV3 | /devpng.sql | UTF-8 | 3,526 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 24, 2021 at 01:21 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
28d8d0e810aa07a036f546950ba52497d6832bd5 | SQL | klepaski/DB-6-sem | /4 - Пространственные данные/1new.sql | WINDOWS-1251 | 2,325 | 3.71875 | 4 | [] | no_license | drop table products;
drop table dilers;
drop table clients;
drop table supplies;
drop table orders;
select * from gadm36_blr_1;
create table products (
id_product int identity (1,1) primary key,
name_product nvarchar(25),
kol int check (kol >0)
);
create table dilers (
id_diler int identity (1,1)... | true |
ad6cdc14d9f52762ff5a19486468b304f0232c60 | SQL | nhussaini/BootcampX | /4_queries/cohort_average_assistance_duration.sql | UTF-8 | 567 | 4.3125 | 4 | [] | no_license | -- Calculate the average total duration of assistance requests for each cohort.
-- Use the previous query as a sub query to determine the duration per cohort.
-- Return a single row average_total_duration
SELECT avg(total_duration) as average_total_duration
FROM (
SELECT cohorts.name as cohort, sum(completed_a... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.