sql stringlengths 6 1.05M |
|---|
<gh_stars>100-1000
-- Copyright 2018 <NAME>. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
SET PAGESIZE 5000 LINESIZE 1000 TRIMSPOOL ON TRIMOUT ON TAB OFF
DEF sqlset_name="GPN_MON18"
VAR dbid NUMBER
VAR inst_id NUMBE... |
<filename>migrate/migrations/20180821150330-deferable-status-cm.sql
-- +migrate Up
ALTER TABLE users
ALTER CONSTRAINT users_alert_status_log_contact_method_id_fkey DEFERRABLE;
-- +migrate Down
ALTER TABLE users
ALTER CONSTRAINT users_alert_status_log_contact_method_id_fkey NOT DEFERRABLE;
|
<reponame>iamhuwjones/hermes
CREATE TABLE sfrm_message_segment
(
message_id varchar(200) NOT NULL,
message_box varchar(200) NOT NULL,
segment_no int NOT NULL,
segment_type varchar(200) NOT NULL,
segment_start bigint,
segment_end bigint,
retried int DEFAULT -1,
md5_value varchar(200),
... |
CREATE TABLE info_vars
(
info_var_id INTEGER NOT NULL
CONSTRAINT info_vars_pk
PRIMARY KEY ASC AUTOINCREMENT,
patch_version_id INTEGER NOT NULL
CONSTRAINT info_vars_patch... |
<reponame>XanaduNWH/dlxx
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.3
-- Dumped by pg_dump version 9.6.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;
SET check_function_bodie... |
--- PKEYS
ALTER TABLE ONLY oauth_client ADD CONSTRAINT oauth_client_obj_id_pkey PRIMARY KEY (id);
ALTER TABLE ONLY oauth_scope ADD CONSTRAINT oauth_scope_obj_id_pkey PRIMARY KEY (id);
ALTER TABLE ONLY oauth_access_token ADD CONSTRAIN... |
<reponame>PREngineer/Event-Manager-Global<filename>dummy data/event_change_log.sql<gh_stars>0
INSERT INTO `Event Change Log` (`ID`, `Event_ID`, `Changed_By_ID`, `Type`, `Reason`, `Timestamp`) VALUES
(1, 26, 'poc', 'Create', 'New Event Creation Form', '2018-04-14 06:52:47'); |
<reponame>JonesSteel/visor
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 5.7.33 - MySQL Community Server (GPL)
-- SO del servidor: Win64
-- HeidiSQL Versión: 11.2.0.6213
-- --------------------------------... |
<gh_stars>0
INSERT INTO `magnum-checklist`.users (id, f_name, l_name, is_admin, email, password, remember_token, created_at, updated_at) VALUES (1, 'Чингиз', 'Болатов', 1, '<EMAIL>', '$<PASSWORD>DdZ0BtHGVyzUGR50yG6uirigRzyC74I<PASSWORD>', 'FspXdrp8qvqd47lv0KekUW9KnSNwDH6pN8w8KDjkpjPfPimYbYQlTXYfha5U', '2022-02-08 11:16... |
INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAME>',41,200);
INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAME>',44,145);
INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAM... |
<reponame>wing2005/dogsBarber<gh_stars>0
USE eyalet_BackEnd_Project_Chen;
INSERT INTO `Orders` (`employee_id`, `service_id`, `customer_id`, `order_date`, `total_price`, `dog_id`) VALUES
(1, 1, '111111111', '2021-02-09', 150, 2001),
(2, 3, '222222222', '2021-02-09', 100, 2002),
(3, 2, '333333333', '2021-02-09', 200, 20... |
select NULL pracID, NULL klientID, round(sum(SubTotal),2) as Suma from Sales.SalesOrderHeader
UNION ALL
select SalesPersonID pracID, CustomerID klinetID, round(sum(SubTotal),2) Suma from Sales.SalesOrderHeader
group by SalesPersonID,CustomerID
order by pracID, klientID |
SET FOREIGN_KEY_CHECKS=0;
-- --------------------------------------------------------
ALTER TABLE `@prefix@tab_adress` ADD `active` TINYINT(1) NOT NULL DEFAULT '1' ;
ALTER TABLE `@prefix@tab_events` ADD `active` TINYINT(1) NOT NULL DEFAULT '1' ;
ALTER TABLE `@prefix@tab_patients` ADD `active` TINYINT(1) NOT NULL DEFAUL... |
-- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 04, 2014 at 01:04 AM
-- Server version: 5.5.32
-- PHP Version: 5.4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
create or replace trigger tr8
before insert on loans
for each row
declare
cincome number ;
begin
select income into cincome from customer c where c.cid=:NEW.cid;
if(:NEW.amount > 2*cincome) then
raise_application_error(-20009,'LIMIT EXCEEDED');
end if;
end;
/ |
<filename>src/cli/bundled/sql/PartnerStudy.sql
CREATE TABLE partner_study (
id String,
additional_info Nullable(String),
brand Nullable(String),
client_name Nullable(String),
emails Nullable(String),
input_ids Array(String),
is_export Nullable(UInt8),
location Nullable(String),
match_file_ds Nullable(... |
-- file:alter_table.sql ln:1253 expect:true
alter table foo alter f1 TYPE integer
|
<gh_stars>1-10
insert into account (id, name)
values (uuid('2b441c6f-e9d4-4252-ab66-f87998080d51'), 'Test Account');
|
-- 2018-06-18T18:02:14.787
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceO... |
/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 ... |
SET XACT_ABORT ON;
GO
IF NOT EXISTS(select a.name as TableName, b.name as IdentityColumn from sysobjects a inner join syscolumns b on a.id = b.id where columnproperty(a.id, b.name, 'isIdentity') = 1 and objectproperty(a.id, 'isTable') = 1 and a.name = 'County')
BEGIN TRANSACTION;
-- Batch 0
BEGIN TRY
ALTER TABLE [... |
<gh_stars>0
ALTER DATABASE jjain2 CHARACTER SET utf8 COLLATE utf8_unicode_ci;
DROP TABLE IF EXISTS articleTag;
DROP TABLE IF EXISTS article;
DROP TABLE IF EXISTS tag;
DROP TABLE IF EXISTS author;
CREATE TABLE author (
authorId BINARY(16) NOT NULL,
authorAvatarUrl VARCHAR(250),
authorActivationToken CHAR(32),
auth... |
<gh_stars>0
begin
dbms_network_acl_admin.drop_acl(
out_put, in_put
);
end;
/ |
--
-- headlines stylesheet category and classes
--
\connect - jcms
INSERT INTO updatelog (name,value) VALUES ('db_version','20100219');
-- STYLESHEET - rename email to headlines since email now deprecated
UPDATE stylesheetcategories SET stylesheetcategory='headlines' WHERE stylesheetcategory_id=18;
DELETE FROM style... |
<filename>src/main/resources/data.sql
INSERT INTO tbg_profile (id, profile_description)
SELECT * FROM (SELECT 2, 'ROLE_ADMIN') AS tmp
WHERE NOT EXISTS (
SELECT profile_description FROM tbg_profile WHERE profile_description = 'ROLE_ADMIN'
) LIMIT 1;
INSERT INTO tbg_profile (id, profile_description)
SELECT * FROM (S... |
<filename>read_me.sql
SELECT si.id, si.spectrum_id AS sid,
pep1.seq_mods AS pep1, pep2.seq_mods AS pep2, pep1.link_site AS linkpos1, pep2.link_site AS linkpos2,
si.charge_state AS charge,
sp.frag_tol AS fragTolerance,
si.pass_threshold, si.rank, si.ions, si.scores, pep1.crosslinker_modmass AS modmass1, pep2.crosslinker... |
DROP TABLE IF EXISTS clients;
DROP TABLE IF EXISTS banned_users;
CREATE TABLE clients (
ip TEXT PRIMARY KEY,
username TEXT NOT NULL,
drifter INTEGER NOT NULL DEFAULT 0,
sort_number INTEGER NOT NULL
);
CREATE TABLE banned_users (
username TEXT PRIMARY KEY
);
|
insert into user (name,mic_code,github_code,update_time,create_time) values ('test','','',now(),now()); |
PRINT N'Create Sequences for Table Primary Keys'
GO
CREATE SEQUENCE [dbo].[PIMS_TENANT_ID_SEQ]
AS BIGINT
START WITH 0
INCREMENT BY 1
MINVALUE 0
MAXVALUE 2147483647
NO CYCLE
CACHE 50
GO
CREATE SEQUENCE [dbo].[PIMS_ACCESS_REQUEST_ID_SEQ]
AS BIGINT
START WITH 0
INCREMENT BY 1
MINVALUE 0
MAXVAL... |
--! Previous: sha1:2333ed9fff52a9fd530cbafcc8a7587b6c503b42
--! Hash: sha1:2a911af9cfb7fa75e232790171a67e59b722a836
-- Enter migration here
alter table form_logic_conditions alter column value drop not null;
create or replace function create_survey_jump_rule("formElementId" int, "jumpToId" int, "booleanOperator" for... |
select (row_number() over (order by datum)) as covid_hospitalisation_id,
'CZ' as country_id,
datum as covid_hospitalisation_date,
pacient_prvni_zaznam as covid_hospitalisation_admissions,
pocet_hosp as covid_hospitalisation_current,
... |
USE SoftUni
GO
/*
SELECT Salary FROM Employees
GROUP BY Salary
ORDER BY Salary ASC
*/
SELECT DISTINCT Salary FROM Employees
ORDER BY Salary ASC |
SELECT
nummer,
CASE
WHEN ordnung LIKE 'LFP2%' THEN 2
WHEN ordnung LIKE 'LFP1%' THEN 1
ELSE 0
END AS kategorie,
h02::numeric AS hoehe,
lfp.geometrie,
bfs_nr,
ordnung,
signatur,
fineltra,
proto_url AS protokoll
FROM
${dbschema}.grundlagen_fpds AS lfp
LEFT JOIN ${dbschema}.grundlagen_ge... |
<reponame>sayeedazmal/elearning<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 19, 2019 at 05:15 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;
S... |
CREATE OR ALTER PROCEDURE [capture].[test update_only_captures_modified_columns]
AS
BEGIN
-----------------------------------------------------------------------------------------------------------------
-- Arrange:
--------------------------------------------------------------------------------------------------... |
<reponame>lanka97/bightstar_enterprise
-- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64)
--
-- Host: localhost Database: empmgt
-- ------------------------------------------------------
-- Server version 8.0.11
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_R... |
<reponame>AerisG222/mikeandwan.us<filename>src/maw_database_pg/005/funcs/maw.get_roles.sql
CREATE OR REPLACE FUNCTION maw.get_roles
(
_id SMALLINT DEFAULT NULL,
_name VARCHAR(30) DEFAULT NULL
)
RETURNS TABLE (
id SMALLINT,
name VARCHAR(30),
description VARCHAR(255)
)
LANGUAGE SQL
AS $$
SELECT i... |
create database todolist;
use todolist;
create table tarefa(
id int primary key,
descricao varchar(36000),
status_tarefa boolean default(false)
);
ALTER TABLE `todolist`.`tarefa`
CHANGE COLUMN `id` `id` INT NOT NULL AUTO_INCREMENT ; |
CREATE OR REPLACE VIEW mountain_peak_label_z12toz14 AS
SELECT id AS osm_id, elevation_m,
name, name_fr, name_en, name_de, name_es, name_ru, name_zh, name_sv, type, geometry
FROM osm_mountain_peak_point;
CREATE OR REPLACE VIEW mountain_peak_label_layer AS (
SELECT osm_id FROM mountain_peak_label... |
<reponame>rh24/code-libs
CREATE TABLE IF NOT EXISTS stretch_games (
id SERIAL PRIMARY KEY,
username VARCHAR(256),
date_created TEXT,
stretch_template_id INTEGER REFERENCES stretch_templates(id),
lib_1 TEXT,
lib_2 TEXT,
lib_3 TEXT,
lib_4 TEXT,
lib_5 TEXT,
lib_6 TEXT,
lib_7 TEXT,
lib_8 TEXT,
lib... |
-- MySQL Script generated by MySQL Workbench
-- Wed Jan 16 22:12:41 2019
-- 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_MODE, SQL_MODE='ON... |
SET LINESIZE 300
SET PAGESIZE 300
SET ECHO OFF
SET FEEDBACK OFF
SET TRIMSPOOL ON
COLUMN sid FORMAT 9999
COLUMN sec FORMAT 9999999999
COLUMN event FORMAT A50
COLUMN p1 FORMAT 999999999999999
COLUMN wait_class FORMAT A25
COLUMN laddr FORMAT A30
COLUMN object FORMAT A50
SELECT w.sid,
... |
CREATE TABLE [Sales].[Orders] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[CustomerId] INT NOT NULL,
[DateAndTime] DATETIME2 (0) NOT NULL,
[OrderStatusId] TINYINT NOT NULL,
[Comments] NVARCHAR (1000) NULL,
CONSTRAINT [pk_Orders_nc_Id] PRIMARY KEY ... |
<gh_stars>1-10
CREATE TABLE [dbo].[Patients](
[PatientId] [int] IDENTITY(1,1),
[SSN] [char](11) NOT NULL,
[FirstName] [nvarchar](50) NULL,
[LastName] [nvarchar](50) NULL,
[MiddleName] [nvarchar](50) NULL,
[StreetAddress] [nvarchar](50) NULL,
[City] [nvarcha... |
alter table results
add column p_rank int;
update results left join (
select study_id, cpg,
@rank := case when study_id = @last_study
then @rank + 1
else 1
end as p_rank,
@last_study := study_id
from (
select study_id, cpg from results order by study_id, (p+0) asc
) as... |
IF OBJECT_ID('config.get_custom_field_form_name') IS NOT NULL
DROP FUNCTION config.get_custom_field_form_name;
GO
CREATE FUNCTION config.get_custom_field_form_name
(
@table_name character varying
)
RETURNS character varying
BEGIN
RETURN
(
SELECT form_name
FROM config.custom_field_forms
WHERE table... |
<reponame>wilfriedago/parkoo
/**
* @licence MIT Licence
* @author <NAME>
* @email <EMAIL>
* Created: 27 déc. 2021
*/
--Create database parkooDB
CREATE DATABASE "parkooDB"
WITH
OWNER = postgres
ENCODING = 'UTF8'
CONNECTION LIMIT = -1;
--Create parkooDB.caissiers
CREATE TABLE public.caissiers
(
... |
<filename>resources/migrations_data/mig-enums-2019-03-06.sql
COPY vetd.enums (id, idstr, created, updated, deleted, fsubtype, descr) FROM stdin;
558733581462 heypt0w4 2019-03-06 10:40:00.000-00 2019-03-06 10:40:00.000-00 \N e-yes-no Yes or No
|
<reponame>yasir2000/brown-bear
DROP TABLE IF EXISTS plugin_taskboard_usage;
CREATE TABLE IF NOT EXISTS plugin_taskboard_usage
(
project_id INT(11) NOT NULL PRIMARY KEY,
board_type VARCHAR(10) NOT NULL
);
INSERT INTO plugin_taskboard_usage (project_id, board_type)
SELECT group_id, 'taskboard'
FROM `groups`,... |
-- file:jsonb.sql ln:228 expect:true
SELECT '[5]'::jsonb @> '[5]'
|
<filename>DBADashDB/dbo/Stored Procedures/InstanceVersionInfo_Get.sql
CREATE PROC dbo.InstanceVersionInfo_Get(
@InstanceIDs VARCHAR(MAX)=NULL
)
AS
DECLARE @Instances TABLE(
InstanceID INT PRIMARY KEY
)
IF @InstanceIDs IS NULL
BEGIN
INSERT INTO @Instances
(
InstanceID
)
SELECT InstanceID
FROM dbo.Instances... |
<reponame>SkobelevIgor/stackexchange-xml-to-csv<gh_stars>10-100
-- Example of schema
-- The schema does not include any indexes ( except PK's )
-- Users
CREATE TABLE users (
id SERIAL PRIMARY KEY,
account_id INTEGER,
reputation INTEGER NOT NULL,
views INTEGER DEFAULT 0,
down_votes INTEGER DEFAULT 0,
up_votes IN... |
CREATE TABLE `tb_lvzjcjnwfj`
(
`col_wfdgvtipop` binary(1) NOT NULL,
`col_dhvowgmope` date,
`col_ztgybltpcr` bit(42) DEFAULT b'0',
`col_rfeddmkkmb` enum('enum_or_set_0','enum_or_set_1','enum_or_set_2') CHARACTER SET utf8mb4 NULL DEFAULT 'enum_or_set_0',
CONSTRAINT symb_puisvgsxvj PRIMARY KEY (`col_wf... |
<gh_stars>0
create table persons(
person_id varchar(32) primary key,
person_name varchar(32),
person_age int,
person_sex char(1),
person_section varchar(200),
person_position varchar(100)
);
|
<reponame>irrenhaus/pushmearound_server
CREATE TABLE users (
id SERIAL PRIMARY KEY,
created_at date NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_modified_at date NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_sign_in_at date NOT NULL DEFAULT CURRENT_TIMESTAMP,
username varchar(40) NOT NULL UNIQUE,
first_n... |
/*
Navicat MySQL Data Transfer
Source Host : localhost:3306
Source Database : amdb
Target Host : localhost:3306
Target Database : amdb
Date: 2015-12-27 21:05:20
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `stud... |
<reponame>gerinka/EnhancedDocumentCreator
insert into documentstructurerelation(DocumentTemplateId, StructureElementId)
values
(3, 168),
(3, 169),
(3, 170),
(3, 171),
(3, 172),
(3, 173),
(3, 174),
(3, 175),
(3, 176),
(3, 177),
(3, 178),
(3, 179),
(3, 180),
(3, 181) |
alter table EMAILTEMPLATES_EMAIL_TEMPLATE_FILE_DESCRIPTOR_LINK add constraint FK_EMATEMFILDES_ON_EMAIL_TEMPLATE foreign key (EMAIL_TEMPLATE_ID) references EMAILTEMPLATES_EMAIL_TEMPLATE(ID);
alter table EMAILTEMPLATES_EMAIL_TEMPLATE_FILE_DESCRIPTOR_LINK add constraint FK_EMATEMFILDES_ON_FILE_DESCRIPTOR foreign key (FILE... |
<gh_stars>10-100
create table gx_access_key(
oid integer not null identity(1,1),
access_key uniqueidentifier not null,
secret nvarchar(200) not null,
is_active bit not null default 1,
access_key_type integer,
primary key(oid)
);
create table gx_user_account_access_key_join(
oid_user_account inte... |
-- 505 Number of death records, by death_type_concept_id
--insert into @results_schema.heracles_results (cohort_definition_id, analysis_id, stratum_1, count_value)
select c1.cohort_definition_id,
505 as analysis_id,
death_type_concept_id as stratum_1,
cast( '' as varchar(1) ) as stratum_2, cast( '' as varchar(1... |
create or replace package test_documentation_reporter as
--%suite(ut_documentation_reporter)
--%suitepath(utplsql.test_user.reporters)
--%test(Report produces expected output)
procedure report_produces_expected_out;
end;
/
|
-- Check if pg_stat_last_shoperation stores CREATE of global objects
CREATE DATABASE shoperation;
CREATE ROLE shoperation_user;
SELECT count(*) FROM pg_stat_last_shoperation
WHERE staactionname = 'CREATE' AND stasubtype = 'DATABASE'
AND objid = (SELECT oid FROM pg_database WHERE datname = 'shoperation');
SELECT count... |
<reponame>TTGS/IT_script<gh_stars>0
ERROR: invalid input syntax for type point: ""
2018-07-03 14:50:30| 分类: PostgreSQL | 标签:postgresql 案例 修复
今天接了一个大活,把开发存在mysql数据库里的坐标都导入到postgresql里,为后面的postgis做准备。开发存放坐标也是比较直接,直接一个字符类型就保存了坐标。
前面传过来的数据也是很规矩,经纬度,逗号分隔,不会给你偷摸多个空格什么的。
那我我这里就直接保存成point类型就好了。因为后面反正也是给postgis用,... |
DELETE FROM poll WHERE id = $1;
|
<reponame>afdmoraes/Server
CREATE DATABASE ELIBRAS;
CREATE TABLE publicacoes(
publicacao_id SERIAL PRIMARY KEY,
descricao varchar(255),
)
|
INSERT INTO `district` VALUES (1,'Bad Cannstatt'),(2,'Birkach'),(3,'Botnang'),(4,'Degerloch'),(5,'Feuerbach'),(6,'Hedelfingen'),(7,'Möhringen'),(8,'Mühlhausen'),(9,'Münster'),(10,'Obertürkheim'),(11,'Plieningen'),(12,'Sillenbuch'),(13,'Stammheim'),(14,'Stuttgart‐Mitte'),(15,'Stuttgart‐Nord'),(16,'Stuttgart‐Ost'),(17,'S... |
/*
SQLyog Enterprise v12.4.3 (64 bit)
MySQL - 10.1.13-MariaDB : Database - auth
*********************************************************************
*/
/*Table structure for table `aauth_group_to_group` */
DROP TABLE IF EXISTS `aauth_group_to_group`;
CREATE TABLE `aauth_group_to_group` (
`group_id` int(11) unsig... |
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: mrvir.com (MySQL 5.7.18-0ubuntu0.16.04.1)
# Database: chaos
# Generation Time: 2017-05-10 17:23:52 +0000
# ********************************... |
DELETE FROM [semanticinsight].[process]
DELETE FROM [semanticinsight].[data_type]
DELETE FROM [semanticinsight].[load_pattern_attribute]
DELETE FROM [semanticinsight].[system_framework_attribute]
DELETE FROM [semanticinsight].[load_pattern]
DELETE FROM [semanticinsight].[system_framework]
DELETE FROM [se... |
<gh_stars>1-10
------------------------------------ADDING FEATURE STARTS------------------------
INSERT INTO eg_feature(ID,NAME,DESCRIPTION,MODULE) VALUES (NEXTVAL('seq_eg_feature'),'Common Search Application','Common Search Application',(select id from eg_module where name='Common'));
---------------------------------... |
<filename>Employee Names.sql
-- https://www.hackerrank.com/challenges/name-of-employees/problem
SELECT name
FROM employee
ORDER BY name; |
DROP TABLE IF EXISTS `XXX_galerie_bilder`; ##b_dump##
CREATE TABLE `XXX_galerie_bilder` (
`bild_id` bigint(20) NOT NULL AUTO_INCREMENT,
`bild_datei` varchar(255) NOT NULL,
`bild_gal_id` bigint(20) NOT NULL,
`bild_nummer` int(11) NOT NULL,
`bild_format` varchar(50) NOT NULL,
`bild_breite` int(11) NOT NULL,
... |
<gh_stars>10-100
ENV COLWRAP 120
COL "Create View" new_value ddl
COL "VIEW,TABLE" NOPRINT
SHOW CREATE VIEW `&object_owner`.`&object_name`
save ddl &object_owner..&object_name..sql |
<gh_stars>1-10
-- Up
CREATE TABLE posts_m (
id int unsigned NOT NULL AUTO_INCREMENT,
title varchar(50) DEFAULT NULL,
body text,
created_at datetime NOT NULL,
updated_at datetime NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE a... |
<reponame>UKHomeOffice/hocs-casework
create table casework.case_link
(
primary_case_uuid uuid not null
constraint case_link_primary___fk
references casework.case_data (uuid),
secondary_case_uuid uuid not null
constraint case_link_secondary__fk
references casework.case_dat... |
-- alter4.test
--
-- execsql {ALTER TABLE abc ADD d INTEGER;}
ALTER TABLE abc ADD d INTEGER; |
<gh_stars>1000+
CREATE TYPE status AS ENUM ('open', 'closed');
ALTER TYPE status ADD VALUE 'unknown';
ALTER TYPE status ADD VALUE IF NOT EXISTS 'unknown'; |
<gh_stars>0
--4. List the department of each employee with the following information:
--employee number, last name, first name, and department name.
SELECT
e.emp_no, e.first_name,e.last_name, d.dept_name
FROM employees AS e
JOIN dept_emp AS de on e.emp_no = de.emp_no
JOIN departments AS d on de.dept_no = d.dept_no |
insert into tipo_veiculo values(1,'Caminhão baú', 1.0);
insert into tipo_veiculo values(2,'Caminhão caçamba', 1.05);
insert into tipo_veiculo values(3,'Carreta', 1.12); |
/****** Object: StoredProcedure [dbo].[UpdateMyEMSLUploadIngestStats] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[UpdateMyEMSLUploadIngestStats]
/****************************************************
**
** Desc: Updates column Ingest_Steps_Completed for the given MyEMSL... |
<filename>resources/sql/fb/gene_xref.sql<gh_stars>10-100
SELECT
feature.uniquename as gene_id,
dbxref.accession as xref_id,
db.name as xref_source
FROM feature
JOIN cvterm cvt
ON feature.type_id = cvt.cvterm_id
AND cvt.name = 'gene'
JOIN featureprop
ON feature.feature_id = featureprop.feature_id
... |
<filename>sql/_01_object/_05_serial/_002_with_option/cases/1059.sql
-- create serial using INCREMENT BY which value is 2 and MAXVALUE which value is 999999999999999999999999999999999998
create serial ser1
INCREMENT BY 2
MAXVALUE 9999999999999999999999999999999999998
;
select * from db_serial WHERE name='ser1';
drop... |
-- misc tests : wrong separators, special cases
create table tab1 (name char varying, t1 time, d1 date, d2 datetime, t2 timestamp,i1 integer ,b bit varying);
insert into tab1 values('alice',time'11:21:31',date'2001-10-10',datetime'2002-11-01 03:11:45',timestamp'2006-10-02 21:21:10',3,b'001011101100');
insert into tab1... |
create table stages
(
id varchar(64) not null
constraint stages_pk
primary key,
guide varchar(64) not null
constraint stages_guides_id_fk
references guides
on delete cascade,
from_spot varchar(64) not null
... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 28-04-2021 a las 03:06:45
-- Versión del servidor: 10.1.35-MariaDB
-- Versión de PHP: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
CREATE DATABASE IF NOT EXISTS ims;
USE IMS;
CREATE TABLE IF NOT EXISTS `customers` (
`customers_id` INT(50) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(40) DEFAULT NULL,
`surname` VARCHAR(40) DEFAULT NULL,
PRIMARY KEY (`customers_id`)
);
CREATE TABLE IF NOT EXISTS `items`(
`items_id` int NOT NULL ... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 10, 2017 at 10:15 PM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
use togo;
DROP TABLE IF EXISTS users;
CREATE TABLE users(
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
daily_limit INT NOT NULL DEFAULT 0
)ENGINE=INNODB;
DROP TABLE IF EXISTS user_daily_counters;
CREATE TABLE user_daily_counters(
user_id BIGINT NOT NULL UNIQUE,
daily_count INT NOT NULL DEFAULT 0,
... |
<reponame>emmaus-5h/5Hin1-webshop-Yara
--
-- create tables
--
CREATE TABLE products (
id INTEGER PRIMARY KEY AUTOINCREMENT,
code VARCHAR(15),
name VARCHAR(255),
description TEXT,
price NUMERIC(10, 2),
model VARCHAR(255),
productiejaar_id INTEGER,
kleuren_id INTEGER,
rating_id INTEGER
);
CREATE T... |
<filename>scripts/db-seed/db_data_parcel_tracking.sql<gh_stars>0
INSERT INTO `refua_delivery`.`parcel_tracking` (`status_date`, `status`, `user_fk`, `parcel_fk`) VALUES ('2020-02-01 08:00:00', 'delivered', 14, 6);
|
<gh_stars>0
/* Question 1 */
ALTER TABLE BOOK
ADD(
CONSTRAINT book_price_positive check (price > 0),
CONSTRAINT book_publishdate_notnull check (publish_date is not null)
);
INSERT INTO BOOK values ('9752106401.', '<NAME>', 3, 'Emrah', 'Serbes', -10, to_date('01.06.14', 'DD-mm-YY') , 6);
/* Question 2 *... |
<gh_stars>10-100
CREATE SCHEMA myschema;
CREATE TABLE myschema.foo (a text, b integer);
-- name: InsertValues :copyfrom
-- InsertValues inserts multiple values using copy.
INSERT INTO myschema.foo (a, b) VALUES ($1, $2);
-- name: InsertSingleValue :copyfrom
-- InsertSingleValue inserts a single value using copy.
INSE... |
<reponame>manikmagar/munit-db-testcontainers-connector
drop table if exists books;
CREATE TABLE books (
book_id int(11) NOT NULL AUTO_INCREMENT,
title varchar(45) NOT NULL,
description varchar(45) NOT NULL,
price decimal(10,0) NOT NULL,
total_quantity int(11) NOT NULL,
available_quantity int(11) NOT NULL,
... |
<reponame>idocalm/dl-banking
CREATE TABLE `banking-payments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`player` varchar(255) DEFAULT NULL,
`time` varchar(255) DEFAULT NULL,
`money` varchar(255) DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
);
-- money can be - 500 / + 500
-- play... |
<filename>tools/DDLShow/files/sample.ddl<gh_stars>1-10
/* sample.ddl */
scope Basic
{
include <inc/basic.ddl>
}
include <inc/basic.ddl>
scope Int
{
include <inc/int.ddl>
}
scope Text
{
include <inc/text.ddl>
}
scope Scope
{
include <inc/scope.ddl>
}
scope Block
{
include <inc/block.ddl>
}
s... |
--
-- Copyright 2010-2013 <NAME> and the many 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
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required ... |
DECLARE
@PatientID VARCHAR(50),
@RegistrationDate VARCHAR(100),
@StartARTDate VARCHAR(100),
@TransferInFrom VARCHAR(1000),
@StartRegimenId VARCHAR(1000),
@RegimenName varchar(1000)
DECLARE @C as cursor
Set @C = CURSOR FOR
WITH HIVEnrollment AS (select
a.Ptn_Pk PatientPK
, a.IQNumber
, b.Visit_Id VisitPK
... |
<gh_stars>0
insert into REALMS(ID,NAME,DESCRIPTION,CONFIG,CREATION_TIME,LAST_UPDATE_TIME, REGISTRATION_ENABLED, PRIVACY_POLICY_URL, AUP_URL)
values (1,'iam', 'The iam realm', '{"kc":{"clientId":"iam-api", "clientSecret": "secret"}}', CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), false,
'https://iam.example.com/pr... |
<reponame>ysaakpr/kratos<gh_stars>0
CREATE INDEX `auth_codes_flow_id_idx` ON `auth_codes` (`flow_id`);
|
--######################################################
--# Create legacy indication staging tables DDL and
--# Load legacy FAERS data files into the indi_legacy table
--#
--# LTS Computing LLC
--######################################################
set search_path = faers;
drop table if exists indi_legacy;
create ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.