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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4af022b334f5c86bc30316dbeb3058caf2301461 | SQL | dh3591/P2-Tournament-Results | /tournament.sql | UTF-8 | 1,457 | 4.34375 | 4 | [] | no_license | -- Table definitions for the tournament project.
--
-- Put your SQL 'create table' statements in this file; also 'create view'
-- statements if you choose to use it.
--
-- You can write comments in this file by starting them with two dashes, like
-- these lines here.
CREATE DATABASE tournament;
\c tournament;
CREATE ... | true |
1ab5482dd10294ab92bad4ddb9b983adf58cfdb0 | SQL | MichaelRempe/Node_CMS | /company_db.sql | UTF-8 | 1,574 | 3.96875 | 4 | [] | no_license | DROP DATABASE IF EXISTS company_db;
CREATE DATABASE company_db;
USE company_db;
CREATE TABLE department(
dep_id INTEGER NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NOT NULL,
-- primary key --
PRIMARY KEY (dep_id)
);
CREATE TABLE role(
role_id INTEGER NOT NULL AUTO_INCREMENT,
title VARCHAR(30) NOT... | true |
cc0aaed3fd757ba9eddc8d21c1382c18137b40e4 | SQL | shimne/zoo | /src/com/shimne/zoopu/album/dao/sqlmap/Album.sql | UTF-8 | 961 | 2.875 | 3 | [] | no_license | CREATE TABLE ZOOPU_ALBUM
(
id BIGINT(20) NOT NULL AUTO_INCREMENT,
name VARCHAR(50) NOT NULL DEFAULT '',
cover VARCHAR(100) DEFAULT '',
description VARCHAR(100) DEFAULT '',
creatorId BIGINT(20) NOT NULL DEFAULT 0,
createTime BIGINT(20) NOT NULL DEFAULT 0,
updaterId BIGINT(20) NOT NULL DEFAULT 0,
updateT... | true |
3929b6788bd0a5ce90831edce9fe2c4188c6c46d | SQL | international-school-of-curitiba/TOTVSRM | /Classis/Financeiro/Bolsas/CLASSIS.Descontos.e.Bolsas.sql | UTF-8 | 3,980 | 3.734375 | 4 | [] | no_license | /* RELACAO DE COMPANHIAS Vs FUNDO DE DESENVOLVIMENTO */
/*
SELECT
TIPOALUNO, UMATRICPL.MATALUNO, EACOMPL.A_COMPANHIA,
EDESCLAN.PLANO,
CASE
WHEN EDESCLAN.PLANO LIKE '%50%' THEN '50'
ELSE
'100'
END AS DESCONTO,
EDESCLAN.VALOR1
FROM
EALUNOS
INNER JOIN UTABTIPO (NOLOCK) ON (UTABTIPO.CODTIPO =... | true |
8606cf7bef8915b6107bde0f991a7ca41b901220 | SQL | Sahil2510/Cruise-Travel-Website | /hostel.sql | UTF-8 | 4,754 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 03, 2021 at 08:58 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
9ee46966ef659c373d08749058a566f3b5596f67 | SQL | kseniausta/netology | /data scientist/01 sql/2019.02.16 Лабораторная работа "SQL и получение данных"/Создание схемы БД.sql | UTF-8 | 1,302 | 3.28125 | 3 | [] | no_license | -- Используя редактор сайта https://www.db-fiddle.com создать схему базы данных (создать таблицы и заполнить их). Использовать синтаксис PostgreSQL 10.
CREATE TABLE departament
(ID INTEGER PRIMARY KEY,
NAME VARCHAR) ;
CREATE TABLE employee (
ID INTEGER PRIMARY KEY,
DEPARTAMENT_ID INTEGER,
CHIEF_DOC_ID INTEGER,
... | true |
82aa3e5e7e4c1e2a448caa4dda7aaf07de1aadd3 | SQL | freemed/freemed-modules | /dosing/0.8.x/billing_etl.sql | UTF-8 | 4,610 | 3.515625 | 4 | [] | no_license | # $Id$
#
# Authors:
# Jeff Buchbinder <jeff@freemedsoftware.org>
#
# FreeMED Electronic Medical Record and Practice Management System
# Copyright (C) 1999-2008 FreeMED Software Foundation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | true |
84028afa1fc6e425307da6b85737acfcf1f8be97 | SQL | AntoniadisPanos/Private_Scool-ConsoleApp-Ado.NET-SQL-Database-First | /SELECT_Queries/TrainersPerCourse_List.sql | UTF-8 | 339 | 3.59375 | 4 | [] | no_license | --------Trainers Per Course--------
SELECT
Trainer.ID,
Trainer.LastName,
Trainer.FirstName,
Trainer.[Subject],
Course.ID,
Course.Title,
Course.[Type],
Course.Stream
FROM TrainersPerCourse
JOIN Course
ON Course.ID=TrainersPerCourse.CourseID
JOIN Trainer
ON Trainer.ID=TrainersPerCourse.TrainerID
order b... | true |
a8fe79146e38b992523e17fe54630b9cce8a2f91 | SQL | Snjeza2104/knjiznicaMySQL | /knjiznica.sql | UTF-8 | 7,537 | 3.390625 | 3 | [] | no_license | DROP DATABASE IF EXISTS knjiznica;
CREATE DATABASE IF NOT EXISTS knjiznica;
USE knjiznica;
CREATE TABLE autor(
autorID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
prezime VARCHAR(25) NOT NULL,
ime VARCHAR(25) NOT NULL
);
CREATE UNIQUE INDEX prezime_ime ON autor(prezime, ime);
CREATE TABLE izdavac(
izdavac... | true |
81ed823d02fef5d50d6994902158c39d6cea3fe7 | SQL | rayanc/Pecuniaus | /Database/Stored Procedures/avz_usr_spRetrieveAllTaskAssignmentsGrouped.sql | UTF-8 | 2,192 | 3.640625 | 4 | [] | no_license |
drop procedure if exists avz_usr_spRetrieveAllTaskAssignmentsGrouped;
delimiter $$
create procedure avz_usr_spRetrieveAllTaskAssignmentsGrouped
(
)
begin
Select * from (
Select distinct
Id UserID,UserName,
SUM(IF(X.TaskName='PQ-Merchant Review',TaskCount,0)) As 'PQMerchantReview',
SUM(IF(X.TaskName='PQ-Scan Docume... | true |
c85578f45cf3e9b2aff4bd7ea6e2d03787aaa10a | SQL | isaiasspiry77/CC_Ejercicio_Practico2021 | /BaseDatos/Consultas_bdConcredito.sql | UTF-8 | 1,173 | 3.03125 | 3 | [] | no_license | use bd_concredito;
select *from c_estados;
select *from c_tipos;
select *from tb_prospectos;
select *from tb_seguimientoprospectos;
/* --------------- INSERT ESTADOS ------------------- */
insert into
C_Estados (ClaveEstado, DescEstado)
values
/* Estados de usuarios */
("AC","Activo"),("IA","Inactivo"),
/* Estado... | true |
a19f330608eca58327048f3d6ae8eb68f2ae9b8f | SQL | kuixiao/SelectCourse | /db/tb_student.sql | UTF-8 | 386 | 2.75 | 3 | [] | no_license | CREATE TABLE tb_student(
Sno char(6) NOT NULL PRIMARY KEY comment '学号',
Smajor char(20) NOT NULL comment '专业',
Sname varchar(20) NULL comment '名字',
Ssex char(2) NOT NULL comment '性别' check(Ssex = '男' or Ssex = '女'),
Sbirthday date NOT NULL comment '出生日期',
Spassword varchar(20) NOT NULL comment '密码',
Sclass varch... | true |
ac5069c68d014d0e4560fac8dcc48f36b8d1d6af | SQL | tracy80s2003/employee-tracker | /db/seeds.sql | UTF-8 | 806 | 3.203125 | 3 | [] | no_license | USE employee_trackerDB;
-- Creates new rows containing data in all named columns --
INSERT INTO department (deptName) VALUES
("Marketing"),
("Human Resources"),
("Sales"),
("Admin"),
("IT");
INSERT INTO role (title, salary, department_id) VALUES
("Marketing Coordinator", 45000.00, 1),
("Marketing Manager", 75000.00, ... | true |
eb93d1a8dbe81abe5bc33460f5ff62c2d22c279f | SQL | Ljhansi-pk/ICS | /ICS/.svn/pristine/7f/7f1983e72417305ddb32f60168ac6093706fe93f.svn-base | UTF-8 | 2,053 | 3.0625 | 3 | [] | no_license | set serveroutput ON
DECLARE
PC_RETCURSOR ICS.CERTIFICATION_CRUD.retCursor;
PS_SEARCHCRITERIA VARCHAR2(200);
PS_SEARCHTYPE VARCHAR2(200);
li_BrandCode ICS.BRAND.BRANDCODE%type;
li_SKUID ICS.PRODUCT.SKUID%type;
ls_SKU ICS.PRODUCT.SKU%type;
ls_SIZESTAMP ICS.PRODUCT.SIZESTAMP%type;
... | true |
f19b6f9d7d1aef510fb7f0e357a28e3db8d92cab | SQL | nhuyhoang1305/message-queue | /db/db.sql | UTF-8 | 2,244 | 2.796875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 05, 2021 at 11:26 AM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.4.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
e0958df9698adfbb810c5a1f4e691869a79ef301 | SQL | dewyisle/dbSql | /2019_11_15.sql | UHC | 10,183 | 4.15625 | 4 | [] | no_license | -- ü ȸؾϴ !
SELECT SUM(sal)
FROM emp;
--emp̺ empno÷ PRIMARY KEY
-- PRIMARY KEY = UNIQUE + NOT NULL;
--UNIUE => ش ÷ UNIQUE INDEX ڵ
ALTER TABLE emp ADD CONSTRAINT pk_emp PRIMARY KEY (empno);
EXPLAIN PLAN FOR
SELECT *
FROM emp
WHERE empno=7369;
SELECT *
FROM TABLE(dbms_xplan.display);
/*
Plan hash value: 29495441... | true |
f8816e584ae6df7c43ade47a8b1acb3c5c8eaf36 | SQL | ZhaoYu1105/yz | /com.yz.edu.document/1.5/us.us_task_card.sql | UTF-8 | 791 | 3.40625 | 3 | [] | no_license | CREATE TABLE `us_task_card` (
`id` varchar(50) NOT NULL COMMENT '领取任务ID',
`user_id` varchar(50) NOT NULL COMMENT '用户ID',
`task_id` varchar(50) NOT NULL COMMENT '任务ID',
`task_count` varchar(10) NOT NULL COMMENT '任务数',
`complete_count` varchar(10) DEFAULT '0' COMMENT '完成数',
`complete_status` char(1) DEFAULT '... | true |
fa80c5cf58ee3b2c9b8357679c3b66fedaeb9b30 | SQL | JohnnyBss/DBScripts.Tables | /User.sql | UTF-8 | 677 | 3.390625 | 3 | [] | no_license | USE CBSS;
DROP TABLE IF EXISTS `User`;
CREATE TABLE `User` (
`UserID` INT NOT NULL AUTO_INCREMENT,
`BankID` INT NOT NULL ,
`BranchID` INT NOT NULL ,
`UserName` VARCHAR(15) NOT NULL ,
`Cellphone` VARCHAR(11) NOT NULL ,
`Password` VARCHAR(15) NOT NULL ,
`InUser` VARCHAR(15) NOT NULL DEFAULT 'sys',
`InDate` TIMEST... | true |
9d995461bca25ae25f1eb187fb25c6d0780ada45 | SQL | saschenbeck/database-exercises | /join_exercises.sql | UTF-8 | 1,707 | 4.34375 | 4 | [] | no_license | USE employees;
# shows each department along with the name of the current manager for that department.
SELECT d.dept_name AS Department_Name, CONCAT(e.first_name, ' ', e.last_name) AS Department_Manager
FROM employees as e
JOIN dept_manager as d_Manager
ON d_Manager.emp_no = e.emp_no
JOI... | true |
307d43bd1636178b39fe41d8ca4eb1d7930af954 | SQL | igorbcoelho/SQL | /SQLs 2.0/Query - Excluir baixa do borderô eletrônico.sql | UTF-8 | 859 | 3.234375 | 3 | [] | no_license |
-- EXCLUIR AS BAIXAS DO BORDERÔ ELETRÔNICO
-- EXCLUIR BAIXAS DOS TITULOS
DELETE FROM FINANCAS.BAIXAS
WHERE ID IN ('c500b7a8-6533-4f8c-a474-e4bc9fd4a1a8', '5ed84812-f19b-4db5-a9c6-328b44ac7b35');
-- EXCLUIR LANÇAMENTOS EM CONTAS
DELETE FROM FINANCAS.LANCAMENTOSCONTAS
WHERE LANCAMENTOCONTA IN ('2a71844a-cc05-4d10-a10... | true |
31cf5df3968d3478bf977c11a444e7d4c61412a8 | SQL | devikholilah/PROJECT-GIS-APPS-DATABASE-MYSQL | /db_aplikasiku1811500057.sql | UTF-8 | 5,110 | 2.921875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 06, 2021 at 10:20 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
ebcbf783f3e0026f85ad1929dc97b6e9f201ea2b | SQL | manoldzhermanski/Databases-Workshop-Project | /loadData.sql | UTF-8 | 4,217 | 2.53125 | 3 | [] | no_license | SET SCHEMA FN72OO3;
INSERT INTO HOTEL(NAME, LOCATION, PARKING, SWIMMINGPOOL, FITNESS, WIFI, SPA, ROOMSERVICE, RESTAURANT)
VALUES
('Novotel Roma','Rome',1,1,1,1,1,1,1),
('Roma Vintage','Rome',0,0,0,1,0,1,0),
('Le Gray d''Albion','Cannes',1,1,1,1,1,1,1),
('Le Fouquet''s','Paris',0,1,1,1,1,1,1),
('La Residencia',... | true |
dc4783accafeb0e3f005b4867dc7f35d1f83e547 | SQL | zachcb/peak-services | /src/database/sql/create-location.sql | UTF-8 | 254 | 2.53125 | 3 | [
"MIT"
] | permissive | DO
$do$
BEGIN
IF NOT EXISTS
(SELECT * FROM locations
WHERE id = $1
AND name = $2) THEN
else
INSERT INTO locations (
id,
name,
coordinates
)
VALUES ($1, $2, $3)
RETURNING *
end if;
end;
$do$
| true |
32e4a3f74e972b5feea60efe4496297d01b2ed21 | SQL | ddorori7/SQL | /02-DML-join-aggregation.sql | UTF-8 | 6,713 | 4.53125 | 5 | [] | no_license | ----------
-- JOIN
----------
--먼저 employees와 departments 를 확인
DESC employees;
DESC departments;
-- 두 테이블로부터 모든 레코드를 추출: Cartition Product or Cross Join
SELECT first_name, emp.department_id, dept.department_id, department_name
FROM employees emp, departments dept
ORDER BY first_name;
-- 테이블 조인을 위한 조건 부여할 수 있다.
SELEC... | true |
3a6ae1c69455463a7e346d96f4891748c2c68557 | SQL | JosephVales/Flight-Booking-System | /CorrelatedSubQueries.sql | UTF-8 | 355 | 3.484375 | 3 | [] | no_license | -- Get invoices that are larger than the client's average invoice amount
-- For each client find the avg invoice amount
-- For each client return the invoices larger than the avg
USE sql_invoicing;
SELECT *
FROM invoices i
WHERE invoice_total > (
SELECT
AVG(invoice_total)
FROM invoices
WHERE client_id = ... | true |
fa949be39761e70e231acf7792dec3ab5e926873 | SQL | abernazzani/PFA.bancos | /pfa_bancos.sql | UTF-8 | 16,776 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 04-11-2016 a las 21:28:01
-- Versión del servidor: 10.1.16-MariaDB
-- Versión de PHP: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... | true |
6afe556dea28b971abae51b4da89f75414929900 | SQL | fufylev/GeekBrains | /Data_Bases_interactive/HW_5/lesson_5.sql | UTF-8 | 4,221 | 4.21875 | 4 | [] | no_license | DROP TABLE IF EXISTS rubrics;
CREATE TABLE rubrics (
id SERIAL PRIMARY KEY,
name VARCHAR(255) COMMENT 'Название раздела',
UNIQUE unique_name(name(10))
) COMMENT = 'Разделы интернет-магазина';
INSERT INTO rubrics VALUES
(DEFAULT, 'Мат платы'),
(DEFAULT, 'Видеокарты'),
(DEFAULT, 'Сетевая карта'),
(DEFAULT, 'Дисковод... | true |
34a3357a31964a2d1028271d154d5b69b6408287 | SQL | jjotatp/chamada-ebd-sistema | /dados/sql/professor.sql | UTF-8 | 1,845 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 26-Fev-2018 às 03:44
-- Versão do servidor: 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_SE... | true |
a58368dbca3ab400b3305779ac13853cad4e235e | SQL | Rmecan/SQLLoader | /bin/dbsource/GetDBSourceList.sql | SHIFT_JIS | 377 | 2.703125 | 3 | [
"MIT"
] | permissive | SET HEADING OFF;
SET NEWPAGE NONE;
SET FEEDBACK OFF;
SET PAGESIZE 0;
SET VERIFY OFF;
SET TAB OFF;
SET TRIMSPOOL ON;
SET LINESIZE 32767;
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
SELECT name
FROM user_source
WHERE type = UPPER('&1')
AND name not like 'BIN$%' -- ɃS~ɂ͗vȂ
GROUP BY name
ORDER BY na... | true |
fe7cce9f32051995c6625f680d09030d170e5b74 | SQL | khotilov/cmssw | /CondTools/OracleDBA/monitorsql/dbamisc/weekly_report.sql | UTF-8 | 2,220 | 3.703125 | 4 | [] | no_license | /* VIEWS */
create or replace force view expiring_accounts as
select "USERNAME", "EXPIRY_DATE", "SERVER"
from (
select username, expiry_date , 'INT2R' as server
from dba_users
union select username, expiry_date , 'INT9R' as server
from dba_users@int9r.cern.ch
union select username, expiry_date , 'C... | true |
2fc8f551e01832cc0b387022ce8eaba6b5d258df | SQL | yellowbright/docs | /gyxr/国誉91/91docker_config/clickhouse/ga/metadata/vview_huigou/FactReturnLogs.sql | UTF-8 | 707 | 3.140625 | 3 | [] | no_license | ATTACH VIEW FactReturnLogs
(
`id` Int64,
`DateKey` UInt32,
`returned_at` Date,
`SHOPKey` Int64,
`SKUKey` Int64,
`return_prd_qty` Nullable(Float32),
`return_amt` Nullable(Float32),
`reason` Nullable(String),
`order_no` Nullable(String),
`return_no` Nullable(String)
) AS
S... | true |
fc0e47660a8441f5f075d4b8ea0490e255e634e9 | SQL | radtek/abs3 | /sql/mmfo/bars/Data/tts/et_010.sql | WINDOWS-1251 | 30,362 | 2.765625 | 3 | [] | no_license | set lines 1000
set trimspool on
set serveroutput on size 1000000
prompt / !!3
prompt : :STOP ! =
declare
cnt_ number;
begin
--------------------------------
-- --
--------------------------------
begin
insert into tts(tt, name, dk, nlsm, kv, nlsk, kvk, nlss, nlsa, nlsb, mfob, flc, fl... | true |
5f977e1eb670d3d6def97bfdf9fb2ed8c7ef2685 | SQL | yaozd/com.yzd.shiro.root | /.doc/shiro4yzd-2019-05-06-version.sql | UTF-8 | 4,454 | 3.40625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 192.168.1.238
Source Server Version : 50725
Source Host : 192.168.1.238:3306
Source Database : shiro4yzd
Target Server Type : MYSQL
Target Server Version : 50725
File Encoding : 65001
Date: 2019-05-21 16:47:15
*/
SET FOREIGN_KEY_CHECK... | true |
dc97f86334a0a64fee3bf6fb79aa401b67936993 | SQL | date-night-28/date-night | /sql/ddl-database.sql | UTF-8 | 1,125 | 3.484375 | 3 | [
"Apache-2.0"
] | permissive | ALTER DATABASE cap28_datenight CHARACTER SET utf8 COLLATE utf8_unicode_ci;
DROP TABLE IF EXISTS favorite;
DROP TABLE IF EXISTS activity;
DROP TABLE IF EXISTS profile;
CREATE TABLE profile(
profileId BINARY(16) NOT NULL,
profileActivationToken CHAR(32),
profileEmail VARCHAR(128) NOT NULL,
profileHash CHAR(97) NOT NU... | true |
e8c8e7830bcc01460573146da3072dee2785b96e | SQL | radtek/Scripts | /scripts/PLSQL/TSPIR_FP.sql | ISO-8859-1 | 7,722 | 2.515625 | 3 | [] | no_license | log do restore do agent
tail -100f /usr/openv/netbackup/logs/user_ops/dbext/logs/29554.0.1340221018
------------------------------------ RESTORE ------------------------------------
export NLS_DATE_FORMAT="YYYYMMDDHH24MISS"
rman target / catalog RMAN/TRR_RMAN_123@oragc trace=$ADM/logs/restore_fp.log <<eof
SET PARA... | true |
bf9f55e2b09be0db7a2f48c693d03db69053f17e | SQL | Jobayer-Tuser/MySQL | /update.sql | UTF-8 | 420 | 3.0625 | 3 | [] | no_license | -- [=@=> To Update a Specific or All Column Data Into The Table
UPDATE `your_table_name`
SET `salary` = 12500, `updated_at` = '2020-06-08 08:27'
WHERE `id` = 2;
UPDATE `your_table_name`
SET `salary` = 12500, `updated_at` = '2020-06-08 08:27'
WHERE `id` IN(1,3,5,7);
-- [=@=> To Update Same Data to Al... | true |
d420cc7517c7e32bf5d453fbc88d72c9c187916e | SQL | thibautvangoethem/IR_lucene | /src/main/resources/create.sql | UTF-8 | 542 | 2.53125 | 3 | [] | no_license | DROP TABLE IF EXISTS documents;
CREATE TABLE documents (
Id INTEGER PRIMARY KEY,
PostTypeId INTEGER,
AcceptedAnswerId INTEGER,
ParentId INTEGER,
CreationDate DATE,
Score INTEGER,
ViewCount INTEGER,
Body TEXT,
LastEditDate DATE,
LastActivityDate Date,
Title TEXT,
Tags TEX... | true |
97d79f38ebd1027ebcc7154b9e6ecf424f9bb5b2 | SQL | praveenselvam/iWallet | /db/iWallet_2010-08-15.sql | UTF-8 | 2,540 | 3.109375 | 3 | [] | no_license | # Sequel Pro dump
# Version 2492
# http://code.google.com/p/sequel-pro
#
# Host: 127.0.0.1 (MySQL 5.1.49)
# Database: iWallet
# Generation Time: 2010-08-15 13:55:10 +0530
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_C... | true |
2895520bd5db5206232e375b7f9855e934ef93ca | SQL | alejjanadormar/telmarket1 | /telemarket (1).sql | UTF-8 | 43,646 | 2.96875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 27-04-2016 a las 06:02:40
-- Versión del servidor: 5.7.9-log
-- Versión de PHP: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... | true |
548c892db1242deff5748cf59ba848506eb9fb8e | SQL | ne8/test | /authorization-server/src/main/resources/db/migration/V1__init.sql | UTF-8 | 2,290 | 3.296875 | 3 | [] | no_license | CREATE SCHEMA IF NOT EXISTS users;
CREATE TABLE IF NOT EXISTS users.users (
id BIGINT PRIMARY KEY ,
username VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
password TEXT,
first_name VARCHAR(255) NOT NULL,
... | true |
0994b8c83b904dab653aee62e5e7db7d0bdef0e1 | SQL | leyanessantiago/contact-list-api | /prisma/migrations/20210114071337_init/migration.sql | UTF-8 | 299 | 3.046875 | 3 | [
"MIT"
] | permissive | -- CreateTable
CREATE TABLE "Contact" (
"id" SERIAL,
"email" TEXT NOT NULL,
"name" TEXT NOT NULL,
"phone" TEXT NOT NULL,
"address" TEXT NOT NULL,
"avatar" TEXT NOT NULL,
PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Contact.email_unique" ON "Contact"("email");
| true |
607384ac4f5ce85c562706b9a9c7e24b45927b74 | SQL | mila89/Database-MSSQL | /SubqueriesandJOINs/1.Employee Address.sql | UTF-8 | 165 | 3.40625 | 3 | [] | no_license | select top(5) EmployeeID, JobTitle, e.AddressID, a.AddressText
from Employees as e
INNER JOIN Addresses AS a
ON e.addressID=a.AddressID
order by e.AddressID; | true |
30070d8489927ad87be88738e6728bc167f7e02c | SQL | darold/pgFormatter | /t/test-files/expected/ex22.sql | UTF-8 | 1,631 | 3.671875 | 4 | [
"Artistic-2.0"
] | permissive | SELECT
code.code,
properties_code.valeur,
properties_code1.valeur,
properties_code2.valeur
FROM
code
INNER JOIN linkcode ON (code.id_code = linkcode.id_codeparent)
INNER JOIN linkcode linkcode1 ON (linkcode.id_codeenfant = linkcode1.id_codeparent)
INNER JOIN code code1 ON (linkcode1.id_c... | true |
ed45f6da3b677497721aae1c46101bc24013a9f7 | SQL | CUBRID/cubrid-testcases | /sql/_14_mysql_compatibility_2/_04_table_related/_02_alter_change_column/_16_shared_attribute/cases/type_change_date.sql | UTF-8 | 1,467 | 3.21875 | 3 | [
"BSD-3-Clause"
] | permissive | ---- ALTER TABLE ... CHANGE COLUMN
-- class attribute
-- type change from int
-- to short
create table t1 (d1 date shared date'2001-01-04', i2 int);
insert into t1 values (date'2001-01-04',1),(date'2001-01-04',2);
update t1 set t1.d1=date'2001-05-09';
select * from t1 order by 1,2;
show columns in t1;
alter tabl... | true |
46d65b5a180ed2b8ba5ac9ad6e5b1d27f4a0ed97 | SQL | almadrasa/t0m | /create_tables.sql | UTF-8 | 757 | 3.375 | 3 | [] | no_license | CREATE TABLE users (
avatar VARCHAR(80),
followers INTEGER NOT NULL,
following INTEGER NOT NULL,
id INTEGER PRIMARY KEY,
name VARCHAR(50) NOT NULL,
uname VARCHAR(32) NOT NULL,
about VARCHAR(150),
likes INTEGER NOT NULL,
answers INTEGER N... | true |
04d23567ce5eec1a4d10844ffc86397a95fafa69 | SQL | IlyaSamoylov45/Coding-Challenges-and-Exercises | /Leetcode/Done/1731_The_Number_of_Employees_Which_Report_to_Each_Employee.sql | UTF-8 | 2,054 | 4.4375 | 4 | [] | no_license | -- Table: Employees
--
-- +-------------+----------+
-- | Column Name | Type |
-- +-------------+----------+
-- | employee_id | int |
-- | name | varchar |
-- | reports_to | int |
-- | age | int |
-- +-------------+----------+
-- employee_id is the primary key for this table.
-- This... | true |
cf7535cae69b3bce32fc5f33c23f5d0fa178f979 | SQL | skammers/fellesprosjekt-TDT4140 | /DB.sql | UTF-8 | 2,012 | 3.828125 | 4 | [] | no_license | CREATE TABLE User(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(50) NOT NULL,
firstName VARCHAR(30) NOT NULL,
lastName VARCHAR(30) NOT NULL,
position VARCHAR(30),
phoneNumber VARCHAR(20),
hashedPassword CHAR(64) NOT NULL,
INDEX (email)
);
CREATE TABLE UserGroup(
id INT N... | true |
e92c051c778dd6eb300cf573bddaa9ad14da2ad9 | SQL | acgiesbrecht/mgweb | /modules/core/db/update/postgres/20/200328-1-createTblConfiguraciones.sql | UTF-8 | 863 | 2.578125 | 3 | [] | no_license | create table TBL_CONFIGURACIONES (
ID serial,
--
PERIODO_FISCAL_ACTIVO integer,
FORMATO_FACTURA varchar(50) not null,
FORMATO_AUTOFACTURA varchar(50) not null,
FORMATO_NOTA_DE_CREDITO varchar(50) not null,
FRECUENCIA_COBRO_COLECTAS integer not null,
MODO_IMPRESION_TRANSFERENCIAS integer ... | true |
b0cddec8a0f5c3d0f239748352cceb100ed9e28d | SQL | YujunWu-King/university | /src/main/resources/sql/TZMaterialInterviewReviewBundle/material/TzGetMaterialScoreItemInfo.sql | UTF-8 | 461 | 3.6875 | 4 | [] | no_license | SELECT
A.TZ_ZLPS_SCOR_MD_ID,
B.TREE_NAME ,
C.TZ_SCORE_ITEM_ID,
C.DESCR,
C.TZ_SCORE_ITEM_TYPE,
D.TREE_NODE_NUM,
D.TREE_LEVEL_NUM
FROM
PSTREENODE D,
PS_TZ_CLASS_INF_T A,
PS_TZ_MODAL_DT_TBL C,
PS_TZ_RS_MODAL_TBL B
WHERE
D.TREE_NAME=B.TREE_NAME
AND D.TREE_NODE=C.TZ_SCORE_ITEM_ID
AND B.TZ_JG_ID=C.TZ_JG_ID... | true |
e19084a2aa81e08b555d3217c47b0063b19f78e9 | SQL | brunohesilva/BancoDeDados | /SQL Projects/01_SCRIPT_DDL_PSales.sql | UTF-8 | 520 | 3.265625 | 3 | [] | no_license | CREATE DATABASE M_PSales;
USE M_PSales;
CREATE TABLE Cursos
(
IdCurso INT PRIMARY KEY IDENTITY
,Nome VARCHAR(200)UNIQUE NOT NULL
);
CREATE TABLE Disciplinas
(
IdDisciplina INT PRIMARY KEY IDENTITY
,Nome VARCHAR(200) NOT NULL
,IdCurso INT FOREIGN KEY REFERENCES Cursos (IdCurso)
);
CREATE TABLE Alunos
(
IdAl... | true |
d32188938be363cadd19d98d94ccb9bb1949ee93 | SQL | uscxiaoyu/Database | /.ipynb_checkpoints/jd_cfunding-checkpoint.sql | UTF-8 | 2,720 | 3.859375 | 4 | [] | no_license | create database jd_crowdfunding character set utf8;
use jd_crowdfunding;
-- 公司表
create table company (
company_name varchar(100) primary key,
company_address varchar(255),
company_phone varchar(15),
company_hours varchar(40)
) default character set utf8;
-- 发起者表
create table promoter (
promoter_name va... | true |
85975807c89bfda1b6ee418fbbb85852ba730f30 | SQL | ort-cloud/review-spew-server | /sql-scripts/create.reviews.table.sql | UTF-8 | 298 | 2.828125 | 3 | [] | no_license | DROP TABLE IF EXISTS reviews;
CREATE TABLE reviews (
reviews_id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
movies_id INTEGER REFERENCES movies(movies_id) NOT NULL,
users_id INTEGER REFERENCES users(users_id) NOT NULL,
review_author TEXT,
review_url TEXT,
review_text TEXT
); | true |
bf98f7e0c4c72053fd240eaa0d17efe26c2ace17 | SQL | 2017JosePablo/Paradigmas | /content/backup/30-septiembre-2017/dbasoturga(2).sql | UTF-8 | 16,715 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 01-10-2017 a las 00:27:31
-- Versión del servidor: 10.1.25-MariaDB
-- Versión de PHP: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
741eca377955f4725f8d5b3dc51cad99906a25db | SQL | bellmit/flexdb | /1.BDSHOST/Parameters/SEARCH_SEARCHFLD/BDS_SEARCH_SEARCHFLD_BRKFEEGRP.sql | UTF-8 | 2,078 | 3 | 3 | [] | no_license | --
--
/
DELETE SEARCH WHERE SEARCHCODE = 'BRKFEEGRP';
INSERT INTO SEARCH (SEARCHCODE,SEARCHTITLE,EN_SEARCHTITLE,SEARCHCMDSQL,OBJNAME,FRMNAME,ORDERBYCMDSQL,TLTXCD,CNTRECORD,ROWPERPAGE,AUTOSEARCH,INTERVAL,AUTHCODE,ROWLIMIT,CMDTYPE)
VALUES ('BRKFEEGRP','Quản lý nhóm chung phí môi giới','Group broker fee management','SELE... | true |
1b579207e6ffc9c9d98e907c45e059a650c1563a | SQL | javierlona/contact-form-connected-to-database | /createdb.sql | UTF-8 | 519 | 3.09375 | 3 | [
"MIT"
] | permissive | CREATE DATABASE wd_form;
USE wd_form;
CREATE TABLE person (
person_id int(11) NOT NULL AUTO_INCREMENT,
submit_time_stamp datetime NOT NULL,
person_name varchar(70) NOT NULL,
person_email varchar(60) NOT NULL,
person_phone varchar(15) NOT NULL,
CONSTRAINT wd_form_person_id_pk PRIMARY KEY (person_id),
... | true |
0a4273bba063487258cfe4e5c20d019afacb8e95 | SQL | syan6010/ExpressdvdSystem | /store.sql | UTF-8 | 11,140 | 2.921875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Type : MySQL
Source Server Version : 50636
Source Host : localhost:3306
Source Schema : store
Target Server Type : MySQL
Target Server Version : 50636
File Encoding : 65001
Date: 31/05/20... | true |
08132472ca1474eccb1fde7d58f5379191fbfd41 | SQL | Mylanos/Database_systems_project-IDS- | /task4/untrivial_triggers.sql | UTF-8 | 621 | 2.84375 | 3 | [] | no_license | -- vytvoření alespoň dvou netriviálních databázových triggerů vč. jejich předvedení, z toho právě jeden trigger pro
-- automatické generování hotnot primárního klíče nějaké tabulky ze sekvence (např. pokud bude při vkládání záznamů
-- do dané tabulky hodnota primárního klíče nedefinována, tj. NULL),
CREATE OR REPLAC... | true |
01faf2c6dba2fcad70a29e750b907eed3b9ce897 | SQL | SebEdena/PJS4 | /pjs4.sql | UTF-8 | 4,727 | 3.390625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Client : 127.0.0.1
-- Généré le : Mar 21 Mars 2017 à 15:20
-- Version du serveur : 5.7.14
-- Version de PHP : 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... | true |
fa6fa8c15918873fdd6184cb175cf8577b093dd3 | SQL | galigaribaldi/BDD-Oracle | /Proyecto/Parte 4/s-06-autos-main-triggers.sql | UTF-8 | 3,497 | 2.65625 | 3 | [] | no_license | --@Autor: Cabrera Garibaldi Hernan Galileo
--@Fecha creación: 06/02/2021
--@Descripción: Script principal - creación de triggers
clear screen
whenever sqlerror exit rollback;
prompt =====================================
prompt Creando triggers para hgcg_s1
prompt =====================================
c... | true |
b59ef0b40ceecfb0df4b84e495495941e2259fe1 | SQL | fstanchese/corporativo | /corporativo/sql/Matric/Matric_qCurrSerie.sql | UTF-8 | 635 | 3.15625 | 3 | [] | no_license | select
min(DuracXCi.Sequencia) as SerieI,
max(DuracXCi.Sequencia) as SerieF
from
pletivo,
duracxci,
turma,
curr,
curso,
currofe,
turmaofe,
matric,
wpessoa
where
matric.state_id > 3000000002002
and
currofe.pletivo_id = pletivo.id
and
turma.duracxci_id = duracxci.id (+)
and
turmaofe.turma_id... | true |
b6a9defeb11dc26ad687f008fb514a677e298f52 | SQL | carlsverre/singlestore-near-analytics | /schema.sql | UTF-8 | 9,988 | 4.09375 | 4 | [
"Apache-2.0"
] | permissive | drop database if exists near;
create database near;
use near;
-- the replication_meta table contains one row per range of blocks replicated to
-- this database. The block_height field refers to the highest block_height in
-- the range of replicated blocks.
CREATE TABLE replication_meta (
block_height DECIMAL(20,0... | true |
9157f256134494cb3113590f0be8b7a9f09b5faf | SQL | adriandeadly/Cosas_que_tu-_no_entiendes | /estadias (1).sql | UTF-8 | 3,291 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 31-07-2020 a las 05:30:02
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
5fafbdbbab3b04d0dfe04525c09ecc70a2bb1efa | SQL | rdxunlock/MinKernel | /minkernel.sql | UTF-8 | 11,776 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2017-09-18 16:34:59
-- 服务器版本: 5.6.32-log
-- PHP Version: 7.1.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 ... | true |
6f7e447e8e0552d4539952010a39e1e3098cefd4 | SQL | wifido/spms-code | /code/database/V1.3.1/考勤数据库脚本/2_tabe_TI_SAP_ZTHR_PT_DETAIL_TMP.sql | GB18030 | 4,041 | 2.96875 | 3 | [] | no_license | -- Create table
create table TI_SAP_ZTHR_PT_DETAIL_TMP
(
MANDT VARCHAR2(9) default '000' not null,
PERNR VARCHAR2(24) default '00000000' not null,
BEGDA VARCHAR2(30) default '' not null,
NACHN VARCHAR2(120) default '' not null,
ORGTX VARCHAR2(120) default '' not null,
O... | true |
fb0caf2e1c93b940004462740ff360a11cbd986f | SQL | gyokkoo/db-fmi-2019 | /02.Many-Relations/2-PC/1-SelectMakerSpeed.sql | UTF-8 | 150 | 3.203125 | 3 | [] | no_license | SELECT product.maker, laptop.speed
FROM product, laptop
WHERE product.type LIKE 'laptop'
AND laptop.hd > 9
AND laptop.model = product.model;
| true |
705d04f7d3f24f11095d7c36b6b9f73802845079 | SQL | katooshka/sqlex | /057.sql | UTF-8 | 709 | 4.34375 | 4 | [] | no_license | -- Schema: Ships
-- For classes having irreparable combat losses and at least three ships in the database,
-- display the name of the class and the number of ships sunk.
WITH ship_classes AS (
SELECT classes.class class, name ship_name
FROM classes JOIN ships ON classes.class = ships.class
UNION
SELECT class... | true |
1db241b5c9a84685ee9bbc60d8188c856f2d1a8a | SQL | atikhashmee/maria-inventory | /db/maria.sql | UTF-8 | 11,629 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 15, 2018 at 05:46 PM
-- Server version: 10.1.33-MariaDB
-- PHP Version: 7.2.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
fc4050643ebc809e98f6ceaf335aa4021f1948f2 | SQL | AndrichardWS/SIPOK-APP | /DATABASE/dbsipok_app.sql | UTF-8 | 23,191 | 2.890625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 27 Sep 2020 pada 19.07
-- Versi Server: 10.1.25-MariaDB
-- PHP Version: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
e48ab8f2e30d65413227e70d4ed8f74d5ac6fbe9 | SQL | luoxialan/leetcode | /Problems/Database/601. Human Traffic of Stadium/601. Human Traffic of Stadium.sql | UTF-8 | 385 | 3.65625 | 4 | [] | no_license | # my solution
SELECT DISTINCT s1.*
FROM stadium s1, stadium s2, stadium s3
WHERE (
(s1.id = s2.id-1 AND s1.id = s3.id-2) OR
(s1.id = s2.id+1 AND s1.id = s3.id-1) OR
(s1.id = s2.id-1 AND s1.id = s3.id+1) OR
(s1.id = s2.id+2 AND s1.id = s3.id+1) OR
(s1.id = s2.id+1 AND s1.id = s3.id+2)
) AND s1.peopl... | true |
d0e3183e9d0fa8153b760d201b18e513ba291ad9 | SQL | nstelluto/nossolar | /nosso_lar.sql | UTF-8 | 10,827 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 11-Dez-2019 às 17:09
-- Versão do servidor: 5.6.34
-- 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 @OLD_CHARACT... | true |
80134f93d48314f716f25f629a1dd5848777a222 | SQL | davidfmatheson/lead-action | /data/05-county_table_fixes.sql | UTF-8 | 4,425 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | -- Alabama, Georgia, Indiana, Missouri all have a 'DeKalb' county which needs correcting
UPDATE county SET name = 'DeKalb' WHERE name = 'De Kalb';
-- In Illinois, 'LaSalle County' has no space (unlike Texas and Louisiana)
UPDATE county SET name = 'LaSalle' WHERE name = 'La Salle' AND id = 634;
-- In Florida, 'DeSoto Co... | true |
51df5dc62f973139aa1f75c9fd48eba376255c60 | SQL | edapigo/Planner | /Database/scheduler-data.sql | UTF-8 | 2,878 | 2.890625 | 3 | [] | no_license | /*
Authors: Edward Pino | Juan Pita
Date: 2021 - 03 - 17
Purpose: Scheduler Project | Object-oriented Programming (Oop)
*/
USE Scheduler;
INSERT INTO Accounts(userId, fName, lName, username, passwd, email) VALUES (101,"Tatyana","Chase","V1V4MU5","keb75ONm2Xa","eget@liberet.edu"),
(102,"Stone","Duffy","ridiculus... | true |
eea8530c17d232e7f222a56f4c819defa529809d | SQL | ezenteam2/EzenCrowdFunding | /gr2_kht/Servers/Scripts/b01_createTable.sql | UTF-8 | 2,549 | 4.40625 | 4 | [] | no_license | /*
# 테이블 만들기
1) 데이터 타입
2) 테이블의 제약조건 만들기
primary key
foreign key
not null
# 테이블의 관계 만들기
foreign key
# 데이터 등록 / 수정 / 삭제
# 테이블 간의 join 구문
1) 데이터 타입
- 데이터 베이스에 저장되는 데이터는 문자, 숫자, 날짜, 이미지 등과 같이 다양한 형식
- 실무에서 컬럼의 데이터 타입이나 길이의 결정은 DB 설계 단계에서 아주 중요!
- 설계 단계에서 잘못 설정된 데이터 타입은 응용 프로그램 개발을 어렵게 하고 성능을 저하시키는 요인
2... | true |
7f3473d87a4d921dc835391e08a0e30f0bc32a9c | SQL | HudsonFleur/Rent-A-Computer | /drop.sql | UTF-8 | 1,188 | 3 | 3 | [] | no_license | -- Hudson Fleurimond
-- CS 205-01
-- Fall 2019
-- drop.sql Version 2
-- Purpose: Script to drop all Rent-A-Computer Schema objects
-- Based on: Physical Schema, Version 3
-- Change Summary:
-- The results of this script will be spooled to
-- 'spoolDrop.txt'
\o 'spoolDrop.txt'
-- Output script execution data
\qec... | true |
f73753549aa565f00a57c62aa992bb458e580da2 | SQL | jimmyseraph/coffee-service | /docker/mysql/sql/2_t_coffee.sql | UTF-8 | 598 | 2.875 | 3 | [] | no_license | set names utf8mb4;
drop table if exists coffeedb.t_coffee;
create table coffeedb.t_coffee(
coffeeId bigint auto_increment primary key comment '咖啡商品ID',
coffeeName varchar(20) not null comment '咖啡名称',
price decimal(5,2) comment '咖啡价格'
) CHARACTER SET 'utf8mb4' comment '咖啡商品表';
insert into coffeedb.t_coffee... | true |
5b44bfd926539965139b0fcf7f3a31c807f4e3f0 | SQL | santiagoguinle/hogardexto | /db/structure/03_persons.sql | UTF-8 | 1,147 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE IF NOT EXISTS `persons` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`lastname` varchar(255) DEFAULT '',
`birthdate` date,
`password` varchar(255) DEFAULT '',
`avatar` varchar(255) ,
`cuil` varchar(14) DEFAULT '',
`firstdate` date,
`nickname` v... | true |
7397e8820233de31607657c1926396238ac5a838 | SQL | analyst045/dbt-Ahmad | /models/example/incremental_time.sql | UTF-8 | 371 | 3.09375 | 3 | [] | no_license |
{{ config(materialized='incremental',unique_key='time')}}
select
to_time(concat(T_HOUR::varchar, ':', T_MINUTE, ':', T_SECOND)) AS time,
*
from "SNOWFLAKE_SAMPLE_DATA"."TPCDS_SF10TCL"."TIME_DIM"
where to_time(concat(T_HOUR::varchar, ':', T_MINUTE, ':', T_SECOND)) <= current_time
{% if is_incremental() %}
and time ... | true |
6514b374b168ffae0aca85deb4a2d3cb63916362 | SQL | mmsolovev/mysql-basics | /lesson_7/task_1.sql | WINDOWS-1251 | 301 | 3.5625 | 4 | [] | no_license |
/*
users, orders .
*/
select u.name
from users as u
join orders as o on o.users_id = u.id
group by u.name
having count(o.id) > 0
;
| true |
66e59884f0eaf2c310c9206d99f50a6865f088cd | SQL | Claradev/gestiondestage | /stage.sql | UTF-8 | 5,234 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : sam. 27 jan. 2018 à 17:58
-- Version du serveur : 10.1.28-MariaDB
-- Version de PHP : 7.1.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4010... | true |
be6c280f203bcf91502bcb64baa8f1f4d9d9c622 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day12/select0136.sql | UTF-8 | 178 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-11T01:36:00Z' AND timestamp<'2017-11-12T01:36:00Z' AND temperature>=46 AND temperature<=61
| true |
397d30c99d799d54f5abf9e87335c479be03b231 | SQL | bpasbuddies/buddies2 | /MyProjects/eEMRT/EEMRT/Tables/INVOICE.sql | UTF-8 | 726 | 2.65625 | 3 | [] | no_license | CREATE TABLE eemrt.invoice (
invoice_id NUMBER NOT NULL,
contract_number VARCHAR2(200 BYTE) NOT NULL,
vendor VARCHAR2(200 BYTE) NOT NULL,
period_of_performance_id NUMBER NOT NULL,
invoice_number VARCHAR2(200 BYTE) NOT NULL,
invoice_date TIMESTAMP,
invoice_period_from DATE,
invoice_period_to DATE... | true |
89b6a0a45c8d51dd502795fcf4f2c92536305981 | SQL | dmalex619/rfm-wms | /_SQL/Check Acts between Logostics and WMS.sql | UTF-8 | 532 | 4 | 4 | [] | no_license | -- Check Acts between Logostics and WMS
select *
from (
select 'L.ACT.' + replace(str(LA.ID, 10), ' ', '0') as LERPCode,
count(LAG.ID) as LCount
from Acts LA with (nolock)
inner join ActsGoods LAG with (nolock) on LAG.ActID = LA.ID
group by LA.ID
) X
left join (
select WA.ERPCode as WERPCode,
count(WAG.... | true |
1f808e942f9c9649c2703766f82d629192bd672d | SQL | Chetin88/ejemplo | /Entornos/src/tema3/JMCMySQL.sql | UTF-8 | 3,284 | 3.703125 | 4 | [] | no_license | SET SESSION FOREIGN_KEY_CHECKS=0;
/* Drop Tables */
DROP TABLE IF EXISTS EQUIPO_HORARIO;
DROP TABLE IF EXISTS JUGADOR_EQUIPO;
DROP TABLE IF EXISTS EQUIPO;
DROP TABLE IF EXISTS CATEGORIA;
DROP TABLE IF EXISTS ENTRENADOR;
DROP TABLE IF EXISTS HORARIO;
DROP TABLE IF EXISTS JUGADOR;
DROP TABLE IF EXISTS POSICI... | true |
076337aff30b59519a934c4bcb802584730225cc | SQL | ShahakBH/jazzino-master | /bi/bi-reporting/src/main/resources/deltas/17.sql | UTF-8 | 513 | 3.234375 | 3 | [] | no_license | -- Table: TOURNAMENT_PLAYER_SUMMARY
CREATE TABLE TOURNAMENT_PLAYER_SUMMARY (
PLAYER_ID DECIMAL(16,2) NOT NULL DISTKEY SORTKEY,
TOURNAMENT_ID DECIMAL(16,2) NOT NULL,
POSITION integer NOT NULL,
PRIZE bigint NOT NULL,
PRIMARY KEY (PLAYER_ID,TOURNAMENT_ID),
FOREIGN KEY(PLAYER_ID) REFERENCES LOBBY_USER(PLAYER_ID... | true |
4f7ec1ac5636ee28316d242d48582b93cd39b75d | SQL | Gaya3-SQL/SQL_Exercise | /SQL_Scripts/Select_Count_SQL.sql | UTF-8 | 312 | 3.21875 | 3 | [] | no_license | --//This query uses count function to find count of rows in a table**--
Select Count(*) from Sales.Customer
Select Count(CustomerID) from Sales.Customer
Select Count(Distinct CustomerID) from Sales.Customer
Select Count(TerritoryID) from Sales.Customer
Select Count(Distinct TerritoryID) from Sales.Customer | true |
6bfc45aa1539f45ee7f14d650c89c9b23a28e47c | SQL | AgustinRamiroDiaz/LCC-TBD-Practica-Parcial-1 | /ConsultasParcial2019.sql | UTF-8 | 4,115 | 3.359375 | 3 | [] | no_license | --I
--AR
--1
pi Empleado, Departamento, Curso
(sigma
trabajaEn.departamento!=requiere.departamento or
realiza.curso=requiere.curso
(trabajaEn |x| realiza) x requiere)
/ requiere
E D C
E D C
'Agus' 'Ñoquis' 'RCP'
'Agus' 'Ñoquis' 'BaB'
'Litma' 'RRHH' 'CS'
'Facu' 'RRHH... | true |
a9ee28ec04bee18f2c3f7b6a62017377b98d579c | SQL | BenjaminHini/jdbc-project | /projet.sql | UTF-8 | 4,421 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : jeu. 04 nov. 2021 à 18:46
-- Version du serveur : 10.4.10-MariaDB
-- Version de PHP : 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... | true |
e5d6c121c0a81ae406427854d197681b9e12c38c | SQL | oranguice/Subscribe | /random_query/订阅生产游戏类内容被订阅用户下载数量_yapeng.sql | UTF-8 | 1,224 | 3.921875 | 4 | [] | no_license | select sum(d.col_downloads)
from (
select col_udid, sum(col_downloads) as col_downloads
from (
select col_udid, count(*) as col_downloads
from android.tb_click
where col_name = '安装' and col_item_id like '%GAME%' and p_date = {date} and col_url_normalize not like '/search_result%'
group by col_udid
union all... | true |
223ac003bc491e722f4c73607084edb6d93f17ce | SQL | robs23/SQLs | /NPD_SQL_SERVER/SapIdBySessionIdAndZfinIndex.sql | UTF-8 | 241 | 3.09375 | 3 | [] | no_license |
USE npd
SELECT DISTINCT oZfor.sapId as [Zfor order], op.SessionNumber
FROM tbZfin z LEFT JOIN tbOperations op ON op.zfinId=z.zfinId
LEFT JOIN tbOrders oZfor ON oZfor.orderId=op.orderId
WHERE op.SessionNumber=496 AND z.zfinIndex=34005471
| true |
a32b0208b8e1bc592fdec670264c0f6445257887 | SQL | qvdev-source/Oracle_Database_SQL_Certified_Associate | /07_Displaying_Data_from_Multiple_Tables.sql | UTF-8 | 10,916 | 4.34375 | 4 | [] | no_license |
/*
Displaying Data from Multiple Tables
- Understanding and Using Cartesian Products
- Using various types of Joins
- Using Non Equijoins
- Using Outer Joins
- Using Self-Joins
*/
/*
Cartesian Products:
- Retreiving data from multiple tables without using Joins
A Cartesian Product is formed when:
- A join c... | true |
2298664e6c445cc170aad590a70caa2a7850ab17 | SQL | garciparedes/animals-database | /definitions/tables/organizacion.sql | UTF-8 | 618 | 3.359375 | 3 | [] | no_license | /*
Tabla Organizacion
*/
CREATE TABLE organizacion (
id_responsable INTEGER NOT NULL,
cif VARCHAR(20) NOT NULL,
tipo VARCHAR(50) NOT NULL,
CONSTRAINT organizacion__unique_cif
UNIQUE (cif),
CONSTRAINT organizacion__clave
PRIMARY KEY (id_responsable),
CONSTR... | true |
a98cb008c3563e3d7811bff782b9b5fa893ebe82 | SQL | SkyFire/SkyFireDB | /character_updates/01_06_11_corpse_table.sql | UTF-8 | 1,432 | 2.96875 | 3 | [] | no_license | DROP TABLE IF EXISTS `corpse`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `corpse` (
`corpseGuid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Gl... | true |
516c5a7e50a4313590599148a904461afe7f0f48 | SQL | binbin0915/-Swing- | /sql/user.sql | UTF-8 | 1,486 | 2.96875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : MyConn
Source Server Version : 50527
Source Host : localhost:3306
Source Database : fly_tickets
Target Server Type : MYSQL
Target Server Version : 50527
File Encoding : 65001
Date: 2019-03-11 21:08:00
*/
SET FOREIGN_KEY... | true |
af31ecb6aa8f15c5dcf314b56d5f38c21fb04845 | SQL | young6435/aiajr202003 | /SQL/work6.sql | UTF-8 | 4,814 | 4.25 | 4 | [] | no_license | --2020.05.22. 금요일
1 마당서점의고객이요구하는다음질문에대해SQL 문을작성하시오.
(5) 박지성이구매한
도서의출판사수
;
select * from orders;
select * from customer;
select * from book;
select count(distinct b.publisher) -- 같은 출판사의 책을 구매할수있다. --join 사용
from customer c, orders o, book b
where c.custid = o.custid and o.bookid = b.bookid
and c.na... | true |
fbb1a47a106eba7a7d902d0bb6da2332f90589fe | SQL | YixueWang/Priniciples-of-Informatics | /assignment_5/query5.sql | UTF-8 | 437 | 3.640625 | 4 | [] | no_license | select name, total_7d_1-total_7d_18 as diff_7d, total_30d_1-total_30d_18 as diff_30d
from (select station, sum(7d) as total_7d_1, sum(30d) as total_30d_1
from fares_feb1
group by station) as f1
join(select station, sum(7d) as total_7d_18, sum(30d) as total_30d_18
from fares_jan18
group by station) a... | true |
a9ca7193c41b28d656741879a7719ba3e68d73d3 | SQL | surajvkm/alshamil | /query/3.seed-query.sql | UTF-8 | 52,585 | 2.578125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10.18
-- https://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Jan 30, 2018 at 06:45 AM
-- Server version: 5.5.45-37.4-log
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... | true |
ddb90ae32112b26876f9648f3941f02459445bf1 | SQL | erick113/tic84 | /second.sql | UTF-8 | 2,088 | 4.03125 | 4 | [] | no_license | DELIMITER$$
CREATE FUNCTION cats(customerName VARCHAR(30)) RETURNS INT
BEGIN
DECLARE q INT;
SELECT COUNT(m.idm) INTO q
FROM mascotas AS m
INNER JOIN especies AS e ON e.ide = m.ide
INNER JOIN clientes AS c ON c.idc = m.idc
WHERE c.nombre = customerName
AND e.nombre = "Gato";
RETURN q;
END$$
DELIMITER$$
CR... | true |
75b7958162c37eec5ec34fa666076fa8928923cb | SQL | szlzq/HQL | /setup.sql | UTF-8 | 702 | 3.703125 | 4 | [] | no_license | DROP TABLE IF EXISTS address;
DROP TABLE IF EXISTS employee;
CREATE TABLE employee(
id INTEGER PRIMARY KEY
, name VARCHAR(20) NOT NULL
, salary NUMERIC(15,2) NOT NULL DEFAULT 0)
CREATE TABLE address(
id INTEGER PRIMARY KEY
, address VARCHAR(50) NOT NULL DEFAULT ''
, zipCode VARCHAR(10) DEFAULT 0
, city VA... | true |
284ab8418e8e4490075334d2479ebc2d4866bb9f | SQL | JBaeza89/mustruo | /BBDD/script.sql | UTF-8 | 12,607 | 3.390625 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Tue Apr 28 09:31:14 2020
-- Model: New Model Version: 1.0
-- 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='ON... | true |
262eceb8bfae73b91d44c3bf565b4aa445bc53de | SQL | Zhengzhibo1/SQL-practice | /16_统计当前各个title类型对应的员工平均工资/solution.sql | UTF-8 | 984 | 4.46875 | 4 | [] | no_license | /*
统计出当前(titles.to_date='9999-01-01')各个title类型对应的员工当前(salaries.to_date='9999-01-01')薪水对应的平均工资。结果给出title以及平均工资avg。
CREATE TABLE `salaries` (
`emp_no` int(11) NOT NULL,
`salary` int(11) NOT NULL,
`from_date` date NOT NULL,
`to_date` date NOT NULL,
PRIMARY KEY (`emp_no`,`from_date`));
CREATE TABLE IF NOT EXISTS "titles" (... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.