text stringlengths 1 1.05M |
|---|
insert into sline_line_day values('1','0','1','1','0');
insert into sline_line_day values('2','0','2','2','0');
insert into sline_line_day values('3','0','3','3','0');
insert into sline_line_day values('4','0','4','4','0');
insert into sline_line_day values('5','0','5','5','0');
insert into sline_line_day values('6','0... |
DROP SCHEMA IF EXISTS sikb cascade;
CREATE SCHEMA sikb;
CREATE TABLE sikb.application
(
"id" serial PRIMARY KEY,
"name" text UNIQUE,
"login" text,
"password" text
);
CREATE TABLE sikb.user
(
"id" serial PRIMARY KEY,
"email" text UNIQUE,
"pa... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.4.5
-- Dumped by pg_dump version 9.4.1
-- Started on 2016-02-02 15:23:20
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages =... |
/**新闻分类初始化***/
insert into crawler_news_classify(classifytype,classifyname) values(0,'体育');
insert into crawler_news_classify(classifytype,classifyname) values(1,'教育');
insert into crawler_news_classify(classifytype,classifyname) values(2,'财经');
insert into crawler_news_classify(classifytype,classifyname) values(3,'社会'... |
-- Your SQL goes here
CREATE TABLE modules (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
name TEXT NOT NULL,
cost INTEGER NOT NULL,
author INTEGER NOT NULL
); |
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row... |
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(100),
`email` varchar(100),
`mobile` varchar(15),
`alamat` varchar(100),
PRIMARY KEY (`id`)
); |
-- @testpoint:openGauss关键字reset(非保留),作为列名带引号并且更新时使用该列,建表成功,reset的值更新为100
drop table if exists reset_test;
create table reset_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_numeric numeric(38),
... |
-- MySQL dump 10.13 Distrib 8.0.22, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: fromDb
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... |
CREATE TABLE subdivision_NE (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "subdivision_NE" ("id", "name", "level") VALUES ('NE-1', 'Agadez', 'region');
INSERT INTO "subdivision_NE" ("id", "name", "level") VALUES ('NE-2', 'Diffa', 'region');
INSERT INTO "subdivisi... |
alter table cd_stage drop column jenkins_step_name; |
INSERT INTO department (id, name)
VALUES (1, 'Customer Service'),
(2, 'Development'),
(3, 'Marketing'),
(4, 'Accounting'),
(5, 'Human Resources');
INSERT INTO role (id, title, salary, department_id)
VALUES (1, 'Representative', 55000.00, 1),
(2, 'Junior Developer', 75000.00, 2),
... |
/* contrib/pg_stat_monitor/pg_stat_monitor--1.4.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pg_stat_monitor" to load this file. \quit
-- Register functions.
CREATE FUNCTION pg_stat_monitor_reset()
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C PARALLEL S... |
CREATE UNIQUE INDEX UX_PhoneNumber_PhoneNumber ON dbo.PhoneNumber (PhoneNumber)
GO
|
-- phpMyAdmin SQL Dump
-- version 3.4.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 20, 2012 at 03:23 PM
-- Server version: 5.1.52
-- PHP Version: 5.3.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
--Drop schema if exists quickstats cascade;
--create schema quickstats;
set search_path=quickstats,public;
create table usda_api (
year text,
commodity_desc text,
statisticcat_desc text,
county_code text,
source_desc text,
unit_desc text,
prodn_practice_desc text,
freq_desc text,
domain_desc text,
util_practice_desc t... |
SELECT MIN("CommonGovernment_13"."naics_name") AS "TEMP(attr:naics_name:nk)(3709532549)(0)", MAX("CommonGovernment_13"."naics_name") AS "TEMP(attr:naics_name:nk)(766450649)(0)", "CommonGovernment_13"."naics_code" AS "naics_code", SUM(CAST("CommonGovernment_13"."Number of Records" AS SIGNED)) AS "sum:Number of Rec... |
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
CREATE OR REPLACE VIEW analytics.rls_UserDim
AS
... |
begin;
select round_id as rd,
school_name as name,
p::numeric(4,3) as p
from ncaa_sr.rounds
where TRUE --round_id=2
and p<1.0
order by round_id asc,p desc;
copy
(
select round_id as rd,
school_name as name,
p::numeric(4,3) as p
from ncaa_sr.rounds
where TRUE --round_id=2
and p<1.0
order by round_id asc,p desc
)
to '/... |
--
CREATE EXTENSION IF NOT EXISTS plpgsql;
CREATE OR REPLACE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
HANDLER plpgsql_call_handler
VALIDATOR plpgsql_validator;
-- |
-- 1112.Highest Grade For Each Student
-- Table: Enrollments
-- +---------------+---------+
-- | Column Name | Type |
-- +---------------+---------+
-- | student_id | int |
-- | course_id | int |
-- | grade | int |
-- +---------------+---------+
-- (student_id, course_id) is the primary... |
-- CUISINE Table
CREATE TABLE cuisine (
id BIGSERIAL PRIMARY KEY NOT NULL,
name VARCHAR(100) NOT NULL,
created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT current_timestamp NOT NULL,
updated_at TIMESTAMP WITHOUT TIME ZONE DEFAULT current_timestamp NOT NULL
);
-- USERS Table
CREATE TABLE users (
id BIGSERIAL PR... |
SELECT
EMPLOYEES.NAME, EMPLOYEE_PAN.UIN
FROM EMPLOYEES INNER JOIN EMPLOYEE_PAN
ON EMPLOYEES.ID = EMPLOYEE_PAN.ID;
SELECT
CONCAT(DEPARTMENTS.DEPT_NAME, " " ,COUNT(STUDENTS.STUDENT_ID))
FROM STUDENTS INNER JOIN DEPARTMENTS
ON STUDENTS.DEPT_ID = DEPARTMENTS.DEPT_ID
GROUP BY DEPARTMENTS.DEPT_ID
ORDER BY COUNT(STUDENT... |
ALTER TABLE db_version CHANGE COLUMN required_2008_12_22_11_mangos_player_classlevelstats required_2008_12_22_12_mangos_player_levelstats bit;
DELETE FROM `player_levelstats`;
INSERT INTO `player_levelstats` VALUES
(1,1,1,23,20,22,20,20),
(1,1,2,24,21,23,20,20),
(1,1,3,26,22,24,20,21),
(1,1,4,27,22,26,20,21),
(1,1,5,2... |
-- @(#)16.sql 2.1.8.1
-- TPC-H/TPC-R Parts/Supplier Relationship Query (Q16)
-- Functional Query Definition
-- Approved February 1998
:o
:b
:x
select
p_brand,
p_type,
p_size,
count(distinct ps_suppkey) as supplier_cnt
from
partsupp,
part
where
p_partkey = ps_partkey
and p_brand <> ':1'
and p_type not like ':2%... |
CREATE DATABASE IF NOT EXISTS `teste_mercado` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `teste_mercado`;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: teste_mercado
-- ------------------------------------------------------
-- Server version 5.7.21-log
/*!40101 SET @OLD_C... |
DROP DATABASE IF EXISTS geeglo_store;
CREATE DATABASE geeglo_store;
ALTER DATABASE geeglo_store CHARACTER SET utf8 COLLATE utf8_general_ci;
use geeglo_store;
DROP TABLE IF EXISTS country;
create table country (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(128),
phoneCode VARCHAR(10)
);
ALTER TABLE c... |
/* Modelagem Básica -
ENTIDADE=TABELA
CAMPOS = ATRIBUTOS */
/*MODELAGEM CONCEITUAL - RASCUNHO */
CLIENTE
NOME - CARACTER(30)
CPF - NUMERICO(11)
EMAIL - CARACTER(30)
TELEFONE - CARACTER(30)
ENDERECO - CARACTER(100)
SEXO - CARACTER(1)
/* PROCESSOS DE MODELAGEM */
/*MODELAGEM CONCEITUAL - RASCUNHO
MODELAGEM LÓGICA... |
drop table winner;
CREATE TABLE winner
(
id INTEGER NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
how INTEGER NOT NULL,
'when' TEXT NOT NULL DEFAULT (datetime('now','localtime'))
)
|
CREATE PROCEDURE [dbo].[usp_sqlwatch_internal_run_job]
@job_name sysname,
@fail_on_error bit = 1
as
set nocount on ;
declare @job_id uniqueidentifier,
@job_owner sysname;
declare @xp_results table (
job_id UNIQUEIDENTIFIER NOT NULL,
last_run_date INT NOT NULL,
last_run_time INT NOT NULL,
next_run_date INT N... |
CREATE INDEX idx_round_product_round_id ON vetd.round_product (round_id) |
-- Insert security deposit return test data for lease id = 2
INSERT INTO [dbo].[PIMS_SECURITY_DEPOSIT_RETURN]
(
[LEASE_ID]
,[SECURITY_DEPOSIT_TYPE_CODE]
,[TERMINATION_DATE]
,[DEPOSIT_TOTAL]
,[CLAIMS_AGAINST]
,[RETURN_AMOUNT]
,[RETURN_DATE]
,[CHEQUE_NUMBER]
,[PAYEE_NAME]
,[PAYEE_ADDRESS]
,[CONCURRENCY_CONTRO... |
CREATE TABLE [dbo].[Standard_Import]
(
[StandardUId] VARCHAR(20) PRIMARY KEY,
[IfateReferenceNumber] VARCHAR(10) NOT NULL,
[LarsCode] INT NULL,
[Status] VARCHAR(100) NOT NULL,
[VersionEarliestStartDate] DATETIME NULL,
[VersionLatestStartDate] DATETIME NULL,
[VersionLatestEndDate] DATETIME NULL... |
CREATE OR REPLACE VIEW roles_overview AS
SELECT
r.app_id AS out_app_id,
r.role_id AS out_role_id,
--
r.app_id,
r.role_id,
r.role_name,
r.role_group,
r.description_,
r.is_active,
r.order#,
--
u.count_users,
--
r.updated_by,
r.updated_at
FRO... |
-- 菜单
CREATE TABLE sys_menu (
menu_id NUMBER(20, 0) NOT NULL,
parent_id NUMBER(20, 0) NOT NULL,
name varchar2(50),
url varchar2(200),
perms varchar2(500),
type NUMBER(2, 0),
icon varchar2(50),
order_num int,
PRIMARY KEY (menu_id)
);
-- 部门
CREATE TABLE sys_dept (
dept_id NUMBER(20, 0) NOT NULL,
pa... |
explain plan for select c1, c2, c3 from dfs.drillTestDir.`parquet_storage/DRILL_6174/DRILL_6174_test_data` where c2 = false and c3 is not null; |
--====================================================================================================================================
--============================================= DROP TABLE [dbo].[Customer] ==========================================================
--================================================... |
-- create database
create user '${MYSQL_USER}'@'localhost' identified by 'password';
create database if not exists ${MYSQL_DB_NAME};
grant all privileges on `${MYSQL_DB_NAME}`.* to 'myUser'@'localhost';
flush privileges;
-- create liquibase user
grant all privileges on `${MYSQL_DB_NAME}`.* to 'liquibase'@'localhost';... |
-- DROP USER LJSA CASCADE;
-- DROP TABLESPACE LJSA_DATA INCLUDING CONTENTS AND DATAFILES;
-- DROP TABLESPACE LJSA_TEMP INCLUDING CONTENTS AND DATAFILES;
-- SELECT * FROM v$version;
CREATE TABLESPACE LJSA_DATA DATAFILE '/u02/app/oracle/oradata/ORCL/LJSA_DATA.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT 512K MAXSIZE 8192M;... |
##查询
#macro($taskQuery(subjectCode,classId,calDate,classIds))
select t.* from class_statistics_report t where t.subject_code=:subjectCode
#if(classId)
AND t.class_id=:classId
#end
#if(classIds)
AND t.class_id in (:classIds)
#end
#if(calDate)
AND t.cal_date=:calDate
#end
#end
##查询知识点分析情况
#macro($getKn... |
create function fv.${query}_insert() returns void
language plpgsql
as
$$
declare
entries stream_lineitem[];
start_counter int := 1;
end_counter int := 0;
begin
select max(counter)
into end_counter
from base_lineitem;
while start_counter <= end_counter
loop
entries :=... |
CREATE SCHEMA [aspnet_Personalization_FullAccess]
AUTHORIZATION [aspnet_Personalization_FullAccess];
|
USE [master]
GO
/****** Object: Database [Multek_SZ_New] Script Date: 11/06/2014 15:47:39 ******/
CREATE DATABASE [Multek_SZ_New] ON PRIMARY
( NAME = N'Multek_SZ_New', FILENAME = N'D:\Multek_Database\Multek_SZ_New.mdf' , SIZE = 5233728KB , MAXSIZE = UNLIMITED, FILEGROWTH = 102400KB )
LOG ON
( NAME = N'Multek_S... |
DROP TABLE IF EXISTS "message";
DROP TABLE IF EXISTS "template";
DROP TABLE IF EXISTS "mailer";
DROP TABLE IF EXISTS "owner"; |
/*
Forgot that we had unique constraints on the name of the metatypes/relationships - this won't
work unless we also include the ontology version number in there.
*/
ALTER TABLE metatypes DROP CONSTRAINT metatypes_container_id_name_key;
ALTER TABLE metatype_relationships DROP CONSTRAINT metatype_relationships_... |
select Email
from Person
group by Email
having count(Email) > 1;
|
SELECT m.name FROM member m, checkout_item c
WHERE c.member_id = m.id
GROUP BY m.name
HAVING COUNT(c.member_id) >1
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.1
-- Dumped by pg_dump version 9.5.1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
... |
# Write your MySQL query statement below
select Name as Customers from Customers where Id not in
(select distinct CustomerId from Orders);
|
CREATE TABLE users
(
password TEXT NOT NULL,
username TEXT NOT NULL,
token TEXT,
CONSTRAINT username PRIMARY KEY (username)
);
CREATE TABLE files
(
id TEXT NOT NULL,
owner TEXT NOT NULL,
extension TEXT,
created integer NOT NULL DEFAULT (strftime('%s','now')),
CONSTRAINT files_pkey PR... |
DROP TABLE IF EXISTS QRTZ_TIMED_TASK;
DROP TABLE IF EXISTS QRTZ_TIMED_TASK_PARAM;
CREATE TABLE QRTZ_TIMED_TASK
(
TASK_NAME VARCHAR(200),
TASK_DESC VARCHAR(500),
TASK_EXPRES VARCHAR(100),
TASK_METHOD VARCHAR(200),
TASK_CLASS VARCHAR(200),
TASK_GROUP VARCHAR(200) DEFAULT 0,
STATUS VARCHAR(100) D... |
create table LINKS_TO_BE_PROCESSED(
link varchar(2000)
);
create table LINKS_ALREADY_PROCESSED(
link varchar(2000)
);
create table news(
id bigint primary key auto_increment,
title text,
content text,
url varchar(1000),
created_at timestamp default now(),
modified_at timestamp default n... |
-- Occupations
-- https://www.hackerrank.com/challenges/occupations/problem
SELECT
D.Name,
P.Name,
S.Name,
A.Name
FROM (
SELECT
@rownum:=@rownum+1 AS rownum,
Name
FROM (SELECT @rownum:=0) r,
Occupations
WHERE Occupation = 'Doctor'
ORDER BY Name
) AS D ... |
CREATE OR REPLACE VIEW lookup_terms AS
SELECT tt.id AS id, tt.meaning_id, tt.termlist_id, t.term
FROM termlists_terms tt
JOIN terms t ON tt.term_id = t.id AND t.deleted = false
WHERE tt.deleted = false; |
/*
SQLyog Ultimate v12.2.6 (64 bit)
MySQL - 5.7.19-0ubuntu0.16.04.1 : Database - alipay
*********************************************************************
*/
CREATE DATABASE /*!32312 IF NOT EXISTS*/`alipay` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `alipay`;
/*Table structure for table `alipay` */
DROP TAB... |
set global time_zone = '+8:00';
create database `ccsu_test`;
use ccsu_test;
create table ccsu_score_student_data(
`id` varchar(14) not null comment '学生学号',
`total_score` decimal(10,1) default '0.0' comment '综测分数',
primary key (`id`)
)engine = InnoDB default charset utf8MB4;
create table ccsu_score_event(
`... |
create table accounts (
id varchar not null PRIMARY KEY,
first_name varchar not null,
last_name varchar not null,
email varchar not null unique,
password varchar not null,
password_salt varchar,
verified boolean not null DEFAULT false,
verified_token varchar not null DEFAULT '',
two_factor_auth varcha... |
/*
* Project:Easy Web Framework
* Description:
* EasyFK stands for Easy Web Framework.It's an open source product for E-Business / E-Commerce.It
* was launched by a chinese Hezhiping(QQ:110476592) in 2015.The goal of EasyFK is to provide a
* foundation and starting point for reliable, secure , simple-to-use ,cost... |
------------------START------------------
CREATE TABLE egadtax_agency (
id bigint NOT NULL,
code character varying(50) NOT NULL,
name character varying(250) NOT NULL,
ssid character varying(50),
emailid character varying(100),
mobilenumber character varying(10) NOT NULL,
address character v... |
-- file:json.sql ln:422 expect:true
select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":[100,200,false],"x":43.2}') q
|
--ZAD9
CREATE OR REPLACE FUNCTION bilans_kont()
RETURNS TABLE (
konto numeric(11),
suma_wplat numeric(11,2),
suma_wyplat numeric(11,2)
)
AS $$
BEGIN
RETURN QUERY
SELECT nr_konta as "Konto",
COALESCE((SELECT SUM(kwota) as d FROM transakcje WHERE na_konto=nr_konta GROUP BY na_konto), 0),
COALE... |
SELECT * FROM KNOWLEDGE_EDIT_GROUPS
WHERE
GROUP_ID = ?
AND DELETE_FLAG = 0;
;
|
select p.*
from product p
join transformation_output t_out
on t_out.product = p.id
join transformation t
on t.id = t_out.transformation
left join sale_input si
on si.product = p.id
left join transformation_input ti
on ti.product = p.id
where si.sale is null and ti.transformation is null
and t.emitter = $1
and p.type !=... |
/*Listar código, nombre, continente y población de todos los países.
(Se esperan 4 columnas y 239 registros).*/
SELECT
country.Code,
country.Name,
country.Continent,
country.Population
FROM
world.country; |
CREATE OR REPLACE PACKAGE child_bonus AS FUNCTION get_child_bonus(employee IN INTEGER, x1 IN REAL, x2 IN REAL, x3 IN REAL) RETURN REAL;
PROCEDURE add_child_bonus(x1 IN REAL, x2 IN REAL, x3 IN REAL);
END child_bonus;
/
CREATE OR REPLACE PACKAGE BODY child_bonus AS
PROCEDURE add_child_bonus(x1 IN REAL, x2 IN REAL, x3 IN... |
CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%redactor2_profiles` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL DEFAULT '',
`description` varchar(255) NOT NULL DEFAULT '',
`urltype` varchar(50) NOT NULL,
`minheight` smallint(5) unsigned NOT NULL,
`maxheight` smallint(5) unsigned N... |
DELIMITER $$
CREATE TRIGGER `tr_delete_user`
BEFORE DELETE
ON `users`
FOR EACH ROW
BEGIN
IF(SELECT u.`id` FROM `users` AS u WHERE u.`id` = OLD.`id`) THEN
DELETE FROM `users_chats`
WHERE `user_id` = OLD.`id`;
DELETE FROM `messages`
WHERE `user_id` = OLD.`id`;
DELETE FROM `messages_log`
WHERE `user_id` = OLD.`id`;... |
SET QUOTED_IDENTIFIER ON
GO
DROP PROCEDURE IF EXISTS test_regression_models
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [test_regression_models] @connect... |
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
select
distinct
(SELECT text FROM sys.dm_exec_sql_text(sql_handle)) as txt,
request_session_id as spid,
(SELECT count(*) FROM sys.sysprocesses with(nolock) WHERE blocked = request_session_id) as blocked_process_cnt
from
sys.dm_tran_locks with(noloc... |
-- 206 Distribution of age by visit_concept_id
--insert into @results_schema.heracles_results_dist (cohort_definition_id, analysis_id, stratum_1, stratum_2, count_value, min_value, max_value, avg_value, stdev_value, median_value, p10_value, p25_value, p75_value, p90_value)
select vo1.cohort_definition_id,
vo1.subj... |
SELECT id, boardId, color, title
FROM main.Categories
WHERE boardId = :boardId |
-- agg by author
-- not very useful because tends to just mimic the top publishing users
select author, count(*) as c from (
select distinct second as package from npm_edit_distances e
where e.distance < 2
union all
select distinct first from npm_edit_distances e
where e.distance < 2
) pAll
inner join npm_authors ... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.15
-- Dumped by pg_dump version 9.6.16
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '',... |
CREATE TABLE IF NOT EXISTS statistics (
ID INT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
name varchar(20) UNIQUE NOT NULL,
count INT NOT NULL DEFAULT 0
)
|
/* Replace with your SQL commands */
delete from
crm_v2.document_roles dr
using crm_v2.roles r
where dr.role_id=r.role_id and r.name='billing';
|
-- =============================================
-- Mapping NULL values into numbers
-- =============================================
EXEC UpdateNullValues
EXEC GetColumnsWithNullValues |
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 3.9.0 or higher.
--
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '... |
----------------------------------------------------------------
-- [vds_spm_id_map] Table
--
Create or replace FUNCTION Insertvds_spm_id_map(v_storage_pool_id UUID,
v_vds_id UUID,
v_vds_spm_id INTEGER)
RETURNS VOID
AS $procedure$
BEGIN
INSERT INTO vds_spm_id_map(storage_pool_id, vds_id, vds_spm_id)
VA... |
/*
* Business Process Definition: Project Approval (project_approval_wf)
* Auto-generated by ACS Workflow Export, version 4.3
*/
/*
* Cases table
*/
create table project_approval_wf_cases (
case_id integer primary key
references wf_cases on delete cascade
);
/*
* Declare the object type
*/
create funct... |
--
-- This script performs initial setup of the database.
--
CREATE TABLE User
(
user_id INT AUTO_INCREMENT NOT NULL,
username VARCHAR(32) NOT NULL,
password BINARY(60) NOT NULL,
wins INT DEFAULT 0 NOT NULL,
losses INT DEFAULT 0 NOT NULL,
CONSTRAINT User_pk
PRIMARY KEY (user_id)
);
CREA... |
-- ########## TIME STATIC TESTS ##########
\set ON_ERROR_ROLLBACK 1
\set ON_ERROR_STOP true
BEGIN;
SELECT set_config('search_path','partman, public',false);
SELECT plan(128);
CREATE SCHEMA partman_test;
CREATE ROLE partman_basic;
CREATE ROLE partman_revoke;
CREATE ROLE partman_owner;
CREATE TABLE partman_test.time_... |
CREATE TABLE IF NOT EXISTS `SES_NOTIFICATIONS` (
`ID` BIGINT NOT NULL,
`CREATED_ON` TIMESTAMP(3) NOT NULL,
`INSTANCE_NUMBER` INT NOT NULL,
`SES_MESSAGE_ID` VARCHAR(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
`SES_FEEDBACK_ID` VARCHAR(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT... |
--
-- Table structure for table `gliders`
--
DROP TABLE IF EXISTS `gliders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gliders` (
`glider_id` int(11) NOT NULL AUTO_INCREMENT,
`callsign` char(32) NOT NULL,
PRIMARY KEY (`glider_id`)
) ... |
-- current titles on sale, ordered by discount; additional filtering may be added to narrow down currency and region
SELECT gpr_id, gpr_product_title, gpr_country_code, gpr_currency, gpr_base_price, gpr_final_price,
CAST(ROUND((gpr_base_price - gpr_final_price) * 100 / gpr_base_price) AS INTEGER) AS gpr_discount_perce... |
SELECT TR_UID AS [UID], TR_InDate [Task In],TR_Productivity AS [Productivity]
FROM tbl_TaskRecordDetail
INNER JOIN [NTLILO].[dbo].[LILO] LILO ON
WHERE TR_Apporval = 2 AND TR_Productivity> 150 AND TR_PIC = 'ZDQ' AND
TR_InDate BETWEEN '01-01-2018 00:00:00' AND '11-01-2018 23:59:59' ORDER BY TR_UID desc
-----/-----... |
DROP TABLE user;
DROP TABLE event;
DROP TABLE organization;
DROP TABLE event_user_junction;
CREATE TABLE user (
username character(100),
name character(100),
points integer,
location character(1000),
constraint user_pkey PRIMARY KEY (username)
);
CREATE TABLE event (
location character(1000),
num_people intege... |
-- @testpoint:opengauss关键字Lc_Ctype(非保留),作为数据库名
--关键字不带引号-成功
drop database if exists Lc_Ctype;
create database Lc_Ctype;
drop database Lc_Ctype;
--关键字带双引号-成功
drop database if exists "Lc_Ctype";
create database "Lc_Ctype";
drop database "Lc_Ctype";
--关键字带单引号-合理报错
drop database if exists 'Lc_Ctype';
create database 'L... |
-- @testpoint:openGauss关键字duplicate(非保留),同时作为表名和列名带引号,并进行dml操作,duplicate列的值最终显示为1000
drop table if exists "duplicate";
create table "duplicate"(
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 num... |
-- MySQL dump 10.13 Distrib 5.7.19, for Linux (x86_64)
--
-- Host: localhost Database: javavirtual
-- ------------------------------------------------------
-- Server version 5.7.19-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTE... |
---------------------------------------------------------------------------------------------
----------------------------------USING WHEN CLAUSE ON TRIGGERS------------------------------
---------------------------------------------------------------------------------------------
create or replace trigger prevent_h... |
DROP DATABASE IF EXISTS burgers_db;
CREATE DATABASE burgers_db;
USE burgers_db;
DROP TABLE IF EXISTS burgers;
CREATE TABLE burgers (
id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY,
burger_name VARCHAR (50),
devoured BOOLEAN
); |
/* Replace with your SQL commands */
alter table water.billing_volumes
drop constraint uniq_charge_element_id_financial_year;
alter table water.billing_volumes
add constraint uniq_charge_element_id_financial_year_season unique (charge_element_id, financial_year, is_summer); |
--
-- Copyright 2005-2013 The Kuali Foundation
--
-- Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
--
-- Unless required by ap... |
# Select info about users with max salary in each company
# Subquery is used due to enabled only_full_group_by.
# In case only_full_group_by is disabled -
# current query can be shorter and only unique users can be shown
# In case more than 1 user has same max salary - all these users will be shown
Select e.sJo... |
CREATE TABLE `tb_bbvvzzczcw` (
`col_ruygkecjzp` longblob,
`col_orycjbfrss` year(4) DEFAULT '2019',
`col_aqqnunnega` varbinary(225) DEFAULT NULL,
`col_pxwauaruqw` enum('enum_or_set_0','enum_or_set_1','enum_or_set_2') DEFAULT 'enum_or_set_0',
UNIQUE KEY `col_ruygkecjzp` (`col_ruygkecjzp`(14),`col_orycjbfrss`)
)... |
--
-- YB_FEATURE Testsuite: CREATE LANGUAGE
--
DROP EXTENSION plpgsql CASCADE;
CREATE LANGUAGE plpgsql;
CREATE FUNCTION test() RETURNS INTEGER AS $$begin return 1; end$$ LANGUAGE plpgsql;
SELECT * FROM test();
DROP LANGUAGE plpgsql CASCADE;
-- leave the cluster in a clean state
CREATE EXTENSION plpgsql;
|
IF $(OneTimeLoad) = 1
BEGIN
DECLARE @Section TABLE
(
SectionKey INT NOT NULL PRIMARY KEY,
PartKey INT NOT NULL,
ParentSectionKey INT NULL,
SectionName NVARCHAR(250) NOT NULL,
PageReference NVARCHAR(50) NULL,
DisplayOrder FLOAT NOT NULL,
SectionSlug VARCHA... |
-- Create tables for our ingredients and favorite recipes, plus the cache tables to save our results
CREATE TABLE IF NOT EXISTS favoriterecipes(
favoriterecipe_id VARCHAR(32) PRIMARY KEY,
title VARCHAR(256),
image_url VARCHAR(256),
directions_url VARCHAR(256),
source_title VARCHAR(256),
calo... |
USE employee_db;
INSERT INTO department
(name)
VALUES
('Sales'),
('Engineering'),
('Finance'),
('Legal');
INSERT INTO role
(title, salary, department_id)
VALUES
('Salesperson',100, 1),
('Software Engineer', 900, 2),
('Accountant', 300, 3),
('Lawyer', 600, 4);
INSERT INTO empl... |
IF OBJECT_ID(N'tempdb..#DropLegacyObjects') IS NOT NULL DROP PROCEDURE #DropLegacyObjects;
GO
CREATE PROCEDURE #DropLegacyObjects
(
@ObjectName NVARCHAR(128),
@ObjectType CHAR(2)
)
AS
BEGIN
DECLARE @DDLType NVARCHAR(128)
IF EXISTS
(
SELECT
*
FROM
sys.objects o
INNER JOIN sys.schemas s
ON o.[s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.