text stringlengths 1 1.05M |
|---|
DROP DATABASE IF EXISTS test_show_limit;
CREATE DATABASE test_show_limit;
CREATE TABLE test_show_limit.test1 (test UInt8) ENGINE = TinyLog;
CREATE TABLE test_show_limit.test2 (test UInt8) ENGINE = TinyLog;
CREATE TABLE test_show_limit.test3 (test UInt8) ENGINE = TinyLog;
CREATE TABLE test_show_limit.test4 (test UInt8... |
-- @executemode ORCA_PLANNER_DIFF
-- @description function_in_select_constant_withfunc2_123.sql
-- @db_name functionproperty
-- @author tungs1
-- @modified 2013-04-03 12:00:00
-- @created 2013-04-03 12:00:00
-- @tags functionProperties
SELECT func1_read_setint_sql_stb(func2_sql_int_vol(5)) FROM foo order by 1;
|
create database chapter3;
use chapter3;
create table t_role (
id int(12) auto_increment,
role_name varchar(60) not null,
note varchar(256) null,
primary key(id)
);
insert into t_role(role_name, note) values('role_name_1', 'note_1'); |
CREATE TABLE attribute_definition (
attribute_definition_id integer NOT NULL,
attribute_name character varying(255) NOT NULL,
attribute_description text,
attribute_type_concept_id integer NOT NULL,
attribute_syntax text
);
CREATE TABLE care_site (
care_site_id integer NOT NULL,
care_si... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 29, 2021 at 04:58 PM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
{% macro oracle__get_columns_in_query(select_sql) %}
{% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}
select * from (
{{ select_sql }}
) dbt_sbq_tmp
where 1 = 0 and rownum < 1
{% endcall %}
{{ return(load_result('get_columns_in_query').t... |
/*
https://leetcode.com/problems/exchange-seats/
https://leetcode.com/submissions/detail/143029079/
*/
SELECT (
CASE
WHEN MOD(id, 2) != 0 AND counts != id THEN id + 1
WHEN MOD(id, 2) != 0 AND counts = id THEN id
ELSE id - 1
END
) AS id, student
FROM seat, (
SELECT COUNT(*) AS count... |
--
-- ABSTIME
-- testing built-in time type abstime
-- uses reltime and tinterval
--
--
-- timezones may vary based not only on location but the operating
-- system. the main correctness issue is that the OS may not get
-- daylight savings time right for times prior to Unix epoch (jan 1 1970).
--
CREATE TABLE ABSTIM... |
CREATE TABLE deportes_usuarios (
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
id_wappersonas INT NULL,
nombre VARCHAR(50) NULL,
apellido VARCHAR(50) NULL,
telefono VARCHAR(50) NULL,
email VARCHAR(250) NULL,
nacionalidad VARCHAR(45) NULL,
id_ciudad INT NULL,
id_barrio INT NULL,
otro_barrio VARCHAR(250) NULL,
o... |
/**
* This is the database schema for testing Sqlite support of Yii DAO and Active Record.
* The database setup in config.php is required to perform then relevant tests:
*/
DROP TABLE IF EXISTS tbl_order_item;
DROP TABLE IF EXISTS tbl_item;
DROP TABLE IF EXISTS tbl_order;
DROP TABLE IF EXISTS tbl_category;
DROP TAB... |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101... |
COPY movies FROM '/Users/maximcondon/Desktop/Spiced/06_Week_6/ml-latest-small/movies.csv' DELIMITER ','CSV HEADER;
COPY links FROM '/Users/maximcondon/Desktop/Spiced/06_Week_6/ml-latest-small/links.csv' DELIMITER ','CSV HEADER;
COPY ratings FROM '/Users/maximcondon/Desktop/Spiced/06_Week_6/ml-latest-small/ratings.csv... |
-----------View_DIM_STORE--,
create view View_DIM_STORE as
select dimstoreid,
DIMLOCATIONID,
SOURCESTOREID,
STORENUMBER,
STOREMANAGER
from DIM_STORE
-------DIM_CUSTOMER----------
create view View_DIM_CUSTOMER as
select DIMCUSTOMERID,
DIMLOCATIONID,
SOURCECUSTOMERID,
CUSTOMERFULLNAME,
CUSTOMERFIRSTNA... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 19, 2021 at 04:56 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 8.0.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.35-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Version: 9.4.0.5125
-- ------------------------------------------------... |
select *
from {{ var('campaign_history') }}
|
CREATE DATABASE TableRelations
USE TableRelations
--01. One-To-One Relationship
CREATE TABLE Persons(
PersonID INT PRIMARY KEY,
FirstName VARCHAR(50),
Salary decimal,
PassportID INT UNIQUE
)
CREATE TABLE Passports(
PassportID INT PRIMARY KEY,
PassportNumber NVARCHAR(255)
)
INSERT INTO Passports VALUES
(101, 'N34F... |
# --- First database schema
# --- !Ups
create table User (
id char(36) not null,
name varchar(255) unique not null,
email varchar(255) unique not null,
password varchar(255),
isAdmin bool,
isModerator ... |
-- file:alter_table.sql ln:2207 expect:true
ALTER TABLE list_parted2 ATTACH PARTITION part_5 FOR VALUES IN (5)
|
select * from customer, region; |
# Note: This schema designed for PostgreSQL.
CREATE TABLE domains (
domainName VARCHAR(254) NOT NULL,
-- The domain name, with the "www" prefix (where such prefix exists).
domainDepth INTEGER NOT NULL CHECK (domainDepth > 0),
-- How far is the domain name from its TLD? ... |
/*
-- Query: SELECT * FROM fseletro.produtos
LIMIT 0, 1000
-- Date: 2020-10-25 23:16
*/
INSERT INTO `` (`id`,`categoria`,`descricao`,`preco`,`preco_venda`,`imagem`) VALUES (1,'geladeira','Geladeira Brastemp',899,899,'imagens/WhatsApp%20Image%202020-09-24%20at%2018.08.03%20(2).jpeg');
INSERT INTO `` (`id`,`categoria`,`... |
USE [ANTERO]
GO
/****** Object: View [dw].[v_arvo_avop] Script Date: 2.10.2020 8:50:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dw].[v_arvo_avop] AS
SELECT --TOP 100
--AIKAMUUTTUJAT
d5.vuosi AS 'Kyselyvuosi'
, d3b.kuukausi_fi AS 'Vastauskuukausi'
... |
SELECT TOP 1
AirlineID
FROM Airlines
ORDER BY Rating DESC
UPDATE Tickets
SET Price = Price * 1.5
WHERE FlightID IN
(SELECT FlightID
FROM Flights WHERE AirlineID =
(SELECT TOP 1 AirlineID
FROM Airlines ORDER BY Rating DESC)) |
PRAGMA foreign_keys=off
CREATE TABLE 'new_household' (
'id' INTEGER PRIMARY KEY AUTOINCREMENT,
'address1' VARCHAR(255),
'address2' VARCHAR(255),
'city' VARCHAR(255),
'state' VARCHAR(255),
'zip' VARCHAR(255),
'income' VARCHAR(255),
'note' VARCHAR(255),
'dateEntered' VARCHAR(255),
'createdAt' DATETI... |
DROP TABLE dbo.Person;
DROP TABLE dbo.Person_Hist;
--Create a copy of Person table for testing purposes
SELECT BusinessEntityID, PersonType, NameStyle, Title, FirstName, MiddleName, LastName
INTO dbo.Person
FROM Person.Person
GO
--Another copy of the structure for archiving
SELECT BusinessEntityID, PersonType, NameSt... |
PRINT 'Info: Creating the ''microsoft.vw_query_slots'' view';
GO
CREATE VIEW microsoft.vw_query_slots
AS
SELECT
SUM(CASE WHEN r.[status] = 'Running' THEN 1 ELSE 0 END) [running_queries],
SUM(CASE WHEN r.[status] = 'Running' THEN rw.concurrency_slots_used ELSE 0 END) [running_queries_slots],
SUM(CASE WHEN r.[status]... |
DROP VIEW IF EXISTS case_study_1_v;
CREATE VIEW case_study_1_v as (
SELECT
id,
CASE WHEN lower(summary) like '%hospitalized%' THEN 1 ELSE 0 END as hospitalized,
CASE WHEN (death='1') or (death is not null) THEN 1 ELSE 0 END as death,
CASE WHEN age BETWEEN 0 AND 39 THEN 2 ELSE 0 END as age_0_39,
CASE WHEN ag... |
CREATE PROCEDURE [employer_account].[AcceptInvitation]
(
@email NVARCHAR(255),
@accountId BIGINT,
@role TINYINT
)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @userId BIGINT;
SELECT @userId = Id
FROM [employer_account].[User]
WHERE [Email] = @email;
UPDATE [employer_account].[Invitation]
SET [Status] = 2
WHERE [Emai... |
SELECT start_terminal,
duration_seconds,
SUM(duration_seconds) OVER
(PARTITION BY start_terminal ORDER BY start_time)
AS running_total
FROM tutorial.dc_bikeshare_q1_2012
WHERE start_time < '2012-01-08';
|
SELECT * FROM verify WHERE email = $1;
|
IF not EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tbOper]') AND type in (N'U'))
begin
CREATE TABLE [dbo].[tbOper](
[vcOperID] [varchar](10) NOT NULL primary key,
[vcOperName] [varchar](10) NOT NULL,
[vcLimit] [varchar](5) NULL,
[vcPwd] [varchar](6) NULL,
[vcDeptID] [varchar](5) NULL,
... |
CREATE DATABASE FBLAQuiz;
CREATE TABLE Student (
student_id INT(16) PRIMARY KEY,
student_name VARCHAR(255) NOT NULL,
student_grade INT(16) NOT NULL
);
CREATE TABLE Question (
question_id INT(16) PRIMARY KEY AUTO_INCREMENT,
question_text TEXT NOT NULL,
question_type VARCHAR(50) NOT NULL,
question_score I... |
/* Copyright (c) 2006-2012 Regents of the University of Minnesota.
For licensing terms, see the file LICENSE. */
BEGIN TRANSACTION;
/** Using 'visualization' is too verbose. Renaming tables to use the
* more concise name 'viz'
*/
SET CONSTRAINTS ALL DEFERRED;
ALTER TABLE user_ RENAME COLUMN route_viz TO rou... |
--
-- Apache Derby scripts by Steve Stewart, updated by Ronald Pomeroy
-- Based on Srinivas Venkatarangaiah's file for Cloudscape
--
-- In your Quartz properties file, you'll need to set
-- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.CloudscapeDelegate
--
-- Known to work with Apache Derby... |
SELECT * FROM my_table WHERE my_column = ${val} |
CREATE UNIQUE INDEX users_email_key ON users (email) |
-- delete_empty_keys
SELECT delete_empty_keys(NULL) AS v1_null;
SELECT delete_empty_keys(''::hstore) AS v2_null;
SELECT delete_empty_keys('"empty"=>""'::hstore) AS v3_null;
SELECT delete_empty_keys('"foo"=>"bar"'::hstore) AS v4;
SELECT delete_empty_keys('"foo"=>"bar", "empty"=>""'::hstore) AS v5;
SELECT delete_empty_ke... |
-- file:interval.sql ln:11 expect:true
SELECT INTERVAL '-08:00' AS "Eight hours"
|
SET @sName = 'bx_forum';
-- SETTINGS
SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES
('modules', @sName, '_bx_forum', 'bx_forum@modules/boonex/forum/|std-icon.svg', IF(ISNULL(@iTypeOrder), ... |
-- +goose Up
create table list_type (
id int PRIMARY KEY NOT NULL,
created_at timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
deleted_at timestamp,
name varchar(20) UNIQUE NOT NULL
);
-- +goose Down
drop table if exists list_type;
|
CREATE TABLE CUSTOMER ( CUSTOMER_ID INTEGER NOT NULL, USERNAME VARCHAR(30) NOT NULL, OPEN_ORDER INTEGER, NAME VARCHAR(30) NOT NULL, BUSINESS_VOLUME_DISCOUNT CHAR(1) DEFAULT 'N', BUSINESS_PARTNER CHAR(1) DEFAULT 'N', BUSINESS_DESCRIPTION CLOB(12582912), RESIDENTIAL_HOUSEHOLD_SIZE SMALLINT, RESIDENTIAL_FREQUENT_CUSTOMER ... |
create proc sp_Consulta5
as
select * from Producto
where Nombre = 'Mountain-100 Black, 42'
go |
--
-- Record of deleted file data
--
CREATE TABLE /*$wgDBprefix*/filearchive (
-- Unique row id
fa_id int not null auto_increment,
-- Original base filename; key to image.img_name, page.page_title, etc
fa_name varchar(255) binary NOT NULL default '',
-- Filename of archived file, if an old revision
fa_arc... |
SELECT b1.name,
count(*)
FROM site AS s,
so_user AS u1,
tag AS t1,
tag_question AS tq1,
question AS q1,
badge AS b1,
account AS acc
WHERE s.site_id = u1.site_id
AND s.site_id = b1.site_id
AND s.site_id = t1.site_id
AND s.site_id = tq1.site_id
AND s.site_id = q1.site_id
AND... |
CREATE TABLE IF NOT EXISTS account (
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
token_subject character varying(128) NOT NULL,
CONSTRAINT uq__account__token_subject UNIQUE(token_subject)
);
|
SELECT
`id`,
`question_number`,
`source`,
`cidr_bits`,
CAST(`is_cidr` AS UNSIGNED) AS `is_cidr`,
`correct_nw`,
`answer_nw`,
`correct_bc`,
`answer_bc`,
`elapsed`,
`created`,
`updated`
FROM T_QUESTION
WHERE `id` = :id
AND `question_number` = :number;
|
--
-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
-- under one or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information regarding copyright
-- ownership. Camunda licenses this file to you under the Apache License,
-- Version 2.0; y... |
#
# TABLE STRUCTURE FOR: Endereco
#
USE comportamento_digital;
INSERT INTO `Endereco` (`cep`, `regiao`, `estado`, `cidade`, `bairro`, `rua`) VALUES ('00130', '\"Regiao A\"', 'Arizona', 'North Veronaburgh', 'Apt. 191', 'Catalina Circle');
INSERT INTO `Endereco` (`cep`, `regiao`, `estado`, `cidade`, `bairro`, `rua`) VA... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 22, 2021 at 11:08 AM
-- 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... |
select way,highway,aeroway,
case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel,
case when bridge in ('yes','true','1') then 'yes'::text else bridge end as bridge,
case when name ilike ref then null else name end as name,
ref,char_length(ref) as length
from &prefix;_line... |
USE [dbo]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Marco Puccio
-- Create date: 12-09-2016
-- Description: Trigger to set the depuration
-- date to a new row inserted. This
-- date will be the last day of the
-- ... |
ALTER TABLE `settings` ADD `pv_maker` INT(11) DEFAULT 0;
ALTER TABLE `settings` ADD `pv_maker_host` varchar(255) COLLATE utf8_bin DEFAULT NULL;
ALTER TABLE `ingredients` ADD `soluble` VARCHAR(255) NULL AFTER `flavor_use`, ADD `impact` VARCHAR(255) NULL AFTER `soluble`;
CREATE TABLE `allergens` (
`id` int(11) NOT NUL... |
SELECT
Case
WHEN A+B <= C THEN 'Not A Triangle'
WHEN A = B AND A = C THEN 'Equilateral'
WHEN A = B OR A = C OR B = C THEN 'Isosceles'
ELSE 'Scalene'
END
FROM TRIANGLES
------------------------------------------------
SELECT NAME + '(' +LEFT(OCCUPATION, 1) + ')' FROM OCCUPATIONS ORDER BY NAME;
SELECT 'There are ... |
CREATE TABLE [Genre] (
[Id] VARCHAR(10) NOT NULL PRIMARY KEY,
[Name] VARCHAR(10) NOT NULL
)
|
CREATE TABLE IF NOT EXISTS everyday_analysis(
v_date DATETIME NOT NULL DEFAULT NOW(),
visitor_cnt INT NOT NULL,
posts_cnt INT NOT NULL,
PRIMARY KEY (v_date)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; |
-- Tags: global
SELECT 'GLOBAL IN';
select * from remote('localhost', system.one) where dummy global in (0);
select * from remote('localhost', system.one) where dummy global in system.one;
select * from remote('localhost', system.one) where dummy global in (select 0);
SELECT 'GLOBAL NOT IN';
select * from remote('loca... |
---
--- Example SQL
---
DROP SCHEMA techtalk CASCADE;
CREATE SCHEMA techtalk;
CREATE TABLE techtalk.data as (
SELECT
'foobar-' || cast(trunc(random() * 1000) as text) as name,
(CASE random()::INTEGER WHEN 0 THEN 'heads' WHEN 1 THEN 'tails' END) as coin_flip,
cast(trunc(random() * 1000) as int) as luck... |
-- MySQL dump 10.13 Distrib 8.0.21, for Linux (x86_64)
--
-- Host: localhost Database: seata_account
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th3 19, 2022 lúc 06:53 PM
-- Phiên bản máy phục vụ: 10.4.22-MariaDB
-- Phiên bản PHP: 8.0.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
select * from hive_json where get_json_object(hive_json.json, '$.User.ShippingAddress.City') like '%an%';
|
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 11, 2019 at 06:06 PM
-- Server version: 5.7.26-0ubuntu0.16.04.1
-- PHP Version: 7.2.19-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!... |
/****** Object: View [dbo].[V_Operations_User_Detail_Report] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Operations_User_Detail_Report]
As
-- Note that GetOperationDMSUsersNameList only includes Active users
SELECT Operation,
Operation_Description AS Description,
... |
CREATE TABLE IACUC_PERSON_TRAINING (
IACUC_PERSON_TRAINING_ID NUMBER(12,0) NOT NULL,
PERSON_TRAINING_ID NUMBER(12,0) NOT NULL,
PERSON_ID VARCHAR2(40) NOT NULL,
SPECIES_CODE NUMBER(4,0) NOT NULL,
PROCEDURE_CODE NUMBER(4,0) NOT NULL,
UPDATE_TIMESTAMP DATE NOT NULL,
UPDATE_USER VARCHAR2(... |
INSERT INTO gc_cur_team_stats_rushing (player_id, name, att, yds, tds, lng, lngtd, twopta, twoptm, _gc_cur_team_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016-2021] EMBL-European Bioinformatics Institute
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may ob... |
CREATE TABLE [dbo].[Accounts] (
[Flag] BIT DEFAULT ((0)) NOT NULL,
[Id] INT IDENTITY (1, 1) NOT NULL,
[UserName] NVARCHAR (50) NOT NULL,
[Password] NVARCHAR (100) NULL,
[PasswordSalt] VARCHAR (100) NULL,
... |
DROP FUNCTION IF EXISTS de_metas_material.retrieve_atp_at_date(timestamp with time zone);
CREATE FUNCTION de_metas_material.retrieve_atp_at_date(IN p_date timestamp with time zone)
RETURNS TABLE(
M_Product_ID numeric,
M_Warehouse_ID numeric,
C_BPartner_Customer_ID numeric,
StorageAttributesKey character varying... |
/* \\\\Release Notes\\\\
Created/updated by MK Advisory Services, LLC
Version [0.0.002] – last updated 1/3/2021
Tools: created with CMS MAT v. 6.0.3 (FHIR Beta)
Value sets in this library included per NCQA HEDIS Specifications MY 2020 Volume 2 Value Set Directory 2020-11-13
Value sets in this library have not been add... |
UPDATE
archfolio.users
SET
username = COALESCE(cast(:username AS TEXT), username),
email = COALESCE(cast(:email AS TEXT), email),
salt = COALESCE(cast(:salt AS BYTEA), salt),
password = COALESCE(cast(:password AS BYTEA), password),
pfp_url = COALESCE(cast(:pfp_url AS TEXT), pfp_url),
name = ... |
CREATE PROCEDURE [dbo].[spExam_Create]
@CreatedBy int = 0,
@Description VARCHAR(MAX),
@Name VARCHAR(100)
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO [dbo].[Exam] ([CreatedBy], [Description], [Name]) VALUES (@CreatedBy, @Description, @Name)
END
|
-- phpMyAdmin SQL Dump
-- version 4.1.6
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2015-06-05 08:57:54
-- 服务器版本: 5.5.36
-- PHP Version: 5.4.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @... |
SeLEcT a FrOm foo |
CREATE TABLE "public"."votes" ("id" serial NOT NULL, "option_id" integer NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , FOREIGN KEY ("option_id") REFERENCES "public"."options"("id") ON UPDATE restrict ON DELETE cascade);
|
/*
Navicat MySQL Data Transfer
Source Server : pp
Source Server Version : 50622
Source Host : localhost:3306
Source Database : ldms
Target Server Type : MYSQL
Target Server Version : 50622
File Encoding : 65001
Date: 2016-05-31 06:06:47
*/
SET FOREIGN_KEY_CHECKS=0;
-- -----------... |
USE demographics
IF OBJECT_ID(N'[dbo].[StudentRaceSnapshot]','U') IS NOT NULL
DROP TABLE [dbo].[StudentRaceSnapshot]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[StudentRaceSnapshot](
[studentRaceSnapshotID] [INT] IDENTITY(1,1),
[yearID] [INT] N... |
CREATE TABLE `sap_candidate_jobs_applied_data`
(
`CandidateID` varchar(20) NOT NULL,
`ApplicationID` varchar(20) NOT NULL,
`PosTitle` varchar(40) DEFAULT NULL,
`Yesanswer` varchar(20) DEFAULT NULL,
`JobCode` varchar(20) DEFAULT NULL,... |
drop schema "kundu" cascade;
|
-- [er] create class using Constraints DEFAULT,Unique and SHARED
create table t1 (
c1 int SHARED 9 Unique DEFAULT 8
);
drop t1; |
SELECT state_name,
num_awcs AS "Total AWCs",
num_launched_awcs AS "AWCs Launched",
num_launched_districts AS "Districts launched",
awc_days_open,
CASE
WHEN num_launched_awcs > 0 THEN awc_days_open / num_launched_awcs
ELSE awc_days_open
END ... |
# $Id$
#
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
# 1785 E. Sahara Avenue, Suite 490-204
# Las Vegas, Nevada 89104
#
# Licensed under The MIT License
# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above ... |
/**
* SQLite
*/
DROP TABLE IF EXISTS "page";
CREATE TABLE page (
id INTEGER PRIMARY KEY NOT NULL,
title TEXT,
created_at TIMESTAMP WITH TIME ZONE
);
INSERT INTO "page" VALUES
(1, 'home page', ''),
(4, 'about', ''),
(16386, 'contacts', '');
DROP TABLE IF EXISTS "session";
CREATE TABLE "session" (
... |
EXEC tSQLt.RunAll |
-- create schema demo_ds_0;
-- create schema demo_ds_a;
-- demo_ds_0 表初始化
USE `demo_ds_0`;
DROP TABLE IF EXISTS `account`;
CREATE TABLE `account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` varchar(128) NOT NULL,
`balance` decimal(10,0) NOT NULL COMMENT '用户余额',
`freeze_amount` decimal(10,0) NOT NU... |
-- func.test
--
-- execsql {SELECT substr(t1,2,2) FROM tbl1 ORDER BY t1}
SELECT substr(t1,2,2) FROM tbl1 ORDER BY t1 |
SELECT 1 WHERE my_col = 3;
SELECT 3, 1
FROM blah.my_table a
LEFT JOIN bleh.my_table_two b
ON a.meh = b.bleh
LIMIT 1;
SELECT 3, 1 /* my fav column */
FROM blah.my_table a
JOIN bleh.extra_table b
ON a.id = db.b.a_id
WHERE a = 4.4 OR b = 3
GROUP BY a, b, 1
HAVING c
ORDER BY a
LIMIT 1;
SELECT * FROM my... |
CREATE TABLE `file_chunk_record` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`md5` varchar(255) NOT NULL COMMENT '文件md5值',
`chunk` int(11) NOT NULL COMMENT '分片值'... |
--
-- Copyright © 2012 - 2018 camunda services GmbH and various authors (info@camunda.com)
--
-- 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... |
-- ----------------------------
-- 日期:2019-04-20 12:44:44
-- MySQL - 5.5.52-MariaDB : Database - managers
-- ----------------------------
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `baby`
-- ----------------------------
DROP TABLE IF EXISTS `baby`;
... |
CREATE TABLE #Codesets (
codeset_id int NOT NULL,
concept_id bigint NOT NULL
)
;
INSERT INTO #Codesets (codeset_id, concept_id)
SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (4118056,194702)
UNION se... |
select
'Tables' as table_type,
'YES' as is_nullable,
tables.schema_name as table_schema,
tables.table_name as table_name,
column_name,
data_type
from
information_schema.tables, information_schema.columns
where
tables.schema_name not in ('information_schema')
and columns.sc... |
CREATE TABLE [dbo].[Session] (
[SessionId] INT IDENTITY (1, 1) NOT NULL,
[Title] NVARCHAR (1000) NOT NULL,
[ShortTitle] NVARCHAR (500) NULL,
[Description] NVARCHAR (4000) NULL,
[RoomId] INT NULL,
[StartTime] DATETIME2 (7) NULL,
... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Oct 25, 2018 at 07:15 AM
-- Server version: 8.0.11
-- PHP Version: 7.2.10-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... |
select
count(*) as count_star,
sum(a.d9) as sum_d9,
--round(avg(a.d9)) as round_avg_d9,
cast(avg(a.d9) as bigint) as round_avg_d9,
--trunc(avg(a.d9)) as trunc_avg_d9,
cast(avg(a.d9) as bigint) as trunc_avg_d9,
--sum(case when a.d9 = 0 then 100 else round(a.d9/12) end) as case_in_sum_d9,
... |
CREATE OR REPLACE FUNCTION fn_revoke_schema(p_role_name VARCHAR)
RETURNS void
AS $$
DECLARE cursor_row RECORD;
BEGIN
PERFORM fn_schema_privileges('REVOKE', p_role_name);
END$$
LANGUAGE plpgsql VOLATILE;
|
CREATE TABLE [dbo].[Users]
(
[Id] [uniqueidentifier] NOT NULL,
[FirstName] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LastName] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserName] [nvarchar] (300) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Lang] [nvarchar] (10) COLLATE SQL_Lati... |
-- original: randexpr1.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
SELECT 11+17+case when case 17 when coalesce((select max(d) from t1 where 13+(t1.c-e)+19+e-t1.e>=b and not 11 not in (19,t1.e,13) and (t1.f)>b),19)*19 then c else -d end not in (c,19,t1.c) then d when d<=t1.d then 13 else 11 en... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: db
-- Generation Time: Feb 05, 2020 at 03:17 AM
-- Server version: 5.7.28
-- PHP Version: 7.2.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `goraddUnit`
--
-- ----------------------------------... |
-- file:subscription.sql ln:30 expect:true
COMMENT ON SUBSCRIPTION testsub IS 'test subscription'
|
-- @testpoint: --建表查询
DROP TABLE if EXISTS words CASCADE;
CREATE TABLE words(name1 varchar,name2 int);
begin
for i in 1..20 LOOP
insert into words VALUES('aa',i);
end loop;
end;
/
select array_to_json(array_agg(row_to_json(t))) from (select name1, name2 from words) t;
--SELECT row_to_json(words) from words;
D... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.