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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7a4220152c6899480f43802082af626cc806ec23 | SQL | iag-geo/psma-admin-bdys | /postgres-scripts/01b-prep-locality-boundaries.sql | UTF-8 | 2,010 | 3.625 | 4 | [
"Apache-2.0",
"CC-BY-4.0"
] | permissive |
-- create thinned locality boundaries - 3 mins
DROP TABLE IF EXISTS admin_bdys.temp_localities;
CREATE UNLOGGED TABLE admin_bdys.temp_localities
(
gid serial NOT NULL,
locality_pid text,
state text NOT NULL,
geom geometry(Polygon,{0}) NOT NULL,
area float NULL
)
WITH (OIDS=FALSE);
ALTER TABLE admin_bdys.temp... | true |
203862eb91f8396a4ca3c510bf211a756da0645d | SQL | sethfischer/electricity-usage | /reports/month.sql | UTF-8 | 190 | 2.875 | 3 | [
"MIT"
] | permissive | /**
* Consumption by month.
*/
SELECT
TO_CHAR(started_at, 'YYYY-MM') AS year_month,
SUM(value) AS monthly_usage
FROM
readings
GROUP BY
year_month
ORDER BY
year_month
;
| true |
03ffa47a69e2ccdf1336d6a0b6f74739fe8457c5 | SQL | JcGaara/SGA-PLSQL-OPE | /SGA-OPERACION/Procedures/P_CONS_SERVICIOS.sql | UTF-8 | 1,836 | 3.015625 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE OPERACION.P_CONS_SERVICIOS(a_cod_id in solot.cod_id%type,
o_resultado out PQ_INTRAWAY.T_CURSOR)
IS
V_CURSOR PQ_INTRAWAY.T_CURSOR;
BEGIN
OPEN V_CURSOR FOR
select distinct
p.customer_id AS customer_id,
... | true |
8cea95682868889e00ee7bae3997f5aebffd013d | SQL | ew0s/ITMO_DATABASES | /LABS/LAB2 - Group by/5.sql | UTF-8 | 176 | 3.109375 | 3 | [] | no_license | SELECT
ProductID, COUNT(*) AS 'COUNT'
FROM
Sales.SalesOrderDetail
WHERE
ProductID IS NOT NULL
GROUP BY
ProductID
HAVING
COUNT(*) > 5
ORDER BY
ProductID
| true |
33e1da40260b4e23026b8c89bed512c125eafcec | SQL | ww-lessons/datenanalyse-in-sql | /demodatenbank_createskript.sql | UTF-8 | 1,616 | 3.71875 | 4 | [
"MIT"
] | permissive | /*
* Datenmodell zum Beispiel Student/Prüfung
*/
create table student (
student_id serial primary key,
matrikelnummer varchar(10) not null unique,
vorname varchar(50),
nachname varchar(50),
geschlecht char(1)
);
create table pruefung (
pruefung_id serial primary key,
bezeichnung varchar(100),
... | true |
3b4637f8ac7ac93faeacb357adb5b56933051308 | SQL | dukeofharen/httplaceholder | /src/HttPlaceholder.Persistence/SqlScripts/Migrations/mysql/004_executing_stub_id_length.check.sql | UTF-8 | 195 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE (table_name = 'requests')
AND (table_schema = DATABASE())
AND (column_name = 'executing_stub_id')
AND (CHARACTER_MAXIMUM_LENGTH = 255)
| true |
9940096f1dcaf453c270c130f8e06f1311436d8a | SQL | showjoo/G1G | /shop.sql | UTF-8 | 17,054 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 2018-04-13 03:53:32
-- 服务器版本: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
b8c93284f0604c367fe416177367f1898e569ce3 | SQL | MustafaEdward/Homework-Submission | /Week 18/SQL_ 01/homework.sql | UTF-8 | 441 | 3.296875 | 3 | [] | no_license | SELECT * FROM [Employees]
SELECT City FROM [Employees]
SELECT * FROM [Employees] WHERE city = 'Toronto'
SELECT * FROM [Employees] WHERE city = 'Mississauga'
SELECT EmployeeID FROM [Employees] WHERE city = 'Mississauga'
WHERE EmployeeID >=320 ORDER BY EmployeeID DESC LIMIT 3;
SELECT * FROM Employees
ORDER BY Empl... | true |
3fa4d458af4661834cd85d27b35098576d0def40 | SQL | cliffrochie/ebt_reports | /db_files/queries/ebt_reports_employee_license.sql | UTF-8 | 279 | 3.15625 | 3 | [] | no_license | SELECT
ELC.U_EMPLOYEE_LICENSE_NUMBER,
ELC.U_EMPLOYEE_LICENSE_TYPE,
ELC.U_EMPLOYEE_LICENSE_DATE_ISSUED,
ELC.U_EMPLOYEE_LICENSE_EXPIRY_DATE
FROM
u_employee_details AS ED
LEFT JOIN u_employee_license AS ELC ON ED.`CODE` = ELC.`CODE`
WHERE ED.`CODE` = "C-100002"
AND ED.`CODE` <> "" | true |
090e648122cbb932c1df40c2a0e842686134fe0d | SQL | sirlordalberto/programa | /SCRIPTS/SCRIPT13.SQL | UTF-8 | 428 | 2.75 | 3 | [] | no_license | USE ESCUELA;
DELIMITER $$
CREATE PROCEDURE almacenar_alumno (in nombre01 VARCHAR(20), in apellidoP01 VARCHAR(20), in apellidoM01 VARCHAR(20), in direccion01 VARCHAR(20), in curp01 VARCHAR(20), in fechaNacimiento01 DATE, in padreTutor01 VARCHAR(20), in DGrupo01 VARCHAR(20))
BEGIN
INSERT INTO ALUMNO VALUES(nombre01, ap... | true |
f5733fd4fdd1b9c43679ac16f20d841fb854913d | SQL | naveenbhaskar/gocd | /server/db/migrate/h2deltas/1_create_initial_tables.sql | UTF-8 | 4,413 | 3.328125 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | --****
-- Copyright 2014 ThoughtWorks, Inc.
--
-- 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 applicabl... | true |
d8b2309541348b81339024f770bfb889bc432286 | SQL | hapinam/Oracle_RMAN | /rman_backup_tape.sql | UTF-8 | 4,896 | 2.84375 | 3 | [] | no_license | export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
rman target / <<EOF
RUN
{
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE DEVICE TYPE 'SBT_TAPE' BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 2;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE ... | true |
2e1ed0adae5de94365f56ac703362bcc61a1e704 | SQL | nhamhung/DBMS | /COMPONENT/experiments/queries/joinAircraftsFlightsAndSchedule.sql | UTF-8 | 299 | 3.328125 | 3 | [] | no_license | SELECT Schedule.flno,Schedule.aid,Flights.flno,Flights.from,Flights.to,Flights.distance,Flights.departs,Flights.arrives,Aircrafts.aid,Aircrafts.aname,Aircrafts.cruisingrange
FROM Flights,Schedule,Aircrafts
WHERE Flights.flno=Schedule.flno,Schedule.aid=Aircrafts.aid
ORDERBY Flights.flno,Schedule.aid | true |
5d6ce60d1a92748b623804586c060500e114ad31 | SQL | JGonzaTeo/SMG_Didactico | /bdsmg.sql | UTF-8 | 12,261 | 3.015625 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `mydb` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `mydb`;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: mydb
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.34-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_C... | true |
7e8be12ecbc0c3c30eacb4ece4c4d2a21e1ddcb8 | SQL | TheEdu/SQL-PLSQL-practices | /TUTORIAL_SQL/Funciones/testing_function.sql | UTF-8 | 618 | 2.78125 | 3 | [] | no_license | /* Compilar el codigo pl/sql y las funciones a codigo C nativo.
Optimiza la ejecucion de funciones.
Disponible en Oracle10g +
ALTER SESSION SET PLSQL_CODE_TYPE = NATIVE;
ALTER FUNCTION get_emp_count COMPILE PLSQL_CODE_TYPE = NATIVE;
*/
-- Ejecutando una funcion
DECLARE
l_number NUMBER;
BEGIN
l_number := g... | true |
17dd7bcdca0e0712c4602bf0a4263169745a1bef | SQL | BXZR/platformUse | /platformUse/readMe/operation201707041150.sql | UTF-8 | 6,505 | 3.71875 | 4 | [] | no_license | CREATE TABLE `iot_business` (
`business_id` int(10) NOT NULL AUTO_INCREMENT,
`business_name` varchar(64) DEFAULT NULL COMMENT '公司名称',
`register_time` int(10) DEFAULT '0',
`flag` tinyint(1) DEFAULT '0',
PRIMARY KEY (`business_id`),
KEY `business_name` (`business_name`)
) ENGINE=InnoDB DEFAULT CHARSET... | true |
26c826dd0b7cb310cb11a75a1073795eba9c25be | SQL | a-mujumdar/Testing-Mendix-Widgets | /src/database_commands.sql | UTF-8 | 2,202 | 2.90625 | 3 | [] | no_license | CREATE TABLE "myfirstmodule$productionarea" (
"id" BIGINT NOT NULL,
"productionarea" VARCHAR_IGNORECASE(50) NULL,
PRIMARY KEY("id"));
INSERT INTO "mendixsystem$entity" ("id",
"entity_name",
"table_name")
VALUES ('a9aea3e5-36d1-4477-95ec-3c4a191d3e0f',
'MyFirstModule.ProductionArea',
'myfirstmodule$productionare... | true |
dcef09b57704bd4f02db2c3c607d731d7dcbb327 | SQL | ljca/mybackup | /src_note/develop/others/db/sql/MySQL/traininfo.sql | UTF-8 | 1,879 | 3 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: localhost Database: train
-- ------------------------------------------------------
-- Server version 5.6.24
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... | true |
2c29ec21d3e46de6863286e9dbb914803888dc98 | SQL | CUBRID/cubrid-testcases | /sql/_15_fbo/_02_qa_test/cases/fbo_ddl05.sql | UTF-8 | 1,004 | 3.375 | 3 | [
"BSD-3-Clause"
] | permissive | -- alter table, not delete file. The spec says this feature is not support.
--R30 rename table
create table rntree2(id int not null, parentid int, text clob);
insert into rntree2 values(1,null,char_to_clob('A'));
insert into rntree2 values(2,null,char_to_clob('B'));
insert into rntree2 values(3,1,char_to_clob('AA'));... | true |
66f64e280e9b81c062405000cd3d547410fd75b2 | SQL | b-cube/Response-Identification-Info | /scripts/sqls/select_by_schema.sql | UTF-8 | 106 | 2.65625 | 3 | [
"MIT"
] | permissive | select r.source_url, d
from responses r, lateral unnest(schemas) d
-- limit 100;
where d ilike '%.DTD'; | true |
80bddca8d4db6f9f91cc5e47b55949f12d141235 | SQL | Gouravsingh17/php-form-mysql | /form.sql | UTF-8 | 1,603 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 27, 2019 at 12:15 PM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.1.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... | true |
860220c22a3d2640a530710cb3a5f271365cb90f | SQL | pk-codebox-evo/xamarin-benchmarker | /postgresql/views.psql.in | UTF-8 | 6,129 | 3.671875 | 4 | [] | no_license | -- -*- sql -*-
create schema "1";
create view "1".benchmark as
select * from benchmark;
create view "1".config as
select * from config;
create view "1".machine as
select * from machine;
create view "1".parseobjectid as
select * from parseobjectid;
create view "1".commit as
select * from commit;
create view "1".s... | true |
d7e1dd97d6fc8716ba4218175d3b4cb9f85ea0e3 | SQL | james-shively-iii/ITC222 | /a6.sql | UTF-8 | 2,906 | 4.59375 | 5 | [] | no_license | --1. Write the SQL to CREATE the location table. Run it to debug any errors
CREATE TABLE location(
locationkey SERIAL NOT NULL,
locationname TEXT NOT NULL,
locationaddress TEXT NOT NULL,
locationcity TEXT NOT NULL,
locationstate CHAR(2) NOT NULL,
postalcode VARCHAR(12) NOT NULL,
phone VARCHAR(13) NOT NULL,
emai... | true |
d334d5061b0431922c31652a8acff59f8457a743 | SQL | sarikam1/DatabaseModelling | /Database Modelling/server/schema/create.sql | UTF-8 | 1,488 | 3.21875 | 3 | [] | no_license | drop table if exists duplicates;
drop table if exists playlist_songs;
drop table if exists release;
drop table if exists tracklist;
drop table if exists created;
drop table if exists play;
drop table if exists playlist;
drop table if exists song;
drop table if exists album;
drop table if exists artist;
create ... | true |
6f5d1115a6a6e867c643a6d80ebb98957f104e77 | SQL | peladillas/PDV | /assets/bd/backup/cambios_2016_08.sql | UTF-8 | 672 | 2.859375 | 3 | [] | no_license | CREATE TABLE `vendedor` (
`id_vendedor` int(11) NOT NULL,
`vendedor` varchar(128) NOT NULL,
`id_estado` int(11) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `vendedor` (`id_vendedor`, `vendedor`, `id_estado`) VALUES
(1, 'Pablo', 1),
(2, 'Juan', 1),
(3, 'Martin', 1);
CREATE TABLE `in... | true |
cedd4aea6dae645941aa105f8980cbe3db6ecaa0 | SQL | ahmadtechcampus2/ahmad4 | /برنامج الامين المحاسبي/Bin/System/Sys/fnRestGetDrivers.sql | UTF-8 | 382 | 3.140625 | 3 | [] | no_license | ########################################
CREATE FUNCTION fnRestGetDrivers( @AddressGUID UNIQUEIDENTIFIER )
RETURNS TABLE
AS
RETURN
SELECT
rv.*
FROM
RestVendor000 rv
LEFT JOIN RestDriverAddress000 rda ON rv.GUID = rda.DriverGUID
WHERE
(rv.IsAllAddress = 1 OR rda.AddressGUID = @AddressGUID)
... | true |
211cfe36a7011a206aa50c8f042d9f531edfad59 | SQL | martintalor/dep-redis | /dep-all/dep/src/main/resources/sqlLoad/201902/20190225_007_DEP_DML_yftao.sql | UTF-8 | 902 | 2.640625 | 3 | [] | no_license | -- ============================================================
-- 名称:20190225_007_DEP_DML_yftao
-- 用途:机构类型数据初始化-ORG_TYPE
-- 审核人:
-- ============================================================
prompt '机构类型数据初始化insert Table ORG_TYPE'
truncate table DEP.ORG_TYPE;
prompt Importing table DEP.ORG_TYPE...
set feedb... | true |
408b58f77d5507f837ea7f74c7ee7f435aa3fbf0 | SQL | ianhazael/poo | /mvc_pdo/punto_de_venta.sql | UTF-8 | 5,298 | 3.03125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 05-05-2016 a las 20:34:55
-- Versión del servidor: 5.7.9
-- Versión de PHP: 5.6.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... | true |
7c5752dc1953160a7dfab9fdd7ecec1fb44aa23a | SQL | glescano/chat | /documentation/sentencias_apertura.sql | UTF-8 | 2,680 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 07-04-2018 a las 23:13:50
-- Versión del servidor: 10.1.31-MariaDB
-- Versión de PHP: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
f8724755a880919e83a71459f6484e61b03d78c6 | SQL | Losajhonny/webscraping | /proyecto_de_clase/script/temporadas/Temporada_1995_1994.sql | ISO-8859-1 | 42,381 | 2.71875 | 3 | [] | no_license | -- Temporada 1995-1994
EXEC INSERT_ALERTA(1994, 1995, '*Al finalizar la temporada, el Sevilla y el Celta fueron descendidos a Segunda B por no cumplir un trmite burocrtico. Para reemplazarlos se recuper al Albacete (que haba descendido en la promocin) y al Valladolid. Finalmente, Sevilla y Celta fueron indultados y la... | true |
381e5d8591938d4ccde0d9220e8cb2b8920af5d1 | SQL | thaiseerp/fciist.net | /fciist.sql | UTF-8 | 6,212 | 3.296875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 10, 2016 at 12:04 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_SET_CLIENT */;... | true |
078a8c140938cbbc7f4bf3792c086590505e6aad | SQL | m-shahrestani/Ghanari | /SQL Files/queries/show_ava_hashtags.sql | UTF-8 | 365 | 3.03125 | 3 | [] | no_license | select content, sender, send_date
from hashtags natural join ava
where text = '#abs5h' and 'gak' not in (select blocked from blocks where blocker = sender )
order by send_date desc;
select content, sender, send_date
from hashtags natural join ava
where text = '#abs5h' and 'rak' not in (select blocked from blocks where... | true |
f1747d4a1e7d9b09c4092582553ca9c6651c80ee | SQL | sherpic/backend | /migrations/prep_tables.sql | UTF-8 | 770 | 3.09375 | 3 | [] | no_license | create table if not exists images (
id serial(11) not null primary key,
name varchar(11) not null,
type varchar(11) not null,
content blob not null
);
create table if not exists tasks (
id serial(11) not null primary key,
task text not null, /* Text of task, Markdown strign */
part int(1) not null, /* Pa... | true |
aafec2e0d02e3be9c4a435acbf760a6df0aa797f | SQL | lwj-wuwang/demo_test | /db.sql | UTF-8 | 1,943 | 3.515625 | 4 | [] | no_license | CREATE TABLE `onenet_demo`.`device_info`(
`id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
`device_sn` VARCHAR(100) NOT NULL COMMENT '设备序列号',
`device_name` VARCHAR(100) COMMENT '设备名称',
`iot_device_id` INT COMMENT 'OneNet平台的设备ID',
`iot_device_key` VARCHAR(255) COMMENT 'OneNet平台的设备apikey',
`addtime` INT COMMENT... | true |
b95d61983801eded77fa3ab85028563ccdf775ab | SQL | mohdafzal330/CarePrincsys | /careprincsys.sql | UTF-8 | 11,572 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 12, 2018 at 09:06 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
cbd19da40fb0e52888c5bc121a5f83180ea43bb9 | SQL | ZamSergey/mySystem | /user.sql | UTF-8 | 2,170 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Апр 10 2017 г., 20:06
-- Версия сервера: 5.6.26
-- Версия PHP: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4... | true |
f0f39babf758d196f1ef0d8b90e39b40b092b379 | SQL | iqbalsalman/Apliasi_BPR2 | /src/main/resources/db/migration/V0_0_4__CreateRelationalTables.sql | UTF-8 | 1,347 | 3.59375 | 4 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Author: iqbal
* Created: Feb 6, 2018
*/
create table master_provinsi(
kode_provinsi CHARACTER VARYING(255) not null uniqu... | true |
54debf68dedf657e4e3871c07357b8c8c86bf103 | SQL | Chandini-k/IIHT | /mentorOnDemand/mentorOnDemand/sql/mod_sql.sql | UTF-8 | 3,400 | 3.8125 | 4 | [] | no_license | drop database modDB
create database IIHT_modDB
use IIHT_modDB
create table [skill](
[id] [bigint] IDENTITY(1,1) primary key NOT NULL,
[name] [varchar](30) NOT NULL,
[toc] [varchar](40) NOT NULL,
[prerequistes] [varchar](100) NULL
)
create table [user](
[id] [bigint] IDENTITY(1,1) primary key NOT NULL,
[user_n... | true |
1d9f41932d05c8282468353ecbd2b710cc2791e2 | SQL | dhruv48/Tutor_Managment_System | /Database/TutorMS.sql | UTF-8 | 2,905 | 3.84375 | 4 | [] | no_license | create database TutorMS
--create table contact
create table Contact_tbl
(
id int identity(101,1) primary key,
cname varchar(50)not null,
cemail varchar(50) not null,
csubject varchar(50) not null,
cmessage varchar(max) not null
)
--create store procedure for insert contact table
create procedure spContact_... | true |
b940f6535fbc239e306ae356a2520a4f4007e5e1 | SQL | elkana911/b2b-big2 | /scripts/B2BAGENT.sql | UTF-8 | 417 | 3.03125 | 3 | [] | no_license | CREATE TABLE B2BAGENT
(
ID VARCHAR2(40 BYTE),
NAME VARCHAR2(100 BYTE) NOT NULL,
EMAIL VARCHAR2(100 BYTE),
PHONE VARCHAR2(30 BYTE),
USERNAME VARCHAR2(100 BYTE),
PASSWORD VARCHAR2(255 BYTE),
AGENTID VARCHAR2(40 BYTE)
)
;
CREATE UNIQUE INDEX B2BAGENT_PK ON B2BAGENT
(... | true |
b3ca37e320b294671674938fb3223b1a1b659d9c | SQL | Prizmer/wui | /prizmer/static/sql_query_template/water/Query_water_elf_hvs_for_period_for_abon.sql | UTF-8 | 1,893 | 3.859375 | 4 | [] | no_license | Select z1.name,z1.factory_number_manual,z1.attr1,z1.value,z2.value, z1.value-z2.value as delta
from
(SELECT
daily_values.date,
abonents.name,
meters.factory_number_manual,
meters.attr1,
daily_values.value,
taken_params.id,
params.channel,
abonents.guid as ab_guid,
meters.guid
FROM
publ... | true |
99c487136406772da0b8a52c7fc9837178c9ed70 | SQL | yusong-shen/leetCodePractice | /src/databaseProblem/deleteDuplicate196.sql | UTF-8 | 1,014 | 4.375 | 4 | [] | no_license | /**
Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id.
+----+------------------+
| Id | Email |
+----+------------------+
| 1 | john@example.com |
| 2 | bob@example.com |
| 3 | john@example.com |
+----+------------------+... | true |
73bafeb3458d3687dd3bd26c901c3257a6302976 | SQL | gabganda926/graduation | /CimisTableScript.sql | UTF-8 | 14,874 | 3.609375 | 4 | [
"MIT"
] | permissive | USE CIMIS;
CREATE TABLE tbl_address
(
add_ID INT NOT NULL IDENTITY(1,1),
add_blcknum varchar(10),
add_street varchar(20),
add_subdivision varchar(50 ),
add_brngy varchar(20),
add_district varchar(20),
add_city varchar(20),
add_province varchar(20),
add_region varchar(11),
add_zipcode varchar(4),
PRIMARY KE... | true |
85c412d4e2f2abd0900b0bdec77994b6e7479230 | SQL | ichsanharun/app_penggajian | /penggajian(1).sql | UTF-8 | 10,175 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 19 Jul 2018 pada 03.20
-- Versi Server: 10.1.24-MariaDB
-- PHP Version: 7.0.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
b96fc568b908b38d76d4ce767c712ce671d66b92 | SQL | ggslyman/Super-Street-Fighter-IV-Arcade-Edition-Lobby-System | /libs/cakephp/apps/ssf4ae/sql/ssf4ae_entry_characters.sql | UTF-8 | 1,237 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.10.3
-- http://www.phpmyadmin.net
--
-- ホスト: mysql122.db.sakura.ne.jp
-- 生成時間: 2011 年 9 月 11 日 23:33
-- サーバのバージョン: 5.1.51
-- PHP のバージョン: 5.2.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_... | true |
10ec22b31b942d82585610fef91e687f5e1415db | SQL | TsvetomirAleksandrov/Software-University | /Databases Basics - MS SQL Server - May 2020/06.TableRelations/06.TableRelations/06.UniversityDatabase.sql | UTF-8 | 1,254 | 3.84375 | 4 | [] | no_license | CREATE TABLE Majors (
MajorID INT NOT NULL IDENTITY(1, 1),
Name NVARCHAR(50) NOT NULL,
CONSTRAINT PK_Majors PRIMARY KEY (MajorID)
)
CREATE TABLE Subjects (
SubjectID INT NOT NULL IDENTITY(1, 1),
SubjectName NVARCHAR(50) NOT NULL,
CONSTRAINT PK_Subjects PRIMARY KEY (SubjectID)
)
CREATE TABLE ... | true |
f516c174cff29bec2c31208d685d94fad9ebaf31 | SQL | Jean-Roc/sia_sql | /export/projet/decompte_mobilier.sql | UTF-8 | 631 | 4.09375 | 4 | [] | no_license | -- décompte des mobiliers par matière/type pour chaque projet
CREATE VIEW stats.projet_nbr_mobilier AS
SELECT
projet.intitule,
(SELECT valeur FROM app.liste WHERE liste.id = mobilier.id_matiere) AS matiere,
(SELECT valeur FROM app.liste WHERE liste.id = mobilier.id_matiere_type) AS matiere_type,
COUNT(mobilier... | true |
5c950a0d8fe0935b57074a83c848a662f9417504 | SQL | ladislas14/drugs_converter | /etl-scripts/fr_bdpm/sql/drug.sql | UTF-8 | 443 | 3.515625 | 4 | [] | no_license | INSERT INTO drug(name, brand_name, country_id, source_id)
SELECT DISTINCT fr_cis_bdpm."Dénomination du médicament" as name, fr_cis_bdpm."Titulaire(s)" as brand_name, 1, fr_cis_bdpm."Code CIS" as source_id FROM fr_bdpm.fr_cis_bdpm
JOIN fr_bdpm.fr_cis_compo_bdpm ON (fr_bdpm.fr_cis_bdpm."Code CIS" = fr_bdpm.fr_cis_compo_... | true |
65079c87e92b4603e4bd5269b8258a8cc3e4ab2f | SQL | talatynnikA/bd | /6/6.sql | ISO-8859-7 | 271 | 2.859375 | 3 | [] | no_license | use TAL_UNIVER
select top 1
(select avg(NOTE) from PROGRESS where SUBJECT like '') [],
(select avg(NOTE) from PROGRESS where SUBJECT like '') []
from PROGRESS
--select avg(NOTE)[]
--from PROGRESS
--where SUBJECT like '' | true |
e20164de71f55339b47095aa30370a558a218f3e | SQL | victorjatoba/sql-zero-to-mastery-course | /exercises/sec5/date-filtering.sql | UTF-8 | 1,290 | 4.3125 | 4 | [] | no_license | /*
* DB: Employees
* Table: employees
* Question: Get me all the employees above 60, use the appropriate date functions
*/
SELECT age(birth_date), * FROM employees
WHERE age(birth_date) >= INTERVAL '61 years'
ORDER BY age(birth_date)
SELECT age(birth_date), * FROM employees
WHERE (EXTRACT (YEAR FROM age(birth_date)) ... | true |
abaae8a737dba7af927ec56f564eb2f1fc134733 | SQL | First-01/dune_queries | /queries/98619_average_swap_fee_on_polygon.sql | UTF-8 | 574 | 3.296875 | 3 | [] | no_license | WITH fees AS (
SELECT
LAST_VALUE("swapFeePercentage" / 1e16) OVER (
PARTITION BY contract_address
ORDER BY
evt_block_time
) AS fee
FROM
balancer_v2."WeightedPool_evt_SwapFeePercentageChanged"
UNION
ALL
SELECT
LAST_VALUE("swapFee... | true |
ddb9ba05352ea4afe5a9f29987bb9a8bb9b21778 | SQL | wentium/dw_sql | /da_db/da_article.sql | UTF-8 | 698 | 3.328125 | 3 | [] | no_license | INSERT OVERWRITE TABLE da_db.da_article
SELECT
a.article_id,
a.inventory_id,
nvl(a.pc_pv,0) + nvl(a.tw_pv,0) + nvl(a.app_user_ios_pv,0) + nvl(a.app_user_android_pv,0) AS article_pv,
a.article_wechat,
(nvl(a.pc_pv,0) + nvl(a.tw_pv,0) + nvl(a.app_user_ios_pv,0) + nvl(a.app_user_android_pv,0))/b.max_vppv as vppv... | true |
f746d8cc6d20af072c4a060354255499b81333e9 | SQL | gbouzon/database | /DDL/Hotel.sql | UTF-8 | 3,258 | 3.5 | 4 | [
"MIT"
] | permissive | Begin
for c in (select table_name from user_tables) loop
execute immediate ('drop table '||c.table_name||' cascade constraints');
end loop;
End;
/
CREATE TABLE hotel (
hotelno CHAR(4) PRIMARY KEY,
hotelname VARCHAR(20) NOT NULL,
city VARCHAR(20) NOT NULL
);
CREATE TABLE room (
roomno char(4),
hotelno char(4),
rt... | true |
46dab9b018d933c53aa79791a370122634b20451 | SQL | diegohss/BANCO_DE_DADOS | /Queries feitas Havik/Queries/Relatórios/Placements - Sistema.sql | UTF-8 | 416 | 3.703125 | 4 | [] | no_license | select base.id id_projeto,
base.nome projeto,
cli.nome nome_candidato
from bc_projeto base
left join (select * from bh_cli_status
where ((id_status=7 and id_substatus=32) or (id_status=7 and id_substatus is null)) and exibir=1)st on
st.id_projeto=base.id
left join bc_cliente cli on
cli.id=st.id_clie... | true |
4dfc79551e0a03e281120f24a83cbb3daeb20577 | SQL | younos1986/Core.EventStore | /Core.EventStore.EFCore.PostgreSQL/PostgreSql_EventStoreDb.sql | UTF-8 | 527 | 3.015625 | 3 | [] | no_license | CREATE DATABASE EventStoreDb
WITH OWNER = postgres
ENCODING = 'UTF8'
CONNECTION LIMIT = -1;
create table if not exists idempotences
(
id char(38) not null,
createdon date not null,
constraint idempotences_pk
primary key (id)
);
create tab... | true |
1c9aebae22aa800a7b844eaa98579f50ba7b718e | SQL | trezawin/prms | /data-scripts/Create_table_weekly-schedule.sql | UTF-8 | 458 | 3.65625 | 4 | [] | no_license | drop table `weekly-schedule`
CREATE TABLE `weekly-schedule` (
`id` bigint(11) NOT NULL,
`startDate` datetime NOT NULL,
`assignedBy` varchar(45) DEFAULT NULL,
`endDate` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `startDate_UNIQUE` (`startDate`),
KEY `id_assigned_by` (`assignedBy`),
CONSTRAINT... | true |
ebfeea9f943990636383518bfd4b9f2197e7bf24 | SQL | jessey90/pushVG | /api_cucre.sql | UTF-8 | 2,156 | 3.140625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50616
Source Host : localhost:3306
Source Database : api_cucre
Target Server Type : MYSQL
Target Server Version : 50616
File Encoding : 65001
Date: 2014-03-04 15:50:05
*/
SET FOREIGN_KEY_CHECKS=0... | true |
fab00ac3f1b05ea9d413c9a1b4668fb47e76e9c8 | SQL | Sammiee4real/telegram_bot | /w156cred__wplending.sql | UTF-8 | 103,690 | 2.796875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 16, 2021 at 05:33 PM
-- Server version: 5.5.57-MariaDB
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... | true |
66a91463b0689b2b8338e5b7a00c235f17d291f2 | SQL | bharathnreddy/Basic-Bank-System | /sql/banking_system.sql | UTF-8 | 911 | 3.234375 | 3 | [] | no_license | CREATE TABLE clients(
c_id int(3) PRIMARY KEY AUTO_INCREMENT,
c_name varchar(20) NOT NULL,
c_mail varchar(20) UNIQUE,
c_balance int(10) NOT NULL
);
INSERT INTO `clients`(`c_id`, `c_name`, `c_mail`, `c_balance`) VALUES
(101,'Bharath','bharath@gmail.com',15000),
(102,'Rohan','rohan10@gmail.... | true |
0b18bb0f00d70a059f9bfa2a42c15aff29749294 | SQL | GyoriSzabolcs/TeamProject | /dormadmin.sql | UTF-8 | 3,753 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 03, 2019 at 10:10 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
3932ab298908b445550627f92d9de04e3d2ab79c | SQL | shakhrayv/MIPT-PROGRAMMING | /DataBases/SQL-EX/009.SQL | UTF-8 | 101 | 2.890625 | 3 | [] | no_license | select distinct maker from Product left join PC on (Product.model = PC.model) where PC.speed >= 450
| true |
cfeb1d4f4c77ade14b4737df2b4cd898fd222d09 | SQL | lisaolson/higher_level_programming | /0x0E-SQL_more_queries/7-cities.sql | UTF-8 | 311 | 3.546875 | 4 | [] | no_license | -- Creates the database hbtn_0d_usa and the table cities
CREATE DATABASE IF NOT EXISTS hbtn_0d_usa;
USE hbtn_0d_usa;
CREATE TABLE IF NOT EXISTS cities (
id INT UNIQUE AUTO_INCREMENT PRIMARY KEY NOT NULL,
state_id INT NOT NULL,
FOREIGN KEY (state_id) REFERENCES states(id),
name VARCHAR(256) NOT NULL
);
| true |
d4cf4e6bb6482f3e7811e6d968ed90afd22a227b | SQL | shkodskihk/SQLite | /VideoFiles/27-36/27-36.sql | UTF-8 | 2,436 | 3.71875 | 4 | [] | no_license | -- LENGTH
SELECT Name, LENGTH(Name), Code, Code2 FROM Country;
SELECT Name, Code, Code2 FROM Country WHERE LENGTH(Name) >= 10;
SELECT Name, LENGTH(Name) AS Len, Code, Code2 FROM Country
WHERE LENGTH(Name) BETWEEN 10 AND 12
ORDER BY Len DESC;
-- UPPER
CREATE TABLE t ( a, b );
INSERT INTO t VALUES ( 'Aaa', 'Bbb' )... | true |
a3c7e28a92b7202a96e64c5e2f9588db66ba1870 | SQL | Phongsavanhx/Bamazon | /bamazon.sql | UTF-8 | 1,149 | 3.28125 | 3 | [] | no_license | -- Create a database called 'Bamazon' and switch into it for this activity --
CREATE DATABASE Bamazon;
USE Bamazon;
-- Create a table called 'products' which will contain the store inventory --
CREATE TABLE products (
item_id INTEGER(11) AUTO_INCREMENT NOT NULL,
product_name VARCHAR(30) NOT NULL,
department_name VA... | true |
f4dfc773c479c50a6fda8e41d0fefc49e788056f | SQL | TitanicThompson1/BDAD | /Projeto_completo/projetoTerceiraParte/povoar.sql | UTF-8 | 18,879 | 3 | 3 | [] | no_license | PRAGMA foreign_keys = on;
--Empresas
INSERT INTO Empresa(nome, representante, contacto, morada) VALUES ('Dreamworks', 'Jorge', 914303411, 'Matosinhos'); --1
INSERT INTO Empresa(nome, representante, contacto, morada) VALUES ('Disney', 'Paulo', 9144603411, 'Porto'); --2
INSERT INTO Empresa(nome, representante, cont... | true |
679b57996706a949f9bd4f00278e02fee5b22554 | SQL | shgy/code-snippet | /hive/lesson_24_select的正则表达式-.sql | UTF-8 | 749 | 3.125 | 3 | [] | no_license | 下面的查询,选择除了ds和hr的所有列。
SELECT `(ds|hr)?+.+` FROM sales ;
set hive.support.quoted.identifiers=None (不支持中文)
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select#LanguageManualSelect-REGEXColumnSpecification
Whether to use quoted identifiers. Value can be "none" or "column".
column: Column names can... | true |
e5a92b900edc22090ddcc6bdac6d0a84e55e3903 | SQL | Henery002/studying-logs | /0804-AJAX-03/AJAX_day03-source/dangdang.sql | UTF-8 | 1,181 | 3.8125 | 4 | [] | no_license | #设置后续的SQL语句编码
SET NAMES UTF8;
#试着删除数据库dangdang
DROP DATABASE IF EXISTS dangdang;
#创建数据库dangdang,指定保存数据时的字符集
CREATE DATABASE dangdang CHARSET=UTF8;
#进入dangdang
USE dangdang;
#创建保存书籍信息的表: dd_book
#bid(自增主键) name price birthday isOnsale
CREATE TABLE dd_book(
bid INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(64),
... | true |
36ff04849629173985b9268d27d352915a2638ff | SQL | ramzan5/SQL | /3rd_Practice.sql | UTF-8 | 2,860 | 3.6875 | 4 | [] | no_license | select * from likes;
--1
select fruits from likes where name = 'Winnie';
--2
select fruits from likes
MINUS
select fruits from likes where name = 'Winnie';
--3
select name from likes where fruits = 'apple';
--4
select name from likes
MINUS
select name from likes where fruits = 'pear';
--5
select name from likes w... | true |
178a907847d99f8356266c2ffc659017f8d8abdc | SQL | IvyyyyyH/Resume | /Database/Assignment2/part1/q5.sql | UTF-8 | 3,627 | 4 | 4 | [] | no_license | SET search_path TO bnb, public;
/*question 5 rating histogram*/
/*given each traveler rating, match with the homeowner with listingId*/
CREATE VIEW ho_rating_list AS
SELECT Listing.owner, TravelerRating.listingId, TravelerRating.startDate,
TravelerRating.rating
FROM TravelerRating, Listing
WHER... | true |
6dbecfbb359d1bb600ca6da26968147eabc6face | SQL | jgarzonext/plsql-testing | /script_plsql/bd_iaxis/script/tables/HISDIRECCIONES.sql | ISO-8859-1 | 2,540 | 2.890625 | 3 | [] | no_license | --------------------------------------------------------
-- DDL for Table HISDIRECCIONES
--------------------------------------------------------
CREATE TABLE "AXIS"."HISDIRECCIONES"
( "SHISDIR" NUMBER(9,0),
"SPERSON" NUMBER(10,0),
"CDOMICI" NUMBER,
"TDOMICI" VARCHAR2(40 BYTE),
"CPOSTAL" VARCHAR2(30 BYT... | true |
e0037026c6692edbab2c1837f5ef1a88adf78168 | SQL | jlb984/TP_Integrador_BD1 | /abms_2.sql | UTF-8 | 9,406 | 3.8125 | 4 | [] | no_license | use terminal_automotriz;
-- ****************** ABM modelos ***************************--
DELIMITER |
CREATE PROCEDURE abm_modelo (IN _id_modelo int, IN _nombre varchar(50), IN _descripcion varchar(100),
IN accion varchar(10),out _respuesta varchar(45))
BEGIN
CASE accion
WHEN 'alta' THEN
set @re... | true |
67533c694f55bdbfbb161de8e3502c3dd7836da5 | SQL | rafaelgr/gdes_ac | /sql/gdes_ac_v2015_1_0_2.sql | UTF-8 | 1,353 | 3.734375 | 4 | [] | no_license | /* Creación de la tabla de relaciones proyecto - trabajador*/
CREATE TABLE `gdes_ac`.`asg_proyecto`( `asgProyectoId` INT(11) NOT NULL AUTO_INCREMENT, `nombre` VARCHAR(255), `proyectoId` INT(11), `trabajadorId` INT(11), PRIMARY KEY (`asgProyectoId`) );
ALTER TABLE `gdes_ac`.`asg_proyecto` ADD CONSTRAINT `ref_proyecto` ... | true |
ad343bceceac9574d800f2cfc5f59187da5277c6 | SQL | DepartmentOfHealth-htbhf/htbhf-claimant-service | /db/src/main/resources/db/migration/V1_061__replace_eligiblity_override_columns_with_json.sql | UTF-8 | 590 | 3.046875 | 3 | [
"MIT"
] | permissive | UPDATE claim AS c1
SET eligibility_override = (
SELECT row_to_json(t) FROM (
SELECT eligibility_override_outcome as "eligibilityOutcome",
eligibility_override_until as "overrideUntil",
eligibility_override_children_dob as "childrenDob"
FROM claim AS c2 WHERE c1.id = c2.id and eligibility... | true |
05469d77e8b54a87d46cd6b0e371cb71778b2e28 | SQL | murzinov01/DB_tasks | /Lab1/task10.sql | UTF-8 | 1,547 | 4.28125 | 4 | [] | no_license | -- Используя операцию IN (NOT IN) реализовать следующие запросы:
-- a) найти всех потребителей, заказывавших болты или винты не менее двух раз;
SELECT Customer.name FROM Customer WHERE Customer.ID IN
(SELECT customer FROM "Order", Customer, Detail
WHERE "Order".customer = Customer.ID AND "Order".detail = Detail.ID
AND ... | true |
50857bad657a338016b4311bd5d575ea65a05da2 | SQL | immn/PHP-Piscine | /d05/ex07/ex07.sql | UTF-8 | 108 | 2.609375 | 3 | [] | no_license | SELECT title, summary
FROM film
WHERE
(title LIKE '%42%') OR
(summary LIKE '%42%')
ORDER BY duration ASC;
| true |
dbe7ced7bfd2c134b7b0de237886a4683847860f | SQL | rustam-mukhametshin/mysql-bootcamp | /relationships/cross_join.sql | UTF-8 | 248 | 3.0625 | 3 | [] | no_license | SELECT * FROM customers
WHERE last_name='George';
SELECT * FROM orders
WHERE customer_id=1;
--
SELECT * FROM orders
WHERE customer_id = (
SELECT id FROM customers
WHERE last_name='George'
);
-- Cross join
SELECT * FROM customers, orders;
| true |
d54641b8270be9743127634452da588729f2a369 | SQL | Gintorres/OMDB | /sql/scripts/insert_movie_shrek.sql | UTF-8 | 3,131 | 3.328125 | 3 | [] | no_license | -- --------------------------------------------------------
-- Insertion script for the movie: Shrek
-- Christian Duvick
-- --------------------------------------------------------
-- Insert movie stuff
-- ------------------------------------------------------------------
INSERT INTO `movies` (`movie_id`, `native_n... | true |
0015cef1b44aec61f78ef27874fcd877352d0aee | SQL | BangBang666666/db-sql | /sql/practices/tricky/5.sql | UTF-8 | 399 | 4.34375 | 4 | [] | no_license | -- 4 查询所有学生的学生编号、学生姓名、选课总数、所有课程的总成绩
SELECT
Student.Sid, Student.Sname, Cnum, Tsocre
FROM
Student
LEFT JOIN
(
SELECT
Sid, count(*) as Cnum, SUM(SC.score) as Tsocre
FROM
SC
WHERE
score is not NULL
GROUP BY
Sid
) as r
ON
S... | true |
8b87952f50401fbbe001bbe6e6dcd9e2d202a378 | SQL | tifa64/Banchmarking-ClickHouse | /benchmarking merge tree/lesson code.sql | UTF-8 | 1,702 | 3.78125 | 4 | [] | no_license | -- tabix tab 1
CREATE DATABASE merge_tree;
-- combination 1
CREATE TABLE merge_tree.event_time_batch
(
id UInt64,
time DateTime,
type UInt16,
pokemon_id UInt16
)
ENGINE = MergeTree()
PARTITION BY toYYYYMM(time)
ORDER BY (time, id);
-- Pay attention to order of fields, and please don't use such terrible order b... | true |
a017b68e1f56c71348e25c310dbbf174a55584b8 | SQL | bellmit/origin | /family_order/sql/TF_F_RECOMMEND/SEL_BY_SN.sql | UTF-8 | 1,526 | 2.8125 | 3 | [] | no_license | SELECT a.execute_id,a.execute_desc,a.serial_number,a.id_type,a.id,a.priority,a.description,
TO_CHAR(a.start_date,'yyyy-mm-dd hh24:mi:ss') start_date,TO_CHAR(a.end_date,'yyyy-mm-dd hh24:mi:ss') end_date,
a.eparchy_code,TO_CHAR(a.update_date,'yyyy-mm-dd hh24:mi:ss') update_date,a.update_tag,a.update_staff_i... | true |
ff7e102a3f0702e0f02a264b6d754387fa155f74 | SQL | sky1634-web/WEB | /Загрузки/test1_local (1).sql | UTF-8 | 5,270 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Хост: localhost
-- Время создания: Ноя 12 2020 г., 16:33
-- Версия сервера: 10.4.14-MariaDB
-- Версия PHP: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@... | true |
af03da919fb91654e8ca5c2e14dbf8c3baa74b72 | SQL | panupongjkn/be_booking | /migrations/20190807115813-users.sql | UTF-8 | 694 | 2.90625 | 3 | [] | no_license |
-- +migrate Up
CREATE TABLE IF NOT EXISTS users (
id VARCHAR(36) NOT NULL,
username VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
fname VARCHAR(255) NOT NULL,
lname VARCHAR(255) ... | true |
8a65b3694836763a5bb78626215a2a55f76f7183 | SQL | yefc/CBOE | /subprojects/Database/Registration/RegLegacyLoad/sql/import_legacy_users.sql | UTF-8 | 3,364 | 3.703125 | 4 | [] | no_license | PROMPT ===> Starting file import_legacy_users.sql
PROMPT Dropping legacy_users Table
DROP TABLE legacy_users;
PROMPT Creating legacy_users table
CREATE TABLE legacy_users(
PersonID INT,
UserName VARCHAR2(30),
UserCode VARCHAR2(10),
Active VARCHAR2(1),
Role VARCHAR2(30),
Firs... | true |
0c3b3eac61dbdbbd97023783a92ec1c6846f2dbd | SQL | blakeward05/SQL-Queries | /Early Warning/SAIL GPA Validation.sql | UTF-8 | 3,845 | 3.578125 | 4 | [] | no_license | SELECT
st.student_key,
st.student_id,
st.student_key,
st.student_name,
st.student_age,
stx.student_years_in_high_school,
st.student_current_grade_code,
st.student_current_school,
sail_gpa.school_name as sail_school,
st.student_cumulative_gpa,
sail_gpa.risk_factor_name,
sa... | true |
b13ef33e5895d4774adda171b0bfa9c743be47c9 | SQL | EdreaRobinson/SQL-Intro-Lab | /person.sql | UTF-8 | 1,225 | 4.09375 | 4 | [] | no_license | -- #1
CREATE TABLE person (
id SERIAL PRIMARY KEY,
name VARCHAR(40) NOT NULL,
age INTEGER,
height_in_cm FLOAT,
city VARCHAR(100),
favorite_color VARCHAR(100)
);
-- #2
INSERT INTO person (name, age, height_in_cm, city, favorite_color)
VALUES ('Edrea', 42, 157.48, 'Lafayette', 'orange'),
('Cameron', 40, 180.... | true |
e9684e79a0c97dd5efce24892f435d0c9c4f26c9 | SQL | eimingming/CPE231_DATABASE | /hw4/assn3C.sql | UTF-8 | 305 | 3.21875 | 3 | [] | no_license | CREATE VIEW "view_c2"
AS SELECT P."Pname", D."Dname", COUNT(*), sum(W."Hours")
FROM "PROJECT" P
JOIN "DEPARTMENT" D ON D."Dnumber" = P."Dnum"
JOIN "WORKS_ON" W ON P."Pnumber" = W."Pno"
GROUP BY P."Pname", D."Dname";
/*CREATE VIEW
Query returned successfully in 304 msec.*/
select view_c2.*
from view_c2 | true |
a07268a4c97af5140e08c667ed4034b3ea1abc59 | SQL | maduhu/CGIAR-CIAT-TheChangingGlobalDiet | /SQLServerQueries/FirstThreeLastThreeYearAveragesAllMeasurements.sql | UTF-8 | 2,377 | 2.96875 | 3 | [] | no_license | (SELECT firstgroup.ItemName, firstgroup.ElementName, firstgroup.UnitName, firstgroup.AvgValue61to63, lastgroup.AvgValue07to09
From
(SELECT ItemName, ElementName, UnitName, AVG([Value]) AS AvgValue61to63
FROM dbo.QuickCropData
WHERE ElementName='Fat' and Year<='1963'
GROUP BY ItemName, ElementName, UnitName) firs... | true |
4bf48d1d483b9ee2dd1eaa22f144617b477cb9ea | SQL | edersoncsouza/localizesenac | /localizesenac-uq_aluno_disciplina.sql | UTF-8 | 31,510 | 3.640625 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4.2
-- http://www.phpmyadmin.net
--
-- Máquina: localhost
-- Data de Criação: 24-Abr-2015 às 01:25
-- Versão do servidor: 5.6.13
-- versão do PHP: 5.4.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIE... | true |
b39008644787b525d2c781bf4eb8ba13140322ae | SQL | drimsilverback/ra_data_warehouse | /models/sources/stg_hubspot_crm/stg_hubspot_crm_owners.sql | UTF-8 | 1,012 | 3.65625 | 4 | [
"Apache-2.0"
] | permissive | {% if not var("enable_hubspot_crm_source") %}
{{
config(
enabled=false
)
}}
{% endif %}
{% if var("stg_hubspot_crm_etl") == 'fivetran' %}
WITH source as (
select * from
from {{ target.database}}.{{ var('stg_hubspot_crm_fivetran_schema') }}.{{ var('stg_hubspot_crm_fivetran_owner_table') }}
),
rename... | true |
9ff43d3f6db5e83016cfdf15bd0d38b3e63ec833 | SQL | TVSenosi/ndg-ng | /db/evolutions/1.sql | UTF-8 | 472 | 3 | 3 | [] | no_license | # Update question_type
# Jobs schema
# --- !Ups
UPDATE question_type
SET supported=1
WHERE type_name='geopoint';
CREATE TABLE jobs (
id bigint(20) NOT NULL AUTO_INCREMENT,
surveyId varchar(255) NOT NULL,
dateTo varchar(255) NOT NULL,
dateFrom varchar(255) NOT NULL,
email varchar(255) NOT NULL,
... | true |
d5c0e18abb1b18ed20d0663e0524ca1d8306666f | SQL | chikkun/cd-questionnaire | /sql/enquetes.sql | UTF-8 | 22,183 | 3.25 | 3 | [] | no_license | USE wordpress
TRUNCATE table wp_enquetes;
TRUNCATE table wp_questions;
TRUNCATE table wp_selections;
INSERT INTO wp_enquetes
(id,name,start_date,end_date,poll_or_question)
VALUES
(
'1',
'アンケート 1',
'2013-12-01',
'2013-12-31',
'1'
);
INSERT INTO wp_questions
(id,enquete_id,sort_id,question_text,multiple_... | true |
2b2b32f35146845eb22c8f4ffdeaeac016d79cba | SQL | MinSu-Kim/erp_jsp_exam | /Scripts/02_ddl.sql | UTF-8 | 2,214 | 4.125 | 4 | [] | no_license | -- 접속자 확인
SELECT USER FROM DUAL;
DROP TABLE EMPLOYEE;
DROP TABLE DEPARTMENT;
DROP TABLE TITLE;
-- DEPARTMENT 테이블 생성
CREATE TABLE DEPARTMENT (
DEPT_NO NUMBER(2),
DEPT_NAME VARCHAR2(20),
FLOOR NUMBER(2) DEFAULT 2,
CONSTRAINT DEPARTMENT_DEPTNO_PK PRIMARY KEY (DEPT_NO),
... | true |
6b4f8d90456503cb221cc27be953d7e935e6146d | SQL | SHF-INFORMATICA/VBRetaguarda | /RETAGUARDA/STORED PROCEDURE/MEGASIM/spNF.sql | ISO-8859-1 | 1,996 | 3.34375 | 3 | [] | no_license | ALTER procedure spNF @Acao int, @NF_ID int, @PESSOA_ID bigint, @TRANSP_ID bigint, @NF_TIPO nvarchar(2),
@NUMR_NOTA int, @SERIE_NOTA nvarchar(6), @DT_EMISSAO datetime, @DT_ENTRASAI datetime, @STATUS nvarchar(50),
@DT_CANCELA datetime, @QTD_VOLUME float, @PESO_BRUTO float, @PESO_LIQUIDO float,
@NUMR_... | true |
d5f0341bac29a1ace6a811069b01accf77a852b0 | SQL | sqshine/springboot-demo | /readinglist/src/main/resources/db/schema.sql | UTF-8 | 6,536 | 3.859375 | 4 | [] | no_license | SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for data_dict
-- ----------------------------
DROP TABLE IF EXISTS `data_dict`;
CREATE TABLE `data_dict` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type_name` varchar(64) NOT NULL COMMENT '数据字典类型名称',
`type_code` varchar(64) DEFAULT NULL C... | true |
cc7b00081b705e6f41ad3d8492e5985da0ef28f2 | SQL | buxianghua/DeviceManagers | /crebas.sql | UTF-8 | 6,912 | 3.1875 | 3 | [] | no_license | /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2020/6/15 16:38:19 */
/*==============================================================*/
drop table if exists admin_user;
drop table if ex... | true |
bfb69735d57e96f3870c1fc0919b56a9448846b9 | SQL | rikardholm/activiti | /testing/src/main/resources/rikardholm/insurance/common/test/database/schema.sql | UTF-8 | 511 | 3.875 | 4 | [] | no_license | SET MODE Oracle;
CREATE TABLE customers
(
id NUMBER PRIMARY KEY,
personal_identifier VARCHAR(11) UNIQUE
);
CREATE TABLE insurances
(
id NUMBER PRIMARY KEY,
customer_id REFERENCES customers (id) NOT NULL
);
ALTER TABLE insurances ADD insurance_number NUMBER UNIQUE NOT NULL;
CREATE SEQUENCE customers_seq
MINVAL... | true |
9e72ff6d4ba505cdb6efcc5ca7c0a7ec567095f3 | SQL | AlexanderSchaedlich/LMSCF-CodeReview10-Alexander | /database/cr10_alexander_biglibrary.sql | UTF-8 | 7,448 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Erstellungszeit: 23. Mrz 2020 um 09:49
-- Server-Version: 10.4.11-MariaDB
-- PHP-Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
b4a2f4baabb842e11d582a42e21f2faebc18641e | SQL | msgabor/MySQL | /DML.sql | UTF-8 | 1,534 | 4.0625 | 4 | [] | no_license | use hr;
select * from employees;
select department_id from employees group by department_id;
select department_id, sum(salary) from employees group by department_id;
select department_id, avg(salary) from employees group by department_id;
select department_id, max(salary), min(salary) from employees group by departmen... | true |
7aba8643ac4f98df5d8cc5c3da0e4fd383052034 | SQL | wearedevx/keystone | /api/db/migrations/20210707090655_create_project_permissions.up.sql | UTF-8 | 560 | 3.40625 | 3 | [
"MIT"
] | permissive | CREATE TABLE public.project_permissions (
user_id integer NOT NULL,
project_id integer NOT NULL,
"role" text NULL,
created_at timestamptz NULL,
updated_at timestamptz NULL,
CONSTRAINT project_permissions_pkey PRIMARY KEY (user_id, project_id)
);
-- public.project_permissions foreign keys
ALTER TABLE public.pr... | true |
3c6bb60038d3ba7de8e1e917602056192a7e53ed | SQL | EnMuhammad/alhuda | /database sql/alhuda.sql | UTF-8 | 4,217 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 24, 2020 at 07:23 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.