sql
stringlengths
6
1.05M
CREATE TABLE cities ( id serial primary key, name varchar(80) );
<gh_stars>0 CREATE TABLE Student ( StudentName VARCHAR(60), StudentAge INT(4), StudentEmailAddress VARCHAR(120) ); INSERT INTO Student VALUES('<NAME>', 19, '<EMAIL>'); INSERT INTO Student VALUES('<NAME>', 34, '<EMAIL>'); INSERT INTO Student VALUES('<NAME>', 58, '<EMAIL>'); COMMIT; INSERT...
<reponame>dibley1973/SimpleCQRSExample<filename>SimpleCQRSExample/07.01.SimpleCqrsDatabase/customer/Tables/Address.sql<gh_stars>1-10 CREATE TABLE [customer].[Address] ( [AddressId] INT IDENTITY (1, 1) NOT NULL , [NumberOrName] VARCHAR(30) NOT NULL , [StreetName] VARCHAR(100) NOT NULL , ...
-- ---------------------------------------------------------------------------- -- Table AdventureWorksLT.ProductModel -- ---------------------------------------------------------------------------- INSERT `AdventureWorksLT`.`ProductModel` (`ProductModelID`, `Name`, `CatalogDescription`, `rowguid`, `ModifiedDate`) VALU...
{% macro is_project_part_of_product() %} {%- call statement('get_project_ids', fetch_result=True) %} SELECT DISTINCT project_id FROM {{ref('projects_part_of_product')}} WHERE project_id IS NOT NULL {%- endcall -%} {%- set value_list = load_result('get_project_ids') -%} {%- i...
<filename>hackerrank/sql/Weather-Observation-Station-9/Weather-Observation-Station-9.sql select distinct city from station where city not regexp '^[aieouAIEOU].*';
<reponame>alexOarga/docker-nginx-flask-celery-mysql-redis CREATE DATABASE EXAMPLEDB; use EXAMPLEDB; CREATE TABLE EXAMPLE_TABLE ( UUID varchar(100) NOT NULL, PRIMARY KEY ( UUID ) );
<filename>egov/egov-bpa/src/main/resources/db/migration/main/V20190401113712__bpa_stakeholder_type_add_regfee_auto_licence_dtl.sql alter table IF EXISTS state.EGBPA_MSTR_STAKEHOLDERTYPE ADD COLUMN IF NOT EXISTS regFee numeric not null default 500; alter table IF EXISTS state.EGBPA_MSTR_STAKEHOLDERTYPE ADD COLUMN IF ...
INSERT INTO simplecourse.student (id, name, state, update_time, institute_id) VALUES (18214470, 'aa', 0, 1544696005000, 1); INSERT INTO simplecourse.student (id, name, state, update_time, institute_id) VALUES (18214471, '维明', 0, 1544695820000, 1);
<gh_stars>1-10 SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[EventLogConfig]( [ID] [int] IDENTITY(1,1) NOT NULL, [LogTypeKey] [nvarchar](35) NULL, [LogTypePortalID] [int] NULL, [LoggingIsActive] [bit] NOT NULL, [KeepMostRecent] [int] NOT NULL, [EmailNotificationIsActive] [bit] NOT NULL, ...
-- =============================================== -- -- Configure Data Access Quick Starts EntLibQuickStarts Database -- -- =============================================== use master go IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'EntLibQuickStarts') DROP DATABASE [EntLibQuickStarts] --GO I...
USE `rdap`; INSERT INTO `RDAP_AUTNUM` (`AS_ID`,`HANDLE`,`START_AUTNUM`,`END_AUTNUM`,`NAME`,`TYPE`,`COUNTRY`,`LANG`,`PORT43`) VALUES (1,'as-1',62464,63487,'as-1:62464~63487','DIRECT ALLOCATION','CN','en','cnnic.cn'),(2,'as-2',1,19,'as-2:1~19','DIRECT ALLOCATION','CN','en','cnnic.cn'),(3,'as-3',9981,9981,'as-3:9981','D...
CREATE TABLE trade ( id VARCHAR(100), acountId INT8, tradeId INT8, cusip VARCHAR(10), units INT4, tradeDate DATE, action VARCHAR(10), amount INT8 );
-- @testpoint:openGauss保留关键字Asc作为视图名 --不带引号-合理报错 CREATE or replace VIEW Asc AS SELECT * FROM pg_tablespace WHERE spcname = 'pg_default'; --加双引号-创建成功 CREATE or replace VIEW "Asc" AS SELECT * FROM pg_tablespace WHERE spcname = 'pg_default'; --清理环境 drop VIEW "Asc"; --加单引号-合理报错 CREATE or re...
DELIMITER $$ DROP PROCEDURE IF EXISTS `sp_consulta_reporte_company_28` $$ CREATE DEFINER=`root`@`%` PROCEDURE `sp_consulta_reporte_company_28`() BEGIN DROP TEMPORARY TABLE IF EXISTS tmp_comercios; CREATE TEMPORARY TABLE IF NOT EXISTS tmp_comercios ( INDEX(store_id) ) AS ( select * FROM comercio_excel_company_28 ); D...
<filename>data/seed.sql INSERT INTO admins (name,password) VALUES ('admin','<PASSWORD>'); INSERT INTO rooms (name,adminid) VALUES ('Python for Web Developers' , 1), ('Web Development vs. Data Science' , 1), ('Frontend vs. Backend' , 1), ('Tech Startups 2021' , 1), ('Weirdest Mobile Apps' , 1), ('Developers Tool...
/* Warnings: - Added the required column `communityId` to the `posts` table without a default value. This is not possible if the table is not empty. */ -- AlterTable ALTER TABLE "posts" ADD COLUMN "communityId" TEXT NOT NULL; -- AddForeignKey ALTER TABLE "posts" ADD CONSTRAINT "posts_communityId_fkey" FOREIG...
/* leave this l:see LICENSE file g:utility k:web v:120823.1000\s.zaglio: short comment c:from http://www.simple-talk.com c:/sql/t-sql-programming/getting-html-data-workbench/ t:select * from fn__html_tag() */ CREATE function fn__html_tag() returns table as return SELECT [tag]='!DOCTYPE', [...
--Problem 1. Create Table Logs --Problem 2. Create Table Emails --Problem 3. Deposit Money --Problem 4. Withdraw Money --Problem 5. Money Transfer --Problem 6. Trigger --Problem 7. *Massive Shopping --Problem 8. Employees with Three Projects --Problem 9. Delete Employees --L-----------A-------BBB-------------...
<gh_stars>0 create function add_rank() returns trigger as $add_rank$ begin if new.parent_id is null then new.rank := lpad(new.id::text, 10, '0'); else new.rank := concat( (select rank from comments where id = new.parent_id), '-...
<reponame>heranYang93/employee-tracker INSERT INTO departments(name) VALUES ("Sales"),("Engineering"),("Finance"),("Legal"); INSERT INTO roles VALUES (1, "Salesperson",80000,1), (2, "Lead Engineer",150000,2), (3, "Software Engineer",120000,2), (4, "Account Manager",160000,3), (5, "Accountant",12500...
DROP TABLE IF EXISTS product CASCADE; CREATE TABLE product ( id INTEGER PRIMARY KEY, name VARCHAR(60), slogan VARCHAR(128), description VARCHAR(512), category VARCHAR(64), default_price NUMERIC(11,2), created_at TIMESTAMP DEFAULT Now(), updated_at TIMESTAMP DEFAULT Now() ); DROP TABLE IF EXISTS styles CASCADE;...
DROP VIEW AKTOR_STATUS; DROP VIEW DIALOG_STATUS; ALTER TABLE DIALOG DROP COLUMN skal_vente_pa_svar; ALTER TABLE DIALOG DROP COLUMN markert_som_ferdigbehandlet; ALTER TABLE DIALOG ADD siste_vente_pa_svar_tid TIMESTAMP; ALTER TABLE DIALOG ADD siste_ferdigbehandlet_tid TIMESTAMP; CREATE VIEW DIALOG_STATUS AS ( SELECT...
<gh_stars>0 INSERT INTO frameworks_v2 (comparison_data_last_update,osx,wup,javame,firefoxos,stackoverflow,objc,hired_help,csharp,appshowcase,xml,ads,iteration_speed,vibration,perf_overhead,windowsmobile,book,opensource,python,repo,framework,nativeevents,compass,nfc,blackberry,phone_supp,gestures_multitouch,multi_screen...
<reponame>maiha/facebook.cr CREATE TABLE product_catalog ( id String, default_image_url Nullable(String), fallback_image_url Array(String), feed_count Nullable(Int64), name Nullable(String), product_count Nullable(Int64), vertical Nullable(String) ) ENGINE = Log
<gh_stars>1-10 -- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION pg_eyes" to load this file. \quit -- Function: eyes.get_pg_stat_activity() CREATE OR REPLACE FUNCTION eyes.get_pg_stat_activity() RETURNS SETOF pg_stat_activity AS $body$ SELECT * FROM pg_stat_ac...
<reponame>jaydeesimon/vetd-app DROP VIEW IF EXISTS vetd.docs_to_fields; --;; CREATE OR REPLACE VIEW vetd.docs_to_fields AS SELECT "d"."id" AS "doc_id", "d"."dtype" AS "doc_dtype", "d"."dsubtype" AS "doc_dsubtype", "d"."title" AS "doc_title", "d"."from_user_id" AS "doc_from_user_id", "d"."to_org_id" AS "doc_to_org_id", ...
load 'plpgsql'; load 'plpgsql_check'; set client_min_messages to notice; -- enforce context's displaying -- emulate pre 9.6 behave \set SHOW_CONTEXT always set plpgsql_check.mode = 'every_start'; create table t1(a int, b int); create function f1() returns void as $$ begin if false then update t1 set c = 30; ...
<filename>backend/de.metas.purchasecandidate.base/src/main/sql/postgresql/system/5492930_sys_gh4002_C_PurchaseCandidate_ReminderDate.sql -- 2018-05-08T07:34:03.987 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Column (AD_Reference_ID,IsKey,IsParent,IsTranslated,IsIdentifier,AD_Client_...
-- acs-kernel -- upgrade-4.5-4.5.1.sql -- @author <EMAIL> -- @creation-date 2002-08-17 -- acs-create.sql -- scalabilty change create or replace view registered_users as select p.email, p.url, pe.first_names, pe.last_name, u.*, mr.member_state from parties p, persons pe, users u, group_member_map m, membership_r...
-- Creating a trigger to sum all marks added CREATE TRIGGER marks_sum BEFORE INSERT ON results FOR EACH ROW SET @sum = @sum + NEW.mark; -- Using the trigger when adding a row SET @SUM = 0; INSERT INTO results (`id`, `name`, `surname`, `mark`) VALUES (7, 'Megan', 'Moore', 71); SELECT @SUM AS 'Tot...
-- phpMyAdmin SQL Dump -- version 4.4.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: 21 Sep 2016 pada 07.22 -- Versi Server: 5.6.26 -- PHP Version: 5.6.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!...
<gh_stars>100-1000 WITH storage AS ( SELECT c.oid, n.nspname AS schema, c.relkind AS type, c.relname AS name, c.reltuples AS rows, pg_total_relation_size(c.oid) AS total_bytes, pg_indexes_size(c.oid) AS index_bytes, pg_total_relation_size(reltoastrelid) AS toast_bytes FROM pg_class c LEFT JOI...
DROP TABLE IF EXISTS msg_0; DROP TABLE IF EXISTS msg_1; DROP TABLE IF EXISTS msg_2; DROP TABLE IF EXISTS msg_3; DROP TABLE IF EXISTS msg_4; DROP TABLE IF EXISTS msg_5; DROP TABLE IF EXISTS msg_6; DROP TABLE IF EXISTS msg_7; DROP TABLE IF EXISTS msg_8; DROP TABLE IF EXISTS msg_9; CREATE TABLE msg_0 ( id INTEGER GEN...
/* Navicat MySQL Data Transfer Source Server : 本地 Source Server Version : 50540 Source Host : localhost:3306 Source Database : ytwo Target Server Type : MYSQL Target Server Version : 50540 File Encoding : 65001 Date: 2017-02-24 10:33:34 */ SET FOREIGN_KEY_CHECKS=0;
SELECT tag, (SELECT COUNT(*) FROM dump_gb.posttags posttag LEFT JOIN dump_gb.posts post ON post.id = posttag.postid WHERE posttag.tagid = root.id AND post.downloaded AND post.rating != 'e') AS numImages, id FROM dump_gb.tags root WHERE LENGTH(tag) > 1 ORDER BY tag ASC
-- tpch8 using 1395599672 as a seed to the RNG select o_year, sum(case when nation = 'EGYPT' then volume else 0 end) / sum(volume) as mkt_share from ( select extract(year from o.o_orderdate) as o_year, l.l_extendedprice * (1 - l.l_discount) as volume, n2.n_name as nation from ...
--+ holdcas on; set names utf8; create class t1( col1 string collate binary, col2 char(10) collate utf8_ja_exp , col3 varchar(10) collate utf8_ja_exp , col4 DATE, col5 TIME, col6 TIMESTAMP); INSERT INTO t1 VALUES ('ヨあ12p■「亜','ヨあ12p■「亜','ヨあ12p■「亜 ','2008-05-26', '14:24:00', ' 2008-05-26 14:24:00'); INSERT INTO t1 VA...
TRUNCATE TABLE comments cascade; TRUNCATE TABLE entries cascade; TRUNCATE TABLE users cascade; ALTER SEQUENCE entries_id_seq RESTART with 4; ALTER SEQUENCE comments_id_seq RESTART with 9; ALTER SEQUENCE users_id_seq RESTART with 2; INSERT INTO entries VALUES (1, 'blog1234', 'tag1, tag2, tag3', '#...
<filename>Sql/sqledi2_Sample/Sample/Ch07/7_1/List7_3.sql<gh_stars>0 SELECT shohin_id, shohin_mei FROM Shohin UNION SELECT shohin_id, shohin_mei FROM Shohin2;
<reponame>Wratten/Employee-Tracker INSERT INTO department (name) VALUES ('Department1'); INSERT INTO department (name) VALUES ('Department2'); INSERT INTO role (title, salary, department_id) VALUES ('Manager', '85000', '1'); INSERT INTO role (title, salary, department_id) VALUES ('Manager', '75000', '2'); INSERT INTO ...
<filename>Sends.sql<gh_stars>0 CREATE TABLE PETCLINIC.sends ( Appointment_id INT NOT NULL, Vet_id INT NOT NULL, PRIMARY KEY (Appointment_id, Vet_id), UNIQUE (vet_id), UNIQUE (Appointment_id), FOREIGN KEY (Appointment_id) REFERENCES petclinic.appointment (Appointment_id) ON DELETE CASCADE ON UPDATE CAS...
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 19, 2019 at 09:16 AM -- Server version: 10.1.36-MariaDB -- PHP Version: 7.2.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
<reponame>ikarteeva/SQL-query select Contact.client_id from Contact left outer join Dep on Contact.client_id = Dep.client where Dep.client is null union all select Dep.client from Dep left outer join Contact on Dep.client = Contact.client_id where Contact.client_id is null
<filename>prestasi_mahasiswa.sql -- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 10, 2021 at 12:05 PM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.2.33 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!...
<filename>ruangrapat.sql -- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 28, 2017 at 01:48 PM -- Server version: 10.1.28-MariaDB -- PHP Version: 5.6.32 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+0...
<filename>SignalRDatabaseNotification/SQL/SignalRDatabaseNotification/1.- CreateTable.sql<gh_stars>0 SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Messages]( [MessageID] [int] IDENTITY(1,1) NOT NULL, [Message] [nvarchar](50) NULL, [Date] [datetime] NULL, CONSTRAINT [PK_Messages] PRIMARY KE...
CREATE TABLE [dbo].[AgreementAddress] ( [Id] INT IDENTITY (1, 1) NOT NULL, [AgreementId] INT NOT NULL, [AddressId] INT NOT NULL, [IsPrimary] BIT DEFAULT 0 NOT NULL, [Created] DATETIME DEFAULT (getdate()) NOT NULL, [Modified] DATETIME DEFAULT (getd...
<reponame>jaswal72/hacker-rank /* Contributer : github.com/jaswal72 Email : <EMAIL> */ SELECT MAX(POPULATION)-MIN(POPULATION) FROM CITY;
<reponame>bhupendpatil/Practice<filename>Database/PL SQL/transactions.sql --Study of transactions and locks --Commit --COMMIT create table employee(id int, first_name varchar2(10), last_name varchar2(10), salary decimal(10,2), department_no int); insert into employee values(1, 'ABC', 'CBA', 232.1, 50); insert into e...
<reponame>PJChamley/das-payments-V2 CREATE TABLE [Payments2].[FundingSourceLevyTransaction] ( [Id] BIGINT NOT NULL IDENTITY(1,1) CONSTRAINT PK_FundingSourceLevyTransaction PRIMARY KEY CLUSTERED, [Ukprn] BIGINT NOT NULL, [CollectionPeriod] TINYINT NOT NULL, [AcademicYear] SMALLINT NOT NULL, [DeliveryPeriod] TINYIN...
select c1.release_group, c2.release_group, c2.cover_url from context c1 left join release_cover as c2 on c2.release_group = c1.release_group --where c1.release_group = 'tt0110912' where c2.cover_url is not null limit 10 ;
<reponame>CSCfi/antero<gh_stars>1-10 USE [ANTERO] GO /****** Object: View [dw].[v_virta_otp_yhteiskaksoistutkinnot] Script Date: 21.1.2020 9:16:37 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER VIEW [dw].[v_virta_otp_yhteiskaksoistutkinnot] AS SELECT [Tilastovuosi] = S.tutkintovuosi ...
RAISERROR('Create procedure: [dbo].[usp_sqlAgentJobCheckStatus]', 10, 1) WITH NOWAIT GO SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_sqlAgentJobCheckStatus]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[usp_sq...
<reponame>jdkoren/sqlite-parser -- journal1.test -- -- execsql { -- BEGIN; -- DELETE FROM t1; -- } BEGIN; DELETE FROM t1;
-- fts3corrupt2.test -- -- execsql { INSERT INTO t2 VALUES(d, d) } INSERT INTO t2 VALUES(d, d)
INSERT INTO tyre_manufacturer ( id , name , country_id , best_race_result , best_starting_grid_position , total_race_entries , total_race_starts , total_race_wins , total_race_laps , total_podiums , total_podium_races , total_pole_positions , total_fastest_lap ) VALUES ( ?.id , ?.name , ?.countryId , ?.bestRaceResult ,...
<reponame>J-Soegaard/PC-Video-Test-Interface<filename>sql/quality.sql -- phpMyAdmin SQL Dump -- version 4.1.7 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jul 10, 2014 at 09:38 AM -- Server version: 5.5.35-0+wheezy1 -- PHP Version: 5.3.3-7+squeeze19 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET...
<reponame>malnaimi1/sql-challenge -- Exported from QuickDBD: https://www.quickdatabasediagrams.com/ -- Link to schema: https://app.quickdatabasediagrams.com/#/d/cfIt15 -- NOTE! If you have used non-SQL datatypes in your design, you will have to change these here. -- Modify this code to update the DB schema diagra...
-- 数据中心后台 微服务信息表 DROP TABLE IF EXISTS dca_instance_info; CREATE TABLE dca_instance_info ( id SERIAL PRIMARY KEY, service_title VARCHAR(100) NOT NULL, service_name VARCHAR(100) NOT NULL, host VARCHAR(100) NOT NULL, port INT, type...
<reponame>sammyjava/neptune<filename>jcms/sql/20091125.sql<gh_stars>0 -- -- Add a Setting for SoftSlate context; replacing softslate stylesheet path, no longer needed; also remove stylesheet editor. -- \connect - jcms INSERT INTO updatelog (name,value) VALUES ('db_version','20091125'); UPDATE settings SET setting_na...
<reponame>xiashang0624/dwh-assessment-extraction-tool<filename>src/java/com/google/cloud/bigquery/dwhassessment/extractiontool/dbscripts/partitioning_constraints.sql SELECT DatabaseName AS "DatabaseName", IndexName AS "IndexName", IndexNumber AS "IndexNumber", ConstraintType AS "ConstraintType", ConstraintTex...
-- Check the indexes usage in your database. -- Replace <MyDatabase> by your database name. -- To reflect your goals, you can update the ORDER BY clause, or customize the TotalUsage calculation. DECLARE @databaseName sysname = N'<MyDatabase>'; DECLARE @databaseId smallint = DB_ID(@databaseName); SELECT DISTINCT OBJE...
############################################################### # $Author: szavrel $ # $Revision: 14846 $ # $Date: 2009-10-21 16:38:35 +0200 (Mi, 21 Okt 2009) $ ############################################################### # ATTENTION: do not add other sql statements than the CREATE TABLE statement CREATE TABLE vie...
-- drop view UserMessageView create view UserMessageView as SELECT TOP 30 [TimeEntered], [Message], [Level] from LOGRECORD WITH (NOLOCK) WHERE Zone = 'USER' ORDER BY TimeEntered DESC /* select * from UserMessageView; */
<gh_stars>1-10 INSERT [dbo].[Localization_Culture] ([Id], [Name]) VALUES ('es-ES', N'Spanish') GO INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('es-ES', N'Register', N'Registrar,') INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('es-ES', N'Hello {0}!', N'Hola!')...
<reponame>sapcc/arc -- +goose Up -- SQL in section 'Up' is executed when this migration is applied ALTER TABLE registries RENAME TO locks; ALTER TABLE locks RENAME COLUMN registry_id to lock_id; ALTER TABLE locks ADD COLUMN created_at timestamp without time zone NOT NULL DEFAULT(NOW()), DROP CONSTRAINT registries_pkey...
<filename>JOB-Queries/implicit/6d.sql<gh_stars>1-10 SELECT COUNT(*) FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE k.keyword IN ('superhero', 'sequel', 'second-part','marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence') AND n.name LIKE '%Dow...
<reponame>zwkjhx/vertx-zero<filename>vertx-pin/zero-rbac/src/main/resources/plugin/sql/rbac/R_USER_GROUP.sql -- liquibase formatted sql -- changeset Lang:ox-user-group-1 -- 关联表:R_USER_GROUP DROP TABLE IF EXISTS R_USER_GROUP; CREATE TABLE IF NOT EXISTS R_USER_GROUP ( `GROUP_ID` VARCHAR(36) COMMENT '「groupId」- 关联组ID...
ALTER TABLE teams ADD COLUMN deletable BOOLEAN NOT NULL DEFAULT TRUE; INSERT INTO teams VALUES (uuid_generate_v4(), 'admins', 'Members of the admins team, by default, have access to all parts of the API.', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, FALSE) ON CONFLICT (name) DO UPDATE SET del...
<reponame>turbot/steampipe-plugin-oci select id, name, lifecycle_state from oci.oci_cloud_guard_managed_list where id = '{{ output.resource_id.value }}::dummy';
-- Test re-set_schema_quota CREATE SCHEMA srE; SELECT diskquota.set_schema_quota('srE', '1 MB'); SET search_path TO srE; CREATE TABLE a(i int) DISTRIBUTED BY (i); -- expect insert fail INSERT INTO a SELECT generate_series(1,100000); SELECT diskquota.wait_for_worker_new_epoch(); -- expect insert fail when exceed quota l...
-- @author prabhd -- @created 2012-12-05 12:00:00 -- @modified 2012-12-05 12:00:00 -- @tags dml -- @db_name dmldb -- @description union_test30: INSERT NON ATOMICS with union/intersect/except \echo --start_ignore set gp_enable_column_oriented_table=on; \echo --end_ignore SELECT COUNT(*) FROM dml_union_r; SELECT COU...
<reponame>kmr0877/spark<gh_stars>0 -- -- Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group -- -- -- INT8 -- Test int8 64-bit integers. -- https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/sql/int8.sql -- CREATE TABLE INT8_TBL(q1 bigint, q2 bigint) USING parquet; INSERT INTO IN...
<reponame>paramaggarwal/sharp-knives-pgw -- -- PostgreSQL database dump -- -- Dumped from database version 9.5.17 -- Dumped by pg_dump version 10.9 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 p...
<gh_stars>0 create table if not exists items ( item_handle uuid primary key default gen_random_uuid(), name text not null, price text not null, description text ); grant select, insert, update, delete on table items to project_app; grant select on table items to project_read;
CREATE VIEW LaneView AS SELECT DISTINCT Lane.* , TSB.TSBNameEN, TSB.TSBNameTH , PlazaGroup.PlazaGroupNameEN, PlazaGroup.PlazaGroupNameTH, PlazaGroup.Direction , Plaza.SCWPlazaId, Plaza.PlazaNameEN, Plaza.PlazaNameTH FROM Lane , Plaza , PlazaGroup , TSB WHERE PlazaGroup.TSBId = TSB.TSBId ...
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Mar 18, 2021 at 06:17 PM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.4.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARAC...
<reponame>Yann-Fontaine/Dev-Go<gh_stars>0 SELECT name AS "Name of the most expensive subscription", MAX(price) AS "Price" FROM subscriptions;
CREATE TABLE [dbo].[Photos] ( [websiteId] INT NOT NULL, [folderId] INT NOT NULL, [filename] NVARCHAR(15) NOT NULL PRIMARY KEY, [uploadname] NVARCHAR(25) NULL, [width] INT NULL, [height] INT NULL, [datecreated] DATETIME NULL ) GO CREATE INDEX [index_photos] ON [dbo].[Photos] (websiteId, folde...
<reponame>EWBSWE/member-portal<filename>sql/MemberByEmails.sql<gh_stars>0 SELECT member.id, email, name, location, education, profession, member_type, gender, year_of_birth, created_at, expiration_date, employer FROM member LEFT JOIN member_type ON (member.member_type_id ...
<reponame>rafatheonly/theeventsspringbootapi insert into evento (titulo, data, descricao, foto) values ('<NAME>', 'Seg 18 Mai 2018', 'Praesent tincidunt sed tellus ut rutrum sed vitae justo...', 'teste'); insert into evento (titulo, data, descricao, foto) values ('Festival de Rua', 'Seg 18 Mai 2019', 'Praesent tincidun...
CREATE DATABASE SGT go use SGT go CREATE TABLE [dbo].[TB_USUARIO] ( [cod_usuario] BIGINT IDENTITY (1, 1) NOT NULL, [nomecompleto] VARCHAR (100) NULL, [login] VARCHAR (20) NULL, [senha] VARCHAR (500) NULL, [estado] INT DEFAULT ((1)) NULL ) ); ALTER TAB...
<filename>Chapter_12/P246_SpringRedundantSave/src/main/resources/data-mysql.sql INSERT INTO book (id, isbn, title, price) VALUES (1, 'Isbn_1' , 'Title_1', 100);
<filename>src/startup/CEF/ServiceProvider/Otp/Sql/CreateOtpStoreSchema.sql set ansi_nulls on set quoted_identifier on set nocount on go if exists (select * from sys.objects where object_id = object_id(N'[dbo].[OtpCodes]') and type in (N'U')) drop table [dbo].OtpCodes go create table [dbo].OtpCodes ( [PhoneNu...
<reponame>GeorgiPopovIT/CSharp-DB SELECT FirstName,LastName,JobTitle FROM Employees WHERE Salary BETWEEN 20000 AND 30000
<filename>db/SQLServer/Upgrade/09.notif.stats_time_series_sp.sql /****** Object: StoredProcedure [notif].[stats_time_series] Script Date: 4/12/2021 10:57:31 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE OR ALTER PROCEDURE [notif].[stats_time_series] @days int= 30, @topcount int=5 AS BEGIN cr...
<gh_stars>10-100 CREATE TABLE integration.manual_Holidays ( DateKey int NOT NULL, HolidayName varchar(255) NOT NULL, HolidayTypeKey int NOT NULL );
ALTER TABLE `newsletter_subscribers` ADD `subscribed` TINYINT(1) NOT NULL DEFAULT '1' AFTER `time_created`;
-- =================================================== -- Drop Key template -- -- This template creates a table with a primary key, -- then it drops the primary key of the table. -- =================================================== USE <database_name, sysname, AdventureWorks> GO IF OBJECT_ID(N'<schema_name, sysnam...
<gh_stars>100-1000 -- Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (http://h2database.com/html/license.html). -- Initial Developer: H2 Group -- select trunc('2015-05-29 15:00:00'); >> 2015-05-29 00:00:00 select trunc('2015-05-29'); >> 2015-05-29 00:00:00 select trunc(timestam...
<filename>mybatis-3/src/test/java/org/apache/ibatis/submitted/dynsql/CreateDB.sql<gh_stars>1-10 -- -- Copyright 2009-2018 the original author or authors. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtai...
<filename>db/seed.sql USE employee_management_db; INSERT INTO department (name) VALUES ("IT"), ("Production"), ("Engineering"), ("Accounting"), ("Sales"); INSERT INTO role (title, salary, department_ID) VALUES ("Manager", 65000, 1), ("IT Tech", 50000, 1), ("Manager", 50000, 2), ("Team Lead", 40000, 2), ("Op...
<gh_stars>1-10 DROP TABLE IF EXISTS `Event`; CREATE TABLE `Event` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `description` mediumtext NOT NULL, `filename` varchar(2000) DEFAULT NULL, `authorId` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO...
<reponame>floodfx/gma-village select u.id, u.first_name, u.last_name, u.phone, u.user_type, u.active, u.profile_image_url, u.account_kit_access_token, u.account_kit_user_id, u.account_kit_access_token_expires_at, u.accepted_terms, u.created_by_user, u.created_on, u.updated_at from users as u where u...
<reponame>KimleyHorn/ATSPM4.2 -- DROP FUNCTION [dbo].[LowerBoundary] CREATE FUNCTION [dbo].[LowerBoundary] (@TableName varchar(40), @FirstIndexName varchar(100), @PartitionNumber int) Returns Datetime With EXECUTE as Caller AS BEGIN -- DECLARE @FileGroupName VARCHAR(50); DECLARE @LowerBoundaryString va...
<reponame>richie77mendez/inventariosCunoc CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET utf8 ; USE `mydb` ; -- ----------------------------------------------------- -- Table `mydb`.`Usuario` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`Usuario` ; CREATE TABLE IF NOT...
<gh_stars>0 ALTER TABLE USERS_GROUPS ADD CONSTRAINT USERS_GROUPS_PK PRIMARY KEY (GROUPID, USERID); --//@UNDO ALTER TABLE USERS_GROUPS DROP CONSTRAINT USERS_GROUPS_PK;
<reponame>ptrick/hdfs-hive-sql-playground<filename>bin/apache-hive-3.1.2-bin/scripts/metastore/upgrade/postgres/012-HIVE-1362.postgres.sql version https://git-lfs.github.com/spec/v1 oid sha256:d061c55470705fcc38f0b022bbe340eb39be52be25e83f435473702e83849d0a size 2447
<gh_stars>0 -- Change the values below if you are not installing via Docker (environment variable values come from .env file) -- name of the database \set db_name 'hederamirror' --username \set db_user 'hederamirror' --user password \set db_password '<PASSWORD>' --owner of the database (usually postgres) \set db_owner...