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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9f16ad91b34aef55edeae869ed840ae845c73384 | SQL | bbajra/Gerrymanderin_ICS449 | /Data/Queries/select_All_Total_Votes_BasedOnPrecint.sql | UTF-8 | 219 | 2.515625 | 3 | [] | no_license | --Created by Vizeng Lee
--all total votes based on precint
--This script alone will tell us all total votes
select countyname,pctname
,totvoting,usprstotal,USrepTOTAL,
MNSENTOTAL, MNLEGTOTAL
from results where pctname = var | true |
f079cf9abd50a97ddc4eae0b7b3070ed909b97d7 | SQL | novakdr/burger | /db/schema.sql | UTF-8 | 230 | 3.171875 | 3 | [
"MIT"
] | permissive | /* MYSQL DATABASE & TABLE SCHEMA */
CREATE DATABASE burgers_db
USE burgers_db
CREATE TABLE burgers (
id INT AUTO_INCREMENT NOT NULL,
burger_name VARCHAR(100) NOT NULL,
devoured BOOLEAN NOT NULL,
PRIMARY KEY (id)
) | true |
77d530b28e704ffba14a7a38021bf4b148fa6d84 | SQL | GreyHumanBeing/Oracle_SQL | /8-Practica_AND_OR.sql | UTF-8 | 607 | 3.609375 | 4 | [] | no_license | select first_name,
hire_date,
job_id
from employees
where job_id='IT_PROG' and salary < 6000;
select *
from employees
where first_name like 'S%' and salary > 3000 and (department_id=50 or department_id=80)
--Otra alternativa
... | true |
106126eb6426587c9fc161c70f5fcd73b0978255 | SQL | gregorovitz/formation_front-end_developpeur | /sql/DBSlide_LoadData_OK.sql | UTF-8 | 4,309 | 3.171875 | 3 | [] | no_license | Begin transaction
use DBSlide
delete from course
delete from professor
delete from student
delete from section
delete from grade
INSERT INTO section VALUES (1010, 'BSc Management', 12);
INSERT INTO section VALUES (1020, 'MSc Management', 9);
INSERT INTO section VALUES (1110, 'BSc Economics', 15);
INSERT INTO section ... | true |
d874a1d9429b91a124852fdf67eddc31d5f0923b | SQL | gitRobV/DojoAssignments | /Python/MySQL/mysql_countries/world.sql | UTF-8 | 2,925 | 4.46875 | 4 | [] | no_license | -- What query would you run to get all the countries that speak Slovene?
-- Your query should return the name of the country, language and language percentage.
-- Your query should arrange the result by language percentage in descending order. (1)
SELECT countries.name as country_name, languages.language as languag... | true |
feec23ae54dda96e04511392fab04d79cac0f6b0 | SQL | musec/clowder | /migrations/00000000000001_clowder_init_schema/up.sql | UTF-8 | 2,290 | 3.34375 | 3 | [] | no_license | create table architectures (
id serial primary key not null,
name varchar not null
);
insert into architectures (name) values ('i386'), ('x86_64');
create table microarchitectures (
id serial primary key not null,
arch_id integer not null,
name varchar not null,
url varchar,
foreign key (arch_id) references a... | true |
7a39be1b7e6692daa4a752c041accc454fc93332 | SQL | dklykov/repo1 | /cake/dreams.sql | UTF-8 | 765 | 2.59375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.11.4
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Май 30 2012 г., 14:33
-- Версия сервера: 5.1.28
-- Версия PHP: 5.4.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- База данных: `cake`
--
-- --------------------------------------------------------
--
-- Стр... | true |
eecf9a293bba937585c0c3e5e7b8c393620270e9 | SQL | Shyamswami/toolbox | /df_details_pre_9.sql | UTF-8 | 606 | 3.28125 | 3 | [] | no_license | select A.tablespace_name, file_name, bytes/1024/1024 curr_mb, autoextensible,
maxbytes/1024/1024 max_mb, (increment_by * (select value from v$parameter where name='db_block_size'))/1024/1024 incr_mb
from ( select tablespace_name, file_name, bytes, autoextensible, maxbytes,
increment_by
f... | true |
01997088c10a682391ccb94ebeeb7779c53dbe17 | SQL | Spand0x/SoftUni | /MySQL/10 Exercises Table Relations/09 Peaks In Rila.sql | UTF-8 | 214 | 3.453125 | 3 | [] | no_license | USE geography;
SELECT mountain_range,
peak_name,
elevation AS 'peak_elevation'
FROM peaks
JOIN mountains ON peaks.mountain_id = mountains.id
WHERE mountain_range = 'Rila'
ORDER BY peak_elevation DESC; | true |
809afeefbf6824880fe6aae0e5744c3ff9c74da4 | SQL | abiais/Data-Warehouse | /example_analytics_queries.sql | UTF-8 | 800 | 4.3125 | 4 | [] | no_license | -- Here are some example queries that could be run on the database
-- Top 10 artists by number of songplays
SELECT
dim_artist.name,
count(fact_songplay.id)
FROM
fact_songplay
JOIN
dim_artist
ON fact_songplay.artist_id = dim_artist.id
GROUP BY
dim_artist.name
LIMIT 10
-- Year of origin of the most playe... | true |
c056a6a2209fcf97338b5739e25d7bba27503de2 | SQL | frede122/vehicle-api | /Scripts/init-db.sql | UTF-8 | 6,114 | 4.15625 | 4 | [] | no_license | -- USERS DATABASE -------------------------------------
create user 'questor'@'%' identified by '123';
grant all privileges on *.* to 'questor'@'%' with grant option;
-- DATABASES ------------------------------------------
create database questor_vehicle;
use questor_vehicle;
/*
create database questor_vehicle_test;
... | true |
eca77747cc17dd12d2b78a7a7640372e1c10265f | SQL | paulcollet/CS420_SQL | /CS420_Lab5/CS420_Lab5/database1/Data.sql | UTF-8 | 777 | 2.609375 | 3 | [] | no_license |
INSERT INTO shipping(ID, company, [time], price)
VALUES (123456, 'FEDEX', 12, 1200.00),
(123475, 'USPS' , 03, 100.00),
(123568, 'USPS' , 03, 20.00),
(125232, 'USPS' , 03, 12.00);
INSERT INTO product(ID, name, quantity)
VALUES (342123, 'sail boat', 01),
(234553, 'sail... | true |
63b549e17aab13108be46453a1eeea7c487e7ff3 | SQL | AlexandraGalindoCante/SIControlCapacitaciones | /bases de datos/dbcontrolcapacitacion_contrato.sql | UTF-8 | 2,693 | 3.171875 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `dbcontrolcapacitacion` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `dbcontrolcapacitacion`;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: dbcontrolcapacitacion
-- ------------------------------------------------------
-- Server version 5.7.1... | true |
148f125714ce08810971b27117d23eeae2debeb5 | SQL | smora17/Emelytours | /application/modules/setup/sql/016_1.5.0.sql | UTF-8 | 608 | 3.1875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | # Add column custom_field_type to table ip_custom_fields
ALTER TABLE `ip_custom_fields`
ADD COLUMN `custom_field_type` VARCHAR(64) NOT NULL
AFTER `custom_field_table`;
# Feature IP-162
# Allow invoice item to refer to a table `products` or to table `tasks`
ALTER TABLE `ip_invoice_items`
ADD COLUMN `item_task_id` INT(1... | true |
340009903f7310294a2232e29b88ca56ec117047 | SQL | CahHjl/C---Cmbap | /Documentatie/SQL-files/DS_Licentie_controle.sql | UTF-8 | 659 | 2.703125 | 3 | [] | no_license | CREATE TABLE Licentie_controle (
Licctrl_Id INTEGER NOT NULL PRIMARY KEY Autoincrement,
Licctrl_StatusId INTEGER DEFAULT 175009,
Licctrl_DispStatus VARCHAR(75) DEFAULT 'Licctrl-record is leeg / Tabelinitrecord',
Licctrl_Programma VARCHAR(10) DEFAULT 'Cmbap'NOT NULL,
Licctrl_Nr INTEGER DEFAULT 0 NOT NULL,
Li... | true |
2c33fd3c31d7e2b5e45f972b3ae43868d4bd6ba0 | SQL | xxseric/allocine-de | /database/film_favoris.sql | UTF-8 | 1,452 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le : Mer 16 Mai 2012 à 15:48
-- Version du serveur: 5.5.16
-- Version de PHP: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
4bf609e76e6ee4aadcaf0ad693a537cccecbd9b8 | SQL | w01f/VolgaTeam.SalesLibrary | /WebSalesLibraries/protected/data/tables/wallbin/tbl_link_bundle.sql | UTF-8 | 456 | 2.859375 | 3 | [] | no_license | DROP TABLE IF EXISTS `tbl_link_bundle`;
CREATE TABLE IF NOT EXISTS `tbl_link_bundle` (
`id` varchar(36) NOT NULL,
`id_bundle` varchar(36) NOT NULL,
`id_link` varchar(36) NOT NULL,
`id_library` varchar(36) NOT NULL,
`order` int(11) NOT NULL,
`use_as_thumbnail` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `i... | true |
7b9f3f46ee928507fcc6fe008f6d942f90fa99ef | SQL | signature-opensource/CK-DB-Twitter | /CK.DB.User.UserTwitter/Res/Model.CK.UserTwitterTable.Install.2.0.1.sql | UTF-8 | 594 | 3.25 | 3 | [
"MIT"
] | permissive | --[beginscript]
create table CK.tUserTwitter
(
UserId int not null,
-- The Twitter account identifier is the key to identify a Twitter user.
TwitterAccountId varchar(36) collate Latin1_General_100_BIN2 not null,
LastLoginTime datetime2(2) not null,
constraint PK_CK_UserTwitter primary key (UserId),
constraint FK... | true |
c3f492f00d5c8e646e58d1fe4dde67164d1d88b2 | SQL | fandashtic/arc_chennai | /Sivabalan-SQL/SQL_STORED_PROCEDURE/sp_update_TargetMeasure.sql | UTF-8 | 302 | 2.953125 | 3 | [] | no_license |
CREATE PROCEDURE [sp_update_TargetMeasure]
(@MeasureID_1 [int],
@MeasureID_2 [int],
@Description_3 [nvarchar](128),
@Active_4 [int])
AS UPDATE [TargetMeasure]
SET [Description] = @Description_3,
[Active] = @Active_4
WHERE
( [MeasureID] = @MeasureID_1)
| true |
d5bec0de19344776f905205945cac8cac0cb1e07 | SQL | SeanCreagan/raceresults | /Create_JN_U18U20_Ranking.sql | UTF-8 | 532 | 2.578125 | 3 | [] | no_license | CREATE TABLE `nensa_results_2017`.`JN_U18U20_RANKING` (
`Rank` INT NOT NULL,
`USSA_Num` INT NOT NULL,
`NENSA_Num` INT NOT NULL,
`Season` INT NOT NULL,
`Athlete_Name` VARCHAR(45) NOT NULL,
`Num_Races` INT NULL,
`1stBest_Race_Pts` DECIMAL(5,2) NULL,
`2ndBest_Race_Pts` DECIMAL(5,2) NULL,
`3rdBest_Race_Pt... | true |
312b805914e4eb61170e1453e5739df885508af1 | SQL | katshamai/sql-challenge | /Bonus/Bonus and Epilogue.sql | UTF-8 | 822 | 4.1875 | 4 | [] | no_license | -- Bonus: Create View for Employee Salary and titles
-- Join Salaries and Employees
SELECT public."Salaries".emp_no,
salary
FROM public."Salaries"
INNER JOIN public."Employees" ON
public."Salaries".emp_no=public."Employees".emp_no;
-- Join Employees and Titles
SELECT public."Titles".title_id,
title
FROM public."T... | true |
10e1d4615e876180c815c78c3d277029151104fb | SQL | Kosmachevskiy/enterprise-patterns-training | /src/main/resources/init.sql | UTF-8 | 1,964 | 3.78125 | 4 | [] | no_license | DROP TABLE IF EXISTS product_category;
DROP TABLE IF EXISTS product;
DROP TABLE IF EXISTS orders;
DROP TABLE IF EXISTS product_item;
DROP TABLE IF EXISTS user;
CREATE TABLE product_category (
id IDENTITY AUTO_INCREMENT,
name VARCHAR(50)
);
CREATE TABLE product (
id IDENTITY AUTO_INCREMENT,
name ... | true |
6b50a04f92b942c012705a871d360920c28a9e04 | SQL | RobertoAffonso/SGBD_Scripts | /Create_Database.sql | UTF-8 | 15,620 | 3.453125 | 3 | [] | no_license | -- 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='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema my... | true |
ef106e225816f873aebd8fa55e43907324e039db | SQL | olegivo/olegivo-mm | /Oleg_ivo.MeloManager.Database/dbo/Functions/GetFullFulename.sql | UTF-8 | 495 | 2.59375 | 3 | [] | no_license | -- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
CREATE FUNCTION dbo.GetFullFulename
(
-- Add the parameters for the function here
@Path NVARCHAR(255),
@FileNameWit... | true |
3b8ecb5b01bb12a796f77e821714bb2650f2044e | SQL | Jackfrost04/CMPT308 | /cmpt 308 hw 2 answers.sql | UTF-8 | 1,249 | 3.78125 | 4 | [] | no_license | --Mason Crane
--Question set 2.
--9/22/13
--Question One
select distinct city
from Agents
where aid in
(select aid
from Orders
where cid = 'c002'
)
--Question Two
select distinct pid
from Products
where pid in
(select pid
from Orders
where aid in
(select aid
from Orders
where aid in
(select aid
f... | true |
26d1c7d9b8e415a68ce61c0cb74c383af29b3773 | SQL | Onk24/Leetcode_Solutions | /#601_Human_Traffic_of_Stadium.sql | UTF-8 | 1,675 | 4.125 | 4 | [] | no_license | # Write your MySQL query statement below
with new_t as
(Select
id,
visit_date,
people,
lag(people,2) over(order by visit_date) as prev2,
lag(people,1) over(order by visit_date) as prev1,
lead(people,1) over(order by visit_date) as next1,
lead(people,2) over(order by visit_date) as next... | true |
2a8f7e56f0e3af1ec131e516c7ae7613d3d84271 | SQL | nour-KARRI/UGA-App-theatre-JEE | /sql/datasets/nds1.sql | UTF-8 | 8,966 | 3.046875 | 3 | [] | no_license | --=========================================================================
-- MyTheatre
--=========================================================================
---------------------------------------------------------------------------
-- This negative dataset tests all constraints defined in the schema
--------... | true |
ef38caf1331559a46e9936d02af21c7a6d793b34 | SQL | Jovan-Petrovic/ProjektovanjeSoftveraIspiti | /Jul16Zajednicki/prosoftjul16g1.sql | UTF-8 | 2,416 | 3.46875 | 3 | [] | no_license | /*
SQLyog Ultimate v9.50
MySQL - 5.6.20 : Database - prosoftjul16g1
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@... | true |
2d751451110b613f11142637a13ce59ac5ba37f6 | SQL | elmer7186/back-demo-hexagonal-multiproject-netflix | /cinema/infrastructure/build/resources/main/data.sql | UTF-8 | 1,349 | 3.59375 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS category
(
category_id int NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL,
description varchar(5000),
PRIMARY KEY (category_id)
);
CREATE TABLE IF NOT EXISTS movie
(
movie_id int NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL,
description varchar(5000),
category_id int NOT ... | true |
4058a11fb789f649775dbb0a971eb306ad687c00 | SQL | namitabhat/airline-database | /add_reservations_procedure.sql | UTF-8 | 4,394 | 4.03125 | 4 | [] | no_license | DELIMITER //
CREATE PROCEDURE addReservation (
IN departure_airport_code VARCHAR(3),
IN arrival_airport_code VARCHAR(3),
IN ryear INTEGER,
IN rweek INTEGER,
IN rday VARCHAR(10),
IN dep_time TIME,
IN number_of_passengers INTEGER,
OUT output_reservation_nr INTEGER
)
BEGIN
SET @sched_id = (SELECT sched... | true |
37984bc9f10969aa2941a768c81d42b6b537bac8 | SQL | Allan-Sanchez/SQL_Oracle | /Funciones_SQL/Funicion_cadena_manimulacion.sql | UTF-8 | 2,153 | 3.515625 | 4 | [] | no_license |
/*FUNCION DE CARACTERES
FUNCION DE MANIPULACION
( CONCAT )
( SUBSTR )
( LENGTH )
( INSTR )
( LPAD )
( RPAD )
( REPLACE )
( TRIM )
*/
--CONCAT concadenacion entre cadena muy parecido a ( || )
... | true |
7bd36111fba04bc80af37a05af45b76f40da1899 | SQL | MiracleOluwaseyi/Database-Excercise- | /Assignment Query.sql | UTF-8 | 1,609 | 4.46875 | 4 | [] | no_license | -- Write a query in SQL to find the name and year of the movies
SELECT mov_title, mov_year
FROM movie;
-- Write a query in SQL to find the year when the movie American Beauty released
select mov_year
from movie
where mov_title = 'American Beauty';
-- Write a query in SQL to find the movie which was released in the ye... | true |
c0c70f5b37347e4c76a13c2ab490e6ee13e7562d | SQL | rupertoss/RefuellingsTracker | /src/test/resources/beforeTest.sql | UTF-8 | 1,747 | 3.328125 | 3 | [] | no_license | DROP TABLE IF EXISTS `refuellings`;
DROP TABLE IF EXISTS `users`;
DROP TABLE IF EXISTS `users_vehicles`;
DROP TABLE IF EXISTS `vehicles`;
CREATE TABLE `refuellings` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`fuel_type` int(11) NOT NULL,
`mileage` int(11) NOT NULL,
`price` decimal(19,2) NOT NULL,
`quantity`... | true |
dd58117d773e5d247a06c8bde79fcd57a78b61dd | SQL | rakib1521/Production-Prediction- | /Site F/insert_employee.sql | UTF-8 | 472 | 3.203125 | 3 | [] | no_license | SET SERVEROUTPUT ON;
DECLARE
ID INTEGER;
EMP_NAME VARCHAR2(9):='&Employee_Name';
POSITION VARCHAR2(10):='&Position';
SALARY int:=&SALARY;
NEG_VALUE EXCEPTION ;
BEGIN
IF SALARY<=0 THEN
RAISE NEG_VALUE;
END IF;
select count(ID) into ID from EMP_F;
ID:= ID +1;
insert into EMP_F (ID,EMP_NAME,POSITION,SALARY,OFF... | true |
700de8dcc15f63b171ffde934265912efb47b34e | SQL | Kudusov/DB_API_Project | /db-project/src/main/resources/db/migration/V1__init.sql | UTF-8 | 2,541 | 4.0625 | 4 | [] | no_license | DROP TABLE IF EXISTS Users CASCADE;
DROP TABLE IF EXISTS Forums CASCADE;
DROP TABLE IF EXISTS Threads CASCADE;
DROP TABLE IF EXISTS Posts CASCADE;
DROP TABLE IF EXISTS Votes CASCADE ;
CREATE EXTENSION IF NOT EXISTS CITEXT;
DROP INDEX IF EXISTS forums_user_id_idx;
DROP INDEX IF EXISTS threads_user_id_idx;
DROP INDEX IF... | true |
bc3ce13cd937b29adef364b470041d171e2fc2fd | SQL | SINHASantos/users | /migrations/2018-11-21-150207_add_uuid/up.sql | UTF-8 | 244 | 2.6875 | 3 | [] | no_license | ALTER TABLE reset_tokens ADD COLUMN uuid uuid;
UPDATE reset_tokens SET uuid = uuid_generate_v4();
CREATE UNIQUE INDEX IF NOT EXISTS users_reset_tokens_uuid_idx ON reset_tokens (uuid);
ALTER TABLE reset_tokens ALTER COLUMN uuid SET NOT NULL;
| true |
1f97b0bc473e053da9b37c42bfec1a4170df34b5 | SQL | stuartMelville/dashboards | /scripts/dashboards.sql | UTF-8 | 1,871 | 2.640625 | 3 | [] | no_license | INSERT INTO dashboards (id,created_at,title,updated_at) VALUES(1,'2018-11-01 8:23:12',"Title 1",'2018-11-01 8:23:12');
INSERT INTO dashboards (id,created_at,title,updated_at) VALUES(2,'2018-11-02 8:23:12',"Title 2",'2018-11-02 8:23:12');
INSERT INTO dashboards (id,created_at,title,updated_at) VALUES(3,'2018-11-03 8:2... | true |
72ad55bd8125c8f99b1517a22270168560c3e85a | SQL | klme1998/HelloWorld | /2020264283_任杰/record.sql | UTF-8 | 1,335 | 2.96875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50615
Source Host : localhost:3306
Source Database : test1
Target Server Type : MYSQL
Target Server Version : 50615
File Encoding : 65001
Date: 2020-09-19 20:26:02
*/
SET FOREIGN_KEY_CHECKS=0;
-... | true |
2122c6c365aca87d8ceb51f01fb2472c53bcb7d4 | SQL | oscarmmi/Suplos | /bd/intelcost_bienes.sql | UTF-8 | 2,411 | 3.140625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 22-02-2021 a las 04:09:57
-- Versión del servidor: 10.4.14-MariaDB
-- Versión de PHP: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
0f86c903f7c738a1e90e2ad34d2106ac9c97bdfb | SQL | aeroshev/SQL_course | /create_tables.sql | UTF-8 | 3,892 | 4 | 4 | [] | no_license | CREATE TABLE client (
user_id serial NOT NULL PRIMARY KEY,
type character varying(12) NOT NULL
);
CREATE TABLE individual (
user_id serial NOT NULL,
name character varying(20) NOT NULL,
number_id int NOT NULL UNIQUE CHECK(number_id > 0),
place_residence character varying(200) NOT NULL,
PRIM... | true |
e779e547bf7fbf2dd25bd2d4019dbf082b5d46c7 | SQL | antoniofurone/cy-bss-core | /cy-bss-core/DataBase/Mercury/MySql/views/cr_vw_05_OBJECT.sql | UTF-8 | 957 | 3.484375 | 3 | [
"MIT"
] | permissive | drop view BSSV_ATTRIBUTE;
create view BSSV_ATTRIBUTE
(ID,NAME,TYPE_ID,TYPE,OBJ_ID,OBJECT,ENTITY)
as
select
a.ATT_N_ATTRIBUTE_ID,a.ATT_S_NAME,
b.ATY_N_ATTR_TYPE_ID,b.ATY_S_NAME,
c.OBJ_N_OBJECT_ID,c.OBJ_S_NAME,c.OBJ_S_ENTITY_NAME
from BSST_ATT_ATTRIBUTE a
join BSST_ATY_ATTR_TYPE b on a.ATY_N_ATTR_TYPE_ID=... | true |
43c8a156f61a8acfd0659301e3a3685188bead0f | SQL | advocaite/legacy | /game.sql | UTF-8 | 89,072 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- MySQL dump 10.13 Distrib 5.7.4-m14, for Linux (x86_64)
--
-- Host: db.hackerexperience.com Database: game
-- ------------------------------------------------------
-- Server version 5.7.4-m14
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SE... | true |
f6fa59c107643b58d18d32972d91ba7c70299ed8 | SQL | WillTorres10/BlogComQuestionarioEmLaravel | /banco.sql | UTF-8 | 6,736 | 2.921875 | 3 | [
"MIT"
] | permissive | -- MySQL dump 10.13 Distrib 5.7.22, for Linux (x86_64)
--
-- Host: localhost Database: avaliacao
-- ------------------------------------------------------
-- Server version 5.7.22-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_... | true |
903535faa0f4b9e595f0d3ab3fc86eefacbbc67c | SQL | andrewpugliese/Our-Framework | /SourceCode/Database/Db2/Tables/B1.AppConfigParameters.sql | UTF-8 | 740 | 3.484375 | 3 | [] | no_license | --#SET TERMINATOR /
--
-- This table is used for testing and demoing the functionality
-- of the DataAccessMgr class and the UniqueIds table and stored procedure.
--
CREATE TABLE B1.AppConfigParameters(
ParameterName Varchar(48) not null,
ParameterValue Varchar(256) not null,
ParameterNameUPPER generated always... | true |
a22784a2aad0b037966b9c899b1e4a56d3ac2421 | SQL | Dadagum/cinema-booking | /src/main/resources/sql/creat_table.sql | UTF-8 | 746 | 3.578125 | 4 | [] | no_license | # film table
CREATE TABLE film (
fid INT AUTO_INCREMENT,
name VARCHAR(30),
director VARCHAR (30),
actors VARCHAR (100),
price DOUBLE ,
last_len DOUBLE ,
type VARCHAR(30),
introduction VARCHAR(800),
PRIMARY KEY (fid)
)ENGINE=INNODB
# film_period table
CREATE TABLE film_period (
fid INT ,
pid INT... | true |
d734f664e550ac7ffbf65b6b8fd13954be9335fd | SQL | DomWeldon/nyutalk | /cypher_queries/03_import_comments.cql | UTF-8 | 645 | 3.34375 | 3 | [] | no_license | USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM 'file:///output-comments-0031.csv' AS line
WITH line
// find the pub it refers to
MATCH (pl:PubListing) WHERE pl.source_pub_id = toInteger(line.source_pub_id)
// ensure the comment node is created
MERGE (bc:BiteComment { source_comment_id: toInteger(line.source_comment_i... | true |
2cd954d6768a73ce7988bb9da33d3ef7c3df480f | SQL | zachariahyoung/virtualaltnet | /db/DbSchema.sql | UTF-8 | 4,306 | 3.125 | 3 | [] | no_license |
if exists (select 1 from sys.objects where object_id = OBJECT_ID(N'[FK1A2E670F582CE0D1]') AND parent_object_id = OBJECT_ID('Roles'))
alter table Roles drop constraint FK1A2E670F582CE0D1
if exists (select 1 from sys.objects where object_id = OBJECT_ID(N'[FK73A69973186756F6]') AND parent_object_id = OBJECT... | true |
5e2a370d34a7001dd8060826744cd2b0ad471b87 | SQL | rbryant/BetterOfficeOld | /demodb.sql | UTF-8 | 53,252 | 3.640625 | 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,ALLOW_INVALID_DATES';
CREATE SCHEMA IF NOT EXISTS `better-office` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
USE `better-office`... | true |
781355dde83837408c60158e192202b18b25a27c | SQL | ninton/ShuffleSim | /Config/Schema/shuffle_sims.sql | UTF-8 | 1,254 | 2.75 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 25, 2014 at 06:47 PM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
5ac805ad6607b7d5d9c6cb8f6263cf23212ecc42 | SQL | ALMLAMBO/SUBD | /2019-02-08-intro-to-SQL/students.sql | UTF-8 | 506 | 3.578125 | 4 | [] | no_license | /*create database school;*/
use school;
/*create table students (
Id integer auto_increment primary key,
Name varchar(150) not null,
EGN char(10) not null,
Birthday date
);
insert into students values
(null, 'Aleksander Marinov', '1111111110', '2000-11-02'),
(null, 'Aleksander Petrov', '1234567890', '1999... | true |
36f718d4d8043980fa24f100d2d5dc22878c164f | SQL | edwintorok/jira | /projectTrend/C+.sql | UTF-8 | 1,221 | 3.765625 | 4 | [] | no_license | --
-- list jira issues created for a given IssueVersion and matching a given project, priority, team, start date
-- Using the jira SQL interface, ref:
-- https://developer.atlassian.com/display/JIRADEV/Database+Schema
-- https://confluence.atlassian.com/display/JIRA041/Example+SQL+queries+for+JIRA
-- philippeg jul2014
... | true |
02022e66e5f7d6f8fcff1f4f5effdf6818665154 | SQL | wcig/spring-study-demo | /dao-demo/SQL/test.sql | UTF-8 | 5,035 | 3.9375 | 4 | [] | no_license | -- 1.数据库
CREATE
DATABASE `spring_study_demo` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
-- 2.用户信息表
CREATE TABLE `spring_study_demo`.`user`
(
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`name` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '昵称',
... | true |
ab3d5760b93b3eba4445a9d216f9337687872394 | SQL | hejiaz1/fastbase | /application/admin/command/Install/fastadmin.sql | UTF-8 | 60,302 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | /*
SQLyog Ultimate v13.1.1 (64 bit)
MySQL - 5.7.26 : Database - fastadmin
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MO... | true |
296781b25d0f83b7186347bffee0b475059b766f | SQL | ian-deans/angry-taco | /angry-taco/schema.sql | UTF-8 | 940 | 3.171875 | 3 | [
"MIT"
] | permissive |
DROP TABLE IF EXISTS books;
CREATE TABLE books
(
id SERIAL PRIMARY KEY,
title VARCHAR(256) NOT NULL,
year VARCHAR(16),
publisher VARCHAR(256),
img_url VARCHAR(512),
summary TEXT
);
DROP TABLE IF EXISTS authors;
CREATE TABLE authors
(
id SERIAL PRIMARY KEY,
name VARCHAR(256) NOT NULL,
bio TEXT DEF... | true |
048511e4decb03407431f0865d1257ff51ee99b8 | SQL | popovdenis/source_it_project | /sql/OnlineTest2.sql | UTF-8 | 9,037 | 2.65625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.13.1deb1
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Окт 30 2015 г., 21:11
-- Версия сервера: 5.6.27-0ubuntu1
-- Версия PHP: 5.6.11-1ubuntu3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA... | true |
335293200996c4486cf0aa4378ea5b5823521502 | SQL | dyisdog/SpringAll | /19.Spring-Boot-Testing/src/main/resources/init.sql | UTF-8 | 886 | 3.265625 | 3 | [
"MIT"
] | permissive | -- ----------------------------
-- Table structure for T_USER
-- ----------------------------
CREATE TABLE T_USER (
ID NUMBER NOT NULL ,
USERNAME VARCHAR2(20 BYTE) NOT NULL ,
PASSWD VARCHAR2(128 BYTE) NOT NULL ,
CREATE_TIME DATE NULL ,
STATUS CHAR(1 BYTE) NOT NULL
);
COMMENT ON COLUMN T_USER.USERNAME IS... | true |
9276172afdf169a7c8e7dc9c4a8f2ccea19dd5e0 | SQL | sgwilbur/database-scripts | /oracle/refresh_temp.sql | UTF-8 | 832 | 2.96875 | 3 | [] | no_license | -- Simple script to refresh the temp file, if it starts to get very large.
--
-- ref:
-- http://www.idevelopment.info/data/Oracle/DBA_tips/Tablespaces/TBS_3.shtml
--
set echo on
CREATE TEMPORARY TABLESPACE temp2
TEMPFILE 'C:\OPT\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10\TEMP02.DBF' SIZE 5M REUSE
AUTOEXTEND ON NEX... | true |
7c489f3c29d8d3f29d62decf99caa0c768fcbc58 | SQL | MishaVernik/LeetCode | /Database/Duplicate Emails/solution.sql | UTF-8 | 892 | 4.4375 | 4 | [
"MIT"
] | permissive | /*
Write a SQL query to find all duplicate emails in a table named Person.
Create table If Not Exists Person (Id int, Email varchar(255))
Truncate table Person
insert into Person (Id, Email) values ('1', 'a@b.com')
insert into Person (Id, Email) values ('2', 'c@d.com')
insert into Person (Id, Email) values ('3', 'a@b.c... | true |
1bf50e846eee92063a96e1beccd0f4c84ba291d3 | SQL | R3alloc/Database_CourseDesign | /sql_scripts/book_storeinfo.sql | UTF-8 | 612 | 2.578125 | 3 | [] | no_license |
-- ----------------------------
-- Table structure for `book_storeinfo`
-- ----------------------------
DROP TABLE IF EXISTS `book_storeinfo`;
CREATE TABLE `book_storeinfo` (
`loc_barcode` varchar(20) NOT NULL,
`loc_callNo` varchar(50) NOT NULL,
`loc_voliss` varchar(50) DEFAULT NULL,
`loc_rom` varchar(20) DEFA... | true |
6bfb8513b2cfcbbbbc935f53d5202b8973266777 | SQL | jiacong1123/lss_mgd | /sql/20190522_gdyhwx.sql | UTF-8 | 10,874 | 3.546875 | 4 | [] | no_license | /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2019/5/8 星期三 16:56:38 */
/*==============================================================*/
/*=================================================... | true |
4ef21f16809786d4c0165b1b8d380249ccced146 | SQL | tomkowz/anonymous-discussions | /schema-triggers.sql | UTF-8 | 674 | 3.328125 | 3 | [] | no_license | create trigger entries_insert
before insert on entries
for each row
set NEW.created_at = CURRENT_TIMESTAMP, NEW.updated_at = CURRENT_TIMESTAMP;
create trigger entries_update
before update on entries
for each row
set NEW.updated_at = CURRENT_TIMESTAMP;
create trigger comments_insert
before insert on comments
for each ... | true |
b8508f242c6cf7601a178b824f665cf28dc67b13 | SQL | mylearning-gourav/LibraryUserService | /src/main/resources/new_db.sql | UTF-8 | 699 | 3.09375 | 3 | [] | no_license | CREATE DATABASE `library_users`;
CREATE TABLE `library_users`.`user` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL DEFAULT '',
`email` VARCHAR(100) NOT NULL DEFAULT '',
`password` VARCHAR(100) NOT NULL DEFAULT '',
`active` BOOLEAN NOT NULL DEFAULT 1,
`role_id` INTEGER ... | true |
7c986675771f781fde9eedc2021c783523cd3188 | SQL | yakiris/20200213_Database | /05_dz/08.sql | UTF-8 | 158 | 2.53125 | 3 | [] | no_license | #3. Подсчитайте произведение чисел в столбце id таблицы users
SELECT ROUND(EXP(SUM(LN(id)))) AS result FROM users; | true |
039d1bd01d3ae9d1ec590abbc7013abd25ed0bfd | SQL | yuz835/weindex | /weindex.dao/src/main/resources/sql/offer_comment.sql | UTF-8 | 394 | 2.859375 | 3 | [] | no_license | CREATE TABLE offer_comment (
id INT NOT NULL AUTO_INCREMENT,
offer_id INT NOT NULL,
title VARCHAR(256) NOT NULL,
content VARCHAR(512),
visible INT default 0,
creator_id INT NOT NULL,
creator_name varchar(256),
trace_comment_id INT,
create_time DATETIME,
update_time DATETIME,
PRIMARY KEY (id),
FOREIGN KEY (offer_id) REF... | true |
7e63e13ac76c3d115f082a07fd076cf9a4d6eca2 | SQL | ASherstobitov/EssentialCommandsForPostgresql | /Controller.sql | UTF-8 | 7,366 | 4.25 | 4 | [] | no_license |
-- order by
select * from person order by first_name, last_name asc
select country_of_birth from person order by country_of_birth desc
select country_of_birth from person order by country_of_birth
--distinct
select distinct country_of_birth from person order by country_of_birth
select distinct country_of_birth from p... | true |
454359cae37147c01b5f7be90faacc16c071384b | SQL | Wang-Yann/LeetCodeMe | /MySQL/1393_capital-gainloss.sql | UTF-8 | 3,448 | 4.09375 | 4 | [] | no_license | -- @Author : Rock Wayne
-- @Created : 2020-08-06 21:43:33
-- @Last Modified : 2020-08-06 21:43:33
--
-- #Stocks 表:
-- #
-- # +---------------+---------+
-- #| Column Name | Type |
-- #+---------------+---------+
-- #| stock_name | varchar |
-- #| operation | enum |
-- #| operation_day | int ... | true |
fcd05e8894201f255ebeba7c27f44e63832ebfef | SQL | JoelBondurant/RandomCodeSamples | /sql/Functions/iso_year.sql | UTF-8 | 203 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | DELIMITER $$
DROP FUNCTION IF EXISTS iso_year$$
CREATE DEFINER=`root`@`localhost` FUNCTION iso_year (adate DATE)
RETURNS INT DETERMINISTIC
BEGIN
RETURN date_format(adate, "%x");
END$$
DELIMITER ;
| true |
55fe7848e1687e931095e0fa3907597f90039e1c | SQL | amazon-archives/aws-ohdsi-automated-deployment | /Achilles/inst/sql/sql_server/ConceptHierarchy_v5.sql | UTF-8 | 18,177 | 3.625 | 4 | [
"Apache-2.0"
] | permissive | {DEFAULT @results_database_schema = 'webapi.dbo'}
{DEFAULT @vocab_database_schema = 'omopcdm.dbo'}
/*********************************************************************/
/***** Create hierarchy lookup table for the treemap hierarchies *****/
/*********************************************************************/
IF O... | true |
4f9b084e987d8d35dde36176ede43fcf70e1b77b | SQL | amadecode/skateshop | /skateshop.sql | UTF-8 | 4,587 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 25, 2018 at 12:05 PM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
bd3acc67a861a9d2f0789b2b782aa2e771f2fe86 | SQL | kt5007/sql_study | /scripts/chapter8.sql | UTF-8 | 1,714 | 3.578125 | 4 | [] | no_license | SELECT shohin_mei, shohin_bunrui, hanbai_tanka,
RANK () OVER (
PARTITION BY shohin_bunrui
ORDER BY hanbai_tanka
) AS ranking
FROM Shohin;
-- 順位付け
SELECT shohin_mei, shohin_bunrui, hanbai_tanka,
RANK () OVER ( ORDER BY hanbai_tanka ) AS ranking,
DENSE_RANK () OVER ( ORDER BY hanbai_t... | true |
57c197e8ca8eb5a08c5bbe4c82ec7983425025be | SQL | FChenebit/CryptoWallet | /databaseScript/createTable.sql | UTF-8 | 498 | 3.21875 | 3 | [
"MIT"
] | permissive | -- Table: public.currency_rate
-- DROP TABLE public."currency_rate";
CREATE TABLE public."currency_rate"
(
"rate_id" serial PRIMARY KEY,
"rate_date" date NOT NULL,
"currency_code" character varying(10) COLLATE pg_catalog."default" NOT NULL,
"rate_value" numeric
)
TABLESPACE pg_default;
ALTER TABLE p... | true |
1e73365d85a34aff2b9e45ac57666716ba35ea7f | SQL | GlinZachariah/ARMS | /arms.sql | UTF-8 | 2,933 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 22, 2017 at 07:21 PM
-- Server version: 5.7.20-0ubuntu0.16.04.1
-- PHP Version: 7.0.22-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
30378a79978997de3b97eb6a542b228a0feb4f5c | SQL | RickChuck/gitReady | /db/get_post.sql | UTF-8 | 259 | 3.40625 | 3 | [] | no_license | -- SELECT *
-- FROM blog_posts
-- ORDER BY id DESC;
SELECT blog_posts.id as post_id, post, user_id, user_name, movie_title, movie_poster
FROM blog_posts
JOIN users ON blog_posts.user_id = users.id
-- WHERE blog_posts.user_id = $1
ORDER BY blog_posts.id DESC; | true |
87a7dfe52e4c45f300c7516bc3e142da9037e1cc | SQL | rrighetti/cscripts | /sql/segments.sql | UTF-8 | 2,027 | 3.78125 | 4 | [] | no_license | SET HEA ON LIN 500 PAGES 100 TAB OFF FEED OFF ECHO OFF VER OFF TRIMS ON TRIM ON TI OFF TIMI OFF;
SELECT tablespace_name FROM dba_tablespaces ORDER BY 1;
PRO
PRO 1. Enter TABLESPACE_NAME (required)
DEF tablespace_name = '&1.';
PRO
COL size_gb FOR 999,990.000 HEA 'SIZE (GBs)';
COL percent FOR 990.0;
COL segment_type H... | true |
4951e2da9df34bc006dfc9779f4d3122b4a9d5b0 | SQL | NetwerkOorlogsBronnen/pilot-geocoderen | /scripts/nob.sql | UTF-8 | 3,722 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.10
-- http://www.phpmyadmin.net
--
-- Host: localhost:8889
-- Generation Time: Jun 22, 2016 at 09:27 AM
-- Server version: 5.5.42
-- PHP Version: 5.6.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
885d018a7c988a9cffdb00b72e1e24ae4101c3d1 | SQL | UltraJag214/UserManagerPostgress | /users.sql | UTF-8 | 1,259 | 3.296875 | 3 | [] | no_license | create table users (
user_id serial PRIMARY KEY,
first_name text,
last_name text,
email text,
age int
);
create index concurrently "idx_first_name" on users using btree (first_name);
create index concurrently "idx_last_name" on users using btree (last_name);
insert into users (first_name, last_nam... | true |
07a796ba083e01a3d6048a1de02537dea6b120ab | SQL | sangyoonlee019/ITE2038_DataBaseSystems | /project1/21.sql | UTF-8 | 150 | 3.515625 | 4 | [] | no_license | select distinct t.name,count(*) ccount
from Trainer t,CatchedPokemon c,Gym g
where t.id=c.owner_id and g.leader_id=t.id
group by t.id
order by t.name; | true |
6eb9e76a7929d863db5dd2b3ec64603ba8ae15c2 | SQL | chrisjamesr/sql-library-lab-v-000 | /lib/insert.sql | UTF-8 | 1,289 | 3.046875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | INSERT INTO series (id, title, author_id, subgenre_id) VALUES
(1, "Southern Reach", 1, 1), (2, "The Lord of the Rings", 2, 2);
INSERT INTO subgenres (id, name) VALUES
(1, "The New Weird"), (2, "Epic Fantasy");
INSERT INTO authors (id, name) VALUES
(1, "Jeff VanderMeer"), (2, "J.R.R. Tolkien");
INSERT INTO book... | true |
12988b9bb3cb8a12483276c3f2a1cd5082f8a71b | SQL | sulgy0928/dbSql | /191104pr.sql | UTF-8 | 6,159 | 3.609375 | 4 | [] | no_license | SELECT TO_CHAR(hiredate,'YYYYMM') hiredate_yyyymm,count(*) cnt
FROM emp
GROUP BY TO_CHAR(hiredate, 'YYYYMM');
SELECT DISTINCT TO_CHAR(hiredate,'YYYYMM') hiredate_yyyymm,count(*) cnt
FROM emp
GROUP BY TO_CHAR(hiredate, 'YYYYMM');
SELECT
TO_CHAR(hiredate, 'YYYY') hiredate_yyyy, count(*) cnt
FROM emp
GROUP... | true |
b6e29e1278c12126e709b9ad7d1eef8abe6a3977 | SQL | favorbob/qklproject | /token-mj/src/main/sql/update.sql | UTF-8 | 1,070 | 3.109375 | 3 | [] | no_license | ALTER TABLE eth_trade_record
CHANGE `flow_type` `from_flow_type` TINYINT(2) DEFAULT 1 NOT NULL COMMENT '流水类型,1:lockedbalance,2:balance,3积分',
CHANGE `trade_no` `trade_no` VARCHAR(64) CHARSET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' NOT NULL COMMENT '交易订单号',
ADD COLUMN `to_flow_type` TINYINT(2) DEFAULT 1 ... | true |
3f78778c315a838ea1c6a248e86d638e1cd9413c | SQL | hgolaszewski/jokebox-backend | /src/db/db_changelog.sql | UTF-8 | 2,530 | 3.25 | 3 | [] | no_license | --liquibase formatted sql;
--changeset hubert:1
CREATE TABLE Category (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(64) NOT NULL UNIQUE,
requestparam VARCHAR(64) NOT NULL UNIQUE,
address VARCHAR(255) NOT NULL UNIQUE
);
CREATE TABLE Joke (
id INT PRIMARY KEY AUTO_INCREMENT,
category_id INT... | true |
34007633c32042529cc3d99050dc409d03ac9e45 | SQL | mrprompt/mailing | /application/configs/schema/tables/email.sql | UTF-8 | 903 | 3.15625 | 3 | [] | no_license | CREATE TABLE `email` (
`id_email` int(11) unsigned NOT NULL AUTO_INCREMENT,
`id_email_grupo` int(11) unsigned NOT NULL,
`id_empresa` int(11) unsigned NOT NULL,
`str_nome` varchar(160) DEFAULT NULL,
`str_email` varchar(255) NOT NULL,
`str_hash` varchar(200) NOT NULL,
`dat_log` datetime DEFAULT '0000-00-00 ... | true |
7c85463718bb390e701b6231a9c898958b61aa6b | SQL | haikalazhar197/citra-iium-membership_system-sql | /citramembershipsystem_data.sql | UTF-8 | 9,663 | 2.53125 | 3 | [] | no_license |
--Users
INSERT INTO USERS(displayname, email, userpassword) VALUES('samsuladry', 'samsul@example.com', '$2a$10$DsAmJSdmbHSoHpcaul09A.d./Wxf9i/caUKP9ggO86tr8kmMEVUzG');
INSERT INTO USERS(displayname, email, userpassword) VALUES('haikalazhar197', 'haikalazhar197@gmail.com', '$2a$10$3/oz8Neqk0/A5gub7427KuXRT.uBwRlG.LDA9... | true |
5a52e63dac58b9ce00b37d47985a105cb0ebed2b | SQL | barend-erasmus/world-of-rations-db | /scripts/insertUser.sql | UTF-8 | 381 | 3.5 | 4 | [
"MIT"
] | permissive | DELIMITER //
CREATE PROCEDURE insertUser (
p_username CHAR(128),
p_lastLoginTimestamp BIGINT
)
BEGIN
INSERT INTO worldofrations.users (`id`, `username`, `lastLoginTimestamp`)
SELECT uuid(), p_username, p_lastLoginTimestamp FROM worldofrations.users
WHERE NOT EXISTS ( SELECT * FROM worldofrations.users
... | true |
28ddbe7ebebea27cf7a07ad2b9cc0a6a75ad5b02 | SQL | NMDSdevopsServiceAdm/SopraSteria-SFC | /resources/db/jobs.sql | UTF-8 | 2,104 | 3 | 3 | [
"MIT"
] | permissive | -- Table: cqc."Job"
-- DROP TABLE cqc."Job";
CREATE TABLE cqc."Job"
(
"JobID" integer NOT NULL,
"JobName" text COLLATE pg_catalog."default",
CONSTRAINT "Job_pkey" PRIMARY KEY ("JobID")
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE cqc."Job"
OWNER to sfcadmin;
insert into cqc."Job" (... | true |
0340ba0c3b45eb7bef3a7f6aabdc8e529ea687a3 | SQL | PauGuirao/LSPIANO | /BaseDeDades/BBDD.sql | UTF-8 | 2,042 | 3.5625 | 4 | [] | no_license | -- Creacio base de dades
DROP DATABASE IF EXISTS DB;
CREATE DATABASE DB;
USE DB;
DROP USER IF EXISTS 'admin'@'localhost';
CREATE USER 'admin'@'localhost' IDENTIFIED BY '1234';
GRANT ALL PRIVILEGES ON * . * TO 'admin'@'localhost';
-- Creacio de taules
DROP TABLE IF EXISTS Usuari CASCADE;
CREATE TABLE Usuari (
codiAm... | true |
fdd93d613dc4924e95db52d3099485ba4d65fc31 | SQL | DimaGashko/funnySqlTasks | /1.sql | UTF-8 | 216 | 3.15625 | 3 | [] | no_license | -- https://vk.com/zadachi_sql?w=wall-126489801_2
SELECT MAX(salary) FROM worker;
SELECT id, name, salary
FROM worker
WHERE salary = (
SELECT MAX(salary)
FROM worker
);
SELECT * FROM worker WHERE id > 25;
| true |
d9fa87a3e9198ed77dd0c3d5db4dd7e48fd8da0b | SQL | nchong128/fit3171 | /Week 10/Tutorial/Solution/SQL-Intermediate-sample-sol.sql | UTF-8 | 4,918 | 4.1875 | 4 | [] | no_license | /* 1. Find the maximum mark for FIT1004 in semester 1, 2013.*/
select
max(mark)
from
SHAREDSAMPLES.enrolment
where
unitcode='FIT1004'
and
semester = 1
and
to_char(ofyear,'YYYY')= '2013';
/* 2. Find the average mark of FIT1040 in semester 2, 2013.*/
select
avg(mark)
from
SHAREDSAMPLES.enrolment
wher... | true |
02383d9c47838e89397711c1e07cd17936d20c0a | SQL | mmoormeier/sql-challenge | /EmployeeSQL/TableCreation.sql | UTF-8 | 1,257 | 4.1875 | 4 | [] | no_license | -- Create employees table
CREATE TABLE employees (
emp_no VARCHAR NOT NULL PRIMARY KEY,
emp_title_id VARCHAR(10) NOT NULL,
birth_date DATE NOT NULL,
first_name VARCHAR(20) NOT NULL,
last_name VARCHAR(20) NOT NULL,
sex VARCHAR(1) NOT NULL,
hire_date DATE NOT NULL
);
ALTER TABLE employees
ALTER COLUMN hire_date T... | true |
ed47e2704035178a716e7c4fcf1241248d8527b5 | SQL | kamkarm/Stock-Analysis | /graph_data/sql_queries/rolling_cumulative_volume.sql | UTF-8 | 177 | 3.453125 | 3 | [] | no_license | -- contains the rolling cumulative volume for each stock
SELECT
symbol,
SUM(volume) OVER (
PARTITION BY symbol
ORDER BY open_day
) AS total_trades
FROM stocks | true |
1b3cc7342184f5d8ba6ce0b2d948e2dc5d898136 | SQL | mhbratek/SQL | /QueryingData.sql | UTF-8 | 534 | 3.5 | 4 | [] | no_license | select lastName, firstName, jobTitle from employees;
select * from employees;
select distinct * from employees;
select lastName from employees order by lastName;
select distinct lastName from employees order by lastName;
select distinct state, city from customers where state is not null order by state, city;
select ... | true |
28946fcaa9ba25fa3140df61347cac4e066d8079 | SQL | EmperorSARATH/market | /market_basket (3).sql | UTF-8 | 26,288 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 23, 2020 at 02:22 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
d23a3e80dbb3d4149d369ef0887d9853e4d06c9e | SQL | kin2pete/misc_useful_stuff | /ddl/tables/lb_att_chn.sql | UTF-8 | 1,195 | 3.359375 | 3 | [] | no_license | DROP TABLE IF EXISTS lb_att_chn CASCADE;
CREATE TABLE lb_att_chn
(
attribution_channel_id varchar(40) DEFAULT ''::character varying NOT NULL,
attribution_source varchar(255) NOT NULL,
attribution_medium varchar(255) NOT NULL,
attribution_campaign varchar(255) NOT NULL,
... | true |
937cbe425f982d1f01ae8f642d979c423f5c5745 | SQL | Rajagunasekaran/Code-Backup | /OLD PROJECT SQL/SP'S/USER/SP_LOGIN_CREATION_INSERT_VER_0.5_14052014.sql | UTF-8 | 4,995 | 3.609375 | 4 | [] | no_license | -- version 0.5 startdate:14/05/2014 --enddate:14/05/2014--- issueno 817 commentno:65-->desc: CHANGED THE SP FOR DYNAMIC PURPOSE BY RAJA
-- version 0.4 startdate:14/03/2014 --enddate:15/03/2014--- issueno 659 commentno:#76-->desc: DONE SOME CHANGES FOR LOGIN REJOIN DONE BY:DHIVYA
-- version 0.3 startdate:28/02/2014 --en... | true |
6b26e66a0e59e9f7a914804a15ce758874b070c6 | SQL | mikeburkat/laicos | /Data_Scripts/tables_and_data.sql | UTF-8 | 54,933 | 3.046875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- Adminer 4.1.0 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP DATABASE IF EXISTS `ebdb`;
CREATE DATABASE `ebdb` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `ebdb`;
DROP TABLE IF EXISTS `club`;
CREATE TABLE `club` (
`clubID` int(10) ... | true |
0ebb807485a922fbf60e3576cdb59a57533d4883 | SQL | chgl16/shopping-platform | /src/main/resources/sql/db_shopping_platform.sql | UTF-8 | 5,849 | 3.734375 | 4 | [] | no_license | DROP DATABASE IF EXISTS `db_shopping_platform`;
CREATE DATABASE `db_shopping_platform` DEFAULT CHARACTER SET utf8;
USE `db_shopping_platform`;
/* 1.创建用户信息表 */
CREATE TABLE `tb_user` (
`pk_id` INT UNSIGNED AUTO_INCREMENT COMMENT '用户id',
`uk_phone` VARCHAR(12) UNIQUE COMMENT '手机号',
`shadow` VARCHAR(40) COMMENT '密码md... | true |
12665a0031fdb9d6f156c3b8caa3c4d7a911eab3 | SQL | FanVane/DB4AI_POSTGRESQL_MADLIB_PLPY_C | /opengaussOPs.sql | GB18030 | 7,345 | 2.8125 | 3 | [] | no_license | ------------------------------------------------------------
------------------------------------------------------------
-- db4ai_abs(input_table_name TEXT, output_table_name TEXT)
-- input_table_name ľ
-- output_table_name ľ
-- ִ״̬
-- Ч ľÿԪضֵγ
------------------------------------------------------------
--[ͻ˽ӿ]--
CR... | true |
26c8aa617a05141da23251efa455444b35dd5382 | SQL | Ghagini/comp9311 | /comp9311/proj1/proj1.sql | UTF-8 | 1,391 | 2.859375 | 3 | [] | no_license | -- comp9311 19T3 Project 1
--
-- MyMyUNSW Solutions
-- Q1:
create or replace view Q1(unswid, longname)
as
--... SQL statements, possibly using other views/functions defined by you ...
;
-- Q2:
create or replace view Q2(unswid,name)
as
--... SQL statements, possibly using other views/functions defined by you ...
;
-... | true |
d023f2993ab2179ff35ec83ca34fc5dd23c9704b | SQL | lalonica/PublicTransportation | /GTFSTransitModel_model2.cql | UTF-8 | 5,939 | 3.953125 | 4 | [] | no_license | //************TimeTree************
//********************************
//CREATE HOURS
WITH range(0,23) as HOURS
FOREACH (hour in HOURS | CREATE (:Hour {id:hour}));
//CREATE minutes
MATCH (h:Hour) WITH range(0,59) as MINUTES, h
FOREACH (mm in MINUTES | CREATE (:Minute {id:mm})<-[:HAS]-(h));
//CREATE SECONDS
... | true |
d66c08b7d1a21a8a13e32e12ba7840cb9a44c6dd | SQL | andrewpblee/snowplow-dvd-rentals | /question-queries/question_one.sql | UTF-8 | 611 | 4.46875 | 4 | [] | no_license | with rentals_by_category as (
select
fc.film_id,
fc.category_id,
count(rental_id) as rentals
from rental as r
inner join inventory i
on r.inventory_id = i.inventory_id
inner join film_category as fc
on i.film_id = fc.film_id
where rental_date between '2005-01-01' and '2006-06-30'
group b... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.