sql stringlengths 6 1.05M |
|---|
<filename>db/db_create.sql<gh_stars>1-10
BEGIN
FOR remove IN (
SELECT 'DROP ' || object_type || ' ' || object_name || DECODE ( object_type, 'TABLE', ' CASCADE CONSTRAINTS PURGE' ) AS rmsql
FROM user_objects
WHERE object_type IN ( 'TABLE', 'VIEW', 'PACKAGE', 'T... |
<reponame>truthly/pg-cbor
CREATE TYPE cbor.next_state AS (remainder bytea, item jsonb);
|
@./Tables/tables.sql
|
<filename>database/Tables/SocialMediaAccounts.sql
CREATE TABLE SocialMediaAccounts
(
SocialMediaAccountId INT IDENTITY NOT NULL,
FoodTruckId INT NOT NULL,
PlatformId INT NOT NULL,
AccountName VARCHAR(40)
CONSTRAINT PK_SocialMediaAccounts
PRIMA... |
drop table if exists user;
-- create table user (id int primary key auto_increment, name varchar(255), age int(11));
CREATE TABLE `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`password` varchar(20) DEFAULT NULL,
`perms` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENG... |
<filename>Migrations/018 - CachedResults Indexes.sql<gh_stars>100-1000
if dbo.fnIndexExists('CachedResults', 'idxId') = 1
begin
drop index CachedResults.idxId
end
go
if dbo.fnIndexExists('CachedResults', 'idxIdPrimaryKey') = 0
begin
create unique index idxIdUnique on CachedResults (Id)
end |
-- file:matview.sql ln:120 expect:true
CREATE MATERIALIZED VIEW mv_test3 AS SELECT * FROM mv_test2 WHERE moo = 12345
|
-- file:numeric_big.sql ln:1333 expect:true
WITH t(x, bc_result) AS (VALUES
('2.0e10', 10.301029995663981),
('5.0e10', 10.698970004336019),
('8.0e10', 10.903089986991944),
('2.0e17', 17.301029995663981),
('5.0e17', 17.698970004336019),
('8.0e17', 17.903089986991944),
('2.0e24', 24.301029995663981),
('5.0e24', 24.698970... |
CREATE OR REPLACE FUNCTION public.security_user_create(
_security_user_id character varying,
_uid character varying
)
RETURNS SETOF security_user AS
$BODY$
DECLARE
_insertedid integer;
_createddatetime timestamp without time zone DEFAULT now();
BEGIN
INSERT INTO security_user (
created... |
ALTER TABLE my_identity ADD COLUMN birthdate INTEGER DEFAULT NULL;
ALTER TABLE my_identity ADD COLUMN gender INTEGER DEFAULT NULL;
|
# --- !Ups
SET NAMES utf8;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL COMMENT 'user name',
`update_time` int(10) NOT NULL COMMENT 'last update timestamp',
`init_time` int(10) NOT NULL COMMENT 'init timestamp',
`tombstone` tinyint(1) unsigned NOT NULL DEFAULT '0',
... |
-- +migrate Up
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION trigger_set_updated_at()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
-- +migrate StatementEnd
-- +migrate Down
DROP FUNCTION trigger_set_updated_at();
|
drop table posts;
drop table comments;
create table posts (
id serial primary key,
content text,
author varchar(255)
);
create table comments (
id serial primary key,
content text,
author varchar(255),
post_id integer
) |
-- userspace_data was added temporarily and is no longer required
DROP TABLE IF EXISTS userspace_data; |
<reponame>goldmansachs/obevo-kata<filename>kata-files/lesson2/postgresql/expected/MYLARGESCHEMA/function/func86.sql<gh_stars>10-100
CREATE FUNCTION func86() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE284);val:=(SELECT COUNT(*)INTO ... |
-- Tags: no-fasttest
SELECT MONTH(toDateTime('2016-06-15 23:00:00'));
|
--
-- Tests for return correct error from qe when create extension error
-- The issue: https://github.com/greenplum-db/gpdb/issues/11304
--
--start_ignore
drop extension if exists gp_debug_numsegments;
create extension if not exists gp_inject_fault;
--end_ignore
select gp_inject_fault('create_function_fail', 'error',... |
ALTER TABLE `purchase_committee` CHANGE `pc_creation date` `pc_creation date` DATE NOT NULL;
ALTER TABLE `purchase_committee` ADD `pc_purchasethrough` VARCHAR(255) NOT NULL AFTER `pc_dept`;
ALTER TABLE `purchase_committee` CHANGE `pc_creation date` `pc_creationdate` DATE NOT NULL;
ALTER TABLE `purchase_committ... |
DELIMITER //
/*
$trx_status: 200 - Succeeded.
412 - Failed.
*/
create procedure mtp_tx_write_transaction_for_withdrawal
(
$account_no integer,
$withdrawal_type smallint,
$withdrawal_amount decimal(12, 2),
$source_transaction_id varchar(50),
$trx_note ... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 05, 2020 at 06:30 AM
-- Server version: 5.7.17-log
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... |
INSERT INTO instance_session (id, instance_id, connection_id, last_seen_at, client_count, created_at, updated_at)
VALUES (1000, 1000, '24e7437a-eae5-48c4-923e-778c42a6acf8', '2019-01-01', 5, '2019-01-01', '2019-01-01');
INSERT INTO instance_session (id, instance_id, connection_id, last_seen_at, client_count, created_a... |
<filename>person.sql
create table person (
id BIGSERIAL NOT NULL PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
email VARCHAR(50),
gender VARCHAR(50) NOT NULL,
date_of_birth DATE NOT NULL,
country_of_birth VARCHAR(50) NOT NULL
);
insert into person (first_name, last_name, email, ge... |
<reponame>lao-tseu-is-alive/golang-learning<gh_stars>0
CREATE USER gouser WITH PASSWORD '<PASSWORD>';
GRANT CONNECT ON DATABASE golangdb TO gouser;
GRANT USAGE ON SCHEMA public TO gouser;
create table todo
(
id serial not null,
title text not null,
is_done boolean default false not null,
date_created ti... |
<gh_stars>0
drop database university_yourname;
create database university_yourname;
\c university;
create table classroom
(building
varchar(15),
room_number
varchar(7),
capacity
numeric(4,0),
primary key (building, room_number)
);
create table department
(dept_name
varchar(20),
building... |
<reponame>zoiloreyes/Muro
-- phpMyAdmin SQL Dump
-- version 4.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 26, 2016 at 07:46 PM
-- Server version: 5.5.49-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET... |
CREATE DATABASE academiadb
GO
USE academiadb
GO
DROP DATABASE academiadb; |
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 07, 2016 at 04:24
-- Server version: 5.6.20
-- PHP Version: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
<filename>employers.sql
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 06, 2018 at 02:14 PM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+0... |
update fund set created = current_date , purpose_id = null ;
Insert into EG_ACTION (id,name,url,queryparams,parentmodule,ordernumber,displayname,enabled,contextroot,version,createdby,createddate,lastmodifiedby,
lastmodifieddate,application) values (nextval('SEQ_EG_ACTION'),'FundSearch','/masters/fund-search.action'... |
<filename>laravel.sql
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 12, 2021 at 06:30 AM
-- 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 = "+00:0... |
<filename>migrations/20211217182244.do.newUserFields.sql
alter table users add column IF NOT EXISTS flag_public boolean default(true) not null;
alter table users add column IF NOT EXISTS flag_displayfavorites boolean default(false) not null;
alter table users add column IF NOT EXISTS social_networks jsonb default('{"... |
<reponame>uk-gov-mirror/SkillsFundingAgency.das-apprenticeship-programs-indexer
/****** Object: Table [dbo].[NationalRaw] Script Date: 21/04/2020 11:45:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NationalRaw](
[Age] [nvarchar](255) NULL,
[Sector Subject Area Tier 1] [nvarchar... |
<filename>pset7/movies/13.sql
SELECT DISTINCT people.name FROM people
JOIN stars ON people.id = stars.person_id
WHERE stars.movie_id IN
(SELECT stars.movie_id FROM people
JOIN stars ON stars.person_id = people.id
WHERE people.name = "<NAME>"
AND people.birth = 1958)
AND people.name != "<NAME>";
|
<filename>database/schema.sql
/* rough draft */
DROP DATABASE IF EXISTS fish;
CREATE DATABASE fish;
\c fish;
DROP TABLE IF EXISTS users;
CREATE TABLE users
(
id serial NOT NULL,
username text,
firstName text,
lastName text,
email text,
picture text,
adult boolean,
PRIMARY KEY (id)
);
D... |
<filename>data/en/sqlite/subdivisions_JP.sqlite.sql
CREATE TABLE subdivision_JP (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "subdivision_JP" ("id", "name", "level") VALUES ('JP-23', 'Aiti', 'perfecture');
INSERT INTO "subdivision_JP" ("id", "name", "level") VAL... |
SELECT db_alter_table('derkurier_shipper_config', 'update derkurier_shipper_config set CollectorCode=''00'' where CollectorCode IS NULL');
SELECT db_alter_table('derkurier_shipper_config', 'update derkurier_shipper_config set CustomerCode=''00'' where CustomerCode IS NULL');
-- 2018-05-14T06:50:02.532
-- I forgot to... |
<filename>ddl.sql
create table profile(
id serial primary key,
name varchar(42) not null,
email varchar(42) unique not null,
password varchar(42) not null,
coin int default 100
);
create table post(
id serial primary key,
content text not null,
author int not null
);
insert into profil... |
ALTER SESSION SET CURRENT_SCHEMA = system;
CREATE TABLE messages (
id number NOT NULL,
amount number,
due_date date NOT NULL,
fiscal_code VARCHAR2(16) NOT NULL,
invalid_after_due_date number(1) NOT NULL,
markdown clob NOT NULL,
notice_number VARCHAR2(18) NOT NULL,
subject VARCHAR2(100) ... |
UPDATE /*_*/pagecontent SET textvector=to_tsvector(old_text)
WHERE textvector IS NULL AND old_id IN
(SELECT max(rev_text_id) FROM revision GROUP BY rev_page);
INSERT INTO /*_*/updatelog(ul_key) VALUES ('patch-textsearch_bug66650.sql');
|
<reponame>thibonacci/dbt_jira
{{
config(
materialized='incremental',
partition_by = {'field': 'date_day', 'data_type': 'date'}
if target.type != 'spark' else ['date_day'],
unique_key='issue_day_id',
incremental_strategy = 'merge',
file_format = 'delta'
)
}}
w... |
# --- !Ups
ALTER TABLE attachment ALTER COLUMN container_type TYPE varchar(255);
# --- !Downs
ALTER TABLE attachment ALTER COLUMN container_type TYPE varchar(16);
|
<gh_stars>10-100
ALTER TABLE mine_location ALTER COLUMN latitude DROP NOT NULL;
ALTER TABLE mine_location ALTER COLUMN longitude DROP NOT NULL; |
<filename>src/AdminViews/v_get_cluster_restart_ts.sql
--DROP VIEW admin.v_get_cluster_restart_ts ;
/**********************************************************************************************
Purpose: View to get the datetime of when Redshift cluster was recently restarted
History:
2015-07-01 srinikri Created
2016-1... |
<filename>sql/_14_mysql_compatibility_2/_04_table_related/_02_alter_change_column/_02_not_null/cases/clob_blob.sql
--+ holdcas on;
---- ALTER TABLE ... CHANGE COLUMN
-- constraints : testing add/drop : NOT NULL,
-- name : same of different
-- type : CLOB, BLOB , not type change
-- adding 'not null' : permissive... |
-- @testpoint: 字节长度设定为负数,合理报错
-- @modify at: 2020-11-17
drop table if exists test_varchar_03;
create table test_varchar_03 (name varchar(-1));
|
<filename>src/test/regress/sql/gin_test3.sql
-- gin 创建 修改 重建 删除 测试
-- Set GUC paramemter
SET ENABLE_SEQSCAN=OFF;
SET ENABLE_INDEXSCAN=OFF;
SET ENABLE_BITMAPSCAN=ON;
-- 普通表
DROP TABLE IF EXISTS test_gin_1;
CREATE TABLE test_gin_1 (id INT, info INT[]);
DROP TABLE IF EXISTS test_gin_2;
CREATE TABLE test_gin_2 (id INT, ... |
<reponame>theonehg/0317e
-- MySQL dump 10.16 Distrib 10.1.16-MariaDB, for Win32 (AMD64)
--
-- Host: localhost Database: demologin
-- ------------------------------------------------------
-- Server version 10.1.16-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER... |
INSERT INTO `#__osefirewall_basicrules` (`id`, `rule`, `action`, `attacktype`) VALUES
(1, 'OSE_ENABLE_SFSPAM', 1, '["11"]'),
(2, 'BLOCKBL_METHOD', 1, '["1"]'),
(3, 'CHECK_MUA', 1, '["9"]'),
(4, 'checkDOS', 1, '["9"]'),
(5, 'checkDFI', 1, '["6"]'),
(6, 'checkRFI', 1, '["5"]'),
(7, 'checkJSInjection', 1, '["10"]'),
(8, '... |
-- Paymorrow module install SQL file --
ALTER TABLE `oxpayments` ADD COLUMN `OXPSPAYMORROWACTIVE` tinyint( 1 ) NOT NULL DEFAULT 0;
ALTER TABLE `oxpayments` ADD COLUMN `OXPSPAYMORROWMAP` tinyint( 1 ) NOT NULL DEFAULT 0;
ALTER TABLE `oxuserpayments` ADD COLUMN `OXPSPAYMORROWBANKNAME` VARCHAR(255) CHARACTER SET utf8 COLL... |
CREATE TABLE [dbo].[UCGameplayAction] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[GameId] INT NOT NULL,
[Quarter] INT NOT NULL,
[TeamId] INT NOT NULL,
[PlayerId] INT DEFAULT ((-1)) NOT NULL,
[ActionCode] INT NOT NU... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 01, 2022 at 08:43 AM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 7.4.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
<filename>file_db/alkayis_db.sql
-- --------------------------------------------------------
-- Host: 172.16.17.32
-- Server version: 10.3.28-MariaDB - MariaDB Server
-- Server OS: Linux
-- HeidiSQL Version: 11.2.0.6213
-- ----------------------------... |
DROP FUNCTION IF EXISTS recompilation(exp_ids UUID[], recomp_status VARCHAR);
CREATE OR REPLACE FUNCTION recompilation(exp_ids UUID[], recomp_status VARCHAR)
returns table(name VARCHAR, value VARCHAR, run_id INTEGER) as $recompilation$
BEGIN
RETURN QUERY
SELECT config.name,
config.value,
c... |
<gh_stars>1-10
SELECT TOP 5
e.EmployeeID,
e.FirstName,
e.Salary,
d.Name AS [DepartmentName] FROM Employees AS e
INNER JOIN Departments AS d ON e.DepartmentID = d.DepartmentID
WHERE e.Salary > 15000
ORDER BY e.DepartmentID |
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `[DATABASE_PREFIX]mysql_databases`;
CREATE TABLE `[DATABASE_PREFIX]mysql_databases` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`time_created` datetime DEFAULT NULL,
`time_deleted` datetime DEFAULT N... |
<gh_stars>1-10
create or replace function auth.test_login() returns void as $$
begin
IF assert.not_null(users.add('login', 'password', '<PASSWORD>', '<EMAIL>', true)) THEN
PERFORM assert.not_null(auth.login('login', 'password'));
END IF;
PERFORM assert.exception(
... |
-- Drop databse if not exists
-- DROP DATABASE IF EXISTS jobfinder_db;
-- CREATE DATABASE jobfinder_db;
-- use jobfinder_db;
-- create table User(
-- id integer auto_increment NOT NULL,
-- firstname VARCHAR(50),
-- lastname VARCHAR(50),
-- email VARCHAR(100),
-- password VARCHAR(20),
-- PRIMA... |
<reponame>pjunyent/Kalkun
CREATE TABLE "plugin_sms_credit" (
"id_user_credit" serial PRIMARY KEY,
"id_user" integer NOT NULL,
"id_template_credit" integer NOT NULL,
"valid_start" timestamp(0) WITHOUT time zone NOT NULL,
"valid_end" timestamp(0) WITHOUT time zone NOT NULL
);
CREATE TABLE "plugin_sms_credit_temp... |
SELECT * FROM (
SELECT
quants.id AS original_id,
'Quant' AS original_type,
quants.name,
qp.display_name,
quants.unit,
qp.unit_type,
qp.tooltip_text
FROM quants
LEFT JOIN quant_properties qp ON qp.quant_id = quants.id
UNION ALL
SELECT
inds.id,
'Ind',
inds.name,
ip.... |
-- file:join.sql ln:1042 expect:true
explain (costs off)
select * from
(values (1, array[10,20]), (2, array[20,30])) as v1(v1x,v1ys)
left join (values (1, 10), (2, 20)) as v2(v2x,v2y) on v2x = v1x
left join unnest(v1ys) as u1(u1y) on u1y = v2y
|
<filename>coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/current/4.0/dml/KC_DML_31001_PERSON_TRAINING_0TSD.sql
INSERT INTO PERSON_TRAINING (PERSON_TRAINING_ID,PERSON_ID,TRAINING_NUMBER,TRAINING_CODE,SCORE,DATE_REQUESTED,DATE_SUBMITTED,DATE_ACKNOWLEDGED,FOLLOWUP_DATE,ACTIVE_FLAG,UPDATE_USER,UPDATE_TI... |
<reponame>Ambal/mangos
-- Enhanced .gocreature command
DELETE FROM `command` WHERE `name` = 'gocreature';
INSERT INTO `command` VALUES('gocreature',2,'Syntax: .gocreature #creature_guid\r\nTeleport your character to creature with guid #creature_guid.\r\n.gocreature #creature_name\r\nTeleport your character to creature ... |
CREATE TABLE [Payroll].[Employee]
(
[ID] [int] NOT NULL,
[FirstName] [nvarchar] (100) COLLATE Latin1_General_CI_AS NOT NULL,
[LastName] [nvarchar] (150) COLLATE Latin1_General_CI_AS NOT NULL,
[DateOfBirth] [datetime] NOT NULL,
[PayrollNumber] [int] NOT NULL,
[DepartmentID] [int] NOT NULL,
[Twitter] [nvarchar] (50) COLL... |
CREATE TABLE `t_order_0` (
`order_id` bigint(20) unsigned NOT NULL,
`user_id` int(11) DEFAULT NULL,
PRIMARY KEY (`order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `t_order_1` (
`order_id` bigint(20) unsigned NOT NULL,
`user_id` int(11) DEFAULT NULL,
PRIMARY KEY (`order_id`)
) ENGINE=InnoDB ... |
GO
PRINT N'Creating [dbo].[__EFMigrationsHistory]...';
GO
CREATE TABLE [dbo].[__EFMigrationsHistory] (
[MigrationId] NVARCHAR (150) NOT NULL,
[ProductVersion] NVARCHAR (32) NOT NULL,
CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY CLUSTERED ([MigrationId] ASC)
);
GO
PRINT N'Creating [dbo].[As... |
<filename>posda/posdatools/queries/sql/GetPosdaPhiElementSigInfo.sql
-- Name: GetPosdaPhiElementSigInfo
-- Schema: posda_phi
-- Columns: ['element_signature', 'vr', 'is_private', 'private_disposition', 'name_chain']
-- Args: []
-- Tags: ['NotInteractive', 'used_in_reconcile_tag_names']
-- Description: Get the relevant ... |
CREATE ROLE lele WITH SYSID 1000
CREATE ROLE lele WITH ADMIN r1, r2
|
UPDATE oppgave SET status='Invalidert'::oppgavestatus WHERE status='AvventerSaksbehandler'::oppgavestatus AND opprettet < '2020-04-28 15:15:00'::timestamp;
|
<reponame>renepacios/code-snippets<filename>T-SQL/QueryAdHocCachePlans.sql
SELECT UseCounts, Cacheobjtype, Objtype, TEXT, query_plan
FROM sys.dm_exec_cached_plans
CROSS APPLY sys.dm_exec_sql_text(plan_handle)
CROSS APPLY sys.dm_exec_query_plan(plan_handle)
where ObjType='Adhoc'
order by usecounts desc
|
<filename>database/blog_admin.sql
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 80016
Source Host : 127.0.0.1:3306
Source Database : blog
Target Server Type : MYSQL
Target Server Version : 80016
File Encoding : 65001
Date: 2019-09-19 16:36:33
*/
... |
DROP TABLE IF EXISTS `#__gals`;
DROP TABLE IF EXISTS `#__gals_photo`; |
DROP TABLE users;
DROP TABLE scratches;
|
/*
Navicat MySQL Data Transfer
Source Server : vmware
Source Server Version : 50542
Source Host : 192.168.1.203:3306
Source Database : ad_bg
Target Server Type : MYSQL
Target Server Version : 50542
File Encoding : 65001
Date: 2015-12-09 19:27:34
*/
SET FOREIGN_KEY_CHECKS=0;
-- --... |
<filename>SQL Scripts/OriginalTableList.sql<gh_stars>0
CREATE TYPE [dbo].[OriginalTableList] AS TABLE(
[tbl] [varchar](200) NOT NULL, [srcFile] [varchar](5000) NULL,
UNIQUE NONCLUSTERED
(
[tbl] ASC
)WITH (IGNORE_DUP_KEY = OFF)
)
|
<gh_stars>0
INSERT INTO
auth.providers (provider)
VALUES
('strava');
|
<gh_stars>1-10
SELECT 'DROP INDEX [' + I.[NAME] + '] ON [' + sc.name + '].[' + o.name + ']',
o.name,
I.[NAME] AS [INDEX NAME],
s.USER_SEEKS,
s.USER_SCANS,
s.USER_LOOKUPS,
s.USER_UPDATES,
ps.row_count,
SizeMb= (ps.in_row_reserved_page_count*8.)/1024.,
s.last_use... |
<gh_stars>1-10
-- Add phone, phone_confirmed_at columns to auth.users
ALTER TABLE auth.users
ADD COLUMN phone VARCHAR(15) UNIQUE,
ADD COLUMN phone_confirmed_at timestamptz; |
<gh_stars>10-100
SELECT setval('seq_egf_budget',(select max(id)+1 from EGF_BUDGET));
|
<reponame>chackoge/ERNIE_Plus
-- DDL script for base table:
-- Field - Immunology
-- Seed Year - 1986
SET search_path = theta_plus;
--
-- Get all immunology articles published in the year 1986
DROP TABLE IF EXISTS theta_plus.imm1986;
CREATE TABLE theta_plus.imm1986
TABLESPACE theta_plus_tbs AS
SELECT sp.scp FROM pub... |
--
-- Setup data.
--
DECLARE @create_admin BIT;
DECLARE @admin_email VARCHAR(100);
DECLARE @task_status VARCHAR(100);
SET @create_admin = (SELECT IIF([value] = 'true', 1, 0) FROM __sync_db_injected_config WHERE [key] = 'create_admin');
SET @admin_email = (SELECT [value] FROM __sync_db_injected_config WHERE [key] = 'ad... |
-- Création des tables du projet
-- created by <NAME> <<EMAIL>>
-- since 22/02/2019
-- ********************************************************************************************
-- STRUCTURE DE DONNEES POUR LES ESTIMATION D'UNE BORNE INFERIEUR V1
-- *******************************************************************... |
<gh_stars>10-100
-- file:alter_table.sql ln:1384 expect:true
CREATE TABLE test_type_diff2_c3 (int_two int2, int_four int4, int_eight int8)
|
<reponame>RyanAFinney/sakai
-- SAM-666
alter table SAM_ASSESSFEEDBACK_T add FEEDBACKCOMPONENTOPTION number(10,0) default null;
update SAM_ASSESSFEEDBACK_T set FEEDBACKCOMPONENTOPTION = 2;
alter table SAM_PUBLISHEDFEEDBACK_T add FEEDBACKCOMPONENTOPTION number(10,0) default null;
update SAM_PUBLISHEDFEEDBACK_T set FEED... |
--testデータを入れる
--会社テストデータ
INSERT
INTO public.company (company_seq, address, name, phone, zip) VALUES
(1, '東京都千代田区丸の内〇-〇-〇', 'SENSIBILE(サンシーブル)', '03-〇〇〇-〇〇〇', '○○○○'),
(2, '東京都港区赤坂〇-〇-〇', '', '03-〇〇〇-〇〇〇', '○○○○')
;
--クライアントテストデータ
INSERT
INTO PUBLIC.clients(clients_seq, name) VALUES
(1, '宮木総合商事'),
(2, '木原商事'),
(3... |
create table product(id serial primary key,
name varchar(2000),
type_id int,
expired_date date,
price money);
create table type(id serial primary key, name varchar(2000));
insert into type (name) values ('СЫР'),('МОЛОКО');
select * from type;
insert into product (name, type_id, expire... |
<gh_stars>0
--$Id$
alter table WF_DEFAULT_PROC_ACTOR add column SORT_ORDER integer^ |
CREATE TABLE /*TABLE_PREFIX*/t_item_toggle_status (
ti_id INT(10) UNSIGNED NOT NULL,
ti_status INT(1) NOT NULL,
PRIMARY KEY (ti_id),
FOREIGN KEY (ti_id) REFERENCES /*TABLE_PREFIX*/t_item (pk_i_id)
) ENGINE=InnoDB DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI'; |
-- Create table to load SC930 format data from CSV file output:
--CREATE TABLE queries
--(
-- querytext VARCHAR(16000) WITH NULL WITH DEFAULT,
-- begintimestamp TIMESTAMP WITHOUT TIME ZONE WITH NULL WITH DEFAULT,
-- endtimestamp TIMESTAMP WITHOUT TIME ZONE WITH NULL WITH DEFAULT,
... |
-- Заполнение date_finish в oa_session
declare
nRecord integer;
begin
nRecord := pkg_OAuthInternal.setSessionDateFinish();
jobResultMessage :=
'Заполнение date_finish в oa_session: обновлено записей: '
|| to_char( nRecord)
;
end;
|
<reponame>ThatAnnoyingKid/pikadick-rs
SELECT
enabled
FROM
reddit_embed_guild_settings
WHERE
guild_id = ?; |
<reponame>yunayr/StudtNote-SQL
-- 查詢在2025-10-15以後,
-- 同一個用戶下單2個以及2個以上
-- 狀態為購買成功的C++課程或Java課程或Python課程的user_id,
-- 並且按照user_id升序排序
SELECT user_id
FROM order_info
WHERE product_name IN('C++', 'Java', 'Python')
AND `status` = 'completed'
AND date > '2025-10-15'
GROUP BY user_id
HAVING count(1) >= 2
ORDER BY user_id
;
... |
-- @testpoint:opengauss关键字characteristics(非保留),作为函数名
--关键字不带引号-成功
drop function if exists characteristics;
create function characteristics(i integer)
returns integer
as $$
begin
return i+1;
end;
$$ language plpgsql;
/
--清理环境
drop function characteristics;
--关键字带双引号-成功
drop function if exists "characteristics";
cr... |
<reponame>risnadesmayanti/silatek-bt4
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.31.10
-- Waktu pembuatan: 21 Jan 2020 pada 08.41
-- Versi server: 10.1.39-MariaDB
-- Versi PHP: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_... |
-- CreateTable
CREATE TABLE "environments" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"logo" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "environments_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "users" (
"... |
<gh_stars>0
Insert into R_CIRCUMSTANCE_TYPE (CIRCUMSTANCE_TYPE_ID,CODE_VALUE,CODE_DESCRIPTION,SELECTABLE,ACTIVE_DUPLICATES,ROW_VERSION,CREATED_BY_USER_ID,CREATED_DATETIME,LAST_UPDATED_USER_ID,LAST_UPDATED_DATETIME,TRAINING_SESSION_ID,ENQUIRY,SPG_INTEREST) values (1500001951,'OPD1','OPD Pathway Screen','Y','Y',6,1500000... |
<reponame>manuGarciaMons/PHP
/*
Obtener listado de clientes atendidos por el vendedor '<NAME>'
*/
SELECT * FROM clientes WHERE vendedor_id IN(
SELECT id FROM vendedores WHERE nombre = 'David' AND apellidos = 'Lopez'
); |
-- =============================================
-- Author: (<EMAIL> <NAME>; <NAME>)
-- Create date: 2015-02-12
-- Description: Lists Parameters And their Configured Values for Package from the JobStep belongig to specified JobStepExecutionID.
-- Allways Checks Is there is a Value for the proposed Sytem (Dev, QA etc... |
<gh_stars>1-10
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `question_group` (
`group_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`group_text` varchar(255) NOT NULL,
`page_num` tinyint(4) NOT NULL,
PRIMARY KEY (`group_id`)
) ENGINE=In... |
create table zamestnanci (
-- Evidence všech zaměstnanců v nemocnici
id_zam int primary key auto_increment,
-- umělý, automaticky generovaný primární klíč
prijm nvarchar(100) not null,
-- Příjmení lékaře
-- rozsah 2 až 100 znaků včetně
jmeno nvarchar(100) not null
-- Jméno (jména) lékaře
... |
create unique index holyday_day_country_region_city_uindex
on holyday (day, country, region, city); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.