sql stringlengths 6 1.05M |
|---|
<gh_stars>10-100
/*
* Copyright 2020 <NAME>
*
* 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 o... |
/*
This is the defult vault database and you can create as many as you want for the
same tokenization instance.
*/
DROP TABLE IF EXISTS token_vault;
CREATE TABLE token_vault (
id VARCHAR(1024) NOT NULL,
value VARCHAR(1024) NOT NULL,
PRIMARY KEY (id)
);
CREATE INDEX value_idx ON token_vault(value);
INSERT INTO... |
<filename>src/AdminViews/v_get_tbl_priv_by_user.sql
/**********************************************************************************************
Purpose: View to get the tables that a user has access to
History:
2013-10-29 jjschmit Created
*************************************************************************... |
<reponame>Schreglmann/koala-framework<gh_stars>10-100
CREATE TABLE IF NOT EXISTS `kwc_basic_link_phone` (
`component_id` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL,
PRIMARY KEY (`component_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
<filename>hasura/migrations/1615736960936_set_fk_public_EventPerson_personId/up.sql
alter table "public"."EventPerson"
add constraint "EventPerson_personId_fkey"
foreign key ("personId")
references "public"."ContentPerson"
("id") on update cascade on delete cascade;
|
<gh_stars>0
-- MariaDB dump 10.19 Distrib 10.6.3-MariaDB, for Win64 (AMD64)
--
-- Host: localhost Database: calories
-- ------------------------------------------------------
-- Server version 10.6.3-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RE... |
create table posts (
id serial primary key,
content text,
author varchar(255)
);
create table comments (
id serial primary key,
content text,
author varchar(255),
post_id integer references posts(id)
);
create table users (
id serial primary key,
username text,
password varchar(255)
-- post_id int... |
<reponame>purbon/kafka-connect-playbook
-- Create the test database
CREATE DATABASE testDB;
GO
USE testDB;
EXEC sys.sp_cdc_enable_db;
-- Create some customers ...
CREATE TABLE customers (
id INTEGER IDENTITY(1001,1) NOT NULL PRIMARY KEY,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
email ... |
CREATE TRIGGER employees_trg_bu
BEFORE UPDATE ON employees
FOR EACH ROW
BEGIN
IF NEW.salary <50000 THEN
SET NEW.contrib_401K=500;
ELSE
SET NEW.contrib_401K=500+(NEW.salary-50000)*.01;
END IF;
END
|
drop table if exists bi_prod.d_sfdc_opportunity cascade;
create table if not exists bi_prod.d_sfdc_opportunity
(
opportunity_key serial not null,
opportunity_id varchar(36) not null,
account_key int not null,
account_id varchar(36) not null,
record_ty... |
<filename>ScriptsVarios/nuevas tablas/catastrophe.sql
INSERT INTO catastrophe (id_catastrophe,name_catastrophe,id_commune)VALUES (29,'y',154);
INSERT INTO catastrophe (id_catastrophe,name_catastrophe,id_commune)VALUES (141,'el',86);
INSERT INTO catastrophe (id_catastrophe,name_catastrophe,id_commune)VALUES (160,'no',16... |
if exists (select 1 from sys.objects where object_id = OBJECT_ID(N'[FK_order_customer]') AND parent_object_id = OBJECT_ID('ta_orders'))
begin
alter table ta_orders drop constraint FK_order_customer
end
if exists (select * from dbo.sysobjects where id = object_id(N'ta_customers') and OBJECTPROPERTY(id, N'IsU... |
<filename>resources/migrations/20181126231238-proposal-status.down.sql
alter table proposal drop column status;
alter table proposal_history drop column status;
drop type proposal_status;
|
<filename>Databases/MetadataDB/Security/BIML.sql
CREATE SCHEMA [BIML]
AUTHORIZATION [dbo]; |
<reponame>tomaztk/SQLServer-Data-Lineage<filename>remove_comments.sql
USE QL;
GO
GO
CREATE OR ALTER PROCEDURE dbo.remove_comments
/*
Author: <NAME>
Date: July 2021
GitHub: github.com/tomaztk
Blogpost: wordpress.com/post/tomaztsql.wordpress.com/7232
Description:
Removing all comments from your T-SQL Query for a g... |
-- file:insert_conflict.sql ln:17 expect:true
explain (costs off) insert into insertconflicttest values(0, 'Crowberry') on conflict (fruit) do nothing
|
<gh_stars>10-100
-- file:interval.sql ln:73 expect:true
INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483647 years')
|
USE `bpr`;
LOCK TABLES `autonomous` WRITE;
INSERT INTO `autonomous` (`code`, `p_code`, `type`, `name`) VALUES
('1101', '11', 2, 'SIMEULUE'),
('1102', '11', 2, 'ACEH SINGKIL'),
('1103', '11', 2, 'ACEH SELATAN'),
('1104', '11', 2, 'ACEH TENGGARA'),
('1105', '11', 2, 'ACEH TIMUR'),
('1106', '11', 2, 'ACEH TEN... |
/* This file is for users that currently use InnoDB with MySQL 5.6+ and want to use InnoDB for their replicated releasesearch table. While this isn't a requirement to import, the team
has decided to code the Fulltext searching within the site for MyISAM due to its larger compatibility and ease of future troubleshootin... |
CREATE TABLE `tbl_backup` (
`backup_id` int(11) NOT NULL AUTO_INCREMENT,
`backup_date` date NOT NULL,
`backup_time` time NOT NULL,
`file_name` varchar(200) NOT NULL,
`user_id` varchar(10) NOT NULL,
`backup_status` tinyint(1) NOT NULL,
PRIMARY KEY (`backup_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CH... |
CREATE TABLE conduit_db."TEAMS"
(
id integer NOT NULL DEFAULT nextval('conduit_db.teams_id_seq'::regclass),
name character varying(64) COLLATE pg_catalog."default",
CONSTRAINT team_id PRIMARY KEY (id)
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE conduit_db."TEAMS"
OWNER TO db_user; |
INSERT INTO `bookcopy` ( `book_author`, `book_name`) VALUES ('update 4 ', 'update 4 ');
|
CREATE TABLE `baseinfo` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`symbol` varchar(50) NOT NULL COMMENT '币种',
`language` varchar(50) NOT NULL COMMENT '语言',
`total` bigint(20) DEFAULT NULL COMMENT '总量',
`circulation` bigint(20) DEFAULT NULL COMMENT '流通量',
`marketValue` decimal(10,5) DEFAULT NULL COMMENT '市值... |
insert into user(id, name) values (1, 'kotlin max');
insert into user(id, name) values (2, 'kotlin fax');
insert into user(id, name) values (3, 'kotlin bax');
|
<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : wamp
Source Server Version : 50714
Source Host : localhost:3306
Source Database : muti
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2017-07-07 21:10:47
*/
SET FOREIGN_... |
DELETE FROM rubrics
WHERE parent_id = 500 OR id = 500;
|
<filename>src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_all_with_pager.sql
SELECT * FROM DRAFT_KNOWLEDGES
ORDER BY INSERT_DATETIME %s
LIMIT ? OFFSET ?;
|
<filename>universal-application-tool-0.0.1/conf/evolutions/default/18.sql
# --- Create the versions table and migrate existing actives and drafts.
# --- !Ups
create table if not exists ti_organizations (
id bigserial primary key,
name varchar not null,
description varchar
);
alter table accounts add column memb... |
---
--- Blocks pivot table GIS enabled
---
drop table if exists manzanas_geo;
create table manzanas_geo(
id integer primary key,
cvegeo varchar(255),
geom geometry(Polygon, 4326)); -- 0 defaults to 4326 WSG834
-- Raw data as importe from KML sources is dirty, some replace magi for cleanup
insert into manzanas_g... |
DO
$$
BEGIN
IF register_patch('AlterUserGenderLength.sql', 'fredrikbolmsten', 'Make user title longer', '2019-12-10') THEN
BEGIN
ALTER TABLE users ALTER COLUMN gender TYPE varchar(30);
END;
END IF;
END;
$$
LANGUAGE plpgsql;
|
--pass exceptional data of timestampltz/datetimeltz type to the parameter
--1. [error] exceptional argument of timestampltz type
select second(timestampltz'23:00:00 11/001');
select second(timestampltz'04:14:07 1/0019/2011');
select second(timestampltz'03:15,07 1/19/1999');
select second(timestampltz'03:14:08 hm 1... |
<gh_stars>1-10
--use lag function in a subquery
create table lag_sq(
col1 smallint auto_increment primary key,
col2 bigint not null,
col3 varchar default 'abc',
col4 timestamp default CURRENT_TIMESTAMP,
col5 bit(20)
);
insert into lag_sq(col2, col3, col4, col5) values(500, 'cubrid', '1990-10-10 11:12:13', B'00... |
INSERT INTO department (department_name)
VALUES
('Accounting'),
('Administration'),
('Software Development'),
('Foundations');
INSERT INTO roles (title, salary, department_id)
VALUES
('Accountant', 80000, 1),
('System Manager', 90000, 2),
('Laborer', 90000, 4),
('Janitor', 50000, 4),
('Software Engin... |
<filename>server/db/sql/requests/remove.sql
DELETE FROM requests
WHERE id=$1
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 06, 2021 at 09:36 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 7.4.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 13, 2017 at 07:37 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... |
<gh_stars>0
DROP DATABASE IF EXISTS crowdfunding;
CREATE DATABASE crowdfunding;
\c crowdfunding;
create extension CITEXT;
create type category_type as enum ('подкасты', 'творчество',
'блог', 'еда', 'путешествия',
'разработка игр', 'музыка', 'дизайн', 'разработка');
CREATE TABLE donators
(
id BI... |
<reponame>joadarpe/springboot-java-microservices
insert into currency_exchange(id,currency_from,currency_to,conversion_multiple,environment)
values(10001,'USD','COP',65,'');
insert into currency_exchange(id,currency_from,currency_to,conversion_multiple,environment)
values(10002,'EUR','COP',75,'');
insert into currency_... |
<reponame>Kingsmai/bug-fac-bugventure
USE `bugventure`;
CREATE TABLE Inventory(
`InventoryItemID` int NOT NULL,
`Quantity` int NOT NULL
);
|
DROP DATABASE IF EXISTS appfix_db;
CREATE DATABASE appfix_db; |
<reponame>Fr4nc3/oracle-db-samples
--------------------------------------------------------
-- DDL for Index BOOKS_PK
--------------------------------------------------------
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
CREATE UNIQUE INDEX "BOOKS_PK" ON "BOOKS" ("BOOK_ID")
PCTFREE 10 INITRANS 2 ... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 05, 2019 at 06:33 AM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40... |
<gh_stars>1-10
CREATE PROCEDURE [dbo].[GetCourseById]
@Id INT
AS
BEGIN
SET NOCOUNT ON;
SELECT Id, Name
FROM Courses
WHERE Id = @Id
END |
-- Deploy auth:structure/extensions to pg
BEGIN;
CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
COMMIT;
|
CREATE TABLE [dbo].[tblCrypto]
(
[Id] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,
[UserId] UNIQUEIDENTIFIER NOT NULL,
[Symbol] NCHAR(100) NOT NULL,
[CurrentPrice] DECIMAL(18, 2) NOT NULL
)
|
<reponame>chris-french/address-api
DROP TABLE IF EXISTS address_spatial.areasf ;
DROP SEQUENCE IF EXISTS address_spatial.areasf_id_seq;
DROP TABLE IF EXISTS address_spatial.areas ;
DROP SEQUENCE IF EXISTS address_spatial.areas_id_seq;
CREATE SEQUENCE address_spatial.areas_id_seq
START WITH 2001
INCREMENT BY ... |
<filename>sql_scripts/add_meta_data_for_word.sql
ALTER TABLE
words ADD COLUMN `length` TINYINT(1),
ADD COLUMN `weight` TINYINT(1),
ADD COLUMN `strength` TINYINT(1),
ADD COLUMN `level` TINYINT(1),
ADD COLUMN `date_created` TIMESTAMP DEFAULT NOW(),
ADD COLUMN `date_modified` TIMESTAMP DEFAULT NOW(... |
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
IF NOT EXISTS(SELECT * FROM [__EFMigra... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jun 28, 2021 at 09:39 PM
-- Server version: 8.0.15
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
-- misc2.test
--
-- execsql {
-- DELETE FROM t1;
-- INSERT INTO t1 VALUES(1);
-- }
DELETE FROM t1;
INSERT INTO t1 VALUES(1); |
USE test_cs;
DROP TABLE IF EXISTS test_foreach;
CREATE TABLE test_foreach (name VARCHAR(64) CHARSET ascii);
DROP DATABASE IF EXISTS test_cs_foreach;
CREATE DATABASE test_cs_foreach;
USE test_cs_foreach;
CREATE TABLE test_foreach_00 (id INT);
CREATE TABLE test_foreach_01 (id INT);
CREATE TABLE test_foreach_02 (id INT);... |
<reponame>trussworks/mymove
CREATE TYPE webhook_notifications_status AS ENUM (
'PENDING',
'SENT',
'FAILED'
);
CREATE TABLE webhook_notifications
(
id uuid PRIMARY KEY NOT NULL,
event_key text NOT NULL,
trace_id uuid,
move_task_order_id uuid REFERENCES move_task_orders,
object_id uuid,
payload json NOT N... |
DROP DATABASE IF EXISTS employees_DB;
CREATE database employees_DB;
USE employees_DB;
CREATE TABLE department (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(30) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE role (
id INT AUTO_INCREMENT NOT NULL,
title VARCHAR(30) NOT NULL,
salary DECIMAL NOT NULL,
departm... |
<gh_stars>1-10
/*
Navicat MySQL Data Transfer
Target Server Type : MYSQL
Target Server Version : 50540
File Encoding : 65001
Date: 2016-10-18 17:45:31
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `oc_packet_wechat_area`
-- ----------------------------
... |
<reponame>BrettPWRE/HDB
create user brio_user identified by h1nterface
default tablespace HDB_user quota unlimited on HDB_user
temporary tablespace HDB_temp quota unlimited on HDB_temp;
grant create session to brio_user;
grant connect to brio_user;
|
<gh_stars>0
select student_id, first_name, last_name
from students
where last_name="Dane";
select student_id, first_name, last_name
from students
where student_id=1;
select student_id, first_name, last_name
from students
where student_id>1;
select student_id, first_name, last_name
from students
where student_id<4
s... |
<filename>tts/tts.sql
-- Database: tts
-- DROP DATABASE tts;
CREATE USER tts;
CREATE DATABASE tts
WITH
OWNER = tts
ENCODING = 'UTF8'
TEMPLATE = template0
CONNECTION LIMIT = -1;
GRANT TEMPORARY, CONNECT ON DATABASE tts TO PUBLIC;
GRANT ALL ON DATABASE tts TO tts;
CREATE SEQUENCE public.words_bk... |
ALTER TABLE [samplestudenttranscript].[InstitutionControlDescriptor] WITH CHECK ADD CONSTRAINT [FK_InstitutionControlDescriptor_Descriptor] FOREIGN KEY ([InstitutionControlDescriptorId])
REFERENCES [edfi].[Descriptor] ([DescriptorId])
ON DELETE CASCADE
GO
ALTER TABLE [samplestudenttranscript].[InstitutionLevelDescript... |
<filename>model/migrations/871a27f-model_config.sql
ALTER TABLE `models`
ADD `config` MEDIUMTEXT COLLATE utf8_bin NOT NULL DEFAULT '{}' AFTER `use_exact`,
ADD `trained_config` MEDIUMTEXT COLLATE utf8_bin DEFAULT NULL AFTER `metrics`;
ALTER TABLE `training_jobs`
ADD `owner` int(11) NULL DEFAULT NULL,
ADD FOREIG... |
<filename>Source/tSQLt.AssertNotEquals.ssp.sql
IF OBJECT_ID('tSQLt.AssertNotEquals') IS NOT NULL DROP PROCEDURE tSQLt.AssertNotEquals;
GO
---Build+
CREATE PROCEDURE tSQLt.AssertNotEquals
@Expected SQL_VARIANT,
@Actual SQL_VARIANT,
@Message NVARCHAR(MAX) = ''
AS
BEGIN
IF (@Expected = @Actual)
O... |
<filename>sql/chars.sql
/*
MySQL Data Transfer
Source Host: localhost
Source Database: tpzdb
Target Host: localhost
Target Database: tpzdb
Date: 2/11/2013 11:16:49 PM
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for chars
-- ----------------------------
DROP TABLE IF EXISTS `chars`;
... |
drop schema if exists "public" cascade;
drop schema if exists "geo" cascade;
create schema "public";
create table "projects"
(
"projectId" serial not null,
"name" text not null,
primary key ("projectId")
);
create table "users"
(
"userId" serial not null,
"email" varchar(64) n... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Ноя 26 2016 г., 13:16
-- Версия сервера: 10.1.16-MariaDB
-- Версия PHP: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... |
<filename>sys_ddl_pkg.sql
create or replace package sys_ddl_pkg is
-- Author : Spencer
-- Created : 2017/5/23 9:22:02
-- Purpose : 生成alter语句
/**
* 根据传入的表名+列名+数据类型+列描述+操作类别+是否立即执行
* 生成alter语句
*
**/
PROCEDURE generate_alter_sql(p_table_name VARCHAR2,
... |
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- N... |
ALTER TABLE APP_FILE ADD UUID VARCHAR(255);
UPDATE APP_FILE SET UUID=UUID();
ALTER TABLE ORG_GROUP ADD UUID VARCHAR(255);
UPDATE ORG_GROUP SET UUID=UUID();
ALTER TABLE GROUP_USER_REQUEST ADD UUID VARCHAR(255);
UPDATE GROUP_USER_REQUEST SET UUID=UUID();
ALTER TABLE INVITATION ADD UUID VARCHAR(255);
UPDATE INVITATION ... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 06, 2018 at 09:48 AM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 5.6.33
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
# Copyright (c) 2015 Intelliant
#
# Product fuzzy search module
#
# The MIT License (MIT)
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including w... |
CREATE TABLE LPR3_ACTIVE.SAET
(
ROOT char(16) for bit data PRIMARY KEY NOT NULL,
LATESTDOKUMENTID char(16) for bit data,
REPORTINGTIME timestamp NOT NULL,
VERSIONNUMBER int NOT NULL
);
INSERT INTO LPR3_ACTIVE.SAET (ROOT, LATESTDOKUMENTID, REPORTINGTIME, VERSIONNUMBER) VALUES (BLOB(x'A6C28882E0AE484EAA1C... |
<reponame>GrupaZero/platform2<filename>tests/db/dump.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.7
-- Dumped by pg_dump version 9.6.7
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_string... |
SELECT Username, SUBSTRING(Email, CHARINDEX('@', Email) + 1, LEN(Email)) AS [Email Provider]
FROM Users
ORDER BY [Email Provider], Username |
# Write your MySQL query statement below
SELECT DeptName AS Department, Name AS Employee, Salary FROM
(SELECT e.Name,e.Salary,e.DepartmentId,d.Name as DeptName FROM Employee e
JOIN Department d ON e.DepartmentId=d.Id) AS Dept
JOIN (SELECT MAX(Salary) as Sal, DepartmentID FROM Employee GROUP BY DepartmentID)
AS MaxS... |
<reponame>akilli/cms<gh_stars>1-10
START TRANSACTION;
-- ---------------------------------------------------------------------------------------------------------------------
-- Converts given text to UID
--
-- This optional PostgreSQL function mimics the PHP function str\uid() and could be useful during initial migra... |
{% set version_usage_stats_list = dbt_utils.get_column_values(table=ref('version_usage_stats_list'), column='full_ping_name', max_records=1000, default=[]) %}
WITH mom_change as (
SELECT
MD5(uuid || created_at) AS unique_key,
uuid,
created_at,
ping_source,
company,
edition,
... |
<filename>streaming-platforms/models/staging/imdb/stg_imdb_movies__genres.sql
with stg_imdb_movies as (
select unnest(string_to_array(genres, ', ')) as genre,
uid,
title_id
from {{ ref('stg_imdb_movies') }}
group by genre, uid, title_id
)
select *
from stg_imdb_movies |
CREATE TABLE [dbo].[GcCourse]
(
[EducationOrganizationId] INT NOT NULL,
[SchoolYear] SMALLINT NOT NULL,
[SchoolId] INT NOT NULL,
[LocalCourseCode] nvarchar(60) NOT NULL,
[SessionName] nvarchar(60) NOT NULL,
[SectionIdentifier] nvarchar(255) NOT NULL,
[LocalCourseTitle] nvarchar(60) NULL,
... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : sam. 18 mai 2019 à 13:37
-- Version du serveur : 10.1.25-MariaDB
-- Version de PHP : 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 ... |
<filename>SQL Server Query Step-by-step/Part .01/Views.sql
Select * from tblEmployee
select * from tblDepartment
Create View vwEmployeeBYDepartmentID
as
Select tblEmployee.ID, Name,Salary, gender, DepartmentName
from tblEmployee
join tblDepartment
on tblEmployee.DepartmentId= tblDepartment.ID
--cause ... |
## 根据班级id及教材编码查找相关数据
#macro($ymFindByClassAndTextbook(textbookCode,classId))
SELECT * FROM diagno_class_textbook t WHERE t.class_id = :classId AND t.textbook_code = :textbookCode
#end
## 根据班级id及教材编码查找相关数据
#macro($ymFindByClassAndTextbooks(textbookCodes,classId))
SELECT * FROM diagno_class_textbook t WHERE t.class_id =... |
<gh_stars>1-10
#
# This removes all tables in the database since our database.sql
# file will only drop DBs itself is creating, and we need to get
# rid of things like Grid fields that may have been created
#
SET FOREIGN_KEY_CHECKS = 0;
SET GROUP_CONCAT_MAX_LEN=32768;
SET @tables = NULL;
SELECT GROUP_CONCAT(table_name... |
BEGIN
<<outer_loop>>
FOR i IN 1..3 LOOP
<<inner_loop>>
FOR i IN 1..3 LOOP
IF outer_loop.i = 2 THEN
DBMS_OUTPUT.PUT_LINE
( 'outer: ' || TO_CHAR(outer_loop.i) || ' inner: '
|| TO_CHAR(inner_loop.i));
END IF;
END LOOP inner_loop;
END LOOP outer_lo... |
<reponame>evryfs/ClickHouse<gh_stars>10-100
DROP DATABASE IF EXISTS dict_db_01254;
CREATE DATABASE dict_db_01254;
USE dict_db_01254;
CREATE TABLE dict_data (key UInt64, val UInt64) Engine=Memory();
CREATE DICTIONARY dict
(
key UInt64 DEFAULT 0,
val UInt64 DEFAULT 10
)
PRIMARY KEY key
SOURCE(CLICKHOUSE(HOST 'localh... |
CREATE PROCEDURE SP542(OUT MYCOUNT INTEGER) SPECIFIC SP542_33450 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE477;SELECT COUNT(*)INTO MYCOUNT FROM TABLE447;SELECT COUNT(*)INTO MYCOUNT FROM TABLE330;SELECT COUNT(*)INTO MYCOUNT FROM... |
DROP TYPE IF EXISTS Getsystem_statistics_rs CASCADE;
CREATE TYPE Getsystem_statistics_rs AS (val INT);
CREATE OR REPLACE FUNCTION Getsystem_statistics (
v_entity VARCHAR(10), -- /*VM,HOST,USER,SD*/
v_status VARCHAR(20)
) -- comma-separated list of status values
RETURNS Getsystem_statistics_rs STABLE AS $... |
-- @description : Alter UAO tables and execute DML statements on the tables
--
-- Create AO tables
DROP TABLE if exists sto_alt_uao1_default;
CREATE TABLE sto_alt_uao1_default(
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4 NOT NULL,... |
--
-- create tables
--
DROP TABLE IF EXISTS products;
CREATE TABLE products (
id INTEGER PRIMARY KEY AUTOINCREMENT,
code VARCHAR(15),
name VARCHAR(255),
description TEXT,
price NUMERIC(10, 2),
kleur_id INTEGER,
product_kleur_id INTEGER,
maat_id INTEGER,
product_maat_id INTEGER,
categorie_id INTEGE... |
INSERT INTO ApplicationTables
SELECT name AS TableName, "REFERENCE" AS Model
FROM [Reference.accdb].MSysObjects
WHERE name NOT LIKE "_#%" AND
name NOT LIKE "#%" AND
name NOT LIKE "f_#%" AND
name NOT LIKE "f_%" AND
name NOT LIKE "tbl_%" AND
name NOT LIKE "USys%" AND
name NOT LIKE "MSys%" AND
... |
<gh_stars>0
-- RenameIndex
ALTER INDEX "Booking_uid_key" RENAME TO "Booking.uid_unique";
-- RenameIndex
ALTER INDEX "DestinationCalendar_bookingId_key" RENAME TO "DestinationCalendar.bookingId_unique";
-- RenameIndex
ALTER INDEX "DestinationCalendar_eventTypeId_key" RENAME TO "DestinationCalendar.eventTypeId_unique";... |
create or replace function fm_assign(int)
returns BIT[]
AS
$$
declare
dim ALIAS for $1;
retVal bit(16)[];
bitStr bit(16);
rndNum numeric;
index int;
BEGIN
for i in 1..dim LOOP
retVal[i] := 0::bit(16);
select random() into rndNum;
select floor(log(0.5, rndNum)) into index;
if index >= 16 then
index := 15
e... |
<gh_stars>0
create table company (
id serial primary key,
name text not null unique,
inn text not null unique
);
create table orders (
id serial primary key,
id_client integer not null references company
); |
<filename>seperate-tablesDB/users.sql
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 06, 2020 at 04:59 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
... |
<reponame>Yuri47/newerplte
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Tempo de geração: 05/11/2016 às 13:56
-- Versão do servidor: 5.7.16-0ubuntu0.16.04.1
-- Versão do PHP: 7.0.8-0ubuntu0.16.04.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+0... |
<filename>src/main/resources/db/migration/V19__Add_Albums_Labels_Data.sql<gh_stars>0
INSERT INTO albums_labels (album_id, label_id) VALUES (1, 1);
INSERT INTO albums_labels (album_id, label_id) VALUES (1, 2);
INSERT INTO albums_labels (album_id, label_id) VALUES (2, 1);
INSERT INTO albums_labels (album_id, label_id) V... |
<gh_stars>1-10
CREATE TABLE categories (
category_code VARCHAR(5) PRIMARY KEY,
category VARCHAR(50)
);
CREATE TABLE countries (
country_code CHAR(3) PRIMARY KEY,
country VARCHAR(50),
continent VARCHAR(20)
);
CREATE TABLE businesses (
business VARCHAR(64) PRIMARY KEY,
year_founded INT,
category_code VA... |
<filename>sql/functions/ConvertOffsetToLocalDateTime.sql<gh_stars>1-10
IF EXISTS (
SELECT * FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_NAME = 'ConvertOffsetToLocalDateTime'
AND ROUTINE_SCHEMA = 'dbo'
AND ROUTINE_TYPE = 'FUNCTION'
)
BEGIN
DROP FUNCTION [dbo].[ConvertOffsetToLocalDateTime];
END
... |
WITH RECURSIVE
comment_friends_closed_init(commentid, head_userid, tail_userid) AS (
-- transitive closure (reachability-only, no path is recorded)
-- of friendship-subgraphs defined by comment likes
-- start with the users that liked a specific comment.
-- They are the vertices of the projected users graph fo... |
CREATE OR REPLACE FUNCTION "public"."geoc_transform_lon"("x" numeric, "y" numeric)
RETURNS "pg_catalog"."numeric" AS $BODY$
DECLARE
ret numeric;
BEGIN
ret := 300 + x + 2 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * sqrt(abs(x));
ret :=ret + (20 * sin(6 * x * pi()) + 20 * sin(2 * x * pi())) * 2 / 3;
ret :... |
-- file:foreign_data.sql ln:519 expect:true
CREATE FUNCTION dummy_trigger() RETURNS TRIGGER AS $$
BEGIN
RETURN NULL
|
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/select/867ec441.sql
-- file:jsonb.sql ln:137 expect:true
SELECT test_json ->> 6 FROM test_jsonb WHERE json_type = 'array'
|
CREATE TABLE WATERMARK(
WATERMARK_ID NUMBER(12,0) NOT NULL,
STATUS_CODE VARCHAR2(8 BYTE) NOT NULL,
WATERMARK_TEXT VARCHAR2(100 BYTE) NOT NULL,
WATERMARK_STATUS CHAR(1 BYTE) NOT NULL,
FONT_SIZE VARCHAR2(5 BYTE),
FONT_COLOUR VARCHAR2(50 BYTE),
UPDATE_TIMESTAMP DATE NOT NULL,
VER_NBR NUMBER(8,0) NOT NULL,
OBJ_ID ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.