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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
193f8f24bda68f24fe7824e05ab7fffb3bcb8eed | SQL | caichang01/louplus-linux | /04/challenges/04/import.sql | UTF-8 | 1,901 | 4 | 4 | [] | no_license | -- 创建数据库
CREATE DATABASE `shiyanlou-staging` CHARACTER SET=utf8;
-- 创建用户
CREATE USER "shiyanlou"@"localhost" IDENTIFIED BY "Xd4a8lKjeL9Z";
-- 分配权限
GRANT SELECT, UPDATE ON `shiyanlou-staging`.* TO "shiyanlou"@"localhost";
-- 选择数据库
USE `shiyanlou-staging`;
-- 创建表 shiyanlou_user
CREATE TABLE `shiyanlou_user`
(
`id... | true |
b29626f98f18ccdfb5fb548b698e894723969a25 | SQL | auranet/aura-biz | /db/views/VENDOR_PAYMENTS_BY_YEAR_V.sql | UTF-8 | 1,043 | 3.859375 | 4 | [] | no_license | select employee_name as name,
to_char(paid_dt,'YYYY') as year,
sum(payable_amount) as amount_paid,
employee.ssn,
company.ein,
company.company_name,
employee.address as employee_address,
employee.city as employee_city,
employee.state as employee_state,
emplo... | true |
0939396c9fe3fa71478708b289394a0b55568160 | SQL | dipakjadhav24may/autism | /src/main/resources/db/changelog/questionList.sql | UTF-8 | 5,946 | 2.609375 | 3 | [] | no_license | INSERT INTO `question` (`question_id`,`que_id`, `que`) VALUES
(1, 'Q.1','Is your child speaking?'),
(2, 'Q.2','Has your child been diagnosed with autism'),
(3, 'Q.3','Is your child undergoing speech therapy?'),
(4, 'Q.4','Do you see any improvements in your child s speech with speech therapy?'),
(5, 'Q.5','Fo... | true |
2ceffc59fdb25bd4934b8190c8ec25e665146c4c | SQL | tobymao/sqlglot | /tests/fixtures/optimizer/pushdown_predicates.sql | UTF-8 | 3,576 | 3.609375 | 4 | [
"MIT"
] | permissive | SELECT x.a AS a FROM (SELECT x.a FROM x AS x) AS x JOIN y WHERE x.a = 1 AND x.b = 1 AND y.a = 1;
SELECT x.a AS a FROM (SELECT x.a FROM x AS x WHERE x.a = 1 AND x.b = 1) AS x JOIN y ON y.a = 1 WHERE TRUE AND TRUE AND TRUE;
WITH x AS (SELECT y.a FROM y) SELECT * FROM x WHERE x.a = 1;
WITH x AS (SELECT y.a FROM y WHERE y... | true |
4f8c9da77c98fe070547d281c176e6ee3c79e73a | SQL | cqframework/clinical_quality_language | /Src/java/engine/src/test/resources/org/opencds/cqf/cql/engine/execution/CqlQueryTests.cql | UTF-8 | 2,505 | 3.703125 | 4 | [
"Apache-2.0",
"CC-BY-4.0"
] | permissive | library CqlQueryTests
// #204: Unexpected results
// list [1:1] [A, B, C, D]
// RightShift [4:1] [null, A, B, C]
// LeftShift [9:1] [null, A, B, C]
// LeftShift2 [14:1] [B, C, D, null]
define list:
{ 'A', 'B', 'C', 'D' }
define RightShift:
list L1
let L2: list[IndexOf(list, L1) - 1]
return L2
define LeftShif... | true |
c26b222a08b990da607ed5d4307db7dc216a1f0b | SQL | codeacademyp210/p210-20190508-weekend-task-sql-Elnur584 | /SQLQuery7.sql | UTF-8 | 1,579 | 3.59375 | 4 | [] | no_license | --create database Homework
--use HomeWork
--create table Users(
-- Id int Primary Key identity(1,1),
-- Name nvarchar(15) not null,
-- Surname nvarchar(20) not null,
-- Username nvarchar(15) not null,
-- Email nvarchar(20) unique not null,
-- Password nvarchar(20) not null
-- );
--create table Products(
--Id int Prim... | true |
2f117d691f330513ce6f227613fd4dbfdfc8295c | SQL | NemanjaSimic/Vodovod-Servis | /Template/Schema objects/Schemas/dbo/Tables/Keys/NALAZI_U_FK2.sql | UTF-8 | 117 | 2.765625 | 3 | [] | no_license | ALTER TABLE NALAZI_U
ADD CONSTRAINT NALAZI_U_MAGACIN_FK
FOREIGN KEY(MAGACIN_ID_MAG)
REFERENCES MAGACIN(ID_MAG) | true |
960b8d0a2c5acf5cbb5d182417e5fbbb8f2a2c79 | SQL | mrpoobalan/park | /parklane.sql | UTF-8 | 7,149 | 2.9375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 21, 2015 at 12:33 PM
-- Server version: 5.5.44-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... | true |
7bc6eaf50a6f4bc4cff73d98073cd0c9ac674162 | SQL | trajan4k6/acv | /models/l20_marts/preqin/preqin_fact_paid_subscription_range.sql | UTF-8 | 1,034 | 3.546875 | 4 | [] | no_license | {{ config(materialized='table') }}
with fsd_combined as (
SELECT
date_key,
dimension_firm_key
FROM {{ ref('preqin_fact_paid_subscriber_daily') }}
GROUP BY 1, 2
UNION
SELECT
date_key,
dimension_firm_key
FROM {{ ref('preqin_fact_paid_subscriber_daily_history') }}
)
,fsd_grouped as (
SELECT
dimens... | true |
fc7414180c7a1c2d94ab697b00d9a48920c42c6b | SQL | darrell-ulm/SQL-Queries | /review file item count and url.sql | UTF-8 | 2,793 | 3.828125 | 4 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | SELECT
{{Grouping}},
COUNT (i.id) AS "Item total",
SUM(i.checkout_total) AS "Total_Checkouts",
SUM(i.renewal_total) AS "Total_Renewals",
SUM(i.checkout_total) + SUM(i.renewal_total) AS "Total_Circulation",
ROUND(AVG(i.price) FILTER(WHERE i.price>'0' AND i.price <'10000'),2) AS "AVG_price",
COUNT (i.id) FILTER(WHERE i.... | true |
f456ff9fb45c8528ff1aeb0d1a45e88cb54f35f3 | SQL | BeelssleeB/GraduationProject | /src/main/resources/sql/graduation_project.sql | UTF-8 | 32,430 | 3.03125 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : MyDB
Source Server Type : MySQL
Source Server Version : 50728
Source Host : localhost:3306
Source Schema : graduation_project
Target Server Type : MySQL
Target Server Version : 50728
File Encoding : 65001
Date: 29/05/2... | true |
d176e0ffd4fbe7a583387db18970cd9d16c50266 | SQL | dylaanliu/Smith-Sustainability-Studies | /support/createUserTable.sql | UTF-8 | 6,909 | 3.359375 | 3 | [] | no_license | -- SQL script to initialize the users tables.
-- first, remove then create database
-- DROP DATABASE `cisc498`;
-- CREATE DATABASE `cisc498`;
-- ALTER DATABASE `cisc498` CHARACTER SET utf8 COLLATE utf8_bin;
-- use `cisc498`;
-- create user table and fill it with values
DROP TABLE IF EXISTS userTable;
CREATE TABLE `u... | true |
3279054260d6df812f557350f906f8a973ad35dd | SQL | archanadeshpande/SQLPracticeSolutions | /codewars_postgresql_bug_fixing.sql | UTF-8 | 1,070 | 4.15625 | 4 | [] | no_license | /*Oh no! Timmys been moved into the database divison of his software company but as we know Timmy loves making mistakes. Help Timmy keep his job by fixing his query...
Timmy works for a statistical analysis company and has been given a task of calculating the highest average salary for a given job, the sample is compi... | true |
1647ff24983663ab1211b522382e15c01102ce3e | SQL | Kelompok-6-WSI-Web/Workshop-Sistem-Informasi-Berbasis-Web | /Tugas Individu/E41190532_Moh. Syaifudin/CRUD_PDO_Moh. Syaifudin/dbsekolah.sql | UTF-8 | 1,939 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 29, 2020 at 01:38 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
3e8967fb12da7cc3349b70b8f3312956d10e321c | SQL | dhamotharang/SvnGit | /Core/Database/StoredProcedure/Create Scripts/InsertScript_Screens_GroupMAR.sql | UTF-8 | 2,483 | 2.890625 | 3 | [] | no_license | ------------------------------------------------------------
--Author :Varun
--Date :06/03/2015
--Purpose:Screen and Banner for Group MAR.
------------------------------------------------------------
IF NOT EXISTS (
SELECT *
FROM [Screens]
WHERE [ScreenId] = 1133
)
BEGIN
SET IDENTITY_INSERT [... | true |
564c9360641a44a4e16e2614ce9bb252264580c6 | SQL | Maksolo27/MySqlTrainigs | /Army.sql | UTF-8 | 892 | 3.078125 | 3 | [] | no_license |
create database army;
use army;
create table soldiers
(
id int auto_increment not null,
name nvarchar(30) not null,
rankk nvarchar(30),
primary key(id)
);
create table weapons
(
soldier_id int not null,
giver_id int not null,
troop int not null,
weapon nvarchar(30) not null,
foreign k... | true |
c75dfb504e269f3a7b1fad762a7cf0ef28e81cf1 | SQL | ganeshbabuNN/Databases | /RDMS/Oracle Database/Subquery_CorelatedSubquery_EXISTS.sql | UTF-8 | 170 | 3.5625 | 4 | [] | no_license |
select distinct first_name,last_name
from employees a where EXISTS ---exists operator
(select department_id from departments b
where b.department_id=a.department_id) | true |
4806d3243f2b514cbb4db6e29ce3e6290fce5147 | SQL | sotorrent/db-scripts | /analysis/analysis.sql | UTF-8 | 19,934 | 4.15625 | 4 | [
"Apache-2.0"
] | permissive | use analysis;
##########
# Get Java posts (to compare all vs. Java posts)
##########
select Id as PostId, PostTypeId
from JavaQuestions
into outfile 'F:/Temp/java_questions.csv'
fields terminated by ','
optionally enclosed by '"'
lines terminated by '\n';
select Id as PostId, PostTypeId
from JavaAnswers
into outfile ... | true |
fb54bd08545afaf3a639d009de5851f82c3cefce | SQL | wongrong/SpringBootShiroMybatis | /src/main/resources/test.sql | UTF-8 | 2,853 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.11.9.2
-- http://www.phpmyadmin.net
--
-- 主机: 127.0.0.1:3306
-- 生成日期: 2016 年 06 月 08 日 05:11
-- 服务器版本: 5.5.20
-- PHP 版本: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTE... | true |
892f0b0c36782127317d98d9237ec4c1b1757602 | SQL | valeponchi/boolean-uk-api-final-project | /backend/prisma/migrations/20210817165809_updated_athlete_country_relation/migration.sql | UTF-8 | 219 | 3.125 | 3 | [] | no_license | -- DropForeignKey
ALTER TABLE "Athlete" DROP CONSTRAINT "Athlete_categoryId_fkey1";
-- AddForeignKey
ALTER TABLE "Athlete" ADD FOREIGN KEY ("countryId") REFERENCES "Country"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
| true |
046a5fcffab77fda020bf2e3e455314cc4e9ebb1 | SQL | wgillihan/CST-363-Final-Project | /StartupSolutionsTeamFinalProject_CST363/changeOfficeLoc.sql | UTF-8 | 480 | 2.59375 | 3 | [] | no_license | PROMPT -----------------------------------------------------------
PROMPT
PROMPT Change Office Location
ACCEPT vID PROMPT 'Please enter office number to update (1-10): ';
ACCEPT vStreetAdd PROMPT 'New Street address: ';
ACCEPT vCity PROMPT 'City: ';
ACCEPT vState PROMPT 'State: ';
ACCEPT vZip PROMPT 'Zip cod... | true |
b3c78b76402a6041944850114681a7148adb5469 | SQL | fandashtic/arc_chennai | /Sivabalan-SQL/SQL_STORED_PROCEDURE/sprc_sales_by_ItemCategory_Beat_Items.sql | UTF-8 | 2,088 | 3.921875 | 4 | [] | no_license |
--------------------------------------------------------------------------------------------------------------------------------------------------------------
CREATE PROCedure sprc_sales_by_ItemCategory_Beat_Items(@CATERY int,
@Beatid int,
@Customerid nvarchar(15),
@FROMDATE DATE... | true |
669cc2a3972bac2b0f4d16d434ade25a2a55a866 | SQL | menonmachado/leroyprod | /leroyprod_structure_and_data.sql | UTF-8 | 4,236 | 3.296875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : laragon
Source Server Version : 50723
Source Host : localhost:3306
Source Database : leroyprod
Target Server Type : MYSQL
Target Server Version : 50723
File Encoding : 65001
Date: 2019-04-11 15:11:06
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... | true |
9c105f3c2bf056cf708eaed417cbf60e5705ed98 | SQL | isamsamsularip/tes | /isam.sql | UTF-8 | 8,413 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 28, 2021 at 06:37 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.3.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
57e269390bf4b06c39a024e53a41a6e3b7e74897 | SQL | QFults/07-Day-01 | /sql/schema.sql | UTF-8 | 207 | 2.5625 | 3 | [] | no_license | DROP DATABASE IF EXISTS media_db;
CREATE DATABASE media_db;
USE media_db;
CREATE TABLE songs (
id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
title VARCHAR(50) NOT NULL,
artist VARCHAR(50) NOT NULL
);
| true |
52c8dc7bc7c3c92adf2d92d76f1781cbcf7c7150 | SQL | JuliaTao/sql_practice | /i_questions/sql_facebook_evan.sql | UTF-8 | 3,734 | 3.71875 | 4 | [] | no_license | -- Create table
CREATE TABLE content_actions
(action_type text, content_id int, target_id int)
;
INSERT INTO content_actions VALUES
('photo', 11, NULL)
, ('comment', 12, 11)
, ('comment', 13, 11)
, ('comment', 14, 11)
, ('photo', 15, NULL)
, ('comment', 16, 15)
, ('comment', 17, 15)
, ('comment', 18, 15)
, ('photo', ... | true |
dede6eeb3af51125d363f50cc0fa947795bb3014 | SQL | brownguo/pengine-jwt | /Static/db/t_account.sql | UTF-8 | 2,142 | 2.9375 | 3 | [] | no_license | # ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.18)
# Database: PeopleSoft
# Generation Time: 2019-02-24 02:40:33 +0000
# ********************************************... | true |
65aa923db30531cf72b350b7e916773591b9702e | SQL | wilnelmpls/CDM | /CDM/CDM/Tables/CustomerPartner.sql | UTF-8 | 753 | 3.4375 | 3 | [] | no_license | CREATE TABLE [CDM].[CustomerPartner] (
[CustomerPartnerID] INT IDENTITY (1, 1) NOT NULL,
[CustomerAccountID] INT NULL,
[PartnerID] INT NULL,
[SourceSystemID] INT NULL,
[CreateDTS] DATETIME NULL,
[UpdateDTS] DATETIME NULL,
PRIMARY KEY CLUSTERED ... | true |
71bf607ab920e31c93493a0a947a89a1d38cfe9d | SQL | darknegma/docker-airflow | /libs/sdc_etl_libs/sql/TNT/CREATE_VIEW_vw_tracking_events.sql | UTF-8 | 846 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | CREATE OR REPLACE VIEW "LOGISTICS"."TNT"."VW_TRACKING_EVENTS" COPY GRANTS AS
(
SELECT
"DEPOT",
"CONSIGNMENT",
"STATUS",
"STATUS_CAPTURE",
"STATUS_AVAILABILITY",
CASE WHEN PII_ACCESS = TRUE THEN "ADDITIONAL_INFORMATION" ELSE sha2("ADDITIONAL_INFORMATION", 512) END AS "ADDITIONAL_INFORMATION",
CASE WHEN PII_ACCESS... | true |
8df6dcd291005c1d8b1f2750e5c37dde8f62bb12 | SQL | md-emaduddin/BookShelf | /corner.sql | UTF-8 | 14,422 | 3.015625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 06, 2019 at 12:14 PM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
d11f7d69f93c4c4228d01a9b0b1c5515dde9a077 | SQL | yunalescca/TDA357 | /SQL/test_itineraries.sql | UTF-8 | 383 | 3.09375 | 3 | [] | no_license | CREATE OR REPLACE VIEW test_Itineraries AS
SELECT reference, passenger, flight, date, departure.city AS departure, destination.city AS destination
FROM test_Bookings
JOIN test_flights ON test_Bookings.flight = test_flights.code
JOIN test_Airports AS departure ON departure.code = test_flights.origin
JOIN test_Airports... | true |
91e99205c2f6d25f7886267e059bef98d267a31b | SQL | sharrylove/xxw-for-public | /sqlscript/test相关.sql | UTF-8 | 761 | 2.828125 | 3 | [] | no_license | set sql_safe_updates=0;
SELECT * FROM test.user;
select location ,count(location) as total from test.user order by location;
select location as '居住地',count(*) as '统计数' from test.user group by location;
select * from test.user;
select business as '职业',count(*) as '统计数' from test.user group by business;
select education... | true |
756b511dc2ad398e0a8dbd66c6bf0989d43da0f3 | SQL | haeunnnnn/Programmers | /SQLkit/String, Date/DATETIME에서DATE로형변환.sql | UTF-8 | 165 | 2.609375 | 3 | [] | no_license | -- 코드를 입력하세요
SELECT ANIMAL_ID, NAME, DATE_FORMAT(DATETIME, '%Y-%m-%d') AS 날짜 /* %y로 하면 끝자리 2개*/
FROM ANIMAL_INS
ORDER BY ANIMAL_ID; | true |
b5a8271c52f0566b65a4f569b7541905f5903888 | SQL | Montigomo/Sql-Ex-Quests | /01. Stage DML Study/a.054.sql | UTF-8 | 582 | 3.265625 | 3 | [] | no_license |
-- С точностью до 2-х десятичных знаков определите среднее число орудий всех линейных кораблей (учесть корабли из таблицы Outcomes).
-- cost 0.032328709959984 operations 11
with shc as (select ships.name, Classes.numGuns
from ships join classes on ships.class = classes.class
where [type]='bb'
union
select class ... | true |
80d526f1919b0a422e0c3c5cd21f0f8cf808322b | SQL | bchau1000/poke-gacha-webapp | /pokeDB.sql | UTF-8 | 368,304 | 3.03125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `pokedb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `pokedb`;
-- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: localhost Database: pokedb
-- ------------------------------------------------------
-- Se... | true |
d0367c4872c18e4be2815c0b6bfe714d2cd67de5 | SQL | un-knower/hadoop-ws | /spark-ws/yekuobaozhuang/1-datasource/oracle3-exploring.sql | UTF-8 | 289 | 2.625 | 3 | [] | no_license | select count(*) from bigdata_mpvolume_onerow; -- 15677
select * from bigdata_mpvolume_onerow where rownum < 10;
select count(*) from bigdata_mpvolume_onerow where run_date > TO_DATE('2012-01-01','YYYY-MM-DD') order by run_date
select TO_DATE('2012-01-01','YYYY-MM-DD') from dual; | true |
a5b8391f9e371694f9e3a2d7fdcd1ff6747044f2 | SQL | 1stResponder/nics-db | /baseline_datalayers.sql | UTF-8 | 2,570 | 2.96875 | 3 | [
"BSD-3-Clause"
] | permissive | --
-- Copyright (c) 2008-2016, Massachusetts Institute of Technology (MIT)
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- 1. Redistributions of source code must retain the above copyrig... | true |
0114d9cd278e711c85192328c196916704bdbe4f | SQL | NickCharsley/ONS_googleAnalytics | /database/schema/msqli/fctvsnetwork.sql | UTF-8 | 1,746 | 2.796875 | 3 | [] | no_license | CREATE TABLE `fctvsnetwork` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`dimDate` int(11) NOT NULL,
`dimProfile` int(11) NOT NULL,
`dimNetwork` int(11) NOT NULL,
`dimVanquisSession` int(11) NOT NULL,
`Visits` int(11) NOT NULL DEFAULT '0',
`Visitors` int(11) NOT NULL DEFAULT '0',
`NewVisits` int(11) NOT NULL... | true |
ad4fc7a572f7dd671259e61f494b1faf4a66a859 | SQL | varunu28/SQL-Scripts | /LeetCode/Sales Analysis I.sql | UTF-8 | 186 | 3.625 | 4 | [] | no_license | SELECT DISTINCT seller_id
FROM Sales
GROUP BY seller_id
HAVING SUM(price) = (
SELECT SUM(price)
FROM Sales
GROUP BY seller_id
ORDER BY SUM(PRICE) DESC
LIMIT 1
);
| true |
cd55ad0db9f5f993581b71ddcbe9a06ecbbc1a40 | SQL | rsine/rsineVad | /vad/data/rsine/post-install.sql | UTF-8 | 3,890 | 3.578125 | 4 | [] | no_license | --A simple exec method, returning 0 on success and 1 on error.
--Inspired by WIKI_EXEC_NO_ERROR
create procedure DB.DBA.RSINE_EXEC (in text varchar)
{
log_enable(1);
declare exit handler for sqlstate '*' {
rollback work;
return 1;
};
exec (text);
commit work;
return 0;
}
;
--Procedure to create rsi... | true |
e87cd31f3f4e229a1cfef79551deb1c6c75c7ac7 | SQL | InnovativeSPIN/NSCET-Website | /Alumnireg/db/form.sql | UTF-8 | 2,596 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 14, 2020 at 12:51 PM
-- 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";
/... | true |
e3601d73e48cf85381251b4f56dad8f05d429fd4 | SQL | khuzzuk/dvd-example | /src/main/resources/business_query.sql | UTF-8 | 1,340 | 4.0625 | 4 | [] | no_license | --revenue per film
SELECT f.film_id, sum(p.amount)
FROM film f
JOIN inventory i ON f.film_id = i.film_id
JOIN rental r ON i.inventory_id = r.inventory_id
JOIN payment p ON r.rental_id = p.rental_id
GROUP BY f.film_id
ORDER BY f.title;
--revenue per film per day
SELECT f.film_id, p.payment_date, SU... | true |
a59fd7b2eb104971c35920c57302b5451ce24b37 | SQL | atymkiv/DB | /lab12/triggers.sql | UTF-8 | 344 | 2.796875 | 3 | [] | no_license | use real_estate;
CREATE
TRIGGER user_password BEFORE INSERT
ON real_estate.user FOR
EACH ROW
SET NEW.password = real_estate_encode(NEW.password);
INSERT INTO real_estate.user (login, password, created, email, firstName, lastName, deleted_at)
VALUES ( 'olek', '12345', '2019-05-25', 'olek@gmail.com', 'Olek... | true |
0a219c734f4e6e3306721d61bfe8614c9219c6b1 | SQL | swimshahriar/CSE311_MySQL | /CSE311_Lab01.sql | UTF-8 | 4,038 | 3.359375 | 3 | [] | no_license | -- creating Employees table
CREATE TABLE Employees(
Employee_id INT(6) PRIMARY KEY NOT NULL, -- It is a primary key and cannot be left blank(NULL)
First_name VARCHAR(20),
Last_name VARCHAR(25) NOT NULL,
Email VARCHAR(25) NOT NULL,
Phone_number VARCHAR(20),
Hire_date DATE NOT NULL,
Job_id VARCHAR(1... | true |
2c2ec2f1a04539f5ce23c2e57efd1207236fc0f5 | SQL | Sanyyouisf/chinook--SanyYousif- | /17-Invoice_line_item_count.sql | UTF-8 | 274 | 3.734375 | 4 | [] | no_license | /*17-Provide a query that shows all Invoices
but includes the # of invoice line items*/
select Invoice.*,
Count(InvoiceLine.InvoiceLineId)As InvoiceLineNumber
from Invoice
join InvoiceLine
on Invoice.InvoiceId = InvoiceLine.InvoiceId
Group By Invoice.InvoiceId
| true |
b1691b4d43eb6755757ec9e47cf8384e5df7a6fb | SQL | tecnot2773/holidaypark | /data/9_keycard.sql | UTF-8 | 512 | 3.03125 | 3 | [] | no_license | use holiday_park;
DELETE FROM key_card WHERE key_card_id IS NOT NULL;
INSERT INTO key_card (code, check_in, check_out, card_owner_id, key_card_type, age, name, reception_id, bill_nr) VALUES
(1, '2020-12-12', '2021-01-01', 5, 'adult', NULL, 'Tanner Kirlin', 1, 1),
(2, '2020-12-12', '2021-01-01', 8, 'adult', NUL... | true |
1b76f5e35b6e84369d0a89e14dab47b146731e40 | SQL | radtek/scripts-oracle-named | /+usados/Novos/Query Optimization/missing_statistics8.0or8.1.sql | UTF-8 | 2,026 | 3.96875 | 4 | [
"MIT"
] | permissive | -------------------------------------------------------------------------------
--
-- Script: missing_statistics.sql
-- Purpose: to count the number of segments in each schema with/out stats
-- For: 8.0 and higher
--
-- Copyright: (c) Ixora Pty Ltd
-- Author: Steve Adams
--
-----------------------------------... | true |
c1a3eabc9ca6e269601bd4b04e15c7399f10f29e | SQL | eddyphilippo/ExerciceSQL | /Exercice6/script.sql | UTF-8 | 705 | 2.625 | 3 | [] | no_license | INSERT INTO image
VALUES (1, 'orwellPortrait', 'https://upload.wikimedia.org/wikipedia/commons/7/7e/George_Orwell_press_photo.jpg', '1176', '1596', 'jpg', 'Portrait de l’auteur Geroge Orwell', '2020-05-10'),
(2, 'steinbeckPortrait', 'https://live.staticflickr.com/525/18306511889_1c9606e8ea_z.jpg', '640', '476', 'jpg', ... | true |
8d239be4c538c5c746353422005e2c87d31828bc | SQL | aphistic/intro-to-cassandra-and-cql | /22-query-limitations.cql | UTF-8 | 1,088 | 4.1875 | 4 | [] | no_license | CREATE TABLE census (
state VARCHAR,
city VARCHAR,
area INT,
section INT,
voters INT,
PRIMARY KEY ((state, city), area, section)
);
INSERT INTO census (state, city, area, section, voters) VALUES ('WI', 'Milwaukee', 1, 2, 25000);
INSERT INTO census (state, city, area, section, voters) VALUES ('WI', 'Milwauke... | true |
98c613a3d040c3598a8f45e2838a087a0387afbf | SQL | RahulAdepu92/myLearning | /irxah-inbound-services-new/db-scripts/2020/sqls_to_be_run_for_20200904_release.sql | UTF-8 | 976 | 3.375 | 3 | [] | no_license | ## sql to add and update column -AHUB391 ##
alter table ahub_dw.client_files
ADD current_timezone VARCHAR(50) ENCODE lzo;
update ahub_dw.client_files set current_timezone = 'EDT'
where client_file_id in (1,4,5,7);
update ahub_dw.client_files set current_timezone = 'NA'
where client_file_id in (2,3,6);
## sql to ru... | true |
6aa5a5a475fbaf27e1a495de1adeda3ece35502b | SQL | phikhanhb7/C0321G1-NguyenPhiKhanh | /case_study_modul3/database_case_study.sql | UTF-8 | 379 | 3.203125 | 3 | [] | no_license | use demo ;
DELIMITER $$
create procedure searById(IN id int)
begin
select *
from user
where id =user.id ;
end $$
DELIMITER ;
DELIMITER $$
CREATE PROCEDURE insert_user(
IN user_name varchar(50),
IN user_email varchar(50),
IN user_country varchar(50)
)
BEGIN
INSERT INTO users(name, email, country) VALUES(us... | true |
274053586702ccafdf25873cab9e9ac395b370bd | SQL | ballerina-platform/module-ballerina-sql | /ballerina/tests/resources/sql/procedures/call-procedures-test-data.sql | UTF-8 | 7,228 | 3.359375 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE IF NOT EXISTS StringTypes (
id INT IDENTITY,
varchar_type VARCHAR(255),
charmax_type CHAR(10),
char_type CHAR,
charactermax_type CHARACTER(10),
... | true |
52a4eb4e5dfa67bfb52a22e6cb6292f9032ed585 | SQL | Lendi/DotNetExperimentsWithCSharp | /Assignments/Product_Supplier/ProductSupplierTablesCreation.sql | UTF-8 | 435 | 3.5 | 4 | [] | no_license | use CSCDB
create table Product_Details(
prodid int not null,
prodname varchar(25) not null,
supplierid int not null primary key,
)
create table supplier_info(
supplierid int not null foreign key references product_details(supplierid),
suppliername varchar(25) not null,
supplier_address varchar(50),
city varchar(25),
... | true |
8fa51a1c081c32b8be387074feee4b1c501934dc | SQL | RogerDavidCruz/code-wars | /#_The_Post_RC_Saga_Training/SQL_practice/6kyu_codewars/6kyu_SQL_basics_monsters_using_CASE.sql | UTF-8 | 1,166 | 4.3125 | 4 | [] | no_license | -- 6 kyu - SQL Basics - Monsters using CASE
-- https://www.codewars.com/kata/593ef0e98b90525e090000b9/train/sql
--
-- You have access to two tables named top_half and bottom_half, as follows:
--
-- top_half schema
--
-- id
-- heads
-- arms
-- bottom_half schema
--
-- id
-- legs
-- tails
-- You must return a table with ... | true |
5ef4ffc577b6dcf42af81ec530c6f4ab09446853 | SQL | AndrewMore/fullstack-sql-mock | /db/schema.sql | UTF-8 | 255 | 2.890625 | 3 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS iBid;
CREATE DATABASE iBid;
USE iBid;
CREATE TABLE bid_items (
id INT NOT NULL AUTO_INCREMENT,
item VARCHAR(200),
min_cost FLOAT(20,2),
curr_bid FLOAT(20,2),
ends_in INT,
image_url VARCHAR(255),
PRIMARY KEY(id)
);
| true |
66a60577ccb2d87889c0d3ddc8c268136afff341 | SQL | joabtorres/minicurso_mysql | /codigo/3-estudo-de-caso/4-select/4_produtos.sql | UTF-8 | 621 | 3.359375 | 3 | [] | no_license | -- LISTAR TODAS OS PRODUTOS --
SELECT * FROM produtos;
-- LISTAR TODAS OS PRODUTOS da empresa 1 --
SELECT * FROM produtos WHERE cod_empresa='1';
-- LISTAR TODAS OS PRODUTOS com a quantidade abaixo de 10 --
SELECT * FROM produtos WHERE quantidade<'10';
-- LISTAR TODAS OS PRODUTOS da categoria cod 1 --
SELECT * FROM p... | true |
bcb7f281e143f1a3b21bb46bba9c7c548404fea5 | SQL | pareshsutariya/LeetCode-MSSql | /1251-AverageSellingPrice.sql | UTF-8 | 394 | 4.1875 | 4 | [
"MIT"
] | permissive | /* Write your T-SQL query statement below */
WITH cte AS (
SELECT p.product_id, u.units, p.price * u.units AS total
FROM Prices AS p
LEFT JOIN UnitsSold AS u
ON p.product_id = u.product_id AND
u.purchase_date BETWEEN p.start_date AND p.end_date
)
SELECT
product_id,
Round((Sum(tot... | true |
51fe40776f4f398b3a96530ca72592909ea793c9 | SQL | selectnull/euler | /sql/117.sql | UTF-8 | 511 | 3.96875 | 4 | [] | no_license | with tiles as(
select 1 black, 2 red, 3 green, 4 blue from rdb$database
)
select max_black.val || '*black', max_red.val || '*red', max_green.val || '*green', max_blue.val || '*blue' --count(*)
from tiles
cross join integers(0, 5 / black) max_black
cross join integers(0, 5 / red) max_red
cross join integers(... | true |
c9191927ac7390a8ad3e592bf57cdad0d9c0990a | SQL | jpotalujeva/bookstore | /docker/mysql/bookstore.sql | UTF-8 | 6,074 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Sep 22, 2018 at 02:02 PM
-- Server version: 5.7.21
-- PHP Version: 7.1.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... | true |
5df5e6c08c15cd9943cbc2e4e15813aa313834a7 | SQL | cado1982/football-stats-api | /src/FootballStatsApi.Database/Scripts/Script0004_Create team-summary table.sql | UTF-8 | 1,191 | 3.03125 | 3 | [] | no_license | CREATE SCHEMA IF NOT EXISTS "stats";
CREATE TABLE "stats"."team_summary" (
"team_id" integer NOT NULL REFERENCES "stats"."team"(id) ON DELETE CASCADE,
"season_id" integer NOT NULL,
"competition_id" integer NOT NULL REFERENCES... | true |
ee7b0fb31f1b14463138830aa6cd7fedc386f53c | SQL | HAIWWH/JAVAEE | /car_database.sql | UTF-8 | 35,545 | 3.5625 | 4 | [] | no_license |
create database car_database; #创建数据库test_database
use car_database; #使用创建好的数据库
#1左侧模块表
CREATE TABLE t_module (
moduleid INT auto_increment PRIMARY KEY NOT NULL, #模块编号
modulename VARCHAR (100) #模块名称
) ENGINE = INNODB DEFAULT charset = utf8;
INSERT INTO t_module VALUES (NULL, '组织结构');... | true |
49579a46feed3a93d99dfdfecee3c4fc762602ba | SQL | krawat10/SQLExample | /SYNTAX/DATE FUNCTIONS.sql | UTF-8 | 1,780 | 3.515625 | 4 | [] | no_license | /* DATE FUNCTIONS */
-- returns current date and time
SELECT NOW(); -- '2018-02-25 18:30:42'
SELECT CURRENT_TIMESTAMP(); -- '2018-02-25 18:30:42'
-- returns day name
SELECT DAYNAME('2018-02-25 18:30:42'); -- 'Sunday'
-- returns day of month
SELECT DAYOFMONTH('2018-02-25 18:30:42'); -- '25'
-- returns day of week
SE... | true |
a15433a32aa4dc6b39cd92ad4db247a812dc07cc | SQL | avyunusemre/SQLDersler | /day10_joinExamples.sql | ISO-8859-3 | 4,912 | 3.734375 | 4 | [] | no_license | CREATE TABLE bolumler (
bolum_id NUMBER(2) CONSTRAINT bolum_pk PRIMARY KEY,
bolum_isim VARCHAR2(14),
konum VARCHAR2(13)
);
INSERT INTO bolumler VALUES (10,'MUHASABE','IST');
INSERT INTO bolumler VALUES (20,'MUDURLUK','ANKARA');
INSERT INTO bolumler VALUES (30,'SATIS','IZMI... | true |
b85459213ad68912975ecb964b839a7c1cab369c | SQL | tomoya06062155/typing_game | /typing_game_dump.sql | UTF-8 | 3,141 | 3.03125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.31, for macos10.14 (x86_64)
--
-- Host: localhost Database: typing_game
-- ------------------------------------------------------
-- Server version 5.7.31
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULT... | true |
7b721729511e8623cabf51705a006c6cc617c830 | SQL | VB6Hobbyst7/VB-2 | /당진종합병원/sql1.sql | UTF-8 | 1,785 | 2.8125 | 3 | [] | no_license | SELECT DiSTINCT b.SCP42IDNOA, a.SCP41NAME, a.SCP41JDATE, b.SCP42SUGACD ,SCP41SNDYN,a.SCP41RSTYN,b.SCP42RSTCD,b.SCP42RESULT
FROM JAIN_SCP.SCPRST41 a, JAIN_SCP.SCPRST42 b
WHERE a.SCP41PCODE = b.SCP42PCODE
AND a.SCP41JDATE = b.SCP42JDATE
AND a.SCP41SID = b.SCP42SID
AND a.SCP41SPMNO2 = '2012004616'
AND b.S... | true |
89f4012913292b452b4109835d86f1168dd8061b | SQL | phptrh/framework | /framework.sql | UTF-8 | 2,439 | 3.0625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 50553
Source Host : 127.0.0.1:3306
Source Database : framework
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2018-07-19 15:21:32
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... | true |
ef1d4530fa5d245beab508e5eb7e7d4d96b45ee7 | SQL | csmoon1010/DBProgramming_EnrollCourse | /WebContent/SQL/CountSelected.sql | UTF-8 | 686 | 3.5625 | 4 | [] | no_license | create or replace procedure CountSelected(
sStudentId in varchar2,
nYear in number,
nSemester in number,
nTotalUnit OUT number,
nTotalCourse OUT number
)
is
v_course course%ROWTYPE;
cursor cur
is
select e.c_id, e.c_id_no, c.c_unit
from enroll e, course c
where e.s_id = sStudentId and substr(e.e_sem, 1,... | true |
06a1eaa05174d044c8bdcdbe13e85d30a403868a | SQL | srianant/DNN_Hyperparameter_Optimization | /Optimization/nn_dist/data/source_code/data_files/sql/load_pyodbc.sql | UTF-8 | 1,044 | 3.46875 | 3 | [] | no_license | -- load_py.sql
-- create blob table
CREATE COLUMN TABLE "LIVE2"."MYBINARIES"
(
ID INTEGER PRIMARY KEY,
STRING BLOB ST_MEMORY_LOB
)
;
-- create full text index
DROP FULLTEXT INDEX "LIVE2"."MYINDEX_BLOB";
CREATE FULLTEXT INDEX myindex_blob ON "LIVE2"."MYBINARIES" ("STRING")
CONFIGURATION 'EXTRACTION_CORE'... | true |
2b4645987eed7a62a8fc118ef7d1a80f69e3eca9 | SQL | OsmanBytyqi/PHP_Project_Gr23 | /ProjektiPHP/restaurant_project.sql | UTF-8 | 5,498 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 17, 2021 at 07:13 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
2cf7c895044d312abf64295997c88c7b43d39d48 | SQL | wf-oadenaike/TestProject | /TestDBProject/Organisation/Tables/AnnualBudgetReviewTypes.sql | UTF-8 | 251 | 2.53125 | 3 | [] | no_license | CREATE TABLE [Organisation].[AnnualBudgetReviewTypes] (
[ReviewTypeId] INT IDENTITY (1, 1) NOT NULL,
[ReviewType] VARCHAR (128) NOT NULL,
CONSTRAINT [PKAnnualBudgetReviewTypes] PRIMARY KEY CLUSTERED ([ReviewTypeId] ASC)
);
| true |
6dbda4d592e4add2ab2ecd1c87626e518a914ef9 | SQL | viethoanggg/quanlybanvemaybay | /SQLmaybay/nhanvien.sql | UTF-8 | 1,779 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th5 11, 2019 lúc 05:40 PM
-- Phiên bản máy phục vụ: 10.1.38-MariaDB
-- Phiên bản PHP: 7.2.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... | true |
0138c067b5795b3794ed69fd51e153489170bc49 | SQL | danielchungara1/v1-tplate-ws | /src/main/resources/db/migration/V8.10__create_category_model.sql | UTF-8 | 326 | 3.234375 | 3 | [] | no_license | CREATE TABLE category
(
id BIGSERIAL PRIMARY KEY,
name VARCHAR(255) UNIQUE NOT NULL,
description VARCHAR(255) NOT NULL,
title VARCHAR(255) NOT NULL,
category_parent_id BIGINT DEFAULT NULL
);
ALTER TABLE category
ADD FOREIGN KEY (category_parent_id) REFERENCES category... | true |
b43c2b00f2dc102cb7e08a44daadec040ba5cdbe | SQL | lj89/TeamHealthcareSMU_GCP | /Logistic Regression model on BQ ML.sql | UTF-8 | 294 | 2.65625 | 3 | [] | no_license | -- create Logistic Regression model on BQ ML
CREATE MODEL
`Models.BreastCancerLogisticRegModel`
OPTIONS
( model_type='logistic_reg',labels=['diagnosis'], class_weights=[('B', 0.6), ('M', 0.4)]) AS
SELECT
*
FROM
`smu-msds-7346-summer2019-mld.raw_biopsy_data.BCDatasetForModeling` | true |
85eafd9f36231556ef479a3b4e5fdd5a948850ee | SQL | yorgosk/EAM_prj3 | /database/sdi1400058.sql | UTF-8 | 5,011 | 3.5 | 4 | [
"MIT"
] | permissive | -- MySQL Script generated by MySQL Workbench
-- Παρ 12 Ιαν 2018 08:31:26 μμ EET
-- 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_M... | true |
ed966780060514040f89b3c5464d0b5b987df9d7 | SQL | PassZhang/simple-microservice | /db/product.sql | UTF-8 | 1,356 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | /*
SQLyog Ultimate v12.08 (64 bit)
MySQL - 5.6.43 : Database - tb_product
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHE... | true |
27ba74f14666d4b2137a83066b54c30ad7318458 | SQL | oss-mirrors/egroupware | /workflow/doc/README.MYSQL | UTF-8 | 1,701 | 3.5 | 4 | [] | no_license | Note for MySQL users:
=====================
InnoDb / MyIsam
===============
THe workflow application is using transactions and Locks.
You should really consider having InnoDb type tables for all your workflow tables
(i.e.: tables with names starting with 'egw_wf' in your egroupware database).
This will certainly not... | true |
a8ace954cf4c15cc0fb0e7553957c1413fac4d71 | SQL | blackcatdead/ws_p2km | /p2km.sql | UTF-8 | 4,613 | 3.1875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.21 - MySQL Community Server (GPL)
-- Server OS: Win32
-- HeidiSQL version: 7.0.0.4053
-- Date/time: 2015-11-04 16:12:18
-- -------... | true |
9447113b0959c50e5ef10cec6039773d24bf308c | SQL | fmyuk/Memo | /src/main/resources/schema.sql | UTF-8 | 609 | 3.875 | 4 | [] | no_license | create table IF NOT EXISTS note (
id INT AUTO_INCREMENT primary key,
title TEXT,
body TEXT,
date TIMESTAMP
);
create table IF NOT EXISTS users (
username varchar_ignorecase(50) not null primary key,
password varchar_ignorecase(100) not null,
enabled boolean not null
);
create table IF NOT ... | true |
ed6dddcef7de262ac0bcef895125a92137fad63f | SQL | viraphilavong/ICS-311 | /Project3.sql | UTF-8 | 3,912 | 4.09375 | 4 | [] | no_license | CREATE TABLE customer (
cus_id INTEGER AUTO_INCREMENT PRIMARY KEY,
cus_name VARCHAR(50),
address VARCHAR(50),
cc_num VARCHAR(16),
phone VARCHAR(12));
CREATE TABLE category (
cat_id INTEGER AUTO_INCREMENT PRIMARY KEY,
cat_name VARCHAR(20));
CREATE TABLE product (
prod_id INTEGER AUTO_INCREMENT PRIMARY KEY,
cat_id INTE... | true |
639a47f37885be51955fed24b79bd78b67e6fab4 | SQL | avargaso1487/mundipack | /sql/SCRIPTS ANTERIORES/SCRIPTS JORGE/opc_buscar_socio.sql | UTF-8 | 973 | 3.515625 | 4 | [] | no_license | use bdmundipack;
drop procedure IF EXISTS sp_buscar_socio;
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_buscar_socio`(IN `opcion` VARCHAR(30), IN `p_dni` VARCHAR(8))
NO SQL
BEGIN
IF opcion = 'opc_buscar_socio' THEN
SET @EXISTE = (SELECT count(*) FROM se_viajero V INNER JOIN se_persona P ON P.Pers... | true |
bb0c0871bb16c8e540ec0d243aaf55aca166c51f | SQL | YakovBurtsev/socialnetwork | /friends/src/main/resources/schema.sql | UTF-8 | 537 | 3.90625 | 4 | [] | no_license | DROP TABLE IF EXISTS requests;
DROP TABLE IF EXISTS friends;
DROP SEQUENCE IF EXISTS requests_seq;
CREATE SEQUENCE requests_seq START WITH 1;
CREATE TABLE friends
(
user_id BIGINT NOT NULL,
friend_id BIGINT NOT NULL
);
ALTER TABLE friends
ADD PRIMARY KEY (user_id, friend_id);
CREATE TABLE requests (
id ... | true |
b313556f7661a82761b78f13b59d37fa61666f12 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day21/select0240.sql | UTF-8 | 191 | 2.6875 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-20T02:40:00Z' AND timestamp<'2017-11-21T02:40:00Z' AND SENSOR_ID='e4f84490_f30f_4e9b_a601_a78423f270e0'
| true |
371a849afc7d9fb3464ad42513809279457a534a | SQL | nabocode/CRUD-PHP-Project | /oop_crud.sql | UTF-8 | 1,592 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Feb 25, 2021 at 08:55 PM
-- Server version: 5.7.32
-- PHP Version: 7.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIE... | true |
ef307650bddccea435f06f48daee0ef1ef29c2d8 | SQL | dariuszlesiecki/BD-1-Projekt | /sql/insert.sql | UTF-8 | 2,546 | 3.03125 | 3 | [] | no_license | set search_path to wiezienie;
insert into zmiana(nazwa) values
('pierwsza'),
('druga'),
('trzecia');
insert into zawod(opis) values
('dyrektor zakładu karnego'),
('z-ca dykrektora zakładu karnego'),
('dowódca zmiany'),
('oddziałowy'),
('strażnik'),
('lekarz'),
('szef kuchni'),
('woźny'),
('sprzątaczka'),
('mechanik')... | true |
553e80afa153f7cc56459ad5b961673c0288f9c4 | SQL | lndeaver/undergradLabs | /moreSQL.sql | UTF-8 | 2,170 | 4.46875 | 4 | [] | no_license | /* PROBLEM 1 BEGIN */
CREATE TABLE label (
lbltitle VARCHAR(25) NOT NULL,
lblstreet VARCHAR(30) NOT NULL,
lblcity VARCHAR(20) NOT NULL,
lblstate VARCHAR(10) NOT NULL,
lblpostcode VARCHAR(10) NOT NULL,
lblnation VARCHAR(10) NOT NULL,
PRIMARY KEY (lbltitle)
);
CREATE TABLE cd (
cdid INTEGER,
cdlblid VARCHAR(10)... | true |
3c05ef97c2140a9f6a0d618f6f13b80eb617bad7 | SQL | chaplien666/PRAKTIKUM6 | /DPW/billing_address.sql | UTF-8 | 2,866 | 2.875 | 3 | [] | no_license | -- MariaDB dump 10.17 Distrib 10.4.6-MariaDB, for Win64 (AMD64)
--
-- Host: localhost Database: billing_address
-- ------------------------------------------------------
-- Server version 10.4.6-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS... | true |
8b2384d8966c60775c86f02db6e8a1eb7f9ee7e0 | SQL | adeskmr/SQL | /lab2/query3.sql | UTF-8 | 145 | 3.171875 | 3 | [] | no_license | SELECT DISTINCT s.exchangeID, s.Stockname
FROM Stocks s, Quotes q
WHERE q.price < 314.15
AND q.symbol = s.symbol
AND q.exchangeID = s.exchangeID; | true |
41b34c4fe62b357b39b9e34f3540b101614870c1 | SQL | fu-kim/My | /GC-sql.sql | UTF-8 | 8,762 | 3.375 | 3 | [] | no_license | create table staff(
s_id int not null primary key,
s_name varchar(50) not null,
s_pwd varchar(50) not null,
s_age int not null,
s_type int not null,
s_phone varchar(50) not null,
s_entrytime date not null
)
insert into staff(s_id,s_name,s_pwd,s_age,s_type,s_phone,s_entrytime) values(1001,'付金鑫','123456',20... | true |
b54ed21b7f9d4c7b1a606affe208beade47bbc8c | SQL | PaarthB/FIT3003-Business-Intelligence-and-Data-Warehousing | /FIT3003 Week 8.sql | UTF-8 | 5,270 | 3.703125 | 4 | [] | no_license | Describe DW.CHARTER_FACT;
Describe DW.TIME;
Describe DW.PILOT;
Describe DW.MODEL;
Select * from DW.CHARTER_FACT;
Select * from DW.PILOT;
---------------------------------C1 -----------------------------
Select t.TIME_MONTH, p.PIL_LICENSE, c.MOD_CODE, SUM(c.Tot_Fuel) as Total_Fuel
from DW.CHARTER_FACT c,... | true |
934a90be964a8741f4a8c66739fb10f914e14295 | SQL | hqottsz/MXI | /assetmanagement-database/src/solution/plsql/refterm/10ref_oil_status.sql | UTF-8 | 869 | 2.71875 | 3 | [] | no_license | /********************************************
** INSERT SCRIPT FOR TABLE "REF_OIL_STATUS"
** 10-Level
** DATE: 02-OCT-09
*********************************************/
INSERT INTO ref_oil_status (oil_status_db_id,oil_status_cd,oil_status_sdesc,oil_status_ord,ui_notify_bool,rstat_cd,creation_dt,revision_dt,revision_db_i... | true |
b12a15d2fb721e85b1995b4359ca42e5fd313282 | SQL | Pamelapxaylink/postgresql-course | /125/ninja8e3.sql | UTF-8 | 444 | 3.03125 | 3 | [
"MIT"
] | permissive | --Hands-on exercise #3
--Do the following:
--Use the existence operator to see if ice cream is in the favorite foods people like
-- SELECT * FROM people LIMIT 10;
-- SELECT pfirstname, (pfavorites -> 'Desserts') FROM people LIMIT 10;
SELECT pfirstname, (pfavorites -> 'Desserts') ? 'ice cream' FROM people;
-- fancy
-... | true |
d03f6d45a17d922c7a299af7bec54ca542811828 | SQL | viviana1982/modelado-de-datos | /olimpica.sql | UTF-8 | 5,871 | 2.515625 | 3 | [] | no_license | -- MySQL dump 10.16 Distrib 10.1.34-MariaDB, for Win32 (AMD64)
--
-- Host: localhost Database: cede_olimpica
-- ------------------------------------------------------
-- Server version 10.1.34-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@... | true |
e10fae0ae2f1a336bafcbb9fa180e93599d00674 | SQL | OniqLoshiq/SoftUni-CSharpDBFundamentals | /07- 180522-C# DB Basics/180620-DBB-16 Ex.Prep 1/180620-DBB-16 ExamPrep1/180620-DBB-16 ExamPrep1/ReportService-Section1.sql | UTF-8 | 1,781 | 4.21875 | 4 | [] | no_license | CREATE TABLE Users(
Id INT IDENTITY NOT NULL,
Username NVARCHAR(30) NOT NULL UNIQUE,
[Password] NVARCHAR(50) NOT NULL,
[Name] NVARCHAR(50),
Gender CHAR(1),
BirthDate DATE,
Age INT,
Email NVARCHAR(50) NOT NULL,
CONSTRAINT PK_Users PRIMARY KEY (Id),
CONSTRAINT ck_Gender CHECK (Gender = 'M' OR Gender = 'F')
)
... | true |
41aa1b80e5c7cac976aa41bf77a40598f32f348f | SQL | blavoie/oracle-scripts | /_blos/_to_merge_/ILO_2.3/ilo_install.sql | UTF-8 | 13,596 | 2.9375 | 3 | [] | no_license | REM ILO
REM Copyright (c) 2006 - 2008 by Method R Corporation. All rights reserved.
REM
REM This library is free software; you can redistribute it and/or
REM modify it under the terms of the GNU Lesser General Public
REM License as published by the Free Software Foundation; either
REM version 2.1 of the License, ... | true |
1028cac97993d43358fa9843dd1d528b432ebd0b | SQL | haskouri/fipsen | /database/11_tbl_rating.sql | UTF-8 | 263 | 3 | 3 | [] | no_license | CREATE TABLE t_rating (
oid VARCHAR(20) NOT NULL,
type VARCHAR(20) not null,
referenceid VARCHAR(20) not null
) engine = innodb;
alter table t_rating add constraint `pk_rating` primary key (oid);
alter table t_rating add Index `index_rating` (oid); | true |
6bb8787bc7d7d07555096447556020a65e175e82 | SQL | dbillue/AV | /AV/SQL Scripts/PLSQL/JSON_2.sql | UTF-8 | 1,387 | 4.0625 | 4 | [] | no_license | /*****************************
Author: Duane Billue / Oracle
Date: 2019-11-08
Description: Oracle JSON 2
*****************************/
------------------------
-- Create table
CREATE TABLE sales_report
(
sales_rep_id NUMBER(6, 0) PRIMARY KEY,
sales_rep_fname VARCHAR2(20),
sales_rep_lname ... | true |
1b32bfb16db94e73d229f3c88c9860897ae22eac | SQL | fmilani/dark | /backend/migrations/20190910_053903_make_accounts_email_unique.sql | UTF-8 | 163 | 2.9375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"BSD-3-Clause"
] | permissive | CREATE UNIQUE INDEX idx_accounts_email_uniqueness ON accounts (email);
ALTER TABLE accounts ADD constraint emails UNIQUE USING INDEX idx_accounts_email_uniqueness
| true |
ba3b21f651335ad3c74145ba2fc3e19febc35d1d | SQL | IANCA-SA/Customizacion_Ianca | /SQL/postgreSQL/varios_04052011.sql | UTF-8 | 754 | 2.515625 | 3 | [] | no_license | SELECT * FROM C_Invoice WHERE C_Invoice_ID in(1003624, 1003618)
SELECT * FROM XX_ConceptoRetencion
SELECT * FROM XX_RV_Comprobante_Retencion WHERE C_Invoice_ID=1003601 AND
DocStatus IN ('CO','CL','RE') AND IsSotrx = 'N' AND DocBaseType IN ('API', 'APC') AND XX_TipoRetencion = 'IV'
SELECT * FROM AD_Table WHERE ... | true |
6f819447b2de8b717ee155aaa0bc60f037eddc55 | SQL | DomCoppens77/TFProjectAPI | /TFProjectAPI.Database/Procedures/Object/AppYearPurchases.sql | UTF-8 | 320 | 2.984375 | 3 | [] | no_license | CREATE PROCEDURE [AppUser].[AppYearPurchases]
AS
BEGIN
SELECT
Sum([O].[PRICE_EUR]) as [sumprice] ,[O].[TypeId], [GenTypeName] ,datepart(yyyy, [O].[Date]) as [year]
FROM [AppUser].[V_Object] as O
GROUP BY datepart(yyyy, [O].[Date]), [O].[TypeId], [O].GenTypeName
ORDER by datepart(yyyy, [O].[Date]) ASC;
END
| true |
8a4afc76cae4de9128b70ff234d99f3484ef2167 | SQL | OWDesign/5ps_ch1 | /5ps_ch1.sql | UTF-8 | 2,278 | 3.265625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Gazdă: 127.0.0.1
-- Timp de generare: aug. 22, 2019 la 03:11 PM
-- Versiune server: 10.1.38-MariaDB
-- Versiune PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.