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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ca0d07b4505f1afa546e65c633869e8639b6a0e4 | SQL | oogiisar/notourbackyard-server | /migrations/005.do.create_cleanups.sql | UTF-8 | 307 | 2.515625 | 3 | [] | no_license | CREATE TABLE cleanups (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
location INTEGER REFERENCES region(id) NOT NULL,
user_name INTEGER REFERENCES users(id) NOT NULL,
date TIMESTAMP NOT NULL DEFAULT now(),
type_of_trash garbage_type NOT NULL,
quantity INTEGER NOT NULL
); | true |
4def0b260115d65766b733c202e2c2413d3acb4e | SQL | ArrettB/omni-workspace | /servicetrax/ims/initial_trace_plans/view-invoices/customer_name_lookup.sql | UTF-8 | 156 | 2.796875 | 3 | [] | no_license | SELECT DISTINCT iev.customer_name, iev.customer_name
FROM invoices_extranet_v iev
WHERE iev.organization_id = 2
ORDER BY iev.customer_name | true |
535e0d67fdd0c46fb91a406c62f603ab50916414 | SQL | zhangyu2222z/JAVA-000 | /Week_09/bizuo_homework2/4.sql | UTF-8 | 1,126 | 2.734375 | 3 | [] | no_license | /*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.7.32-log : Database - db1
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS... | true |
b72e39c977180be8d3287c0438e34a59e01f1a7e | SQL | PetrovPetar5/Databases-MSSQL-EntityFramework-SoftUni-Problems | /MSSQL/Exams/ExamTwentySeventhJune/TwentySeventhJune/6.CurrentClients.sql | UTF-8 | 259 | 3.828125 | 4 | [] | no_license | SELECT CONCAT(C.FirstName,' ',C.LastName) AS [Client],ABS(DATEDIFF(DAY,'2017/04/24',J.IssueDate)) AS [Days going], J.[Status] FROM JOBS AS J
JOIN Clients AS C ON J.ClientId = C.ClientId
WHERE J.FinishDate IS NULL
ORDER BY [Days going] DESC, C.ClientId ASC | true |
96b8aadb8106b32028338631d3c4ea116439a333 | SQL | ipf-tlp-2019/MiSalud | /SQL_BD/bd_sistema_medico.sql | UTF-8 | 8,006 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 02-08-2019 a las 08:17:31
-- Versión del servidor: 10.1.38-MariaDB
-- Versión de PHP: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
73b761f0155bd03a4c6d26faa4c342bb789fb611 | SQL | krishnamohankaruturi/secret | /aart-web-dependencies/db/other/DE9175.sql | UTF-8 | 3,419 | 4.03125 | 4 | [] | no_license | --DE 9175 Populating missing group indicator for reading and history
DO
$BODY$
DECLARE
readingRecords RECORD;
historyRecords RECORD;
groupingInd1 character varying(50);
groupingInd2 character varying(50);
testTypeCode character varying(10);
BEGIN
RAISE NOTICE 'Get Reading enrollmenttest... | true |
1dbc320ab9c760eb656de975b4e0eee2fc57044b | SQL | pirat77/QuestStoreBackendAndSQL | /QuestStore.sql | UTF-8 | 4,688 | 3.6875 | 4 | [] | no_license | create table user_types
(
id integer not null
constraint user_types_pk
primary key,
name text not null
);
alter table user_types
owner to postgres;
create table teams
(
id serial not null
constraint teams_pk
primary key,
name text not null
);
alter... | true |
702280e7ff277c581821a553743b70c3dc91a8b9 | SQL | aforrester08/Spending-Tracker-App | /db/spending_tracker.sql | UTF-8 | 483 | 3.234375 | 3 | [] | no_license | DROP TABLE transactions;
DROP TABLE merchants;
DROP TABLE tags;
DROP TABLE budget;
CREATE TABLE budget (
id SERIAL8 PRIMARY KEY,
amount INT8
);
CREATE TABLE tags (
id SERIAL8 PRIMARY KEY,
type VARCHAR(255)
);
CREATE TABLE merchants (
id SERIAL8 PRIMARY KEY,
name VARCHAR(255)
);
CREATE TABLE transactions... | true |
c0e0d3219fc8c6d2938523725f552aa397b39001 | SQL | hannanyusop/ezprint | /database.sql | UTF-8 | 7,529 | 3.53125 | 4 | [] | no_license | -- --------------------------------------------------------
-- Host: localhost
-- Server version: 5.7.24 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.5.0.5332
-- --------------------------------------------------------
/*... | true |
13aece63d072023745eec0f24f1e552456bf977e | SQL | yang00333/data_class_0420 | /Homework-sql.sql | UTF-8 | 23,591 | 4.125 | 4 | [] | no_license |
-- 1. Prepare a list of offices sorted by country, state, city.
SELECT country, state, city
FROM classicmodels.offices;
-- 2. How many employees are there in the company?
SELECT count(employeenumber)
FROM classicmodels.employees;
-- 3. What is the total of payments received?
SELECT sum(amount)
FROM cl... | true |
10b02ccf63f181cd2a43fa378d33d64c2fea83d3 | SQL | tayduivn/training | /rdbms/update/.svn/text-base/sacwis_1154.sql.svn-base | UTF-8 | 542 | 2.578125 | 3 | [] | no_license | --STGAP00017435 - Release(5.0) Updating Other pages drop down for ECEM
-- updating dropdowns for Client chara and resource search page
Update CAPS.CODES_TABLES set DECODE = 'Family Hx of Mental Retardation'
where code_type = 'CLNCHAR2' and code = '302';
update CAPS.CODES_TABLES set DECODE = 'Infant Drug Addiction/Pre... | true |
7505b1694a54c365aadd136a9db0ae9af84fa012 | SQL | israaoliver/Senai-backend-inlock-IsraelO-MarinaS | /BD/InLock_BD_DQL_03.sql | UTF-8 | 2,028 | 3.921875 | 4 | [] | no_license | USE Inlock_Games_Tarde
SELECT * FROM Estudios;
SELECT * FROM Jogos;
SELECT * FROM TiposUsuarios;
SELECT * FROM Usuarios;
SELECT Estudios.NomeEstudio, Jogos.NomeJogo FROM Estudios
INNER JOIN Jogos ON Estudios.IdEstudio = Jogos.IdEstudio
SELECT Estudios.NomeEstudio, Jogos.NomeJogo FROM Estudios
LEFT JOIN Jogos ON Estu... | true |
33a4b4c86f55bf2fab8f2c7ea93e89669e65535e | SQL | ManojKumarPatnaik/SQL | /LeetCode/175. Combine Two Tables.sql | UTF-8 | 528 | 4.0625 | 4 | [
"MIT"
] | permissive | # Task: Write a SQL query for a report that provides the following information for each person in the Person table, regardless if there is an address for each of those people
# Problem Statement: https://leetcode.com/problems/combine-two-tables/
# Difficulty: Easy
- MySQL query:
# can also use abbr for each table or ... | true |
d2764c42956adef989ddc588b789c9b9cca01574 | SQL | rumi55/smservice | /SMS_CreateDB_script.sql | UTF-8 | 2,997 | 3.59375 | 4 | [] | no_license | CREATE TABLE receiver (
UName varchar(50) not null ,
UPhone bigint unsigned ,
VKAccount varchar(20) not null ,
Password varchar(60) not null,
primary key ( UPhone )
);
-- Table that uses for specifications of all audiences such as : sex(male\female), age(<20 , 20-30 , ...), salary(...) etc.
CREATE TABLE audi... | true |
c253275293ffe3d5df6310ce792405d8eccfe7d6 | SQL | angelsleung/walk-with-friends | /database/data.sql | UTF-8 | 4,375 | 2.609375 | 3 | [] | no_license | insert into "users" ("name", "weeklyDistance", "username", "hashedPassword")
values ('Ash', 5.2, 'ash', 'password'),
('Misty', 3.4, 'misty', 'password'),
('Brock', 2.8, 'brock', 'password'),
('Jenny', 1.2, 'jenny', 'password'),
('Joy', 1.1, 'joy', 'password'),
('Gary', 2.5, 'gary', 'p... | true |
93072182bd39b189096c96de7eb1c89cf844dad9 | SQL | file3/tm_book | /setup.sql | UTF-8 | 908 | 3.484375 | 3 | [] | no_license | CREATE DATABASE transfermate WITH ENCODING='UTF8';
\c transfermate;
DROP TABLE books;
DROP TABLE authors;
CREATE TABLE authors
(
auid SERIAL NOT NULL PRIMARY KEY,
name TEXT NOT NULL UNIQUE
);
CREATE TABLE books
(
boid SERIAL NOT NULL PRIMARY KEY,
author INT NOT NULL... | true |
2d32877d76b9f3ac16c069b233124c76eb0c7669 | SQL | augusticor/oodb-transporte | /tables_constraints/ctmantenimientos.sql | UTF-8 | 570 | 2.8125 | 3 | [] | no_license | /*==============================================================*/
/* Table: MANTENIMIENTOS */
/*==============================================================*/
create table MANTENIMIENTOS (
ID_MANTENIMIENTO NUMBER(4) not null,
PLACA ... | true |
a953982fd388fa97052ee4e08276860c5f04e7b6 | SQL | joaovitormo/ExerciciosSQL | /Exercicios18-06/exercicio03.sql | UTF-8 | 479 | 3.28125 | 3 | [] | no_license | create database db_escola;
use db_escola;
create table tb_alunos (
id bigint auto_increment,
nome varchar(200),
data_nascimento date,
turma varchar(4),
media_nota decimal(3,2),
primary key(id)
);
insert into tb_alunos(nome, data_nascimento, turma, media_nota) values("Marcos", '2005-05-06', "2ºB", 4.50);
select * fro... | true |
b9fafbee4e25afcb6d9bbe990f84735e97f7bc63 | SQL | soltan2272/mk | /mm.sql | UTF-8 | 19,620 | 2.875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 03, 2019 at 08:42 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
f37aa65ee9de2b73806d10d7c8873207fedc8fd3 | SQL | chardur/AdvancedDatabaseFinal | /spAddProduct.sql | UTF-8 | 445 | 2.625 | 3 | [] | no_license | Create PROC spAddProduct
@productName varchar(250),
@creationDate date,
@usage varchar(50),
@inventoryScanningID varchar(250),
@color varchar(50),
@encryptedData varBinary(max)
AS
insert into Products
(productName, creationDate, usage, inventoryScanningID, color, encryptedData)
values
(@productName, @creationDate,... | true |
813c42682bb416437c88d9b8959a41419d279596 | SQL | jasynecka/bst-currency | /db/datebase.sql | UTF-8 | 244 | 2.921875 | 3 | [] | no_license | CREATE DATABASE currencydb;
CREATE TABLE currency (
id int NOT NULL AUTO_INCREMENT UNIQUE,
name varchar(255) NOT NULL,
code varchar(3) NOT NULL,
middleRate decimal(8, 4) NOT NULL,
date date NOT NULL,
PRIMARY KEY (id)
); | true |
5e87b12d01403be34c6266c94079c79a35e3b776 | SQL | praveen-332/HOTEL-MANAGEMENT-DASHBOARD | /17075017.sql | UTF-8 | 3,796 | 3.765625 | 4 | [] | no_license | create table customers
(
cid int not null auto_increment,
cname varchar(20),
csex char(1),
cdob date,
cphone int(10) not null,
caddress varchar(75),
primary key(cid)
);
create table emps
(eid int primary key auto_increment,
e_firstname varchar(15),
e_lastname varchar(15),
birthday date,
strtdate date,
e_sex varchar(1... | true |
39a3f9bbc36205885a34c5fba017e4863dc7e51e | SQL | itonkovski/DataBases-MSSQL-January-2021 | /01-DatabasesIntroduction/14.CarRentalDatabase.sql | UTF-8 | 3,271 | 3.78125 | 4 | [] | no_license | CREATE TABLE Categories
(
Id INT IDENTITY PRIMARY KEY,
CategoryName NVARCHAR(50) NOT NULL,
DailyRate DECIMAL(10,2),
WeeklyRate DECIMAL(10,2),
MonthlyRate DECIMAL(10,2),
WeekendRate DECIMAL(10,2)
)
CREATE TABLE Cars
(
Id INT IDENTITY PRIMARY KEY,
PlateNumber NVARCHAR(10) NOT NULL,
M... | true |
5644d3226d89546c9b4436bdb9bd50e3306c99fb | SQL | Maddy1993/cs5200f18_whoophee | /Assignment-2/delete.sql | UTF-8 | 645 | 3.859375 | 4 | [] | no_license | use `assignment_2`;
-- Problem 1
DELETE address
FROM address JOIN person ON address.person_id = person.id
WHERE person.first_name = 'alice' AND address.primary = TRUE;
-- Problem 2
DELETE widget
FROM widget JOIN `page` ON widget.page_id = `page`.id
WHERE page.title = 'Contact' AND
widget.order = (SELECT MAX(`order`) ... | true |
6ed73a89c29f3db13321acef363b7959bb93a59b | SQL | Takiyo/WebDev | /OLD/projects/madlibstable.sql | UTF-8 | 1,307 | 2.515625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 05, 2018 at 11:32 PM
-- Server version: 5.7.16-log
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... | true |
726ff6add31619f8a55754b911702816eced7b52 | SQL | CaseyQWood/Buckets | /server/src/db/schema/messages.sql | UTF-8 | 285 | 2.90625 | 3 | [
"MIT"
] | permissive | DROP TABLE IF EXISTS messages CASCADE;
CREATE TABLE messages (
id SERIAL PRIMARY KEY NOT NULL,
sender_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
budget_id INTEGER REFERENCES budgets(id) ON DELETE CASCADE,
message VARCHAR(255),
reciever_email VARCHAR(255) NOT NULL
); | true |
d73e2276cf41eec12c6568d6b0666c961c84c734 | SQL | vijaykiran/hopsworks | /sql/test_rows.sql | UTF-8 | 1,979 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | -- --------------------------------------------------------
--
-- Creating test users.
--
INSERT INTO `users` (`uid`, `username`, `password`, `email`, `fname`, `lname`, `activated`, `title`, `orcid`, `false_login`, `isonline`, `secret`, `validation_key`, `security_question`, `security_answer`, `mode`, `password_change... | true |
3f1d1e3020a0c0fc3864b12208fb7d0c9333e9fe | SQL | songzigw/webim-for-php5 | /webim/webim_conversations.sql | UTF-8 | 1,423 | 3.015625 | 3 | [
"MIT"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Version : 50151
Source Host : 127.0.0.1:3306
Source Database : webim5
Target Server Type : MYSQL
Target Server Version : 50151
File Encoding : 65001
Date: 2016-05-11 13:52:38
*/
SET FOREIGN_KEY_CHECKS=0;
-- --... | true |
ce9df30c257f87f1eea2e63d93ed02df83c3e68f | SQL | eralmas7/MovieApplication | /src/main/resources/db/migration/V1__MoviesTableCreation.sql | UTF-8 | 218 | 3.09375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS movies (
imdb_id VARCHAR NOT NULL,
screen_id VARCHAR NOT NULL,
movie_title VARCHAR,
available_seats INT NOT NULL,
reserved_seats INT DEFAULT 0,
PRIMARY KEY(imdb_id, screen_id)
); | true |
e9bc22419b0d6d0854c2d6d7c146e9a38a7b1caf | SQL | npandelakis/cs257 | /webapp/doc/database-schema.sql | UTF-8 | 1,207 | 3.359375 | 3 | [
"MIT"
] | permissive | --Written by Grace de Benedetti and Nick Pandelakis
CREATE TABLE countries (
id SERIAL,
country_name text
);
CREATE TABLE attack_types (
id SERIAL,
attack_type text
);
CREATE TABLE target_types (
id SERIAL,
target_type text
);
CREATE TABLE target_subtypes (
id SERIAL,
target_subtype text
);
CREATE TABLE ... | true |
7747b499ec14eb07279941ed5455054c1ec8dd45 | SQL | RussellRiesJr/chinook--RussellRiesJr | /sales_agent_customer_count.sql | UTF-8 | 191 | 3.671875 | 4 | [] | no_license |
select
e.FirstName || ' ' || e.LastName as EmployeeName,
count(c.SupportRepId) as CustomerCount
from Employee e, Customer c
where e.EmployeeId = c.SupportRepId
group by EmployeeName
| true |
75420bb122e4486ed74e825715fa32b5b7e512db | SQL | Jelonek94/Szkolenia | /Bazy_danych/Pierwszy.sql | UTF-8 | 915 | 3.640625 | 4 | [] | no_license | DROP TABLE IF EXISTS sq_has_teams;
DROP TABLE IF EXISTS study_groups;
DROP TABLE IF EXISTS faculty;
DROP TABLE IF EXISTS teams;
CREATE TABLE faculty (
name varchar(16),
CONSTRAINT fac_pkey PRIMARY KEY(name)
);
CREATE TABLE teams (
name varchar(16),
cash integer,
CONSTRAINT teams_pkey PRIMARY KEY(name... | true |
81c2627c8041960867ee3a338c3950e3a7cc7219 | SQL | prasanth260295/mysql | /coresoft-product-database/src/main/resources/oracle/1.0.2/Deposits_Cycle_Group_Scripts_2.sql | UTF-8 | 4,294 | 3.671875 | 4 | [] | no_license | -- renaming the column DATE_LAST_KITING_CURR_PERIOD to DATE_LAST_KITING
ALTER TABLE DEPOSIT_ACCOUNT rename column DATE_LAST_KITING_CURR_PERIOD to DATE_LAST_KITING;
CREATE OR REPLACE VIEW DEPOSIT_ACCOUNT_VW AS
select A.ACCOUNT_NO,A.INSTITUTION_ID,A.PRODUCT_ID,A.ACCOUNT_CATEGORY, A.ACCOUNT_TYPE_ID,A.BUSINESS_DATE,... | true |
8c2adb01fe85e8754498626f3b5fd7e95f61c901 | SQL | rohitsingh186/question-bank | /db/dump.sql | UTF-8 | 6,334 | 3.265625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: localhost Database: question_bank
-- ------------------------------------------------------
-- Server version 5.6.24
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... | true |
4ce744c264472c981a68fac5862cb98a6c98d26f | SQL | samklr/amazon-redshift-utils | /src/AdminViews/v_generate_external_tbl_ddl.sql | UTF-8 | 5,208 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | --DROP VIEW admin.v_generate_external_tbl_ddl;
/**********************************************************************************************
Purpose: View to get the DDL for an external table.
History:
2019-07-10 styerp Created
*************************************************************************************... | true |
e4e79a9e5581d68a73689f796b57cd7610c9f886 | SQL | marioz22/cafeteria-system | /fosdb.sql | UTF-8 | 4,889 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 04, 2019 at 06:58 AM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
1855b0ab44e37ac740413e53af42078718886cfa | SQL | elrik428/atom_Warehouse | /DCC_Reports/DCC_ReportMonthly_Attica_ToRun.sql | UTF-8 | 8,261 | 3.0625 | 3 | [] | no_license |
-- Attica
-- 1.YTD
-- 1a.
select substring(LEFT(datum,10),1,4)+substring(LEFT(datum,10),6,2)+ substring(LEFT(datum,10),9,2),
replace((convert(varchar,(convert(money,(CAST((count(*)) as dec(10,0))/1),0)),1)),'.00','') as ALL_TRN,
replace((convert(varchar,(convert(money,(CAST((sum(case when right(DCCCHOSEN_DCCELIGIBLE,2... | true |
d95e1cc4b6b50e3a7f1e7f27f789eb6ac8d1d3dc | SQL | hxnky/SQL | /2020.11.10.sql | UTF-8 | 6,853 | 3.609375 | 4 | [] | no_license | -- 2020.11.10
-- 함수
-- 단일행, 집합 함수
-- 단일행 함수 : 숫자, 문자, 날짜, 변환함수
desc dual;
-- 숫자 함수
select ABS(-15.5) from dual; -- 절댓값
select FLOOR(15.7) from dual; -- 소수점 절사
select ROUND(15.693) from dual; -- 반올림
select ROUND(15.693,1) from dual; -- 소수점 둘째자리에서 반올림
select LOG(10,100) from dual; -- 로그(지수 구하기)
select POWER(3... | true |
34df349aec84f80dc780c2f05a0c0458b62caa72 | SQL | danielhndz/DB-FL-CLAN | /sql/DisparadoresNoOk.sql | ISO-8859-1 | 1,863 | 2.984375 | 3 | [] | no_license | --UP_FICHAMEDICA
--No debera dejar actualizar una ficha medica
UPDATE FichaMedica SET descripcion = null WHERE codigo = 1;
--UP_TESTFISICO
--No debera dejar actualizar un test fisico
UPDATE TestFisico SET imc = null WHERE codigo = 1;
--UP_ENCARGADOA
--No deberia dejar actualizar encargadoA
UPDATE EncargadoA... | true |
1827db0731238a438214dddf79444ba76b113520 | SQL | shreyasnisal/DBMS_VideoSeries | /tutorialdb.sql | UTF-8 | 6,615 | 3.3125 | 3 | [
"MIT"
] | permissive | -- MySQL dump 10.13 Distrib 8.0.15, for Win64 (x86_64)
--
-- Host: localhost Database: tutorialdb
-- ------------------------------------------------------
-- Server version 8.0.15
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... | true |
dfbf10b881772dc5863ba20b06474ba7270f5d3e | SQL | Anijia/app-config | /mysql.sql | UTF-8 | 705 | 3.46875 | 3 | [] | no_license | CREATE DATABASE `app_config`;
use `app_config`;
CREATE TABLE `app` (
`id` VARCHAR(255) NOT NULL,
`name` VARCHAR(566) NOT NULL,
`platform` VARCHAR(255) NOT NULL,
`device` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `recommended_app` (
`id` INT(11) NOT NULL ... | true |
bcf79ec392063ea6ef357a065f1012f333f44e64 | SQL | Hinsteny/short-url-service | /src/main/resources/liquibase/changelog.mysql.sql | UTF-8 | 906 | 3.4375 | 3 | [] | no_license | --liquibase formatted sql
--changeset short-url-service:1
CREATE TABLE `s_short_url` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`short_id` varchar(40) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '短链ID',
`source_url_hash` char(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '原始链接的MD5 HASH',
`so... | true |
0130f950c6a5d051291ae88f5ecbe80554900aa9 | SQL | gn0mesort/forum-project | /sql/init.sql | UTF-8 | 3,976 | 4.625 | 5 | [] | no_license | create database if not exists forum;
use forum;
create table if not exists users(
user_id binary(16) not null default (UUID_TO_BIN(UUID())),
name varchar(64) not null,
password text not null,
join_date datetime not null default (CURRENT_TIMESTAMP),
avatar varchar(1024), -- 1024 is PATH_MAX?
primary key (user_id),... | true |
4051c6eb452e44c61d047d492b648abf2d2989a8 | SQL | mauricejenkins-00/TeamSpark | /shark_queries.sql | UTF-8 | 1,385 | 4.15625 | 4 | [] | no_license | --Dropping shark_attack table if it already exists
DROP TABLE shark_attacks
--Creates shark_attacks table
CREATE TABLE shark_attacks (
case_num varchar(100),
attack_date varchar(65),
attack_year decimal,
attack_type varchar(100),
attack_country varchar(100),
attack_state varchar(100),
attack_location varc... | true |
0e95253d3c22f9987e9ce7532cdae10e89eb4bb9 | SQL | pcamposaugusto/CTD-2021-Bimestre1 | /CTD-BancoDeDados/Ex-Aula13-Endpoints.sql | UTF-8 | 3,580 | 4.375 | 4 | [] | no_license | USE musimundos_V2;
-- 1. Listar todos os nomes de todos artistas ordenados de forma crescente
SELECT nome FROM artistas
ORDER BY nome;
-- 2. Quais são os generos musicais existentes?
SELECT nome FROM generos;
-- 3. Mostre todos os compositores que criaram alguma cancao;
SELECT DISTINCT(compositor) FROM cancoes
WHER... | true |
ba66ccf44a8828b03bda520c7aa1a65a05297661 | SQL | dpitkevics/MD-labosanas-sistema | /sql-history/md-009(clean).sql | UTF-8 | 7,174 | 3.359375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.0-rc4
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 28, 2013 at 05:19 PM
-- Server version: 5.6.11
-- PHP Version: 5.4.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `md`
--
-- -----------------------------------... | true |
88f27e67e3b824a47e4f59eecbb9043add5607a2 | SQL | sasor/db2_project_scp | /database/hospital_model.sql | UTF-8 | 1,826 | 2.90625 | 3 | [] | no_license | CREATE TABLE Persona(
ci integer NOT null,
nombre text,
apelloPaterno text,
apellidoMaterno text,
tipoSangre varchar(4),
sexo char,
telefomo integer,
direccion text,
);
CREATE TABLE Doctor(
ci integer NOT null,
nombre text,
apellidoPaterno text,
apellidoMaterno text,
... | true |
27abc65d593b1fe7049d6e347246f27fca9be472 | SQL | proshantokuet/bahmni-config | /openmrs/apps/reports/sql/labReport.sql | UTF-8 | 950 | 3.78125 | 4 | [] | no_license |
select pi.identifier as Patient_id,
pn.given_name, pn.family_name Patient_name,
cv.concept_full_name as Test_Name,
o.obs_datetime as Test_Date,
concat(coalesce(o.value_text,''),coalesce(o.value_numeric,''),coalesce(cv2.concept_full_name,'')) as Test_Result
from obs o
inner joi... | true |
a0a198d301fd58cff5fffc66430525897e1cff28 | SQL | BielinskiLukasz/sqlTasks | /SBD/c01/lab/create.sql | UTF-8 | 3,091 | 3.59375 | 4 | [] | no_license | -- Created by Vertabelo (http://vertabelo.com)
-- Last modification date: 2019-03-17 13:20:29.768
-- tables
-- Table: Pierwiastek
CREATE TABLE Pierwiastek (
IdPierwiastek integer NOT NULL,
Nazwa varchar2(30) NOT NULL,
Symbol varchar2(3) NOT NULL,
Opis varchar2(500) NOT NULL,
Ilosc number(7,2) ... | true |
9c4d3d328df9eea9c707f2860765f6471ab031a8 | SQL | zaucker/agrammon | /db/schema.sql | UTF-8 | 19,569 | 3.734375 | 4 | [] | no_license | --
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
CREATE EXTENSION IF NOT EXISTS pgcrypto;
--
-- Name: dataset_... | true |
5df082bbf32c30cded326cee2f19c417390e5ca8 | SQL | hohenzollerns/whatevermusic | /whatever.sql | UTF-8 | 1,482 | 3.421875 | 3 | [] | no_license | CREATE DATABASE whatever;
USE whatever;
create table tb_usuario(
codf int primary key auto_increment,
nome varchar(1000) not null,
email varchar(100) not null,
telefone varchar(11) not null,
cpf char(11) not null,
rg char(9) not null,
sexo varchar(20) not null,
dia varchar(2) not null,
mes varchar(10) not null,
ano c... | true |
7bbc801653446e2f3c9ed670ac1f398305572e85 | SQL | DIBYA03/TF-code | /WISE/core-platform/migrations/core/00014_user_device.sql | UTF-8 | 1,155 | 3.421875 | 3 | [] | no_license | -- +goose Up
/* User Device table */
CREATE TABLE user_device (
id UUID PRIMARY KEY NOT NULL DEFAULT Uuid_generate_v4(),
user_id UUID NOT NULL REFERENCES wise_user (id),
device_type TEXT NOT NULL,
token_type TEXT NOT NULL,
token TEXT NOT NULL,
device_key TEXT NOT NULL,
... | true |
bc6dcab14a6296c6b1b24f1a9762d6e0878297bc | SQL | surenius/datasci_course_materials | /assignment2/part_g.sql | UTF-8 | 615 | 4.125 | 4 | [] | no_license | select row_num, col_num, sum(x.value) value
from (
select
a.row_num row_num,
b.col_num col_num,
a.value * b.value value
from A a, B b
where a.col_num = b.row_num
) x
group by x.row_num, x.col_num;
select *
from (
select row_doc, col_doc, sum(x.value) simvalue
from (
select
a.docid row_doc,
b.d... | true |
840c09885a9159a6e629f6da9e50b8fe39255120 | SQL | OHDSI/WebAPI | /src/main/resources/resources/cdmresults/sql/report/datadensity/totalrecords.sql | UTF-8 | 1,877 | 3.375 | 3 | [
"Apache-2.0"
] | permissive | SELECT
table_name AS series_name,
stratum_1 AS x_Calendar_Month,
count_value AS y_Record_Count
FROM
(
SELECT
'Visit occurrence' AS table_name,
stratum_1,
count_value
FROM @results_database_schema.achilles_results WHERE analysis_id = 220
UNION ALL
SELECT
'Condition occu... | true |
8d61e71c2893be7bd5c50bf0f7cc2b8a1174557d | SQL | izerui/lemon | /src/main/resources/dbmigrate/h2/cms/V0_0_1__cms_article.sql | UTF-8 | 465 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive |
-------------------------------------------------------------------------------
-- cms article
-------------------------------------------------------------------------------
CREATE TABLE CMS_ARTICLE(
ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL,
NAME VARCHAR(200),
CONTENT VARC... | true |
021a1a6315309e7453b3d483624e2d4ea0abdbe1 | SQL | JinYuan8/wuhan_plague | /version2.0/SQL_mysql/china_total_info.sql | UTF-8 | 1,515 | 3.015625 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : yyw
Source Server Type : MySQL
Source Server Version : 80016
Source Host : localhost:3306
Source Schema : plague_info
Target Server Type : MySQL
Target Server Version : 80016
File Encoding : 65001
Date: 19/02/2020 22:5... | true |
3bdff090aa9aab59234ee4d5a88961d0b858897b | SQL | jonasmu/Actos | /Actos.BaseDatos/dbo/Stored Procedures/TiposRedesSociales_DevolverTodos.sql | UTF-8 | 148 | 2.578125 | 3 | [] | no_license | CREATE PROCEDURE TiposRedesSociales_DevolverTodos
AS
SELECT
tr.IdTipoRedSocial,
tr.Nombre
FROM TiposRedesSociales tr
ORDER BY tr.Nombre ASC | true |
7b1b46a8ad03be8eec1be7aed53a323ad20ae208 | SQL | mabr3/HackerRank | /SQL/BasicJoin/TheReport.sql | UTF-8 | 175 | 3.234375 | 3 | [] | no_license | SELECT CASE WHEN Grade >7 THEN Name ELSE NULL END as Name, Grade, Marks
FROM Students join Grades
ON Marks BETWEEN Min_Mark AND Max_Mark
ORDER BY Grade desc, Name, Marks asc
| true |
858db32e2afdbfca3515977ea28fc8d4a88cdbfe | SQL | bogdanovmn/ncuxywka-original | /install/db/tables/bans.sql | UTF-8 | 608 | 3.453125 | 3 | [] | no_license | CREATE TABLE ban (
id int unsigned NOT NULL AUTO_INCREMENT,
ip char(15) NOT NULL,
user_id smallint unsigned DEFAULT NULL,
begin timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
end timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`comment` var... | true |
e65481e3149946380c2f153e1ae3075010c11cd7 | SQL | DmitriyPavliut/store | /store.sql | UTF-8 | 7,765 | 3.28125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Хост: localhost
-- Время создания: Июл 03 2021 г., 23:00
-- Версия сервера: 10.4.19-MariaDB
-- Версия PHP: 7.3.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@... | true |
b136edf1c8b3e0b9b70a9d48379e688bd3c367dd | SQL | euberdeveloper/unitn-db-assignment-2 | /SQL_201514/query_8.sql | UTF-8 | 293 | 3.78125 | 4 | [
"MIT"
] | permissive | SELECT DISTINCT S.name
FROM "Stadium" S
WHERE (
(
'Europe' = ALL (
SELECT continent
FROM "Nationality" N, "Match" M
WHERE M.stadium = S.name AND (N.country = M.home OR N.country = M.GUEST)
)
)
AND (
EXISTS (
SELECT *
FROM "Match" M
WHERE M.stadium = S.name
)
)
); | true |
b580bbc3249e538c3fbb9b04900a34ba0d487384 | SQL | wantonbe/mojolicious-wp_sample | /ddl/service_request_history.sql | UTF-8 | 326 | 3 | 3 | [] | no_license | CREATE TABLE service_request_history (
service_request_id INT UNSIGNED NOT NULL,
update_datetime TIMESTAMP NOT NULL,
new_status ENUM('Open', 'Waiting Customer', 'In Progress', 'Closed') NOT NULL,
PRIMARY KEY (service_request_id, new_status, update_datetime),
INDEX(update_datetime)
) ENGINE=InnoDB DEFAULT CHARSET=... | true |
def3eb64f60bc54996cc5526b01f8b3678146f7c | SQL | ericLavachery/COGIP-app | /db/cogip_db.sql | UTF-8 | 3,035 | 3.40625 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- di 28 aug 2018 12:04:39 CEST
-- 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... | true |
8594b19116bc1ec17b9f12bbcb7e7fa835e510e3 | SQL | arvi9/sqlserver-kit | /Scripts/Estimate_When_Long_Running_SQL_Processes_Will_Finish.sql | UTF-8 | 910 | 3.765625 | 4 | [
"MIT"
] | permissive | /*
Author: Tim Ford
Original link: http://sqlmag.com/database-administration/estimate-when-long-running-sql-processes-will-finish
*/
SET NOCOUNT ON;
SELECT R.session_id
, R.percent_complete
, R.total_elapsed_time/1000 AS elapsed_seconds
, R.wait_type
, R.wait_time
, R.last_wait_type
, DA... | true |
1554c5283bf01275a200f7d15f31043ccf690a1d | SQL | yesh13/todo | /sql/dev.sql | UTF-8 | 337 | 3.0625 | 3 | [] | no_license |
create table taglist(
id int not null auto_increment primary key,
uid int,
name varchar(16),
schedule_type int,
foreign key(uid) references account(uid)
);
create table act_tag(
id int not null auto_increment primary key,
aid int unsigned,
tid int,
foreign key(tid) references taglist(id),
foreign key(aid) reference... | true |
19a558729a394752b7732de876e902c8f8eea79d | SQL | KylinHuang7/Account | /doc/accounts.sql | UTF-8 | 1,698 | 3.390625 | 3 | [] | no_license | USE `accounts`;
CREATE TABLE `user` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(32) NOT NULL,
`pass` varbinary(64) NOT NULL,
`family_id` int(10) unsigned NOT NULL,
`last_login` TIMESTAMP NOT NULL,
`settle_day` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB... | true |
ec2f89bac4b456f198777ac6fa0962392969a975 | SQL | iyaso/bank-transfer-demo | /src/test/resources/demo.sql | UTF-8 | 686 | 2.84375 | 3 | [] | no_license | DROP TABLE IF EXISTS Account;
CREATE TABLE Account (AccountId LONG PRIMARY KEY AUTO_INCREMENT NOT NULL,
UserName VARCHAR(30),
Balance DECIMAL(19,4),
CurrencyCode VARCHAR(30)
);
INSERT INTO Account (UserName,Balance,CurrencyCode) VALUES ('iyas',100.0000,'USD');
INSERT INTO Account (UserName,Balance,CurrencyCode) VALUE... | true |
91a65eb88dd200c5e9de5283030b40b09a62c79c | SQL | tunji86/SQL | /Aggregate Functions.sql | UTF-8 | 2,195 | 4.03125 | 4 | [] | no_license | --WINDOW FUNCTIONS TUTORIAL
--https://www.postgresql.org/docs/8.4/static/tutorial-window.html
select BusinessEntityID, TerritoryID, SUM(BONUS)
over (partition by BusinessEntityID order by TerritoryID)
from Sales.SalesPerson;
--MIN & MAX
select Max(bONUS) from Sales.SalesPerson
select Min(Bonus) from Sales.... | true |
597f1004b5a00cd3964f316683c9d8abf4cb84eb | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day17/select2032.sql | UTF-8 | 498 | 3.6875 | 4 | [] | no_license |
SELECT obs.sensor_id, avg(counts)
FROM (SELECT sensor_id, date_trunc('day', timestamp), count(*) as counts
FROM WeMoObservation WHERE timestamp>'2017-11-16T20:32:00Z' AND timestamp<'2017-11-17T20:32:00Z' AND SENSOR_ID = ANY(array['8b20c416_ec01_4567_9dda_999371e0f0fb','fdd5bea7_91fd_4094_b44d_c41f9aa78fc7','ee... | true |
6c10d83a1c010e1306bb014b099978037b053b7a | SQL | hdblocal/authorityDemo | /sql.sql | UTF-8 | 6,477 | 3.28125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : taotao
Source Server Version : 50711
Source Host : localhost:3306
Source Database : mooc_quanxian
Target Server Type : MYSQL
Target Server Version : 50711
File Encoding : 65001
Date: 2017-06-07 18:11:48
*/
SET FOREIGN_KEY_CHECKS=0;
-... | true |
7d68d4728682b0349fc097596772776918897bfa | SQL | enimateK/database-tp | /TP3/TP3.sql | UTF-8 | 5,039 | 3.96875 | 4 | [] | no_license | /* Script de création des tables et des tuples */
/* Par Dan Monunu et Benjamin Dutriaux */
/* Création de la table clients qui a comme clé primaire l'attribut "idcl" */
CREATE TABLE clients(
idcl INTEGER PRIMARY KEY,
nom VARCHAR2(20),
prenom VARCHAR2(15),
adr VARCHAR2(30),
tel VARCHAR2(12)
);
/* Création... | true |
fedc7af5fff4db623a3c2a9549a63c2b9a196993 | SQL | thanglovemusic94/SpringMVC-Poly | /ass/database/update_table.sql | UTF-8 | 466 | 2.75 | 3 | [] | no_license | use newservlet12month2018;
insert into category(name, code) value('thể thao', 'the-thao');
insert into category(name, code) value('thế giới', 'the-gioi');
insert into category(name, code) value('chính trị', 'chinh-tri');
insert into news(title, categoryid) value('bài viết 1', 1);
insert into news(title, categoryid) ... | true |
fc94cb886af5bf8ee6f80902d71a8b390dbb7c11 | SQL | Squirrelshit/Tawagoto | /database.sql | UTF-8 | 683 | 2.625 | 3 | [] | no_license |
-- phpMyAdmin SQL Dump
-- version 2.11.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 03, 2015 at 04:27 AM
-- Server version: 5.1.57
-- PHP Version: 5.2.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `tawagoto`
--
-- --------------------------------------------------------
-... | true |
6dd5df2c3a3b0eee3f75e9d22511b4d9f2eb6e3b | SQL | Andoromeda-Foundation/java-server-template | /pb-migration/src/main/resources/migrations/V20170329134333__ddl_add_md.sql | UTF-8 | 801 | 2.53125 | 3 | [] | no_license | CREATE TABLE `mds` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`p` DECIMAL(20,4) NULL DEFAULT NULL,
`q` DECIMAL(20,4) NULL DEFAULT NULL,
`value` DECIMAL(20,4) NULL DEFAULT NULL,
`name` VARCHAR(45) NULL DEFAULT NULL,
`node` VARCHAR(45) NULL DEFAULT NULL,
`uuid` VARCHAR(128) NULL DEFAULT NULL,
`redis_key` ... | true |
835de69a85b9a7f70daa2cb4b82cd8c361b5a1b2 | SQL | andre-franco/PAX | /monitoria2/paxmon2/pax/PMP_INSTANCIA.sql | UTF-8 | 962 | 3.375 | 3 | [] | no_license |
CREATE TABLE "PAX"."PMP_INSTANCIA"
( "INSTANCIA_ID" NUMBER,
"HOST_AMBIENTE_ID" NUMBER NOT NULL ENABLE,
"INSTANCIA" VARCHAR2(50) NOT NULL ENABLE,
"DESCRICAO" VARCHAR2(500),
PRIMARY KEY ("INSTANCIA_ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MIN... | true |
e77efebe156b64590681e38bbb2523a2783eabd1 | SQL | richtermarkbaay/MEDTrip | /data/events/error_logs.events.sql | UTF-8 | 282 | 3.0625 | 3 | [
"MIT"
] | permissive | DROP EVENT IF EXISTS error_logs_purger $$
CREATE EVENT `error_logs_purger`
ON SCHEDULE
EVERY 1 DAY
COMMENT 'Purges >1 day old data in error_logs every day'
DO
BEGIN
## purges > 1 day old data
DELETE FROM `error_logs` WHERE DATEDIFF(NOW(), `date_created`) > 1;
END;
$$ | true |
bb629b45b4970d70072e0da8be8a812863200974 | SQL | volodden/MIPT | /Database/DB sql-ex.ru/070.SQL | UTF-8 | 433 | 4.25 | 4 | [] | no_license | WITH T AS (SELECT Battle, Country, COUNT(ship) AS CS
FROM (
SELECT Outcomes.battle, Classes.country, Outcomes.ship
FROM Outcomes INNER JOIN Ships ON Outcomes.ship = Ships.name INNER JOIN Classes ON Classes.class = Ships.class
UNION
SELECT Outcomes.battle, Classes.country, Outcomes.ship
FROM Outcomes INNER JOIN Classe... | true |
e14434f387cfb483d6d9f0e2d9ee8994d95d1b3f | SQL | Stokes06/mvcphp | /sql/scriptdb.sql | UTF-8 | 793 | 3.453125 | 3 | [] | no_license | drop database if EXISTS epicerie;
create database epicerie;
use epicerie;
create table TypeProduit(
id INT PRIMARY KEY auto_increment NOT NULL,
nom varchar(100)
);
create table Produit(
id int primary key auto_increment not null,
nom varchar(100),
prix double,
mois int,
stock int,
image VARCHAR(100),
idType... | true |
def16867ac5a58c4fa0c90fcf45c6eaa501332a4 | SQL | jungeunlee95/mariadb-pratice | /문제/join.sql | UTF-8 | 251 | 3.359375 | 3 | [] | no_license | -- join
-- employees 테이블과 titles 테이블을 join하여
-- 직원의 이름과 직책을 모두출력하되 여성 엔지니어만 출력
select e.first_name, t.title
from employees e, titles t
where e.emp_no = t.emp_no
and e.gender = 'f';
| true |
64806f864647bbbbf367ac119edc445bc10fa114 | SQL | TseboMokoena/Intelli-Fleet | /IntelliFleet Database/SQL Queries/VEHICLE_DRIVER.sql | UTF-8 | 254 | 3 | 3 | [] | no_license | CREATE TABLE VEHICLE_DRIVER
(DRIVER_ID INTEGER NOT NULL IDENTITY(1,1),
VEHICLE_ID INTEGER NOT NULL,
PRIMARY KEY (DRIVER_ID,VEHICLE_ID),
FOREIGN KEY (DRIVER_ID) REFERENCES DRIVERS (DRIVER_ID),
FOREIGN KEY (VEHICLE_ID) REFERENCES VEHICLE (VEHICLE_ID)
); | true |
9f5ca49e0309e3dbe7cfbe2b5f443ccdd03ca0ec | SQL | zeroest/KITRI_ORACLEDB | /ORACLE_DB 정리/DDL.sql | UTF-8 | 2,633 | 4.28125 | 4 | [] | no_license |
DDL : Data Definition Lang
: CREATE TABLE 데이터 구조의 정의 / ALTER TABLE 변경 / DROP TABLE 삭제
=====================================================================
--table 생성
create table TEST
(A NUMBER(5) constraint pk_a primary key,
B VARCHAR2(50) [제약조건/생략가능],
.....);
TEST
A B
100 교육부 RECORD=ROW
200 인사개발부 RECORD=ROW
CO... | true |
2618326a87f29b56fa2a5c1be0467e9075b5e53e | SQL | gmlakds21/Database_MariaDB | /src/_1_Class_Maria_DB/_12_08/1_Sub_query.sql | UTF-8 | 818 | 3.640625 | 4 | [] | no_license | -- 서브 쿼리
-- 메인 쿼리안에 또 다른 쿼리문으로 구성
-- 스칼라 서브 쿼리 : 결과값으로 하나의 값이 조희
-- 인라인 뷰 : 결과값으로 여러개의 값이 조희
-- 질의문을 여러 단게로 구조화 하기 때문에 쿼리의
-- 각 질의문이 의도하는 의미를 쉽게 파악
-- where, from, select 등에 서브쿼리 사용가능
-- 비스킷을 생산하는 모든 제조업체의 모든 과자
select 과자 from 제품 where 제조업체 =
( select 제조업체 from 제품 where 과자 = 비스킷)
where 제... | true |
661d942375662c8f6c4b2585758e37b0eace6c3d | SQL | CUBRID/cubrid-testcases | /sql/_24_aprium_qa/_05_non-ASCII/cases/bug_bts_10624.sql | UTF-8 | 10,618 | 3.609375 | 4 | [
"BSD-3-Clause"
] | permissive |
--+ holdcas on;
drop if exists À;
drop if exists Ö;
create table À(À int);
SHOW full COLUMNS FROM À;
rename table À as Ö;
SHOW full COLUMNS FROM Ö;
rename table Ö to À;
SHOW full COLUMNS FROM À;
drop table À;
create table À(À int);
SHOW full COLUMNS FROM À;
alter table À rename À as Ö;
SHOW full COLUMNS FROM À;
alter ... | true |
8cbeb89956c1844e7ceacbcfc85154089132e253 | SQL | nsdheeraj/Horacle | /userform.sql | UTF-8 | 1,349 | 2.625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 01, 2019 at 11:47 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
dc45af14416b9576e745b1b732c58d04dbb9771c | SQL | leskovsky1/FRI | /Bc/4.semester/zaklady databazovych systemov/databazy/pomocky z predoslych rokov/ZDBS/ZDBS/!_ZDBS cvika, prednasky,testy,skusky/Testy a iné materiály k zápočtu a skúške/zds/sql/isfr.sql | UTF-8 | 41,456 | 3.046875 | 3 | [] | no_license | { DATABASE isfr delimiter | }
grant dba to "isfr";
grant dba to "informix";
grant dba to "kmat";
grant dba to "novakova";
grant dba to "sicova";
grant dba to "grondzak";
grant dba to "jamrich";
grant dba to "vajsova";
grant dba to "sleziak";
grant connect to "mano";
grant connect to "oweis";
{ TABLE "isfr".zamestn... | true |
9423f65ae2eedbb37ca2d623cb38d4c25198c74a | SQL | beea27/klinik | /baseDados_N2.sql | UTF-8 | 4,944 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 15-Jun-2020 às 02:06
-- Versão do servidor: 10.1.25-MariaDB
-- PHP Version: 7.1.7
CREATE DATABASE n2;
USE n2;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone =... | true |
54cdcf8096cdf49eef522e2adeede311b39ef5e5 | SQL | ScarlettUtopia/sql-crowdfunding-lab-seattle-web-082619 | /lib/insert.sql | UTF-8 | 1,734 | 2.875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | INSERT INTO users (id, name, age) VALUES
(1, "Joe", 28),
(2, "Sue", 47),
(3, "Mary", 39),
(4, "Luke", 35),
(5, "Alex", 37),
(6, "Gary", 52),
(7, "Peggy", 54),
(8, "Ben", 31),
(9, "Drew", 25),
(10, "Leah", 37),
(11, "June", 41),
(12, "Cale", 38),
(13, "Kate", 36),
(14, "Mae", 51),
(15, "Sally", 53),
(16, "Peter", 43),
(... | true |
f304d8460429827d1873c3fb1791efc4a30e998b | SQL | CarolSi-hub/Trybe-MySQLVocabulary-Booster | /desafio16.sql | UTF-8 | 340 | 3.609375 | 4 | [] | no_license | DELIMITER $$
CREATE FUNCTION buscar_quantidade_de_empregos_por_funcionario(email VARCHAR(50))
RETURNS INT READS SQL DATA
BEGIN
DECLARE qnt_jobs INT;
SELECT COUNT(*)
FROM hr.employees AS emp
INNER JOIN hr.job_history AS jobH
ON emp.EMPLOYEE_ID = jobH.EMPLOYEE_ID
WHERE emp.EMAIL = email INTO qnt_jobs;
RETURN qnt_jobs;
... | true |
65fe529b13c011bb9ba329641c0d2e9163ff8427 | SQL | FelipeCooper/CNC_Internal_API | /src/repository/DB/sql/setores_membros.sql | UTF-8 | 4,525 | 2.703125 | 3 | [] | no_license | CREATE TABLE
IF NOT EXISTS setores_membros
(
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
setor_id INT UNSIGNED NOT NULL,
email VARCHAR
(255) NOT NULL,
nome VARCHAR
(80) NOT NULL
) ENGINE = InnoDB;
INSERT INTO setores_membros
(id, setor_id, email, nome)
VALUES
(1, 6 , "gerente.vendas@grupoembracon.c... | true |
2fab7e813a160d1eb68a79e63543fb060fe18155 | SQL | laksjpoid/lishibook | /src/main/java/com/lishibook/sql/localhost.sql | UTF-8 | 21,939 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.5
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2014 年 03 月 03 日 12:56
-- 服务器版本: 5.5.27
-- PHP 版本: 5.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... | true |
06dfbfec431b01e2d2e005b62d3bb5f679a1361c | SQL | namila/WorldCup | /hive_scripts/4-histogram_no_of_unique_page_visits.sql | UTF-8 | 201 | 2.78125 | 3 | [] | no_license | USE worldcup;
SELECT hourOfDay, COUNT(DISTINCT userId, request) AS UniquePageVisits
FROM logData
WHERE requestType = "GET" AND isHTML = true AND statusCode = 200
GROUP BY hourOfDay
ORDER BY hourOfDay; | true |
4405b028800ef97b5233008c80de9145fdcf9bd6 | SQL | radtek/abs3 | /sql/mmfo/bars/Table/k2tmp.sql | UTF-8 | 2,544 | 3 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Table/K2TMP.sql =========*** Run *** =======
PROMPT =====================================================================================
PROMPT *** ALTER_POLICY_INFO... | true |
18475169ad9d8f40b4e2a9c86f26aa76964070cb | SQL | Pawan1005/MI-10-MEAN | /sanket/MySQL/sanketA3.sql | UTF-8 | 4,358 | 4.0625 | 4 | [] | no_license | -- DML Operations on student and course table
-- 1. Insert a record in student table
-- 1 Amit 1234567890 9999833445 science 101 camp
INSERT INTO student (studId, studName, studAadhar, mobileNo, streams, studCourseId, address)
VALUES(1, "Amit", 1234567890, 9999833445, "science", 101, "camp");
-- 2. Is the record inser... | true |
bf3543a35a0629481fd4c2e39591a1e3c3aee95b | SQL | tester200xm/pgcodekeeper | /apgdiff.tests/src/main/resources/cz/startnet/utils/pgdiff/create_func_type_new.sql | UTF-8 | 1,131 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
--
-- Name: add(typ_composite, integer); Type: FUNCTION; Sc... | true |
1b5bf962e5c1f0afac6f03a5355d93c5ecbb9c7c | SQL | jose4125/promo | /usuariosalkosto_2012-06-22.sql | UTF-8 | 2,310 | 3.046875 | 3 | [] | no_license | # ************************************************************
# Sequel Pro SQL dump
# Version 3408
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.1.44)
# Database: usuariosalkosto
# Generation Time: 2012-06-23 04:52:28 +0000
# *****************************************... | true |
1efe85d4b11311c3c7873735ef4506c7c64c85ee | SQL | fandashtic/arc_chennai | /Sivabalan-SQL/SQL_STORED_PROCEDURE/sp_ser_checkbankaccount.sql | UTF-8 | 215 | 2.953125 | 3 | [] | no_license | CREATE procedure sp_ser_checkbankaccount(@AccountName as nvarchar(255))
as
Select Bank.AccountId from AccountsMaster
Inner Join Bank On Bank.AccountId = AccountsMaster.AccountID
Where AccountName = @AccountName
| true |
53ddf9b028422e57582eb617cdb8ca35ce2bd8dd | SQL | srqway/dba.postgresql | /dba.v_dublicate_indexes.sql | UTF-8 | 813 | 3.65625 | 4 | [
"Apache-2.0"
] | permissive | CREATE VIEW dba.v_dublicate_indexes AS
SELECT
rank() OVER (ORDER BY schema_name, table_name) AS grp,
schema_name,
table_name,
unnest(index_names) AS index_names,
unnest(index_sizes) AS index_sizes
FROM (
SELECT
s.nspname AS schema_name,
tc.relname AS table_name,
arra... | true |
c8d8c04cf1ed91bffc825129149b87a75b2652e7 | SQL | henry-ns/iTern | /db/deletes.sql | UTF-8 | 601 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | --Exclusão de uma vaga oferecida por uma empresa
DELETE FROM vacancy
WHERE company_id = x
-- Exclusão de uma empresa
DELETE FROM company
Where id = x;
-- Exclusão do número de telefone de um estudante
DELETE FROM student_telephone
WHERE student_id = x;
-- Exclusão de uma rede social de um estudante
DELETE FROM stude... | true |
b0b26226213b48c42f7bd0b9392c859c209a2303 | SQL | freshmuffin/curbside-client | /server/db/schema.sql | UTF-8 | 315 | 2.546875 | 3 | [] | no_license | USE FreshMuffin;
DROP TABLE IF EXISTS `client`;
CREATE TABLE client (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
site_id VARCHAR(50) UNIQUE NOT NULL,
phone VARCHAR(255),
address VARCHAR(255) NOT NULL,
latitude VARCHAR(255) ,
longitude VARCHAR(255),
date DATETIME NOT NULL
-- ,time_window TIME
);
| true |
05be667ccfd8e9bd1a3b38cd793d427f0140e0fc | SQL | Vova0199/NU_LP | /2_course/1_semester/database/4_lab/MySQL/Trigger(4).sql | UTF-8 | 133 | 2.953125 | 3 | [
"MIT"
] | permissive | DELIMITER ;;
CREATE TRIGGER `my_table_bi`
BEFORE INSERT ON user FOR EACH ROW
BEGIN
SET NEW.login = min(surname);
END;;
DELIMITER ; | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.