sql stringlengths 6 1.05M |
|---|
<gh_stars>1-10
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.7.17 : Database - karanotes
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_F... |
<reponame>WeBankPartners/wecube-plugins-kubernetes<filename>init.sql
SET FOREIGN_KEY_CHECKS = 0;
CREATE TABLE `cluster` (
`id` varchar(255) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`correlation_id` varchar(36) DEFAULT NULL,
`api_server` varchar(255) NOT NULL,
`token` varchar(2048) NOT NULL,
`metri... |
<reponame>bastille/ariel
-- Copyright 2019, Oath Inc.
-- Licensed under the terms of the Apache License, Version 2.0. See LICENSE file for terms.
SET client_min_messages TO warning;
CREATE TABLE reserved_instances_recommendations
(
"Account ID" character(12) NOT NULL,
"Scope" ... |
--
-- PORTALS_P2
--
-- POLAR_TAG: EQUAL
BEGIN;
DECLARE foo13 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 50;
DECLARE foo14 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 51;
DECLARE foo15 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 52;
DECLARE foo16 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 53;
... |
CREATE TABLE post ( id INTEGER PRIMARY KEY AUTOINCREMENT, title varchar(100) NOT NULL, content TEXT NOT NULL);
insert into post(title, content) values('Post 1', 'Content 1');
insert into post(title, content) values('Post 2', 'Content 2');
insert into post(title, content) values('Post 3', 'Content 3');
insert into p... |
<reponame>syberside/CMS<filename>Kooboo.CMS/Publish/SiteProviders/EntityFramework/4.3-4.4.sql
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_R... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint:opengauss关键字current(非保留),作为用户组名
--关键字不带引号-成功
drop group if exists current;
create group current with password '<PASSWORD>';
drop group current;
--关键字带双引号-成功
drop group if exists "current";
create group "current" with password '<PASSWORD>';
drop group "current"... |
<gh_stars>100-1000
begin; DECLARE mycursor CURSOR FOR SELECT * FROM a order by i; FETCH FORWARD 2 FROM mycursor; commit;
|
-- DROP TABLE IF EXISTS meta_cols ;
SELECT 'create the "meta_cols" table'
;
CREATE TABLE meta_cols (
guid UUID NOT NULL DEFAULT gen_random_uuid()
, id bigint UNIQUE NOT NULL DEFAULT cast (to_char(current_timestamp, 'YYMMDDHH12MISS') as bigint)
, table_name varchar... |
<filename>data.sql
/*
SQLyog Professional v12.4.3 (64 bit)
MySQL - 10.1.33-MariaDB : Database - pos
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_F... |
<reponame>Pauliceia/ws<gh_stars>0
/*
function get_first_projcs_from_prj_in_wkt
*/
DROP FUNCTION IF EXISTS get_first_projcs_from_prj_in_wkt(prj_wkt TEXT);
CREATE or REPLACE FUNCTION get_first_projcs_from_prj_in_wkt(prj_wkt TEXT)
RETURNS TEXT AS $$
DECLARE
position_first_quote INT;
position_next_quote INT;
prj TEX... |
IF OBJECT_ID ( 'upd_emp_salary', 'P' ) IS NOT NULL
DROP PROCEDURE upd_emp_salary;
GO
CREATE PROCEDURE upd_emp_salary (
@salary decimal(10,2),
@empno decimal(4)
) AS
BEGIN
UPDATE employee SET salary = @salary WHERE empno = @empno
END
GO
|
-- http://geo.stat.fi/geoserver/tilastointialueet/ows?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=tilastointialueet:avi4500k
INSERT INTO oskari_maplayer(type, url,
name, groupId,
locale,
attributes, opacity, srs_name, version)
VALUES(
's... |
<reponame>addempsea/music-api
/* Replace with your SQL commands */
CREATE TABLE songs (
id uuid PRIMARY KEY,
title VARCHAR(500) NOT NULL,
artist VARCHAR(500) NOT NULL,
album VARCHAR(500),
album_year VARCHAR(50) ,
album_art VARCHAR(5000) ,
song_file_name VARCHAR(5000) NOT NULL,
song_id ... |
<filename>php101/c11/CreateTableUser.sql
CREATE TABLE `inest_stg_db`.`authorized_users` (
`Id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(50) NOT NULL,
`password` VARCHAR(50) NOT NULL,
PRIMARY KEY (`Id`)); |
DELETE FROM dept
WHERE DCODIGO in (
SELECT * FROM (SELECT DCODIGO FROM dept
INNER JOIN empr on dept.DCODIGO = empr.DEPT
GROUP BY DCODIGO
having count(DCODIGO) < 4
) AS t
); |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Erstellungszeit: 11. Apr 2020 um 20:48
-- Server-Version: 10.1.43-MariaDB-0ubuntu0.18.04.1
-- PHP-Version: 7.2.24-0ubuntu0.18.04.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @O... |
<filename>mortgage_imports/sql/unified/serv_map_ct.sql
CREATE TABLE unified.serv_map
(
serv_name LowCardinality(String),
serv_mapped LowCardinality(String),
pp_group LowCardinality(FixedString(6)),
pp_rate Float32,
nloans ... |
CREATE DATABASE /*!32312 IF NOT EXISTS*/`jantent` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `jantent`;
/*Table structure for table `student` */
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
`id` char(5) DEFAULT NULL,
`name` char(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*Data for the ta... |
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 07, 2013 at 04:28 PM
-- Server version: 5.5.27
-- PHP Version: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... |
INSERT INTO `user` (`id`, `role`, `username`, `password`, `firstName`, `lastName`, `phoneNumber`, `email`, `address`, `photoUrl`, `banned`) VALUES (1, 'ADMIN', 'admin', 'admin', 'Luka', 'Maletin', '063123456', '<EMAIL>', '<NAME>', ' /images/user_thumb.png', false);
INSERT INTO `language` (`id`, `languageName`) VALUES (... |
<gh_stars>1-10
CREATE TABLE todoes_regulartask_file (
id integer NOT NULL,
regulartask_id integer NOT NULL,
file_id integer NOT NULL
);
ALTER TABLE public.todoes_regulartask_file OWNER TO puser;
CREATE SEQUENCE todoes_regulartask_file_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXV... |
drop table if exists CIF_CLIENT_VERIFICATION;
/*==============================================================*/
/* Table: CIF_CLIENT_VERIFICATION */
/*==============================================================*/
create table CIF_CLIENT_VERIFICATION
(
CLIENT_NO varchar(... |
<gh_stars>1-10
with pools as (
select c."poolId" as pool_id, unnest(cc.tokens) as token_address, unnest(cc.weights)/1e18 as normalized_weight, cc.symbol, 'WP' as pool_type
from balancer_v2."Vault_evt_PoolRegistered" c
inner join balancer_v2."WeightedPoolFactory_call_create" cc
on c.evt_tx_hash = cc.call... |
-- randexpr1.test
--
-- db eval {SELECT case when 19=13 or 13+a & 19*11+b<>b and ((19<=b+(select count(*) from t1))) then t1.d when t1.e<= -19 then d-t1.e+(select ~max(19)*+(count(distinct b)) from t1)+t1.d*t1.d+f else t1.c end FROM t1 WHERE (13*case when 19*case when 19 not between 17 and t1.e then t1.e when ((case w... |
CREATE TABLE badges (
badge_id TEXT NOT NULL,
badge_name TEXT NOT NULL,
owner_id TEXT NOT NULL,
file_name TEXT NOT NULL,
create_date INTEGER NOT NULL,
PRIMARY KEY (badge_id)
) WITHOUT ROWID;
CREATE TABLE user_badges (
user TEXT NOT NULL,
badge TEXT NOT NULL,
priority INTEGER NOT NULL,
is_hidden TINYINT(1) NO... |
<reponame>carehart/dba-dash
CREATE PARTITION SCHEME [PS_SlowQueries]
AS PARTITION [PF_SlowQueries]
ALL TO ([PRIMARY]);
|
<reponame>xaiguy/abstractions
CREATE OR REPLACE FUNCTION uniswap_v3.insert_uniswap_v3_poolcreated(start_ts timestamptz, end_ts timestamptz=now(), start_block numeric=0, end_block numeric=9e18) RETURNS integer
LANGUAGE plpgsql AS $function$
DECLARE r integer;
BEGIN
WITH rows AS (
INSERT INTO uniswap_v3.view_pools(
... |
<reponame>adbertram/pipelines-dotnet-core
IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = N'AppDb')
BEGIN
CREATE DATABASE [AppDb]
END
|
<gh_stars>0
CREATE DATABASE IF NOT EXISTS `dev.schedule`
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci;
USE `dev.schedule`;
DELIMITER $$
DROP PROCEDURE IF EXISTS `user_login`$$
CREATE DEFINER =`root`@`localhost` PROCEDURE `user_login`(IN `__username` VARCHAR(255), IN `__password` VARCHAR(255),
... |
<filename>inst/sql/sql_server/1893.sql
CREATE TABLE #Codesets (
codeset_id int NOT NULL,
concept_id bigint NOT NULL
)
;
INSERT INTO #Codesets (codeset_id, concept_id)
SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEP... |
<reponame>getnacelle/ultraviolet
-- AlterTable
ALTER TABLE "VariantContent" ADD COLUMN "published" BOOLEAN NOT NULL DEFAULT false;
|
<reponame>SAP-samples/hana-apl-apis-runtimes
-- ================================================================
-- APL_AREA, EXPORT_APPLY_CODE_FOR_RECO, using a native format for the model
--
-- Assumption 1: the users & privileges have been created & granted (see apl_admin_ex.sql).
-- Assumption 2: There's a valid an... |
/* File generated automatically by dynamo */
/* The tag definition. */
CREATE TABLE awa_tag (
/* the tag identifier */
"id" BIGINT NOT NULL,
/* the tag name */
"name" VARCHAR(255) NOT NULL,
PRIMARY KEY ("id")
);
/* */
CREATE TABLE awa_tagged_entity (
/* the tag entity identifier */
"id" BIGINT NOT NULL,
... |
<reponame>WarSame/spark_ci<filename>src/test/resources/source_queries/main.dates.sql<gh_stars>0
--main.dates
SELECT date_time, animal_type, colour
FROM main.dates
LIMIT 1000 |
IF OBJECT_ID('account.is_valid_client_token') IS NOT NULL
DROP FUNCTION account.is_valid_client_token;
GO
CREATE FUNCTION account.is_valid_client_token(@client_token national character varying(MAX), @ip_address national character varying(500), @user_agent national character varying(500))
RETURNS bit
AS
BEGIN
DECL... |
WITH ss AS (
SELECT
i_item_id,
sum(ss_ext_sales_price) total_sales
FROM
store_sales, date_dim, customer_address, item
WHERE
i_item_id IN (SELECT i_item_id
FROM item
WHERE i_color IN ('slate', 'blanched', 'burnished'))
AND ss_item_sk = i_item_sk
AND ss_sold_date_sk = d_date_sk
... |
<reponame>jungleworks/fugu-server
ALTER TABLE `user_invitations` CHANGE `email` `email` VARCHAR(80) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
// add column
ALTER TABLE `user_invitations` ADD `contact_number` VARCHAR(255) NULL DEFAULT NULL AFTER `email`;
ALTER TABLE `password_reset_request` ADD ... |
<filename>test/sql/syntax-complex_query.sql
SELECT assert(count(*), 38705, 'syntax-complex_query') FROM so_posts WHERE so_posts ==> 'id:1 /to/ 100 or beer or java and not (one w/3 two) or foop~ and "you have a class" or #expand<parent_id=<this.index>parent_id>(java)';
|
-- @testpoint:创建用户组,指定RESOURCE POOL
--通过系统表pg_resource_pool,查询resource pool名称
select respool_name from pg_resource_pool;
--创建用户组,指定RESOURCE POOL
drop group if exists test_group9;
create group test_group9 with RESOURCE POOL 'default_pool' PASSWORD '<PASSWORD>';
--查看用户所能够使用的resource pool
select rolname,rolrespool from p... |
<filename>Databases Basics - MS SQL Server/Basic CRUD/CreateViewWithCondition.sql
CREATE VIEW V_EmployeeNameJobTitle AS
SELECT FirstName + ' ' + CASE WHEN MiddleName IS NULL THEN '' ELSE MiddleName END + ' ' + LastName
AS [Full Name], JobTitle
FROM Employees
|
-- Скалярная функция: возвращает среднюю популяцию.
create or replace function AveragePopulation() returns int as
'select avg(population) from countries;'
language sql;
select AveragePopulation() as avg_ppl;
-- Табличная функция: возвращает спортсмена по id
create or replace function GetSportsman(s_id int = ... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 12 Jan 2018 pada 01.36
-- Versi Server: 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 @OLD_CH... |
--
-- Updates an existing movie.
--
-- PARAMS:
-- id - The ID of the existing movie.
-- name - The name of the movie. Must be unique and cannot be empty.
-- releaseYear - The release year. If specified must be >= 0.
-- runLength - The run length. If specified must be >= 0.
-- description - Specifies the... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 30, 2020 at 04:58 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<reponame>wbprice/rust-zero-to-prod
-- wrap the whole migration in a transaction
BEGIN;
UPDATE subscriptions
SET status = 'confirmed'
WHERE status IS NULL;
ALTER TABLE subscriptions ALTER COLUMN status SET NOT NULL;
COMMIT;
|
<reponame>ucdavis/AD419<gh_stars>0
CREATE VIEW [dbo].[APTDIS_V_20101026]
AS
SELECT EmployeeID, FullName, UCDMailID, HomeDepartment, HireDate, OriginalHireDate, EmployeeStatus, TitleCode, AlternateDepartment, AdministrativeDepartment,
WorkDepartment, SchoolDivision, RepresentedCode, WOS... |
INSERT INTO `chii_members` (`uid`,
`username`,
`nickname`,
`avatar`,
`groupid`,
`regdate`,
`lastvisit`,
`lastactivity`,
... |
<gh_stars>1-10
-- Should run this script before running DatabaseManager
SET SQL_SAFE_UPDATES = 0;
UPDATE `StockDatabase`.`4update` SET `lastUpdate` = (SELECT MAX(Date) FROM `StockDatabase`.`^BSESN`), `updateStatus` = 0 WHERE Symbol = '^BSESN';
UPDATE `StockDatabase`.`4update` SET `lastUpdate` = (SELECT MAX(Date) FROM `... |
<reponame>nbenn/mimic-code
-------------------------------------------------------------------------------------
--Title: generates a row for every hospital admission per patient to describe the counts of their clinical notes.
--The statement was created for postgresql and it utilizes a function called crosstab from th... |
--
-- CzechIdM 10 Flyway script
-- BCV solutions s.r.o.
--
-- role type - start usage + cleanup obsolete role types
ALTER TABLE idm_role ALTER COLUMN role_type nvarchar(255) NULL;
UPDATE idm_role SET role_type = null WHERE role_type = 'BUSINESS';
UPDATE idm_role SET role_type = null WHERE role_type = 'TECHNICAL';
UPD... |
insert into employee values (nextval ('hibernate_sequence'),'1998-02-13 05:30:00','Tech','Rohit');
insert into employee values (nextval ('hibernate_sequence'),'1998-02-13 05:30:00','Mgmt','Rahul');
insert into employee values (nextval ('hibernate_sequence'),'1998-02-13 05:30:00','Support','Puneet'); |
<reponame>korbanperasaan/HelloWorld<filename>Postgresql/HelloWorld.sql
SELECT 'Hello World !' ; |
-- pragma.test
--
-- execsql {
-- PRAGMA synchronous=ON;
-- PRAGMA cache_size;
-- PRAGMA default_cache_size;
-- PRAGMA synchronous;
-- }
PRAGMA synchronous=ON;
PRAGMA cache_size;
PRAGMA default_cache_size;
PRAGMA synchronous; |
<gh_stars>10-100
-- file:rules.sql ln:270 expect:true
select * from rtest_interface
|
<reponame>Shuttl-Tech/antlr_psql
-- file:create_am.sql ln:62 expect:true
SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL
|
DROP TABLE IF EXISTS ccs_dx;
CREATE TABLE ccs_dx
(
icd9_code CHAR(5) NOT NULL,
-- we will populate ccs_mid and ccs_name with the most granular ID/name later
ccs_matched_id VARCHAR(10),
ccs_matched_name VARCHAR(100),
ccs_id INTEGER,
ccs_name VARCHAR(100),
-- CCS levels and names based on position in hierar... |
<filename>custom/Script_OracleBase/Real Application Clusters (RAC)/session_waits_rac.sql<gh_stars>0
-- -----------------------------------------------------------------------------------
-- File Name : http://www.oracle-base.com/dba/10g/session_waits_rac.sql
-- Author : <NAME>
-- Description : Displays inform... |
<gh_stars>1-10
/*
Navicat Premium Data Transfer
Source Server : wampMysql
Source Server Type : MySQL
Source Server Version : 50714
Source Host : localhost:3306
Source Schema : chatroom
Target Server Type : MySQL
Target Server Version : 50714
File Encoding : 65001
Dat... |
SELECT * FROM employee e where 1=1
<#include "EmployeeDao_condition.sql">
ORDER BY create_date
|
<filename>etl/patients/create_detailed_patients.sql
WITH patients AS
(
-- https://mimic.physionet.org/tutorials/intro-to-mimic-iii/#5-patient-age-and-mortality
SELECT st0.subject_id
, st0.gender
, ROUND( ( CAST( st1.first_admittime AS date) - CAST(st0.dob AS date)) / 365.242,2) AS first_ad... |
<filename>maint/createSBS_to_Constituents.sql
create table SBS_to_Constituents
(prim_key INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
sbs_fk INT UNSIGNED NOT NULL
COMMENT 'refers to row in FSW_inputs',
Constituents_fk INT UNSIGNED NOT NULL
COMMENT 'refers to row in Constituents',
status... |
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
ALTER TABLE AR_GENE_TITLE_TMP
DROP PRIMARY KEY CASCADE
/
DROP TABLE AR_GENE_TITLE_TMP CASCADE CONSTRAINTS PURGE
/
--
-- AR_GENE_TITLE_TMP (Table)
--
CREATE TABLE AR_GE... |
--+ holdcas on;
set system parameters 'dont_reuse_heap_file=yes';
create table a (i int auto_increment);
insert into a (i) values(NULL);
insert into a (i) select NULL from a;
insert into a (i) select NULL from a;
insert into a (i) select NULL from a;
insert into a (i) select NULL from a;
insert into a (i) select NULL ... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 12-01-2017 a las 18:44:38
-- Versión del servidor: 5.7.10-log
-- Versión de PHP: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... |
--database
drop database safelocality;
create database safelocality;
use safelocality;
--User table
CREATE TABLE `User` (
`UserId` BIGINT NULL AUTO_INCREMENT,
`UserName` VARCHAR(255) NULL,
`FirstName` VARCHAR(255) NULL,
`LastName` VARCHAR(255) NULL,
`Useremail` VARCHAR(255) NULL,
`UserPassword` VARCHAR(255) NULL... |
<reponame>keipham/Shopping_website<gh_stars>0
CREATE OR REPLACE FORCE VIEW "SOK_PRODUCT_DETAIL_LIST_VW"
AS
SELECT a.product_id,
a.product_name,
b.product_detail_id,
d.sex_code,
d.sex_name,
c.size_range_code,
c.size_lower_value,
c.size_higher_value... |
drop table if EXISTS favorite;
DROP TABLE if EXISTS subscribe;
DROP TABLE if EXISTS messages;
create table favorite (
id serial PRIMARY KEY,
type VARCHAR(20),
location_id VARCHAR(200),
name VARCHAR(500),
description text,
num_reviews VARCHAR(200),
rating DEC,
price_level VARCHAR(100),
... |
alter table users add column email_for_update varchar(100);
alter table users add column update_email_code text;
alter table users add column update_email_code_expired_at timestamp;
create index index_users_update_email_code on users (update_email_code);
|
select cast(el.TimeGenerated as smalldatetime) as TimeGenerated,
el.UserName, el.EventID, el.EntryType, el.Source
,el.Message
from tempdb..event_logs_ajay as el
where ((Source = 'Microsoft-Windows-FailoverClustering')
or (Source = 'Service Control Manager' and (Message like '%stop%' or Message like '%running%') )... |
<reponame>KarmaScripter/BudgetX
INSERT INTO RegionalTransfers
SELECT Transfers.BFY AS BFY, Transfers.RpioCode AS RPIO, Transfers.AhCode AS AhCode, Transfers.AhName AS AhName, Transfers.FundCode AS FundCode, Transfers.FundName AS FundName, Transfers.OrgCode AS OrgCode, Transfers.OrganizationName AS OrganizationName, Tra... |
/**用户信息**/
CREATE TABLE xz_user(
uid INT PRIMARY KEY AUTO_INCREMENT,
uname VARCHAR(32),
upwd VARCHAR(32),
email VARCHAR(64),
phone VARCHAR(16),
avatar VARCHAR(128), #头像图片路径
user_name VARCHAR(32) #用户名,如王小明
);
-- 首页
CREATE TABLE xz_shouye_one(
oid INT PRIMARY KEY AUTO_INCREMENT,
title VARCHA... |
-- phpMyAdmin SQL Dump
-- version 2.8.0.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 19, 2006 at 11:38 PM
-- Server version: 5.0.21
-- PHP Version: 5.1.4
--
-- Database: `cpsc_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `tbl_fe... |
CREATE TABLE [dbo].[EventLog] (
[Id] INT NOT NULL,
[EventDate] DATETIME CONSTRAINT [DF_AuditLog_LogDateTime] DEFAULT (getdate()) NOT NULL,
[Content] NTEXT COLLATE Latin1_General_CI_AS CONSTRAINT [DF_AuditLog_Content] DEFAULT ('') NOT NULL,
[UserId] INT C... |
INSERT INTO eg_appconfig ( ID, KEY_NAME, DESCRIPTION, VERSION, MODULE ) VALUES (nextval('SEQ_EG_APPCONFIG'), 'BPA_WORKFLOW_EMPLOYEE_BOUNDARY_HIERARCHY', 'The boundary hierarchy for work to be used to get employee',0, (select id from eg_module where name='BPA'));
Insert into eg_appconfig_values ( ID, KEY_ID, EFFECTIVE_... |
<reponame>mlizbeth/Kace-Queries<gh_stars>1-10
SELECT DISTINCT
DATE_FORMAT(LAST_INVENTORY, '%m/%d/%Y') as LAST_INVENTORY,
BIOS_SERIAL_NUMBER AS SERIAL_NUMBER,
OS_NAME AS OPERATING_SYSTEM,
MACHINE.NAME AS COMPUTER_NAME,
CS_MODEL AS COMPUTER_MODEL,
ASSET_DATA_5.FIELD_34 AS REPLACEMENT_DATE,
ASSET_DATA_5.FIEL... |
-- Подробная информация здесь:
-- https://sqlundercover.com/2019/02/19/7-more-ways-to-query-always-on-availability-groups/
SELECT
Groups.name,
COUNT([AGDatabases].[database_name]) AS DatabasesInAG
FROM master.sys.availability_groups Groups
INNER JOIN Sys.availability_databases_cluster AGDatabases ON Groups... |
<filename>query_sql/exer_dossie/Tudo.sql
create table tmp_dossie_qa (
id_dossie numeric (20,0),
cod_user numeric (20,0),
id_status_analise numeric (20,0),
score numeric (29,16),
dt_dossie date not null,
dt_inicio_analise date,
dt_fim_analise date
);
--Exercicio 02. 10% dos que tem status 5
insert into tmp_dossi... |
<reponame>dram/metasfresh
--DROP VIEW IF EXISTS rv_fresh_pricelist
--DROP VIEW IF EXISTS RV_fresh_PriceList_Comparison;
CREATE OR REPLACE VIEW RV_fresh_PriceList_Comparison AS
SELECT
pp.AD_Org_ID, pp.AD_Client_ID,
pp.Created, pp.CreatedBy,
pp.Updated, pp.UpdatedBy,
pp.IsActive,
-- Displayed pricelist data... |
<reponame>designerfx/Public_Code<filename>SWQL/NCM Unlicensed Nodes.sql
--Query to filter NCM unlicensed nodes based on vendor criteria
SELECT CN.OrionNode.Vendor
, CN.OrionNode.Caption --node name from OrionNode table
--commented , CN.OrionNode.CustomProperties.Region
--remove the "--commented" part to filter by a cu... |
CREATE VIEW [LIQUIBASEB].[PERSON_VIEW]
AS
SELECT *
FROM person
GO |
<filename>EMR/usr/share/nginx/html/contrib/forms/strength_conditioning/table.sql
# id is the form ID. Negative form IDs are used for the templates.
# (rownbr, colnbr) start at (0, 0) for cell data. (-1, -1) is used for the
# template name.
#
# datatype is one of:
# 0 = unused cell
# 1 = static text
# 2 = checkbox
# 3 ... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Apr 29, 2021 at 05:24 PM
-- Server version: 5.7.31
-- PHP Version: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
ALTER TABLE public.antenna ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.body ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.decal ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.topper ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.wheel ALTER COLUMN id DROP DEFAULT;
DROP SEQUENCE public.antenna_id_seq;
DROP ... |
<reponame>DavidGrath/spring-cloud-task
CREATE TABLE TASK_EXECUTION (
TASK_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY ,
START_TIME TIMESTAMP DEFAULT NULL ,
END_TIME TIMESTAMP DEFAULT NULL ,
TASK_NAME VARCHAR(100) ,
EXIT_CODE INTEGER ,
EXIT_MESSAGE VARCHAR(2500) ,
ERROR_MESSAGE VARCHAR(2500) ,
LAST_UPDATED TIMES... |
<gh_stars>10-100
CREATE USER [test_user] FOR LOGIN [test_user] WITH DEFAULT_SCHEMA=[dbo]
GO
CREATE USER [test_user2] FOR LOGIN [test_user2]
GO
CREATE USER [test_user3] FOR LOGIN [test_user3] WITH DEFAULT_SCHEMA=[test]
GO |
SELECT
item.title, category.name
FROM
item
INNER JOIN `category-item` ON item.id = `category-item`.item_id
INNER JOIN category ON `category-item`.category_id = category.id
WHERE category.id IN(
SELECT
id
FROM category
WHERE
l >= (SELECT l FROM category WHERE id = 22)
AND
r <= (SELECT r FROM category WHERE ... |
drop table if exists t1;
drop view if exists v1;
create table t1 ( a int , b int);
insert into t1 values (1, 2);
create view v1 as select * from t1 order by b;
insert into v1 select a+1, b+1 from v1 order by b limit 1;
insert into v1 select a, b from v1 order by b ASC limit 1;
insert into v1 select a+b, b-a from v1 ... |
--+ holdcas on;
set system parameters 'dont_reuse_heap_file=yes';
create table t1( a char(1200), b varchar(1200), c nchar(1200), d NCHAR VARYING(1200), e BIT(1200), f BIT VARYING(1200), g int primary key, h SMALLINT, i BIGINT, j NUMERIC, k FLOAT, l DOUBLE, m MONETARY, n DATE, o TIME, p TIMESTAMP, q ... |
WITH
-- 2020/05/15 - Written by <NAME>
-- Version: 3.0.0
-- Moderate revision change, 3.0.0 cleaned up code
asset_metadata AS (
SELECT fa.asset_id
,da.ip_address
-- UPPER wraps the Regex and formats as uppercase
... |
<filename>db/searches.sql
USE employeeDB;
-- SELECT first_name, last_name FROM employee;
-- SELECT first_name, last_name, role.id, title FROM employee LEFT JOIN role ON (employee.role_id = role.id) ORDER BY role.id DESC;
SELECT first_name, last_name, role_id, role.id, department_id, department.id, department.name
FRO... |
SELECT Department.DepartmentName, Employee.Name
FROM Employee, Department
WHERE Employee.DepartmentID = Department.DepartmentID
ORDER BY Department.DepartmentID; |
CREATE DATABASE `tienda` ;
|
use webBaoLong;
show tables;
select * from personal_access_tokens;
select * from customer_orders_admin;
select * from news_post;
select * from news_post_categories;
select * from images;
select * from products;
select * from products_categories;
select * from users;
select * from pages_of_web;
select * from... |
create table ToDoItems (
id int Identity(1,1),
label varchar(256),
completed bit DEFAULT 0
); |
<gh_stars>0
CREATE DATABASE IF NOT EXISTS haidock;
USE haidock;
CREATE TABLE Persons (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
); |
-- problems 1 to 10
--Problem 1 Multiples of 3 and 5
--If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
--Find the sum of all the multiples of 3 or 5 below 1000.
SELECT SUM(number)
FROM numbers
WHERE number < 1000 AND (number % 3 = 0 OR ... |
DROP TABLE IF EXISTS "Users";
CREATE TABLE "Users" (
"Id" SERIAL PRIMARY KEY,
email TEXT,
phone TEXT,
token TEXT,
attempts INT,
created_on DATE,
updated_at TIMESTAMP,
ip TEXT,
name TEXT,
nonsense TEXT,
untouchable TEXT,
"column_with_punctuation?" BOOLEAN
);
DROP TABLE IF EXISTS posts CASCADE;
C... |
DO
$do$
BEGIN
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname='spleis-avstemming') THEN
GRANT SELECT ON ALL TABLES IN SCHEMA public TO "spleis-avstemming";
END IF;
END
$do$
|
<reponame>matigo/streams<gh_stars>1-10
INSERT INTO `AccountMeta` (`account_id`, `type`, `value`)
SELECT a.`id` as `account_id`, CONCAT('password.request-', UNIX_TIMESTAMP(Now())) as `type`, 'N' as `value`
FROM `Account` a
WHERE a.`is_deleted` = 'N'
and 'Y' = CASE WHEN a.`login` = '[ACCOUNT_FILTER]' THEN 'Y'
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.