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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f08299b83ce4a389daa2a269b1b2cb9fb3411258 | SQL | Math-Fatec/Exercicios6 | /Ex_SQL_Aula2.sql | ISO-8859-1 | 629 | 3.265625 | 3 | [] | no_license | CREATE DATABASE ExAula02
USE ExAula02
CREATE TABLE Produto(
Codigo INT PRIMARY KEY NOT NULL,
Descriao VARCHAR(50),
Fornecedor_prod FOREIGN KEY NOT NULL,
Preo DECIMAL(7,2)
)
CREATE TABLE Venda(
Codigo INT PRIMARY KEY NOT NULL,
Codigo_venda FOREIGN KEY NOT NULL,
Cliente_venda FOREIGN KEY NOT NULL,
Qtd I... | true |
07ab3197a84e5f85aa9a2b3bfcb5973836e29b40 | SQL | swayok/vk-test-task | /src/configs/sql/vktask2.db.structure.sql | UTF-8 | 1,786 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10.6
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1:3306
-- Время создания: Май 11 2015 г., 23:50
-- Версия сервера: 5.5.41-log
-- Версия PHP: 5.5.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- База данных: `vktask2`
--
CREATE DATABASE IF NOT EXIST... | true |
619fc210542d0d2e81becf126ecfcef02fb56f5a | SQL | fabricioifc/PROGII_ProjetoFinal | /ProjetoBanco/target/classes/util/dump.sql | UTF-8 | 686 | 3.625 | 4 | [] | no_license | create table produtos (
id bigserial not null primary key,
nome varchar(255) not null,
valor double precision not null
);
CREATE TABLE categorias (
id bigserial not null primary key,
nome varchar(45) not null,
ativo boolean default true
);
ALTER TABLE produtos
ADD column categoria_id bigint
ALTER TAB... | true |
bee23da1412c09ce38d4231f8282f839a98f3aaa | SQL | FirebirdSQL/x-cvs-vulcanj | /VulcanJ/ddl/nist/cdr001.sql | UTF-8 | 1,285 | 3.140625 | 3 | [] | no_license | SET NAMES ASCII;
CREATE DATABASE 'test.fdb' DEFAULT CHARACTER SET ISO8859_1;
CREATE TABLE STAFF4 (EMPNUM CHAR(3) NOT NULL, EMPNAME CHAR(20) DEFAULT NULL, GRADE DECIMAL(4) DEFAULT 0, CITY CHAR(15) DEFAULT ' ');
INSERT INTO STAFF4 (EMPNUM,GRADE) VALUES ('E1',40);
INSERT INTO STAFF4 (EMPNUM,EMPNAME) VALU... | true |
f4cda05a25724bc2c24e9a15e9f23a8508a6f654 | SQL | bcgov/mds | /migrations/sql/V2022.04.26.11.50__alter_project_summary_nulls.sql | UTF-8 | 341 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | -- The project summary factories have been updated in the code base to not include mine_guid anymore but the schema still has a NOT NULL FKEY.
-- We need to disable this and change the column to NULLABLE to move forward.
ALTER TABLE project_summary
ALTER COLUMN mine_guid DROP NOT NULL,
ALTER COLUMN project_summary... | true |
f481879dd8f8a0ad0a777fea2d58e309257b783f | SQL | jm355206/competitionTrackingApp | /sql.sql | UTF-8 | 1,765 | 3.421875 | 3 | [] | no_license | INSERT INTO competition
INSERT INTO competitor (user_name, first_name, last_name)
VALUES (?, ?, ?);
ALTER TABLE competitor
DROP COLUMN competitor_name;
ALTER TABLE competitor
DROP COLUMN username;
ALTER TABLE competitor
ADD COLUMN first_name varchar(20);
ALTER TABLE competitor
ADD COLUMN last_name varchar(20);
A... | true |
1e3e72b6b1418a59fb2cd7582aca31d58205ed61 | SQL | thuc97/Rocket17 | /MySQL/SQL lession3/Testing system3.sql | UTF-8 | 2,579 | 4.125 | 4 | [] | no_license | USE Testing_System_Assignment ;
------------ Question 2: lấy ra tất cả các phòng ban
SELECT DepartmentName
FROM Department;
----------- Question 3: lấy ra id của phòng ban "Sale"
SELECT DepartmentID ,DepartmentName
FROM Department
WHERE DepartmentName='sale' ;
---------- Question 4: lấy ra thông tin account có... | true |
71e706cf9015306d96b1b6a5027276007e9ff6b8 | SQL | lukakan/home-budget | /src/main/resources/Transactions.sql | UTF-8 | 770 | 3.53125 | 4 | [] | no_license | CREATE DATABASE home_budget CHAR SET = 'utf8mb4' COLLATE ='utf8mb4_polish_ci';
USE home_budget;
CREATE TABLE home_budget.transaction(
id BIGINT NOT NULL AUTO_INCREMENT,
type ENUM('INCOME','EXPENSE') DEFAULT 'INCOME' NOT NULL,
description VARCHAR(1000) NOT NULL,
amount DECIMAL(10,2) NOT NULL,
transaction_date DATE,
PR... | true |
3c0044497bd5ed59041bf0d2cdccc6766d4c623d | SQL | dKluev/Site | /MigrationUtils/Scripts/exportNews.sql | UTF-8 | 750 | 3.109375 | 3 | [] | no_license | --use Specialist
--
--
--
--set identity_insert SpecialistWeb..news on
--
--insert into SpecialistWeb..News (newsid,
-- Title,
-- Description,
-- ShortDescription,
-- PublishDate,
-- [Type],
-- IsActive
--)
--select newsid,
-- Header,
-- convert(varchar(5000), News),
-- convert(varchar(2000), isnull(shortnews, news)),... | true |
7a63ef626236b8976b6f19869c9ba4ab02982884 | SQL | Lintu91/Tsoha-Bootstrap | /sql/create_tables.sql | UTF-8 | 589 | 3.328125 | 3 | [] | no_license | -- Lisää CREATE TABLE lauseet tähän tiedostoon
CREATE TABLE Pokemontype(
id SERIAL PRIMARY KEY, -- SERIAL tyyppinen pääavain pitää huolen, että tauluun lisätyllä rivillä on aina uniikki pääavain. Kätevää!
name varchar(50) NOT NULL -- Muista erottaa sarakkeiden määrittelyt pilkulla!
);
CREATE TABLE Pokemon(
id SE... | true |
3dca976a80a79ebf7fa3b557627f2c95d0a1904b | SQL | Prabhat1811/Bank-Management-System | /database queries/account.sql | UTF-8 | 543 | 2.75 | 3 | [] | no_license | CREATE TABLE `bms`.`account`(
`accno` INT AUTO_INCREMENT,
`accamt` FLOAT DEFAULT 0,
`acctype` VARCHAR(10),
`status` VARCHAR(10) DEFAULT 'active',
`password` VARCHAR(50),
`custid` INT UNIQUE,
PRIMARY KEY (`accno`),
FOREIGN KEY (`custid`) REFERENCES `bms`.`customer`(`custid`)
);
INSE... | true |
f18565c38afbe6a69eefd2546e4db7492230a42b | SQL | cbazalar/PROYECTOS_PROPIOS | /nssicc/database/ssicc_pe_es/procedures/imp_pr_proce_nota_credi.prc | UTF-8 | 1,410 | 2.90625 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE "IMP_PR_PROCE_NOTA_CREDI"
(p_fechaInicio VARCHAR2, p_fechaFin VARCHAR2, p_num_docu_inic NUMBER, p_num_docu_fina NUMBER, p_codigoTipoDocumento VARCHAR2, p_nombreArchivo IN VARCHAR2, p_directorio IN VARCHAR2) AS
BEGIN
-- Truncamos las tablas que contienen la infomacion
EXECUTE IMMEDIATE 'T... | true |
ec8e42c1da5f1e858373a06e170ea037f9cfd088 | SQL | kuakling/react-fullstack | /reactql_db.sql | UTF-8 | 17,084 | 2.703125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 21, 2017 at 10:24 AM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
b332079594975ef26c4738f8798c14f3e0268890 | SQL | ccjensen931/CJcs313 | /db/teamActivity07/teamActivity07.sql | UTF-8 | 396 | 3.140625 | 3 | [] | no_license | CREATE TABLE team07_users
(
user_id INTEGER,
username VARCHAR(50) CONSTRAINT nn_users_1 NOT NULL,
user_password VARCHAR(255) CONSTRAINT nn_users_2 NOT NULL,
CONSTRAINT pk_team07_users PRIMARY KEY(user_id)
);
CREATE SEQUENCE team07_user... | true |
d152b2bf5d278bcffc7488023eca5e2d66705808 | SQL | Sachin9549/City-Bus-Management-System--DBMS | /DDL.sql | UTF-8 | 2,227 | 3.53125 | 4 | [
"MIT"
] | permissive | create table customer
(name varchar(100),
NIC varchar(10),
address varchar(200),
occupation varchar(20),
email varchar(100),
username varchar(32), // md5 hashed
password varchar(32),
primary key (username), // md5 hashed
);
... | true |
667beacfc9569b4979572b65445e2375dd915e29 | SQL | medy13/dbshell | /normal_shell/EMS_CLR_TMP.sql | UTF-8 | 685 | 2.734375 | 3 | [] | no_license | \echo ------------------EMS_CLR_TMP----------------
select now();
\timing
insert into EMS_CLR_TMP_GPTMP (CMD_TYPE,EMS_NO, G_TYPE, G_NO) select CMD_TYPE,EMS_NO, G_TYPE, G_NO from EMS_CLR_TMP_INC_EXT;
delete from EMS_CLR_TMP using EMS_CLR_TMP_GPTMP where EMS_CLR_TMP_GPTMP.EMS_NO=EMS_CLR_TMP.EMS_NO AND EMS_CLR_TMP_GPTMP.... | true |
23d7274cb1bd80f986876290df7688046d27913c | SQL | wen1now/iptmp2 | /scripts.sql | UTF-8 | 2,420 | 3.359375 | 3 | [] | no_license | --i hope this works
create database CriticalMiss;
create table Users (
userid integer unsigned auto_increment not null,
hash varchar(255) not null,
username varchar(31) not null,
pointer varchar(6) not null,
picture varchar(255) not null,
primary key(userid)
);
create table Rooms (
roomid integer unsigned auto... | true |
f14304c4bd482429a68950cc4b56e87bf2a67121 | SQL | kh918/dynaop | /dynaop/src/main/resources/sql/dynaop.sql | UTF-8 | 23,569 | 2.9375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50519
Source Host : localhost:3306
Source Database : taskrole
Target Server Type : MYSQL
Target Server Version : 50519
File Encoding : 65001
Date: 2014-04-01 13:20:31
*/
SET FOREIGN_KEY_CHECKS=0;
-- ... | true |
972297c15a59832cb1cacee7c6198c2c97c0c1f1 | SQL | greenplum-db/gpdb | /src/test/modules/test_ddl_deparse/sql/opfamily.sql | UTF-8 | 1,695 | 3.46875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"PostgreSQL",
"OpenSSL",
"LicenseRef-scancode-stream-benchmark",
"ISC",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-ssleay-windows",
"BSD-2-Clause",
"Python-2.0"
] | permissive | -- copied from equivclass.sql
create type int8alias1;
create function int8alias1in(cstring) returns int8alias1
strict immutable language internal as 'int8in';
create function int8alias1out(int8alias1) returns cstring
strict immutable language internal as 'int8out';
create type int8alias1 (
input = int8alias1in,... | true |
bc0785569c7c07c2c412314cb66d432779d57448 | SQL | CUBRID/cubrid-testcases | /sql/_19_apricot/_04_multi-table_update/cases/inheritance_02.sql | UTF-8 | 938 | 3.140625 | 3 | [
"BSD-3-Clause"
] | permissive | --CLIENT
create class t_tr(i int);
create class t(i int);
create trigger tr before delete on t execute insert into t_tr values(obj.i);
insert into t values (1), (2), (3), (4), (5);
create class t1 under t (j int);
insert into t1 values (4, 4), (5,5), (6, 6), (7, 7), (8, 8);
create class t11 under t1 (k int);
insert ... | true |
2e8f299fad9d62eaddc84eaf28d8d83fcd920a62 | SQL | darkfiremoon/Database-Assignment | /P_REPORT/P_CURR_REPORT.sql | UTF-8 | 360 | 3.40625 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE P_CURR_REPORT (
CUR_REPORT OUT SYS_REFCURSOR
)
IS
FIRST_DATE DATE;
BEGIN
FIRST_DATE := TRUNC(SYSDATE, 'MONTH');
OPEN CUR_REPORT FOR
SELECT
VW.EMP_CD,
VW.EMP_NAME,
SUM(VW.TOTAL_PAYMENT) AS TOTAL_PROFIT
FROM VW_SALES VW
WHERE VW.DATE_COMMENCE BETWEEN FIRST_DATE AND SYSDATE
GROUP BY VW.EMP_C... | true |
86f78396d37f40bf2e90ee17b2cf8bfeaefac399 | SQL | Priyanshi200014/To-Do-Management-System | /todo-list/sql_scripts/create_tables.sql | UTF-8 | 1,024 | 3.5 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS `todo_management_directory`;
USE `todo_management_directory`;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(45) DEFAULT NULL,
`password` varchar(45) DEFAULT NULL,
PRIMARY ... | true |
87d0703dc4439c8ac9f518cdeee1eceddcbeaa58 | SQL | lulzzz/tellma | /Tellma.Database.Application/dal/Functions/dal.fn_Center__Node.sql | UTF-8 | 166 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | CREATE FUNCTION [dal].[fn_Center__Node] (
@CenterId INT
)
RETURNS HIERARCHYID
AS
BEGIN
RETURN (
SELECT [Node] FROM dbo.Centers
WHERE [Id] = @CenterId
)
END; | true |
e0c832856e446d5a739394572aac2126dd31bc15 | SQL | durabilliam/BootcampX | /4_queries/2_total_assistance_request_for_student.sql | UTF-8 | 449 | 4.15625 | 4 | [] | no_license | SELECT COUNT(assistance_requests.id) AS total_assistances,
students.name AS name
FROM assistance_requests
JOIN students ON students.id = student_id
WHERE students.name LIKE 'Elliot Dickinson'
GROUP BY students.name;
-- Get the total number of assistance_requests for a student.
-- Select the student's name and... | true |
504eb9c3f9f6316a0dc1f041f799b8a602e64c30 | SQL | Cado21/simple-springboot | /src/main/resources/db/migration/V1_0_0__init.sql | UTF-8 | 1,934 | 3.3125 | 3 | [] | no_license | create table if not exists item_table
(
id bigserial not null
constraint item_table_pkey
primary key,
created_at timestamp,
updated_at timestamp,
description varchar(255) not null,
name varchar(255) not null,
quantity integer not null,
thumbnail varchar(255) not null
);
... | true |
b715525a9faf9cb61355ea744c6c2f3787536797 | SQL | yvathrey/dbt-spark | /dbt/include/spark/macros/materializations/incremental/incremental.sql | UTF-8 | 1,959 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | {% materialization incremental, adapter='spark' -%}
{#-- Validate early so we don't run SQL if the file_format + strategy combo is invalid --#}
{%- set raw_file_format = config.get('file_format', default='parquet') -%}
{%- set raw_strategy = config.get('incremental_strategy', default='append') -%}
{%- set... | true |
d039f9495739fd92245bc934a54ae57bc2ffd60f | SQL | NathanNeff/hadoop-examples | /hbase/null_safe_joins/create_and_query.sql | UTF-8 | 2,163 | 3.828125 | 4 | [] | no_license | -- HBase table and data inserts
-- create 'hbase_a', 'cf1'
-- create 'hbase_b', 'cf1'
-- put 'hbase_a', '1', 'cf1:record_id', '1'
-- put 'hbase_a', '1', 'cf1:record_name', 'bob'
-- put 'hbase_b', '1', 'cf1:record_id', '1'
-- put 'hbase_b', '1', 'cf1:record_name', 'B robert'
-- # record_id for bob in both tables where ... | true |
c9d328bf28edba2867462fed2545724e88dd87c4 | SQL | WillianSi/projetoFinal | /bancoSupermercado/banco_supermercado_cliente.sql | UTF-8 | 2,549 | 2.921875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: banco_supermercado
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESU... | true |
bf44b00e098e45609dafbbb94ffc181149fc39b8 | SQL | bbenarbia/tassyir-new | /src/main/resources/db/mysql/initDB.sql | UTF-8 | 4,306 | 4 | 4 | [] | no_license | drop database IF EXISTS petclinic;
CREATE DATABASE IF NOT EXISTS petclinic;
GRANT ALL PRIVILEGES ON petclinic.* TO pc@localhost IDENTIFIED BY 'pc';
USE petclinic;
CREATE TABLE IF NOT EXISTS vets (
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHAR(30),
INDEX(las... | true |
36927081e0b2bc5fb4f8d45e06393f1d0b58bd32 | SQL | Reynald0/Real | /sql/catalogo_estado_solicitud.sql | UTF-8 | 963 | 2.75 | 3 | [] | no_license | /*
Navicat SQLite Data Transfer
Source Server : REAL
Source Server Version : 30714
Source Host : :0
Target Server Type : SQLite
Target Server Version : 30714
File Encoding : 65001
Date: 2017-05-17 10:15:09
*/
PRAGMA foreign_keys = OFF;
-- ----------------------------
-- Table structure... | true |
b7c87bf693888f4c71c867fd6f1279b4d8c05df9 | SQL | kkkterry/kkkterry | /mynote/02_DBMS/DBMS_src/05_SUBQUERY.sql | UHC | 11,263 | 4.53125 | 5 | [] | no_license | --
--1. ̺ Ի ̸, , Ի
SELECT ENAME, SAL, HIREDATE FROM EMP
WHERE HIREDATE=(SELECT MIN(HIREDATE) FROM EMP);
-- 2. ȸ翡 ̸,
SELECT ENAME, SAL FROM EMP
WHERE SAL=(SELECT MIN(SAL) FROM EMP);
-- 3. ȸ պ ̸, , μڵ
SELECT ENAME, SAL, DEPTNO FROM EMP
WHERE SAL>(SELECT AVG(SAL) FROM EMP);
--4. ȸ ... | true |
c3f36cca34e86e05c5aeea1707d255d5ff0976d5 | SQL | ashroberts121/majorprojectapp | /majorprojectapp.sql | UTF-8 | 14,782 | 3.421875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Aug 02, 2019 at 08:40 AM
-- Server version: 5.7.22
-- PHP Version: 7.1.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
ef54c7ddd94e9356899beb636bf4f797c93f65bb | SQL | atymkiv/DB | /lab5/selects.sql | UTF-8 | 1,747 | 3.828125 | 4 | [] | no_license | CREATE TABLE real_estate.user1 AS SELECT userID, login, created
FROM user WHERE created < '2019-03-15';
CREATE TABLE real_estate.user2 AS SELECT userID, login, created
FROM user WHERE created < '2019-05-03';
#Union
SELECT * FROM user1
UNION SELECT * FROM user2;
#Перетин user1 i user2
SELECT * FROM user1
WHERE us... | true |
ba5f9b4c9b33ba5c7aa84b55cbc38f35566b72a6 | SQL | herbion/immunology | /db/evolutions/13.sql | UTF-8 | 496 | 2.625 | 3 | [] | no_license | # --- !Ups
--Added one more analysis norm
--
-- Data for analysis_norm table
--
INSERT INTO analysis_norm(analysis_norm_id, description, update_date, analysis_analysis_id, value)
VALUES (26, 'Норма', '2012-10-23 00:00:00', 7, 0);
--
-- Data for sequence analysis_sequence
--
SELECT setval('analysis_n... | true |
00f3ce652a5f1215b12a1a383573e28534aeb308 | SQL | vectormars/Hackerrank | /SQL/Advanced Select/New Companies.sql | UTF-8 | 325 | 3.703125 | 4 | [] | no_license | SELECT c.Company_Code, c.founder, count(Distinct e.Lead_Manager_Code),
count(distinct e.Senior_Manager_Code), count(distinct e.Manager_Code),
count(distinct e.employee_Code)
FROM Company c JOIN Employee e
ON c.Company_Code = e.Company_Code
GROUP BY c.Company_Code, c.Founder
ORDER BY c.Company_... | true |
b7742d332c80bc5b6d7bc47fc90cd726f06643ff | SQL | broesler/endgame-research | /data/last_funding_round.sql | UTF-8 | 330 | 3.890625 | 4 | [] | no_license | SELECT o.id,
o.name,
o.last_funding_at,
f.funding_round_code,
f.funded_at,
f.raised_amount_usd
FROM cb_objects AS o
JOIN cb_funding_rounds AS f
ON o.id = f.object_id
-- WHERE f.raised_amount_usd IS NOT NULL
WHERE o.founded_at IS NOT NULL
AND o.last_funding_at = f.funded_at... | true |
869412bd9c4d295b2b91e0e95c90862873fde3f6 | SQL | jaw0/talmud | /sql/ipdb-dm.sql | UTF-8 | 2,309 | 3.65625 | 4 | [] | no_license | -- Copyright (c) 2003 by Jeff Weisberg
-- Author: Jeff Weisberg <jaw @ tcp4me.com>
-- Date: 2003-Oct-15 15:08 (EDT)
-- Function: ip address block allocation tracking
--
-- $Id: ipdb-dm.sql,v 1.8 2010/01/16 05:35:16 jaw Exp $
create table mi_ipdb_config (
param varchar(32) primary key,
descr varchar(... | true |
485b47e09f9a84529e572193d784d098a4d02203 | SQL | eanieto/SeguridadMining | /modelo_dimensional.sql | UTF-8 | 1,451 | 3.3125 | 3 | [] | no_license | create table bodega.DIM_DIVIPOLA_T1
(
SK_DIVIPOLA serial not null
constraint dim_divipola_t1_pk
primary key,
VAR_NOMBRE_PAIS varchar(50) not null,
VAR_NOMBRE_DEPARTAMENTO varchar(50),
VAR_NOMBRE_MUNICIPIO varchar(50)
);
create table bodega.DIM_TIEMPO_T1
(
SK_TIEMPO integer not null
constraint dim_tiempo_pk
... | true |
a37e18c73a4ac1e343328ffdce06f14d2b779eb6 | SQL | gayendeye/Application-Web-gestion-projet | /gestiondeprojet_collaborateur.sql | UTF-8 | 2,622 | 3 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: gestiondeprojet
-- ------------------------------------------------------
-- Server version 5.7.14
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS... | true |
99acbdd5cfa411c87560988131ba587f4209382d | SQL | balena/sqlp | /tests/v6_pc_isql/xts736.sql | UTF-8 | 2,357 | 3.390625 | 3 | [
"BSD-3-Clause"
] | permissive | -- MODULE XTS736
-- SQL Test Suite, V6.0, Interactive SQL, xts736.sql
-- 59-byte ID
-- TEd Version #
-- AUTHORIZATION CTS1
SELECT USER FROM HU.ECCO;
-- RERUN if USER value does not match preceding AUTHORIZATION comment
ROLLBACK WORK;
-- date_time print
-- TEST:7036 Update NCHAR Varying column... | true |
671d1c243ec03940a9f111bf06b248036f967d03 | SQL | matheuslbarros/projeto-java-turma-2014 | /Script.sql | UTF-8 | 4,522 | 3.5 | 4 | [] | no_license | --<ScriptOptions statementTerminator=";"/>
CREATE TABLE ITEM_RESOURCE (
ITEM_RESOURCE_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
RESOURCE_NAME VARCHAR(100) NOT NULL,
ITEM_ID INTEGER NOT NULL,
EXTENSION VARCHAR(10) NOT NULL,
CONTENT_TYPE VARCHAR(30) NOT NULL,
RES_PATH V... | true |
48c9fd42ee876d963ebfd4ca8b2b3835107bbc6a | SQL | SinfulPhantom/Nanavut_Site | /create_db.sql | UTF-8 | 1,784 | 3.3125 | 3 | [] | no_license | drop table Orders;
drop table Product;
drop table Customer;
drop table Registration;
CREATE TABLE Customer (
cc_no numeric(16),
exp_mo numeric(2) NOT NULL,
exp_yr numeric(4) NOT NULL,
name_first varchar(20) NOT NULL,
name_last varchar(20) NOT NULL,
email varchar(20) NOT NULL,
address1 varchar(50) NOT NULL,
add... | true |
d7263ef0beb3f2a86ca46d61ca2a95c74b63bb3f | SQL | ZFGCCP/ZFGC3 | /src/main/database/tables/SYSTEM_DIRECTORIES.sql | UTF-8 | 1,214 | 2.703125 | 3 | [
"MIT"
] | permissive | -- --------------------------------------------------------
-- Host: zfgc.com
-- Server version: 5.5.61-0ubuntu0.14.04.1 - (Ubuntu)
-- Server OS: debian-linux-gnu
-- HeidiSQL Version: 9.3.0.4984
-- -----------------------------------------------------... | true |
3c932358779c61f6941db8badf41ebee97dff57a | SQL | omegazip/dba_scripts | /custom/Script_OracleBase/External Scripts/PerfSheet4_v3.5/sqlplus_scripts/Perfsheet4_query_AWR_ioevent_histogram.sql | UTF-8 | 2,319 | 3.8125 | 4 | [] | no_license | --
-- Perfsheet4 query to extract AWR data
-- Perfsheet4_query_AWR_ioevent_histogram.sql -> Extracts data from dba_hist_event_histogram for io related events, computes delta values between snapshots and rates (i.e. delta values divided over delta time)
-- output is in csv format
-- Luca Canali, Oct 2012
--
-- Usage:... | true |
674f20c5f969d2cfa4c957407da17f02bc194d27 | SQL | vykanton/songscape | /extract_rfpt.sql | UTF-8 | 2,005 | 4.0625 | 4 | [] | no_license | DROP table if exists rftp_scores;
CREATE temporary table rftp_scores AS
select
s.id,
a.analysis_id,
selection_method,
date_part('year', r.datetime) as year,
date_part('month', r.datetime) as month,
date_part('day', r.datetime) as day,
site.code as site,
recorder.code as recorder, ... | true |
29ebe92ec8cad97fe040747a458a3a5e31b56bf6 | SQL | ksacha23/Skylightv2.0 | /minecraftComments.sql | UTF-8 | 1,695 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 30, 2021 at 04:50 PM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
7b7d61b8d2cf4eefd8a98ad623f145885ee95edf | SQL | StanislavRybonka/Guest-Book | /db/guest_book_info.sql | UTF-8 | 3,695 | 2.640625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 02, 2016 at 10:12 PM
-- Server version: 5.5.49-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... | true |
e66f004198e35c7201f68817db934810d88fb2f9 | SQL | Jell/advent2020 | /in_postgres/day_09_part_1.sql | UTF-8 | 1,246 | 4.03125 | 4 | [] | no_license | DROP SCHEMA IF EXISTS day09 CASCADE;
CREATE SCHEMA IF NOT EXISTS day09;
CREATE UNLOGGED TABLE day09.inputs (
line_number bigint NOT NULL GENERATED ALWAYS AS IDENTITY,
line_value bigint NOT NULL
);
\COPY day09.inputs (line_value) FROM PROGRAM 'cat ../inputs/day09.txt';
VACUUM ANALYZE day09.inputs;
\timing on
wi... | true |
8b8a0f850bb51a936c035445bc40fc50de12e7c0 | SQL | jghernandez35/WebAdminVirtualBox | /BD Diseño/crebasMySqlWebVirtualBox01.sql | UTF-8 | 1,530 | 3.375 | 3 | [] | no_license | /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 24/10/2017 12:51:48 p. m. */
/*==============================================================*/
drop table if exists MAQUINA_VIRTUAL;
drop table ... | true |
f884b0ed57ba1b1a7aa714bd66906612ccd69273 | SQL | ankur04/QuizApp | /src/resources/scripts/init.sql | UTF-8 | 3,819 | 3.34375 | 3 | [] | no_license | DROP TABLE quiz_users PURGE;
CREATE TABLE quiz_users (
email_id VARCHAR2(50) PRIMARY KEY,
password VARCHAR2(500) NOT NULL,
username VARCHAR2(20) NOT NULL UNIQUE,
phone_number VARCHAR2(20) NOT NULL,
gender VARCHAR2(25),
date_of_birth DATE,
last_logged... | true |
2ee2f79ae3c0853658f953614265623c2de7bc76 | SQL | Venkateshan-Fullstackdeveloper/SQL-Basics | /01basics/datetime.sql | UTF-8 | 580 | 3.296875 | 3 | [] | no_license | -- TODO: CREATE DATE TIME TABLE
-- CREATE TABLE user(
-- name VARCHAR(10),
-- col1 DATE,
-- col2 TIME,
-- col3 DATETIME
-- );
-- desc user;
-- INSERT INTO user VALUES('Venky','2020-08-14','10:14:22','2021-08-18 11:08:33');
-- INSERT INTO user VALUES('Thor','2020-08-14','10:14:22',NOW());
-... | true |
7668467d958bb54f9396dddadbbfbb615461978c | SQL | paul-rogers/drill-test-framework | /framework/resources/Advanced/tpcds/tpcds_sf1/original/not_supported/query23.sql | UTF-8 | 2,550 | 3.953125 | 4 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- start query 23 in stream 0 using template query23.tpl
WITH frequent_ss_items
AS (SELECT Substr(i_item_desc, 1, 30) itemdesc,
i_item_sk item_sk,
d_date solddate,
Count(*) cnt
FROM store_sales, ... | true |
eb0bb82fc80898b58fad910e55cd830aec3d2147 | SQL | murshidazher/foysonis-abc | /server/postgres/tables/bank_account.sql | UTF-8 | 225 | 2.828125 | 3 | [
"MIT"
] | permissive | BEGIN TRANSACTION;
CREATE TABLE bank_account
(
id serial PRIMARY KEY,
balance DECIMAL DEFAULT 0,
opened TIMESTAMP NOT NULL DEFAULT NOW(),
user_id INTEGER NOT NULL,
last_transaction_id INTEGER
);
COMMIT; | true |
03264c261a8b9519b62c9c62e5566500f61eda79 | SQL | Civerneitor/UD22 | /ej3.sql | UTF-8 | 618 | 3.453125 | 3 | [] | no_license | create database Laboratorio;
use Laboratorio;
drop table if exists Cientificos;
create table Cientificos (
DNI varchar(9) NOT NULL,
nomApels varchar(255),
PRIMARY KEY (DNI)
);
drop table if exists Proyectos;
create table Proyectos (
id char(4) NOT NULL,
nombre varchar(255),
horas int,
PRIMARY KEY (id)
);
drop table i... | true |
9eae32b3a0c01059669282fe45724714cc2a4349 | SQL | andresapodaca/ejemplo2 | /productos.sql | UTF-8 | 5,271 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 07-10-2015 a las 23:01:21
-- Versión del servidor: 5.6.17
-- Versión de PHP: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA... | true |
75d8ab8c95dc774ff6058996507587aab758213a | SQL | zz0733/op-gbsql | /history/v2015/companies/V1.0.1.0570__I_sys_dict.sql | UTF-8 | 2,079 | 2.6875 | 3 | [] | no_license | -- auto gen by linsen 2018-03-12 09:16:37
-- BC转账类型 by zain
INSERT INTO sys_dict (module, dict_type, dict_code, order_num, remark, parent_code, active)
SELECT 'api', 'transaction_type', 'BETPLACED', '1', '下注', NULL, 't'
WHERE NOT EXISTS (SELECT id FROM sys_dict WHERE module='api' and dict_type='transaction_type' a... | true |
1772dd0c607c751f1a08ee8fe39d8d877a7c1929 | SQL | douxiaotian/cpic-data | /src/main/resources/db/migration/V36__update_allele_view.sql | UTF-8 | 950 | 4.125 | 4 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | -- This view is being created mainly for use on the CPIC website. It is meant to show a list of alleles with
-- clinical functional status assigned and that are associated, through a gene, with a guideline.
create view allele_guideline as
select
a.genesymbol,
a.name as allelename,
(
select jsonb_ag... | true |
4e98dfbf1f14f599697cc8f7d2de45a7ae1b4aa9 | SQL | mimogollon1/Tranmiweb | /transmiweb.sql | UTF-8 | 7,442 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 01-10-2017 a las 19:00:51
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLI... | true |
a112f3982d7e4cc43c545dd756b06aeff5cebcd4 | SQL | chris-ramon/CS2 | /Parcial/EP-CS2/CS2-B207/C1B207-14/C1B207_CUE013671/databaseimpuestos.sql | WINDOWS-1250 | 1,205 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generacin: 06-10-2011 a las 13:48:31
-- Versin del servidor: 5.1.37
-- Versin de PHP: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Base de datos: `impuestos`
--
CREATE DATABASE `impuestos` DEFAULT CHARAC... | true |
8871f9b414f95bcf287288fb55c78d470633881d | SQL | omar0928/sistemaElectoral | /elecciones.sql | UTF-8 | 5,936 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 29, 2021 at 05:02 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
3bde050535578ba098ff960d871f1c680c651d33 | SQL | xRockBoyx/PersonalProject | /Untitled.sql | UTF-8 | 6,911 | 3.03125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.12, for macos10.13 (x86_64)
--
-- Host: 127.0.0.1 Database: firstproject
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... | true |
09c9e08b82abb82849a4ec3f799c7af489f75b16 | SQL | kozakjefferson/bigquery-etl | /bigquery_etl/glam/templates/clients_histogram_aggregates_v1.udf.sql | UTF-8 | 734 | 2.796875 | 3 | [] | no_license | {# Accepts: metric_attributes #}
CREATE TEMP FUNCTION udf_merged_user_data(aggs ANY TYPE)
RETURNS ARRAY<
STRUCT<
latest_version INT64,
metric STRING,
metric_type STRING,
key STRING,
agg_type STRING,
value ARRAY<STRUCT<key STRING, value INT64>>
>
> AS (
(
WITH unnested AS (
SELECT... | true |
abcb4a09bfdc37c515ff0a23063b3fb97d6d3ba7 | SQL | faierbol/syncano-platform | /apps/data/sql/class.sql | UTF-8 | 302 | 2.703125 | 3 | [] | no_license | CREATE INDEX class_name_like ON data_klass
USING BTREE (name varchar_pattern_ops);
CREATE INDEX klass_acl_users ON data_klass
USING GIN (_users);
CREATE INDEX klass_acl_groups ON data_klass
USING GIN (_groups);
CREATE INDEX klass_acl_public ON data_klass
USING BTREE (_public) WHERE _public = true;
| true |
c82f2ffa31200671381f2fafd13714459875652c | SQL | hoangphand/dana-weed-stocks | /alter_db.sql | UTF-8 | 2,444 | 3.78125 | 4 | [] | no_license | CREATE TABLE symbol_prices.`Earliest_latest` (
`earliest_5start` int(11) DEFAULT NULL,
`latest_5start` int(11) DEFAULT NULL,
`latest_5start_as_string` datetime DEFAULT NULL,
`earliest_5start_as_string` datetime DEFAULT NULL
);
CREATE TABLE symbol_prices.`Five_mins` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`... | true |
7202165f9b82287073923025b9b55e54abe6c1c9 | SQL | zoomczc/MySQL | /exercise/exer2.sql | UTF-8 | 1,606 | 4.65625 | 5 | [] | no_license | -- 查询和zlotkey相同部门id的员工姓名和工资
SELECT last_name, salary
FROM employees
WHERE department_id = (
SELECT department_id
FROM employees
WHERE last_name = 'zlotkey'
);
-- 查询工资比平均工资高的员工的员工号,姓名和工资
SELECT last_name, employee_id, salary
FROM employees
WHERE salary > (
SELECT avg(salary)
FROM employees
);
-- 查询... | true |
69848ba497c75de72a838d4923fd0f139dd09f0a | SQL | Sunn-git/practice | /CodeSignal/src/Arcade_Databases_MySQL/D_10_mischievousNephews.sql | UTF-8 | 1,134 | 4.3125 | 4 | [] | no_license | /*
날짜, 이름, 제목이 MISCHIEF 테이블에 주어진다.
요일(월요일 0 부터 일요일 6 까지), 날짜, 이름, 제목을 출력하되
이름 (Huey, Dewey, Louie 순), 날짜, 제목 사전순으로 정렬하기.
*/
SELECT WEEKDAY(MISCHIEF_DATE) AS WEEKDAY, MISCHIEF_DATE, AUTHOR, TITLE
FROM MISCHIEF
ORDER BY WEEKDAY, FIELD(AUTHOR, 'Huey', 'Dewey', 'Louie'), MISCHIEF_DATE, TITLE;
-- =======================... | true |
0d1bb49659a51d13e47882e032fdacf7ec919e6d | SQL | plamen911/softuni-db-fundamentals | /DatabasesBasics/_02DataDefinitionAndDataTypesLab/_02CreateTables.sql | UTF-8 | 393 | 2.6875 | 3 | [] | no_license | create table if not exists categories
(
id int auto_increment
primary key,
name varchar(50) not null
)
;
create table if not exists employees
(
id int auto_increment
primary key,
first_name varchar(50) null,
last_name varchar(50) null
)
;
create table if not exists products
(
id int auto_increment... | true |
6d4530356e4cf35df0da0ee3ae3994237ce3335f | SQL | ChrisMusson/Problem-Solving | /HackerRank/SQL/0-Easy/37-african-cities.sql | UTF-8 | 194 | 3.84375 | 4 | [] | no_license | -- https://www.hackerrank.com/challenges/african-cities/problem
SELECT
city.name
FROM
city
LEFT JOIN country ON country.code = city.countrycode
WHERE
country.continent = 'Africa' | true |
b90ad6115941c3368d80fe4ffac3c08475cd298a | SQL | KEY60228/tatsujin_sql | /3-2.sql | UTF-8 | 576 | 4.03125 | 4 | [] | no_license | -- 問題
-- 3-2に同じ
-- 回答
WITH selected AS (
SELECT *, RANK() OVER (ORDER BY price DESC) AS rank
)
DELETE FROM Products P1
WHERE P1.name = P2.name AND P1.price = P2.price AND
-- ... give up
-- 解答
CREATE TABLE Products_NoRedundant AS
SELECT ROW_NUMBER() OVER(PARTITION BY name, price ORDER BY name) AS row_num, nam... | true |
04bf06b71ff640f2c29a81913779fcdc43c761a6 | SQL | altamira/visualstudio | /Sistema de Informação Altamira/EGISSQL.Database/dbo/Stored Procedures/Procs2/pr_manutencao_nota_entrada.sql | UTF-8 | 3,632 | 2.953125 | 3 | [] | no_license |
CREATE PROCEDURE pr_manutencao_nota_entrada
@dt_inicial datetime,
@dt_final datetime
as
SELECT
ne.cd_nota_entrada,
ne.dt_receb_nota_entrada,
f.nm_fantasia_fornecedor,
ne.cd_rem,
dp.nm_destinacao_produto,
opf.cd_mascara_operacao,
ner.cd_tributacao,
opf.cd_lancamento_padrao,
ne.vl_total_nota_entra... | true |
1ef8d6cde88ddf6d8d7f3762717147f7c2de5034 | SQL | saurabhdjha/Spring-Boot-Web-App-With-Thymeleaf | /SpringBootThymleafCRUD/src/main/resources/transcript.sql | UTF-8 | 848 | 2.65625 | 3 | [] | no_license | drop database if exists demospringthymleaf;
create database demospringthymleaf;
use demospringthymleaf;
create table employee(
employee_id int AUTO_INCREMENT PRIMARY KEY,
first_name varchar(20),
last_name varchar(20),
email varchar(30)
);
insert into employee(employee_id,first_name,last_name,email) values (1,'Sa... | true |
441b4aa528d34345d4dd8a08859bda4efa72f780 | SQL | ariel68/aplicacao_ADS102 | /geral/bd_uniasselvi.sql | UTF-8 | 7,038 | 2.96875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: 13-Jan-2020 às 03:18
-- Versão do servidor: 5.7.23
-- versão do PHP: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... | true |
47875885b1c45b4e25e862b0dab0b9057c557d0f | SQL | mrisyad15/project_test | /db_project_test.sql | UTF-8 | 1,697 | 2.96875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 27, 2020 at 05:45 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
07976a14f953a557cd79b4ae3998abf507160f26 | SQL | nessieee/SQL-----advanced-sql-mysql-for-analytics-business-intelligence | /Final project_ex4.sql | UTF-8 | 1,577 | 3.984375 | 4 | [] | no_license | USE mavenfuzzyfactory;
SELECT
Year(website_sessions.created_at) AS year,
quarter(website_sessions.created_at) AS quarter,
COUNT(DISTINCT CASE WHEN utm_source = 'gsearch' AND utm_campaign = 'nonbrand' THEN orders.order_id ELSE NULL END)
/ COUNT(DISTINCT CASE WHEN utm_source = 'gsearch' AND utm_campaign = 'nonbran... | true |
e1cf55273dd125b7c0a7877620427e02d455dca6 | SQL | Ana-Camelia/Librarie | /librarie.sql | UTF-8 | 21,655 | 2.640625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 15, 2020 at 12:33 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
09c9bc3de9319836d5a27985b8dbc4d2f3a41dc6 | SQL | liyanageisu/Sales-Management-System | /salesmanagement.sql | UTF-8 | 4,288 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 02, 2019 at 03:52 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... | true |
d2b7a80e2f4fdc9fa22c89c5a87e3d680186cebf | SQL | 161250092/MoblieBusinessTransactionDBM | /src/main/resources/table.sql | UTF-8 | 11,970 | 3.3125 | 3 | [] | no_license | create database mobilebussinessDB;
use mobilebussinessDB;
-- 用户表
create table if not exists `users`
(
-- `userId` int primary key auto_increment,
`phoneNumber` varchar(20),
`balance` double(16,2),
PRIMARY KEY (`phoneNumber`)
)ENGINE = InnoDB DEFAULT CHARSET =utf8;
-- 用户月数据
create table if not exists `userDataP... | true |
fcb7ff1dbea6a4e25af7c2e43c43f55587a82bb0 | SQL | Blackbaud-BharatYadav/fenxt-npi-dev | /DDL/views/dm_GLBatches_vw.sql | UTF-8 | 446 | 2.515625 | 3 | [] | no_license | create or replace view dm_GLBatches as select
_sys_transform_id,
TenantId,
DateAdded,
DateChanged,
DateDeleted,
DateApproved,
BatchId,
BatchNumber,
StatusTranslation,
AddedByUserName,
AddedByUserNameLabel,
ChangedByUserNameLabel,
DeletedByNameLabel,
ApprovedByUserNameLabel,
BatchDateId,
BatchHyperlink
from out_GLBatc... | true |
b44f434fa551e9484660b67111907cdc848cd6b0 | SQL | MHXXX/quarkus-learning | /quarkus-start-panache/src/main/resources/db/V1.0.1__init.sql | UTF-8 | 424 | 2.671875 | 3 | [] | no_license | create table person
(
id serial8 primary key,
name varchar(64),
gender int2 default -1,
birth date
);
insert into person(name, birth, gender)
values ('peter', '1996-01-01', 0);
insert into person(name, birth, gender)
values ('lisa', '1998-05-01', 1);
insert into person(name, birth, gender)
values... | true |
832b7be2781d6bf5a70fe6662e1d97214caad7be | SQL | rockneu/misc | /sql_tip/dead.lock.sql | UTF-8 | 1,697 | 3.953125 | 4 | [] | no_license |
/*
select b.owner, b.object_name, a.session_id, a.locked_mode
from v$locked_object a, dba_objects b
where b.object_id = a.object_id
order by a.session_id;
--select * from v$session where sid in (select session_id from v$locked_object)
;
select b.username, b.sid, b.serial#, logon_time, b.CLIENT_IDENTIFIER
from v... | true |
44623ed77920b2f5863a48a0844848fe1c7a3d26 | SQL | hoaingo/new-project | /pms-sp-configuration/src/main/resources/list-sp/up_pms_get_list_invoice.sql | UTF-8 | 508 | 2.5625 | 3 | [] | no_license | DELIMITER //
DROP PROCEDURE IF EXISTS up_pms_get_list_invoice//
CREATE PROCEDURE `up_pms_get_list_invoice`()
BEGIN
SELECT
`invoice_id`,
`status`,
`created_date`,
`created_by`,
`updated_date`,
`updated_by`,
`invoice_number`,
... | true |
acb6fc0f31659389bcf1cec12dc3629210d5f4da | SQL | Smit36/CS-561-Database-Management-System-Stevens | /Assignment 1/query3.sql | UTF-8 | 585 | 3.75 | 4 | [] | no_license | with
months as
(select generate_series as month from generate_series(1, 12)),
aggsale as
(select month, prod, sum(quant) from months left join sales using (month) group by month, prod),
mostpop as
(select distinct on (month) month, prod, sum from aggsale order by month, sum desc),
leastpop as
(select distinct on ... | true |
47273c12d5ee9f9b42f4aa98e3c1a516cadf3ddd | SQL | hashgraph/hedera-mirror-node | /hedera-mirror-importer/src/main/resources/db/migration/v1/V1.46.0__entity_timestamp.sql | UTF-8 | 1,051 | 4.15625 | 4 | [
"Apache-2.0"
] | permissive | -------------------
-- Fill missing entity created_timestamp and modified_timestamp
-------------------
-- update entity rows based on successful entity create/update/delete transaction types
with entity_timestamp as (
select entity_id, min(consensus_ns) created_timestamp, max(consensus_ns) modified_timestamp
... | true |
c6e5519a9a5dfc69a74a9abf265b85fed6a76110 | SQL | dlefebvre79/brewery-finder | /final-capstone/java/database/04_insert_seed_data.sql | UTF-8 | 21,599 | 3.046875 | 3 | [] | no_license | -- ********************************************
-- this script inserts seed data for all tables
-- ********************************************
BEGIN TRANSACTION;
-- users
-- the default password for both users is password
INSERT INTO users (user_id, username, password_hash, role, first_name, last_name, date_of_bir... | true |
6dec01d24b653615aaa41cd0d9cc145dbe42c6ec | SQL | Feliciano07/Alie_Store | /database/producto.sql | UTF-8 | 1,153 | 3.828125 | 4 | [] | no_license |
-- consulta para poder traer los productos de un cliente especifico
SELECT
pr.imagen,pr.descripcion,pr.precio_producto,pr.cantidad_disponible,
ct.nombre_categoria as padre
FROM PRODUCTO pr,
PRODUCTO_CATEGORIA pc,
CATEGORIA ct
WHERE pr.usuario=15 AND pr.id_producto=pc.producto AND
pc.categoria=ct.id_categoria ... | true |
9a6938b2de3bda35aba8371068108a4f440de508 | SQL | nilakshgupta/Bamazon | /bamazon.sql | UTF-8 | 310 | 3.03125 | 3 | [] | no_license |
CREATE DATABASE bamazon;
USE bamazon;
CREATE TABLE products(
item_id INTEGER(10) AUTO_INCREMENT,
product_name VARCHAR(50),
department_name VARCHAR(50),
price INTEGER (50),
stock_quantity INTEGER(50),
primary key (item_id)
);
show tables from bamazon;
select * from products;
| true |
5c0424a74c29107d5036a758be30cc8c88c906f5 | SQL | AsciiShell/hse_db_project | /Text/code/tab_block.sql | UTF-8 | 268 | 2.984375 | 3 | [] | no_license | CREATE TABLE Block
(
B_ID SERIAL PRIMARY KEY,
B_THEME VARCHAR(100) NOT NULL,
B_VISIBILITY BOOLEAN NOT NULL DEFAULT FALSE,
B_COURSE INTEGER NOT NULL REFERENCES Course (C_ID),
B_LAST_ID INTEGER REFERENCES Block (B_ID)
); | true |
4b4fc40d238d48e063f5be04f342c012a2ad56e5 | SQL | noracurcio/mySQL-Employee-Tracker | /develop/schema.sql | UTF-8 | 561 | 3.34375 | 3 | [] | no_license | DROP DATABASE IF EXISTS employeeDB;
CREATE DATABASE employeeDB;
USE employeeDB;
CREATE TABLE department (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(45) UNIQUE NOT NULL
);
CREATE TABLE role (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(45) ,
salary DECIMAL(10,2) NOT NULL,
... | true |
7691968e2f6961bcd211dc2caf82ae86af3b9126 | SQL | tjakopec/FormatiDatumVrijeme | /API/skripta.sql | UTF-8 | 1,802 | 3.734375 | 4 | [] | no_license |
drop database if exists fz2017;
create database fz2017 character set utf8 collate utf8_general_ci;
use fz2017;
#https://dev.mysql.com/doc/refman/5.7/en/datetime.html
create table podatak(
sifra int not null primary key auto_increment,
opis varchar(255) not null,
samodatum date, #The DATE type is used ... | true |
385230c87d42fc39bf838907573f086a338b1b99 | SQL | polavarapup2/CTRP_4x_PA | /pa/dbscripts/db-upgrade/postgresql/4.3/PO-9270.sql | UTF-8 | 1,268 | 2.703125 | 3 | [] | no_license | UPDATE pa_properties set value='<hr>
<p><b>Title: </b>${trialTitle}</p>
<table border="0">
<tr>
<td><b>Lead Organization Trial ID:</b></td>
<td>${leadOrgTrialIdentifier}</td>
</tr>
<tr>
<td><b>Lead Organization:</b></td>
<td>${leadOrgName}</td>
</tr>
<tr>
<td><b>Submission Date:</b></td>
<td>${submissionDa... | true |
761ea44827e4b41160b9434c1a20ee5aac165ca6 | SQL | chrko/db12013 | /sheet5/2.3.sql | UTF-8 | 192 | 3.78125 | 4 | [] | no_license | SELECT country.name,
COUNT(concert.*) AS concert_count
FROM country, concert
WHERE country.id = concert.country
GROUP BY country.name
HAVING COUNT(concert.*) >= 5000
ORDER BY country.name
| true |
6052ec023709f61e30777d1bce00bc666701717b | SQL | pp0001/Acl-Demo | /acl-demo/src/main/resources/data.sql | UTF-8 | 1,844 | 3.0625 | 3 | [] | no_license | INSERT INTO User (id, email, password, role_id) VALUES
(1, 'user1@mail.com', 'user1', 'procedure_owner'),
(2, 'user2@mail.com', 'user2', 'procedure_owner'),
(3, 'user3@mail.com', 'user3', 'admin'),
(4, 'user4@mail.com', 'user4', 'employee');
INSERT INTO Ropa (id, name) VALUES
(1, 'Ropa1'),
(2, 'Ropa2'),
(3, 'Ropa3');
... | true |
fbbcec616d458fc344d4ba554bdb50889beb5693 | SQL | ewisuru/spingboot-auth | /src/main/resources/schema.sql | UTF-8 | 361 | 2.953125 | 3 | [] | no_license | CREATE SCHEMA springsecurity
AUTHORIZATION postgres;
COMMENT ON SCHEMA springsecurity
IS 'this schema is to keep user details required for spring authentication';
create table springsecurity.user_info (
id serial PRIMARY KEY,
user_name varchar (50) unique not null,
password varchar (50) not null,
active ... | true |
00ce4ad81164449abe80ffc63a7a80725753a5a0 | SQL | radtek/abs3 | /sql/mmfo/bars/Table/grt_vehicle_types.sql | WINDOWS-1251 | 3,477 | 3.234375 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Table/GRT_VEHICLE_TYPES.sql =========*** Run
PROMPT =====================================================================================
PROMPT *** ALTER_POLICY_INFO... | true |
007c6ee31780cc59e9e3255817f79fa487ad82b1 | SQL | timbiles/Convoke | /convoke/db/schema.sql | UTF-8 | 716 | 3.59375 | 4 | [] | no_license | -- users table
CREATE TABLE users (
users_id SERIAL PRIMARY KEY,
name character varying(100),
bio character varying(500),
auth_id text,
home_town character varying(100),
img text,
email character varying(200)
);
-- events table
CREATE TABLE events (
events_id SERIAL PRIMARY KEY,
t... | true |
6824c08e9e34c4bfdcbc4d93cb9ce6c3a63997d2 | SQL | kevintoro/mysql | /training.sql | UTF-8 | 3,111 | 3.265625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3308
-- Tiempo de generación: 17-04-2020 a las 16:21:53
-- Versión del servidor: 8.0.18
-- Versión de PHP: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... | true |
e2c5e6bf2fd2f93fc233f4195ef064b0a9ab67e5 | SQL | karlrank/os-blog-aggregator | /db/blogaggre.sql | UTF-8 | 1,378 | 3.78125 | 4 | [] | no_license | #Listid Kasutajalt
select listName from bloglist where email='test@gmail.com';
#Blogs by Bloglist
select title,xmlUrl from blog where
id IN (select BLOG_ID from blog_bloglist where
BLOGLIST_ID IN (select id from bloglist where listName='Esimene List'));
#Tags by Blog
select name from tag where
id IN (select TAG_I... | true |
fdc487dec0c159e356bc8c2c5e05b61b7f6aa499 | SQL | tabokie/benchmarksql | /run/sql.oracle/indexCreates.sql | UTF-8 | 1,249 | 3.125 | 3 | [] | no_license | -- configured for 96c setup
create unique index bmsql_warehouse_pkey
on bmsql_warehouse (w_id)
parallel 32
pctfree 1 initrans 3
compute statistics;
create unique index bmsql_district_pkey
on bmsql_district (d_w_id, d_id)
pctfree 5 initrans 3
parallel 1
compute statistics;
create unique index bmsql_cus... | true |
b61caead8ad96deb968fb173d858bc0aa6bc7c0c | SQL | Nanask/Biz_403_2021_04_DBMS | /하나마트/하나마트(2021-05-31-MySQL).sql | UTF-8 | 4,102 | 4.28125 | 4 | [] | no_license | -- 하나마트
-- 데이터베이스 생성
CREATE DATABASE nhDB;
-- 데이터베이스를 사용하기 위한 연결, 사용할 Database에 연결하기
USE nhDB;
DROP table tbl_iolist;
-- table 생성
CREATE TABLE tbl_iolist (
io_seq BIGINT AUTO_INCREMENT PRIMARY KEY,
io_date VARCHAR(10) NOT NULL,
io_time VARCHAR(10) NOT NULL,
io_pname VARCHAR(50) NOT NULL,
io_bname VARCHAR(50)... | true |
d858cd6c00a073be7f515ac4db87f3aec2191b42 | SQL | maflorvega/Redash_queries | /queries_versioned/178_Amount of views for Baidu2.sql | UTF-8 | 582 | 2.78125 | 3 | [] | no_license | /*
Name: Amount of views for Baidu2
Data source: 4
Created By: Admin
Last Update At: 2016-02-10T20:31:22.023402+00:00
*/
SELECT
count(*) AS value
FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal,'CONCAT(REPLACE(table_id,"_","-"),"-01") BETWEEN STRFTIME_UTC_USEC("{{startdate}}", "%Y-%m-01") and STRFTIME... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.