text
stringlengths
1
1.05M
-- В виде триггера реализовать проверку: должно быть нельзя дважды добавить одного человека в один фильм в одном качестве. CREATE OR REPLACE FUNCTION func() RETURNS TRIGGER AS $$ BEGIN IF (TG_OP = 'INSERT' OR TG_OP = 'UPDATE') THEN IF EXISTS (SELECT * FROM moviepeople AS mp WHERE mp.movieid = NEW.movieid AN...
drop function if exists register(text, text, text); drop function if exists authenticate(text, text); drop function if exists "get_current_user"(); drop function if exists "rides_name"(ride rides); drop function if exists "spots_temperature"(spots spots); drop function if exists "rides_has_border"(ride rides); drop fun...
CREATE TABLE IF NOT EXISTS accounts ( id SERIAL PRIMARY KEY, username TEXT, password_digest TEXT NOT NULL, password_salt TEXT NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS accounts_id_idx ON accounts(username);
set names utf8 collate utf8_en_cs; prepare stmt from 'select NULLIF(?, ?), collation (NULLIF(?, ?))'; execute stmt using _utf8'A', _utf8'a', _utf8'A', _utf8'a'; execute stmt using _euckr'A', _euckr'a', _euckr'A', _euckr'a'; execute stmt using _euckr'A', _utf8'a', _euckr'A', _utf8'a'; drop table if exists t1; crea...
-- This file should undo anything in `up.sql` DROP TABLE solutions;
UPDATE service_state SET state=${state},outdated=${outdated},deployment_type=${deployment_type},last_edited=current_timestamp WHERE id=${id}
-- -- Copyright © 2016-2021 The Thingsboard Authors -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicabl...
create or replace PROCEDURE SP_UPDATE_CMS_POSSESS_TABLE ( I_ID IN NUMBER, I_TYPE_RPT IN VARCHAR2 ) IS V_REC_CNT NUMBER(10); V_XMLDOC XMLTYPE; V_XMLVALUE XMLTYPE; V_ERRCODE NUMBER(10); V_ERRMSG ...
/* Navicat Premium Data Transfer Source Server : 8.129.123.15 Source Server Type : MySQL Source Server Version : 80023 Source Host : 8.129.123.15:3306 Source Schema : test Target Server Type : MySQL Target Server Version : 80023 File Encoding : 65001 Date: 27/02/2021...
ALTER TABLE `crm_usedcar_purchase_caseinfo` ADD COLUMN `liquid_mode` ENUM('1', '2') NULL DEFAULT '1' AFTER `is_case_details_completed`;
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs', '2010-09-02 00:15:30'); INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07'); INSERT INTO `sys_trans_text...
CREATE TABLE units ( unit CHAR(44) NOT NULL PRIMARY KEY, -- sha256 in base64 creation_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, version VARCHAR(3) NOT NULL DEFAULT '1.0', alt VARCHAR(3) NOT NULL DEFAULT '1', witness_list_unit CHAR(44) NULL, last_ball_unit CHAR(44) NULL, content_hash CHAR(44) NULL, head...
DROP TABLE IF EXISTS `arena_pvp`; CREATE TABLE `arena_pvp` ( `char_id` int(11) unsigned NOT NULL, `char_name` varchar(24) NOT NULL, `matou` int(10) unsigned NOT NULL, `morreu` int(10) unsigned NOT NULL, `total` int(10) NOT NULL, PRIMARY KEY (`char_id`) ) ENGINE=MyISAM; DROP TABLE IF EXISTS `arena_pvp_logs`; CREATE TAB...
-- -------------------------------------------------------- -- Host: localhost -- Versión del servidor: 5.7.24 - MySQL Community Server (GPL) -- SO del servidor: Win32 -- HeidiSQL Versión: 10.2.0.5599 -- -------------------------------------------------------- /...
# ---------- MdbToMySQL XP 0.9 MySQL IMPORT FROM `C:\Data\vss\Components\EBACombo\v32\Test\Lib\Common\Datasources\en\emaildb.mdb` ---------- # ---------- DROP TABLE `tblContacts` BEFORE (RE)CREATION ---------- DROP TABLE IF EXISTS `tblContacts`; # ---------- CREATE TABLE `tblContacts` ---------- CREATE TABLE `tblC...
# Wiktionary chy http://wiktionary.org/ CC BY-SA 01503061-n chy:lemma vé'kése 01662784-n chy:lemma ma'ëno 01770081-n chy:lemma tó'êseóhtavé'ho'e 01772222-n chy:lemma vé'ho'e 01774384-n chy:lemma mo'ôhtáevé'ho'á'e 01774750-n chy:lemma ma'xemo'ôhtáevé'ho'e 02084071-n chy:lemma oeškeso 02274259-n chy:lemma hevávȧhkema 025...
drop table `hotel`.`quarto_reserva`;
WITH source AS ( SELECT * FROM {{ source('gitlab_dotcom', 'approver_groups') }} QUALIFY ROW_NUMBER() OVER (PARTITION BY id ORDER BY updated_at DESC) = 1 ), renamed AS ( SELECT id::NUMBER AS approver_group_id, target_type::VARCHAR AS target_type, group_id::NUMBER ...
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...
DROP TABLE IF EXISTS central.discovery; CREATE TABLE central.discovery ( id SERIAL NOT NULL, inserted_ts TIMESTAMP NOT NULL DEFAULT NOW(), updated_ts TIMESTAMP NOT NULL, environment VARCHAR(3) NOT NULL, service_name VARCHAR(50) NOT NULL, name VARCHAR(250) NOT NULL, value VARCHAR(1000) NOT NULL, ...
-- boundary2.test -- -- db eval { -- SELECT a FROM t1 WHERE r < 4294967296 ORDER BY r DESC -- } SELECT a FROM t1 WHERE r < 4294967296 ORDER BY r DESC
SELECT * FROM funcionarios WHERE id_departamento IS NULL; SELECT * FROM funcionarios WHERE id_departamento IS NOT NULL;
/*iWeb在线课堂项目必需的数据库结构*/ /*SQL语句不区分大小写,习惯上:关键字都大写,非关键字都小写*/ #删除数据库iweb,如果它存在的话 DROP DATABASE IF EXISTS iweb; #重新创建数据库iweb CREATE DATABASE iweb CHARSET=UTF8; #进入数据库iweb USE iweb; #创建校区表 CREATE TABLE iw_school( sid INT PRIMARY KEY AUTO_INCREMENT, #校区编号(自增的主键) sname VARCHAR(32), #名称 pic VAR...
SELECT SUM(buts) AS buts FROM ((SELECT butsl AS buts FROM match WHERE paysl = 'France') UNION ALL (SELECT butsv AS buts FROM match WHERE paysv = 'France')) AS R;
/* Deletes records associated with a volunteer upon deletion, [ON UPDATE DELETE] Fails :( * */ DROP TRIGGER IF EXISTS tDeleteVolunteer; delimiter $$ CREATE TRIGGER tDeleteVolunteer AFTER DELETE ON Volunteer FOR EACH ROW BEGIN DELETE FROM VolunteerLog WHERE VolunteerID=OLD.VolunteerID; DELETE FROM CheckIn WHERE Vo...
DELETE FROM header; DELETE FROM street; DELETE FROM street_descriptor; DELETE FROM basic_land_property_unit; DELETE FROM application_cross_reference; DELETE FROM local_property_identifier; DELETE FROM delivery_point_address; DELETE FROM metadata; DELETE FROM successor; DELETE FROM organisation; DELETE FROM classificati...
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 06, 2018 at 04:40 PM -- Server version: 10.1.19-MariaDB -- PHP Version: 7.0.13 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL...
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Aug 22, 2021 at 04:58 PM -- Server version: 5.7.33 -- PHP Version: 7.4.19 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTE...
--drop database if exists RabbitDb --go --create database RabbitDb --go --Select 'Here is a comment' --use RabbitDb --go --CREATE TABLE Rabbits( -- RabbitID INT NOT NULL IDENTITY PRIMARY KEY, -- Age INT NULL, -- Name NVARCHAR(50) NULL -- ); --select 'Here is a comment' INSERT INTO Rabbits (Age) VALUES (1); U...
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: 23 Jul 2016 pada 07.39 -- Versi Server: 10.1.13-MariaDB -- PHP Version: 7.0.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ...
SELECT CONCAT(Name, "(", SUBSTR(Occupation, 1, 1), ")") FROM OCCUPATIONS ORDER BY Name; SELECT CONCAT("There are a total of ", COUNT(Occupation), " ", LOWER(Occupation), "s.") FROM OCCUPATIONS GROUP BY Occupation ORDER BY COUNT(Occupation), Occupation;
CREATE TABLE [dbo].[sqlwatch_logger_xes_query_processing] ( [event_time] datetime, [max_workers] bigint, [workers_created] bigint, [idle_workers] bigint, [pending_tasks] bigint, [unresolvable_deadlocks] int, [deadlocked_scheduler] int, [snapshot_time] datetime2(0) not null, [snapshot_type_id] tinyint not null...
select id,nombre,fecha_nacimiento,nombre_contacto,telefono,tipo from mascota where id = :id
-- @testpoint:openGauss关键字exec(非保留),作为列名带反引号(合理报错) drop table if exists exec_test; create table exec_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), c_char char(50) default nul...
UPDATE activity_detail SET cut_line_length_unit_type_code = 'KMT' FROM (SELECT ad.activity_detail_id FROM activity_detail ad JOIN activity_summary_detail_xref asdx ON asdx.activity_detail_id = ad.activity_detail_id JOIN activity_summary as2 ON as2.activity_summary_id = asdx.activity_summary_id W...
0|0 - Continuada por 1|1 - Continuada en parte por 2|2 - Reemplazada por 3|3 - Reemplaza en parte por 4|4 - Absobida por 5|5 - Absorbida en parte por 6|6 - Dividida en… y… 7|7 - Se fusionó con… para formar… 8|8 - Volvió a ser
USE dqlab; CREATE TABLE IF NOT EXISTS invoice ( `invoice_id` INT, `invoice_code` VARCHAR(15) CHARACTER SET utf8, `customer_id` INT, `invoice_date` DATETIME, `product_id` INT, `total_price` INT, `pinalty` VARCHAR(10) CHARACTER SET utf8 ); INSERT INTO invoice VALUES ( ...
SET ANSI_NULLS ON; SET ANSI_PADDING ON; SET ANSI_WARNINGS ON; SET ANSI_NULL_DFLT_ON ON; SET CONCAT_NULL_YIELDS_NULL ON; SET QUOTED_IDENTIFIER ON; go /************************************ * Tables to drop * *************************************/ -- Scrib...
SELECT 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 t1.id = tq1.tag...
CREATE DATABASE go_orm_example CHARACTER SET utf8mb4;
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 31, 2020 at 04:41 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.2.28 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
CREATE TABLE "Generico_4"( "col_00" varchar(37), "col_01" varchar(19), "col_02" smallint NOT NULL, "col_03" varchar(30), "col_04" varchar(47) NOT NULL, "col_05" varchar(21), "col_06" integer NOT NULL, "col_07" smallint NOT NULL, "col_08" varchar(54), "col_09" varchar(77), "col_10" smallint, "col...
-- -- Copyright 2010-2016 the original author or authors. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unles...
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 14, 2021 at 06:42 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...
DELETE FROM `ci_sessions`; DELETE FROM `captcha`; DELETE FROM `iplog_log`; DELETE FROM `iplog_pages`; DELETE FROM `iplog_ua`;
CREATE TABLE Payroll ( PayrollId INTEGER NOT NULL UNIQUE IDENTITY(1,1), PrcId INTEGER NOT NULL UNIQUE, BudgetLevel NVARCHAR(255) NULL, RPIO NVARCHAR(255) NULL, BFY NVARCHAR(255) NULL, FundCode NVARCHAR(255) NULL, AhCode NVARCHAR(255) NULL, OrgCode NVARCHAR(255) NULL, RcCode NVARCHAR(255) NULL, AccountCode ...
ALTER TABLE simulation_runs ADD results_data TEXT, ADD status VARCHAR(64); UPDATE simulation_runs SET results_data = IF( JSON_TYPE(simulation_runs.model_runs->'$[0].results_data') = 'NULL', NULL, IF( simulation_runs.model_runs->>'$[0].results_data' = '', NULL, simula...
create table if not exists migrations ( version text primary key, created_at timestamp not null default CURRENT_TIMESTAMP );
CREATE TABLE time ( time_code INT, order_date DATE, month_code SMALLINT, month_name CHAR(10), quarter_code SMALLINT, quarter_name CHAR(10), year INTEGER ); CREATE TABLE geography ( district_code SERIAL, district_name CHAR(15), state_code CHAR(2), state_name CHAR(18), region ...
-- This SQL code was generated by sklearn2sql (development version). -- Copyright 2018 -- Model : CaretRegressor_ctree2 -- Dataset : diabetes -- Database : firebird -- This SQL code can contain one or more statements, to be executed in the order they appear in this file. -- Model deployment code WITH "DT_node_lo...
CREATE USER typeorm; CREATE DATABASE typeorm; GRANT ALL PRIVILEGES ON typeorm.* TO typeorm;
DELETE FROM ADMINISTRADORENTITY_CAMBIOENTITY WHERE 1=1; DELETE FROM ADMINISTRADORENTITY_NOTIFICACIONENTITY WHERE 1=1; DELETE FROM CAMBIOENTITY WHERE 1=1; DELETE FROM NOTIFICACIONENTITY WHERE 1=1; DELETE FROM ESTADOWEBENTITY WHERE 1=1; DELETE FROM SITIOWEBENTITY_ADMINISTRADORENTITY WHERE 1=1; DELETE FROM ADMINISTRADO...
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...
INSERT INTO user_tags (user_id, name) ( SELECT DISTINCT ON (users.id) users.id, 'editor-beta' FROM org_members INNER JOIN users ON users.auth0_id = org_members.user_id ); INSERT INTO org_tags (org_id, name) ( SELECT DISTINCT ON (orgs.id) orgs.id, 'editor-beta' FROM orgs );
CREATE DATABASE foodfacts ENCODING 'UTF8'; \c foodfacts CREATE TABLE openfoodfacts ( index INT, product_name VARCHAR, countries_en VARCHAR, ingredients_text VARCHAR ); \copy openfoodfacts from '/docker-entrypoint-initdb.d/foodfacts.csv' with (format csv, header)
-- -- Test citext datatype -- CREATE EXTENSION citext; -- Check whether any of our opclasses fail amvalidate SELECT amname, opcname FROM pg_opclass opc LEFT JOIN pg_am am ON am.oid = opcmethod WHERE opc.oid >= 16384 AND NOT amvalidate(opc.oid); -- Test the operators and indexing functions -- Test = and <>. SELECT ...
CREATE TABLE [lookups].[AdCycles] ( [AdCycleId] INT NOT NULL IDENTITY, [Name] VARCHAR(100) NULL, [Active] BIT NOT NULL DEFAULT 1, CONSTRAINT [PK_AdCycles] PRIMARY KEY ([AdCycleId]) )
-- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apache License, Version 2.0 (the -- "License"); yo...
-- DropForeignKey ALTER TABLE "Address" DROP CONSTRAINT "Address_userId_fkey"; -- AddForeignKey ALTER TABLE "Address" ADD CONSTRAINT "Address_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF OBJECT_ID('dbo.DBFileSpaceHistory', 'U') IS NULL BEGIN CREATE TABLE [dbo].[DBFileSpaceHistory]( DBFileSpaceHistoryID int IDENTITY(1,1) NOT NULL, DBName sysname NOT NULL, FileGroupName varchar(150) NULL, LogicalFilename nvarchar(520) NOT NULL, [Filename] nvarchar...
-- -- Database Schema: commedit -- Automatically generated sql script for the service microservicetesttemplate, created by the CAE. -- -------------------------------------------------------- -- -- Table structure for table track. -- CREATE TABLE commedit.track ( singer VARCHAR(255) , trackId VARCHAR(255) , CONST...
# Write your MySQL query statement below Select dep.Name as Department, emp.Name as Employee, emp.Salary from Department dep, Employee emp where emp.departmentId=dep.id and (Select count(distinct Salary) From Employee where DepartmentId=dep.Id and Salary>emp.Salary)<3
CREATE OR REPLACE TRIGGER uploaders__ FOR UPDATE OR INSERT OR DELETE ON uploaders COMPOUND TRIGGER in_updated_by CONSTANT users.updated_by%TYPE := sess.get_user_id(); in_updated_at CONSTANT users.updated_at%TYPE := SYSDATE; -- rows_inserted SIMPLE_INTEGER := 0; rows_updated ...
-- ApprenticeshipStdRoute Go CREATE TABLE [AsData_PL].[ApprenticeshipStdRoute]( [StdRouteID] Int IDENTITY(1,1) PRIMARY KEY, [Reference] [varchar](20), [LARSCode] [varchar](20), [Route] [varchar](200) NULL, AppendDateTime DateTime Default getdate() ) ON [PRIMARY] GO
alter table gx_email_template add column sender_email_address varchar(200);
CREATE OR ALTER PROCEDURE [projection].[test intersecting_tables_and_dates_restricts_results] AS BEGIN ----------------------------------------------------------------------------------------------------------------- -- Arrange: -------------------------------------------------------------------------------------...
BEGIN; DROP MATERIALIZED VIEW IF EXISTS gnosis_protocol_v2.view_solvers; CREATE MATERIALIZED VIEW gnosis_protocol_v2.view_solvers (address, environment, name, active) AS WITH -- Aggregate the solver added and removed events into a single table -- with true/false for adds/removes respectively solver_activation_events a...
CREATE TABLE MAPS ( MAP_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), MAP_NAME VARCHAR(24) NOT NULL, REGION VARCHAR(26), AREA DECIMAL(8,4) NOT NULL, PHOTO_FORMAT VARCHAR(26) NOT NULL, UNIQUE (MAP_ID, MAP_NAME) ) ; CREATE TABLE MAPS ( MAP_ID ...
/****** Object: Stored Procedure dbo.b4nGetOrderTypes Script Date: 23/06/2005 13:31:55 ******/ CREATE PROCEDURE dbo.b4nGetOrderTypes @custid int AS Select * from b4nClassCodes Where b4nClassSysId = 'DelDocketType' And b4nValid = 'Y' select attributeuservalue from b4nbasketattribute whe...
create temp view gstest1(a,b,v) as values (1,1,10),(1,1,11),(1,2,12),(1,2,13),(1,3,14), (2,3,15),(3,3,16),(3,4,17),(4,1,18),(4,1,19); alter table gstest3 add primary key (a); create temp table gstest_empty (a integer, b integer, v integer); select a, b, grouping(a,b), sum(v), count(*), max(v) from gstes...
-- phpMyAdmin SQL Dump -- version 4.4.15.5 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: 2016-04-28 21:58:13 -- 服务器版本: 5.5.48-log -- PHP Version: 5.6.20 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!4010...
ALTER TABLE link RENAME COLUMN value_id TO entity_id; ALTER TABLE link RENAME TO alias; ALTER TABLE value RENAME TO entity; ALTER TABLE entity RENAME COLUMN value TO name; ALTER TABLE alias RENAME COLUMN key TO name; ALTER TABLE dataset RENAME COLUMN match_links TO match_aliases;
# --- Created by Slick DDL # To stop Slick DDL generation, remove this comment and start using Evolutions # --- !Ups create table "newsletters" ("id" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,"version" BIGINT NOT NULL,"subject" VARCHAR(254) NOT NULL,"text" VARCHAR(254) NOT NULL,"stat...
-- file:money.sql ln:121 expect:true SELECT (-1234567890)::int4::money
DELIMITER $$ CREATE PROCEDURE `ocena_restorana`(idRez INT) BEGIN DECLARE IDR int; DECLARE BP int; DECLARE O float; DECLARE S varchar(100); DECLARE ORez int; DECLARE IDStoFK int; SET S := ( SELECT R.Status FROM rezervacija R WHERE R.IDRezervacija = idRez); SET ORez := ( SELECT R.Ocena FROM rezervacija R WHERE R....
select `orderkey`, `suppkey`, `quantity`, round(sum(`quantity`) over (partition by `suppkey` order by `orderkey` rows unbounded_preceding), 5) as `total_quantity` from `tpch`.`tiny`.`lineitem` where `partkey` = 272
#create database if not exists talent default charset utf8; #use talent; DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `mobile` char(11) NOT NULL COMMENT '手机号', `auth_key` varchar(32) NOT NULL, `password_hash` varchar(255) NOT NULL, `password_reset_token` ...
CREATE TABLE `tb_permission` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `parent_id` bigint(20) DEFAULT NULL COMMENT '父权限', `name` varchar(64) NOT NULL COMMENT '权限名称', `enname` varchar(64) NOT NULL COMMENT '权限英文名称', `url` varchar(255) NOT NULL COMMENT '授权路径', ...
CREATE TABLE IF NOT EXISTS a_news ( id int(11) AUTO_INCREMENT, subject varchar(256) NOT NULL, entry varchar(1000), created datetime, PRIMARY KEY (id) ); CREATE TABLE IF NOT EXISTS a_admin ( id int(11) AUTO_INCREMENT, username varchar(256), password varchar(2048), PRIMARY KEY (id), UNIQUE KEY(username) );
BEGIN; ALTER TABLE job DROP COLUMN data; COMMIT;
-- ============================================= -- Author: Scott Kirkland -- Create date: 9/15/06 -- Description: -- ============================================= CREATE PROCEDURE [dbo].[usp_deleteSecondaryDepartment] -- Add the parameters for the stored procedure here @Accession char(7), @CRISDeptCd char(4) AS...
DROP DATABASE IF EXISTS employeetracker_db; CREATE database employeetracker_db; USE employeetracker_db; CREATE TABLE department ( id INT NOT NULL AUTO_INCREMENT, department_name VARCHAR(30) NULL, PRIMARY KEY (id) ); CREATE TABLE role ( id INT NOT NULL AUTO_INCREMENT, title VARCHAR(100) NULL, Salary INT ...
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 26 Jul 2021 pada 06.44 -- Versi server: 10.4.18-MariaDB -- Versi PHP: 7.4.18 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C...
-- -- KEY Pushdown Processing. -- This file tests key-pushdown for system table scan. -- -- Different from UserTable, system tables and its indexes are centralized in one tablet. To take -- advantage of this fact, systable-scan queries the data using an INDEX key in one operation. -- Normally it'd take two operations, ...
-- Deploy cd_changeset_status BEGIN; CREATE TYPE cd_changeset_status AS ENUM('open', 'closed'); COMMIT;
DROP TABLE IF EXISTS locations; CREATE TABLE locations ( id SERIAL PRIMARY KEY, search_query VARCHAR(255), formatted_query VARCHAR(255), latitude NUMERIC(10, 7), longitude NUMERIC(10, 7), created_at BIGINT ); DROP TABLE IF EXISTS weather; CREATE TABLE weather ( id SERIAL PRIMARY KEY, search_query VAR...
#아래순서로 테이블생성 및 기초데이터 입력 # ID Generation INSERT INTO IDS(TABLE_NAME,NEXT_ID) VALUES ('BBS_ID',1); INSERT INTO IDS(TABLE_NAME,NEXT_ID) VALUES ('FILE_ID',1); INSERT INTO IDS(TABLE_NAME,NEXT_ID) VALUES ('GROUP_ID',1); INSERT INTO IDS(TABLE_NAME,NEXT_ID) VALUES ('LOGINLOG_ID',1); INSERT INTO IDS(TABLE_NAME,NEXT_ID) VALUES...
WITH raw_events AS ( SELECT type, REPLACE(repo.url, 'https://api.github.com/repos/', '') AS repo, JSON_EXTRACT(payload, '$.action') AS action, cast(JSON_EXTRACT(payload, '$.distinct_size') AS INT64) AS size FROM `githubarchive.day.DAY_ID` WHER...
CREATE TABLE [dbo].[Ticket] ( [TicketId] INT IDENTITY (1, 1) NOT NULL, [UserId] INT NOT NULL, [MovieShowtimeId] INT NOT NULL, [SeatId] INT NULL, CONSTRAINT [PK_Ticket] PRIMARY KEY CLUSTERED ([TicketId] ASC), CONSTRAINT [FK_Ticket_MovieShowtime] FOREIGN KEY ([MovieShowti...
CREATE TABLE Score (Id int IDENTITY NOT NULL, Place int NOT NULL, Points int NOT NULL, ScoreSystemId int NOT NULL, PRIMARY KEY (Id)); CREATE TABLE ScoreSystem (Id int IDENTITY NOT NULL, Name varchar(255) NOT NULL UNIQUE, FastestLapPoints int DEFAULT 0 NOT NULL, PRIMARY KEY (Id)); CREATE TABLE Season (Id int IDENTITY NO...
# Write your MySQL query statement below ​ DELETE FROM PERSON WHERE ID NOT IN( SELECT ID FROM( SELECT   EMAIL, MIN(ID) AS ID FROM   PERSON GROUP BY 1) AS A)
USE [Koski_SA] GO if not exists ( SELECT top 1 * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'sa' AND table_name = 'sa_koski_opiskeluoikeus' AND column_name = 'oppivelvollisuuden_suorittamiseen_kelpaava' ) alter table [sa].[sa_koski_opiskeluoikeus] add [oppivelvollisuuden_suorittamiseen_kelpaava] [in...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 08, 2021 at 02:24 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.2.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIE...
SELECT t.name FROM towns AS t ORDER BY t.name ASC; SELECT d.name FROM departments AS d ORDER BY d.name ASC; SELECT e.first_name, e.last_name, e.job_title, e.salary FROM employees AS e ORDER BY salary DESC;
--create list partiition table with cast function to change time data type to char data type as a partition value create table list_test(id int, test_time time, test_date date, test_timestamp timestamp, primary key(id,test_time)) PARTITION BY LIST (cast(test_time as char(12))) ( PARTITION p0 VA...
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 14, 2020 at 05:32 AM -- Server version: 10.4.6-MariaDB -- PHP Version: 7.3.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
select 1 as id union all select * from {{ ref('node_0') }} union all select * from {{ ref('node_2') }} union all select * from {{ ref('node_70') }} union all select * from {{ ref('node_290') }}
-- -- The contents of this file are subject to the license and copyright -- detailed in the LICENSE and NOTICE files at the root of the source -- tree and available online at -- -- http://www.dspace.org/license/ -- ----------------------------------------------------------------------------------- -- Drop the 'workflo...
alter table broadcasts drop subject, drop audience;
CREATE OR REPLACE function f_alter_ddl (OUT success bool) LANGUAGE plpgsql AS $func$ BEGIN success := TRUE; BEGIN -- this constraint is unnecessary, because notifications can get deleted (e.g. when clearing notifications from previous automated check runs). ALTER TABLE user_email_notification_frequency_last...