sql stringlengths 6 1.05M |
|---|
library TestListPromotionIn
using QUICK
context Patient
define testIn: 4 in 1
|
<filename>qmq-dist/sql/init_client.sql
CREATE DATABASE `qmq_produce`;
CREATE TABLE `qmq_msg_queue` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`content` longtext NOT NULL,
`status` smallint(6) NOT NULL DEFAULT '0' COMMENT '消息状态',
`error` int unsigned NOT NULL DEFAULT '0' COMMENT '错误次数',
`create_ti... |
<gh_stars>100-1000
create sequence t1_sec start with 1;
go
create table t1 (id int default nextval('t1_sec'), a int);
go
-- Only checking the syntax.
-- INSERT
insert into t1 with() (a) values (1); -- syntax error
go
insert into t1 with((nowait)) (a) values (2); -- syntax error
go
insert into t1 with... |
/*
Name: Filters: Form Factor
Data source: 1
Created By: admin
Last Update At: 2021-07-02T17:20:08.440Z
*/
select distinct form_factor as a, count(*) from cell_metadata group by a order by a |
<reponame>evdhiggins/pg-structure
/*
Created: 9/20/2019
Modified: 10/14/2019
Project: pg-structrue-test
Model: Main
Author: <NAME>
Version: 1.0.0
Database: PostgreSQL 10
*/
CREATE SCHEMA extra_modules;
CREATE EXTENSION IF NOT EXISTS hstore SCHEMA extra_modules;
-- Create schemas section -----------------------------... |
<reponame>chriscardillo/ABSQL
---
my_table_placeholder: my_table
my_var_dict:
extra: something different!
---
SELECT * FROM {{my_table_placeholder}} WHERE {{extra}}
|
<reponame>emmaus-5h/5Hin2-webshop-Isabella<gh_stars>0
--
-- create tables
--
CREATE TABLE products (
id INTEGER PRIMARY KEY AUTOINCREMENT,
code VARCHAR(15),
name VARCHAR(255),
description TEXT,
color TEXT,
price NUMERIC(10, 2)
);
--
-- populate with data
--
-- generared using
-- curl "https://api.mocka... |
USE [Curso];
GO
CREATE TABLE [Aluno](
[Id] INT NOT NULL,
[Nome] NVARCHAR(80) NOT NULL,
[Email] NVARCHAR(180) NOT NULL,
[Nascimento] DATETIME NULL,
[Ativo] BIT NOT NULL DEFAULT(0),
CONSTRAINT [PK_Aluno_Id] PRIMARY KEY([Id]),
CONSTRAINT [UQ_Aluno_Email] UNIQUE([Email])
);
GO
-- Pode ser d... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 15, 2021 at 07:51 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<reponame>sdc-cherry/overview-api<filename>postgres/db.example.sql
-- SQL commands to create SDC db
DROP DATABASE IF EXISTS sdc_test;
CREATE DATABASE sdc_test;
-- psql -d test -f db.sql
-- \psql -d sdc_test -c "\copy cart from '~/Documents/HR/sdc/overview-api/raw/cart.csv' delimiter ',' csv header;" |
declare
num number(3):=1;
begin
dbms_output.put_line('##############----while loop---##################');
while(num<=10)
loop
dbms_output.put_line(num);
num:=num+1;
end loop;
dbms_output.put_line('##############----for loop---##################');
for i in 10..20 loop
dbms_output.put_line(i);
... |
--Top 20 Queries Needing Maintenance
DECLARE @db_id SMALLINT;
SET @db_id = DB_ID(N'easycare');
SELECT TOP 20
a.object_id AS objectid,QUOTENAME(object_name(a.object_id)) as objectname,
a.index_id AS indexid,
indexname = QUOTENAME(b.name),
schemaname=QUOTENAME(d.name),
partition_number ... |
SELECT * FROM users WHERE email = '<EMAIL>'
|
<filename>DB/SCRIPTS CREATE TABLE/authorizations.sql<gh_stars>0
CREATE TABLE "authorizations" (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`startDateTime` DATETIME NOT NULL,
`endDateTime` DATETIME NOT NULL
)
|
<gh_stars>1-10
IF OBJECT_ID('zdm.mountpoints') IS NOT NULL
DROP PROCEDURE zdm.mountpoints
GO
CREATE PROCEDURE zdm.mountpoints
@filter nvarchar(300) = ''
AS
SET NOCOUNT ON
EXEC zdm.info 'mountpoints', @filter
GO
|
<gh_stars>1-10
CREATE TABLE [dbo].[Products] (
[ProductID] INT IDENTITY (1, 1) NOT NULL,
[ProductName] NVARCHAR (40) NOT NULL,
[SupplierID] INT NOT NULL,
[CategoryID] INT NOT NULL,
[QuantityPerUnit] NVARCHAR (20) NOT NULL,
[MinimumOrderQuantity]... |
ALTER TABLE `user_auth` CHANGE `type` `type` ENUM('guest','member','appkey') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `user_auth` ADD `parent` int(10) unsigned NULL DEFAULT NULL;
|
# Write your MySQL query statement below
# #Easy #Database #SQL_I_Day_3_String_Processing_Functions
# #2022_04_22_Time_559_ms_(80.29%)_Space_0B_(100.00%)
select user_id, concat(upper(substring(name, 1, 1)), lower(substring(name, 2))) as name from Users order by user_id
|
<gh_stars>100-1000
-- tkt3718.test
--
-- execsql { SELECT a FROM t2 ORDER BY a+0}
SELECT a FROM t2 ORDER BY a+0 |
-- original: mmap1.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
PRAGMA cache_size=2000
;PRAGMA cache_size=2000
;PRAGMA page_size=1024
;PRAGMA page_size=1024;
PRAGMA auto_vacuum = 1;
CREATE TABLE t1(a, b, UNIQUE(a, b));
INSERT INTO t1 VALUES(rblob(500), rblob(500));
INSERT... |
<filename>internal/endtoend/testdata/join_right/postgresql/query.sql
CREATE TABLE foo (id serial not null, bar_id int references bar(id));
CREATE TABLE bar (id serial not null);
-- name: RightJoin :many
SELECT f.id, f.bar_id, b.id
FROM foo f
RIGHT JOIN bar b ON b.id = f.bar_id
WHERE f.id = $1; |
<reponame>dram/metasfresh
-- 2017-05-09T10:03:14.394
-- URL zum Konzept
INSERT INTO AD_Table (AccessLevel,ACTriggerLength,AD_Client_ID,AD_Org_ID,AD_Table_ID,CopyColumnsFromTable,Created,CreatedBy,EntityType,ImportTable,IsActive,IsAutocomplete,IsChangeLog,IsDeleteable,IsDLM,IsHighVolume,IsSecurityEnabled,IsView,LoadSeq,... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 28, 2019 at 07:49 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... |
-- Will of the Necropolis
DELETE FROM spell_linked_spell WHERE spell_effect=-96171;
INSERT INTO spell_linked_spell VALUES (48982, -96171, 0, "Rune Tap - Will of the Necropolis"); |
<reponame>CopenhagenCityArchives/CorrectOCR
CREATE TABLE token (
doc_id VARCHAR(255) NOT NULL,
doc_index INT NOT NULL,
original VARCHAR(255) NOT NULL,
hyphenated BOOLEAN,
discarded BOOLEAN,
gold VARCHAR(255),
bin INT,
heuristic VARCHAR(1),
decision VARCHAR(255),
selection VARCHAR(255),
token_type ... |
<gh_stars>1-10
ALTER TABLE [AATF].[Return] ADD OrganisationId UNIQUEIDENTIFIER NULL
GO
ALTER TABLE [AATF].[Return] ADD CONSTRAINT FK_Return_Organisation FOREIGN KEY (OrganisationId) REFERENCES [Organisation].[Organisation](Id)
GO
UPDATE
r
SET
r.OrganisationId = o.OrganisationId
FROM
[AATF].[Return] r
INNER JOI... |
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80025
Source Host : 127.0.0.1:3306
Source Schema : spring-cloud-seata-eureka
Target Server Type : MySQL
Target Server Version : 80025
File Encoding : 65001
D... |
-- Create new pluggable database. You may not need that if you are running in a non-CDB environment.
CREATE PLUGGABLE DATABASE TEST ADMIN USER ADMIN IDENTIFIED BY ADMIN
FILE_NAME_CONVERT=('/opt/oracle/oradata/DEV/pdbseed', '/opt/oracle/oradata/DEV/TEST');
-- You may not need that if you are running in a non-CDB en... |
<filename>v2/command/tree.sql
/*
Onix Config Manager - Copyright (c) 2018-2019 by www.gatblau.org
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/LICEN... |
<filename>evidenceProcessingClean/inst/sql/sql_server/splicer.sql
--@vocabSchema
IF OBJECT_ID('@tableName','U') IS NOT NULL
DROP TABLE @tableName;
CREATE TABLE @tableName (
ID SERIAL,
SOURCE_ID VARCHAR(20),
SOURCE_CODE_1 VARCHAR(50),
SOURCE_CODE_TYPE_1 VARCHAR(55),
SOURCE_CODE_NAME_1 VARCHAR(500),
RELATIONSHIP... |
CREATE VIEW view88 AS
SELECT 1 AS c1
FROM table426
UNION
SELECT 1 AS c1
FROM table218
UNION
SELECT 1 AS c1
FROM table70
UNION
SELECT 1 AS c1
FROM view58
UNION
SELECT 1 AS c1
FROM view23
UNION
SELECT 1 AS c1
FROM view83;
GO |
<filename>kata-files/lesson2/hsql/expected/MYLARGESCHEMA/table/TABLE388.sql<gh_stars>10-100
//// CHANGE name=change0
CREATE MEMORY TABLE TABLE388(ID INTEGER NOT NULL PRIMARY KEY,FIELD1 VARCHAR(30),USERTYPE4FIELD USERTYPE4,USERTYPE3FIELD USERTYPE3,USERTYPE5FIELD USERTYPE5)
GO
|
DROP FUNCTION GH_DUMMY(CHAR);
CREATE FUNCTION GH_DUMMY(CHAR) RETURNS refcursor AS $$
DECLARE
rct1 refcursor;
BEGIN
OPEN rct1 FOR
SELECT * FROM Customers where CustomerID = $1;
RETURN rct1;
END;
$$ LANGUAGE 'plpgsql'; |
CREATE FUNCTION public.multiply_numbers(number2 integer, number1 integer) RETURNS integer
AS $$
begin
return number2 * number1;
end;
$$
LANGUAGE plpgsql;
ALTER FUNCTION public.multiply_numbers(number2 integer, number1 integer) OWNER TO fordfrog;
CREATE FUNCTION public.multiply_numbers(number2 smallint... |
<filename>im.sql<gh_stars>10-100
/*
Navicat Premium Data Transfer
Source Server : laradock_mysql
Source Server Type : MySQL
Source Server Version : 50732
Source Host : localhost:3306
Source Schema : im
Target Server Type : MySQL
Target Server Version : 50732
File Encoding ... |
-- phpMyAdmin SQL Dump
-- version 4.4.15.5
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1:3306
-- Generation Time: Feb 08, 2017 at 06:01
-- Server version: 5.5.48-log
-- PHP Version: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_C... |
<filename>sql/_17_sql_extension2/_02_full_test/_05_date_time_function/_10_week/cases/week_012.sql
--pass out-of-range data of string type to the parameter
--1. [error] out-of-range argument: date type
select week(date'13/11/1989');
select week(date'05/33/1901');
select week(date'2/20/10000');
select week(date'0-1... |
<gh_stars>1-10
ALTER TABLE
person
ADD
COLUMN "role" user_role;
UPDATE
person
SET
"role" = 'user';
ALTER TABLE
person
ALTER COLUMN
"role"
SET
NOT NULL;
CREATE TABLE token
(
person text references person(id) primary key,
token text not null,
expire_at bigint not null
);
CREATE TABL... |
<reponame>CAG9/SQL-Interview-Questions
SELECT *
FROM tutorial.billboard_top_100_year_end
WHERE (year_rank BETWEEN 10 AND 20)
AND year IN (1993, 2003, 2013) --
ORDER BY year, year_rank;
|
DECLARE @s NVARCHAR(128) = N'.\SQLLS1',
@t NVARCHAR(128) = N'true',
@p NVARCHAR(128) = N'MSOLEDBSQL',
@i NVARCHAR(128) = N'10.10.10.12,1433';
EXEC [master].dbo.sp_addlinkedserver @server = @s, @srvproduct = N'', @provider = @p, @datasrc = @i;
EXEC [master].dbo.sp_addlinkedsrvlogin @rmtsr... |
SELECT
INVOICE.*
FROM
LG_$FIRM$_$PERIOD$_INVOICE INVOICE
$WHERE$
$ORDER$ |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 21, 2020 at 01:21 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 17, 2020 at 02:11 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE OR REPLACE FUNCTION Select_Local(arg_local_cod BIGINT)
RETURNS JSON
LANGUAGE plpgsql
AS $$
BEGIN
IF(select exists(select 1 From Locals where Locals.local_cod = arg_local_cod)) THEN
RETURN (Select json_build_object(
'Local_Cod',locals.local_cod,
'Local_Designation',locals.designation,
'Local... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versi server: 10.1.26-MariaDB - mariadb.org binary distribution
-- OS Server: Win32
-- HeidiSQL Versi: 9.4.0.5125
-- ------------------------------------------------... |
<reponame>mirusser/Learning-dontNet<filename>src/SagaChoreographyPattern/initDatabse.sql
USE [SagaDB]
GO
CREATE TABLE [dbo].[User](
[Id] [int] PRIMARY KEY IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) NOT NULL,
[Address] [varchar](100) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Product](
[Id] [int] PRIMARY K... |
SELECT * FROM V_CSM |
Insert ignore into m_role values(0,'selfcare','selfcare only');
Create table if not exists del_temp (permission_name varchar(50));
Insert ignore into del_temp values ('CHANGEPLAN_ORDER');
Insert ignore into del_temp values ('CREATE_ALLOCATION');
Insert ignore into del_temp values ('CREATE_CLIENT');
Insert ignore into d... |
<reponame>A-Kastner/101repo
-- SQL statements which are executed at application startup if hibernate.hbm2ddl.auto is 'create' or 'create-drop'
INSERT INTO TB_101_COMPANY(ID, NAME) VALUES (1, 'Meganalysis');
-- we do not set a manager as being an employee of
-- a department.
-- I think that we could have modeled th... |
/*
Add number of crime victimisations to the fact table and relevant dimensions to the dimension tables
Takes about 3 minutes in total
<NAME> 26 September 2017
<NAME> 16 October 2017,
Updates to align with new dim_date table:
NOTE: uses date offence is REPORTED, not date it OCCURRED.
*/
IF OBJECT_ID('TempDB..#... |
<gh_stars>1-10
UPDATE asset_types SET name='IP' WHERE name='ip';
UPDATE asset_types SET name='DomainName' WHERE name='dns';
UPDATE asset_types SET name='Hostname' WHERE name='hostname';
DELETE FROM asset_types WHERE name='cidr';
DELETE FROM asset_types WHERE name='s3';
DELETE FROM asset_types WHERE name='git';
|
# DROP DATABASE IF EXISTS __DATABASE_NAME;
# USE sed -i.bak 's/pattern/result/g' initdb.sql to change database name.
CREATE DATABASE IF NOT EXISTS __DATABASE_NAME DEFAULT CHARACTER SET utf8;
USE __DATABASE_NAME;
CREATE TABLE IF NOT EXISTS t_currency (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(32) NOT NULL UNIQUE... |
<filename>app/postgres.sql
--
-- Copyright (C) 2016-2017 DBot. All other content, that was used, but not created in this project, is licensed under their own licenses, and belong to their authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance ... |
<gh_stars>0
set names utf8;
drop database if exists n9e_mon;
create database n9e_mon;
use n9e_mon;
CREATE TABLE `node` (
`id` int unsigned not null AUTO_INCREMENT,
`pid` int unsigned not null,
`name` varchar(64) not null,
`path` varchar(255) not null,
`leaf` int(1) not null,
`note` varchar(128) not null d... |
-- Migrate atlas object aliases from separated many-to-one table to single column of comma separated strings.
-- Create aliases column on atlas object table.
ALTER TABLE `atlas`.`atlasobject`
ADD COLUMN `aliases` TINYTEXT NOT NULL AFTER `display`; |
<filename>Addons/SingIn/install.sql<gh_stars>0
CREATE TABLE IF NOT EXISTS `wp_signin_log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`score` int(10) NOT NULL COMMENT '积分',
`token` varchar(255) NOT NULL COMMENT 'Token',
`sTime` int(10) UNSIGNED NOT NULL COMMENT '签到时间',
`uid` varchar(255) N... |
CONN xmlusr/xmlusr;
CREATE OR REPLACE FUNCTION placeNewOrderSecure (xmldoc IN XMLType, pswd IN VARCHAR2, msg OUT VARCHAR2)
RETURN NUMBER
IS
tmpxml XMLType;
errcode NUMBER;
errmesg VARCHAR2(256);
BEGIN
tmpxml := xmldoc;
checkCred(tmpxml, pswd);
XMLTYPE.schemaValidate(tmpxml);
tmpxml... |
CREATE TABLE IF NOT EXISTS user_launcher_preferences (
id SERIAL,
user_id INT NOT NULL,
launcher_id INT NOT NULL,
favorite BOOLEAN NULL DEFAULT FALSE,
PRIMARY KEY (id),
FOREIGN KEY (user_id) REFERENCES users (id)
ON DELETE CASCADE
ON UPDATE NO ACTION,
FOREIGN KEY (launcher_id) REFERENCES launc... |
CREATE TABLE discounts (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
source text NOT NULL,
discount int NOT NULL DEFAULT 0,
after timestamp with time zone,
before timestamp with time zone,
UNIQUE (source,after,before)
)
|
<reponame>NCIP/caintegrator
ALTER TABLE GENOMIC_DATA_SOURCE_CONFIGURATION ADD COLUMN DNA_ANALYSIS_USE_CGH_CALL TINYINT AFTER DNA_ANALYSIS_RANDOM_NUMBER_SEED;
UPDATE GENOMIC_DATA_SOURCE_CONFIGURATION SET DNA_ANALYSIS_USE_CGH_CALL = '0'; |
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字password(非保留),作为角色名
--关键字不带引号-成功
drop role if exists password;
create role password with password '<PASSWORD>' valid until '2020-12-31';
drop role password;
--关键字带双引号-成功
drop role if exists "password";
create role "password" with password '<PASSWORD>' valid u... |
<reponame>PaulAnthonyReitz/topaz
/*
Navicat MySQL Data Transfer
Source Server : oo
Source Server Version : 50136
Source Host : localhost:3306
Source Database : tpzdb
Target Server Type : MYSQL
Target Server Version : 50136
File Encoding : 65001
Date: 2012-07-17 14:50:32
*/
SET FOR... |
<filename>src/main/resources/db/migration/V0.2__insert_users.sql
insert into users(id, name) values (1, "Mario");
insert into users(id, name) values (2, "Bowser");
insert into services(user_id, name, url) values (1, "NeverSSL", "http://neverssl.com/");
insert into services(user_id, name, url) values (1, "Cool Chrome",... |
<gh_stars>0
INSERT INTO `info_user`(`PIN`, `nom`, `prenom`, `id_user`, `status`) SELECT distinct (`ext`), `last_name`, `first_name`,`id`, `company` FROM `userscm` WHERE `ext` <> '' AND `company` = 'Perenco Rio del Rey' AND ext LIKE '10%' OR ext LIKE '11%' GROUP BY ext
INSERT INTO `account_info`(`id_user`, `dessert`, `... |
PRAGMA foreign_keys = ON;
CREATE TABLE IF NOT EXISTS Something (
id INTEGER PRIMARY KEY ASC,
otherID INTEGER,
data INTEGER,
FOREIGN KEY (otherID) REFERENCES Other(id)
);
CREATE TABLE IF NOT EXISTS Other (
id INTEGER PRIMARY KEY ASC,
data VARCHAR(40) UNIQUE
);
|
CREATE TABLE url_sync (
version INTEGER AUTO_INCREMENT PRIMARY KEY,
operation TEXT NOT NULL,
rule_id INTEGER NOT NULL,
latest_url_pattern TEXT,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
|
/*
Navicat MySQL Data Transfer
Source Server : 本地服务器
Source Server Version : 50726
Source Host : localhost:3306
Source Database : laravel_admin
Target Server Type : MYSQL
Target Server Version : 50726
File Encoding : 65001
Date: 2021-06-17 22:52:39
*/
SET FOREIGN_KEY_CHECKS=0;
--... |
<gh_stars>0
/*
Vjezbe 01 Zadatak 06 NORTHWIND
Prikazati listu proizvoda ciji naziv pocinje slovima 'L' ili 'T', ili je
ID proizvoda = 46. Lista treba da sadrzi samo one proizvode cija se cijena
po komadu krece izmedju 10 i 50.
Upit napisati na dva nacina.
*/
USE NORTHWND
SELECT *
FROM Products AS P
WHERE (P.Pr... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
<<<<<<< HEAD
-- Generation Time: Sep 08, 2019 at 08:03 PM
=======
-- Generation Time: Sep 02, 2019 at 11:15 PM
>>>>>>> 62d32b97c740eda1d51811800251cb80418504d5
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.10
SET SQL_... |
<filename>cline.hamilton/data/products.sql
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 11, 2020 at 01:43 PM
-- Server version: 5.6.47
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET ti... |
<filename>Uputstva/CreateDatabaseScript.sql
CREATE TABLE clan (
jmbg_clana CHAR(13) NOT NULL,
ime VARCHAR(50) NOT NULL,
prezime VARCHAR(50) NOT NULL,
email VARCHAR(50),
datum_rodjenja DATE,
aktivan bit NOT NULL
)
ALTER TABLE Clan ADD const... |
<filename>Modulo1_Fundamentos/Desafio/Resposta_SQL.sql
-- Qual a média salarial nessa empresa?
SELECT avg(salario) AS media_salario FROM empregado
-- R. 35125.000000000000
-- Quantos empregados do departamento 5 trabalham mais de 10h por semana no projeto chamado "ProductX"?
SELECT
count(empregado.pnome) AS qtd_em... |
<filename>Source Code/Database/db.sql
/*
SQLyog Community v8.4 RC2
MySQL - 5.0.67-community-nt : Database - fuzzy
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE... |
<filename>packages/server/db/sql/user.sql<gh_stars>0
-- 创建用户表,如果已经存在,则不创建
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`nick` varchar(255) DEFAULT NULL,
`detail_info` json ... |
<filename>queries/stackoverflow/q14/694569c07b5039c18d198a1fc963df38b57c4c9e.sql<gh_stars>0
SELECT COUNT(*)
FROM
site as s,
so_user as u1,
question as q1,
answer as a1,
tag as t1,
tag_question as tq1,
badge as b,
account as acc
WHERE
s.site_id = q1.site_id
AND s.site_id = u1.site_id
AND s.site_id = a1.site_id
AND s.sit... |
<reponame>mlpassos/demandou-remo
-- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Máquina: localhost
-- Data de Criação: 06-Jan-2016 às 05:19
-- Versão do servidor: 5.5.31
-- versão do PHP: 5.4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTE... |
DROP DATABASE IF EXISTS sql7263770;
ALTER DATABASE sql7263770 CHARACTER SET utf8 COLLATE utf8_general_ci;
USE sql7263770;
CREATE TABLE Eventt (
Id INTEGER NOT NULL UNIQUE AUTO_INCREMENT PRIMARY KEY,
Title VARCHAR(64) NOT NULL,
TypeOf ENUM('TASK', 'REMINDER', 'GOAL') NOT NULL DEFAULT 'TASK',
Location TEXT DEFAU... |
/****** Object: StoredProcedure [AddE12_CityRoad] ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[AddE12_CityRoad]') AND type in (N'P', N'PC'))
DROP PROCEDURE [AddE12_CityRoad]
GO
CREATE PROCEDURE [AddE12_CityRoad]
@CityRoad_ID int OUTPUT,
@Parent_City_ID int,
@City... |
<reponame>sanctum32/AscemuDB
/*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50714
Source Host : localhost:3306
Source Database : 1_one_db
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2018-04-20 13:42:12
*/
SET F... |
<filename>migrations/postgres/20170607017_alter_table_lines_column_id_set_default.down.sql
ALTER TABLE ONLY lines ALTER COLUMN id DROP DEFAULT; |
<gh_stars>0
-----------------------------------------------------
-----------------------------------------------------
--- TIPO_LINEA DUMP_FISCALIA.TMP_TIPO_LINEA ---
-----------------------------------------------------
-----------------------------------------------------
INSERT INTO T... |
CREATE OR REPLACE FUNCTION public.gettaxonauthor(tcid character varying, tatype character varying DEFAULT 'author'::character varying)
RETURNS character varying
LANGUAGE plpgsql
IMMUTABLE STRICT
AS $function$
DECLARE
authorname VARCHAR(300);
BEGIN
SELECT getdispl(tag.taxonauthor) into authorname
... |
<reponame>pfarestveit/Tools
-- Upgrade a cspace database from 4.1 to 5.0.
-- This script should be run in the cspace_{tenantname} database, as the cspace_{tenantname} user.
alter table tenants add column config_md5hash varchar(255);
alter table tenants add column authorities_initialized boolean;
update tenants set aut... |
<reponame>bsanchezdev/p_solvencia<filename>application/models/uvm/normalizar/update_pagos.sql
update carga AS C
INNER JOIN normalizar_pagos AS N ON C.OPERACION LIKE N.NRO_OPERACION
AND C.CUOTA LIKE N.num_cuota
AND C.RUT LIKE N.RUT_NRO
SET C.PAGADO = "SI";
|
use quantum;
select a.p_date date,concat('"<tab>',a.code,'"') as code,c.name,gudong from gudong a join (select code,max(p_date) mpdate from gudong group by code) b on (a.code=b.code and a.p_date=b.mpdate) join prices c on (a.code=c.code) where gudong like '%汇金%' or gudong like '%证券金融%' or gudong like '%社会保障基金%' or gud... |
--
-- Store information about newly uploaded files before they're
-- moved into the actual filestore
--
CREATE TABLE /*_*/uploadstash (
us_id int unsigned NOT NULL PRIMARY KEY auto_increment,
-- the user who uploaded the file.
us_user int unsigned NOT NULL,
-- file key. this is how applications actually search fo... |
-- from .../analysis/inspector/summary_views/{{query}}
SELECT
CONCAT("{{Datasource}}_unified_", dir) AS Source,
EXTRACT({{dates}} from date) AS dates,
node._instruments AS SubSource,
"{{query}}" AS inspector,
MIN(date) as first, MAX(date) as last,
COUNT(*) AS tests,
COUNT(*) - COUNT(DISTINCT a.UUID) AS ... |
<reponame>Q-xyz/meminero
create type smart_alpha.reward_pool_type as enum ('SINGLE', 'MULTI');
create table smart_alpha.reward_pools
(
pool_type smart_alpha.reward_pool_type default 'SINGLE'::smart_alpha.reward_pool_type,
pool_address text not null,
... |
<gh_stars>1000+
CREATE TABLE FooTable (
FooId INTEGER PRIMARY KEY AUTOINCREMENT, -- In SQLITE3, this is the alias for ROWID
[First] NVARCHAR(50),
[Last] NVARCHAR(50),
BirthDate DATETIME
/*PRIMARY KEY(Key1, Key2)*/ -- SQLite3 does not support an autoincrement in a composite key
) |
<filename>src/test/tinc/tincrepo/mpp/gpdb/tests/storage/aoco_compression/sanity/co_crtb_stg_dir_rle_type_32768_1.sql
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
--
-- Drop table if exists
--
DROP TABLE if exists co_crtb_stg_dir_rle_type_32768_1 cascade;
DROP TABLE if exists co_cr... |
DROP TABLE IF EXISTS address_types;
CREATE TABLE address_types (
address_type_id INTEGER PRIMARY KEY AUTO_INCREMENT,
address_type VARCHAR(20) NOT NULL
);
DROP TABLE IF EXISTS cities;
CREATE TABLE cities (
city_id INTEGER PRIMARY KEY AUTO_INCREMENT,
city_name VARCHAR(255) NOT NULL,
city_state VARCHA... |
-- @testpoint: 子查询中使用between and、not like、not null、in、EXISTS的组合
-- @modify at: 2020-11-17
--建表
drop table if exists all_datatype_tbl;
create table all_datatype_tbl(c_integer integer, c_varchar varchar(50));
--插入数据
insert into all_datatype_tbl values(1,'aaaaa');
insert into all_datatype_tbl values(2,'bbbbb');
insert int... |
<gh_stars>0
-- 创建用户
CREATE USER 'ts'@'%' IDENTIFIED BY '<PASSWORD>';
-- 授权
GRANT ALL PRIVILEGES ON *.* TO 'ts'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
-- 建表
CREATE DATABASE employee_system;
USE employee_system;
CREATE TABLE `level` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`level` varchar(20) DEFAULT NU... |
<gh_stars>0
-- # Unit 12 MySQL Homework: Employee Tracker
-- Developers are often tasked with creating interfaces that make it easy for non-developers to view and interact with information stored in databases. Often these interfaces are known as **C**ontent **M**anagement **S**ystems. In this homework assignment, your... |
-- Adminer 4.2.5 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `book`;
CREATE TABLE `book` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`na` varchar(255) COLLATE utf8_bin NOT NULL COMMENT 'ชื่อหนังสือ (ภาษาหลักของหนังสือ)',... |
<reponame>kristinejensen/prime-solo-project
CREATE TABLE volunteers (
id SERIAL PRIMARY KEY,
name VARCHAR(120) NOT NULL,
email VARCHAR(120) NOT NULL,
linkedin VARCHAR(120),
bio VARCHAR(800)
);
CREATE TABLE skills (
id SERIAL PRIMARY KEY,
skill VARCHAR(120) NOT NULL,
volunteer_id integer REFERENCES volunteers
... |
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."user" add column "lastname" text
null;
|
<filename>database/recreate.sql<gh_stars>0
drop table if exists dream;
create table dream (
id bigserial primary key,
title varchar(255)
);
insert into dream (title) values ('Feed on love');
insert into dream (title) values ('Eat a varied diet');
insert into dream (title) values ('Visit places');
create or repla... |
<reponame>alimoonpk/AssignmentPlus-
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jul 13, 2021 at 08:18 AM
-- Server version: 10.3.28-MariaDB-log-cll-lve
-- PHP Version: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRAN... |
SET search_path = tasker, pg_catalog ;
CREATE TABLE dt_task_journal (
created_dt timestamp with time zone DEFAULT ( now () AT TIME ZONE 'UTC' ),
updated_dt timestamp with time zone,
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
task_id integer NOT NULL,
edition integer DEFAULT 0 NOT NULL,
o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.