sql stringlengths 6 1.05M |
|---|
{{ config(
materialized = 'view',
secure = true,
post_hook = "{{ grant_data_share_statement('SV_EZ_NFT_SALES', 'VIEW') }}"
) }}
SELECT
*
FROM
{{ ref('core__ez_nft_sales') }}
|
USE MIMIC3;
BULK INSERT ADMISSIONS
FROM '/path/to/data/ADMISSIONS.csv'
WITH
(
FIRSTROW = 2, -- as row is header
FIELDTERMINATOR = ',',
ROWTERMINATOR = '0x0a', -- '\n' does not work here, use '0x0a' instead
TABLOCK,
FORMAT = 'csv'
);
BULK INSERT CALLOUT
FROM '/path/to/data/CALLOUT.csv'
WITH
(
FIR... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Ноя 17 2020 г., 19:29
-- Версия сервера: 5.6.47-log
-- Версия PHP: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
<filename>CursoEmVideo/aula1.sql
Create database cadastro;
use cadastro;
create table pessoas(
nome varchar(10),
idade tinyint,
sexo char(1),
peso float,
altura float,
nacionalidade varchar(20)
);
show tables ;
describe pessoas;
drop database cadastro; |
drop schema ims;
CREATE SCHEMA IF NOT EXISTS `imsproject`;
USE `imsproject` ;
CREATE TABLE IF NOT EXISTS `imsproject.customers` (
`cust_id` INT(11) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(40) DEFAULT NULL,
`surname` VARCHAR(40) DEFAULT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `im... |
SELECT departments.dept_no, departments.dept_name, dept_manager.emp_no, employees.last_name, employees.first_name
FROM departments
JOIN dept_manager
ON departments.dept_no = dept_manager.dept_no
JOIN employees
ON dept_manager.emp_no = employees.emp_no; |
<filename>data/open-source/extracted_sql/ZF-Commons_ZfcUser.sql
CREATE TABLE user( user_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(255) DEFAULT NULL UNIQUE, email VARCHAR(255) DEFAULT NULL UNIQUE, display_name VARCHAR(50) DEFAULT NULL, password VARCHAR(128) NOT NULL, state SMALLINT)
CREATE TABLE pu... |
<filename>migrations/2-task.sql
CREATE SEQUENCE "Task_id_seq";
DROP TABLE IF EXISTS "Task";
CREATE TABLE "Task" (
"id" int8 NOT NULL DEFAULT nextval('"User_id_seq"'::regclass),
"userId" int8 NOT NULL,
"title" varchar(255) NOT NULL,
... |
CREATE PROCEDURE [dbo].[ImportProviders]
@providers [dbo].[Providers] READONLY,
@now DATETIME
AS
UPDATE [dbo].[Providers]
SET [Name] = f.[Name], [Updated] = @now
FROM @providers f
INNER JOIN [dbo].[Providers] t ON t.[Ukprn] = f.[Ukprn]
WHERE t.[Name] <> f.[Name]
INSERT INTO [dbo].[... |
-- enc2.test
--
-- execsql {
-- CREATE TABLE t5(a);
-- INSERT INTO t5 VALUES('one');
-- }
CREATE TABLE t5(a);
INSERT INTO t5 VALUES('one'); |
-- file:rolenames.sql ln:446 expect:true
DROP ROLE regress_testrol0, regress_testrol1, regress_testrol2, regress_testrolx
|
<filename>Interview/16_Instagram_Common_Follower/solution.sql<gh_stars>100-1000
SELECT
a.user_id
,b.user_id
,COUNT(*) AS common
FROM
(SELECT DISTINCT user_id FROM Follow) AS a
CROSS JOIN
(SELECT DISTINCT user_id FROM Follow) AS b
ON a.user_id != b.user_id
JOIN Follow AS af
ON a.user_id = af.user_id
JOIN Follow AS bf
O... |
<filename>src/main/resources/sql/schema.sql
CREATE TABLE IF NOT EXISTS car (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
manufacturer VARCHAR(250) NOT NULL,
model VARCHAR(250) NOT NULL
);
|
SET search_path = faers;
/* -------------------------------------------------------------- demographic */
DROP VIEW IF EXISTS demo;
DROP TABLE IF EXISTS demo_staging_version_a;
DROP TABLE IF EXISTS demo_staging_version_b;
DROP VIEW IF EXISTS demo_legacy;
DROP TABLE IF EXISTS demo_legacy_staging_version_a;
DROP TABLE ... |
<gh_stars>1-10
UPDATE IDN_OAUTH2_AUTHORIZATION_CODE
SET AUTHZ_USER = `pseudonym`, SUBJECT_IDENTIFIER = `pseudonym`
WHERE AUTHZ_USER = `username`
AND USER_DOMAIN = `user_store_domain`
AND TENANT_ID = `tenant_id` |
<reponame>Tiamat-Tech/sourcegraph
BEGIN;
ALTER TABLE IF EXISTS batch_spec_workspace_execution_jobs
DROP COLUMN IF EXISTS access_token_id;
ALTER TABLE IF EXISTS access_tokens
DROP COLUMN IF EXISTS internal;
COMMIT;
|
CREATE PROCEDURE assignCai2AdminGroups()
BEGIN
DECLARE group_count int;
select count(*) into group_count from csm_user_group where user_id = (select user_id from csm_user where login_name = 'cai2admin');
IF (group_count = 0) THEN
insert into csm_user_group (user_id, group_id) values
((se... |
<filename>json-serde/src/test/scripts/complex_test.sql
add jar ../../../target/json-serde-1.0-SNAPSHOT-jar-with-dependencies.jar;
DROP TABLE json_complex_test;
CREATE TABLE json_complex_test (
country string,
languages array<string>,
religions map<string,string>)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe... |
create table cliente
(
id int not null
primary key,
nome char null,
sobrenome char null,
email char null,
cpf char null
);
create table employee
(
id int not null
primary key,
nome char not null,
email char null,
pass char not null,
... |
<reponame>Turing-Chu/ListeningPort
CREATE TABLE `port_info` (
`port` int(11) unsigned NOT NULL,
`pid` int(11) NOT NULL,
`process_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '',
`root_dir` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '/',
`user`... |
<reponame>DataGenSoftware/Sql.Net
CREATE AGGREGATE [SqlNet].[AggregateMedian](@value DECIMAL (18, 4))
RETURNS DECIMAL (18, 4)
EXTERNAL NAME [SqlNet].[Sql.Net.Aggregates.Median];
|
-- dapatkan total harga purchases berdasarkan purchased_at dan character_name
SELECT SUM(price), purchased_at, character_name
FROM purchases
GROUP BY purchased_at, character_name;
|
<reponame>inest-us/db<filename>MySql/Tables/CreateTableBookCategory.sql
create table bookcategory
(
cat_id int primary key not null,
cat_desc nvarchar(150)
)
|
INSERT INTO `course_start`(`start_id`, `start_yearSemester`, `start_upperLimit`, `start_lowerLimit`, `start_courseState`, `course_id`, `teacher_id`) VALUES (5003, 2, 21, 35, '开课', 2001, 18004);
INSERT INTO `course_start`(`start_id`, `start_yearSemester`, `start_upperLimit`, `start_lowerLimit`, `start_courseState`, `cou... |
<filename>fdb-sql-layer-core/src/test/resources/com/foundationdb/sql/optimizer/rule/parse/in-l101n.sql
SELECT * FROM customers
WHERE name NOT IN ('Name1', 'Name2', 'Name3', 'Name4', 'Name5', 'Name6', 'Name7', 'Name8', 'Name9', 'Name10', 'Name11', 'Name12', 'Name13', 'Name14', 'Name15', 'Name16', 'Name17', 'Name18', 'N... |
/*
Query used to elicit information regarding cars that have had specialised parts returned due to faults during their repair.
*/
SELECT car.id AS car_id,
car.registration,
work_plan.id AS work_plan_id,
work_plan.work_plan_car_id AS work_plan_car_id,
job.id AS job_id, job.job_work_plan_id AS job_work_plan_... |
<gh_stars>0
select *
from (
select
games.name,
group_concat(genres.name separator ', ') as genre_names,
group_concat(genres.id separator ', ') as genre_ids,
games.description,
games.id
from games
inner join games_to_genres
on game_id = games.id
inner join genres
on genre_id =... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 06, 2019 at 06:10 PM
-- Server version: 5.7.25-0ubuntu0.16.04.2
-- PHP Version: 7.0.33-0ubuntu0.16.04.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- SQL SQLITE
CREATE TABLE spatial_ref_sys(srid INTEGER PRIMARY KEY,auth_name,auth_srid,ref_sys_name,proj4text,srtext);
INSERT INTO spatial_ref_sys VALUES(26711,'epsg',26711,'','','PROJCS["",GEOGCS["",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.9786982138982]],UNIT["degree",0.0174532925199433... |
--SQL script for PostgreSQL
--Connect to 'reminderdb'
\c reminderdb
INSERT INTO "user" ("username", "password_hash", "email", "access_granted", "role_id", "last_seen", "creation_date", "failed_login_attempts", "pass_change_req")
VALUES ('john_doe', 'pbkdf2:sha256:150000$5b2CvGLQ$0cec90763090f8029aa7b02f15d0667a151919... |
<reponame>iqb-berlin/testcenter<filename>database/mysql.patches.d/11.0.0.sql
alter table test_logs
add timestamp_server timestamp default CURRENT_TIMESTAMP null;
alter table tests
add timestamp_server timestamp default CURRENT_TIMESTAMP null;
|
<reponame>alshoja/Income-Expence-Manager
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 27, 2018 at 02:13 PM
-- Server version: 5.6.41-84.1-log
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION... |
<gh_stars>10-100
-- file:dependency.sql ln:91 expect:true
CREATE SEQUENCE ss1
|
CREATE TABLE report{{ ds_nodash }}
AS
SELECT invoices.stockcode,
invoices.country,
AVG(invoices.unitprice) as avg_unit_price,
AVG(invoices.quantity) as avg_quantity,
AVG(invoices.unitprice) * AVG(invoices.quantity) as gain
FROM invoices
WHERE invoices.invoicedate = '{{ ds }}'
GROUP BY 1,2
OR... |
--Change the two parts of the window
-- 2021-05-28T07:59:40.990Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Column SET SeqNo=20,Updated=TO_TIMESTAMP('2021-05-28 10:59:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Column_ID=540109
;
-- 2021-05-28T07:59:49.389Z
-- I forgot to... |
ALTER TABLE job_keys DROP COLUMN encrypted_key; |
create table application (
id int4 generated by default as identity,
appng_version varchar(64),
application_version varchar(64),
description varchar(8192),
displayName varchar(64),
fileBased boolean not null,
hidden boolean not null,
longDescription text,
name varchar(255),
privileged boolean,
snapshot boole... |
<reponame>AlShaffey/UncommonT-SQLusingSQLServer<gh_stars>0
DECLARE @left TABLE
(
[Id] INT,
[Name] NCHAR(30)
)
DECLARE @right TABLE
(
[Id] INT,
[Name] NCHAR(30)
)
Insert @left
SELECT 1 [Id], 'Left 1' [Name]
UNION
SELECT 2 [Id], 'Left 2' [Name]
UNION
SELECT 3 [Id], 'Left 3' [Name]
Insert @right
SELECT 1... |
<reponame>priyankam-rf/qscfsws<filename>recodb.sql
-- phpMyAdmin SQL Dump
-- version 4.6.2
-- https://www.phpmyadmin.net/
--
-- Host: mysql.thinkterns.com
-- Generation Time: Sep 06, 2016 at 05:06 AM
-- Server version: 5.6.25-log
-- PHP Version: 7.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
... |
<gh_stars>0
CREATE TABLE [dbo].[Memberships] (
[UserId] UNIQUEIDENTIFIER NOT NULL,
[ApplicationId] UNIQUEIDENTIFIER NOT NULL,
[Password] NVARCHAR (128) NOT NULL,
[PasswordFormat] INT ... |
<reponame>mbohun/nsl-domain-plugin<gh_stars>0
--drop old tree stuff
drop index if exists by_root_id;
drop index if exists idx_node_current_a;
drop index if exists idx_node_current_b;
drop index if exists idx_node_current_instance_a;
drop index if exists idx_node_current_instance_b;
drop index if exists idx_node_curren... |
<gh_stars>1000+
-- Tags: no-fasttest
DROP TABLE IF EXISTS t_tuple_numeric;
CREATE TABLE t_tuple_numeric (t Tuple(`1` Tuple(`2` Int, `3` Int), `4` Int)) ENGINE = Memory;
SHOW CREATE TABLE t_tuple_numeric;
INSERT INTO t_tuple_numeric VALUES (((2, 3), 4));
SET output_format_json_named_tuples_as_objects = 1;
SELECT * ... |
<reponame>ryanmhood/AWS-MIMIC-IIItoOMOP-1
select CGID as provider_id
, CGID as provider_source_value
, 0 as specialty_concept_id
, LABEL as specialty_source_value
, 0 as specialty_source_concept_id
from mimic3_caregivers |
<gh_stars>1-10
/********************************************************************************
release-type-snapshot-delta-validation-mrcm-module-scope-refset
Assertion:
The current data in the MRCM MODULE SCOPE REFSET snapshot file are the same as the data in
the current delta file.
**************************... |
ALTER TABLE "public"."mesures" DROP COLUMN "department_id" CASCADE;
|
<reponame>GeorgeKirev/OpenOLAT
-- Assessment
alter table o_as_entry add a_last_attempt timestamp;
|
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may... |
<filename>morpheus-examples/src/main/resources/northwind/sql/northwind_views.sql<gh_stars>100-1000
CREATE VIEW view_Employees AS
SELECT convert(EmployeeID, bigint) AS EmployeeID,
LastName,
FirstName,
Title,
TitleOfCourtesy,
convert(BirthDate, VARCHAR(10)) AS BirthDate,
convert(HireDate, VARCHAR(... |
<filename>modules/deutsch/data/deutsch_mark.sql
-- MySQL dump 10.13 Distrib 5.5.59, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: plis
-- ------------------------------------------------------
-- Server version 5.5.59-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 1192.168.127.12
-- Tiempo de generación: 07-11-2021 a las 23:44:34
-- Versión del servidor: 10.4.21-MariaDB
-- Versión de PHP: 8.0.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
<gh_stars>1-10
ALTER TABLE `files` DROP FOREIGN KEY `version_id_refs_id_e75e6066`;
ALTER TABLE `files` ADD CONSTRAINT `version_id_refs_id_e75e6066` FOREIGN KEY (`version_id`) REFERENCES `versions` (`id`) ON DELETE CASCADE;
|
<gh_stars>0
-- MySQL Script generated by MySQL Workbench
-- Sat Mar 16 17:38:18 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, ... |
<reponame>airicyu/airic-api-gateway-key-server
DROP SCHEMA IF EXISTS `gateway_key`;
CREATE SCHEMA `gateway_key`;
USE `gateway_key`;
DROP TABLE IF EXISTS `id_key`;
CREATE TABLE `id_key` (
`id` int NOT NULL AUTO_INCREMENT,
`workspaceId` VARCHAR(36) NOT NULL,
`subjectType` VARCHAR(9) NOT NULL,
`s... |
create table rabbitmq_message_log
(
id VARCHAR2(32 CHAR) primary key,
status VARCHAR2(2 CHAR),
create_time TIMESTAMP(3),
update_time TIMESTAMP(3)
) |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 08, 2020 at 12:13 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
DROP DATABASE IF EXISTS burgers_db;
CREATE database burgers_db;
USE burgers_db;
CREATE TABLE burgers (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
burger_name VARCHAR(30) NOT NULL,
devoured BOOLEAN DEFAULT false
);
|
-- Consultas b�sicas da tabelas criadas para verifica��o dos dados inseridos.
SELECT * FROM alunos;
SELECT * FROM aparelhos;
SELECT * FROM series;
SELECT * FROM treinos;
SELECT * FROM alunos_professores;
SELECT * FROM avaliacoes;
SELECT * FROM registro_aula;
SELECT * FROM treinos_series;
SELECT * FROM seri... |
<gh_stars>0
/*10 05 2017*/
ALTER TABLE `ayr`.`usuarios`
CHANGE COLUMN `Estatus` `Estatus` VARCHAR(45) NOT NULL DEFAULT 'ACTIVO' ;
ALTER TABLE `ayr`.`empresas`
ADD COLUMN `Estatus` VARCHAR(45) NULL AFTER `Estado`,
ADD COLUMN `Registro` VARCHAR(45) NULL AFTER `Estatus`;
UPDATE `ayr`.`empresas` SET Estatus = 'ACTIVO... |
<filename>backend/src/main/resources/db/migration/common/V1_0_16__Update_Proposal_Statuses.sql
UPDATE statuses SET name = 'enrollment_closed' WHERE id = 4; |
<reponame>opsroller/shiphub-server<gh_stars>10-100
CREATE PROCEDURE [dbo].[BulkUpdateRepositories]
@Date DATETIMEOFFSET,
@Repositories RepositoryTableType READONLY
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON
-- For tracking requi... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 10.4.10-MariaDB - mariadb.org binary distribution
-- SO del servidor: Win64
-- HeidiSQL Versión: 10.2.0.5599
-- -----------------------------------------------... |
INSERT INTO `users` (`float_id`, `name`, `email`) VALUES (1.23,'comma ,,, and bracket () and single quote \' and particular patten ),( and finished on backslash \\','<EMAIL>'),(-2.5,'',NULL);
|
-- file:drop_if_exists.sql ln:209 expect:true
DROP FOREIGN DATA WRAPPER test_fdw_exists
|
-- CQUI
-- Author: Infixo
-- Created: 2020-09-11
-- Add missing descriptions for boost-related goody huts
UPDATE GoodyHutSubTypes SET Description = "LOC_GOODYHUT_CIVIC_BOOST_DESCRIPTION" WHERE SubTypeGoodyHut = "GOODYHUT_ONE_CIVIC_BOOST";
UPDATE GoodyHutSubTypes SET Description = "LOC_GOODYHUT_CIVIC_BOOST_DESCRIPTION... |
<reponame>devilkun/LW.Admin<filename>install/data/lwadmin.sql
CREATE TABLE `#__admin` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '管理员ID',
`loginname` varchar(50) DEFAULT NULL COMMENT '登录名',
`username` varchar(50) DEFAULT NULL COMMENT '管理员名称',
`security_code` varchar(20) DEFAULT NULL COMMENT '安全码',
`passwo... |
<gh_stars>0
CREATE TABLE [dbo].[Products] (
[ProductId] INT IDENTITY (1, 1) NOT NULL,
[ProductTypeId] INT NOT NULL,
[ProductOwnerId] INT NOT NULL,
[Name] NVARCHAR (MAX) NULL,
[Description] NVARCHAR (MAX) NULL,
[ProductState... |
/*
Navicat Premium Data Transfer
Source Server : 本机
Source Server Type : MySQL
Source Server Version : 50726
Source Host : localhost:3306
Source Schema : meals
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 18/02/202... |
<reponame>Riz-Kler/GhostPubsMvc4<filename>scripts/notes.sql<gh_stars>1-10
use CMS
;
WITH cteNotes
AS (
-- HauntedOrgs
SELECT
n.*
FROM Organisation.Note AS n WITH (NOLOCK)
join Organisation.Org o
on o.ID = n.OrgID
WHERE (o.HauntedStatus = 1)
)
, cteHaunted
AS (SELECT
*,
R... |
create table tab_partition_range
(
col1 number(15) not null,
col2 number(15) not null,
index add_bitmap_ix (col1) bitmap local
)
partition by range (col1,col2)
(
partition part_10 values less than ("10","5"),
partition part_20 values less than (maxvalue,maxvalue)
);
|
<gh_stars>1-10
-- Name: GetPublicFeaturesBySignature
-- Schema: dicom_dd
-- Columns: ['name', 'vr']
-- Args: ['element_signature']
-- Tags: ['UsedInPhiSeriesScan', 'NotInteractive', 'ElementDisposition']
-- Description: Get Element Signature By Signature (pattern) and VR
select
name, vr
from dicom_element
where tag ... |
<filename>modules/flowable-task-service/src/main/resources/org/flowable/task/service/db/drop/flowable.h2.drop.task.sql
drop table if exists ACT_RU_TASK cascade constraints;
drop index if exists ACT_IDX_TASK_CREATE; |
<reponame>bmyerz/postgres-blog
select pg_stat_reset();
|
USE [AIDE]
GO
/****** Object: View [dbo].[vw_LeaveSummary] ******/
SET ANSI_NULLS ON
GO
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.vw_LeaveSummary'))
BEGIN
PRINT 'Dropping old version of vw_LeaveSummary'
Drop View dbo.vw_LeaveSummary
END
GO
SET QUOTED_IDENTIFIER ON
GO
... |
<reponame>opengauss-mirror/Yat
-- @testpoint: hll_hashval_ne(hll_hashval, hll_hashval),比较两个hll_hashval类型数据是否不相等
select hll_hashval_ne(hll_hash_text('ab', 214748367),hll_hash_bigint(0));
select hll_hashval_ne(hll_hash_text('天天开心', 10),hll_hash_text('天天开心', 10));
|
insert into "ManagerStrings" ("ManagerPhrase") values ('ayupip123'); |
<gh_stars>0
CREATE TABLE CNTR_STDZN_DMN_DFNTN_TB(
DMN_LRG_CTGRY varchar(20),
DMN_MDDL_CTGRY varchar(20),
KOR_DMN_NM varchar(100),
ENG_DMN_MDDL_CTGRY_NM varchar(200) ,
... |
insert into formats (name) values ('Standard');
insert into formats (name) values ('Modern');
insert into formats (name) values ('Vintage');
insert into formats (name) values ('Pauper');
|
CREATE TABLE [dbo].[Users] (
[ID] INT IDENTITY (1, 1) NOT NULL,
[DomainUserName] NVARCHAR (128) NOT NULL,
[PrimaryOnlyHasSandboxDatabaseManagerAccessPermission] BIT DEFAULT ((0)) NOT NULL, -- has a... |
/*
SQLyog v10.2
MySQL - 5.7.11 : Database - com.orange.tbkmobile.db
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@... |
ALTER TABLE PLANETRACKS
ADD CONSTRAINT SetForeignKey
FOREIGN KEY (PKEY)
REFERENCES PLOTPOINTS (nextval);
|
<filename>admin/application/install/updates/1.5.0.mysql.sql
-- Secretary 1.5.0 (2015-12-25)
INSERT INTO `#__secretary_fields` (`id`, `extension`, `title`, `description`, `hard`, `type`, `values`, `standard`, `required`)
VALUES (NULL, 'documents', 'COM_SECRETARY_EMAIL_TEMPLATE', 'COM_SECRETARY_EMAIL_TEMPLATE_DESC', '... |
USE `torque`;
DROP TABLE IF EXISTS `raw_logs`;
CREATE TABLE `raw_logs` (
`v` varchar(1) NOT NULL,
`session` varchar(15) NOT NULL,
`id` varchar(32) NOT NULL,
`time` varchar(15) NOT NULL,
`kff1005` float NOT NULL DEFAULT '0',
`kff1006` float NOT NULL DEFAULT '0',
`kff1001` float NOT NULL DEFAULT '0' COMMEN... |
<reponame>SinKasula/Beyond-LeetCode-SQL
# Write your MySQL query statement below
# let a > b > c
# 1. c + b > a
# 2. a - c < b (equivalent as above)
SELECT x, y, z,
CASE
WHEN x + y < z OR x + z < y OR y + z < x THEN 'No'
ELSE 'Yes'
END
AS 'triangle'
FROM triangle t; |
CREATE TABLE "Collection" (
`id` INTEGER,
`identifier` TEXT,
`name` TEXT NOT NULL,
`arabic_name` TEXT,
`medium_name` TEXT NOT NULL,
`short_name` TEXT NOT NULL,
`has_books` INTEGER NOT NULL,
`has_volumes` INTEGER NOT NULL,
`total_hadiths` INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY(id,identifier)
);
CREATE TABLE "... |
<reponame>piszewc/python-deep-learning-data-science<filename>T-SQL/Querying Data with Transact-SQL/Labs/Lab8 - Grouping Sets and Pivoting Data/2 Retrieve Customer Sales Revenue by Category.sql
-- Retrieve customer sales revenue for each parent category
SELECT *
FROM (SELECT c.CompanyName, ac.ParentProductCategoryName, ... |
<reponame>PBorio/hotel
ALTER TABLE `hotel`.`hospedes`
ADD COLUMN `passaporte` VARCHAR(255) NULL AFTER `sobrenome`,
ADD COLUMN `rne` VARCHAR(255) NULL AFTER `passaporte`; |
CREATE TABLE category(
category_id SERIAL PRIMARY KEY,
category_name VARCHAR(19) NOT NULL UNIQUE
);
insert into category(category_name) values('escritório');
insert into category(category_name) values('periférico');
|
CREATE TABLE reservation (
id IDENTITY,
NAME VARCHAR(50)
); |
ALTER TABLE `models`
ADD `use_exact` boolean NOT NULL DEFAULT false;
UPDATE `models` SET `use_exact` = 1 WHERE tag in (
'org.thingpedia.models.default', 'org.thingpedia.models.developer',
'org.thingpedia.models.contextual', 'org.thingpedia.models.developer.contextual');
|
<gh_stars>1-10
/*
MyStep 网站系统数据库结构
14:05 2019-2-1 By Windy2000
*/
# ---------------------------------------------------------------------------------------------------------------
drop DataBase if exists {db_name};
Create DataBase if not exists {db_name} default charset {charset} COLLATE {charset_collate};
u... |
CREATE TABLE [dbo].[Note] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[CreatedById] INT NULL,
[Content] TEXT NULL,
[NotedRecordId] INT NULL,
[NotedRecordType] VARCHAR (255) NULL,
[NoteTypeId] INT NULL,
[CreatedAt] ... |
<filename>admin/sql/updates/20130910-deprecated-link-types-triggers.sql
\set ON_ERROR_STOP 1
BEGIN;
CREATE OR REPLACE FUNCTION deny_deprecated_links()
RETURNS trigger AS $$
BEGIN
IF (TG_OP = 'INSERT' OR (TG_OP = 'UPDATE' AND OLD.link_type <> NEW.link_type))
AND (SELECT is_deprecated FROM link_type WHERE id = NE... |
<filename>Project0/sql data/SQLQuery1.sql
INSERT INTO INVENTORY (ProductId, StoreId, ProductCount)
Values('1','1','6'),('2','2','6'),('3','3','6'),('4','4','6'),('5','5','6'),('6','6','5'); |
# DEFAULT값을 지정할 경우 else 구분 사용
# 코드를 레이블로 매핑하는 쿼리
SELECT
user_id,
case
WHEN register_device = 1 THEN 'desktop'
WHEN register_device = 2 THEN 'smartphone'
WHEN register_device = 3 THEN 'application'
end as device_name
from mst_users;
|
insert into scientific_area(scientific_area_id, name) VALUES (1,"It");
insert into scientific_area(scientific_area_id, name) VALUES (2,"Physics");
insert into scientific_area(scientific_area_id, name) VALUES (3,"Electrical engineering");
INSERT INTO `role` VALUES (1,'USER'),(2,'ADMIN'),(3,'REVIEWER'),(4,'EDITOR'),(5,'... |
CREATE SCHEMA IF NOT EXISTS kinship;
CREATE TABLE kinship.company(
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL,
location VARCHAR NOT NULL,
address VARCHAR NOT NULL,
tin VARCHAR NULL,
telephone VARCHAR NULL,
email VARCHAR NULL,
createddate VARCHAR NULL,
createdtime VARCHAR NULL,
createdby VARCHAR ... |
desc pessoas;
alter table pessoas
add column profissao varchar(10); # adiciona uma coluna chamada profissao com 10 caracteres
alter table pessoas
drop column profissao; # deleta a coluna profissao
alter table pessoas
add column profissao varchar(10) after nome; # a coluna profissao ficará depois da coluna nome
a... |
DROP DATABASE IF EXISTS game_db;
CREATE DATABASE game_db; |
INSERT INTO public.city (
city_id, city, country_id, last_update)
VALUES (1, '<NAME> (La Corua)', 87, '2017-02-15 09:45:25'),
(2, 'Abha', 82, '2017-02-15 09:45:25'),
(3, '<NAME>', 101, '2017-02-15 09:45:25'),
(4, 'Acua', 60, '2017-02-15 09:45:25'),
(5, 'Adana', 97, '2017-02-15 09:45:25'),
(6, '<NAME>', 31,... |
<reponame>cleuillet/DbModelGenerator<filename>DbModelGenerator.Test/Scripts8/02_update.sql
UPDATE contract
SET created_by = '001'
WHERE created_by IS NULL;
UPDATE contract
SET creation_date = now()
WHERE creation_date IS NULL;
ALTER TABLE contract
ALTER COLUMN created_by SET NOT NULL,
DROP
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.