text
stringlengths
1
1.05M
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 14, 2018 at 04:29 AM -- Server version: 10.1.36-MariaDB -- PHP Version: 7.2.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
USE [Koski_SA] GO /****** Object: Table [dbo].[tutkinnot_ja_tutkinnonosat_valitaulu] Script Date: 25.10.2019 10:58:40 ******/ DROP TABLE IF EXISTS [dbo].[tutkinnot_ja_tutkinnonosat_valitaulu] GO /****** Object: Table [dbo].[tutkinnot_ja_tutkinnonosat_valitaulu] Script Date: 25.10.2019 10:58:40 ******/ SET ANSI_...
DELETE FROM `e10_world_countries`; INSERT INTO `e10_world_countries` VALUES (1,'abw','AW','ABW',533,'Aruba','Aruba','🇦🇼',0,'.aw','297',NULL,NULL), (2,'afg','AF','AFG',4,'Afghanistan','Islamic Republic of Afghanistan','🇦🇫',1,'.af','93',NULL,NULL), (3,'ago','AO','AGO',24,'Angola','Republic of Angola','🇦🇴',1,'.ao',...
negative_gaps -168263.9 -395344.2 -34618.7 -4793.09999999998 -19053.7000000001 -29615.1000000001 -366469 -51623.1999999997 -101325 -260452.8 -248448.8 -2625.30000000005 -18068.5 -1900.69999999998 -426686.5 -5292.19999999995 -315315 -18087.0999999999 -4576 -114331.4 -310955.7 -1669012 -597219.7 -404713.3 -112415.5 -5817...
.bail on .echo on BEGIN TRANSACTION; -- The users table stores information on cmail users -- user_name User handle -- user_authdata Password salt and hash in the format -- <salt>:<sha256(salt + password)> -- user_database Path to a user database if on is to be loaded -- user_alias If this account sh...
-- -- TIMESTAMPTZ -- -- needed so tests pass even in Australia SET australian_timezones = 'off'; CREATE TABLE TIMESTAMPTZ_TBL ( d1 timestamp(2) with time zone); INSERT INTO TIMESTAMPTZ_TBL VALUES ('now'); INSERT INTO TIMESTAMPTZ_TBL VALUES ('current'); INSERT INTO TIMESTAMPTZ_TBL VALUES ('today'); INSERT INTO TIMESTA...
create index char1_idx on test2 (col_char_1);
-- for mysql -- 说明: 生成指定时间范围的随机时间 -- 使用例子: select rand_date(STR_TO_DATE('2018-05-21 23:59:59', '%Y-%m-%d %H:%i:%s'), now()); -- 输出 2019-07-13 16:22:44 delimiter $$ create function rand_date(start_time TIMESTAMP, end_time TIMESTAMP) RETURNS TIMESTAMP NO SQL BEGIN DECLARE tmp_year INT(4) DEFAULT 1970; DECLARE ...
/* RETURN ExceptionType ID INT NOT Type NVARCHAR(25) NOT Name NVARCHAR(50) NOT */ DROP PROCEDURE IF EXISTS `GetExceptionTypes`; CREATE PROCEDURE `GetExceptionTypes` () #BEGIN# SELECT It.Id, It.Type, It.Name FROM IgnoreType I...
CREATE DATABASE ColonialJourney GO USE ColonialJourney GO ------ --1 DDL CREATE TABLE Planets (Id INT PRIMARY KEY IDENTITY NOT NULL, [Name] NVARCHAR(30) NOT NULL) CREATE TABLE Spaceports (Id INT PRIMARY KEY IDENTITY NOT NULL, [Name] NVARCHAR(50) NOT NULL, PlanetId INT REFERENCES Planets(Id) NOT NULL) CREAT...
/* contrib/adminpack/adminpack--1.0.sql */ -- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION adminpack" to load this file. \quit /* *********************************************** * Administrative functions for PostgreSQL * ***************************************...
SELECT month, COUNT(Distinct user_id) FROM api_requestlog l JOIN ( SELECT to_char(created_at, 'YYYY-MM') as month FROM api_requestlog GROUP BY month ) as m on to_char(l.created_at, 'YYYY-MM') <= m.month GROUP BY month ORDER BY month;
DROP TABLE IF EXISTS `test_025`;
-- -- PostgreSQL database dump -- -- Dumped from database version 10.3 -- Dumped by pg_dump version 10.3 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', '', fal...
-- name: create-table-files CREATE TABLE IF NOT EXISTS files ( file_id INTEGER PRIMARY KEY AUTO_INCREMENT ,file_build_id INTEGER ,file_proc_id INTEGER ,file_name VARCHAR(250) ,file_mime VARCHAR(250) ,file_size INTEGER ,file_time INTEGER ,file_data MEDIUMBLOB ,UNIQUE(file_proc_id,file_name)...
-- DRILL-3211 (requires group by) select sum(a2), sum(a2) over(partition by b2) from t2 group by b2;
CREATE EXTENSION IF NOT EXISTS postgis_raster; SET postgis.gdal_enabled_drivers = 'ENABLE_ALL'; SET postgis.enable_outdb_rasters = True; CREATE SCHEMA IF NOT EXISTS loadtmp AUTHORIZATION admin;
4.911448 0.500000 8.157599e-05 -3.497399e+01 2.718193e-02 1.000000e+00 4.914343 0.500000 8.150953e-05 -3.496433e+01 2.716985e-02 1.000000e+00 4.917241 0.500000 8.148415e-05 -3.496069e+01 2.716548e-02 1.000000e+00 4.920140 0.500000 8.142715e-05 -3.495254e+01 2.715595e-02 1.000000e+00 4.923041 0.500000 8.139904e-05 -...
SELECT hasAny([['Hello, world']], [[[]]]); SELECT hasAny([['Hello, world']], [['Hello', 'world'], ['Hello, world']]); SELECT hasAll([['Hello, world']], [['Hello', 'world'], ['Hello, world']]);
DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户id', `name` varchar(100) NOT NULL COMMENT '用户名', `password` char(50) NOT NULL COMMENT '密码', `email` varchar(100) DEFAULT '' COMMENT '邮箱', `phone` char(11) DEFAULT '' COMMENT '电话', `type` tinyint(1) u...
-- @author prabhd -- @created 2014-04-01 12:00:00 -- @modified 2012-04-01 12:00:00 -- @tags dml MPP-21090 ORCA -- @optimizer_mode on -- @description Tests for MPP-21090 \echo --start_ignore set gp_enable_column_oriented_table=on; \echo --end_ignore DROP TABLE IF EXISTS mpp21090_drop_firstcol_dml_decimal; CREATE TABLE...
SELECT CountryCode, COUNT(MountainId) AS MountainRanges FROM MountainsCountries WHERE CountryCode IN ('BG', 'RU', 'US') GROUP BY CountryCode
-- Xóa Quản trị viên -- -- usp_deleteManager '025022111' Create Procedure usp_deleteManager @id nchar(10) As Begin Delete From QuanTriVien Where CMND = @id End
use payroll execute p_add_time_entry @employee_id=27, @entry_date='2019-11-12 00:00:00', @hours_worked=6 execute p_add_time_entry @employee_id=14, @entry_date='2019-11-12 00:00:00', @hours_worked=5 execute p_add_time_entry @employee_id=45, @entry_date='2019-11-12 00:00:00', @hours_worked=5 execute p_add_time_entry @e...
/* Navicat Premium Data Transfer Source Server : 阿里云mysql Source Server Type : MySQL Source Server Version : 50651 Source Host : 39.99.214.230:3306 Source Schema : seckill Target Server Type : MySQL Target Server Version : 50651 File Encoding : 65001 Date: 20/02/2022...
/* INSERT ---------------------------------------------------------------------- INSERT INTO table_name (column1,column2,column3,...) VALUES ('value1','value2','value3',...); *********************************************************************/ USE labpetri /* UNIVERSITIES OF CALIFORNIA ******************************...
USE `cjms`; UPDATE `journeys` SET `purpose` = (CASE WHEN `id` % 2 = 0 THEN 'Medical' WHEN `id` % 3 = 0 THEN 'Technical' WHEN `id` % 5 = 0 THEN 'Educational' WHEN `id` % 7 = 0 THEN 'Military' ELSE `purpose` END);
-- this function compares 'shards' to each other for the past day, this is the best indication that something got wrong in -- one of the shards, like a missing index (e.g. an index that became invalid during rebuild)   CREATE OR REPLACE FUNCTION sprocs_compare_shards_last_day( IN p_date timestamp without time...
--conversion from date/time to enum create table t1 (dt1 timestamp, dt2 datetime, dt3 date, dt4 time); insert into t1 values ('11:00:00 AM 02/21/2012', '01:13:13.000 PM 12/21/2012', '12/21/2012', '02:29:00 PM'); insert into t1 values ('11:11:11 AM 12/22/2010', '01:13:13.000 PM 12/11/1981', '08/08/2008', '01:02:03 PM');...
CREATE TABLE xmltest ( id int, data xml ); INSERT INTO xmltest VALUES (1, '<value>one</value>'); INSERT INTO xmltest VALUES (2, '<value>two</value>'); INSERT INTO xmltest VALUES (3, '<wrong'); SELECT * FROM xmltest; SELECT xmlcomment('test'); SELECT xmlcomment('-test'); SELECT xmlcomment('test-'); SELECT xm...
CREATE PROC dbo.LastGoodCheckDBThresholds_Upd( @InstanceID INT, @DatabaseID INT, @WarningThreshold INT=NULL, @CriticalThreshold INT=NULL, @Inherit BIT=0, @MinimumAge INT=NULL, @ExcludedDatabases NVARCHAR(MAX)=NULL ) AS SET XACT_ABORT ON BEGIN TRAN DELETE dbo.LastGoodCheckDBThresholds WHERE InstanceID = @Instan...
INSERT INTO public.publicated_stories (id_publicated_stories, id_user, id_stories) VALUES (1, 1, 1); INSERT INTO public.publicated_stories (id_publicated_stories, id_user, id_stories) VALUES (19, 2, 2); INSERT INTO public.publicated_stories (id_publicated_stories, id_user, id_stories) VALUES (20, 3, 2); INSERT INTO pub...
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[archiveAuditLog] AS DECLARE @exectime DATE; SET @exectime = GETDATE(); PRINT 'Backing up data' -- Insert all the records that are past last 3 months into the Audit backup tables INSERT INTO dbo.[AuditLogsBackup] SELECT * FROM dbo.[AuditLogs] AL...
EXEC ('DROP VIEW IF EXISTS [zno$(ZnoYear)].[Schools]') GO CREATE VIEW [zno$(ZnoYear)].[Schools] AS SELECT * FROM [dbo].[Schools] WHERE ZnoYear = '$(ZnoYear)' GO
[playlist] File1=http://ice1.somafm.com/u80s-128-aac Title1=Soma FM - Underground 80s NumberOfEntries=1 Length1=-1 Version=2
INSERT INTO ticket_types (ticket_type_code, ticket_type_name, description, includes_workshop) VALUES ('P', 'Premium', 'Access to all conference events plus attend the workshop of your choice.', TRUE), ('S', 'Standard', 'Access to all conference keynotes, sessions, community open spaces and the exhibition hall.',...
CREATE TABLE game ( id integer primary key, gameName text not null, user_id integer not null, date timestamp not null, score integer, duration numeric, success integer, foreign key(user_id) references user(id) ); CREATE TABLE game_log ( id integer primary key, game_id integer not null, timestamp numeric, an...
-- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Oct 19, 2017 at 07:01 PM -- Server version: 5.6.17 -- PHP Version: 5.5.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;...
-- The database update has been implemented in org.jivesoftware.database.bugfix.OF33.java -- Update version UPDATE ofVersion SET version = 21 WHERE name = 'openfire';
CREATE TABLE `tb_games` ( `id` int(11) NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci NOT NULL, `price` decimal(9,2) NOT NULL, `developer` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `release_date` date NOT NULL DEFAULT '1111-11-11' ) ENGINE=Inn...
CREATE TABLE GENE_LOCATION_CONFIGURATION ( ID BIGINT NOT NULL AUTO_INCREMENT, GENOME_BUILD_VERSION VARCHAR(25), STATUS VARCHAR(45), STATUS_DESCRIPTION VARCHAR(255), PRIMARY KEY (ID) ) ENGINE = InnoDB; CREATE TABLE GENE_CHROMOSOMAL_LOCATION ( ID BIGINT NOT NULL AUTO_INCREMENT, GENE_SYMBOL VARCHA...
--test TIMESTAMPTZ column, with group by clause set system parameters 'tz_leap_second_support=yes'; drop table if exists tz_test; create table tz_test(id int primary key auto_increment, col1 timestamp with time zone not null default timestamptz'2014-09-01 2:00:20 Asia/Shanghai', col2 timestamp with time zone); set t...
-- Verify manygolf:appschema on pg BEGIN; SELECT pg_catalog.has_schema_privilege('manygolf', 'usage'); ROLLBACK;
-- DropIndex DROP INDEX `Users.password_unique` ON `Users`;
-- Department seed INSERT INTO department (name) VALUES ("Executive"), ("Finance"), ("Human Resources"), ("Information Technology"), ("Operations"), ("Sales"); SELECT * FROM department; -- Role Seed' s INSERT INTO role (title, salary, department_id) VALUES ("Regional Manager", 180000.00, 1), ("Assistant to ...
select count(*) from nulls3 where float_11 <> 1.0 49
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1:3306 -- Généré le : mer. 15 avr. 2020 à 12:35 -- Version du serveur : 5.7.19 -- Version de PHP : 7.1.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET...
-- phpMyAdmin SQL Dump -- version 5.0.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 30, 2021 at 05:35 PM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.4.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIE...
insert into PROSESS_TASK_TYPE (kode, navn, feil_maks_forsoek, feilhandtering_algoritme, beskrivelse) values ('formidling.tilknyttVedlegg', 'Tilknytte vedlegg', 2, 'DEFAULT', 'Tilknytte vedlegg til et allerede journalført brev'); insert into PROSESS_TASK_TYPE (kode, navn, feil_maks_forsoek, feilhandtering_algoritme, be...
 --Написать запрос получение всех продуктов с типом "СЫР" SELECT products.product_name,typeprod.type_name,products.expired_date,products.price FROM table_type AS typeprod LEFT JOIN table_product as products ON typeprod.type_id = products.type_id WHERE (typeprod.type_name = 'Сыр'); --Написать запрос получения всех пр...
INSERT INTO chat."FlagType" (name, description) VALUES ('Abusive', 'It''s abusive or harmful.'), ('Spam', 'It''s spam, suspicious or annoying.'), ('Risk_To_Life', 'It expresses intentions of self-harm or suicide.'), ('Disinformation', 'It contains false information and is intended to mislead readers.'), ('Mis...
-- 115 Number of persons with observation period end < start select 115 as analysis_id, cast(null as varchar(255)) as stratum_1, cast(null as varchar(255)) as stratum_2, cast(null as varchar(255)) as stratum_3, cast(null as varchar(255)) as stratum_4, cast(null as varchar(255)) as stratum_5, COUNT_BIG(op1.PERSON_I...
/* Navicat Premium Data Transfer Source Server : 106.14.69.75 Source Server Type : MySQL Source Server Version : 50720 Source Host : 106.14.69.75 Source Database : pig Target Server Type : MySQL Target Server Version : 50720 File Encoding : utf-8 Date: 03/27/2018 08:45...
SET NOCOUNT ON DECLARE @ProcessorNameString NVARCHAR(512) DECLARE @SystemManufacturer NVARCHAR(512) DECLARE @SystemProductName NVARCHAR(512) DECLARE @IsAgentRunning BIT DECLARE @InstantFileInitializationEnabled BIT IF OBJECT_ID('sys.xp_instance_regread') IS NOT NULL AND IS_SRVROLEMEMBER('sysadmin')=1 BEGIN EXEC sys...
-- MariaDB dump 10.17 Distrib 10.4.6-MariaDB, for Linux (x86_64) -- -- Host: 198.211.100.224 Database: BDMOBILIEN -- ------------------------------------------------------ -- Server version 5.7.30-0ubuntu0.18.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RES...
CREATE TABLE IF NOT EXISTS users ( user_id bigint NOT NULL AUTO_INCREMENT, username varchar(128) NOT NULL, password varchar(255) NOT NULL, github_handle varchar(64) NOT NULL, created_date datetime NOT NULL, last_login_date datetime NOT NULL, PRIMARY KEY (user_id) );
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 14, 2021 at 02:30 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
SET NOCOUNT ON; IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='dbo' AND TABLE_NAME='v_GS_AntimalwareHealthStatus' AND COLUMN_NAME='AntivirusSignatureAge') BEGIN EXEC (' WITH siteavcompliance AS ( SELECT SMS_Assigned_Sites0 AS SiteCode, Sum(CASE ...
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 5.7.9 - MySQL Community Server (GPL) -- Server OS: Win64 -- HeidiSQL Version: 9.3.0.4984 -- -------------------------------------------------------- /*!...
delete from ACT_RU_VARIABLE where TYPE_ in ('item', 'message') and BYTEARRAY_ID_ is null and DOUBLE_ is null and LONG_ is null and TEXT_ is null and TEXT2_ is null; delete from ACT_RU_VARIABLE where TYPE_ = 'null' and NAME_ in ('org.activiti.engine.impl.bpmn.CURRENT_MESSAGE', 'org.flowable.engine.impl.bpmn...
CREATE TABLE subdivision_IN (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id)); INSERT INTO "subdivision_IN" ("id", "name", "level") VALUES (E'IN-AN', E'Islas Andamán y Nicobar', E'union territory'); INSERT INTO "subdivision_IN" ("id", "name", "level") VALUES (E'IN-AP', E'Andhra P...
CREATE DATABASE IF NOT EXISTS cococaca; USE cococaca; CREATE TABLE IF NOT EXISTS T_SUBSCRIBER (ID INT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR (128), PASSWORD VARCHAR (128), GENDER VARCHAR (32), AVATAR_ID VARCHAR (128)); CREATE TABLE IF NOT EXISTS TC_FOLLOWSHIP (FOLLOWEE_ID VARCHAR (128), FOLLOWER_ID VARCHAR (128));...
INSERT INTO pos_itemtemp VALUES("IBIPT190000090","193040","191001","192008","20000","1","20000","0","20000","1","1","1","IBIP1006190835","NHO2018000009","PAID","","193040"), ("IBIPT190000091","193001","191001","192001","30000","1","30000","0","30000","1","1","1","IBIP1006190835","NHO2018000009","PAID","ramen beef","193...
SELECT tab0.v1 AS v1 , tab6.v7 AS v7 , tab4.v5 AS v5 , tab5.v6 AS v6 , tab3.v4 AS v4 , tab8.v9 AS v9 , tab2.v3 AS v3 , tab7.v8 AS v8 , tab1.v2 AS v2 FROM (SELECT obj AS v1 FROM sorg__contactPoint$$1$$ WHERE sub = 'wsdbm:Retailer900' ) tab0 JOIN (SELECT sub AS v1 , obj AS v2 FROM wsdbm__friendOf$$2$...
alter table "public"."turns" add constraint "turns_round_id_fkey" foreign key ("round_id") references "public"."rounds" ("id") on update restrict on delete restrict;
-- file:foreign_data.sql ln:812 expect:true REVOKE ALL ON FOREIGN DATA WRAPPER postgresql FROM regress_unprivileged_role
# Dump of table hisiphp_admin_annex # ------------------------------------------------------------ DROP TABLE IF EXISTS `hisiphp_admin_annex`; CREATE TABLE `hisiphp_admin_annex` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '关联的数据ID', `type` varchar(20...
/* * This file contains intentionally invalid SQL to test error handling logic. */ CREATE TABEL invalid (id INT);
DO $do$ BEGIN IF NOT EXISTS ( select column_name FROM information_schema.columns where table_name='forms' and column_name='modified' ) THEN alter table forms add column modified timestamp default current_timestamp; END IF; END $do$ ;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SE...
-- fts1c.test -- -- execsql { -- SELECT snippet(email) FROM email -- WHERE email MATCH 'chris is here' -- } SELECT snippet(email) FROM email WHERE email MATCH 'chris is here'
CREATE OR REPLACE FUNCTION prd.crear_lote_v2(p_lote_id character varying, p_arti_id integer, p_prov_id integer, p_batch_id_padre bigint, p_cantidad double precision, p_cantidad_padre double precision, p_num_orden_prod character varying, p_reci_id integer, p_etap_id integer, p_usuario_app character varying, p_empr_id in...
select count(*) from cast_tbl_1 a, cast_tbl_2 b where a.d28 = b.c_double;
-- start_ignore SET gp_create_table_random_default_distribution=off; -- end_ignore CREATE TABLE resync_heap_analyze1( text_col text, bigint_col bigint, char_vary_col character varying(30), numeric_col numeric, int_col int4, float_col float4, int_array_col int[], drop_col numeric, before_rename_col int4, change_datatyp...
# 마치며 - 데이터 마트 ##분석 목적에 맞게 데이터를 가공한 분석용 세트 -- 분석목적 : 2020년 주문금액 및 건수를 회원 프로파일 USE sql_p; SELECT * FROM sorder; #1 SELECT mem_no, SUM(sales_amt) AS tot_amt, COUNT(order_no) AS order_counts FROM sorder WHERE YEAR(order_date) = 2020 GROUP BY mem_no; #2 SELECT * FROM smember A LEFT JOIN (SELECT mem_no, SUM(sales_amt) AS t...
SELECT name FROM Pokemon WHERE type = 'Grass' ORDER BY name; SELECT name FROM Trainer WHERE hometown = 'Brown City' OR hometown = 'Rainbow City' ORDER BY name; SELECT DISTINCT type FROM Pokemon ORDER BY type; SELECT name FROM City WHERE name LIKE 'B%' ORDER BY name; SELECT hometown FROM Trainer WHERE name NOT LIK...
-- -- PostgreSQL database dump -- -- Dumped from database version 9.6.1 -- Dumped by pg_dump version 9.6.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 search_path = publi...
/* Execute sql script to deploy a large data sample
CREATE TABLE IF NOT EXISTS heimdali_config ( config_key VARCHAR(255) NOT NULL, config_value VARCHAR(255) NOT NULL, PRIMARY KEY (config_key)); INSERT INTO heimdali_config (config_key, config_value) SELECT 'nextgid', coalesce(max(cast(`value` as unsigned)), 1039493) + 1 from ldap_attribute where `key` = 'gidNumber...
CREATE VIEW SpotifyClone.top_3_artistas AS SELECT a.artista, s.seguidores FROM SpotifyClone.artistas AS a INNER JOIN (SELECT artista_id, COUNT(*) AS seguidores FROM SpotifyClone.usuario_artistas GROUP BY artista_id) AS s ON s.artista_...
create keyspace if not exists pluralsight with replication = {'class':'SimpleStrategy', 'replication_factor':1}; use pluralsight; CREATE TABLE IF NOT EXISTS course_page_views ( course_id varchar, view_id timeuuid, PRIMARY KEY (course_id, view_id) ) WITH CLUSTERING ORDER BY (view_id desc ); insert into cou...
# Wiktionary *dk http://wiktionary.org/ CC BY-SA 01532261-a *dk:lemma fornuftig
CREATE FUNCTION func363() RETURNS integer LANGUAGE plpgsql AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE149);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE26);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE214);val:=(SELECT COUNT(*)INTO MYCOUN...
##根据学校ID,状态获取对应的school_book count #macro($getSchoolBookByStatus(schoolId,status)) SELECT count(*) FROM school_book where school_id =:schoolId and status =:status #end
--$Id$ alter table WF_PROC_APP_FOLDER alter column FOLDER_ID uniqueidentifier not null^ alter table WF_PROC_APP_FOLDER add primary key (FOLDER_ID);
CREATE FUNCTION get_basnished_emails_from_password_recovery() RETURNS TABLE AS RETURN SELECT email FROM password_recovery_attempts WHERE DATEDIFF(HOUR, date, GETDATE()) < 24 GROUP BY email HAVING COUNT(attempt_id) >= 100
insert into table public.test values (1); insert into table public.test values (2);
DROP TABLE IF EXISTS Marks; CREATE TABLE Marks ( CourseCode VARCHAR(10) NOT NULL REFERENCES Courses(CourseCode), Id BIGINT NOT NULL REFERENCES Students(Id), Result SMALLINT NOT NULL DEFAULT 0, PRIMARY KEY (CourseCode, Id, Result) ); ALTER TABLE Marks OWNER TO webd420...
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50505 Source Host : localhost:3306 Source Database : tracuunhanh Target Server Type : MYSQL Target Server Version : 50505 File Encoding : 65001 Date: 2017-05-10 16:52:58 */ SET FOREIGN_KEY_CHECKS=0; ...
#--SHOW TABLES; #--SHOW DATABASES; #--DROP DATABASE mydb; #--1. Creating the Database CREATE DATABASE mydb; USE mydb; #--2. Creating the table CREATE TABLE Book (`ID` INT PRIMARY KEY AUTO_INCREMENT, `Title` VARCHAR(100), `Author` VARCHAR(40), `Pages` INT, `Price` FLOAT, `GENRE` VARCHAR(30)); ...
/* Copyright (c) 2006-2012 Regents of the University of Minnesota. For licensing terms, see the file LICENSE. */ /* NOTE: This script needs to be run as postgres. */ BEGIN TRANSACTION; DROP SCHEMA minnesota; ALTER TABLE upgrade_event DROP COLUMN schema; COMMIT;
INSERT INTO burger (burger_name) VALUES ("Bacon Cheese Burger"); INSERT INTO burger (burger_name) VALUES ("White Cheddar Burger"); INSERT INTO burger (burger_name) VALUES ("Veggie Tofu Burger - Vegan Friendly"); INSERT INTO burger (burger_name) VALUES ("Bacon Cheese Burger"); INSERT INTO burger (burger_name) VALUES ("W...
-- Start of IDENTITY Tables-- CREATE TABLE IDN_BASE_TABLE ( PRODUCT_NAME VARCHAR (20) NOT NULL, PRIMARY KEY (PRODUCT_NAME)) / INSERT INTO IDN_BASE_TABLE values ('WSO2 Identity Server') / CREATE TABLE IDN_OAUTH_CONSUMER_APPS ( ID INTEGER NOT NULL, CONSUMER_KEY VARCHAR (255...
-- -- CREATE_INDEX -- Create ancillary data structures (i.e. indices) -- -- -- BTREE -- CREATE INDEX onek_unique1 ON onek USING btree(unique1 int4_ops); CREATE INDEX IF NOT EXISTS onek_unique1 ON onek USING btree(unique1 int4_ops); CREATE INDEX IF NOT EXISTS ON onek USING btree(unique1 int4_ops); CREATE INDEX onek_...
use industry; drop table co2; create table co2( id int(4) not null primary key auto_increment, province varchar(10) not null, year char(4) not null, coal double(20,8) default 0.00, refine_coal double(20, 8) default 0.00, other_coal double(20, 8) default 0.00, briquette double(20, 8) default ...
SELECT 1 AS DomainID, Domain FROM system.one ANY LEFT JOIN ( SELECT 1 AS DomainID, 'abc' AS Domain UNION ALL SELECT 2 AS DomainID, 'def' AS Domain ) USING DomainID;
alter table "public"."metadata" alter column "appliences_included" drop not null; alter table "public"."metadata" add column "appliences_included" bool;
-- MATERIALIZED VIEW AND INDEXES FOR VIRUS 186539 AND PROTEIN nucleoprotein CREATE MATERIALIZED VIEW public.epitope_186539_nucleoprote TABLESPACE default_ts AS SELECT DISTINCT epi.iedb_epitope_id, epi.epitope_iri, epi.cell_type, epi.mhc_class, epi.mhc_allele, epi.response_frequency_pos, epi...
-1:1:0:228 0:var0:undefined 17:dewpt:dew point [K] 47:av_sfc_sw_dif:average surface shortwave diffuse radiation flux [W m-2] 57:accum_evap:accumulated evaporation [kg m-2] 58:accum_evap_sea:accumulated evaporation over open sea [kg m-2] 61:accum_prcp:accumulated precipitation [kg m-2] 115:av_sfc_sw_dir:average surface ...
# users schema # profiles schema # cohorts schema # cohort_members schema # content_assigned schema # content_assigned_cohorts schema # content_folders schema # content_packages schema # content_assigned_packages schema # content_items schema # content_assessment_questions schema # content_assessment_answers schema # c...