text stringlengths 6 9.38M |
|---|
with bibs_without_pdv as (select * from
sierra_view.bib_view B left join
sierra_view.subfield_view S
on s.record_id = b.id
and
s.marc_tag = '049'
and substring(lower(s.content), 1, 3) = lower('PDV')
where marc_tag is null
),
items_for_nodc as (
select * from sierra_view.item_view i
left join
sierra_view.s... |
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE task_lists (
id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
task_id integer NOT NULL,
title varchar(100) NOT NULL,
description varchar(2000),
created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at datetime NO... |
CREATE TABLE categoryshop (
id CHAVE NOT NULL,
id_category CHAVE NOT NULL,
id_shop CHAVE NOT NULL,
position CHAVE NOT NULL,
CONSTRAINT pk_categoryshop PRIMARY KEY (id)
); |
alter table workflow_base add ShowDelButtonByReject char(1)
/
update workflow_base set ShowDelButtonByReject='1'
/
|
select
c.clientid
, c.fio
, c.PhoneNumber
, p.Productid
, p.ContractNumber
, th.MaxAmount
, p.StatusName
from prd.vw_product p
inner join client.vw_client c on c.clientid = p.ClientId
inner join pmt.Payment pay on pay.ContractNumber = p.ContractNumber
outer apply
(
select max(th.MaxAmoun... |
Designs
- DES_NUM - value-set
- PROD_ID - value-set
- PRICE - double
DesignsMaterials
- ID -int
- DES_NUM - value-set
- MAT_ID - value-set
EmployeeDesigns
- ID - int
- EMPL_ID - value-set
- DES_NUM - value-set
Employees
- EMPL_ID - value-set
- MANAGER - text
- FIRST_NAME - text
- LAST_NAME - text
... |
ALTER TABLE vilkar_vurdering ADD COLUMN delvilkar JSON; |
DROP INDEX index_domains_on_name;
DROP INDEX index_domains_on_project_id;
DROP TABLE domains;
|
update hrmsalarypaydetail set status=0 where status is null
/ |
SELECT clients_lastname, clients_firstname, clients_budget, category_type
FROM clients
INNER JOIN category ON clients.category_id = category.category_id; |
CREATE TABLE Payroll (
PayrollID UUID UNIQUE DEFAULT uuid_generate_v4(),
EmployeeID UUID REFERENCES Employees(EmployeeID) ON DELETE CASCADE,
Salary BOOLEAN DEFAULT FALSE,
Rate NUMERIC(9, 2) DEFAULT 0,
PaymentFreq VARCHAR(11)
CHECK(
PaymentFreq = 'Monthly' OR
Pa... |
INSERT INTO DQC_InOut_IsNull (WMID, In_Out) VALUES (1,NULL);
INSERT INTO DQC_InOut_IsNull (WMID, In_Out) VALUES (2,NULL);
INSERT INTO DQC_InOut_IsNull (WMID, In_Out) VALUES (3,NULL);
INSERT INTO DQC_InOut_IsNull (WMID, In_Out) VALUES (4,NULL);
INSERT INTO DQC_InOut_IsNull (WMID, In_Out) VALUES (5,NULL);
INSERT INTO DQC... |
alter table WorkFlowPlanDetail modify flowDate varchar2(10)
/ |
--QUERYS INFORMES JUGADORES
--buscar jugador
select nombre,fecha_nacimiento,posicion from dw.dim_jugador
where id_jugador in (select id_jugador from dw.fact_jornada where id_partido <= '179889')
-- <= '179889' ->temp 2016
-- > '179889' ->temp 2017
-- total sin el where
group by nombre,fecha_nacimiento,poscion
order ... |
SELECT students.name AS "Name", AVG(assignment_submissions.duration) AS "Average Duration"
FROM students JOIN assignment_submissions ON students.id = student_id
WHERE students.end_date IS NULL
GROUP BY students.name
ORDER BY "Average Duration" DESC; |
# Host: 127.0.0.1 (Version: 5.6.24)
# Date: 2018-07-24 16:48:42
# Generator: MySQL-Front 5.3 (Build 4.271)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "lianjia_cj"
#
DROP TABLE IF EXISTS `lianjia_cj`;
CREATE TABLE `lianjia_cj` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`city` char(10) DEFAULT NULL,
`re... |
alter table DocDetailLog modify docSubject varchar2(440)
/
alter table ImageFile modify imageFileName varchar2(440)
/
alter table DocImageFile modify imageFileName varchar2(440)
/
alter table SysMaintenanceLog modify relatedName varchar2(440)
/
|
{{
config(
re_data_columns=['amount', 'status'],
re_data_metrics={'table': ['orders_above_100']},
re_data_anomaly_detector={'name': 'z_score', 'threshold': 3.0},
materialized='table'
)
}}
select id, customer_id, status, amount, created_at from {{ ref('orders') }} where status = ... |
/*
Navicat MySQL Data Transfer
Source Server : 118.24.178.170_3306
Source Server Version : 50717
Source Host : 118.24.178.170:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2019-06-18 17:39:44
*/
SET ... |
#7 Mostra el següents sous: El més car, el més barat i la mitjana
SELECT MAX(sou), MIN(sou), AVG(sou)
FROM jugadors;
#8 Incrementa un 5% els pressupostos de tots els equips.
UPDATE equips
SET pressupost = pressupost * 1.05;
#9 Mostra la quiniela de la primera jornada (equip casa, equip fora, 1x2). Harás de buscar ... |
/*
c:\xampp\mysql\bin\mysql -uedunova -pedunova --default_character_set=utf8 < "D:\opg.sql"
*/
drop database if exists opg;
create database opg default character set utf8;
use opg;
create table proizvod (
sifra int not null primary key auto_increment,
naziv varchar(50) not null,
cijena decimal(18,2) not null,
djela... |
/*
Navicat Premium Data Transfer
Source Server : blog
Source Server Type : MySQL
Source Server Version : 80015
Source Host : localhost:3306
Source Schema : blog
Target Server Type : MySQL
Target Server Version : 80015
File Encoding : 65001
Date: 06/11/2019 12:13:53
*... |
--liquibase formatted sql logicalFilePath:V1_005_MTM_USER2ROLE.sql
--changeset sanasov:1.5 runOnChange:true context:prod
CREATE TABLE hp.mtm_hp_user2role (
user_id bigint NOT NULL REFERENCES hp.hp_user (id) ON DELETE CASCADE ON UPDATE CASCADE,
role_id bigint NOT NULL REFERENCES hp.role (id) ON DELETE CASCADE ON UPD... |
create table nts_company
(
company_id bigint auto_increment comment '编号'
primary key,
name varchar(200) default '' null comment '企业名称',
alias varchar(100) default '' null comment '企业别名',
address varchar(500) default '' null comment '企业地址',
industry_i... |
DROP TABLE IF EXISTS `timetracker_downgrade_migration_temp`.`projects`;
-- CREATE TABLE "projects" -------------------------------------
CREATE TABLE `timetracker_downgrade_migration_temp`.`projects` (
`id` Int( 11 ) AUTO_INCREMENT NOT NULL,
`name` VarChar( 200 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,... |
#
# Structure for table "dept"
#
DROP TABLE IF EXISTS `dept`;
CREATE TABLE `dept` (
`deptno` int(11) DEFAULT NULL,
`dname` varchar(14) DEFAULT NULL,
`loc` varchar(13) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
#
# Data for table "dept"
#
INSERT INTO `dept` VALUES (10,'教研部','北京'),(20,'学工部'... |
select *
from catalog_sales, warehouse, item, date_dim
where i_item_sk = cs_item_sk and w_warehouse_sk = cs_warehouse_sk and d_date_sk = cs_sold_date_sk and i_current_price between 0.99 and 1.49 and d_date between (cast ('2001-01-17' as date)) and (cast ('2001-03-17' as date)) |
create table users(
user_name varchar(15) primary key,
user_password varchar(20) not null,
first_name varchar(50) not null,
last_name varchar(50) not null,
creation_date timestamp default current_timestamp,
user_email varchar(100) not null,
type_user int
);
create table end_users(
user_name ... |
CREATE DEFINER=`root`@`localhost` TRIGGER `library`.`update author books count when book removed` AFTER DELETE ON `books` FOR EACH ROW
BEGIN
DECLARE numberOfBooks int;
SET numberOfBooks = (SELECT COUNT(ISBN) FROM books WHERE author_id = Old.author_id);
UPDATE `authors`
SET
number_of_books = numberOfBooks
WHERE
... |
/* Formatted on 06/02/2014 04:25:44 p.m. (QP5 v5.163.1008.3004) */
/*SQL1 - LENGTH=64*/
SELECT DISTINCT E.cd_siniestro,
E.nu_siniestro,
TO_DATE (SS.SISI_FE_OCURRENCIA) FECHA_OCU,
E.cod_producto,
SCS.SICE_CACE_CASU_CD_SUCURSAL CD_POLIZA,
... |
# --- First database schema
# --- !Ups
INSERT INTO categorization VALUES
(01, 3, 'address', 'Corrientes y Malabia', 12354, 45673, '2012-09-24 19:20:00')
;
# --- !Downs
delete from categorization where id > 0; |
-- MySQL Script generated by MySQL Workbench
-- Mon Nov 23 01:08:33 2015
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TR... |
create table FooEntity (
id binary(16) not null,
created_at timestamp not null,
created_by varchar(255) not null,
name varchar(255) not null,
kinds bigint not null,
primary key (id)
)
|
CREATE FUNCTION "DBA"."getpath"()
returns LONG VARCHAR
deterministic
BEGIN
declare dbPath long varchar;
declare dbname LONG VARCHAR ;
set dbPath = (select db_property ('file'));
set dbName = (select db_property('name')) + '.db'; -- nom de la db
set dbPath = left(dbPath, length(dbPath)-length(d... |
/*
Navicat Premium Data Transfer
Source Server : vagrant
Source Server Type : MySQL
Source Server Version : 80017
Source Host : 192.168.205.10:3306
Source Schema : shiyu
Target Server Type : MySQL
Target Server Version : 80017
File Encoding : 65001
Date: 15/09/2019 1... |
alter table workflow_report modify ( reportwfid varchar(1000) )
/
|
/*
Navicat MySQL Data Transfer
Source Server : mysqlimis
Source Server Version : 50151
Source Host : 10.1.51.234:3306
Source Database : jawavesys
Target Server Type : MYSQL
Target Server Version : 50151
File Encoding : 65001
Date: 2017-12-01 11:18:06
*/
SET FOREIGN_KEY_CHECKS=0;
... |
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_notification_property_notification_id
ON notification_property USING btree
(notification_id);
|
-- __/\\\\\\\\\\\__/\\\\\_____/\\\__/\\\\\\\\\\\\\\\_____/\\\\\_________/\\\\\\\\\_________/\\\\\\\________/\\\\\\\________/\\\\\\\________/\\\\\\\\\\________________/\\\\\\\\\_______/\\\\\\\\\_____
-- _\/////\\\///__\/\\\\\\___\/\\\_\/\\\///////////____/\\\///\\\_____/\\\///////\\\_____/\\\/////\\\____/\\\///... |
DROP TABLE IF EXISTS notifications;
CREATE TABLE notifications (
id BIGINT NOT NULL,
sender_id BIGINT,
receiver_id BIGINT NOT NULL,
resolved BOOLEAN NOT NULL,
created_dt TIMESTAMP WITH TIME ZONE NOT NULL,
updated_dt TIMESTAMP WITH TIME ZONE NOT NULL,
type INT NOT NULL,
PRIMARY KEY (id)
);
DROP SEQUENCE... |
CREATE DATABASE lab7;
CREATE TABLE customer
(
customer_id integer ,
first_name varchar(20),
last_name varchar(20),
email varchar(60)
);
CREATE TABLE payment
(
payment_id int,
customer_id int,
rental int ,
commission double precision,
payment_date timestamp
);
CREATE TABLE ... |
CREATE SEQUENCE SEQUENCE_STUDENTS INCREMENT BY 1;
CREATE SEQUENCE SEQUENCE_INTEREST_AREAS INCREMENT BY 1;
CREATE SEQUENCE SEQUENCE_EXAMINATIONS INCREMENT BY 1;
CREATE SEQUENCE SEQUENCE_BOARDS INCREMENT BY 1;
CREATE SEQUENCE SEQUENCE_CLASSES INCREMENT BY 1;
CREATE SEQUENCE SEQUENCE_SEMESTERS INCREMENT BY 1;
CREATE SEQUE... |
select * from personal_crime_09_13
Union All
select * from personal_crime_14_18; |
delete from HtmlLabelIndex where id=22574
/
delete from HtmlLabelInfo where indexid=22574
/
INSERT INTO HtmlLabelIndex values(22574,'关闭预算控制')
/
INSERT INTO HtmlLabelInfo VALUES(22574,'关闭预算控制',7)
/
INSERT INTO HtmlLabelInfo VALUES(22574,'Closure budgetary control',8)
/
INSERT INTO HtmlLabelInfo VALUES(22574,'關閉預算控制... |
-- ---------------------------------------
-- SQLVERSIE 1.9.0 <- 1.7.4
-- ---------------------------------------
-- 25 juli 2011
--
-- Views voor de overgang naar vw_grootboekstam
--
-- vw_grootboekstam is zelf al aangemaakt in 1.7.x omdat 'ie nodig was voor de btw views.
-- Wel kijkt 'ie daar nog naar de tabel "gro... |
delete tags
delete tagplaces
delete Feedbacks
delete Places
delete Categories |
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table company (
id integer auto_increment not null,
name varchar(255),
constraint pk_company primary key (id))
;
# --- !Downs
SET F... |
CREATE DATABASE `dinner` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE `d_dinner` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`week` tinyint(2) NOT NULL COMMENT '周',
`time_kind` varchar(20) NOT NULL DEFAULT '' COMMENT '时间及餐种',
`name` varchar(20) NOT NULL DEFAULT '' COMMENT '付款人',
`a... |
SELECT vlu FROM
(
SELECT a.row_num as i , b.col_num as j , SUM(a.value * b.value) as vlu
FROM a, b
WHERE a.col_num = b.row_num
GROUP BY a.row_num, b.col_num
)
where i = 2 AND j = 3; |
CREATE DATABASE project_test;
GRANT ALL PRIVILEGES ON project_test.* TO 'developer'@'%';
FLUSH PRIVILEGES;
|
CREATE TABLE 'PRODUCTS'(
ProductID INT PRIMARY KEY NOT NULL,
ProductName CHAR(50) NOT NULL,
SupplierID char(50) NOT NULL,
UNITPRICE REAL NOT NULL,
STOCK INT NOT NULL,
REORDERLEVEL INT NOT NULL,
FOREIGN KEY (SupplierID) REFERENCES SUPPLIERS (SupplierID)
)
INSERT INTO PRODUCTS VALUES
(1, "Men's Shoe", 1, 79... |
CREATE PROCEDURE dbo.UpisiPoruku
@Datum DATETIME2 (2),
@Primatelj VARCHAR (50),
@BrojMobitela VARCHAR (12),
@NazivDatoteke VARCHAR (20)
AS
INSERT INTO dbo.Poruke (Datum, Primatelj, BrojMobitela, NazivDatoteke) VALUES (@Datum, @Primatelj, @BrojMobitela, @NazivDatoteke)
RETURN 0 |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50718
Source Host : localhost:3306
Source Database : fire
Target Server Type : MYSQL
Target Server Version : 50718
File Encoding : 65001
Date: 2017-05-17 20:04:30
*/
SET FOREIGN_KEY_CHECKS=0;
--... |
DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE bamazon;
USE bamazon;
CREATE TABLE products (
id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(50),
department_name VARCHAR(50),
price INT(50),
stock_quantity INT(50),
PRIMARY KEY (id)
);
INSERT INTO products (product_name, department_name, price, sto... |
CREATE TABLE S_Province(
ID BIGINT PRIMARY KEY IDENTITY(1,1) NOT NULL,
Name NVARCHAR(100) NOT NULL,
Alias NVARCHAR(100),
Remark TEXT
)
CREATE TABLE S_City(
ID BIGINT PRIMARY KEY IDENTITY(1,1) NOT NULL,
Name NVARCHAR(100) NOT NULL,
ProvinceID BIGINT NOT NULL,
ZipCode NVARCHAR(100),
IsSubSite TINYINT,
Rem... |
-- $Header: /u999/cvsadmin/cms_rep/repository/local_acc/resource/TARB1/create_db_TARB1.sql,v 1.1 2011/02/02 23:22:23 hongh Exp $
-- ----------------------------------------------------------------------------------------------
-- Script : create_db.sql
-- Purpose :
-- Changes :
-- Seq Name Date ... |
delete from HtmlLabelIndex where id=21557
/
delete from HtmlLabelInfo where indexid=21557
/
INSERT INTO HtmlLabelIndex values(21557,'按钮名称')
/
INSERT INTO HtmlLabelInfo VALUES(21557,'按钮名称',7)
/
INSERT INTO HtmlLabelInfo VALUES(21557,'Button Name',8)
/
delete from HtmlLabelIndex where id=21560
/
delete from HtmlLab... |
CREATE TABLE battles (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
theatre TEXT,
location TEXT,
result TEXT,
start_date DATE,
end_date DATE,
description TEXT,
image TEXT
);
-- seed data
INSERT INTO battles (name, theatre, location, result, start_date, end_date, description, image) VALUES ('Oper... |
CREATE TABLE [AsData_PL].[MarketoPrograms]
(
ProgramId Bigint
,ProgramName nvarchar(max)
,ProgramDescription nvarchar(max)
,CreatedAt datetime2
,UpdatedAt datetime2
,ProgramType nvarchar(max)
,Channel nvarchar(max)
,EmailType varchar(10)
,EmailTypeDescription nvarchar(max)
,AudienceType va... |
delete from SystemRights where id=780
/
delete from SystemRightsLanguage where id=780
/
delete from SystemRightDetail where id=4290
/
insert into SystemRights (id,rightdesc,righttype) values (780,'工作流分权人力资源','5')
/
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (780,7,'工作流分权人力资源','工作流分权... |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50505
Source Host : localhost:3306
Source Database : zjds
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2018-11-28 17:16:29
*/
SET FOREIGN_KEY_CHECKS=0;
--... |
CREATE OR REPLACE PROCEDURE SystemRights_Select
(rightdesc_1 varchar2 ,
flag out integer ,
msg out varchar2,
thecursor IN OUT cursor_define.weavercursor
)
AS
begin
open thecursor for
select * from SystemRights where rightdesc like rightdesc_1 order by id desc ;
end;
/
CREATE OR REPLACE PROCEDURE SystemRight... |
SELECT te.trace_event_id,tc.name AS CategoryName
, CASE tc.type
WHEN 0 THEN 'Normal'
WHEN 1 THEN 'Connection'
WHEN 2 THEN 'ERROR'
END AS TraceEventType
,te.name AS TraceEventName
, xem.package_name, xem.xe_event_name
FROM sys.trace_xe_event_map xem
RIGHT OUTER JOIN sys.trace_events te
ON te.trace_event_id... |
/*
Navicat MySQL Data Transfer
Source Server : MySQL
Source Server Version : 50717
Source Host : localhost:3306
Source Database : supermarket
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2017-06-24 02:54:24
*/
SET FOREIGN_KEY... |
DROP TABLE IF EXISTS tabulka1 CASCADE;
DROP TABLE IF EXISTS tabulka2 CASCADE;
CREATE TABLE tabulka1 AS SELECT i FROM generate_series(1,10000) s(i);
CREATE TABLE tabulka2 AS SELECT i FROM generate_series(1,10000) s(i);
ANALYZE tabulka1;
ANALYZE tabulka2;
EXPLAIN SELECT * FROM tabulka1 JOIN tabulka2 USING (i) WHERE ta... |
--ajouter à la table languages une colonne versions (VARCHAR).--
EXO1
USE webDevelopment;
ALTER TABLE `languages`
ADD COLUMN `versions`VARCHAR(5);
--ajouter à la table frameworks une colonne version (INT).--
EXO2
ALTER TABLE `frameworks`
ADD COLUMN `version` INT UNSIGNED;
--dans la table languages renommer la col... |
-- Script de création de la base de données ENCHERES
-- type : SQL Server 2012
--
CREATE TABLE CATEGORIES (
no_categorie INTEGER IDENTITY(1,1) NOT NULL,
libelle VARCHAR(30) NOT NULL
)
ALTER TABLE CATEGORIES ADD constraint categorie_pk PRIMARY KEY (no_categorie)
CREATE TABLE ENCHERES (
no_uti... |
use exam;
insert into Category (name, date_created_on) values
("Liam South", "2016-04-04"),
("Liam South", "2016-04-05"),
("Liam South", "2016-04-03"),
("Liam South", "2016-04-01"),
("Liam South", "2016-04-06"),
("Liam South", "2016-04-02");
insert into Tag (hash, name, Category_id) values
("9568243231905", "L... |
CREATE FUNCTION [Transform].[fnDimDescriptionVersions] ()
RETURNS TABLE
AS
RETURN
( SELECT
[DescriptionKey]
,[DescriptionCode]
,[DescriptionTypeCode]
,[StartDate]
,[EndDate]
,1 AS 'Version'
FROM [Model].[DimDescription] WITH (NOLOCK)
);
|
select NAME, VALUE
from GV$SYSSTAT
where upper(NAME) like '%PARALLEL OPERATIONS%'
or upper(NAME) like '%PARALLELIZED%' or upper(NAME) like '%PX%';
/*
NAME VALUE
---------------------------------------------------------------- ----... |
create database pingui;
CREATE TABLE `rkp` (
`ID` int(11) default NULL,
`prefix` varchar(16) default NULL,
`pip` int(11) default NULL,
`adres` varchar(2048) default NULL
);
CREATE TABLE `host` (
`ID` int(11) default NULL,
`rkpID` int(11) default NULL,
`ip` int(11) default NULL,
`port` int(11) default NUL... |
-- Database: mysql
CREATE TABLE {table} (
id integer unsigned PRIMARY KEY AUTO_INCREMENT NOT NULL,
name varchar(96) NOT NULL,
UNIQUE name (name)
);
|
drop database videogame;
create database videogame;
use videogame;
create table videogame(
id_videogame int primary key not null auto_increment,
modelo_videogame varchar(20),
NS_videogame varchar(24)
);
create table jogos(
id_jogos int primary key not null auto_increment,
nome_jogo varchar(30),
descricao_jog... |
/* ---------------------------------------------------- */
/* Generated by Enterprise Architect Version 13.5 */
/* Created On : 29-mar.-2020 10:22:15 */
/* DBMS : PostgreSQL */
/* ---------------------------------------------------- */
/* Drop Tables */
DROP TABLE IF EXISTS banco_calenio ... |
DROP TABLE master_goleador;
CREATE TABLE public.master_goleador (
temporada character varying(50) NOT NULL,
jugador character varying(150) NOT NULL,
goles integer DEFAULT 0 NOT NULL
);
ALTER TABLE public.master_goleador OWNER TO postgres;
COPY master_goleador FROM '/tmp/GoleadoresLaLiga.csv' WITH CSV HEADE... |
USE burgers_db;
INSERT INTO burgers (burger_name, devoured) VALUES
("Traditional Cheese", false),
("Jalapeno Cheese-Filled", true),
("Homemade Black Bean Veggie ", true); |
set
@channel='SMS',
@list_name='Optin Good Customer',
@list_module='JAGGCSMS',
@list_frq='M',
@list_gen_time= now(),
@time_filter='Paid Off Date',
@opt_out_YN= 1,
@std_date='2015-01-01',
@end_date= curdate();
set @commet='JAG GC paidoff since Jan012015 with transactional optin';
/* GC List */
DROP TEMPORARY TABLE ... |
CREATE OR REPLACE FUNCTION public.dblink_open(text, text, text, boolean)
RETURNS text
LANGUAGE c
STRICT
AS '$libdir/dblink', $function$dblink_open$function$
|
-- phpMyAdmin SQL Dump
-- version 4.1.6
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 06, 2016 at 01:35 PM
-- Server version: 5.6.16
-- PHP Version: 5.5.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... |
-- phpMyAdmin SQL Dump
-- version 4.4.10
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: May 12, 2016 at 04:38 PM
-- Server version: 5.5.42
-- PHP Version: 7.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... |
-- CREATE VIEW stock AS select producto_id, sum(kardex.kardex_stock) as stock,
-- count(producto_id) as filas, p.tab_producto_nombre as nombre, p.tab_producto_codigo as codigo,
-- MAX(kardex_precio) as precio, kardex_movimiento as movimiento, p.tab_producto_imagen as imagen
-- from kardex
-- inner join tab_p... |
-- 插入数据 (增)
-- 1. 插入一条 完整的数据
-- insert into `表名` values(值1, 值2, ...)
INSERT INTO `user` VALUES(null, '小王', md5('123456'), '15000000000', default, '2019-01-28', '老宋隔壁', 2, unix_timestamp() );
-- 注意:
-- 1. 插入所有的字段值
-- 2. 带有 auto_increment属性的字段, 可以用null 代替
-- 3. 带有 default 属性的字段, 可以用 default 代替
-- 4. 带有 unique 属... |
-- Buildings
------------------------------
INSERT INTO Buildings
(Type, BuildingClass, GreatPeopleRateModifier, Defense, ExtraCityHitPoints, Water, GreatWorkSlotType, GreatWorkCount, Cost, FreeStartEra, Happiness, NeverCapture, GoldMaintenance, PrereqTech, ArtDefineTag, SpecialistType, SpecialistCount, MinAr... |
delete from HtmlLabelIndex where id=19870
/
delete from HtmlLabelInfo where indexid=19870
/
INSERT INTO HtmlLabelIndex values(19870,'项目监控')
/
INSERT INTO HtmlLabelInfo VALUES(19870,'项目监控',7)
/
INSERT INTO HtmlLabelInfo VALUES(19870,'Project Monitor',8)
/
INSERT INTO HtmlLabelInfo VALUES(19870,'項目監控',9)
/
|
---- drop ----
DROP TABLE IF EXISTS `test_tqable`;
---- create ----
create table IF not exists `test_table`
(
`id` INT(20) AUTO_INCREMENT,
`user` VARCHAR(20) NOT NULL,
`UpdateTime` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL on update CURRENT_TIMESTAMP,
P... |
-- SQL query to list the names of all people who starred
-- in a movie in which Kevin Bacon also starred.
SELECT name FROM people
WHERE people.id IN (
SELECT person_id FROM stars
WHERE movie_id IN (
SELECT movie_id FROM stars
WHERE person_id IN (
SELECT id FROM people
WHERE name = "Kevin Bacon... |
# --- !Ups
# --- Add enable column in advertisement table to set advertisement enabled or disabled by findgeek administrator
# --- the reason: Because in mind that there will be add are irrelevant IT advertisement , it must disable because we allow user to input data free.
ALTER TABLE Advertisement
ADD COLUMN `en... |
-- BLOCK select_and_auth
WITH instance_questions_info AS (
SELECT
iq.id,
(lag(iq.id) OVER w) AS prev_instance_question_id,
(lead(iq.id) OVER w) AS next_instance_question_id,
qo.question_number,
CASE
WHEN a.type = 'Exam' THEN COALESCE(iq.points_list[1], 0)
... |
ALTER DATABASE django_website CHARACTER SET = utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE diskurs_post CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE diskurs_post CHANGE content content longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 06, 2019 at 08:55 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
drop table TestTable cascade;
create table TestTable(
OutID varchar(50) not null,
Test varchar(100) not null,
Year int not null,
TLID int,
Ball int,
Ball100 int,
Ball12 int,
Lang varchar(50),
TestStatus varchar(50),
DPALevel varchar(50),
AdaptScale int,
const... |
-- Tested on MySQL
/* customersWhoNeverOrder
Suppose that a website contains two tables, the Customers table and the
Orders table. Write a SQL query to find all customers who never order
anything.
Table: Customers.
+----+-------+
| Id | Name |
+----+-------+
| 1 | Joe |
| 2 | Henry |
| 3 | Sam |
| 4 | Ma... |
-- 1) Фінансування
UPDATE `out`
SET `N2` = (SELECT IFNULL(SUM(`N7`), 0) FROM `Z2MPZ`
WHERE `Z2MPZ`.`ID_KEY` = `out`.`ID_KEY`)
WHERE `KOD` = 205200;
-- 3)
UPDATE `out`
SET `N4` = (SELECT IFNULL(SUM(`N7`), 0) FROM `Z41MPS` WHERE `Z41MPS`.`ID_KEY` = `out`.`ID_KEY`)
+(SELECT ... |
-- +migrate Up
-- +migrate StatementBegin
ALTER TABLE claim
DROP FOREIGN KEY claim_ibfk_2;
-- +migrate StatementEnd
-- +migrate StatementBegin
ALTER TABLE input
DROP FOREIGN KEY input_ibfk_1;
-- +migrate StatementEnd
-- +migrate StatementBegin
ALTER TABLE support
DROP FOREIGN KEY support_ibfk_1,
CHANGE COLUM... |
DECLARE
v_taskccid INTEGER;
BEGIN
SELECT col_id
INTO v_taskccid
FROM tbl_taskcc
WHERE col_casecctaskcc = :CaseId
AND Nvl(col_parentidcc, 0) = 0;
RETURN v_taskccid;
EXCEPTION
WHEN no_data_found THEN
RETURN NULL;
END; |
-- Checklist 11
ALTER TYPE tp_sala ADD attribute (numero_janela NUMBER) CASCADE; |
INSERT INTO skm.road (id, bus_line_id, direction) VALUES (12, 1, '1');
INSERT INTO skm.road (id, bus_line_id, direction) VALUES (13, 1, '1');
INSERT INTO skm.road (id, bus_line_id, direction) VALUES (14, 1, '1');
INSERT INTO skm.road (id, bus_line_id, direction) VALUES (15, 1, '1');
INSERT INTO skm.road (id, bus_line_i... |
INSERT INTO CATEGORIA(IDCATEGORIA, NOMBRE, DESCRIPCION)
VALUES (0000000000, 'TODO', 'Categoria todo, que incluye todos los productos del sistema.');
INSERT INTO USUARIO (NOMBREUSUARIO, CORREO, CONTRASEÑA, BANEADO)
VALUES ('Pedro', 'pedro@ugr.es', '123456',0);
INSERT INTO PRODUCTO (IDPRODUCTO, NOMBRE, PUNTUACION... |
create database etec_has_ex_1;
use etec_has_ex_1;
create table area
(
id_area int not null primary key identity(1 , 1),
nm_area varchar(60) not null
);
create table professor
(
id_prof int not null primary key identity(1 , 1),
nm_prof varchar(60) not null,
end_prof varchar(255) not null,
... |
-- {{{ play with logs
bunyan -c 'this.audit == true' -o short log/okr.log*
bunyan -c 'this.audit == true && this.entity="deliverable"' -o short log/okr.log*
bunyan -c 'this.entity == "keyResult" && this.audit == true && this.id == 128' -o short log/okr.log*
-- }}}
-- {{{ unarchive all records
update quarter set archi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.