sql stringlengths 6 1.05M |
|---|
-- View information about the specified distribution database.
USE distribution
EXEC sp_helpdistributiondb;
GO |
CREATE TABLE IF NOT EXISTS RM_ENVIRONMENT(
ID INTEGER NOT NULL AUTO_INCREMENT,
NAME VARCHAR(128) NOT NULL,
PRIMARY KEY (ID),
UNIQUE (NAME)
);
CREATE TABLE IF NOT EXISTS RM_SERVER_INSTANCE (
ID INTEGER NOT NULL AUTO_INCREMENT,
ENVIRONMENT_ID INTEGER NOT NULL,
NAME VARCHAR(128) NOT NULL,
SERVER_URL VARCH... |
<reponame>pabarcgar/eva-ws
INSERT INTO browsable_file
(file_id, ena_submission_file_id, filename, loaded, eva_release, deleted, eva_release_deleted, project_accession, loaded_assembly, assembly_set_id)
VALUES(1, 'ERF1', 'file1.vcf.gz', true, 'Unreleased', false, 'None', 'PRJEB11', NULL, 11);
INSERT INTO browsable_file
... |
accept nr_departament char prompt 'Introduceti numarul departamentului: '
accept venit_mediu_anual char prompt 'Venit mediu anual: '
DEFINE venit_anual = salariu * 12 venit_anual + nvl(comision, 0)
select nume, functie, data_ang, id_dep, &venit_anual
from angajati
where id_dep = &nr_departament and &venit_anual > &... |
set client_min_messages to warning;
create extension if not exists pgtap;
reset client_min_messages;
begin;
select plan(8);
select has_function(
'ggircs_portal_private', 'protect_date_overlap',
'Function protect_date_overlap should exist'
);
select lives_ok(
$$
insert into ggircs_portal.reporting_year (repor... |
EXEC sp_rename
@objname = 'dbo.Person.Deleted',
@newname = 'IsDeleted',
@objtype = 'COLUMN'
GO |
ALTER TABLE user_requests
ADD COLUMN external_event_id CHAR(36) REFERENCES external_events (id);
ALTER TABLE user_requests
ADD COLUMN external_cfp_id CHAR(36) REFERENCES external_cfps (id);
ALTER TABLE user_requests
ADD COLUMN external_proposal_id CHAR(36) REFERENCES external_proposals (id);
UPDATE user_re... |
CREATE TABLE affiliate_share (
uuid UUID PRIMARY KEY,
affiliate_public_key TEXT REFERENCES affiliate(public_key) NOT NULL,
public_key TEXT NOT NULL,
created TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT affiliate_share_key_pair_unq UNIQUE (affiliate_public_key, public_key)
);
|
<gh_stars>0
USE `meethere`;
SELECT * FROM `t_record`
WHERE `user_id` = 2;
SELECT * FROM `t_comment`
WHERE `user_id` = 2;
|
-- We can do "Create Read Update Delete" operations to the data
-- inside the tables.
-- How do we make tables? By doing CRUD on the database schema.
-- The first SQL statement to learn is CREATE:
create table person (
id integer primary key,
first_name text,
last_name text,
age integer,
height_inches integ... |
DROP TABLE IF EXISTS `orgTable`;
CREATE TABLE `orgTable` (
`ID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'org_id',
`ORG_NAME` varchar(128) DEFAULT NULL COMMENT 'org_name',
`PROJECT_NAME` varchar(128) DEFAULT NULL COMMENT 'project name',
`CREATE_TIME` datetime DEFAULT NULL COMMENT 'create_time',
`DES` varchar(1... |
CREATE TABLE IF NOT EXISTS `metadata` (
`revision` INTEGER NOT NULL,
`lastUpdateCheck` TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS `gc2oc` (
`ocCode` TEXT NOT NULL UNIQUE,
`gcCode` TEXT NOT NULL,
PRIMARY KEY(`ocCode`)
);
|
<reponame>PedroPovedaQ/fleet-suite-server
-- AlterTable
ALTER TABLE "Load" ADD COLUMN "load_num" TEXT;
|
<filename>events.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Erstellungszeit: 03. Aug 2019 um 16:03
-- Server-Version: 10.3.16-MariaDB
-- PHP-Version: 7.1.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone... |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 17, 2017 at 05:25 PM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` integer NOT NULL /*!40101 AUTO_INCREMENT */,
`login` varchar(30) NOT NULL,
`mdp` varchar(60) NOT NULL,
`type` varchar(5) NOT NULL DEFAULT 'user',
check (type in ('user','admin')),
PRIMARY KEY (`id`)
) /*!40101 ENGINE=MyISAM ... |
-- name: AddIngredient :one
INSERT INTO ingredients (
nome,
ativo
) VALUES (
$1, $2
) RETURNING *;
-- name: GetIngreditent :one
SELECT * FROM ingredients
WHERE id = $1 LIMIT 1;
-- name: ListIngredients :many
SELECT * FROM ingredients
ORDER BY nome
LIMIT $1
OFFSET $2;
-- name: UpdateIngredient :one
UPDATE ingre... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 19, 2020 at 02:08 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... |
<gh_stars>1-10
INSERT INTO contacts (first_name, last_name) VALUES ("Max", "Peck");
INSERT INTO contacts VALUES ("José", "Jiménez");
INSERT INTO contacts (first_name, last_name) VALUES (?, ?)
INSERT INTO contacts VALUES (NULL, :first_name, :last_name)
|
SELECT `t0`.`Akquisekanal__Level_1_` AS `Akquisekanal__Level_1_`,
`t0`.`sum_Calculation_860187579479334912_ok` AS `sum_Calculation_860187579479334912_ok`,
`t8`.`X_measure__3` AS `sum_Calculation_860187579479445505_ok`,
`t5`.`X_measure__7` AS `usr_Calculation_491736835276996608_ok`,
`t5`.`X_measure__11` AS `usr_... |
<gh_stars>1-10
SET SERVEROUTPUT ON;
CREATE TABLE ID_PESSOA (
ID NUMBER PRIMARY KEY,
NOME VARCHAR2(50) NOT NULL,
SOBRENOME VARCHAR2(50)
);
/
CREATE SEQUENCE id_pessoa_pk;
CREATE OR REPLACE VIEW ID_PESSOA_VW
AS
SELECT NOME, SOBRENOME FROM ID_PESSOA;
/
-- Trigger
CREATE OR REPLACE TRIGGER trg_sequencia_id_pesso... |
<reponame>tsarvs/DataNDragons
CREATE TABLE [dbo].[EPISODE]
(
[ep_id] INT NOT NULL PRIMARY KEY,
[ep_cmpid] INT NOT NULL,
[ep_date] DATE DEFAULT GETDATE(),
[ep_desc] VARCHAR(MAX),
CONSTRAINT [FK_EPISODE_ToCAMPAIGN] FOREIGN KEY ([ep_cmpid]) REFERENCES [CAMPAIGN]([cmp_id])
)
|
<filename>kmserver-core/migrations/20210423000000.do.addLocation.sql<gh_stars>10-100
ALTER TABLE users ADD COLUMN location CHARACTER VARYING;
|
<reponame>hluchotechna/shopify-buyer-segmentation
SELECT
store,
customer_id,
order_number,
order_date,
recent_order_date,
first_order_date,
case when first_order_number = order_number then 'New'
when date_diff(order_date, recent_order_date, DAY) <= 365 then 'Repeat'
when date_diff(order_date, recent_order_date, DAY) ... |
<gh_stars>1-10
ALTER TABLE "gphotos_photos" DROP COLUMN "blur_hash"; |
<reponame>spiliti/boma
INSERT INTO eg_role (id, name, description, createddate, createdby, lastmodifiedby, lastmodifieddate, version, internal) VALUES (nextval('SEQ_EG_ROLE'), 'rest bill creator', 'Third party bill creator', now(), 1, 1, now(), 0, true);
|
<reponame>dram/metasfresh<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5529350_sys_gh5419_layout_fixes.sql<gh_stars>1000+
-- 2019-08-26T10:11:35.919Z
-- description fields
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=560011
;
-- 2019-08-26T10:14:44.27... |
BEGIN;
CREATE INDEX resources_build_id_idx ON resources (build_id);
COMMIT;
|
<gh_stars>0
with greeenhouse_tag as (
select *
from {{ var('tag') }}
),
candidate_tag as (
select *
from {{ var('candidate_tag' )}}
),
agg_tags as (
select
candidate_tag.candidate_id,
{{ fivetran_utils.string_agg('greeenhouse_tag.tag_name', "', '") }} as tags
from candidat... |
CREATE TABLE temp_word
(
word VARCHAR NOT NULL,
count INT DEFAULT 0 NOT NULL,
id SERIAL PRIMARY KEY NOT NULL,
document INT NOT NULL
);
CREATE INDEX word_index ON temp_word (word);
|
<gh_stars>1-10
-- Adjusts the LdapSecurityAuthentication vdc_options value
select fn_db_update_default_config_value('LDAPSecurityAuthentication','GSSAPI','default:GSSAPI','general',false);
select fn_db_update_default_config_value('LDAPSecurityAuthentication','SIMPLE','default:SIMPLE','general',false);
|
-- Create Control service support table
DROP TABLE IF EXISTS fledge.control_script;
DROP TABLE IF EXISTS fledge.control_acl;
-- Script management for control dispatch service
CREATE TABLE fledge.control_script (
name character varying(255) NOT NULL,
steps JSON ... |
<filename>service/account/schema/750$account.actorAccount.add.sql
CREATE OR REPLACE FUNCTION account."actorAccount.add"(
"@accountId" bigint,
"@accountNumber" CHARACTER varying(25),
"@actorId" CHARACTER varying(25),
"@roleName" CHARACTER varying(25),
"@isDefault" boolean,
"@isSignatory" boolean
) RETURNS T... |
ALTER TABLE /*_*/user_properties MODIFY up_user int unsigned NOT NULL; |
<filename>tests/suites/0_stateless/02_0016_function_context.sql<gh_stars>1000+
SELECT current_user();
|
<filename>scripts/schema/ccpv1/049-route-feedback.sql
/* Copyright (c) 2006-2012 Regents of the University of Minnesota.
For licensing terms, see the file LICENSE. */
/* A simple table to record feedback on routes */
begin transaction;
set constraints all deferred;
create table route_feedback (
id serial prim... |
-- MOS: Bug 13250244 : ORA-4031 ERRORS SEEN WHEN PARAMETER _KGHDSIDX_COUNT IS SET TO >1 DUE TO MEM LEAK
-- ~~~~~~~~~~~~~
-- Testcase
-- ~~~~~~~~~~~~~~~~~
--
-- Files: BDETC.tar.Z (containing init.ora, setup.sql, tc.sql)
--
-- Steps:
-- ** IMPORTANT ** Merge init.ora into the pfile used to start... |
<gh_stars>1000+
CREATE TABLE {$NAMESPACE}_user.user_preferences (
id int unsigned not null auto_increment primary key,
userPHID varchar(64) binary not null,
preferences longblob not null,
unique key (userPHID)
);
|
-- AlterTable
ALTER TABLE "EntityField" ADD COLUMN "unique" BOOLEAN NOT NULL DEFAULT false;
|
<reponame>Toexplore/PolarDB-for-PostgreSQL
--
-- Tests for procedures / CALL syntax
--
CREATE PROCEDURE test_proc1()
LANGUAGE plpgsql
AS $$
BEGIN
NULL;
END;
$$;
CALL test_proc1();
-- error: can't return non-NULL
CREATE PROCEDURE test_proc2()
LANGUAGE plpgsql
AS $$
BEGIN
RETURN 5;
END;
$$;
CREATE TABLE tes... |
<reponame>rodel-talampas/gpdb
--
-- @created 2009-01-27 14:00:00
-- @modified 2013-06-24 17:00:00
-- @tags ddl schema_topology
-- Create tablespaces
CREATE tablespace ts_sch1 filespace cdbfast_fs_sch1;
CREATE tablespace ts_sch2 filespace cdbfast_fs_sch1;
CREATE tablespace ts_sch3 filespace cdbfast_fs_sch2;
CREATE tab... |
<filename>api.end.dev/myExternal/sql/pg/finance.sql
/*1对公帐号 2对私帐号 3个人储蓄卡 4个人信用卡*/
CREATE TYPE "default".bank_account_type AS ENUM('1', '2', '3', '4');
/*提现申请状态 -1不通过 1审核中 2审核通过 10提现完毕*/
CREATE TYPE "default".withdraw_apply_status AS ENUM('-1','1','2','10');
/*Table structure for table data_bank_lib */
... |
<filename>whois-commons/src/main/resources/internals_data.sql
-- this could be parsed as well, but we want to avoid that overhead for each integration test
INSERT INTO authoritative_resource (source, resource) VALUES ('test', 'AS102');
INSERT INTO authoritative_resource (source, resource) VALUES ('test', 'AS103');
INSE... |
<gh_stars>1-10
--+ holdcas on;
set system parameters 'dont_reuse_heap_file=yes';
--use analytic function in order by/group by/having clause
create table drank_in_clause(
col1 int auto_increment primary key,
col2 smallint,
col3 char(30) default 'abc',
col4 date default SYSDATE,
col5 clob
);
insert into drank_i... |
PRAGMA foreign_keys = off;
BEGIN TRANSACTION;
-- Table: alert
CREATE TABLE IF NOT EXISTS alert (
conf_id TEXT NOT NULL,
user_id TEXT NOT NULL,
created TEXT NOT NULL,
time TEXT NOT NULL,
message TEXT
);
-- Table: conf
CREATE TABLE IF NOT EXISTS conf (
id NUMERIC NOT NULL
... |
SET FOREIGN_KEY_CHECKS=0;
DELETE FROM currencies WHERE currabrev='CNY';
INSERT INTO currencies (currabrev, currency, country, rate)
VALUES ('CNY', 'Chinese yuan', '中国', 1);
UPDATE companies SET currencydefault='CNY',
... |
CREATE VIEW vw_dst AS
SELECT d.id, s.date as start_date, d.start_time_he, e.date as end_date, d.end_time_he
FROM dim_dst AS d
JOIN dim_date AS s on d.start_date_id = s.id
JOIN dim_date AS e on d.end_date_id = e.id
|
<gh_stars>0
-- 官方提供的sql
-- https://github.com/spring-projects/spring-security-oauth/blob/master/spring-security-oauth2/src/test/resources/schema.sql
-- 因使用mysql,需要修改部分字段类型适配:
CREATE TABLE `clientdetails`
(
`appId` varchar(128) NOT NULL,
`resourceIds` varchar(256) DEFAULT NULL,
... |
select
TR.Nome as 'turma',
AL.Aluno
From Turmas Tr Inner Join TurmaAlunos TA
on
TR.Id = TA.Turma inner join Alunos AL
on
TA.Aluno = AL.id; --Traz alunos da turma
select
D.[Data],
--A.Aluno,
SUM(N.Nota) as 'media',
count(p.Id) as 'Presencas'
from Diarios D inner join TurmaAlunos TR
o... |
<filename>prms.sql
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 27, 2021 at 11:28 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.3.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
IF OBJECT_ID('dbo.sp_BlitzFirst') IS NULL
EXEC ('CREATE PROCEDURE dbo.sp_BlitzFirst AS RETURN 0;')
GO
ALTER PROCEDURE [dbo].[sp_BlitzFirst]
@Question NVARCHAR(MAX) = NULL ,
@Help TINYINT = 0 ,
@AsOf DATETIMEOFFSET = NULL ,
@ExpertMode TINYINT = 0 ,
@Seconds INT = 5 ,
@OutputType V... |
<filename>View-plug-ins/OracleModel/1-Tables/07-EXTRACT_BATCH_LOG.sql
CREATE TABLE VPI.EXTRACT_BATCH_LOG
(
BATCH_ID NUMBER(9) NOT NULL,
LOG_TIME TIMESTAMP(3) DEFAULT SYSTIMESTAMP NOT NULL,
PROGRESS_STEP NUMBER(5) NOT NULL,
PROGRESS_DESC VARCHAR2(128)
) COMPRESS;
CREATE INDEX VPI.IX_EXTRACT_BATCH_... |
BEGIN;
DROP TABLE users;
DROP TABLE companies;
COMMIT;
|
CREATE TABLE SchemaVersion (
updateDate timestamp with time zone,
version smallint primary key
);
INSERT INTO SchemaVersion (version, updateDate) VALUES (1, now());
ALTER TABLE Project ADD COLUMN showChanges bool DEFAULT true;
ALTER TABLE Project ADD COLUMN allResults bool DEFAULT false;
UPDATE Project SET show... |
insert into draggable_category (name, master_store_id)
values ($1, $2)
returning id,
name; |
{#
Adapter Macros for the following functions:
- Bigquery: JSON_EXTRACT(json_string_expr, json_path_format) -> https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions
- Snowflake: JSON_EXTRACT_PATH_TEXT( <column_identifier> , '<path_name>' ) -> https://docs.snowflake.com/en/sql-referenc... |
-- file:alter_table.sql ln:1332 expect:true
alter table test_storage alter a set storage extended
|
-- file:rangefuncs.sql ln:359 expect:true
SELECT * FROM foob(42, 99)
|
<gh_stars>100-1000
CREATE TABLE contents (
id bigint PRIMARY KEY,
title text,
message text,
created timestamp
); |
CREATE EXTERNAL TABLE [fhir].[TestScript] (
[resourceType] NVARCHAR(4000),
[id] VARCHAR(64),
[meta.id] NVARCHAR(4000),
[meta.extension] NVARCHAR(MAX),
[meta.versionId] VARCHAR(64),
[meta.lastUpdated] VARCHAR(30),
[meta.source] VARCHAR(256),
[meta.profile] VARCHAR(MAX),
[meta.security... |
CREATE TYPE status AS ENUM ('open', 'closed');
DROP TYPE IF EXISTS status;
DROP TYPE IF EXISTS status; |
<reponame>dividio/projectfootball
INSERT INTO PF_TEAMS (X_TEAM,S_TEAM,S_SHORT_NAME,S_LOGO,N_BUDGET,X_FK_COUNTRY) VALUES (1,'Equipo 01','E 01','default_team_logo0.png',315000000,1);
INSERT INTO PF_TEAMS (X_TEAM,S_TEAM,S_SHORT_NAME,S_LOGO,N_BUDGET,X_FK_COUNTRY) VALUES (2,'Equipo 02','E 02','default_team_logo1.png',306000... |
INSERT INTO department (name)
VALUES ('R&D'),
('Sales'),
('Support');
INSERT INTO role (title, salary, department_id)
VALUES ('Engineer', 100000, 1),
('Manager', 200000, 2),
('Intern', 0, 3);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ('Ronald', 'Firbank', 1, 1),
('V... |
<reponame>amrjlg/fpush<filename>doc/db/app_account-prod.sql<gh_stars>10-100
/*
Navicat MariaDB Data Transfer
Source Server :
Source Server Version : 50560
Source Host : 192.168.31.100:3306
Source Database : push
Target Server Type : MariaDB
Target Server Version : 50560
File Encoding ... |
<reponame>impira/yugabyte-db
-- Copyright (c) YugaByte, Inc.
alter table alert add column if not exists group_uuid uuid;
alter table alert add constraint fk_alert_group_uuid foreign key (group_uuid) references alert_definition_group (uuid)
on delete cascade on update cascade;
update alert set group_uuid =
(select v... |
-- phpMyAdmin SQL Dump
-- version 4.4.15.7
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1:3306
-- Время создания: Апр 19 2017 г., 20:36
-- Версия сервера: 5.5.50
-- Версия PHP: 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
--
-- The contents of this file are subject to the license and copyright
-- detailed in the LICENSE and NOTICE files at the root of the source
-- tree and available online at
--
-- http://www.dspace.org/license/
--
-----------------------------------------------------------------------------------
-- Create tables for... |
create table if not exists categories (
category_id uuid primary key,
name text not null,
slug text not null,
synopsis text not null
);
create unique index on categories(slug);
create unique index on categories(name);
|
-- @testpoint: 验证【哈希】分区表【split partition】时,update global index关键字对【btree】类型【唯一性普通索引】的重建作用,合理报错
--创建分区表,插入样例数据,建立全局索引
drop table if exists test_ugi_034;
create table test_ugi_034
(
c_id integer not null,
c_name varchar(16) default 'omm',
c_class varchar(20) not null
)
partition by hash(c_id)
(
partition... |
<filename>CK.DB.GuestActor/Res/sGuestActorUCL.sql
-- SetupConfig: { "Requires": [ "CK.sAuthUserOnLogin" ] }
--
-- @Token is the key that identifies a guest user. It can be null for mode 1 or 3 (mode&1)!=0 (creation).
--
-- @Mode (flags): CreateOnly = 1, UpdateOnly = 2, CreateOrUpdate = 3, WithCheckLogin = 4, WithActual... |
<filename>database/ict_database.sql
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 27, 2017 at 02:49 AM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_... |
INSERT INTO library (id, name) VALUES ('36ab2b24-a27d-4d58-a92f-bc4cdd96853b', 'TEST LIBRARY #1'),
('4e4fb99b-a6b1-45e4-a3ed-085600642248', 'TEST LIBRARY #2'); |
ALTER TABLE `consumer_logger` ADD `retries` TINYINT NOT NULL DEFAULT '0' COMMENT '重试次数' AFTER `status`;
ALTER TABLE `consumer_logger` ADD `original` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '源LOG ID' AFTER `retries`;
COMMIT; |
-- TEXT型とBLOB型のカラムを持つテーブルを作成するテスト
DROP TABLE IF EXISTS sample_text_table_1;
CREATE TABLE sample_text_table_1 (
primary_key BIGINT NOT NULL,
text_data TEXT NOT NULL,
PRIMARY KEY(primary_key)
);
DROP TABLE IF EXISTS sample_text_table_2;
CREATE TABLE sample_text_table_2 (
primary_key BIGINT NOT NULL,
text_da... |
CREATE TABLE subdivision_BR (id VARCHAR(6) NOT NULL, name VARCHAR(255) NOT NULL, level VARCHAR(64) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
INSERT INTO `subdivision_BR` (`id`, `name`, `level`) VALUES ('BR-AC', 'Acre', 'state');
INSERT INTO `subdivision_BR` (`id`, `... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2017-07-19 14:05:14
-- 服务器版本: 10.1.19-MariaDB
-- PHP Version: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40... |
<filename>config/exampleTwo/result.sql
CREATE DATABASE dbName;
CREATE TABLE `user1` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`password` varchar(128) NOT NULL DEFAULT '',
`type` enum('USER','ADMIN') NOT NULL DEFAULT 'USER',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (... |
-- file:plpgsql.sql ln:1404 expect:true
select * from PField_v1 where pfname = 'PF0_2' order by slotname
|
ALTER TABLE `characters` ADD `entityId` INT NOT NULL DEFAULT '0' AFTER `dataId`; |
-- This file should undo anything in `up.sql`
ALTER TABLE records ADD COLUMN notes TEXT;
WITH transferred_notes AS (
SELECT record, STRING_AGG(content, '\n') AS content
FROM record_notes
GROUP BY record
)
UPDATE records
SET notes = transferred_notes.content
FROM transferred_notes
WHERE records.id = transf... |
USE devops_ci_store;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for T_APPS
-- ----------------------------
CREATE TABLE IF NOT EXISTS `T_APPS` (
`ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`NAME` varchar(64) NOT NULL DEFAULT '' COMMENT '名称',
`OS` ... |
<filename>common/sql/example_create_materialized_view.sql
-- +----------------------------------------------------------------------------+
-- | <NAME> |
-- | <EMAIL> |
-- | www.idevelopment... |
DELETE FROM spell_proc_event WHERE entry IN(38319);
INSERT INTO `spell_proc_event` VALUES
(38319,0,0,0,0,0x0000000000000000,0x00004000,0,0);
|
<reponame>valmarmoritz/SQL_guru
/*
estimate the size of a nonclustered index v.3.3
https://docs.microsoft.com/en-us/sql/relational-databases/databases/estimate-the-size-of-a-nonclustered-index?view=sql-server-2016
<NAME>
Dec 26th, 2019
*/
SET NOCOUNT ON
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
/* MANUAL INPUTS *... |
<filename>ezhelper.sql
-- This is the schema for tracks.sqlite
--
-- You need to manage the track id values, the are not autoincrement.
-- The filepath columns are paths relative to the "audioroot" value set in ezhelper.py
CREATE TABLE tracks (id integer primary key,title text,artist text,filepath text);
CREATE TABLE l... |
USE rms;
ALTER TABLE `element_guid`
MODIFY COLUMN `path` VARCHAR(1024) DEFAULT NULL;
|
<filename>greenery/models/Core/dim_user_info.sql<gh_stars>0
{{
config(
materialized='table'
)
}}
Select
user_id,
first_name,
last_name,
email,
phone_number,
address,
zipcode,
state,
country,
created_at,
updated_at
FROM {{ ref('int_user_info') }}
|
-- migrate:up
create extension if not exists "citext";
create type sg_public.email_frequency as enum(
'immediate',
'daily',
'weekly',
'never'
);
comment on type sg_public.email_frequency
is 'Email frequency options per user';
create type sg_public.user_role as enum(
'sg_anonymous',
'sg_user',
'sg_adm... |
-- Going to store the event stream and retrieve them from a certain rowid.
CREATE TABLE events (
id INTEGER PRIMARY KEY,
-- Since Unix epoch
create_time_millis INTEGER NOT NULL,
value BLOB NOT NULL
);
|
<gh_stars>1-10
ALTER TABLE nw.payout_tool
ADD COLUMN payout_tool_info_international_bank_number CHARACTER VARYING;
ALTER TABLE nw.payout_tool
ADD COLUMN payout_tool_info_international_bank_aba_rtn CHARACTER VARYING;
ALTER TABLE nw.payout_tool
ADD COLUMN payout_tool_info_international_bank_country_code CHARACTER V... |
<filename>server/src/main/resources/db/bootstrap/V19__test_suites.sql<gh_stars>1-10
DROP TABLE IF EXISTS `test_suites`;
CREATE TABLE `test_suites`
(
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`action_id` BIGINT(20) DEFAULT NULL,
`workspace_version_id` BIGINT(20) ... |
Insert into i8_c select c_nationkey, c_custkey from customer;
Insert into i8_s select s_nationkey, s_suppkey from supplier;
Insert into i8_p select p_partkey from part where p_type = 'ECONOMY ANODIZED STEEL';
Insert into i8_o select o_custkey, o_orderkey, o_orderdate from orders where o_orderdate between date '... |
CREATE FUNCTION undo_partition_id(p_parent_table text, p_batch_count int DEFAULT 1, p_batch_interval bigint DEFAULT NULL, p_keep_table boolean DEFAULT true, p_lock_wait numeric DEFAULT 0, OUT partitions_undone int, OUT rows_undone bigint) RETURNS record
LANGUAGE plpgsql SECURITY DEFINER
AS $$
DECLARE
ex_conte... |
use pr_old;
|
<reponame>alexandre-lecoq/SqlServerSafeDropDatabase<filename>SafeDropDatabase.sql<gh_stars>0
IF EXISTS (
SELECT 1
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[SafeDropDatabase]') AND type IN (N'P', N'PC')
)
DROP PROCEDURE [dbo].[SafeDropDatabase];
GO
-- This is a procedure to drop a database.
-- Out... |
<reponame>xCloudx8/datawarehouse_for_genomes
SELECT term_synonym.term_id, term.id, term.nome, term_synonym.term_synonym, graph_path.distance
FROM term_synonym, term, graph_path
where term_synonym.term_id = term.id
limit 10;
|
<reponame>cscl-git/digit-bpa<filename>egov/egov-egf/src/main/resources/db/migration/main/V20180102152243__egf_financialyear_201819.sql
INSERT INTO financialyear (id, financialyear, startingdate, endingdate, isactive, createddate, lastmodifieddate,lastmodifiedby,createdby,version, isactiveforposting, isclosed, transferc... |
ALTER TABLE public.Inventory
DROP CONSTRAINT InventoryItemInventory;
DROP TABLE Inventory;
DROP TABLE InventoryItem;
|
-- SELECT pfirstname, plastname, pstate, ppoints
-- FROM people
-- WHERE ppoints >= 7000
-- AND NOT (pstate = 'NY');
SELECT pfirstname, plastname, pstate, ppoints
FROM people
WHERE ppoints >= 7000
AND pstate <> 'NY';
|
<reponame>mikubu/Myproject<filename>databases/db.sql
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 15, 2015 at 07:25 PM
-- Server version: 5.6.26
-- PHP Version: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.