sql stringlengths 6 1.05M |
|---|
<gh_stars>0
alter table achievments.achievments add column description text;
create table achievments.templates (
id integer not null primary key auto_increment,
candidate_team text,
template text
);
alter table achievments.candidates add column workhour_start time;
alter table achievments.candidates add column... |
<reponame>ratzPereira/Sales-app
CREATE TABLE CLIENT (
ID INTEGER PRIMARY KEY AUTO_INCREMENT,
NAME VARCHAR(100)
);
CREATE TABLE PRODUCT (
ID INTEGER PRIMARY KEY AUTO_INCREMENT,
DESCRIPTION VARCHAR(100),
... |
<gh_stars>0
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE thoughts (
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
title TEXT,
deep_thought TEXT,
author TEXT,
created_at TIMESTAMP default current_timestamp
);
|
<gh_stars>0
-- Table definitions for the tournament project.
--
-- Put your SQL 'create table' statements in this file; also 'create view'
-- statements if you choose to use it.
--
-- You can write comments in this file by starting them with two dashes, like
-- these lines here.
-- @author <NAME>
CREATE TABLE player ... |
-- Function: generaterandombuildingsample(integer, geometry, double precision)
-- DROP FUNCTION generaterandombuildingsample(integer, geometry, double precision);
CREATE OR REPLACE FUNCTION generaterandombuildingsample(
IN n integer,
IN container geometry,
IN expand double precision DEFAULT 0.0)
RETURN... |
SELECT
query_name,
ROUND(AVG(rating / position), 2) as quality,
ROUND(AVG(rating < 3) * 100, 2) as poor_query_percentage
FROM
queries
GROUP BY
query_name |
-- 分離レベルを設定
set transaction isolation level serializable;
begin;
-- テーブルをロック
lock tables prices write;
-- わざとトランザクション内の実行を失敗させる
update prices set pricex=1000 where id=1;
-- ロールバックが行われたために次の行が更新されないことを確認
update prices set price=1000 where id=2;
-- テーブルをアンロック
unlock tables;
commit;
/*
1.ロールバックされている? ー> されている
2.テーブルのロ... |
<gh_stars>0
INSERT INTO media
(
title,
uri,
rating,
viewed_at,
created_at
)
VALUES
('Snowhite and the Huntsman', 'http://www.imdb.com/title/tt1735898/', 1000, '2017-03-01', now()),
('The Huntsman: Winter''s War', 'http://www.imdb.com/title/tt2381991/', 1000, '2017-03-01', now())
|
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 01, 2017 at 01:31 PM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 29, 2021 at 03:12 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 7.3.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
use wn;
update estados
set nome = 'Maranhão'
where sigla = 'MA';
select nome
from estados
where sigla = 'ma' ;
update estados
set nome = 'Paraná',
populacao = 11.32
where sigla = 'PR';
select nome,sigla,populacao
from estados
where sigla = 'PR'; |
<reponame>Shuttl-Tech/antlr_psql
-- file:collate.sql ln:139 expect:true
SELECT a, b FROM collate_test2 WHERE a < 4 INTERSECT SELECT a, b FROM collate_test2 WHERE a > 1 ORDER BY 2
|
<filename>database_backup.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.3
-- Dumped by pg_dump version 12.3
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set... |
<gh_stars>0
drop database GMS;
create database GMS;
Use GMS;
create table Member(
member_id varchar(20) not null,
full_name varchar (100) not null,
address varchar(200) not null,
gender varchar(15) not null,
mobile_number varchar(20) not null,
date_of_birth date not null,
email varchar(100) not null,
c... |
--HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE observation
(
observation_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
observation_concept_id INTEGER NOT NULL ,
observation_date DATE NOT NULL ,
observation_datetime DATETIME2 NULL ,
observation_ty... |
CREATE VIEW `query_jadwal_kuliah` AS
SELECT
`jadwal_kuliah`.`hari`,
`sesi_kuliah`.`kelas`,
`sesi_kuliah`.`sesi`,
`sesi_kuliah`.`mata_kuliah`,
`sesi_kuliah`.`id_sesi_kuliah`
FROM
`jadwal_kuliah`
INNER JOIN
`sesi_kuliah` ON `jadwal_kuliah`.`id_j... |
<gh_stars>10-100
SELECT
c1.concept_id,
c2.concept_name AS category,
ard1.min_value,
ard1.p10_value,
ard1.p25_value,
ard1.median_value,
ard1.p75_value,
ard1.p90_value,
ard1.max_value
FROM @results_database_schema.ACHILLES_results_dist ard1
INNER JOIN
@vocab_database_schema.concept c1
ON CAST(ard1.str... |
<filename>basic-application/basic-application-core/src/main/resources/db/migration/tests/V1_1__CreateSchemaTest.sql
CREATE SCHEMA IF NOT EXISTS basic_application_test; |
<reponame>vianhazman/optimus
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE IF NOT EXISTS replay (
id UUID PRIMARY KEY NOT NULL,
job_id UUID NOT NULL,
start_date TIMESTAMP WITH TIME ZONE NOT NULL,
end_date TIMESTAMP WITH TIME ZONE NOT NULL,
status varchar(30) NOT NULL,
message JSONB,
created_at ... |
CREATE INDEX NN_EXEC_PARAMS_STRING_VAL ON BATCH_JOB_EXECUTION_PARAMS (KEY_NAME,STRING_VAL);
CREATE INDEX NN_BATCH_JOB_EXEC_STATUS ON BATCH_JOB_EXECUTION (STATUS);
CREATE INDEX NN_BATCH_JOB_EXEC_EXIT_CODE ON BATCH_JOB_EXECUTION (EXIT_CODE(20));
CREATE INDEX NN_BATCH_JOB_EXEC_CREATE_TIME ON BATCH_JOB_EXECUTION (CREATE_TI... |
<reponame>davew-msft/synapse
/*
This demo creates a Logical Data Warehouse using the contoso DW using data sourced
in MY data lake.
You can look at my data using Storage Explorer here: https://davewdemoblobs.blob.core.windows.net/contosoretaildw-tables?sv=2020-04-08&st=2020-07-12T19%3A04%3A00Z&se=2031-07-13T19%3A... |
<filename>src/test/tinc/tincrepo/dml/triggers/sql/child_part_fallback.sql
--start_ignore
SET client_min_messages='log';
INSERT INTO dml_trigger_table VALUES('TEST',10);
SET client_min_messages='notice';
--end_ignore
SELECT * FROM dml_trigger_table order by 2;
\!grep Planner %MYD%/output/child_part_fallback_orca.out
|
CREATE TABLE __INSERT_SCHEMA__.homogenisation_table (
observation_id VARCHAR REFERENCES __INSERT_SCHEMA__.observations_table(observation_id),
homogenisation_method INT REFERENCES __INSERT_SCHEMA__.homogenisation_method(method),
homogenisation_adjustment NUMERIC,
homogenisation_operator INT REFERENCES __INSERT_S... |
<filename>tests/utest/dbal/unit/driver/sqlite/data/dummyStructure.sql
DROP TABLE IF EXISTS tests_comment;
CREATE TABLE tests_comment (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
post_id INTEGER NOT NULL,
date TEXT NOT NULL,
comment TEXT NOT NULL
);
CREATE INDEX user_id_post_id ON tests_c... |
<gh_stars>0
CREATE TABLE [dbo].[LocalEnterprisePartnershipStaging]
(
[Code] VARCHAR(10) NOT NULL,
[Name] VARCHAR(100) NOT NULL,
[CreatedBy] NVARCHAR(50) NULL,
[ChecksumCol] AS BINARY_CHECKSUM([Code], [Name])
)
|
SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE "magistrate" (gid serial,
"district" int2,
"rep" varchar(25));
ALTER TABLE "magistrate" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','magistrate','geom','4269','MULTIPOLYGON',2);
COPY "magistrate" ("district","rep",geom) FROM ... |
USE burgers_database;
INSERT INTO burgers (hamberder_name, devoured, createdAt, updatedAt)
VALUES ("Chicken burger ", false, now(), now());
INSERT INTO burgers (hamberder_name, devoured, createdAt, updatedAt)
VALUES (" Cheese burger", false, now(), now());
INSERT INTO burgers (hamberder_name, devoured, createdAt,... |
INSERT INTO public.spikes (id, parent_id) VALUES (3, null);
INSERT INTO public.spikes (id, parent_id) VALUES (2, 3);
INSERT INTO public.spikes (id, parent_id) VALUES (4, 3);
INSERT INTO public.spikes (id, parent_id) VALUES (1, 2);
INSERT INTO public.spikes (id, parent_id) VALUES (5, 4);
INSERT INTO public.spikes (id, p... |
<filename>Databases Basics - MS SQL Server/04 Data Aggregation/06DepositsSumForOllivanderFamily.sql
SELECT w.DepositGroup, SUM (DepositAmount) AS [TotalSum]
FROM WizzardDeposits AS w
WHERE w.MagicWandCreator = '<NAME>'
GROUP BY w.DepositGroup |
<reponame>zzjtnb/Node
/*
Navicat Premium Data Transfer
Source Server : MySql
Source Server Type : MySQL
Source Server Version : 50725
Source Host : localhost:3306
Source Schema : nodesql
Target Server Type : MySQL
Target Server Version : 50725
File Encoding : 65001
D... |
<filename>phoenix-scala/sql/V4.114__return_line_items_cleanup.sql
alter table return_line_items
drop column inventory_disposition,
drop column is_return_item,
drop column origin_id,
drop column quantity,
drop column reference_number;
alter table return_line_item_shipping_costs
drop column line_item_id,
a... |
/* Formatted on 12-20-2018 8:30:05 AM (QP5 v5.126.903.23003) */
CREATE OR REPLACE FUNCTION pasn.GET_PRSN_GRDID (P_PERSONID NUMBER)
RETURN NUMBER
AS
L_RESULT NUMBER;
BEGIN
L_RESULT := -1;
SELECT TBL1.GRADE_ID
INTO L_RESULT
FROM ( SELECT A.GRADE_ID
FROM PASN.PRSN_GRADE... |
<filename>migrations/1523760449_setup.down.sql
drop table if exists topics;
drop table if exists users;
drop table if exists organizations;
drop extension if exists "uuid-ossp";
|
\set ON_ERROR_STOP on
\c postgres
CREATE USER own_blockchain_node WITH PASSWORD '<PASSWORD>';
CREATE DATABASE own_public_blockchain
WITH ENCODING 'UTF8'
LC_COLLATE = 'C'
LC_CTYPE = 'C'
TEMPLATE template0;
\c own_public_blockchain
SET search_path TO public;
-- Create extensions
--CREATE EXTENSION a... |
<gh_stars>100-1000
-- table.test
--
-- execsql {DROP TABLE test1}
DROP TABLE test1 |
<filename>src/test/resources/sql/grant/b3101ca2.sql
-- file:foreign_data.sql ln:454 expect:true
GRANT USAGE ON FOREIGN SERVER s4 TO regress_test_role
|
-- Jan 19, 2017 10:30 AM
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2017-01-19 10:30:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2901
;
-- Jan 19, 2017 10:55 AM
-- I forgot to set the DICTIONARY_ID_COMMENTS System Confi... |
logparser.exe "SELECT cs-uri-stem, time-taken, sc-bytes FROM *.log WHERE time-taken > 250000 ORDER BY time-taken DESC" -i:w3c
cs-uri-stem time-taken sc-bytes
--------------------------- ---------- --------
/ShoppingCart/ViewCart.aspx 1366976 256328
/DataService.asmx 1265383 53860
... |
<gh_stars>0
-- this script updates the tables OUTBOX_SCHEMA_VERSION and event_store.
ALTER SESSION SET CURRENT_SCHEMA = %schemaName%;
INSERT INTO OUTBOX_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.11.0', CURRENT_TIMESTAMP);
ALTER TABLE EVENT_STORE ADD (SYSTEM_ENGINE_IDENTIFIER VARCHAR(128) DEFAULT 'default');
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.2 (Debian 13.2-1.pgdg100+1)
-- Dumped by pg_dump version 13.2 (Debian 13.2-1.pgdg100+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;... |
<reponame>bcgov/EDUC-SERVICES-CARD-API<gh_stars>1-10
CREATE TABLE SERVICES_CARD_SHEDLOCK
(
NAME VARCHAR(64),
LOCK_UNTIL TIMESTAMP(3) NULL,
LOCKED_AT TIMESTAMP(3) NULL,
LOCKED_BY VARCHAR(255),
CONSTRAINT SERVICES_CARD_SHEDLOCK_PK PRIMARY KEY (NAME) USING INDEX TABLESPACE API_SERVICES_CARD_IDX... |
<reponame>hui0xin/xin-GameFi
-- 创建数据库
CREATE DATABASE IF NOT EXISTS ido_server DEFAULT CHARACTER SET utf8mb4;
DROP TABLE IF EXISTS aww_market;
CREATE TABLE aww_market
(
id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
chain_id bigint(20) NOT NULL COMMENT '链上 id',
aww_id bigi... |
<gh_stars>1-10
CREATE TABLE "vectorgraphic"
(
project_id uuid REFERENCES "project" (id) ON DELETE CASCADE,
graphic text,
has_colour boolean,
PRIMARY KEY (project_id, has_colour)
);
|
<filename>containers/examples/cluster-server-psql/db_init_scripts/4_pentaho_logging_postgresql.sql<gh_stars>1-10
--
-- These queries create OLTP logging tables for a PostgreSQL database
--
\connect hibernate hibuser
CREATE SCHEMA pentaho_dilogs;
-- Job log table
--
CREATE TABLE pentaho_dilogs.job_logs
(
ID_JOB INT... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint:opengauss关键字savepoint(非保留),作为视图名
--关键字explain作为视图名,不带引号,创建成功
CREATE or replace VIEW savepoint AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
drop view savepoint;
--关键字explain作为视图名,加双引号,创建成功
CREATE or replace VIEW "savepoint" AS
SELECT * FROM pg_... |
INSERT INTO `article` VALUES ('1', '2021-01-04 22:47:34.425', '2022-01-28 15:12:43.453', null, '欢迎来到GinWeb', '1', '使用前请阅读', '<h1 dir=\"auto\"><a href=\"https://github.com/Panseng/gin_web/blob/main\">gin_web</a></h1>\n<p dir=\"auto\">以gin为后台框架,使用mysql作数据库。以vue为前端框架<br />参考:<a href=\"https://github.com/wejectchen/Ginblog... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 05, 2019 at 02:46 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.1.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40... |
<reponame>MichalBreskovic/warehouse<gh_stars>0
CREATE DATABASE IF NOT EXISTS `sklady` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_slovak_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `sklady`;
-- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: localhost Database: sklady
-- --------------------... |
<reponame>quannh-uet/sqlfluff<gh_stars>0
BEGIN TRY
-- Table does not exist; object name resolution
-- error not caught.
SELECT * FROM NonexistentTable;
END TRY
BEGIN CATCH
SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_MESSAGE() AS ErrorMessage;
END CATCH
|
<reponame>BitChant/ProjectFaculty
CREATE DATABASE IF NOT EXISTS ProjectFaculty;
USE ProjectFaculty;
CREATE TABLE IF NOT EXITS dept(
id INT(11) UNSIGNED AUTO_INCREMENT NOT NULL,
name VARCHAR(30) ,
description TEXT,
primary key(id)
);
INSERT INTO dept(name,description) VALUES( 'COMPUTER ENGINEERING','Established in t... |
-- MySQL Script generated by MySQL Workbench
-- Wed Jul 25 06:23:21 2018
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TR... |
INSERT INTO turma_reforco_aluno (
id,
created,
aluno_id,
turma_id
)
VALUES (
1001,
now(),
1001,
1001
); |
drop index unique_nino_for_active_claim;
alter table claim alter column email_address drop not null;
alter table claim alter column phone_number drop not null;
alter table claim alter column nino drop not null;
create unique index unique_nino_for_active_claim on claim (nino)
where claim_status in ('NEW', 'ACTIVE', 'P... |
<reponame>m0g/zeithub
ALTER TABLE `activities`
DROP COLUMN `invoice_id`;
|
<gh_stars>10-100
DROP PROCEDURE IF EXISTS `get_callrecording`;
DELIMITER ;;
CREATE PROCEDURE `get_callrecording`(IN user_in INT,IN inbound_cid VARCHAR(60))
BEGIN
declare RECORD tinyint DEFAULT 0;
declare DEFAULT_RECORDING tinyint DEFAULT 2;
declare RECORD_INFO VARCHAR(60) DEFAULT '';
SELECT ifnull(call_recording,0),... |
-- file:regex.sql ln:63 expect:true
select 'xy' ~ 'x(?![xy])'
|
USE [AdventureWorksDW]
GO
/****** Object: View [BI].[vFact_InternetSales] Script Date: 9/18/2018 1:51:02 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [BI].[vFact_InternetSales]
As
SELECT
F.ProductKey as [Product Key]
, F.OrderDateKey as [Order Date Key]
, F.ShipDateKey... |
-- description to support crating and uncrating
ALTER TABLE mto_service_items
ADD COLUMN description text;
COMMENT ON COLUMN "mto_service_items"."description" IS 'Description of a service item. Eg. Decorated horse head needs to be crated.';
-- create dimensions table
-- row is deleted if the mto_service_item is d... |
<reponame>saraoros/employee-tracker
DROP DATABASE IF EXISTS employee_db;
CREATE DATABASE employee_db;
USE employee_db;
-- Start of department table
CREATE TABLE department (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
department_name VARCHAR(30) NOT NULL
);
-- Start of role table
CREATE TABLE role (
id INTEGE... |
<filename>database/atualizador/src/main/resources/db/migration/postgresql/client/V0001/V0000/V0001_0000_00000163__CreateTable_OrderDetail.sql
CREATE TABLE orderdetail (
id CHAVE NOT NULL,
id_order CHAVE NOT NULL,
id_order_invoice ... |
CLEAR SCREEN
PROMPT Menu inserons
PROMPT
PROMPT 1: Ajouter un Client
PROMPT 2: Ajouter un Produit
PROMPT 3: Ajouter une VenteClient
PROMPT 4: Retour au menu principal
PROMPT 5: Quitter
PROMPT
ACCEPT selection PROMPT "Entrez option 1-5: "
PROMPT
SET TERM OFF
COLUMN script NEW_VALUE choixMenu
SELECT CASE '&selection'
WH... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: localhost Database: appoubusdb
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_... |
-- +goose Up
CREATE TABLE IF NOT EXISTS `user`(
`id` INT NOT NULL AUTO_INCREMENT,
`email` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL,
`active` BOOLEAN NOT NULL DEFAULT TRUE,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`update_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UP... |
<reponame>OpenEarthDemo/Genie<gh_stars>0
SELECT
CURRENT_TIMESTAMP AS '',
'Upgrading database schema for Genie 3.2.0' AS '';
SELECT
CURRENT_TIMESTAMP AS '',
'Dropping tag indicies' AS '';
ALTER TABLE `applications`
DROP KEY `APPLICATIONS_TAGS_INDEX`;
ALTER TABLE `clusters`
D... |
ALTER TABLE app_goal_exe ALTER COLUMN exception TYPE text; |
version https://git-lfs.github.com/spec/v1
oid sha256:e902e8a874a77eb2c7e8b1541cca16c3126b366829b1adfa5e101492aad6cde1
size 3623
|
-- Verify ggircs-portal:tables/form_json_001 on pg
begin;
select pg_catalog.has_table_privilege('ggircs_portal.form_json', 'select');
rollback;
|
<gh_stars>10-100
-- drop existing index
DROP INDEX idx_provider_id;
-- recreate case sensitive index idx_provider_id
CREATE INDEX idx_provider_id ON external_provider_tokens (provider_id); |
<reponame>ystros/credhub<gh_stars>100-1000
CREATE TABLE `ssh_secret` (
`public_key` varchar(7000) DEFAULT NULL,
`id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `ssh_secret_fkey` FOREIGN KEY (`id`) REFERENCES `named_secret` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
create database if not exists test_00604;
show create database test_00604;
drop database test_00604;
|
with segment_mapped_actions as (
select * from {{ ref('segment_mapped_actions') }}
),
mapped_actions as (
select
id as action_id,
universal_alias,
received_at,
lag(received_at) over (partition by universal_alias order by received_at) as last_received_at
from segment_mapped_actio... |
CREATE OR REPLACE TABLE datawarehouse3 AS
SELECT
year AS x
FROM
`bigquery-public-data.samples.gsod`;
|
SET search_path = pg_catalog;
CREATE OR REPLACE FUNCTION public.prsd_headline(internal, internal, tsquery) RETURNS internal
LANGUAGE internal IMMUTABLE STRICT
AS 'prsd_headline';
CREATE OR REPLACE FUNCTION public.prsd_lextype(internal) RETURNS internal
LANGUAGE internal IMMUTABLE STRICT
AS 'prsd_lexty... |
<reponame>seppo0010/advent-of-code-2021<filename>13/part2.sql
.mode csv input
create table grid (x int, y int, id integer primary key autoincrement);
.import input grid
DELETE FROM grid WHERE y IS NULL;
create table folds (axis text, rowcol int(1), id integer primary key autoincrement);
.separator "="
.import input fo... |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE DATABASE `3ds_depot` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `3ds_depot`;
CREATE TABLE `games` (
`id` int(11) NOT NULL,
`titleid` varchar(16) NOT NULL DEFAULT '0000000000000000',
`name` varchar(200) NOT NULL DEFAULT 'No ... |
<gh_stars>0
-- @testpoint: opengauss关键字sublist非保留),作为索引名,部分测试点合理报错
--前置条件,创建一个表
drop table if exists explain_test;
create table explain_test(id int,name varchar(10));
--关键字不带引号-成功
drop index if exists sublist;
create index sublist on explain_test(id);
drop index sublist;
--关键字带双引号-成功
drop index if exists "sublist";
... |
<filename>SQLSCRIPT.sql
CREATE USER 'webadmin'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'webadmin'@'%';
CREATE DATABASE sensoro;
USE sensoro;
CREATE TABLE `temperature` (
`ID` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`day` date NOT NULL,
`time` time NOT NULL,
`temperature` float,
`hu... |
DELIMITER $$
CREATE TRIGGER `tr_insert_employees`
AFTER INSERT
ON `employees`
FOR EACH ROW
BEGIN
INSERT INTO `employees_loans` (`employee_id`, `loan_id`)
VALUES (NEW.`employee_id`, (SELECT el.`loan_id`
FROM `employees` AS e
INNER JOIN `employees_loans` AS el
ON e.`employee_id` = el.`employe... |
describe pessoas; # ver a tabela
alter table pessoas # quero alterar tabela pessoas
add column profissao varchar(10); #adicionada em um último campo
alter table pessoas
drop column profissao; # excluir profissão
alter table pessoas # quero alterar tabela pessoas
add column profissao varchar(10) AFTER nome;
alt... |
<reponame>carlosrobertovelasquez/appERPL360<gh_stars>0
ALTER TABLE ANTICIPO_MARCA_FACT
ADD CONSTRAINT FKANTICIPO_MARCA_FACT
FOREIGN KEY ( DOCUMENTO_CC, TIPO )
REFERENCES DOCUMENTOS_CC ( DOCUMENTO, TIPO )
go
ALTER TABLE APERTURA_CAJA
ADD CONSTRAINT FKUSR_APCAJA
FOREIGN KEY ... |
<gh_stars>0
/****** Carga de datos en tablas maestras ******/
/*---------- Carga de tipos de documento--------------*/
INSERT INTO AMPAEXT.dbo.TIPO_DOCUMENTO
(NOMBRE,DESCRIPCION)
VALUES
('NIF', 'Número de Identificación Fiscal')
INSERT INTO AMPAEXT.dbo.TIPO_DOCUMENTO
(NOMBRE,DESCRIPCION)
VA... |
<filename>sql/coworkers_30_days.sql
-- Query to know the coworkers who used at least 1 ticket during the 30 last days
select distinct CONCAT(meta.first_name,' ',meta.last_name), sum(ticket_log.nb_ticket)
from ticket_log
inner join commandes on ticket_log.commande_id = commandes.id
inner join meta on commandes.user_id =... |
<gh_stars>1-10
DELETE FROM sms_alerts WHERE court_date < :expiredDate |
ALTER TABLE AKTOERID_TO_PERSONID ADD OPPRETTET_TIDSPUNKT TIMESTAMP;
ALTER TABLE AKTOERID_TO_PERSONID ALTER COLUMN OPPRETTET_TIDSPUNKT SET DEFAULT CURRENT_TIMESTAMP; |
<reponame>pshresth/dbschemareader
CREATE DATABASE [NorthwindDsr]; |
<reponame>care-share/vha-rural-health-openid-connect-overlay
--
-- Copyright 2016 The MITRE Corporation, All Rights Reserved.
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this work except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www... |
<reponame>attribyte/pubsubhub<gh_stars>1-10
CREATE TABLE IF NOT EXISTS test (
test INT NOT NULL DEFAULT 0
);
CREATE TABLE IF NOT EXISTS topic (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
topicURL VARCHAR_IGNORECASE NOT NULL,
topicHash VARCHAR_IGNORECASE(32) NOT NULL,
createTime TIMESTAMP NOT NULL DEFAULT CU... |
<gh_stars>10-100
-- unary math operations in calculator
-- only one is unary negation
-- Test against our standard data set
set schema 's';
SELECT N1, N2, N3, N4, N5, '|', -N2, - (N3 + N4), - (N4 - N5)
FROM TEST_INTEGER_TABLE ORDER BY N1,N2,N3,N4,N5
;
SELECT N1, N2, N3, N4, N5, '|', -N2, - (N3 + N4), - (N4 - N5)
FR... |
--
-- Copyright 2016 <NAME>, <EMAIL>-Bi.nl
--
-- 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 ... |
INSERT INTO Greeting (text) VALUES ('Hello World!');
INSERT INTO Greeting (text) VALUES ('Hola Mundo!');
|
CREATE FUNCTION bll.[fn_IsLeap](@Year INT)
RETURNS BIT
AS
BEGIN
RETURN
CASE
WHEN @Year % 400 = 0 THEN 1
WHEN @Year % 100 = 0 THEN 0
WHEN @Year % 4 = 0 THEN 1
ELSE 0
END
END |
CREATE TABLE `_oauth_clients` (
`id` CHAR(40) NOT NULL,
`secret` CHAR(40) NOT NULL,
`name` VARCHAR(255) NOT NULL,
`auto_approve` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `u_oacl_clse_clid` (`secret`,`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE utf8_unicode_ci;
CREATE TABLE `_oa... |
<reponame>Tiiduke/VL2017R4T1<filename>vl2017r4t1csut_test.sql
-- phpMyAdmin SQL Dump
-- version 4.0.10.18
-- https://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Apr 05, 2017 at 05:20 PM
-- Server version: 10.0.30-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone... |
/*
Navicat MySQL Data Transfer
Source Server : T-hank
Source Server Version : 50505
Source Host : localhost:3306
Source Database : ifruit_db
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2020-09-09 12:41:00
*/
SET FOREIGN_KEY_CHECKS=0;
-- --... |
<reponame>linminglu/Fgame<filename>sql/1.19/update_game_1.19.sql<gh_stars>0
set names 'utf8mb4';
set character_set_database = 'utf8mb4';
set character_set_server = 'utf8mb4';
USE `game`;
alter table `t_player_trade_log` add column `feeRate` int(11) NOT NULL COMMENT "手续费比例";
-- ----------------------------
-- Table ... |
<gh_stars>0
CREATE TABLE IF NOT EXISTS `account` (
`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
`phone_number` varchar(20) NOT NULL,
`valid` TINYINT(1) DEFAULT 0
)ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
\connect pgdatabase
--
-- PostgreSQL database schema
--
-- Dumped from database version 9.5.5
set statement_timeout = 0;
set lock_timeout = 0;
set client_encoding = 'UTF8';
set standard_conforming_strings = on;
set check_function_bodies = false;
set client_min_messages = warning;
set row_security = off;
set role roo... |
<filename>data/migrations/timestamp-description.sql
alter table books add column author_id int;
CREATE TABLE authors (id SERIAL PRIMARY KEY, name VARCHAR(255));
alter table books add CONSTRAINT fk_author FOREIGN KEY (author_id) REFERENCES authors(id);
INSERT INTO authors(name) SELECT DISTINCT author FROM books;
SEL... |
<gh_stars>0
-- WHERE kullanımı
-- SELECT sutun adları FROM tablo ismi WHERE sartlar
/*
kullanılabilecek operatör ve anahtar kelimeler
=
!= ya da <>
>=,<=,>
IN
BETWEEN AND
LİKE "pattern"
AND OR NOT
% tüm karakterler için
? ya da _tek karakterler için kullanılır
*/
--SELECT * FROM employees WHERE EmployeedId > 5;
--SE... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 10, 2018 at 01:27 PM
-- 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:00";
/*!40101 SET @OL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.