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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
36a3c7f34105e6ce76a736f51a5005f027393419 | SQL | mariodavid/cuba-7-release-party | /modules/core/db/init/hsql/20.create-db.sql | UTF-8 | 668 | 3.015625 | 3 | [] | no_license | -- begin C7RP_PARTY
alter table C7RP_PARTY add constraint FK_C7RP_PARTY_ON_LOCATION foreign key (LOCATION_ID) references C7RP_LOCATION(ID)^
create index IDX_C7RP_PARTY_ON_LOCATION on C7RP_PARTY (LOCATION_ID)^
-- end C7RP_PARTY
-- begin C7RP_INVITATION
alter table C7RP_INVITATION add constraint FK_C7RP_INVITATION_ON_PER... | true |
ecbcacc6c9de3121b51b3565d1166f2343e52450 | SQL | meiMingle/CANUS_Amazon_Scraper | /src/SQLQueries/select_all_by_brand_name_CAN.sql | UTF-8 | 249 | 3.484375 | 3 | [] | no_license | SELECT * FROM CAN_Product
LEFT JOIN brand
ON CAN_Product.brand_id = brand.brand_id
WHERE brand.brand_name = '$brand_name'
/*
select * from CAN_Product
WHERE brand_id = (SELECT brand_id FROM brand WHERE brand_name = '$brand_name')
*/ | true |
0db5aa2fd422beef14cdda18f041d4fb59b1dd14 | SQL | heeyomi/mariadb_practices | /mysql_practice/sql-practice/join.sql | UTF-8 | 2,660 | 4.75 | 5 | [] | no_license | -- join
-- 예제 1
-- employee 테이블과 titles 테이블을 join하여 직원의 이름과 직책을 모두 출력 하세요.
select * from employees a, titles b where a.emp_no = b.emp_no; -- join condition
-- 예제 2
-- employees 테이블과 titles 테이블를 join하여 직원의 이름과 직책을 출력하되 여성 엔지니어만 출력하세요
select concat(a.first_name, ' ', a.last_name) 이름, b.title from employees a, titles b ... | true |
3da3d18db1d45bf69a5789d312b6a6eb2add697e | SQL | clarchiu/scrum-ptious | /server/src/db/schema/create.sql | UTF-8 | 1,654 | 3.625 | 4 | [
"MIT"
] | permissive | DROP TABLE IF EXISTS teams CASCADE;
CREATE TABLE teams (
id SERIAL PRIMARY KEY NOT NULL,
team_name VARCHAR(255) NOT NULL
-- ,manager_id INTEGER REFERENCES employees(id) NOT NULL
);
DROP TABLE IF EXISTS employees CASCADE;
CREATE TABLE employees (
id SERIAL PRIMARY KEY NOT NULL,
name VARCHAR(255) NOT NULL,
e... | true |
4efe99bf6bc760e440341aba92f91109ae2f6ffe | SQL | carolfly86/altar | /sql/golden_record/balance/balance_ws5_gr.sql | UTF-8 | 3,268 | 3.03125 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = fals... | true |
95f34619450fba690ddbab1bb736e228b17eac0c | SQL | Tuan-Simonetti/curso_de_java_udemy | /src/sql/criarTabelaPrefeitos.sql | UTF-8 | 271 | 3.03125 | 3 | [
"MIT"
] | permissive | -- criar tabela prefeitos
create table if not exist prefeitos (
id int unsigned not null auto_increment,
nome varchar(255) not null,
cidade_id int unsigned,
primary key(id),
unique key(cidade_id),
foreign key(cidade_id) references cidades (id)
); | true |
66eb5cba88da75fdf47e6c027b4b1858d60e22e6 | SQL | achmadnabawi/sparkdata | /zlj/project/task/user/user_profile/t_base_user_info_s_tbuserinfo_t_step4.sql | UTF-8 | 914 | 3.3125 | 3 | [] | no_license |
-- 加入闲鱼 个人基本信息
-- 加入模型预测性别数据
Drop table t_base_user_info_s_tbuserinfo_t_step4 ;
create table t_base_user_info_s_tbuserinfo_t_step4 as
SELECT
t1.* ,
t2.gender as predict_gender
FROM
(
select
tb_id ,
alipay ,
buycnt ,
verify ,
regtime ,
tb_nick ,
tb_loc... | true |
36d5b10d9944f35d9e2dad51e5d3127e8658a56f | SQL | nandhawalrost/bonku | /backup_db/bonku.sql | UTF-8 | 16,488 | 2.875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jun 27, 2021 at 12:47 PM
-- Server version: 10.4.18-MariaDB-cll-lve
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!... | true |
d33b45cdc0e62773f9e84365d7f5082ee75ba416 | SQL | zaman-zafar/SQL | /Purchase report.sql | UTF-8 | 2,550 | 3.53125 | 4 | [] | no_license | SELECT t1.[purchid],
t1.[itemid],
[invoicedate],
[qty],
[lineamount],
[purchprice],
t1.[dataareaid],
invoiceid,
t1.taxgroup,
t1.taxitemgroup,
t2.[storenumber],
t4.inventsiteid,
t11.inventlocationid AS warehouse,
t4.... | true |
8d06ef199e436b5250152a3fe55e01c838ecbd89 | SQL | enricorobazza/gamesxp | /scripts/migrate.sql | UTF-8 | 4,019 | 3.984375 | 4 | [] | no_license | -- Desconectar todas as conexões atuais com o DB
SELECT
pg_terminate_backend (pg_stat_activity.pid)
FROM
pg_stat_activity
WHERE
pg_stat_activity.datname = 'gamexp';
-- Drop database, create and connect
DROP DATABASE IF EXISTS gamexp;
CREATE DATABASE gamexp;
\c gamexp
-- Tables
CREATE TABLE pessoa(
cpf V... | true |
4179c023420f910b6892ced80f418a88f0c22d4c | SQL | harikrishnamg/assesment | /CARDIO_DB_SCRIPTS.sql | UTF-8 | 1,843 | 3.421875 | 3 | [] | no_license | --DB Scripts for Cardio Challange Project--
--Category Table
insert into categery (cat_id,cat_title) values (1,'Beginner');
insert into categery (cat_id,cat_title) values (2,'Intermediate');
insert into categery (cat_id,cat_title) values (3,'Advanced');
commit;
--branch develop hhhh
--Challange Table
INSERT INTO chal... | true |
5224786b2417385add7ca05ece6998d032138547 | SQL | papermache/elmhurst | /sql/calc_cumulative_average(sma).sql | UTF-8 | 148 | 3.25 | 3 | [] | no_license | select
ad.id, avg(ad.item_price) over(order by ad.id rows between unbounded preceding and current row) as avg_downloads
from annotations ad
| true |
909258bf74d1ba5c03d1506590afd598b9818a4a | SQL | siddhu95/nlp | /location.sql | UTF-8 | 32,657 | 2.75 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 30, 2015 at 09:10 PM
-- Server version: 5.5.44-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... | true |
04aed54277777fded1470a3ae9511e6181d48e5b | SQL | jonesgaohsu/onprcEHRModules | /onprc_ehr/resources/etl/deprecated/Misc Tests.sql | UTF-8 | 7,932 | 3.8125 | 4 | [] | no_license | /*
* Copyright (c) 2012-2017 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | true |
88dd06424c584d31ad18d199091ac7d9749a3428 | SQL | jubesdotio/scripts | /Windows/MS SQL/Last Proc Run Time.sql | UTF-8 | 176 | 2.796875 | 3 | [] | no_license | select s.last_execution_time
from sys.dm_exec_query_stats s
cross apply sys.dm_exec_query_plan (s.plan_handle) p
where object_name(p.objectid, db_id('DB Name')) = '[Proc Name]' | true |
288d893fc3c4ac7a11775bf2190781cf7c79b51d | SQL | kennyjclew/leetcode_hackerrank_practice | /Customer_Bought_All_Products.sql | UTF-8 | 359 | 3.40625 | 3 | [] | no_license | /*
Title: Customers Who Bought All Products
Difficulty: Medium
Link: https://leetcode.com/problems/customers-who-bought-all-products/
*/
# Write your MySQL query statement below
SELECT customer_id
FROM Customer c
GROUP BY customer_id
HAVING COUNT(DISTINCT product_key) = (SELECT COUNT(DISTINCT product_key)
... | true |
32658d0eb17392292cb2d27bd8d9d1a9cc16f076 | SQL | herrsergio/Fingerprint-PRB | /ereports/ss_cat_menu_option_kfc.sql | UTF-8 | 18,708 | 2.5625 | 3 | [] | no_license | DELETE FROM ss_option_group;
DELETE FROM ss_option_company;
DELETE FROM ss_option_time;
DELETE FROM ss_cat_menu_option;
SELECT setval('ss_cat_menu_option_option_id_seq',1, false);
iNSERT INTO ss_cat_menu_option (option_org, option_desc, action_desc, target, option_key, icon_id, visible) --1
VALUES ('20','Inventario'... | true |
d1938f6ba4dc9db57718f75c9095ad52bb0a31e8 | SQL | jpqy/BootcampX | /2_queries_joins/2_cohort_total_duration.sql | UTF-8 | 175 | 3.125 | 3 | [] | no_license | SELECT sum(duration) AS total_duration
FROM assignment_submissions
JOIN students ON student_id=students.id
JOIN cohorts ON cohort_id=cohorts.id
WHERE cohorts.name='FEB12'; | true |
864214c530ca299bdf1dd8e87e484eaff467cd7f | SQL | jonnyquan/financePlatform | /common/conf/db/account/f_basic_account.sql | UTF-8 | 1,166 | 3.46875 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE f_basic_account
(
id bigint NOT NULL, -- 基本账户Id
account_no character varying(30), -- 基本账户号
status character(1), -- N表示正常
balance numeric(18,4), -- 余额
create_time timestamp without time zone, -- 创建时间
update_time timestamp without time zone, -- 修改时间
delete_time timestamp without time zone, -- 删... | true |
d136c898731a46a75c02920755be35ae8d6efda5 | SQL | claymodel/oraclescripts | /monitoring/ora04031_monitoring.sql | UTF-8 | 10,351 | 3.296875 | 3 | [] | no_license | set echo off
set pages 9999
set trimspool on
set linesize 200
column dcol new_value spoolname noprint
column inputpar01 new_value 1 noprint
select 1 inputpar01 from dual where 1=2;
select nvl('&1', db_unique_name || '_' || to_char(sysdate,'YYYYMMDDHH24MISS') || '_ora04031_monitoring.txt') dcol from v$database;
set f... | true |
35983324f23110fd94b757377507e6a031abcb83 | SQL | imskyer/rust-blog-series-conspiracies-api | /migrations/2018-05-19-130802_add_tag_table/up.sql | UTF-8 | 224 | 2.75 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS "tags" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL UNIQUE,
"approved" INTEGER NOT NULL DEFAULT 0
);
INSERT INTO tags (name, approved) VALUES
('UFO', 1),
('CABAL', 1) | true |
8f1bdafef157d01fb9c2bdf9192f51eae9fd6855 | SQL | szymonpl400/RestApi | /project/src/main/resources/database.sql | UTF-8 | 2,517 | 4.53125 | 5 | [] | no_license | CREATE TABLE "user"(
id bigserial PRIMARY KEY UNIQUE NOT NULL,
uuid UUID NOT NULL UNIQUE,
login VARCHAR( 255 ) UNIQUE NOT NULL,
firstname VARCHAR( 255 ) NOT NULL,
lastname VARCHAR( 255 ) NOT NULL,
account_type VARCHAR( 50 ) NOT NULL CHECK (account_type IN('ADMINISTRATOR', 'MANAGER', 'EMPLOYEE')),
password VARCHA... | true |
3bfbcebe44ee174265e746537d85d574f007cce6 | SQL | ClickHouse/ClickHouse | /tests/queries/0_stateless/02784_projections_read_in_order_bug.sql | UTF-8 | 2,967 | 3.640625 | 4 | [
"BSL-1.0",
"Apache-2.0"
] | permissive | DROP TABLE IF EXISTS events;
create table events (
`organisation_id` UUID,
`session_id` UUID,
`id` UUID DEFAULT generateUUIDv4(),
`timestamp` UInt64,
`payload` String,
`customer_id` UUID,
`call_id` String,
PROJECTION events_by_session_and_org
(
SELECT *
ORDER BY
... | true |
5c96cea2eba17406a867eb3e67c31852569217e2 | SQL | onlinekof2001/Oracle_Auto_Scripts | /oracle_scripts/rdk_create_synonyms_v20.sql | UTF-8 | 2,459 | 3.65625 | 4 | [] | no_license | define synonym_owner=&1
define table_owner=&2
define target_type=&3
set lines 400
set verify off
set feed off
set serveroutput on
begin
execute immediate ('create role select_&table_owner.');
exception
when others then null;
end;
/
declare
st clob;
target_type varchar2(10):='&target_type.';
begin
if upper(target_typ... | true |
57fa0bd680fac59d3eb20d2c75356ea1d7721936 | SQL | YosefSchoen/Data-Base-Mini-Project | /teamsInDivision.sql | UTF-8 | 132 | 2.875 | 3 | [] | no_license | -- find number of teams in each division
select division, league, count(tName)
from team
group by division, league
order by league
| true |
ced00635cd7bfa99cf26456ed27654c9bb5d563e | SQL | bertgodon/bookService | /bookService/src/main/resources/testdb/schema.sql | UTF-8 | 262 | 2.515625 | 3 | [] | no_license | drop table Book if exists;
create table Book (
ID bigint identity primary key,
TITLE varchar(50) not null,
AUTHOR varchar(50) not null,
DESCRIPTION varchar(500) not null,
ISBN varchar(50));
| true |
f46ac6fe0b28d6a3aec4489d3e51bb903dc94be1 | SQL | iamspieler/spieler | /spieler/spieler.sql | UTF-8 | 2,467 | 2.890625 | 3 | [] | no_license | -- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия сервера: 5.1.68-community-log - MySQL Community Server (GPL)
-- ОС Сервера: Win32
-- HeidiSQL Версия: 7.0.0.4381
-- -----------------------------------------... | true |
ab5551ae9b814dd4bcb61ada65dc2c7bbbaec856 | SQL | tirtamahardika/Stemming | /dbsti-stemming.sql | UTF-8 | 165,461 | 2.609375 | 3 | [] | no_license | # stemming
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 24, 2018 at 03:38 PM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!401... | true |
f77b0d6645e3e6432c111995cd482418437dd078 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day18/select2207.sql | UTF-8 | 266 | 2.828125 | 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['5232','5013','3100_4','5100_4','3026','1433','5048','5059','5019','2088'])
| true |
89766d59403b4d2a854a7210d7b0f281f81a57b3 | SQL | prb112/FHIR | /fhir-persistence-schema/src/main/resources/db2/delete_resource_parameters.sql | UTF-8 | 3,457 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | -------------------------------------------------------------------------------
-- (C) Copyright IBM Corp. 2021
--
-- SPDX-License-Identifier: Apache-2.0
-------------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
-- Pr... | true |
f4311cdcef740e8aa0b10f4cd3028861f8d21a68 | SQL | annaymj/SQL | /The Latest Login in 2020.sql | UTF-8 | 1,438 | 4.0625 | 4 | [] | no_license | ```
SQL Schema
Table: Logins
+----------------+----------+
| Column Name | Type |
+----------------+----------+
| user_id | int |
| time_stamp | datetime |
+----------------+----------+
(user_id, time_stamp) is the primary key for this table.
Each row contains information about the login time fo... | true |
99b91a5e4fae8dea157fe71d50c8e226e972787a | SQL | MohAlSaeed/Data-Warehouse | /311-local-sql-server/data-sql/311_Service_Request_create PR.sql | UTF-8 | 1,790 | 3.1875 | 3 | [] | no_license | -- Table: ADDRESS
CREATE TABLE [311_prod].ADDRESS_pr (
ID_ADDRESS int PRIMARY KEY IDENTITY,
LOCATION varchar(200) NULL,
WARD_NUM varchar(200) NULL,
ZIP_CODE varchar(200) NULL,
STREET_NAME varchar(200) NULL,
LATITUDE varchar(200) NULL,
LONGITUDE varchar(200) NULL,
);
-- Table: DATE
CREATE TA... | true |
e9e3046e2ab06de322aae7df9ff59b8ca2aea8f7 | SQL | pertiwiharahap/tugas | /tugas_projetc.sql | UTF-8 | 4,210 | 3.21875 | 3 | [] | no_license | /*
SQLyog Ultimate v10.42
MySQL - 5.1.41 : Database - tugas_project
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@... | true |
76bf7e76e6c5366deb0cb6517049f72ba4b48b9d | SQL | wufeihua/springboot2.0-chapter | /springboot-shiro/src/main/resources/demo.sql | UTF-8 | 763 | 2.828125 | 3 | [] | no_license | CREATE TABLE `roleshiro` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`role` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=3
;
CREATE TABLE `usershiro` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`username` VARCHAR(50) NULL DEFAULT NULL,
`password` VARCHAR(50... | true |
40128f6322a86d01417d1d86f4ded09f04a35ddf | SQL | yagogomesc/bludata-teste | /bludata.sql | UTF-8 | 9,012 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 19-Out-2019 às 01:27
-- Versão do servidor: 10.1.37-MariaDB
-- versão do PHP: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... | true |
f27a8ff1746d6456b6cdf7fa3ee4509f85215120 | SQL | akashdoke4/CarRental | /online_car_rental_system.sql | UTF-8 | 15,773 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 19, 2016 at 03:57 PM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_S... | true |
e86a8f8c0b175a559751f9d196799fc69b45cb72 | SQL | tpacba/bigdata-practice | /sql-practice/thirtyeight.sql | UTF-8 | 761 | 4.25 | 4 | [] | no_license | -- SQL to Get all dates for the given input month and year | date range --
create temporary table if not exists current_month(
current_month date
);
truncate table current_month;
drop procedure if exists days_31;
delimiter //
create procedure days_31()
begin
declare i int default 0;
declare dt date default... | true |
e886680c93fd6fce0832b81ba4bb100d0f31fc4a | SQL | southasia/JrPatrol | /createtables.sql | UTF-8 | 1,944 | 4.3125 | 4 | [] | no_license | CREATE TABLE Shifts (
shiftid INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(25) NOT NULL,
day ENUM('SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT') DEFAULT 'SUN' NOT NULL,
time ENUM('DAY', 'NIGHT') DEFAULT 'DAY' NOT NULL,
PRIMARY KEY (shiftid),
UNIQUE (day, time));
CREATE TABLE Sponsors (
... | true |
36f332dca646c90d9a688c60e463b45f1db576d5 | SQL | pgerdenel/model_gestion_camping | /create_BDD.sql | ISO-8859-1 | 12,428 | 3.265625 | 3 | [] | no_license | /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 24/11/2018 06:55:18 */
/*==============================================================*/
drop table if exists ACCOMPAGNANT;
drop t... | true |
19ababf4f9f86bd3a2abe5606e9f63947686c2e4 | SQL | mrikongkan/vpsakhi.com | /database/ems .sql | UTF-8 | 3,653 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 26, 2021 at 12:29 PM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 8.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
6ccf3febda49579a3b1f102bced6c745fdcafb59 | SQL | jafaralkafar/personal_project | /db/getFileUrlForSThree.sql | UTF-8 | 109 | 2.84375 | 3 | [] | no_license | SELECT s.fileUrl
FROM stories s
INNER JOIN userstories us
ON s.story_id = us.story_id
WHERE us.id = $1;
| true |
9f80f4fc1d5487f3bf3c129b94d66e649e0be3e6 | SQL | rrbb014/warmup-sql | /simple/02_handling_url.sql | UTF-8 | 707 | 3.171875 | 3 | [] | no_license | -- For PostgreSQL
DROP TABLE IF EXISTS access_log ;
CREATE TABLE access_log (
stamp varchar(255)
, referrer text
, url text
);
INSERT INTO access_log
VALUES
('2016-08-26 12:02:00', 'http://www.other.com/path1/index.php?k1=v1&k2=v2#Ref1', 'http://www.example.com/video/detail?id=001')
, ('2016-08... | true |
6b26d74ee9e4cb62cf34a30a54b700aed398030d | SQL | jwhall1/Workforce-Database-GUI | /queries.sql | UTF-8 | 28,392 | 4.0625 | 4 | [] | no_license |
1. List a company’s workers by names.
"select per_name\n" +
"from person natural join occupation\n" +
"where comp_id = '"+companyCombo.getSelectedItem()+"' and occ_status = 'employed'";
2. List a company’s staff by salary in descending order.
"select per_name, pay_rate\n" +
"from person natural join occ... | true |
da8c5a1c61157ad6f9824c3f733f4b8b48babef9 | SQL | gtfold/rnadb_gatech_edu | /sql/rnaDb.sql | UTF-8 | 1,289 | 3.4375 | 3 | [] | no_license | DROP DATABASE rnadb;
CREATE DATABASE rnadb;
USE rnadb;
CREATE TABLE IF NOT EXISTS `rnadb`.`rna` (
`rid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`family` varchar(5) NOT NULL,
`ambiguous` int(1) NOT NULL,
`alignment` int(1) NOT NULL,
`seqlen` int(5),
`filename` varchar(100) NOT NULL,
`accessionnu... | true |
b1e928a0835e35e0408e75dd3b8330c05e55429b | SQL | screwcat/ZXMOA | /.svn/pristine/57/578c5f7551b3264491edcf96bacc0ab87e24576f.svn-base | UTF-8 | 4,034 | 3.671875 | 4 | [] | no_license |
###人员分组表
CREATE TABLE sys_personnel_group(
`group_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '分组ID',
`group_name` VARCHAR(50) DEFAULT NULL COMMENT '分组名称',
`people_number` int(11) DEFAULT NULL COMMENT '分组人数',
`create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
`create_user_name` varchar(50) DEFAULT NULL... | true |
40efc4779cbc653426d6c3f25cd1ad76de6a1a96 | SQL | CBIIT/onedata-mdr | /WA_Scripts/s4/S4_1_WA_RA_DDL.sql | UTF-8 | 26,714 | 3.15625 | 3 | [] | no_license |
alter table nci_quest_valid_value drop primary key;
alter table nci_quest_valid_value add primary key (NCI_PUB_ID, NCI_VER_NR);
alter table obj_key add (DISP_ORD integer null);
create unique index UX_PERM_VAL on PERM_VAL (VAL_DOM_ITEM_ID, VAL_DOM_VER_NR, PERM_VAL_NM, NCI_VAL_MEAN_ITEM_ID, NCI_VAL_MEAN_VER_... | true |
0971194d092ebc7ad16da3c29c82a4066350585b | SQL | WellingtonJunior23/sgp | /database/SGP.sql | UTF-8 | 7,361 | 3.125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.5.16, for Win64 (x86)
--
-- Host: localhost Database: sgp
-- ------------------------------------------------------
-- Server version 5.5.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 S... | true |
bbca38fdfb437a344dc0533b3a41f42934c6e869 | SQL | carze/WWARN | /src/mysql/procedure/quintuple_haplotype_genotype_counts.sql | UTF-8 | 3,922 | 3.546875 | 4 | [] | no_license | DELIMITER //
DROP PROCEDURE IF EXISTS quintuple_haplotype_genotype_counts//
CREATE PROCEDURE quintuple_haplotype_genotype_counts (IN locus1_name VARCHAR(64), IN locus1_pos INT(10),
IN locus2_name VARCHAR(64), IN locus2_pos INT(10),
... | true |
23e2b1ab90b88f9d8a1541cb020858e3f8457dcb | SQL | nphihung94/Web-Interface-accessing-movie-database | /web-interface/sql/load.sql | UTF-8 | 1,657 | 2.6875 | 3 | [] | no_license | -- Load to Actor Table
LOAD DATA LOCAL INFILE '~/data/actor1.del' INTO TABLE Actor
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';
LOAD DATA LOCAL INFILE '~/data/actor2.del' INTO TABLE Actor
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';
LOAD DATA LOCAL INFILE '~/data/actor3.del' INTO TABLE Actor
FIELDS TE... | true |
4bbcdff6b92e793b61796b12405318a6973c8b57 | SQL | joeldatabox/doador | /Doador/src/main/resources/db/migration/V1__CREATE_DATA_BASE.sql | UTF-8 | 643 | 3.4375 | 3 | [] | no_license |
Create table paciente (
id Bigint NOT NULL AUTO_INCREMENT,
nome Varchar(255),
cpf Varchar(20) NOT NULL,
rg Varchar(30) NOT NULL,
nascimento Date NOT NULL,
nome_mae Varchar(255) NOT NULL,
nome_pai Varchar(255),
observacao Longtext,
UNIQUE (cpf),
Primary Key (id)) ENGINE = InnoDB;
Create table endereco (
id ... | true |
a6b6fefdae444b4d79883b3248a636376dff9361 | SQL | IF160005/mysql1-Kaunas | /pratybos8.sql | UTF-8 | 956 | 3.609375 | 4 | [] | no_license | --
-- Database: `Books`
--
--
-- Table structure for table `Authors` - authors of the books
--
CREATE TABLE IF NOT EXISTS `Authors` (
`authorId` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET latin1 COLLATE latin1_german1_ci NOT NULL,
PRIMARY KEY (`authorId`)
) ENGINE=MyISAM DEFAULT CHARSE... | true |
6f9985a72ac32b8a9789ee887d189819f39aa088 | SQL | TinaWuuu/Python001-class01 | /week06/comment.sql | UTF-8 | 4,541 | 2.8125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- 主机: 127.0.0.1:3306
-- 生成日期: 2020-07-31 08:17:48
-- 服务器版本: 10.4.10-MariaDB
-- PHP 版本: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... | true |
83847968b64fba28a8280689a515b0bc8ba811ac | SQL | anandmk95/test | /shopping_cart/database files/payments.sql | UTF-8 | 3,798 | 2.75 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 28, 2018 at 02:38 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
57580e1835d60d23d0efa39fe79eefc2325bb543 | SQL | vishalmajumdar/bloodbank | /bloodbank.sql | UTF-8 | 3,772 | 3.34375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 13, 2021 at 01:28 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
e3d1862a97bae642882419ee0099bb8a969fb6eb | SQL | majing1in/im_server | /server_common/src/main/resources/sql/group_chat_list.sql | UTF-8 | 1,131 | 3 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 80018
Source Host : localhost:3306
Source Schema : im_tables
Target Server Type : MySQL
Target Server Version : 80018
File Encoding : 65001
Date: 30/03/... | true |
d9b96c016c9fa9a7d992cdcf604562df899f604f | SQL | jcevansson/B2-utbetalning-2019 | /B2/SQLQuery1.sql | ISO-8859-1 | 2,852 | 3.3125 | 3 | [] | no_license | --Defaultvrden 100 belopp
drop table #t
SELECT * into #s from v_betalning_summering
select * into #t from #s where datediff(hh,[Registrerat datum] , '2010-05-01 00:01')<0 and datediff(hh,[Registrerat datum] , '2013-08-21 23:59')>0
and kontoOK=1 and DdsBoEjKlart=0
and (Efternamn > 'A' or Efternamn like 'A%')
and... | true |
a9e34b67b2ab022da7a699a288cc36ae9e3403d8 | SQL | FerDev97/SistemaContable | /contanoe.sql | UTF-8 | 17,960 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 04-12-2017 a las 21:48:44
-- Versión del servidor: 10.1.25-MariaDB
-- Versión de PHP: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
65a7601b6c9eb6ddcd6841406768a3b65589a6d4 | SQL | hellolj/SQL_Cookbook | /chapter3/2019-03-23.sql | UTF-8 | 8,815 | 4.8125 | 5 | [] | no_license | /* Chapter 3 */
/* 3.9 Performing Joins When Using Aggregates */
/* Join between emp table to get salary and emp_bonus table to get bonus
But avoid duplicate counting of salaries for employees who have more than
one bonus */
-- note: book uses employee 10 but my bonus table only has employees from 20 and 30
SELECT... | true |
033c20a45d727c07f60ef7ab7cab8ca59d4807a5 | SQL | jnolan97/week4day3 | /day3hw.sql | UTF-8 | 1,885 | 4.5625 | 5 | [] | no_license | --Question 1: Customers who live in Texas
-- SELECT *
-- FROM address
-- SELECT *
-- FROM customer;
SELECT district, first_name, last_name
FROM address
FULL JOIN customer
ON address.address_id = customer.address_id
WHERE district LIKE 'Texas';
--Question 2: All payments above 6.99 with customer's full name
SELECT fi... | true |
08dede56ecb35a2193e80e2a74e4179f17b7a3c7 | SQL | radtek/abs3 | /sql/mmfo/bars/Procedure/cck_del.sql | UTF-8 | 1,406 | 2.640625 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Procedure/CCK_DEL.sql =========*** Run *** =
PROMPT =====================================================================================
PROMPT *** Create procedure... | true |
37d475734122e950c80346376c4c02ec00ec18fe | SQL | jjurm/meetpoint | /db/meetpoint.sql | UTF-8 | 2,524 | 3.546875 | 4 | [] | no_license | --
-- Database: `meetpoint`
--
-- --------------------------------------------------------
--
-- Table structure for table `cities`
--
CREATE TABLE `cities` (
`id` int(11) NOT NULL,
`ign` int(11) NOT NULL DEFAULT '0',
`country` varchar(2) DEFAULT NULL,
`city` varchar(100) DEFAULT NULL,
`accent` varchar(100... | true |
28dcc88de1344b1bc168b1427e6c18a627f770b4 | SQL | tedKarabeliov/Telerik-Academy | /Databases/SQL Queries/Queries.sql | WINDOWS-1250 | 4,349 | 4.59375 | 5 | [] | no_license | -- Write a SQL query to find all information about all departments
SELECT * FROM Departments
-- Write a SQL query to find all department names.
SELECT Name FROM Departments
-- Write a SQL query to find the salary of each employee.
SELECT FirstName + ' ' + LastName AS EmployeeName, Salary
FROM Employees
-- Write a... | true |
11ee225ebccc2f544ce552a8186b0984fef214b1 | SQL | lauradibernardo/jd | /pg/m2/s10.sql | UTF-8 | 1,168 | 4.28125 | 4 | [] | no_license | -- non-equi join
-- ex 1
-- name of department for a given employee
select d.name
from departments d join employees e
using (department_id)
where e.employee_id = 107;
-- name of other department for a given employee
select d.name
from departments d join employees e
on d.department_id != e.department_id
where e.employ... | true |
71b77a05e6853b104158208cdc60a6c44beb0669 | SQL | dynmaticorc72/lesson-practice-temp | /T-SQL/code-ex/ch8/ch8-GROUPING.sql | UTF-8 | 275 | 3.109375 | 3 | [] | no_license | SELECT department_id DEPTID, job_id JOB,
SUM(salary) AS SUMSAL,
GROUPING(department_id) GRP_DEPT,
GROUPING(job_id) GRP_JOB
FROM employees
WHERE department_id < 50
GROUP BY ROLLUP ( department_id, job_id ) ;
| true |
dbf9df7bd5980c4e5ec66381a2e8cd2d5898112e | SQL | arthurxiaohz/ic-card | /j-hi-resource/DbScripts/MSSQL/menu.sql | UTF-8 | 988 | 3.125 | 3 | [] | no_license | if exists (select * from sysobjects where id = object_id(N'HiMenu') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table HiMenu
--
CREATE TABLE HiMenu (
id int IDENTITY (1, 1) NOT NULL ,
version int NOT NULL ,
menuName nvarchar (100) NOT NULL,
displayRef nvarchar (200) NULL,
description nva... | true |
9110ec10a38e75b94e72af07a3f24fa2c7b81863 | SQL | diemarc/keranaProject | /_resources/querys/system/1.1_get_mca_user.sql | UTF-8 | 273 | 3.46875 | 3 | [] | no_license | SELECT A.*,B.module,C.controller,D.action_name
FROM sys_acl_user_action A
INNER JOIN sys_modules B ON (A.id_module = B.id_module)
INNER JOIN sys_controllers C ON (A.id_controller = C.id_controller)
INNER JOIN sys_actions D ON (A.id_action = D.id_action)
WHERE A.id_user = 3 | true |
4a4e0d9fda8f8b53400dde3cc9880bd3184eee2e | SQL | nb18411/ESS2014_PizzaDelivery | /Database/pizzadelivery.sql | UTF-8 | 4,916 | 3.109375 | 3 | [] | no_license | --------------------------------------------------------
-- DDL for Table ORDERS
--------------------------------------------------------
CREATE TABLE "ENG_F05MQD"."ORDERS"
( "USERID" NUMBER,
"PIZZAID" NUMBER,
"DATEOFORDER" DATE,
"ISFINISHED" NUMBER DEFAULT 0
) SEGMENT CREATION DEFERRED
PCTFREE 10 P... | true |
3891d68b0156d096a8bdeb8c02b28682ee00c411 | SQL | Suterna/UPOPET | /upopet.sql | UTF-8 | 4,919 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 27-02-2020 a las 22:40:10
-- Versión del servidor: 10.4.8-MariaDB
-- Versión de PHP: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... | true |
85916ecfea0ba27fcc224c5fbf417f32686a5e04 | SQL | vaflia/oracle_scripts | /колво домов по статистике.sql | WINDOWS-1251 | 771 | 3.0625 | 3 | [] | no_license | ---
for c in
(select distinct reu from statistics_trest t where t.mg='201208')
loop
update prep.statistics_trest t set t.cnt_houses=(select count(*) from
( select distinct reu, kul ,nd from kart where psch <> 9 ) a where a.reu=t.reu)
where t.mg='201208' and rownum=1
and reu='72';
end l... | true |
26f8fc6e8d5775722e7d7a516cfddfc72112f3d7 | SQL | Nguyenphuquy005/KHCG_Repository | /CodeGymReoisitory/My_SQL/Atrung_BT/creaate.sql | UTF-8 | 1,312 | 3.640625 | 4 | [] | no_license | create database first_database ;
use first_database ;
create table Categories(
Id int primary key auto_increment not null ,
Name nvarchar(50) unique not null,
Description nvarchar(500)
) ;
create table Suppliers(
Id int primary key auto_increment not null ,
Name nvarchar(100) not null,
Email varchar(50) not... | true |
46c0a7fb42c1075b6649343983f73d7c9296178c | SQL | AdriJonhson/rest-aspnet | /RestWithAspNET/db/migrations/V11__Alter_Table_Books.sql | UTF-8 | 137 | 2.875 | 3 | [] | no_license | ALTER TABLE books
ADD COLUMN category_id bigint(20);
ALTER TABLE books
ADD FOREIGN KEY (category_id) REFERENCES categories(id);
| true |
79f5d94c7224b5d9567fd2817b85fa832717de87 | SQL | klkirstyleeskl/cinema_many_to_many_homework_7_12_18 | /db/cinema.sql | UTF-8 | 408 | 3.4375 | 3 | [] | no_license |
DROP TABLE tickets;
DROP TABLE customers;
DROP TABLE films;
CREATE TABLE films(
id SERIAL8 PRIMARY KEY,
title VARCHAR(255),
price DECIMAL(18, 2)
);
CREATE TABLE customers(
id SERIAL8 PRIMARY KEY,
name VARCHAR(255),
funds DECIMAL(18, 2)
);
CREATE TABLE tickets(
id SERIAL8 PRIMARY KEY,
customer_id INT8 REFERENCES ... | true |
05113066fee36631b2f43aec598043d38f149f41 | SQL | pixel786/Murach-End-of-Chapter-Solutions | /EOC-ch7.sql | UTF-8 | 3,728 | 4.4375 | 4 | [] | no_license | -- Zainab Sherani
-- Date Completed: 03-31-20
-- Purpose: End of Chapter Practice Problems
-- Q1
-- vendors join invoices using (vendor_id)
-- retrieve the vendors that have invoices
select distinct vendor_name
from vendors join invoices using (vendor_id)
order by vendor_name;
-- rewritten as
select distinct vend... | true |
3547b45aedf10ab799276862e9320255906ebd6e | SQL | IANCA-SA/Customizacion_Ianca | /SQL/postgreSQL/09032011_update.sql | UTF-8 | 1,761 | 2.578125 | 3 | [] | no_license | select * from c_region where c_country_id = 339
update c_location set c_region_id = 490 where c_region_id = 1000010;
update c_location set c_region_id = 493 where c_region_id = 1000008;
update c_location set c_region_id = 491 where c_region_id = 1000005;
update c_location set c_region_id = 471 where c_region_id = 100... | true |
dbe99ecff3a1c4d45c6b90c21db45474a491412d | SQL | nugeat23/workspace | /02.mariadb/06/ex06_index.sql | UTF-8 | 158 | 2.828125 | 3 | [] | no_license | create index idx_employees_first_name
on employees(first_name);
show index from employees;
-- INDEX 삭제
drop index idx_employees_first_name on employees; | true |
57c94fcd013b07671c12dabad96de9ae771a4523 | SQL | Mayfieldlab/FunctionalTraitDB | /SQLite_Database/Example_SQLite_R_Code/example queries.sql | UTF-8 | 1,459 | 3.84375 | 4 | [] | no_license | ---------------------------------------------
-- Mayfield Lab Functional Trait database
-- example queries
---------------------------------------------
-- Summary table of project, field season and traits
select projects.project_id, researcher, email, site, trait_summary.fs_id, year, crew_list, traits from proje... | true |
7e3762c227804bf947a3f9f0b1900dafb71533e7 | SQL | MwlLj/sqlite2cpp | /example_sql/user_info.sql | UTF-8 | 1,969 | 3.734375 | 4 | [] | no_license | #namespace user_info
#create tables
/*
create table if not exists user_info(
id integer primary key autoincrement,
username varchar(32),
userage int
);
create table if not exists user_info(
id integer primary key autoincrement,
username varchar(32),
userage int
);
*/
#end
#create tables
/*
create table if not ... | true |
af1d851d460a550f251a0868eecec334e8827d43 | SQL | zzzzzzzzzzzzz/MIPT-educational | /mssql university course/8/доп2.sql | WINDOWS-1251 | 355 | 3.046875 | 3 | [] | no_license | /* 2
*/
SELECT VIEW_NAME, TABLE_NAME FROM
INFORMATION_SCHEMA.VIEW_TABLE_USAGE, sysobjects s1, sysusers
WHERE s1.xtype='V'
AND sysusers.[name] = CURRENT_USER AND s1.uid = sysusers.uid; | true |
0d6025856fcdd8a8d27894db3f61d3831f832d44 | SQL | spillz-dxb/iotan-core | /db/iotus-populate-lucene.cql | UTF-8 | 6,688 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | /**
* Populate tables for test purposes
Experiments with lucene based schema
*/
// Note: this is now obsolete and was incorporated into the main file iotus-populate.cql
USE iotus;
// ---------------------------------
// --- nodes for test-project
// ---------------------------------
INSERT INTO node (id, crea... | true |
63e9df4ee16abe7c5ebb1707651cd8a5ef5181cb | SQL | 2544662969/Mybatis | /src/com/zhjg/mybatis/sql/sys_role.sql | UTF-8 | 851 | 2.78125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50553
Source Host : localhost:3306
Source Database : mybatis
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2016-12-20 11:30:48
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... | true |
51d8bcf06482fd5e22ec03e4c696f5374e8d791d | SQL | Rendanic/SQL-Zauberkasten | /sql/parameter/spparameter.sql | UTF-8 | 394 | 3.015625 | 3 | [] | no_license | --
-- Thorsten Bruhns (Thorsten.Bruhns@opitz-consulting.de)
-- $Id: spparameter.sql 121 2010-06-21 14:17:48Z tbr $
--
-- Displays all Parameters from SPFILE
--
prompt ID = Instance-ID
set pages 1000
set lines 120
set trimspool on
set verify off
column id format 99
column name format a30
column value format a70
sele... | true |
6ab8d668f768607507f47a1969fabc39278ec120 | SQL | gbhl/bhl-us | /Database-BHL/annotation/Stored Procedures/AnnotationNoteSelectAuto.sql | UTF-8 | 743 | 3.21875 | 3 | [] | no_license |
-- AnnotationNoteSelectAuto PROCEDURE
-- Generated 12/15/2010 3:05:49 PM
-- Do not modify the contents of this procedure.
-- Select Procedure for AnnotationNote
CREATE PROCEDURE annotation.AnnotationNoteSelectAuto
@AnnotationNoteID INT
AS
SET NOCOUNT ON
SELECT
[AnnotationNoteID],
[AnnotationID],
[NoteText]... | true |
15c7f66e8cc0d2650b61fb65dc4fd4460ba4e135 | SQL | MyoThantAung/Freelancer | /SQLQuery1.sql | UTF-8 | 311 | 3.03125 | 3 | [] | no_license | select [user].profile,[user].name,[user].phone_no,[user].email,job.title,bids.amount,contract.finish_date,contract.payment_status
from [user]
inner join job on [user].user_Id=job.empr_id
inner join bids on job.job_id = bids.job_id
inner join contract on bids.bids_id = contract.bids_id
where bids.empe_id = 2 | true |
8e63bcf829bcd2a629bf8f549651b0d4ed5ef0dd | SQL | bylymka/job-search-project | /src/main/resources/db/initDb.sql | UTF-8 | 2,446 | 3.78125 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS users(
id BIGINT NOT NULL AUTO_INCREMENT,
username VARCHAR(45) NOT NULL,
password VARCHAR(100) NOT NULL,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
email VARCHAR(255),
phone_num VARCHAR(20),
is_banned TINYINT(1) DEFAULT 0x00,
UNIQUE(username),
PRIMARY KEY(id... | true |
076c723d60fa164b9df05a604acf4a258c384e14 | SQL | segovialori/database-exercises | /where_exercises.sql | UTF-8 | 3,669 | 4.15625 | 4 | [] | no_license | #Create a file named where_exercises.sql. Make sure to use the employees database.
select *
from employees
where
(hire_date like '%12-17'
or
birth_date like '12-17')
and not
(hire_date like '12-17'
and
birth_date like '12-17');
#In operator allows us to chain together a whole bunch of "ors"
#show me the e... | true |
e5c2d06ca873e6a1658d50a86d88327ab56a0702 | SQL | Honey256/SimpleSpringKotlinApp | /src/main/resources/data.SQL.scripts/00000000_security_init.sql | UTF-8 | 1,661 | 3.9375 | 4 | [] | no_license | CREATE TABLE table_user(
id NUMERIC(38) NOT NULL PRIMARY KEY,
username VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL
);
COMMENT ON TABLE table_user is 'Таблица для хранения пользователей';
COMMENT ON COLUMN table_user.username is 'Системное имя пользователя';
COMMENT ON COLUMN table_user.password is 'Пар... | true |
efb9e04a34f6683bc88b842e49d39dc44bf7947c | SQL | Jinn42/SQL | /WorldWideImporter/Sales-14-ByQuarters.sql | UTF-8 | 645 | 4.0625 | 4 | [] | no_license | /*
Q7: Sales Report by Quarters for 2014
*/
select
SUM(
CASE WHEN DATEPART(quarter, I.InvoiceDate) = 1
THEN IL.Quantity* IL.UnitPrice
END
) SalesQ1,
SUM(
CASE WHEN DATEPART(quarter, I.InvoiceDate) = 2
THEN IL.Quantity* IL.UnitPrice
END
) SalesQ2,
SUM(
CASE WHEN DATEPART(qu... | true |
d7d421e8ce549a0a3f61bc141826add4eec28b85 | SQL | svenkataramani/hdp-oc-team-dataprovider | /Test.sql | UTF-8 | 867 | 2.75 | 3 | [] | no_license |
CREATE TABLE hdp_oc_team.domain_parent_resource
(
domain_id int,
domain_name string,
parent_resource_id int,
unique_id string,
gdshop_product_typeid string,
add_on_resource_id int,
order_date ... | true |
3a4c2297e5675fe893449db60c53ca54835888eb | SQL | ameenah/kafala | /completeDB.sql | UTF-8 | 13,038 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 29, 2016 at 05:13 PM
-- Server version: 5.5.8
-- PHP Version: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SE... | true |
e3483e432a2c77ca0cfcbf94acd7b5457ad1dc02 | SQL | elgoher/heippimetrics_demo | /DB_V2_HeippiMetricsDemo.sql | UTF-8 | 4,546 | 3.421875 | 3 | [] | no_license | /*
SQLyog Enterprise - MySQL GUI v6.5
MySQL - 5.5.28 : Database - heippianalyticsdemo
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!401... | true |
ff45da9ea9ed418c4c8a200304c1ac22607369b8 | SQL | harikesh409/javaee | /JPA with Hibernate/src/main/resources/data.sql | UTF-8 | 1,944 | 2.65625 | 3 | [
"MIT"
] | permissive | insert into course(id, name, created_date, last_updated_date,is_deleted)
values(10001,'JPA in 50 Steps', sysdate(), sysdate(),false);
insert into course(id, name, created_date, last_updated_date,is_deleted)
values(10002,'Spring in 50 Steps', sysdate(), sysdate(),false);
insert into course(id, name, created_date, last... | true |
9ea257a30e709a0f2339ef7a65ae2a77ce04c5e1 | SQL | meridianww/M4PLBase | /QA/Database/Scripts/Backup_Script/Sprint 153/49904_ScriptToUpdateStatusAndInsert.sql | UTF-8 | 869 | 2.671875 | 3 | [] | no_license | If NOT EXISTS (SELECT 1 FROM SYSTM000Ref_Options WHERE SysOptionName = 'All' And SysLookupCode = 'Status')
BEGIN
INSERT INTO dbo.SYSTM000Ref_Options (SysLookupId, SysLookupCode, SysOptionName, SysSortOrder, SysDefault, IsSysAdmin, StatusId, DateEntered, EnteredBy, DateChanged, ChangedBy)
VALUES (39, 'Status', 'All', 1,... | true |
930f7b842d89077b2078fb4d0c892dfd223906e4 | SQL | bellmit/origin | /family_order/sql/TI_B_SYNCHINFO/INC_TI_7_ALL_USER.sql | UTF-8 | 1,497 | 2.703125 | 3 | [] | no_license | INSERT INTO TI_B_USER_MPUTE (SYNC_SEQUENCE,MODIFY_TAG,TRADE_ID,PARTITION_ID,USER_ID,MPUTE_MONTH_FEE,MPUTE_DATE,RELATION_TRADE_ID,START_DATE,END_DATE,UPDATE_TIME,UPDATE_STAFF_ID,UPDATE_DEPART_ID,REMARK,RSRV_NUM1,RSRV_NUM2,RSRV_NUM3,RSRV_NUM4,RSRV_NUM5,RSRV_STR1,RSRV_STR2,RSRV_STR3,RSRV_STR4,RSRV_STR5,RSRV_DATE1,RSRV_DAT... | true |
5c1e610fb391c7082e35e04a4ba8a2b7dc15db77 | SQL | Stefanny99/fudebiol-digital | /SCRIPTS/nombres-comunes.sql | UTF-8 | 5,295 | 2.96875 | 3 | [
"MIT"
] | permissive | CREATE DATABASE IF NOT EXISTS `bd_fudebiol_digital` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `bd_fudebiol_digital`;
-- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: bd_fudebiol_digital
-- ---------------------------------------------------... | true |
93a4567b564676c97108c60adc35bfe9649b830e | SQL | DDimitrova90/C-Sharp-Databases-Basics | /7-Functions-Triggers-And-Transactions/08_Delete-Employees-And-Departments.sql | WINDOWS-1251 | 2,408 | 4 | 4 | [] | no_license | BEGIN TRANSACTION
ALTER TABLE Employees
DROP CONSTRAINT [FK_Employees_Employees]
ALTER TABLE Departments
DROP CONSTRAINT [FK_Departments_Employees]
ALTER TABLE EmployeesProjects
DROP CONSTRAINT [FK_EmployeesProjects_Employees]
UPDATE Employees
SET ManagerID = NULL
WHERE ManagerID IN (SELECT e.Emplo... | true |
e2203483adc97936f2cb75c3535ed2edac3fe629 | SQL | AshutoshChoubey/laravelGst | /databaseBk/gst_laravel (0).sql | UTF-8 | 50,713 | 2.921875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 02, 2019 at 01:23 PM
-- Server version: 10.1.33-MariaDB
-- PHP Version: 7.2.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
06393249cbab13cb53c7c8d334ec0370052190fd | SQL | Peter00007/AviaTicketsWebApp | /src/main/resources/db/1.sql | UTF-8 | 598 | 4.28125 | 4 | [] | no_license | create table route_price (
id INT not null,
name varchar(100) not null,
price double,
primary key(id)
)
insert into route_price (id, name)
select * from routes;
update route_price
set price = (
select sum(price) from tickets where id in (
select ticket_id from flights_tickets where flight_id in (
select id from fligh... | true |
507fde7d4da470dbcbb63c876287de633e7a9770 | SQL | DavidMasschmann/Codes | /SQL/Atividades BD1/atividade 30.05.sql | UTF-8 | 4,733 | 4.15625 | 4 | [] | no_license | /*
Esquema usado para exemplos:
Fornecedor (Fcod, Fnome, Status, Cidcod#, fone)
Cidade (Ccod, Cnome, uf)
Peca (Pcod, Pnome, Cor, Peso, Ccod#)
Projeto (PRcod, Jnome, Ccod#)
Fornecimento (Fcod#, Pcod#, PRcod#, Quantidade)
*/
--1 Criar todas as tabelas do esquema
CREATE TABLE Cidades
(
CodCid INTEGER NOT NULL,
N... | true |
adc8b7730ba2623f70a128fac5402d568469476d | SQL | rkfka0419/public | /universitySQL/createViewDeptSize.SQL | WINDOWS-1252 | 179 | 2.8125 | 3 | [] | no_license | create view deptsize(dept, stnum)
as select dept, count(*)
from student
group by dept;
select * from deptsize;
select * from deptsize where dept ='ǻ';
| true |
7c3978cdfe2449184f8df49ef6103be661417e4f | SQL | patrickvanreck/Cheatsets | /deprecated/mysql-crud.sql | UTF-8 | 6,001 | 3.359375 | 3 | [] | no_license | <?php
$host = "localhost";
$username = "fabrigeas";
$password = "98919032";
$database ="serverseitigeanw";
// Create connection
$conn = new mysqli($host, $username, $password);
// Check connection
if ($conn->connect_error)
die("Connection failed: " . $conn->co... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.