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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
732e75d2085bed5819d8a32e4852393316c25bab | SQL | kcvikrant/SQL-Data-Analysis-and-Visualization-Projects | /SQL for Statistics Essential Training/01.Basic_Descriptive_Statistics.sql | UTF-8 | 2,395 | 4.34375 | 4 | [
"MIT"
] | permissive | /* check first 10 rows */
SELECT * FROM store_sales
LIMIT 10;
/* check how many rows */
SELECT COUNT(*)
FROM store_sales;
/* how many rows in each month */
SELECT month_of_year, COUNT(*) AS total
FROM store_sales
GROUP BY month_of_year
ORDER BY month_of_year ASC;
/* maximum number of employees during any shift of th... | true |
7b3080af4f14c3791f112d0a7ab576fcb6ac54a1 | SQL | viaboxxsystems/agimatec-tools | /dbmigrate-example/oracle/setup/functions/func-bool2int.sql | UTF-8 | 439 | 3.03125 | 3 | [] | no_license | /**********
* Kompatiblitätsfunktion Oracle/Postgres.
* Gibt zurück, ob ein Wert 'true' ist.
* Vereinbarung: null is weder true noch false.
*
* Autor: Roman Stumm
* Historie:
* 09.05.08 Initial
**********/
CREATE OR REPLACE FUNCTION bool2int
(val IN NUMBER)
RETURN NUMBER
IS
BEGIN
IF val... | true |
909964c11ded2f5d44f543dd1154fb5b0f806eaa | SQL | ShacharMarkovich/150225-5781-Databases | /3 queries/4.sql | UTF-8 | 306 | 3.578125 | 4 | [] | no_license | -- get count of seats in plane and how much with windows,
-- if seat is with window - planeSeat.isWithWindow val is 1, else - 0
select planeid, model, p_size as "seats count",
sum(isWithWindow) as "seats with windows"
from plane natural join planeSeat
group by planeid, model, p_size
order by fullname; | true |
d8f771443b3b4064504f3d2e37858888cd314487 | SQL | AkhyarNR/sia_rolas | /database/sia_rolas (13).sql | UTF-8 | 82,596 | 3.234375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 13 Jul 2020 pada 17.45
-- Versi server: 10.1.29-MariaDB
-- Versi PHP: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... | true |
9f11f60fdf3ba454c79753045ff0f1b4ec27bc45 | SQL | yves40/python | /SQL/somequeries.sql | UTF-8 | 306 | 2.59375 | 3 | [] | no_license | select p.nom_pizza, prix, ingredient from pizzas p, ingredients i
select p.nom_pizza, prix, ingredient from pizzas p, ingredients i
where i.nom_pizza = p.nom_pizza
select p.nom_pizza, prix, ingredient from pizzas p, ingredients i
where i.nom_pizza = p.nom_pizza and ingredient like '%fraiche%'
| true |
c92193d7aec3d342bec0516916f98439090d159b | SQL | srajan96/nosma | /classes/user.sql | UTF-8 | 1,975 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 14, 2016 at 10:43 PM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 7.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
6077fc5ef04a9345ca235fade5fa953c368fad2c | SQL | csjfnc/JavaSpringRESTful-JWT | /algamoney-api4/src/main/resources/db/migration/V03__criar_e_registrar_lancamentos.sql | UTF-8 | 1,168 | 3.140625 | 3 | [] | no_license | CREATE TABLE lancamento(
codigo BIGSERIAL,
descricao VARCHAR(50) NOT NULL,
data_vencimento DATE NOT NULL,
data_pagamento DATE,
valor DECIMAL(10,2),
tipo VARCHAR(20),
codigo_categoria BIGSERIAL,
codigo_pessoa BIGSERIAL,
PRIMARY KEY(codigo),
FOREIGN KEY(codigo_categoria) REFERENC... | true |
0e287cf8e9226a33c8daabd917e4cbe15b4ad714 | SQL | Leda909/Var02_Pagination_JQ_Gallery_Silkleda | /db/gallery_db.sql | UTF-8 | 4,012 | 2.84375 | 3 | [
"Unlicense"
] | permissive | CREATE DATABASE IF NOT EXISTS silk_shop;
USE silk_shop;
-- --------------------------------------------------------
CREATE TABLE IF NOT EXISTS gallery (
product_id INT(10) NOT NULL AUTO_INCREMENT,
product_title VARCHAR(100) NOT NULL,
product_category VARCHAR(100) NOT NULL,
product_type VARCHAR(100) NOT NULL,
p... | true |
8dbd88b74bc97224646e068ee4c136e95543fa73 | SQL | JoanQin/kmdata_db | /addl_tables/researchinview/researchinview.riv_outreach_activities.sql | UTF-8 | 369 | 2.640625 | 3 | [] | no_license | -- Table: researchinview.riv_outreach_activities
-- DROP TABLE researchinview.riv_outreach_activities;
CREATE TABLE researchinview.riv_outreach_activities
(
id bigint NOT NULL,
name character varying(1000),
CONSTRAINT riv_outreach_activities_pk PRIMARY KEY (id )
)
WITH (
OIDS=FALSE
);
ALTER TABLE researchinv... | true |
27185aab15595367dba21ed63fe304f44ceeb309 | SQL | cckmit/xinfu | /ccms/WebContent/WEB-INF/action/ccms/module/report2/reportgen/template/query_fk_data.sql | UTF-8 | 397 | 3.421875 | 3 | [] | no_license | select
${field_code} as domain_value
,case when ${field_reference} is not null and '${def:locale}'='en' then ${field_reference} else ${field_alias} end as domain_text
,${field_reference} as reference
from
${schema}.${table}
where
${result_field}
=
(case when ${result}=1 then (select def_subject_id from hr... | true |
3dbaa2fbe77866d400c06d0ea622fefda62e7476 | SQL | Silverbaq/mynotes-flask | /db/schema.sql | UTF-8 | 369 | 2.671875 | 3 | [] | no_license | CREATE TABLE `Topic` (
`Id` INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
`Title` TEXT NOT NULL
);
CREATE TABLE `Subject` (
`Id` INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
`Title` TEXT NOT NULL,
`TopicId` INTEGER NOT NULL
);
CREATE TABLE `Note` (
`Id` INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
`Value` TEXT NOT NULL,... | true |
f331ba130c835ab44bf4e89567c26587e8dd1375 | SQL | kalljoshua/UgaBus | /public/dbs/ugabus.sql | UTF-8 | 29,169 | 3.015625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 13, 2018 at 07:46 PM
-- Server version: 5.7.22-0ubuntu18.04.1
-- PHP Version: 7.2.5-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... | true |
13d6bfab559f7576ec5d0831d34739f339a60bca | SQL | BigBenCoder4Life/Bank | /schema/.svn/text-base/create.sql.svn-base | UTF-8 | 2,617 | 3.71875 | 4 | [] | no_license | DROP TABLE IF EXISTS hs_graduate;
DROP TABLE IF EXISTS divisions;
DROP TABLE IF EXISTS schools;
DROP TABLE IF EXISTS students;
DROP TABLE IF EXISTS accreditation;
DROP TABLE IF EXISTS sol_test_data;
DROP TABLE IF EXISTS virginia_sch_cnt;
--Main Data Set
CREATE TABLE hs_graduate (
school_year text NOT NULL,
level_cod... | true |
a65195ef34910b59fc045f844df284515ca1e4b2 | SQL | rachidelmessaoudi/Gestiondesnotes | /dataBase.sql | UTF-8 | 12,204 | 2.734375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Jun 19, 2019 at 06:11 AM
-- Server version: 5.6.28
-- PHP Version: 7.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `ListeGi`
--
-- ---------------------------... | true |
eb844aaab1451678c0170a7c082790b163988fb5 | SQL | TodorChapkanov/CSharp-Databases-Basics---MS-SQL | /Data Definition And Data Types/Data Definition And Data Types/13_CreateMoviesDatabase.sql | UTF-8 | 1,420 | 4.09375 | 4 | [
"MIT"
] | permissive | CREATE DATABASE Movies
USE Movies
CREATE TABLE Directors(
Id INT PRIMARY KEY IDENTITY ,
DirectorName NVARCHAR(100) NOT NULL,
Notes NVARCHAR(MAX)
)
CREATE TABLE Genres(
Id INT PRIMARY KEY IDENTITY,
GenreName NVARCHAR(100) NOT NULL,
Notes NVARCHAR(MAX)
)
CREATE TABLE Categories(
Id INT PRIMARY KEY IDENTITY,
CategoryN... | true |
3d083549168e66947e1339269bf9b1c15838c31e | SQL | celestebarrios/week4day2homework2 | /tableshw2.sql | UTF-8 | 871 | 3.578125 | 4 | [] | no_license | -- Create Customers Table
CREATE TABLE Customers(
Customer_id SERIAL PRIMARY KEY,
First_name VARCHAR(100),
Last_name VARCHAR(100)
);
-- Create Tickets Table
CREATE TABLE Tickets(
Purchase_id SERIAL PRIMARY KEY,
Seat_num Numeric(30, 1),
Movie_id INTEGER NOT NULL,
TimeBoughtTix DATE,
Customer_id INTEGER NOT NUL... | true |
c04bdf9416be0a1b9d0a6ee706c28838d1ed7c8d | SQL | yoheia/yoheia | /oracle/tpt_scripts/aot/demo3.sql | UTF-8 | 1,855 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | ------------------------------------------------------------------------------
--
-- Copyright 2017 Tanel Poder ( tanel@tanelpoder.com | http://tanelpoder.com )
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a c... | true |
29baa6506be7808a552c29e35e2ad80418fe932a | SQL | jedrzejkopiszka/Introduction_to_SQL | /case_expression.sql | UTF-8 | 1,323 | 4.53125 | 5 | [] | no_license | -- SQL part 3. CASE expression. Eliminating duplicates. Set operators.
--1. Assing labels based on salaries
SELECT surname, salary,
CASE
WHEN salary < 1500 THEN 'low paid'
WHEN salary < 3000 THEN 'average paid'
ELSE 'well paid'
END as label
FROM employees
ORDER BY surname
... | true |
6b8f4283896226644de8b592321f7a6de1bacab2 | SQL | La-Guillotine/webservices2 | /webservices.sql | UTF-8 | 15,066 | 3.265625 | 3 | [] | no_license | -- --------------------------------------------------------
-- Hôte : 127.0.0.1
-- Version du serveur: 10.5.4-MariaDB - mariadb.org binary distribution
-- SE du serveur: Win64
-- HeidiSQL Version: 11.0.0.5919
-- ------------------------------------------------... | true |
5f237856e5f31d92a5b5dd25cdca98f184e69b3e | SQL | Zeral-Zhang/wenlibackyard_program | /wenlibackyard/src/main/resources/sql/create/create_table_mysql.sql | UTF-8 | 6,170 | 3.953125 | 4 | [
"MIT"
] | permissive | -- 创建收藏夹表
CREATE TABLE `favorite` (
`favorite_id` VARCHAR(32) NOT NULL COMMENT '收藏夹编号',
`product_id` VARCHAR(32) NOT NULL COMMENT '商品编号',
`user_id` varchar(60) NOT NULL COMMENT '用户编号',
`create_date` date NOT NULL COMMENT '收藏时间',
`context` varchar(50) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`favorite_... | true |
7cb5a1fd9e5d7f22b4050c69ad46e21e74aec9c3 | SQL | PChaigneau/BoVoyageFinal | /BoVoyageFinal/BDD/Données BoVoyage.sql | UTF-8 | 6,703 | 3.234375 | 3 | [] | no_license | -- Afficher toutes les caractéristiques de la table Destination
--sp_help 'Destination'
-- Creation des 5 continents (niveau 1)
insert Destination(Id, Nom, Niveau, Description) values
(100, 'Europe', 1, 'Continent Europe'),
(200, 'Asie', 1, 'Continent Asie'),
(300, 'Afrique', 1, 'Continent Afrique'),
(400, 'Amériq... | true |
f18cb9b705f9c5ba8bd4d323beaa2c8f279cf06d | SQL | Timon7182/testuco | /modules/core/db/update/postgres/21/06/210617-2-createProduct01.sql | UTF-8 | 202 | 3.25 | 3 | [] | no_license | alter table TESTWORK_PRODUCT add constraint FK_TESTWORK_PRODUCT_ON_ORDER foreign key (ORDER_ID) references TESTWORK_ORDER(ID);
create index IDX_TESTWORK_PRODUCT_ON_ORDER on TESTWORK_PRODUCT (ORDER_ID);
| true |
9ab26ffa02251efbf679fa0a87f3f2d073f7f699 | SQL | Zettoseb27/ProyectoPIS | /Base de datos/Datos/persona.sql | UTF-8 | 1,813 | 3.09375 | 3 | [] | no_license | use proyecto;
SELECT * FROM persona;
insert INTO `persona` (`perId`, `perDocumento`, `perNombre`, `perApellido`, `perEstado`, `perUsuSesion`, `per_created_at`, `per_updated_at`, `usuario_s_usuId`) VALUES
(1, '8888888', 'has', 'gs', 1, NULL, '2018-06-06 15:02:04', '2018-10-09 21:10:14', 1),
(2, '5555555', 'has', 'gs',... | true |
ebb3cf5ef1f6b6abea33cb8bfcbe57c52ecd55c3 | SQL | 421342531/NaiLao | /eclipse-workspace/NaiLaoDemo/database/TABLE/pee_count.sql | UTF-8 | 247 | 2.765625 | 3 | [] | no_license | --记录小便信息
CREATE TABLE `mysql`.`pee_count` (
`date` varchar(100) CHARACTER SET utf8 NOT NULL COMMENT '日期',
`count` varchar(100) CHARACTER SET utf8 NULL DEFAULT NULL COMMENT '小便次数',
PRIMARY KEY (`date`) USING BTREE
); | true |
251564195758447350d26a124baf63eee07c234a | SQL | deliverator23/CWON_Leaning_Tower_of_Pisa | /CWON_Leaning_Tower_of_Pisa/Gameplay/Leaning_Tower_Gameplay.sql | UTF-8 | 3,217 | 3.109375 | 3 | [] | no_license |
INSERT INTO Types (Type, Kind) VALUES ('BUILDING_LEANING_TOWER', 'KIND_BUILDING');
INSERT INTO Buildings (BuildingType, Name, Description, PrereqTech, PrereqDistrict, AdjacentDistrict, Cost, AdvisorType, MaxWorldInstances, IsWonder, RequiresPlacement, Quote)
VALUES ('BUILDING_LEANING_TOWER', 'LOC_BUILDING_LEANING_TOW... | true |
92c295f60a8520dfb61def93126b73d7f82196b0 | SQL | ml1528171114/LinuxClassRepo | /Homework/Week07/StudentSubmissions/ChristopherPerez/query.sql | UTF-8 | 909 | 2.78125 | 3 | [] | no_license | --find the murderer
--imprison the murderer
select * from crime_scene_report where date="20180115" and city="SQL City" and type="murder";
select * from person where address_street_name="Franklin Ave" and name like "%Annabel%";
select * from person where address_street_name="Northwestern Dr" order by address_number;
sel... | true |
2d814640ab71f57fe98e0de9880cc1b9d61dbed3 | SQL | engineer-dammy/testingGit | /SQLModule3.sql | UTF-8 | 2,317 | 4.125 | 4 | [] | no_license | /*
*/
--Question1 Prepare a report of all the persons with first name starting from 'J'--
select firstName from [Person].[Person]
where firstName like 'J%'
select firstName +' '+ MiddleName +' '+LastName [Full Name] from [Person].[Person]
where firstName like 'J%'
--Question 2 Prepare a report of emplo... | true |
a7d5606a9150315e7f9c558d9cc0979e55ec5999 | SQL | cherrythefatbunny/mybatis-multi-ds | /multi-datasource-demo/src/main/resources/init/ds1.sql | UTF-8 | 403 | 2.765625 | 3 | [] | no_license | CREATE TABLE "public"."person" (
"id" varchar(10) NOT NULL COLLATE "default",
"name" varchar(10) COLLATE "default",
PRIMARY KEY ("id") NOT DEFERRABLE INITIALLY IMMEDIATE
)
WITH (OIDS=FALSE);
ALTER TABL... | true |
b238b6da50ef919201159d44d4acdee494169ca1 | SQL | nivertech/Olive | /Database/Schema Objects/Schemas/Exchange/Views/Price.view.sql | UTF-8 | 394 | 4.03125 | 4 | [] | no_license | CREATE VIEW [Exchange].[Price]
AS
SELECT
M.MarketId MarketId,
O.Price Price,
SUM(O.Volume) Volume
FROM
Exchange.[Order] O
INNER JOIN
Banking.Account SA ON SA.AccountId = O.FromAccountId
INNER JOIN
Banking.Account DA ON DA.AccountId = O.ToAccountId
INNER JOIN
Exchange.Market M ON M.FromCurrencyId = SA.Curr... | true |
334e4577746408deeee75ea73266fa9c2dea747b | SQL | saiplodark/bobamap | /db/stores/get_stores.sql | UTF-8 | 199 | 3.875 | 4 | [] | no_license | SELECT s.store_id, s.img, s.name, s.address, s.comment, AVG AS average
FROM stores s
LEFT OUTER JOIN
(SELECT store_id, AVG(rating) FROM rating GROUP BY store_id) AS r
ON s.store_id = r.store_id; | true |
fae4915266177005635c6af659172eef06b92f9c | SQL | aakhmedkhodzhaev/Job4j_TodoList | /db/todolist.sql | UTF-8 | 932 | 3.875 | 4 | [] | no_license | -- Table: public.item
-- DROP TABLE public.item;
CREATE TABLE public.item
(
id integer NOT NULL DEFAULT nextval('item_id_seq'::regclass) ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
description character varying(250) COLLATE pg_catalog."default",
created date,
done boolean,
CONST... | true |
c9ed24dea4087a8fc67447f1bb7508a97453822e | SQL | davidangelcb/mimundodecolores | /admin/bd/argenper_structura.sql | UTF-8 | 4,865 | 3.015625 | 3 | [] | no_license | /*
SQLyog Enterprise - MySQL GUI v6.13
MySQL - 5.1.41 : Database - argenpersms
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
create database if not exists `argenpersms`;
USE `argenpersms`;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FORE... | true |
6b43777ea91309faef201497cc870a5b1f053081 | SQL | ivashog/SQL_work | /count_adert_by_subsegm.sql | UTF-8 | 6,548 | 3.78125 | 4 | [] | no_license | -- Количество валидной продажи по облцентрам --
WITH report_cities AS (
SELECT substring(koatuu_code, '\d{5}') AS city_koatuu, name, district
FROM uvekon.re_dic_koatuu
WHERE locality_form = 1 AND locality_status = 1
)
SELECT DISTINCT
(SELECT name FROM report_cities WHERE district = id_kotuu_district) AS ci... | true |
068191aab0e9fd12cef57d5ae4bb589ad7e68b94 | SQL | darshanpatil324/Spring-AU-2020 | /17-01-2020-AN-Java_Advanced/db.sql | UTF-8 | 5,480 | 3.234375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.18, for macos10.14 (x86_64)
--
-- Host: localhost Database: office
-- ------------------------------------------------------
-- Server version 8.0.18
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;... | true |
bf300db05c52c3760b6f8bd80a8eea6ccf76db93 | SQL | DreRandaci/chinook | /chinook-queries.sql | UTF-8 | 8,143 | 4.4375 | 4 | [] | no_license |
/* 1. Provide a query showing Customers (just their full names, customer ID and country) who are not in the US. */
/* SELECT CustomerId, FirstName, LastName, Country FROM Customer
WHERE Country != 'USA' */
/* 2. Provide a query only showing the Customers from Brazil. */
/* SELECT * FROM Customer WHERE Country = 'Br... | true |
7a9e8d060005de72a7492c4484d178638e78255d | SQL | zlonglove/MyTestProject | /app/src/main/assets/sqllite/init.sql | UTF-8 | 3,035 | 2.703125 | 3 | [] | no_license | CREATE TABLE BuryPoint(
buryPointId TEXT,
areano TEXT,
areanoname TEXT,
buttonno TEXT,
buttonname TEXT
);
INSERT INTO BuryPoint(buryPointId,areano,areanoname,buttonno,buttonname)
SELECT 'SubMenuActivity_tv_titlemenu_tofavor','morepoint','气泡框','morepoint-mainpage','首页' UNION ALL
SELECT 'SubMenuActivity_tv_t... | true |
46273154a3a49ccd0dde4ea2e94a0bcd244f03fc | SQL | samiran2076/DBMS | /ASSIGNMENT8_.sql | UTF-8 | 6,854 | 3.71875 | 4 | [] | no_license | /*1. Drop and create Student and Department tables again. */
DROP VIEW dbo.vStudentDept
DROP TABLE dbo.Student
DROP TABLE dbo.Department
CREATE TABLE dbo.Student
(
StudentId INT NOT NULL,
StudentName VARCHAR(100),
StudentAddress VARCHAR(200),
Phone NUMERIC(10,0),
Email VARCHAR(50),
DateOfBirth Date,
Date... | true |
4391fc75380944b424f624bf14e2dc98427994b3 | SQL | fidelglock/IOSL_DC3-BackEnd | /server/SQL/dbdiagram.sql | UTF-8 | 1,545 | 2.984375 | 3 | [] | no_license |
TABLE "Person"
{
"ID" int
"FullName" varchar
"Email" varchar
"Password" varchar
"DateOfBirth" date
"PersonType" integer
"PersonRole" integer
"PicturePath" varchar
"googleProviderId" varchar
"googleAccessToken" varchar
}
TABLE "Address"
{
"Addres... | true |
017f119a805c398af347daf4899f0ba71fda77d6 | SQL | SoftTech-Course/ProjectHub | /project-service/src/main/resources/db/migration/V1__create_project.sql | UTF-8 | 297 | 3.046875 | 3 | [] | no_license | CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE TABLE IF NOT EXISTS "projects"
(
id uuid NOT NULL DEFAULT gen_random_uuid(),
name varchar(50) NOT NULL,
owner_id uuid NOT NULL,
created_at timestamptz,
updated_at timestamptz,
CONSTRAINT pkey_projects PRIMARY KEY (id)
);
| true |
fb42c2e20ede2f6d2887c09fa038e8e1b52fdc52 | SQL | ahmarulabdi/e-market-place | /db/aplikasi_proyek (1).sql | UTF-8 | 7,937 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 17, 2017 at 11:25
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_C... | true |
d3f6a11f2d277824074e1b5215ff60c1f00ad4a1 | SQL | qumino2/Git_Your_SQL | /LeetCode/597_好友申请1_总体通过率.sql | UTF-8 | 296 | 2.90625 | 3 | [] | no_license | -- select 一个标量; 注意嵌套函数的时候运用换行来保持格式清晰
select round(
coalesce(
(select count(distinct requester_id ,accepter_id) from RequestAccepted) /
(select count(distinct sender_id ,send_to_id) from FriendRequest)
,0)
,2) as accept_rate ; | true |
a539e38cafbfbb10d0c75880244726448c8efe1d | SQL | xiaoJack/btcrobot | /websites/databases/btcrobot_structure.sql | UTF-8 | 9,248 | 3.546875 | 4 | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- 主机: 127.0.0.1
-- 生成日期: 2014-01-21 08:41:22
-- 服务器版本: 5.5.34
-- PHP 版本: 5.4.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_... | true |
ea611e2dd37e973f2ad758de5101c700d213d70a | SQL | BrenPatF/oracle_sql_projects | /sums_products/sums_products.sql | UTF-8 | 2,282 | 3.671875 | 4 | [
"MIT"
] | permissive | @..\initspool sums_products
PROMPT Sums
SELECT department_id, employee_id, salary,
SUM(salary) OVER (PARTITION BY department_id ORDER BY employee_id) running_sum,
SUM(salary) OVER (PARTITION BY department_id) total_sum
FROM employees
-- WHERE department_id = 60
ORDER BY department_id, employee_id
/
PRO... | true |
210c1e6624fbb603029a3ef3bcbab59f6ebb1306 | SQL | EldherMX/OpenHouse.Core.Web | /OpenHouseSQL/Tables/alertType.sql | UTF-8 | 388 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS alertType;
SET FOREIGN_KEY_CHECKS = 1;
CREATE TABLE `alertType` (
`alertTypeId` INT NOT NULL,
`alertType` VARCHAR(100),
PRIMARY KEY(`alertTypeId`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
INSERT INTO `alertType` VALUES(1,'INFORMATION');
INSERT INTO `alertType` V... | true |
e2ac67410869e14a2365b1122764d712935cb876 | SQL | shielcon/PastCSHomework | /CS340/Week 5/Assignment 2 part 2/q1.sql | UTF-8 | 154 | 3.4375 | 3 | [] | no_license | SELECT film_id from film
WHERE film.length = (SELECT MAX(film.length) FROM film)
OR film.rental_duration = (SELECT MIN(film.rental_duration) FROM film); | true |
7f5d41c71612ba61b8d447364d49e7e41dd10bf2 | SQL | NCIP/catissue-core | /software/caTissue/db/db-upgrade/MySql/CSMUpgrade_3.2_to_4.2.sql | UTF-8 | 2,478 | 3.4375 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | DROP TABLE IF EXISTS `CSM_FILTER_CLAUSE`;
CREATE TABLE `CSM_FILTER_CLAUSE` (
FILTER_CLAUSE_ID BIGINT AUTO_INCREMENT NOT NULL,
CLASS_NAME VARCHAR(100) NOT NULL,
FILTER_CHAIN VARCHAR(2000) NOT NULL,
TARGET_CLASS_NAME VARCHAR (100) NOT NULL,
TARGET_CLASS_ATTRIBUTE_NAME VARCHAR (100) NOT NULL,
TARGET_CLASS_... | true |
f7758f031541d4ef93338b6960d9a9b462fe8de7 | SQL | TyPhyter/bamazon | /bamazonSchema.sql | UTF-8 | 1,546 | 2.609375 | 3 | [] | no_license | DROP DATABASE IF EXISTS bamazonDB;
CREATE DATABASE bamazonDB;
USE bamazonDB;
CREATE TABLE products(
id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(100) NOT NULL,
department_name VARCHAR(45) NOT NULL,
price INT default 0,
stock_quantity INT default 0,
PRIMARY KEY (id)
);
INSE... | true |
6986f70aaf955d9b73207c85ce07ca5e96085ded | SQL | beshkenadze/labcms | /www/install/kernel.sql | UTF-8 | 13,623 | 3.0625 | 3 | [] | no_license | DROP TABLE IF EXISTS ?_access;
CREATE TABLE IF NOT EXISTS ?_access (
`group_id` int(11) NOT NULL default '0',
`module_id` int(11) NOT NULL default '0',
`permis` set('read','add','edit','delete','msg_read','msg_add','msg_edit','msg_delete','moderator','admin') default NULL,
PRIMARY KEY (`group_id`,`module... | true |
176f397bf3f77fbaed60b41de854fc04fb8d2e92 | SQL | iamkapilgarg/BootcampX | /3_queries_group-by/large_cohorts.sql | UTF-8 | 155 | 3.65625 | 4 | [] | no_license | SELECT cohorts.name, count(*)
FROM students
JOIN cohorts
on students.cohort_id = cohorts.id
GROUP BY cohorts.name
HAVING count(*) >= 18
ORDER BY count(*); | true |
950d387c694c855501e212bdbec1d585abbf644d | SQL | UniTime/unitime | /Documentation/Database/Oracle/Changes/193 Student Advisors.sql | UTF-8 | 2,648 | 3.203125 | 3 | [
"Apache-2.0",
"EPL-2.0",
"CDDL-1.0",
"MIT",
"CC-BY-3.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-freemarker",
"LGPL-2.1-only",
"EPL-1.0",
"BSD-3-Clause",
"LGPL-2.1-or-later",
"LGPL-3.0-only",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-generic-cla",
... | permissive | /*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may... | true |
c231e6d56026cc21326bae462bbd983428eeebbf | SQL | KaushikKPDARE/Mems_Cardio_SQL_code | /mems_cardio_person.sql | UTF-8 | 3,052 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | CREATE DATABASE IF NOT EXISTS `mems_cardio` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `mems_cardio`;
-- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: localhost Database: mems_cardio
-- ------------------------------------------------------
-- Server version 5.6.26-log
/*!40101 SET @OLD... | true |
729695ce12e766cf49e7427906265b4d15e0ce5f | SQL | xuelin3530/JavaWeb | /20190930/files/sql针对练习/dept.sql | UTF-8 | 919 | 3 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : ttt
Source Server Version : 50527
Source Host : localhost:3306
Source Database : test2
Target Server Type : MYSQL
Target Server Version : 50527
File Encoding : 65001
Date: 2018-10-15 09:02:44
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------... | true |
45a8fe6efb205f3a076d3d7a93b4dd803df6d79c | SQL | AlexisJamal/ISIWEB1-3A-info | /TP5/isiweb_tp5bis.sql | UTF-8 | 2,808 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost
-- Généré le : lun. 07 jan. 2019 à 09:40
-- Version du serveur : 10.1.37-MariaDB
-- Version de PHP : 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4010... | true |
61ccdf20ddc8909fa575b395b9e92a14666a5a07 | SQL | ronaldoexpert/CurralNovo | /InseminaSys/Win32/Debug/Scripts/Versao 1.0/05 - Versão 1.3.sql | UTF-8 | 1,250 | 2.703125 | 3 | [] | no_license | /*
-- 1.3.0 --
- Criação da tabela empresa e campo CODEMPRESA nas tabelas (14/08/2018)
-- 1.3.1 --
- Opção para deletar inseminacao na tela de Confirmação (23/08/2018)
*/
INSERT INTO VERSAO VALUES(3, '08/14/2018', 'Versao 1.3');
Create table EMPRESA(
ID INTEGER NOT NULL PRIMARY KEY,
SITUACAO VARCHAR(10),
RAZAO_SOC... | true |
60e4814cf612e45e20d81526ac5c54765d00adfe | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day11/select2334.sql | UTF-8 | 273 | 3.140625 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='Thermometer' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['5212','2100_9','5216','2074','4211','3100_4','4208','3088','3100_2','4243'])
| true |
5bdb4c99c66f285fa6be941befce2b1bff72ee14 | SQL | LynetteNB/database-exercises | /contacts_migration.sql | UTF-8 | 257 | 2.765625 | 3 | [] | no_license | USE codeup_test_db;
DROP TABLE IF EXISTS contacts;
CREATE TABLE contacts(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(50) NOT NULL,
number CHAR(10),
email VARCHAR(50) NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME,
PRIMARY KEY (id)
); | true |
5122293f869ee6b86b22a194087fdac70adc905e | SQL | essaghirm/hiit-consulting-tchat | /hiit_consulting_test_db.sql | UTF-8 | 2,228 | 3.09375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Sep 23, 2020 at 01:32 AM
-- Server version: 5.7.26
-- PHP Version: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
69dddba4c0275a1a05ac80e84be3a5d6b6acddbe | SQL | Delamater/SQL | /SqlServer/Performance/QueryAnalysis/GetCurrentlyExecutingSQLStatements.sql | UTF-8 | 685 | 3.78125 | 4 | [] | no_license | /* List Currently Executing Statements */
SELECT
r.session_id,
[status],
substring(
qt.text,r.statement_start_offset/2,
(
CASE
WHEN r.statement_end_offset = -1
THEN LEN(CONVERT(NVARCHAR(MAX), qt.text)) * 2
ELSE r.statement_end_offset END - r.statement_start_offset
)/2
) AS ... | true |
0ec141fe18fe9f2c638c4a0f092471c6c4946f2f | SQL | wachirapong1993/program | /SQL/check_smt_rev01.sql | UTF-8 | 144,439 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 19, 2018 at 02:58 AM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.0.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
164a1a583c6b27841cc1d0360120a0b099db6ffe | SQL | brenthl88/SQL-Challenge | /sql-homework-create.sql | UTF-8 | 790 | 3.671875 | 4 | [] | no_license | -- Drop table if exists
DROP TABLE department;
-- Create the players table
CREATE TABLE department (
dept_no VARCHAR,
department_name VARCHAR
);
-- Check data import
SELECT *
FROM department;
-- Create the employee table
CREATE TABLE employee (
birth_date DATE,
first_name VARCHAR,
last_name VARCHAR,
gender CHA... | true |
0f5add9c9060c1ad4584716802c48ddc7bcd9d2a | SQL | Leslym03/Restaurante | /BD/DisenhoBD/DisenhoFisico/Filgroups.sql | UTF-8 | 6,693 | 2.984375 | 3 | [] | no_license |
--- Crea carpetas en las que se guardara la informacion
EXEC sys.xp_create_subdir 'C:\RESTAURANTE\DATOS\'
EXEC sys.xp_create_subdir 'C:\RESTAURANTE\LOG\'
EXEC sys.xp_create_subdir 'C:\RESTAURANTE\BACKUP\'
--- Se crea la base de datos RESTAURANTE
CREATE DATABASE RESTAURANTE_BD
ON PRIMARY(
NAME = 'Restaurante_Datos',... | true |
c79dce5788bcb685ec9916698146d8cba910d460 | SQL | kcondic/DUMPInternship2020Sql2 | /01-ManyToManyWithAttribute.sql | UTF-8 | 316 | 3.390625 | 3 | [] | no_license | DROP TABLE Grades
CREATE TABLE StudentCourses
(
StudentId int FOREIGN KEY REFERENCES Students(Id) NOT NULL,
CourseId int FOREIGN KEY REFERENCES Courses(Id) NOT NULL,
CONSTRAINT StudentCoursesPrimaryKey PRIMARY KEY (StudentId, CourseId),
Mark int CHECK(Mark BETWEEN 1 AND 5),
GradedOn datetime2
); | true |
00ee1d7dc8ccbce25fb99fd6147ff6d4c97768e0 | SQL | kaspa1/paf | /shipping.sql | UTF-8 | 1,480 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: May 25, 2019 at 04:34 PM
-- Server version: 5.7.19
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
0deb9486954e294827486f33419650de94299e93 | SQL | Dheeraj543/leetcode | /count-apples-and-oranges.sql | UTF-8 | 296 | 3.9375 | 4 | [] | no_license | SELECT
SUM(apple_count) AS apple_count,
SUM(orange_count) AS orange_count
FROM (
SELECT
COALESCE(c.apple_count, 0) + b.apple_count AS apple_count,
COALESCE(c.orange_count, 0) + b.orange_count AS orange_count
FROM Boxes b
LEFT OUTER JOIN Chests c
ON c.chest_id = b.chest_id
) t | true |
7e1b82ab04943ac4425920c844902309b07346f8 | SQL | a1is3n/oracle | /MONITOR/oracle_table_indexes.sql | UTF-8 | 511 | 3.3125 | 3 | [] | no_license | -- -----------------------------------------------------------------------------------
-- Hazırlayan : Bugra Parlayan
-- Web : www.bugraparlayan.com.tr
-- -----------------------------------------------------------------------------------
SELECT a.index_name
,a.column_name
,a.column_position
FROM a... | true |
f2571552dfedaab7853a80afe10e74a7df125649 | SQL | R11M11R/LenguasOaxaca | /sql/tablas.sql | UTF-8 | 2,297 | 3.921875 | 4 | [] | no_license |
CREATE TABLE IF NOT EXISTS estado (
clave INT(11) NOT NULL PRIMARY KEY,
descripcion VARCHAR (60) NOT NULL
);
CREATE TABLE IF NOT EXISTS municipio (
clave INT(11) NOT NULL PRIMARY KEY,
descripcion VARCHAR (60) NOT NULL,
id_estado INT(11) NOT NULL REFERENCES estado (clave)
);
CREATE TABLE IF NOT EXISTS familia_lin... | true |
016fe1919f440cee69afa66de1405447d9ce9634 | SQL | bellmit/origin | /family_order/sql/TD_B_CTRM_RELATION/SEL_BY_CTRM_PRODUCT_TYPE.sql | UTF-8 | 101 | 2.578125 | 3 | [] | no_license | SELECT DISTINCT T.PRODUCT_ID
FROM TD_B_CTRM_RELATION T
WHERE T.CTRM_PRODUCT_TYPE = :CTRM_PRODUCT_TYPE | true |
0c26dc95f1adb35d36cbc10b7cfdf849b624f027 | SQL | brusinow/booktown | /mybooktownhomework.sql | UTF-8 | 2,402 | 4.8125 | 5 | [] | no_license | -- ORDER
-- 1. Find all subjects sorted by subject
SELECT * FROM subjects ORDER BY subjects ASC;
-- 2. Find all subjects sorted by location
SELECT * FROM subjects ORDER BY location ASC;
-- WHERE
-- 1. Find the book "Little Women"
SELECT * FROM books WHERE title = 'Little Women';
-- 2. Find all books containing the wor... | true |
f1c0c4948dcc32e5c84d7b0eb59fe7a549e5beb7 | SQL | MdMjd/PublicTalk | /shouts.sql | UTF-8 | 2,175 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 21, 2017 at 07:49 PM
-- Server version: 5.7.19-0ubuntu0.16.04.1
-- PHP Version: 7.0.22-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
39a8c097f30b0c6b7d933be29f75cb21d11a3ca2 | SQL | Moverr/tmis | /scripts/db_20150204.sql | UTF-8 | 7,849 | 3.671875 | 4 | [
"Apache-2.0"
] | permissive |
ALTER TABLE `vacancy` ADD `last_updated` DATETIME NOT NULL,
ADD `last_updated_by` VARCHAR( 100 ) NOT NULL;
ALTER TABLE `application` DROP `person_id` ;
ALTER TABLE `application` ADD CONSTRAINT vacancy_id UNIQUE (`vacancy_id` ,`user_id`);
ALTER TABLE `saved_vacancies` ADD CONSTRAINT user_id UNIQUE (`user_id` ,`vacan... | true |
d9b6e7928c276cfbc0baf2e20a0878bc6ef91b73 | SQL | Balirina/Transporte-de-mercancias | /Tablas/crearRUTA.sql | UTF-8 | 6,970 | 2.75 | 3 | [] | no_license | CREATE TABLE RUTA
(COD_RUTA NUMBER(8)NOT NULL PRIMARY KEY,
FECHA DATE)
/
insert into RUTA values (15000001, to_date('02/01/2015', 'dd/mm/yyyy'));
insert into RUTA values (15000002, to_date('10/01/2015', 'dd/mm/yyyy'));
insert into RUTA values (15000003, to_date('15/03/2015', 'dd/mm/yyyy'));
insert into RUTA ... | true |
f8925ea76d0a125894524231a6d946cb4431145e | SQL | v-komarov/psv3 | /sql/insert_data_eds_list.sql | WINDOWS-1251 | 2,597 | 2.53125 | 3 | [] | no_license |
DELETE FROM mr_eds_list;
INSERT INTO mr_eds_list (mr_rec_id,mr_eds_name_shot,mr_eds_name) VALUES('112','','');
INSERT INTO mr_eds_list (mr_rec_id,mr_eds_name_shot,mr_eds_name) VALUES('163','','');
INSERT INTO mr_eds_list (mr_rec_id,mr_eds_name_shot,mr_eds_name) VALUES('166','','');
INSERT INTO mr_eds_list (mr_rec_id,m... | true |
24974bde4eec206c2f1d48d84102e72d2623aaf5 | SQL | YurySS/oracle_dbd_plsql_basic | /5. scope/3. sql_plsql_vars.sql | UTF-8 | 1,595 | 3.578125 | 4 | [] | no_license | /*
Курс: PL/SQL.Basic
Автор: Кивилев Д.С. (https://t.me/oracle_dbd, https://oracle-dbd.ru, https://www.youtube.com/c/OracleDBD)
Лекция 5. Область действия и видимость
Описание скрипта: столбец в SQL совпадает с переменной.
*/
-- Подготовка. Создадим табличку и вставим четыре записи
drop table my_tab;
cre... | true |
94228fd834fd513389dc128facdaf6beaeec0d7c | SQL | Ensare/PHP_Gr15_2020 | /databaza/databaza.sql | UTF-8 | 2,069 | 3.296875 | 3 | [] | no_license | create database phpconnection;
use phpconnection;
CREATE TABLE IF NOT EXISTS `Products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`image` varchar(255) NOT NULL,
`price` double(10,2) NOT NULL,
PRIMARY KEY (`id`)
);
INSERT INTO `products` (`id`, `name`, `image`, `pri... | true |
c3dcc7f5c228145bfe9b102cdfe5f8f8059eaf2f | SQL | ProxyRare/flux | /phx2flux.sql | UTF-8 | 2,050 | 2.6875 | 3 | [] | no_license | INSERT INTO `texts` (`identifier`, `display_text`) VALUES ('cmd_rank_desc', ':rank <username> <rank> - Ranks the target user to the chosen rank');
INSERT INTO `texts` (`identifier`, `display_text`) VALUES ('cmd_summonall_desc', ':summonall - Sends all the users to the room you are in');
INSERT INTO `texts` (`identifi... | true |
224560ac20f8436cad840e35bdc7e5b8e9c3e9df | SQL | EnnioSimoes/zf2angularjs | /data/zf2angular.sql | UTF-8 | 2,553 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tempo de Geração: 07/05/2015 às 00:44
-- Versão do servidor: 5.5.43-0ubuntu0.14.04.1
-- Versão do PHP: 5.5.9-1ubuntu4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_... | true |
43746c02ac9d205e9690ecae5db1316a425956d1 | SQL | AlexB8675/Esame | /database.sql | UTF-8 | 1,268 | 3.5625 | 4 | [] | no_license | create table Categorie (
id_categoria int not null auto_increment,
nome varchar(32) not null,
primary key (id_categoria)
);
create table Oggetti (
id_oggetto int not null auto_increment,
e_id_categoria int not null,
nome varchar(32) not null,
... | true |
99fa54d608b893a269b2b71639c980cd89cce492 | SQL | ttilley02/VLServer | /migrations/004.do.create.notes_vl.sql | UTF-8 | 492 | 2.890625 | 3 | [] | no_license | CREATE TABLE vocabulab_notes (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
note TEXT,
cardData text,
favorite text, -- default as false
known text, -- set default value "something"
date_created TIMESTAMP DEFAULT now() NOT NULL,
card_id INTEGER
REFERENCES vocabulab_cards(id) ON DELETE CA... | true |
fcc8e18f94071bb3abdf69206576120d1668fb09 | SQL | cttestid41/Apache_Malhar | /examples/twitter/src/main/resources/mysql.sql | UTF-8 | 1,301 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | --
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ... | true |
8f33ee5120ac1a69659e4c725fb21e77a9593d1d | SQL | InNomineMortis/test_task | /db/create_db.sql | UTF-8 | 1,525 | 3.53125 | 4 | [] | no_license | -- DROP TABLE comment cascade ;
-- DROP TABLE post cascade;
-- DROP TABLE person cascade;
-- DROP TABLE address cascade;
--CREATE EXTENSION pgcrypto;
CREATE TABLE address
(
address_id int PRIMARY KEY,
index int NOT NULL,
country varchar(20) NOT NULL,
region varchar(30) NOT ... | true |
e7555981cb5489cd3a9f25e3ed9df6b8ca003289 | SQL | hviraganathan/sql | /last_5_clicks.sql | UTF-8 | 6,332 | 4 | 4 | [] | no_license | WITH accounts AS (
SELECT DISTINCT clientuserid
, s.SUBSCRIPTIONID
, ACTIVATIONCODE
, OFFERID
, createddate
, SERVICE_NAME
, SERVICEID
, Last_value(LASTUPDATED) OVER (partition by CLIENTUSERID, s.SUBSCRIPTIONID ORDER BY LASTUPDATED) as LASTUPDATED
FROM svot.MPP_SUBSCRIPTION... | true |
3cc01db4b62480976b4f70524f8e2915e912b107 | SQL | zzq5271137/learn_mysql | /Chapter15-Explain执行计划/01_Explain执行计划.sql | UTF-8 | 9,793 | 4.34375 | 4 | [] | no_license | /*
* ------------------explain------------------
* 查询执行计划:
* 使用explain关键字, 可以模拟优化器执行的SQL语句, 从而知道MYSQL是如何处理sql语句的;
* 通过explain可以分析查询语句或表结构的性能瓶颈;
*
* 作用
* 1. 查看表的读取顺序
* 2. 数据读取操作的操作类型
* 3. 查看哪些索引可以使用
* 4. 查看哪些索引被实际使用
* 5. 查看表之间的引用
* 6. 查看每张表有多少行被优化器执行
*
* 使用方法:
* explain sql语句;
*
* 分析包含信息:
* 1. id
* 2.... | true |
2d0150c02f82e32dd0452258c9796751d0fba5b6 | SQL | ideaconsult/ambit-mirror | /ambit2-all/ambit2-db/src/main/resources/ambit2/db/q/substance_composition_flat.sql | UTF-8 | 169 | 2.84375 | 3 | [] | no_license | SELECT prefix,hex(uuid),idsubstance,idchemical,smiles,inchi,inchikey,relation FROM substance
join substance_relation using(idsubstance) join chemicals using(idchemical) | true |
a04ad74bd55df4d3f700a544ac5a88539685bb93 | SQL | PuneethReddyV/invoice_management_system | /src/main/resources/db/migration/V2021.1.0.001__create_business.sql | UTF-8 | 208 | 2.640625 | 3 | [] | no_license | CREATE TABLE business(uuid VARCHAR(36),
name VARCHAR(36) NOT NULL,
PRIMARY KEY (uuid),
UNIQUE (name));
| true |
b62fca5ba4e7eeecdee6d373fba56c30b9a65f8b | SQL | dandraden/Database-Scripts | /SqlServer/Scripts-SQL/SCRIPT - HISTORICO DE JOBS.sql | ISO-8859-1 | 949 | 3.984375 | 4 | [] | no_license | select job_name
, step_name
, case run_status
when 0 then 'Erro'
When 1 then 'Sucesso'
Else 'Desconhecido'
end run_status
, run_datetime
, run_duration
from
(
select job_name, run_datetime, step_name, run_status,
SUBSTRING(run_duration, 1, 2) + ':' + SUB... | true |
a08fa18cb353814b80b0511ff7b1aa89f2bb7d42 | SQL | wsapiens/ticket-service | /src/main/resources/db/migration/V1__schema.sql | UTF-8 | 1,218 | 4 | 4 | [] | no_license | CREATE TABLE VENUE (
LEVEL_ID INT IDENTITY NOT NULL PRIMARY KEY AUTO_INCREMENT,
LEVEL_NAME VARCHAR(100) NOT NULL,
PRICE DECIMAL NOT NULL,
NUMBER_OF_ROW INT,
SEATS_IN_ROW INT
);
CREATE TABLE CUSTOMER (
ID BIGINT IDENTITY NOT NULL PRIMARY KEY AUTO_INCREMENT,
EMAIL VARCHAR(100) NOT NULL,
F... | true |
72468989aadf8d7141c9a66dd40f63a13c5dad4d | SQL | biplob023051/rubicon | /app/webroot/rcimport/scripts/processed/20150819_151122_objekt_2365_09.sql | ISO-8859-1 | 2,652 | 2.828125 | 3 | [] | no_license | /* Uebersetzungen */
INSERT INTO Uebersetzungen (UEB_ID,UEB_NUMMER,UEB_FKID_SPR_ID,UEB_TEXT) VALUES
('96503','33297','1','Meerblick Villa in Nova Santa Ponsa zu verkaufen'),
('96504','33298','1','Diese mediterrane Villa wurde 1999 mit hochwertigen Materialien erstellt. Sie steht auf einem ca 1.650m groen Grundstck in ... | true |
5bdffefd98bdf3dc12640daf2351ac4caf2d3812 | SQL | LRojon/Bestiary | /bestiary.sql | UTF-8 | 5,678 | 3.65625 | 4 | [] | no_license | DROP DATABASE IF EXISTS bestiary;
CREATE DATABASE bestiary CHARACTER SET utf8 COLLATE utf8_bin;
USE bestiary;
DROP TABLE IF EXISTS crea_skill;
DROP TABLE IF EXISTS crea_ability;
DROP TABLE IF EXISTS crea_env;
DROP TABLE IF EXISTS creature;
DROP TABLE IF EXISTS size;
DROP TABLE IF EXISTS `type`;
DROP TABLE IF EXISTS ... | true |
19f052a340bab411da32537c6e76bee31601b395 | SQL | TheBigSteph/sql-project | /8_using_null.sql | UTF-8 | 812 | 4.3125 | 4 | [] | no_license | SELECT name FROM teacher WHERE dept IS NULL
SELECT teacher.name, dept.name
FROM teacher INNER JOIN dept ON (teacher.dept=dept.id)
SELECT t.name, d.name
FROM teacher t LEFT OUTER JOIN dept d ON t.dept = d.id
SELECT t.name, d.name
FROM teacher t RIGHT OUTER JOIN dept d ON t.dept = d.id
SELECT name, COALESCE(mo... | true |
aa878ab9b6dd307cae0a5bce21a71559eb053960 | SQL | ClickHouse/ClickHouse | /tests/queries/1_stateful/00046_uniq_upto_distributed.sql | UTF-8 | 180 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | -- Tags: distributed
SELECT RegionID, uniqExact(UserID) AS u1, uniqUpTo(10)(UserID) AS u2 FROM remote('127.0.0.{1,2}', test, visits) GROUP BY RegionID HAVING u1 <= 11 AND u1 != u2 | true |
e1f87998d5fb439163a65342ff6dd523b665abfd | SQL | AndersonDevv/EducacaoFinanceiraInfantil_projetoDH | /Modelos-Logico-e-Fisico/TABELAS_projeto.sql | UTF-8 | 1,064 | 3.296875 | 3 | [] | no_license | USE plataforma_projeto;
CREATE TABLE IF NOT EXISTS dias_semana(
dia_nome VARCHAR(13),
dia_codigo SMALLINT AUTO_INCREMENT PRIMARY KEY
);
CREATE TABLE IF NOT EXISTS UF (
uf_unidade SMALLINT NOT NULL AUTO_INCREMENT, /* o que é isso??*/
uf_codigo SMALLINT , /* NÃO FUNCIonou COM O NOT NULL*/
uf_sigla VARCHAR... | true |
9344c9afd7ed9eb22888a00aba84bd663c8a2e5c | SQL | vijaydairyf/TimelyFish | /SolomonApp/dbo/Stored Procedures/dbo.smCodeType_Fault_Id.sql | UTF-8 | 319 | 3.09375 | 3 | [] | no_license | CREATE PROCEDURE smCodeType_Fault_Id
@parm1 varchar(10)
,@parm2 varchar(10)
AS
SELECT *
FROM smCodeType
left outer join smCallTypes
on smCodeType.CallTypeId = smCallTypes.CallTypeId
WHERE smCodeType.Fault_Id = @parm1
AND smCodeType.CallTypeId LIKE @parm2
ORDER BY smCodeType.Fault_Id, smCodeType.CallTypeId
| true |
fd0de87636ef3f60e1a305e9b540f05e9026eca2 | SQL | klingtnet/mastery-with-sql | /solutions-ch08.sql | UTF-8 | 3,267 | 4.84375 | 5 | [] | no_license | -- 8.1
select rental_id,
customer_id,
rental_date
from (
select rental_id,
customer_id,
rental_date,
rank() over (
partition by customer_id
order by rental_date desc
)
from rental
) as r
where rank <= 3;
-- 8.2
-... | true |
532c76ed90a98be98e87d3056c2d016789705a6d | SQL | yahoo/maha | /core/src/test/resources/pg-dim-ddl.sql | UTF-8 | 2,218 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE advertiser_postgres
(device_id NUMERIC(3) NOT NULL,
name VARCHAR NOT NULL,
booking_country VARCHAR NOT NULL,
id NUMERIC NOT NULL,
last_updated VARCHAR NOT NULL,
status VARCHAR NOT NULL,
currency VARCHAR NOT NULL,
managed_by NUMERIC NOT NULL)
;
CREATE TABLE campaign_postgres
(device_id... | true |
07b91e52529bff5cb6f48229c8f32edf03a4c276 | SQL | sixtoromero/pruebatecnica | /Scripts/TR_LogCorrespondencesUpdate.sql | UTF-8 | 335 | 2.6875 | 3 | [] | no_license | CREATE TRIGGER TR_LogCorrespondencesUpdate
ON Correspondences
FOR UPDATE
AS
INSERT INTO AuditLogs (
TableName
,RegisterId
,[Action]
,[Data]
,[Date]
,UserId)
SELECT
'Correspondences',
inserted.Consecutive,
'U',
(SELECT * FROM inserted FOR JSON AUTO),
GETDATE(),
inserted.UserId
... | true |
ca64a2c423def04cc700dd04cc2a269d37a2b6ed | SQL | lastrix/mafp-kraken-service | /kraken-service/src/main/resources/liquibase/changelog/v1.0/20201107-00-1-positions.sql | UTF-8 | 345 | 2.734375 | 3 | [] | no_license | DO
$$
DECLARE
id bigint;
BEGIN
FOR _ in 1..1000
LOOP
id = nextval('kraken_service.position_seq');
INSERT INTO kraken_service.position(position_id, name, description)
VALUES (id::regclass, 'Position' || id, 'Position ' || id);
... | true |
a43078e8b5d4a9a261c99630d05fe74d349e4148 | SQL | EvaCukor/Algebra-FinalProject | /db/kolekcija.sql | UTF-8 | 2,729 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 05, 2012 at 07:02 PM
-- Server version: 5.5.16
-- PHP Version: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... | true |
eaa6365b3e67892bc41988d3a5cfdaa149a757fc | SQL | peilin97/MySQL-Bootcamp | /exercise/comments.sql | UTF-8 | 390 | 2.890625 | 3 | [] | no_license | CREATE TABLE comments(
content VARCHAR(100),
created_at TIMESTAMP DEFAULT NOW()
);
INSERT INTO comments(content)
VALUES
("NCJDVNISLKV");
CREATE TABLE comments2(
content VARCHAR(100),
changed_at TIMESTAMP DEFAULT NOW() ON UPDATE CURRENT_TIMESTAMP
);
INSERT INTO comments2(content)
VALUES
("NCJDVNISLKV"... | true |
95e9cc93fd4c462a2aa558a6bdc0a71076edfcba | SQL | RezaNurRochmat13/tiketextra | /tiketextra.sql | UTF-8 | 1,782 | 3.125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Feb 05, 2018 at 04:21 PM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
0c26373d81e99e45745c90f2d62468ed02cef0d4 | SQL | JasRockr/TCompany | /T-Company_PHP/database/db_TCompany.sql | UTF-8 | 145,710 | 3.640625 | 4 | [
"MIT"
] | permissive | -- Scripts MySQL for DB T-Company
CREATE DATABASE IF NOT EXISTS tcompany
CHARACTER SET utf8
COLLATE utf8_general_ci;
USE tcompany;
-- Tabla Categoria
CREATE TABLE tcompany.tc_Categoria (
idCategoria INT(10) NOT NULL AUTO_INCREMENT COMMENT 'Codigo que identifica la categoria de un producto o articulo',
catNombr... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.