sql stringlengths 6 1.05M |
|---|
<gh_stars>100-1000
Filename: out-SPT.h5repack_aggr.h5
Free-space persist: TRUE
Free-space section threshold: 5 bytes
Small size free-space sections (< 10 bytes):
Total # of small size sections: 0
Free-space section bins:
# of sections of size 100 - 999: 1
Total # of sections: 1
File space management strategy: H5F_FS... |
CREATE SCHEMA IF NOT EXISTS db DEFAULT CHARACTER SET utf8 ;
USE `db` ;
CREATE TABLE IF NOT EXISTS `users` (
id_user INT NOT NULL AUTO_INCREMENT,
email VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL,
phone varchar(10) not null,
firstName VARCHAR(255) not NULL,
lastname VARCHAR(255) ,
Sex tinyint(... |
<filename>ADD_LOCATION.sql
/*
CREATE_LOCATION_SP. Add a new location to the VM_LOCATION table.
This procedure should take as input location-related attributes and create a
new location entry. This procedure does not set the latitude/longitude values,
only address information a user might provide. If the coun... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 18, 2017 at 01:39 PM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 10, 2017 at 02:34 PM
-- Server version: 5.7.9
-- PHP Version: 5.6.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... |
<gh_stars>0
create table `recordbook` (
`app_user_id` int not null
,`workbook_id` int not null
,`problem_type_id` int not null
,`study_type_id` int not null
,`problem_id` int not null
,`result_prev3` tinyint
,`result_prev2` tinyint
,`result_prev1` tinyint
,`level` int not null
,`memorized` tinyint
,`last_answered_at` ... |
<reponame>seinyan/nest-rest-booking-task
SELECT * FROM room AS r
WHERE id NOT IN (
SELECT rr.room_id FROM room_reserve as rr
WHERE (date '2021-08-11', date '2021-08-23') OVERLAPS (rr.arrival_at, rr.departure_at) ::boolean
)
SELECT * FROM room as r
LEFT JOIN room_reserve rr on r.id = rr.room_id
WHERE NOT (dat... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 03, 2020 at 06:48 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";
/*!40... |
<filename>database_dump/urlshortner.sql
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jul 10, 2020 at 10:06 AM
-- Server version: 5.7.19
-- PHP Version: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time... |
<filename>bamazon.sql
DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE bamazon;
USE bamazon;
CREATE TABLE products (
item_id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(128) NULL,
department_name VARCHAR(128) NULL,
price DECIMAL (7, 2),
stock_quantity INT NULL,
PRIMARY KEY (item_ID)
);
... |
SELECT president
FROM STUDIO
WHERE name="MGM" |
-- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Feb 27, 2018 at 03:59 PM
-- Server version: 5.6.35
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `mydb`
--
-- ------------------------------------... |
<filename>database/migrations/06_createeventtable.sql
drop table if exists event;
create table event (
id integer AUTO_INCREMENT not null,
org_id integer not null,
message varchar(1000),
date_created date,
last_updated date,
version varchar(10),
p... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 05, 2020 at 03:16 PM
-- Server version: 8.0.13
-- PHP Version: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTE... |
UPDATE settings SET send_push_notifications = 1;
|
<reponame>rzayevsahil/HRMS
-- This script was generated by a beta version of the ERD tool in pgAdmin 4.
-- Please log an issue at https://redmine.postgresql.org/projects/pgadmin4/issues/new if you find any bugs, including reproduction steps.
BEGIN;
CREATE TABLE public.cities
(
id integer NOT NULL GENERATED BY DEF... |
<reponame>bruce-one/pg_timetable
DO $$
-- An example for using the Log task.
DECLARE
v_task_id bigint;
v_chain_config_id bigint;
BEGIN
-- Create the chain
INSERT INTO timetable.task(command)
VALUES ('Log')
RETURNING task_id INTO v_task_id;
-- Create the chain execution configuration
INSERT INTO ti... |
<reponame>Ambal/mangos
ALTER TABLE `item_template` ADD `RangedModRange` float NOT NULL default '0' AFTER `ammo_type` ;
|
<reponame>HSLdevcom/openmaptiles<gh_stars>0
DROP TRIGGER IF EXISTS trigger_store ON osm_waterway_linestring;
DROP TRIGGER IF EXISTS trigger_flag ON osm_waterway_linestring;
DROP TRIGGER IF EXISTS trigger_refresh ON waterway_important.updates;
-- We merge the waterways by name like the highways
-- This helps to drop no... |
--
-- Table structure for table `teleport`
--
DROP TABLE IF EXISTS custom_teleport;
CREATE TABLE custom_teleport (
Description varchar(75) default NULL,
id decimal(11,0) NOT NULL default '0',
loc_x decimal(9,0) default NULL,
loc_y decimal(9,0) default NULL,
loc_z decimal(9,0) default NULL,
price decimal(6... |
CREATE FOREIGN PROCEDURE SourceProc (
IN airlineid string,
IN connectionid string,
IN flightdate timestamp )
RETURNS
OPTIONS (
ANNOTATION 'procedure result desc',
UPDATECOUNT '2' )
TABLE (
ECONOMAX integer,
ECONOFREE integer,
BUSINMAX integer,
... |
create table user (
id int primary key AUTO_INCREMENT,
created timestamp not null default now(),
login varchar(80) not null,
name varchar(140),
locale varchar(3) ,
language varchar(3) ,
is_login_enabled enum ('Y','N') not null default 'n',
enabled TINYINT NOT NULL DEFAULT 1 ,
unique key (login)
) engine innodb... |
select rowid from nulls where binary_10 <= x'01' order by 1;
1
2
|
<filename>src/main/resources/genres.sql
insert into genres (category, genres) values ('Лёгкое чтение', 'Фантастика');
insert into genres (category, genres) values ('Лёгкое чтение', 'Боевики');
insert into genres (category, genres) values ('Лёгкое чтение', 'Детективы');
insert into genres (category, genres) values ('Лёг... |
DROP TABLE IF EXISTS public.water_iq_history;
DROP SEQUENCE IF EXISTS public.water_iq_history_id_seq;
DROP TABLE IF EXISTS public.water_iq;
DROP TABLE IF EXISTS public.water_iq;
-- Account current water iq information
CREATE TABLE public.water_iq
(
id int not null,
updated_on timestamp without time zone not null,... |
/*
Navicat Premium Data Transfer
Source Server : 192.168.127.12
Source Server Type : MySQL
Source Server Version : 50728
Source Host : 192.168.127.12:3306
Source Schema : ol_system
Target Server Type : MySQL
Target Server Version : 50728
File Encoding : 65001
Date: 1... |
-- set users with to-be-removed groups to now be proctors
update user_account_security_group uasg
set security_group_id =
(select security_group_id from security_group sg where
sg.group_name='PROCTOR')
where uasg.security_group_id in (
select security_group_id from security_group sg
where sg.group_name in ('... |
<reponame>bcgov/cas-ciip-portal
-- Deploy ggircs-portal:enum_operators to pg
-- https://github.com/metabase/metabase/issues/7092
begin;
create or replace function ggircs_portal_private.add_enum_comparison_operators(schema_name text)
returns void as
$func$
declare
r record;
code_ text;
enum_name te... |
CREATE TABLE `news_source_subscription` (
`id` INT NOT NULL AUTO_INCREMENT,
`subscriber_id` INT NOT NULL,
`news_source_id` INT NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (subscriber_id) REFERENCES `student` (id)
ON UPDATE CASCADE
ON DELETE CASCADE,
FOREIGN KEY (news_source_id) REFERENC... |
select
[deployment_started_at:aggregation] as period
, sum(datediff('minute', deployment_started_at, deployment_completed_at)) as total_runtime_m
, avg(datediff('minute', deployment_started_at, deployment_completed_at)) as avg_runtime_m
, sum(models_deployed) as models_deployed
from
{{ ref('stg_dbt_deployment... |
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES
('transaction_savings', 'REFUNDBYTRANSFER_ACCOUNTTRANSFER_CHECKER', 'ACCOUNTTRANSFER', 'REFUNDBYTRANSFER', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
V... |
/*
* Copyright 2015 herd contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... |
<gh_stars>10-100
create table article
(
id int auto_increment
primary key,
article_title varchar(255) charset utf8 default '' null,
article_content text null,
create_time datetime null,
user_id int null,
del_flag int(255) default '0' null,
like_count int default '0' null,
comment_count int default '0' null,
... |
<filename>sql/init-user.sql
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.5.28 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------... |
-- This file should undo anything in `up.sql`
drop table if exists events;
|
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50616
Source Host : localhost:3306
Source Database : yii2lv_blog
Target Server Type : MYSQL
Target Server Version : 50616
File Encoding : 65001
Date: 2019-02-17 18:29:09
*/
SET FOREIGN_KEY_CHECKS=0;
... |
-- Remove colorset references
alter table visualization drop column if exists colorsetid;
-- Remove colorset tables
drop table if exists colorset_colors;
drop table if exists color;
drop table if exists colorset;
|
CREATE INDEX foo__uniq__key__null_value
ON foo ( key )
WHERE value IS NULL
|
use cadastro;
create table gafanhotos_assiste_cursos (
id int not null auto_increment,
data date,
idgafanhoto int,
idcurso int,
primary key(id),
foreign key(idgafanhoto) references gafanhotos(id),
foreign key(idcurso) references cursos(idcurso)
) default charset = utf8;
insert into gafanhotos_assiste_cursos values
(... |
<reponame>wang-q/garr<gh_stars>0
SELECT
chr_name, COUNT(*), AVG(length)
FROM
ctg
GROUP BY
chr_name
|
<gh_stars>0
DELETE FROM "managers"; -- apagar todas as linha da tabela
INSERT INTO "managers" ("cpf", "directorship_id")
VALUES
('16370290102', (SELECT "directorship_id" from "directorships" WHERE "name" = 'Inovação')),
('19370290101', (SELECT "directorship_id" from "directorships" WHERE "name" = 'Inovação')),
(... |
<filename>database/07.itemFixPriceSomeEmpv2.sql
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.21 - MySQL Community Server (GPL)
-- Server OS: Win32
-- HeidiSQL Version: 9.2.0.4947
-- -------... |
IF OBJECT_ID(N'[__EFMigrationsHistory]') IS NULL
BEGIN
CREATE TABLE [__EFMigrationsHistory] (
[MigrationId] nvarchar(150) NOT NULL,
[ProductVersion] nvarchar(32) NOT NULL,
CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY ([MigrationId])
);
END;
GO
CREATE TABLE [AspNetRoles] (
[Id... |
CREATE TABLE "user" (
id UUID PRIMARY KEY,
name TEXT NOT NULL CONSTRAINT user_name_unique UNIQUE,
email TEXT NULL,
pw_hash TEXT NOT NULL,
is_admin BOOLEAN NOT NULL DEFAULT FALSE
);
CREATE TABLE session (
session_id UUID UNIQUE,
user_id UUID NOT NULL REFERENCES "user"(id),
PRIMARY KEY(ses... |
CREATE TABLE customServiceQuestions (
id INT AUTO_INCREMENT PRIMARY KEY,
serviceId INT NOT NULL,
label VARCHAR(256),
type ENUM (
'text',
'number',
'select',
'boolean',
'date'
) NOT NULL,
CONSTRAINT fk_question_serviceId FOREIGN KEY (serviceId) REFERENCES services(id)
);
CREATE TABLE cus... |
<filename>data/train/sql/802c0e468715fd3bab0550c495fcf73b08407937donetselling_doterm_taxonomy.sql
CREATE DATABASE IF NOT EXISTS `donetselling` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `donetselling`;
-- MySQL dump 10.13 Distrib 5.6.13, for Win32 (x86)
--
-- Host: localhost Database: donetselling
-- ------------... |
-- Move reference from shipment to orderline part 2 of 3
PRINT N'Altering [dbo].[uCommerce_OrderLine]'
ALTER TABLE [dbo].[uCommerce_OrderLine] ADD
[ShipmentId] [int] NULL |
<filename>src/SFA.DAS.Commitments.Database/AdhocScripts/Support/UpdateAccountLevyStatus.sql
/*
UpdateAccountLevyStatus script for Commitments db
Sets the LevyStatus for a given Account (0 = NonLevy, 1 = Levy)
Note: this script only updates the record held in the Commitments service
Other systems (eas, reservations, pa... |
<reponame>prbpedro/java-springboot-microservices-patterns-exemples<filename>scripts/createreadonlyuser.sql
CREATE USER 'readonlyuser'@'%' IDENTIFIED BY 'password';
GRANT SELECT, SHOW VIEW ON *.* TO 'readonlyuser'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES; |
<filename>prisma/migrations/20220201150635_initial_migration/migration.sql
-- CreateEnum
CREATE TYPE "TaskStatus" AS ENUM ('TODO', 'DOING', 'DONE');
-- CreateTable
CREATE TABLE "users" (
"id" TEXT NOT NULL,
"email" TEXT NOT NULL,
"password" TEXT NOT NULL,
"full_name" TEXT NOT NULL,
"created_at" TIM... |
DROP TABLE utbetalingsreferanse;
|
-- enc2.test
--
-- execsql {SELECT * FROM t5 ORDER BY 1 COLLATE test_collate; }
SELECT * FROM t5 ORDER BY 1 COLLATE test_collate; |
<filename>src/test/resources/sql/insert/63745964.sql<gh_stars>10-100
-- file:inherit.sql ln:30 expect:true
INSERT INTO d(aa) VALUES('ddd')
|
-- file:timestamp.sql ln:232 expect:true
SELECT make_timestamp(2014,12,28,6,30,45.887)
|
<reponame>scheltwort-it-services/common_schema<gh_stars>100-1000
DROP TABLE IF EXISTS `routine_privileges`;
CREATE TABLE IF NOT EXISTS `routine_privileges` (
`GRANTEE` varchar(81),
`ROUTINE_CATALOG` binary(0),
`ROUTINE_SCHEMA` char(64),
`ROUTINE_NAME` char(64),
`ROUTINE_TYPE` enum('FUNCTION','PROCEDURE'),
... |
INSERT INTO notes(id, name, hash, created, content)
VALUES (counter.nextval, ?, ?, ?, ?); |
SELECT * FROM table ORDER BY TIME_FORMAT(column '%H:%i') DESC |
<gh_stars>100-1000
USE [CSETWeb]
GO
/****** Object: Table [dbo].[FILE_KEYWORDS] Script Date: 11/14/2018 3:57:23 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[FILE_KEYWORDS](
[Gen_File_Id] [int] NOT NULL,
[Keyword] [varchar](60) NOT NULL,
CONSTRAINT [FILE_KEYWORDS_PK] PRIMARY KEY... |
-- Package model
{{
config(
materialized = "table",
)
}}
with
wer as (
SELECT
sp.sergvsdrvs,
sp.sdtrsbnt,
trim(LTRIM(sp.sresgdr, 'asecesf')) as srebstrgserg,
sp.bdfgsrg,
sp.sfnsfdgnfd,
sp.vsdfbvsdfv,
sp.sdbsdr,
sp.srgdsrbsfcgb,
s.sdrgsdrbsd,
... |
--
-- Copyright 2005-2014 The Kuali Foundation
--
-- Licensed under the Educational Community License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.opensource.org/licenses/ecl2.php
--
-- Unless required by ap... |
<filename>docs/db/2.1/easyreport21.sql
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50532
Source Host : localhost:3306
Source Database : easyreport2
Target Server Type : MYSQL
Target Server Version : 50532
File Encoding : 65001
Date: 2017-05-25 0... |
<gh_stars>10-100
ALTER TABLE cstar_perf.test_artifacts ADD artifact_available boolean;
ALTER TABLE cstar_perf.test_artifacts ADD object_id text;
CREATE TABLE cstar_perf.chunk_object_storage (
object_id text,
chunk_id int,
chunk_size int,
chunk_sha text,
object_chunk blob,
total_chunks int stati... |
<reponame>189569400/ClickHouse
SELECT toTypeName(now() - now()) = 'Int32';
SELECT toTypeName(now() + 1) = 'DateTime';
SELECT toTypeName(1 + now()) = 'DateTime';
SELECT toTypeName(now() - 1) = 'DateTime';
SELECT toDateTime(1) + 1 = toDateTime(2);
SELECT 1 + toDateTime(1) = toDateTime(2);
SELECT toDateTime(1) - 1 = toD... |
<filename>devstats/config/metrics/shared/episodic_issues.sql
with prev as (
select distinct user_id
from
gha_issues
where
created_at >= date '{{from}}' - '3 months'::interval
and created_at < '{{from}}'
and is_pull_request = false
), prev_cnt as (
select user_id, count(distinct id) as cnt
from... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.3.15
-- Dumped by pg_dump version 9.5.1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; T... |
CREATE TABLE IF NOT EXISTS meta_settings (
id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
meta_setting TEXT NOT NULL UNIQUE,
meta_value TEXT
);
|
<gh_stars>0
-- @testpoint:opengauss关键字comments(非保留),作为模式名
--关键字不带引号-成功
drop schema if exists comments;
create schema comments;
drop schema comments;
--关键字带双引号-成功
drop schema if exists "comments";
create schema "comments";
drop schema "comments";
--关键字带单引号-合理报错
drop schema if exists 'comments';
create schema 'comme... |
create table APP_USER (
id BIGINT NOT NULL AUTO_INCREMENT,
ident_id INT(30) NOT NULL,
password VARCHAR(100) NOT NULL,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
email VARCHAR(30) NOT NULL,
PRIMARY KEY (id),
UNIQUE (ident_id)
);
create table USER_PROFILE(
id BIGINT NO... |
{{ config(materialized='table') }}
SELECT DISTINCT o.o_orderdate,
SUM(o.o_totalprice) over (ORDER BY o.o_orderdate) AS cumulative_sales
FROM "SNOWFLAKE_SAMPLE_DATA"."TPCH_SF1"."ORDERS" o
ORDER BY o.o_orderdate
|
-- DROP DATABASE
DROP DATABASE IF EXISTS tech_blog_db;
-- CREATE DATABASE
CREATE DATABASE tech_blog_db; |
CREATE TABLE [AppDbo].[Stage] (
[StageId] INT IDENTITY (1, 1) NOT NULL,
[Stage] NVARCHAR (100) NOT NULL,
[OrderNumber] INT NOT NULL,
CONSTRAINT [PK_Stage] PRIMARY KEY CLUSTERED ([StageId] ASC)
);
GO
CREATE NONCLUSTERED INDEX [IX_Stage]
ON [AppDbo].[Stage]([Stag... |
CREATE TABLE IF NOT EXISTS "simpleregister_passwords" (
"id" SERIAL PRIMARY KEY,
"name" VARCHAR(255),
"uuid" VARCHAR(36),
"ip" VARCHAR(255),
"password" VARCHAR(255)
);
CREATE INDEX "simpleregister_passwords_uuid" ON "simpleregister_passwords" ("uuid");
|
<reponame>pabloIO/clinica-unifranz
-- MySQL Script generated by MySQL Workbench
-- Thu Jan 11 00:30:54 2018
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OL... |
CREATE TABLE `dz`.`question` (
`question_id` int(11) NOT NULL AUTO_INCREMENT,
`question_description` varchar(255) NOT NULL,
PRIMARY KEY (`question_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `dz`.`quiz` (
`quiz_id` int(11) NOT NULL AUTO_INCREMENT,
`quiz_nome` varchar(255) DEFAULT NULL,
PRIMAR... |
<filename>dml.sql
/*
* DML - Data Modification Language
* DML is used for adding (inserting), deleting, and modifying (updating) data in a database
*/
INSERT INTO seasons (year)
VALUES
(2019);
INSERT INTO teams(team_name, team_city, home_stadium, team_nickname, team_owner)
VALUES
('New England Patriots', 'Foxborough'... |
<reponame>prateeknagwani/tally-database-loader
/*
Daily Receipt and Payment (incl Contra)
*/
declare
@fromDate date = '2014-04-01',
@toDate date = '2015-03-31';
with tblDateList as
(
select @fromDate value
union all
select dateadd(day, 1, value) from tblDateList where value < @toDate
),
tblCashMove... |
--------------------------------------------------------------------------------
-- Mode ------------------------------------------------------------------------
--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW Mode (Id, Reference, Code, Name, Description)
AS
SE... |
<filename>sql_trab2/insert.sql<gh_stars>0
-- PESSOA
-- CLIENTE
INSERT INTO CLIENTE
VALUES ('455.111.111.31', '361111131', '<NAME>', '1977-07-16', 'CLIENTE');
INSERT INTO CLIENTE
VALUES ('455.111.111.32', '361111132', '<NAME>', '1955-02-23', 'CLIENTE');
INSERT INTO CLIENTE
VALUES ('455.111.111.33', '3611111... |
<reponame>qvant/achivement_bot<gh_stars>0
CREATE SCHEMA achievements_hunt
AUTHORIZATION achievements_hunt_bot;
create table achievements_hunt.statuses
(
id integer primary key,
name varchar(32)
);
create unique index u_statuses_name on achievements_hunt.statuses(name);
alter table achievement... |
CREATE TABLE forum_reponses (
id int(6) NOT NULL auto_increment,
auteur VARCHAR(30) NOT NULL,
message text NOT NULL,
date_reponse datetime NOT NULL default '0000-00-00 00:00:00',
correspondance_sujet int(6) NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM; |
CREATE TABLE `hopak`.`users` (
`user_id` INT(11) NOT NULL,
`username` VARCHAR(45) NOT NULL,
`email` VARCHAR(45) NOT NULL,
`password` VARCHAR(100) NOT NULL,
PRIMARY KEY (`user_id`),
UNIQUE INDEX `user_id_UNIQUE` (`user_id` ASC) VISIBLE,
UNIQUE INDEX `username_UNIQUE` (`username` ASC) VISIBLE,
UNIQUE INDE... |
<gh_stars>1-10
SET DEFINE OFF;
CREATE SEQUENCE AFW_36_FILTR_SESN_SEQ
START WITH 1
MAXVALUE 9999999999999999999999999999
MINVALUE 1
NOCYCLE
CACHE 20
NOORDER
/
|
-- +goose Up
CREATE TABLE IF NOT EXISTS `shoppingcart` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`user_id` BIGINT NOT NULL,
`created_at` TIMESTAMP NOT NULL,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
PRIMARY KEY (`id`),
INDEX `user_id_cart_id` (`user_id`, `id`)
)
DEFAULT CHARACTE... |
<gh_stars>1-10
--Authors: <NAME>, <NAME> (SQL Help)
WITH stitch AS (
select a.accession, a.id as rxn_id,
b.reactionside,
b.reactionsidereactiontype,
c.compound,
d.id as cmpd_id,
d.name
FROM reaction a
inner join reactionsidereaction b on a.accession = b.reaction
inner join reactionparticipant c USING(r... |
<filename>phoenix-scala/sql/V1.053__create_gift_card_adjustments.sql
-- ledger for all adjustments (credits/debits) to gift_cards
create table gift_card_adjustments (
id serial primary key,
gift_card_id integer not null,
order_payment_id integer null,
store_admin_id integer null,
credit integer not ... |
grant alter any COLLATION TO PUBLIC WITH GRANT OPTION;
grant alter any DOMAIN TO PUBLIC WITH GRANT OPTION;
grant alter any EXCEPTION TO PUBLIC WITH GRANT OPTION;
grant alter any FILTER TO PUBLIC WITH GRANT OPTION;
grant alter any FUNCTION TO PUBLIC WITH GRANT OPTION;
grant alter any SEQUENCE TO PUBLIC WITH GRANT OPTIO... |
<filename>sql2019workshop/sql2019wks/03_Security/dataclassification/findpeopleonecolumn.sql
USE WideWorldImporters
GO
-- What if I access just one of the columns directly?
SELECT FullName FROM [Application].[People]
GO |
-- you can change the password on initial the database.
/**
create database `wolf` CHARACTER SET utf8mb4;
grant DELETE,EXECUTE,INSERT,SELECT,UPDATE
on wolf.* to wolfroot@'127.0.0.1' IDENTIFIED BY '123456';
grant DELETE,EXECUTE,INSERT,SELECT,UPDATE
on wolf.* to wolfroot@'localhost' IDENTIFIED BY '123456';
FLUSH PRIVILE... |
{# only valid for PostgreSQL targets #}
{{ config(
materialized="table",
enabled=(target.type == 'postgres' | as_bool())
) }}
{# Repurpose any existing model to test the macro select_star_except() #}
{% set src = ref("data_test_numeric_constraints") %}
{% set exceptions_list = ["type", "vat_pct"] %}
{# check both... |
<gh_stars>1-10
select papers.PaperId,
Year,
DocType,
PaperTitle,
paper_fields.Score
from gcp_cset_mag.FieldsOfStudy fields
inner join gcp_cset_mag.PaperFieldsOfStudy paper_fields
on paper_fields.FieldOfStudyId = fields.FieldOfStudyId
inner join gcp_cset_... |
CREATE TABLE backup.BKP_M_InventoryLine_gh12663_18032022
AS
SELECT *
FROM m_inventoryline
;
UPDATE m_inventoryline il
SET IsExplicitCostPrice = 'Y',
Updated = TO_TIMESTAMP('2022-03-18 16:41:56', 'YYYY-MM-DD HH24:MI:SS'),
UpdatedBy = 100
WHERE il.qtybook = il.qtycount
;
|
<filename>db/sql/src/main/resources/org/kuali/rice/rice-sql/upgrades/2.4.0/mysql/client/test/2014-02-13--KULRICE-10937.sql
--
-- Copyright 2005-2015 The Kuali Foundation
--
-- Licensed under the Educational Community License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the Licens... |
/* Insert statement for Currency */
INSERT INTO currency (id, entity_code, symbol, name, description) VALUES (1, 'KSH', 'Ksh', 'Kenyan Shillings', 'Kenyan Shillings');
INSERT INTO currency (id, entity_code, symbol, name, description) VALUES (2, 'USD', '$', 'US Dollar', 'US Dollar');
/* Insert statement for Location Ty... |
-----------------------------------------------------------------------------
-- Copyright (c) 2010-2015 <NAME> <<EMAIL>>
-- https://github.com/DmitryZav/
--
-- This file is part of Constellation Kings game project.
--
-- This file is subject to the terms and conditions defined in
-- file 'LICENSE', which is part of th... |
<reponame>silas0605/phpFaculdade<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 06-Nov-2019 às 09:34
-- Versão do servidor: 10.1.33-MariaDB
-- PHP Version: 7.2.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
S... |
-- // CB-15139 Support for StopStart scaling in periscope
-- Migration SQL that makes the change goes here.
ALTER TABLE "cluster" ADD COLUMN IF NOT EXISTS "stop_start_enabled" boolean DEFAULT false;
-- //@UNDO
-- SQL to undo the change goes here.
ALTER TABLE "cluster" DROP COLUMN IF EXISTS "stop_start_enabled";
|
<reponame>l-tyagi/course-dbt-lucky
{{
config(
materialized='table',
unique_key = 'session_guid'
)
}}
SELECT date(event_date_utc) as event_date,
extract(Hour from event_date_utc) as EventHour,
session_guid,
product_name,
user_guid,
event_guid
FROM {{ ref('i... |
ALTER TABLE PARTY_STRUCT_RULE DROP CONSTRAINT FK_PARTY_STRUCT_RULE_TYPE;
ALTER TABLE PARTY_STRUCT_RULE DROP CONSTRAINT FK_PARTY_STRUCT_RULE_TYPE_PARENT;
ALTER TABLE PARTY_STRUCT_RULE DROP CONSTRAINT FK_PARTY_STRUCT_RULE_TYPE_CHILD;
ALTER TABLE PARTY_STRUCT_RULE DROP CONSTRAINT PK_PARTY_STRUCT_RULE;
ALTER TABLE PARTY... |
-- Revert ggircs-portal:tables/application_002 from pg
begin;
alter table ggircs_portal.application drop column report_id;
commit;
|
<filename>db_api/create_dbuser.sql
CREATE USER 'mimus'@'localhost' IDENTIFIED BY '9dc1b3ae-584c-434e-b899-da2c8ad093fb';
GRANT ALL PRIVILEGES ON *.* TO 'mimus'@'localhost' WITH GRANT OPTION;
CREATE USER 'mimus'@'%' IDENTIFIED BY '9dc1b3ae-584c-434e-b899-da2c8ad093fb';
GRANT ALL PRIVILEGES ON *.* TO 'mimus'@'%' WITH GRA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.