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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
fa12b0dc8f68e88b4e0e1c6563bf60830daf2354 | SQL | rrighetti/cscripts | /sql/spb/spb_internal_plans_perf.sql | UTF-8 | 6,228 | 3.34375 | 3 | [] | no_license | -- spb_internal_plans_perf.sql
-- summary of plans performance given a sql_id
-- this script is for internal use and only to be called from other scriprs
COL avg_et_ms_awr FOR A11 HEA 'ET Avg|AWR (ms)';
COL avg_et_ms_mem FOR A11 HEA 'ET Avg|MEM (ms)';
COL avg_cpu_ms_awr FOR A11 HEA 'CPU Avg|AWR (ms)';
COL avg_cpu_ms_m... | true |
c6427d1e3c7733d801ef745d1c0513f7510b4de6 | SQL | AndyCarmenR/prueba-bitware | /pruebaPostgre/poblarTablas.sql | UTF-8 | 710 | 2.796875 | 3 | [] | no_license |
INSERT INTO
cajeros(nomapels)
VALUES
('ANDRES'),
('DANIEL'),
('ALEJANDRO'),
('LILIANA'),
('LAURA'),
('EDGAR'),
('BEATRIZ'),
('ELIZABETH'),
('KARLA'),
('CESAR');
INSERT INTO maquinas_registradoras
(piso)
VALUES
(1),
(2),
(3);
INSERT INTO productos(nombre,precio)
VALUES
('TELEVISION',5000),
('CELULAR',... | true |
1dae10509f528ffbc30dc8567a39c97c69f73e83 | SQL | florians/backup | /dbback/my_test_page_20-10-2012_21-00-30.sql | UTF-8 | 3,712 | 3.140625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.5.24, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: my_test_page
-- ------------------------------------------------------
-- Server version 5.5.24-0ubuntu0.12.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULT... | true |
77a377be90a3157a4ccf432c8c698814306cbf43 | SQL | halitdogmen/Postgraphile-CLI-Basic-App | /migrations/sqls/20210626164935-create-table-event-up.sql | UTF-8 | 915 | 3.734375 | 4 | [] | no_license | /*
This table represents the user's events in a specific time period.
*/
CREATE TABLE app_calendar.event (
id SERIAL PRIMARY KEY,
title text CHECK( util.non_empty_trimmed_string(title,'title')),
payload jsonb,
_start timestamptz NOT NULL,
_end timestamptz NOT NULL,
created_at timestamptz DEFAULT now()... | true |
430ce181897557e2d9aff644797f22aebf0e40f4 | SQL | afamJM/SupplierCatalogue.DataExtract | /SupplierCatalogue.DataExtract/Queries/SupplierImages.sql | UTF-8 | 203 | 2.625 | 3 | [] | no_license | Select images.Title As "name",
images.ImagePath As "path",
images.Height As "height",
images.Width As "width"
From MediaGallery.SupplierImages As images
Where images.CompanyID = (@SupplierId) | true |
b0dc1f92e72ca21d98b8c5ee993e4e9a79d5ebe2 | SQL | grumpycoder/sql | /mediapublished.sql | UTF-8 | 529 | 2.953125 | 3 | [] | no_license |
select *
from Beholder.MediaPublished
where DateCreated >= CONVERT(date, getdate())
order by datecreated desc
select id from Beholder.MediaPublishedContext
where MediaPublishedId in (
select id
from Beholder.MediaPublished
where DateCreated >= CONVERT(date, getdate())
)
/*
delete from Beholder.MediaPublishedCon... | true |
bca1c287350f295e12256db3938b93c44d5cdbb3 | SQL | seabilwe/osgs | /setup.sql | UTF-8 | 1,417 | 3.125 | 3 | [] | no_license | --
-- Setup API schema for push from ESP32 monitorinig device readings
--
-- psql -h localhost -p 15432 -U docker gis < setup.sql
--
CREATE SCHEMA api;
CREATE ROLE anon NOLOGIN;
GRANT USAGE ON SCHEMA api TO anon;
CREATE ROLE authenticator NOINHERIT LOGIN PASSWORD 'secret password';
GRANT anon TO authenticator;
AL... | true |
3a3494237e341dccd98a99e039cd8a7adf61768d | SQL | FelipeMarini/Senai_2S | /sprint-1-bd/exercicios/1.1-exercicio-pessoas/pessoas_03_DQL.sql | UTF-8 | 433 | 3.75 | 4 | [] | no_license | USE Pessoas;
SELECT * FROM Pessoas;
SELECT * FROM Telefones;
SELECT * FROM Emails;
SELECT * FROM Cnh;
SELECT Pessoas.Nome,
Telefones.Descricao AS Telefone,
Emails.Descricao AS Email,
Cnh.Descricao AS CNH
FROM Pessoas
INNER JOIN Telefones ON Pessoas.idPessoa = Telefones.idTelefone
INNER JOIN Ema... | true |
315e695febbbc6c10fa3ed97d859a378047f9e11 | SQL | Can-ZHOU/Information-Management-II | /Can_ZHOU_19324118/view.sql | UTF-8 | 718 | 3.265625 | 3 | [] | no_license | CREATE VIEW Club_President AS
SELECT
Staff.Staff_ID, Staff.Student_ID, Club.Club_name, Student.Name, Student.Email, Student.Telephone
FROM
Staff, Position, Student, Club
WHERE
Position.Role = 'President'
AND
Staff.Student_ID = Student.Student_ID
AND
Staff.Club = Club.Club_ID
AND
S... | true |
48a5e223a69cfe8599b5b3ffc5f8689ba9c30072 | SQL | huangzuting/zerg | /zmEducation/sql/zmedu.sql | UTF-8 | 11,246 | 3.046875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : hzt
Source Server Version : 50537
Source Host : localhost:3306
Source Database : zmedu
Target Server Type : MYSQL
Target Server Version : 50537
File Encoding : 65001
Date: 2018-01-02 16:11:23
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---------... | true |
5b29f524dcd3756ce551f43f474fadb549116b08 | SQL | MasterMotoi/BoulderCrashVAPF | /Maps/Procédures stockés niveau_4.sql | UTF-8 | 17,142 | 3.125 | 3 | [] | no_license | ##---PROCEDURE 'findAllniveau_4'---##
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `findAllniveau_4`()
NO SQL
SELECT colone_1, colone_2, colone_3, colone_4, colone_5, colone_6, colone_7, colone_8, colone_9, colone_10,colone_11, colone_12, colone_13, colone_14, colone_15, colone_16, colone_17, colone_18... | true |
f0ca1f83dc73a067d98495abd7bbc64315907c93 | SQL | AndreHammel/Projeto_Trybe_modulo_20_mySQL__Vocabulary_Booster | /desafio15.sql | UTF-8 | 289 | 3.65625 | 4 | [] | no_license | DELIMITER $$
CREATE PROCEDURE
buscar_media_por_cargo(IN cargo varchar(30))
BEGIN
SELECT
ROUND(AVG(Salary), 2) AS 'Média salarial'
FROM
employees AS emp
JOIN
jobs AS jb ON emp.job_id = jb.job_id
GROUP BY jb.job_title
HAVING jb.job_title = cargo;
END
$$
DELIMITER ;
| true |
04e32a3da748bc407f9549711d5d8cc48418c36e | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day24/select1217.sql | UTF-8 | 177 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-23T12:17:00Z' AND timestamp<'2017-11-24T12:17:00Z' AND temperature>=5 AND temperature<=92
| true |
648079fd56db06c64080c8591016a64c22d9fd12 | SQL | vinibanaco/masti-education | /db.sql | UTF-8 | 4,994 | 3.484375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- sáb 24 ago 2019 10:05:00 -03
-- 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 |
1e92d4e38c8f8086661e9880d13b68c3adb038c6 | SQL | colemclaren/ttt | /db.sql | UTF-8 | 44,066 | 3.8125 | 4 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | DROP PROCEDURE IF EXISTS createUserInfo;
DELIMITER $$
CREATE PROCEDURE createUserInfo(in stid text, in stname text charset utf8mb4, in ipaddr text, in ostime bigint)
BEGIN
set @Count = (SELECT COUNT(*) AS Cnt FROM player WHERE `SteamID`=stid);
if (@Count = 0) then
insert into player (`SteamID`, `SteamName`, `FirstJ... | true |
0706a4cf9989c6c8412d685e83392942ee548493 | SQL | jibi8086/raspberry-pi | /bus_route.sql | UTF-8 | 436 | 3.78125 | 4 | [] | no_license | select Buses.bus_name,s1.stop_name as from_stop_name,t1.departure_time,s2.stop_name
as to_stop_name,t2.arrival_time
from Buses
inner join route t1 on t1.bus_id = Buses.id
inner join Stop s1 on s1.id = t1.stop_id
inner join route t2 on t2.bus_id = Buses.id
inner join Stop s2 on s2.id = t2.stop_id
... | true |
ae54cd9cc5e74d6422aeb631a9bca2764b0fe6f4 | SQL | karmis/IIPTT | /db.sql | UTF-8 | 1,896 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.15.7
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1:3306
-- Время создания: Фев 20 2017 г., 06:54
-- Версия сервера: 5.7.13-log
-- Версия PHP: 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
6b70f3587a4196f7ebd5458332ead4428097cc78 | SQL | davidway/miaosha | /sql/data.sql | UTF-8 | 4,127 | 3.453125 | 3 | [] | no_license | CREATE TABLE `goods` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '商品ID',
`goods_name` varchar(16) DEFAULT NULL COMMENT '商品名称',
`goods_title` varchar(64) DEFAULT NULL COMMENT '商品标题',
`goods_img` varchar(64) DEFAULT NULL COMMENT '商品的图片',
`goods_detail` longtext COMMENT '商品的详情介绍',
`goods_price` decimal(1... | true |
be6fe1a2d1d2609555d1918f68743bf3a820937a | SQL | Dhirasha/tech | /techsup.sql | UTF-8 | 5,086 | 3.265625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 15, 2018 at 01:53 AM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.0.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... | true |
f12be264712fe6078162eaaada9b48d1a705c31b | SQL | yurepo/nutc-coding-class | /nutc_homework.sql | UTF-8 | 2,841 | 3.265625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- 主機: 127.0.0.1
-- 產生時間: 2019 年 01 月 13 日 09:36
-- 伺服器版本: 10.1.37-MariaDB
-- PHP 版本: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... | true |
77cc169987b0f2f2317f973f8fa626585deba7c3 | SQL | ybg345/sql-hands-on | /Vertabelo Academy/3_SQL Join Types/15_Additional Exercise2.sql | UTF-8 | 417 | 3.859375 | 4 | [] | no_license | /*
Problem Statement:
-----------------
Show the name, initial price, and final price of every item with initial price greater than $300.
If the item wasn't sold (there was no bidding person), show the item's name anyway.
*/
SELECT auction_item.name, auction_item.initial_price, bidder.final_price
FROM auction_item L... | true |
4a02b16f485de999174c4454c079d53d787f74a3 | SQL | HarpritSmn/-LMSCF-Harprit-Sumon-CR11 | /new/cr11_harprit_petadoption (1).sql | UTF-8 | 4,276 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Erstellungszeit: 11. Aug 2020 um 20:43
-- Server-Version: 10.4.13-MariaDB
-- PHP-Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... | true |
0923d8688c48bd9bca8ae158e1004cc7dc2f53cb | SQL | polysantiago/PalermoTenis | /palermotenis-persist/src/main/resources/db/migration/V1_30__palermotenis_imagenes_escaladas.sql | UTF-8 | 690 | 3.015625 | 3 | [] | no_license | CREATE TABLE `imagenes_escaladas` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ContentType` varchar(45) NOT NULL,
`Imagen` longblob NOT NULL,
`Tamanio` bigint(20) unsigned NOT NULL,
`Nombre` varchar(100) NOT NULL,
`Tipo` char(1) NOT NULL,
`ImagenOriginal` int(10) unsigned NOT NULL,
`Alto` int(10) u... | true |
48c97e17f1498c67991c116ff10a0f2aa4716839 | SQL | charleyarby/databases | /server/schema.sql | UTF-8 | 667 | 3.515625 | 4 | [] | no_license | CREATE DATABASE chat;
USE chat;
CREATE TABLE users (
userID INT,
userName TEXT,
PRIMARY KEY (userID)
);
CREATE TABLE lobbies (
lobbyID INT,
lobbyName TEXT,
PRIMARY KEY (lobbyID)
);
CREATE TABLE messages (
/* Describe your table here.*/
messageID INT,
userMessage TEXT,
lobbyID INT,
userID INT,
... | true |
e658f441cd0564efb0e4a369ab593646abd62c62 | SQL | hammer007/Print-APP | /Database/printerbook.sql | UTF-8 | 15,528 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 09, 2017 at 05:15 PM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
0af66e57909ec61bf72edc1e63926fad588e847e | SQL | vijaydairyf/TimelyFish | /SolomonApp/dbo/Views/dbo.cfvAssetListWithInfo.sql | UTF-8 | 1,733 | 3.734375 | 4 | [] | no_license |
-- CREATED IN THE SOLOMONAPP database
--CREATED BY: TJONES FOR: George
--CREATED ON: 10/18/05
CREATE VIEW cfvAssetListWithInfo
AS
SELECT a.CompanyID, CompanyName = c.LongName, a.AssetID, a.CompAsstNo,
CompAsstNoPrefix = CASE
WHEN left(compasstno,5) Like '%-%' THEN ''
WHEN Len(RTrim(left(compAsstNo,5))) < 5 ... | true |
a5597d78f0fd5dda360b76826f4ba580b4ed36c6 | SQL | antodank/Anto_SQL | /SQLSHACK/SQL10_INFOSCHEMA.sql | UTF-8 | 625 | 3.5625 | 4 | [] | no_license | -- get table info
SELECT * FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'Employees'
--get column info
SELECT TABLE_SCHEMA,TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'id'
-- check exist
IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'id')
SELECT 'found' AS search_result... | true |
a863d2563b60125aa895417e57b302263f80a43d | SQL | google-code/beaver-mvc-ssh | /Liuyun/FreamWork/mybatis/src/MyBatis.Common.Test/Scripts/MySql/DataBase.sql | ISO-8859-1 | 5,209 | 3.34375 | 3 | [
"Apache-2.0"
] | permissive | use mysql;
drop database iBatisNet;
create database iBatisNet;
drop database NHibernate;
create database NHibernate;
grant all privileges on iBatisNet.* to IBatisNet@'%' identified by 'test';
grant all privileges on iBatisNet.* to IBatisNet@localhost identified by 'test';
grant all privileges on iBatisNet.... | true |
2f86856961edbb9d9f0ab781cda05e5ebf83b6c0 | SQL | JSConF6/semipjt | /RocketLaptop2/WebContent/sql/product.sql | UTF-8 | 5,256 | 4.25 | 4 | [] | no_license | DROP TABLE PRODUCT;
CREATE TABLE PRODUCT(
PRODUCT_CODE VARCHAR2(6) -- 상품 코드
CONSTRAINT PK_PRODUCT_CODE PRIMARY KEY,
CATEGORY_CODE VARCHAR2(50), -- 카테고리 코드
PRODUCT_NAME VARCHAR2(100) NOT NULL, -- 상품명
PRODUCT_PRICE NUMBER(7) NOT NULL, -- 상품가격
PRODUCT_DETAILS VARCHAR2(1000), -- 상세정보
PRODUCT_STATUS VARCHAR2(10) CHE... | true |
dccb4a49e52ae23ede16f51434c92013106b4ebc | SQL | zhuohuwu0603/twitter-pipeline | /operational-db/103-create_table_user.sql | UTF-8 | 261 | 2.578125 | 3 | [] | no_license | CREATE TABLE users (
id INT NOT NULL,
name VARCHAR(255),
screen_name VARCHAR(255),
description VARCHAR(255),
favorites_count INT,
follow_request_sent BOOLEAN,
following BOOLEAN,
followers_count INT,
location VARCHAR(255),
PRIMARY KEY(id)
);
| true |
a4f224deb473f92c663c75920b06e4c466323cdc | SQL | Singhcoders/scnetwork | /sc_social.sql | UTF-8 | 2,151 | 3.109375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.6.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 05, 2016 at 10:00 PM
-- Server version: 5.6.25
-- PHP Version: 5.6.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
b2e39f572c8033832d9ad9d3ed0a7f09b0b5eae2 | SQL | michrija/selfizee | /data-struct/struct/altervie_smsenvoi.sql | UTF-8 | 726 | 4 | 4 | [] | no_license | DROP VIEW IF EXISTS `sms_envois`;
CREATE ALGORITHM=UNDEFINED DEFINER=`manager-selfizee`@`localhost` SQL SECURITY DEFINER VIEW `sms_envois` AS (
SELECT
COUNT(`e`.`id`) AS `total_envoi`,
`p`.`evenement_id` AS `evenement_id`,
COUNT(`stat`.`id`) AS `total_ouvert`
FROM ((((`envois` `e`
JOIN `contacts` `c`
... | true |
864264198f8ddc220e5f8f724bf5efdf7bf313ca | SQL | Rachel-kpt/Webpagetest | /app/config/updates/update_2015_04_21_08_52_10.sql | UTF-8 | 634 | 2.640625 | 3 | [] | no_license |
START TRANSACTION;
INSERT INTO `fields` VALUES (NULL, 'titles_ARRAY_AP11', 'arrays', 'titles_ARRAY_AP11', 'script', '2015-04-21 08:29:52');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'File not existing', 'script');
INSERT INTO `fields` VALUES... | true |
364894b53100bd6cda5fc802a98a1a1d651943d5 | SQL | Wathis/ProjetCDI | /utils/bdd.sql | UTF-8 | 11,311 | 2.609375 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive |
SET SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO';
SET time_zone = '+00:00';
DROP TABLE IF EXISTS CDI_PAYS;
DROP TABLE IF EXISTS BILAN;
DROP TABLE IF EXISTS SONDAGE;
DROP TABLE IF EXISTS CDI_POIMESSAGE;
DROP TABLE IF EXISTS CDI_MESSAGE;
DROP TABLE IF EXISTS CDI_ARTICLE;
DROP TABLE IF EXISTS CDI_CLIENT;
DROP TABLE IF EXISTS CDI... | true |
0f151a0eb38288523259c9ea184efc52cb9776d1 | SQL | raymondyou97/NEU_Coursework | /CS4500/GregsList/backend/src/main/resources/sql/create_users_table.sql | UTF-8 | 334 | 2.6875 | 3 | [] | no_license | DROP TABLE IF EXISTS users;
CREATE TABLE users (
id int(11) NOT NULL AUTO_INCREMENT,
username varchar(255) DEFAULT NULL,
password varchar(255) DEFAULT NULL,
first_name varchar(255) DEFAULT NULL,
last_name varchar(255) DEFAULT NULL,
role varchar(255) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT C... | true |
651eec953072051db758b44241988ac1e29f8e58 | SQL | fabricioaldecosea/scrum | /epiz_23663526_scrum.sql | UTF-8 | 39,824 | 3.421875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.8.2
-- http://www.phpmyadmin.net
--
-- Host: sql312.epizy.com
-- Generation Time: Mar 30, 2019 at 09:44 PM
-- Server version: 5.6.41-84.1
-- PHP Version: 5.3.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_... | true |
25d39fab673e8bb126726f3a2cc93e30d962a459 | SQL | Nalipp/mysql_coursework | /course_examples/exercises.sql | UTF-8 | 5,438 | 4.15625 | 4 | [] | no_license | /* SELECT CONCAT(title, ' - ', released_year) AS 'title' FROM books ORDER BY released_year DESC LIMIT 3; */
/* SELECT title, author_lname FROM books WHERE author_lname REGEXP ' '; */
/* SELECT title, released_year, stock_quantity FROM books ORDER BY stock_quantity LIMIT 3; */
/* SELECT title, author_lname FROM books... | true |
7a6bf71f401e9f34f10c8fd8cce3ed4b623059ec | SQL | MarkButko/TrainTasks | /rest/src/main/webapp/META-INF/sql/schema.sql | UTF-8 | 383 | 3.65625 | 4 | [] | no_license | CREATE table users (
ID INT NOT NULL AUTO_INCREMENT,
VARCHAR(30) first_name NOT NUll,
VARCHAR(30) last_name NOT NUll,
PRIAMRY KEY(ID)
);
CREATE TABLE car (
ID INT NOT NULL AUTO_INCREMENT,
customer_id INT NOT NULL,
license_type char(1) not null,
weight int not null,
constraint fk_cus... | true |
177b65a12a9df3c8216bb95b663a2d4fc8a22940 | SQL | ruanjiayu/dubbo-myshop | /myshop-database/sql/TbOrder.sql | UTF-8 | 1,597 | 3.59375 | 4 | [
"Apache-2.0"
] | permissive | -- auto Generated on 2020-01-08
-- DROP TABLE IF EXISTS myshop.tb_order;
CREATE TABLE myshop.tb_order(
order_id VARCHAR (50) NOT NULL COMMENT '订单id',
payment VARCHAR (50) NOT NULL DEFAULT '' COMMENT '实付金额。精确到2位小数;单位:元。如:200.07,表示:200元7分',
payment_type INT (11) NOT NULL DEFAULT -1 COMMENT '支付类型,1、在线支付,2、货到付款',
post_... | true |
070e8f343512c97fdb8b09066c73ed877a89ff4a | SQL | nastyaseptilko/My-Trello | /scriptDatabase.sql | UTF-8 | 1,088 | 3.703125 | 4 | [] | no_license | CREATE DATABASE TRELLO;
USE TRELLO;
CREATE TABLE USERS (
ID INT PRIMARY KEY AUTO_INCREMENT,
FULL_NAME VARCHAR(60) NOT NULL,
EMAIL VARCHAR(50) NOT NULL
);
CREATE TABLE SET_LISTS (
ID INT PRIMARY KEY AUTO_INCREMENT
);
CREATE TABLE LISTS (
ID INT PRIMARY KEY AUTO_INCREMENT,
LIST_NAME VARCHAR(60) NOT NULL... | true |
25490657c1649f8a218ac443c890c23e9fb94073 | SQL | BeatTheBookie/BeatTheBookie | /099_extra/001_kicktipp_simulations/fixed_2_1_betting_simulation.sql | UTF-8 | 4,751 | 4.28125 | 4 | [] | no_license | --single game list
select
season.season,
his.match_date,
home.team home_team,
away.team away_team,
stat.full_time_home_goals,
stat.full_time_away_goals,
stat.full_time_result,
round((1 / odd.bet365_home_odds) / ((1 / odd.bet365_home_odds) + (1 / odd.bet365_draw_odds) + (1 / odd.bet365_away_odds)), 4) b... | true |
3010c5cf22937506f35b558fba6caadfa5cf15ca | SQL | PaulApivat/chain_data | /dune/dex.sql | UTF-8 | 1,524 | 3.96875 | 4 | [
"MIT"
] | permissive | /* DEX 24 Hours Volume */
SELECT
SUM(usd_amount)/1e9 AS billion_volume
FROM dex."trades"
WHERE block_time > now() - interval '24 hours'
AND category = 'DEX'
/* note: two categories - DEX & Aggregator */
SELECT
DISTINCT(category) AS distinct_category
FROM dex."trades"
LIMIT 50
/* DEX 7 Day Volume */
/* note... | true |
80a27ca4ac183a50c02e17f5bd15daf6b12cfbec | SQL | Dregosh/Serwis-Aukcyjny-Backend | /src/main/resources/db/migration/V4__user_table.sql | UTF-8 | 379 | 2.59375 | 3 | [] | no_license | create table user (
id BIGINT PRIMARY KEY auto_increment,
email VARCHAR(75) not null unique,
display_name VARCHAR(255) not null unique,
address VARCHAR(500) not null,
created_at DATETIME not null,
account_status VARCHAR(15) not null,
account_type VARCHAR(15) not null,
version BIGINT not ... | true |
454b5291103361c9faaed563fd782b9c8207d4c6 | SQL | duwanqiebi/Bookmarks_Manager | /src/main/resources/sql/schema.sql | UTF-8 | 417 | 2.671875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS BOOKMARK(
ID IDENTITY NOT NULL PRIMARY KEY,
NAME VARCHAR(500),
URL VARCHAR(500),
CREATEDATE DATE,
MODIFYDATE DATE,
FILENAME VARCHAR(50),
classId INT,
clicksNum BIGINT,
LASTDATE DATE,
ICON VARCHAR(2000)
);
CREATE TABLE IF NOT EXISTS BOOKMARKCLASS(
ID IDENTITY ... | true |
2163ca013c3d426762f24a0e88ded885e8297f7f | SQL | gladiopeace/digital-data-syn | /documents/oms/TB_PMTGJ.SQL | GB18030 | 1,801 | 3.328125 | 3 | [] | no_license | /*
================================================================================
ṹ:TB_PMTGJ
ṹ:ۼƷȯƷ
ṹĿ:
================================================================================
*/
drop sequence SEQ_TB_PMTGJ;
drop index AK_TB_PMTGJ;
drop table TB_PMTGJ;
create table TB_PMTGJ (
PMTGJ_ID INTEGER... | true |
bf6cb514d5695300f4c38271446115454da251d9 | SQL | aidanmccoy/Databases_Lab_5 | /aimccoy-lab5.sql | UTF-8 | 4,108 | 4.5 | 4 | [] | no_license | -- BAKERY-1 For each pastry flavor which is found in more than three types of
-- pastries sold by the bakery, report the average price of an item of this
-- flavor and the total number of different pastrties of this flavor on the
-- menu. Sort the output in ascending order by the average price.
SELECT AVG(price), Flavo... | true |
a48e6ae9d9227bb7e3b67c1694f5c42e7799ea99 | SQL | thurbakt2/IHC | /codeing/pfunc2.sql | UTF-8 | 294 | 3.109375 | 3 | [] | no_license | select C.CUST_ID CustID, C.CUST_DESCR Company, N.NAME MainContact, N.NAME_TITLE Title, R.NAME RepName
from ihc_customer c,ihc_client_assignments a, ihc_client_rep r,ihc_names n where
C.CUST_ID = N.CUST_ID and C.CUST_ID = A.CUST_ID(+) and r.emplid = a.EMPLID and C.CUST_ID = &CustomerID;
| true |
c548f3d165b4be190a7cb1835bdbff64a39b563f | SQL | 404jv/prisma-crud | /prisma/migrations/20211002174626_create_todos/migration.sql | UTF-8 | 351 | 3.5 | 4 | [] | no_license | -- CreateTable
CREATE TABLE "Todo" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"deadline" TIMESTAMP(3) NOT NULL,
"userId" TEXT,
CONSTRAINT "Todo_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Todo" ADD CONSTRAINT "Todo_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELE... | true |
33fdbc0ddd1751c76b52c275df0ffff2aeee211b | SQL | TeagueLander/370assignments | /assn1/doctors-pharmacies-drugs.sql | UTF-8 | 3,723 | 3.671875 | 4 | [] | no_license | CREATE TABLE doctors (
doctor_id INTEGER,
name VARCHAR(60),
specialty VARCHAR(60),
years_experience INTEGER,
CONSTRAINT pk_doctors PRIMARY KEY (doctor_id)
);
CREATE TABLE patients (
healthcare_id INTEGER,
name VARCHAR(60),
address VARCHAR(120),
age INTEGER,
primary_doctor INTEGER,
CONSTRAINT pk_p... | true |
cca5bd2f5b1e4b14c102be6558e958eea1599e33 | SQL | LittleMiki/DesafioPHP | /desafioPHP.sql | UTF-8 | 3,819 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 23-11-2018 a las 14:04:51
-- Versión del servidor: 5.7.24-0ubuntu0.18.04.1
-- Versión de PHP: 7.2.10-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*... | true |
7936e0f546ca808f0aa87dd58d6e46f3660825a3 | SQL | framirov/SQL-course | /2/2.3/4.sql | UTF-8 | 319 | 2.65625 | 3 | [] | no_license | UPDATE book
SET genre_id = (SELECT genre_id FROM genre WHERE name_genre = 'Поэзия')
WHERE (title = 'Стихотворения и поэмы');
UPDATE book
SET genre_id = (SELECT genre_id FROM genre WHERE name_genre = 'Приключения')
WHERE (title = 'Остров сокровищ');
SELECT * FROM book | true |
4e708d54e5e8ca7cc2e5acb6b7198d93ed269415 | SQL | rk1023/FlywaySpringbootApp | /src/main/resources/db/DDL/V1.0.0.0035_create_table_comm_template_loc.sql | UTF-8 | 681 | 3.296875 | 3 | [] | no_license | DROP TABLE IF EXISTS mdm.comm_template_loc CASCADE;
CREATE TABLE mdm.comm_template_loc (
comm_temp_loc_id serial NOT NULL,
comm_template_id int4 NOT NULL,
seq_num int2 NOT NULL,
file_type_cd varchar(50) NOT NULL,
status_cd varchar(50) NOT NULL,
template_location varchar(500) NOT NULL,
created_by varchar(50) NO... | true |
bf8840f28956ca73fe0c2a731aba46b4457ab1cd | SQL | vaneves/chimpan | /schema.sql | UTF-8 | 4,252 | 3.46875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tempo de Geração:
-- Versão do Servidor: 5.5.27
-- Versão do PHP: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT=0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Banco de Dados: `orango`
--
-- ------... | true |
eb3eb59894a88f327218f58f7df48906fc51bcec | SQL | Witoldinio/protobuf-server | /DB/tables/NPCStat.sql | UTF-8 | 250 | 3.078125 | 3 | [] | no_license | CREATE TABLE NPCStat
(
NPCStatID SERIAL CONSTRAINT PK_NPCStat PRIMARY KEY,
NPCID INTEGER NOT NULL CONSTRAINT FK_NPCStat_NPC REFERENCES NPC,
StatID INTEGER NOT NULL CONSTRAINT FK_NPCStat_Stat REFERENCES Stat,
StatValue REAL NOT NULL
); | true |
ec88778f9ba1b91e419f3961c860b1cd2e511209 | SQL | chpaez18/centro_produccion | /data/control.sql | UTF-8 | 21,187 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 27-02-2021 a las 16:42:48
-- Versión del servidor: 8.0.21
-- Versión de PHP: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
0279bd80725092a37394fc47991e2208646e0f6b | SQL | darkpink/Informagator | /DB/Configuration/Tables/SystemConfigurationErrorHandler.sql | UTF-8 | 639 | 3.484375 | 3 | [] | no_license | CREATE TABLE [Configuration].[SystemConfigurationErrorHandler] (
[Id] BIGINT IDENTITY (1, 1) NOT NULL,
[SystemConfigurationId] BIGINT NOT NULL,
[ErrorHandlerId] BIGINT NOT NULL,
CONSTRAINT [PK_SystemConfigurationErrorHandler] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [F... | true |
d836cb38e0f07a5a5dea158762e88e8380d92fd7 | SQL | shridharbhutada/Inventory-Magement-System | /inventory.sql | UTF-8 | 10,737 | 2.5625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: localhost Database: inventory
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULT... | true |
72b4fb306796125c48ff4a1e27b3d2932e7d68c5 | SQL | nicomon24/IoTSecurityFramework | /iot-oas/database/oas.sql | UTF-8 | 5,029 | 2.625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generato il: Feb 03, 2014 alle 17:47
-- Versione del server: 5.5.27
-- Versione PHP: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
15934949bd7d5d92293e43cb6fa6b4c02268bd81 | SQL | Z1863676/466GroupAssignment | /DMLSQL.sql | UTF-8 | 2,839 | 3.171875 | 3 | [] | no_license |
/**
* Poulate the user table with pre-determined values
*/
INSERT INTO User
VALUES (1, 'ehren', 'notagoodpassword'),
(2, 'bob', 'maybeagoodpassword'),
(3, 'tom', 'alrightthisisbetter'),
(4, 'john', 'bestpasswordrighthere');
/**
* Poulate the workout table ... | true |
ae0ee4012f9fe9f16154a10ae5b18e48053e248f | SQL | KirilPecev/CSharp-DB-Fundamentals | /02. Databases Basics - Exams/04. Databases MSSQL Server Exam - 22 October 2017/14. Open or Closed Statistics.sql | UTF-8 | 582 | 4.15625 | 4 | [] | no_license | SELECT concat(e.FirstName, ' ', e.LastName) AS [Name],
concat(ISNULL(CDC.ReportCount, 0), '/', ISNULL(odc.ReportCount, 0)) AS [Close Open Reports]
FROM Employees AS e
JOIN
(
SELECT EmployeeId,
COUNT(*) AS [ReportCount]
FROM Reports AS r
WHERE YEAR(OpenDate) = 2016
GROUP BY Emplo... | true |
f0ca467fe8815a6d5303e9e1f1c49d68526e4fd7 | SQL | AlexNadeyko/ztw_project | /DB/AdvWebProject.sql | UTF-8 | 1,060 | 3.65625 | 4 | [] | no_license | CREATE DATABASE AdvWeb;
USE AdvWeb;
CREATE TABLE HallType(
type_id int NOT NULL AUTO_INCREMENT,
type varchar(25) NOT NULL,
PRIMARY KEY (type_id)
);
CREATE TABLE Users(
user_id int NOT NULL AUTO_INCREMENT,
name varchar(50) NOT NULL,
surname varchar(50) NOT NULL,
email varchar(50) NOT NULL,
password varchar(50... | true |
e14487558bf47c32830542ec18af9ba400b5171d | SQL | prfagun1/Scripts | /Banco de dados/Oracle/Listar tablespaces com espaco livre.sql | UTF-8 | 579 | 3.359375 | 3 | [] | no_license | --Listar table spaces com espaço livre
select a.tablespace_name,sum(a.tots/1048576) Tot_Size,
sum(a.sumb/1048576) Tot_Free,
sum(a.sumb)*100/sum(a.tots) Pct_Free,
sum(a.largest/1024) Max_Free,sum(a.chunks) Chunks_Free
from
(
select tablespace_name,0 tots,sum(bytes) sumb,
max(bytes) la... | true |
5d846c32a846b02a0595d064ffb536cd073452d3 | SQL | hll5211314/0033 | /sks/sks数据库/category.sql | UTF-8 | 1,983 | 3.21875 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 100119
Source Host : localhost:3306
Source Schema : sks
Target Server Type : MySQL
Target Server Version : 100119
File Encoding : 65001
Date: 06/12/2020 16:4... | true |
6e83ae20f9fc6050a82c5e5442cea3eb2c95d4be | SQL | hawwwdi/qanari | /db/sql_quries/likePost.sql | UTF-8 | 531 | 3.453125 | 3 | [] | no_license | insert into postLike(Post, User)
select 1, getID('hadi')
where (select ava.Publisher from ava where ava.ID = 1) not in (
select block.Blocker from block where block.Blocked = GetID('hadi')
);
delimiter //
create procedure likeAva_procedure(IN pAID INT)
begin
insert into postLike(Post, User)
select pAID... | true |
c652b85ccf2c30f13cf73b11bd6344deeb950da1 | SQL | Zahinul/RastotInsight | /queries.sql | UTF-8 | 1,457 | 3.671875 | 4 | [] | no_license | CREATE DATABASE rastotInsight;
CREATE TABLE posts(
id INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
user_id INT(11) NOT NULL,
topic_id INT(11) NULL,
post_title VARCHAR(255) UNIQUE,
img_name VARCHAR(255),
core TEXT,
published TINYINT(2) NOT NULL,
valid TINYINT(2) NOT NULL,
created_at DATETIME DEFAULT CURRENT_TI... | true |
24c3103910fdf1c68f0739d0d1b4f53ff89a834c | SQL | mindis/FairBenchmarking | /SQLite/9_samehardcode.sql | UTF-8 | 784 | 3.75 | 4 | [] | no_license | -- using default substitutions
select
nation,
o_year,
sum(amount) as sum_profit
from
(
select
n_name as nation,
cast(strftime('%Y', o_orderdate) as integer) as o_year,
l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
from
partsupp cross join part cross join lineitem cross ... | true |
09bc9981efb9992febc637a23a2c64ab3498fbd8 | SQL | Esserterp/20200104_EvalBackEnd | /housing.sql | UTF-8 | 2,376 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Apr 01, 2020 at 10:37 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... | true |
3e85c74a15fe2e5da1212bda22635770a03a8d92 | SQL | InfantryMan/tp-database | /src/main/resources/db/migration/V1_1__init.sql | UTF-8 | 1,714 | 3.8125 | 4 | [] | no_license | CREATE EXTENSION IF NOT EXISTS citext;
CREATE TABLE IF NOT EXISTS public.users (
nickname CITEXT PRIMARY KEY,
email CITEXT UNIQUE NOT NULL,
fullname VARCHAR(128) NOT NULL,
about TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS public.forum (
posts BIGINT NOT NULL DEFAULT 0,
slug CITEXT PRIMARY KEY,
threads I... | true |
0dcf6e243a4015880ae07ea5c5aaf5b5f85fd571 | SQL | Ivan2810/utn-grupo-h | /biblioteca.sql | UTF-8 | 3,714 | 3.09375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `biblioteca` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `biblioteca`;
-- MySQL dump 10.16 Distrib 10.1.40-MariaDB, for Win64 (AMD64)
--
-- Host: 127.0.0.1 Database: biblioteca
-- ------------------------------------------------------
-- Server version 10.1.40-MariaDB
/*!40... | true |
0605114b1c27fabf6b389c2d8be844be8eb2be24 | SQL | choisanghwa/skmk | /target/skmk-1.0.0-BUILD-SNAPSHOT/WEB-INF/sqls/create_guestBookTable.sql | UTF-8 | 303 | 2.875 | 3 | [] | no_license | create table guestBook (
shopCode varchar2(50) not null primary key,
guestBookImage varchar2(500),
guestBookTitle varchar2(300) not null,
guestBookContent varchar2(3000) not null,
guestBookTime date not null,
constraint GUEST_BOOK_SHOP_CODE_FK foreign key(shopCode) references shop(shopCode)
); | true |
9e3422d74c875e5e3ef0697a0759bb8bab2222fa | SQL | h-4vok/university-comical | /Comical/Comical.SQL/dbo/Stored Procedures/Permission_getByRole.sql | UTF-8 | 221 | 3.3125 | 3 | [] | no_license | CREATE PROCEDURE Permission_getByRole
@roleId INT
AS
BEGIN
SELECT
p.Id,
p.Code
FROM RolePermission RP
INNER JOIN Permission P
ON rp.PermissionId = p.Id
WHERE rp.RoleId = @roleId
END | true |
30c1657602078ed312906154495a9a31b54ab48a | SQL | 18918090402/MZJF_Work | /MZJF_Work/0002 Git.nonobank.com/archive_20180806/bi-etl.git/03_DW_HADOOP/05_DMT_FD/03_SCRIPT/FD_CSYY_USER_INTEREST/FD_CSYY_USER_INTEREST.sql | UTF-8 | 1,538 | 2.96875 | 3 | [] | no_license | set mapreduce.job.name = dmt_fd_fd_csyy_user_interest_01;
set mapreduce.job.queuename = etl-dw;
set hive.exec.parallel=true;
insert overwrite table dmt_fd.fd_csyy_user_interest
select i.user_interest_id SRC_ID,
'user_interest' SRC_TAB,
ar.nono_user_id USER_ID,
i.user_code USER_CODE,
... | true |
6d48ac6d34d6885bd661a113fbbe6d91e48a50d9 | SQL | SamPinheiro/Trabalho-BDII | /sqlBanco.sql | UTF-8 | 1,997 | 3.296875 | 3 | [] | permissive | CREATE TABLE usuario
( idUsuario number NOT NULL,
nome varchar2(50) NOT NULL,
email varchar2(50) unique NOT NULL,
senha varchar2(20) NOT NULL,
CONSTRAINT usuarioPk PRIMARY KEY (idUsuario)
);
create sequence incUsuario
minValue 1
MAXVALUE 300
START WITH 1
INCREMENT by 1
Cache 100;
create tabl... | true |
e22a14988a441841f656ff1f615098630da00120 | SQL | stapleen/clojure-crud | /db/init.sql | UTF-8 | 882 | 3.234375 | 3 | [] | no_license | CREATE DATABASE clojure;
\c clojure
CREATE TABLE patients (
id SERIAL NOT NULL PRIMARY KEY,
full_name VARCHAR(50) NOT NULL,
gender VARCHAR(1) NOT NULL,
date_of_birth DATE NOT NULL,
deleted BOOL NOT NULL DEFAULT FALSE,
created_at TIMESTAMPTZ,
updated_at TIMESTAMPTZ
);
INSERT INTO patie... | true |
f9f50e36dc31d4c5073f006b2069744cd6fc8d38 | SQL | leelo07/queries | /Queries/DMV index stats.sql | UTF-8 | 256 | 2.71875 | 3 | [] | no_license | SELECT *
FROM sys.dm_db_index_physical_stats (DB_ID('LFMBSI')
,OBJECT_ID('dbo.AuditEvent')
,NULL
-- NULL to view all indexes;
-- otherwise, input index number
,NULL -- NULL to view all partitions of an index
,'DETAILED') -- We want all information | true |
f3ff44f9af1f82037cf7ed156fbb7a9358ad9e3d | SQL | mgabrielaa1988/Program-y-lab3 | /ProgramacionBackEnd/ParcialesFinales/Modelo_Parc_2/db/donfubd.sql | UTF-8 | 2,610 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 02-07-2018 a las 09:18:18
-- Versión del servidor: 10.1.31-MariaDB
-- Versión de PHP: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
7dc284c80ac94aaf9937fe21cf0b5dc556d80b42 | SQL | KostadinovK/CSharp-DB | /01-MS SQL/13-Exam 20.10.2019/05-Unassigned Reports.sql | UTF-8 | 162 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | SELECT
[Description],
FORMAT(OpenDate, 'dd-MM-yyyy') AS OpenDate
FROM Reports
WHERE EmployeeId IS NULL
ORDER BY FORMAT(OpenDate, 'yyyy-MM-dd'), [Description]; | true |
5fe040f63554ebeaaba421a091a0f30d22b77fb5 | SQL | shiyuede/film | /tri.sql | UTF-8 | 43,949 | 3.25 | 3 | [] | no_license | /* 数据库 */
SET NAMES UTF8; /*编码方式*/
DROP DATABASE IF EXISTS tri;
CREATE DATABASE tri CHARSET=UTF8;
USE tri;
/* 1.用户信息表 */
CREATE TABLE tri_user(
uid INT PRIMARY KEY AUTO_INCREMENT, /*ID*/
uname VARCHAR(32),
upwd VARCHAR(32),
phone VARCHAR(32) /*手机, 必填*/
);
/*登录测试数据*/
INSERT INTO tri_user VALUES(null, 'tom', ... | true |
e04b87bfd9dd12232a2fe67fdd2b62eac7289b89 | SQL | Q-Adorable/TWS | /growth-note-app/backend/src/main/resources/db/migration/V5__create_follow_table.sql | UTF-8 | 222 | 2.703125 | 3 | [] | no_license | CREATE TABLE `follow` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`createTime` TIMESTAMP default current_timestamp,
`followerId` int(11),
`followeeId` int(11),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | true |
f6f74956f8696264c4296519de3c45a0d04ef233 | SQL | NicePlayOfU/leetcode | /sql/1076.project-employees-ii 员工最多的项目 销售额最高的销售者/1.sql | UTF-8 | 255 | 3.4375 | 3 | [] | no_license | # Title: Project Employees II
# Link: https://leetcode-cn.com/problems/project-employees-ii
WITH `tmp` AS (SELECT `project_id`, count(*) AS `c` FROM `project` GROUP BY `project_id`)
SELECT `project_id`
FROM `tmp`
WHERE `c` = (SELECT max(`c`) FROM `tmp`); | true |
87e9ef169a207760b7ee3b8358c6f0e0dccf355e | SQL | AEaker/ETL-Project | /IMDBqueries.sql | UTF-8 | 5,452 | 4.5625 | 5 | [] | no_license | /*How many times actors appeared in movies in range of years*/
select n.name, count(m.title)
from names as n
inner join titles as t on n.imdb_name_id = t.imdb_name_id
inner join movies as m on t.imdb_title_id = m.imdb_title_id
where t.category = 'actor' and m.year_published > 2015 or t.category = 'actress' and m.year_... | true |
ff818e3d51954dfb6cb035937b7a31811b38ffa2 | SQL | zhangtaouc/Lenovo | /files/DB_levono_computer.sql | UTF-8 | 1,900 | 3.046875 | 3 | [] | no_license | CREATE TABLE `cart` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) DEFAULT NULL,
`computerid` int(11) DEFAULT NULL,
`count` int(11) DEFAULT NULL,
`totalprice` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8
CREATE TABLE `computer` (
`id` int(11) ... | true |
cf32c4b7a1b047d83800d75953ef9af251350945 | SQL | lingwei0604/android-cube-app-server | /docs/demo.sql | UTF-8 | 316 | 2.953125 | 3 | [] | no_license | -- kind=s_demo_kv
-- table_num=1
-- split_id=k
CREATE TABLE s_demo_kv (
k varchar(50) NOT NULL default '',
v blob NOT NULL,
ctime timestamp NOT NULL default 0,
mtime timestamp NOT NULL default current_timestamp ON UPDATE current_timestamp,
UNIQUE KEY k(k)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
| true |
0edc756c2936a515b6106cf8c17dc44df2197b91 | SQL | ardijnwn/GoodandGoods | /good_goods.sql | UTF-8 | 3,511 | 3.28125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 10, 2019 at 05:28 AM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
c513b8e57b7adc6d79c047b158079995844a88cd | SQL | RodrigoMCarvalho/exercicios-sql-nosql | /exercicios.sql | UTF-8 | 5,381 | 3.875 | 4 | [] | no_license | SET GLOBAL time_zone = '+4:00';
insert into produto (nome, quantidade, valor) values ("Sansung S8", 5, 2800);
insert into produto (nome, quantidade, valor) values ("Impressora HP", 8, 700);
desc produto;
select * from produto;
truncate table produto;
SELECT * FROM livraria.livro;
=================================... | true |
0db7b53dfaa6600991d6ac89eb2abb92c1137859 | SQL | meta-suraj-shrivastava/GET2021 | /DBMS/Sql Constraints,functions & Views/Assignment_5.sql | UTF-8 | 1,078 | 4.40625 | 4 | [] | no_license | use ecommerce;
/*
Create a view displaying the order information (Id, Title, Price, Shopper’s name, Email, Orderdate, Status)
with latest ordered items should be displayed first for last 60 days.
*/
CREATE VIEW order_info as
select
p.productId,
p.name as product_name,
p.price,
u.name as user_name,
... | true |
e07aa8dc4b39a687d8bb5a3091ba9e9019e88287 | SQL | davekr/pypg | /examples/blogapp.sql | UTF-8 | 8,167 | 3 | 3 | [
"MIT"
] | permissive | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_cata... | true |
900e5790f42ca702c5cf72f1e59eedd65b17eba6 | SQL | maxpsq/oracert | /1Z0-047/byTopic/08.Using_DDL_Statements_to_Create_and_Manage_Tables/033.Data_types_available_for_columns.sql | UTF-8 | 11,198 | 4.25 | 4 | [] | no_license |
/*
Beginning with Oracle Database 12c, you can specify a maximum size of 32767 bytes for
the VARCHAR2, NVARCHAR2, and RAW data types. You can control whether your database
supports this new maximum size by setting the initialization parameter
MAX_STRING_SIZE as follows:
If MAX_STRING_SIZE = STANDARD, then the size... | true |
dade2317c6bb5839c9cc2c5ea5cff55820666ad6 | SQL | tituscsmith/moviesDB | /data/locations.sql | UTF-8 | 2,696,855 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 28, 2020 at 05:28 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
e37dbf0c834456212e5721ed0d1a688a2c20384c | SQL | VinothBen/BMS_2 | /WebContent/script.sql | UTF-8 | 1,214 | 3.359375 | 3 | [] | no_license | //////////Transaction Details//////
CREATE TABLE TRANSACTION_DETAILS
(
TRANSACTION_ID INT(10) ,
TRANSACTION_DESCRIPTION VARCHAR(20),
TRANSACTION_TYPE VARCHAR(10),
TRANSACTION_AMOUNT BIGINT(20),
PRIMARY KEY (TRANSACTION_ID)
);
/////User Details //////
create table UserDetails(
accountNumber BIGINT(16),
accou... | true |
25d70c25921a74ca62d8ce46ecbb1c0128dfa655 | SQL | mbnosama/G-api | /article.sql | UTF-8 | 2,385 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Mar 24, 2021 at 09:26 AM
-- Server version: 8.0.21
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@... | true |
ccf52145a873864ef606b2ce05fce8827313e47e | SQL | agdiaz/GestionDeDatos | /TP1C2013 K3051 SI_NO_APROBAMOS_HAY_TABLA 16 ZIP123/data/C03_v_DestinosMasCancelados.sql | UTF-8 | 608 | 3.671875 | 4 | [] | no_license | CREATE VIEW [SI_NO_APROBAMOS_HAY_TABLA].v_DestinosMasCancelados
AS
SELECT Ciudad.nombre, COUNT(id_pasaje) as CantCancelados
from SI_NO_APROBAMOS_HAY_TABLA.Ciudad
inner join SI_NO_APROBAMOS_HAY_TABLA.Recorrido
on Ciudad.id_ciudad = Recorrido.id_ciudad_destino
inner join SI_NO_APROBAMOS_HAY_TABLA.Viaje
on Recorrido.id_... | true |
727aee66eb4c3bd7a7305bdcf7e5e9a76aa5ec77 | SQL | Fanatic-off/HR_DataBase_VS | /HR_DataBase_VS/HR_DataBase_VSDB/Tables/Statuses.sql | UTF-8 | 217 | 2.5625 | 3 | [] | no_license | CREATE TABLE [HR_DataBase_VSDB].[Statuses] (
[id] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (50) NOT NULL UNIQUE
CONSTRAINT [PK_STATUSES] PRIMARY KEY CLUSTERED ([id] ASC)
); | true |
6515614611c78389ea49fe5b2af64e2855b6f600 | SQL | OHDSI/circe-be | /src/main/resources/resources/cohortdefinition/sql/inclusionrule.sql | UTF-8 | 213 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | select @inclusion_rule_id as inclusion_rule_id, person_id, event_id
INTO #Inclusion_@inclusion_rule_id
FROM
(
select pe.person_id, pe.event_id
FROM #qualified_events pe
@additionalCriteriaQuery
) Results
;
| true |
9db673fb2a6120b390aa996335fc398ca5878b9e | SQL | presian/HomeWorks | /Databases/5.AdvancedSQL/problem10.sql | UTF-8 | 398 | 4.4375 | 4 | [] | no_license | --Problem 10. Write a SQL query to find
--the count of all employees in each department and for each town.
SELECT t.Name AS Town, d.Name AS Department, COUNT(*) AS [Employees count]
FROM Employees e
INNER JOIN Departments d
ON d.DepartmentID = e.DepartmentID
INNER JOIN Addresses a
ON a.AddressID = e.Add... | true |
a13e80277d77371b5db6c1b46961f71da8fbbdd2 | SQL | peterirungu/ecoTalanta | /doc/database.sql | UTF-8 | 848 | 3.09375 | 3 | [] | no_license |
---seller table
CREATE TABLE `ecotalanta`.`seller` (
`seller_id` INT(11) NOT NULL AUTO_INCREMENT ,
`first_name` VARCHAR(50) NOT NULL ,
`last_name` VARCHAR(50) NOT NULL ,
`nick_name` VARCHAR(50) NOT NULL ,
`phone_number` VARCHAR(15) NOT NULL ,
`gender` VARCHAR(15) NOT NULL ,
`email` VARCHAR(50) NOT NULL ,
... | true |
9c757b168fa9d2f5dc58417975df98aacbb2f3a7 | SQL | ReportersLab/Archiver_Public | /src/sql/entity/InsertOrUpdateEntity.sql | UTF-8 | 921 | 2.765625 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive | INSERT OR IGNORE INTO Entity
(
id,
type,
expandedURL,
url,
displayURL,
hashText,
name,
mentionId,
screenName,
mediaId,
mediaURL,
mediaURLHttps,
mediaSizes,
mediaType,
startIndex,
endIndex,
ownerId,
twitterStatusId
)
VALUES
(
:id,
:type,
:expandedURL,
:url,
:displayURL,
:hashText,
:name,
:menti... | true |
6e7fb230a9c290b86a167ca1ab622b6489e14d9a | SQL | ArtMonCab/java_2020_0226 | /UF1466_3/sql/gestiondocente.sql | UTF-8 | 52,181 | 2.96875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: localhost Database: gestiondocente
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_R... | true |
de57182ceb8ea7a2adbc1803d9bb6402cfcb065b | SQL | apurba420/MySql_NorthWind_Database | /Queries_SQL statements.sql | UTF-8 | 1,611 | 4.6875 | 5 | [] | no_license | -- Q1.Write a query to get Product list (name, unit price) of ten most expensive products.
SELECT ProductName,UnitPrice
From Products
ORDER BY UnitPrice DESC LIMIT 10;
-- Q3.Find out the quartely orders for each product for the year 1997?
SELECT a.ProductName,
year(OrderDate) as OrderYear,
format(sum(case ... | true |
4acabed2d8b59af813ff761391c77d6a5a012b45 | SQL | svn2github/hsqldb | /base/tags/2.0.0-rc7/test-src/org/hsqldb/jdbc/resources/sql/TestSelfCheckConstraints.sql | UTF-8 | 2,861 | 3.6875 | 4 | [] | no_license | DROP TABLE "Tab" IF EXISTS;
DROP TABLE TC0 IF EXISTS;
DROP TABLE TC1 IF EXISTS;
DROP TABLE TC2 IF EXISTS;
DROP TABLE TC3 IF EXISTS;
DROP TABLE TC4 IF EXISTS;
DROP TABLE TC5 IF EXISTS;
CREATE TABLE "TAB"("a" INT, "b" INT, "c" INT, CONSTRAINT CC CHECK("a" > "b" AND "b">"c"));
/*e*/INSERT INTO TAB VALUES(null,2,3)... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.