sql stringlengths 6 1.05M |
|---|
ALTER TABLE "board"."thread"
ADD COLUMN LastPostedAt TIMESTAMP DEFAULT now();
|
<gh_stars>100-1000
select
"FL_DATE" as flight_date,
"OP_UNIQUE_CARRIER" as carrier_id,
"ORIGIN_AIRPORT_ID" as origin_airport_id,
"ORIGIN_AIRPORT_SEQ_ID" as origin_airport_seq_id,
"ORIGIN_CITY_MARKET_ID" as origin_city_market_id,
"ORIGIN_CITY_NAME" as origin_city_name,
"DEST_AIRPORT_ID" as d... |
<filename>models/sources/stg_harvest_projects/stitch/stg_harvest_projects_tasks.sql<gh_stars>100-1000
{% if target.type == 'bigquery' or target.type == 'snowflake' or target.type == 'redshift' %}
{% if var("projects_warehouse_timesheet_sources") %}
{% if 'harvest_projects' in var("projects_warehouse_timesheet_sources")... |
<filename>src/postgres/src/test/regress/sql/reloptions.sql
-- Simple create
CREATE TABLE reloptions_test(i INT) WITH (FiLLFaCToR=30,
autovacuum_enabled = false, autovacuum_analyze_scale_factor = 0.2);
SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass;
-- Fail min/max values check
CREATE TABLE r... |
create table t(a char(1200), b varchar(1200));
create index idx on t(greatest(a(1),b(1)));
create index idx on t (a(1), greatest(a(1), b(1)));
drop table t; |
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字partition(非保留),作为字段数据类型(合理报错)
--前置条件
drop table if exists partition_test cascade;
--关键字不带引号-合理报错
create table partition_test(id int,name partition);
--关键字带双引号-合理报错
create table partition_test(id int,name "partition");
--关键字带单引号-合理报错
create table partition_te... |
<reponame>ronething/leetcode-golang
-- # Write your MySQL query statement below
-- # 思路
-- # 确保某条记录大于 1jk0
-- # 1) 遍历每一天
-- # 2) 是否高峰日
-- # 3) (当天 > 100 and ((前一天 >=100 and 后一天 >= 100) or (前两天 >=100) or (后两天 >= 100)))
select tmp.id, s.visit_date, s.people from
(select id,
-- # 前两天
if (
(select people from stadium... |
<filename>data/www/dolphin-master/htdocs/modules/boonex/store/install/sql/uninstall.sql
-- tables
DROP TABLE IF EXISTS `[db_prefix]products`;
DROP TABLE IF EXISTS `[db_prefix]customers`;
DROP TABLE IF EXISTS `[db_prefix]product_images`;
DROP TABLE IF EXISTS `[db_prefix]product_videos`;
DROP TABLE IF EXISTS `[db_prefix... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 05-07-2021 a las 08:45:44
-- Versión del servidor: 10.4.19-MariaDB
-- Versión de PHP: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
#3 - UPDATE
SELECT m.sent_on, c.start_date
FROM chats AS c
INNER JOIN messages AS m
ON m.chat_id=c.id
WHERE m.sent_on < c.start_date
ORDER BY c.start_date; |
<reponame>rikoraynolhasan/web-pengadilan
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 02 Mar 2021 pada 16.14
-- Versi server: 10.1.35-MariaDB
-- Versi PHP: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_z... |
PROMPT Creating view LOGGER_LOG_5_MIN ...
@@logger_log_5_min.sql
|
<reponame>phunc20/leetcode
--SELECT Email, COUNT(Email) FROM Person GROUP BY Email HAVING COUNT(Email) > 1;
-- | MariaDB [gfg]> SELECT Email, COUNT(Email) FROM Person GROUP
-- | BY Email HAVING COUNT(Email) > 1;
-- | +------------------+--------------+
-- | | Email | COUNT(Email) |
-- | +------------------+... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 14, 2018 at 12:06 AM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40... |
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Daily collection report VLT') ,(select id FROM eg_feature WHERE name = 'Property Tax Reports'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Daily collection report VLT r... |
-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
--
-- Host: localhost Database: online_shop
-- ------------------------------------------------------
-- Server version 5.7.20-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTE... |
/*
Adding foreign key constraints (dropping existing if they exist)
*/
ALTER TABLE Sales.Invoices
DROP CONSTRAINT IF EXISTS FK_Cust_Inv
ALTER TABLE Sales.Orders
DROP CONSTRAINT IF EXISTS FK_Cust_Orders
GO
ALTER TABLE Sales.Invoices
ADD CONSTRAINT FK_Cust_Inv FOREIGN KEY (CustomerID)
REFERENCES Sales.Customers (Cu... |
CREATE TABLE day24 (rownum serial, input text);
\COPY day24 (input) FROM 'input.txt'
WITH RECURSIVE
input AS (
SELECT rownum,
match[1]::integer AS a,
match[2]::integer AS b
FROM day24,
regexp_match(input, '^(\d+)/(\d+)$') AS match
),
bridges AS (
SELECT 0 AS step,
... |
-- file:path.sql ln:9 expect:true
INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)]')
|
<filename>migrations/framework/20200614_Development/07_Dev.RecordDel.sql<gh_stars>1-10
--liquibase formatted sql
--changeset vrafael:framework_20200614_Development_07_DevRecordDel logicalFilePath:path-independent splitStatements:true endDelimiter:\nGO runOnChange:true
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
----... |
ALTER TABLE character_db_version CHANGE COLUMN required_9974_01_characters_group required_10007_01_characters_pet_aura bit;
UPDATE `pet_aura` SET remaincharges = 0 WHERE remaincharges = 255; |
<gh_stars>0
SELECT COUNT(1) FROM propuesta WHERE id <> :id AND licitacion_id = :licitacionId AND nombre = :nombre |
-- limit offset
select count(*) from j1 where c_float not in ( select max(c_integer) from j6 group by c_date having count(*) > 0 limit 3);
|
<gh_stars>0
SELECT SUBJ.SUBJ_NAME
|| ','
|| TARG.TARGET_NAME
|| ','
|| FLD.FLDNO
|| ','
|| FLD.TARGET_NAME
|| ','
|| DTYPE.DATATYPE_NAME
|| ','
|| FLD.DPREC
|| ','
|| FLD.DSCALE
|| ','
|| FLD.NULLTYPE
|| ','
|| FLD.KEYTYPE RES
FROM $metaOwner.OPB_TARG TARG,
$metaOwner.OPB_TARG_FLD FLD,... |
drop procedure if exists complete_user;
delimiter $$
create procedure complete_user(i_user_name varchar(32))
main_sql:
begin
update users set completed='Y' where user_name=i_user_name;
end
$$
delimiter ;
|
-- populate_user_identity_source.sql
delete from system_user;
delete from user_identity_source;
insert into user_identity_source(name, record_effective_date, description, create_date, create_user) values ('DATABASE', now(), 'DATABASE user source system.', now(), 1);
insert into user_identity_source(name, record_effect... |
<filename>server/src/main/resources/db/bootstrap/V14__requirements.sql
DROP TABLE IF EXISTS `requirements`;
CREATE TABLE `requirements`
(
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`workspace_version_id` BIGINT(20) DEFAULT NULL,
`description` TEXT DEFAULT NULL,
`name... |
CREATE OR REPLACE FUNCTION test_effective_roles_at_enterprise_function()
RETURNS SETOF TEXT
LANGUAGE plpgsql
AS $$
DECLARE
BEGIN
RETURN QUERY SELECT set_eq(
format('SELECT effective_roles_at_enterprise(%L, %L)', 'BigCo', 'BigCo User'),
ARRAY[]::delivery_role[],
'BigCo User has no roles at the enterprise ... |
<filename>dm/tests/gtid/data/db1.increment.sql
use gtid;
insert into t1 values (2);
|
<reponame>byeungchun/ETL-CMS
/*********************************************************************************
# Copyright 2016 Observational Health Data Sciences and Informatics
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... |
<gh_stars>100-1000
--bx_history_volume
load data local inpath '/home/xxx/stock-data/bx_history_volume/20200701-20200706' overwrite into table stock.bx_day_volume_top10 partition(yearmonth=${yearmonth});
--history_dragon_tiger_list
load data local inpath '/home/xxx/stock-data/history_dragon_tiger_list/20200701-20200710'... |
<filename>html/Lords_of_Games/administrator/components/com_joomlapack/uninstall.sql
DROP TABLE IF EXISTS `#__jp_profiles`;
DROP TABLE IF EXISTS `#__jp_exclusion`;
DROP TABLE IF EXISTS `#__jp_inclusion`;
DROP TABLE IF EXISTS `#__jp_registry`;
DROP TABLE IF EXISTS `#__jp_temp`;
DROP TABLE IF EXISTS `#__jp_stats`;
|
--+ holdcas on;
set names utf8;
CREATE TABLE t(
col1 INT NOT NULL AUTO_INCREMENT,
col2 CHAR collate utf8_ja_exp DEFAULT NULL
);
INSERT INTO t(col2) VALUES('ぁ');
INSERT INTO t(col2) VALUES('ぃ');
INSERT INTO t(col2) VALUES('ぇ');
INSERT INTO t(col2) VALUES('ぉ');
INSERT INTO t(col2) VALUES('ゃ');
INSERT INTO t(col2) VALU... |
<reponame>opengauss-mirror/Yat
-- @testpoint: 网络地址函数text(inet)把IP地址和掩码长度抽取为文本。
-- v4
-- 带掩码
SELECT text(inet '192.168.1.5/0') AS RESULT;
SELECT text('192.168.1.5/7') AS RESULT;
SELECT text('192.168.1.5/24') AS RESULT;
SELECT text('192.168.1.5/25') AS RESULT;
SELECT char_length(text('192.168.1.5/32'));
SELECT text('19... |
<gh_stars>0
-- file: db_s_etl/grant_privileges.sql
-- <NAME>
-- 2017-04-06
GRANT SELECT, UPDATE, INSERT, DELETE ON sl_nap, sl_night TO sp_etl;
GRANT USAGE ON sl_night_night_id_seq TO sp_etl;
GRANT USAGE ON sl_nap_nap_id_seq TO sp_etl;
|
ALTER TABLE `crm_finance_delivery` ADD `customer_balance` VARCHAR( 100 ) NOT NULL COMMENT 'for dashboard purpose' AFTER `cancel_id` ;
ALTER TABLE `crm_finance_delivery` ADD `showroom_balance` VARCHAR( 100 ) NOT NULL COMMENT 'for dashboard purpose' AFTER `customer_balance` ; |
SELECT
sturz,
hangmure,
gerinne,
lawine,
andere_kt,
geometrie
FROM
awjf_silvaprotect_v1.silvaprotect_andere_kt
;
|
-- drop table if exists user;
create table if not exists user(
user_id integer primary key autoincrement,
username string not null,
score string not null
); |
<gh_stars>0
--
-- summary of commmittee contributions to candidates, by committee (source)
--
select cc.cmte_id as src_cmte_id,
cc.name as src_name,
cc.entity_tp as src_entity_tp,
cm.cmte_nm,
cm.cmte_pty_affiliation,
sum(cc.transaction_amt) as total_amt,
count(cc.transaction_am... |
CREATE TABLE patient_experience_2 (
experience_id serial PRIMARY KEY,
patient_id int NOT NULL REFERENCES patient_2(patient_id),
experience_treatment varchar(255) NULL,
experience_office varchar(255) NULL
);
|
CREATE VIEW [rapOp].[SRVCView2] AS
--Lista usług oferowanych przez serwis wraz z łączną ilością zrealizowanych zamówień na daną usługę w bieżącym roku oraz sumaryczną wartością zarobionych na wykonaniu danej usługi pieniędzy
SELECT
st.[Name] AS ServiceType,
COUNT(od.OrderID) AS OrdersQty,
SUM(st.Price) AS MoneySum
F... |
select id, password, MD5(password)
from account
|
<filename>backups/homesteadbackup.sql
-- MySQL dump 10.13 Distrib 5.7.11, for Linux (x86_64)
--
-- Host: localhost Database: homestead
-- ------------------------------------------------------
-- Server version 5.7.11
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET... |
CREATE FUNCTION ufn_IsWordComprised(@setOfLetters NVARCHAR(20), @word NVARCHAR(20))
RETURNS BIT
AS
BEGIN
DECLARE @CountOfLetters INT = LEN(@word);
DECLARE @Index INT = 1;
WHILE @Index <= @CountOfLetters
BEGIN
IF(CHARINDEX(SUBSTRING(@word, @Index, 1), @setOfLetters) = 0)
BEGIN
RETURN 0
END
SET @I... |
ALTER TABLE vetd.round_product
ADD COLUMN result integer,
ADD COLUMN reason text |
<gh_stars>100-1000
-- randexpr1.test
--
-- db eval {SELECT coalesce((select (a) from t1 where 11-11+t1.b<=17-b),case when case when not t1.e*f>= -t1.f and a in (11,t1.c,t1.b) or 19>e then (select case min((f)-f) when cast(avg(t1.a) AS integer) then (cast(avg(17) AS integer)) else ((cast(avg((13)) AS integer))) end fro... |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ma... |
<filename>sql/mysql/schema/system_rights.sql
CREATE TABLE `system_rights` (
`ID` INT(10) NOT NULL AUTO_INCREMENT,
`name` CHAR(50) NOT NULL,
`description` CHAR(255) NOT NULL,
PRIMARY KEY (`ID`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
AUTO_INCREMENT=16; |
-- ============================================================================
-- Copyright (C) 2013 <NAME> <<EMAIL>>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of t... |
DROP TABLE IF EXISTS sushi;
CREATE TABLE sushi (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30),
time_to_make INT DEFAULT NULL
);
DROP TABLE IF EXISTS sushi_order;
CREATE TABLE sushi_order (
id INT AUTO_INCREMENT PRIMARY KEY,
status_id INT NOT NULL,
sushi_id INT NOT NULL,
created_at TIMESTAMP NOT NULL default C... |
alter table USER_BASE change reference ref varchar(64);
alter table USER_BASE add email varchar(100);
alter table USER_BASE add mobile varchar(50);
|
<reponame>bheckel/code
-- Modified: 14-Feb-2020 (<NAME>)
-- Execution plan. Query plan. SQL Tuning.
-- See also indexes.sql, devgym_create_toy_objects.sql
-- The B-tree traversal is the first power of indexing.
-- Clustering is the second power of indexing.
---
-- Oracle indexing
-- See also https://blog... |
ALTER TABLE `services` ADD COLUMN `id_vessel` INT;
ALTER TABLE `services` ADD FOREIGN KEY (`id_vessel`) REFERENCES vessels(`id`) ON DELETE SET NULL;
|
<filename>src/console/db/queries/actors/insert.sql
INSERT INTO
storage.actors (
lookup_fields,
email_id,
ip_address_id,
person_id,
phone_number_id,
database_id
)
VALUES
(
${lookupFields},
${emailId},
${ipAddressId},
${personId},
${phoneNumberId},
${databaseId}
)
R... |
<reponame>navyuginfo/phabricator
/* Patch 060 neglected to make this an AUTO_INCREMENT PRIMARY KEY */
ALTER TABLE {$NAMESPACE}_phriction.phriction_document
CHANGE id id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;
/* Needs to be initially nullable for insert when documents are created. */
ALTER TABLE {$NAMESPAC... |
<filename>posda/posdatools/queries/sql/InboxContentAllByUserToDismiss.sql
-- Name: InboxContentAllByUserToDismiss
-- Schema: posda_queries
-- Columns: ['user_name', 'id', 'operation_name', 'current_status', 'activity_id', 'brief_description', 'when', 'file_id', 'command_line', 'spreadsheet_file_id']
-- Args: ['user_nam... |
<reponame>bseries/cms_team<filename>data/upgrade/V1529659315__add_vacant_positions.sql<gh_stars>0
CREATE TABLE `vacant_team_positions` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`owner_id` int(11) unsigned NOT NULL,
`order` int(11) unsigned DEFAULT NULL,
`title` varchar(250) DEFAULT NULL,
`department` v... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 10, 2021 at 08:06 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.4.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
INSERT INTO users (id, name, cpf, gender, email, date_of_birth, nacionality, naturality)
VALUES
('5950fd4e-8613-4e56-97bc-7f1e331266eb', '<NAME>', '123.456.789-89', 'Male', '<EMAIL>',
parsedatetime('29-02-2000 00:00:00.000', 'dd-MM-yyyy hh:mm:ss.SS'), 'Brazil', 'SC');
INSERT INTO users (id, name, cpf, gender, ... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 30, 2021 at 06:11 AM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.3.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
<filename>SQL/Exams practice/Databases MSSQL Server Exam - 17 Feb 2019/Exclude From School.sql
CREATE PROCEDURE usp_ExcludeFromSchool(@StudentId INT)
AS
BEGIN
DECLARE @targetId INT = (SELECT Id FROM Students WHERE Id = @StudentId)
IF(@targetId IS NULL)
BEGIN
RAISERROR('This school has no student with the provided... |
<reponame>robsmitha/VanValinMagic
use cory2v;
DELIMITER //
CREATE PROCEDURE `cory2v`.`usp_image_LoadFeaturedImages`
()
BEGIN
SELECT
`image`.`Id` AS `Id`,
`image`.`Name` AS `Name`,
`image`.`Description` AS `Description`,
`image`.`ImgUrl` AS `ImgUrl`,
`image`.`EventId` AS `EventId`,
`image`.`Views` AS `View... |
-- phpMyAdmin SQL Dump
-- version 4.5.0.2
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 30-11-2015 a las 04:50:31
-- Versión del servidor: 10.0.17-MariaDB
-- Versión de PHP: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<gh_stars>0
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = :'dbname' AND pid <> pg_backend_pid();
DROP DATABASE IF EXISTS :dbname;
CREATE DATABASE :dbname
WITH TEMPLATE = template0
ENCODING = 'UTF8';
ALTER DATABASE :dbname OWNER TO :username;
GRANT ... |
<gh_stars>0
--
-- Teds Init Script
--
-- Sensor Table
CREATE TABLE Sensor_Tbl
( Sensor_ID NUMBER(10) NOT NULL
, Bridge_ID NUMBER(8) -- Which bridge sensor resides
, Teds_ID NUMBER(10) -- Sensor TEDS
, Location_Number NUMBER(4) -- Location number based on b... |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 22, 2017 at 12:20 AM
-- Server version: 5.5.54-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
<filename>schema.sql<gh_stars>0
drop table if exists usajobs;
create table if not exists usajobs(
id serial primary key,
title varchar(255),
company varchar(255),
location varchar(255),
url text,
description text
) |
UPDATE court
SET phone='314.615.7400', address='715 Northwest Plaza Drive', city='St. Ann', zip_code='63074', latitude='38.733026', longitude='-90.4023659'
WHERE court_id='51'; |
ALTER TABLE `cms_category`
ADD INDEX `uri` (`uri`),
DROP INDEX `uri`; |
<reponame>roaddee/dulkemot
INSERT INTO tweb_apbd(`rangkuman`,`berkas_id`,`lembaga_id`, `lembaga_kode`,`pemda_kode`, `wilayah_kode`,`tahun`, `rekening_kode`,`rekening`, `uraian`, `nominal`,`nominal_sebelum`, `nominal_sesudah`, `nominal_perubahan`, `nominal_persen`, `keterangan`, `created_by`, `updated_by`) VALUES
('0',... |
<gh_stars>10-100
create table ADDRESS_TRANSACTIONS
(
ADDRESS VARCHAR(255) not null
primary key,
LAST_CHECKED_AT_BLOCKHEIGHT INTEGER not null
);
create table ADDRESS_OWNERSHIP
(
ADDRESS VARCHAR(255) not null
primary key,
OWNERSHIP_STATUS VARCHAR(255)
);
... |
<filename>database/mysql/Change-Sets/changelogs-2020-04-28-db-002.user_info.mysql.sql
CREATE TABLE user_info (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(128),
sur_name VARCHAR(128),
age INT,
sex CHAR(1),
city VARCHAR(128),
FOREIGN KEY (id) REFERENCES user_profi... |
<filename>skating_elt/ddl/table/f_perf.sql
CREATE OR REPLACE TABLE `your-project.skating.f_perf` (
perf_id INT64 NOT NULL,
event_id INT64 NOT NULL,
event_perf_seq_nbr INT64 NOT NULL,
skater1_id INT64 NOT NULL,
skater2_id INT64,
event_perf_rank_nbr INT64,
comp... |
SELECT Name FROM Employee
ORDER BY Name;
|
ALTER PROCEDURE [dbo].[sp_SaveUpdatePharmacyPrescription_GreenCard]
@ptn_pharmacy_pk int = null,
@DrugId int = null,
@BatchId varchar(50) = null,
@Dose varchar(50) = null,
@FreqId int = null,
@Morning decimal(18,2)=0,
@Midday decimal(18,2)=0,... |
CREATE TABLE balance (
b_id VARCHAR(36),
b_version BIGINT,
b_time DATETIME,
b_account VARCHAR(36),
balance BIGINT
); |
BEGIN;
DROP FUNCTION gp_allocate_palloc_test_all_segs(content int, size int, sleep int, crit_section bool);
DROP FUNCTION gp_allocate_palloc_test_f(content int, size int, sleep int, crit_section bool);
DROP FUNCTION gp_allocate_top_memory_ctxt_test_all_segs(content int, size int, sleep int);
DROP FUNCTION gp_allocat... |
<reponame>lintzc/GPDB
-- @author prabhd
-- @created 2014-04-01 12:00:00
-- @modified 2012-04-01 12:00:00
-- @tags dml MPP-21090 ORCA
-- @optimizer_mode on
-- @description Tests for MPP-21090
\echo --start_ignore
set gp_enable_column_oriented_table=on;
\echo --end_ignore
DROP TABLE IF EXISTS mpp21090_drop_midcol_dml_t... |
--! Previous: sha1:1d54640835d8e602bbcb1cfacd38672adc258cc9
--! Hash: sha1:62b5e2158ca83a406b93f328d06dcf35e938cdb4
-- Enter migration here
DROP POLICY IF EXISTS survey_responses_insert ON public.survey_responses;
revoke insert on survey_responses from anon;
revoke insert on survey_responses from seasketch_user;
-- gr... |
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字existing(非保留),作为模式名
--关键字不带引号-成功
drop schema if exists existing;
create schema existing;
drop schema existing;
--关键字带双引号-成功
drop schema if exists "existing";
create schema "existing";
drop schema "existing";
--关键字带单引号-合理报错
drop schema if exists 'existing';
c... |
CREATE OR REPLACE FUNCTION public.match_id(vid character varying)
RETURNS TABLE(video_id character varying, uploader character varying, uploader_id character varying, title character varying, description character varying, upload_date integer, filepath character varying, playlists character varying[])
LANGUAGE sql
AS... |
-- Banco de Dados: `revenda`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `automovel`
--
CREATE TABLE IF NOT EXISTS `automovel` (
`codautomovel` int(5) NOT NULL AUTO_INCREMENT,
`descricao` varchar(100) NOT NULL,
`codmodelo` int(5) NOT NULL,
`codcategoria` int(5) NO... |
<reponame>NeoYY/Leetcode-Solution<filename>183. Customers Who Never Order.sql
/*
SQL Schema
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything.
Table: Customers.
+----+-------+
| Id | Name |
+----+-------+
| 1 | Joe ... |
CREATE TABLE member(
id VARCHAR(36) NOT NULL PRIMARY KEY,
name VARCHAR(80) NOT NULL
);
|
<gh_stars>0
use hannah;
drop table if exists Event;
drop table if exists Person;
create table Person(
ID int auto_increment primary key,
Name varchar(30),
Password varchar(30)
);
-- create table Event(
-- ID int auto_increment primary key,
-- PersonID int ,
-- Value varchar(255),
-- foreign key (... |
<gh_stars>0
-- ----------------------------
-- 用途
-- 用户权限管理
--
-- 实现逻辑
-- ----------------------------
-- ----------------------------
-- Table structure for `{{%permission_path}}`
-- ----------------------------
CREATE TABLE `{{%permission_api}}` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID'... |
<filename>server_inventory_system(2).sql
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 12, 2020 at 05:09 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... |
<filename>src/main/resources/db/migration/V1__create_schema.sql<gh_stars>0
create table Store (
id int8 not null,
version int4,
name varchar(255) not null,
email varchar(255) not null unique,
status varchar(30) not null,
primary key (id)
);
create sequence hibernate_sequence;
|
<reponame>valerc123/EPS_VAL
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 06-06-2019 a las 01:10:53
-- Versión del servidor: 10.1.32-MariaDB
-- Versión de PHP: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTI... |
<reponame>divakarpatil51/spring-security
create sequence if not exists role_id_generator start 1 increment 1
create sequence if not exists user_id_generator start 1 increment 1
create table if not exists roles (id int4 not null, role varchar(255), primary key (id))
create table if not exists users (id int4 not null, a... |
-- MySQL dump 10.13 Distrib 8.0.19, for Linux (x86_64)
--
-- Host: localhost Database: blog
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!401... |
<reponame>nvanbaak/project2placeholder
DROP DATABASE IF EXISTS pocketbutler_db;
CREATE DATABASE pocketbutler_db; |
-- file:triggers.sql ln:75 expect:true
insert into fkeys2 values (30, '3', 2)
|
<filename>internal/endtoend/testdata/func_aggregate/query.sql
-- Example queries for sqlc
CREATE TABLE authors (
id BIGSERIAL PRIMARY KEY,
name text NOT NULL,
bio text
);
-- name: Percentile :one
select percentile_disc(0.5) within group (order by authors.name)
from authors;
|
CREATE TABLE featureshop (
id CHAVE NOT NULL,
id_feature CHAVE NOT NULL,
id_shop CHAVE NOT NULL,
CONSTRAINT pk_featureshop PRIMARY KEY (id)
); |
CREATE TABLE IF NOT EXISTS `account_links` (
`id` varchar(200) NOT NULL,
`uid` varchar(200) NOT NULL,
`provider` char(60) DEFAULT NULL,
`profile` text NOT NULL,
`linked` datetime NOT NULL,
PRIMARY KEY (`id`,`uid`),
KEY `uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXIS... |
-- reclaim diskspace after dropping column 'contents' by performing a 'full vacuum'
--
-- See https://www.postgresql.org/docs/9.1/sql-vacuum.html on how 'aggressive'
-- VACUUM FULL is vs. a regular VACUUM
VACUUM FULL;
|
{{ config(
materialized ='materializedview'
) }}
with fct_bus as (
SELECT *
FROM {{ ref('stg_bus_information') }} fi
)
select id, modified from fct_bus order by id, modified |
<reponame>fivetran-saraseylani/dbt-training
{{ config(enabled=var('fivetran_log_using_triggers', True)) }}
with trigger_table as (
select * from {{ var('trigger_table') }}
),
fields as (
select
{% if target.type == 'bigquery' %}
table as trigger_table,
{% elif target.type == 'pos... |
use questionsdatabase;
drop function if exists GetWordPoint;
create function GetWordPoint(original varchar(1), symbol varchar(1))
returns decimal(4, 2) DETERMINISTIC
return if(original = 'Y' and symbol = 'Y', 1,
if(original = 'Y' and symbol = 'N', 0,
if(original = 'Y' and symbol = 'U', 0,
if(original = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.