sql
stringlengths
6
1.05M
<reponame>DerekCL/WinstonLogSaver /* Creates table Users. NOTE: We only add schema here to demonstrate the ability of class QueryFile to pre-format SQL with static formatting parameters when needs to be. */ CREATE TABLE ${schema~}.events ( id serial primary key, level text, message text, m...
<reponame>TianRB/cgq -- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64) -- -- Host: localhost Database: cgq -- ------------------------------------------------------ -- Server version 5.7.28-0ubuntu0.18.04.4 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESUL...
CREATE OR REPLACE FUNCTION update_post() RETURNS TRIGGER AS $update_post$ BEGIN IF (OLD.topic_id <> NEW.topic_id) THEN UPDATE topic_statistics_mat SET expiry = NEW.modified WHERE topic_statistics_mat.topic_id IN (OLD.topic_id, NEW.topic_id); UPDATE forum_statistics_mat SET expiry = NEW.modifi...
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 06 Okt 2021 pada 12.58 -- Versi server: 10.4.13-MariaDB -- Versi PHP: 7.4.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET...
<reponame>DEFRA/prsd-iws ALTER TABLE [Notification].[FinancialGuarantee] DROP COLUMN [ValidFrom]; ALTER TABLE [Notification].[FinancialGuarantee] DROP COLUMN [ValidTo];
<reponame>Sourav692/FAANG-Interview-Preparation<gh_stars>1000+ # Time: O(n^2) # Space: O(1) SELECT e.Name AS Employee FROM Employee e LEFT JOIN Employee b ON e.ManagerId=b.Id WHERE e.Salary > b.Salary SELECT Name AS Employee FROM Employee e WHERE e.ManagerId IS NOT NULL AND e.Salary > (SELECT...
-- Openbravo POS is a point of sales application designed for touch screens. -- Copyright (C) 2007-2010 Openbravo, S.L. -- http://sourceforge.net/projects/openbravopos -- -- This file is part of Openbravo POS. -- -- Openbravo POS is free software: you can redistribute it and/or modify -- it under the ...
/* 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 sequence user_id_seq start with 10 increment by 50; create sequence role_id_seq start with 10 increment by 50; create sequence bm_id_seq start with 10 increment by 50; create sequence txn_id_seq start with 10 increment by 50; create sequence todo_id_seq start with 10 increment by 50; create sequence note_id_seq ...
<gh_stars>10-100 -- 1.x update to 2.x ALTER TABLE `wechat_ext_app` DROP COLUMN `method_name`, DROP COLUMN `beanName`, DROP COLUMN `methodName`, MODIFY COLUMN `restful_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `bean_name`, MODIFY COLUMN `support_req_type` varchar(255) CHARAC...
-- delete bioentities from Esembl for xenopus laevis, this will cascade delete corresponding annotations and mappings DELETE FROM A2_BIOENTITY WHERE ORGANISMID=57 and BIOENTITYTYPEID IN (1, 2); -- xenopus laevis is not in Ensembl - delete annotation source DELETE FROM A2_ANNOTATIONSRC WHERE name like 'xenopus laevis%'...
<filename>FUNCTION/GET_PART_COUNT_PRESERVE.sql CREATE OR REPLACE FUNCTION "GET_PART_COUNT_PRESERVE" ( collection_object_id IN VARCHAR2, preserve in varchar2 ) RETURN NUMBER -- Given a collection_object.collection_object_id, returns the number -- -- of specimen_parts for that collection_object. -- -- if n...
<reponame>mikaelene/dbt<gh_stars>1-10 {% macro get_relation_comment(persist_docs, model) %} {%- if persist_docs is not mapping -%} {{ exceptions.raise_compiler_error("Invalid value provided for 'persist_docs'. Expected dict but got value: " ~ persist_docs) }} {% endif %} {% if persist_docs.get('relation', f...
create table human ( userid bigint generated by default as identity (start with 1) not null, first_name varchar(255), last_name varchar(255), gender varchar(255), age integer not null, constraint pk_human primary key (userid) );
<reponame>coufalja/service-api<gh_stars>10-100 INSERT INTO users (login, password, email, role, type, full_name, expired, metadata) VALUES ('default_customer', '<PASSWORD>', '<EMAIL>', 'USER', 'INTERNAL', 'tester', FALSE, '{"metadata": {"last_login": 0}}'); INSERT INTO project_user (user_id, project_id, projec...
@connect_admin set echo on -- -- WARNING - about to create SPM_TESTU user -- pause p... drop user spm_testu cascade; --##### EDIT HERE TO SET PASSWORD ##### create user spm_testu identified by <your_password_here>; grant connect,resource to spm_testu; grant unlimited tablespace to spm_testu; grant select on v_$sqla...
<filename>api/pkg/db/migrate/schema/migrations/000124_suggestion_user_id.up.sql ALTER TABLE suggestions ADD COLUMN user_id TEXT;
CREATE TABLE etl_delegationLog ( practice_code VARCHAR(50) NOT NULL, instance INTEGER NOT NULL, name VARCHAR(500) NOT NULL, role VARCHAR(500), gcp_training BOOLEAN, gv_trained BOOLEAN, on_delegation_log_yn BOOLEAN, gv_start_del_log DATETIME, gv_end_del_log DATETIME, rsn_not_on_de...
LOAD DATA LOCAL INFILE 'DATA_PATH' INTO TABLE charity_commission.charity_area_of_operation CHARACTER SET UTF8MB4 FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' IGNORE 1 LINES ( date_of_extract, organisation_number, registered_charity_number, linked_charity_number, geographic_area_type, geographic_area_descri...
/* 10. Agregatne funkcije, grupisanje. */ use office; set profiling = 1; /* Pokretanje upita bez koriscenja indeksa. */ explain analyze select e.did, count(*) from Employees as e group by e.did; explain analyze select e.did, count(*) from Employees as e where e.salary = 10000 group by e.did; explain analyze select...
<gh_stars>0 # Content tags schema # --- !Ups CREATE TABLE contentTags ( contentId VARCHAR(256) NOT NULL, tag TEXT NOT NULL, CONSTRAINT contentTags_channelContent_id_fk FOREIGN KEY (contentId) REFERENCES channelContent (id) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE INDEX contentTags_fk ON contentTags (conten...
WITH T2 AS ( SELECT id, SUM(_count) agg_count FROM ( (SELECT seller_id AS id, COUNT(seller_id) _count FROM buy_sell GROUP BY seller_id) UNION ALL (SELECT buyer_id AS id, COUNT(buyer_id) AS _count FROM buy_sell GROUP BY buyer_id) ) T1 GROUP BY 1 ) SELECT * FROM T2 WHERE agg_count = (SELECT MAX(agg_count) FROM T2...
-- Changeset src/main/resources/liquibase/changelog/1_2/1_2_changelog.xml::20170130000254::diego CREATE TABLE City (id INT NOT NULL, name VARCHAR(20) NOT NULL, state VARCHAR(10) NULL, CONSTRAINT PK_CITY PRIMARY KEY (id), CONSTRAINT unq_city_name UNIQUE (name)); -- Changeset src/main/resources/liquibase/changelog/1...
CREATE TABLE "reporte_reporteproducto" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "nombre" varchar(100) NULL, "inicio" date NOT NULL, "fin" date NOT NULL, "tipo" integer NOT NULL) select * from base_consultas insert into mes (id,nombre) values (1,"Enero"); insert into mes (id,nombre) values (2,"Febrero"); inser...
CREATE TABLE tx_newt_domain_model_method ( endpoint int(11) unsigned DEFAULT '0' NOT NULL, type varchar(255) NOT NULL DEFAULT '', beusergroups int(11) unsigned NOT NULL DEFAULT '0', feusergroups int(11) unsigned NOT NULL DEFAULT '0' ); CREATE TABLE tx_newt_method_backendgroups_mm ( uid_local int(11) unsigned DEFA...
/* Top 15 Batches Group by SQL Text Order by Duration */ ;WITH CTE AS ( SELECT TextDataHashCode, NormalizedTextData AS Item, SUM(ExecutionCount) AS [#], SUM(CPU) AS CPU, CAST(CAST(SUM(CPU) AS DECIMAL(22,2))/ SUM(ExecutionCount) AS DECIMAL(22,2)) AS AvgCPU, SUM(Reads) AS Reads, CAST(CAST(SUM(Reads) AS D...
SELECT * FROM dbo.apple WHERE id = 1; SELECT * FROM dbo.taco WHERE id <> 1; SELECT * FROM dbo.carrot WHERE id IN (1, 2); SELECT * FROM dbo.carrot WHERE id IS NULL; SELECT * FROM dbo.carrot WHERE id IS NOT NULL;
SELECT Person.FirstName AS FirstName, Person.LastName AS LastName, Address.City AS City, Address.State AS State FROM Person LEFT JOIN Address ON Person.PersonId = Address.PersonId;
<reponame>ph1p/gotrue -- auth.users definition CREATE TABLE IF NOT EXISTS auth.users ( instance_id uuid NULL, id uuid NOT NULL UNIQUE, aud varchar(255) NULL, "role" varchar(255) NULL, email varchar(255) NULL UNIQUE, encrypted_password varchar(255) NULL, email_confirmed_at timestamptz NULL, invited_at timestamp...
<gh_stars>1-10 -- phpMyAdmin SQL Dump -- version 5.0.3 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Dec 06, 2020 at 01:01 AM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.4.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHA...
-- CreateEnum CREATE TYPE "SpotifyModeStrategy" AS ENUM ('QUEUE', 'HOST'); -- AlterTable ALTER TABLE "SpotifyMode" ADD COLUMN "strategy" "SpotifyModeStrategy" DEFAULT E'QUEUE';
<gh_stars>1-10 /*!50003 DROP FUNCTION IF EXISTS `randomizeVehicleHitpoints` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET character_set_client = utf...
<gh_stars>0 copy stns.shef_COOP1 (station_id, station_name, state, country, latitude, longitude, elevation,station_type) FROM stdin with delimiter as ',' ; 05D ,NEW TOWN ,ND,US,47.97,-102.48, -9999,UCOOP 0I9 ,ELIZABETHTOWN ,KY,US,37.75,-85.88, -9999,UCOOP 101M1 ,AMHERST ...
<filename>macros/external/create_external_table.sql {% macro create_external_table(source_node) %} {{ adapter_macro('dbt_external_tables.create_external_table', source_node) }} {% endmacro %} {% macro default__create_external_table(source_node) %} {{ exceptions.raise_compiler_error("External table creation is ...
-- Drill 3580 select c_date, c_integer, avg(c_integer) over (partition by c_date), avg(c_bigint - c_integer) over (partition by c_date) from j1_v ;
# --- Created by Ebean DDL # To stop Ebean DDL generation, remove this comment and start using Evolutions # --- !Ups create table annotation ( id integer auto_increment not null, idSeed varchar(255), idEmbryon integer, idUser in...
alter table `user_projects` drop primary key
SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for cms_category -- ---------------------------- DROP TABLE IF EXISTS `cms_category`; CREATE TABLE `cms_category` ( `id` int(11) NOT NULL auto_increment, `site_id` int(11) NOT NULL COMMENT '站点ID', `name` varchar(50) NOT NULL COMMENT '名称...
CREATE FOREIGN TABLE cont_freq_agg_stream (x integer, y text) SERVER pipelinedb; CREATE VIEW test_freq_agg0 AS SELECT x % 10 AS g, freq_agg(x) AS x_freq, freq_agg(y) AS y_freq FROM cont_freq_agg_stream GROUP BY g; INSERT INTO cont_freq_agg_stream (x, y) SELECT x, x::text FROM generate_series(1, 1000) x...
<gh_stars>100-1000 /* Navicat Premium Data Transfer Source Server : Docker-MySQL Source Server Type : MySQL Source Server Version : 50722 Source Host : 192.168.75.136:3306 Source Schema : tesco-coupon Target Server Type : MySQL Target Server Version : 50722 File Encoding ...
<reponame>warren830/lake BEGIN; -- This line is required USE lake_test; SELECT now(); COMMIT;
<filename>emadical_new.sql<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Feb 26, 2021 at 04:05 PM -- Server version: 5.7.33-0ubuntu0.18.04.1 -- PHP Version: 7.2.34-13+ubuntu18.04.1+deb.sury.org+1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START...
<filename>sql/mysql_db.sql CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password_reset_token` varchar(255) COLLATE ...
<reponame>NCIP/cabio /*L Copyright SAIC Distributed under the OSI-approved BSD 3-Clause License. See http://ncip.github.com/cabio/LICENSE.txt for details. L*/ ALTER TABLE GENE_TARGET DROP PRIMARY KEY CASCADE / DROP TABLE GENE_TARGET CASCADE CONSTRAINTS PURGE / -- -- GENE_TARGET (Table) -- -- Dependencie...
CREATE TABLE "video"."VonageRoomRecording" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "roomId" uuid, "startedAt" timestamptz NOT NULL, "endedAt" timestamptz, "vonageSessionId" text NOT NULL, "s3Url" text, "initiatedBy"...
CREATE FUNCTION setwayparkingpermit() RETURNS void LANGUAGE plpgsql AS $$ DECLARE success boolean := true; BEGIN WITH x as ( SELECT geom FROM parking_permits ) UPDATE ways_clean SET has_permit = true FROM x WHERE ST_Contains(x.geom, ways_clean.geom) = true OR ST_Crosses(x.geom, ways_clean.geom) = true; ...
-- If want to drop temp tables DROP TABLE IF EXISTS #t; DROP TABLE IF EXISTS #g; DROP TABLE IF EXISTS #r; DECLARE @payload NVARCHAR(max) = N'[{ "DirectionId": 1, "RouteId": 100001, "VehicleId": 1, "Position": { "Latitude": 47.61705102765316, "Longitude": -122.14291865504012 }, "TimestampUTC": "20201...
CREATE TABLE Users ( id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, email VARCHAR UNIQUE NOT NULL, password VARCHAR(255) NOT NULL, firstname VARCHAR(255) NOT NULL, lastname VARCHAR(255) NOT NULL, addr VARCHAR(255) NOT NULL, balance FLOAT NOT NULL ); CREATE TABLE Sellers ( id INT N...
-- phpMyAdmin SQL Dump -- version 4.3.8 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: 13-Jun-2018 às 15:32 -- Versão do servidor: 5.5.51-38.2 -- 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_SET_CLIENT...
<reponame>jspilinek/sqlperf<filename>sql/DBFiles.sql SELECT DB_NAME(database_id) AS [DB Name], file_id, name AS [Logical Name], type_desc, state_desc, size / 128 AS [Size(MB)], CASE max_size WHEN -1 THEN 'unlimited' WHEN 0 THEN 'no growth' ELSE CAST((CAST (max_size AS BIGINT)) / 128 AS VARCHA...
CREATE TABLE `covidinfo`.`information`( `id` INT(255) NOT NULL AUTO_INCREMENT, `username` VARCHAR(255) NOT NULL, `email` VARCHAR(255) NOT NULL, `mobile` VARCHAR(10) NOT NULL, `address` VARCHAR(255) NOT NULL, `symptom` VARCHAR(255) NOT NULL, `message` VARCHAR(255) NOT NULL, `created_at` D...
CREATE TABLE `words_positive` ( `word` varchar(100) NOT NULL, PRIMARY KEY (`word`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `donation`( `id` INTEGER NOT NULL AUTO_INCREMENT, `name` VARCHAR(255), `email` VARCHAR(255), `amount` FLOAT NOT NULL, `payment_id` INTEGER NOT NULL, PRIMARY KEY (`id`), INDEX `donation_fi_f8ae68` (`payment_id`), CONSTRAINT `donation_fk_f8ae68` FOREIGN KEY (`payment_id`) REFERENCES `payment` (`id`)) CREATE ...
CREATE TABLE word( id int NOT NULL AUTO_INCREMENT, word_string CHAR(255) NOT NULL, meanings VARCHAR(20000), UNIQUE KEY(word_string), PRIMARY KEY(id) ) ENGINE INNODB CHARACTER SET = utf8; CREATE INDEX word_string_index on word (word_string);
<gh_stars>1-10 -- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 18, 2017 at 02:17 PM -- Server version: 10.1.25-MariaDB -- PHP Version: 7.1.7 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*...
create schema <misp2_schema>; -- Drop Tables, Stored Procedures and Views DROP TABLE IF EXISTS <misp2_schema>.classifier, <misp2_schema>.check_register_status, <misp2_schema>.group_, <misp2_schema>.group_item, <misp2_schema>.group_person, <misp2_schema>.manager_candidate, <misp2_schema>.news, <misp2_schema>.org, <m...
<reponame>The-Makers-of-things/dune-snippets CREATE OR REPLACE VIEW iearn_v2.view_ytokens (symbol, contract_address, decimals, underlying_token_address) AS VALUES ('yDAI' ::text, '\x16de59092dAE5CcF4A1E6439D611fd...
<reponame>gpipperr/OraPowerShell --============================================================================== -- GPI - <NAME> -- Desc: SQL Script Locks overview -- Date: 2012 -- --============================================================================== set verify off set linesize 130 pagesize 300 set ech...
<reponame>whiscard/SQL-Queries<filename>openmrs/kapsowar/getServiceInventory.sql select department.name, itemcode.code, item.name, item.buying_price, iip.price as selling_price, item.minimum_quantity as reorderLevel from inv_item item left join inv_item_price iip on item.i...
select c.codigo, c.nombre_completo, sum(d.debito_mone_local) as debito_mone_local, sum(d.credito_mone_local) as credito_mone_local, 0.0 as saldo_anterior, 0.0 as saldo_debito, 0.0 as saldo_credito from cartera.cliente c inner join cartera.detalle_prove d on d.id_cliente=c.id --where group by c.codigo...
<filename>dist/circ/chromebook-checkouts-and-renewals-by-date-range.sql SELECT borrowers.cardnumber, borrowers.surname, borrowers.firstname, statistics.datetime, statistics.type, items.barcode, items.itype FROM borrowers LEFT JOIN statistics on (statistics.borrowernumber=borrowers.borrowernumber) LEFT JOIN items on (it...
<reponame>DennisGoldfarb/ProHits -- phpMyAdmin SQL Dump -- version 2.6.0-pl3 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jul 12, 2005 at 01:42 PM -- Server version: 3.23.41 -- PHP Version: 4.1.1 -- -- Database: `prohitsClient` -- -- --------------------------------------------------------...
<reponame>desarrollo-bexandy-rodriguez/ares-app-zf2<filename>data/vistas/vista_productos_disponibles.sql CREATE VIEW `vista_productos_disponibles` AS SELECT `disponiblidad_productos`.`disponible`, `productos`.`id`, `productos`.`nombre`, TRUNCATE(IF(`disponibilidad_x_almacen`.`cantidad`<> 0,`disponibilidad_x_alm...
<filename>go/src/infra/tricium/api/bigquery/views/events.comment_events.sql<gh_stars>0 -- This view contains one row per event (comment post or not useful report) -- and contains extra information about the change ID and comment details. SELECT time, FlattenedComments.id AS comment_id, CommentIDs.gerrit_project, ...
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [Profile.Data].[EagleI.UpdateEagleITables] AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; select right(ProfilesURI,charindex('/',reverse(ProfilesURI))-1) NodeID, * into #e ...
-- phpMyAdmin SQL Dump -- version 4.9.5deb2 -- https://www.phpmyadmin.net/ -- -- Servidor: localhost:3306 -- Tiempo de generación: 23-10-2020 a las 17:26:50 -- Versión del servidor: 8.0.21-0ubuntu0.20.04.4 -- Versión de PHP: 7.4.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_...
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1:3306 -- Tiempo de generación: 18-11-2018 a las 22:02:04 -- Versión del servidor: 5.7.23 -- Versión de PHP: 7.2.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /...
ALTER TABLE `addressbook` ADD `gender` ENUM('M','F') NOT NULL DEFAULT 'M' AFTER `company`, ADD `mobile` INT NULL AFTER `gender`, ADD `telefax` INT NULL AFTER `mobile`, ADD `note` TEXT NULL AFTER `telefax`; ALTER TABLE `order_info` ADD `status` ENUM('new','viewed') NOT NULL DEFAULT 'new' AFTER `aggrement`; ALTER TABLE ...
<reponame>jakubwieczorek/shop -- Generated by Oracle SQL Developer Data Modeler 19.4.0.350.1424 -- at: 2020-07-04 21:26:22 CEST -- site: Oracle Database 11g -- type: Oracle Database 11g CREATE SEQUENCE category_id_sequence START WITH 1 INCREMENT BY 1 CACHE 100 ORDER; CREATE SEQUENCE complaint...
<filename>code_sample/lc_1068.sql # Solution 1 select p.product_name, s.year, s.price from Sales s left join Product p on s.product_id = p.product_id
<filename>sources/java/Sample.sql /* * Copyright (c) Meta Platforms, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* this is a demo procedure, it's rather silly... */ @attribute(cql:vault_sensitive) @attri...
<filename>dbscripts/V1.0/createBasicTables.sql CREATE TABLE USER_PROFILE ( USER_ID int(11) NOT NULL AUTO_INCREMENT, FIRST_NAME varchar(20) NOT NULL, LAST_NAME varchar(20) NOT NULL, EMAIL_ID varchar(30) NOT NULL, PHONE_NUMBER int(13) NOT NULL, GENDER varchar(20) NOT NULL, USER_ROLE varchar (15) NOT NULL, ...
<gh_stars>0 -- Drop the dna_records table if it already exists DROP TABLE IF EXISTS dna_records_1; -- DDL to create table CREATE TABLE dna_records_1( record_id INT, geneName VARCHAR(30), geneSymbol VARCHAR(10), organism VARCHAR(30), PRIMARY KEY (record_id) ); -- DML to insert some data -- Note the...
CREATE TABLE posts ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, title VARCHAR NOT NULL, body TEXT NOT NULL, published BOOLEAN NOT NULL DEFAULT 0 )
USE pick; DROP PROCEDURE IF EXISTS GET_TEACHER_FROM_FLOOR; DROP PROCEDURE IF EXISTS SET_TEACHER; DROP PROCEDURE IF EXISTS DIVIDE_STATE_FROM_PERIOD; DROP PROCEDURE IF EXISTS SET_STATE; DROP PROCEDURE IF EXISTS SET_DEFAULT_STATE; DROP PROCEDURE IF EXISTS CREATE_DEFAULT_ATTENDANCE; DELIMITER $$ CREATE PROCEDURE GET_TE...
CREATE TABLE books ( id serial PRIMARY KEY UNIQUE NOT NULL, isbn varchar(255) UNIQUE NOT NULL, name varchar(255) NOT NULL, authors varchar(255), publisher varchar(255), content varchar(511), created_at timestamp NOT NULL DEFAULT NOW() );
/* This procedure will start a new transaction and lock on the master row for the given key. The output writeLockToken and precursorToken will be non-null if either exists and are not expired for the given lock. */ CREATE PROCEDURE lockOnWriteReadMaster(IN lockKey VARCHAR(256), OUT writeLockToken VARCHAR(256), OUT pre...
WITH const_col as ( SELECT '"'||pcl.relname||'"' as tabela ,ccu.column_name as coluna ,pco.contype as tipo ,cck.check_clause as ck_clause FROM pg_class pcl JOIN pg_constraint pco ON pco.conrelid = pcl.oid join pg_namespace pns on pns.oid = pco.connamespace JOIN information_schema.constraint_colum...
INSERT INTO cats (gender, name, birthdate, breed, furColor, furLength, preferences) VALUES ("m", "Tux", 2022-01-01, "Europese korthaar", "", "", "");
<gh_stars>10-100 -- file:create_operator.sql ln:49 expect:true CREATE OPERATOR !=- ( leftarg = int8, procedure = numeric_fac )
-- Destroy and recreate the database from scratch DROP TABLE IF EXISTS technician_region; DROP TABLE IF EXISTS technician; DROP TABLE IF EXISTS depot_region; DROP TABLE IF EXISTS depot; DROP TABLE IF EXISTS site; DROP TABLE IF EXISTS customer; DROP TABLE IF EXISTS city_region; DROP TABLE IF EXISTS city; DROP TABLE IF E...
<gh_stars>0 SELECT created, source_id, jdata FROM eniwareedge.sn_general_Edge_datum WHERE created = ? AND source_id = ?
<filename>doc/schema/mysql.ddl create table articles ( pmid varchar(255) unique not null, pmc varchar(255), doi varchar(255), other_id varchar(255), title varchar(1000), abstract text, authors varchar(1000), affiliations varchar(1000), mesh_terms varchar(1000), publication_types varchar(1000), keywords varchar(1000), c...
--- -- #%L -- AIW i2b2 ETL -- %% -- Copyright (C) 2012 - 2015 Emory University -- %% -- 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 --...
<reponame>maransowthri/sql -- For both MySQL and PostgreSQL insert into users (full_name, yearly_salary, current_status) values ('<NAME>', 30000, 'employed'), ('<NAME>', 40000, 'employed'), ('<NAME>', 1000, 'unemployed'); insert into employers (company_name, company_address, yearly_revenue, is_hiring) values ('<NAME>...
<reponame>CLClark/pinclone<filename>postgres-sql.sql<gh_stars>1-10 /************ "likes" table *************/ -- Table: public.likes -- DROP TABLE public.likes; CREATE TABLE public.likes ( likeid uuid NOT NULL DEFAULT gen_random_uuid(), userliking text COLLATE pg_catalog."default" NOT NULL, likedpi...
<filename>files/search-export/so-rna-types.sql COPY ( select distinct coalesce(pre.assigned_so_rna_type, pre.so_rna_type) FROM rnc_rna_precomputed pre where coalesce(pre.assigned_so_rna_type, pre.so_rna_type) is not null ) TO STDOUT
-- phpMyAdmin SQL Dump -- version 2.11.11.3 -- http://www.phpmyadmin.net -- -- Host: 172.16.31.10 -- Generation Time: Aug 18, 2016 at 06:26 PM -- Server version: 5.5.43 -- PHP Version: 5.1.6 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHA...
<reponame>frankgh/cassandra<filename>doc/modules/cassandra/examples/CQL/spec_retry_values.cql min(99percentile,50ms) max(99p,50MS) MAX(99P,50ms) MIN(99.9PERCENTILE,50ms) max(90percentile,100MS) MAX(100.0PERCENTILE,60ms)
<filename>tests/queries/0_stateless/00044_sorting_by_string_descending.sql SELECT s FROM (SELECT materialize('abc') AS s FROM system.numbers LIMIT 100) ORDER BY s DESC
<filename>go/src/infra/appengine/weetbix/internal/span/init_db.sql -- Copyright 2021 The Chromium Authors. All rights reserved. -- -- Use of this source code is governed by a BSD-style license that can be -- found in the LICENSE file. -------------------------------------------------------------------------------- -- ...
ALTER TABLE `client_accounts` ADD COLUMN `user_token_id` INT NULL COMMENT '' ; ALTER TABLE `user_token` ADD COLUMN `name` TEXT NULL COMMENT '' AFTER `parent_id` ; DELETE FROM `user_token`; CREATE TABLE `migration` ( `id` INT NOT NULL COMMENT '', `user_id` INT NULL COMMENT '', `created` TIMESTAMP NOT NULL COM...
CREATE schema FVT_COMPRESS_QWER; set search_path to FVT_COMPRESS_QWER; create table test_partition_for_null_list (a int, b int, c int, d int) partition by list (a) ( partition test_partition_for_null_list_p1 values(0), partition test_partition_for_null_list_p2 values(1,2,3), partition test_partition_for_null_list_...
DROP DATABASE IF EXISTS blog_about_it_db; CREATE DATABASE blog_about_it_db;
<filename>postgres/test-data.sql --Users --insert into users (name, email) values ('Super name', '<EMAIL>'); --insert into users (name, email) values ('Andrew', '<EMAIL>'); --insert into users (name, email) values ('Vlad', '<EMAIL>'); --insert into users (name, email) values ('Valik', '<EMAIL>'); --insert into users (n...
<filename>dw_projects/sfdc_ingest_daily/sql_scripts/dml/stg_account.sql drop table if exists bi_stage.stg_sfdc_account; create table if not exists bi_stage.stg_sfdc_account ( id varchar not null, name varchar, billingcity varchar, billingstate varchar, billingcountry varchar, ownerid varchar, createddate timest...
<filename>docker/postgres/molinaro.sql<gh_stars>0 -- PostgreSQL database dump for book: -- SQL Cookbook. <NAME>. 2009 -- -- Employee table -- CREATE TABLE public.emp ( empno integer NOT NULL, ename character varying(10), job character varying(9), mgr integer, hiredate date, sal integer, co...
<reponame>Fahmincibi/test1_app<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.3.11 -- http://www.phpmyadmin.net -- -- Client : 127.0.0.1 -- Généré le : Lun 10 Juillet 2017 à 18:13 -- Version du serveur : 5.6.24 -- Version de PHP : 5.6.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 S...
<gh_stars>0 <% const words = ['uno', 'due', 'tre']; %> <% for (const word of words) { %> select '<%= word %>'; <% } %>
<gh_stars>0 CREATE TABLE users( id INT auto_increment NOT NULL, name VARCHAR(50) UNIQUE NOT NULL, password VARCHAR(200) NOT NULL, email VARCHAR(50) NOT NULL, updated_at VARCHAR(100) NOT NULL, created_at VARCHAR(100) NOT NULL, PRIMARY KEY(id) ); CREATE TABLE travels( id INT auto_incremen...