sql stringlengths 6 1.05M |
|---|
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"name" TEXT,
"email" TEXT NOT NULL,
"hashedPassword" TEXT,
"role" TEXT NOT NULL DEFAULT 'user',
PRIMARY KEY (id)
);
-- CreateTable
CREATE TAB... |
<reponame>biberltd/AccessManagementBundle<filename>SQL/MySQL/database-structure.sql<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50505
Source Host : localhost:3306
Source Database : bod_core
Target Server Type : MYSQL
Target Server Version : 50... |
-- +micrate Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE dtopics (
id bigserial primary key,
cvuser_id bigint not null default 0,
dboard_id bigint not null default 0,
label_ids int[] not null default '{}',
title text not null default '',
uslug text not null default ''... |
<gh_stars>1-10
-- 601. Human Traffic of Stadium
-- mysql
-- consecutive 按题意指的是id序号的连续性
select x.* from
(
select a.* from
(select s.* from stadium s where s.people>=100) a,
(
select s.* from stadium s where s.people>=100
and exists(select 1 from stadium t2 where t2.people>=100 and t2.id=s.id-1)
and exists(select 1... |
<reponame>open-discourse/open-discourse
CREATE TABLE open_discourse.factions (
id int8 NOT NULL,
abbreviation varchar NOT NULL,
full_name varchar NOT NULL,
CONSTRAINT factions_pk PRIMARY KEY (id)
);
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE open_discourse.factions TO visitor;
|
<filename>migrations/1_init.down.sql
BEGIN;
DROP TABLE employees;
DROP TABLE positions;
DROP TABLE departments;
COMMIT; |
<gh_stars>1-10
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssueUserCountByProject]
@ProjectId int
AS
SELECT
AssignedName,
Number,
AssignedUserId,
AssignedImageUrl
FROM BugNet_IssueAssignedToCountView
WHERE ProjectId = @ProjectId
ORDER BY SortOrder, AssignedName
|
-- File generated by Mangos Online Translation Editor (MOTE) v2.10
SET NAMES 'utf8';
UPDATE `trans_words` SET `content_loc9`='The deeds are mine, brother! Soon you shall be out of my way for good!' WHERE `word_id` = 6935; -- db_script_string - content : entry=2000000001
UPDATE `trans_words` SET `content_loc9`='Honor yo... |
<reponame>forki/Sproc.Lock<filename>Database/up/2. Create tbl_organisation_locks.sql
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_organisation_locks](
[LockId] [char](44) NOT NULL,
[Organisation] [char](44) NOT NULL,
[Description] [nvarchar](4000) NOT NULL,
[Stale] [datetime] NOT NULL,... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50625
Source Host : localhost:3306
Source Database : dot
Target Server Type : MYSQL
Target Server Version : 50625
File Encoding : 65001
Date: 2016-01-22 16:06:37
*/
SET FOREIGN_KEY_CHECKS=0;
-- -----... |
<gh_stars>0
CREATE FUNCTION open_for_users_open(_username text)
RETURNS void AS $$
BEGIN
UPDATE meta SET opens = opens + 1
WHERE id = (
SELECT meta_id
FROM users
WHERE username = _username
);
END;
$$ LANGUAGE plpgsql;
|
CREATE OR REPLACE FUNCTION web_page_template_delete_fn() RETURNS TRIGGER AS
$$BEGIN
INSERT INTO web_page_template_history (
name,
content,
create_date,
modify_date,
publish_date,
web_site_id,
web_page_template_id
)
SELECT
name,
content,
now(),
modify_date,
publish_d... |
<filename>evaluator.cli/src/test/resources/qicore/TJCOverall_QICore4-5.0.000.cql<gh_stars>0
library TJCOverall_QICore4 version '5.0.000'
/*
@update: @@BTR 2020-03-31 ->
Incremented version to 5.0.000
Updated FHIR version to 4.0.1
@@
*/
using QICore version '4.1.1'
include FHIRHelpers version '4.0.1'
include MATGlob... |
<gh_stars>1-10
begin transaction;
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;
-- TOC entry 2424 (class 2606 OID 274473)
-- Name: act_ge_bytearray_pkey; Type: CONSTRAINT; Sch... |
--+ holdcas on;
set system parameters 'dont_reuse_heap_file=yes';
create table tb(a double,b char(1), c varchar(1), d date);
create index i_tb_a on tb(log10(a));
insert into tb values (1,'Y', 'Monday', DATE('2010-10-27'));
insert into tb values (2,'N', 'Friday', DATE('2010-10-28'));
insert into tb values (3,'Y', 'Mond... |
insert into public.bedes_term
(name, description, term_category_id, data_type_id, unit_id, definition_source_id)
values
(${_name}, ${_description}, ${_termTypeId}, ${_dataTypeId}, ${_unitId}, ${_definitionSourceId})
returning
id as "_id",
name as "_name",
description as "_description",
term_cate... |
/*
* <NAME>
*
*/
\COPY Countries FROM 'C:\Users\Joey\Documents\Database\HW6\countries.csv' CSV HEADER;
\COPY City FROM 'C:\Users\Joey\Documents\Database\HW6\city.csv' CSV HEADER;
\COPY Airline FROM 'C:\Users\Joey\Documents\Database\HW6\airline.csv' CSV HEADER;
\COPY Routes FROM 'C:\Users\Joey\Documents\Database\HW6... |
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Ven 16 Janvier 2015 à 12:07
-- Version du serveur: 5.5.41
-- Version de PHP: 5.6.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT *... |
CREATE VIEW users_has_access_surveys AS
SELECT DISTINCT users_has_areas.user_id, surveys_has_roles.survey_id
FROM users
join users_has_areas on
users_has_areas.user_id = users.id
join users_has_roles on
users_has_roles.user_id = users.id
join surveys_has_areas on
surveys_has_areas.area_id = users_has_are... |
<filename>database/2017_taniya.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 15 Des 2019 pada 15.30
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET t... |
<filename>Vulcan.Core.Auth.Database/StoredProcedures/auth_GroupUsers_DeleteByGroupId.sql
CREATE PROCEDURE [auth].[auth_GroupUsers_DeleteByGroupId]
@groupid INT
AS
DELETE [GroupUsers]
WHERE [GroupId] = @groupid
GO
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 13, 2021 at 02:29 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
--SELECT * FROM dba_tablespaces ORDER BY 1;
--
-- TABLE OWNER
--
CREATE USER pmp
IDENTIFIED BY "<PASSWORD>"
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
QUOTA UNLIMITED ON data;
--
GRANT CREATE SESSION TO pmp;
GRANT ALTER SESSION TO pmp;
GRANT CREATE TABLE ... |
CREATE SCHEMA collhbrs;
--
-- Name: col_seq_address_id; Type: SEQUENCE; Schema: collhbrs; Owner: houde2s
--
CREATE SEQUENCE collhbrs.col_seq_address_id
START WITH 10000000
INCREMENT BY 1
MINVALUE 10000000
MAXVALUE 19999999
CACHE 1;
--
-- Name: col_seq_advertisement_id; Type: SEQUENCE; Schema: coll... |
<reponame>KikiAbdullah/sistem-paduan-suara
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 27, 2021 at 04:23 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.3.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:... |
BEGIN;
CREATE SCHEMA microcontrole;
CREATE TABLE microcontrole.tipo_operacao(
code SMALLINT NOT NULL PRIMARY KEY,
nome VARCHAR(255) NOT NULL
);
INSERT INTO microcontrole.tipo_operacao (code, nome) VALUES
(1, 'INSERT'),
(2, 'DELETE'),
(3, 'UPDATE');
CREATE TABLE microcontrole.monitoramento_feicao(
id SERIAL NOT ... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 12-Ago-2021 às 16:11
-- Versão do servidor: 10.4.19-MariaDB
-- versão do PHP: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
-- Listing 9.1 Amount of space (total, used, and free) in tempdb
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SET NOCOUNT ON
SELECT SUM(user_object_reserved_page_count + internal_object_reserved_page_count + version_store_reserved_page_count + mixed_extent_page_count
+ unallocated_extent_page_count) * ... |
<gh_stars>1-10
-- Creates a spatially explicit table of sale prices adjusted to 2010 dollars
CREATE TABLE transactions_by_year_adjusted AS
SELECT a.use_code_std, a.sa_sqft, sq.sr_property_id, sq.score, sq.mm_fips_county_name,
sq.sr_val_transfer_adj, sq.sr_tax_transfer_adj, sq.sr_date_transfer,
sq.sr_full... |
<reponame>eileenhlmitchell19/HobbyHub<filename>db/schema.sql
DROP DATABASE IF EXISTS hobbyHub_db;
CREATE DATABASE hobbyHub_db;
|
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/truncate/01722a37.sql<gh_stars>10-100
-- file:truncate.sql ln:245 expect:true
TRUNCATE truncparted
|
-- PAGES
DELETE FROM `sys_pages_blocks` WHERE `object`='bx_events_joined' AND `title` IN ('_bx_events_page_block_title_entries_actions', '_bx_events_page_block_title_entries_of_author');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, ... |
create extension postgis;
create extension postgis_raster;
create extension postgis_topology;
create extension postgis_sfcgal;
create extension if not exists fuzzystrmatch;
create extension if not exists unaccent;
create extension if not exists pg_trgm;
create extension if not exists bloom;
create extension if not... |
<filename>6_CSDL/thuc_hanh/practice_10.sql
use QuanLyDeTai;
go
--Cho biết mã của các giáo viên có họ tên bắt đầu là “Nguyễn” và lương trên $2000 hoặc,
--giáo viên là trưởng bộ môn nhận chức sau năm 1995.
(select magv
from giaovien
where luong > 2000 and hoten like N'Nguyễn%')
union
(se... |
<gh_stars>1-10
EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
|
-- 用户反馈表
CREATE TABLE `DI_FEEDBACK` (
`ID` char(32) NOT NULL COMMENT '主键',
`ORDER_ID` varchar(200) DEFAULT NULL COMMENT '订单ID',
`USER_ID` varchar(200) DEFAULT NULL COMMENT '用户ID',
`USER_COMMENT` varchar(200) NOT NULL COMMENT '用户评论',
`CREATE_DATE` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`UPD... |
<gh_stars>1-10
--209 Number of visit records with end date < start date
select 209 as analysis_id,
cast(null as varchar(255)) as stratum_1, cast(null as varchar(255)) as stratum_2, cast(null as varchar(255)) as stratum_3, cast(null as varchar(255)) as stratum_4, cast(null as varchar(255)) as stratum_5,
COUNT_BIG(... |
<filename>migrations/20200405164521_uspCreateMarket.up.sql<gh_stars>0
create or alter proc dbo.uspCreateMarket @MarketName varchar(60), @EventId int, @Url varchar(240), @Num tinyint as
begin
set nocount on
declare @MarketId int
select @MarketId = MarketId from dbo.Market where MarketName = @MarketName and ... |
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016-2018] EMBL-European Bioinformatics Institute
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may ob... |
<reponame>fernando-romulo-silva/myStudies<gh_stars>1-10
insert into users (username, password, enabled) values ('<EMAIL>', '{bcrypt}$2a$10$E3mPTZb50e7sSW15fDx8Ne7hDZpfDjrmMPTTUp8wVjLTu.G5oPYCO', true);
insert into users (username, password, enabled) values ('<EMAIL>', '{bcrypt}$2a$10$5VWqjwoMYnFRTTmbWCRZT.iY3WW8ny27... |
<reponame>UAMS-DBMI/PosdaTools
-- Name: StartTransaction
-- Schema: posda_phi_simple
-- Columns: []
-- Args: []
-- Tags: ['NotInteractive', 'used_in_dciodvfy']
-- Description: Create a dciodvfy_scan_instance row
begin |
CREATE TABLE "identity_verification_tokens" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"token" VARCHAR (64) NOT NULL,
"used" bool NOT NULL DEFAULT 'false',
"used_at" timestamp,
"expires_at" timestamp NOT NULL,
"issued_at" timestamp NOT NULL,
"identity_verifiable_address_id" UUID NOT NULL,
"selfservice_verification_flow_i... |
--BEGIN;
-- More parcels
INSERT INTO features.land_parcels VALUES ('F3', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
1, -- TG_LAYER_ID for this topology (from topology.layer)
'{{3,3}}') -- face_id:3
);
INSERT INTO f... |
<reponame>lintzc/GPDB
-- Create ETF using return syntax: TABLE (argname argtype).
-- CREATE FUNCTION tabfunc2(t anytable)
-- RETURNS TABLE (x int, y text) ...
CREATE OR REPLACE FUNCTION transform3(a anytable)
RETURNS TABLE (b text, a int)
AS '$libdir/tabfunc_gppc_demo', 'mytransform'
LANGUA... |
<filename>fixtures/doctests/comment/002/input.sql
COMMENT ON ACCESS METHOD gin IS 'GIN index access method';
COMMENT ON AGGREGATE my_aggregate (double precision) IS 'Computes sample variance';
COMMENT ON CAST (text AS int4) IS 'Allow casts from text to int4';
COMMENT ON COLLATION "fr_CA" IS 'Canadian French';
COMMENT O... |
-- Generates script to rebuild indexes
set linesize 120
set pagesize 60
set feedback off
spool idx_rebuild.out
select table_name||' alter index '||rtrim(owner)||'.'||index_name||' rebuild tablespace indx unrecoverable;'
from sys.dba_indexes
where table_owner in ('ESS','OEBS')
order by owner,index_name;
s... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 24, 2017 at 01:50 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... |
/*==============================================================*/
/* Table: user_session */
/*==============================================================*/
CREATE TABLE user_session (
session_id varchar(255) NOT NULL,
last_updated datetime,
data_value text,
usr_id in... |
<reponame>mcroteau/Kilo
create table if not exists users (
id bigint PRIMARY KEY AUTO_INCREMENT,
business_id bigint default 0,
name character varying(250) default '',
phone character varying(140) default '',
username character varying(253),
password character varying(253) NOT NULL,
fresh_password character varyi... |
-- Query A1: Enter a function that calculates the total cost of all
-- animal rescues in the PETRESCUE table.
select SUM(COST)
from PETRESCUE
;
-- Query A2: Enter a function that displays the total cost of all
-- animal rescues in the PETRESCUE table in a column called SUM_OF_COST.
select SUM(COST) AS SUM_OF_COST... |
<filename>SQL/IsolationLevels/Semaphores.Database/Deployments/Post/Seed.dbo.Concert.sql
MERGE dbo.Concert AS target
USING ( VALUES
('Slayer'),
('Nine Inch Nails')
)
AS source
(
[Name]
)
ON target.[Name] = source.[Name]
WHEN NOT MATCHED THEN
INSERT ([Name])
VALUES (source.[Name]);
|
CREATE TABLE [dbo].[AppClients] (
[Id] BIGINT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (500) NOT NULL,
[ClientId] NVARCHAR (500) NOT NULL,
[ClientSecret] NVARCHAR (MAX) NULL,
[LogoutRedirectUri] NVARCHAR (MAX) NULL,
[RedirectUri] NVARCHAR... |
<reponame>Phyrra/JavaSql
select field as alias
from table |
<gh_stars>1-10
-- Procedure WebUser_Del
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[WebUser_Del]
(
@UserId int = -1,
@UserName nvarchar(50) = null
)
AS
SET NOCOUNT ON
IF(@UserId > 0)
BEGIN
DELETE FROM WebUser
WHERE UserId=@UserId
END
ELSE IF(@UserName <> NULL)
BEGI... |
drop table if exists MB_AGREEMENT;
/*==============================================================*/
/* Table: MB_AGREEMENT */
/*==============================================================*/
create table MB_AGREEMENT
(
AGREEMENT_ID varchar(30) not null comment '协议号',
... |
<filename>resources/vdk_recolt/sample.sql
INSERT INTO `coordinates` VALUES (1,2222.84301757813,5578.4443359375,53.7291946411133),(2,2477.29931640625,3784.62109375,41.4352760314941),(3,-1476.54870605469,171.836669921875,55.8890762329102),(4,2645.97143554688,2806.37280273438,33.9922828674316),(5,1038.34326171875,2261.368... |
<filename>Miscellaneous/StoredProcedures/Backup_2015 March 25/h3giCatalogueCreatePriceGroup.sql<gh_stars>1-10
/*********************************************************************************************************************
**
** Procedure Name : h3giCatalogueCreatePriceGroup
** Author ... |
<gh_stars>100-1000
DROP TABLE tasks;
|
-- **************************************************************************************************
-- Table:MeasureType
-- **************************************************************************************************
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'MeasureType')
AND OBJECTPROPER... |
<reponame>smartinsighsSolutions/restaurant<gh_stars>0
START TRANSACTION;
UPDATE `options` SET `value`='1|0::1' WHERE `key`='o_multi_lang';
COMMIT; |
<filename>differentialBackup.sql
-- SQL SERVER BACKUP LOG WITH ODD/EVEN WEEK ROTATION
-- (c) 2016-2020 <NAME> <<EMAIL>>
-- VERSION 1.0
-- DIFFERENTIAL BACKUP
DECLARE
@EvenOdd INT,
@BackupSet VARCHAR(20),
@BackupFile VARCHAR(128),
@MediaName VARCHAR(128),
@BackupName VARCHAR(128),
@DBName VARCHAR(128),
@BackupP... |
<reponame>aravi5/drill-test-framework
SELECT
sqlTypeOf(decimal_18_4) sqlTypeOf_decimal_18_4
FROM dfs.drillTestDir.`CTAS_CSV_PARQUET_DECIMAL18`;
|
<gh_stars>0
SET AUTOCOMMIT = 0;
START TRANSACTION;
DELETE FROM client_grant_type WHERE owner_id = (SELECT id from client_details where client_id = '040c7a59-7250-43e6-946d-941e765320a6');
DELETE FROM client_scope WHERE owner_id = (SELECT id from client_details where client_id = '040c7a59-7250-43e6-946d-941e76... |
<filename>data/backup/20151023_1/20151023_1_1.sql
-- ThinkCMF SQL Dump Program
--
-- DATE : 2015-10-23 15:19:26
-- Vol : 1
DROP TABLE IF EXISTS `sp_ad`;
CREATE TABLE `sp_ad` (
`ad_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '广告id',
`ad_name` varchar(255) NOT NULL,
`ad_content` text,
`status` int(2) ... |
-- add postgis to database if not already added
create extension if not exists postgis;
-- create output table
drop table if exists {1};
create table {1} (
gid integer,
bal_number smallint,
bal_name text,
area_m2 double precision,
azimuth double precision,
distance_m double precision,
aspe... |
/*
Navicat MySQL Data Transfer
Source Server : 192.168.1.12
Source Server Version : 50644
Source Host : 192.168.1.12:3306
Source Database : base_security_authorization_server
Target Server Type : MYSQL
Target Server Version : 50644
File Encoding : 65001
Date: 2020-09-18 09:56:46
*/... |
ALTER TABLE SCHEMA_DATA ADD SCHEMA_TYPE VARCHAR2(255) DEFAULT 'MANAGED' NOT NULL; |
/*
* Ensure you have an up-to-date snapshot of the test_artifacts data.
* Create a cql backup file with cassandradump that will be restored in the new table. (This need 22G of free disk space on cstar)
python cassandradump.py --export-file /mnt/data/dump.cql --cf cstar_perf.test_artifacts --no-create
-> https:/... |
DELETE FROM @results_schema.cohort_sample_element
WHERE cohort_sample_id IN ( @cohortSampleId )
; |
<filename>sql/religion_count/config.sql<gh_stars>0
INSERT INTO Parameters
(Key1, Key2, ParameterId, Name, Description, Domain, DefaultValue, ConfigurationGroup, ConfigurationId, GroupId,
SortIndex)
VALUES ('Ruleset', 'RULESET_STANDARD', 'p0kReligions', 'LOC_P0K_RELIGIONS_NAME', 'LOC_P0K_RELIGIONS_DESCRIPTION',
... |
ALTER TABLE account_tree_cache
ALTER COLUMN tree_cache TYPE jsonb;
|
<filename>sql2_persediaan/beban_barang3_sql/beban_barang3_snt.sql<gh_stars>1-10
DROP VIEW IF EXISTS view_beban_barang3_snt;
CREATE VIEW view_beban_barang3_snt AS
SELECT
*,
CASE WHEN id_jenis_transaksi = 1 AND pra_saldo < 0
THEN jumlah
WHEN id_jenis_transaksi = 1 AND pra_saldo < jumlah
THEN (jumlah - pra_sa... |
<reponame>gregturmel/LegacyDataStoreRiskAssessment<filename>SQLQuery-updateControldifferencevaluesRow1diffeq0.sql
WITH CTE AS (SELECT [TodaysDate],[databaseName],[SchemaName],[TableName],[RecordCount],[Ddifference],ROW_NUMBER() OVER (ORDER BY DatabaseName,SchemaName,TableName,TodaysDate) AS ROW_Num FROM [tableRowCountC... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 05, 2020 at 10:29 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
<reponame>Kevin-Huang-NZ/dmt
INSERT INTO `sys_page`(`page_name`,`page_title`,`memo`)VALUES('user','用户','');
INSERT INTO `sys_page`(`page_name`,`page_title`,`memo`)VALUES('file','上传文件','');
INSERT INTO `sys_page`(`page_name`,`page_title`,`memo`)VALUES('syspage','模块','');
INSERT INTO `sys_page`(`page_name`,`page_title`,`... |
INSERT INTO `user` (`username`, `auth_key`, `access_token_expired_at`, `password_hash`, `password_reset_token`,`email`, `unconfirmed_email`, `confirmed_at`, `registration_ip`, `last_login_at`, `last_login_ip`, `blocked_at`, `status`, `role`, `created_at`, `updated_at`, `name`, `phone`, `address`, `rt`, `rw`, `kel_id`, ... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 28, 2022 at 12:44 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.3.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<reponame>bintangnl/tubes_rescli
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 31 Des 2020 pada 13.10
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "... |
CREATE TABLE group_leaders_courses (
student_id UUID NOT NULL REFERENCES person(verification_code),
course_id BIGINT NOT NULL REFERENCES course(id),
PRIMARY KEY(student_id, course_id)
);
INSERT INTO group_leaders_courses (student_id, course_id) VALUES ('96631d71-74d4-44dc-b9d8-dcedfb80bce3', 1);
INSERT INTO group_l... |
-- Before materialized views, the query run time was 5 min 5 secs, after materialized views 1 min 5 secs
CREATE MATERIALIZED VIEW AGE_GAP AS
SELECT
GET_AGE_GAP (M.YEAR) AS GAP,
TITLE,
MID
FROM
movies AS M;
CREATE MATERIALIZED VIEW RATING_GAP AS
SELECT
GET_RATING_GAP (M.RATING) AS GAP,
TITLE,
MID
FROM
m... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 28, 2021 at 05:18 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
-- auto-generated definition
create table ro.merchants
(
id serial not null
constraint merchants_pk
primary key,
name char(30) not null,
pos_top smallint not null,
pos_left smallint not null,
currency smallint not null,
last_update timestamp,
s... |
<reponame>MSCI-245-S20/MySQL_Playground
delete from prereq;
delete from time_slot;
delete from advisor;
delete from takes;
delete from student;
delete from teaches;
delete from section;
delete from instructor;
delete from course;
delete from department;
delete from classroom;
insert into classroom values ('Packard', '1... |
USE master
GO
CREATE DATABASE SoftUni
COLLATE Cyrillic_General_CI_AI
GO
USE SoftUni
GO
CREATE TABLE Towns (
Id INT IDENTITY(1, 1) NOT NULL,
[Name] NVARCHAR(20) NOT NULL,
CONSTRAINT PK_Towns PRIMARY KEY (Id)
)
CREATE TABLE Addresses (
Id INT IDENTITY(1, 1) NOT NULL,
AddressText NVARCHAR(100) N... |
-- Parameters:
-- 1: the touchstone id (including version, e.g., 201710gavi-1)
-- 2: year_min: vaccination activity calander year from
-- 3: year_max: vaccination activity calander year to
----------------------------------------------------------------------------------
SELECT coverage_fvps.*, un_population.value AS p... |
<filename>Contest/Troll.sql
SELECT count(DISTINCT flight_id) FROM booking WHERE pax_id IN (SELECT id FROM Pax WHERE race = 'Trolls'); |
-- this migration exists solely for the purpose of running the included tests
-- set run time parameters
alter database audit_star SET audit_star.changed_by = 'default';
-- set enough schema for audit testing
create extension if not exists hstore;
drop schema if exists teststar cascade;
drop schema if exists teststar_... |
<reponame>MySolSo/nftglee
CREATE OR REPLACE VIEW "public"."search" AS
SELECT a.id,
CASE WHEN a.editions > 1 THEN a.title || ' (Edition ' || a.edition || ' of ' || a.editions || ')' ELSE a.title END AS s,
'artwork'::text AS type
FROM artworks a
UNION
SELECT u.id,
u.username AS s,
'user'::text AS ty... |
ALTER TABLE `invoices`
DROP COLUMN `discount`,
DROP COLUMN `tax`,
DROP COLUMN `memo`,
DROP COLUMN `client_address_id`,
DROP COLUMN `user_address_id`; |
<reponame>jdkoren/sqlite-parser
-- tkt3522.test
--
-- db eval {
-- CREATE TABLE tab1(col0 INTEGER);
-- CREATE TABLE tab2(col0 INTEGER);
-- SELECT cor0.* FROM tab1 NATURAL JOIN tab2 AS cor0;
-- }
CREATE TABLE tab1(col0 INTEGER);
CREATE TABLE tab2(col0 INTEGER);
SELECT cor0.* FROM tab1 NATURAL JOIN tab2 AS c... |
CREATE TABLE IF NOT EXISTS songs (
song_id int PRIMARY KEY NOT NULL AUTO_INCREMENT,
authors VARCHAR(128) NOT NULL,
title VARCHAR(256) NOT NULL,
youtube_id VARCHAR(16) NOT NULL,
length_seconds int NOT NULL,
release_date DATE,
debuted_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
CREATE DATABASE IF NOT EXISTS `pypolicyd` /*!40100 DEFAULT CHA... |
<reponame>raonigabriel/cities-migrations-pg<filename>src/main/resources/db/migration/V1_0_0__INITIAL_STRUCTURE.sql
CREATE TABLE IF NOT EXISTS states (
id char(2) PRIMARY KEY,
acronym char(2) NOT NULL UNIQUE,
state_name varchar(50) NOT NULL
);
CREATE TABLE IF NOT EXISTS cities (
id char(7) PRIMARY KEY,
state_id ch... |
<reponame>Xwx100/x_tp6
CREATE TABLE `login`
(
`id` bigint NOT NULL AUTO_INCREMENT,
`flag_one` varchar(50) NOT NULL DEFAULT '' COMMENT '登录标识1:type=1是账号名,type=2是手机号,type=3是邮箱,type=4是三方登录唯一标识',
`flag_two` varchar(50) NOT NULL DEFAULT '' COMMENT '登录标识2:type=4是渠道',
`type` tinyint NOT NULL ... |
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `{$NAMESPACE}_almanac` /*!40100 DEFAULT CHARACTER SET {$CHARSET} COLLATE {$COLLATE_TEXT} */;
USE `{$NAMESPACE}_almanac`;
SET NAMES utf8 ;
SET character_set_client = {$CHARSET} ;
CREATE TABLE `almanac_binding` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`phid` varb... |
/*
* Your installation or use of this SugarCRM file is subject to the applicable
* terms available at
* http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
* If you do not agree to all of the applicable terms or do not have the
* authority to bind the entity as an authorized representative, then... |
CREATE TABLE IF NOT EXISTS "categories"(
"id" SERIAL primary key,
"code" VARCHAR,
"description" VARCHAR
); |
CREATE STREAM raw_quotes(ticker varchar, bid int, ask int, bidqty int, askqty int)
WITH (kafka_topic='stockquotes', value_format='avro', key='ticker', partitions=1); |
delimiter //
create trigger verificar_limite_disciplina_prerequisito before insert on disciplina_pre_requisito
for each row
begin
set @quantidade = (select
count(id)
from
disciplina_pre_requisito dp
where dp.codigo_disciplina = new.codigo_disciplina);
if @quantidade >= 3 then
si... |
-- =============================================
-- Author: <NAME>
-- Create date: 1395/04/31
-- Description: Check Tablet Employees Roles for Menu
-- =============================================
CREATE PROCEDURE [dbo].[sp_CheckAndCreateEmployeesRoles]
@EmployeId INT
AS
BEGIN
BEGIN TRY
BEGIN TRANSACTION T
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.