sql stringlengths 6 1.05M |
|---|
<filename>SQLServer/2008/ZGWSecurity/Stored Procedures/Get_Function_Types.sql
/*
Usage:
DECLARE
@P_Function_SeqID INT = 1,
@P_Debug INT = 1
exec ZGWSecurity.Get_Function_Types
@P_Function_SeqID,
@P_Debug
*/
-- =============================================
-- Author: <NAME>
-- Create date: 08/16/2011
-- De... |
------------------------------------------------------------------------------------------
--Choose database to use
------------------------------------------------------------------------------------------
use telcoedw
go
------------------------------------------------------------------------------------------
--Vie... |
DROP TABLE prices.hourly_bridge_token_price_ratios;
CREATE TABLE IF NOT EXISTS prices.hourly_bridge_token_price_ratios(
hour timestamptz NOT NULL,
lp_contract bytea,
erc20_token bytea NOT NULL,
bridge_token bytea NOT NULL,
bridge_symbol text,
bridge_decimals numeric,
price_ratio numeric,
... |
-- AlterEnum
ALTER TYPE "Feature" ADD VALUE 'STEAM_OAUTH';
|
<reponame>crs2007/CodeSmell
-- =============================================
-- Author: sharonr
-- Create date: 03/07/2021
-- Update date: 25/07/2021 fix function bug
-- 26/07/2021 @LoginName sysname = NULL,@RunningID INT = NULL. Remove Temp tables
-- Description: Find Missing EXECUTE Permissions.
-- =============... |
<gh_stars>0
DROP TABLE IF EXISTS `shuyang_vote_option`; |
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Version : 50721
Source Host : localhost:3306
Source Database : wqm
Target Server Type : MYSQL
Target Server Version : 50721
File Encoding : 65001
Date: 2022-02-11 10:44:32
*/
SET FOREIGN_KEY_CHECKS=0;
-- -----... |
<reponame>endeavourhealth-discovery/Explorer<filename>Database/getCurrentAddress.sql
-- USE subscriber_pi_rv;
-- function to retrieve the patient's current address
DROP FUNCTION IF EXISTS getCurrentAddress;
DELIMITER //
CREATE FUNCTION getCurrentAddress(p_address_id BIGINT, p_id BIGINT)
RETURNS VARCHAR(1000)
... |
# Users schema
# --- !Ups
CREATE TABLE Team (
id serial NOT NULL,
name varchar(50) NOT NULL,
about text NOT NULL,
PRIMARY KEY (id)
);
# --- !Downs
DROP TABLE Team;
|
<reponame>xiaomoxu/spring-cloud-zuul-authentication
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50720
Source Host : localhost:3306
Source Database : spring_security
Target Server Type : MYSQL
Target Server Version : 50720
File Encoding : 65001
D... |
<gh_stars>1-10
select
type || ' ' || name as resource,
case
when (arguments -> 'encrypted') is null then 'alarm'
when (arguments -> 'logging') is null then 'alarm'
when (arguments -> 'logging' ->> 'enabled')::boolean then 'ok'
else 'alarm'
end status,
name || case
when (arguments -> 'encrypt... |
-- @testpoint: 插入正常MAC类型值
drop table if exists test_macaddr_01;
create table test_macaddr_01(type macaddr);
insert into test_macaddr_01 values('08:00:2b:01:02:03');
insert into test_macaddr_01 values('08-00-2b-01-02-03');
insert into test_macaddr_01 values('08002b:010203');
insert into test_macaddr_01 values('0800.2b0... |
<gh_stars>0
-- @testpoint: 创建列存表,验证其他类型对主键/唯一约束/唯一索引的支持,部分step合理报错
--测试点一:创建列存普通表,字段类型为货币/大对象类型,指定主键约束
--step1:测试点一,创建列存普通表,字段类型为货币/大对象类型,指定主键约束 expect:成功
drop table if exists t_columns_unique_index_0089_01;
create table t_columns_unique_index_0089_01(
salary money,name clob,primary key(salary,name)) with(orientatio... |
select * from estados;
select nome, sigla from estados;
select nome AS 'Nome', sigla AS 'Sigla' from estados;
select nome, sigla from estados
where regiao = 'Sul';
select nome, sigla from estados
where regiao = 'Sul'
order by populacao;
select nome, sigla from estados
where regiao = 'Sul'
order by p... |
<reponame>GabrielCordeiroDev/yoffy-node-api
-- CreateTable
CREATE TABLE "messages" (
"id" TEXT NOT NULL,
"text" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"userId" TEXT NOT NULL,
CONSTRAINT "messages_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "message... |
<filename>postgres/migrations.sql
CREATE TABLE public.order
(
id serial PRIMARY KEY,
name VARCHAR (50) NOT NULL,
description VARCHAR NULL,
created_on TIMESTAMP NOT NULL
);
CREATE TABLE public.job_queue
(
id serial NOT NULL,
new_data json NULL,
old_data json NULL,
status character varyi... |
<filename>database/news.sql
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 30, 2018 at 04:46 AM
-- 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 = "... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 31 Bulan Mei 2019 pada 07.17
-- Versi server: 10.1.36-MariaDB
-- Versi PHP: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<filename>prisma/migrations/20220312170753_init/migration.sql
-- CreateEnum
CREATE TYPE "Sexo" AS ENUM ('MASCULINO', 'FEMENINO');
-- CreateEnum
CREATE TYPE "Educacion" AS ENUM ('NINGUNA', 'PRIMARIA', 'SECUNDARIA', 'LICENCIATURA', 'MAESTRIA', 'DOCTORADO');
-- CreateTable
CREATE TABLE "puestos" (
"id" SERIAL NOT NU... |
<reponame>robertjlooby/scotty-story-board
CREATE TABLE projects (
id SERIAL PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
description TEXT
);
CREATE UNIQUE INDEX ON projects (name);
|
SELECT
{{fields_block}}
FROM
{{table}}
{{where_block}} |
<filename>src/test/resources/fts3ac.test_28.sql
-- fts3ac.test
--
-- execsql {
-- DELETE FROM ft WHERE one = 'foo';
-- SELECT offsets(ft) FROM ft WHERE ft MATCH 'foo';
-- }
DELETE FROM ft WHERE one = 'foo';
SELECT offsets(ft) FROM ft WHERE ft MATCH 'foo'; |
create table pk as (
select p.id as p_id, k_person2id
from person p,
knows
where p.p_personid = k_person1id
);
create
index pk_idx on pk(p_id);
|
<reponame>NordiCelt/TraXdotNet<gh_stars>1-10
CREATE PROCEDURE [dbo].[BugNet_Query_SaveQueryClause]
@QueryId INT,
@BooleanOperator NVarChar(50),
@FieldName NVarChar(50),
@ComparisonOperator NVarChar(50),
@FieldValue NVarChar(50),
@DataType INT,
@CustomFieldId INT = NULL
AS
INSERT BugNet_QueryC... |
<filename>sql/updates/0.8/4464_instance_template.sql
ALTER TABLE `instance_template` ADD `script` varchar(255) NOT NULL default ''; |
<filename>docs/data/upgrade.sql
ALTER TABLE `pt_merchant`
RENAME TO `pt_merchant`;
ALTER TABLE `pt_page`
CHANGE COLUMN `partner_id` `merchant_id` INT(11) NULL DEFAULT NULL;
ALTER TABLE `dlv_partner_bind`
CHANGE COLUMN `partner_id` `merchant_id` INT(11) NULL DEFAULT NULL,
RENAME TO `dlv_merchant_bind`;
ALTER TABLE `... |
<reponame>sevaggap/UofT-SCS-Coding-Bootcamp-Project-2
DROP DATABASE IF EXISTS recipes_db;
CREATE DATABASE recipes_db;
|
select account_id, akas, title
from aws.aws_guardduty_finding
where akas::text = '["{{ output.resource_aka.value }}"]'; |
<filename>migrations/part_image_change_column.sql
ALTER TABLE part_image CHANGE image_url image_path varchar(255); |
<gh_stars>1-10
\o proj2-U45623430.out
-- Put your SQL statement under the following lines:
--1. Find all the coaches who have coached exactly ONE team. List their first names followed by their last names;
SELECT DISTINCT c1.cid, c1.firstname, c1.lastname
FROM coaches_season c1
WHERE NOT EXISTS (SELECT null -- try to ... |
<gh_stars>0
/*L
Copyright Duke Comprehensive Cancer Center
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/catrip/LICENSE.txt for details.
L*/
INSERT INTO SNP_ANALYSIS_GROUP ( ANA_GRP_ID, ANA_GRP_NAME, ANA_GRP_DESCRIPTION, ASSO_ANALYSIS_ID,
MEMBER_COUNT ) VALUES (
1, 'Incide... |
<gh_stars>0
-- @ creating xkeys table ...
DROP TABLE IF EXISTS xkey;
CREATE TABLE xkey
(
id VARCHAR(10),
accession VARCHAR(16),
entry VARCHAR(16),
description VARCHAR(256),
PRIMARY KEY(id),
INDEX(accession),
INDEX(entry)
); |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 08, 2018 at 08:43 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET... |
<reponame>gitter-badger/doughnut
CREATE TABLE note (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
title varchar(100) not null,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1;
|
<filename>fichier_SQL/creationBDD.sql<gh_stars>0
-- DROP TABLE IF EXISTS Book;
-- DROP TABLE IF EXISTS Author;
-- DROP TABLE IF EXISTS Users;
-- DROP TYPE IF EXISTS kindOf;
-- DROP TYPE IF EXISTS currentOf;
-- DROP TYPE IF EXISTS roleOf;
CREATE TYPE kindOf AS ENUM('po%C3%A9sie', 'roman', 'th%C3%A9atre', 'jeunesse', 'B... |
<reponame>jackfiallos/workflow_notas
-- --------------------------------------------------------
-- Host: 192.168.15.21
-- Versión del servidor: 5.5.34-0ubuntu0.13.04.1 - (Ubuntu)
-- SO del servidor: debian-linux-gnu
-- HeidiSQL Versión: 8.0.0.4396
-- ------... |
<filename>PL4/5.sql
-- Mostre a lista dos Contínuos e o respectivo salário com um aumento de 13,55% para
-- estes empregados. O salário depois do aumento deverá ser arredondado na primeira
-- casa decimal.
SELECT emp.nome, emp.funcao, emp.sal, ROUND(emp.sal * 1.1355, 1) "SAL COM AUMENTO"
FROM emp
WHERE emp.funcao = ... |
<filename>db_archive/sql_archive/5116__create_proc_anteroapi_p_lataa_api_toimitilat_esilataus.sql<gh_stars>1-10
USE [AnteroAPI]
GO
DROP PROCEDURE IF EXISTS [dw].[p_lataa_api_toimitilat_esilataus]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dw].[p_lataa_api_toimitilat_esilataus] AS
TRUNC... |
<gh_stars>1-10
INSERT INTO `addon_account` (`name`, `label`, `shared`) VALUES
('society_orpailleurs', 'Orpailleurs',1)
;
INSERT INTO `addon_inventory` (`name`, `label`, `shared`) VALUES
('society_orpailleurs', 'Orpailleurs', 1)
;
INSERT INTO `datastore` (`name`, `label`, `shared`) VALUES
('society_orpailleurs', 'Or... |
-- ===================================================
-- Description: Commands for creating all SQL tables in the PCS
-- ===================================================
# Input table 1 - Historical orders
CREATE TABLE [FcastML].[HistoricalOrders](
[CustomerName] [nvarchar](100) NOT NULL,
[ProductCatego... |
<gh_stars>10-100
select
p.year,
--p.visitor_name,p.home_name,
--v.strength::numeric(6,4) as v_str,
--h.strength::numeric(6,4) as h_str,
--(v.strength*d.exp_factor)::numeric(6,4) as v_str,
--(h.strength*o.exp_factor)::numeric(6,4) as h_str,
sum(
(h.strength*o.exp_factor)^16/
((h.strength*o.exp_factor)^16+(v.strength*d.e... |
<filename>src/hg/lib/mouseTraceInfo.sql
# traceInfo.sql was originally generated by the autoSql program, which also
# generated traceInfo.c and traceInfo.h. This creates the database representation of
# an object which can be loaded and saved from RAM in a fairly
# automatic way.
# Handed-edited to set table name a... |
-- For new (ActionType = A) or mixed aggregate (ActionType = E) assistance awards specifically,
-- the CFDA_Number must be active as of the ActionDate. This does not apply to correction records
-- (those with CorrectionDeleteIndicator = C and delete records).
WITH detached_award_financial_assistance_fabs37_1_{0} AS
... |
-- This script creates airlineWithIndex table needed for running perf tuning tests.
use PerfTuning;
go
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = N'airlineWithIndex')
BEGIN
PRINT 'dropping existing table airlineWithIndex'
drop table [airlineWithIndex];
END
GO
CREATE TABLE [dbo... |
--
-- PostgreSQL database cluster dump
--
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
--
-- Roles
--
--NOTE: change the password in production evn
CREATE ROLE tdw;
ALTER ROLE tdw WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION PASSWORD '<PASSWORD>';
--NOTE: change the p... |
<reponame>dianasaur323/timescaledb
-- Copyright (c) 2016-2018 Timescale, Inc. All Rights Reserved.
--
-- This file is licensed under the Apache License,
-- see LICENSE-APACHE at the top level directory.
--make sure diff only has explain output not result output
\! diff ${TEST_OUTPUT_DIR}/results/append_unoptimized.ou... |
-- Revert ggircs-portal:set_general_permissions from pg
begin;
revoke usage on schema ggircs_portal from ciip_administrator, ciip_analyst, ciip_industry_user, ciip_guest;
revoke usage on schema swrs from ciip_administrator, ciip_analyst, ciip_industry_user;
revoke select on all tables in schema swrs from ciip_a... |
-- 编写一个 SQL 查询来实现分数排名。
--
-- 如果两个分数相同,则两个分数排名(Rank)相同。请注意,平分后的下一个名次应该是下一个连续的整数值。换句话说,名次之间不应该有“间隔”。
--
-- +----+-------+
-- | Id | Score |
-- +----+-------+
-- | 1 | 3.50 |
-- | 2 | 3.65 |
-- | 3 | 4.00 |
-- | 4 | 3.85 |
-- | 5 | 4.00 |
-- | 6 | 3.65 |
-- +----+-------+
-- 例如,根据上述给定的 Scores 表,你的查询应该返回(按分数从高到... |
START TRANSACTION;
-- update the version
UPDATE sec_schema_version SET version_value='56' WHERE version_key='schema_patch';
-- HSQL does not allow a sequence to be started or reset to a value from a variable; the grammar only accepts an integer literal.
-- Fortunately it's rare that HSQL databases will need t... |
-- Name: FindTagsInQuery
-- Schema: posda_queries
-- Columns: ['tag']
-- Args: ['name']
-- Tags: ['meta', 'test', 'hello', 'query_tags']
-- Description: Find all queries matching tag
select
tag from (
select name, unnest(tags) as tag
from queries) as foo
where
name = ? |
<gh_stars>100-1000
-- MODULE DML050
-- SQL Test Suite, V6.0, Interactive SQL, dml050.sql
-- 59-byte ID
-- TEd Version #
-- AUTHORIZATION HU
set schema HU;
--O SELECT USER FROM HU.ECCO;
VALUES USER;
-- RERUN if USER value does not match preceding AUTHORIZATION comment
-- date_time print
-- TEST:0226 FIPS siz... |
-- Tags: no-parallel
CREATE TABLE old_syntax_01071_test (date Date, id UInt8) ENGINE = MergeTree(date, id, 8192);
ALTER TABLE old_syntax_01071_test ADD INDEX id_minmax id TYPE minmax GRANULARITY 1; -- { serverError 36 }
CREATE TABLE new_syntax_01071_test (date Date, id UInt8) ENGINE = MergeTree() ORDER BY id;
ALTER T... |
<gh_stars>10-100
/*
Migrates the pre-refactor database of april 2020 to database verion 1
rename all tables to table_old
run version 1 population script
filter, copy change data
A deactivated, unauthorized user with the name "unknown_staff" is created to attribute to unknown staff
*/
INSERT INTO DBPREFIXsections (id... |
CREATE SEQUENCE seq_pessoa nocache;
CREATE TABLE PESSOA (
ID NUMBER(11,0) NOT NULL ,
NOME VARCHAR2(30) NOT NULL ,
SOBRENOME VARCHAR2(50) NOT NULL ,
EMAIL VARCHAR2(50) NOT NULL ,
CPF VARCHAR2(11) NOT NULL ,
CONSTRAINT "PESSOA_PK" PRIMARY KEY (ID)
) ;
CREATE OR REPLACE TRIGGER BI__PESSOA
be... |
<filename>migrations/587-persona-checksum.sql
ALTER TABLE `personas`
ADD COLUMN `checksum` varchar(64) NOT NULL DEFAULT '',
ADD COLUMN `dupe_persona_id` int(11) UNSIGNED NULL,
ADD CONSTRAINT `dupe_persona_id_refs_id` FOREIGN KEY (`dupe_persona_id`)
REFERENCES `personas` (`id`);
CREATE INDEX persona... |
<reponame>3dlink/criollos_hompage
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 16-08-2016 a las 20:39:03
-- Versión del servidor: 10.1.10-MariaDB
-- Versión de PHP: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!4... |
use [master]
go
create database [Sync1]
go
USE [Sync1]
GO
CREATE TABLE [dbo].[Users](
[Id] [int] NOT NULL,
[Name] [nvarchar](10) NOT NULL,
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED ([Id] ASC)
)
GO
CREATE TABLE [dbo].[Roles](
[Id] [int] NOT NULL,
[Name] [nvarchar](10) NOT NUL... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 30, 2018 at 04:23 AM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 7.0.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
<reponame>AliAbdurohman16/projek_desa<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 04 Jul 2021 pada 17.16
-- Versi server: 10.4.19-MariaDB
-- Versi PHP: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:0... |
CREATE TABLE [dbo].[GdprDTD]
(
[Id] UNIQUEIDENTIFIER CONSTRAINT [DF_GdprDTD_Id] DEFAULT NEWID() NOT NULL PRIMARY KEY NONCLUSTERED,
[DisplayName] NVARCHAR(40) NOT NULL,
[Details] NVARCHAR(MAX) NULL
)
GO;
CREATE UNIQUE CLUSTERED INDEX [IX_GdprDTD_DisplayName] ON [dbo].[GdprDTD] ([DisplayName])
GO;
|
alter table regression_model drop constraint regression_model_model_type_check;
alter table regression_model add constraint regression_model_model_type_check check (model_type in ('Price', 'Volatility', 'Extrema')); |
<filename>schema.sql
CREATE SCHEMA IF NOT EXISTS "{{.Schema}}";
CREATE TABLE IF NOT EXISTS "{{.Schema}}".gue_jobs
(
job_id bigserial NOT NULL PRIMARY KEY,
priority smallint NOT NULL,
run_at timestamptz NOT NULL,
job_type text NOT NULL,
args json NOT NULL,
... |
<reponame>nightslife/bamazon-repo<gh_stars>0
DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE bamazon;
use bamazon;
CREATE TABLE products (
item_id INTEGER auto_increment NOT NULL,
product_name VARCHAR(255) NOT NULL,
department_name VARCHAR(255) NOT NULL,
price INTEGER NOT NULL,
stock_quantity INTEGER... |
<reponame>bpx-energy/LE_Utility_C-series
CREATE PROCEDURE [AFEDive].[GET_MEAN_DAILY_COST_FOR_OFFSET_WELLS]
@API10 VARCHAR(10)
AS
SELECT MDC.DEPTH, MDC.CUM_WELL_COST
FROM [AFEDive].[DRILL_WELL_OFFSET] DWO
INNER JOIN [AFEDive].[DRILL_OFFSET_MEAN_DAILY_COST] MDC ON MDC.OFFSET_ID = MDC.OFFSET_ID
WHERE DWO.API10 = ... |
SELECT
city,
state
FROM
station; |
SELECT "Medicare2_1"."provider_type" AS "provider_type" FROM "Medicare2_1" WHERE ("Medicare2_1"."nppes_provider_state" = 'NY') GROUP BY 1 ORDER BY "provider_type" ASC
SELECT "Medicare2_2"."hcpcs_description" AS "hcpcs_description" FROM "Medicare2_2" WHERE ("Medicare2_2"."nppes_provider_state" = 'NY') GROUP BY 1 ORDER ... |
<gh_stars>1-10
CREATE TABLE Participante (
DNI CHAR(9) NOT NULL,
nombre VARCHAR(32) NOT NULL,
ciudad VARCHAR(20) NOT NULL,
PRIMARY KEY(DNI)
);
CREATE TABLE Charla (
codigo INT NOT NULL,
titulo VARCHAR(80) NOT NULL,
resumen VARCHAR(200) NULL,
duracion INT DEFAULT 30 NOT NULL,
PRIMARY KEY (codigo)
);
C... |
insert into users(id, username, password, last_password_reset, authorities) values(users_seq.nextval, 'user', '$2a$08$UkVvwpULis18S19S5pZFn.YHPZt3oaqHZnDwqbCW9pft6uFtkXKDC', null, 'USER')
insert into users(id, username, password, last_password_reset, authorities) values(users_seq.nextval, 'admin', <PASSWORD>Dn<PASSWORD... |
drop table events;
create table events (
event_id integer,
event_name varchar(50),
location_id integer references locations(location_id),
event_start timestamp,
event_end timestamp,
attendance integer,
description varchar(1000)
);
|
create extension fuzzystrmatch;
|
<gh_stars>1-10
SELECT p.[Name] AS [ProductName],
AVG(f.Rate) AS [ProductAverageRate],
d.[Name] AS [DistributorName],
c.[Name] AS [DistributorCountry]
FROM Products AS p
JOIN ProductsIngredients AS pri ON p.Id = pri.ProductId
JOIN Ingredients AS i ON pri.IngredientId = i.Id
JOIN Distributors AS d ON i.Dis... |
<reponame>hekailiang/actor-server
CREATE TABLE avatar_datas (
entity_id bigint NOT NULL,
entity_type int NOT NULL,
small_avatar_file_id bigint,
small_avatar_file_hash bigint,
small_avatar_file_size int,
large_avatar_file_id bigint,
large_avatar_file_hash bigint,
l... |
INSERT INTO `users` (`id`, `user_name`, `user_hash`, `system_generated_password`, `<PASSWORD>`, `authenticate_id`, `sugar_login`, `first_name`, `last_name`, `is_admin`, `external_auth_only`, `receive_notifications`, `description`, `date_entered`, `date_modified`, `modified_user_id`, `created_by`, `title`, `photo`, `dep... |
-- wherelimit.test
--
-- execsql {DELETE FROM t1 WHERE x=2 ORDER BY x LIMIT 30, 50}
DELETE FROM t1 WHERE x=2 ORDER BY x LIMIT 30, 50 |
-- file:rowsecurity.sql ln:1185 expect:true
SELECT * FROM t1
|
-- file:alter_table.sql ln:1419 expect:true
select * from at_view_2
|
insert into storage_plans(provider,name,date_observed,region,storage_cost,minimum_volume_size,storage_type) values
('Google Cloud Persistent Disk','Standard provisioned space','2018-07-18','Iowa','0.040',NULL,NULL)
,('Google Cloud Persistent Disk','SSD provisioned space','2018-07-18','Iowa','0.170',NULL,'SSD')
... |
<gh_stars>0
-- 3D City Database - The Open Source CityGML Database
-- https://www.3dcitydb.org/
--
-- Copyright 2013 - 2021
-- Chair of Geoinformatics
-- Technical University of Munich, Germany
-- https://www.lrg.tum.de/gis/
--
-- The 3D City Database is jointly developed with the following
-- cooperation partners:
--
... |
CREATE TABLE MLMANAGER.model_metadata (
run_uuid VARCHAR(32) NOT NULL,
action VARCHAR(50) NOT NULL,
tableid VARCHAR(250) NOT NULL,
trigger_type VARCHAR(250) NOT NULL,
triggerid VARCHAR(250) NOT NULL,
triggerid_2 VARCHAR(250),
db_env VARCHAR(100),
db_user VARCHAR(250) NOT NULL,
action_date TIMESTAMP NO... |
<filename>sql/derived_tables/instance_subjects.sql
DROP TABLE IF EXISTS folio_reporting.instance_subjects;
-- Create a local table for subjects in the instance record.
CREATE TABLE folio_reporting.instance_subjects AS
SELECT
instances.id AS instance_id,
instances.hrid AS instance_hrid,
json_array_elements_... |
<filename>chapter_006/src/main/scripts/car_store.sql<gh_stars>1-10
-- Создаем базу данных для хранилища машин.
create database car_store;
-- Создаем таблицу для хранения типов кузовов.
create table body
(
id serial primary key,
name character varying(20)
);
-- Создаем таблицу для хранения типов двигателей.
... |
-- CREATE TYPES
CREATE TYPE sidekick.jwt_token AS
(
role text COLLATE pg_catalog."default",
user_uuid UUID,
exp bigint
);
-- ddl-end --
ALTER TYPE sidekick.jwt_token OWNER TO sidekick_admin; |
CREATE STREAM R(A int, B int)
FROM FILE 'examples/data/simple/r.dat' LINE DELIMITED
CSV ();
SELECT * FROM R r2 WHERE r2.B < ALL (SELECT r1.A FROM R r1);
|
<reponame>opengauss-mirror/Yat
-- @testpoint: 类型转换函数to_number,参数为日期
select to_number('12,454.8-', to_date('2020-02-01')); |
<reponame>yebukong/jts_download
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for jts_file
-- ----------------------------
DROP TABLE IF EXISTS `jts_file`;
CREATE TABLE `jts_file` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增id',
`jts_id` varcha... |
<reponame>Misteryagci/vigilant-system
-- creation de la relation Annuaire
drop table Hommes;
create table Hommes(nom varchar(30),
prenom varchar(30),
age number(3),
--adresse varchar(30),
cp number(5),
tel varchar(10)
);
-- definition de la procedure
-- pour ajouter n tuples dans l'annuaire
create or replace... |
<gh_stars>0
SELECT
DISTINCT ON (o.measure_ts, measurement, l.elevation)
o.measure_ts AT TIME ZONE 'UTC' as measure_ts,
cbibs.depth_naming(v.actual_name, l.elevation) as measurement,
v.report_name,
o.obs_value,
u.canonical_units,
qc.qa_code as primary_qc
FROM cbibs.f_observation o
JOIN cbibs.... |
INSERT INTO CITY VALUES (1,'Kabul','AFG','Kabol',1780000);
INSERT INTO CITY VALUES (2,'Qandahar','AFG','Qandahar',237500);
INSERT INTO CITY VALUES (3,'Herat','AFG','Herat',186800);
INSERT INTO CITY VALUES (4,'Mazar-e-Sharif','AFG','Balkh',127800);
INSERT INTO CITY VALUES (5,'Amsterdam','NLD','Noord-Holland',731200);
IN... |
-- example (old) notifications that will show up in dashboard
INSERT INTO notification VALUES(NULL,NULL,2,'envelope','daily status report sent');
INSERT INTO notification VALUES(NULL,NULL,2,'user','greenfrog: reset all hosts in E27');
INSERT INTO notification VALUES(NULL,NULL,2,'comment','greenfrog commented on E27');... |
<filename>target/spring-mvc-embedded-db-1.0-SNAPSHOT/WEB-INF/classes/db/sql/insert-data.sql
INSERT INTO notes VALUES (1, 'Pickup the milk.');
INSERT INTO notes VALUES (2, 'Get dry cleaning.'); |
/* MYSQL accounts used by our website.
*The first one used by the store's owner to work on products table and clients table.
*The second one used by clients to see products, his/her commands,
see each product in one of his/her command, check if he/she is a client,
*/
CREATE USER 'store_admin'@'%' IDENTIFIED ... |
DROP TABLE IF EXISTS books;
CREATE TABLE books(
id SERIAL PRIMARY KEY,
img_url VARCHAR(255),
title VARCHAR(255),
authors VARCHAR(255),
book_description TEXT,
isbn VARCHAR(255)
); |
<filename>rms-base/src/main/resources/META-INF/rms/common/dao/TReportApproveFlowDao/deleteListByApplyUserIdAndTargetYm.sql
delete from t_report_approve_flow
where apply_user_id = /* applyUserId */'a'
and target_ym = /* targetYm */1
|
<reponame>navikt/fo-veilarbjobbsokerkompetanse
ALTER TABLE RAAD DROP COLUMN raad;
ALTER TABLE RAAD ADD raad_tittel NVARCHAR2(255);
ALTER TABLE RAAD ADD raad_ingress NVARCHAR2(255);
CREATE SEQUENCE AKTIVITET_SEQ START WITH 1;
CREATE TABLE AKTIVITET (
aktivitet_id NUMBER(19) NOT NULL,
raad_id NUMBER(19) NOT ... |
-- Table: public.emails
ALTER DATABASE serialized_lob;
DROP TABLE IF EXISTS public.emails;
DROP SEQUENCE IF EXISTS emails_id_seq;
CREATE SEQUENCE emails_id_seq;
CREATE TABLE public.emails
(
email_id integer NOT NULL DEFAULT nextval('emails_id_seq'),
email character varying(100) NOT NULL,
CONSTRAINT ema... |
<filename>nginx/php-fpm/7.3/database.sql
-- MySQL script that creates two databases for production and testing purposes.
-- The script also creates two users that are used to make the connection to
-- each database.
--
-- Copyright (c) 2018 <NAME> <<EMAIL>> https://justinhartman.blog
-- Repo: https://github.com/justinh... |
<reponame>NexuS-Pt/BO3-Bozon<filename>install/add-demo-user.sql<gh_stars>1-10
INSERT INTO `os_9_users` (`username`, `password`, `rank`, `email`, `user_key`, `status`, `custom_css`) VALUES ('Demo', '9ccc4065e071a93e89b4327bb48b2aefe4f51a3e', 'owner', '<EMAIL>', '<PASSWORD>', 1, '');
|
<reponame>VanessaSwerts/goMusic-api
INSERT INTO USERS(name, email, password, avatar, country) VALUES('User Default', '<EMAIL>', '$2a$10$oEfUNPSGE6XTFG3YQ3/C3uQX6YQlRtBFLSifQjNH4l0ZqltWGhMqW', 'goMusic/goMusic-dev/user/default-avatar.png', 'Brasil');
INSERT INTO USERS(name, email, password, avatar, country) VALUES('<NAM... |
<gh_stars>10-100
-- Write your migrate up statements here
CREATE TABLE "mahi_applications"
(
"id" uuid DEFAULT uuid_generate_v4(),
"name" varchar(255) unique NOT NULL,
"description" text,
"storage_engine" varchar(255) NOT NULL,
... |
update users set pubkey='<KEY>', mnemonic='<KEY>
', address='XQqpZcNMwXrSA9xFbDDgC9Fw9d7mxjPmKY' where username='anon';
update users set pubkey='<KEY>', mnemonic='<KEY>', address='XNZ6ZA4YWSvM2fnAweHa6FYmn3DUx8Te6N
' where username='alice';
update users set pubkey='<KEY>', mnemonic='U2FsdGVkX18hetjUk0rfHO35gmsowUx+e4xu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.