text stringlengths 1 1.05M |
|---|
CREATE UNIQUE INDEX address_default_geocode_pid_idx ON address_default_geocode USING btree (address_detail_pid);
CREATE UNIQUE INDEX address_mesh_block_2011_pid_idx ON address_mesh_block_2011 USING btree (address_detail_pid);
CREATE UNIQUE INDEX address_mesh_block_2016_pid_idx ON address_mesh_block_2016 USING btree (ad... |
SET search_path TO casework;
ALTER TABLE correspondent
ADD COLUMN organisation TEXT;
CREATE OR REPLACE VIEW active_correspondent AS
SELECT c.*
FROM correspondent c
JOIN active_case ac ON c.case_uuid = ac.uuid
WHERE NOT c.deleted;
CREATE OR REPLACE VIEW primary_correspondent AS
SELECT c.*
FROM ... |
CREATE TABLE `empresa` (
`id` bigint(20) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`cnpj` varchar(255) NOT NULL,
`data_atualizacao` datetime NOT NULL,
`data_criacao` datetime NOT NULL,
`razao_social` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `funcionario` (
`id` bigint(20) NOT NUL... |
CREATE TABLE `category` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `note` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`category_id` int unsigned DEFAULT NULL,
`date` datetime DEFAULT NULL,
... |
DROP TABLE IF EXISTS current_failed_query_metrics;
DROP TABLE IF EXISTS to_insert;
CREATE TABLE current_failed_query_metrics (event LowCardinality(String), value UInt64) ENGINE = Memory();
INSERT INTO current_failed_query_metrics
SELECT event, value
FROM system.events
WHERE event in ('FailedQuery', 'FailedInsertQue... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 23, 2020 at 04:44 PM
-- Server version: 5.7.26
-- PHP Version: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `weekloggr`
--
-- ------------------------... |
typedef void (*set_rel_pathlist_hook_type) (PlannerInfo *root,
RelOptInfo *rel,
Index rti,
RangeTblEntry *rte);
extern PGDLLIMPORT set_rel_pathlist_hook_type set_rel_pathlist_hook;
|
-- Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255));
> ok
insert into test values(1, 'Hello');
> update count: 1
select locate(null, null) ... |
{{ include "./schema" "./get_example_name" }} |
INSERT INTO burgers (burger_name, devoured) VALUES ('Black Bean Burger', true);
INSERT INTO burgers (burger_name, devoured) VALUES ('Impossible Burger', true);
INSERT INTO burgers (burger_name, devoured) VALUES ('Bacon Cheese Burger', false);
|
USE [ANTERO]
GO
/****** Object: View [dw].[v_virta_otp_kvliikkuvuus] Script Date: 23.4.2020 11:23:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dw].[v_virta_otp_kvliikkuvuus] AS
SELECT
f.tilastovuosi
,f.opintojen_aloitusvuosi AS 'Opintojen aloitusvuosi'
,d4.sukupuoli_fi A... |
CREATE TABLE clients (
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
connection uuid NOT NULL UNIQUE,
connected boolean NOT NULL DEFAULT True,
created timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
target b... |
-- Revert ggircs:schema_ciip from pg
begin;
drop schema ciip_2018;
commit;
|
create table T(A integer);
create temp view positive_T as select * from T where 0<A;
select count(*) from main.sqlite_master where type='view';
select count(*) from temp.sqlite_master where type='view';
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 30, 2021 at 07:05 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
create table T_CLUBES
(
id_club VARCHAR2(5) not null,
id_persona NUMBER(10),
nombre_oficial VARCHAR2(100),
otros_nombres VARCHAR2(100),
fundacion DATE,
pagina_web VARCHAR2(200),
twitter VARCHAR2(100),
facebook VARCHAR2(100),
id_division VARCHAR2(3),
nombre_corto ... |
--SELECT CAST(EXTRACT(HOUR FROM ((cast('1/1/1970' as DATE) + (CAST(CAST("Romance_1"."created_time" AS BIGINT) AS float8) / NULLIF(86400,0)) * INTERVAL '1' DAY) + -8 * INTERVAL '1' HOUR)) AS BIGINT) AS "hr:Calculation_813462698269921280:ok", SUM(CAST("Romance_1"."Number of Records" AS BIGINT)) AS "sum:Number of Record... |
-- Convert schema 'upgrades/Tapper-Schema-ReportsDB-2.010018-SQLite.sql' to 'upgrades/Tapper-Schema-ReportsDB-2.010020-SQLite.sql':
BEGIN;
CREATE TEMPORARY TABLE report_temp_alter (
id INTEGER PRIMARY KEY NOT NULL,
suite_id INT(11),
suite_version VARCHAR(11),
reportername VARCHAR(100) DEFAULT '',
peeraddr V... |
-- phpMyAdmin SQL Dump
-- version 3.3.7deb7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 10, 2013 at 02:42 PM
-- Server version: 5.1.66
-- PHP Version: 5.3.3-7+squeeze17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET ... |
CREATE INDEX idx_rounds_status ON vetd.rounds (status) |
--点 POINT
--线 LINESTZRING
--面 POLYGON
--第一种
DROP TABLE gistest;
CREATE TABLE gistest (
gid serial NOT NULL,
NAME TEXT,
lng NUMERIC (18, 8),
lat NUMERIC (18, 8),
geom geometry (POINT, 4326)
);
--第二种
DROP TABLE gistest;
CREATE TABLE gistest (
gid serial NOT NULL,
NAME TEXT,
lng NUMERIC (18... |
-- @testpoint: openGauss保留关键字Asc作为触发器名,部分测试点合理报错
--前提条件
--创建源表
drop table if exists test_trigger_src_tbl;
CREATE TABLE test_trigger_src_tbl(id1 INT, id2 INT, id3 INT);
--创建触发表
drop table if exists test_trigger_des_tbl;
CREATE TABLE test_trigger_des_tbl(id1 INT, id2 INT, id3 INT);
--创建触发器函数
CREATE OR REPLACE FUNCTION... |
-- create a vclass and using column naming as '#' starting
create vclass DML_0001 (
#intcol1 integer,
int_col2 integer
) ;
drop vclass DML_0001;
|
ALTER TABLE terraria_world DROP CONSTRAINT terraria_world_file_fkey;
ALTER TABLE terraria_world_file RENAME COLUMN id TO world_id;
ALTER TABLE terraria_world_file
ADD CONSTRAINT terraria_world_file_world_fkey FOREIGN KEY (world_id) REFERENCES terraria_world(id);
|
/*
* Copyright 2019 Google LLC
*
* 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 by applicable law or agreed to i... |
CREATE VIEW results AS
SELECT a.id, a.address, cl.street,
ST_ShortestLine(a.wkb_geometry, cl.wkb_geometry) AS line
FROM addresses a, centerlines cl, (
SELECT ogc_fid AS a_fid, (
SELECT ogc_fid
FROM centerlines _cl
ORDER BY ST_Distance(Geography(_a.wkb_geometry), Geography(_cl.wkb_geometry))
LIMIT 1
... |
-- Database: neptuno
-- Autor: Ing. Jaime Suasnabar Terrel
-- Fecha: 20 de octubre de 2016
-- script de la base de datos neptuno
-- DROP DATABASE Pedidos
CREATE DATABASE Pedidos
go
USE Pedidos
create table productos(
idproducto int primary key,
nombreProducto varchar(40),
idProveedor int null,
idCategoria int ... |
\set ON_ERROR_STOP 1
BEGIN;
CREATE OR REPLACE FUNCTION _median(anyarray) RETURNS anyelement AS $$
WITH q AS (
SELECT val
FROM unnest($1) val
WHERE VAL IS NOT NULL
ORDER BY val
)
SELECT val
FROM q
LIMIT 1
-- Subtracting (n + 1) % 2 creates a left bias
OFFSET greatest(0, floor((sele... |
{{ config(schema="TEST_NORMALIZATION", tags=["top-level"]) }}
-- SQL model to build a Type 2 Slowly Changing Dimension (SCD) table for each record identified by their primary key
select
ID,
CURRENCY,
DATE,
TIMESTAMP_COL,
{{ adapter.quote('HKD@spéçiäl & characters') }},
HKD_SPECIAL___CHARACTERS,
... |
WITH ssr AS
( SELECT
s_store_id,
sum(sales_price) AS sales,
sum(profit) AS profit,
sum(return_amt) AS RETURNS,
sum(net_loss) AS profit_loss
FROM
(SELECT
ss_store_sk AS store_sk,
ss_sold_date_sk AS date_sk,
ss_ext_sales_price AS sales_price,
ss_net_profit AS profit,
... |
create table categories (
categoryID INT PRIMARY KEY NOT NULL,
categoryName VARCHAR(50) NOT NULL,
description TEXT,
picture TEXT
);
create table customers (
customerID VARCHAR(50) PRIMARY KEY NOT NULL,
companyName VARCHAR(50) NOT NULL,
contactName VARCHAR(50),
contactTitle VARCHAR(50),
... |
-- @testpoint:openGauss关键字privilege(非保留),作为列名带引号并且删除时使用该列,建表成功,privilege列值是'hello'的删除成功
drop table if exists privilege_test;
create table privilege_test(
c_id int, c_int int, c_integer integer, c_bool int, c_boolean int, c_bigint integer,
c_real real, c_double real,
c_decimal decimal(38), c_number number(38), c_... |
{{ config(
unique_key = env_var('AIRBYTE_DEFAULT_UNIQUE_KEY', '_airbyte_ab_id'),
schema = "test_normalization",
tags = [ "nested" ]
) }}
-- Final base SQL model
select
_airbyte_nested_strea__nto_long_names_hashid,
double_array_data,
{{ adapter.quote('DATA') }},
{{ adapter.quote('column__\'wi... |
UPDATE paminnelse SET neste_paminnelsetidspunkt='2020-05-04 07:00:00.000000' WHERE tilstand='AVVENTER_SIMULERING';
|
-- Örnek 1
SELECT DISTINCT replacement_cost FROM film;
-- Örnek 2
SELECT COUNT(DISTINCT replacement_cost) FROM film;
-- Örnek 3
SELECT title FROM film
WHERE title ILIKE '%T%T%T%T%';
-- Örnek 4
SELECT COUNT(title) FROM film
WHERE title LIKE 'T%' AND
rating = 'G';
-- Örnek 5
SELECT COUNT(country) FROM country
WHERE ... |
/* Create sentence */
/* dep_ucreacion and dep_fcreacion refers to User and Date of creation respectively */
create table loc_departamentos
(
dep_id serial primary key,
dep_nombre text not null,
dep_ucreacion text not null,
dep_fcreacion timestamp not null,
estado char(3)
);
/* Inserts for departments table */
... |
-- wal3.test
--
-- execsql { INSERT INTO blue VALUES(5, 6) }
INSERT INTO blue VALUES(5, 6) |
-- https://www.hackerrank.com/challenges/earnings-of-employees/problem
-- Top Earners
select earnings, count(*) as employees_count
from (
select months * salary as "earnings",
(select max(months * salary) from employee) as max_earnings
from employee
) as t1
where earnings = max_earnings
group by earnings |
-- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия на сървъра: 10.1.19-MariaDB - mariadb.org binary distribution
-- ОС на сървъра: Win32
-- HeidiSQL Версия: 9.4.0.5125
-- -------------------------------------------... |
USE `essentialmode`;
ALTER TABLE jobs add whitelisted BOOLEAN NOT NULL DEFAULT FALSE; |
-- MySQL dump 10.13 Distrib 8.0.27, for Linux (x86_64)
--
-- Host: localhost Database: downtime_alert
-- ------------------------------------------------------
-- Server version 8.0.27-0ubuntu0.20.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARA... |
-- txid_snapshot data type and related functions
-- Note: these are backward-compatibility functions and types, and have been
-- replaced by new xid8-based variants. See xid.sql. The txid variants will
-- be removed in a future release.
-- i/o
select '12:13:'::txid_snapshot;
select '12:18:14,16'::txid_snapshot;
sele... |
Insert into EG_ACTION (id,name,url,queryparams,parentmodule,ordernumber,displayname,enabled,contextroot,version,createdby,createddate,lastmodifiedby,lastmodifieddate,application) values (nextval('SEQ_EG_ACTION'),'ReceiptReconcileOnlinePayment','/citizen/onlineReceipt-reconcileOnlinePayment.action',null,(select id from ... |
-- CreateTable
CREATE TABLE "LostPasswordToken" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"expiresAt" TIMESTAMP(3) NOT NULL,
"hashedToken" TEXT NOT NULL,
"userId" INTEGER NOT NULL,
CONSTRAINT "LostPasswordToken_pk... |
CREATE TABLE "signup"
(
"id" SERIAL NOT NULL,
"code" text,
"code_salt" text,
CONSTRAINT "PK_signup" PRIMARY KEY ( "id" )
);
INSERT INTO signup(code,code_salt) VALUES('HASH_FROM_SCRIPT','SALT_FROM_SCRIPT'); |
CREATE TABLE scm_night_club(
seq BIGINT AUTO_INCREMENT PRIMARY KEY,
/**
* type: org.kyojo.schemaorg.m3n3.pending.Container$ActionableFeedbackPolicy
* param: org.kyojo.schemaorg.m3n3.core.Clazz$CreativeWork
* org.kyojo.schemaorg.m3n3.core.Clazz$URL
*/
actionable_feedback_policy VARCHAR(100) NULL,
/... |
ABD0310
create or replace
PROCEDURE CREA_SEC_INVERSION(NOMBREE IN VARCHAR2)
IS
NUM INT;
BEGIN
SELECT COUNT(*) INTO NUM FROM USER_OBJECTS WHERE OBJECT_NAME = 'SEC_' || NOMBREE;
IF NUM = 0 THEN
execute immediate 'create sequence SEC_' || NOMBREE || ' start with 1 increment by 1 nomaxvalue NOCACHE NOCYCLE';
EN... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 05 Mar 2021 pada 06.47
-- Versi server: 10.4.6-MariaDB
-- Versi PHP: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
-- CreateTable
CREATE TABLE "Coupon" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"item_id" TEXT NOT NULL,
"code" TEXT NOT NULL,
"expire_date" INTEGER NOT NULL
);
|
create view "postgres"._airbyte_test_normalization."nested_stream_with_c__ion_double_array_data_ab1__dbt_tmp" as (
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
select
_airbyte_partition_hashid,
jsonb_extract_path_text... |
DROP TABLE named_certificate_authority; |
CREATE TABLE `acesso` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`advertising_default_id` int(11) DEFAULT NULL,
`advertising_by_car_id` int(11) DEFAULT NULL,
`marca` varchar(100) NOT NULL,
`modelo` varchar(100) NOT NULL,
`ano` int(4) NOT NULL,
`combustivel` varchar(50) NOT NULL,
`propriedade` varchar(50) N... |
WITH
-- DASHBOARD: https://dune.xyz/anthonybowman/Index:-Net-Inflows-Monitoring
-- QUERY: https://dune.xyz/queries/143860/283631
index_products AS (
SELECT * FROM dune_user_generated.index_products
),
-- Generate a table of days from the first inception date
days AS (
SELECT
generate_series(m... |
--
-- Author: Matt Lavery
-- Date: 09/04/2018
-- Purpose: Reports when sql logins passwords will expire
-- Reference: https://gallery.technet.microsoft.com/scriptcenter/When-will-a-SQL-login-d6fbb6df#content
-- Version: 0.1.0
-- Disclaimer: This script is provided "as is" in acc... |
-- Inserção de dados tabela Aeronave
INSERT INTO aeronave (modelo, peso, capacidade) VALUES('Airbus A300', '157000', '270');
INSERT INTO aeronave (modelo, peso, capacidade) VALUES('Airbus A320', '68000', '220');
INSERT INTO aeronave (modelo, peso, capacidade) VALUES('Airbus A350', '308000', '350');
INSERT INTO aeronav... |
{% load app_filters %}
DROP VIEW IF EXISTS {{ schema }}.{{ view_name }};
CREATE OR REPLACE VIEW {{ schema }}.{{ view_name }} AS
SELECT {% for data in fds_data %}
geocontrib_feature.{{ data|lookup:'related_field' }}{% if data|lookup:'alias'|length > 0 %} AS {{ data|lookup:'alias' }}{% endif %}{% if not forloop... |
/*
Warnings:
- Made the column `owner` on table `projects` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE "projects" ALTER COLUMN "owner" SET NOT NULL;
|
INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID)
VALUES ('KC-IACUC', 'Document', 'iacucProtocolProjectEndDateNumberOfYears', SYS_GUID(), 1, 'CONFG', '5', 'Number of Years for Proposal Development Project End Date', 'A', 'KC')
/
|
SELECT * FROM Towns ORDER BY [Name]
SELECT * FROM Departments ORDER BY [Name]
SELECT * FROM Employees ORDER BY Salary DESC |
CREATE TABLE cpa
(
cpa_id VARCHAR(256) NOT NULL UNIQUE,
cpa CLOB NOT NULL
);
CREATE TABLE url
(
source VARCHAR(256) NOT NULL UNIQUE,
destination VARCHAR(256) NOT NULL
);
CREATE TABLE ebms_message
(
time_stamp TIMESTAMP NOT NULL,
cpa_id VARCHAR(256) NOT NULL... |
CREATE EXTERNAL TABLE `hg19_variant_9b_table_partitioned_4000`(
`reference_name` string,
`start_position` string,
`end_position` string,
`reference_bases` string,
`alternate_bases` string,
`hg19_dbnsfp_35a_allvariants_sift_score` string,
`hg19_dbnsfp_35a_allvariants_sift_converted_rankscore` string,
`hg... |
ALTER TABLE oppdrag ADD COLUMN utbetaling_id UUID NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
ALTER TABLE oppdrag ALTER COLUMN utbetaling_id DROP DEFAULT |
[{"model": "contenttypes.contenttype", "pk": 1, "fields": {"app_label": "admin", "model": "logentry"}}, {"model": "contenttypes.contenttype", "pk": 2, "fields": {"app_label": "auth", "model": "permission"}}, {"model": "contenttypes.contenttype", "pk": 3, "fields": {"app_label": "auth", "model": "group"}}, {"model": "co... |
CREATE or ALTER TRIGGER delUp_item ON item
AFTER DELETE, UPDATE
AS
if(update(i_item_sk))
begin
raiserror('Operation not allowed', 16, 10);
rollback transaction;
end
if exists (select * from inserted) --this means updates to item table happened
begin
insert into logTable values ('logging updat... |
-- @testpoint:openGauss关键字source(非保留),同时作为表名和列名带引号,与union结合查询合并两个SELECT 语句查询
drop table if exists "source" CASCADE;
create table "source"(
c_id int, c_int int, c_integer integer, c_bool int, c_boolean int, c_bigint integer,
c_real real, c_double real,
c_decimal decimal(38), c_number number(38), c_numeric numeric(3... |
/*
Navicat Premium Data Transfer
Source Server : 本机
Source Server Type : MySQL
Source Server Version : 50722
Source Host : localhost:3307
Source Schema : test_order1
Target Server Type : MySQL
Target Server Version : 50722
File Encoding : 65001
Date: 08/07/2020 11:03... |
----------------------------
-- Copyright (C) 2021 CARTO
----------------------------
CREATE OR REPLACE SECURE FUNCTION ST_DELAUNAYPOLYGONS
(points ARRAY)
RETURNS ARRAY
IMMUTABLE
AS $$(
SELECT ARRAY_AGG(ST_ASGEOJSON(ST_MAKEPOLYGON(TO_GEOGRAPHY(unnested.VALUE)))::STRING)
FROM LATERAL FLATTEN(input => _DELAUNAYH... |
--Версия 1.1
--Добавляет таблицу данных кредитных карт сотрудников:
--номер карты, дата истечения, имя card holder, ссылку на сотрудника,
IF NOT EXISTS (SELECT * FROM SYS.TABLES SysTables WHERE SysTables.[Name] = 'CreditCards')
BEGIN
CREATE TABLE [dbo].[CreditCards](
[CreditCardId] INT NOT NULL PRIMARY KEY IDENTI... |
use demo;
insert into t_department(name) values('部门一');
insert into t_department(name) values('部门二');
insert into t_department(name) values('部门三');
insert into t_employee(name, gender, birthday, email, dept_id)
values ('赵波', 1, '1986-05-29', 'codergege@163.com', 1);
insert into t_employee(name, gender, birthday, emai... |
SELECT COUNT(*)
FROM
tag as t,
site as s,
question as q,
tag_question as tq
WHERE
t.site_id = s.site_id
AND q.site_id = s.site_id
AND tq.site_id = s.site_id
AND tq.question_id = q.id
AND tq.tag_id = t.id
AND (s.site_name in ('softwareengineering'))
AND (t.name in ('agile','programming-practices','python'))
AND (q.score... |
CREATE DATABASE IF NOT EXISTS `elearning`;
USE `elearning`;
--
-- Table structure for table `elearning`
--
CREATE TABLE `course` (
`id` int PRIMARY KEY AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`user_id` int,
`course_info` mediumtext,
`price` int NOT NULL,
`rating` numeric
);
CREATE TABLE `chapter` (
... |
USE [perpetuumsa]
GO
/*
BEGIN TRANSACTION
ROLLBACK TRANSACTION
COMMIT TRANSACTION
*/
-------------Balance fix prototype inconsistent velocities and armors------------
PRINT N'Balance fixes for prototype inconsistencies as of 3/4/2018';
DECLARE @definitionID int;
DECLARE @aggvalueID int;
DECLARE @aggfieldID int;
P... |
ALTER TABLE `contest_bracket_media_combo` ADD `combo_id` INT( 11 ) NOT NULL AFTER `id` ; |
CREATE SCHEMA [NetSqlAzMan_Readers]
AUTHORIZATION [NetSqlAzMan_Readers];
|
drop table conversations; |
CREATE TABLE `users` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
`login` VARCHAR(32) NOT NULL,
`password_hash` VARCHAR(40) NOT NULL
);
INSERT INTO `users` (`login`, `password_hash`) VALUES ('admin', '40bd001563085fc35165329ea1ff5c5ecbdbbeef');... |
-- Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0.
-- PostgreSQL database for the pvw module, version 1.0.0
SET client_encoding = 'UTF8';
SET default_with_oids = FALSE;
CREATE TABLE IF NOT EXISTS "pvw_instance" (
"instance_id" serial PRIMARY KEY,
"item_id" bigint NOT NULL,
"po... |
\set ECHO
\set QUIET 1
\pset format unaligned
\pset tuples_only true
\pset pager
\set ON_ERROR_ROLLBACK 1
\set ON_ERROR_STOP true
\set QUIET 1
SET client_encoding = utf8;
BEGIN;
SELECT plan(19);
SELECT lives_ok( 'CREATE LANGUAGE plperl', 'Language creation should work fine?!' );
SELECT lives_ok( 'CREA... |
CREATE TABLE `empresa` (
`id` bigint(20) NOT NULL,
`cnpj` varchar(255) NOT NULL,
`data_atualizacao` datetime NOT NULL,
`data_criacao` datetime NOT NULL,
`razao_social` varchar(255) NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET= utf8;
CREATE TABLE `funcionario` (
... |
DROP FUNCTION IF EXISTS reclada_storage.s3_generate_presigned_post(jsonb, jsonb);
CREATE OR REPLACE FUNCTION reclada_storage.s3_generate_presigned_post(data JSONB, credentials JSONB)
RETURNS JSONB AS $$
import json
import boto3
json_data = json.loads(data)
json_credentials = json.loads(credentials)["a... |
CREATE TABLE IF NOT EXISTS {{ params.table_name }}(custom_id integer NOT NULL, timestamp TIMESTAMP NOT NULL, user_id VARCHAR (50) NOT NULL) |
DROP TABLE IF EXISTS academic_years;
CREATE TABLE `academic_years` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`session` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`year` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT ... |
-- db_patches
INSERT INTO `db_patches` VALUES ('PHPOE-2257', NOW());
-- custom_modules
UPDATE `custom_modules` SET `filter`='Institution.Types' WHERE `code`='Institution' AND `model`='Institution.Institutions';
|
/* ejercicio 9 */
SELECT Top 5 CAT.CategoryName as CATEGORIA, sum([Quantity]) as SUBTOTAL
FROM [Northwind].[dbo].[Order Details] AS MOVEMENT
INNER JOIN [Northwind].[dbo].[Products] AS PROD
ON (MOVEMENT.ProductID=PROD.ProductID)
INNER JOIN [Northwind].[dbo].[Categories] AS CAT
on (PROD.CategoryID=CAT.Categor... |
select
g.location,
(
sum(
case when g.location='Home' and g.team_score>g.opponent_score then 1
when g.location='Away' and g.team_score<g.opponent_score then 1
when g.location='Neutral' then 0.5
else 0 end
)::float/
count(*)
)::numeric(3,2) as win_pct,
count(*) as n
from uscho.games g
where
TRUE
and g.g... |
-- generared using
-- curl "https://api.mockaroo.com/api/910b6c20?count=100&key=90eac760" > seed.sql
--
-- want different data? check: https://www.mockaroo.com/910b6c20
--
insert into categories (name, description) values ('Schilderijen', ' Zeg je kunst, zeg je schilderijen. Daarom bieden wij van bijvoorbeeld goedkop... |
SELECT
ref.relname AS refname, d2.refclassid, dep.deptype AS deptype
FROM pg_depend dep
LEFT JOIN pg_depend d2 ON dep.objid=d2.objid AND dep.refobjid != d2.refobjid
LEFT JOIN pg_class ref ON ref.oid=d2.refobjid
LEFT JOIN pg_attribute att ON d2.refclassid=att.attrelid AND d2.refobjsubid=att.attnum
{{... |
--test power function using char and other types as its operand
select power('char3/3/2003 8:8:8 am', 10) from db_root;
select power('char3/3/2003 8:8:8 am', 10.12) from db_root;
select power('char3/3/2003 8:8:8 am', time'8:8:8 am') from db_root;
select power('char3/3/2003 8:8:8 am', date'6/6/2006') from db_root;
selec... |
create table T_AMIGO_MENSAJES
(
id_amistad_mensaje NUMBER not null,
id_amistad NUMBER not null,
id_usuario NUMBER(10) not null,
contenido VARCHAR2(2000),
ref_mensaje NUMBER,
fecha TIMESTAMP(2) WITH TIME ZONE default CURRENT_TIMESTAMP not null
)
;
comment on table... |
insert into students
values( 1,
"John",
"Doe",
"3225 Woodland Park St",
"Houston",
"TX",
"77082"
);
|
-- Copyright Data Geekery GmbH
--
-- 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 by applicable law or agreed to in... |
-- Foreign Server: FS_$%{}[]()&*^!@"'`\/#
-- DROP SERVER FS_$%{}[]()&*^!@"'`\/#
CREATE SERVER "FS_$%{}[]()&*^!@""'`\/#"
TYPE 'oracle'
VERSION '1.1'
FOREIGN DATA WRAPPER test_fdw_for_fs
OPTIONS (host '192.168.1.1', dbname 'edb', port '5450');
ALTER SERVER "FS_$%{}[]()&*^!@""'`\/#"
OWNER TO enterpr... |
-- MySQL dump 10.16 Distrib 10.1.34-MariaDB, for Win32 (AMD64)
--
-- Host: localhost Database: cytek
-- ------------------------------------------------------
-- Server version 10.1.34-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_... |
-- =============================================
-- Author: Artyom
-- Create date: 22.03.2022
-- Description: Получить наименование населенного пункта
-- =============================================
CREATE FUNCTION [mun].[SUF_VillageName](
@ObjectGUID CHAR(36))
RETURNS CHAR(36)
AS
BEGIN
DECLARE @Result CHAR(36)
... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 02, 2020 at 02:54 PM
-- Server version: 8.0.16
-- PHP Version: 7.2.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... |
--
-- 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 ... |
-- 2018-09-18T16:33:18.476
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,544778,0,TO_TIMESTAMP('2018-09-18 16:33:18','YYYY-MM-DD HH24:MI:SS'),100,'de... |
select c_custkey, c_nationkey, c_name, o_custkey, (case when a.c_nationkey > 3 then 4 else 3 end)
from customer_parts a
inner join orders b
on a.c_custkey = b.o_custkey
where a.c_custkey = (case when a.c_name like 'Customer%' and a.c_nationkey > 3 then 4 else 3 end)
order by c_custkey |
/*
Database create script for the Great Reading Adventure.
This script creates the database, SQL Server logins, and database users.
* It will exit immediately if the database exists.
* If the SQL Server logins exist, it will continue running without modifying them.
Please change the following password below in ... |
CREATE TABLE [Sales].[SalesOrderDetail] (
[SalesOrderID] INT NOT NULL,
[SalesOrderDetailID] INT IDENTITY (1, 1) NOT NULL,
[CarrierTrackingNumber] NVARCHAR (25) NULL,
[OrderQty] SMALLINT NOT NULL,
[ProductID] INT ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.