sql stringlengths 6 1.05M |
|---|
<filename>Back end Prototype/RateIt.Database/dbo/Tables/Accounts.sql
CREATE TABLE [dbo].[Accounts](
[Id] [bigint] IDENTITY(1,1) PRIMARY KEY NOT NULL,
[EthereumAddress] NVARCHAR(42) NOT NULL,
[Password] NVARCHAR(50) NOT NULL,
[Salt] NVARCHAR(10) NOT NULL,
[LastEdit] [datetime] NOT NULL DEFAULT GETDATE(),
[UserId]... |
-- 06. Extract all military journeys
-- https://judge.softuni.bg/Contests/Practice/Index/1265#6
SELECT id, journey_start, journey_end
FROM journeys
WHERE purpose = 'Military'
ORDER BY journey_start |
/*
Create five views based on workspace table:
1) workspace users
2) workspaces
3) workspace reports
4) workspace datasets
5) workspace dashboards
*/
--1. Create workspace users view
CREATE VIEW BIMonitoring.vDim_PBIWorkspaceUsers
AS
SELECT
P.[Workspace ID]
, P.[Workspace Name]
, U.[emailAddress] ... |
<gh_stars>100-1000
-- original: cost.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
CREATE TABLE t3(id INTEGER PRIMARY KEY, b NOT NULL);
CREATE TABLE t4(c, d, e);
CREATE UNIQUE INDEX i3 ON t3(b);
CREATE UNIQUE INDEX i4 ON t4(c, d)
;SELECT e FROM t3, t4 WHERE b=c ORDER BY b, d
;CREATE TABLE t... |
# The following SQL query retrieves a list of all users
# and their last session activity at date and time.
# Important Note: If the time that the the user was last
# active at exceeded the configured session legnth in
# days, or the user has never logged in, the
# LastActivityAt field will be null.
# Tested on MySQL... |
<filename>doc/demo/db/development_structure.sql
CREATE TABLE `comments` (
`id` int(11) NOT NULL auto_increment,
`author` varchar(100) NOT NULL default '',
`content` text NOT NULL,
`content_id` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `contents` (
`id` int... |
/*
Navicat MySQL Data Transfer
Source Server : 172.16.17.32
Source Server Version : 50505
Source Host : 172.16.17.32:3306
Source Database : hacker
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2019-08-12 21:20:51
*/
SET FOREIGN_KEY_CHECKS=0;
... |
ALTER TABLE Tweets ADD COLUMN uid INTEGER;
ALTER TABLE Tweets ADD COLUMN retweets INTEGER;
ALTER TABLE Tweets ADD COLUMN likes INTEGER; |
--
-- Table structure for table `dt_wx_access_token`
--
DROP TABLE IF EXISTS `dt_wx_access_token`;
CREATE TABLE `dt_wx_access_token` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`access_token` varchar(500) NOT NULL,
`expires_in` int(10) unsigned NOT NULL,
`create_time` int(10) unsigned NOT NULL,
`update... |
<gh_stars>1-10
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50726
Source Host : 127.0.0.1:3306
Source Schema : mall
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 0... |
CREATE PROCEDURE SP294(OUT MYCOUNT INTEGER) SPECIFIC SP294_96413 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE97;SELECT COUNT(*)INTO MYCOUNT FROM TABLE418;SELECT COUNT(*)INTO MYCOUNT FROM TABLE228;SELECT COUNT(*)INTO MYCOUNT FROM ... |
BEGIN;
ALTER TABLE device_port DROP COLUMN is_uplink_admin;
ALTER TABLE device_port ADD COLUMN "slave_of" text;
ALTER TABLE device_port ADD COLUMN "is_master" bool DEFAULT false NOT NULL;
COMMIT;
|
<filename>restoran.sql
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 01, 2019 at 08:18 AM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.1.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+0... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- 主機: 127.0.0.1
-- 產生時間: 2016-08-03 15:16:44
-- 伺服器版本: 10.1.13-MariaDB
-- PHP 版本: 5.6.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SE... |
INSERT INTO recipe(name, origin,servings, ingredients, process, equipment, contributor, category) VALUES('Besan (Til) Ladoo', 'Indian - North', 60, ARRAY ['5 cup besan (Make sure the bag just says “Besan”. Not “Ladoo Besan”. Not “Kala Chana Besan”.', '1 cup fine sooji', '2 cup almonds', '1 cup melon seeds', '1 cup sesa... |
<gh_stars>0
select st.STAVKA,
st.PROIZVOD,
st.NAZIV,
st.JED_MERE,
st.PDV_STOPA,
st.KOLICINA,
st.CENA,
st.IZNOS,
st.PROC_RABATA,
st.PROC_KASE,
st.RABAT+st.K... |
<filename>src/Resources/migration/foreign-constraint.sql
ALTER TABLE `__prefix__Person` ADD CONSTRAINT FOREIGN KEY (`primary_role`) REFERENCES `__prefix__Role` (`id`),
ADD CONSTRAINT FOREIGN KEY (`house`) REFERENCES `__prefix__House` (`id`),
ADD CONSTRAINT FOREIGN KEY (`class_of_academic_year`) REFERENCES `__pr... |
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
--
-- Data for Name: bidding; Type: TABLE DATA; Schema: pu... |
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
--
-- Host: localhost Database: patrinodb
-- ------------------------------------------------------
-- Server version 5.7.27-0ubuntu0.19.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_... |
CREATE TABLE "MLB_63"(
"col_00" smallint NOT NULL,
"col_01" decimal(4, 3),
"col_02" decimal(4, 3),
"col_03" decimal(4, 1),
"col_04" smallint NOT NULL,
"col_05" decimal(4, 1),
"col_06" smallint NOT NULL,
"col_07" decimal(4, 1),
"col_08" smallint,
"col_09" smallint NOT NULL,
"col_10" decimal(4, 1),
"col_11" decimal(4, 3)... |
<gh_stars>1-10
SELECT * FROM ' . $this->getTableName() . ' WHERE user_id = ?';
SELECT * FROM *PREFIX*mail_collected_addresses WHERE `user_id` = ? AND `email` ILIKE ?';
SELECT * FROM `' . $this->getTableName() . '` WHERE user_id = ? and id = ?';
|
<reponame>G-tmp/Forum_SSM
-- MySQL dump 10.13 Distrib 8.0.17, for Linux (x86_64)
--
-- Host: localhost Database: forum
-- ------------------------------------------------------
-- Server version 8.0.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARA... |
<gh_stars>1-10
CREATE OR REPLACE FUNCTION login(email text, password text) RETURNS jsonb AS $$
DECLARE v_user_id UUID;
BEGIN
SELECT id FROM public.users u WHERE u.email = $1 and u.password = public.crypt($2, u.password)
INTO v_user_id;
IF NOT FOUND THEN
RAISE EXCEPTION 'invalid email/password'
USING ERRC... |
/*
<<property_start>>Description
* xref:sqldb:logs.ftv_executionlog_puml_sequence_start_stop_per_execution.adoc[] uses xref:sqldb:logs.executionlog.adoc[] to create PlantUML code for sequence diagrams
* Only procedure calls are considered, not "normal code".
<<property_end>>
<<property_start>>exampleUsage
--analy... |
SELECT k.keyword AS movie_keyword,
n.name AS actor_name,
t.title AS marvel_movie
FROM title AS t JOIN (movie_keyword AS mk JOIN keyword AS k ON k.id = mk.keyword_id) ON t.id = mk.movie_id
JOIN (cast_info AS ci JOIN name AS n ON n.id = ci.person_id) ON t.id = ci.movie_id
WHERE k.keyword = 'marvel-cinematic... |
<filename>db/app/cfg/src/full/R__09.PACKAGE_SPEC.UT_CODE_CHECK_PKG.sql
create or replace package ut_code_check_pkg is
"abcd" constant varchar2(4 char) := 'abcd';
-- Do not defined global public variables but use setters and getters
l_var varchar2(4 char);
procedure ut_assign(p_str out nocopy varchar2);
procedure ut... |
<reponame>Yoyocyw/newtest
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for loupanindexzz
-- ----------------------------
DROP TABLE IF EXISTS `loupanindex`;
CREATE TABLE `loupanindex` (
`ID` int NOT NULL AUTO_INCREMENT,
`name` text CHARACTER SET utf8mb4 COLLATE... |
# chromAlias.sql was originally generated by the autoSql program, which also
# generated chromAlias.c and chromAlias.h. This creates the database representation of
# an object which can be loaded and saved from RAM in a fairly
# automatic way.
#correspondence of UCSC chromosome names to refseq, genbank, and ensembl... |
SELECT
comments.date_added,
comments.comment_text
FROM
flyspray_comments AS comments
WHERE
comments.task_id = %s
ORDER BY
comments.date_added
|
CREATE TABLE [Lookup].[OperationCode](
[Id] [int] NOT NULL CONSTRAINT [PK_OperationCode] PRIMARY KEY,
[Name] [nvarchar](256) NOT NULL);
GO
INSERT INTO [Lookup].[OperationCode](
[Id],
[Name])
SELECT 1, 'R1' UNION ALL
SELECT 2, 'R2' UNION ALL
SELECT 3, 'R3' UNION ALL
SELECT 4, 'R4' UNION ALL
SELECT 5, 'R5' UNION AL... |
DROP PROCEDURE IF EXISTS `getRoleSP`;
|
<reponame>mooejun/scarf
/*
Navicat Premium Data Transfer
Source Server : 腾讯云
Source Server Type : MySQL
Source Server Version : 50642
Source Host : 172.16.31.10:3306
Source Schema : scarf
Target Server Type : MySQL
Target Server Version : 50642
File Encoding : 65001
... |
WITH ndtLegacy AS (
SELECT NET.SAFE_IP_FROM_STRING(connection_spec.client_ip) AS ip, 8 * (web100_log_entry.snap.HCThruOctetsAcked / (web100_log_entry.snap.SndLimTimeRwin + web100_log_entry.snap.SndLimTimeCwnd + web100_log_entry.snap.SndLimTimeSnd)) AS mbps
FROM `measurement-lab.ndt.downloads`
WHERE partition_da... |
<filename>sample_project/dbt/models/examples/sinks/redpanda/materialized_flight_information.sql
{{ config(materialized='sink') }}
{% set sink_name %}
{{ mz_generate_name('redpanda_flight_information') }}
{% endset %}
CREATE SINK {{ sink_name }}
FROM {{ ref('rp_flight_information') }} INTO KAFKA BROKER 'redpanda:9... |
--Create an CO table with partitions ( having diff storage parameters)
--start_ignore
drop table if exists pt_co_tab cascade;
--end_ignore
Create table pt_co_tab(a int, b text, c int , d int, e numeric,success bool) with ( appendonly = true, orientation = column)
distributed by (a)
partition by list(b)
(
... |
/*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 50619
Source Host : localhost:3306
Source Database : wsnail
Target Server Type : MYSQL
Target Server Version : 50619
File Encoding : 65001
Date: 2016-03-03 22:46:27
*/
SET FOREIGN_KEY_CHECK... |
create table utsjoppa (
USERID DECIMAL(15,0),
HREYFING SMALLINT,
DAGS TIMESTAMP,
PRIMARY KEY(USERID,DAGS)
);
|
<gh_stars>0
CREATE TABLE [auth].[Audits]
(
[Id] INT NOT NULL identity(100000, 1),
[Type] char(1) not null,
[TableName] varchar(64) not null,
[PrimaryKeyField] varchar(64) not null,
[PrimaryKeyValue] int not null,
[FieldName] varchar(64) not null,
[OldValue] nvarchar(max) null,
[NewValue] nvarchar(max) null,
[... |
<filename>sql/kawpi.sql
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 12, 2019 at 08:51 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:... |
select name
from employee
where id in (select managerid from (select managerid, count(managerid) cnt from employee group by managerid having count(managerid )>=5) t1)
|
<filename>core/migrations.sql
--db:ups
--{{{
create table sch( id text);
insert into sch (id) VALUES ('ups');
--}}}
--{{{
DO $$
BEGIN
IF EXISTS (SELECT * FROM sch) THEN
RAISE NOTICE 'Hello';
END IF;
END$$;
--}}}
--{{{
CREATE OR REPLACE
FUNCTION add_migration(_version_ text, _up_ text) RETURNS text AS $$
INS... |
<reponame>adele-robots/fiona
--
-- patch-backlinkindexes.sql
--
-- Per bug 6440 / http://bugzilla.wikimedia.org/show_bug.cgi?id=6440
--
-- Improve performance of the "what links here"-type queries
--
ALTER TABLE /*$wgDBprefix*/pagelinks
DROP INDEX pl_namespace,
ADD INDEX pl_namespace(pl_namespace, pl_title, p... |
-- prove table is empty
SELECT * FROM Students;
-- insert new students
INSERT INTO
Students (FirstName, LastName, House, DOB)
VALUES
('Harry', 'Potter', 'Gryffindor', '1980-07-31')
, ('Draco', 'Malfoy', 'Slytherin', '1980-05-05')
, ('Hermione', 'Granger', 'Gryffindor', '1979-09-19');
-- prove table has re... |
<reponame>MarAvFe/Footballer<filename>scripts/scripts functions specific.sql
select pt.idTeam
from Player_Team pt ,
(select idEvent from mydb.Event ev inner join Game ga on ga.idEvent = pIdEvent) evt
inner join mydb.Group gr on gr.idEvent = pIdEvent)
inner join Team te on gr.idGroup = te.idGroup
where pt.idPlayer = ... |
<reponame>israelmrios/Coding-Tech-Blog<filename>db/schema.sql
DROP DATABASE IF EXISTS coding_tech_db;
CREATE DATABASE coding_tech_db; |
<reponame>betoamaya/ReportesCXC
SELECT VerAuxCorte.Moneda,
VerAuxCorte.Cuenta,
VerAuxCorte.Mov,
VerAuxCorte.MovID,
VerAuxCorte.Saldo,
Cxc.FechaEmision,
Cxc.Referencia,
Cxc.Vencimiento,
Cte.Cliente,
Cte.Nombre,
Cxc.ClienteEnviarA AS 'Sucursal'
... |
<reponame>jacobwilde378/tracker-employee<gh_stars>0
USE tracker_employee_db;
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES
('Jacob','Wilde',3,null),
('Troy','Berry',1,1),
('Rickey','Ramirez',5,2),
('Paul','Perschon',6,2),
('Rose','Coon',2,1),
... |
/*
Warnings:
- You are about to drop the column `addressNumber` on the `locations` table. All the data in the column will be lost.
- Added the required column `address_number` to the `locations` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "location... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 27, 2018 at 06:45 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 08, 2020 at 11:53 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
<reponame>wyhaines/kansas
drop table Students;
drop table Courses;
drop table Courses_Taken;
create table Students (
student_number int not null primary key auto_increment,
first_name varchar(40),
last_name varchar(40),
address varchar(40),
city varchar(40),
state varchar(40),
zip varchar(11)
);
create table C... |
<filename>4_queries/9_aggregate_average_assistance_request_duration.sql
SELECT AVG(total_duration) AS average_total_duration
FROM (
SELECT cohorts.name AS cohort, SUM(completed_at - started_at) AS total_duration
FROM assistance_requests
JOIN students ON student_id = students.id
JOIN cohorts ON students.cohort_i... |
<reponame>hawkwithwind/chat-bot-hub<gh_stars>1-10
ALTER TABLE `bots` DROP INDEX `accountid_botname_deleteat`;
ALTER TABLE `bots` DROP INDEX `login_deleteat`;
ALTER TABLE `bots` ADD INDEX `accountid_index` (`accountid`);
ALTER TABLE `bots` ADD INDEX `botname_index` (`botname`);
ALTER TABLE `bots` ADD INDEX `login_index... |
<filename>database/camm_WebManager_build_2117.sql
--limit retention time for log type RuntimeInformation to max 30 days (for high load reasons because of regular webcron cleanup log entries increasing table size to too large values for typical shared hostings)
IF NOT EXISTS (SELECT 1 FROM [dbo].System_GlobalProperties... |
<reponame>marcoslarsen/spilo
SET search_path TO public;
-- Table dfm_configuration_meta
CREATE SEQUENCE IF NOT EXISTS dfm_configuration_meta_seq INCREMENT 10 START 1;
CREATE TABLE IF NOT EXISTS dfm_configuration_meta (
id BIGINT NOT NULL,
PRIMARY KEY (id)
);
-- Table dfm_parameter_grou... |
<reponame>pribtech/nodete
XQUERY <Customers1002>
{ db2-fn:sqlquery("SELECT info FROM ?SCHEMA?.xmlcustomer WHERE cid = 1002") }
</Customers1002> ;
|
<reponame>bcgov/cas-ciip-portal<gh_stars>1-10
-- Verify ggircs-portal:policies/form_result_status_policies on pg
begin;
do $$
begin
if (select exists(select * from pg_proc where proname='ggircs_portal_private.get_valid_form_result_status_applications')) then
raise exception 'ggircs_portal_private.get_val... |
<reponame>HazyResearch/dd-genomics
DROP INDEX IF EXISTS genes_ensembl_id;
DROP INDEX IF EXISTS genes_gene_name;
DROP INDEX IF EXISTS gene_mentions_doc_id;
DROP INDEX IF EXISTS gene_mentions_section_id;
DROP INDEX IF EXISTS gene_mentions_sent_id;
DROP INDEX IF EXISTS gene_mentions_mention_id;
DROP INDEX IF EXISTS varian... |
DROP TABLE nft_factory;
|
--- pg_rewrite table ---
\echo -- start_ignore
select * from pg_rewrite;
\echo -- end_ignore
|
<filename>pgtap/test/sql/enumtap.sql
\unset ECHO
\i test/setup.sql
SELECT plan(108);
--SELECT * FROM no_plan();
-- This will be rolled back. :-)
SET client_min_messages = warning;
CREATE TYPE public.bug_status AS ENUM ('new', 'open', 'closed');
RESET client_min_messages;
/********************************************... |
CREATE PROC usp_GetEmployeesFromTown (@TownName VARCHAR(10))
AS
SELECT e.FirstName,
e.LastName
FROM Employees e
INNER JOIN Addresses a
ON a.AddressID = e.AddressID
INNER JOIN Towns t
ON t.TownID = a.TownID
WHERE t.Name = @TownName |
BEGIN TRANSACTION;
DROP TABLE content;
CREATE TABLE content (
id INTEGER PRIMARY KEY NOT NULL,
create_datetime varchar(50) NOT NULL,
modified_datetime datetime(50),
data TEXT,
tags varchar(100),
views int(1000000000000),
clicks int(1000000000000)
);
COMMIT; |
<reponame>dwinuray/collage-erp<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 05, 2021 at 07:17 PM
-- 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:0... |
<reponame>liuhaobo0728/mpvue
/*
* @Author: 56513
* @Date: 2018-07-30 12:58:46
* @Last Modified by: 56513
* @Last Modified time: 2018-08-01 15:40:16
*/
-- 图书信息表
create table books(
id int not null auto_increment primary key,
isbn varchar(20) not null,
openid varchar(50) not null,
title varchar(100) not null,
im... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 08 Des 2019 pada 13.36
-- Versi server: 10.1.31-MariaDB
-- Versi PHP: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 S... |
DROP DATABASE book_app;
CREATE DATABASE book_app;
DROP TABLE IF EXISTS books;
CREATE TABLE books (
id SERIAL PRIMARY KEY,
title TEXT,
author VARCHAR(255),
isbn VARCHAR(255),
image VARCHAR(255),
description TEXT
);
-- INSERT INTO books (author, title, isbn, image_url, description, bookshelf)... |
<reponame>instaql/instaql<gh_stars>1-10
-- Deploy schemas/myschema/schema to pg
BEGIN;
CREATE SCHEMA myschema;
COMMIT;
|
<filename>schema/revert/roles/kit-processor/create.sql<gh_stars>10-100
-- Revert seattleflu/schema:roles/kit-processor/create from pg
begin;
drop role "kit-processor";
commit;
|
<filename>deploy/users_graphql_subscription.sql
-- Deploy postgraphile_user_system:users_graphql_subscription to pg
-- requires: postgraphile_utility_functions:trigger_graphql_subscription
BEGIN;
create trigger _500_gql_update
after update on app_public.users
for each row
execute procedure app_public.tg__graph... |
/*
Navicat Premium Data Transfer
Source Server : Terminal
Source Server Type : MySQL
Source Server Version : 100135
Source Host : localhost:3306
Source Schema : ta_book
Target Server Type : MySQL
Target Server Version : 100135
File Encoding : 65001
Date: 27/03/2019 1... |
CREATE SCHEMA IF NOT EXISTS openidconnect;
CREATE TABLE openidconnect.authorization_endpoint_parameters (
id UUID NOT NULL,
version BIGINT NOT NULL,
date_created TIMESTAMP NOT NULL,
last_updated TIMESTAMP NOT NULL,
ui_locales VARCHAR(255),
display ... |
ALTER TABLE addStoriesTask
ADD COLUMN collectionId INT DEFAULT NULL,
ADD COLUMN questionnaireId INT DEFAULT NULL;
|
<filename>cmdb-core/src/main/resources/database/ch/03.cmdb.system.data.mysql_ch.sql<gh_stars>1-10
SET FOREIGN_KEY_CHECKS=0;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KE... |
CREATE TABLE `ex_crawler_platform_job_parameter` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`jobName` varchar(50) NOT NULL,
`attName` varchar(45) NOT NULL,
`attValue` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
INSERT INTO `ex_crawler_platform_job_parameter` VALUES (3, 'qicha... |
CREATE TABLE [dbo].[Preference] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[PreferenceOptionId] INT NULL,
[PreferenceTypeId] INT NULL,
[CreatedAt] DATETIME NOT NULL,
[UpdatedAt] DATETIME NOT NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO
CREATE NONCL... |
-- this is a database schema for a zoo operations
-- a fun excercise in data base related applications
-- for mysql
-- the existing database will be dropped
-- WARNING - DATA will be lost
drop database if exists zoo;
create database zoo;
use zoo;
-- caretakers definition
create table caretakers (
id int not nul... |
CREATE TABLE [dbo].[d_item]
(
[Id] INT NOT NULL PRIMARY KEY Identity,
[Board] varchar(50) null,
[List] varchar(50) null,
[Action] varchar(50) null,
[CardNumber] VARCHAR(50) null,
[PriorityNumber] INT NOT NULL,
[Requirement] varchar(max) null,
[PriorityLevelId] int null,
[StatusId] int not null,
[CoderId]... |
<filename>sql/fix_auth_socket.sql
UPDATE user SET plugin='mysql_native_password' WHERE User='root';
FLUSH PRIVILEGES; |
<reponame>KarenJF/leetcode_sql<gh_stars>0
/* 1440. Evaluate Boolean Expression
Table Variables:
+---------------+---------+
| Column Name | Type |
+---------------+---------+
| name | varchar |
| value | int |
+---------------+---------+
name is the primary key for this table.
This table conta... |
<reponame>lgcarrier/AFW
SET DEFINE OFF;
create or replace package body afw_29_asurn_qualt_pkg
as
procedure exect_reqt (pva_liste_contrl in varchar2
,pnu_page in number default null)
is
cursor cur_contr
is
select c.seqnc
,c.nom_struc_acces
,c.n... |
CREATE TABLE blobs ( project_id integer NOT NULL, parsed boolean DEFAULT false NOT NULL, errored boolean DEFAULT false NOT NULL, id integer NOT NULL, path text NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone, sha character varying(40) NOT NULL, path_sha character varying(64) NOT... |
USE [Sporty]
GO
/****** Object: Table [dbo].[Plan] Script Date: 03/27/2011 22:32:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Plan](
[Id] [int] IDENTITY(1,1) NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
[Duration] [int] NULL,
[SportTypeId] [int] NOT NULL,
[ZoneId] [int]... |
<reponame>GhazaleZe/CourseShop_DataWarehouse<filename>ghazale's files/UserMart_tables.sql
Use DataWarehouse
Go
create table U_Fact_UserRating
(
[user_id] int,
course_key int,
course_id int,
time_key nvarchar(100),
rating decimal(3, 2),
);
create table U_user_rating_temp
(
[user_id] int,
course_key int,
cour... |
<gh_stars>100-1000
-- MySQL dump 10.13 Distrib 5.7.19, for osx10.12 (x86_64)
--
-- Host: 192.168.1.100 Database: auth_test
-- ------------------------------------------------------
-- Server version 5.5.53-0ubuntu0.14.04.1-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHAR... |
<gh_stars>10-100
alter table "array" add constraint array_dimensions check( array_ndims(rows) = 2 );
|
<reponame>smith750/kc<filename>coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/RELEASE-SCRIPTS/KC-RELEASE-3_2-SCRIPT/oracle/tables/KC_TBL_FIN_INT_ENTITY_STATUS.sql
CREATE TABLE FIN_INT_ENTITY_STATUS (
STATUS_CODE NUMBER(3,0) NOT NULL,
DESCRIPTION VARCHAR2(200) NOT NULL,
UPDATE_TIMESTAM... |
select * from lineitem where
case
when l_returnflag = 'N' then true
else false
end
; |
use bank;
select sum(amount) from loan;
select sum(payments) from loan;
# group by is giving you a "oer each" result
#you can devide the aggregation fun like avg, sum, etc by groups
# always after the where statement
#is followed by having
#where > group by > having
select account_id, sum(amount) from loan
group by a... |
<filename>tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk2.sql
select * from lineitem where l_orderkey = 2; |
<filename>aws-test/tests/aws_ssm_document/test-turbot-query.sql
select akas, name, region, tags, title
from aws.aws_ssm_document
where name = '{{ resourceName }}';
|
<reponame>kainsk/kratos<filename>persistence/sql/migrations/sql/20210816142650000012_flow_internal_context.sqlite3.up.sql
CREATE INDEX "selfservice_registration_flows_nid_idx" ON "_selfservice_registration_flows_tmp" (id, nid); |
ALTER TABLE group_profile DROP COLUMN avatar, DROP COLUMN avatar_format; |
<filename>tramites_db.sql
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 28-03-2020 a las 01:44:12
-- Versión del servidor: 10.4.6-MariaDB
-- Versión de PHP: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;... |
<filename>tiketbus.sql
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 04, 2020 at 01:12 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 @... |
EXEC [EST].[Proc_yjbb_Ins] @Code = N'600190',@CutoffDate = N'2017-09-30',@EPS = N'0.0427',@EPSDeduct = N'0',@Revenue = N'31.38亿',@RevenueYoy = N'46.64',@RevenueQoq = N'-13.94',@Profit = N'8546.11万',@ProfitYoy = N'113.62',@ProfiltQoq = N'-97.51',@NAVPerUnit = N'2.9827',@ROE = N'1.44',@CashPerUnit = N'0.2649',@GrossProfi... |
<reponame>SkillsFundingAgency/DC-Alpha-EasyWrapperPaaS
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Report].[GetEFAMathsAndEnglishReportData]') AND type in (N'P', N'PC'))
DROP PROCEDURE [Report].[GetEFAMathsAndEnglishReportData]
GO
CREATE PROCEDURE [Report].[GetEFAMathsAndEnglishReportData]
@... |
INSERT INTO frequencies (name, sdmx_id, title)
VALUES
(
'annual', 'A',
hstore(ARRAY[['en', 'Annual'], ['fr', 'Annuelle']])
),
(
'semester', 'S',
hstore(ARRAY[['en', 'Half-yearly, semester'], ['fr', '']])
),
(
'quarterly', 'Q',
hstore(ARRAY[['en', 'Quarterly'], ['fr', 'Trimestriel']])
),
(
'monthly', 'M',
... |
<filename>tests/HSPHP/import.sql
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- База данных: `HSPHP_test`
--
-- --------------------------------------------------------
--
-- Структура таблицы `read1`
--
DROP TABLE IF EXISTS `read1`;
CREATE TABLE `read1` (
`key` int(11) NOT NULL,
`date` date NOT NULL,
`float` fl... |
<filename>src/test/resources/async3.test_2.sql
-- async3.test
--
-- execsql {SELECT * FROM abc}
SELECT * FROM abc |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.