sql
stringlengths
6
1.05M
<filename>src/main/resources/db/migration/V20200120132536421__Alter_workspace_(change_constraints).sql alter table workspace modify username null; alter table workspace add constraint username_or_public check ((username is null and isPublic = 1) or (username is not null and isPublic = 0))
<gh_stars>1-10 DROP TABLE IF EXISTS quizapp; CREATE TABLE quizapp ( id INT AUTO_INCREMENT PRIMARY KEY, question VARCHAR(250) NOT NULL, affirmation1 VARCHAR(250) NOT NULL, affirmation2 VARCHAR(250) NOT NULL, affirmation3 VARCHAR(250) NOT NULL, answer INT NOT NULL ); INSERT INTO quizapp (questio...
<reponame>enesdee-systems/temporal_tables CREATE OR REPLACE FUNCTION versioning() RETURNS TRIGGER AS $$ DECLARE sys_period text; history_table text; manipulate jsonb; ignore_unchanged_values bool; commonColumns text[]; time_stamp_to_use timestamptz := current_timestamp; range_lower timestamptz; transact...
create table proc_sfb.mpf_quilombo_dados as SELECT mpf_quilombo_imoveis.idt_imovel, mpf_quilombo_imoveis.cod_imovel, mpf_quilombo_imoveis.ind_status_imovel, mpf_quilombo_imoveis.ind_tipo_imovel, mpf_quilombo_imoveis.idt_municipio, mpf_quilombo_imoveis.nom_municipio, mpf_quilombo_imoveis.cod_estado...
<filename>EmployeeSQL/Data_Analysis.sql -- Q1: List the following details of each employee: -- employee number, last name, first name, gender, and salary. CREATE VIEW Question1 AS SELECT Employees.emp_no AS "Employee Number", Employees.first_name AS "<NAME>", Employees.last_name AS "<NAME>", Employees.ge...
CREATE TABLE AWARD_APPROVED_EQUIPMENT ( AWARD_APPROVED_EQUIPMENT_ID NUMBER(22,0) NOT NULL, AWARD_ID NUMBER(22,0) NOT NULL, AWARD_NUMBER varchar2(10) NOT NULL, SEQUENCE_NUMBER NUMBER(4) NOT NULL, ITEM varchar2(100) NOT NULL, VENDOR varchar2(50), MODEL varchar2(50), AMOUNT NUMBER(12,2) NOT NULL, ...
#------------------------------------------------------------------------------ # Suppression compétences en double #------------------------------------------------------------------------------ DELETE game_skill_skill FROM game_skill_skill LEFT JOIN ( SELECT MIN(id) as id, `name` as `name` FR...
select * from angajati where functie in ('DIRECTOR', 'Director') and data_angajarii >= '1-JAN-2019' AND data_angajarii <= '31-DEC-2019';
CREATE PROCEDURE [dbo].[pe_NL_Accounts] @Org int, @Type nvarchar(10) AS DECLARE @IntSys varchar(20) SELECT @IntSys = IntSystem FROM tblTranNominalControl IF @IntSys = 'AD' BEGIN EXEC pe_NL_Accounts_AD @Org, @Type END IF @IntSys = 'GP' BEGIN EXEC pe_NL_Accounts_GP @Org, @Type END IF @IntSys = 'SS' BEGIN ...
-- Copyright 2020 Google LLC. -- SPDX-License-Identifier: Apache-2.0 CREATE VIEW test_chrome_metric_output AS SELECT TestChromeMetric('test_value', 1))
<filename>phoenix-tools/src/it/resources/synthesis/alter_table_add_pk.sql<gh_stars>1-10 CREATE TABLE IF NOT EXISTS TEST.TABLE_1 ( STATE CHAR(1) NOT NULL, CONSTRAINT PK PRIMARY KEY ( STATE ) ); ALTER TABLE TEST.TABLE_1 ADD IF NOT EXISTS SOME_ID VARCHAR NULL PRIMARY KEY;
<reponame>sjcdigital/como-anda-a-ciclovia<filename>src/main/resources/import.sql -- INSERT STATUS -- INSERT INTO Status (id, name, pin_name, description) VALUES (1, 'Ciclovia não esta bem (problemas de infra-estrurura)', 'pin-01.png', ''); INSERT INTO Status (id, name, pin_name, description) VALUES (2, 'Tem reforma sen...
/* Navicat Premium Data Transfer Source Server : localhost Source Server Type : MySQL Source Server Version : 50724 Source Host : localhost:3306 Source Schema : spring_boot_easyexcel Target Server Type : MySQL Target Server Version : 50724 File Encoding : 65001 Date:...
select (select cust_value from events_custominfo where events.id = events_custominfo.event_id and cust_key = 'address') as address, (select cust_value from events_custominfo where events.id = events_custominfo.event_id and cust_key = 'Application Name') as app, events.* from events
CREATE COLUMN TABLE "DWC_DEMO"."ProductTexts" ("PRODUCTID" NVARCHAR(10) NOT NULL , "LANGUAGE" NVARCHAR(2) NOT NULL , "SHORT_DESCR" NVARCHAR(20), "MEDIUM_DESCR" NVARCHAR(40), "LONG_DESCR" NVARCHAR(10), PRIMARY KEY ("PRODUCTID", "LANGUAGE")) UNLOAD PRIORITY 5 AUTO MERGE ; COMMENT ON TABLE "DWC_DEMO"."ProductTexts" is 'P...
ALTER TABLE BPM_CONF_NOTICE ADD COLUMN TEMPLATE_CODE VARCHAR(200); ALTER TABLE BPM_CONF_NOTICE ADD COLUMN NOTIFICATION_TYPE VARCHAR(200); COMMENT ON COLUMN BPM_CONF_NOTICE.TEMPLATE_CODE IS '模板编码'; COMMENT ON COLUMN BPM_CONF_NOTICE.NOTIFICATION_TYPE IS '提醒类型';
INSERT INTO `usuario` (`idUsuario`,`dniUsuario`,`claveUsuario`,`mailUsuario`,`authkey`,`activado`,`idRol`) VALUES (1,14780341,'capXGYjL7lKE.','<EMAIL>','1',1,2), (2,35178582,'ca5MeixRJe8SM','<EMAIL>','1',1,3), (3, 27894458, 'caqVPE9ZitkGw', '<EMAIL>', 'aerrarcrcraddbredardcarrarrraraarberrcaadaraeearra', 0, 1), (4, 37...
-- MySQL dump 10.13 Distrib 5.7.30, for Linux (x86_64) -- -- Host: localhost Database: mysql -- ------------------------------------------------------ -- Server version 5.7.30-debug-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS...
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 26, 2018 at 03:15 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...
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 28 Apr 2019 pada 18.48 -- Versi server: 10.1.37-MariaDB -- Versi PHP: 7.2.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHAR...
-- cria dados iniciais -- ------------------------------------------------------------------------ -- USUÁRIO -- ------------------------------------------------------------------------ insert into sec_usuario (nome, email, validhash) values ('MVP','<EMAIL>','?'); update sec_usuario set _inc_usua = 1, _alt_usua = 1, _...
<reponame>rafignwn/Toko-Online-Nyimeng-Kicks -- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 14, 2021 at 03:00 AM -- Server version: 10.4.17-MariaDB -- PHP Version: 7.4.14 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+0...
create database projectDB; use projectDB; SET SQL_SAFE_UPDATES=0; alter database projectdb character set utf8; create table tb_users( user_id varchar(40) primary key not null, user_pwd varchar(40) not null, user_email varchar(50) not null unique, user_img text null, user_identity varchar(20) null, user_regdate d...
select p.*, ae.name as emittername, ar.name as receivername from practice p join actor ae on ae.id = p.emitter join actor ar on ar.id = p.receiver where p.id = $1;
<filename>5.2.3/Database/Indexes/AFW_30_EFORT_ITEM_FK1.sql<gh_stars>1-10 SET DEFINE OFF; CREATE INDEX AFW_30_EFORT_ITEM_FK1 ON AFW_30_EFORT_ITEM (REF_ITEM_CARNT_SPRIN) LOGGING /
--SELECT * from Addresses; --SELECT * from Customers; --SELECT * from Orders; INSERT INTO Addresses (addressLine1, city, countryCode) VALUES ('432 Millbrook Ln.', 'Crowley', 'CY'); --CROSS JOIN SELECT Addresses.Addressid, AddressLine1, FirstName FROM Addresses CROSS JOIN Customers;
/* Structure for the CONNSTR table : */ CREATE TABLE CONNSTR ( ID INTEGER NOT NULL, IDKEY VARCHAR(190) NOT NULL, STR BLOB); ALTER TABLE CONNSTR ADD CONSTRAINT PK_CONNSTR PRIMARY KEY (ID,IDKEY);
<gh_stars>1-10 USE [test_normalization]; execute('create view _airbyte_test_normalization."non_nested_stream_wit__lting_into_long_names_ab2__dbt_tmp" as -- SQL model to cast each column to its adequate SQL type converted from the JSON schema type select cast(id as VARCHAR(max)) as id, cast("date" ...
<gh_stars>10-100 SELECT c.oid AS id, table_catalog AS catalog, table_schema, table_name, obj_description(c.oid) AS comment FROM information_schema.tables JOIN pg_class c ON quote_ident(table_schema)::regnamespace = c.relnamespace AND c.relname = table_name LEFT JOIN pg_stat_user_tables ON pg_stat_user...
<filename>sql/persistence-service-ddl-oracle.sql<gh_stars>1-10 SET serveroutput ON DECLARE CR VARCHAR2(100); tabCount NUMBER; BEGIN DBMS_OUTPUT.ENABLE(1000000); CR := 'CR #foo'; --Begin Creating ENTITIES SELECT COUNT(*) INTO tabCount FROM all_tables WHERE table_name='ENTITIES'; IF tabCou...
<reponame>uoregon-libraries/newspaper-curation-app<filename>db/migrations/20171030125000_issue_error.sql -- +goose Up -- SQL in section 'Up' is executed when this migration is applied ALTER TABLE `issues` ADD `error` MEDIUMTEXT COLLATE utf8_bin NOT NULL DEFAULT ''; -- +goose Down -- SQL section 'Down' is executed when...
CREATE TABLE sec.client ( client_id character varying(255) NOT NULL, client_secret character varying(255), grant_types character varying(255), redirect_uris character varying(1000), access_token_lifetime integer, refresh_token_lifetime integer, logout_url character varying(1000), CONSTRA...
<gh_stars>1-10 INSERT INTO requested_entity(name) values('UNKNOWN');
<gh_stars>1-10 INVALID TEST Cockroach has a bug for this changeset (records are inserted in cases where they should be updated) https://github.com/liquibase/liquibase/issues/2023
select CAST(CASE WHEN isNumeric(stratum_1) = 1 THEN stratum_1 ELSE null END AS INT) as age_at_index, count_value as num_persons from @ohdsi_database_schema.heracles_results where analysis_id in (1800) and cohort_definition_id = @cohortDefinitionId
CREATE COLUMN TABLE NYCCAB.FARE_ADV AS (SELECT DRIVER, PICKUP_TIME, TOTAL, YEAR(PICKUP_TIME) AS YEAR, MONTH(PICKUP_TIME) AS MONTH, ROUND(DAYOFMONTH(PICKUP_TIME) / 7, 0, ROUND_UP) AS WEEKOFMONTH FROM FARE WHERE FARE < 1001 AND TOTAL > 0 AND YEAR(PICKUP_TIME) != 2015 AND ...
<reponame>nabeelkhan/Oracle-DBA-Life set echo on alter session set sql_trace=true; begin for x in ( select /* this is my very nice Comment */ * from big_table.big_table where rownum <= 10000 ) loop null; end loop; end; / pause connect / host tkprof `ls -t $ORACLE...
-- DROP EXTERNAL DATA SOURCE INTERIM_Zone -- Create External Data Source --https://mdwdopsstdevimops.dfs.core.windows.net/datalake/data/interim/ --declare @ADLSLocation varchar(300) --set @ADLSLocation = 'https://mdwdopsstdevimops.dfs.core.windows.net/datalake/data/interim/' IF NOT EXISTS (SELECT * FROM sys.external_d...
{% macro transform_filter_string(field) -%} split(regexp_replace(replace(replace({{ field }}, 'account in [', ''), ']', ''),r'([\'\"])', ''), ',') {%- endmacro %}
<reponame>wowpanda/Stocks -- -------------------------------------------------------- -- Host: 127.0.0.1 -- Versione server: 5.7.24 - MySQL Community Server (GPL) -- S.O. server: Win64 -- HeidiSQL Versione: 10.3.0.5771 -- ---------------------------------...
INSERT INTO "public"."users"("id","username","email","password","phone","full_name") VALUES (E'11d6719e-1ad8-4622-916c-811c74dcadcf',E'<EMAIL>',E'<EMAIL>',E'$2a$12$RoP9TTaczrumb2HG8T8N6upwmyR6JNtFhPYsUKkVrQwSVjrtdPuD.',E'',E'istrator, Admin');
CREATE TABLE IF NOT EXISTS users ( id INT PRIMARY KEY, firstname varchar(255), lastname varchar(255), email varchar(255) ); INSERT INTO users (id,firstname,lastname,email) VALUES (1,"McKenzie","Monroe","<EMAIL>"),(2,"Hakeem","Coleman","<EMAIL>"),(3,"Leroy","Rodriguez","<EMAIL>"),(4,"Darrel","Burks","<EMAIL>"),...
<gh_stars>0 SELECT b.name, COUNT(ca.id) AS count_of_cards FROM branches AS b LEFT JOIN employees AS e ON e.branch_id = b.id LEFT JOIN employees_clients AS ec ON ec.employee_id = e.id LEFT JOIN clients AS c ON c.id = ec.client_id LEFT JOIN bank_accounts AS ba ON ba.client_id = c.id LEFT JOIN cards AS ca ON...
drop table if exists admin; create table admin(name varchar(255) not null, pass varchar(255) not null); drop table if exists category; create table category(id serial primary key, name varchar(255)); drop table if exists users; create table users(id serial primary key, name varchar(255), password varchar(255)); dro...
<gh_stars>0 -- DROP VIEW marketplace.field_in_table CREATE VIEW marketplace.field_in_table AS SELECT column_name as field_name, table_name FROM information_schema.columns WHERE table_schema = 'cherre_sample_data' and column_name in (select name from marketplace.available_fields);
<gh_stars>0 INSERT INTO address(cep, logradouro, complemento, bairro, localidade, uf, ibge, gia, ddd, siafi) VALUES ('90110170', 'Rua Dezessete de Junho', 'complemento', 'Menino Deus', 'Porto Alegre', 'RS', 'ibge', 'gia', 'ddd', 'siafi') ON CONFLICT DO NOTHING;
<reponame>mepler-labs/steps -- Revert steps:user_add_unique_email from pg BEGIN; ALTER TABLE "user" DROP CONSTRAINT user_email_unique; COMMIT;
set define off verify off feedback off whenever sqlerror exit sql.sqlcode rollback -------------------------------------------------------------------------------- -- -- ORACLE Application Express (APEX) export file -- -- You should run the script connected to SQL*Plus as the Oracle user -- APEX_050000 or as the owner ...
INSERT INTO talks (slug, name, description, speaker_name, speaker_title, speaker_image, track, date) VALUES ( 'the-mother-of-all-demos', 'The Mother of All Demos', 'The live demonstration featured the introduction of a complete computer hardware and software system called the oN-Line System or, more commonly,...
drop index UIDX_IAY_OPPGITT_OPPTJE_01; create unique index UIDX_IAY_OPPGITT_OPPTJE_01 ON IAY_OPPGITT_OPPTJENING (oppgitte_opptjeninger_id, ekstern_referanse);
<reponame>Anzzhhela98/CSharp-DatabaseModule<filename>Database-Basic/08.Triggers and Transactions/16. Deposit Money.sql CREATE PROCEDURE usp_DepositMoney(@AccountId INT, @MoneyAmount DECIMAL(18,4)) AS BEGIN TRANSACTION DECLARE @accountExist INT = (SELECT COUNT(*) FROM Accounts AS A WHERE A.Id = @AccountId) IF(@accoun...
<reponame>Shuttl-Tech/antlr_psql -- file:create_view.sql ln:312 expect:true create table tt2 (a int, b int, c int)
<reponame>G-kodes/openopps-platform with tasks as ( select task.*, community.target_audience, community.is_disabled as community_is_disabled, community.community_name, (select row_to_json (muser) from ( select id, name, username, government_uri, coalesce(given_name, (string_to_array(trim(name), ' '))[ar...
SELECT count(*) from ( select d_year, s_nation, p_category, sum(lo_revenue - lo_supplycost) as profit from ssb.dwdate, ssb.customer, ssb.supplier, ssb.part, ssb.lineorder where lo_custkey = c_custkey and lo_suppkey = s_suppkey and lo_partkey = p_partkey and lo_orderdate = d_datekey and c_region = 'AMERICA' and s_regio...
<reponame>FrolovOlegVladimirovich/job4j /* Задача: Есть таблица встреч(id, name), есть таблица юзеров(id, name). Нужно доработать модель базы данных, так чтобы пользователи могли учавствовать во встречах. У каждого участника встречи может быть разный статус участия - например потвердил участие, отклонил. После дораб...
ALTER TABLE PUBLIC.T_USER_PREFERENCE DROP CONSTRAINT IF EXISTS PUBLIC.FKMMODM3SCEAISNQUY0QHICYQK4; ALTER TABLE PUBLIC.T_USER_PREFERENCE DROP COLUMN IF EXISTS C_USER_ID; ALTER TABLE PUBLIC.T_USER ADD COLUMN IF NOT EXISTS C_PREFERENCE_ID INTEGER NOT NULL; ALTER TABLE PUBLIC.T_USER ADD CONSTRAINT IF NOT EXISTS PUBLIC.T_U...
<reponame>howardfackrell/splinter # --- !Ups create table things ( id serial PRIMARY KEY , something text ); # --- !Downs drop table if exists things;
# --- !Ups CREATE TABLE IF NOT EXISTS `books` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `title` VARCHAR(255) NOT NULL, `author` VARCHAR(255) NOT NULL, `meta` INT(11) NOT NULL, PRIMARY KEY(`id`) ); # --- !Downs DROP TABLE IF EXISTS `books`;
<gh_stars>1-10 CREATE OR REPLACE TRIGGER "TR_IDTAXONOMY_AIUD_FLAT" AFTER INSERT OR UPDATE OR DELETE ON identification_taxonomy FOR EACH ROW DECLARE id NUMBER; BEGIN IF deleting THEN id := :OLD.identification_id; ELSE id := :NEW.identification_id; END IF; UPDATE flat SET stale_flag = 1, last...
with source_table as ( select * from {{ source('my_long_source_name', 'my_source_table') }} ), renamed as ( select 1 from source_table ) select * from renamed window site_window as ( partition...
<reponame>pdv-ru/ClickHouse<filename>tests/queries/0_stateless/00068_empty_tiny_log.sql CREATE TABLE IF NOT EXISTS empty_tiny_log(A UInt8) Engine = TinyLog; SELECT A FROM empty_tiny_log; DROP TABLE empty_tiny_log;
-- -- Creates N points randomly distributed arround the polygon -- -- @param g - the geometry to be turned in to points -- -- @param no_points - the number of points to generate -- -- @params max_iter_per_point - the function generates points in the polygon's bounding box -- and discards points which don't lie in the p...
INSERT INTO {{ application_dim }} ( application_id, domain, name, application_last_modified, deleted, dim_last_modified, dim_created_on, batch_id, version, copy_of ) SELECT application_id, domain, name, application_last_modified, CASE doc_type WHEN 'Ap...
<reponame>mzk/migrations<filename>tests/fixtures/pgsql/structures/002.sql CREATE TABLE "languages" ( "code" char(2) NOT NULL, "name" varchar(100) NOT NULL, PRIMARY KEY ("code") );
-- @testpoint:opengauss关键字max(非保留),作为模式名 --关键字不带引号-成功 drop schema if exists max; create schema max; drop schema max; --关键字带双引号-成功 drop schema if exists "max"; create schema "max"; drop schema "max"; --关键字带单引号-合理报错 drop schema if exists 'max'; create schema 'max'; --关键字带反引号-合理报错 drop schema if exists `max`; create...
DROP SCHEMA IF EXISTS cms; CREATE SCHEMA cms; CREATE TYPE cms.page_assets_type AS ENUM('carousel', 'grid'); CREATE TABLE cms.assets ( id SERIAL, source VARCHAR(255), full_image VARCHAR(255), thumb_small VARCHAR(255), thumb_medium VARCHAR(255), thumb_large VARCHAR(255), filesize INT, mimetype VARCHAR(1...
<reponame>Dule888811/ArticlesCI -- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 16, 2020 at 08:22 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40...
<gh_stars>0 SELECT NodeAliasPath, NodeID, NodeParentID, NodeSiteID, NodeLevel, NodeClassID, ClassName, ClassDisplayName FROM CMS_Tree JOIN CMS_Class on ClassID = NodeClassID WHERE NodeID in @IDs
<gh_stars>0 ALTER TABLE egbpa_master_nocconfiguration ADD COLUMN isdeemedapproval boolean not null default false; ALTER TABLE egbpa_master_nocconfiguration drop COLUMN isactive;
<filename>src/smscenter/database/scripts/smsserver_calls.sql CREATE TABLE [dbo].[smsserver_calls]( [id] [bigint] IDENTITY(1,1) NOT NULL, [call_date] [datetime] NOT NULL, [gateway_id] [nvarchar](64) NOT NULL, [caller_id] [nvarchar](64) NOT NULL, CONSTRAINT [PK_smssvr_calls] PRIMARY KEY ([id]) ) GO ...
CREATE TABLE notafiscal_produtos ( ID INT(11) NOT NULL, ID_NF INT(11) NOT NULL, ID_ITEM INT(11) NOT NULL, COD_PROD INT(11) NOT NULL, VALOR_UNIT FLOAT NOT NULL, QUANTIDADE INT(11) NOT NULL, DESCONTO INT(3) NULL, ) INSERT INTO notafiscal_produtos (ID_NF, ID_ITEM, COD_PROD, VALOR_UNI...
<filename>webapp/sql/isucoin.sql use isucoin; CREATE TABLE setting ( name VARBINARY(191) NOT NULL, val VARCHAR(255) NOT NULL, PRIMARY KEY (name) ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4; CREATE TABLE user ( id BIGINT NOT NULL AUTO_INCREMENT, bank_id VARBINARY(191) NOT NULL, name VARCHAR(1...
<gh_stars>10-100 SELECT TaskName, --TaskType, case when (IsEnabled=1) then 'Yes' else 'No' end as [Enabled], NumRefreshDays, DaysOfWeek, BeginTime, LatestBeginTime, BackupLocation, DeleteOlderThan FROM vSMS_SC_SQL_Task
<filename>mt2414/db.sql<gh_stars>1-10 CREATE TABLE roles ( id BIGSERIAL PRIMARY KEY, name TEXT UNIQUE NOT NULL ); INSERT INTO roles (name) VALUES ('superadmin'); INSERT INTO roles (name) VALUES ('admin'); INSERT INTO roles (name) VALUES ('member'); CREATE TABLE users ( id BIGSERIAL PRIMARY KEY, email TEXT UNIQUE ...
<reponame>UWIT-IAM/uw-redcap-client -- Deploy seattleflu/schema:warehouse/sample/collection-date to pg -- requires: warehouse/sample begin; alter table warehouse.sample add column collected date; comment on column warehouse.sample.collected is 'Date when the sample was collected'; commit;
<reponame>flexsocialbox/una<gh_stars>100-1000 SET @sName = 'bx_notifications'; -- SETTINGS UPDATE `sys_options` SET `value`='12' WHERE `name`='bx_notifications_events_per_page'; -- MENUS UPDATE `sys_menu_items` SET `copyable`='1' WHERE `set_name`='sys_account_notifications' AND `name`='notifications-notifications';...
# this file is a placeholder, please refer template file from ../mysql_init_temlate DROP USER IF EXISTS '${MYSQL_USER}'@'%'; CREATE USER '${MYSQL_USER}'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}'; GRANT ALL PRIVILEGES ON *.* TO '${MYSQL_USER}'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}'; GRANT ALL PRIVILEGES ON *.* TO '${MYSQL_U...
-- +----------------------------------------------------------------------------+ -- | <NAME> | -- | <EMAIL> | -- | www.idevelopment.info | -- |-----------------...
<reponame>nickywongdong/nickywongdong.github.io<filename>CS340/Assignment2/Assignment2selection4_with_rubrique-1.sql #1 Find all films with maximum length or minimum rental duration (compared to all other films). #In other words let L be the maximum film length, and let R be the minimum rental duration in the table f...
SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for armor -- ---------------------------- DROP TABLE IF EXISTS `armor`; CREATE TABLE `armor` ( `item_id` int(11) NOT NULL DEFAULT '0', `name` varchar(70) DEFAULT NULL, `bodypart` varchar(15) NOT NULL DEFAULT '', `crystallizable` varcha...
-- SPDX-License-Identifier: Apache-2.0 -- Licensed to the Ed-Fi Alliance under one or more agreements. -- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. -- See the LICENSE and NOTICES files in the project root for more information. PRINT N'Adding foreign keys to [edfi].[Interventio...
<filename>migration-client/wso2-api-migration-client/src/main/resources/110to200Migration/sql-scripts/stat/oracle.sql ALTER TABLE API_LAST_ACCESS_TIME_SUMMARY ADD CONSTRAINT last_access_time_pri_key PRIMARY KEY (tenantDomain,apiPublisher,api); / ALTER TABLE API_REQUEST_SUMMARY ADD CONSTRAINT api_request_summary_pri_key...
if exists(select * from sys.databases where name = 'testdb') drop database [testdb] ; if not exists(select * from sys.databases where name = 'testdb') create database [testdb]
CREATE TABLE configurations( key VARCHAR(100), value varchar (255) );
--update from 2 tables with datetime type column for join condition create table md_datetime1(id1 double, col1 datetime not null default SYS_DATETIME unique); insert into md_datetime1 values(1111111.11111, '2011-09-01 12:12:12.123'), (2222222.22222, '2011-09-01 12:12:13.123'), (33333333.33333, '2011-09-01 12:12:14.1...
<reponame>Zhaojia2019/cubrid-testcases --+ holdcas on; --this cases was added for cubridsus-2554 create table test_table ( test_id varchar(4000), test_seq varchar(4000), test_s_label varchar(4000), synonym varchar(4000), refer_entry varchar(4000), test_label1 varchar(4000), test_label2 varchar(4000), test_label3 varch...
alter table "schedule"."Continuation" add column "fromShuffleQueue" uuid null;
<filename>openGaussBase/testcase/SQL/DML/upsert/Opengauss_Function_DML_Upsert_Case0089.sql -- @testpoint:建表指定其中一列是唯一约束,冲突使用insert...update语句 --预置条件enable_upsert_to_merge为off drop table if exists mykey_0h; --建表指定id列是唯一约束 create table mykey_0h ( name nvarchar2(20), id number unique , address nvarchar2(50) ) ; -...
<reponame>mars0n/nodepoc USE [dbo] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <NAME> -- Create date: 12-09-2016 -- Description: Trigger to set the depuration -- date to a new row inserted. This -- date will be the last day...
<filename>pwl (1).sql -- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 26, 2020 at 05:02 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00...
SELECT g1.id AS main_id, g1.name AS main_name, g2.id AS matching_id, count(GU1.id) AS count_all1, count(GU2.id) AS count_match FROM groups_with_totals AS g1 JOIN fb_groups AS g2 ON g1.id >= g2.id JOIN fb_groups_users AS GU1 ON GU1.group_id = g1.id LEFT JOIN fb_groups_users AS GU2 ON GU2.group_id = g2.id AND...
<filename>SQL/Exams practice/(Demo) Databases MSSQL Server Exam - 13 Oct 2019/Find by Extensions.sql CREATE PROC usp_FindByExtension(@extension VARCHAR(10)) AS BEGIN SELECT f.Id, f.[Name], CONCAT(f.Size,'KB') AS Size FROM Files f WHERE [Name] LIKE '%.' + @extension ORDER BY Id, [Name], f.Size DESC END
<reponame>AndSviat/public<filename>packages/UsageAnalysis/queries/log_param_values.sql --name: Log Parameter Values --connection: System:Datagrok select et.name as event_name, e.event_time, ep.name as param_name, epv.value from event_types et, events e, event_parameters ep, event_parameter_values epv where e.event_ty...
<gh_stars>0 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Table `epanchayath`.`users` -- ------------...
<reponame>JonathanWilbur/mariadb-technology-schema CREATE TABLE IF NOT EXISTS DomainNameSystemResourceRequestDigestTypeCodes ( code TINYINT UNSIGNED NOT NULL PRIMARY KEY, description TINYTEXT NOT NULL, definingRFCs TINYTEXT NULL ); INSERT INTO DomainNa...
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1 -- Généré le : lun. 17 juin 2019 à 18:31 -- Version du serveur : 10.1.37-MariaDB -- Version de PHP : 7.2.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00...
<gh_stars>1-10 CREATE TABLE IF NOT EXISTS `account_log` ( `time` int(11) NOT NULL, `login` varchar(32) NOT NULL, `ip` varchar(15) NOT NULL, KEY `login` (`login`), KEY `ip` (`ip`) ) DEFAULT CHARSET=utf8
<reponame>motki/core DROP TABLE IF EXISTS app.industry_jobs; CREATE TABLE app.industry_jobs ( job_id BIGINT PRIMARY KEY NOT NULL, corporation_id BIGINT NOT NULL, installer_id BIGINT NOT NULL, facility_id BIGINT NOT NULL, location_id BIGINT NOT NULL, activity_id BIGINT NOT NULL, blueprint_id BIGINT NOT NUL...
<reponame>ShipLift-LLC/goatcounter<filename>db/migrate/2020-12-24-1-user_agent_id_null-postgres.sql update sites set settings = jsonb_set(settings, '{collect}', '30', true); alter table hits alter column user_agent_id drop not null; alter table hits drop constraint hits_user_agent_id_check; alter table hits add constr...
-- This lesson will entail designing a simple employee database with time -- tracking along with writing queries to maintain and report on the employee -- data. -- Start by creating a table for employees. create table employees ( id int primary key generated by default as identity, first_name varchar not null, l...