sql stringlengths 6 1.05M |
|---|
--implicit conversion from TIME(L)TZ columns to bit/blob/clob types, in update
drop table if exists tz_test, bbc_types;
create table tz_test (id int auto_increment, ts time, tltz datetime with local time zone, ttz datetime with time zone);
set timezone '+10:00';
insert into tz_test(ts, tltz, ttz) values (time'2:00:0... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint:创建数据源对象,添加type选项
--创建数据源对象,type为空
DROP DATA SOURCE if exists ds_test3;
CREATE DATA SOURCE ds_test3 type '';
--查询创建的数据源对象信息
select srcname,srctype,srcversion,srcacl,srcoptions from PG_EXTENSION_DATA_SOURCE where srcname = 'ds_test3';
--删除数据源对象
DROP DATA SOURCE ds_... |
<gh_stars>0
-- @testpoint:opengauss关键字symmetric(保留),作为字段数据类型(合理报错)
--前置条件
drop table if exists symmetric_test cascade;
--关键字不带引号-合理报错
create table symmetric_test(id int,name symmetric);
--关键字带双引号-合理报错
create table symmetric_test(id int,name "symmetric");
--关键字带单引号-合理报错
create table symmetric_test(id int,name 'symm... |
-- ADM - 04) Ranking de músicas mais ouvidas n lugar X no periodo Y.
SELECT titulo, count(*) AS QTD_REPRODUCOES
FROM ((
SELECT idM, titulo, idU, cidade
FROM ((
SELECT mus_id AS idM, idU, cidade
FROM ((SELECT id_usuario AS idU, cidade_residencia AS cidade
FROM usuario
WHERE cidade_residencia LIKE '%/BR') AS ouvi_cid... |
<gh_stars>0
alter table person_sessions
add name_suffix varchar(100) null; |
<gh_stars>0
CREATE TABLE users (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
email VARCHAR(256) NOT NULL UNIQUE,
name VARCHAR(32),
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
deleted_at TIMESTAMP DE... |
-- MySQL dump 10.13 Distrib 8.0.19, for macos10.15 (x86_64)
--
-- Host: localhost Database: News
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... |
<filename>bookcase-core/src/test/resources/db/migration/V99999999.0__data.sql
INSERT INTO accounts (id, uuid, username, password) VALUES (accounts_sq.nextval, '<PASSWORD>', 'Account 1 username', 'Account 1 password');
INSERT INTO accounts (id, uuid, username, password) VALUES (accounts_sq.nextval, '<PASSWORD>', 'Accoun... |
CREATE TABLE guestbook (
id SERIAL,
visitor varchar(128) NOT NULL,
comment text NOT NULL,
time timestamp DEFAULT CURRENT_TIMESTAMP
);
|
<gh_stars>0
-- =============================================
-- Author: <NAME> <<EMAIL>>
-- Create date: 2017-07-30
-- Description: Retrieves timetable for a station.
-- =============================================
CREATE PROCEDURE [dbo].[GetTimetable]
@stop_id nvarchar(100),
@route_short_name nvarchar(50),
@date ... |
<gh_stars>0
SELECT C.CLIENT_ID, C.SURNAME, CA.CLIENT_ACCOUNT_NUMBER, A_TYPE.DESCRIPTION, CA.DISPLAY_BALANCE
FROM CLIENT_ACCOUNT CA
INNER JOIN CLIENT C ON C.CLIENT_ID = CA.CLIENT_ID
INNER JOIN ACCOUNT_TYPE A_TYPE ON A_TYPE.ACCOUNT_TYPE_CODE = CA.ACCOUNT_TYPE_CODE
INNER JOIN (
SELECT INNER_CA.CLIENT_ID, MAX(INNER... |
<gh_stars>0
create database if not exists test_products;
use test_products;
create table if not exists product(
id int not null auto_increment primary key ,
name varchar(200) not null,
price double not null default 0,
quanti... |
<filename>database/30_data.sql
BEGIN;
--------------------------------------------------------------------------------
INSERT INTO hidden.users VALUES ('dev-test', '2016-03-08 19:44:47.858918', '2016-03-08 19:44:47.858918', 'dev-test', 'dev-test', NULL, NULL);
INSERT INTO hidden.users VALUES ('auth0|56dea0b381de292e0... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 11, 2018 at 12:17 PM
-- Server version: 5.7.21-0ubuntu0.16.04.1
-- PHP Version: 7.0.28-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... |
<filename>scripts/alias_tz.sql
DROP TABLE IF EXISTS "alias";
CREATE TABLE "alias"
(
alias_TZID text,
alias_new_TZID text
);
|
<gh_stars>1-10
-- \i /home/globi/sex_for_many/sql/vroom.sql
drop table if exists vroom;
create table vroom(
us_id int not null,
nick varchar(16) unique not null references buser(bname),
src text, -- video src
p text, -- video poster
descr text, -- video stream description
crat TIMESTAMP NOT NULL default now()::timesta... |
-- MIT License
-- Copyright(c) 2020 Futurewei Cloud
--
-- 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,... |
<filename>db_archive/sql_archive/471__alter_tables_f_amk-yo_opintopisteet_measures_to_null.sql
-- change a set of column types based on one check
IF EXISTS (
select * from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA='dw' and TABLE_NAME='f_yo_opintopisteet'
and COLUMN_NAME='kaikki_tutk_op_lkm' and IS_NULLABLE='N... |
ALTER TABLE [dbo].[SecurityRolePermission] WITH CHECK ADD CONSTRAINT [FK_SecurityRolePermission_SecurityPermission]
FOREIGN KEY([SecurityPermissionId]) REFERENCES [dbo].[SecurityPermission] ([Id])
GO
ALTER TABLE [dbo].[SecurityRolePermission] WITH CHECK ADD CONSTRAINT [FK_SecurityRolePermission_SecurityRole]
FOR... |
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
INSERT INTO pagos_tipos_cadena_pago VALUES('01','SPEI');
COMMIT;
|
{%- macro sqlserver__iso_week_end(date) -%}
{{ dbt_date._iso_week_end(date, 'iso_week') }}
{%- endmacro %} |
<reponame>Calcifer777/scalachain
CREATE TABLE IF NOT EXISTS pythonkeyspace.mytable (
mykey text,
col1 text,
col2 text,
PRIMARY KEY (mykey, col1))
WITH ID = ddcdb490-c8f5-11ea-9497-e709cd27ef9f
AND CLUSTERING ORDER BY (col1 ASC)
AND bloom_filter_fp_chance = 0.01
AND dclocal_read_repair_chance = 0.1
AND crc_chec... |
<filename>models/intermediate/int_mailchimp__automation_recipients.sql<gh_stars>1-10
{{ config(enabled=var('mailchimp_using_automations', True)) }}
with recipients as (
select *
from {{ var('automation_recipient') }}
), automation_emails as (
select *
from {{ var('automation_email') }}
), automatio... |
<filename>deployments/compose/dbt/dbt-project/macros/create-schema.sql
{% macro create_schama(name, location) %}
create schema {{ name }} with ( location = '{{location}}')
{% endmacro %}
|
<filename>t/pg-test-files/expected/conversion.sql
--
-- create user defined conversion
--
CREATE USER regress_conversion_user WITH NOCREATEDB NOCREATEROLE;
SET SESSION AUTHORIZATION regress_conversion_user;
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
--
-- cannot make same name conversion... |
<gh_stars>1-10
DROP VIEW IF EXISTS view_persediaan_barang3_setwan;
CREATE VIEW view_persediaan_barang3_setwan AS
SELECT
*,
CASE WHEN pra_saldo > 0 AND jumlah >= pra_saldo
THEN pra_saldo
WHEN pra_saldo > 0 AND jumlah < pra_saldo
THEN jumlah
ELSE 0
END AS saldo
FROM
view_persediaan_barang2_setwan
WHERE
1... |
<reponame>opengauss-mirror/Yat<filename>openGaussBase/testcase/KEYWORDS/sequence/Opengauss_Function_Keyword_Sequence_Case0018.sql
-- @testpoint:opengauss关键字sequence(非保留),作为数据库名
--关键字不带引号-成功
drop database if exists sequence;
create database sequence;
drop database sequence;
--关键字带双引号-成功
drop database if exists "seque... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 01-05-2021 a las 20:52:24
-- Versión del servidor: 10.1.30-MariaDB
-- Versión de PHP: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone ... |
INSERT INTO images(id, created_at, texture, hash_name)
VALUES (%s, %s, %s, %s); |
<gh_stars>0
DROP TABLE IF EXISTS location;
CREATE TABLE location (
id SERIAL PRIMARY KEY,
search_query VARCHAR(255),
formatted_query VARCHAR(255),
latitude DECIMAL,
longitude DECIMAL
); |
<reponame>doublem1nt/burgerTime<gh_stars>0
-- DROP database if it already exists
DROP DATABASE IF EXISTS burgers_db;
-- Create the database burgers_db and specified it for use.
CREATE DATABASE burgers_db;
USE burgers_db;
-- Create Table with three properties / columns, id is the primary key. devoured remains false o... |
-- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 17 Okt 2018 pada 03.59
-- Versi server: 10.1.33-MariaDB
-- Versi PHP: 7.2.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
-- Source : https://leetcode.com/problems/department-top-three-salaries/
-- Author : <NAME>
-- Date : 2018-04-03
/***************************************************************************************
*
* The Employee table holds all employees. Every employee has an Id, and there is also a column for the depar... |
CREATE TABLE Monasteries (
Id INT PRIMARY KEY IDENTITY,
Name NVARCHAR(MAX) NOT NULL,
CountryCode CHAR(2) FOREIGN KEY REFERENCES Countries (CountryCode)
)
INSERT INTO Monasteries (Name, CountryCode) VALUES
('Rila Monastery “St. Ivan of Rila”', 'BG'),
('Bachkovo Monastery “Virgin Mary”', 'BG'),
('Troyan Mona... |
USE TripService
WITH CTE_TripsByCountry AS
(
SELECT
a.Id AS [AccountId],
a.Email,
c.CountryCode,
COUNT(t.Id) AS [TripsCount],
DENSE_RANK() OVER
(
PARTITION BY c.CountryCode
ORDER BY COUNT(t.Id) DESC
) AS [TripsRank]
FROM Cities AS c
JOIN Hotels AS h
ON h.CityId = c.Id
JOIN Rooms AS r
ON r.Hot... |
SET FOREIGN_KEY_CHECKS = 0;
DELETE
FROM reported_user;
DELETE
FROM ban;
DELETE
FROM moderation_report;
DELETE
FROM teamkills;
DELETE
FROM unique_id_users;
DELETE
FROM uniqueid;
DELETE
FROM global_rating;
DELETE
FROM ladder1v1_rating;
DELETE
FROM uniqueid_exempt;
DELETE
FROM version_lobby;
DELETE FROM friends_and_foes;
... |
ALTER TABLE users DROP COLUMN series_lang_mode;
ALTER TABLE users DROP COLUMN main_series_lang;
ALTER TABLE users DROP COLUMN fallback_series_lang; |
<filename>FLDCLegacyDataMigrator/FLDCLegacyDataMigrator.Tests/TestData/EmptyFile.sql
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: mysql.joelooney.org
-- Generation Time: Jun 19, 2018 at 04:57 AM
-- Server version: 5.6.34-log
-- PHP Version: 7.1.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_... |
-- file:triggers.sql ln:1707 expect:true
create table child () inherits (parent)
|
-- file:json.sql ln:363 expect:true
select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', '']
|
<filename>Patches/Live_20/Raw_SQL/04_EliteModules_upserts__2020_12_26.sql
USE [perpetuumsa]
GO
--------------------------------------------
-- ELITE MODULES for Stronghold zone 70 boss
-- a lot
-- Date modified: 2021/01/19
--------------------------------------------
DECLARE @highTierCommodity AS BIGINT = (SELECT TOP... |
DROP FUNCTION IF EXISTS de_metas_acct.taxaccounts_details(p_AD_Org_ID numeric(10, 0),
p_Account_ID numeric,
p_C_Vat_Code_ID numeric,
p_DateFrom date,
p_DateTo date);
CREATE OR REPLACE FUNCTION de_metas_acct.taxaccounts_details(p_AD_Org_ID numeric(10, 0),
... |
DROP TABLE IF EXISTS `character_queststatus_rewarded`;
CREATE TABLE `character_queststatus_rewarded` (
`guid` int(10) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier',
`quest` int(10) unsigned NOT NULL default '0' COMMENT 'Quest Identifier',
PRIMARY KEY (`guid`,`quest`)
) ENGINE=InnoDB DEFAULT CHA... |
/*
Navicat MySQL Data Transfer
Source Server : bz
Source Server Version : 50713
Source Host : localhost:3306
Source Database : bz
Target Server Type : MYSQL
Target Server Version : 50713
File Encoding : 65001
Date: 2016-07-21 01:25:18
*/
SET FOREIGN_KEY_CHECKS=0;
-- -------------... |
<reponame>skylover87/friendManagement<gh_stars>0
TRUNCATE TABLE profile_account;
INSERT INTO profile_account (email_address) values ('<EMAIL>');
TRUNCATE TABLE friends;
INSERT INTO friends (id, owner_id, friend_id) values (null, '<EMAIL>', '<EMAIL>');
INSERT INTO friends (id, owner_id, friend_id) values (null, '<EMAI... |
select p.FirstName, p.LastName , a.City, a.State
from Person p left join Address a on p.PersonId = a.PersonId |
<gh_stars>1-10
SELECT p.objectid
,p.id
,p.sireid
,p.date
,to_char(p.date_conception, 'yyyy-MM-dd') AS date_conception
, CASE
WHEN p.date_conception_early IS NOT NULL AND p.date_conception_late IS NOT NULL THEN
(to_char(p.date_conception_early, 'yyyy-MM-dd') || ' to ' ... |
alter table AccountProvider rename to ServiceProvider;
update ServiceProvider set implementation = 'com.springsource.greenhouse.connect.providers.TwitterServiceProvider' where name = 'twitter';
update ServiceProvider set implementation = 'com.springsource.greenhouse.connect.providers.FacebookServiceProvider' where name... |
<gh_stars>10-100
CREATE FUNCTION func506() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE465);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE14);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE47);val:=(SELECT COU... |
CREATE TABLE [dbo].[EmailClients]
(
[clientId] INT NOT NULL PRIMARY KEY,
[key] VARCHAR(32) NOT NULL,
[label] NVARCHAR(64) NOT NULL,
[config_json] NVARCHAR(MAX) NOT NULL
)
|
create table t (a int default 1, b int default 2);
create table s (s1 int default 10, s2 int default 11, s3 int default 12, s4 int default 13);
create view v (x int default 5, y int default 7) as
select * from t;
create view v2 as subclass of v (z int default 8, w int default 9) as
select * from s;
insert into v2 (... |
<reponame>ursjoss/sipamato
-- in order to add referential integrity between new_study and paper, we do need the records
INSERT INTO paper(ID, NUMBER, PM_ID, AUTHORS, TITLE, LOCATION, PUBLICATION_YEAR) VALUES
(8861, 8861, 28321937, '<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.'... |
<filename>sql/_27_banana_qa/issue_5765_timezone_support/_00_dev_cases/_01_object/_05_datetimeltz/cases/1063.sql
create class test_class (int_col int, datetime_col datetimeltz, UNIQUE(datetime_col));
insert into test_class(int_col, datetime_col) values(1, datetimeltz '1994-01-02 23:59:59.999');
insert into test_class(i... |
DROP DATABASE IF EXISTS company_employees;
CREATE DATABASE company_employees;
USE company_employees;
-- create 3 different tables --
CREATE TABLE department(
id INTEGER (4) NOT NULL,
dpt_name VARCHAR (30) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE roles(
id INTEGER (4) NOT NULL,
title... |
<filename>queries/select_to_predict_illness_probability.sql
SELECT
age,
psa_level0,
pros_gleason,
dth_cat
FROM
prostate_screening.prostate_overall
WHERE
is_dead = 1.0 AND f_cancersite = 1.0 AND dth_cat = 1.0
AND (psa_level0 != 0.0) AND (psa_level0 <= 35.0) AND (pros_gleason NOT IN (0.0, 99.0)) |
--SQL TESTS--
CREATE DATABASE user_profiles;
--set extension
CREATE TABLE users(
user_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
user_name VARCHAR(255) NOT NULL,
user_email VARCHAR(255) NOT NULL,
insurance_id VARCHAR(255) NOT NULL,
user_password VARCHAR(255) NOT NULL
);
--insert sample user
... |
-- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Хост: 10.12.125.155:3306
-- Время создания: Ноя 23 2018 г., 19:03
-- Версия сервера: 5.7.19
-- Версия PHP: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
-- find the full name of each employee
USE TelerikAcademy
SELECT FirstName + ' ' + COALESCE(MiddleName, '') + ' ' + LastName AS [Full Name]
FROM Employees |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 10 Agu 2020 pada 15.23
-- Versi server: 10.4.6-MariaDB
-- Versi PHP: 7.1.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
--
-- Dumping data for table `language`
--
INSERT INTO `language` (`id`, `name`, `abbreviation`) VALUES
(1, 'English', 'en'),
(2, 'Français', 'fr'),
(3, 'Deutsch', 'de'),
(4, 'Español', 'es'),
(5, 'Italiano', 'it'),
(6, 'Български', 'bg');
--
-- Dumping data for table `role`
--
INSERT INTO `role` (`id`, `name`, `des... |
<gh_stars>0
CREATE TABLE IF NOT EXISTS `gameservers` (
`server_id` int(11) NOT NULL DEFAULT '0',
`hexid` varchar(50) NOT NULL DEFAULT '',
`host` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`server_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
CREATE PROCEDURE `sumoftwoproc`(IN numb INT)
BEGIN
DECLARE cubeRoot FLOAT;
DECLARE yCube DOUBLE;
DECLARE y DOUBLE;
DECLARE i INT;
SET cubeRoot = FLOOR(POW(numb, 1/3));
SET i = 1;
SET @result = FALSE;
# Start at 1 up until the cube root of the sum
# Get the leftover amount after taking... |
<reponame>zachfedor/flask-boilerplate
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id bigserial PRIMARY KEY,
email text UNIQUE NOT NULL,
password text NOT NULL
);
|
<gh_stars>0
CREATE DATABASE "TableRelationsDB";
USE "TableRelationsDB"; |
<reponame>accelcloud/ecd
-- MySQL dump 10.13 Distrib 5.1.73, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: ecd
-- ------------------------------------------------------
-- Server version 5.1.73-1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESUL... |
<gh_stars>1-10
SELECT
prescriptions.subject_id,prescriptions.icustay_id,prescriptions.drug_type,prescriptions.drug,prescriptions.drug_name_poe,prescriptions.drug_name_generic, prescriptions.formulary_drug_cd,prescriptions.prod_strength, prescriptions.dose_val_rx,prescriptions.dose_unit_rx, prescriptions.form_val_disp... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 01, 2018 at 11:23 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>matigo/streams
INSERT INTO `File` (`account_id`, `name`, `local_name`, `public_name`, `hash`, `bytes`, `location`, `type`, `guid`)
SELECT [ACCOUNT_ID] as `account_id`, LEFT('[FILENAME]', 256) as `name`, LEFT('[FILELOCAL]', 80) as `local_name`, LEFT('[FILENAME]', 256) as `public_name`,
'[FILEHASH]' as `... |
<filename>uscho/loaders/load_uscho_teams.sql
begin;
drop table if exists uscho.teams;
create table uscho.teams (
team_id text,
year integer,
season text,
coach text,
conference text,
division text,
won integer,
lost integer,
tied integer,
win_perc... |
--
-- empresa
--
CREATE TABLE empresa (
cnpj text,
identificador_matriz_filial bigint,
razao_social text,
nome_fantasia text,
situacao_cadastral bigint,
data_situacao_cadastral date,
motivo_situacao_cadastral bigint,
nome_cidade_exterior text,
codigo_natureza_juridica bigint,
da... |
<reponame>samuelburnham/observatory-new<filename>migrations/sqlite/2019-03-25-190605_create_meetings/up.sql
-- Your SQL goes here
CREATE TABLE meetings (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
-- The datetime in UNIX time
happened_at DATETIME NOT NULL DEFAULT (datetime('now','localtime')),
-- T... |
<filename>mysql.sql
-- CREATED_AT = 21-02-2021 01:00:00
-- create table `blogs` with id using uuid
DROP TABLE IF EXISTS `blogs`;
CREATE TABLE `blogs` (
`id` char(36) NOT NULL,
`title` varchar(100) NOT NULL,
`body` varchar(1000) NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` time... |
CREATE PROCEDURE Config.SP_refresh_access_token AS
--get new access token using refresh token
--see https://developers.strava.com/docs/authentication/#refreshingexpiredaccesstokens
--declare variables
DECLARE @client_ID NVARCHAR(64) =(SELECT client_ID FROM Config.API_credentials),
@client_secret NVARCHAR(64) = (SE... |
-- Change user IDs for security.
--
-- Also change manually:
-- * AUTO_INCREMENT value of 'users' table, e.g. > 10000
-- * Fields in 'users' and 'usermeta' that disclose the login name
-- example.com
UPDATE wp_1234_users SET ID = 12345 WHERE ID = 1;
UPDATE wp_1234_usermeta SET user_id = 12345 WHERE user_id = 1;
UPDATE... |
CREATE DATABASE Minions
USE Minions
CREATE TABLE Minions(
Id INT PRIMARY KEY NOT NULL,
[Name] NVARCHAR(50) NOT NULL,
Age TINYINT
)
CREATE TABLE Towns(
Id INT PRIMARY KEY NOT NULL,
[Name] NVARCHAR(50) NOT NULL
)
ALTER TABLE Minions
ADD TownId INT FOREIGN KEY REFERENCES Towns(Id)
INSERT INTO Towns(Id, [Name])
... |
<reponame>Shuttl-Tech/antlr_psql<gh_stars>10-100
-- file:macaddr8.sql ln:32 expect:true
SELECT macaddr8_set7bit('00:08:2b:01:02:03'::macaddr8)
|
/* Workload for Capture Function Executions */
USE AdventureWorks2016;
GO
/* Create function */
CREATE FUNCTION [dbo].[ParseLastName](@LastName VARCHAR(50))
RETURNS VARCHAR(5)
AS
-- Returns the 5 left characters of the last name
BEGIN
DECLARE @ret VARCHAR(5);
SET @ret =
LEFT(@LastName, 5)
RETURN @ret
END;
/* Simpl... |
TRUNCATE TABLE [#__assets];
TRUNCATE TABLE [#__categories];
TRUNCATE TABLE [#__menu];
TRUNCATE TABLE [#__menu_types];
TRUNCATE TABLE [#__modules];
TRUNCATE TABLE [#__modules_menu];
SET IDENTITY_INSERT [#__assets] ON;
INSERT [#__assets] ([id], [parent_id], [lft], [rgt], [level], [name], [title], [rules]) VALUES (1, 0,... |
<gh_stars>100-1000
# Change reqid server used
UPDATE settings SET value = 'http://reqid.newznab-tmux.pw/index.php' WHERE section = '' AND subsection = '' AND name = 'request_url';
|
<filename>test-cases/RMLTC0001b-MySQL/resource.sql
USE rml;
DROP TABLE IF EXISTS rml.student;
CREATE TABLE student (Name VARCHAR(50));
INSERT INTO student values ('Venus'); |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 21, 2021 at 01:49 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.3.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
select c1.concept_id as concept_id,
'Quantity' as category,
hrd1.min_value as min_value,
hrd1.p10_value as p10_value,
hrd1.p25_value as p25_value,
hrd1.median_value as median_value,
hrd1.p75_value as p75_value,
hrd1.p90_value as p90_value,
hrd1.max_value as max_value
from @ohdsi_database_schema.heracles_results... |
--
-- 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
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or ... |
CREATE OR REPLACE FUNCTION public.update_updated_ts()
RETURNS TRIGGER AS $$
BEGIN
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 16, 2021 at 06:15 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
CREATE TRIGGER [homograph].[homograph_Name_TR_Upda... |
<reponame>lukeyMing/socialbot<filename>scripts/socialbot.sql
CREATE DATABASE IF NOT EXISTS `socialbot` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `socialbot`;
-- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: 172.16.17.32 Database: ... |
-- your code goes here
|
<reponame>Gabrielgps25/fiap-application-security
USE lab1;
CREATE TABLE users (
user VARCHAR(355) UNIQUE NOT NULL,
password VARCHAR(256) NOT NULL
);
INSERT INTO users (user, password) VALUES ('admin', '<PASSWORD>'), ('homer', '<PASSWORD>');
|
<reponame>scwiek/reshare-analytics
DROP TABLE IF EXISTS reshare_derived.stat_reqs;
CREATE TABLE reshare_derived.stat_reqs AS SELECT DISTINCT
pr."__origin" AS str_supplier,
pr.pr_hrid AS str_hrid,
pr.pr_title AS str_title,
pr.pr_local_call_number AS str_call_number,
pr.pr_selected_item_barcode AS st... |
-- AUTO-GENERATED BY igluctl DO NOT EDIT
-- Generator: igluctl 0.2.0
-- Generated: 2017-12-06 11:52
CREATE SCHEMA IF NOT EXISTS atomic;
CREATE TABLE IF NOT EXISTS atomic.com_mailgun_message_complained_1 (
"schema_vendor" VARCHAR(128) ENCODE RUNLENGTH NOT NULL,
"schema_name" VARCHAR(128) ENCODE RUNLE... |
<reponame>Rob--W/phabricator
RENAME TABLE {$NAMESPACE}_herald.herald_action
TO {$NAMESPACE}_herald.herald_actionrecord;
|
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
--
-- CT CO Part Table 1
--
CREATE TABLE ct_co_alter_part_add_default_part1 (id int, name text, rank int, year date, gender
char(1)) with ( appendonly='true', orientation='column') DISTRIBUTED BY (id, gender, year)
partition by list (ge... |
<gh_stars>1-10
/*L
Copyright <NAME>.
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/calims/LICENSE.txt for details.
L*/
INSERT INTO type (id, createdby, datecreated, datemodified, modifiedby, description, displayname, name, dataelementcollection, status) VALUES (3, NULL, NUL... |
-- @testpoint: 转换-
select ASCII('-'); |
CREATE PROCEDURE [dbo].[rpt_RegistrationStats] @ProgId INT = NULL,
@BranchID INT = NULL,
@School VARCHAR(50) = NULL,
@LibSys VARCHAR(50) = NULL,
@TenID INT = NULL
AS
SELECT ProgID,
pg.AdminName,
CASE
WHEN DOB IS NOT NULL
THEN FLOOR((CAST(GetDate() AS INT) - CAST(DOB AS INT)) / 365.25)
ELSE CASE
WHE... |
<reponame>richchurcher/postgraphile-auth<gh_stars>0
CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
|
<gh_stars>0
-- Table: players
-- DROP TABLE players;
CREATE TABLE players
(
"PLAYER_ID" bigint NOT NULL,
"PLAYER_NAME" text,
"TEAM_ID" bigint,
"TEAM_ABBREVIATION" text,
"GP" bigint,
"W" bigint,
"L" bigint,
"MIN" double precision,
"STL" bigint,
"BLK" bigint,
"DREB" bigint,
"DEF_RIM_FGM" bigint,... |
CREATE DATABASE touchfyp;
CREATE TABLE admin(
AdminID INT (25) NOT NULL UNIQUE,
AdminFirstName VARCHAR (50) NOT NULL,
AdminLastName VARCHAR (50) NOT NULL,
AdminUsername VARCHAR (50) NOT NULL UNIQUE,
AdminHashPassword VARCHAR (100) NOT NULL,
AdminStatus BOOLEAN NOT NUL... |
CREATE VIEW [dbo].[vwAccumulatedType]
AS
select ID,
Active,
[user],
company,
InstanceID,
TypeOfAccumulated,
Code
from AccumulatedType |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.