sql
stringlengths
6
1.05M
<filename>src/_tree_move.sql DELIMITER $$ DROP FUNCTION IF EXISTS `_tree_move`$$ CREATE FUNCTION `_tree_move`( move_id INT, target_id INT, left_column INT, left_offset INT, level_offset INT ) RETURNS TINYINT(1) READS SQL DATA BEGIN DECLARE _parent_left INT; DECLARE _parent_right INT; ...
<reponame>jedielson/database-cd<gh_stars>0 /****** Object: Table [dbo].[AspNetUserTokens] Script Date: 26/04/2017 11:41:15 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AspNetUserTokens]( [UserId] [nvarchar](450) NOT NULL, [LoginProvider] [nvarchar](450) NOT NULL, [Name] [nvarcha...
<filename>sql/prakpwl-scrapping.sql<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 19, 2021 at 10:22 AM -- Server version: 10.4.17-MariaDB -- PHP Version: 8.0.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+...
use bl_2015_04_film; select * from film; -- svi filmovi sa zanrom, drzavom i reziserom select f.Naziv, z.Naziv as Zanr, f.Godina, d.Naziv as Drzava, concat(r.Prezime, ' ', r.Ime ) as Reziser, f.Zarada from film as f, zanr as z, drzava as d, reziser as r where f.DrzavaId = d.DrzavaId and f.ZanrId = z.ZanrId and...
Insert into eg_roleaction (roleid,actionid) values ((select id from eg_role where name='SYSTEM'), (select id from eg_action where name='generate renewal rejection notice'));
<filename>ewforexdb.sql -- phpMyAdmin SQL Dump -- version 4.8.0.1 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 20-10-2021 a las 20:37:15 -- Versión del servidor: 10.1.32-MariaDB -- Versión de PHP: 7.2.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; ...
SET @sName = 'bx_artificer'; -- page: service blocks SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 0 ORDER BY `order` DESC LIMIT 1); INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system` , `title`, `designbox_id`, `visible_for_levels`, `t...
<filename>invasion.sql -- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Apr 18, 2015 at 11:51 AM -- 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=@@C...
-- Name: example-9b6feb45-2cf0-4505-862b-6adc86111bc1 -- Date: 6/4/2018 2:33:26 AM -- Author: BaoChau ---------------------------- -- Migration up goes here. ---------------------------- ALTER TABLE core_queue_items ADD [RetryCount] INT NOT NULL; --Down-- ---------------------------- -- Migration down goes here. -----...
select utctime,sym from test select utctime,sym from test where sym=`TEST
<gh_stars>1-10 BEGIN; -- Add Author fixtures: contenttype & permissions INSERT INTO django_content_type(app_label, model) VALUES('north_app', 'author'); INSERT INTO auth_permission(codename, name, content_type_id) VALUES('add_author', 'Can add author', (SELECT id FROM django_content_type WHERE app_label = 'north_ap...
-- 数据插入 -- 插入多条数据 INSERT INTO customers( cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country ) VALUES ( '<NAME>', '100 Main Street', 'Los Angeles', 'CA', '90046', 'USA' ), ( '<NAME>', '42 Galaxy Way', 'New York', 'NY', '112...
<filename>sql/soongu/isnull/null처리하기.sql SELECT ANIMAL_TYPE, IFNULL(NAME, "No name") AS NAME, SEX_UPON_INTAKE FROM ANIMAL_INS
<reponame>aydan08/Python-Kursu-15.02.21 -- SQLite INSERT INTO sehirler (isim) VALUES ('Rize')
<filename>sqitch/verify/stories_enhanced_view.sql<gh_stars>1-10 -- Verify scribly:stories_enhanced_view on pg BEGIN; SELECT id, title, current_writer_id FROM stories_enhanced WHERE FALSE; ROLLBACK;
begin; create schema if not exists app; create schema if not exists app_private; -- after schema creation and before function creation alter default privileges revoke execute on functions from public; create or replace function app.set_updated_at() returns trigger as $$ begin new.updated_at := current...
<filename>sql/Dump20211009/matrix_media_media.sql<gh_stars>1-10 -- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64) -- -- Host: 192.168.3.116 Database: matrix_media -- ------------------------------------------------------ -- Server version 8.0.22 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */...
-- MySQL dump 10.13 Distrib 8.0.20, for Linux (x86_64) -- -- Host: 192.168.3.11 Database: inventory_tracker -- ------------------------------------------------------ -- Server version 8.0.18-google /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER...
-- ptrchng.test -- -- execsql { -- SELECT pointer_change(y, 'blob', 'bytes', 'blob') FROM t1 -- } SELECT pointer_change(y, 'blob', 'bytes', 'blob') FROM t1
<reponame>zdoryk/restaraunt-database use resto_zasb; go /* ################# Kwerendy: ################ */ /* 1. Podać ile dań zawierających składnik 'lemon juice' było sprzedano przez pracownika "<NAME>"? */ select count(*) 'liczba dan' from Recipe where ingredient_id in ( select Warehouse.ing...
CREATE DATABASE hmda WITH OWNER = postgres ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'en_US.utf8' LC_CTYPE = 'en_US.utf8' CONNECTION LIMIT = -1; CREATE TABLE public.institutions2018 ( lei character varying NOT NULL, activity_year integer NOT NULL, agency integer ...
<filename>data/db-carpool/load.sql \COPY groups(gid, nickname) FROM 'data/groups.dat' WITH DELIMITER ',' NULL '' CSV \COPY users(email, name, passwordhash) FROM 'data/users.dat' WITH DELIMITER ',' NULL '' CSV \COPY isdrivenby(trip_id, email) FROM 'data/isDrivenBy.dat' WITH DELIMITER ',' NULL '' CSV \COPY ismemberof(ema...
SELECT cast(ar1.stratum_1 AS INT) - MinValue.MinValue AS "intervalIndex", ar1.count_value AS "countValue", round(1.0 * ar1.count_value / denom.count_value, 5) AS "percentValue" FROM (SELECT * FROM @results_database_schema.ACHILLES_results WHERE analysis_id = 3) ar1, ...
/* Extra SQL table for nomination locks. */ CREATE TABLE IF NOT EXISTS nomination_lock ( doc_name TEXT PRIMARY KEY NOT NULL, locked_by TEXT NOT NULL, lock_id TEXT NOT NULL );
<gh_stars>1-10 SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for iot_radar_properties -- ---------------------------- DROP TABLE IF EXISTS `iot_radar_properties`; CREATE TABLE `iot_radar_properties` ( `id` bigint(20) NOT NULL...
-- Remove Feast DELETE FROM applications WHERE name = 'Feast';
<reponame>clouserw/olympia INSERT INTO waffle_flag_mkt (name, everyone, percent, superusers, staff, authenticated, rollout, note, created, modified) VALUES ('allow-b2g-paid-submission', 0, NULL, 0, 0, 0, 0, 'Enable this to allow paid apps in the submission process.', NOW(), NOW()); UPDATE waffle_flag_mkt SET everyo...
CREATE FUNCTION [SqlNet].[CharIsSeparator] (@character NCHAR (1)) RETURNS BIT AS EXTERNAL NAME [SqlNet].[Sql.Net.Types.CharType].[IsSeparator]
<filename>DBATools/Tables/BlitzServerMapping.sql CREATE TABLE [dbo].[BlitzServerMapping]( [ServerName] NVARCHAR(50) NOT NULL, [Alias] NVARCHAR(50) NULL, [SortOrder] INT NULL ) GO ALTER TABLE [dbo].[BlitzServerMapping] ADD CONSTRAINT [PK_BlitzServerMapping] PRIMARY KEY CLUSTERED ( [ServerName] ASC )WITH (PAD_...
<filename>db_scritps/stored_procedures.sql use bodega; drop procedure if exists buscar_usuario; delimiter // create procedure buscar_usuario(in var_usuario varchar(64), in var_clave char(64), out id_usuario int) begin declare usuario_encontrado int default 0; sele...
SELECT VALUE ,LABEL FROM ( SELECT 'U-' || USERS.USER_ID AS VALUE ,USERS.USER_NAME AS LABEL FROM USERS WHERE USERS.DELETE_FLAG != 1 AND USERS.USER_NA...
<filename>db/shopping.sql -- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 23, 2020 at 04:50 PM -- Server version: 10.1.37-MariaDB -- PHP Version: 7.2.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+...
CREATE DATABASE IF NOT EXISTS db_vk;
<reponame>satyajitg2/TokenService /* * SQL Code Generation * Project : Tokenization (v1.0) * * Date Created : Tuesday, Februrary 16, 2016 * Target DBMS : Microsoft SQL Server 2012 * * DB Partioning script * The <FILENAME> is to be defined by Barclays Infrastructure team. */ USE [master] GO ...
SET SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO'; SET time_zone = '+00:00'; -- -- Database: `swim_conf` -- CREATE DATABASE IF NOT EXISTS `swim_conf` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; USE `swim_conf`; -- -- Table structure for table `DIEs` -- CREATE TABLE `DIEs` ( `Core_Familly` int(10) NOT ...
<filename>db-migration/2020-08-29.sql ALTER TABLE `event_images` ADD COLUMN `is_completed` ENUM('1', '0') NULL DEFAULT '0' AFTER `is_default`; ALTER TABLE `event_images` ADD INDEX `index2` (`event_id` ASC, `is_completed` ASC); CREATE TABLE `programs_images` ( `prog_img_id` int(11) NOT NULL AUTO_INCREMENT, `prog...
DROP PROCEDURE IF EXISTS assigncustomercontract; DELIMITER $$ CREATE PROCEDURE assigncustomercontract(p_customers_id CHAR(36),p_contracts_id CHAR(36)) BEGIN UPDATE customers SET customers.contracts_id = p_contracts_id WHERE (customers.id = p_customers_id); END$$ DELIMITER ;
<filename>create_sample_database/install.sql USE cms_shop; -- DROP OLD TABLES IF EXISTS DROP TABLE IF EXISTS `order_products`; DROP TABLE IF EXISTS `orders`; DROP TABLE IF EXISTS `delivery_address`; DROP TABLE IF EXISTS `cart`; DROP TABLE IF EXISTS `products`; DROP TABLE IF EXISTS `product_category`; DROP TABLE IF EXIS...
<gh_stars>0 CREATE DATABASE IF NOT EXISTS `moviesdb` DEFAULT CHARACTER SET utf8 COLLATE utf8_estonian_ci; USE `moviesdb`; -- andmebaasi loomine CREATE TABLE `actor` ( `actor_id` smallint(5) UNSIGNED NOT NULL, `firstname` varchar(50) NOT NULL, `lastname` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8...
-- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 26, 2021 at 01:11 PM -- Server version: 10.4.19-MariaDB -- PHP Version: 7.4.20 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIE...
SET time_zone = "+08:00"; CREATE DATABASE IF NOT EXISTS `example` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- phpMyAdmin SQL Dump -- version 4.6.6deb5 -- https://www.phpmyadmin.net/ -- -- Servidor: localhost:3306 -- Tiempo de generación: 31-03-2019 a las 15:02:17 -- Versión del servidor: 5.7.25-0ubuntu0.18.04.2 -- Versión de PHP: 7.2.15-0ubuntu0.18.04.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*...
<gh_stars>1-10 -- MySQL dump 10.13 Distrib 5.7.21, for macos10.13 (x86_64) -- -- Host: 127.0.0.1 Database: teamUpDb -- ------------------------------------------------------ -- Server version 5.7.21 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTE...
<reponame>ucdavis/StudentService CREATE TABLE [dbo].[DepartmentOverrides] ( [Id] INT NOT NULL PRIMARY KEY IDENTITY, [Subject] VARCHAR(5) NOT NULL, [CourseNumb] VARCHAR(5) NULL, [DepartmentId] VARCHAR(4) NOT NULL )
WITH mycte AS ( SELECT foo, bar, baz FROM mytable1 ) INSERT INTO table2 (column1, column2, column3) SELECT foo, bar, baz FROM mycte;
<gh_stars>10-100 CREATE UNIQUE INDEX rtc_unique_room_id ON rtc (room_id);
CREATE TABLE server ( uuid BINARY(16) NOT NULL, created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (uuid) ) CREATE TABLE player ( uuid BINARY(16) NOT NULL, server BINARY(16) NOT NULL, color VARCHAR(255) NOT NULL,...
/*Table structure for table `hd_admin` */ DROP TABLE IF EXISTS `hd_admin`; CREATE TABLE `hd_admin` ( `admin_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `shop_id` mediumint(8) unsigned NOT NULL, `account` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(200) COLLATE utf8mb4_unicode_ci NOT...
<filename>snowmobile/core/pkg_data/DDL.sql /*- __DDL.sql__ __description***: This script stores the default DDL statements utilized by Snowmobile. - The statement tags include all components (keyword, object, and description) in order to be able to add additional statements as time progresses without worrying about cr...
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[DatabaseBackup] @Databases nvarchar(max) = NULL, @Directory nvarchar(max) = NULL, @BackupType nvarchar(max), @Verify nvarchar(max) = 'N', @CleanupTime int = NULL, @CleanupMode nvarchar(max) = 'AFTER_BACKUP', @Compress nvarchar(max) = ...
-- randexpr1.test -- -- db eval {SELECT case when (case when e between t1.b and c+(select cast(avg( -case c when a then t1.f+c else 17 end) AS integer) from t1) then t1.e when not 19>=t1.a then 17 else d end in (select cast(avg(13) AS integer)-max(11) & +count(*) from t1 union select case (cast(avg(d) AS integer)) whe...
-- Remove mr337 CAC using unique sha256 digest of client cert DELETE FROM client_certs WHERE sha256_digest='6f684e8ed9f697a5b6099f31f5346042db6339ecd8029000df8924369defb069';
<reponame>anhnguyendon92/NExpress-Handlebars USE burgers_db; INSERT INTO burgers (burger_name, devoured) VALUE ('CHEESEBURGER', false); INSERT INTO burgers (burger_name, devoured) VALUE ('HAMBURGER', false); INSERT INTO burgers (burger_name, devoured) VALUE ('<NAME>', false);
<gh_stars>0 INSERT INTO `#__joomlawatch_ip2c` (`start`, `end`, `a2`, `a3`, `country`) VALUES (3265608448, 3265608703, 'SE', 'SWE', 'SWEDEN'), (3265608704, 3265608959, 'GB', 'GBR', 'UNITED KINGDOM'), (3265608960, 3265609215, 'RU', 'RUS', 'RUSSIAN FEDERATION'), (3265609216, 3265609727, 'UA', 'UKR', 'UKRAINE'), (32656...
SELECT TOP(2) DepositGroup FROM WizzardDeposits GROUP BY DepositGroup ORDER BY AVG(MagicWandSize)
<filename>sql-scripts/Clean-Evacuee-Test-Data.sql --Will delete all regisration data BEGIN TRANSACTION -- Delete all addresses DELETE FROM EvacueeRegistrationAddresses FROM EvacueeRegistrationAddresses a INNER JOIN EvacueeRegistrations d ON a.RegistrationId = d.EssFileNumber -- Delete all people recorded DELETE FRO...
select id, identificacion_usuario,valor_gasto,fecha_gasto from gasto
SELECT row_to_json(t) from ( SELECT * FROM pg_stat_all_tables ) t;
-- 将config表的key设置为唯一索引 DROP INDEX idx_sys_config_key; CREATE UNIQUE INDEX idx_sys_config_key ON ${_prefix}sys_config (config_key); -- 新增主导航菜单显示风格配置 INSERT INTO ${_prefix}sys_config(id, config_name, config_key, config_value, is_sys, create_by, create_date, update_by, update_date, remarks) VALUES ('1092344803460943872'...
truncate table os; insert into os (name) values ('Windows'); insert into os (name) values ('OS X'); insert into os (name) values ('CentOS'); insert into os (name) values ('Android'); insert into os (name) values ('iOS');
<gh_stars>1-10 -- SPDX-License-Identifier: Apache-2.0 -- Licensed to the Ed-Fi Alliance under one or more agreements. -- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. -- See the LICENSE and NOTICES files in the project root for more information. -- run report to detect involve...
SELECT sum(ws_ext_discount_amt) AS "Excess Discount Amount " FROM web_sales, item, date_dim WHERE i_manufact_id = 350 AND i_item_sk = ws_item_sk AND d_date BETWEEN cast('2000-01-27' AS DATE) AND (cast('2000-01-27' AS DATE) + INTERVAL '90' day) AND d_date_sk = ws_sold_date_sk AND ws_ext_discount_amt > ( SE...
-------------------------------------------------------------------------- -- test PostGIS data type -------------------------------------------------------------------------- .run ../common/postgresql_setup.sql .debug resultset on CREATE TABLE GeoTable ( a INTEGER, c1 Geography ); .format table .desc GeoTable .des...
<gh_stars>100-1000 ALTER TABLE iam_stanzas RENAME TO iam_statements; ALTER TABLE iam_policy_stanzas RENAME TO iam_policy_statements; ALTER TABLE iam_policy_statements RENAME COLUMN stanza_id TO statement_id; CREATE OR REPLACE FUNCTION query_policy(_policy_id UUID) RETURNS json AS $$ WITH t AS (SELECT p.id...
SELECT pgroonga_escape(29.2929::float8); SELECT pgroonga_escape(-29.2929::float8);
<filename>ExampleDb/1. DatabaseCreate/CreateDatabase.sql IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = N'ExampleDb') BEGIN CREATE DATABASE [ExampleDb] ON PRIMARY ( NAME = N'ExampleDb', FILENAME = N'D:\Databases\ExampleDb.mdf' , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'ExampleDb_l...
insert into sline_car_suit values('1','1','租车','<p>更多租车线路定制服务欢迎拨打:400-609-9927</p>','','','10','1','3','1','0','1','9999','0'); insert into sline_car_suit values('2','3','金龙旅游大巴车30座','<p>特点:该旅游大巴性能优越,车内空间较大,豪华舒适,适合在路面较为平坦的路面行驶。载客数位30人,建议载客人数为29人。</p><p><br/></p><p>适合线路:30座金龙旅游大巴非常适合团队包车出行,还适合成都双流机场接送机,成都市区周边郊线包车服务,四川省内...
<reponame>iliyaST/TelericAcademy<filename>Databases/08.Advanced-SQL/Homework/AdvancedSQL.sql --01.Write a SQL query to find the names and salaries of the employees that take the minimal salary in the company. --Use a nested SELECT statement. SELECT FirstName + ' ' + LastName AS [Empleyee Name], Salary FROM Employe...
<reponame>StraightUpCode/ProjectoADB create view vFactura as Select IdFactura ,F.fecha, U.nombre + ' ' + U.apellido as vendedor, nombreCliente, precioTotal, totalDescontado, cancelado From Factura as F inner join Usuario as U on U.IdUsuario = F.idUsuario go drop view vDetalleFactura go create view vDetalleFactura as S...
-- *************************************************************************** -- File: 14_11.sql -- -- Developed By TUSC -- -- Disclaimer: Neither Osborne/McGraw-Hill, TUSC, nor the author warrant -- that this source code is error-free. If any errors are -- found in this source code, please rep...
INSERT INTO inventories(id,item_id) VALUES (1,1); INSERT INTO inventories(id,item_id) VALUES (2,2); INSERT INTO inventories(id,item_id) VALUES (3,3); INSERT INTO inventories(id,item_id) VALUES (4,4); INSERT INTO inventories(id,item_id) VALUES (5,5); INSERT INTO inventories(id,item_id) VALUES (6,6); INSERT INTO inventor...
-- phpMyAdmin SQL Dump -- version 4.4.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 05, 2016 at 03:52 PM -- Server version: 5.6.26 -- PHP Version: 5.6.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;...
<reponame>Farukcoder/Laravel_File_uploading<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 18, 2021 at 03:49 AM -- Server version: 10.4.18-MariaDB -- PHP Version: 7.4.18 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_...
SET client_min_messages TO warning; CREATE EXTENSION IF NOT EXISTS pgtap; RESET client_min_messages; BEGIN; SELECT no_plan(); -- SELECT plan(1); SELECT pass('Test users_trigger_updated!'); WITH u (id) as ( insert into forum_example.users (first_name,last_name) values ('Hermann','Munster') returning id) se...
# CURDATE() is giving the current DATE # CURTIME() is giving the current TIME # NOW() will give the current current DATE and TIME # formating date and time sometimes we want to have more specialized format for our date and time we can format it using SQL built in function prety straight forward and can be seen in the ...
create table if not exists store( id int(1) not null auto_increment, sname varchar(40) not null, qty int(1) not null, price float not null, primary key (id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7; insert into store (id, sname, qty, price) values (1, 'apple', 10, 1), (2, 'pear', 5, 2), (3, 'banana', 10, 1...
<filename>src/server-test/resources/queries/TEST_DB_QUERY1.sql select 1 as test_column from no_such_table nst where nst.id = 1001 -- dummy sql comment
<reponame>erumd/Travelers-SQL DROP DATABASE IF EXISTS travelers_db; CREATE DATABASE travelers_db; USE travelers_db; CREATE TABLE traveler ( id INTEGER auto_increment NOT NULL, name VARCHAR (30), email VARCHAR (30), primary key (id) ); CREATE TABLE location ( id INTEGER auto_increment NOT NULL, nam...
-- entity_type INSERT INTO meta.entity_type (entity_type_code, name, primary_key_data_type) VALUES ('b', 'Base', 'uuid') , ('ba', 'Abstract Base', 'uuid') , ('s', 'Subtype', 'uuid') , ('r', 'Reference List', 'smallint'); -- schema INSERT INTO meta.schema(schema_name) SELECT s.name AS schema_name FROM...
-- file:cluster.sql ln:145 expect:true CLUSTER
SET search_path = auditsearch, pg_catalog; -- -- Name: cand_audit_vw; Type: VIEW; Schema: auditsearch; Owner: fec -- CREATE VIEW cand_audit_vw AS SELECT cand_valid_fec_yr.cand_id, cand_valid_fec_yr.cand_name, "substring"((cand_valid_fec_yr.cand_name)::text, 1, CASE WHEN (strpos((cand_vali...
<gh_stars>10-100 -- NIBRS Offense Counts select EXTRACT(YEAR FROM NI.INCIDENT_DATE) "DATA_YEAR", RS.STATE_ID, RS.STATE_ABBR, ra.agency_id, ra.ORI, NOFT.OFFENSE_NAME, COUNT(DISTINCT NI.INCIDENT_ID) "INCIDENT_COUNT", COUNT(DISTINCT NOFF.OFFENSE_ID) "OFFENSE_COUNT" from NIBRS_INCIDENT NI JOIN NIBRS_OFFENSE NOFF ON NOFF.IN...
<gh_stars>1-10 -- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 26, 2017 at 08:32 AM -- Server version: 10.1.28-MariaDB -- PHP Version: 7.1.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /...
<reponame>zcavaliero/timescaledb<filename>tsl/test/sql/partialize_finalize.sql -- This file and its contents are licensed under the Timescale License. -- Please see the included NOTICE for copyright information and -- LICENSE-TIMESCALE for a copy of the license. -- TEST1 count with integers create table foo (a integer...
<reponame>dakshika/stratos<gh_stars>0 /* * 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, Versi...
<reponame>rockset/dbt-external-tables<filename>macros/plugins/snowflake/helpers/transaction.sql {% macro snowflake__exit_transaction() %} {{ return('begin; commit;') }} {% endmacro %}
<gh_stars>0 EXEC tSQLt.NewTestClass 'Private_ScriptIndexTests_2014'; GO CREATE PROCEDURE Private_ScriptIndexTests_2014.[test handles clustered columnstore index] AS BEGIN EXEC Private_ScriptIndexTests.[assert index is scripted correctly] @index_create_cmd = 'CREATE CLUSTERED COLUMNSTORE INDEX [Private_Scrip...
SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Records of data_dictionary -- ---------------------------- INSERT INTO `data_dictionary` VALUES ('623', '', null, '2016-08-17 09:29:21', null, null, 'driver_honour_type', '', '0', '6230000', ' 荣誉类型', null, '', null, '', '1'); INSERT INTO `data_dictionary` VAL...
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50725 Source Host : localhost:3306 Source Database : springbootv2 Target Server Type : MYSQL Target Server Version : 50725 File Encoding : 65001 Date: 2019-07-13 02:23:17 */ SET FO...
<reponame>mwalliczek/bumon -- MySQL dump 10.16 Distrib 10.2.22-MariaDB, for Linux (x86_64) -- -- Host: localhost Database: netimond -- ------------------------------------------------------ -- Server version 10.2.22-MariaDB-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHA...
-- ACCESS database script - upgrade to data model version 5 drop table extensioncodes; create table extensioncodes ( nsort integer not null, svalue text(40), svalue_en text(40), field_name text (30) NOT NULL ); -- tabs for extension fields alter table extensioncodes add constraint extensioncodesPK prima...
# --- !Ups create table uploaded_files ( id bigint primary key auto_increment not null, name varchar(255) not null, word_count int not null ); create table counts ( id bigint primary key auto_increment not null, file_id bigint not null, foreign key (file_id) references uploaded_files(id), ...
-- -- 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: test; Type: SCHEMA; Schema: -; Owner: galiev_mr -- CREATE SCHEMA test; ALTER SCHEM...
<reponame>hbraha/ovirt-engine Create or replace FUNCTION InsertDiskVmElement( v_disk_id UUID, v_vm_id UUID, v_is_boot boolean, v_pass_discard boolean, v_disk_interface VARCHAR(32), v_is_using_scsi_reservation boolean) RETURNS VOID AS $procedure$ BEGIN INSERT INTO disk_vm_element ( di...
UPDATE "selfservice_registration_flows" SET "internal_context" = "_internal_context_tmp";
<filename>src/test/regress/sql/gp_constraints.sql<gh_stars>1-10 -- -- CONSTRAINTS -- As of Postgres 9.2, the executor provides details in errors for offending -- tuples when constraints are violated during an INSERT / UPDATE. However, we -- are generally masking out these details (using matchsubs) in upstream tests -- ...
-- @testpoint: Hash分区表中查看分区信息 --step1:创建hash分区表 expect:成功 drop table if exists t_partition_hash_0081_01; create table t_partition_hash_0081_01( id int, name varchar(100), age int) partition by hash(id) (partition p1, partition p2); --step2:插入数据 expect:成功插入四条数据 insert into t_partition_hash_0081_01 values( 1, '张三', 2...
/* SQLyog Trial v13.1.8 (64 bit) MySQL - 10.4.22-MariaDB : Database - nomina ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOR...
<gh_stars>0 CREATE TABLE Users ( Id int IDENTITY(1,1) UNIQUE, Username NVARCHAR(30) UNIQUE NOT NULL, Password NVARCHAR(26) NOT NULL, ProfilePicture VARBINARY CHECK(DATALENGTH(ProfilePicture)<900*1024), LastLoginTime DATE, IsDeleted NVARCHAR(5) NOT NULL CHECK(IsDeleted='true' OR isDeleted='false') ) INSERT INTO ...
<reponame>razorops-public/clojure-guestbook-demo<gh_stars>0 -- :name create-user! :! :n -- :doc creates a new user record INSERT INTO users (id, first_name, last_name, email, pass) VALUES (:id, :first_name, :last_name, :email, :pass) -- :name update-user! :! :n -- :doc updates an existing user record UPDATE users SET ...