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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
13ff254b32ab7f0a92a333f855bb96b826314faa | SQL | aarjav89/SQL-Project-AJ | /Task2/Task2.sql | UTF-8 | 3,177 | 4.34375 | 4 | [] | no_license |
use task2;
/*
TASK 2
------------
1. Your Instructor has given you four files that came from an obsolete database and it is your job to migrate this data into a sql server database.
Once the data is added to sql server you need to check the data and setup the relationships between the tables.
*/
Answer :
1.Right c... | true |
955a6a742e9c09f4f4231b319e8617fda9d52a36 | SQL | jbmedalla2/apc-webprog-ecsit-jbmedalla | /basic/test.sql | UTF-8 | 3,361 | 3.3125 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 04, 2017 at 05:14 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
ee8d72f03dd145796f8be65fe755fd80c39dde8b | SQL | nss-evening-cohort-3/learning-sql-individual-assignment-bernardanderson | /15.sql | UTF-8 | 275 | 3.328125 | 3 | [] | no_license | -- Provide a query that shows the total number of tracks in each playlist. The Playlist name should be include on the resulant table.
SELECT pl.Name, Count(plt.PlaylistId) FROM Playlist pl JOIN PlaylistTrack plt WHERE plt.PlaylistId == pl.PlaylistId GROUP BY plt.PlaylistId; | true |
f10a97fc44ca7a80cca7da4d87d0b8317ce74c17 | SQL | whchi/too-young-too-naive | /articles/articles.sql | UTF-8 | 1,937 | 3.125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50625
Source Host : 127.0.0.1:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50625
File Encoding : 65001
Date: 2015-11-13 14:46:32
*/
use test;
SET FOREIGN_KEY_CHECKS=0;... | true |
6aa2d72e71237b2ce3341bc2fa81dc3e962224ff | SQL | EanDalin0012/onlinecode | /bin/main/db/QuickDBD-e-commers-version1.sql | UTF-8 | 4,842 | 3.109375 | 3 | [] | no_license | -- Exported from QuickDBD: https://www.quickdatabasediagrams.com/
-- Link to schema: https://app.quickdatabasediagrams.com/#/d/MTT7P8
-- NOTE! If you have used non-SQL datatypes in your design, you will have to change these here.
CREATE TABLE "main_category" (
"id" int NOT NULL,
"name" varchar(225) NOT N... | true |
4033741a02e2c0789e4862b254fe67d0c4d77813 | SQL | jiezhigang/k8s_linkerd2_docker_build | /src/main/resources/db/init1.0.sql | UTF-8 | 1,177 | 2.75 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Version : 50723
Source Host : 127.0.0.1:3306
Source Database : NSPM
Target Server Type : MYSQL
Target Server Version : 50723
File Encoding : 65001
Date: 2019-01-03 16:18:45
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... | true |
baa93b6a82654a890ee1dfc85f3909243dd7568d | SQL | L1ya1ya/studytask | /Task8/baidunews/news.sql | UTF-8 | 1,790 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2016-11-05 15:44:47
-- 服务器版本: 10.1.13-MariaDB
-- PHP Version: 5.6.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40... | true |
0e995db16afbe143bde5d62950c7e89f8ae9c0ec | SQL | skadinyo/datacatalog-connectors-rdbms | /google-datacatalog-postgresql-connector/src/google/datacatalog_connectors/postgresql/config/metadata_query.sql | UTF-8 | 1,332 | 3.875 | 4 | [
"Apache-2.0"
] | permissive | SELECT t.schemaname AS SCHEMA_NAME,
t.tablename AS table_name,
CASE
WHEN ns.oid = pg_my_temp_schema() THEN 'LOCAL TEMPORARY'::text
WHEN pc.relkind = 'r'::"char" THEN 'BASE TABLE'::text
WHEN pc.relkind = 'v'::"char" THEN 'VIEW'::text
WHEN pc.relkind = 'f'::"char" THEN 'FOREIGN TABLE'::text
... | true |
0931126b3c6371f862e980e9423abf9f0bbb040f | SQL | kaiservog/atsixsix | /scripts.sql | UTF-8 | 707 | 2.875 | 3 | [] | no_license | create table comment (
id integer PRIMARY KEY,
lat NUMERIC(14, 11) NOT NULL,
lon NUMERIC(14, 11) NOT NULL,
comment_time timestamp NOT NULL,
text VARCHAR(255) NOT NULL
);
CREATE SEQUENCE comment_id START 1000;
CREATE INDEX lat_lon ON comment (lat, lon);
--DB version 2
alter table comment add column nick VAR... | true |
e21ce1dcf5ff48f1e60cc66006e31cd5b721db32 | SQL | triggoai/dbt_mailchimp_source | /models/stg_mailchimp__segment_members.sql | UTF-8 | 578 | 3.1875 | 3 | [
"Apache-2.0"
] | permissive | {{ config(enabled=var('mailchimp_using_segments', True)) }}
with base as (
select *
from {{ ref('stg_mailchimp__segment_members_tmp') }}
),
fields as (
select
{{
fivetran_utils.fill_staging_columns(
source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp_... | true |
f08813c7f69c63bedcf61785288f638c365754e3 | SQL | ketrin38/DS_LetiskoveParkovisko | /E _Letiskove_parkovisko/procedura-all.sql | WINDOWS-1250 | 5,689 | 3.90625 | 4 | [] | no_license |
--###################################################################################################################################
-- Procedura vypise faktura za dane csove obdobie spolu s cenami a datumami
create or replace PROCEDURE procedure_get_faktura
(p_preukaz IN NUMBER, p_date_from IN DATE, p_date_to IN... | true |
ad827070b9f6b6d3be8e2f5115ba04695ea2ab44 | SQL | aboulie/bamazon | /bamazon_db.sql | UTF-8 | 966 | 3.21875 | 3 | [] | no_license | CREATE DATABASE bamazon_db;
USE bamazon_db;
CREATE TABLE products
(
id int NOT NULL AUTO_INCREMENT,
productName VARCHAR(255) NOT NULL,
departmentName VARCHAR(100) NOT NULL,
price VARCHAR(30)NOT NULL,
stockQuantity VARCHAR(30)NULL,
PRIMARY KEY (id)
);
INSERT INTO products (id, productName, departmentName... | true |
4b2bcc5cffd45320a23f666597950aad7c84095d | SQL | dev-bloke/examples | /java/itunes-library/src/main/sql/create.sql | UTF-8 | 824 | 3.078125 | 3 | [] | no_license | create database if not exists recordings default character set utf8;
grant all on recordings.* to 'recordings'@'%' identified by 'r3c0rd1ng5';
flush privileges;
use recordings;
create table if not exists recording (
id int primary key not null auto_increment,
title varchar(255),
artist varchar(255),
year in... | true |
b7621a663415d88b3ebc85fca7c759c527fd1061 | SQL | ytatus94/Leetcode | /SQL/1193_Monthly_Transactions_I.sql | UTF-8 | 710 | 4.09375 | 4 | [] | no_license | # 方法 1.
# Write your MySQL query statement below
SELECT
LEFT(trans_date, 7) AS month,
country,
COUNT(id) AS trans_count,
SUM(IF(state = 'approved', 1, 0)) AS approved_count,
SUM(amount) AS trans_total_amount,
SUM(IF(state = 'approved', amount, 0)) AS approved_total_amount
FROM Transactions
GROUP... | true |
55f3de5b975ad7b30524c3f803585189fd3f0403 | SQL | fariswidhi/larashop | /shop (2).sql | UTF-8 | 26,059 | 3.125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 17, 2017 at 12:40 AM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
1da3ad40d6bdae4d89951783ff63133bfebced6f | SQL | murari-goswami/bi | /ETL/DataVirtuality/views/bi/bi.stock_reconciliation.sql | UTF-8 | 834 | 3.828125 | 4 | [] | no_license | -- Name: bi.stock_reconciliation
-- Created: 2015-04-24 18:17:42
-- Updated: 2015-04-24 18:17:42
CREATE VIEW bi.stock_reconciliation AS
SELECT
c.date,
se.sku,
se.quantity,
CASE WHEN dd.docdata_quantity is null THEN 0 ELSE dd.docdata_quantity END as docdata_quantity,
CASE
WHEN se.quantity !=
CASE WHEN dd.d... | true |
79e1a7eea08b5ee4bb795a07a629b8e26cadb3fd | SQL | sql2/pgsql-example | /vaccum/common_tbl.sql | UTF-8 | 382 | 2.609375 | 3 | [] | no_license | DROP TABLE IF EXISTS tbl;
CREATE TABLE tbl( col1 INT, col2 INT );
ALTER TABLE bloat_tbl SET (autovacuum_enabled = true);
INSERT INTO tbl
SELECT generate_series, generate_series
FROM generate_series(1, 100000);
\dt+ tbl
UPDATE tbl SET col2 = col2 + 1;
\dt+ tbl
UPDATE tbl SET col2 = col2 + 1;
\dt+ tbl
--VACUUM V... | true |
3066cb6a0cd6e19c6f63f19d06ef446a52c527bb | SQL | iced-americano/hyundai-marketing-kpis | /models/vlpvdp_floodlights.sql | UTF-8 | 500 | 2.53125 | 3 | [] | no_license | SELECT placement
, ds
, SUM(search_inventory_page_vlp_vdps) AS search_inventory_page_vlp_vdps /* This should be updated with the new floodlight name. */
, SUM(model_detail_page_vlp_vdps) AS model_detail_page_vlp_vdps /* This should be updated with the new floodlight name. */
, SUM(vehicle_detail_page_vl... | true |
21e51e840d58dd7e95e1a6201795fbd59f9904cd | SQL | basedosdados/mais | /bases/br_me_socios/socio/publish.sql | UTF-8 | 1,460 | 3.53125 | 4 | [
"MIT"
] | permissive | /*
Query para publicar a tabela.
Esse é o lugar para:
- modificar nomes, ordem e tipos de colunas
- dar join com outras tabelas
- criar colunas extras (e.g. logs, proporções, etc.)
Qualquer coluna definida aqui deve também existir em `table_config.yaml`.
# Além disso, sinta-se à vontade para alterar alg... | true |
70f63e26202c18eda8d1d9d53f58cdd986cc08ba | SQL | encolpius1965/gloss | /sql_proc/GetUserId.sql | UTF-8 | 243 | 2.59375 | 3 | [] | no_license | CREATE DEFINER=`root`@`%` FUNCTION `GetUserId`(__login varchar(255), __password varchar(255)) RETURNS int(11)
BEGIN
SET @UserId = ifnull(
(SELECT USER_ID FROM USER WHERE LOGIN=__login AND _PASSWORD= MD5(__password)),0);
RETURN @UserId;
END | true |
2340fe66e34592938595aec599128944c2b6dc5f | SQL | PaxAuz15/tests | /Talentuum-Healthatom/Challengue3/answer.sql | UTF-8 | 1,288 | 4.34375 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS `persons` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`nombre` VARCHAR(255) NOT NULL,
PRIMARY KEY(`id`)
)
INSERT INTO persons (id, nombre) VALUES (1,'Luis Auz'),(2,'Antonio García'),(3,'Mariuxi Casquete'),(4,'Brayan Cantos'),(5,'Brangy Castro'),(6,'Zully Cedeño'),(7,'Karla Palma'),(8... | true |
ba40e6d82d3e2c7bdb78bf56a198606d40b24752 | SQL | AndrewKhitrin/antlr_psql | /src/test/resources/sql/explain/e62468b1.sql | UTF-8 | 198 | 2.859375 | 3 | [
"MIT"
] | permissive | -- file:partition_join.sql ln:300 expect:true
EXPLAIN (COSTS OFF)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1 RIGHT JOIN prt2_l t2 ON t1.a = t2.b AND t1.c = t2.c WHERE t2.a = 0 ORDER BY t1.a, t2.b
| true |
e4210620f630fe6a0e831441598524b98c8cb8be | SQL | bzmctl/mysql | /第十五章 用户安全管理.sql | UTF-8 | 13,934 | 3.640625 | 4 | [] | no_license | /*----------第十五章 用户安全管理---------------*/
/*
15.1 权限表
15.1.1 user表
use mysql;
desc user;
1.用户列
其中Host和user为主键
2.权限列
3.安全列
4.资源控制列
15.1.2 db表
desc mysql.db;
15.1.3 table_priv表和columns_priv表
desc tables_priv;
desc columns_priv;
15.1.4 procs_priv表
desc procs_priv;
15.2 账户管理
15.2.1 登陆和退出MySQL服务器
mysql -h hostname|hostIP -... | true |
4c23068c321ec0343f5b3cd49a912c58b4676858 | SQL | andreacannata/BD2 | /OLAP/schema_relazionale.sql | UTF-8 | 15,648 | 2.84375 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.2
-- Dumped by pg_dump version 9.5.2
-- Started on 2016-05-12 15:43:06 CEST
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_mess... | true |
0adddc9c730adeca47438cf0732ca22e7b500f1c | SQL | HananAbdelwahab/CPSC_476 | /project_3/schema.cql | UTF-8 | 869 | 4 | 4 | [] | no_license | drop keyspace if exists mt_api;
create keyspace mt_api
with replication = {
'class' : 'SimpleStrategy',
'replication_factor' : 3
};
use mt_api;
drop table if exists mt_api.user;
create table user (
user_id uuid,
username text,
email text,
pw_hash text,
primary key (username, user_id)
);
drop ta... | true |
fbb7ab85299687e341835b9bd703ea5c32bfb540 | SQL | aiemelyanov/RedGate | /TEST3/APEX_030200/Views/APEX_APPLICATION_PAGE_BRANCHES.sql | UTF-8 | 9,155 | 3.09375 | 3 | [] | no_license | CREATE OR REPLACE FORCE VIEW apex_030200.apex_application_page_branches (workspace,application_id,application_name,page_id,page_name,branch_action,branch_point,when_button_pressed,branch_type,process_sequence,condition_type,condition_expression1,condition_expression2,save_state_before_branch,build_option,authorization_... | true |
6b84f05bbab1637a6e27129ada7cfeba247f2725 | SQL | am-b/testv4 | /Testv3 tables/Queries.sql | UTF-8 | 1,138 | 3.40625 | 3 | [] | no_license | use Testv3
SELECT COUNT(*) AS "TOTAL Number of Questions Related to PHYSICAL"
FROM Answers
INNER JOIN Questions
ON Answers.QuestionID=Questions.QuestionID
WHERE Answers.UserID = 'cf86c4c8-85f8-40b2-be8e-f15891d573d4'
AND Questions.QuestionTag = 'Physical'
SELECT COUNT(*) AS "Number of AGREE(Positive) in PHYSICAL"
FR... | true |
9a341f9a212b0d0750526f5e1b200ea6a57c59c3 | SQL | bgoonz/UsefulResourceRepo2.0 | /_MY_ORGS/Web-Dev-Collaborative/blog-research/database/pg-admin/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configurations/sql/default/create.sql | UTF-8 | 737 | 3.015625 | 3 | [
"MIT"
] | permissive | {# CREATE FTS CONFIGURATION Statement #}
{% if data and data.schema and data.name %}
CREATE TEXT SEARCH CONFIGURATION {{ conn|qtIdent(data.schema, data.name) }} (
{% if 'copy_config' in data and data.copy_config != '' %}
COPY={{ data.copy_config }}
{% elif 'prsname' in data and data.prsname != '' %}
PARSER = {{... | true |
aee67496d60ad7e3c5c01c5bb9a39882b2b6a3dd | SQL | boretobg/CSharp-MSSQL | /AdditionalExercises/01_NumberOfUsersForEmailProvider.sql | UTF-8 | 218 | 3.328125 | 3 | [] | no_license | SELECT
RIGHT(Email, LEN(Email) - CHARINDEX('@', Email)) AS EmailProvider,
COUNT(Id) AS NumberOfUsers
FROM Users
GROUP BY RIGHT(Email, LEN(Email) - CHARINDEX('@', Email))
ORDER BY NumberOfUsers DESC, EmailProvider | true |
08fd8889c3b9d446a40b98c676a6994e16f64778 | SQL | eideo/ioss | /dbscripts/kb_ods_itsm_dealinfo.sql | UTF-8 | 1,327 | 3.078125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : gzw
Source Server Version : 50711
Source Host : localhost:3306
Source Database : ioss
Target Server Type : MYSQL
Target Server Version : 50711
File Encoding : 65001
Date: 2016-07-20 17:41:10
*/
SET FOREIGN_KEY_CHECKS=0;... | true |
5c7c3ce9a4c6a7f964c44abf8307d999c2ae0234 | SQL | fastcatch/Szelmero | /doc/adatok_beillesztese_sema.sql | UTF-8 | 97 | 2.546875 | 3 | [] | no_license | insert into cel_tabla c
select * from temp_tabla t
where t.at not in (select at from cel_tabla2); | true |
a95676a4266587f014f88890a48d51e6aff234df | SQL | cdesmarais/WebDB-Test | /WebDB/StoredProcedures/Common/dbo.procLogProcedureError.PRC | UTF-8 | 718 | 3.171875 | 3 | [] | no_license | if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[procLogProcedureError]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[procLogProcedureError]
GO
CREATE Procedure dbo.procLogProcedureError
@ErrorID int,
@ProcName nvarchar(2000),
@Action nvarchar(3000),
@DBError nvarchar(100... | true |
fe97adbefff8614a76df77cae6f8088fb27d46bc | SQL | jmone/swordfish | /docs/category.sql | UTF-8 | 2,098 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.8
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2013 年 07 月 08 日 00:16
-- 服务器版本: 5.5.28
-- PHP 版本: 5.3.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET... | true |
a67409347b21f2fe40039d14021c7fd21095e41c | SQL | armdev/vertx-jsf-integration | /vertx-backend/src/main/resources/db.sql | UTF-8 | 1,541 | 3.109375 | 3 | [] | no_license | /*
SQLyog Ultimate v9.50
MySQL - 5.5.5-10.1.13-MariaDB : Database - superchat
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KE... | true |
035dcbb17118203a542184db660e2f982c1e9f68 | SQL | josiemerson/libshare | /project_files/database/database_create.sql | UTF-8 | 5,918 | 3.5625 | 4 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema libshare
... | true |
3196e87b5b0aaf2467003290899de04d34b3385e | SQL | jegan97/IssueTracker | /it.sql | UTF-8 | 6,355 | 3.484375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 22, 2017 at 02:35 AM
-- Server version: 5.7.9
-- PHP Version: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
73845e2b1ba6b72c0783f2295bdfd830b2d35e66 | SQL | dzlatarov/CSharp-DB-September-2019 | /MS SQL - September 2019/02.EXERCISE BASIC CRUD/14.FindAllEmployeesExceptMarketing.sql | UTF-8 | 73 | 2.5625 | 3 | [] | no_license | SELECT FirstName, LastName
FROM Employees
WHERE DepartmentID NOT IN (4) | true |
89006a80f2a9e6abc9a42ced6452a9640828405a | SQL | kilex/twidel | /dump.sql | UTF-8 | 2,449 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.7
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Апр 19 2012 г., 22:39
-- Версия сервера: 5.1.61
-- Версия PHP: 5.2.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_R... | true |
f524b942887dbb77163ecc8cd8c19a8878afa2ad | SQL | wemitchell3/LugNutz | /LugNutz.sql | UTF-8 | 1,346 | 3.171875 | 3 | [] | no_license | CREATE TABLE `users`
(
`id` int PRIMARY KEY,
`userName` varchar(255),
`email` varchar(255),
`password` varchar(255),
`phoneNumber` numeric
);
CREATE TABLE `messages`
(
`id` int PRIMARY KEY,
`user_id` int,
`messageTimeStamp` datetime,
`message` varchar(255)
);
CREATE TABLE `garage`
(
`id` int PRIMA... | true |
c439047508a4b845cb961ea5807fa113247ecfc6 | SQL | SINF-FEUP/SINF-T | /beersDB/PopulateTables.sql | UTF-8 | 11,863 | 2.546875 | 3 | [] | no_license | /*******************************************************************************
Beers Database - Version 0.5
Script: PopulateTables.sql
Description: Populates the Beers database.
DB Server: PostgreSql
Author: Gil Gonçalves
License:
*********************************************************************... | true |
7dfc85cc2deb0cf552cf9c3200f24234abd59a38 | SQL | suomenriistakeskus/oma-riista-web | /scripts/database/sample-data/sql/harvest_permit_area.sql | UTF-8 | 3,848 | 4.15625 | 4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | CREATE TABLE import_harvest_permit_area (
club_official_code VARCHAR(255) NOT NULL,
external_id CHAR(10) NOT NULL,
hunting_year INT NOT NULL,
name_finnish VARCHAR(255) NOT NULL
);
CREATE TABLE import_harvest_permit_area_partner (
external_id CHAR(10) NOT NULL,
club... | true |
ffccae6ca8f13d23ab8fddcd7b62f3edd12126cf | SQL | OlafMd/MedCon1.0 | /mm-docconnect-dataimporter/DataImporter/DataImporter/DBMethods/Case/Atomic/Retrieval/SQL/cls_Get_Cases_with_Wrongfully_Transferred_BillPositions.sql | UTF-8 | 2,188 | 3.59375 | 4 | [] | no_license |
Select
hec_cas_cases.HEC_CAS_CaseID,
bil_billposition_transmitionstatuses.BIL_BillPosition_TransmitionStatusID,
hec_cas_case_billcodes.HEC_CAS_Case_BillCodeID,
hec_bil_billposition_billcodes.HEC_BIL_BillPosition_BillCodeID,
hec_bil_billpositions.HEC_BIL_BillPositionID,
hec_bil_billpositions.Ext_BIL_BillPos... | true |
3f96c86537cb2fd3a450992e79e526ffec202940 | SQL | wildgrok/sql | /create_droplogins.sql | UTF-8 | 447 | 2.53125 | 3 | [] | no_license | SET NOCOUNT ON
SELECT 'DROP LOGIN [' + loginname + ']'
FROM master.dbo.syslogins
WHERE name NOT IN ('sa')
AND name NOT LIKE ('##%')
AND isntname = 0
/*
and loginname in
(
'ANON',
'GAUTAMB',
'MLABRA',
'GLENN',
'ANTHONYB',
'ERICG',
'JOHNHU',
'ADRIANJ',
'SARAJ',
'GUSTAVOB',
'LEMARI',
'JODIK',
'OMARC',
'YJIMENEZ',
'JUST... | true |
146f17675cb8323159d3052adbba02b21b686cbf | SQL | nhachem/stitchr | /sql/collectionDDL.sql | UTF-8 | 1,251 | 3.59375 | 4 | [
"Apache-2.0"
] | permissive | CREATE TABLE
dataset_collection
(
id SERIAL NOT NULL,
name CHARACTER VARYING(64)
);
alter table dataset_collection add constraint collection_pk primary key(id);
create unique index concurrently uc_name_collection_idx on dataset_collection(name);
CREATE TABLE
dataset_collection_member
... | true |
f012263fa80b53bace4dab14342479c836543697 | SQL | leopcastro/record-shop | /docker/mysql/2-create-tables-and-seed.sql | UTF-8 | 1,017 | 3.171875 | 3 | [] | no_license | USE record-shop;
CREATE TABLE record (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(100) NOT NULL, artist VARCHAR(100) NOT NULL, price NUMERIC(8, 2) NOT NULL, released_year SMALLINT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
INSERT INTO `record-shop`.rec... | true |
8c72dd4f5c0422e440518e9891415052f71147fc | SQL | jbredow/fei-code-repository | /pl-sql/builds/gp_tracker_writer_ytd.sql | UTF-8 | 30,251 | 3.0625 | 3 | [
"MIT"
] | permissive | TRUNCATE TABLE AAE0376.GP_TRACKER_WRITER_YTD;
DROP TABLE AAE0376.GP_TRACKER_WRITER_YTD;
CREATE TABLE AAE0376.GP_TRACKER_WRITER_YTD
AS
(SELECT LINE_HIST.YEARMONTH,
LINE_HIST.REGION,
LINE_HIST.ACCOUNT_NUMBER,
LINE_HIST.WAREHOUSE_NUMBER,
LINE_HIST.KOB,
LINE_HIST.... | true |
ca0e812462d2ed3def6c950dc3f48a8b86b002b2 | SQL | mohamed572013/tawheed-group | /new tables/visa_types.sql | UTF-8 | 2,399 | 3.28125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 15, 2018 at 12:21 PM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 7.0.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
a553f2c969dabeaeddead9615d820d2e279443fc | SQL | gogastonoga/mysql_project | /selects.sql | UTF-8 | 3,552 | 4.28125 | 4 | [] | no_license | #SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
# A) Pracownicy o wieku wiekszym niz 25 lat
SELECT *
FROM worker
WHERE TIMESTAMPDIFF(YEAR, date_birth, NOW()) > 25;
# B) Pracownicy o nazwisku dlyzszym niz 7 znakow
SELECT *
FROM worker
WHERE LENGTH(surname) > 7... | true |
4e9b56efcb6a1c52d89b644cf8c7b837a012eaaa | SQL | Beryl1020/SQL | /30link/data require/data require-每日前端新单详情.sql | UTF-8 | 1,366 | 3.890625 | 4 | [] | no_license | select distinct
fa_id as 主站ID,
user_name as 用户姓名,
fia_id as 投顾ID, name as 投顾姓名,
(case when group_id =106 then 14 else group_id end) as 投顾组别,
submit_time as 流转时间,
net_assets as 激活资金
from
(select *
from
(select distinct fa_id, b.user_name, a.fia_id, c.name, c.group_id, submit_time, net_assets
fr... | true |
b99b28e774db44998dc11992cdb359f42610f418 | SQL | CUBRID/cubrid-testcases | /sql/_28_features_930/issue_11399_hash_agg/hash_agg_with_i18n/cases/HEX_group_by.sql | UTF-8 | 1,489 | 3.203125 | 3 | [
"BSD-3-Clause"
] | permissive | autocommit off;
drop if exists t;
set names utf8;
select hex('가');
create table t(col1 char(10) collate utf8_ko_cs_uca,col2 varchar(10) collate utf8_ko_cs_uca,col3 nchar(10) collate utf8_ko_cs_uca,col4 NCHAR VARYING(10) collate utf8_ko_cs_uca,col5 string collate utf8_ko_cs_uca);
insert into t values('a','a',N'a',N'a','... | true |
f300b9ca8b0c0eb5f3d51581573d77102de3ab2e | SQL | mit-ccc/census | /acs/sql/census_acs_variable.sql | UTF-8 | 533 | 2.671875 | 3 | [] | no_license | drop table if exists cortico.census_acs_variable;
create external table cortico.census_acs_variable (
variable string,
description string)
row format serde
'org.apache.hadoop.hive.serde2.OpenCSVSerde'
with serdeproperties (
'separatorChar'=',')
stored as inputformat
'org.apache.hadoop.mapred.TextInputFor... | true |
30b2e87726f42e03b75d51f43b955af03a496cbc | SQL | pgoldtho/visulate | /code/database/reclaim-sysaux.sql | UTF-8 | 8,469 | 3 | 3 | [] | no_license | column segment heading 'Segment Name' format a32
column file_name heading 'File Name' format a40
column segment_type heading 'Segment Type' format a20
select
file_name,
segment_type,
owner||'.'||segment_name segment,
block_id,
blockIdMB
... | true |
fe3414c40388f8e01e08ffb991085f9a44918383 | SQL | CoderKonig/WebProgrammingProject4 | /DB/CarRental_Insurance.sql | UTF-8 | 2,812 | 3.1875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.22, for macos10.15 (x86_64)
--
-- Host: localhost Database: CarRental
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS ... | true |
324350890e888599d91469b58569197d759ad7bf | SQL | icecode/ISVN-upload | /mysql.sql | UTF-8 | 3,954 | 2.984375 | 3 | [] | no_license | -- --------------------------------------------------------
--
-- 表的结构 `dev_demand`
--
CREATE TABLE IF NOT EXISTS `dev_demand` (
`id` int(11) NOT NULL auto_increment,
`title` text NOT NULL,
`status` varchar(20) default 'add',
`project_id` int(11) NOT NULL,
`bug_id` int(11) default NULL,
`addtime` int(11) ... | true |
7f54100bca08376a45f3198916aaf4c9faf70986 | SQL | robertomelita/SegundoSemestre2017 | /BaseDatos/07/query10.sql | UTF-8 | 166 | 3.171875 | 3 | [] | no_license | use northwind;
select ProductName,
UnitPrice,
(select avg(UnitPrice)from products) as Promedio
from products
having UnitPrice>Promedio
order by UnitPrice desc; | true |
54f3b8f7824ae546a72c67d231c588c7bbeea6cc | SQL | SMC1/JK1 | /Integration/splice_skip.sql | UTF-8 | 1,307 | 2.828125 | 3 | [] | no_license | drop table IF EXISTS splice_skip;
CREATE TABLE splice_skip (
samp_id varchar(63) NOT NULL,
loc1 varchar(31) NOT NULL, -- hg19
loc2 varchar(31) NOT NULL,
gene_sym varchar(31) NOT NULL,
frame text,
delExons varchar(63),
exon1 text,
exon2 text,
nReads mediumint unsigned NOT NULL,
nPos tinyint unsigned NOT NULL,
... | true |
f90842fab0257458e9e9dab93a2af54578d3b38a | SQL | OHDSI/circe-be | /src/main/resources/resources/cohortdefinition/negativecontrols/sql/domainQuery.sql | UTF-8 | 233 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | SELECT d.person_id subject_id,
c.ancestor_concept_id cohort_definition_id,
d.@domain_start_date cohort_start_date
FROM @cdm_database_schema.@domain_table d
INNER JOIN #Codesets c ON c.concept_id = d.@domain_concept_id | true |
910f3ffb0dac70699edd42f60c22a69741bd61d1 | SQL | zazacaca32/old-marketplace | /patches/PRIM-31.sql | UTF-8 | 680 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE `user_privileges_settings` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(32) NULL,
`alias` VARCHAR(32) NULL,
PRIMARY KEY (`id`)) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_general_ci;
INSERT INTO `user_privileges_settings` (`id`, `name`, `alias`) VALUES ('1', 'basic', 'Базовый')... | true |
6c81ed90dc95f3b3779fcefbdb1fe9afb592d2a4 | SQL | kawista9/My-SQL-Homework-10 | /kwilliams_hw10.sql | UTF-8 | 10,699 | 4.34375 | 4 | [] | no_license | USE sakila;
SELECT * FROM actor;
-------------------------------------------------------------------------------
#1a. Display the first and last names of all the actors from the table actor.
SELECT
first_name, last_name
FROM
actor;
------------------------------------------------------------------------------... | true |
b8146318c467c15cfb7ae2104439ecc5addc98fb | SQL | englandv/Assignment1 | /EnglandVaughanASS1Ver2.sql | UTF-8 | 689 | 3.0625 | 3 | [] | no_license | -- create database hospital2017;
use hospital2017;
drop table if exists referral;
drop table if exists surgeon;
drop table if exists patient;
drop table if exists department;
drop table if exists gender;
create table gender(
genderID int primary key,
genderType varchar(8)
)engine=innodb;
load data infile 'H:\\Gende... | true |
4d2940af6e1cf14fc229362e8c8e95a1543aaedc | SQL | valvandor/demo_project_MySQL | /kreoshine_db_functions.sql | UTF-8 | 2,465 | 4.21875 | 4 | [] | no_license | USE kreoshine;
DROP FUNCTION IF EXISTS get_user_id_from_order;
DELIMITER //
CREATE FUNCTION get_user_id_from_order (order_id BIGINT)
RETURNS INT DETERMINISTIC
BEGIN
DECLARE id_user BIGINT;
SELECT user_id INTO id_user
FROM orders WHERE orders.id = order_id;
RETURN id_user;
END//
DELIMITER ;
DROP FUNCTION... | true |
618f6ccd1bbfcad897ea82939af69d019c272ea3 | SQL | caddleman/pg_insights | /sql/index_hit_rate.sql | UTF-8 | 230 | 2.6875 | 3 | [
"MIT"
] | permissive | SELECT relname,
CASE idx_scan
WHEN 0 THEN NULL
ELSE round(100.0 * idx_scan / (seq_scan + idx_scan), 5)
END percent_of_times_index_used,
n_live_tup rows_in_table
FROM
pg_stat_user_tables
ORDER BY
n_live_tup DESC;
| true |
ce8563977816d9d1e0da4236a5b346e44e057f06 | SQL | rishabh26malik/Software-Systems-Development | /Lab Work/lab7/2020201074_Lab7.sql | UTF-8 | 1,086 | 3.96875 | 4 | [] | no_license | # Q1
select fname, lname
from EMPLOYEE
where Super_ssn in (select ssn from EMPLOYEE
where fname = 'Jennifer' and lname = 'Wallace');
# Q2
select Fname
from EMPLOYEE as emp, DEPENDENT as dep
where emp.ssn=dep.essn and emp.sex=dep.sex and emp.fname=dep.dependent_name;
# Q3
select fname, lname
from EMPLOYEE ... | true |
2ed0a28315d607e23e0c784667f7b49a8d6b5678 | SQL | w72er/gb-basic-db | /lesson-6/todo-hw-task-1/task-1.sql | UTF-8 | 2,568 | 3.4375 | 3 | [] | no_license | # Задание 1.
Проанализировать запросы, которые выполнялись на занятии,
определить возможные корректировки и/или улучшения (JOIN
пока не применять).
## Алгоритм
Алгоритм составления вложенного запроса следующий:
1) составление родительского запроса в виде шаблона с константами,
вместо данных, которые заменятся на под... | true |
2e1508d47eb600e657f406706301f4658b5984d1 | SQL | kks4825/RealProject | /김동욱/schedules_data.sql | UHC | 75,816 | 3.0625 | 3 | [] | no_license | --------------------------------------------------------
-- - -3-30-2017
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Table SCHEDULES
--------------------------------------------------------
CREATE TABLE "SCHEDULES"
( "PACK_NO... | true |
d29e730dd41c80afc6368129ab82de6f8b0637d9 | SQL | latomcus/api-platform | /sql/mysql.sql | UTF-8 | 1,169 | 3.296875 | 3 | [
"MIT"
] | permissive | -- https://github.com/latomcus/api-platform
-- 1. Create database
create database api_database;
-- select version(); -- "8.0.15"
-- 2. After database is created you need to establish new connection and continue the steps below
use api_database;
-- 3. Create sample tables
create table if not exists users
(id serial,... | true |
b170739824c87d324abb7f0446c5935c06c0b637 | SQL | andre2694/AndroidProfiling | /server/src/main/java/dbutils/init.sql | UTF-8 | 2,963 | 3 | 3 | [] | no_license | USE android_profiling;
CREATE TABLE IF NOT EXISTS Users (USERNAME VARCHAR(256) PRIMARY KEY NOT NULL,
PUBLICKEY VARCHAR(2048) NOT NULL,
AESKEY VARCHAR(2048) NOT NULL,
NONCE VARCHAR(256) NOT NULL,
CODE VARCHAR(4) NOT NULL,
UNI... | true |
c6502e347a28795abcdba26038cefb2aff8bd538 | SQL | seguracarlos/avianca | /data/base datos/avianca.sql | UTF-8 | 25,267 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 26-04-2018 a las 19:40:13
-- Versión del servidor: 10.1.26-MariaDB
-- Versión de PHP: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
a4f71ae9463def4023110cca6d47bffe1581f862 | SQL | RamesesDev/ETRACS2 | /etracs2-rpt/rpt2-services/services.jar/rpt-services.jar/META-INF/sql/propertyclassification.sql | UTF-8 | 1,366 | 3.25 | 3 | [] | no_license | [getList]
SELECT * FROM propertyclassification ORDER BY orderno
[getListByCode]
SELECT * FROM propertyclassification WHERE propertycode LIKE $P{propertycode} ORDER BY orderno
[getListByDescription]
SELECT * FROM propertyclassification WHERE propertydesc LIKE $P{propertydesc} ORDER BY orderno
[lookupList]
SELECT obj... | true |
261d8ddb37dfbbe6f3735cd4344c37916db932ae | SQL | ahgittin/stratos | /products/stratos2/stratos_controller/1.0.1/billing-script/migration.sql | UTF-8 | 509 | 2.703125 | 3 | [] | no_license | ALTER TABLE UM_TENANT ADD UM_CREATED_DATE TIMESTAMP NOT NULL DEFAULT '2010-06-01 00:00:01';
ALTER TABLE UM_TENANT ADD UNIQUE INDEX INDEX_UM_TENANT_UM_DOMAIN_NAME (UM_DOMAIN_NAME);
ALTER TABLE REG_ASSOCIATION ADD INDEX REG_ASSOCIATION_INDEX_SOURCEPATH (REG_SOURCEPATH, REG_TENANT_ID);
ALTER TABLE REG_ASSOCIATION ADD I... | true |
7013a31604f811d058fccb4cf2524f1ae25389b9 | SQL | AndriiTomashevsky/T-SQL-Learning | /INTERSECT.sql | UTF-8 | 228 | 2.8125 | 3 | [] | no_license | USE usersdb;
--Оператор INTERSECT позволяет найти общие строки для двух выборок
SELECT FirstName, LastName
FROM Employees
INTERSECT SELECT FirstName, LastName
FROM Customers
| true |
d14ab721914feb060b8fca0ae5d00ab758243266 | SQL | yangliang0818/mydemo | /sql/haowu/成交记录表.sql | UTF-8 | 336 | 2.890625 | 3 | [] | no_license | ALTER TABLE client_deal_record ADD build_no VARCHAR(20);
ALTER TABLE client_deal_record ADD room_no VARCHAR(20);
update client_deal_record set build_no=substring_index(substring_index(deal_room_num, '(幢)', 1),'幢',1)
, room_no= substring_index(substring_index(deal_room_num, '幢', -1), '室', 1) where deal_room_num is not n... | true |
4c6623c7eb3a8e3506224a2d2f313ab70fcfcbf5 | SQL | PanSiad/demo | /src/main/resources/data.sql | UTF-8 | 354 | 2.828125 | 3 | [] | no_license | --INSERT INTO CHORES (TITLE) VALUES ('CLEANING');
DROP TABLE IF EXISTS CHORES;
CREATE TABLE CHORES (
CHORE_ID INT AUTO_INCREMENT PRIMARY KEY,
TITLE VARCHAR(64) NOT NULL,
TIME_CREATED TIMESTAMP,
TIME_UPDATED TIMESTAMP,
TIME_DELETED TIMESTAMP
);
INSERT INTO CHORES (TITLE) VALUES
('Mopping'),
('Cleaning... | true |
547227ad64015370d11dfe99c881ee03acdd80c4 | SQL | leedonghu/jsp-web | /WebContent/WEB-INF/sql/CONSTRAINT05.sql | UTF-8 | 676 | 3.296875 | 3 | [] | no_license | -- DEFAULT
CREATE TABLE MyTable13
(
id INT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(255) NOT NULL,
body VARCHAR(255) NOT NULL,
inserted TIMESTAMP
);
INSERT INTO MyTable13
(title, body, inserted)
VALUES
('title1', 'body1', now());
SELECT * FROM MyTable13;
CREATE TABLE MyTable14
(
id INT PRIMARY KEY AUTO_INCREMENT,
... | true |
77c7acf14c1a82ca4ca66a75d37ba520b2072edb | SQL | michaelcumings/great-bay | /greatbaySQL.sql | UTF-8 | 396 | 3.1875 | 3 | [] | no_license | DROP DATABASE IF EXISTS greatBay_DB;
CREATE DATABASE greatBay_DB;
USE greatBay_DB;
CREATE TABLE itemList (
id INT auto_increment PRIMARY KEY,
item VARCHAR(255) NOT NULL,
initialBid INT default 1,
highestBid INT default 1
);
INSERT INTO itemList (item, initialBid, highestBid)
VALUES ("Apple", "2", "2"), ("New... | true |
3d631ca3ae318c0046dd8ec3f92fdccdddae5e61 | SQL | bhagatamit2512/hackathon | /hack.sql | UTF-8 | 2,848 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 29, 2019 at 04:32 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
d90d987923af3b30f54d91f19268529a5d8d4050 | SQL | lukstricker/car_rental | /Milestone 2/Create.sql | UTF-8 | 3,870 | 4.15625 | 4 | [] | no_license | /*
* Group Members: Lukas Stricker 14433, lsustricker@unibz.it
* Philipp Scomparin 14109, Philipp.Scomparin@stud-inf.unibz.it
*/
CREATE table Damages (
damages_id SERIAL primary key,
description varchar(120)
);
CREATE table Car_Brands (
car_brands_id SERIAL primary key,
company_... | true |
d5e8920c5342bb37a327f428036cac2346bf19db | SQL | yefc/CBOE | /subprojects/Classic/Consulting/DFCI/ChemACXOra/Oracle_Install_Scripts/sql/check_import_chemacx.sql | UTF-8 | 551 | 2.890625 | 3 | [] | no_license | Prompt Substance row count should be 352,353
select count(*) from chemacxdb.substance;
Prompt CSCartridge.chemacxdb_mx row count should be 300,935
SELECT COUNT(*) FROM CSCARTRIDGE.chemacxdb_MX;
Prompt CSCartridge.chemacxdb_mx_nr row count should be 18,153,028
SELECT COUNT(*) FROM CSCARTRIDGE.chemacxdb_MX_NR;
Prompt ... | true |
9eafd7904f77b94861bfadc9c25388e63e7c707c | SQL | sssilvar/ml-sklearn | /datasets/sql_queries/hepatitis.sql | UTF-8 | 919 | 3.203125 | 3 | [] | no_license | /* === HEPATITIS DATASET - UCI ===
Author: Santiago S. Silva R.
Description: This script generates a table corresponding to
the values of the hepatitis dataset.
1. It is necessary to create a [machine] database,
inside, create a [datasets] schema.
More in... | true |
6e4999dbea8870525f06637b798bcf61951ebb5b | SQL | LuisWNC/grifoInambari | /grifoInambari-core/src/test/resources/pe/com/grifoInambari/scripts/laUltima.sql | UTF-8 | 556 | 3.0625 | 3 | [] | no_license | SELECT dv.quantity FROM voucher v JOIN customer c ON (c.id = v.customerId) JOIN descriptionVenta dv ON (v.id=dv.voucherId) WHERE DATE='2016-07-04' AND dv.productId = 1;
SELECT dv.quantity
FROM voucher v JOIN customer c ON (c.id = v.customerId)
JOIN descriptionVenta dv ON (v.id=dv.voucherId)
WHERE DATE='2016-07-04'
AN... | true |
4939971ac69f6c33c00599b2fdee78d355b82a9e | SQL | Iveta-Nagle/SDA_Final_Project_backend | /src/main/resources/db/migration/V1_0_0__create_account.sql | UTF-8 | 370 | 2.828125 | 3 | [] | no_license | DROP TABLE IF EXISTS account;
CREATE TABLE account (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
account_number VARCHAR(21),
currency VARCHAR(3) NOT NULL,
ballance DOUBLE NOT NULL,
status INT DEFAULT NULL
);
INSERT INTO account (account_number, currency, ballance, status) VALUES
('LV007UNLA66666666666', 'USD'... | true |
4454c09a7c378f2cdd5b9f42a739d73615a53365 | SQL | 13476173038/SIXwork | /src/main/mysql/m03/d31/mahui.sql | GB18030 | 1,171 | 3.640625 | 4 | [] | no_license | #sale
SELECT empid,proid,
SUM(CASE WHEN MONTH(saDate)=9 THEN ROUND(num,2) ELSE num=0 END)AS ,
SUM(CASE WHEN MONTH(saDate)=10 THEN ROUND(num,2) ELSE num=0 END)AS ʮ,
SUM(CASE WHEN MONTH(saDate)=11 THEN ROUND(num,2) ELSE num=0 END)AS ʮһ,
SUM(CASE WHEN MONTH(saDate)=12 THEN ROUND(num,2) ELSE num=0 END)AS ʮ
FROM sales... | true |
c9d17d3d57e8cb450b87fb0794c02ff0133dd716 | SQL | Lotes/big-canvas | /src/main/sql/schema.sql | UTF-8 | 5,096 | 3.453125 | 3 | [] | no_license | DROP TABLE IF EXISTS users;
CREATE TABLE users (
id DECIMAL(65) PRIMARY KEY,
name VARCHAR(255) NOT NULL,
openId VARCHAR(255) NULL,
defaultColor CHAR(7) NOT NULL
);
INSERT INTO users (id, name, openId, defaultColor) VALUES (0, 'Demo user', NULL, '#FF0000');
DROP TABLE IF EXISTS tiles;
CREATE TABLE tiles (
id ... | true |
b43bb8b1dbcbd4e9b8347352871e19d459a58f78 | SQL | rohmatrico/tugas-web-2 | /db/biodata.sql | UTF-8 | 2,744 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.0.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 12, 2015 at 03:34
-- Server version: 10.0.17-MariaDB
-- PHP Version: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
937f8e0d13abef0c1858263fbe231fbcccde6d8c | SQL | ArctosDB/DDL | /migration/3.8_catalogNumberPrefixSuffix.sql | UTF-8 | 5,089 | 3.6875 | 4 | [] | no_license | */
GET LAM TO PULL GOOD FRESH BACKUPS
*/
CREATE TABLE dlm.cataloged_item20100909 AS SELECT * FROM cataloged_item;
ALTER TABLE cataloged_item ADD cat_num_prefix varchar2(10);
ALTER TABLE cataloged_item ADD cat_num_integer NUMBER;
ALTER TABLE cataloged_item ADD cat_num_suffix varchar2(10);
ALTER TRIGGER TR_CATITEM... | true |
d0fd56514fa4cf3dd90ab9cee1c0e92ba59c82c5 | SQL | teaisawesome/ORACLE-SQL | /negyedik-ora.sql | UTF-8 | 4,011 | 3.859375 | 4 | [] | no_license | -- Listázzuk azokat a női tagokat, akik kölcsönöztek olyan könyvet, amit még nem hoztak vissza.
SELECT DISTINCT tag.olvasojegyszam, vezeteknev||' '||keresztnev as nev FROM konyvtar.tag
INNER JOIN konyvtar.kolcsonzes ON tag.olvasojegyszam = kolcsonzes.tag_azon
WHERE visszahozasi_datum IS NULL AND nem = 'f';
-- Keressü... | true |
f5c6f3fe4cd23792e82824f6e6774200949ca90a | SQL | bodii/test-code | /java/leetcode_test/0596.Classes-More-Than-5-Students/Solution.sql | UTF-8 | 396 | 3.59375 | 4 | [] | no_license | # Write your MySQL query statement below
# 1
/*
select class from (
select class, student from courses group by class, student
) as c
group by class having count(class) >= 5;
*/
# 2
/*
select class from (
select distinct student, class from courses
) as c group by class having count(class) >= 5;
*/
# 3
se... | true |
b4816acf330ebbc221005183474667bd8597c325 | SQL | joni89/FeedClient | /database/creation_script.sql | UTF-8 | 1,395 | 3.859375 | 4 | [
"MIT"
] | permissive | DROP TABLE IF EXISTS users;
CREATE TABLE users (
id INTEGER PRIMARY KEY NOT NULL,
username TEXT NOT NULL UNIQUE,
password TEXT NOT NULL,
name TEXT NOT NULL
);
DROP TABLE IF EXISTS feeds;
CREATE TABLE feeds (
id INTEGER PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
url TEXT NOT NULL,
user_id INTEGER NOT NULL,
FORE... | true |
f12a5df29fc4545ab6fb54202beb6d2d84c2132d | SQL | zuoxiaojun/sql | /查询合同表头带主数量.sql | UTF-8 | 299 | 3.265625 | 3 | [] | no_license | select b.vbillcode, b.ctname, a.snnum, c.name vdef4name
from (select pk_ct_pu, sum(nnum) snnum
from ct_pu_b
where dr = 0
group by pk_ct_pu) a
left join ct_pu b
on a.pk_ct_pu = b.pk_ct_pu
left join bd_defdoc c
on b.vdef4 = c.pk_defdoc
where b.blatest = 'Y'
| true |
84cddef67ffa7ce2643e1839e836d388ff204c08 | SQL | SENA-CLASS/595885G1_TRIM3-4 | /MySQL/profun.sql | UTF-8 | 1,679 | 3.71875 | 4 | [] | no_license | -- funciones
create function pijamax.text6 (s varchar(20))
returns char (50)
return concat('hola',s,'!')
;
-- eliminar una funcion
drop function pijamax.text6;
-- muestra el contenido de la funcion o procedimiento
show create function pijamax.text;
-- muestra el contenido de la funcion o procedimiento
show create ... | true |
6306531baf1b933a8961e642812c0a8d85025ea6 | SQL | danielryne/Bamazon | /bamazon.sql | UTF-8 | 1,499 | 3.3125 | 3 | [] | no_license | DROP DATABASE IF EXISTS bamazon;
CREATE database bamazon;
USE bamazon;
CREATE TABLE products(
item_id INT(11) AUTO_INCREMENT NOT NULL,
product_name VARCHAR(100),
department_name VARCHAR(100),
price DECIMAL(10, 2) NULL,
stock_quantity INT (100),
PRIMARY KEY(item_id)
);
INSERT INTO products (product_name, departmen... | true |
5fbb0e65fcc5d07ed56cf79a16f444b8b383619b | SQL | chakibreds/mtq_epl_kb | /ontologies/sparql-generalization/c3.sql | UTF-8 | 549 | 2.765625 | 3 | [] | no_license | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX bet: <http://www.semanticweb.org/massy/ontologies/2021/2/untitled-ontology-5#>
CONSTRUCT {
?team bet:c3 ... | true |
48c2aa47d23ac9d2bef7aa3bd7754e822b714912 | SQL | chyannawee/SQL-Case-Study | /CaseStudy.sql | UTF-8 | 9,710 | 3.40625 | 3 | [] | no_license | alter session set NLS_DATE_FORMAT='DD/MM/YYYY';
DROP TABLE job_contractor;
DROP TABLE jobs;
DROP TABLE contractors;
DROP TABLE skills;
DROP TABLE contracts;
DROP TABLE clients;
CREATE TABLE clients (
client_id CHAR(3) PRIMARY KEY,
first_name CHAR(10),
last_name ... | true |
685657dd5e689f010c973c27247e4b102492c8d7 | SQL | pfiq3000/library_2 | /struct.sql | UTF-8 | 2,584 | 3.65625 | 4 | [] | no_license | CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`password` varchar(128) NOT NULL,
`rigths` int(2) NOT NULL,
`username` varchar(30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `author` (
`id` int(11) NOT N... | true |
46329cbd9a3cfe56e74c74cdd286b3699968361c | SQL | raghurammandapalli/github-upload | /Library-database-MySQL.sql | UTF-8 | 2,088 | 3.65625 | 4 | [] | no_license | DROP DATABASE IF EXISTS LIBRARY;
CREATE DATABASE LIBRARY;
USE LIBRARY;
DROP TABLE IF EXISTS BOOK;
CREATE TABLE BOOK(
Isbn BIGINT,
Title VARCHAR(210),
PRIMARY KEY(Isbn));
DROP TABLE IF EXISTS AUTHORS;
CREATE TABLE AUTHORS(
Author_id INT AUTO_INCREMENT,
Name VARCHAR(100),
PRIMARY KEY(Author_id));
DROP TABLE IF EXIST... | true |
49619c1252c6e2caad822b8f501cae34201f69df | SQL | beto-Sibileau/lab-mysql | /your-code/seeding.sql | UTF-8 | 1,349 | 2.90625 | 3 | [] | no_license |
use lab_mysql;
# challenge 3
insert into cars (vehicle_in,manufacturer,model,model_year,color)
values ('3K096I98581DHSNUP','Volkswagen','Tiguan',2019,'blue'),
('ZM8G7BEUQZ97IH46V','Peugeot','Rifter',2019,'red'),
('RKXVNNIHLVVZOUB4M','Ford','Fusion',2018,'white'),
('HKNDGS7CU31E9Z7JW','Toyota','RAV4',2018,'silver'),
... | true |
4749d3babdf15659d3272a4496169f54a42e3147 | SQL | jrubiotecno/simple_cms | /cmsjr.sql | UTF-8 | 144,451 | 2.765625 | 3 | [] | no_license | /*
SQLyog Ultimate v9.02
MySQL - 5.0.45-community-nt-log : Database - cmsjr
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_... | true |
a2a8f0a4821270bd5c94ecd83fbe8ec471f3ad57 | SQL | Temirhanova/scrumit | /modules/core/db/update/postgres/18/180629-2-updateSprint01.sql | UTF-8 | 200 | 3.171875 | 3 | [] | no_license | alter table SCRUMIT_SPRINT add constraint FK_SCRUMIT_SPRINT_ON_COMMAND foreign key (COMMAND_ID) references SCRUMIT_TEAM(ID);
create index IDX_SCRUMIT_SPRINT_ON_COMMAND on SCRUMIT_SPRINT (COMMAND_ID);
| true |
7c9248f4a70c406f4ea058bdab637f1c41e44052 | SQL | deymerh/Odontologia | /backend/RinaDent.sql | UTF-8 | 1,395 | 2.640625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 26-02-2016 a las 05:18:51
-- Versión del servidor: 10.1.9-MariaDB
-- Versión de PHP: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... | true |
a8e7d115079edfcce4d94ac9559d7a6ac5ae4d55 | SQL | AlessioDP/ADP-Core | /common/src/test/resources/db/migrations/postgresql/1__Test_queries.sql | UTF-8 | 249 | 2.953125 | 3 | [
"MIT"
] | permissive | -- MySQL Test schema
CREATE TABLE <prefix>table (
"column1" SERIAL PRIMARY KEY,
"column2" VARCHAR(255) NOT NULL
);
SELECT *
FROM <prefix>table;
-- Comment
-- Another comment
ALTER TABLE <prefix>table
ADD "column3" INTEGER DEFAULT 0 NOT NULL; | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.