sql stringlengths 6 1.05M |
|---|
<gh_stars>10-100
CREATE TABLE eth_events (
id SERIAL PRIMARY KEY NOT NULL,
event_type VARCHAR NOT NULL,
data JSON NOT NULL DEFAULT '{}',
block_number NUMERIC NOT NULL,
created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL
... |
<filename>Src/SimpleFeedly.DbUpdater/Migrations/SimpleFeedlyDb/@RefScript/Stored/dbo.AddBlacklistItem.sql
/****** Object: StoredProcedure [dbo].[AddBlacklistItem] Script Date: 4/28/2019 6:49:02 AM ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[AddBlacklistItem]') AND type IN (N'P... |
<filename>048-IncrementalSynapsePipelines/Student/Resources/SQL/Dedicated_Pool/CREATE PROCEDURE spInsertAddress.sql
IF OBJECT_ID ( 'SalesLT.spInsertAddress', 'P' ) IS NOT NULL
DROP PROCEDURE SalesLT.spInsertAddress;
GO
CREATE PROCEDURE SalesLT.spInsertAddress
AS
BEGIN
SET NOCOUNT ON;
INSERT SalesLT.Addres... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 10, 2020 at 03:06 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... |
<filename>src/manifest-comparison/templates/create-parquet-table.sql<gh_stars>1-10
CREATE EXTERNAL TABLE IF NOT EXISTS [table_name] (
`id` string,
`database` string,
`collection` string,
`import_timestamp` bigint,
`import_source` string,
`import_component` string,
`import_type` string,
... |
# Time: O(s+dlogd)
# Space: O(d+s)
SELECT
dept_name, COUNT(student_id) AS student_number
FROM
department
LEFT JOIN
student ON department.dept_id = student.dept_id
GROUP BY department.dept_name
ORDER BY student_number DESC , department.dept_name
;
|
-- Revert postgraphile_user_system:link_or_register_user from pg
BEGIN;
SET SEARCH_PATH TO app_private,public;
DROP FUNCTION link_or_register_user(uuid,character varying,character varying,json,json);
COMMIT;
|
--
-- Create Pokemon Deck Manager database
--
-- Create database for storing information about players, their deck,
-- and their Pokemon.
--
-- Create tables --
CREATE TABLE pokemon (
id INTEGER NOT NULL AUTO_INCREMENT,
pokemon_key VARCHAR(60) NOT NULL,
pokemon_name VARCHAR(120) NOT NULL,
pokemon_num INT... |
<filename>working/packages/DevV5_additional_functions/urlencode.sql
CREATE OR REPLACE FUNCTION devv5.urlencode (
txt_string text
)
RETURNS text AS
$body$
from urllib import quote_plus
return quote_plus (txt_string)
$body$
LANGUAGE 'plpythonu'
IMMUTABLE
RETURNS NULL ON NULL INPUT
SECURITY DEFINER
PARALLEL SAFE
COST ... |
<reponame>git001/orchestrator
UPDATE database_instance SET
last_checked=current_timestamp,
last_attempted_check=current_timestamp,
last_seen=current_timestamp,
seconds_behind_master=7,
slave_lag_seconds=7
where port in (22294, 22297);
|
ALTER TABLE wnprc_compliance.persons ADD COLUMN hold BOOLEAN DEFAULT false;
--update measles_required from wnprc_compliance.measles_clearances using labkey javascript API
ALTER TABLE wnprc_compliance.persons ADD COLUMN measles_required BOOLEAN DEFAULT false;
|
<reponame>hubbub-tech/blubber-orm<filename>src/blubber_orm/versions/destroy.sql
--\i Projects/hubbub/blubber/src/blubber_orm/dev/destroy.sql
DROP TABLE addresses CASCADE;
DROP TABLE calendars CASCADE;
DROP TABLE carts CASCADE;
DROP TABLE details CASCADE;
DROP TABLE dropoffs CASCADE;
DROP TABLE extensions CASCADE;
DROP... |
---
--- Replace t_cryptotransferlists.account_id with realm_num and entity_num
---
-- populate realm_num and entity_num from t_entities table
-- instead of in place update insert into a new table without index overhead for optimal performance
create table t_cryptotransferlists_migrate
(
consensus_timestamp nanos_t... |
/*
* Copyright (c) 2004-2018, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list o... |
<filename>tests/Sql/PostgreSql/PostgreSQL_SPTests.sql<gh_stars>10-100
-- Sequence: public.products_productid_seq
DROP SEQUENCE public.products_productid_seq;
CREATE SEQUENCE public.products_productid_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1000
CACHE 1;
ALTER TABLE public.products_prod... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 01, 2021 at 08:08 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<reponame>One-E2-Team/ISA
insert into pharmacies values (1, '<NAME> 1', 'Nebitan opis',15.0, 0, 15.0, 'Apoteka 1', 0);
insert into medicines values (1, 100, 'sastav', 4, 'proizvodjac', 'oblik', 'tip', 'lek 1', 0, false, 'nuspojave 1');
insert into warehouses values (1, 10, 0, 0, 1, 1);
insert into all_users values ('PA... |
<reponame>xiguaff/bigmarket
SET NAMES UTF8;
DROP DATABASE IF EXISTS xm;
CREATE DATABASE xm CHARSET=UTF8;
USE xm;
-- 创建用户信息表
CREATE TABLE xm_user(
uid INT PRIMARY KEY AUTO_INCREMENT,
uname VARCHAR(50),
upwd VARCHAR(50),
email VARCHAR(50),
phone VARCHAR(50),
gender INT /*1-->男 0-->女*/
);
INSERT INTO xm_u... |
/*
Run this script on:
(localdb)\MSSQLLocalDB.CSETWeb - This database will be modified
to synchronize it with:
sql19dev1.CSETWeb
You are recommended to back up your database before running this script
Script created by SQL Data Compare version 14.6.10.20102 from Red Gate Software Ltd at 2/1/2022 4:03:44 ... |
ALTER TABLE PUBLIC.USERS ADD AVATAR VARCHAR(255); |
<reponame>fujiazhiyu/OAsystem
CREATE TABLE `team_thread` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`board` mediumint(9) NOT NULL,
`title` varchar(255) NOT NULL,
`content` text NOT NULL,
`author` varchar(60) NOT NULL,
`editor` varchar(60) NOT NULL,
`createdDate` datetime NOT NULL,
`editedDate... |
CREATE TABLE READING (
ID BIGINT NOT NULL AUTO_INCREMENT,
READ_DATE DATETIME NOT NULL,
TRIP_ID BIGINT NOT NULL,
LATITUDE DECIMAL(10, 7) NOT NULL,
LONGITUDE DECIMAL(10, 7) NOT NULL,
AIR_INTAKE_TEMP DOUBLE NULL,
AMBIENT_AIR_TEMP DOUBLE NULL,
ENGINE_COOLANT_TEMP DOUBLE NULL,
OIL_TEMP DOUBLE NULL,
ENGINE_R... |
CREATE TABLE list (id VARCHAR(64) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "list" ("id", "value") VALUES (E'AF', E'Afgaanistaan');
INSERT INTO "list" ("id", "value") VALUES (E'AL', E'Albaaniya');
INSERT INTO "list" ("id", "value") VALUES (E'DZ', E'Aljeeriya');
INSERT INTO "list" ("id", "valu... |
<gh_stars>1-10
ALTER TABLE projects RENAME COLUMN donation_email TO donation_subject;
ALTER TABLE projects DROP COLUMN donation_default_amount, DROP COLUMN donation_monthly_amounts, DROP COLUMN donation_onetime_amounts
|
<reponame>auditt7708/oracle_scripts
select l.blocks*l.block_size/1024/1024, l.*
from gv$archived_log l where recid > (select max(recid)-20 from gv$archived_log)
--and name = 'JANUARY'
order by recid, inst_id
select * from gv$loghist where sequence# = 361861
with
param as (select &<name="Begin" type="date" d... |
ALTER TABLE lookup_manager_tables ADD url NVARCHAR(255) NOT NULL DEFAULT ''; |
CREATE OR REPLACE FUNCTION ti.gettaxagroupecolsetids(_taxagroupid character varying)
RETURNS TABLE(taxagroupid character varying, ecolsetid integer)
LANGUAGE sql
AS $function$
select tx.taxagroupid,
eg.ecolsetid
from ndb.ecolgroups AS eg
inner join ndb.taxa AS tx on eg.taxonid = tx.taxonid
g... |
<reponame>aliostad/deep-learning-lang-detection<gh_stars>10-100
--DROP TABLE YYZY.T_YYZY_PFPH_SCX;
CREATE TABLE YYZY.T_YYZY_PFPH_SCX(
PFPHDM INTEGER,
PFPHMC VARCHAR(50),
SCXBJ INTEGER,
PPBJ INTEGER
) IN TS_REG_16K;
ALTER TABLE YYZY.T_YYZY_PFPH_SCX
LOCKSIZE ROW
APPEND OFF
NOT VOLATILE
LOG INDEX BUILD NU... |
CREATE TABLE [dbo].[SiteVisit] (
[EventId] UNIQUEIDENTIFIER NOT NULL,
[IsDataEntryComplete] BIT CONSTRAINT [DF_PointSurvey__IsDataEntryComplete] DEFAULT ((0)) NOT NULL,
[LocationId] UNIQUEIDENTIFIER NOT NULL,
[StartTime] DATETIME NOT NULL,
[EndTim... |
<reponame>sap-archive/cloud-contact-srv
DROP TABLE "CONTACT_ADDRESS";
DROP TABLE "CONTACT_EMAIL";
DROP TABLE "CONTACT_PHONE";
DROP TABLE "CONTACT_CONTACT"; |
IF not EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Depts]') AND type in (N'U'))
begin
CREATE TABLE [dbo].[Depts](
[DeptId] [uniqueidentifier] NOT NULL DEFAULT (newsequentialid()) primary key,
[ParentDeptId] [uniqueidentifier] NULL,
[Address] [nvarchar](2000) NULL,
[DeptCode] [nvarchar](2... |
/* Copyright (c) 2006-2012 Regents of the University of Minnesota.
For licensing terms, see the file LICENSE. */
/* Update the annot_bs_geo view to include the byway id col */
BEGIN TRANSACTION;
SET CONSTRAINTS ALL DEFERRED;
DROP VIEW geofeature;
DROP VIEW annotation_geo;
DROP VIEW annot_bs_geo;
create view anno... |
/*
* Copyright 2019 Google LLC
*
* 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 agreed to... |
<filename>src/olympia/migrations/1043-remove-thunderbird-seamonkey-categories.sql<gh_stars>1-10
-- Remove categories for applications others than Firefox and Firefox for
-- Android.
-- Removing those categories and associated m2m will hide them from the site,
-- and prevent developers from choosing them when submitting... |
-- @testpoint: else用于条件表达式中
--case when之后的条件都为真,返回结果是then之后的值
drop table if exists case_when_t1;
CREATE TABLE case_when_t1(CW_COL1 INT);
INSERT INTO case_when_t1 VALUES (1), (2), (3);
SELECT * FROM case_when_t1;
SELECT CW_COL1, CASE WHEN CW_COL1=1 THEN 'one' WHEN CW_COL1=2 THEN 'two' ELSE 'other' END FROM case_when_t1 ... |
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Erstellungszeit: 02. Jun 2018 um 18:11
-- Server-Version: 10.2.14-MariaDB-log
-- PHP-Version: 7.2.5
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = ... |
<filename>sql/ctas_csv_to_parquet.sql
-- Create Table as Select
CREATE TABLE nyc_taxi_parquet
WITH (
external_location = 's3://ids-glue-athena-demo/nyc_taxi_parquet/',
format = 'parquet')
AS SELECT *
FROM nyc_taxi_csv; |
<filename>dbt_test/models/report_group_sales_product_region.sql
{{ config(materialized='view') }}
{% set regions = ["r1","r2","r3","r4","r5"] %}
with report_group_sales_product_region as (
select s.product,
{% for r in regions %}
coalesce(sum(case when s.region ='{{r}}' then s.amount end)... |
EXEC [EST].[Proc_yjbb_Ins] @Code = N'600789',@CutoffDate = N'2017-09-30',@EPS = N'0.075',@EPSDeduct = N'0',@Revenue = N'18.84亿',@RevenueYoy = N'3.87',@RevenueQoq = N'-4.96',@Profit = N'4356.93万',@ProfitYoy = N'101.73',@ProfiltQoq = N'-38.64',@NAVPerUnit = N'3.2450',@ROE = N'2.32',@CashPerUnit = N'0.3056',@GrossProfitRa... |
<filename>application/schema/table/tapir_configuration.sql
create table TAPIR_CONFIGURATION
(
key VARCHAR2(255) not null,
value VARCHAR2(4000),
description VARCHAR2(4000)
)
;
comment on table TAPIR_CONFIGURATION is 'TAPIR configuration table';
comment on column TAPIR_CONFIGURATION.key is 'Configur... |
<filename>src/metadb/FooDB/FooDB.sql<gh_stars>1-10
CREATE DATABASE IF NOT EXISTS `foodb` /*!40100 DEFAULT CHARACTER SET gbk */;
USE `foodb`;
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: localhost Database: foodb
-- ------------------------------------------------------
-- Server version 5.5.3... |
UPDATE public.search_service
SET description_cy = 'Ceisio lloches, hawl i fyw yn y DU, ac apelio yn erbyn allgludiad.'
WHERE id = 5;
UPDATE public.search_service
SET description_cy = 'Y Weithdrefn Un Ynad ac achosion troseddol eraill yn Llys y Goron neu''r Llys Ynadon.'
WHERE id = 6;
UPDATE public.search_servicearea
... |
<reponame>rhomicom-systems-tech-gh/Rhomicom-DB-Scripts
/* Formatted on 12-17-2018 11:37:55 AM (QP5 v5.126.903.23003) */
DROP TABLE SELF.SELF_PERSON_QUESTION_ANSWERS CASCADE CONSTRAINTS PURGE;
CREATE TABLE SELF.SELF_PERSON_QUESTION_ANSWERS (
PRSN_ANSR_ID NUMBER NOT NULL,
QSTN_ID NUMBER,
PRSN_I... |
--
-- 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 ma... |
<reponame>ddpkts/wallee-oxid-6
-- DROP INDEX idx_oxorder_oxtransstatus ON `oxorder`;
-- not required to persist following tables after uninstall
-- DROP TABLE `wleWallee_alert`;
-- DROP TABLE `wleWallee_cron`; |
<reponame>anrodigina/ClickHouse<filename>dbms/tests/queries/0_stateless/00752_low_cardinality_mv_1.sql
drop table if exists lc;
drop table if exists lc_mv;
create table lc (str StringWithDictionary) engine = MergeTree order by tuple();
insert into lc values ('a'), ('bbb'), ('ab'), ('accccc'), ('baasddas'), ('bcde');
... |
select partition, region, resource_id
from aws.aws_appautoscaling_target
where service_namespace = 'dynamodb' and resource_id = '{{output.resource_id.value}}';
|
-- 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 not... |
<reponame>dyz001/proxy_manager
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1_56
Source Server Version : 50505
Source Host : 192.168.1.36:3306
Source Database : h5proxy
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2018-01-29 21:22:3... |
CREATE TABLE TBL_STOCK(
product_id VARCHAR2(6) PRIMARY KEY,
product_name VARCHAR2(20) UNIQUE,
quantity_on_hand NUMBER CHECK (quantity_on_hand >=0),
product_unit_price NUMBER CHECK (product_unit_price >=0),
reorder_level NUMBER CHECK (reorder_level >=0)
);
|
<gh_stars>0
SELECT "user", users.real_name, count(distinct mention) as count_m
FROM mentions
join users on mentions.user = users.id
group by "user", users.real_name
order by count_m desc |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 05, 2021 at 05:17 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<reponame>jorcalle11/hello-graphql
DROP DATABASE IF EXISTS name_contests;
create DATABASE name_contests;
USE name_contests;
drop view if exists total_votes_by_name;
drop table if exists votes;
drop table if exists names;
drop table if exists contests;
drop table if exists users;
create table users (
id serial prim... |
DROP DATABASE IF EXISTS employeeDB;
CREATE DATABASE employeeDB;
USE employeeDB;
CREATE TABLE department (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30)
);
CREATE TABLE role (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(30),
salary DECIMAL,
department_id INT,
FOREIGN KEY (department_id) REFERENCES departme... |
<reponame>saullainez/Sistema-inventario
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `reporte_mejor_proveedor`(in fechaInicio date, in fechaFin date)
begin
select a.ProveedorId, e.EmpresaNombre, mc.Nombre, mc.TipoMovimiento,count(ProveedorId) as cantidad_movimientos, sum(monto) as total
from movimie... |
<reponame>AliTaha27170/EST<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Oct 19, 2021 at 07:29 PM
-- Server version: 5.6.51-cll-lve
-- PHP Version: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SE... |
DROP TABLE IF EXISTS users;
CREATE TABLE users (
user_id serial PRIMARY KEY,
username VARCHAR (50) NOT NULL UNIQUE,
email VARCHAR(50) NOT NULL UNIQUE,
pass_digest VARCHAR(1000) NOT NULL
);
DROP TABLE IF EXISTS habits;
CREATE TABLE habits (
habit_id serial PRIMARY KEY,
user_id INT,
habit_... |
DROP FUNCTION IF EXISTS fetchq.destroy_with_terrible_consequences();
CREATE OR REPLACE FUNCTION fetchq.destroy_with_terrible_consequences(
OUT was_destroyed BOOLEAN
) AS $$
DECLARE
VAR_q RECORD;
BEGIN
DROP SCHEMA IF EXISTS fetchq CASCADE;
DROP SCHEMA IF EXISTS fetchq_data CASCADE;
-- drop all queu... |
INSERT INTO category VALUES ('c60902ffd0344445b7f61e56154d8724', 'building');
INSERT INTO category VALUES ('0b9a432909c549a1821b578be7ec82f3', 'garden');
INSERT INTO category VALUES ('6b7a4917aa884807b660028aa32adbdd', 'workshopServices');
INSERT INTO category VALUES ('6eb67bbe592f49aab7827e4b294fef00', 'transport');
I... |
UPDATE metadata
SET value = "-180.0,-85,180,85"
WHERE name = "bounds"; |
-- alter user schema
ALTER TABLE auth.users
ADD COLUMN IF NOT EXISTS phone VARCHAR(15) NULL UNIQUE DEFAULT NULL,
ADD COLUMN IF NOT EXISTS phone_confirmed_at timestamptz NULL DEFAULT NULL,
ADD COLUMN IF NOT EXISTS phone_change VARCHAR(15) NULL DEFAULT '',
ADD COLUMN IF NOT EXISTS phone_change_token VARCHAR(255) NULL D... |
prompt - table ed_dept
create table ed_dept (
deptno number(2,0) generated by default on null as identity (start with 50 increment by 10 maxvalue 9000 nocache nocycle),
dname varchar2(50 char) ,
loc varchar2(50 char) ,
--
primary key (deptno)
);
|
--Demo data for icr type code
insert into FIN_IDC_TYPE_CODE (FIN_IDC_CODE, RATE_TYPE_CODE, OBJ_ID, VER_NBR, RATE_CLASS_CODE) values (22, 1, sys_guid(), 1, 1)
/
insert into FIN_IDC_TYPE_CODE (FIN_IDC_CODE, RATE_TYPE_CODE, OBJ_ID, VER_NBR, RATE_CLASS_CODE) values (11, 1, sys_guid(), 1, 2)
/
insert into FIN_IDC_TYPE_CODE ... |
#------------------------------------------------------------------------------
# Durée de vie bonus des sessions
#------------------------------------------------------------------------------
ALTER TABLE quantyl_session
ADD `lifetime` int(11) not null ;
|
CREATE TABLE "DGR_LOCATOR"
( "LOCATOR_ID" NUMBER NOT NULL ENABLE,
"COLLECTION_OBJECT_ID" NUMBER,
"FREEZER" NUMBER NOT NULL ENABLE,
"RACK" NUMBER NOT NULL ENABLE,
"BOX" NUMBER NOT NULL ENABLE,
"PLACE" NUMBER NOT NULL ENABLE,
"NK" NUMBER,
"TISSUE_TYPE" VARCHAR2(255 CHAR)
) |
<filename>azure-test/tests/azure_subnet/test-turbot-query.sql<gh_stars>10-100
select name, akas, title
from azure.azure_subnet
where name = '{{resourceName}}' and resource_group = '{{resourceName}}' and virtual_network_name = '{{resourceName}}'
|
CREATE TABLE `tb_fijiqnymmp` (
`col_tcroqoomon` tinyblob
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
SELECT a AS from, b + c AS sum FROM ...
SELECT a "from", b + c AS sum FROM ...
|
-- created 2012-08-29
CREATE TABLE `audit_log_entry` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`transaction_id` varchar(50) NULL,
`entity_id` int(11) NULL,
`entity_type` varchar(150) NULL,
`finger_print` varchar(200) NULL,
`create_dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
... |
<gh_stars>1-10
-- create a class,insert data to this class,select data from this class with decr function and rownun
create class xoo (a int primary key, b int);
insert into xoo values(1,1);
insert into xoo values(2,2);
insert into xoo values(3,3);
select * from xoo order by 1,2;
select a, decr(b) from xoo where a > 0... |
<filename>openGaussBase/testcase/KEYWORDS/result/Opengauss_Function_Keyword_Result_Case0019.sql
-- @testpoint:opengauss关键字result(非保留),作为外部数据源名
--关键字不带引号-成功
drop data source if exists result;
create data source result;
drop data source result;
--关键字带双引号-成功
drop data source if exists "result";
create data source "resu... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 25, 2017 at 02:12 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
<reponame>nurchulis/Puspidep
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Oct 10, 2018 at 12:58 PM
-- Server version: 5.7.23-log
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone =... |
PRAGMA foreign_keys = OFF;
BEGIN IMMEDIATE;
CREATE TABLE messages_temp (
id INTEGER PRIMARY KEY,
timestamp TEXT NOT NULL,
visitor_id INTEGER NOT NULL REFERENCES visitors,
message TEXT NOT NULL,
hidden INTEGER NOT NULL DEFAULT 0 CHECK (hidden BETWEEN 0 AND 1)
);
INSERT INTO messages_temp (id, timestamp, vis... |
<gh_stars>0
create or replace view varda_rap_varhaiskasvatussuhde as
select
(select organisaatio_oid from varda_toimipaikka where varda_toimipaikka.id = varda_varhaiskasvatussuhde.toimipaikka_id) as toimipaikka_oid
,varda_varhaiskasvatuspaatos.hakemus_pvm
,varda_varhaiskasvatussuhde.alkamis_pvm
,varda_varhaiskasvatussu... |
<gh_stars>0
insert into uf (uf, name, created_at, updated_at) values
('AC', 'Acre', now(), null),
('AL', 'Alagoas', now(), null),
('AP', 'Amapá', now(), null),
('AM', 'Amazonas', now(), null),
('BA', 'Bahia', now(), null),
('CE', 'Ceará', now(), null),
('DF', 'Distrito Federal', now(), null),
('ES', 'Espirito Santo', n... |
insert into marca (marca_id, clave, descripcion, activo) values (1, 'abarth', 'Abarth', 1);
insert into marca (marca_id, clave, descripcion, activo) values (2, 'alfa-romeo', '<NAME>', 1);
insert into marca (marca_id, clave, descripcion, activo) values (3, 'aro', 'Aro', 1);
insert into marca (marca_id, clave, descripcio... |
CREATE TABLE user (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
user_name varchar(255) NOT NULL,
password varchar(255) NOT NULL,
first_name varchar(255),
last_name varchar(255),
roles varchar(255)
)ENGINE=INNODB; |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 14, 2017 at 03:28 PM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE TABLE player (
id VARCHAR_IGNORECASE(36) not null,
first_name VARCHAR(255) not null,
last_name VARCHAR(255) not null,
position_name VARCHAR(255) not null,
injury_status VARCHAR(255),
disabled_from_drafting BOOLEAN not null,
salary DOUBLE not null,
team_id VARCHAR(255) not null,
next_game_id VAR... |
<reponame>Pamelapxaylink/postgresql-course<gh_stars>0
-- Do the following using the database movies:
-- show the customer's name and the total number of movies they've rented
SELECT cname, COUNT(*) from customers
JOIN rentals USING(cid)
GROUP BY cname;
SELECT cname, COUNT(rid) from customers
LEFT JOIN r... |
DROP TABLE IF EXISTS car;
DROP SEQUENCE IF EXISTS car_seq;
CREATE SEQUENCE car_seq START 1;
CREATE TABLE car (
id INT NOT NULL PRIMARY KEY DEFAULT nextval('car_seq'),
license_plate VARCHAR(20) NOT NULL,
manufacturer VARCHAR(20) NOT NULL,
manufacture_date DATE NOT NULL,
age ... |
DROP TABLE IF EXISTS weathers;
DROP TABLE IF EXISTS locations;
CREATE TABLE locations (
id SERIAL PRIMARY KEY,
search_query VARCHAR(255),
formatted_query VARCHAR(255),
latitude NUMERIC(8, 6),
longitude NUMERIC(9, 6)
);
CREATE TABLE weathers (
id SERIAL PRIMARY KEY,
f... |
create table if not exists doit ( task_id text not null primary key, task_data json )
|
INSERT INTO partnerServices
(partnerId, name, isActive, addedBy, modifiedBy)
VALUES
(?, ?, ?, ?, ?); |
-- file:timestamptz.sql ln:428 expect:true
SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow'
|
<reponame>NothinX/StockTradingSystem
USE [gp]
GO
/****** Object: StoredProcedure [dbo].[user_order] Script Date: 2017-11-03 16:27:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[user_order]
@user_id AS bigint
AS
BEGIN
-- routine body goes here, e.g.
-- SELECT 'Navicat for SQL... |
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 23 Bulan Mei 2020 pada 02.00
-- Versi server: 10.1.34-MariaDB
-- Versi PHP: 7.0.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<filename>scripts/sqlserver/migrate_5.sql
-- SQL Server database script
drop table extensioncodes;
create table extensioncodes (
nsort integer,
svalue nvarchar(40),
svalue_en nvarchar(40),
field_name nvarchar (30) NOT NULL ,
CONSTRAINT extensioncodesPK PRIMARY KEY (field_name,nsort)
);
alter table extensi... |
<reponame>jaywoong/learn_sql
/*
1. 입사 년도별 직원들의 연봉의 평균을 출력 하시오
단 연봉 평균이 3000이상인 정보만 출력 하시오
year, avg_salary
2. 부사별 입사 년도별 직원들의 연봉의 평균을 출력 하시오
*/
-- 1
SELECT DATE_FORMAT(hdate,'%Y') AS YEAR,
ROUND(AVG(salary),1) AS avg_salary
FROM emp
GROUP BY DATE_FORMAT(hdate,'%Y')
HAVING ROUND(AVG(salary),1) >= 3000
-- 2.
SELECT ... |
<gh_stars>0
select *
from {{ var('user_unsubscribed_channel_history') }}
|
<filename>sql/cargopartidario02.sql
INSERT INTO `cargopartidario` (dni,orgpolcargopartidario,cargopartidario,aniocargopartidesde,aniocargopartihasta) VALUES ('27990337','PARTIDO POLÍTICO FUERZA POPULAR' ,'AFILIADO','2014','ACTUALIDAD');
INSERT INTO `cargopartidario` (dni,orgpolcargopartidario,cargopartidario,aniocarg... |
-- SQL Dump of BOOK.MDB
-- generated by MDB Viewer 2.2.7
-- optimized for MySQL
SET NAMES 'UTF8';
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`用户名` VARCHAR(12) PRIMARY KEY,
`密码` VARCHAR(50),
`管理员设置管理` BOOLEAN,
`删除数据功能` BOOLEAN,
`图书资料管理` BOOLEAN,
`读者资料管理` BOOLEAN,
`期刊资料管理` BOOLE... |
<gh_stars>1-10
create or replace package body ut_test_execute
as
procedure execute_procedure(a_owner_name in varchar2
,a_package_name in varchar2
,a_procedure_name in varchar2)
as
obj_data user_objects%rowtype;
stmt varchar2(104);
execute_... |
create table smart_yield.controller_harvests
(
protocol_id text not null,
controller_address text not null,
caller_address text not null,
comp_reward_total numeric(78),
comp_reward_sold numeric(78),
underlying_pool_share numeric(78),
underlying_reward ... |
<gh_stars>10-100
ALTER TABLE exposure_window_test_result
ALTER COLUMN android_api_level TYPE BIGINT,
ALTER COLUMN android_enf_version TYPE BIGINT;
|
<reponame>Emiya0306/mdx-kylin
CREATE TABLE if not exists "calculate_measure" (
"id" serial4 ,
"dataset_id" int NOT NULL,
"name" varchar(300) NOT NULL,
"expression" varchar(5000) NOT NULL,
"format" varchar(150) NOT NULL,
"format_type" varchar(50) DEFAULT '',
"measure_folder" varchar(200... |
ALTER TABLE [tester].[table1]
DROP CONSTRAINT [PK_table1]
GO
DROP TABLE [tester].[table1]
GO
DROP SCHEMA [tester]
GO
CREATE SCHEMA [super]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE TABLE [super].[table1](
[c1] [int] NOT NULL,
[c2] [varchar](100) NULL
)
GO
ALTER TABLE [super].[table1]
ADD CONST... |
SELECT anyleast('abc'::text, 'ABC');
|
<gh_stars>0
INSERT INTO laravel_ecomerce.users (id, name, email, email_verified_at, password, remember_token, created_at, updated_at) VALUES (1, 'Tới', '<EMAIL>', null, '$2y$10$o/Xq69YOWnSx7L3M5ZwNWel/BFR1nvAkobsE5QMcKKh8x87/dvQfS', 'QDbwhXAcL5dION4hSnGHLB64motX5rVOlaLODPlE3WtTkEqhkPfr4STgw3WR', '2021-05-01 10:31:26', ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.