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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0eb8fc2dd147e3823d27981fa54fafda4d1d1305 | SQL | raymondyou97/NEU_Coursework | /CS3200/quiz2/11-08EditedCREATE/11-02Edited.sql | UTF-8 | 1,011 | 3.984375 | 4 | [] | no_license | USE ex;
-- create a table without any column attributes
CREATE TABLE vendors
(
vendor_id INT,
vendor_name VARCHAR(50)
);
-- create a table specifying specific column attributes
-- since two NULL values are not considered the same a UNIQUE column can contain NULL values
-- in this example we do not allow NU... | true |
505c585a2baf8a95b1fd31afd41c7c334de1cebc | SQL | nss-day-cohort-44/chinook-NotThatPatrickStewart | /sql exercises/sales_agent_total_sales.sql | UTF-8 | 284 | 3.6875 | 4 | [] | no_license | SELECT Employee.FirstName ||" "|| Employee.LastName Employee_Name,
printf("%.2f", SUM(Invoice.Total)) AS Total_Sales
FROM Invoice
JOIN Customer
ON Invoice.CustomerId = Customer.CustomerId
JOIN Employee
ON Customer.SupportRepId = Employee.EmployeeId
GROUP BY Employee_Name | true |
a9faada06ad8b06d8279ecad3c6cbdef16d1b2ff | SQL | ikhlo/Cooking_project | /SQL/Base.sql | UTF-8 | 2,605 | 3.96875 | 4 | [] | no_license | USE cooking;
drop table if exists commande;
drop table if exists composition;
drop table if exists produit;
drop table if exists recette;
drop table IF EXISTS client;
drop table if exists fournisseur;
CREATE TABLE `cooking`.`client` (
`nom` VARCHAR(20) NOT NULL,
`numeroC` VARCHAR(10) NOT NULL,
`Id_CdR` VARCHAR(2... | true |
d2b1205e6349f6460a6b07af788a552322a1e890 | SQL | alqiluo/EatingHack | /store-router/conf/evolutions/default/1.sql | UTF-8 | 1,504 | 3.203125 | 3 | [
"Apache-2.0"
] | permissive | # --- !Ups
# Dump of table user
# ------------------------------------------------------------
CREATE TABLE `user` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL DEFAULT '',
`hashed_password` varchar(255) NOT NULL DEFAULT '',
`verified` tinyint(1) NOT NULL DEFAULT '0',
`creat... | true |
01397aa134ada714a80262bf9d62867b22f62436 | SQL | GloRo2022/ecoBike- | /ecoBike_DB.sql | UTF-8 | 5,784 | 3.359375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Sat Aug 28 16:20:47 2021
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON... | true |
3ad1f1af858fe38d84e40c173a01c7c506e07f3d | SQL | chaitanyakrishnabojja/SQL_Projects | /Hotel_Chain_Management_Database/Database/hotelchain.sql | UTF-8 | 19,399 | 3.953125 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 09, 2018 at 09:58 PM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
8bfcfca03557507c7bedaf82b9c8a1e8267e898e | SQL | mundodron/arduino-bot-aurelio | /Querys/~ebBAB7.sql | UTF-8 | 4,931 | 3.25 | 3 | [] | no_license | set serverout on size 1000000;
DECLARE
v_errcode NUMBER (10) := 0;
CURSOR c1
IS
SELECT DISTINCT
(Q.ROW_ID),
A.EXTERNAL_ID AS CMF_EXT_ID,
EIEM.EXTERNAL_ID AS EMF_EXT_ID,
SERVICE.SERVICE_ACTIVE_DT AS SERVICE_START,
... | true |
26a5a445997dee7159bfe242a2ce4c9bfa5fbbd2 | SQL | jhosep98/alkemy-challenge | /src/database/db.sql | UTF-8 | 378 | 2.859375 | 3 | [] | no_license | CREATE DATABASE budget;
CREATE TABLE operations (
operation_id SERIAL PRIMARY KEY,
operation_date DATE NOT NULL,
concept VARCHAR(30) NOT NULL,
amount INT NOT NULL
);
SELECT * FROM operations;
INSERT INTO operations(operation_date, concept, amount) VALUES('2021-01-20','compra de teclado para la pc', 1... | true |
bd59dd66d888d7d6a324c3ed8874cfb5c9e2fe02 | SQL | gvenzl/db-sample-schemas | /order_entry/cidx_v3.sql | UTF-8 | 2,690 | 3.046875 | 3 | [
"MIT"
] | permissive | rem
rem Copyright (c) 2001, 2015, Oracle Corporation. All rights reserved.
rem
rem Permission is hereby granted, free of charge, to any person obtaining
rem a copy of this software and associated documentation files (the
rem "Software"), to deal in the Software without restriction, including
rem without limitation ... | true |
4741da0ad2a6700ad1cb28b209cdb7183ad150f2 | SQL | Purv267/WishList | /wishtable.sql | UTF-8 | 2,364 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 10, 2020 at 08:36 PM
-- 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_CLIEN... | true |
f1198c78d32f5043b896d9a6e8c0cf8418f8121f | SQL | mdegroot09/my_product_compass | /db/create_table/devs.sql | UTF-8 | 249 | 2.828125 | 3 | [] | no_license | create table devs (
dev_id serial primary key,
first_name varchar,
last_name varchar,
manager_id int,
FOREIGN KEY (manager_id) REFERENCES managers (manager_id),
product_id int,
FOREIGN KEY (product_id) REFERENCES products (product_id)) | true |
0044ac4f035c4089edd443fe9ba76c1c688ef199 | SQL | Rupa1216/lowkey_backend | /_seed.sql | UTF-8 | 2,873 | 3.953125 | 4 | [] | no_license | DROP DATABASE IF EXISTS lowkey;
CREATE DATABASE lowkey;
\c lowkey;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(20) UNIQUE NOT NULL,
email VARCHAR UNIQUE NOT NULL,
fbase_uid VARCHAR UNIQUE NOT NULL,
is_private BOOLEAN DEFAULT true,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP... | true |
1f81ea477444f6540874d851a3e7a3f54a632ab2 | SQL | rsuzumura/sist-dist | /database/Estrutura_Tabelas_Sist_Dist.sql | UTF-8 | 4,128 | 3.578125 | 4 | [] | no_license | 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='TRADITIONAL';
DROP SCHEMA IF EXISTS `sistdist` ;
CREATE SCHEMA IF NOT EXISTS `sistdist` DEFAULT CHARACTER SET latin1 ;
USE `sistdist` ;
-- --... | true |
91616adc26f666bb35aa68a7c7be35269c047043 | SQL | rahulbishnoi/LabM | /Hephaistos/MySQL-Dump/Dump20130204-1/thor_machine_state_list.sql | UTF-8 | 3,034 | 2.515625 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `thor` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `thor`;
-- MySQL dump 10.13 Distrib 5.5.16, for Win32 (x86)
--
-- Host: localhost Database: thor
-- ------------------------------------------------------
-- Server version 5.5.25-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@... | true |
5664b8f9b1cd75d763901d3cf2f1a577c299112f | SQL | memmedimanli/IntellectualOnlineGame | /db/db_nhn.sql | UTF-8 | 6,758 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.8.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 28, 2014 at 12:29 AM
-- Server version: 5.0.51
-- PHP Version: 5.1.6
--
-- Database: `db_nhn`
--
-- --------------------------------------------------------
--
-- Table structure for table `comment... | true |
340ab1064cee65b6621010b56065ae5b61dfdfc8 | SQL | vijaydairyf/TimelyFish | /SolomonApp/dbo/Views/dbo.vCF507PigMovement.sql | UTF-8 | 784 | 3.109375 | 3 | [] | no_license | --*************************************************************
-- Purpose:Pig Movements with Source and Destination names
-- Author: Charity Anderson
-- Date: 8/2/2004
-- Usage: PigTransportRecord app PigMovement PV
-- Parms:
--*************************************************************
CREATE VIEW dbo.vCF507PigMo... | true |
2778a0f92757076f1408fd289b71deb6e9dc6358 | SQL | aekbhisit/zcom-domain-reseller-api | /dump.sql | UTF-8 | 3,402 | 2.96875 | 3 | [
"MIT"
] | permissive | # ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.17)
# Database: onamae
# Generation Time: 2017-07-20 10:57:26 +0000
# ************************************************... | true |
e438a61021e7b3276dc465162801903867a19f6a | SQL | benjamesian/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/16-shows_by_genre.sql | UTF-8 | 204 | 4.0625 | 4 | [] | no_license | -- List all shows with related genres
SELECT S.title, G.name
FROM tv_shows S
LEFT JOIN tv_show_genres SG
ON S.id = SG.show_id
LEFT JOIN tv_genres G
ON SG.genre_id = G.id
ORDER BY S.title ASC, G.name ASC;
| true |
755d594550f89aa4f337ddd0516f3166a1c53265 | SQL | juliezembik/adventure_link_solo | /database.sql | UTF-8 | 3,443 | 3.5625 | 4 | [] | no_license | CREATE TABLE "person" (
"id" SERIAL PRIMARY KEY,
"username" VARCHAR (80) UNIQUE NOT NULL,
"password" VARCHAR (100) NOT NULL
);
CREATE TABLE "person_character" (
"person_id" SERIAL PRIMARY KEY,
"character_id" INT REFERENCES "person",
"character_name" VARCHAR(40) UNIQUE NOT NULL,
"gender" VARCHAR (10),
"race" ... | true |
084e564ac23b4eab607d77cf2c1c5b4e571b5130 | SQL | LuizMendes90/crinfo | /base.sql | UTF-8 | 5,223 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 12, 2018 at 04:44 PM
-- Server version: 10.1.33-MariaDB
-- PHP Version: 7.2.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
4923e4f723c68dda587fb6a0b30f3dc83f6c259b | SQL | feikesteenbergen/adventofcode.com | /2017/sql/30_functions/day1-2.sql | UTF-8 | 613 | 3.375 | 3 | [] | no_license | DEALLOCATE day1_2;
PREPARE day1_2 AS
WITH RECURSIVE input (no, item) AS (
SELECT *
FROM regexp_split_to_table($1::text, '')
WITH ORDINALITY
)
SELECT
coalesce(sum(a.no::int), 0) AS captcha
FROM
input a
CROSS JOIN
(SELECT count(*) FROM input) AS sub(length)
JOIN
input b ON ((a.item+lengt... | true |
cbb6b74e77ed57f83726792c2998a9ac8d3b9733 | SQL | Ivan-Yovchev/Software-University-Homeworks | /10. Databases/ExamPreparation/RetakeExam/08. LeaguesWithTeamsAndGoals.sql | UTF-8 | 370 | 4.375 | 4 | [] | no_license | SELECT
l.LeagueName as [League Name],
COUNT(DISTINCT lt.TeamId) as [Teams],
COUNT(DISTINCT tm.Id) as [Matches],
AVG(ISNULL(tm.HomeGoals, 0) + ISNULL(tm.AwayGoals, 0)) as [Average Goals]
FROM Leagues l
LEFT JOIN Leagues_Teams lt
ON l.Id = lt.LeagueId
LEFT JOIN TeamMatches tm
ON tm.LeagueId = l.Id
GROUP ... | true |
f1eb55103a01954705f6bea5fb13063d9f0ebdb3 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day10/select2041.sql | UTF-8 | 177 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-09T20:41:00Z' AND timestamp<'2017-11-10T20:41:00Z' AND temperature>=4 AND temperature<=65
| true |
e74a6693d638f34000ad0006d29f4157743cf9ce | SQL | TalanLabs/SynaptixLibs | /dev/src/main/resources/CreateDB.sql | UTF-8 | 129,170 | 3.03125 | 3 | [] | no_license | CREATE TABLE T_APPLICATION_DAYS
(
ID RAW(16) NOT NULL,
VERSION NUMBER(10) NOT NULL,
APPLICATION_DAYS_CODE VARCHAR2(17 CHAR),
CHECK_MONDAY CHAR(1 CHAR) DEFAULT '0' NOT NULL,
CHECK_TUESDAY CHAR(1 CHAR) ... | true |
25e682060b3b95426f066ff6a821f7eba9c9d5cc | SQL | iuthub/lab-7-NodirjonKhamrokulov1810228 | /ip_U1810228_lab-7/imdb_queries.sql | UTF-8 | 1,458 | 3.515625 | 4 | [] | no_license | /* 1 */
SELECT movies.name FROM movies WHERE year=1995
/* 2 */
SELECT COUNT(*) FROM movies
JOIN roles on movies.id=roles.movie_id
WHERE movies.name="Lost in Translation"
/* 3 */
SELECT actors.first_name, actors.last_name FROM movies
JOIN roles ON movies.id=roles.movie_id
JOIN actors ON actors.id=roles.acto... | true |
61e3771a70e7ace2c50e60f463ed62605f240b07 | SQL | jiasimon/code | /src/main/java/com/sjia/Leetcode/SQLDeleteDuplicateEmails.sql | UTF-8 | 278 | 3.015625 | 3 | [] | no_license | #196. Delete Duplicate Emails
#https://leetcode.com/problems/delete-duplicate-emails/submissions/
# Runtime: 2122 ms, faster than 47.87% of MySQL online submissions for Delete Duplicate Emails.
delete p2
from Person p1, Person p2
where p1.Email = p2.Email and p2.Id > p1.Id;
| true |
b16396c470f42193e7a6733b6bc2241d8ba87039 | SQL | gitprojectjockey/DatabaseScripts | /SQL/StoredProcedures/prc_ClientPortal_ValidateUserPassword.PRC | UTF-8 | 777 | 3.34375 | 3 | [] | no_license | SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF EXISTS (SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[prc_ClientPortal_ValidateUserPassword]') AND type in (N'P'))
DROP PROCEDURE [dbo].[prc_ClientPortal_ValidateUserPassword]
GO
CREATE PROC prc_ClientPortal_ValidateUserP... | true |
9d1a8bcb03cedd8ffa028977e40b33dca6703602 | SQL | HohShenYien/bizBangkit | /sql/POST new post.sql | UTF-8 | 708 | 2.953125 | 3 | [] | no_license | --- POSTING, you will check the user id and authkey if they match,
--- if matches then this user posts a new post as below
INSERT INTO FORUM_POST_T (forum_post_id, forum_post_title, forum_post_content, forum_post_datetime, forum_post_status,
forum_post_tos_flag, forum_post_total_point, forum_post_minuspoint, user_id) ... | true |
dbda3bf93062fc81ab693ea77633c268d92546e6 | SQL | luizbsilva/desafio-devjava | /src/main/resources/db/changelog/sqls/criacao-tabela-usuario.sql | UTF-8 | 518 | 3.234375 | 3 | [] | no_license | CREATE TABLE cademp.usuario (
codigo BIGINT,
nome VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
senha VARCHAR(255) NOT NULL,
tipo_usuario VARCHAR(255),
ativo BOOLEAN,
PRIMARY KEY ( codigo ),
CONSTRAINT unique_usuario_codigo UNIQUE( codigo ));
CREATE SEQUENCE cademp.usuario_codigo_seq
IN... | true |
96c88c02ca5879134383341f71305309fdc0180f | SQL | Pedrogonzaga/sql_students | /script_sql.sql | UTF-8 | 373 | 3.328125 | 3 | [] | no_license | SELECT name , (SELECT Grade FROM notes WHERE Min_Value <= Value AND Max_Value >= Value limit 1 ) as grade_student, Value FROM students WHERE grade_student >7
UNION
SELECT 'NULL' , (SELECT Grade FROM notes WHERE Min_Value <= Value AND Max_Value >= Value limit 1 ) as grade_student, Value FROM students WHERE grade_st... | true |
11d9b1796da25838a5349a08fa598ad6295c8097 | SQL | Selim-Baskaya-22/CarRentalApplication | /SQLQuery4.sql | UTF-8 | 3,165 | 3.75 | 4 | [] | no_license | CREATE DATABASE CarsRental
CREATE TABLE Brands(
BrandsId INT IDENTITY PRIMARY KEY NOT NULL,
Name varchar(50),
);
CREATE TABLE Colors (
ColorsId INT IDENTITY PRIMARY KEY NOT NULL,
Name varchar(30),
);
CREATE TABLE Cars (
CarsId INT IDENTITY PRIMARY KEY NOT NULL,
ModelYear int,
BrandsId int,
... | true |
ec4fd0e607fc33c0739bffc8066e756f5921256a | SQL | josephspurrier/rove | /testdata/badspace.sql | UTF-8 | 359 | 2.515625 | 3 | [
"MIT"
] | permissive | --changeset josephspurrier:1
-- Query is missing here on purpose.
--rollback DROP TABLE user_status;
--changeset josephspurrier:2
INSERT INTO `user_status` (`id`, `status`, `created_at`, `updated_at`) VALUES
(1, 'active', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(2, 'inactive', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);... | true |
9f268d0cf879c0eff5e2a7176784d5bf15b08f9f | SQL | rtaka/spring-archetype | /example-ds/docker/postgres/init.sql | UTF-8 | 1,957 | 3.640625 | 4 | [] | no_license | create table game (
id integer primary key,
host varchar(256) not null,
held_at date not null
);
create table participant (
id integer primary key,
name varchar(256) not null
);
create table athlete (
id integer primary key,
participant_id integer not null,
name varchar(256) not null
)... | true |
12e551d3ec51d300f100f44505e5e752020b48e4 | SQL | MikeRena77/sdlw | /SQL/Executables/MainPerlScripts/selectPkgHist2User.sql | UTF-8 | 309 | 2.8125 | 3 | [] | no_license | select
harpackage.packageobjid,
statename,
username,
action,
execdtime,
packagename
from
harpkghistory,
haruser,
harpackage
where
harpkghistory.usrobjid = haruser.usrobjid AND
harpkghistory.packageobjid = harpackage.packageobjid
order by
packageobjid; | true |
17597e34dea79c0a53a91943a232c89c60bd0995 | SQL | smallswan399/das-employerapprenticeshipsservice | /src/SFA.DAS.EAS.Employer_Financial.Database/SeedData/SeedProdData.sql | UTF-8 | 1,821 | 3.46875 | 3 | [
"MIT"
] | permissive | /*
Post-Deployment Script Template
--------------------------------------------------------------------------------------
This file contains SQL statements that will be appended to the build script.
Use SQLCMD syntax to include a file in the post-deployment script.
Example: :r .\myfile.sql
... | true |
1c60ecffa335f4f6c66c76acc935c3c88faabcb4 | SQL | stevan/p5-Source-Gauge | /db/master.sql | UTF-8 | 4,703 | 3.625 | 4 | [] | no_license | -- ==================================================================
-- BEGIN Source::Gauge schema defintion
-- ==================================================================
-- ----------------------------------------------
-- TODO:
-- ----------------------------------------------
-- > Need to add indexes to th... | true |
d606076411923b4610416d3de79ac259c8135be0 | SQL | arthurdysart/HackerRank | /sql/basic_select/weather_observation_station_9/mysql_source.sql | UTF-8 | 282 | 2.96875 | 3 | [
"Unlicense"
] | permissive | /*
HackerRank SQL: Weather Observation Station 9
https://www.hackerrank.com/challenges/weather-observation-station-9
Difficulty: easy
Created on Sun Oct 28 17:00:25 2018
@author: Arthur Dysart
*/
SELECT DISTINCT CITY
FROM STATION
WHERE SUBSTRING(CITY, 1, 1) NOT IN ('a','e','i','o','u'); | true |
00bdfbd50d655036c0ba6dcf01c38cecdb18a8dd | SQL | shli-me/wildbook | /queries.sql | UTF-8 | 4,590 | 3.390625 | 3 | [] | no_license |
-- To sign up:
INSERT INTO users (username,email,firstname,lastname,gender,street,state,zipcode,birthdate) VALUES ('JohnSmith','JohnSmith@mail.com','John','Smith',1,'111 Main St.','NY','11201','1/2/1990');
INSERT INTO users (username,email,firstname,lastname,gender,street,state,zipcode,birthdate) VALUES ('RachelHen',... | true |
1fef571e00027231211249e09f4c2eb99710c9c0 | SQL | plkpiotr/soccer-league | /queries/goals-of-teams.sql | UTF-8 | 319 | 3.265625 | 3 | [
"MIT"
] | permissive | select sum(goals) AS total, club
from players
natural join teams
natural join scores
group by club
order by sum(goals) desc, club
limit 5;
/*
total | club
-------+---------------------
14 | Wisła Cracow
13 | AC Milan
12 | Paris Saint-Germain
9 | Juventus
6 | FC Barcelona
(5 rows... | true |
fe16056c06522f3ea705e7dfadcc7c4757e6eb78 | SQL | zixueheng/gorm-test | /gorm.sql | UTF-8 | 7,059 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- 主机: 127.0.0.1
-- 生成日期: 2020-05-18 05:22:33
-- 服务器版本: 10.4.11-MariaDB
-- PHP 版本: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTE... | true |
fd56f883344e9623e75551dac1e9091c41ebf0ed | SQL | calv1nn/informasi-binatang | /binatang.sql | UTF-8 | 1,396 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 25, 2013 at 11:01 AM
-- Server version: 5.5.29
-- PHP Version: 5.3.20
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*... | true |
0e733848e2992c4a2b914cbf1c4cbe2fec62664b | SQL | ArpitaBhagwat/IndustryConnect | /Task 1 b.sql | UTF-8 | 304 | 2.765625 | 3 | [] | no_license | SELECT dbo.PropertyHomeValue.Id, dbo.PropertyHomeValue.PropertyId, dbo.PropertyHomeValue.Value
FROM dbo.PropertyHomeValue
WHERE dbo.PropertyHomeValue.PropertyId = 5597
OR dbo.PropertyHomeValue.PropertyId = 5637
OR dbo.PropertyHomeValue.PropertyId = 5638
AND dbo.PropertyHomeValue.HomeValueTypeId = 1 | true |
92d43bf6391fc4bb91512bb9494ebedc18e1c2eb | SQL | roytuts/spring-jpa | /springboot-data-jpa-composite-primary-key/user.sql | UTF-8 | 450 | 2.84375 | 3 | [] | no_license | CREATE TABLE user (
id int unsigned COLLATE utf8mb4_unicode_ci NOT NULL,
first_name varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
last_name varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (last_name,first_name)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSE... | true |
3967026c1d84aa7b320289d5af9234ffa5bbd487 | SQL | KevinCastroP/holbertonschool-web_back_end | /0x0C-MySQL_Advanced/1-country_users.sql | UTF-8 | 274 | 3.171875 | 3 | [] | no_license | -- Create a table users
-- If the table exists, your script should not fail
CREATE TABLE IF NOT EXISTS `users` (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(255) NOT NULL UNIQUE,
name VARCHAR(255),
country ENUM('US', 'CO', 'TN') NOT NULL
);
| true |
c59afc8570bc9e179953e1dfe83ebd9ebf6525d0 | SQL | mightymv/deeploma | /bettingshop/src/main/resources/sql/schema.sql | UTF-8 | 6,495 | 3.75 | 4 | [] | no_license | --
--Create user betshop identified by "betshop!";
--Grant connect,resource to betshop;
--
--DROP
-- TABLE Competitions CASCADE CONSTRAINTS ;
--
--DROP
-- TABLE Matches CASCADE CONSTRAINTS ;
--
--DROP
-- TABLE Results CASCADE CONSTRAINTS ;
--
--DROP
-- TABLE Sports CASCADE CONSTRAINTS ;
--
--DROP
-... | true |
3ef2c89d827bba55b790f39d3ee3cbab0c1f57cf | SQL | prashant97sikarwar/SQL-programming | /Leetcode Mysql/BigCountries.sql | UTF-8 | 169 | 3.09375 | 3 | [] | no_license | /* Problem Link:- https://leetcode.com/problems/big-countries/ */
SELECT
name, population, area
FROM
World
WHERE
area > 3000000 OR population > 25000000; | true |
1477e5f4e027e15daafe0aa6d0a7bfc697aec5f8 | SQL | Brain-up/brn | /src/main/resources/db/migration/V220220117_950.sql | UTF-8 | 7,565 | 2.5625 | 3 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | UPDATE series SET description = 'Распознавание похожих фраз' WHERE description = 'Распознование похожих фраз';
UPDATE series SET description = 'Распознавание сигналов по длительности' WHERE description = 'Распознование сигналов по длительности';
UPDATE series SET description = 'Распознавание сигналов по частоте сигнало... | true |
7530e97327de1d1d050de9d75c2581b11f5eb58f | SQL | danielbrauer/instead | /backend/src/queries/follow_requests.sql | UTF-8 | 1,344 | 3.734375 | 4 | [
"MIT"
] | permissive | /* @name Create */
INSERT INTO follow_requests (requester_id, requestee_id, friend_code) VALUES (:requesterId, :requesteeId, :friendCode);
/* @name Destroy */
DELETE FROM follow_requests WHERE requester_id = :requesterId AND requestee_id = :requesteeId;
/* @name GetByIds */
SELECT id FROM follow_requests WHERE reques... | true |
62b044c5ad79f67e147d41decbc7d29fb25592d8 | SQL | DamasoGB/Pizzeria | /SQL/ejercicio4.sql | UTF-8 | 163 | 3.25 | 3 | [] | no_license | SELECT pizza.name AS "Sin ingredientes"
FROM pizza
LEFT JOIN pizza_ingredient
ON pizza.id = pizza_ingredient.id_pizza
WHERE pizza_ingredient.id_ingredient IS NULL; | true |
3beaae5c32084370be9d14265ff675584874c7e4 | SQL | jsvigneshkanna/Railway-booking-software | /database-MySql/table2.sql | UTF-8 | 274 | 2.59375 | 3 | [] | no_license | use vk2db;
create table table1(
reg_num varchar(7) not null,
name varchar(15) not null,
cat1 int(10) not null,
city varchar(10) not null,
primary key(name)
);
insert into table1 (reg_num, name, cat1, city)
values('17d108', 'anu', 47, 'tenkasi');
select cat1
from demo2;
| true |
ca19d836263fc6998f5451d713dd0ba05dcd76cb | SQL | waynedelcorraljr/sql-library-lab-onl01-seng-pt-072720 | /lib/insert.sql | UTF-8 | 2,822 | 2.765625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | INSERT INTO series (title, author_id, subgenre_id) VALUES ("Space Adventures", 1, 1);
INSERT INTO series (title, author_id, subgenre_id) VALUES ("Coding for Dummies", 2, 2);
INSERT INTO books (title, year, series_id) VALUES ("Radical Ruby Routes", 2015, 2);
INSERT INTO books (title, year, series_id) VALUES ("Carl Saga... | true |
c25e82bf32cf2821ffabf203cb60faf3301ea2ce | SQL | IQBALKHILMI/Proyek3_Java_Desktop | /Sistem Jadwal Matakuliah/dv_aknkajen_jadwalmatkul.sql | UTF-8 | 9,214 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 20, 2017 at 08:28 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
2a05b46208b178ab770f841339750a6445cf9e67 | SQL | S-Maitland/PSQL_create_insert_update_delete_examples | /marvel.sql | UTF-8 | 5,353 | 3.15625 | 3 | [] | no_license | DROP TABLE movies;
DROP TABLE people;
CREATE TABLE movies (
id SERIAL8 PRIMARY KEY,
title VARCHAR(255),
year INT2,
show_time VARCHAR(255)
);
CREATE TABLE people (
id SERIAL8 PRIMARY KEY,
name VARCHAR(255)
);
INSERT INTO people (name) VALUES ('Atyha Arshad');
INSERT INTO people (name) VALUES ('Calum Cannon');
I... | true |
e6754a743334f74ea115f157678d9544bab9dcf1 | SQL | GIorfindel/mediatheque | /mediatheque/src/mediatheque.sql | UTF-8 | 2,477 | 3.5 | 4 | [] | no_license | CREATE schema Mediatheque;
CREATE table Mediatheque.Adresse(
adresse_id integer generated always as identity primary key,
pays varchar(20),
ville varchar(20),
rue varchar(20),
numero integer
);
CREATE table Mediatheque.Personne(
personne_Id integer generated always as identity primary key,
nom varchar(2... | true |
fe64539faab3fe167df8095b0169b6828483685b | SQL | msand/ais-provider | /db/schema/005.do.ais_data_source.sql | UTF-8 | 317 | 2.71875 | 3 | [] | no_license |
ALTER TABLE ais DROP CONSTRAINT IF EXISTS ais_unique_vessel_entry;
ALTER TABLE ais ADD COLUMN IF NOT EXISTS data_source CHARACTER VARYING NOT NULL DEFAULT 'aishub';
CREATE INDEX ais_data_source_idx ON ais(data_source);
ALTER TABLE ais ADD CONSTRAINT ais_unique_vessel_entry UNIQUE(mmsi, generated_date, data_source); | true |
26d8c4e53626e860efb73d387dff4f6300e5f252 | SQL | wzwuwenzhe/homecoming | /src/main/resources/sql/hc_school.sql | UTF-8 | 361 | 2.953125 | 3 | [] | no_license | --学校表
CREATE TABLE `hc_school` (
`id` char(6) NOT NULL COMMENT '学校id',
`name` varchar(50) not null COMMENT '学校名称',
`admin` varchar(500) null COMMENT '学校管理员id',
`creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间' ,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='学校表' | true |
74ea57efa4ef348d5e04d7d9063ee96e9dd568f9 | SQL | daffawrdhn/Farm-stock | /farmstock.sql | UTF-8 | 9,302 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 09 Jun 2019 pada 17.53
-- Versi server: 10.1.36-MariaDB
-- Versi PHP: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
043f6696e229bf6a400975da427d5415d3e6e307 | SQL | kasparek/fundekave-v4 | /install/fdk4_data.sql | UTF-8 | 5,777 | 2.59375 | 3 | [] | no_license | delete from sys_pages where typeId not in ('forum','blog','galery','culture');
INSERT INTO `sys_pages` VALUES ('maina', null, 'top', null, null, 'page_ItemsList', '', NULL, NULL, 1, now(), NULL, NULL, 1, NULL, 0, 0, NULL);
INSERT INTO `sys_pages` VALUES ('mapon', null, 'top', null, null, 'page_Map', 'Mapa', NULL, NUL... | true |
3327147c651f9af02ab90b39e03f1f9233a2a94e | SQL | primo86git/gestalt-security | /conf/db/migration/base/V11__tokens_and_api_creds_ref_apps_not_orgs.sql | UTF-8 | 824 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | -- delete them all, they're ephemeral at this version of the schema
DELETE FROM token;
DELETE FROM api_credential;
-- change api key type to uuid
ALTER TABLE api_credential ALTER COLUMN api_key TYPE UUID USING uuid_generate_v4();
ALTER TABLE api_credential ALTER COLUMN api_key SET DEFAULT uuid_generate_v4();
-- add i... | true |
af32bdbcdfdc427fd26996f2be37a464aba71e16 | SQL | jsngerlach/08-SQL-fun | /08 SQL fun.sql | UTF-8 | 5,612 | 4.5625 | 5 | [] | no_license |
--1. Write a query to return all category names with their descriptions from the Categories table.
SELECT Description, CategoryName
FROM Categories
--2. Write a query to return the contact name, customer id, company name and city name of all Customers in London
SELECT ContactName, CustomerID, CompanyName, City
FROM ... | true |
b975d4520c5cb07972c9d3e745b3d661688df860 | SQL | Carto-NA/gal_leader | /sql/gal_leader_10_structure.sql | UTF-8 | 15,433 | 3.515625 | 4 | [] | no_license | /* GAL LEADER V1.0 */
/* Creation de la structure des données (tables, séquences, triggers,...) */
/* gal_leader_10_structure.sql */
/* PostgreSQL/PostGIS */
/* Conseil régional Nouvelle-Aquitaine - https://cartographie.nouvelle-aquitaine.fr/ */
/* Auteur : Tony VINCENT */
--------------------------------------------... | true |
489bf1d9c24fea0641f6ff1db9d1b6dc0c7e3f56 | SQL | philFernandez/HCL_ProductLookup | /Product.sql | UTF-8 | 713 | 2.625 | 3 | [] | no_license | CREATE TABLE product(
id BIGINT AUTO_INCREMENT,
name VARCHAR(255),
price FLOAT,
quantity INT
);
INSERT INTO product(
name, price, quantity
)
VALUES(
'Sony Car Stereo',
500,
1234
);
INSERT INTO product(
name, price, quantity
)
VALUES(
'JBL 10 inch Woofer',
89.99,
322
);
... | true |
0820ab14de56d95b313f65a3ab80cc45153a2560 | SQL | pramod2k18/Truyum | /TruyumDB.sql | UTF-8 | 733 | 3.8125 | 4 | [] | no_license | create database TruYumFinal
use TruYumFinal
create table Category (
CategoryId int PRIMARY KEY IDENTITY,
Name varchar(30))
create table MenuItem(
MenuItemId int PRIMARY KEY IDENTITY,
Name varchar(30) NOT NULL,
Price float NOT NULL,
Active BIT NOT NULL,
DateOfLaunch datetime NOT NULL,
CategoryId int NOT NULL,
FreeDeli... | true |
e3ba3b596c8b09bf493b8eb60c85a6d6da015def | SQL | berkayalcin/hexagonal-event-driven-demo | /timeline-api/src/main/resources/initial_scripts/initial_db.sql | UTF-8 | 1,976 | 3.953125 | 4 | [] | no_license | create table if not exists users
(
id varchar(255) not null
constraint users_pk
primary key,
first_name varchar(255) not null,
last_name varchar(255) not null,
email varchar(255) not null
);
alter table users
owner to postgres;
create unique index if not exists users_id_u... | true |
4627fb401215f08b43dd02e87071c73aa83895ff | SQL | coder187j3x1/community | /sql/community.sql | UTF-8 | 2,777 | 3.34375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 80015
Source Host : localhost:3306
Source Database : community
Target Server Type : MYSQL
Target Server Version : 80015
File Encoding : 65001
Date: 2020-04-15 21:04:59
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... | true |
2d30406a86be786ebe7370b623c972e09395ed70 | SQL | 200106-UTA-PRS-NET/Curtis-Shaanan-code-challenge-2 | /Employee.sql | UTF-8 | 3,318 | 3.734375 | 4 | [] | no_license | CREATE SCHEMA EMPLOYEE;
USE EMPLOYEE;
CREATE TABLE Department
(
ID MEDIUMINT NOT NULL UNIQUE AUTO_INCREMENT, -- UNIQUE is implicit but doesn't hurt
`Name` CHAR(50) NOT NULL,
Location CHAR(10) NOT NULL,
CONSTRAINT Depo_PK PRIMARY KEY(ID)
);
CREATE TABLE Employee
(
ID BIGINT NOT NULL UNIQU... | true |
ac8a6ec6e2d295d9065d968bc8abe3f8266a8047 | SQL | longxulanwws/cm | /SqlShell/生产管理建表及视图相关脚本.sql | GB18030 | 15,255 | 3.15625 | 3 | [] | no_license | DROP TABLE IF EXISTS cm_compact;
/*
* ͬϢʱδpdm
*/
CREATE TABLE `cm_compact` (
`ID` varchar(36) NOT NULL,
`Company_ID` varchar(36) DEFAULT NULL,
`Dept_ID` varchar(36) DEFAULT NULL,
`BusiOrg_ID` varchar(36) DEFAULT NULL,
`Code` varchar(36) NOT NULL,
`Name` varchar(60) DEFAULT NULL,
`partner_id` ... | true |
d067338b7efc6851b5cd02de515f3a7466f40fe1 | SQL | mmazzulli/loginphp | /inc/database.sql | UTF-8 | 221 | 2.640625 | 3 | [] | no_license | -- create database projphp_login;
use projphp_login;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL auto_increment,
`nome` varchar(100) NOT NULL,
`senha` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
); | true |
d9ca5a16124b6f74fc9ea7e658f5a8d03cdc3c8e | SQL | islobell/CAIN_new | /db/script_0.1a.sql | UTF-8 | 4,147 | 4.0625 | 4 | [] | no_license | DROP DATABASE IF EXISTS `MusicDB`;
CREATE DATABASE `MusicDB`;
USE `MusicDB`;
/*
Tabla 'Albums', que guardará la información relativa a los álbumes
Tiene los siguientes campos:
- ID: clave principal
- Title: título del albúm
*/
CREATE TABLE IF NOT EXISTS `Albums` (
`ID` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`Ti... | true |
895ce488664377b109ee156b953d446e0d739be2 | SQL | lpaulobos/Form_PHP_To_Register_And_Learn | /MySqlInnerJoin.sql | UTF-8 | 249 | 3.65625 | 4 | [] | no_license | SELECT curso.Nome as "Curso", aluno.ID_Disciplina, disciplinas.Nome, aluno.ID_Disciplina FROM `curso`
INNER JOIN aluno ON (curso.ID = aluno.ID_Curso)
INNER JOIN disciplinas ON (aluno.ID_Disciplina =
disciplinas.ID) ORDER BY `curso`.`Nome` ASC ;
| true |
d3baad5ce7227dc2334e87e0141476bc12bda035 | SQL | vaglarov/Databases-Basics---MS-SQL-Server | /Test 012019/04. DATA AGGREGATION/Exercieses/Problem 16 MAX FILTER NOT BETWEEN.sql | UTF-8 | 167 | 3.625 | 4 | [] | no_license | --Problem 16 MAX FILTER NOT BETWEEN
SELECT DepartmentID
,MAX(Salary) AS MaxSalary
FROM Employees
GROUP BY DepartmentID
HAVING MAX(Salary) NOT BETWEEN 30000 AND 70000 | true |
113379f76a4b2dec3f7acfce2a58975b19416eda | SQL | blavoie/oracle-scripts | /_blos/extlibs/bluegecko/remove-fks.sql | UTF-8 | 1,264 | 3.40625 | 3 | [] | no_license | /*
Copyright (c) 2007 Blue Gecko, Inc
License:
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; wit... | true |
b0aa7dedfc724d76036455fed9e6b537716d0643 | SQL | ivaneyvieira/impresssoPedido | /src/main/resources/sqlSaci/findProduto.sql | UTF-8 | 370 | 3.625 | 4 | [] | no_license | SELECT P.no AS prdno, TRIM(MID(P.name, 1, 37)) AS descricao, IFNULL(B.grade, '') AS grade,
IFNULL(L.localizacao, '') AS localizacao
FROM sqldados.prd AS P
LEFT JOIN sqldados.prdbar AS B
ON P.no = B.prdno
LEFT JOIN sqldados.prdloc AS L
ON L.prdno = P.no AND L.grade = IFNU... | true |
aabde14f88b4b178947095a70a70f4f6f57a38b6 | SQL | frankxiao008/ORACLE_DATABASE_DBS301 | /demo/DBS301_W3_DemoB.sql | UTF-8 | 2,921 | 3.984375 | 4 | [] | no_license | -------------------------------------------------------
-- Week 3 Working Demos
-- Created by: Clint MacDonald
-- January 22, 2019
-- Purpose: Week 3, Lesson 3 Working Demos DBS301
-- Description: Using Single-Line Functions in SELECT statements
-- in addition to more string formatting
-----------------------------... | true |
04c027a233f006f206132f600a2b447795a1cf50 | SQL | vanessaxlee/twitterdb | /db/twitter_create.sql | UTF-8 | 903 | 3.578125 | 4 | [] | no_license | drop schema if exists twitter;
-- -----------------------------------------------------
-- Schema twitter
-- -----------------------------------------------------
create schema if not exists twitter;
use twitter;
-- -----------------------------------------------------
-- Table followers
-- --------------------------... | true |
5f954ae366461f3e826660d794e91fcdea3b91c8 | SQL | pavelMihhailov/SoftUni-CSharp-DB-Fundamentals-2018 | /Database-Basics-MS-SQL-Server/07_Database-Programmability-and-Transactions-Exercises/12_Calculating-Interest.sql | UTF-8 | 382 | 3.6875 | 4 | [] | no_license | CREATE PROC usp_CalculateFutureValueForAccount(@accountId INT, @interestRate FLOAT)
AS
BEGIN
SELECT
a.Id AS [Account Id],
ah.FirstName AS [First Name],
ah.LastName AS [Last Name],
a.Balance AS [Current Balance],
dbo.ufn_CalculateFutureValue(ac.Balance, @interestRate, 5)
FROM Accounts AS a
JOIN AccountHolders A... | true |
f49bcb2286f82e7f9a5684c42953c1a1630640b3 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day09/select1742.sql | UTF-8 | 264 | 2.890625 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='WiFiAP' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['2100_6','4042','6215','6028','2066','4051','2042','4019','4068','5056'])
| true |
8b141e0dd870095554df9ef975eb6bd98459cc1f | SQL | rams1996/Bookish-LibraryManagementSoftware | /Postgres_Schema_Script/LibraryManagementSystem.sql | UTF-8 | 6,438 | 3.0625 | 3 | [
"MIT"
] | permissive | --
-- PostgreSQL database dump
--
-- Dumped from database version 12.0
-- Dumped by pg_dump version 12.0
-- Started on 2019-10-27 16:48:50 CDT
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_ca... | true |
9d93dda74d60efbc7b26f1909d9086c4fc41945a | SQL | ryantran2165/hotel-rntn | /hotel_rntn.sql | UTF-8 | 5,478 | 4.03125 | 4 | [] | no_license | DROP DATABASE IF EXISTS hotel_rntn;
CREATE DATABASE hotel_rntn;
USE hotel_rntn;
CREATE TABLE account (
PRIMARY KEY (id),
id MEDIUMINT UNSIGNED AUTO_INCREMENT,
email VARCHAR(255) NOT NULL UNIQUE CHECK (email <> ''),
password VARCHAR(32) NOT NULL CHECK (password <> ''),
first_name VARCHA... | true |
29ca0a7490164239cf7c60a9815e15c4b43e7092 | SQL | david0718/oauth2-resource | /src/main/resources/sql/create-database-table.sql | UTF-8 | 5,709 | 3.859375 | 4 | [
"MIT"
] | permissive | #
#
# CREATE DATABASE IF NOT EXISTS coupon_db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
# create user 'coupon'@'localhost' identified by 'password_dev!';
# grant all privileges on coupon_db.* to 'coupon'@'localhost';
# 模板
CREATE DATABASE IF NOT EXISTS coupon_db DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
u... | true |
da21b10ac8f5bdc583fff382f8c2bda15ccf11d0 | SQL | yani-valeva/Databases-Basics-MySQL | /Exam preparation III/17. Section 4 Programmability - P03. Take Loan.sql | UTF-8 | 558 | 3.390625 | 3 | [
"MIT"
] | permissive | DELIMITER $$
CREATE PROCEDURE `usp_take_loan`(IN `customer_id` INT, IN `loan_amount` DECIMAL(18, 2), IN `interest` DECIMAL(4, 2), IN `start_date` DATE)
BEGIN
START TRANSACTION;
INSERT INTO `loans` (`start_date`, `amount`, `interest`, `customer_id`)
VALUES(`start_date`, `loan_amount`, `interest`, `customer_id`)... | true |
0fa1324b703dc311155d1268f1bfc454cd326006 | SQL | lucas-calixto/ControleOS | /banco/Modelo.sql | UTF-8 | 6,700 | 3.28125 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- 01/25/17 23:46: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='TRADITION... | true |
b8d5337613252eaf684ff8f83c6d1a6dbfbdf9c1 | SQL | FranciscoMan/TestDB2 | /ADM/Stored Procedures/SPE_GET_BRANCH_PLANT_TRANSITIONS.sql | UTF-8 | 1,109 | 3.765625 | 4 | [] | no_license | -- =============================================
-- Author: Gabriel Vázquez Torres
-- Create date: 06/07/2018
-- Description: Get the transitions suggested for branch plant
-- =============================================
CREATE PROCEDURE [ADM].[SPE_GET_BRANCH_PLANT_TRANSITIONS]
-- Add the parameters for the stor... | true |
af6c4058fa819959aa23380092302509280162a4 | SQL | s742850/mmorpg | /src/main/resources/school/createData.sql | UTF-8 | 2,736 | 3.375 | 3 | [] | no_license | # 建立資料表
# 學生表
create table student
(
sno varchar(10) primary key,
sname varchar(20),
sage int(2),
ssex varchar(5)
);
# 教師表
create table teacher
(
tno varchar(10) primary key,
tname varchar(20)
);
# 課程表
create table course
(
cno varchar(10),
cname varchar(20),
tno varchar(... | true |
4b3669ca4f0bf49858575b478dcf20a7cd973126 | SQL | chrischrisjackson/StateStreetTransformations3 | /ddl/Snowpipe/pipe/HOLDINGS_PIPE.sql | UTF-8 | 831 | 2.75 | 3 | [] | no_license | USE ROLE SS_DBA;
CREATE
OR REPLACE
PIPE SS_DEV.RAW.HOLDINGS_PIPE
AUTO_INGEST = TRUE
INTEGRATION = 'STATESTREET_INTEGRATION'
AS COPY INTO HOLDINGS
(
SPONSOR_ID,
ENTITY_CODE,
ASSET_IDENTIFIER,
COUPON_RATE,
MATURITY_DATE,
UNIQUE_SECURITY_ID,
EFFECTIVE_DATE,
UNIT_PRICE,
UNITS_AMOU... | true |
13f66d0eaed4b8ec0a3fa3db6dab6d33b5cc2dfb | SQL | jmata188/CIS485 | /DB_Tables.sql | UTF-8 | 716 | 2.671875 | 3 | [] | no_license | CREATE DATABASE PROJECT_CIS485;
CREATE TABLE electronic
(
ele_id INT AUTO_INCREMENT PRIMARY KEY,
ele_img VARCHAR(600) NOT NULL,
ele_name VARCHAR(100) NOT NULL,
ele_price VARCHAR(6) NOT NULL
);
CREATE TABLE toys
(
toy_id INT AUTO_INCREMENT PRIMARY KEY,
toy_img VARCHAR(600) NOT NULL,
toy_name VARCHAR(100) NOT NULL,
toy... | true |
a97b8d15160c29a9835c072a5802e6d13e3f3ed4 | SQL | dpentajeu/beijingbakedfish | /protected/data/user.sql | UTF-8 | 796 | 2.875 | 3 | [] | no_license | create database bbf;
use bbf;
CREATE TABLE user (
`id` BIGINT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`acc_num` VARCHAR(45) NULL ,
`name` VARCHAR(45) NOT NULL ,
`email` VARCHAR(45) NOT NULL ,
`contact` VARCHAR(45) NOT NULL ,
`address` VARCHAR(255) NOT NULL ,
`dateOfBirth` date NOT NULL ,
`country` int NULL... | true |
8a899a610ebede77b424c8bbb779f2ab1526771f | SQL | MarcLallier/codewars_AllMykatas | /SQL_6kyu_SELECT prime numbers.sql | UTF-8 | 354 | 3.78125 | 4 | [] | no_license | /*#_6kyu_#_SELECT prime numbers*/
-- Write a SELECT query which will return all prime numbers smaller than 100 in ascending order.
-- Your query should return one column named prime.
SELECT t1.a AS prime
FROM generate_series(2, 100) AS t1(a)
WHERE NOT EXISTS (
SELECT t2.a
FROM generate_series(2, t1.a-1) AS t... | true |
e90e58b60a9e298172e58fb33cef7259490bb50b | SQL | InterfaceTT/SQL250 | /Module05/Solution/EmployeeDepartmentHistory.sql | UTF-8 | 644 | 4.15625 | 4 | [] | no_license | USE AdventureWorks;
SELECT E.EmployeeID
, C.FirstName + ISNULL(' ' + C.MiddleName + ' ', ' ') + C.LastName FullName
, CONVERT(VARCHAR(20), edh.StartDate, 107) StartDate
, ISNULL(CONVERT(VARCHAR(20), edh.EndDate, 107), 'Current') EndDate
, D.Name Department
FROM HumanResources.Employe... | true |
2131058c94a4854d4fd0f15901b3bca275b6b069 | SQL | ce-pqml/database-evaluation | /PIQUEMAL_Charles-Elie/script_logement_eval.sql | UTF-8 | 4,104 | 3.875 | 4 | [] | no_license | /************************************************
*************************************************
*************************************************
* 2.1
* Réalisation d'un TRIGGER BEFORE UPDATE
* Récupération de l'ancienne image avant sa modification pour l'insérer dans une table
* pour les photos à supprimer
... | true |
dd5eabc874ca7a8bbcbd9e8d5f0f68ad9d7cc381 | SQL | MariiaMaltseva/PhoneBook | /README.md/create_db.sql | UTF-8 | 641 | 3.109375 | 3 | [] | no_license | DROP DATABASE IF EXISTS PhoneBook;
CREATE DATABASE PhoneBook;
USE PhoneBook;
CREATE TABLE User(
id INT NOT NULL AUTO_INCREMENT,
login VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL,
full_name VARCHAR(100) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE Contact (
id INT NOT NULL AUTO_INCR... | true |
df2098ea991c905ca2c6e9d8ef0d82e19a07ba9c | SQL | niklod/highload-social-network | /deployment/migrations/000007_city_columns_rename.up.sql | UTF-8 | 95 | 2.546875 | 3 | [] | no_license | ALTER TABLE citys
DROP INDEX name,
DROP COLUMN name,
ADD city_name VARCHAR(50) NOT NULL UNIQUE; | true |
3b9f2e7cc834bcd382f4d45343262f4b45cbe9df | SQL | minald/UniversityProjects | /4th course/DBMS/lab3_Triggers.sql | UTF-8 | 1,757 | 3.328125 | 3 | [] | no_license | -- 1.Триггер должен не допускать к участию в турнире шахматиста, не оплатившего взнос.
CREATE OR REPLACE TRIGGER task1
AFTER INSERT OR UPDATE ON TournamentPlayers
FOR EACH ROW
DECLARE isPaid VARCHAR2(5);
BEGIN
SELECT AnnualMemberPayment into isPaid FROM Players WHERE Id = :new.PlayerId;
IF isPaid = 'false'
THEN... | true |
96ff456e605d150edb7ff2819e4114cba3247e71 | SQL | sircanist/clipper | /clipper-cli/src/test/scripts/v_Chair.sql | UTF-8 | 190 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | DROP VIEW v_Chair CASCADE;
CREATE OR REPLACE VIEW v_Chair AS
SELECT innerRel.x1 AS att1
FROM (
SELECT ca_0.individual AS x1
FROM concept_assertion ca_0
WHERE ca_0.concept=56
) as innerRel
| true |
0183f44621f5443f17a5301a38b4209ef1d80d77 | SQL | mishellscripts/antivirus | /db_creation.sql | UTF-8 | 340 | 2.90625 | 3 | [] | no_license | /* Creation of the database */
DROP DATABASE IF EXISTS malwaredb;
CREATE DATABASE malwaredb;
USE malwaredb;
/* Creation of the tables */
CREATE TABLE malware (
name VARCHAR(32),
signature VARCHAR(20),
PRIMARY KEY (name, signature)
);
CREATE TABLE admin (
username VARCHAR(32) NOT NULL PRIMARY KEY,
password VAR... | true |
93e14b38b686a929fc40e8373088749ffd2b596d | SQL | JustinLye/Databases | /sql/relations/ticket_line.sql | UTF-8 | 648 | 4.03125 | 4 | [] | no_license | /* SQL command to create ticket_line relation */
/* NOTE - will need to use triggers or some other mechanism to ensure referential integrity.
Mainly, will need make sure (entree_id, ticket.location_id) exists in entree_table
*/
CREATE TABLE ticket_line(
ticket_line_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMA... | true |
561069561e82708f34682ebfc5b698d39b2e8168 | SQL | jmoratayat/Prototipo1P | /BodegaDBs.sql | UTF-8 | 8,304 | 3.1875 | 3 | [] | no_license | create database bodega;
use bodega;
#------------------------------------------------------------------------------------------------------------------------------------------
create table if not exists tbl_login(
pk_id_login int,
usuario_login varchar(45),
contraseña_login varchar(45),
estad... | true |
e5c00eec6a814d5f8c52d9b5ca6de38c005b94fd | SQL | Lince99/Websites | /Backend/Databases/es_squadra_calcio.sql | UTF-8 | 2,985 | 3.546875 | 4 | [
"Unlicense"
] | permissive | -- CREATE DATABASE 191118_calcio;
-- USE 191118_calcio;
-- DROP TABLE IF EXISTS 191118_incontro;
-- DROP TABLE IF EXISTS 191118_ingaggio;
-- DROP TABLE IF EXISTS 191118_arbitro;
-- DROP TABLE IF EXISTS 191118_squadra;
-- DROP TABLE IF EXISTS 191118_calciatore;
CREATE TABLE IF NOT EXISTS 191118_squadra (
nome CHAR... | true |
a2c01812e50d9dd2d415abeda4a3ac4c5db2f89a | SQL | raogaru/raoctl | /sql/awr_stat_trend.sql | UTF-8 | 1,361 | 4.09375 | 4 | [] | no_license | -- System Statistic trends from AWR
-- Usage: @awr_stat_trend.sql <name of the statistic> <number of days to report> <interval in hours>
-- i.e. @awr_stat_trend.sql "physical read bytes" 2 4
-- i.e. The example above summarizes the number of "physical read bytes" each 4 hours in last 2 days.
-- v1.0 - inital version
--... | true |
ad504ba0710b1902d932f6b8f6d74c442ac0b630 | SQL | VorTicL/PetShop | /DB/v1.sql | UTF-8 | 3,073 | 3.421875 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE filial(
id int not null auto_increment,
nome varchar(255) not null,
endereco varchar(255) not null,
numeroEnd int not null,
dataCri timestamp not null,
primary key(id)
);
CREATE TABLE cliente (
id int(11) NOT NULL AUTO_INCREMENT,
nome varchar(100) NOT NULL,
... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.