sql stringlengths 6 1.05M |
|---|
# --- !Ups
CREATE TYPE gender AS ENUM ('Male', 'Female', 'Unknown');
CREATE TYPE "type" AS ENUM ('Bug', 'Dark', 'Dragon', 'Electric', 'Fairy', 'Fighting', 'Fire', 'Flying', 'Ghost', 'Grass',
'Ground', 'Ice', 'Normal', 'Poison', 'Psychic', 'Rock', 'Steel', 'Water', 'Unknown');
CREATE TYPE egg_group AS ENUM ('Amorphous... |
{{config(materialized='table')}}
SELECT
session_id,
CASE WHEN event_type = 'checkout' THEN 1 ELSE 0 END AS checkout
FROM
{{ref('dim_events')}} |
-- ----------------------------
-- Table structure for sys_resource
-- ----------------------------
DROP TABLE IF EXISTS `sys_resource`;
CREATE TABLE `sys_resource` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(255) DEFAULT '' COMMENT '权限类型:menu、button、url',
`name` varchar(255) NOT NULL COMMENT '权限名称'... |
<gh_stars>1-10
-- This file and its contents are licensed under the Timescale License.
-- Please see the included NOTICE for copyright information and
-- LICENSE-TIMESCALE for a copy of the license.
SELECT * FROM :TEST_TABLE1 m INNER JOIN :TEST_TABLE2 d USING (device_id) ORDER BY m.bucket, m.device_id;
SELECT * FROM ... |
<gh_stars>1-10
insert into table result SELECT * FROM bigdatabench_dw_item order by ITEM_ID limit 13653400000;
|
<reponame>yunayr/StudtNote-SQL<filename>牛客網練習題/牛客網SQL84.sql
-- 查询在2025年内投递简历的岗位和数量,并且按数量降序排序
SELECT
job,
sum(num) as cnt
FROM resume_info
WHERE date < '2026-01-01' -- 也可以寫「date BETWEEN '2025-01-01' AND '2025-12-31'」或「year(date) = 2025」
AND date > '2024-12-31'
GROUP BY job
ORDER BY cnt DESC; |
<reponame>frediness/cl-psbd<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 23, 2018 at 02:53 AM
-- 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 t... |
<reponame>mohamedkhairy/dhis2-android-sdk<filename>core/src/main/assets/migrations/89.sql
# Add organisationUnitId hash to TrackedEntityInstanceSync and EventSync
DROP TABLE TrackedEntityInstanceSync;
DROP TABLE EventSync;
CREATE TABLE TrackedEntityInstanceSync (_id INTEGER PRIMARY KEY AUTOINCREMENT, program TEXT, orga... |
<gh_stars>0
# 新建数据库
CREATE DATABASE best_practice CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci';
# 查询表中数据条数
# select table_name,table_comment,table_rows from information_schema.tables where table_schema='best_practice' order by table_rows desc
-- oauth2相关表
CREATE TABLE `clientdetails` (
`appId` varchar(128) N... |
prompt --application/set_environment
set define off verify off feedback off
whenever sqlerror exit sql.sqlcode rollback
--------------------------------------------------------------------------------
--
-- ORACLE Application Express (APEX) export file
--
-- You should run the script connected to SQL*Plus as the Oracle... |
DROP TABLE IF EXISTS `user_login_logs`;
CREATE TABLE IF NOT EXISTS `user_login_logs` (
`id` INT NOT NULL AUTO_INCREMENT,
`user_id` INT NULL,
`ip_address` VARCHAR(45) NULL,
`action` VARCHAR(45) NULL,
`datetime` DATETIME NULL,
PRIMARY KEY (`id`));
|
<reponame>EFREI-M1-LSI-2020-2021/distributed-database
-- Exo 1
create table Messages(
value int
);
declare
begin
for i in 1..10
loop
if i not in (6,8) then
insert into Messages values(i);
end if;
end loop;
commit;
end;
select * from Messages;
-- Exo 2
create function... |
DELETE FROM endpoints;
ALTER SEQUENCE endpoints_id_seq
RESTART WITH 1;
|
-- privmaps.sql
-- <NAME> -
-- 2016-06-24
-- this will show system privileges that are granted through roles
col which_user new_value which_user noprint
var which_user varchar2(30)
prompt Username:
set feed off term off echo off
select upper('&1') which_user from dual;
set feed on term on
col privileged_role forma... |
--How I am populating the database--
INSERT INTO employee (first_name, last_name) values ('Jane', 'Austen');
INSERT INTO department (department_name) values ('Math'); |
<reponame>9090ID/visualjambi
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 17, 2020 at 09:33 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone =... |
SELECT quan NOT BETWEEN 10 AND 100 FROM items |
<filename>db/stored-procedures/query/Query_80.sql<gh_stars>0
/*
Object: dbo.Query_80
Transaction: IPA:NUN,INN
*/
CREATE PROCEDURE [dbo].[Query_80]
@HeaderID AS bigint
AS
SET NOCOUNT ON;
DECLARE @SQL AS nvarchar(MAX) = N'
INSERT INTO ipi.IPNameUsage
(RowID, NID, CCCode, RoleCode)
SELECT
A.RowID
, R.NID
... |
CREATE FUNCTION public.row_inserted ()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $$
BEGIN
NEW.modified := LOCALTIMESTAMP;
RETURN NEW;
END;
$$;
CREATE FUNCTION public.row_updated ()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $$
BEGIN
IF NEW.* != OLD.* THEN
NEW.modified := LOCALTIMESTAMP;
END ... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 11, 2016 at 01:18 AM
-- Server version: 5.6.21
-- PHP Version: 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 */;
... |
<gh_stars>10-100
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 172.16.58.3 (MySQL 5.7.22-0ubuntu0.16.04.1)
# Database: ethos-panel
# Generation Time: 2018-06-14 06:12:07 +0000
# *******... |
<reponame>debian-janitor/pg_fact_loader<gh_stars>1-10
CREATE OR REPLACE FUNCTION fact_loader.safely_terminate_workers()
RETURNS TABLE (number_terminated INT, number_still_live INT, pids_still_live INT[]) AS
$BODY$
/****
It is not a requirement to use this function to terminate workers. Because workers are transactiona... |
<reponame>jdkoren/sqlite-parser
-- capi3c.test
--
-- execsql {
-- CREATE TABLE t2(a);
-- INSERT INTO t2 VALUES(1);
-- INSERT INTO t2 VALUES(2);
-- BEGIN;
-- INSERT INTO t2 VALUES(3);
-- }
CREATE TABLE t2(a);
INSERT INTO t2 VALUES(1);
INSERT INTO t2 VALUES(2);
BEGIN;
INSERT INTO t2 VALUES(3); |
<reponame>mjburling/beneficiary-fhir-data
-- The V40 through V52 migrations rename our tables and columns for CCW-sourced data, such that:
-- 1. We follow PostgreSQL's general snake_case naming conventions, to improve the developer experience: DB
-- object names won't have to be quoted all over the place, anymore.
-... |
UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN (12298,12296);
|
<reponame>manuelmartinoracle/oci-micronaut
alter session set "_ORACLE_SCRIPT"=true;
CREATE USER catalogue IDENTIFIED BY "micronaut";
GRANT CONNECT, RESOURCE TO catalogue;
GRANT UNLIMITED TABLESPACE TO catalogue;
|
<reponame>mwilliams7197/aegis<filename>init/procedures/Ticket/GetTicketByIPGroupIDVulnID.sql
/*
RETURN TicketSummary SINGLE
Title VARCHAR(36) NOT NULL
Status VARCHAR(100) NOT NULL
DetectionID VARCHAR(36) NOT NULL
OrganizationID VARCHAR(100) NOT NULL
Upda... |
<reponame>robertosf90/oct<filename>src/oi/brm/scripts/TR_AGENDA_OCT.sql
--
-- TR_AGENDA (Trigger)
--
CREATE OR REPLACE TRIGGER "TR_AGENDA_OCT"
BEFORE INSERT
ON AGENDA_OCT REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
if pc_adn_sva.desativa_agenda then
return;
end if;
--
select to_number(to_char(sys... |
<filename>install/mysql/data/llx_c_exp_tax_range.sql
-- Copyright (C) 2017 ATM Consulting <<EMAIL>>
-- Copyright (C) 2017 <NAME> <<EMAIL>>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundat... |
insert into spring_security.sys_user values (1,'test','{noop}123456',18);
|
<gh_stars>1-10
/****** Object: StoredProcedure [dbo].[GenerateLCCartLoadingList] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE dbo.GenerateLCCartLoadingList
/****************************************************
**
** Desc:
** Generates a sample loading list for given LC Cart
**
... |
<reponame>BOBO41/trifolia<filename>Database/Upgrade/DDL/4.2.0h_viewImplementationGuidePermissions.sql
ALTER VIEW [dbo].[v_implementationGuidePermissions] AS
select distinct userId, implementationGuideId, permission
from (
select u.id as userId, igp.implementationGuideId as implementationGuideId, igp.permission as per... |
<filename>source/org.ohdsi.cdm.framework.etl/org.ohdsi.cdm.framework.etl.common/ETL/Common/Scripts/Redshift/v6.0/TruncateLookup.sql
truncate table {sc}.CARE_SITE;
truncate table {sc}.LOCATION;
truncate table {sc}.PROVIDER; |
<reponame>bcgov/cas-cif<filename>schema/verify/computed_columns/project_revision_project_form_change.sql<gh_stars>1-10
-- Verify cif:computed_columns/project_revision_project_form_change.sql on pg
begin;
select pg_get_functiondef('cif.project_revision_project_form_change(cif.project_revision)'::regprocedure);
rollba... |
<reponame>ChenYi015/Raven
-- run query 1 in stream 0 using template query56.tpl and seed 1951559352
with ss as (
<<<<<<< HEAD
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... |
SELECT * FROM NOTIFICATIONS
ORDER BY INSERT_DATETIME %s;
|
select foo, bar from baz group by foo, bar
|
--+ holdcas on;
SELECT COUNT(*) FROM virtual_c2
WHERE attr1_int_unique_idx <> attr16_objpath.attr1_int_unique_idx
AND attr16_objpath.attr1_int_unique_idx <>
attr16_objpath.attr16_objpath.attr1_int_unique_idx
AND attr16_objpath.attr16_objpath.attr1_int_unique_idx =
... |
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Feb 05, 2018 at 02:20 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 09-12-2020 a las 23:44:09
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
<filename>Data/Initium.Portal.Data/Schema/Identity/Tables/PasswordHistory.sql<gh_stars>0
CREATE TABLE [Identity].[PasswordHistory]
(
[Id] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY
, [Hash] VARCHAR(100) NOT NULL
, [WhenUsed] DATETIME2 NOT NULL
, [UserId] UNIQUEIDENTIFIER NOT NULL
, [TenantId] UN... |
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 06, 2021 at 12:48 PM
-- Server version: 10.3.29-MariaDB-cll-lve
-- PHP Version: 7.3.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 11-03-2019 a las 18:21:16
-- Versión del servidor: 10.1.30-MariaDB
-- Versión de PHP: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
insert into usuario (id, email, nome, senha)
select 9999, '<EMAIL>', 'Usuario 0','@tsfevt4577'
WHERE NOT EXISTS (SELECT 1 FROM usuario WHERE id = 1);
insert into usuario_grupo values(9999, 1);
insert into usuario_grupo values(9999, 2);
insert into usuario_grupo values(9999, 3); |
DROP DATABASE IF exists EPOOL;
CREATE DATABASE EPOOL;
USE EPOOL;
CREATE TABLE UTENTE (
EMAIL VARCHAR(30) PRIMARY KEY,
PW VARCHAR(30) NOT NULL,
NOME VARCHAR(30) NOT NULL,
COGNOME VARCHAR(30) NOT NULL,
DATANASCITA DATE NOT NULL,
LUOGO VARCHAR(50)
) ENGINE=INNODB;
CREATE TABLE UTENTE_S... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: sql200.epizy.com
-- Generation Time: Jul 07, 2020 at 05:09 AM
-- Server version: 5.6.47-87.0
-- PHP Version: 7.2.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 16, 2018 at 07:27 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... |
<filename>arsip-kkn.sql<gh_stars>0
-- Adminer 4.6.3 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `mahasiswa`;
CREATE TABLE `mahasiswa` (
`id_mhs` int(11) NOT NULL AUTO_INCREMENT,
`nama` varchar(50) NOT NULL,
`univer... |
SELECT
visitStartTimestamp
,deviceCategory
,COUNT(DISTINCT CONCAT(session_id, "-", hit_Number)) AS pageviews
FROM `govuk-xgov.InsightsDataset.covid19ukgovresponse`
WHERE type = "PAGE"
GROUP BY visitStartTimestamp
,deviceCategory
|
-- This file should undo anything in `up.sql`
ALTER TABLE 'pastes' ALTER COLUMN 'hash' set not null; |
--
-- Copyright (c) Microsoft Corporation. All rights reserved.
-- Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
--
CREATE VIEW TransactionCardHolders
AS
SELECT DISTINCT
TransactionId = Info.Id
,Info.LastUpdatedDateUtc
,C.UserId
,GlobalU... |
<filename>blog_db.sql
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 15, 2019 at 05:50 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... |
-- Usuarios
-- begin
CREATE TRIGGER agregar_usuario_docente
AFTER INSERT ON docente
FOR EACH ROW
INSERT INTO users(email,password,tipoUsuario,nroId,estado,created_at)
values (NEW.email,NEW.password,'<PASSWORD>',NEW.id,NEW.estado,NOW());
CREATE TRIGGER agregar_usuario_personal
AFTER INSERT ON personal
FOR EACH ROW
INSE... |
<gh_stars>10-100
-- check for errors in package console
declare
v_count pls_integer;
begin
select count(*)
into v_count
from user_errors
where name = 'CONSOLE';
if v_count > 0 then
dbms_output.put_line('- Package CONSOLE has errors :-(');
end if;
end;
/
column "Name" forma... |
DROP TABLE IF EXISTS Customer
GO
CREATE TABLE Customer
(
id INT,
[name] VARCHAR(100)
)
GO
INSERT INTO customer
VALUES(1,'Hyphen'),(2,'Page'),(3,'Data Inc'),(4,'Delta'),(5,'Genx'),(6,'Rand Inc'),(7,'Hallo Inc')
GO
DROP TABLE IF EXISTS Sales
GO
CREATE TABLE Sales
(
CustomerName VARCHAR(100),
Country VARCHAR... |
-- +goose Up
ALTER TABLE direct_request_specs ADD COLUMN min_contract_payment numeric(78,0);
-- +goose Down
ALTER TABLE direct_request_specs DROP COLUMN min_contract_payment;
|
DROP TABLE IF EXISTS "Like";
DROP TABLE IF EXISTS "Match";
DROP TABLE IF EXISTS "MakeOrBreakUserAnswer";
DROP TABLE IF EXISTS "MakeOrBreakPossibleAnswer";
DROP TABLE IF EXISTS "MakeOrBreakQuestion";
DROP TABLE IF EXISTS "Photo";
DROP TABLE IF EXISTS "UserInterest";
DROP TABLE IF EXISTS "User";
DROP TABLE IF EXISTS "Lo... |
<reponame>smith750/kc<gh_stars>0
DELIMITER /
INSERT INTO KREN_PRODCR_S VALUES(NULL)
/
INSERT INTO KREN_PRODCR_T (PRODCR_ID, NM, DESC_TXT, CNTCT_INFO, VER_NBR) VALUES ((SELECT (MAX(ID)) FROM KREN_PRODCR_S), 'KC Notification System', 'This producer represents messages sent from KC', '<EMAIL>', 1)
/
DELETE FROM KREN_CHNL_... |
DELIMITER /
INSERT INTO krcr_parm_t(NMSPC_CD,CMPNT_CD,PARM_NM,OBJ_ID,VER_NBR,PARM_TYP_CD,VAL,PARM_DESC_TXT,EVAL_OPRTR_CD,APPL_ID)
VALUES ('KC-PD','Document','enableBudgetCalculatedSalary',UUID(),1,'CONFG','Y','Flag to display BASE SALARY BY PERIOD LINK','A','KC')
/
INSERT INTO krcr_parm_t(NMSPC_CD,CMPNT_CD,PARM_NM,OBJ_... |
delete from "peer";
INSERT INTO "peer" VALUES('gwu18_1',49161,'127.0.0.1');
INSERT INTO "peer" VALUES('gwu22_1',49162,'127.0.0.1');
INSERT INTO "peer" VALUES('gwu18_2',49161,'127.0.0.1');
INSERT INTO "peer" VALUES('gwu22_2',49162,'127.0.0.1');
INSERT INTO "peer" VALUES('regonf_1',49191,'127.0.0.1');
INSERT INTO "peer" ... |
SELECT A_STRONGLY_AGREE
FROM nss
WHERE question='Q01'
AND institution='Edinburgh Napier University'
AND subject='(8) Computer Science'
|
<gh_stars>1-10
-- 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='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- S... |
------------------------------------
-- Created: 24-Feb-2021 (<NAME>)
------------------------------------
---
-- Dynamic update version 1
create or replace PROCEDURE dynamic_update(in_table_name VARCHAR2,
in_column_name VARCHAR2,
... |
/****** Object: View [dbo].[V_Tuning_QueryExecutionStats] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create VIEW [dbo].[V_Tuning_QueryExecutionStats]
AS
SELECT QS.total_worker_time / QS.execution_count AS Avg_CPU_Time,
SUBSTRING(st.text, (qs.statement_start_offset / 2) + 1,
... |
-- Write your migrate up statements here
CREATE TABLE purchases (
id BIGSERIAL PRIMARY KEY,
customer_id bigint REFERENCES customers(id),
product_id bigint REFERENCES products(id),
quantity integer,
returned_at timestamp without time zone,
created_at timestamp without time zone NOT NULL,
upd... |
<filename>src/Frapid.Web/Areas/MixERP.Inventory/db/SQL Server/2.x/2.0/src/02.functions-and-logic/inventory.get_customer_transaction_summary.sql
IF OBJECT_ID('inventory.get_customer_transaction_summary') IS NOT NULL
DROP FUNCTION inventory.get_customer_transaction_summary;
GO
CREATE FUNCTION inventory.get_custome... |
create table greeting
(
id bigint generated by default as identity,
created timestamp,
updated timestamp,
version bigint,
greeting_id uuid not null,
name varchar(255) not null unique,
salutes integer not null,
primary key (id)
); |
DROP TABLE IF EXISTS `tb_application`;
CREATE TABLE `tb_application` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`group_id` bigint(20) NOT NULL DEFAULT -1,
`absolute_path` varchar(255) NOT NULL,
`name` varchar(50) NOT NULL,
`yarn_application_id` varchar(50) NULL,
`status` varchar(20) NOT NULL,
`command` ... |
DELETE FROM APPLICANT;
INSERT INTO APPLICANT(ID, NAME, AGE, CREDIT_SCORE) VALUES (0, 'Amy', 38, 100);
INSERT INTO APPLICANT(ID, NAME, AGE, CREDIT_SCORE) VALUES (1, 'Bill', 18, 65);
INSERT INTO APPLICANT(ID, NAME, AGE, CREDIT_SCORE) VALUES (2, 'Charlie', 65, 80);
DELETE FROM CREDIT_ISSUE_TYPE;
INSERT INTO CREDIT_ISSUE_... |
CREATE TABLE [IQ].[RefreshToken]
(
[Id] UNIQUEIDENTIFIER NOT NULL CONSTRAINT [DF_RefreshToken_Id] DEFAULT (NEWSEQUENTIALID()),
[TokenHash] NVARCHAR(256) NOT NULL,
[UserName] NVARCHAR(256) NOT NULL,
[ClientId] NVARCHAR(450) NULL,
[ProtectedTicket] NVARCHAR(MAX) NULL,
[Issued] DATETIMEOFFSET ... |
<filename>tests/queries/0_stateless/01411_from_unixtime.sql
SELECT formatDateTime(FROM_UNIXTIME(123), '%Y-%m-%d %R:%S', 'UTC');
SELECT formatDateTime(FROM_UNIXTIME(123456789), '%Y-%m-%d %R:%S', 'UTC');
SELECT formatDateTime(FROM_UNIXTIME(6457477432), '%Y-%m-%d %R:%S', 'UTC');
SELECT FROM_UNIXTIME(5345345, '%C', 'UTC');... |
<gh_stars>1000+
CREATE INDEX `courier_messages_nid_idx` ON `courier_messages` (`id`, `nid`); |
-- Copyright (c) Microsoft Corporation. All rights reserved.
-- Licensed under the PostgreSQL License.
-- This only tests that names are assigned properly
\x on
-- create a citus formation
select *
from pgautofailover.create_formation('citus', 'citus', 'citus', true, 0);
-- register the first coordinator
select *... |
SELECT "FIRST".SNO AS XX, SECOND.SNO AS YY
FROM S AS "FIRST",S AS SECOND
WHERE "FIRST".CITY=SECOND.CITY
AND "FIRST".SNO<SECOND.SNO
; |
<filename>Sources/sys_install/data_browser_schema_sys_package.sql
/*
Copyright 2019 <NAME>, Strack Software Development
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/lic... |
BEGIN TRANSACTION;
-- usersagents table
CREATE TABLE IF NOT EXISTS useragents(
UUID varchar(255) primary key,
agentIP varchar(255),
agentPort integer,
agentOnline boolean,
sessionID varchar(255),
secureSessionID varchar(255),
regionID varchar(255),
loginTime inte... |
<gh_stars>0
USE Geography
SELECT
c.CountryCode,
m.MountainRange,
p.PeakName,
p.Elevation
FROM Countries AS c
JOIN MountainsCountries AS mc
ON mc.CountryCode = c.CountryCode
JOIN Mountains AS m
ON m.Id = mc.MountainId
JOIN Peaks AS p
ON p.MountainId = m.Id
WHERE c.CountryCode = 'BG'
AND p.Elevation > 2835
ORDER BY ... |
<reponame>neosys-opentech/identity-db
CREATE PROCEDURE [dbo].[ps_AspNetUsers_u]
@Id int = NULL,
@UserName nvarchar(256) = NULL,
@NormalizedUserName nvarchar(256) = NULL,
@Email nvarchar(256) = NULL,
@NormalizedEmail nvarchar(256) = NULL,
@EmailConfirmed bit = 0,
@PasswordHash nvarchar(MAX) = NULL,
@SecuritySta... |
DROP TABLE IF EXISTS `customers`;
CREATE TABLE IF NOT EXISTS `customers` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(40) DEFAULT NULL,
`surname` VARCHAR(40) DEFAULT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS item (
item_id INT NOT NULL AUTO_INCREMENT,
item_name CHAR(50) N... |
<gh_stars>0
ALTER TABLE scheduled_events ADD CONSTRAINT set_pdn_fk FOREIGN KEY (pdn_id) REFERENCES process_definitions (id);
ALTER TABLE scheduled_events ADD CONSTRAINT set_e_pdn_fk FOREIGN KEY (e_pdn_id) REFERENCES process_definitions (id); |
<gh_stars>0
INSERT INTO palavrachave (descricao) VALUES ('Palavra I'), ('Palavra II'), ('Palavra III'); |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: mysql:3306
-- Generation Time: May 08, 2020 at 12:46 AM
-- Server version: 8.0.20
-- PHP Version: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... |
-- MIT License
-- Copyright (c) 2021 san k
-- -------------------------
-- DANGEROUS! Might break constrains when run on unprepared database. Recreate the schema first.
-- Enters sample data into the schema for Fluffy Best backend.
USE `fluffybest` ;
-- Add sample data
-- --------------------------------------------... |
<filename>SCRIPTS/grants8.sql
REM FILE NAME: grants8.sql
REM LOCATION: Security Administration\Reports
REM FUNCTION: Produce report of table grants showing GRANTOR GRANTEE
REM and specific GRANTS
REM TESTED ON: 8.0.4.1, 8.1.5, 8.1.7, 9.0.1
REM PLATFORM: non-specific
REM REQUIRES: DBA_TAB_PRIVS
RE... |
USE employee_db;
INSERT INTO department (department_name)
VALUES
('Engineering'),
('Legal'),
('Sales'),
('Finance');
INSERT INTO roles (title, salary, department_id)
VALUES
('Software Engineer', 120000, 1),
('Lead Engineer', 150000, 1),
('Legal Team Lead', 250000, 2),
('Lawyer', 190000... |
<gh_stars>0
create database ScrapedEmails;
use ScrapedEmails;
CREATE TABLE emailDump (
id INT unsigned NOT NULL AUTO_INCREMENT,
sender VARCHAR(150) NOT NULL,
subject VARCHAR(150) NOT NULL,
email VARCHAR(150) NOT NULL,
PRIMARY KEY (id) ); |
use [WWI-Staging];
GO
CREATE OR ALTER PROCEDURE FillStagingPurchaseOrder
AS
BEGIN
TRUNCATE TABLE StagingPurchaseOrder
INSERT INTO StagingPurchaseOrder
(
PurchaseOrderID,
SupplierID,
OrderDate,
DeliveryMethodID,
ContactPersonID,
ExpectedDeliv... |
<filename>embed/files/schemas/full_identity_schema_down.sql
DROP TABLE IF EXISTS invite_tokens;
DROP TABLE IF EXISTS ephemeral_public_keys;
DROP TABLE IF EXISTS peer_pubkeys;
DROP TABLE IF EXISTS peers;
DROP TABLE IF EXISTS invite_tokens;
DROP TABLE IF EXISTS local_threepid_associations;
DROP TABLE IF EXISTS global_thr... |
-- Tablas
CREATE TABLE `inventariopillin`.`rango` (
`id` INT(10) NOT NULL AUTO_INCREMENT ,
`nombre` VARCHAR(50) NOT NULL ,
`observacion` VARCHAR(100) NOT NULL ,
PRIMARY KEY (`id`)) ENGINE = InnoDB;
CREATE TABLE `inventariopillin`.`usuarios` (
`id` INT(10) NOT NULL AUTO_INCREMENT ,
`usuario` VARCHAR(50) NOT NULL ,
`nom... |
<filename>Migrations/4.sql
INSERT INTO FileIndex (fileUUID, userId, deviceUUID, fileGroupUUID, creationDate, updateDate, mimeType, appMetaData, deleted, fileVersion, appMetaDataVersion, fileSizeBytes) VALUES ("7B9E68B3-2827-43C1-AF1A-B0A904431445", 1, "FAF13FCE-EA89-4BCA-84C2-D6F594E3A429", "32FBC7A2-2AE0-49A6-A52E-E5F... |
drop table if exists StickerPack;
|
-- randexpr1.test
--
-- db eval {SELECT (case when (select count(*) from t1)++t1.d+b*t1.e | t1.a+coalesce((select max(t1.d) from t1 where d-19<>c),t1.a)+t1.f in (select coalesce((select max(b) from t1 where t1.c-case when t1.c in (select c from t1 union select t1.f from t1) then f when t1.c not in ( -e,t1.e,11) then (... |
CREATE TABLE helm_releases (
id SERIAL PRIMARY KEY,
environment_id INTEGER REFERENCES environments (id) NOT NULL,
created_at TIMESTAMPTZ,
updated_at TIMESTAMPTZ,
deleted_at TIMESTAMPTZ,
release_name VARCHAR(512) NOT NULL
);
|
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5457360_sys_gh1045-plv-field-updateable.sql
-- 28.02.2017 20:45
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsReadOnly='N',Updated=TO_TIMESTAMP('2017-02-28 20:45:42','Y... |
<gh_stars>0
drop table if exists `dfs.drillTestDir`.t1;
create table `dfs.drillTestDir`.t1 as select 1 as c1;
drop table if exists dfs.drillTestDir.t2;
create table dfs.drillTestDir.t2 as select 1 as c2;
drop table if exists dfs.drillTestDir.`t3`;
create table dfs.drillTestDir.`t3` as select 1 as c2,1 as c1;
--@test
se... |
<filename>framework/resources/Functional/window_functions/tpcds_variants/percentrank02.sql
SELECT PERCENT_RANK() OVER (ORDER BY ss.ss_store_sk) FROM store_sales ss LIMIT 20;
|
<reponame>xiaoqingxing/service-4ncov<gh_stars>1-10
alter table user_info
add column user_identification_number char(18) not null;
alter table material_supplier_info
drop column material_supplier_identification_number; |
CREATE OR REPLACE TRIGGER "UNDERSCORE_RELATION_TRG"
BEFORE INSERT ON MCZBASE.UNDERSCORE_RELATION
FOR EACH ROW
BEGIN
if :NEW.UNDERSCORE_RELATION_ID is null then
select MCZBASE.UNDERSCORE_RELATIONS_SEQ.nextval into :new.UNDERSCORE_RELATION_ID from dual;
end if;
END;
ALTER TRIGGER "UNDERSCORE_RE... |
/********************************************************************************
release-type-full-validation-mrcm-domain-refset
Assertion: The current MRCM Domain Refset full file contains all
previously published data unchanged.
The current full file is the same as the prior version of the same full
fi... |
--HINT DISTRIBUTE ON RANDOM
CREATE TABLE attribute_definition
(
attribute_definition_id INTEGER NOT NULL,
attribute_name VARCHAR(255) NOT NULL,
attribute_description TEXT NULL,
attribute_type_concept_id INTEGER NOT NULL,
attribute_syntax TEXT NULL
);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.