sql
stringlengths
6
1.05M
CREATE DATABASE to_go_out_db CHARACTER SET utf8 COLLATE utf8_unicode_ci; USE to_go_out_db; CREATE TABLE users ( id_user INT(3) NOT NULL AUTO_INCREMENT, pseudo VARCHAR(25) NOT NULL, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, PRIMARY KEY (id_user) ) ENGINE=INNODB; CREATE TABLE events ( id...
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET AUTOCOMMIT = 0; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET ...
<gh_stars>1-10 -- Процедура CLR -- Инфляция ( CREATE OR REPLACE PROCEDURE update_prices(coeff_ FLOAT) AS $$ plan = plpy.prepare("UPDATE courses SET price = price * ($1)", ["FLOAT"]) plpy.execute(plan, [coeff_]) $$ language plpython3u; call update_prices(1.1);
<filename>Chapter06/08_using_own_clr_aggregation_and_t_sql_batch.sql declare @nThMoment int = 3 -- calculation using T-SQL ;with cte as ( select * from (values (1.), (.5), (2.), (3.)) as vals(c) ) , cte2 as ( select power(c - (select AVG(c) from cte), @nThMoment) as pwr from cte ) select sum(pwr) / (select count(*) f...
<reponame>xvanausloos/Snowflake-Cookbook<filename>Chapter04/r2/01_task_tree.sql<gh_stars>10-100 --We will be using a fictitious query on the sample data SELECT C.C_NAME,SUM(L_EXTENDEDPRICE),SUM(L_TAX) FROM SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.CUSTOMER C INNER JOIN SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.ORDERS O ON O.O_CUSTKEY = ...
INSERT INTO b_tuid (n) SELECT n FROM generate_series(1, 100000) s(n);
---------------ECON_reward_by_missiontargettype-------------- --Mission bonuses by type balance --See Econ Spreadsheet for details USE [perpetuumsa] GO DECLARE @TEMPTARGETREWARDS TABLE ( name varchar(50), reward int ) --rewards by objective INSERT INTO @TEMPTARGETREWARDS VALUES ('loot_item',50), ('kill_definit...
<reponame>dram/metasfresh<filename>backend/de.metas.business/src/main/sql/postgresql/system/20-de.metas.business/5505390_sys_gh4737-app_update_packagename_of_AttributeGeneratorValidationRule.sql -- 2018-11-01T21:22:23.054 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Val_Rule SET Classname...
ALTER TABLE CHANGG ADD NUMBRR CHAR(11); ALTER TABLE CHANGG DROP NAAM RESTRICT; ALTER TABLE CHANGG ADD COLUMN DIVORCES INT DEFAULT 0; ALTER TABLE USIG ADD COLUMN NUL INT; ALTER TABLE T0878 ADD C2 CHAR (4); ALTER TABLE USIG ADD(COL3 INTEGER, COL4 SMALLINT); ALTER TABLE X ADD D INT; ...
<reponame>jtalmi/dbt-data-reliability {% macro full_table_name() -%} upper(concat(database_name, '.', schema_name, '.', table_name)) {%- endmacro %} {% macro full_schema_name() -%} upper(concat(database_name, '.', schema_name)) {%- endmacro %} {% macro full_column_name() -%} upper(concat(database_name, '....
<gh_stars>10-100 CREATE TABLE items( iid INT NOT NULL PRIMARY KEY, sku INT, oid INT, GROUPING FOREIGN KEY(oid) REFERENCES orders, INDEX(items.sku, orders.odate, customers.name) USING LEFT JOIN )
-- migrate:up create table password_reset ( id UUID, username varchar(255) NOT NULL, used BOOLEAN NOT NULL, creation_timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, expiration_timestamp timestamp NOT NULL, PRIMARY KEY (i...
select * from table1 cross join table2 join table3 on table1.id = table3.id inner join table4 on table1.id = table4.id left outer join table5 on table1.id = table5.id right outer join table6 on table1.id = table6.id full outer join table7 on table1.id = table7.id join table8 inner join table9 left outer join ...
/* Copyright 2020-2021 Snowplow Analytics Ltd. All rights reserved. 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...
CREATE FUNCTION func132() RETURNS integer LANGUAGE plpgsql AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE313);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE409);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE35);val:=(SELECT COUNT(*)INTO MYCOUN...
alter table `t_messages` add column `_content_type` int(11) NOT NULL DEFAULT '0';
select `bar`(1, 10), `bar`(1, 10, `rgb`(255, 0, 0), `color`('#0f0'))
declare @CollectionID varchar(8) DECLARE @Now DateTime = GetDate() set @CollectionID = 'P010002E' select distinct rsy.ResourceID, rsy.Name0 as 'Device HostName', case rsy.Client0 when 1 then 'Enabled' else 'Disabled' end as 'SCCM Managed', case when chc.IsActiveHW is null then 'Disabled' when chc.IsAc...
-- 修改 e_audit_outgoing_data表的create_time和modify_time的数据类型 alter table e_audit_outgoing_data modify create_time DATE; alter table e_audit_outgoing_data modify modify_time DATE; alter table e_audit_outgoing_data modify time DATE;
DROP DATABASE IF EXISTS burgers_db; CREATE DATABASE burgers_db; USE burgers_db; CREATE TABLE burgers( id INTEGER AUTO_INCREMENT PRIMARY KEY, burger_name VARCHAR(50), devoured BOOLEAN, date TIMESTAMP);
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 16, 2022 at 05:20 PM -- Server version: 10.4.17-MariaDB -- PHP Version: 7.4.15 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIE...
ALTER TABLE portti_terms_of_use_for_publishing RENAME TO oskari_terms_of_use_for_publishing;
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 1172.16.31.10 -- Generation Time: 17-Maio-2018 às 06:42 -- Versão do servidor: 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 SE...
 CREATE PROCEDURE [dbo].[app_SchoolCrosswalk_Export] @TenID INT = NULL AS BEGIN SET NOCOUNT ON; SELECT s.[Code] AS [SchoolName], st.[Code] AS [SchoolType], d.[Code] AS [DistrictName], NULLIF(scw.[MinGrade], 0) AS [MinGrade], NULLIF(scw.[MaxGrade], 0) AS [MaxGrade], NULLIF(scw.[MinAge], 0) AS [MinAge], N...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 29, 2020 at 07:52 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.2.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIE...
<gh_stars>0 DROP TABLE IF EXISTS users CASCADE; DROP TABLE IF EXISTS habits CASCADE; DROP TABLE IF EXISTS habit_logs; CREATE TABLE users ( id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, phone_number VARCHAR(20), pin INTEGER, password VARCHAR(20), password_hash TEXT, user_photo_url TEXT );...
<filename>mxonline2.sql<gh_stars>1-10 /* Navicat Premium Data Transfer Source Server : ght_ubuntu Source Server Type : MySQL Source Server Version : 50717 Source Host : 172.16.58.3:3306 Source Schema : mxonline2 Target Server Type : MySQL Target Server Version : 50717 File Enc...
-- file:jsonb.sql ln:79 expect:true select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04')
-- file:json.sql ln:494 expect:true SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q
-- Copyright (c) Microsoft Corporation. -- Licensed under the MIT License. CREATE EXTERNAL TABLE [External].[IATIRecipientRegion] ( [iati-identifier] NVARCHAR(50) NOT NULL, [recipient-region_code] NVARCHAR(100) NULL, [recipient-region] NVARCHAR(4000) NULL, [recipient-region_percentage] NVARC...
<filename>World/ALive/RC2/world/2011-09-14-09_spell_target_position.sql DELETE FROM `spell_target_position` WHERE `id` IN (46233,52462,54963); INSERT INTO `spell_target_position` (`id` ,`target_map` ,`target_position_x` ,`target_position_y` ,`target_position_z` ,`target_orientation`) VALUES (46233,571,3202.959961,5274....
set pagesize 10000 linesize 300 tab off col tablespace_name format A22 heading "Tablespace" col ts_type format A13 heading "TS Type" col segments format 999999 heading "Segments" col files format 9999 col allocated_mb format 9,999,990.000 headin...
DROP FUNCTION IF EXISTS website.get_menu_id_by_menu_name(_menu_name national character varying(500)); CREATE FUNCTION website.get_menu_id_by_menu_name(_menu_name national character varying(500)) RETURNS integer AS $$ BEGIN RETURN ( SELECT menu_id FROM website.menus WHERE menu_name = _menu_name AND NOT ...
select district__state_i_d as district_state_id, district_name as local_education_agency_name, school_name as school_name, split(split(term_name, "-")[OFFSET(0)], " ")[OFFSET(0)]...
CREATE TABLE `main_table` ( `id` INT NOT NULL, `grp` VARCHAR(20) DEFAULT NULL, `value` INT DEFAULT NULL, `comment` TEXT DEFAULT NULL, PRIMARY KEY (id) );
--DROP FUNCTION alpha; /** * This function computes the ra expansion for a given theta at * a given declination. * theta and decl are both in degrees. * * For a derivation, see MSR TR 2006 52, Section 2.1 * http://research.microsoft.com/apps/pubs/default.aspx?id=64524 */ CREATE FUNCTION alpha(theta DOUBLE PREC...
DROP INDEX IF EXISTS "content_Element_accessToken";
<reponame>jantonv/XCoLab<filename>microservices/services/contest-service/src/test/resources/schema.sql DROP TABLE `xcolab_ProposalContestPhaseAttribute` IF EXISTS; CREATE TABLE `xcolab_ProposalContestPhaseAttribute` ( `id_` bigint(20) NOT NULL AUTO_INCREMENT, `proposalId` bigint(20) DEFAULT NULL, `contestPhaseId`...
/* ****** Problem 3 -> Add foreign key to table ****** */ USE Minions ALTER TABLE Minions ADD TownId INT FOREIGN KEY REFERENCES Towns(Id) /* SELECT * FROM Minions */
DROP TABLE IF EXISTS department; CREATE TABLE department ( department_id INT NOT NULL AUTO_INCREMENT, department_name VARCHAR(255) NOT NULL UNIQUE, PRIMARY KEY (department_id) );
<filename>database/bkp_bd/aquiMarceneiro_db_OLD.sql -- -------------------------------------------------------- -- Servidor: 127.0.0.1 -- Versão do servidor: 10.1.19-MariaDB - mariadb.org binary distribution -- OS do Servidor: Win32 -- HeidiSQL Versão: 9.4.0.5125...
-- name: GetThreadMessages :many select * from thread_messages order by id desc limit $1; -- name: CreateThreadMessage :one insert into thread_messages (message, created_at) values ($1, $2) RETURNING *;
CREATE TABLE `productbundleitem` ( `ProductBundleItemID` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `ProductBundleID` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `ProductID` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, PRIMARY KEY (`ProductBundleItemID...
ALTER TABLE configuracion ADD COLUMN tiempo_expiracion_publicaciones INT(11) NULL; UPDATE configuracion SET tiempo_expiracion_publicaciones = 30; ALTER TABLE configuracion MODIFY tiempo_expiracion_publicaciones INT(11) NOT NULL; ALTER TABLE categoria ADD COLUMN tiempo_expiracion_publicaciones INT(11) NULL; ALTER TABL...
CREATE TABLE [dbo].[RoomTypes] ( [Id] INT NOT NULL PRIMARY KEY IDENTITY, [Title] NVARCHAR(50) NOT NULL, [Description] NVARCHAR(2000) NOT NULL, [Price] MONEY NOT NULL )
SELECT resourceId, resourceName, resourceType, configuration.instanceType, configuration.imageId, availabilityZone, configuration.state.name WHERE resourceType = 'AWS::EC2::Instance' AND configuration.imageId <> 'ami-golden-ami-id'
<gh_stars>100-1000 CREATE OR REPLACE FUNCTION AuthorizeSlaveZones( zonenames varchar[], account_id_to_auth int ) RETURNS int AS $$ DECLARE account_check INT; BEGIN FOR i IN array_lower(zonenames, 1) .. array_upper(zonenames, 1) LOOP SELECT account_id INTO account_check FROM slavezone WHERE slavezone.name ...
<reponame>Czembri/ITSerwis<gh_stars>1-10 CREATE TABLE ITEM ( ID int AUTO_INCREMENT, BARCODE int , LOCATIONID int, SUBCATEGORYID int, VENDORID int, TAXRATEID int, DESCRIPTION VARCHAR(200), WEIGHT VARCHAR(20), LASTRECEIVEDDATE DATE, ITEMTYPEID INT, WARRANTYRETURNS int, ACTIVITYSTATUS INT, NAME VARCHAR(100), ...
-- Gets the last comment for a post by the post's ID. SELECT id, post_id, user_id, created_at, updated_at, body, is_spam FROM comments WHERE post_id = ? ORDER BY updated_at DESC LIMIT 1
<reponame>dram/metasfresh<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5532090_sys_gh5544_fix_trl.sql<gh_stars>1000+ -- 2019-09-26T10:22:47.639Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Ref_List SET Name='kürzeste Haltbar...
/* SQLyog Ultimate v11.11 (64 bit) MySQL - 5.5.53 : Database - xw ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FO...
INSERT INTO `citasmedicas`.`paciente` (`idPaciente`, `nombrePaciente`, `cedula`) VALUES ('1', '<NAME>', '12365478'); INSERT INTO `citasmedicas`.`especialista` (`idEspecialista`, `nombreEspecialista`, `especialidad`, `tarifa`, `maximoDiasAgendables`) VALUES ('1', 'Pedro Especialista', 'Nutricionista', '200000', '7'); IN...
<reponame>anrodigina/ClickHouse<gh_stars>1-10 DROP TABLE IF EXISTS partitioned_by_tuple_replica1; DROP TABLE IF EXISTS partitioned_by_tuple_replica2; CREATE TABLE partitioned_by_tuple_replica1(d Date, x UInt8, w String, y UInt8) ENGINE = ReplicatedSummingMergeTree('/clickhouse/tables/test/partitioned_by_tuple', '1') PA...
/****** Object: View [dbo].[V_Data_Package_Detail_Report] ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE VIEW [dbo].[V_Data_Package_Detail_Report] AS SELECT DP.ID, DP.Name, DP.Package_Type AS [Package Type], DP.Description, DP.[Comment], ISNULL(U1.U_Nam...
-- -- Where is an object referenced? -- -- See also -> find_unreferenced_objects.sql and -> dep.sql -- select type, name from dba_dependencies where lower(referenced_name) = lower('&1');
show parameter recovery%dest SELECT * FROM v$recovery_area_usage;
SELECT zdb. count('idxso_posts', '({"term": {"body": "java"}})');
<filename>sql/startruth/star_truth_summary_data.sql \copy star_truth_test.truth_summary (id, host_galaxy, ra, dec, redshift, is_variable, is_pointsource, flux_u, flux_g, flux_r, flux_i, flux_z, flux_y, flux_u_noMW, flux_g_noMW, flux_r_noMW, flux_i_noMW, flux_z_noMW, flux_y_noMW) from '/global/cscratch1/sd/jrbogart/star...
ALTER TABLE `organization` CHANGE `address` `visit_address` VARCHAR( 100 ) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL , CHANGE `address2` `visit_address2` VARCHAR( 100 ) CHARACTER SET latin1 COLLATE latin1_bin NULL DEFAULT NULL , CHANGE `zipcode` `visit_zipcode` VARCHAR( 20 ) CHARACTER SET latin1 COLLATE...
<filename>8 a 18 de julho/QUERYS/Carro.sql SELECT ' CARROS' as 'CARROS', SUM(Temp.Media) as' Vendas', Temp.Ano from (select Modelo, Ano, (SUM(NumVendas) /COUNT(*)) as 'Media', year(DataVenda) as 'Total por Ano' FROM Carro Group BY Modelo, Ano, year(DataVenda)) Temp group BY Temp.Ano
<reponame>MertYumer/CSharp-DB-Exams SELECT TOP 5 r.Id, r.Name, COUNT(c.Id) AS Commits FROM Repositories r JOIN RepositoriesContributors rc ON rc.RepositoryId = r.Id JOIN Users u ON u.Id = rc.ContributorId JOIN Commits c ON c.RepositoryId = r.Id GROUP BY r.Id, r.Name ORDER BY COUNT(c.Reposi...
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 18, 2021 at 04:55 PM -- Server version: 10.4.18-MariaDB -- PHP Version: 7.4.16 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIE...
<filename>db_jual_motor.sql -- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: 03 Jul 2019 pada 10.49 -- Versi Server: 10.1.13-MariaDB -- PHP Version: 5.6.23 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_C...
<reponame>usefull3app/rainbowland SET @Alchemy := 900065, @Blacksmithing := 900066, @Enchanting := 900067, @Engineering := 900068, @Inscription := 900069, @Jewelcrafting := 900070, @Leatherworking := 900071, @Tailoring := 900074, @Cooking := 900085, @NAME := "神秘商人"; # delete al...
<reponame>Amaterazu7/farmaUNLa<filename>ExportBase-21-06-2018.sql -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) -- -- Host: localhost Database: testfarma -- ------------------------------------------------------ -- Server version 5.5.60 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!...
DROP DATABASE IF EXISTS services_db; CREATE DATABASE services_db;
-- Compute the gaps WITH request_gaps AS ( SELECT date_created, -- lead or lag LAG(date_created) OVER (ORDER BY date_created) AS previous, -- compute gap as date_created minus lead or lag date_created - LAG(date_created) OVER (ORDER BY date_created) AS g...
<gh_stars>1-10 DROP TABLE EGPT_MV_CURRENT_FLOOR_DETAIL; CREATE TABLE EGPT_MV_CURRENT_FLOOR_DETAIL AS SELECT basicproperty.id AS basicPropertyId, currpropdet.id_property AS propertyId, usage.usg_name AS natureOfUsage, propdet.id_propertytypemaster AS propertyType, floordet.floor_no AS floorNo, f...
select 'function' __typename ,'public' || '.' || p.proname || '--' || replace(replace(coalesce(pg_catalog.pg_get_function_identity_arguments(p.oid), 'N/A'),', ','_'),' ',':') id ,p.proname function_name ,n.nspname function_schema ...
<gh_stars>1000+ -- 2018-03-20T14:28:54.685 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Element SET ColumnName='IsQuarantineWarehouse', Name='IsQuarantineWarehouse', PrintName='IsQuarantineWarehouse',Updated=TO_TIMESTAMP('2018-03-20 14:28:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE A...
use mproject; DROP TABLE IF EXISTS tb_ProjectRoleType; -- MService project role type CREATE TABLE tb_ProjectRoleType ( -- role id of this team member intProjectRoleId INT NOT NULL, -- creation date dtmCreated DATETIME NOT NULL, -- modification date dtmModified DATETIME NOT NULL, -- deleti...
<gh_stars>0 SELECT * FROM mysql_servers;
-- system_patches INSERT INTO `system_patches` (`issue`, `created`) VALUES ('POCOR-3459', NOW()); -- institutions ALTER TABLE `institutions` MODIFY COLUMN `classification` INT(1) NOT NULL DEFAULT '1' COMMENT '1 -> Academic Institution, 2 -> Non-academic institution'; UPDATE `institutions` SET `classification` = 2 WHE...
<reponame>opowbow/cpp-samples<filename>getting-started/gcs_objects.sql -- Copyright 2021 Google LLC -- -- 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/license...
{%- set source_model = "v_stg_orders" -%} {%- set src_pk = "ORDER_PK" -%} {%- set src_hashdiff = "ORDER_HASHDIFF" -%} {%- set src_payload = ["ORDERSTATUS", "TOTALPRICE", "ORDERDATE", "ORDERPRIORITY", "CLERK", "SHIPPRIORITY", "ORDER_COMMENT"] -%} {%- set src_eff = "EFFECTIVE_FROM" -%} {%- set src_...
/** * Script for cleaning up the schema for PostgreSQL used for the AccountsDb plugin. */ DROP FUNCTION audit_account_update; DROP TABLE account_audit; DROP TABLE account;
select last_name, department_name from employees@remote, departments where employees.department_id = departments.department_id
<filename>apgdiff.tests/src/main/resources/cz/startnet/utils/pgdiff/modify_materialized_view_new.sql CREATE TABLE public.testtable ( c1 integer NOT NULL, c2 text NOT NULL, c3 text ); ALTER TABLE public.testtable OWNER TO galiev_mr; CREATE MATERIALIZED VIEW public.testview_1 AS SELECT * FROM public.tes...
/* * Function to turn a table into the parent of a partition set */ CREATE FUNCTION create_parent( p_parent_table text , p_control text , p_type text , p_interval text , p_constraint_cols text[] DEFAULT NULL , p_premake int DEFAULT 4 , p_use_run_maintenance boolean DEFAULT NULL , p_st...
<gh_stars>1-10 drop table stress_iterations_table;
<filename>gpMgmt/bin/gppylib/test/behave/mgmt_utils/steps/data/gptransfer/post/ddl/create_heap_tables.sql \c gptest; select * from sto_heap1 order by col_numeric; Create index sto_heap1_idx1 on sto_heap1(col_numeric); select * from sto_heap1 order by col_numeric; Create index sto_heap1_idx2 on sto_heap1 USING bitma...
ALTER TABLE `member_investments` CHANGE `installment_type_id` `installment_type` VARCHAR(255) NOT NULL; ALTER TABLE `member_investments` CHANGE `installment_date` `installment_date` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; ALTER TABLE `member_investments` ADD `last_installment_date` ...
<filename>structure.sql CREATE TABLE IF NOT EXISTS `user` ( `id` bigint NULL DEFAULT NULL COMMENT 'Unique user identifier', `first_name` CHAR(255) NOT NULL DEFAULT '' COMMENT 'User first name', `last_name` CHAR(255) DEFAULT NULL COMMENT 'User last name', `username` CHAR(255) DEFAULT NULL COMMENT 'User username...
<filename>mysql/breakblog-ssm_post.sql -- MySQL dump 10.13 Distrib 8.0.18, for Win64 (x86_64) -- -- Host: localhost Database: breakblog-ssm -- ------------------------------------------------------ -- Server version 5.7.28-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHAR...
DROP FUNCTION IF EXISTS permission_check_livestock_map; CREATE FUNCTION permission_check_livestock_map ( IN user_id INT , IN livestock_map_id INT , OUT permission_check BOOLEAN ) AS $body$ BEGIN SELECT EXISTS ( SELECT fp.user_id, cm.id FROM farm_permissions AS fp JOIN livestock_maps AS cm ON fp.farm_i...
-------------------------------------------------------- -- 파일이 생성됨 - 금요일-7월-26-2019 -------------------------------------------------------- -------------------------------------------------------- -- DDL for Table PRJ_PSTATIONS -------------------------------------------------------- CREATE TABLE "HR"."PRJ_PS...
DROP VIEW participants; DROP VIEW skilllevels; DROP VIEW locations; DROP VIEW boattypes; DROP VIEW boatstyles; DROP VIEW boats; DROP VIEW paddles; DROP VIEW shafts; DROP VIEW trailers; DROP VIEW users; DROP VIEW failedlogins; DROP VIEW logins; DROP VIEW exposedviews; DROP TABLE participants_tbl; DROP TABLE skilllevels...
<gh_stars>0 CREATE TABLE if not exist CREATE TABLE jokes ( id INT PRIMARY KEY, type VARCHAR (50) NOT NULL, setup VARCHAR (50) NOT NULL, punchline VARCHAR(50), );
<reponame>Dynart/SistemaTaller.BackEnd CREATE TABLE EstadoReparaciones( IdEstadoReparacion INT, NombreEstado VARCHAR(15) NOT NULL, Activo BIT DEFAULT(1) NOT NULL, FechaCreacion DATETIME DEFAULT GETDATE() NOT NULL, FechaModificacion DATETIME, CreadoPor VARCHAR(60), ModificadoPor VARCHAR(60), CONSTRAINT PK_Estad...
-- PRAGMA page_size=1024; -- PRAGMA encoding='UTF-8'; -- PRAGMA auto_vacuum=NONE; -- PRAGMA max_page_count=1073741823; BEGIN TRANSACTION; -- Table assets DROP TABLE IF EXISTS assets; CREATE TABLE assets( asset_id TEXT UNIQUE, asset_name TEXT UNIQUE, b...
/* Warnings: - You are about to drop the column `institute_id` on the `Project` table. All the data in the column will be lost. */ -- AlterEnum -- This migration adds more than one value to an enum. -- With PostgreSQL versions 11 and earlier, this is not possible -- in a single migration. This can be worked aroun...
-- Procedure MemberLink_Set SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE dbo.MemberLink_Set ( @MemberLinkId int = -1, @UserId int, @MemberId int, @ExternalIdNo nvarchar(50), @HomeAddressLine1 nvarchar(250), @HomeAddressLine2 nvarchar(250), @HomeAddressStateCode int, @HomeAddres...
CREATE OR REPLACE FUNCTION message_store.get_stream_messages( stream_name varchar, "position" bigint DEFAULT 0, batch_size bigint DEFAULT 1000, condition varchar DEFAULT NULL ) RETURNS SETOF message_store.message AS $$ DECLARE _command text; _setting text; BEGIN IF is_category(get_stream_messages.stream_n...
<reponame>ministryofjustice/prison-visits-2<filename>db/views/distribution_by_prison_and_calendar_weeks_v01.sql SELECT prisons.name AS prison_name, PERCENTILE_DISC(ARRAY[0.99, 0.95, 0.90, 0.75, 0.50, 0.25]) WITHIN GROUP (ORDER BY ROUND(EXTRACT(EPOCH FROM vsc.created_at - v.created_at))::integer) AS perc...
<reponame>gianlucampos/crud-react-backend DROP TABLE IF EXISTS artista,musica,album,playlist; DROP SEQUENCE IF EXISTS seqartista,seqmusica,seqalbum,seqplaylist; CREATE SEQUENCE seqartista INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1 NO CYCLE; C...
<gh_stars>10-100 -- file:numeric.sql ln:137 expect:true INSERT INTO num_exp_sub VALUES (2,8,'-34413373.215397047')
-- file:plpgsql.sql ln:1395 expect:true insert into Hub values ('base.hub1', 'Patchfield PF0_1 hub', 16)
<gh_stars>1000+ -- Your SQL goes here CREATE TABLE sessions ( token TEXT PRIMARY KEY )
<reponame>max7-alpha/projectwork -- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 24, 2020 at 10:19 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zon...
-- 27/03/2015 - assign additional products ALTER TABLE `products` ADD `is_additional` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_hidden`; UPDATE `products` SET `is_additional` = 1 WHERE belongs_to IS NOT NULL AND belongs_to <> '';