sql
stringlengths
6
1.05M
-- system_patches INSERT INTO `system_patches` (`issue`, `created`) VALUES ('POCOR-3857', NOW()); -- config_items #get the first level as initial value SELECT `level` INTO @HighestAreaLevel FROM `area_levels` ORDER BY `level` LIMIT 1; INSERT INTO `config_items` (`id`, `name`, `code`, `type`, `label`, `value`, `defa...
CREATE TABLE public.weather (address varchar(255)); insert into public.weather values ('<EMAIL>'); insert into public.weather values ('<EMAIL>'); SELECT EMAIL(weather.address, 'WEATHER ALERT', false, 'THERE IS A WEATHER WARNING') FROM weather;
<reponame>kujilabo/cocotola-api<filename>sqls/mysql/2020050204_create_audio.up.sql create table `audio` ( `id` int auto_increment ,`lang` varchar(5) character set ascii ,`text` varchar(100) character set ascii not null ,`audio_content` text character set ascii not null ,primary key(`id`) ,unique(`lang`, `text`) );
<filename>database/ashvigil.sql<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: May 21, 2018 at 09:04 PM -- Server version: 10.1.26-MariaDB -- PHP Version: 7.1.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SE...
<gh_stars>0 -- Beite / overflatedyrka produserer kjøtt/melk (areas producing meat/milk) -- Jordbruk, fulldyrka, overflatedyrka or innmarksbeit then 0 -- TODO: CHECK -- if a lot of milk production use 100 DROP TYPE mess.function_3_2_2_type cascade; CREATE TYPE mess.function_3_2_2_type AS ( gid bigint, value i...
<gh_stars>0  CREATE PROCEDURE [dbo].[app_ProgramCodes_AssignCodeForPatron] ( @PID INT, @PatronId INT ) AS DECLARE @PCID INT SELECT TOP 1 @PCID = PCID FROM ProgramCodes WHERE PID = @PID AND isUsed = 0 ORDER BY PCID UPDATE ProgramCodes SET isUsed = 1, DateUsed = GETDATE(), PatronId = @PatronId WHERE PCID = @PCID...
<filename>DatabaseWowMacroEditor/Schema Objects/Database Level Objects/Security/Schemas/aspnet_Roles_FullAccess.schema.sql CREATE SCHEMA [aspnet_Roles_FullAccess] AUTHORIZATION [WowMacroEditorUser];
<reponame>SQLAdrian/sql-server-samples<filename>samples/features/security/code-snacks/sqlonlinux/advanced-security/SQL Resources/Explore Data with RLS.sql USE [AdventureWorks] GO -- Query the table as usual: observe that no rows are returned because no login ID context is set SELECT * FROM HumanResources.Employee; ...
ALTER TABLE messages ADD CONSTRAINT user_fkey FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE;
<filename>cassandra/cql/create_if_doesnot_exist/ig_jobs_dev.cql // GENERATED using CqlScriptsGeneratorMain.java // Keyspace: ig_jobs CREATE KEYSPACE IF NOT EXISTS ig_jobs WITH replication = { 'class': 'SimpleStrategy', 'replication_factor' : 1 }; USE ig_jobs; CREATE TABLE IF NOT EXISTS current_jobs ( job_id...
CREATE TABLE [dbo].[Adverts] ( [ContentItemID] [int] NOT NULL, [PlainTextRepresentation] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[Adverts] ADD CONSTRAINT [PK_Adverts] PRIMARY KEY CLUSTERED ([ContentItemID]) ON [PRIMARY] GO GRANT INSERT ON [dbo].[Adverts] TO [ssc_webapplica...
-- 삭제 구문 drop table post; drop sequence post_seq; -- 게시글 테이블 create table post( post_no number(19) primary key, post_client_no references client(client_no) on delete set null, post_board_no references board(board_no) on delete set null, post_title varchar2(90) not null, post_contents varchar2(4000) not null, post_date...
<reponame>uk-gov-mirror/ministryofjustice.hmpps-interventions-service<gh_stars>1-10 create table service_category( id uuid NOT NULL, created timestamp with time zone, name text not null, primary key (id) );
-- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- -- Host: 127.0.0.1 Database: goods_service -- ------------------------------------------------------ -- Server version 5.7.24-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL...
SELECT nome, idade FROM pessoas ORDER BY idade DESC LIMIT 1; SELECT nome, idade FROM pessoas WHERE idade = (SELECT MAX(idade) FROM pessoas); --https://pt.stackoverflow.com/q/345185/101
<filename>db/schema.sql<gh_stars>0 DROP DATABASE IF EXISTS techBlog; CREATE DATABASE techBlog;
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_DD_Order_Details (IN Record_ID numeric, IN AD_Language Character Varying(6)) ; DROP TABLE IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_DD_Order_Details ; CREATE TABLE de_metas_endcustomer_fresh_reports.Docs_Sales_DD_Order_Details ( L...
DELETE FROM `sys_menu_mobile` WHERE `title` = '_idbw_mobilewall_member_news'; DROP TABLE IF EXISTS `mobilewall_config`; DELETE FROM `sys_menu_admin` WHERE `name` = 'MobileWall Activation'; DELETE FROM `sys_menu_admin` WHERE `name` = 'MobileWall';
<filename>SCRIPTS FUNCIONES/Modulo personal/Administrar sistema/Usuario/F_DAR_BAJA_USR.sql --Funnción para dar de baja a un usuario por medio del ID --Se tiene que deshabilitar el campo de estado en la tabla de tbl empleados por usuario CREATE OR REPLACE FUNCTION "PERMISOS".F_DAR_BAJA_USR(IN P_ID_EMPLEADO CHARACTER...
DROP TABLE if EXISTS `shop_category` ; CREATE TABLE `shop_category` ( `cat_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `cat_name` varchar(90) NOT NULL DEFAULT '' COMMENT '分类名称', `cat_desc` varchar(255) NOT NULL DEFAULT '' COMMENT '分类描述', `parent_id` smallint(5) unsigned NOT NULL DEFAULT '0', `sort_order...
<reponame>lanfangping/ravel ------------------------------------------------------------ -- STATEFUL FIREWALL ------------------------------------------------------------ /* Flow whitelist */ DROP TABLE IF EXISTS FW_policy_acl CASCADE; CREATE UNLOGGED TABLE FW_policy_acl ( end1 integer, end2 ...
<gh_stars>1-10 drop table if exists meta_data; #drop table if exists raw_meta_data; drop table if exists raw_data; drop table if exists dataset_version; drop table if exists dataset; drop table if exists archive; drop table if exists status; drop table if exists project; drop table if exists type; #enumeration of arch...
<filename>aws-blog-redshift-python-udf-tutorial/LOAD_OPPR_ALL_DTL_GNRL_12192014.sql --creates a structure to hold the data in the general payments file. --Per CMS README --File #1 - OPPR_ALL_DTL_GNRL_12192014.csv: --This file contains the data set for identified General Payments for the 2013 program year, including t...
<reponame>toymachiner62/promscale ALTER TABLE SCHEMA_CATALOG.metric ADD COLUMN delay_compression_until TIMESTAMPTZ DEFAULT NULL; DROP PROCEDURE IF EXISTS SCHEMA_CATALOG.decompress_chunks_after(NAME, TIMESTAMPTZ); DROP PROCEDURE IF EXISTS SCHEMA_CATALOG.do_decompress_chunks_after(NAME, TIMESTAMPTZ); DRO...
<gh_stars>100-1000 SET NAMES utf8mb4; START TRANSACTION; INSERT INTO changelog VALUES (13, UNIX_TIMESTAMP()); ALTER TABLE user_log CHANGE user_id user_id INT UNSIGNED NULL; COMMIT;
autocommit off; select ssn, name, dept_no, salary, location from joe.employees_v e; insert into joe.employees_v values (555555555, '<NAME>', 5, $50000, 'birmingham'); select ssn, name, dept_no, salary, location from joe.employees_v e; rollback work; rollback;
------------------------------------------------------------------------ -- Script: sql2017-t-sql-development.sql -- Copyright: 2017 <NAME> -- License: MIT License -- Credits: ------------------------------------------------------------------------ -------------------------------------------------------------...
-- @testpoint: 函数substring_inner(string [from int] [for int]),截取子字符串,from int表示从第几个字符开始截取,for int表示截取几个字节 --参数是有效值 select substring_inner('adcde', 2,3); select substring_inner('adcde123456', 6,3); select substring_inner('adcde@23456', 6,3); select substring_inner('adcde_23456', 6,3); select substring_inner(12345, 2,3)...
CREATE Function TempIndicadoresEducativos (varchar) Returns Void as $$ -- Eliminar Tabla Temp Indicadores Educativos. DELETE from temp_indicadores_educativos; -- Insertar Valores en la Tabla Temp Indicadores Educativos. INSERT INTO temp_indicadores_educativos SELECT DISTINCT btrim(org_gs.codigo_turno || org_gs.codigo...
drop database if exists sq_eson; /*创建数据库,并设置编码*/ create database sq_eson default character set utf8; use sq_eson; /*删除管理员表*/ drop table if exists account; /*删除商品类别表*/ drop table if exists category; /*删除商品信息表*/ drop table if exists product; /*删除购物项表*/ drop table if exists forder; /*删除购物车(订单)表*/ drop table if exists sor...
create role practice with login encrypted password '<PASSWORD>'; grant all priviledes on all tables in schema public to practice;
<gh_stars>0 ALTER TABLE "as".as_languages RENAME TO as_locale_languages; ALTER TABLE "as"."as_locale_languages" DROP CONSTRAINT "as_languages_pkey" CASCADE; --$ scan_tables locale t --$ scan_tables lang t --$ scan_tables user t --$ scan_tables template t INSERT INTO as_locale_domains_list (locale_do...
<filename>camdecmpswks/tables/2-monitor-qualification-lme.sql -- Table: camdecmpswks.monitor_qualification_lme -- DROP TABLE camdecmpswks.monitor_qualification_lme; CREATE TABLE camdecmpswks.monitor_qualification_lme ( mon_lme_id character varying(45) COLLATE pg_catalog."default" NOT NULL, mon_qual_id charact...
<filename>core/src/main/resources/dbshaker/db-models-idx.sql<gh_stars>0 ALTER TABLE models ADD PRIMARY KEY HASH (id); ALTER TABLE models ADD FOREIGN KEY (series_id) REFERENCES series(id);
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 14, 2019 at 05:42 PM -- Server version: 10.1.36-MariaDB -- PHP Version: 7.2.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
<filename>testove.sql -- phpMyAdmin SQL Dump -- version 4.7.3 -- https://www.phpmyadmin.net/ -- -- Хост: 127.0.0.1:3306 -- Время создания: Мар 02 2018 г., 14:02 -- Версия сервера: 5.7.19 -- Версия PHP: 5.6.31 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!...
<filename>temp/create.sql CREATE SCHEMA `__DBNAME__` CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE USER '__USERNAME__'@'localhost' IDENTIFIED BY '__PASSWORD__'; GRANT ALL ON `__DBNAME__`.* TO '__USERNAME__'@'localhost'; /* DROP DATABASE IF EXISTS `woodypaydb`; DROP USER IF EXISTS `woodypayuser`; CREATE SCHEMA `...
<filename>students.sql -- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Feb 02, 2018 at 05:47 PM -- Server version: 10.1.13-MariaDB -- PHP Version: 5.6.20 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CL...
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Tempo de geração: 24-Mar-2022 às 05:18 -- Versão do servidor: 10.4.20-MariaDB -- versão do PHP: 8.0.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHAR...
create database ets; use ets; create table rol( id int not null primary key auto_increment, nombre varchar(64) not null unique ) engine = InnoDB; create table usuario( id int not null primary key auto_increment, username varchar(128) not null unique, password varchar(128) not null, enabled...
insert into originals (version_guid, type, data, created_at, created_by_guid, deleted_at, deleted_by_guid) select guid, 'api_json', original, created_at, created_by_guid, deleted_at, deleted_by_guid from versions where original is not null and trim(original) != '{}' and trim(original) != '{ }';
<gh_stars>10-100 CREATE TABLE [dbo].[VmSize] ( [VmSizeId] INT IDENTITY (1, 1) NOT NULL, [Name] NVARCHAR (100) NOT NULL, [Description] NVARCHAR (500) NOT NULL, [Cores] INT NOT NULL, [Memory] INT NOT NULL, [MaxDataDisk...
-- add table prefix if you have one DELETE FROM core_config_data WHERE path like 'ffuenf_deleteorder/%'; DELETE FROM core_config_data WHERE path = 'advanced/modules_disable_output/Ffuenf_DeleteOrder'; DELETE FROM core_resource WHERE code = 'ffuenf_deleteorder_setup';
<reponame>chrdebru/direct-mapping<gh_stars>1-10 -- phpMyAdmin SQL Dump -- version 4.2.10 -- http://www.phpmyadmin.net -- -- Host: localhost:3306 -- Generation Time: Jan 31, 2020 at 12:09 AM -- Server version: 5.5.38 -- PHP Version: 5.6.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database...
<filename>test/assets/setup.cql<gh_stars>10-100 DROP KEYSPACE IF EXISTS default_art; CREATE KEYSPACE "default_art" WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor' : 1} ; USE default_art; CREATE TABLE t_data ( id uuid PRIMARY KEY, version int, data_int int, data_str text, data_float floa...
<filename>gtn-game.sql -- phpMyAdmin SQL Dump -- version 5.0.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Tempo de geração: 11-Dez-2021 às 20:54 -- Versão do servidor: 10.4.14-MariaDB -- versão do PHP: 7.4.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 S...
''' MIT License Copyright (c) 2019 <NAME> and <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publ...
-- file:boolean.sql ln:47 expect:true SELECT bool 'of' AS false
<filename>src/test/resources/sql/update/bcfcbf25.sql -- file:alter_table.sql ln:862 expect:true update atacc1 set "........pg.dropped.1........" = 3
<gh_stars>100-1000 -- Подробная информация здесь: -- https://sqlundercover.com/2019/02/19/7-more-ways-to-query-always-on-availability-groups/ SELECT PrimaryServer.replica_server_name AS PrimaryServer, Groups.name AS AGname, ReadOnlyReplica.replica_server_name AS ReadOnlyReplica, ReadOnlyReplica.read_on...
<reponame>ChangYeop-Yang/Study-DataBase # Write your MySQL query statement below SELECT name, population, area FROM World WHERE population > 25000000 OR area > 3000000;
CREATE TABLE `user_info` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `user_name` varchar(100) NOT NULL, `password` varchar(100) NOT NULL, PRIMARY KEY (`id`) ); INSERT INTO `user_info` VALUES (1, '张三', '<PASSWORD>'); select * from user_info
<reponame>joannepoblete/herd-mdl<filename>mdl/src/main/herd/sql/herdSecurityRoles.sql<gh_stars>0 -- Copyright 2018 herd-mdl contributors -- -- 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 --...
<filename>FUNCTION/GET_LITHOSTRAT_ATTR.sql<gh_stars>1-10 CREATE OR REPLACE FUNCTION "GET_LITHOSTRAT_ATTR" ( LOCALITY_ID IN NUMBER , ATTRIB IN VARCHAR2 ) RETURN VARCHAR2 AS -- Given a locality ID and the lithostratigraphic attribute to return (Group, Formation, Member, Bed) -- return the value of that attri...
<filename>oracle2file/config/TRIAD_DEPT_UP.sql select * from TRIAD_DEPT where to_char(update_time,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
<gh_stars>10-100 -- add index for queries by file id and consensus timestamp create index if not exists file_data__id_timestamp on file_data(entity_id, consensus_timestamp);
<reponame>pdv-ru/ClickHouse SELECT hex(1.0); SELECT hex(101.); SELECT hex(1e+18); SELECT hex(1e-20); SELECT hex(1e+100); SELECT hex(0.000578); SELECT hex(-123.978); SELECT hex(toFloat32(99.67)); SELECT hex(toFloat32(number)) FROM numbers(200, 2); SELECT hex(toFloat64(number)) FROM numbers(202, 2); ...
<reponame>eazyfin/graphql-engine<filename>cli/commands/testdata/migrate-squash-test/migrations/1588172670028_create_table_public_table36/down.sql DROP TABLE "public"."table36";
ALTER TABLE versions ALTER COLUMN yanked SET NOT NULL;
ALTER TABLE events DROP COLUMN event_end;
<gh_stars>1-10 SELECT 'route-subway' AS name, * FROM `openstreetmap-public-data-dev.osm_planet.multilinestrings` WHERE EXISTS(SELECT 1 FROM UNNEST(all_tags) as tags WHERE tags.key = 'route' AND tags.value='subway')
CREATE DATABASE movies; USE movies; CREATE TABLE movie( ID int NOT NULL AUTO_INCREMENT, title varchar(120) NOT NULL, year year, rating decimal(3,1), description TEXT, vote_count int, running_time_minutes int, gross_millions float, PRIMARY KEY(ID) ); CREATE TABLE person( ID int NOT...
CREATE TABLE [ASData_PL].[GA_SessionData]( [GASD_Id] [bigint] IDENTITY(1,1) NOT NULL, [FullVisitorId] [nvarchar](500) NULL, [ClientId] [nvarchar](500) NULL, [VisitId] [nvarchar](500) NULL, [VisitNumber] [nvarchar](500) NULL, [VisitStartDateTime] [nvarchar](500) NULL, [VisitDate] [n...
-- # ASSIGNMENT-6 # -- --USE EMPLOYEE; CREATE VIEW EMP_SAL_DETAILS AS SELECT EMP.EMPID, NAME, DOJ, DEPT, DESI, SALARY AS 'BASIC', (SALARY*0.15) AS 'HRA', (SALARY*0.09) AS 'PF', (SALARY+(SALARY*0.15)+(SALARY*0.09)) AS 'NET', ((SALARY+(SALARY*0.15)+(SALARY*0.09))-(SALARY*0.09)) AS 'GROSS' ...
<gh_stars>0 -- 2017-05-09 ND: Add newline to EOF. -- 2017-04-24 ND: Add ? contains JSON operator to improve performance -- 2017-04-01 ND: Temporarily aggregate dev_test=true payloads -- 2017-03-30 ND: Add typechecking to JSON input -- 2017-03-29 ND: Moved permanent table updates to their own .sql script -- ========...
<reponame>akshaysingh2/RailwayManagementSystem -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) -- -- Host: localhost Database: traindb -- ------------------------------------------------------ -- Server version 5.6.37 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD...
-- -- PostgreSQL database dump -- -- Dumped from database version 12.4 -- Dumped by pg_dump version 13.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...
<gh_stars>0 --FLATTEN JSON INTO TABLE INSERT INTO TRANSACTIONS SELECT JSON_DATA:customer_id::string, basket.value:product_id::string, basket.value:price::number, JSON_DATA:date_of_purchase::timestamp_ntz as date_of_purchase FROM TRANSACTIONS_JSON, LATERAL FLATTEN (JSON_DATA:basket) as basket;
<filename>kokeru.sql -- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Dec 10, 2020 at 08:17 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+0...
<gh_stars>0 USE `${DB_MAIN}`; DROP TABLE IF EXISTS `PeriodGoal`; CREATE TABLE IF NOT EXISTS `PeriodGoal` ( `Period` INT NOT NULL, AxisId INT UNSIGNED NOT NULL, `Level1` DECIMAL(16,3) NOT NULL, `Level2` DECIMAL(16,3) NOT NULL, `Level3` DECIMAL(16,3) NOT NULL, `Level4` DECIMAL(16,3) NOT NULL, ...
<reponame>EdwinOliveira/Restaurant-Web-Application CREATE OR REPLACE PROCEDURE Update_Restaurant(arg_restaurant_cod BIGINT, arg_json_data JSON) LANGUAGE plpgsql AS $$ BEGIN IF(select exists(select 1 From Restaurants where Restaurants.restaurant_cod = arg_restaurant_cod)) THEN -- GET JSON DATA WITH source AS (S...
/* * This file will contain: * * - RLS rules * and/or * - triggers * * and possibly * * - a separate schema and views * * such that users that have access to this DB, either directly via psql, or * indirectly via an HTTP/REST server, can be authorized according to our * authorization system. I.e., some...
<filename>5.2.3/Database/Constraints/AFW_12_HISTR_TUTRL_PK.sql SET DEFINE OFF; ALTER TABLE AFW_12_HISTR_TUTRL ADD ( CONSTRAINT AFW_12_HISTR_TUTRL_PK PRIMARY KEY (SEQNC) ENABLE VALIDATE) /
CREATE OR ALTER PROCEDURE dbo.prc_Config_FilePathCheck @RootDirectory VARCHAR(300),--Directory to check if path exists or you can reach it. @SubDirectory VARCHAR(50) = NULL, --You want to create a sub directory if it doesn't exist in the @RootDirectory you provided. Pass just the name, no \. @CreateSubDir TINYINT =...
<reponame>Haili321/inventory-order-JDBC-project DROP TABLE INVENTORY CASCADE; CREATE TABLE INVENTORY ( ProductID integer primary key, ProductDesc varchar(30) not null, ProductPrice numeric(8,2) not null, ProductStockAmount integer not null ); DROP SEQUENCE ProductSequence; CREATE SEQU...
<filename>db/Drop/drop_jobs.sql<gh_stars>10-100 -- Drop Jobs USE [msdb] GO DECLARE @jID VARCHAR(256) SET @jID=(SELECT job_id FROM msdb.dbo.sysjobs where name=N'DataMatrixDeleteEntities_$(DB_DATA)') EXEC msdb.dbo.sp_delete_job @job_id= @jID, @delete_unused_schedule=1 SET @jID=(SELECT job_id FROM msdb.dbo.sysjobs wher...
CREATE TABLE LBUSER.createTableDataTypeText (textCol CLOB)
<reponame>Datasilk/Saber-DataSets<filename>Sql/DataSet_UpdateRecord.sql CREATE PROCEDURE [dbo].[DataSet_UpdateRecord] @datasetId int, @recordId int = 0, @lang nvarchar(16), @fields XML /* example: <fields> <field name="label"><value>My Label</value></field> <field name="description"><value>The short sum...
<reponame>nielsenbe/Spark-Wiki-Parser CREATE OR REPLACE TEMPORARY VIEW wkp_link_external AS SELECT lnk.parentPageId AS parent_page_id, lnk.parentRevisionId AS parent_revision_id, lnk.parentHeaderId AS parent_header_id, lnk.elementId AS element_id, lnk.destination AS destination, l...
<reponame>lanyuanxiaoyao/mybatis-generator-plugin-plus<gh_stars>1000+ /* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50617 Source Host : localhost:3306 Source Database : mybatis-generator-plugin Target Server Type : MYSQL Target Server Version : 50617 File ...
set enable_seqscan=off; CREATE TABLE test_timestamptz ( i timestamptz ); INSERT INTO test_timestamptz VALUES ( '2004-10-26 03:55:08' ), ( '2004-10-26 04:55:08' ), ( '2004-10-26 05:55:08' ), ( '2004-10-26 08:55:08' ), ( '2004-10-26 09:55:08' ), ( '2004-10-26 10:55:08' ) ; CREATE INDEX idx_timestamptz ON test_t...
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!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 utf8mb4 */; CREATE DATABASE IF NO...
<reponame>opengauss-mirror/Yat -- @testpoint: 存储过程声明语法 定义变量 NUMBER(12,6) --创建存储过程 CREATE OR REPLACE PROCEDURE Proc_Syntax_011(IN name1 varchar2(20)) IS DECLARE emp_id NUMBER(12,6) := 12.3456789; begin emp_id := 12.3456789+1; raise info ':%',emp_id; end; / --调用存储过程 call Proc_Syntax_011('V_name1'); --清理环境 DROP PROCED...
CREATE TABLE [dbo].[SeminarPeopleXSeminarRoles] ( [SeminarPersonId] INT NOT NULL, [SeminarRoleId] CHAR (2) NOT NULL );
SET FOREIGN_KEY_CHECKS=0; DROP TABLE IF EXISTS secu_permission; create table secu_permission ( id int auto_increment comment '主键', name varchar(32) not null comment '菜单', constraint secu_permission_pk primary key (id) ) comment '菜单表'; DROP TABLE IF EXISTS secu_role; create table secu_role ( ...
BEGIN TRANSACTION; -- test various types CREATE TABLE integral_values ( i TINYINT, j smallint, k integer, l bigint, m HUGEINT ); INSERT INTO integral_values VALUES (1, 2, 3, 4, 5), (NULL, NULL, NULL, NULL, NULL); CREATE TABLE numeric_values ( i float, j double ); INSERT INTO numeric_valu...
<filename>src/main/resources/db/base-table.sql<gh_stars>0 CREATE TABLE `base_user` ( `user_id` varchar(16) NOT NULL COMMENT '用户id', `user_name_login` varchar(255) NOT NULL COMMENT '登录名称', `user_password` varchar(255) NOT NULL COMMENT '账号密码', `user_name_real` varchar(255) DEFAULT NULL ...
<reponame>andrecontisilva/SQL-aprendizado<gh_stars>0 /* Site: HackerRank Type: Practice Subdomain: Advanced Select Difficulty: Easy Skill: SQL (Oracle) Problem: Type Of Triangle URL: https://www.hackerrank.com/challenges/what-type-of-triangle/problem */ -- SOLUTION: SELECT CASE WHEN a + b > c AND b + c ...
<gh_stars>0 /* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50505 Source Host : 127.0.0.1:3306 Source Database : ketapang Target Server Type : MYSQL Target Server Version : 50505 File Encoding : 65001 Date: 2017-07-16 01:05:36 */ SET FOREIGN_KEY_CH...
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 24, 2019 at 02:21 PM -- 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"; /*!40...
USE minors_2022; DROP TABLE IF EXISTS secondbase_minors_fantasy; CREATE TABLE secondbase_minors_fantasy ( player_id int NOT NULL AUTO_INCREMENT PRIMARY KEY, first_name varchar(100) DEFAULT NULL, last_name varchar(100) DEFAULT NULL, ORG VARCHAR(100), ETA INT, PA int DEFAULT NULL, H int DEFAULT...
<gh_stars>0 CREATE TABLE notfy.email ( email_id bigserial NOT NULL, "from" character varying(100), "to" character varying(100)[], cc character varying(100)[], bcc character varying(100)[], subject character varying(1000), body text, status_events jsonb, PRIMARY KEY (email_id...
<gh_stars>0 UPDATE DBO.Profiles SET favoriteMap='Milky Way' WHERE CAST((id) AS int) % 3 = 0 GO UPDATE DBO.Profiles SET favoriteMap='Andromeda' WHERE CAST((id) AS int) % 3 = 1 GO UPDATE DBO.Profiles SET favoriteMap='Pinwheel' WHERE CAST((id) AS int) % 3 = 2 GO
SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `mock_config` -- ---------------------------- DROP TABLE IF EXISTS `mock_data`; CREATE TABLE `mock_data` ( `id` int(11) NOT NULL AUTO_INCREMENT = 1000000, `project_name` varchar(50) DEFAULT NULL, `test_page` varchar(50) DEFAULT NULL...
SELECT s.id AS student_id, l.id AS lesson_id FROM lessons l JOIN groups g ON l.group_id = g.id JOIN students s ON g.id = s.group_id;
LOAD 'pg_semver'; SELECT PG_SEMVER_CMP('0.0.0', '0.0.1'); SELECT PG_SEMVER_CMP('0.0.1', '0.0.1'); SELECT PG_SEMVER_CMP('0.0.2', '0.0.1'); SELECT PG_SEMVER_CMP('1.0.0-alpha.1', '1.0.0-alpha.0'); SELECT PG_SEMVER_CMP('1.0.0-alpha.1', '1.0.0-alpha.2'); SELECT PG_SEMVER_CMP('1.0.0-alpha.1', '1.0.0-beta.2'); SELECT PG_SEM...
--USE Orders SELECT ProductName,OrderDate, DATEADD(DAY,3,OrderDate) AS [Pay Due], DATEADD(MONTH,1,OrderDate) AS [Deliver Due] FROM Orders
INSERT INTO app.venues (id, name, capacity, created_at, updated_at) VALUES (1, 'venues01', 400, '1991-11-30 12:49:18', '1991-11-30 12:49:18'); INSERT INTO app.venues (id, name, capacity, created_at, updated_at) VALUES (2, 'でんでんコンベンションセンター', 250, '2003-08-10 00:14:16', '2003-08-10 00:14:16'); INSERT INTO app.venues (id,...
-- Your SQL goes here CREATE OR REPLACE FUNCTION payment_service_api.cancel_subscription(id uuid) RETURNS json LANGUAGE plpgsql AS $function$ declare _subscription payment_service.subscriptions; _result json; begin -- ensure that roles come from any permitted ...
<reponame>appNG/appng create table template ( id integer generated by default as identity (start with 1), appng_version varchar(255), description varchar(255), displayName varchar(255), long_desc varchar(255), name varchar(255), template_version varchar(255), timestamp varchar(255), version timestamp, primary...