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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
52644edf770d1e2339d31ba310aa7be35c233037 | SQL | CactusField/sql-prac | /practice.sql | UTF-8 | 3,061 | 4.03125 | 4 | [] | no_license |
--PERSON TABLE--
--Answer 1--
CREATE TABLE person (
persons_id SERIAL PRIMARY KEY,
name VARCHAR(100),
age int,
height int,
city VARCHAR(100),
favorite_color VARCHAR(60)
)
--Answer 2--
INSERT INTO person(
name,
age,
height,
city,
favorite_color
)
VALUES
('John', ... | true |
014755def0b2c0e15b88384d9a1df1649599d51f | SQL | unidev39/Oracle_DBA_Research | /Flashback_Recovery.sql | UTF-8 | 3,718 | 2.703125 | 3 | [] | no_license | [oracle@racdb1 ~]$ srvctl status database -d racdb
/*
Instance racdb1 is not running on node rac1
Instance racdb2 is not running on node rac2
*/
-- To Create Restore point
SHOW PARAMETER DB_FLASHBACK_RETENTION;
SHOW PARAMETER DB_RECOVERY_FILE_DEST;
SHOW PARAMETER DB_RECOVERY_FILE_DEST_SIZE;
ALTER SYSTEM S... | true |
a1217fad6cc19afa9658c47863a959cd4b961f2f | SQL | EErasmus/Advanced-Databases-Project | /Assignment/Assignment 3/Course_Master.sql | UTF-8 | 1,669 | 3.0625 | 3 | [] | no_license | --------------------------------------------------------
-- File created - Tuesday-October-27-2020
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Table COURSE_MASTER
--------------------------------------------------------
CREAT... | true |
26425742479f1578ae42e231fe0d69e8107f5d20 | SQL | santig19/DBT | /models/processing/tmp_event_attendee.sql | UTF-8 | 9,686 | 3.1875 | 3 | [] | no_license | {{ config(
post_hook="grant all privileges on {{ this }} to {{ var('snowflake_user_grant_privileges') }}")
}}
SELECT
c.Account_vod__c as Account_Id,
case when (c.Account_vod__c = a.Id)
then case when a.Country_JJ__c <> ''
then a.Country_JJ__c
else COALESCE(a.JJ_Country__c,'') end
|| '... | true |
4299e06947a3fcc3eca87f5ad33e3e4fc61a06ba | SQL | waqaskamran/ecash_cfe | /ecash_cfe/sql/updates/RELEASE_3.5.20/.svn/text-base/200708021139-mantis_8986.sql.svn-base | UTF-8 | 1,023 | 3.4375 | 3 | [] | no_license | CREATE TABLE `agent_affiliation_reason` (
`date_modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`date_created` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
`agent_affiliation_reason_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(60) NOT NULL DEFAULT '',
`... | true |
24f889f5de8cf2190ed12e8fb89fbad271a8ff3d | SQL | Matias-Bernal/dose2014 | /implementations/group3/create_db_content.sql | UTF-8 | 3,590 | 4.25 | 4 | [] | no_license | -- Drop tables if they exist
DROP TABLE Users;
DROP TABLE Sprints;
DROP TABLE SprintComments;
DROP TABLE Tasks;
DROP TABLE TasksComments;
DROP TABLE Projects;
DROP TABLE ProjectComments;
DROP TABLE Stories;
DROP TABLE StoriesComments;
DROP TABLE UsersToProjects;
DROP TABLE UsersToSprints;
DROP TABLE UsersToStories;
DR... | true |
92368c43ec5e338995387e4a4a455fc577ae71ff | SQL | sohn0356-git/TIL | /DBStudy/210119_1.sql | UTF-8 | 475 | 4.1875 | 4 | [] | no_license | #GROUP BY
SELECT emp_no, SUM(salary) FROM salaries
GROUP BY emp_no
HAVING SUM(salary) > 1000000;
SELECT emp_no, salary FROM salaries
WHERE salary > 70000
AND emp_no = 10001;
SELECT emp_no, ROUND(AVG(salary / 12),2) AS 월급 FROM salaries
GROUP BY emp_no HAVING 월급 > 5000;
SELECT emp_no, MAX(salary), MIN(salary), MAX(sa... | true |
5e17a1f9fd44de5fd2df34dfb7599609a5d24c88 | SQL | Razfury/OneDB | /WIP/Kezan/item_properties_kezan.sql | UTF-8 | 14,061 | 2.796875 | 3 | [
"MIT"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50714
Source Host : localhost:3306
Source Database : 1_one_db
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2018-04-20 01:40:25
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... | true |
e1a7dbb08a5ad81bc71bd059c5df88cbbd284fdc | SQL | GeorgeMitrakis/just-bid-it-backend | /src/main/sql/item.sql | UTF-8 | 628 | 2.765625 | 3 | [] | no_license | create table item
(
id int auto_increment
primary key,
seller_id int not null,
name varchar(256) not null,
current_bid float not null,
first_bid float not null,
buy_price float null,
number_of_bids int default... | true |
9befe9a73dfc396ed60beb628366ad55339c392b | SQL | MattDekinder/391-Radiology-Information-System | /setup_new.sql | UTF-8 | 1,965 | 3.796875 | 4 | [
"Apache-2.0"
] | permissive | /*
* File name: setup.sql
* Function: to create the initial database schema for the CMPUT 391 project,
* Winter Term, 2014
* Author: Prof. Li-Yan Yuan
*/
DROP TABLE family_doctor;
DROP TABLE pacs_images;
DROP TABLE radiology_record;
DROP TABLE users;
DROP TABLE persons;
/*
* To store the ... | true |
25c35d8b561d8ee7e39cc0ead38a95b504e87c1e | SQL | dfjxpcxm/pcmss.dev | /pcmss.dev/setup/ddl/delete_user.sql | UTF-8 | 645 | 3.390625 | 3 | [] | no_license | DROP PROCEDURE IF EXISTS DELETE_PORTAL_USER;
DELIMITER //
CREATE PROCEDURE DELETE_PORTAL_USER (
IN P_USER_ID INT
, OUT P_ERROR_NO INT
)
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET P_ERROR_NO=0;
SET P_ERROR_NO = 1;
START TRANSACTION;
DELETE FROM SYS_USER WHERE USER_ID = P_USER_ID;
DELETE FROM USER_DE... | true |
47bb7d0bb538242b5c49aa86e4e839e42177a5a4 | SQL | joeyzhuangyi/COMP3311 | /WEEK_8/php_programming.sql | UTF-8 | 4,131 | 3.390625 | 3 | [] | no_license | db = connect_to_dbms(DBname,User/Password);
query = build_SQL("sql_statement_template",values);
results = execute_query(db,query);
while (more_tuples_in(results))
{
tuple = fetch_row_from(results);
# do something with values in tuple ...
}
# example
$db = dbAccess("db");
$query = "select age from students where a... | true |
3afd06e3b2af54fd5a3a3163a7db10c907fb298f | SQL | SoapyD/Warehousing-Process | /sql/incident2/fsa_request.sql | UTF-8 | 2,547 | 3.828125 | 4 | [] | no_license | INSERT INTO TEMP_incident_combined
SELECT
inc.sys_id,
inc.number as number,
inc.system,
inc.company,
NULL AS businessunit,
CASE WHEN users.vip = 'False' THEN 0 ELSE 1 END as isvip,
users.location,
users.name AS customer,
inc.subject,
NULL AS symptom,
priority,
inc.status... | true |
70b8ff929473f0f8f8db6e131722c27e249fba3f | SQL | crunchdata/bigquery-examples | /pgp/sql/comparing-pgp-to-1000genomes/sample-counts-minmax-by-chromosome.sql | UTF-8 | 381 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | # Summarize the minimum and maximum number of samples per variant by chromosome.
SELECT
contig_name,
MIN(sample_count) AS minimum_sample_count,
MAX(sample_count) AS maximum_sample_count,
FROM (
SELECT
contig_name,
COUNT(call.callset_name) WITHIN RECORD AS sample_count
FROM
[google.com:biggene:pgp.... | true |
1064f4f9fb83404041f1edb4152c7a2e29b17ed5 | SQL | intfrr/coding-challenge | /db/employee-db.sql | UTF-8 | 1,303 | 3.796875 | 4 | [] | no_license | DROP TABLE IF EXISTS department;
CREATE TABLE department(id INT PRIMARY KEY, name VARCHAR(255));
DROP TABLE IF EXISTS employee;
CREATE TABLE employee(
id INT PRIMARY KEY,
first_name VARCHAR(255),
last_name VARCHAR(255),
department_id INT
);
DROP TABLE IF EXISTS address;
CREATE TABLE address(
id INT PRIMARY KE... | true |
6166d05fd1803214035aee4c4266543bc18561da | SQL | Just1kz/job4j_todo | /db/schema.sql | UTF-8 | 800 | 3.953125 | 4 | [] | no_license | create table if not exists users(
idU serial primary key ,
name text,
email text unique,
password text
);
create table if not exists item(
id serial primary key,
description text,
created timestamp default now(),
author_id int not null references users(idU) default 1,
categories_id int not null referen... | true |
384b01cf41608bc26ee5beb04fca21db29303129 | SQL | trunghieu99off/sharecode | /webschlmvc.sql | UTF-8 | 20,050 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th10 20, 2020 lúc 03:10 AM
-- Phiên bản máy phục vụ: 10.4.14-MariaDB
-- Phiên bản PHP: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
576c073d833703d6ace09f01b97a02aa7b9aa654 | SQL | filipeoliveirah/php-default-project | /res/sql/tables/tb_personssocialnetworks.sql | UTF-8 | 560 | 2.71875 | 3 | [] | no_license | CREATE TABLE `tb_personssocialnetworks` (
`idperson` int(11) NOT NULL,
`idsocialnetwork` int(11) NOT NULL,
`desvalue` varchar(128) NOT NULL,
`dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
KEY `idperson` (`idperson`),
KEY `idsocialnetwork` (`idsocialnetwork`),
CONSTRAINT `tb_personssocialnetwor... | true |
369e22f9fcbc67519f9e58770089548bcd9f415e | SQL | kylerlittle/yelp-app | /yelp-app/db-init/small_db.sql | UTF-8 | 12,258 | 3.125 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 10.6 (Ubuntu 10.6-0ubuntu0.18.04.1)
-- Dumped by pg_dump version 10.6 (Ubuntu 10.6-0ubuntu0.18.04.1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_str... | true |
c91d4da3fe2fa1ecb9b800544d3f21d2551e5e29 | SQL | arisabia/Week4Test | /NegozioDischi.sql | WINDOWS-1250 | 4,093 | 4.125 | 4 | [] | no_license | create database NegozioDischi
create table Band(
ID int identity(1,1) not null,
Nome varchar(25) not null,
NumeroComponenti int not null,
primary key(ID)
)
insert into Band values
('Band a',2),
('Band b',5),
('Maneskin',3),
('Band c',1),
('Band d',2)
insert into Band values ('The Giornalisti', 5)
create table ... | true |
26c24c1eb8c1c9e7d1d5cfc6d4588f01f2443626 | SQL | maheshguddeti/CUSTOM_TOP | /sql/XXRS_SC_PA_PERIOD_UPD_120920-09626.sql | UTF-8 | 8,174 | 3.140625 | 3 | [] | no_license | /**************************************************************************************************************
* *
* NAME : XXRS_SC_PA_PERIOD_UPD_120920-09626.sql ... | true |
6f7c908e5b67133a9435b9d6ad4238d7f2c75730 | SQL | ff7/feup-bdad | /3rd Delivery /Triggers/gatilho3_verifica.sql | UTF-8 | 414 | 2.609375 | 3 | [] | no_license | .mode columns
.header on
.nullvalue NULL
PRAGMA foreign_keys = ON;
.print ''
.print 'Insercao de uma transacao sem receita para o medicamento 51 (que necessita de receita) ;'
.print ''
INSERT INTO Transação (ID, DataHora, Receita, "ID Cliente", "ID Farmacêutico") VALUES (79, '2018-04-02 3:30:27 PM', 'false', 4,7);
... | true |
64919da2a6769afbb8eb9ac6fef571eff2853422 | SQL | mebelousov/antlr_psql | /src/test/resources/sql/explain/0a1965eb.sql | UTF-8 | 475 | 3.34375 | 3 | [
"MIT"
] | permissive | -- file:join.sql ln:1758 expect:true
explain (verbose, costs off)
select * from (values (0), (1)) v(id),
lateral (select * from int8_tbl t1,
lateral (select * from
(select * from int8_tbl t2
where q1 = any (select q2 from int8_tbl t3
... | true |
38333c9b78ea86ab4a2df12fb63b01deade1093b | SQL | jacobo1407b/puntoventa | /src/sql/venta.sql | UTF-8 | 8,619 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: bdvr8azxmbi608mwwnsg-mysql.services.clever-cloud.com:3306
-- Generation Time: Sep 01, 2021 at 03:24 AM
-- Server version: 8.0.15-5
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
/*SET AUTOCOMMIT = 0;
START TRANSACTION;*/... | true |
a31cecdfe75fb7cb21f6228d0d6b6555b9eef9ee | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day11/select0108.sql | UTF-8 | 178 | 2.59375 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-10T01:08:00Z' AND timestamp<'2017-11-11T01:08:00Z' AND temperature>=18 AND temperature<=54
| true |
5a9eadc714aff7f857704abd1dd24fd69864a11b | SQL | ReportsAdmin/LazurdeUAE | /models/Lazurde_UAE/Tables/fProductStock.sql | UTF-8 | 1,160 | 3.484375 | 3 | [] | no_license | select Inventory,product_id as productid,null Sizes,Selling_Price,null Discount,
Case when selling_price>=100 and selling_price<10000 then "0 to 11k"
when selling_price>=10000 and selling_price<=15000 then "11K to 15k"
when selling_price>15000 and selling_price<=25000 then "15K to 25k"
... | true |
8fe3f0686fdb3680a93ba7efa29bf73905fa0ae2 | SQL | rushabhtolia99/CS564 | /p2/Query8.sql | UTF-8 | 241 | 3.546875 | 4 | [] | no_license | select d.division_desc, t.stname, max(t.increase)
from division d, (select h.division, h.stname, h.state, h.huest_2011 - h.huest_2010 as increase
from housing_units_state_level h) t
where d.division_cd = t.division
group by t.division; | true |
f3e931877d669c6d46eb8267314beefb6432f3f3 | SQL | Doro97/datawarehouse_techstack | /dbt/dwh/models/staging/staging_station_summary.sql | UTF-8 | 176 | 2.9375 | 3 | [] | no_license | with source_station_summary as (
select * from {{ source('stations_data','station_summary') }}
),
final as (
select * from source_station_summary
)
select * from final | true |
9aa61064bdeac93ca17931da5fc7ce90380ee754 | SQL | Xyrephon/Database | /SQLDatabase/SurveyModification.sql | UTF-8 | 626 | 3.640625 | 4 | [] | no_license | DROP TABLE IF EXISTS answer;
CREATE TABLE answer
(
id int(11) PRIMARY KEY auto_increment,
question_id int(11) NOT NULL,
response VARCHAR(2000),
FOREIGN KEY (question_id) REFERENCES question(id)
);
CREATE TABLE participant_answer
(
id int(11) PRIMARY KEY auto_increment,
participant_id int (11) NOT NULL,
answer_id int (... | true |
bad302a9e769e091ea440d3ea603806a55b5ebc7 | SQL | davsva/ruze | /db/authdb/mysql/0001reinit.sql | UTF-8 | 1,508 | 3.65625 | 4 | [] | no_license | DROP TABLE IF EXISTS auditlogs;
DROP TABLE IF EXISTS events;
DROP TABLE IF EXISTS users_modules;
DROP TABLE IF EXISTS modules;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
principal VARCHAR(255) NOT NULL,
credential VARCHAR(32) NOT NULL,
salt ... | true |
daa6452be211e51d98e27dafa3a6d2ae38318385 | SQL | fhalamos/sql_and_python | /hw4/answers/2.sql | UTF-8 | 686 | 4.53125 | 5 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | -- For the 10 users from the prior question,
-- calculate the average stars of all their reviews.
-- Use a nested subquery to calculate the result. (given as avg)
select CAST(sum(stars) AS float)/CAST(count(stars) AS float) as avg
from review where user_id in
(with userIdAndCountReviews as
(select r.user_id as us... | true |
ee8d89ac33c7acc397d55080b306b6125f283142 | SQL | magda-io/magda | /magda-migrator-authorization-db/sql/V1_3__access_control.sql | UTF-8 | 11,355 | 3.359375 | 3 | [
"Apache-2.0"
] | permissive | -- Roles & Permissions ---------------------------------------------------
CREATE EXTENSION IF NOT EXISTS "pg_trgm";
CREATE TABLE "public"."operations" (
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
"uri" varchar(250) NOT NULL DEFAULT ''::character varying UNIQUE,
"name" varchar(250) NOT NULL DEFAULT ''... | true |
4a7c23fe244561b803372dc8d75da5f92e891a2b | SQL | denisdiaconu/vet-clinic | /data.sql | UTF-8 | 4,725 | 3.359375 | 3 | [] | no_license | /* Populate database with sample data. */
INSERT INTO animals (name) VALUES ('Luna');
INSERT INTO animals (name) VALUES ('Daisy');
INSERT INTO animals (name) VALUES ('Charlie');
INSERT INTO animals (name, date_of_birth, weight_kg, neutered, escape_attempts) VALUES ('Agumon','2020-02-03',10.23,'true',0);
INSERT INTO a... | true |
f5d5895f4049fc548e33433e23581995c670f196 | SQL | GalinaBaziak/Project | /Project_5.sql | UTF-8 | 1,824 | 3.609375 | 4 | [] | no_license | -- 5. Сформулировать 5 смысловых запросов к БД. Написать их на SQL.
---- 1. Найдем количество оценок "отлично":
select count(grade_numb) as COUNT_5
, avg(grade_numb) as AVG_GRADE
from GRADE where grade_numb = '5'
;
---- 2. Найдём средний балл за экзамен:
select avg(grade_numb) as AVG_GRADE
from GRAD... | true |
bd8ac10a50dd135ac658affcd293e9c3a80c0dcc | SQL | omarbek/kz.halyqsoft.univercity | /src/main/java/kz/halyqsoft/univercity/db/real-2019-01-21.sql | UTF-8 | 4,767 | 3.84375 | 4 | [] | no_license | create table constants
(
id bigint not null,
type_name varchar(255) not null,
value numeric(10, 2) not null
);
create sequence s_constants
minvalue 0
start with 1
no cycle;
alter table constants
add constraint pk_constants primary key (id);
insert into constants values (nextval('s_... | true |
97e2458721d624684dbcb011d57322284bf07356 | SQL | edigonzales-dumpster/oereb-kataster | /gretl/prod/nplso2trsfr/update_oereb_npl_staging_responsible_office.sql | UTF-8 | 2,773 | 3.453125 | 3 | [
"MIT"
] | permissive | WITH zustaendige_stelle_rrb AS
(
SELECT
*
FROM
arp_npl_oereb.vorschriften_amt
WHERE
t_ili_tid = 'ch.so.sk'
)
,
zustaendige_stelle_gemeinden AS (
SELECT
RIGHT(t_ili_tid,4)::int AS bfsnr,
*
FROM
arp_npl_oereb.vorschriften_amt
WHERE
t_ili_tid LIKE 'ch.so.arp.npl.%'
)
,
vorschri... | true |
cf7ef046cfefbbb89283b0b1cdce6d02d4bd1152 | SQL | mhgopal/dg | /flashback.sql | UTF-8 | 300 | 2.875 | 3 | [] | no_license | select cast(
from_tz(
cast( oldest_flashback_time as timestamp )
,dbtimezone )
at time zone 'US/Eastern' as date ) oldest_db_fb
,round((sysdate - oldest_flashback_time) * 24, 1) oldest_db_fb_hours
from v$flashback_database_log;
| true |
30c9a82f0657d9a93e51b8c20ff85d62ac7e2548 | SQL | fivetran-jamie/dbt_asana | /models/asana_user.sql | UTF-8 | 1,705 | 4.09375 | 4 | [
"Apache-2.0"
] | permissive | with user_task_metrics as (
select *
from {{ ref('asana_user_task_metrics') }}
),
asana_user as (
select *
from {{ var('user') }}
),
project_user as (
select *
from {{ ref('asana_project_user') }}
where currently_working_on or role = 'owner'
),
count_user_projects as (
sele... | true |
5f0dee9cd5b41719812a66e8e2947f1c3f0306f0 | SQL | Guo-zy/mysqlTask | /mysqlTask.sql | UTF-8 | 3,606 | 3.359375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: localhost Database: student_examination_sys
-- ------------------------------------------------------
-- Server version 8.0.20
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... | true |
8a8547237d5be79c47abc1ae484418616b118b27 | SQL | uk-gov-mirror/decc.times-sql-bat | /HumanReadableQueries.sql | UTF-8 | 237,040 | 3.8125 | 4 | [] | no_license | /* ***Human readable versions of "standard" queries analysing results from the UK TIMES [UKTM] model***
/*Developed against model ver = uktm_model_v1.2.3_d0.1.2_DNP
This file is a "human readable" (= formatted) version of key regularly re-used crosstabs in various DOS batch files (.BAT). As far as possible, thes... | true |
330e6bace1e236379e5f774681ff36a5673762bb | SQL | Zakery1/sql-1-afternoon | /init.sql | UTF-8 | 2,606 | 4.09375 | 4 | [] | no_license |
CREATE TABLE Person (
ID SERIAL PRIMARY KEY,
Name TEXT,
Age integer,
Height integer,
City TEXT,
FavoriteColor TEXT
);
INSERT INTO Person
( Name, Age, Height, City, FavoriteColor )
VALUES
('Jimmy', 22, 179.832, 'Akron', 'Green'),
('Ryan', 42, 188.976, 'Tampa', 'Coral'),
('Ed... | true |
f9dda115dd67e15aef72721202b8b540e25cb7b8 | SQL | ionab/Consultancy_Project_Management_Tool | /db/consultancy_budget_tracker.sql | UTF-8 | 770 | 3.515625 | 4 | [] | no_license | DROP TABLE expenses;
DROP TABLE time_units;
DROP TABLE employees;
DROP TABLE projects;
CREATE TABLE employees(
id SERIAL8 primary key,
name VARCHAR(255),
job_title VARCHAR(255),
hourly_rate FLOAT
);
CREATE TABLE projects(
id SERIAL8 primary key,
name VARCHAR(255),
client VARCHAR(255),
time_budget FLOA... | true |
541a45fbc2a877e97712b0bcc9225c6a2e0cdfa0 | SQL | jdiperi88/just_us_api | /db/migrations/migration.sql | UTF-8 | 481 | 3.34375 | 3 | [] | no_license |
CREATE TABLE IF NOT EXISTS images
(
id SERIAL PRIMARY KEY,
image_name VARCHAR(255) NOT NULL,
location_name VARCHAR(255) NOT NULL,
descriptions TEXT,
featured_image boolean,
vertical boolean
);
CREATE TABLE IF NOT EXISTS people
(
id SERIAL PRIMARY KEY,
person_name VARCHAR(255) NOT NULL
);
CREATE TABLE... | true |
bd67d4801f671613e192db0e6135865b40fa906b | SQL | astarinamaulida/cravings | /db/schema/04_order_items.sql | UTF-8 | 385 | 3.078125 | 3 | [] | no_license | -- Drop and recreate Users table (Example)
DROP TABLE IF EXISTS order_items CASCADE;
CREATE TABLE order_items (
id SERIAL PRIMARY KEY NOT NULL,
order_id INTEGER REFERENCES orders(id) ON DELETE CASCADE,
menu_item_id INTEGER REFERENCES menu_items(id) ON DELETE CASCADE,
total_price INTEGER NOT NULL,
quantity I... | true |
5cd932b34790540a583703b41475e14fa32fcde1 | SQL | DiegoCampos1/Projects | /Mysql-Vocabulary-booster/desafio9.sql | UTF-8 | 261 | 3.8125 | 4 | [] | no_license | SELECT
CONCAT(e.FirstName, " ", e.LastName) AS 'Nome completo',
COUNT(o.EmployeeID) AS 'Total de pedidos'
FROM
w3schools.employees AS e
INNER JOIN w3schools.orders AS o ON o.EmployeeID = e.EmployeeID
GROUP BY
o.EmployeeID
ORDER BY
COUNT(o.EmployeeID) ASC;
| true |
737928483877f1b08e9c9670d73074957552ce46 | SQL | mungowz/esse4 | /codice/trigger/trigger_assegnazione_erasmus.sql | UTF-8 | 4,952 | 3.640625 | 4 | [
"MIT"
] | permissive | /*
Trigger_assegnazione_erasmus
Gli Erasmus sono assegnati agli studenti che hanno fatto richiesta per quel bando. Inoltre,
non deve essere assegnato ad uno studente che ha già vinto l'Erasmus in quell'anno accademico e
il numero di bandi Erasmus assegnati non supera il numero di borse Erasmus dispo... | true |
334241a1809ee79583a7a0df4fe43fcb57f82f27 | SQL | sohaibahmed553/BrainBusterFYP | /database/QUERIES.sql | UTF-8 | 2,337 | 4.46875 | 4 | [] | no_license |
##### SELECT QUERIES
#get 10 questions randomly by using stageid and difficulty
SELECT * FROM questions where stid='1' and Difficulty='1' order BY RAND();
#quiz page
select StTitle, CourseName from stages, courses where stages.courseid= courses.courseid and StID=1;
#dashboard queries
select badges.BID, BName, BAvat... | true |
6aee365f0924ef80019c5ce71a16765f2f11f87a | SQL | conglinduye/dapphouse | /schema/dapphouse.sql | UTF-8 | 6,530 | 3.359375 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50721
Source Host : localhost:3306
Source Schema : tron_dapphouse
Target Server Type : MySQL
Target Server Version : 50721
File Encoding : 65001
Date: 13/10/... | true |
c0e5dd4ef858825fc76116215b63384a083e2cc7 | SQL | himselfv/jet-tool | /examples/Procedures.sql | UTF-8 | 866 | 3.140625 | 3 | [] | no_license | /*
Tests procedure creation and calls. This requires a fair amount of other functionality working, so run later in the tests.
Dump must much the procedures part.
*/
CREATE TABLE [Users] (
[ID] COUNTER NOT NULL,
[Username] TEXT(64),
[Password] TEXT(64),
[FullName] TEXT(128),
[Age] INTEGER,
[Revision] INTEGER... | true |
8184d45e9e80e4ac36113021b060afb8b9dd148f | SQL | move47/Database-Systems-Lab | /LAB5/Q1/data_and_ddl.sql | UTF-8 | 1,128 | 3.296875 | 3 | [] | no_license | /*Q - 5*/
create table account (
accno number primary key,
accname varchar2(20) not null,
type varchar2(10) not null,
balance number not null
);
create table transaction (
tr_id number primary key,
accno number not null,
tr_type char(1) not null,
amt number not null,
trdate date,
... | true |
b1ad94c2e30855207d3b395a03b6849b29b398c0 | SQL | jxsd0084/JavaTrick | /sql/powernode/Oracle_02/课堂代码/函数.sql | UTF-8 | 2,723 | 4.625 | 5 | [] | no_license | SELECT MAX( SAL ) AS 最高工资, MIN( SAL ) AS 最低工资, AVG( SAL ) AS "平均工资", SUM( SAL ) AS "工资总和"
FROM EMP;
-- SUM,AVG 只能针对数值型的数据
SELECT AVG( SAL ) AS "平均工资", SUM( SAL ) AS "工资总和"
FROM EMP;
-- MAX,MIN 可以针对任何类型
SELECT MAX( E.HIREDATE ), MIN( E.HIREDATE )
FROM EMP E;
SELECT MAX( E.ENAME ), MIN( E.ENAME )
FROM EMP E;
-- ... | true |
a6b7d8fa046b39a798f3ac59f537910a4f89d2aa | SQL | rnaimehaom/drug-combinations-az | /sql/drug_pair_to_target_pair.sql | UTF-8 | 2,855 | 3.90625 | 4 | [] | no_license | -- THIS FILE RUNS WAY TOO SLOW!!! --
-- Use python instead --
--
drop table if exists drug_pair_to_ensp_pair;
create table drug_pair_to_ensp_pair (
unique_id varchar(255),
ensp_pair varchar(255),
ensp_1 varchar(255),
ensp_2 varchar(255)
);
insert into drug_pair_to_ensp_pair
SELECT
unique_id,
ep.ensp_pair ensp_pair,
... | true |
004371c15bc9a458637a2d8774b71d1042aef79c | SQL | mettyoung/ecc-spring-angular | /infra/src/main/resources/buildtools/2017-11-08_0022.sql | UTF-8 | 2,061 | 4.1875 | 4 | [] | no_license | -- DDL Commands
CREATE TABLE persons (
id SERIAL NOT NULL,
title VARCHAR(20),
last_name VARCHAR(20) NOT NULL,
first_name VARCHAR(20) NOT NULL,
middle_name VARCHAR(20) NOT NULL,
suffix VARCHAR(20),
street_number VARCHAR(20) NOT NULL,
barangay VARCHAR(50) NOT NULL,
municipality VARCHAR(50) NOT NULL,
zip_code IN... | true |
2b5efa836433a6ec2e4d1bb1d45073fdee5e93a5 | SQL | vittorioventura/UniAds | /Annunci.sql | UTF-8 | 3,117 | 4 | 4 | [] | no_license | DROP DATABASE IF EXISTS Annunci;
CREATE DATABASE Annunci;
USE Annunci;
DROP USER IF EXISTS 'vittorio'@'localhost';
CREATE USER 'vittorio'@'localhost' IDENTIFIED BY 'vittorio';
GRANT ALL ON Annunci.* TO 'vittorio'@'localhost';
DROP TABLE IF EXISTS utente;
CREATE TABLE utente (
email char(100),
password char(10... | true |
140b70530ebd133f439f8dc3f652854706f68b97 | SQL | Technology-Community/Students-Manager-3 | /BAOCAO/qlhs.sql | UTF-8 | 22,994 | 3.46875 | 3 | [] | no_license | # Host: localhost Database: qlhs
# ------------------------------------------------------
# Server version 5.0
DROP DATABASE IF EXISTS `qlhs`;
CREATE DATABASE `qlhs` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `qlhs`;
CREATE TABLE `phan_quyen` (
`ma_phan_quyen` char(6) NOT NULL default '' COMMENT 'Mã phân quyền'... | true |
99dd6cfc344058dd75a80e6e13dce1076b0bc665 | SQL | hmotta/sql | /regulatorios/tablasregulatorios.sql | UTF-8 | 2,111 | 2.734375 | 3 | [] | no_license | -- Table: sucursal1.prestamobancario
drop table carteracomunidadfecha;
create table carteracomunidadfecha (
carteraid serial,
fechadegeneracion date,
prestamoid int4,
clavesocioint char(15),
grupo char(25),
referenciaprestamo char(18),
tipoprestamo char(3),
nom... | true |
b69b10465a5981a4df94901d0afff9a840081005 | SQL | rokurosatp/nlelement | /nlelement/sqlcode/GetHeadPointCount.sql | UTF-8 | 429 | 3.640625 | 4 | [] | no_license | SELECT tar_token.ID, Documents.NAME, COUNT(pre_token.ID) as total_tokens, SUM(LENGTH(pre_token.surface)) as total_chars FROM
TOKENS as pre_token ,
TOKENS as tar_token , Documents
where pre_token.DOCUMENT_ID == tar_token.DOCUMENT_ID and pre_token.ID < tar_token.id and tar_token.DOCUMENT_ID == Documents.ID
and
tar_t... | true |
53f1fcc149cedb690e314c1b53e9547c2975deaf | SQL | albertomattos/SQL_gerais | /Faturas em remessas abertas.sql | UTF-8 | 328 | 3.234375 | 3 | [] | no_license | select c.fantasia, a.fatura, a.remessa, b.data_emiss, b.data_venci, b.data_entre, a.valor_tot
from fafatcad a, faremcad b, faconcad c, fapaccad d
where a.remessa = b.remessa
and a.cod_con = c.cod_con
and a.cod_pac = d.cod_pac
and b.remessa_fechada = 'N'
and b.data_emiss between '01/01/2014' and '30/09/2014'
order by b.... | true |
f42ef1e9dedeb1984403e7a1e62b17002dc330f1 | SQL | cmdln/empholite | /migrations/2020-08-12-203728_add_http_verb_rule/up.sql | UTF-8 | 183 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | alter type rule_type add value if not exists 'http_method';
create type http_verb as enum ('get', 'post', 'put', 'delete');
alter table rules add column http_method http_verb null;
| true |
37c9f233004674ce1d86fee960f47543be28b258 | SQL | kabugit/ETC5543_RRSCalcu | /Label instructions - Emyria.sql | UTF-8 | 380 | 3.15625 | 3 | [] | no_license | SELECT DISTINCT MasterPatient_ID, ATCLevel5Name, ATCLevel3Name
FROM
DimProductMaster d
JOIN
FactScript f
ON
f.MasterProductId = d.MasterProductID
JOIN
DimMAIU m
ON
m.MAIU_ID = f.MAIUID
WHERE ATCLevel1Name ILIKE '%NERVOUS SYSTEM%'
AND ATCLevel2Name ILIKE '%PSYCHO%'
AND MasterPatient_ID... | true |
3787bdd51fe5f2fe38a8b7f6bcd931cb1193c2d8 | SQL | alexandrstiroi/factory_base | /t_composition.sql | UTF-8 | 1,242 | 2.890625 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : OracleCloudStation01
Source Server Type : PostgreSQL
Source Server Version : 130004
Source Host : 152.70.187.29:5432
Source Catalog : orders_catalog
Source Schema : working_data
Target Server Type : PostgreSQL
Target Serv... | true |
abb4abfd6c1221a842ae519c77850c65188a1c56 | SQL | gabrielos307/BasesDatosAvanzadas | /BDA/proyecto-final/ProyectoFinal_Subastas/s-13-crea-fra.sql | UTF-8 | 1,826 | 2.875 | 3 | [] | no_license | --@Autor: FLores García Karina
--@Autor: Herrera Gandarela Gabriel Alejandro
--@Fecha Creacion: 04/02/2021
--@Descripcion: Creacion de la FRA
whenever sqlerror exit rollback
set serveroutput on
connect sys as sysdba
--crear un pfile a partir de un spfile
create pfile from spfile;
/*
alter system set db... | true |
c5f3d9b8727111bf9c6f169876f547999d8d1139 | SQL | whehdwns/CSE_111 | /Lab_5/Lab5/8.sql | UTF-8 | 174 | 3.09375 | 3 | [] | no_license | SELECT COUNT(DISTINCT s_suppkey)
FROM supplier, part,lineitem
WHERE s_suppkey=l_suppkey AND l_partkey=p_partkey AND p_type LIKE '%MEDIUM POLISHED%' AND p_size IN (3,23,26,49) | true |
49d06196d3ab93765480f1f944136de6d5e2518c | SQL | Siriyakorn28/php | /project (เชื่อม).sql | UTF-8 | 4,265 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 02, 2020 at 02:24 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
c08f4fbff875b3415ba647094a2311b01c641cf3 | SQL | MDolega20/witryny | /4TI/18-11-2019_probny_egzamin/kino.sql | UTF-8 | 5,540 | 3.421875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Czas generowania: 17 Lis 2019, 23:40
-- Wersja serwera: 10.1.37-MariaDB
-- Wersja PHP: 7.2.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
02cb9d95454e2dfc6167e93c4b8ea1ba5cfd5bbd | SQL | pedroalles/trybe-exercises | /exercises/BACK-END/BLOCO_19/DIA_02/prática/ex15.sql | UTF-8 | 264 | 3.296875 | 3 | [] | no_license | -- Escreva uma query que exiba a string "Existem Number cientistas na tabela Scientists.", em que Number se refira a quantidade de cientistas
USE Scientists;
SELECT CONCAT('Existem ', COUNT(Name), ' cientistas na tabela Scientists.') as resultado FROM Scientists; | true |
48aa15bc22e0f906adbf040b59570e5822cf35fe | SQL | Maxim-Turovets/SQL_lab_FICT-2018 | /ТуровецьМЮ_лаб1.sql | UTF-8 | 1,383 | 3.03125 | 3 | [] | no_license | SELECT "Туровець Максим Юрійович"; /*Завдання №1*/
SELECT * FROM products; /*Завдання №2*/
SELECT * FROM products
WHERE discontinued=1; /*Завдання №3*/ /*я так розумію 1 - це припинено*/
SELECT DISTINCT City FROM Customers; ... | true |
32250207cf991d39dafd038bf3123073ff9c1384 | SQL | aboutboy/citywifi | /Source/WebServer/web/auth1/WebRoot/WEB-INF/sql/import.sql | GB18030 | 1,257 | 3.5 | 4 | [] | no_license |
drop table comment if exists;
drop table thread if exists;
drop table user if exists;
-- û
create table user(
username varchar(100), -- ʺ
password varchar(100), --
reg_time datetime, -- עʱ
last_login datetime, -- ϴε¼ʱ
state integer, -- ˻״̬
level integer, -- ˻
hit integer, -- ½
realname varchar(10... | true |
14e270ff2e9b2e205a0d4374dc729ba1e57a16a5 | SQL | Ujin-n/HCFA_DWH | /DWH_HCFA/TABLES/LOG_TABLES.SQL | UTF-8 | 6,310 | 3.578125 | 4 | [] | no_license | /**************************************************************************
DDL statements for R_DWH_ETL table
**************************************************************************/
DECLARE
E_OBJECT_EXISTS EXCEPTION;
PRAGMA EXCEPTION_INIT (E_OBJECT_EXISTS, -00955);
BEGIN
EXECUTE IMMEDIATE '
... | true |
ca700dbe93912d6921b7e90bc601a43ade0e7519 | SQL | seanbrwh/personalcomputerchunks | /db/Cpu/CpuSeed.sql | UTF-8 | 4,976 | 2.765625 | 3 | [] | no_license | -- drop table cpu
-- create table cpu(cpu_id serial primary key,manufacturer varchar(30),model varchar(20),partnum varchar(30),socket varchar(30), frenquency decimal, turbo decimal, cores integer, tdp integer, multithread varchar(5),maxmem varchar(10), intgraphics varchar(20), included_cooler varchar(5),price decimal,p... | true |
c3f742ae340346189c94ef3b5bc07be7a957de04 | SQL | Jean-Roc/sia_sql | /statistiques/mobilier/determination_correction.sql | UTF-8 | 5,596 | 3.734375 | 4 | [] | no_license | SELECT count(id)
FROM app.mobilier
WHERE determination IS NULL
SELECT DISTINCT determination
FROM app.mobilier
WHERE determination IS NOT NULL
ORDER BY determination
UPDATE app.mobilier SET determination = trim(both ' ' from determination);
UPDATE app.mobilier SET determination = NULL WHERE determination = '';
SELE... | true |
84910adc7e552a7cb8eb2331a5c8083af73b474d | SQL | matthewpoletin/mountainpier-social | /src/main/resources/sql/db.sql | UTF-8 | 6,405 | 3 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 10.0
-- Dumped by pg_dump version 10.0
-- Started on 2018-03-27 17:53:52 MSK
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_fu... | true |
b7052fd31690fad9f52107537025a5783b070db2 | SQL | lavandalia/Teme-Poli-Calculatoare | /Anul III/BD/lab6.sql | UTF-8 | 1,188 | 3.703125 | 4 | [] | no_license | SELECT LOWER(DNAME),LOWER('SQL course')
FROM DEPT;
SELECT ENAME
FROM EMP
WHERE ENAME =UPPER('&ENAME');
SELECT INITCAP(DNAME), INITCAP(LOC)
FROM DEPT;
SELECT CONCAT (ename,job) "JOB"
FROM EMP
WHERE EMPNO =7900;
SELECT LPAD(DNAME,20,'*'),LPAD(DNAME,20),LPAD(DEPTNO,20,'.')
FROM DEPT;
SELECT DNAME,INSTR(D... | true |
c437670f8ea0492c5943594f07baf11f470fc531 | SQL | CUBRID/cubrid-testcases | /sql/_23_apricot_qa/_03_i18n/es_ES/_01_string_date_func/cases/_001_strtodate.sql | UTF-8 | 5,754 | 2.796875 | 3 | [
"BSD-3-Clause"
] | permissive | --+ holdcas on;
set names utf8;
set system parameters 'intl_date_lang = es_ES';
-- day long form : Sunday - Saturday
select 'Days long form';
SELECT STR_TO_DATE('domingo 2 2011','%W %u %Y') FROM db_root;
SELECT STR_TO_DATE('lunes 2 2011','%W %u %Y') FROM db_root;
SELECT STR_TO_DATE('martes 2 2011','%W %u %Y') FROM db_r... | true |
4c0022d867bfc498c49b7de671925b7e5cdbbd5c | SQL | FerPezzutti/proyecto-final | /ayudar_db.sql | UTF-8 | 12,486 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 13-12-2017 a las 09:39:16
-- Versión del servidor: 10.1.24-MariaDB
-- Versión de PHP: 7.1.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
e672ee44c119d7f6881b22fd8988f362b62bee94 | SQL | kurganITteacher/kpk-django | /query_1.sql | UTF-8 | 396 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | SELECT
"mainapp_course"."id", "mainapp_course"."category_id", "mainapp_course"."name", "mainapp_course"."desc",
"mainapp_course"."hours", "mainapp_course"."level", "mainapp_course"."is_active", "mainapp_course"."picture"
FROM "mainapp_course"
WHERE "mainapp_course"."category_id" = 1
ORDER BY "mainapp_course"."i... | true |
437873d032b556a34cf5bca37a75eda03349231d | SQL | calonso/globaldent | /docs/Scripts/grupo_imagenes.sql | UTF-8 | 519 | 3.28125 | 3 | [] | no_license | DROP TABLE IF EXISTS `grupo_imagenes`;
CREATE TABLE `grupo_imagenes` (
`id_grupo_imagenes` int(10) unsigned NOT NULL auto_increment,
`nombre` varchar(255) collate latin1_spanish_ci NOT NULL,
`id_usuario` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_grupo_imagenes`),
KEY `id_usuario` (`id_usuario`),
... | true |
b5d4d40995bb5919ebe397cfb965520cde087c30 | SQL | rudgjs8080/2021_04_DBMS | /Oracle/SCUSER(2021-04-27_Dual).sql | UTF-8 | 2,733 | 4.28125 | 4 | [] | no_license | -- 여기는 SCUSER 접속-- 여기는 SCUSER 접속
select 30 + 40 from dual;
select 40 - 30 from dual;
select 40 / 20 from dual;
select 30 * 40 from dual;
-- select 명령문을 사용하여
-- 간단한 연산을 수행할 수 있다
-- 표준 SQL에서는 select 연산식 형식으로 수행해 볼 수 있는데
-- oracle 에서는 from 절이 없는 select 는 허용하지 않는다
-- dual이라는 dummy table을 준비해놓고
-- SQL 연산을 수행할 때 사용하도록 만들어놨... | true |
f0df005b092beee3dba8efec7430c9d72eb2429a | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day15/select0938.sql | UTF-8 | 266 | 2.9375 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='WiFiAP' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['6211','3042','5100_5','5100_9','3004','2066','6088','2089','3058','5089'])
| true |
132020e351ca4241fe18ac2ba5f69e467fa92990 | SQL | nabaskes/InterviewQs | /oct92018-monthlyrevenuegrowth.sql | UTF-8 | 1,323 | 4.15625 | 4 | [] | no_license | -- Question 40 - Calculating monthly revenue growth in SQL
-- Given the table below, called 'orders', write a SQL query to show the monthly revenue growth. To calculate the monthly revenue growth, you can apply the following logic:
-- revenue growth = (current month's revenue-prior month's revenue)/prior month's reve... | true |
7867e1c4c7585d745b0b81f6e379edc62086f5a2 | SQL | sebasberra/shu_bases | /scripts/padron2/auxiliares/versiones.sql | UTF-8 | 787 | 2.71875 | 3 | [] | no_license | /*
SQLyog Community Edition- MySQL GUI v8.14
MySQL - 5.1.34-community : Database - hmi2
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40101 SET @OLD_... | true |
dc819a860b101f07a8c767ed1a9ac304a156e0d4 | SQL | max-dankow/SQL-EX-Queries | /089.SQL | UTF-8 | 383 | 3.796875 | 4 | [] | no_license | SELECT maker, COUNT(model)
FROM product
GROUP BY maker
HAVING COUNT(model) >= ALL
(
SELECT *
FROM
(
SELECT COUNT(model) AS number
FROM Product
GROUP BY Maker
) t1
)
UNION
SELECT maker, COUNT(model)
FROM product
GROUP BY maker
HAVING COUNT(model) <= ALL
(
SELECT *
FROM
(
SELECT COUN... | true |
1da6a1d49784ba81963506fdae2b449cf4dd3e30 | SQL | BaptistePoree/recettes-db | /scripts/create_tables.sql | UTF-8 | 9,374 | 3.90625 | 4 | [] | no_license | -- Création de la table users
CREATE TABLE "users" (
"id" int NOT NULL,
"pseudo" varchar2(25) NOT NULL,
"mail" varchar2(255) NOT NULL,
"password" varchar2(255) NOT NULL,
"display_name" varchar2(255),
"localisation" varchar2(255),
CONSTRAINT USERS_PK PRIMARY KEY ("id"),
CONSTRAINT USERS_U UNIQUE ("pseudo", "mail... | true |
0d924dc265380db96b5f146b6f994b9ec56d8fa0 | SQL | aonizai/dhdc3 | /modules/population/การติดตั้ง/dhdc_module_population.sql | UTF-8 | 45,803 | 3.578125 | 4 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 06-61.19.22.158-พรหมพิราม
Source Server Version : 50505
Source Host : 61.19.22.158:3306
Source Database : dhdc_fnc
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2017-08-11 12:58:48
*/
SET FOREIGN... | true |
0d14a3f7dfd3f2da7b4a92b40d723633270acccc | SQL | krogank9/forum-server | /seeds/seed.forum.sql | UTF-8 | 2,313 | 3.078125 | 3 | [] | no_license | INSERT INTO users (user_name, password, admin, profile_picture)
VALUES
('logan', '$2y$12$l6D6NqNrO5pkN.VV7Tgurer9hrEP/TYQJVqC3uVQ4k4FxQDToU3jK', TRUE, 1),
('djole', '$2y$12$l6D6NqNrO5pkN.VV7Tgurer9hrEP/TYQJVqC3uVQ4k4FxQDToU3jK', FALSE, 2),
('maggie', '$2y$12$l6D6NqNrO5pkN.VV7Tgurer9hrEP/TYQJVqC3uVQ4k4FxQDToU3... | true |
49fb9026f23befb9d8c99583d2e1772cb0cec6d9 | SQL | kenny5he/docnet | /Services/BigData/Hadoop/hive/hive.sql | UTF-8 | 5,593 | 4.1875 | 4 | [] | no_license | --创建badou schema
create schema if not exists badou;
--删除 schema
--drop schema badou;
--使用 badou schema
use badou;
--创建用户表
--create table users
--(
--
--)
--row format delimited fields terminated by ','
--lines terminated by '\n';
--创建一级品类表( 部门/类别 比如厨房类 )
create table departments
(
department_id String,
department S... | true |
203d57bbdbafee3b633ba5d3ff2f3b58dd7416ea | SQL | Tinchoarcangeli/Sistema-de-login-intraconsula- | /MartinGabrielArcangeli/bd/datos.sql | UTF-8 | 2,187 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 14-04-2017 a las 00:11:23
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... | true |
622cea905efd5c63be3587863ecf502039cb0f94 | SQL | joshdeng/LBJ-Viewer | /SQLstatement/setupscript.sql | UTF-8 | 522 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | DROP TABLE imagescount;
DROP TABLE pictures;
DROP TABLE imagesviewer;
DROP sequence images_seq;
DROP sequence pic_id_sequence;
DROP sequence group_id_sequence;
@setup.sql;
@CreateIndex.sql;
@drjobml1.sql;
@drjobml2.sql;
@drjobml3.sql;
@counter.sql;
CREATE sequence pic_id_sequence;
CREATE sequence group_id_sequence incr... | true |
64ec7b699f5a18a1e6cb108861a4e205a034edcf | SQL | wenrurumon/smart_city | /temp_lc_pool_20180712_sel.sql | UTF-8 | 2,647 | 3.796875 | 4 | [] | no_license |
create table temp_lc_pool_20180712_sel as
select x.uid, x.gender, x.age, x.prov_id,
min(x.stime) as stime, max(x.etime) as etime, sum(dtime) as dtime,
x.spot0, x.spot from
(
select
uid, gender, age, prov_id, stime, etime,
cast((unix_timestamp(etime)-unix_timestamp(stime)) as bigint) as dtime,
gw, spot, lag(spot,1,sp... | true |
34fd030cfb203dc3671b087b7e9bf3241ffbfe7a | SQL | ADoublePlus/TestDome | /Question 3. Pets.sql | UTF-8 | 362 | 3.59375 | 4 | [] | no_license | /*
Information about pets is kept in two separate tables:
TABLE dogs
id INTEGER NOT NULL PRIMARY KEY,
name VARCHAR(50) NOT NULL
TABLE cats
id INTEGER NOT NULL PRIMARY KEY,
name VARCHAR(50) NOT NULL
Write a query that selects all distinct pet names.
*/
select distinct name from
(
select name from... | true |
de634968118d37c7b71f42e37bda25acc51ab80c | SQL | ox-it/sakai | /gradebook/app/business/src/sql/mysql/SAK-18306.sql | UTF-8 | 542 | 3.53125 | 4 | [
"LicenseRef-scancode-generic-cla",
"ECL-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | # SAK-18306 - Adding additional grading scales to existing gradebooks
# Replace the XXXXX in the sql with the GB_GRADING_SCALE_T.ID for your new grading scale
#
insert into GB_GRADE_MAP_T (OBJECT_TYPE_ID, VERSION, GRADEBOOK_ID, GB_GRADING_SCALE_T)
select distinct 0,0,GB_GRADEBOOK_T.ID,GB_GRADING_SCALE_T.ID
from GB_GR... | true |
e6b4c978e9208b4218aba00272184ecd05008c42 | SQL | kibo13/test-regform | /static/database.sql | UTF-8 | 2,686 | 3 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : mamp
Source Server Type : MySQL
Source Server Version : 50724
Source Host : localhost:8889
Source Schema : db_persons
Target Server Type : MySQL
Target Server Version : 50724
File Encoding : 65001
Date: 26/07/2021 00:2... | true |
6a66318f0ed58adfc5757fb5a0943e6c37c13a9b | SQL | carloshenriquefs/SQL- | /Exercicios/023 - CidadeEmOrdemAlfabetica.sql | ISO-8859-1 | 797 | 3.171875 | 3 | [] | no_license | CREATE DATABASE CidadesOrdemA;
USE CidadesOrdemA;
CREATE TABLE Fornecedores(
IdFornecedores INT PRIMARY KEY IDENTITY,
NomeF VARCHAR(255) NOT NULL,
Rua VARCHAR(200) NOT NULL,
Cidade VARCHAR(255) NOT NULL,
Estado CHAR (2) NOT NULL
);
INSERT INTO Fornecedores VALUES ('Henrique', 'Av Brasil', 'Rio de Janeiro', 'RJ');
IN... | true |
27509c6d021eb02e859a061f2bcbbc4cd758fbee | SQL | idanso/train_time_schedule_DB | /train_schedular_final_project_only_proceduresAndTriggers.sql | UTF-8 | 15,445 | 4.03125 | 4 | [] | no_license | USE train_schedular;
# procedure for getting all lines and their departure time that match the wanted source and destination stations
DELIMITER $$
CREATE PROCEDURE giving_relevent_lines_by_stations_and_departure_time(
search_source CHAR(25),
search_destination CHAR(25),
departure_time TIME,
wanted_date... | true |
fd285ca60fe8235993712c91bebad90091586e9e | SQL | mstover/AllarPhotos | /src/web/web-inf/sqlTemplates/findProducts.sql | UTF-8 | 2,022 | 3.140625 | 3 | [] | no_license | #if($primaryValue && !$path)
select * from findProductsByPrimary('$table','$sql.escapeSql($sql.escapeSql($primaryValue))')
#elseif($name && $path)
select * from findProductsByPrimaryPath('$table','$sql.escapeSql($sql.escapeSql($name))','$sql.escapeSql($sql.escapeSql($path))')
#elseif($name && !$path)
select * from f... | true |
5aea0385abf53a3bc9444d9186d72e968715652b | SQL | ivancekic/sql-data-analysis | /sql/ZAVISNI_TROSKOVI/Inst_package/07 Tab_ZTroStav.sql | UTF-8 | 2,284 | 2.671875 | 3 | [
"MIT"
] | permissive | -- tabela ZAVISNI_TROSKOVI_STAVKE
CREATE TABLE INVEJ.ZAVISNI_TROSKOVI_STAVKE
(
BROJ_DOK VARCHAR2(7) NOT NULL,
VRSTA_DOK VARCHAR2(3) NOT NULL,
GODINA NUMBER NOT NULL,
STAVKA NUMBER NOT NULL,
VRSTA_TROSKOVA VARCHAR2(5) NOT NULL,... | true |
547e650efdbef7d007623d9f47387aceca2ab3fb | SQL | dennohdee/kuict | /auth-o.sql | UTF-8 | 3,657 | 3.4375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 11, 2018 at 08:19 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
71511c944b37fb7dab76d8f0b9a629f1e86fb4bc | SQL | notdoori/pilot-mighty | /sql/sys_system_code.sql | UHC | 2,389 | 3.328125 | 3 | [] | no_license | --------------------------------------------------------
-- - ݿ-6-18-2021
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Table SYS_SYSTEM_CODE
--------------------------------------------------------
CREATE TABLE "C##SCOTT"."S... | true |
a15ec1371cc60e456bbc9f448d924da6d2cab09d | SQL | ewpatton/cancerwiki-reader | /src/main/resources/edu/rpi/tw/mobilehealth/wiki/WikiReader.sql | UTF-8 | 557 | 4.0625 | 4 | [] | no_license | select page.page_id, page.page_namespace, page.page_title, revision.rev_timestamp, text.old_text from
page join revision on page.page_id = revision.rev_page
join text on revision.rev_text_id = text.old_id
join (select page.page_id, max(revision.rev_id) as latest_edit from
page join revision on page.page_id = revisi... | true |
84f510d93e03023b64b9e6b44b693062d38c9894 | SQL | FireFoxHD/test-eclipse | /equipment_rental.sql | UTF-8 | 2,545 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 29, 2021 at 08:26 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.3.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.