text stringlengths 6 9.38M |
|---|
delete from "EOC"."EO_O_GTFETREATY"; |
select campaign_id, email_id, action_date as clicked_date
from {{env.schema}}.mailchimp_email_actions
where action = 'click' |
SELECT * FROM dept |
CREATE TABLE TIPO_ASENTAMIENTO(
ID_TIPO_ASENTAMIENTO NUMBER(3) PRIMARY KEY,
DESCRIPCION VARCHAR(50)
);
CREATE TABLE PAIS(
ID_PAIS NUMBER(4) PRIMARY KEY,
NOMBRE VARCHAR(100)
);
CREATE TABLE ESTADO(
ID_ESTADO NUMBER(3),
ID_PAIS NUMBER(4),
NOMBRE VARCHAR(100),
PRIMARY KEY (ID_ESTADO, ID_PAIS),
... |
SELECT geo_events.eventTime, geo_events.event_time, 'joined_stream' as eventSource,
geo_events.truckId , geo_events.driverId , geo_events.driverName,
speed_events.speed, geo_events.routeId, geo_events.route,
geo_events.eventType , geo_events.latitude , geo_events.longitude,
geo_events.correlationId... |
CREATE TABLE rv.h_WeatherObservatoryLocation (
WeatherObservatoryLocationHashKey CHAR(32) NOT NULL
, LoadDate DATETIME2 NOT NULL
, RecordSource VARCHAR(500) NOT NULL
, LocationID INT NOT NULL
, CONSTRAINT [PK_h_WeatherObservatoryLocation] PRIMARY KEY NONCLUSTERED
(
WeatherObservatoryLocationHashKey A... |
create or replace view v1_zf005_fname as
select jsde317 ,'C'||a.DE194||'02'||to_char(de001,'yyyymmdd') || a.de151 ||'.TXT' as FILENAME
from zf005 a
--where a.hdde212 = 80
order by a.de194 ,a.de151;
|
USE sakila;
-- 1. Na tabela sakila.film, monte uma query que exiba o título e o ano de lançamento dos filmes em uma coluna e dê a ela o nome Lançamento do Filme.
SELECT CONCAT(title, ' ', release_year) AS 'Lançamento do Filme' FROM film;
-- 2. Na tabela sakila.film, crie uma query que exiba o título do filme e sua cla... |
-- Create sequence
create sequence seq_cargo_tracking_id
minvalue 1
maxvalue 99999999
start with 1
increment by 1
cache 20;
--//@UNDO
drop sequence seq_cargo_tracking_id;
|
select
s.node_name
,s.user_name
,s.client_hostname
,s.transaction_start
,s.statement_start
,qp.query
,qp.query_duration_us
from sessions s join query_profiles qp on (qp.statement_id = s.statement_id)
where qp.query_duration_us > 1946533
order by qp.query_duration_us desc ; |
ALTER TABLE `users`
ADD INDEX `grooup_user_idx` (`group` ASC) VISIBLE;
;
ALTER TABLE `users`
ADD CONSTRAINT `grooup_user`
FOREIGN KEY (`group`)
REFERENCES `group` (`id`)
ON DELETE SET NULL
ON UPDATE SET NULL;
;
ALTER TABLE `group_to_permission`
ADD INDEX `permission_idx` (`permission` ASC) VISIBLE;
;
ALTER TABL... |
CREATE procedure sp_acc_GetDefaultDocType(@Username nVarchar(100),@TranNumber int)
As
Select Top 1 DocumentType from TransactionDocNumber,DocumentUsers
Where DocumentUsers.UserName = @UserName
And TransactionDocNumber.SerialNo = DocumentUsers.SerialNo
And TransactionDocNumber.TransactionType = @TranNumber
A... |
CREATE PROCEDURE sp_list_Claims_Cancel (@VENDORID NVARCHAR(15), @FROMDATE DATETIME,
@TODATE DATETIME)
AS
SELECT ClaimID, ClaimDate, ClaimsNote.VendorID, Vendors.Vendor_Name, DocumentID,
Case Balance When 0 Then Status | 128 Else Status End, Balance, ClaimValue
FROM ClaimsNote, Vendors
WHERE ClaimsNote.VendorID LIK... |
/*
STATUS SID NAME PROGRAM CPU WAITING IO TOTAL
------------ ----- ------------ ------------------------- ----- ---------- ----- ------
CONNECTED 165 SYS ORACLE.EXE (CKPT) 232 173 0 405
DISCONNECTED 158 SYS ORACLE.EXE (J003) ... |
SELECT avg(total_duration) AS average_total_duration
FROM
(SELECT cohorts.name, SUM(assistance_requests.completed_at - assistance_requests.started_at) AS total_duration
FROM cohorts
JOIN students ON cohorts.id = cohort_id
JOIN assistance_requests ON students.id = student_id
GROUP BY cohor... |
select meta_id_source, count(meta_id_target) as citations from matches group by meta_id_source; |
CREATE DATABASE IF NOT EXISTS flim;
USE flim;
CREATE TABLE IF NOT EXISTS users
(
`userid` int(11) NOT NULL AUTO_INCREMENT,
`username` char(20) NOT NULL,
`hashed_pwd` char(64) NOT NULL,
`salt` char(8) NOT NULL,
`email` varchar(254) DEFAULT NULL,
`location` char(30) DEFAULT NULL,
`nickname` char(40) NOT NU... |
--Using SQL query create table Users with columns:
--• Id – unique number for every user. There will be no more than 2^63-1 users. (Auto incremented)
--• Username – unique identifier of the user will be no more than 30 characters (non Unicode). (Required)
--• Password – password will be no longer than 26 characters (no... |
CREATE USER 'geschaeftsfuehrer'@'localhost' IDENTIFIED BY 'password1';
GRANT SELECT ON musterag.* TO 'geschaeftsfuehrer'@'localhost';
CREATE USER 'abteilungsleiter1'@'localhost' IDENTIFIED BY 'password2';
GRANT SELECT ON musterag.pod TO 'abteilungsleiter1'@'localhost';
GRANT INSERT ON musterag.pod TO 'abteilungsleite... |
CREATE Procedure spr_list_Customerwise_Pricing_Detail (@QuotationID int,
@ProductHierarchy nVarchar(255),
@Category nVarchar(2550))
As
Create Table #tempCategory(CategoryID int, Status int)
Exec dbo.GetLeafCategories @ProductHierarchy, @Category
Select Distinct CategoryID InTo #temp From... |
-- MySQL Script generated by MySQL Workbench
-- Thu Dec 20 12:09:24 2018
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
-- -----------------------------------------------------
-- Schema sharik_db
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `... |
drop table if exists user;
CREATE TABLE `user` (
`id` bigint(20) DEFAULT NULL,
`username` varchar(100) DEFAULT NULL,
`email` varchar(200) DEFAULT NULL,
`age` int(20) DEFAULT NULL,
`town_code` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
use notes_db;
CREATE TABLE `User` (
`User_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`Email` varchar(50) NOT NULL UNIQUE,
`Password` varchar(50) DEFAULT NULL,
Create_Time Date,
Last_Update_Time Date,
PRIMARY KEY (`User_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE... |
-- supp-db-info.sql
-- show supplemental logging info for the database
@clears
set linesize 200 trimspool on
col supplemental_log_data_all format a6 head 'SUPP|ALL'
col supplemental_log_data_fk format a6 head 'SUPP|FK'
col supplemental_log_data_min format a6 head 'SUPP|MIN'
col supplemental_log_data_pk format a6 he... |
/*
Name: Top Location Search Reverse
Data source: 4
Created By: Admin
Last Update At: 2016-02-17T20:05:15.908081+00:00
*/
SELECT REPLACE(REPLACE(REGEXP_EXTRACT(PAGE_URL, r'formatted_address%5D=([^&]*)'),'+',' '),'%2C',',') AS formatted_address,
count(*) AS Amount
FROM (TABLE_QUERY(djomniture:cipomniture_djmansio... |
-- AOO085 이체유형코드
-- 수납유형코드
SELECT *
FROM GUSER.GBCT_COMM_CD_DESC Z
WHERE Z.CD_KIND_NO = 'R00012' /* R00012 */
-- AND Z.CD_DESC_NO =... |
-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Máquina: localhost
-- Data de Criação: 25-Nov-2014 às 22:41
-- Versão do servidor: 5.5.34
-- versão do PHP: 5.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... |
create or replace schema "sessionagg";
!set force on
alter pump "sessionagg".* stop;
drop schema "sessionagg" cascade;
!set force off
create or replace schema "sessionagg";
set schema '"sessionagg"';
set path '"sessionagg"';
create or replace foreign stream "test_fs"
( "eventtime" varchar(20)
, "sessionId" bigint
,... |
DROP VIEW IF EXISTS "FilmRatingDto";
create view "FilmRatingDto"
as
select
fr."Id"
, lf."Id" as "LocationFilmDtoId"
, "Source" as "RatingSource"
, "Url" as "FilmUrl"
, "Rating"
from "LocationFilm" lf
join "FilmRating" fr on fr."FilmId" = lf."FilmId"
|
# --- !Ups
CREATE TABLE allowed_ips (ip VARCHAR(30) primary key);
INSERT INTO allowed_ips (ip) VALUES('127.0.0.1');
# --- !Downs
DROP TABLE allowed_ips;
|
#DROP TABLE IF EXISTS `mkt_pledge_detail`;
CREATE TABLE `mkt_pledge_detail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ts_code` varchar(20) NOT NULL COMMENT 'TS代码',
`ann_date` char(8) NOT NULL COMMENT '截至日期',
`holder_name` varchar(300) DEFAULT NULL COMMENT '股东名称',
`pledge_amount` float DEFAULT NULL COMMENT '质押... |
CREATE column TABLE EOC.EO_O_GTFEPeriod (
PeriodGuid VARCHAR (22),
DeleteFlag SMALLINT NOT NULL,
CreateDate DATETIME NOT NULL,
CreateUser NVARCHAR (32) NOT NULL,
ModifyDate DATETIME NOT NULL,
ModifyUser NVARCHAR (32... |
Create Procedure [SP_DayCloseModules]
AS
BEGIN
select Module,DayCloseDate,Priority from DayCloseModules ORder by 3
End
|
create database lab8_1;
CREATE TABLE departments(
departments_id serial
);
CREATE TABLE employees(
departments_id serial
);
create index country_name on counts(name);
CREATE INDEX country_name ON countries(name);
CREATE INDEX employee_ns ON employees(name,surname);
CREATE UNIQUE INDEX salary_comp ON employe... |
-- MySQL dump 10.13 Distrib 5.1.63, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: disorder
-- ------------------------------------------------------
-- Server version 5.1.63-0ubuntu0.10.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@... |
DELETE FROM `callbacks`
WHERE `id` = ? AND `user` = ?; |
-- create temporary index
CREATE INDEX tmp_ad_wf_activity_speed ON ad_wf_activity(ad_table_id, record_id);
-- ****** SET ProcessedOn on table C_AllocationHdr ******
-- try to get the processed from ad_changelog
update C_AllocationHdr set processedon =
(select max(EXTRACT(EPOCH FROM updated)*1000) from ad_chang... |
create schema if not exists snooper;
use snooper;
create table if not exists users (
id varchar(255) primary key not null,
name varchar(70) not null,
photo_url varchar(255)
);
create table if not exists mes... |
CREATE DATABASE WMS
USE WMS
--01
CREATE TABLE Clients
(
ClientId INT PRIMARY KEY IDENTITY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
Phone CHAR(12)
)
CREATE TABLE Mechanics
(
MechanicId INT PRIMARY KEY IDENTITY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
[Address] VARCHAR(... |
create database ngan_hang;
create table ngan_hang.Customers(
customer_number int(11) not null,
fullname varchar(50) not null,
address varchar(220) not null,
email varchar(50),
phone int (10) not null,
primary key(customer_number));
create table ngan_hang.accounts(
account_number int (11) not null,
account_type varchar(... |
CREATE Procedure sp_Get_SCItemsUnAvailable(@SchID int)
as
select "Type"=1, special_Cat_Product_Rec.product_code
from Special_Cat_Product_Rec, Special_category_Rec
where Special_Category_Rec.Special_Cat_Code = Special_cat_Product_Rec.Special_Cat_Code
and special_Cat_Product_Rec.product_code not in (se... |
-- Update for 2015-05-04
-- > Remove the foreign on service_id in task_coc_info table
USE `baiken_fwm_1`;
ALTER TABLE `task_coc_info`
MODIFY COLUMN `service_id` int(11) NULL COMMENT 'Lab ID number'; |
CREATE TABLE USERS (
USERNAME VARCHAR(50) NOT NULL PRIMARY KEY,
PASSWORD VARCHAR(50) NOT NULL,
ENABLED BOOLEAN NOT NULL
);
CREATE TABLE AUTHORITIES (
USERNAME VARCHAR(50) NOT NULL,
AUTHORITY VARCHAR(50) NOT NULL,
CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY (USERNAME) REFERENCES USERS... |
USE TelerikAcademy
SELECT Name FROM Departments |
alter table integra_cad_socio alter column complemento type varchar(100);
alter table integra_cad_grafica alter column complemento type varchar(100);
alter table integra_cad_empresa alter column complemento type varchar(100);
alter table integra_cad_escritorio alter column complemento type varchar(100);
... |
SELECT model, speed, hd
FROM PC
WHERE price < 600 AND (cd='12x' or cd='24x');
|
/* Создание таблицы билетов */
CREATE TABLE /*PREFIX*/TICKETS
(
TICKET_ID VARCHAR(32) NOT NULL,
DEALER_ID VARCHAR(32),
TIRAGE_ID VARCHAR(32) NOT NULL,
SERIES VARCHAR(3) NOT NULL,
NUM VARCHAR(8) NOT NULL,
USED INTEGER NOT NULL,
SURNAME VARCHAR(100),
NAME VARCHAR(100),
PATRONYMIC VARCHAR(100),
ADDRES... |
CREATE TABLE JOBOFFER (
ID INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
MINSKILL INTEGER,
DESCRIPTION VARCHAR(30),
REWARD INTEGER,
POSSIBLEGLORY BOOLEAN
); |
CREATE TABLE publisher(
id integer PRIMARY KEY,
name text,country text);
CREATE TABLE books(
id integer PRIMARY KEY,
title text,
publisher integer,
FOREIGN KEY(publisher) REFERENCES publisher(id));
CREATE TABLE subjects(id integer PRIMARY KEY,
name text);
CREATE TABLE books_subjects(
book integer REFERENCES books(... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: capstone
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.19-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... |
CREATE TABLE IF NOT EXISTS authorities (
id serial primary key,
authority VARCHAR(50) NOT NULL
);
CREATE TABLE IF NOT EXISTS users (
id serial primary key,
authority_id int not null references authorities(id),
enabled boolean default true,
password VARCHAR(100) NOT NULL,
username VARCHAR(50) NOT NULL
);
... |
SELECT
pc.sku_config,
pc.sale_price,
-- pc.sale_price,
"yay" as nothing,
pc.gross_cost * (1 - pc.vat_in) as net_cost,
case
when pc.is_private_label then "PL"
when pc.is_crossdocking then "XDOC"
when 1+1=3 then "ERRO!"
when 1+1=4 then concat("AINDA MAIS", " ERRO! ", "CASE WHEN ERRADO!!!")
else "BR"
e... |
-- 修改日期:20120910
-- 修改人:吴生火
--修改内容:奥克斯网上银行修改
declare
max_id_cs20120910 number;
max_id_cs20120910_id number;
max_id_cs20120910_1 number;
begin
select FUNCTION_ID into max_id_cs20120910 from bt_function where FUNCTION_IDEN='w_net_chalk';
select count(*) into max_id_cs20120910_id from bt_function where UPPER... |
DROP TABLE funding_user CASCADE CONSTRAINTS;
DROP TABLE subs_userInfo CASCADE CONSTRAINTS;
DROP TABLE movie_genre CASCADE CONSTRAINTS;
DROP TABLE fundingDetail CASCADE CONSTRAINTS;
DROP TABLE fundingList CASCADE CONSTRAINTS;
DROP TABLE funding CASCADE CONSTRAINTS;
DROP TABLE movieDetail CASCADE CONSTRAINTS;
DROP TABLE ... |
UPDATE `bdCinema`.`ticket`
SET
`usuario_idUsuario` = <{usuario_idUsuario: }>,
`assento_sala_idAssento` = <{assento_sala_idAssento: }>,
`reserva` = <{reserva: }>,
`valor` = <{valor: }>
WHERE <{where_expression}>;
|
--
-- PostgreSQL database dump
--
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;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpg... |
CREATE TABLE `customer_address` (
`customer_address_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(10) unsigned NOT NULL,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`street_1` varchar(255) NOT NULL,
`street_2` varchar(255) DEFAULT NULL,
`postcode` varchar(255) NU... |
-- users --
CREATE TABLE `users` (
`id` int(11) NOT NULL COMMENT 'ID for user',
`first_name` varchar(25) DEFAULT NULL COMMENT 'first name of user',
`last_name` varchar(25) DEFAULT NULL COMMENT 'last name of user',
`username` varchar(100) DEFAULT NULL COMMENT 'username of user',
`email` varchar(100) DEFAULT N... |
DROP TABLE freq_item;
CREATE TABLE freq_item(
id INTEGER REFERENCES users,
item_name VARCHAR(100) NOT NULL,
description VARCHAR(500),
last_purchase_date DATE NOT NULL DEFAULT GETDATE());
SELECT * FROM freq_item;
DELETE FROM freq_item WHERE item_name LIKE '';
INSERT INTO freq_item VALUES(1, 'Strawberry', 'red', '3/12... |
ALTER TABLE registro_pagos ADD no_factura varchar(255);
|
SELECT cohorts.name as cohort_name, count(assignment_submissions.*) as total_submissions
FROM cohorts
JOIN students ON students.cohort_id = cohorts.id
JOIN assignment_submissions ON assignment_submissions.student_id = students.id
GROUP BY cohorts.name
ORDER BY count(assignment_submissions.*) DESC; |
# MySQL-Front 5.1 (Build 1.5)
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
/*!40101 SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
/*!40103 SET SQL_NOTES='ON' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=... |
/*
How to remove all shared drafts and start with a clean state using Collaborative Editing
Purpose: Important Definitions
To understand more about this KB, the following definitions are necessary:
CE: Collaborative Editing.
Personal draft: a draft that is visible only by its creator and was saved while C... |
CREATE PROCEDURE spr_get_total_bookstock(@PRODUCT_CODE nvarchar(15),
@VanDocID integer=0)
AS
if(@VanDocID=0)
Begin
SELECT SUM(Quantity) FROM Batch_Products
WHERE Product_Code = @PRODUCT_CODE AND
(Expiry IS NULL OR Expiry >= GetDate()) AND
ISNULL(Damage, 0) = 0
End
Else
Begin
Select SUM(... |
-- Insert data in to a table
INSERT INTO 'suppliers'
(supplier_id, supplier_name)
VALUES (24553, 'IBM');
-- Sign a user up to a site
INSERT INTO 'users'
(email, first_name, last_name, sign_up_date)
VALUES ('stew@rtmatheson.com', 'Stewart', 'Matheson', NOW()); |
-- phpMyAdmin SQL Dump
-- version 4.4.15.10
-- https://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 04, 2020 at 02:22 PM
-- Server version: 5.6.48-log
-- PHP Version: 7.3.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
-- ----------------------------------------------------------------------------------------------------
-- TABLE: destinations
-- ----------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS destinations;
CREATE TABLE destinations (
tenantId integer NOT NUL... |
-- AlterTable
ALTER TABLE "Comments" ALTER COLUMN "published" SET DEFAULT true;
|
CREATE DATABASE proxy;
USE proxy;
CREATE TABLE proxies
(
proxy_port varchar(64),
passwd varchar(64),
PRIMARY KEY ( proxy_port )
);
grant all privileges on proxy.* to wx@localhost identified by 'bihu24h';
desc proxies;
|
select Department, Employee, Salary
from
(
select Department, Employee, Salary,
@cur_rank := IF(@pre_dep = Department, @cur_rank + IF(@pre_salary = Salary, 0, 1), 1) as rank,
@pre_dep := Department,
@pre_salary := Salary
from (select @cur_rank := 0) r, (select @pre_dep := null) d, (select @pre_sala... |
-- 修复玩家建筑升级队列卡死的bug脚本 --
DROP PROCEDURE IF EXISTS test;
DELIMITER //
-- 创建存储过程 --
CREATE PROCEDURE test()
BEGIN -- 开始存储过程
declare i int;
set i = 1;
while i < 1000000 do
insert into testB (id,number) values (i,1000000-i);
set i = i +1;wk
end while;
END; -- 结束存储过程
//
DELIMITER ;
-- 调用存储过程 --
CALL test();
|
-- * Create the `burgers_db`.
-- Drops the burgers_db if it exists currently --
DROP DATABASE IF EXISTS burgers_db;
-- Creates the burgers_db database --
CREATE DATABASE burgers_db;
-- * Switch to or use the `burgers_db`.
-- Makes it so all of the following code will affect burgers_db --
USE burgers_db;
-- * Cr... |
--修改日期:20121130
--修改人lishc
--修改内容:表外记账 改名字
-- Add/modify columns
update bt_sys bsy set bsy.sys_name='表外账务',bsy.rmk='表外账务' where bsy.sys_name='表外帐务';
commit
/ |
/* Создание таблицы статусов */
CREATE TABLE /*PREFIX*/STATUSES
(
STATUS_ID VARCHAR(32) NOT NULL,
NAME VARCHAR(100) NOT NULL,
DESCRIPTION VARCHAR(250),
TABLE_NAME VARCHAR(100) NOT NULL,
CONDITION VARCHAR(250),
PRIORITY INTEGER NOT NULL,
PRIMARY KEY (STATUS_ID)
)
--
/* Создание просмотра таблицы статусо... |
INSERT INTO ems_accident_info (id,pid,NAME,SORT,notes,updatetime) VALUES(1,-1,'事故灾难',1,'',SYSDATE);
INSERT INTO ems_accident_info (id,pid,NAME,SORT,notes,updatetime) VALUES(2,-1,'煤矿事故',2,'',SYSDATE);
INSERT INTO ems_accident_info (id,pid,NAME,SORT,notes,updatetime) VALUES(3,2,'事故灾难',1,'',SYSDATE);
INSERT INTO ems_... |
--可以创建 非 read-only procedure
ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'SYSTEM') SET ('repository','sqlscript_mode') = 'UNSECURE'
WITH RECONFIGURE;
--打开XSENGINE debug
ALTER SYSTEM ALTER CONFIGURATION ('xsengine.ini', 'SYSTEM') SET ('httpserver','developer_mode') = 'true'
WITH RECONFIGURE;
ALTER SYSTEM AL... |
CREATE TABLE IF NOT EXISTS cd_profiles
(
id character varying,
name character varying,
user_id character varying,
alias character varying,
dob timestamp with time zone,
"country" json,
city json,
private boolean,
place json,
gender character varying,
address character varying,
last_edited timest... |
SELECT *
FROM employees
WHERE
hire_date = (select max(hire_date) from employees);
SELECT *
FROM employees
ORDER BY hire_date DESC LIMIT 1; |
CREATE TABLE `image` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`parent` BIGINT NULL,
`userId` BIGINT NOT NULL,
`albumId` BIGINT NOT NULL,
`extension` CHAR(5) NOT NULL,
`initialName` CHAR(40) NULL,
`imageName` CHAR(2) NULL,
`path` CHAR(100) NULL,
`height` INT NOT NULL,
`width` INT NOT NULL,
`imageType... |
/*Redenumeste coloana 'data_angajrii' in 'data_angajarii' din tabela *_angajati*/
ALTER TABLE LH_ANGAJATI
RENAME COLUMN DATA_ANGAJRII TO DATA_ANGAJARII;
|
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.6.43)
# Database: kakaobot
# Generation Time: 2019-03-29 12:03:33 +0000
# **********************************************... |
--문제1.
select first_name,
manager_id,
commission_pct
from employees
where manager_id is not null
and commission_pct is null
and salary > 3000;
--문제2.
select employee_id 직원번호,
first_name 이름,
salary 급여,
to_char(hire_date, 'YYYY-MM-DD') 입사일,
replace(phone... |
/*
产品资料-成交总额
*/
delimiter $
drop procedure if exists Proc_Items_SumTotalTotalTurnover $
create procedure Proc_Items_SumTotalTotalTurnover(sItemNo varchar(255))
begin
Update Items set TotalTurnover = (Select Sum(ifnull(ConvertUSD,0)) as ConvertUSD from SalesOrdersline where ItemNo=sItemNo) Where ItemNo=sItemNo;
en... |
/*
Navicat Premium Data Transfer
Source Server : OVH-NVME-R1-DS
Source Server Type : MySQL
Source Server Version : 80022
Source Schema : short
Target Server Type : MySQL
Target Server Version : 80022
File Encoding : 65001
Date: 20/12/2020 01:04:25
*/
SET NAMES utf8mb4;
SET FOR... |
CREATE DATABASE `posts`;
USE posts; |
-- CREATE DATABASE IF NOT EXISTS ydgps DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
-- 集团用户信息表
CREATE TABLE GROUP_USER_INFO (
id bigint(20) not null auto_increment comment '用户ID',
name varchar(30) not null comment '管理员登录名',
realName varchar(30) comment '真实姓名',
mobile varchar(11) comment '联系电话',
... |
select * from DBA_SCHEDULER_CHAIN_RULES;
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Author: ifpb
* Created: 19/07/2018
*/
INSERT INTO contato (nome, email, telefone, datanascimento) VALUES ('Caio', 'caio@gmai... |
/* Создание таблицы сессий */
CREATE TABLE /*PREFIX*/SESSIONS
(
SESSION_ID VARCHAR2(32) NOT NULL,
ACCOUNT_ID VARCHAR2(32) NOT NULL,
APPLICATION_ID VARCHAR2(32) NOT NULL,
DATE_CREATE DATE NOT NULL,
DATE_CHANGE DATE NOT NULL,
PARAMS BLOB,
PRIMARY KEY (SESSION_ID),
FOREIGN KEY (ACCOUNT_ID) REFERENCES ACCO... |
INSERT INTO skyggesak(id, fk_fagsak_id)
select nextval('skyggesak_seq'), id
from fagsak
where arkivert = false
AND status in ('LØPENDE', 'OPPRETTET'); |
-- Consulta geral
SELECT r.codigo as "Cód. Rec.", r.nome as "Nome Receita",
i.nome as "Nome Ingrediente",
ri.quantidade as "Qtd.", ri.unidade as "Unidade"
FROM Receita r
INNER JOIN ReceitaIngrediente ri ON ri.codigo_receita = r.codigo
INNER JOIN Ingrediente i ON ri.codigo_ingrediente = i.codigo
-- Consulta... |
--- URI Online Judge SQL
--- Copyright URI Online Judge
--- www.urionlinejudge.com.br
--- Problem 2603
SELECT customers.name, customers.street FROM customers WHERE customers.city = 'Porto Alegre';
|
Create Procedure Sp_Ser_LoadJobNameInfo(@Jobid nvarchar(50),@Jobname nvarchar(255))
as
select jobid,taskmaster.taskid,[Description] from job_tasks,taskmaster
where job_tasks.jobid = @jobId
and taskmaster.taskid = job_tasks.taskid
|
-- tids
--
-- TIDs represent a physical network element.
CREATE TABLE tids (
id NUMBER NOT NULL PRIMARY KEY, -- Primary Key comes from tid_id_seq
name VARCHAR2(17) NOT NULL, -- TID name
ipaddress VARCHAR2(16) NOT NULL, -- IP Address of the element
flag NUMBER(1) NOT NULL, -- Stat... |
-- Output the facility id that has the highest number of slots booked. For bonus points, try a version without a LIMIT clause. This version will probably look messy!
select facid, sum(slots) as "Total Slots"
from cd.bookings
gorup by facid
order by sum(slots) desc
limit 1;
-- CTE Common Table Expressions. CTEs can b... |
CREATE PROCEDURE sp_Cancel_Bills_DocLU (@FromDocID int, @ToDocID int,@DocumentRef nvarchar(510)=N'')
AS
If Len(@DocumentRef)=0
Begin
SELECT BillAbstract.VendorID, Vendors.Vendor_Name, BillID, BillDate,
Value +AdjustmentAmount + TaxAmount, Status, BillReference, DocumentID,
BillAbstract.Balance,DocSerialType,DocID... |
-- drop table messages if exists ;
CREATE TABLE IF NOT EXISTS messages (id bigint generated by default as identity (start with 1), message VARCHAR(100));
-- INSERT INTO messages(message) VALUES ('Message') |
use automotriz;
-- TERCERA ETAPA
-- 8) dada la información de un pedido en
-- particular, se generan los automóviles con la patente asignada al azar
DELIMITER $$
create procedure generarAutomoviles(in _id_modelo int,in id_pedido int, in _cantidad int)begin
declare i int default 0;
declare _nro_chasis int;
declare can... |
--
-- Creating Database
--
CREATE DATABASE IF NOT EXISTS `trainingfactory`
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
SET default_storage_engine=InnoDB;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
USE `trainingfactory`;
-- --------------------------------------------------------
--
-- Tabelstru... |
ALTER TABLE dbo.ForecastingTreeNode ADD CONSTRAINT
FK_ForecastingTreeNode_ForecastingTreeNode FOREIGN KEY
(
ParentRef
) REFERENCES dbo.ForecastingTreeNode
(
Id
) ON UPDATE NO ACTION
ON DELETE NO ACTION
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.