sql stringlengths 6 1.05M |
|---|
DROP DATABASE IF EXISTS food_db;
CREATE DATABASE food_db;
|
ALTER TABLE recall ADD COLUMN booking_number VARCHAR(32); |
CREATE OR REPLACE FUNCTION zerobyte.TIME_TO_ZEROBYTE(t TIME)
AS (
zerobyte.INT64_TO_ZEROBYTE(TIME_DIFF(t, '00:00:00', MICROSECOND))
);
|
-- PAGES
DELETE FROM `sys_objects_page` WHERE `object`='bx_files_top';
INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `de... |
<gh_stars>10-100
CREATE OR REPLACE FUNCTION pgl_ddl_deploy.enable(p_set_name text)
RETURNS boolean
LANGUAGE plpgsql
AS $function$
DECLARE
v_deployable BOOLEAN;
v_result BOOLEAN;
BEGIN
SELECT pgl_ddl_deploy.deployment_check(p_set_name) INTO v_deployable;
IF v_deployable THEN
SELECT pgl_ddl_deploy.schema_ex... |
<filename>src/Database/EntAppSettingsDb/EntAppSettingsDb/dbo/Stored Procedures/CreateNewAppSettingSet.sql<gh_stars>0
-- =============================================
-- Author: <NAME>
-- Create date: 07/05/2016
-- Description: Creates a base set of AppSettings for a new Tenant based on an existing Tenant
-- =========... |
INSERT INTO `object` (`id`, `entry`, `scale_x`) VALUES
(1, 6145, 1),
(2, 6145, 1),
(3, 6145, 1),
(4, 6145, 1),
(5, 6145, 1),
(6, 6145, 1),
(7, 6145, 1),
(8, 6145, 1),
(9, 6145, 1),
(10, 6145, 1),
(11, 6145, 1),
(12, 6491, 1),
(13, 6491, 1),
(14, 6491, 1),
(15, 6491, 1),
(16, 15271, 1),
(17, 15271, 1),
(18, 15271, 1),
(... |
<filename>db.sql
-- MySQL dump 10.13 Distrib 5.5.47, for Win32 (x86)
--
-- Host: localhost Database: shop
-- ------------------------------------------------------
-- Server version 5.5.47
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESU... |
<gh_stars>10-100
insert into message(id, text) values(1, 'Hello World');
|
<reponame>PrasantHub/DynamicDataLoad<filename>Database Scripts/dbo.DataSourceConfigs.sql
/****** Object: Table [dbo].[DataSourceConfigs] Script Date: 10-11-2021 00:01:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DataSourceConfigs](
[ConfigID] [int] IDENTITY(1,1),
[S... |
select
array[],
array[1],
array[1, 2, 3, foo + bar],
array[array[1, 2, 3], array[4, 5, 6]],
array[[1, 2, 3], [4, 5, 6]]
from
baz
|
<gh_stars>10-100
CREATE TABLE [dbo].[CardComments]
(
[commentId] INT NOT NULL PRIMARY KEY,
[cardId] INT NOT NULL,
[userId] INT NOT NULL,
[datecreated] DATETIME NOT NULL DEFAULT GETDATE(),
[comment] NVARCHAR(MAX) NOT NULL
)
|
<gh_stars>10-100
DELETE FROM `holer_user` WHERE user_id=1;
INSERT INTO `holer_user` (`user_id`, `name`, `password`, `token`) VALUES (1, 'admin', '<PASSWORD>123', NULL);
|
DROP TABLE IF EXISTS job_dep;
DROP TABLE IF EXISTS job;
DROP TABLE IF EXISTS run;
DROP TABLE IF EXISTS session;
DROP TABLE IF EXISTS appkey;
DROP TABLE IF EXISTS usr;
CREATE TABLE usr (
id SERIAL PRIMARY KEY,
username VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(1024) NOT NULL, -- format: METHOD$PAYLOA... |
<reponame>dorianmouafo/zend-Framework-2-test<filename>data-base/data-base.sql<gh_stars>0
/*
SQLyog Community Edition- MySQL GUI v6.52
MySQL - 5.6.17 : Database - booking_car
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!... |
--[er]test octet_length with time as parameter
create class tb(
col1 time
);
insert into tb values('5:5:5 am');
select octet_length(col1) from tb;
drop class tb; |
<filename>openGaussBase/testcase/SQL/DDL/partition/Hash/Opengauss_Function_DDL_Partition_Hash_Case0027.sql
-- @testpoint: Hash分区表上以concurrently方式创建索引,合理报错
--step1:创建hash分区表 expect:成功
drop table if exists partition_hash_tab;
create table partition_hash_tab(p_id int)
partition by hash(p_id)
(partition p1,
partition p2,... |
<filename>Module_A/_data/data.sql
-- MySQL dump 10.16 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: db
-- ------------------------------------------------------
-- Server version 10.1.26-MariaDB-0+deb9u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4... |
<gh_stars>0
/* falta criar a database... tenho no meu notebook mas só posso acessar a tarde rs. mas é só criar ela aqui (chamei de usersdb)
e fazer "use usersdb" antes de começar a criar as tables */
--DROP DATABASE IF EXISTS `piquepei`;
CREATE DATABASE IF NOT EXISTS `piquepei`
DEFAULT CHARACTER SET = latin1;
USE 'piq... |
<filename>cql/step_4_get_db_stats.cql<gh_stars>0
////////////////////////////////////////////////////////////////////////
//
// Create a snapshot report
//
// Note: This script will be processed by neo4j-shell utility
// All comments in Java Style: line preceded by //
// Its syntax must be list of cypher queries and ne... |
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `mydb` ;
-- -----------... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 20, 2021 at 03:15 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 = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<filename>mysql-demo/mysql-transaction-demo/sql/write-isolation-1.sql
start transaction;
select 'sql 1', @amount := value from mywrite where id=1;
select 'sql 1: sleep 1 second', now();
select 'sql 1', now(), sleep(1);
update mywrite set value = @amount - 1 where id=1;
select 'sql 1: sleep 5 seconds ...', now();
select... |
<filename>employee-schema.sql
CREATE DATABASE trackerDB;
USE trackerDB;
CREATE TABLE department (
department_id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NOT NULL,
PRIMARY KEY (department_id)
);
CREATE TABLE role (
role_id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(30) NOT NULL,
salary DECIMAL(10,... |
<reponame>yadavritu/pc<filename>database/sql_changes.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 20, 2018 at 07:05 AM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
... |
ALTER TABLE services ADD COLUMN is_testnet BOOLEAN NOT NULL DEFAULT TRUE;
ALTER TABLE services ADD COLUMN flat_fee DECIMAL(40, 8);
ALTER TABLE services ADD COLUMN percent_fee DECIMAL(4, 2);
CREATE INDEX ON services (is_testnet);
CREATE INDEX ON services (flat_fee);
CREATE INDEX ON services (percent_fee);
CREATE TABL... |
<filename>Amigoscode/Relational Database and SQL Essentials/4- Filtering Data/3- Limit, Offset & Fetch.sql<gh_stars>1-10
-- Limit, Offset & Fetch
SELECT * FROM person LIMIT 15;
SELECT * FROM person OFFSET 5;
SELECT * FROM person OFFSET 5 LIMIT 15;
SELECT * FROM person FETCH FIRST 8 ROWS ONLY;
SELECT * FROM person ... |
<gh_stars>1-10
IF NOT EXISTS (
select * from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA='dw' and TABLE_NAME='f_virta_jtp_tilasto'
and COLUMN_NAME='d_julkaisufoorumitaso_vanha_id'
) BEGIN
ALTER TABLE dw.f_virta_jtp_tilasto ADD d_julkaisufoorumitaso_vanha_id int NULL
END
IF NOT EXISTS (
select * from INFORMAT... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Oct 13, 2019 at 05:10 PM
-- Server version: 10.1.40-MariaDB
-- PHP Version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
IF OBJECT_ID('dbo.usp_GenerateRandomPassword') IS NULL
EXEC('CREATE PROCEDURE dbo.usp_GenerateRandomPassword AS SELECT 1;');
GO
ALTER PROCEDURE dbo.usp_GenerateRandomPassword(
@length int = 20,
@allowAtoZ BIT = 1,
@allow0to9 BIT = 1,
@allowSpecials1 BIT = 1,
@allowSpecials2 BIT = 1,... |
alter table ereg_adresse
drop constraint UK_mwy9fnkebxg8f85ak183y14gu;
alter table ereg_adresse
drop constraint FKsc5tbhryssbqy7xeuik532naj;
alter table ereg_adresse
drop constraint FKfm1k7o3ad0mk31vl67786ta2o;
drop table ereg_adresse;
drop table adresse;
alter table ereg
add column forretnings_adre... |
<gh_stars>0
-- +----------------------------------------------------------------------------+
-- | <NAME> |
-- | <EMAIL> |
-- | www.idevelopment.info |
-- |-----... |
<gh_stars>0
library BiofeedbackTherapyfortheTreatmentofUrinaryIncontinence version '1'
using FHIR
//include otherLibrary version 'x.x' called otherLibrary
//codesystem codeSystemName : 'OID' version 'x.x'
//valueset valuesetName : 'OID' version 'x.x' codesystems{codeSystem1 , codeSystem2, etc}
//code codeName : 'OID'... |
delete from wiphis_lot;
delete from wiphis_mo_line;
delete from wiphis_qtyunit;
delete from wiphis_sbd;
delete from wiphis_smc;
delete from wip_future_action;
delete from wip_lot_hld;
delete from wip_lot_parameter;
delete from wip_lot_consume;
delete from wip_lot_component;
delete from wip_lot;
delete from wip_qtyunit;... |
<reponame>nick5uni/A_CTIC_NIETO
Tablas del proyecto (V1.0)
nombre: Nicolás (V2.0)
dirección: Jr marmol 465 (V3.0)
create table(
) (V4.0)
trabajo en otra rama (V5.0)
cambio rama desarrollo (V6.0)
|
<reponame>JavierCeiba/InventarioGuitarras<filename>microservicio/infraestructura/src/main/resources/sql/envio/listar.sql
select id,id_guitarra,id_empresa,fecha_envio,valor_total,fecha_entrega
from envio |
#macro($getTopicsByExam(examId))
SELECT ept.* FROM exam_paper_topic ept WHERE ept.exam_paper_id =:examId ORDER BY sequence ASC
#end
#macro($getTopicsByExams(examIds))
SELECT ept.* FROM exam_paper_topic ept WHERE ept.exam_paper_id in :examIds GROUP BY exam_paper_id,sequence ORDER BY sequence ASC
#end
#macro($u... |
<reponame>T5750/maven-archetype-templates
/*
Navicat MySQL Data Transfer
Source Server : localhost_UR_dahua
Source Server Version : 50539
Source Host : localhost:3306
Source Database : dubbo-wusc
Target Server Type : MYSQL
Target Server Version : 50539
File Encoding : 65001
Date: 2... |
<gh_stars>0
--Base Tables
CREATE TABLE IF NOT EXISTS PlayerClass (
ID INTEGER PRIMARY KEY ASC AUTOINCREMENT,
Name TEXT NOT NULL DEFAULT "Default",
Description TEXT NOT NULL DEFAULT "No description.",
ModelPath TEXT NOT NULL DEFAULT "", --Have a default thing
AnimationPath TEXT NOT NULL DEFAULT "", --Have a default thi... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50523
Source Host : localhost:3306
Source Database : prize
Target Server Type : MYSQL
Target Server Version : 50523
File Encoding : 65001
Date: 2015-11-07 17:48:21
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... |
<gh_stars>0
-- MySQL Script generated by MySQL Workbench
-- Sex 21 Ago 2015 09:57:56 BRT
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MO... |
CREATE PROCEDURE [Time_shift].RestoreData AS
DELETE FROM [Time_shift].DS_1
DELETE FROM [Time_shift].DS_2
DELETE FROM [Time_shift].DS_3
DELETE FROM [Time_shift].DS_4
INSERT INTO [Time_shift].DS_1 VALUES ('A', '2010-01/2010-12', 'helo world')
INSERT INTO [Time_shift].DS_1 VALUES ('A', '2011-01/2011-12', NULL)
IN... |
SET FOREIGN_KEY_CHECKS=0;
-- --------------------------------------------------------
INSERT INTO `@prefix@api_tab_menu` (`id`, `Description`, `Description_courte`, `id_categorie`, `Lien`) VALUES (NULL, 'shoppingList.title', 'shoppingList.title', '3', 'shoppingList');
UPDATE `@prefix@api_tab_menu_rangs_droit` a
INNE... |
update eg_installment_master set description = 'WT_MC-APR/16-17' where description = 'WT_MC-I/16-17' and id_module = (select id from eg_module where name ='Water Tax Management');
update eg_installment_master set description = 'WT_MC-MAY/16-17' where description = 'WT_MC-II/16-17' and id_module = (select id from eg_mo... |
USE [master];
DECLARE @kill varchar(8000) = '';
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), session_id) + ';'
FROM sys.dm_exec_sessions
WHERE database_id = db_id('RCSQL')
EXEC(@kill);
USE [master]
GO
ALTER DATABASE [RCSQL] SET READ_COMMITTED_SNAPSHOT ON WITH NO_WAIT
GO
ALTER DATABASE [RCSQL] S... |
EXEC sp_addlinkedserver
@server = 'MetadataExcel',
@srvproduct = 'Excel',
@provider = 'Microsoft.ACE.OLEDB.12.0',
@datasrc = 'C:\Test\Metadata.xlsx',
@provstr = 'Excel 12.0;IMEX=1;HDR=YES;'
|
ALTER TABLE `users` ADD INDEX `index_search_mobile` (`mobile`);
|
<filename>src/test/resources/sql/alter_foreign_table/62338ec5.sql
-- file:foreign_data.sql ln:330 expect:true
ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 OPTIONS (SET p2 'V2', DROP p1)
|
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5453334_sys_FRESH-727_AD_Process_Stats_index.sql
create unique index AD_Process_Stats_UQ on AD_Process_Stats (AD_Process_ID, AD_Client_ID);
|
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
GO
CREATE TABLE [dbo].[AUTH_IMAGE_CATEGORIES](
[ID] [int] IDENTITY(1,1) NOT NULL,
[CATEGORY] [nvarchar](50) NOT NULL,
CONSTR... |
<reponame>andrewmsboyd/pfds-database<filename>project-queries-submission2.sql
-- Slide 1: From which of our customers did we make the most profit over the lifetime of the company?
SELECT
customer_id,
customer_name,
SUM(amount) AS total_paid
FROM
(SELECT
r.customer_id,
CONCAT(c.first_name, ' '... |
drop view if exists "public"."ccc_view3" cascade;
drop function if exists "public"."depends_on_bbb_view2"(t text) cascade;
drop view if exists "public"."ddd_unchanged" cascade;
drop view if exists "public"."bbb_view2" cascade;
drop view if exists "public"."ddd_changed" cascade;
drop view if exists "public"."aaa_vi... |
<filename>src/main/resources/db/changelog/changes/v1.0.0/sql/2021-08-25-02__alter-modified-by-columns.sql
CREATE OR REPLACE FUNCTION modify_last_modified(p_table varchar) RETURNS void LANGUAGE plpgsql
AS '
BEGIN
EXECUTE ''ALTER TABLE '' || p_table ||
'' ADD COLUMN updated_by_userid UUID'';
EXECUTE ''ALT... |
CREATE TABLE `Events` (
`id` CHAR(36) COLLATE UTF8_UNICODE_CI NOT NULL,
`user_id` CHAR(36) COLLATE UTF8_UNICODE_CI NOT NULL,
`name` VARCHAR(100) COLLATE UTF8_UNICODE_CI NOT NULL,
`description` TEXT COLLATE UTF8_UNICODE_CI,
`phone_number` CHAR(10) COLLATE UTF8_UNICODE_CI DEFAULT NULL,
`location_a... |
IF EXISTS (SELECT * FROM sys.objects WHERE object_id
= OBJECT_ID(N'[dbo].[sp_CU_GetPharmacyQueue]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].sp_CU_GetPharmacyQueue
GO
CREATE PROCEDURE [dbo].sp_CU_GetPharmacyQueue
AS
BEGIN
WITH a AS (SELECT a.Id
, c.DrugName
FROM PatientDrugPrescription a
I... |
DROP TABLE IF EXISTS multiple;
CREATE TABLE multiple (
ID int NOT NULL,
OTHER_ID int NOT NULL,
SEQUENCE int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (ID, OTHER_ID)
); |
<reponame>alexavila150/luciddb
-- tests ability to run code from file or from a string
select schema_name from sys_root.dba_schemas order by schema_name;
call applib.execute_script('js', 'importPackage(java.sql) /* There is also an importClass() function. */
var conn = DriverManager.getConnection("jdbc:default:connec... |
{#-- We can't use temporary tables with `create ... as ()` syntax #}
{% macro spark_create_temporary_view(relation, sql) -%}
create temporary view {{ relation.include(database=false, schema=false) }} as
{{ sql }}
{% endmacro %}
{% macro file_format_clause() %}
{%- set file_format = config.get('file_format', ... |
CREATE INDEX IF NOT EXISTS LOCAL_PAGE_IDX_PAGE_ID ON LOCAL_PAGE(LANG_ID, PAGE_ID);
CREATE INDEX IF NOT EXISTS LOCAL_PAGE_IDX_PAGE_TITLE ON LOCAL_PAGE(LANG_ID, TITLE, NAME_SPACE)
|
--
-- Copyright (C) 2004, 2005, 2006 Mekensleep <<EMAIL>>
-- 24 rue vieille du temple, 75004 Paris
--
-- This software's license gives you freedom; you can copy, convey,
-- propagate, redistribute and/or modify this program under the terms of
-- the GNU Affero General Public License (AGPL... |
# Host: localhost (Version: 5.5.53)
# Date: 2017-02-20 16:44:34
# Generator: MySQL-Front 5.3 (Build 4.234)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "jfb_admin"
#
CREATE TABLE `jfb_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`auth_key` v... |
CREATE TABLE beverage_boot
(
id integer NOT NULL,
manufacturer character varying(255),
name character varying(255),
quantity integer,
price double precision,
version integer,
incentive_boot_id integer,
CONSTRAINT beverage_boot_pkey PRIMARY KEY (id),
CONSTRAINT fk_beverage_incentive_b... |
<gh_stars>0
CREATE TABLE [Config].[AppConfig] (
[ID] INT IDENTITY (1, 1) NOT NULL,
[ConfigName] VARCHAR (100) NULL,
[ConfigDescription] VARCHAR (500) NULL,
[StringValue] VARCHAR (200) NULL,
[INTValue] INT NULL,
[BoolValue] ... |
<filename>DB_design/ecom.sql
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Feb 11, 2021 at 07:29 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!4010... |
<reponame>CodeAperture/AdventureWorksSourceControl
CREATE TABLE [Person].[BusinessEntityContact]
(
[BusinessEntityID] [int] NOT NULL,
[PersonID] [int] NOT NULL,
[ContactTypeID] [int] NOT NULL,
[rowguid] [uniqueidentifier] NOT NULL ROWGUIDCOL CONSTRAINT [DF_BusinessEntityContact_rowguid] DEFAULT (newid()),
[Modifi... |
<gh_stars>0
CREATE TABLE `hostUser` (
`hostId` int PRIMARY KEY AUTO_INCREMENT,
`userName` varchar(255),
`emailAddress` varchar(255),
`password` varchar(255),
`created_at` timestamp
);
CREATE TABLE `games` (
`gameId` int PRIMARY KEY AUTO_INCREMENT,
`gameLink` varchar(255),
`name` varchar(255),
`player... |
<reponame>NYMRAZE/erp_project
ALTER TABLE user_profiles DROP COLUMN employee_id;
|
<reponame>MiXALK/printerApp.dev
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Янв 25 2018 г., 00:33
-- Версия сервера: 5.7.16
-- Версия PHP: 7.0.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SE... |
DROP TABLE IF EXISTS employee;
CREATE TABLE employee (
employee_id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(250) NOT NULL,
last_name VARCHAR(250) NOT NULL,
dob VARCHAR(250) NOT NULL
department VARCHAR(250) NOT NULL,
gender VARCHAR(4) DEFAULT NULL
);
INSERT INTO practice.employee... |
<gh_stars>0
--ZAD1
DROP TABLE IF EXISTS zwierzeta;
CREATE TABLE zwierzeta (
gatunek varchar(100) NOT NULL,
jajorodny char CHECK (jajorodny='T' OR jajorodny='N') NOT NULL,
liczba_konczyn INT CHECK (liczba_konczyn < 100) NOT NULL,
data_odkrycia DATE NOT NULL
)
|
/*
Empresa : EurekaBank
Software : Sistema de Cuentas de Ahorro
DBMS : MySQL Server
Base de Datos : eurekabank
Script : Inserta datos en las tablas de la Base de Datos
*/
-- =============================================
-- Seleccionar la Base de Datos
-- ==========================... |
CREATE TABLE [dbo].[Application]
(
[Id] INT IDENTITY PRIMARY KEY,
[Name] VARCHAR(50) NOT NULL,
[Description] VARCHAR(100) NOT NULL,
[Path] VARCHAR(50) NOT NULL,
[IsExternal] INT NOT NULL DEFAULT 0,
[Public] INT NOT NULL DEFAULT 0,
[Admin] INT NOT NULL DEFAULT 0
)
|
create table pt_court_cases_tbl (
i_asmtno bigint not null,
vc_onrname character varying(100),
vc_onrdoorno character varying(30),
i_rwid bigint,
vc_lctyname character varying(350),
d_taxamt double precision,
dt_casedt date,
vc_caseeno character varying(30),
vc_courtname character varying(50),
i_ulb... |
<gh_stars>1-10
/*
This script joins block and tract FIPS to individual-level dataset
Written by: <NAME>
*/
CREATE TABLE core_birth_info_rc AS
SELECT core_birth_info_rc2.*,
indiv_census_tracts."FIPS_BLK_GEO",
substring(indiv_census_tracts."FIPS_BLK_GEO" from 1 for 11)
AS "FIPS_TRACT_... |
CREATE TABLE IF NOT EXISTS eg_fsm_application(
id character varying(256) NOT NULL,
applicationno character varying(128),
tenantid character varying(64),
additionaldetails jsonb,
accountid character varying(64) DEFAULT NULL,
description character varying(256) DEFAULT NULL,
applicationStat... |
-- 10 November 2020
-- <NAME>
-- dummy data for test_beetroot qr code
INSERT INTO foodprint_weeklyview (
logid,
harvest_logid,
harvest_supplierShortcode,
harvest_supplierName,
harvest_farmerName,
harvest_supplierAddress,
harvest_produceName,
harvest_phot... |
CREATE TABLE lang (
id SERIAL NOT NULL PRIMARY KEY,
name VARCHAR(20) UNIQUE NOT NULL
);
INSERT INTO lang (name) VALUES ('Afrikaans');
INSERT INTO lang (name) VALUES ('Albanian');
INSERT INTO lang (name) VALUES ('Arabic');
INSERT INTO lang (name) VALUES ('Armenian');
INSERT INTO lang (name) VALUES ('Bengali... |
-- file:tstypes.sql ln:3 expect:true
SELECT '1'::tsvector
|
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/alter_table/6327f2ca.sql
-- file:foreign_data.sql ln:612 expect:true
ALTER TABLE pt1 ALTER COLUMN c4 SET DEFAULT 0
|
-- file:rowsecurity.sql ln:947 expect:true
ALTER TABLE x1 ENABLE ROW LEVEL SECURITY
|
<filename>src/BugNET.Database/Stored Procedures/BugNet_ProjectPriorities_GetPriorityById.sql
CREATE PROCEDURE [dbo].[BugNet_ProjectPriorities_GetPriorityById]
@PriorityId int
AS
SELECT
PriorityId,
ProjectId,
PriorityName,
SortOrder,
PriorityImageUrl
FROM
BugNet_ProjectPriorities
WHERE
PriorityId =... |
-- Generated by hibernate
create table CM_SEC_CATEGORY_T (CAT_CODE varchar2(255 char) not null, CAT_DESCR varchar2(255 char), primary key (CAT_CODE));
create index CM_ENR_USER on CM_ENROLLMENT_T (USER_ID);
create index CM_MBR_CTR on CM_MEMBERSHIP_T (MEMBER_CONTAINER_ID);
create index CM_MBR_USER on CM_MEMBERSHIP_T (US... |
<filename>inst/sql/sql_server/analyses/420.sql
-- 420 Number of condition occurrence records by condition occurrence start month
--HINT DISTRIBUTE_ON_KEY(stratum_1)
WITH rawData AS (
select
YEAR(co1.condition_start_date)*100 + month(co1.condition_start_date) as stratum_1,
COUNT_BIG(co1.PERSON_ID) as count_va... |
create table if not exists flyway (
version text
);
-- drop table if exists memento cascade;
create table if not exists memento (
prefix varchar(64) not null,
name varchar(64) not null,
value text not null,
sort_order integer not null default 0,
created bigint not null default 0,
modified bigint not null ... |
CREATE TABLE IF NOT EXISTS astra.guilds
(
guild_id BIGINT NOT NULL
CONSTRAINT guilds_pk
PRIMARY KEY,
channel_id BIGINT NOT NULL,
active BOOLEAN DEFAULT TRUE NOT NULL,
launches BOOLEAN DEFAULT TRUE NOT NULL,
apod BOOLEAN DEFAULT TRUE ... |
<reponame>dbrtly/ra_data_warehouse
{% macro results_values(results) %}
{% for res in results -%}
{% if loop.index > 1 %},{% endif %}
('{{ res.node.alias }}', '{{ res.status }}',
case when '{{ res.status }}' like 'CREATE TABLE%' or '{{ res.status }}' like 'MERGE%' then
{% if target.type == 'bigquer... |
CREATE TABLE merged_life_expectancy AS
(SELECT us_regions.State,
LifeExpectancy,
MinLifeExpectancyRange,
MaxLifeExpectancyRange,
'2010-2015' AS Period,
Region,
0 AS GDP
FROM
cleaned_life_expectancy_2010_2015 JOIN us_regions ON us_regions.State = cleaned_life_expectancy_2010_2015.State
)
UNIO... |
INSERT INTO Book(title, pages) VALUES ('title0', 0);
INSERT INTO Book(title, pages) VALUES ('title1', 1);
INSERT INTO Book(title, pages) VALUES ('title2', 2);
INSERT INTO Book(title, pages) VALUES ('title3', 3);
INSERT INTO Book(title, pages) VALUES ('title4', 4);
INSERT INTO Book(title, pages) VALUES ('title5', 5);
IN... |
<reponame>jp7492code/multiple-linear-regression
CREATE TABLE demandFor2015Minus AS
SELECT substr(Year,7,4) AS Year, EducationalAttainment, sum(PopulationCount) AS Demand
FROM 'CA_Educational_Attainment___Personal_Income_2008-2014'
GROUP BY Year,EducationalAttainment
|
<reponame>filippovdenis/pg_gatherer
select extract(epoch from now())::int - (extract(epoch from now())::int % $1); |
INSERT INTO waffle_flag_mkt (name, everyone, percent, superusers, staff, authenticated, rollout, testing, languages, note, created, modified)
VALUES ('android-payments', 0, NULL, 0, 0, 0, 0, 0, '', 'ON: paid apps for Android can be submitted and show up in search results; OFF: paid apps for Android are disallowed a... |
--+ holdcas on;
drop table if exists t1;
drop table if exists t2;
create table t1(a varchar, b int, c int, d int, e int, f int, g int, h int);
insert into t1 values(repeat('a',300),1,1,1,1,1,1,1);
create index i_t1_all on t1(a,b,c,d,e,f,g,h);
select /*+ INDEX_LS */ a from t1 where c>0 group by a;
i... |
# up
create table if not exists `task_log` (
`id` bigint(20) unsigned not null,
`version` int(11) not null,
`create_time` datetime null,
`update_time` datetime null,
`delete_time` datetime null,
`result` varchar(200) null,
`task_id` bigint(20) unsigned not null,
`snap_task_robot_url` var... |
<gh_stars>0
INSERT INTO burger (burger_name) VALUES ('Double Quarter Pounder');
INSERT INTO burger (burger_name) VALUES ('Macaroni and Cheese Burger');
INSERT INTO burger (burger_name, devoured) VALUES ('Sushi Burger', true);
INSERT INTO burger (burger_name) VALUES ('Chicken Bacon Ranch Burger');
INSERT INTO burger (bu... |
<reponame>Hubbitus/sql
-- Extended version http://stackoverflow.com/questions/25413303/how-to-list-files-in-a-folder-from-inside-postgres/37903171#37903171
-- Unfortunately that variant only allow use hardcoded path
-- To use user parameter we will use dynamic EXECUTE.
-- Return also file size and allow filtering
--
--... |
<reponame>binhminh10/binhminh10.github.io
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Máy chủ: localhost
-- Thời gian đã tạo: Th5 08, 2018 lúc 03:09 AM
-- Phiên bản máy phục vụ: 5.7.21-log
-- Phiên bản PHP: 7.2.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSAC... |
<reponame>bbogin/sr2s<gh_stars>0
-- Table: a30_event
-- DROP TABLE a30_event;
CREATE TABLE a30_event
(
event_id serial NOT NULL,
project_idref integer NOT NULL DEFAULT 0,
"name" character varying(64) NOT NULL DEFAULT 'new task'::character varying,
description character varying(256) NOT NULL DEFAULT 'new task... |
\echo Check that virtual fields are not defined for inserting / updating
SELECT * FROM analysis.meta_data_all_inconsistent_insert_update_validation();
\echo Check that virtual fields are not pointing to an invalid table
select * from analysis.meta_data_pointers_to_wrong_table( 'to_deb_primary', ARRAY['to_deb_primary',... |
DROP TABLE Project;
DROP TABLE Testimonial;
DROP TABLE BlogPostLocation;
DROP TABLE BlogPostTag;
DROP TABLE BlogPost;
DROP TABLE CarouselItem;
DROP TABLE Category;
DROP TABLE Author;
DROP TABLE Tag;
DROP TABLE [Location];
DROP TABLE ContentHtml;
DROP TABLE ContentText;
DROP TABLE Faq;
DROP TABLE MailingList;
DROP TABLE... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 11, 2021 at 03:04 PM
-- Server version: 5.7.24
-- PHP Version: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.