sql stringlengths 6 1.05M |
|---|
<reponame>mohbadar/digit-bpa<filename>egov/egov-egi/src/main/resources/db/migration/main/V20191115094905__egi_remove_userroletemp_add_roleconstraint.sql
INSERT INTO state.EG_USERROLE (userid, roleid)
SELECT userid,roleid FROM state.TEMP_EG_USERROLE;
DROP TABLE state.TEMP_EG_USERROLE;
ALTER TABLE state.eg_userrole AD... |
/*
VerseBot for reddit
By <NAME>
create_book_table.sql
Copyright (c) 2015 <NAME> (MIT License)
*/
CREATE TABLE book_stats (
id INTEGER PRIMARY KEY,
book TEXT,
t_count INTEGER DEFAULT 0,
last_used DATETIME DEFAULT NULL
);
INSERT INTO book_stats (book) VALUES
('Genesis'),
('Exodus'),
('Leviti... |
<reponame>stevencyrway/quasar
DROP TABLE IF EXISTS public.campaign_info_ashes_snapshot;
CREATE TABLE public.campaign_info_ashes_snapshot AS (
SELECT c.field_campaigns_target_id as campaign_node_id,
n2.title as campaign_node_id_title,
c.entity_id as campaign_run_id,
n1.title as campaign_run_i... |
if object_id('libros') is not null
drop table libros;
create table libros(
codigo int identity,
titulo varchar(40) not null,
autor varchar(30),
editorial varchar(15),
precio float
);
go
insert into libros (titulo,autor,editorial,precio)
values('<NAME>','Borges','Emece',23);
SELECT * FROM libros
ins... |
<reponame>applikatoni/applikatoni<gh_stars>100-1000
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE deployments (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
user_id INTEGER,
application_name TEXT,
target_name TEXT,
commit_sha TEXT,
comment TEXT,
state TEXT,... |
-- This script was generated by a beta version of the ERD tool in pgAdmin 4.
-- Please log an issue at https://redmine.postgresql.org/projects/pgadmin4/issues/new if you find any bugs, including reproduction steps.
BEGIN;
CREATE TABLE IF NOT EXISTS public.cities
(
id smallint NOT NULL,
name character varying(... |
<reponame>2MAX-io/php-classifieds
INSERT INTO `listing` (`id`, `category_id`, `user_id`, `expiration_date`, `admin_activated`, `admin_rejected`, `admin_removed`, `user_deactivated`, `user_removed`, `featured`, `featured_until_date`, `featured_priority`, `order_by_date`, `first_created_date`, `last_edit_date`, `admin_la... |
DROP TABLE IF EXISTS foo;
|
-- MySQL dump 10.13 Distrib 5.6.17, for Win64 (x86_64)
--
-- Host: localhost Database: exam_system
-- ------------------------------------------------------
-- Server version 5.6.22-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS... |
<reponame>informaticslab/site<gh_stars>1-10
-- Adding ipb_allow_usertalk for blocks
ALTER TABLE /*$wgDBprefix*/ipblocks
ADD ipb_allow_usertalk bool NOT NULL default 1;
|
<reponame>evansd/sqlite-parquet-vtable
select int64_4 from nulls1 where int64_4 >= 49000000000
50000000000
49000000000
|
<gh_stars>100-1000
use ks;
flush logs;
create table stu (
id int(11) NOT NULL,
name varchar(40) NOT NULL,
age int(11) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 1
begin;
insert into stu(id,name,age) values(10,"hello1",101);
insert into stu(id,name,age) values(12,"hello2",102);
update stu ... |
<filename>database/CombineTwoTables.sql
# https://oj.leetcode.com/problems/combine-two-tables/
select FirstName, LastName, City, State from Person Left join Address on Person.PersonId = Address.PersonId;
|
-- 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';
-- -----------------------------------------------------
-- Schema SENA
-- -... |
DROP TABLE IF EXISTS mailer CASCADE;
CREATE TABLE mailer (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
queue_name CHAR(16) NOT NULL,
mail TEXT NOT NULL,
created TIMESTAMP DEFAULT now() ... |
-- @testpoint:opengauss关键字Instead(非保留),作为用户组名
--关键字不带引号-成功
drop group if exists Instead;
create group Instead with password '<PASSWORD>';
drop group Instead;
--关键字带双引号-成功
drop group if exists "Instead";
create group "Instead" with password '<PASSWORD>';
drop group "Instead";
--关键字带单引号-合理报错
drop group if exists 'In... |
--create function return table , no BEGIN and END in this case
create function Test (@TZ int)
returns table
as
return
(
select 1 AS s FROM dbo.Table1
)
GO
--create function return date_type
Create Function dbo.FooBar(
@p1 nVarchar(4000)
)
Returns int
As
Begin
return 123;
END
GO
--create ... |
<reponame>arindamdeyofficial/RationcardWindowsApp
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sp_WrongCard_Cust_operate]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[Sp_WrongCard_Cust_operate]
GO
--EXEC Sp_WrongCard_Cust_operate 1, 'VIEW'
--EXEC Sp_WrongCard_Cust_operate 1, 'DELETE... |
--
-- <NAME>.
-- Prepared SQL queries for 'ClockDifference' definition.
--
--
-- SELECT template for table `ClockDifference`
--
SELECT `_class`, `diff` FROM `ClockDifference` WHERE 1;
--
-- INSERT template for table `ClockDifference`
--
INSERT INTO `ClockDifference`(`_class`, `diff`) VALUES (?, ?);
--
-- UPDATE tem... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 08, 2020 at 10:00 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>Tambunan1991/Laravel_AgusAntoni
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 30, 2020 at 04:07 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SE... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 100122
Source Host : localhost:3306
Source Database : ace
Target Server Type : MYSQL
Target Server Version : 100122
File Encoding : 65001
Date: 2017-07-17 00:50:26
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... |
<reponame>SpinlockLabs/GitSQL
CREATE OR REPLACE FUNCTION __do_create_commit_type__()
RETURNS VOID
AS $BODY$
BEGIN
IF NOT EXISTS(SELECT 1
FROM pg_type
WHERE typname = 'commit')
THEN
CREATE TYPE commit AS (
hash TEXT,
tree TEXT,
parent TEXT[]... |
<reponame>iloveloveyou/sql-diaries<filename>oracle/sessions/sessions_by_user.sql
--
-- User sessions on the database
--
-- Tested on: 10g, 11g
--
SELECT
a.spid pid,
b.sid,
b.serial#,
b.machine,
b.username,
b.server,
b.osuser,
b.program
FROM v$session b, v$process a
WHERE
b.paddr = a.addr
AND TYPE = 'USER... |
<reponame>TrainingByPackt/Beginning-MySQL<filename>lesson_2/activity_b.sql
-- Step (2)
INSERT INTO teacher_student
(student_id, subject_id, teacher_id, start_date, end_date)
VALUES
(4, 2, 2, '2018-05-1', '2018-08-30'),
(5, 3, 3, '2018-05-15', '2018-08-30'),
(6, 3, 5, '2018-05-10', '2018-08-30'),
(7, 4, 6, '2... |
<reponame>igorwessel/naruto_api
INSERT INTO "Ninja" ("id", "name", "birthdate", "specie", "status", "sex", "bloodType", "ninjaRegistration", "academyGradAge", "chuninPromAge") VALUES
(1, E'A (Primeiro Raikage)', E'1 de Dezembro', E'Humano', E'Morto', E'Masculino', E'O', NULL, NULL, NULL),
(2, E'A (Quarto Raikage)', E'1... |
<reponame>ShiSheng233/Hello-2022
-- phpMyAdmin SQL Dump
-- version 4.4.15.10
-- https://www.phpmyadmin.net
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 S... |
-- 2019-07-25T12:39:47.092Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Tab (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Tab_ID,AD_Table_ID,AD_Window_ID,AllowQuickInput,Created,CreatedBy,EntityType,HasTree,ImportFields,InternalName,IsActive,IsAdvancedTab,IsCheckParentsChanged,IsGenericZ... |
<reponame>safinbot/hedera-mirror-node
-- Change the values below if you are not installing via Docker
\set dbHost '127.0.0.1'
\set dbPort '5432'
\set dbName 'mirror_node'
\set dbSchema 'public'
\set grpcPassword '<PASSWORD>'
\set grpcUsername 'mirror_grpc'
\set importerPassword '<PASSWORD>'
\set importerUsername 'mirr... |
<reponame>chalice19/ClickHouse
SELECT 'Const Offset';
select 1 as offset, 'Hello' as s, subString(bin(s), offset), bin(bitSlice(s, offset));
select 2 as offset, 'Hello' as s, subString(bin(s), offset), bin(bitSlice(s, offset));
select 3 as offset, 'Hello' as s, subString(bin(s), offset), bin(bitSlice(s, offset));
se... |
<filename>sql/update_status.sql
CREATE OR REPLACE FUNCTION public.update_status () RETURNS trigger AS
$BODY$
DECLARE
balance NUMERIC;
v_bm_accounts_id TEXT;
BEGIN
IF TG_OP = 'UPDATE' OR TG_OP = 'DELETE' THEN
v_bm_accounts_id = OLD.bm_accounts_id;
ELSE
v_bm_accounts_id = NEW.bm_... |
{{ retrieve_edfi_records_from_data_lake('base_edfi_student_program_associations') }}
select
date_extracted as date_extracted,
school_year as school_year,
id as id,
parse_date('%Y-%m-%d', json_value(data, "$.begin... |
<filename>src/test/tinc/tincrepo/mpp/gpdb/tests/storage/filerep_end_to_end/sync1/sql/skip/sync1_co_alter_part_exchange_default_part.sql
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
--
-- SYNC1 CO TABLE 1
--
CREATE TABLE sync1_co_alter_part_exchange_default_part1 (
unique1 ... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 03, 2020 at 12:05 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Database: `a... |
-- <NAME>
-- february 26 2022
-- insert cusine
USE [CapstoneRecipeDatabase]
GO
INSERT INTO [dbo].[Cuisine]
([Id]
,[Region]
,[Country])
VALUES
(0, '', ''),
(1, 'american', 'united states'),
(2, 'carribean', ''),
(3, 'french', 'france'),
... |
<reponame>SKalt/pg_sql_parser_tests
void
amparallelrescan (IndexScanDesc scan);
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 13 Jul 2020 pada 05.02
-- Versi server: 10.4.13-MariaDB
-- Versi PHP: 7.2.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 10, 2020 at 07:28 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:00";
/*!40101 SET @OLD... |
ALTER TABLE medical_appointments ALTER COLUMN state_appointments SET default 2
ALTER TABLE medical_appointments ALTER COLUMN data_creation_appointments SET default now()
SELECT sch.id_schedule, mass.id_user, tus.nombre_tipo, us.name, us.apellidos, sch.name_schedules, sch.schedules_start, sch.schedules_end FROM med... |
INSERT INTO burgers(burger_name)
VALUES ('Cheeseburger'),
('Turkey Burger'),
('Black & Blue Burger'),
('Bacon, Cheddar Burger'); |
--Drop table items
--Go
SELECT Links.Heading, Links.PageNo, Images2.Path, Sets.SetId, Images2.Id as ImageId INTO SetImages
FROM Links
INNER JOIN Links2 ON Links.PageNo=Links2.PageNo
INNER JOIN Images2 ON Links2.FileName = Images2.FileName
INNER JOIN Sets ON (Sets.Year + ' ' + Sets.Description) = Links.Headi... |
/*
This is the msgr relational DB
*/
GRANT ALL PRIVILEGES ON DATABASE msgr TO msgr;
CREATE SCHEMA IF NOT EXISTS msgr;
-- The main msgr user table
CREATE TABLE IF NOT EXISTS msgr.msgr_user (
MsgrUserId SERIAL NOT NULL,
UserName VARCHAR(100) NOT NULL CHECK (char_length(Use... |
INSERT INTO reserva_divulgacao (id_divulgacao, ra_aluno_comprador, quantidade, status_reserva) VALUES
($1, $2, $3, $4) |
<filename>project.web/standard.libray/crud.user.singleton/pgdmp/gostandard.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.4 (Ubuntu 12.4-1.pgdg20.04+1)
-- Dumped by pg_dump version 12.4 (Ubuntu 12.4-1.pgdg20.04+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_sessi... |
<reponame>287/sqlgenerate
-- original: fts1porter.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
CREATE VIRTUAL TABLE t1 USING fts1(word, tokenize Porter)
;DELETE FROM t1_term;
DELETE FROM t1_content;
INSERT INTO t1(word) VALUES(sub_pfrom);
SELECT term FROM t1_term; |
<gh_stars>10-100
-- IFS-5919
UPDATE section SET display_in_assessment_application_summary=true
WHERE section_type='TERMS_AND_CONDITIONS'; |
INSERT INTO "Jutsu" ("id", "name", "description", "kanji", "romaji", "portugues", "games", "mangaPanini", "tvBrasileira", "range", "rank", "handSeals") VALUES
(1999, E'Salgueiro do Estilo Konoha', E'O usuário faz movimentos ondulares para trás com sua espada, que, quando visto pelo alvo bloqueia-os em um genjutsu que ... |
/*
Navicat Premium Data Transfer
Source Server : BOOKKEEP
Source Server Type : Oracle
Source Server Version : 190000
Source Host : localhost:1521
Source Schema : BOOKKEEPER
Target Server Type : Oracle
Target Server Version : 190000
File Encoding : 65001
... |
# Time: O(nlogm)
# Space: O(n + m)
SELECT seller_name
FROM seller s
WHERE NOT EXISTS
(
SELECT 1
FROM orders o
WHERE s.seller_id = o.seller_id AND o.sale_date >= '2020-01-01'
)
ORDER BY 1;
|
delete from card;
insert into card values(0, "name01", "summary", "thumbnail", 0, 0); |
/*
SQLyog Ultimate v10.00 Beta1
MySQL - 5.5.53 : Database - zz
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREI... |
SELECT
i_item_id,
i_item_desc,
i_current_price
FROM ${database}.item, ${database}.inventory, ${database}.date_dim, ${database}.catalog_sales
WHERE i_current_price BETWEEN 68 AND 68 + 30
AND inv_item_sk = i_item_sk
AND d_date_sk = inv_date_sk
AND d_date BETWEEN cast('2000-02-01' AS DATE) AND (cast('2000-02-0... |
DROP TABLE IF EXISTS user_groups;
|
<filename>microservices/appliance-maintenance-management/microservices/maintenance-organisation-service/src/main/resources/data.sql
INSERT INTO addresses(id, address_line_1, address_line_2, city, state, country, postal_code, longitude, latitude) SELECT 1, 'House Name', 'Street Name', 'City', 'County', 'Country', '0000'... |
-- system_patches
INSERT INTO `system_patches` (`issue`, `created`) VALUES ('POCOR-3606', NOW());
-- table `user_nationalities`
RENAME TABLE `user_nationalities` TO `z_3606_user_nationalities`;
DROP TABLE IF EXISTS `user_nationalities`;
CREATE TABLE IF NOT EXISTS `user_nationalities` (
`id` char(64) COLLATE utf8mb4... |
<filename>dms/v_table_index_usage.sql<gh_stars>1-10
--
-- Name: v_table_index_usage; Type: VIEW; Schema: public; Owner: d3l243
--
CREATE VIEW public.v_table_index_usage AS
SELECT pg_stat_all_indexes.schemaname AS schema_name,
pg_stat_all_indexes.relname AS table_name,
pg_stat_all_indexes.indexrelname A... |
-- phpMyAdmin SQL Dump
-- version 4.0.10.10
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1:3306
-- Generation Time: Mar 17, 2016 at 10:01 PM
-- Server version: 5.5.45
-- PHP Version: 5.4.44
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 14, 2020 at 10:26 AM
-- 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:00";
/*!40101 SET @OLD... |
<filename>hackerrank-solutions/sql/Advanced Select/Occupations.sql
SELECT MIN(Doctor),MIN(Professor),MIN(Singer),MIN(Actor)
FROM(
SELECT CASE WHEN OCCUPATION='Doctor' THEN NAME END AS Doctor,
CASE WHEN OCCUPATION='Actor' THEN NAME END AS Actor,
CASE WHEN OCCUPATION='Singer' THEN NAME END AS Singer,
... |
<filename>database_changes/subscription_plans07102020.sql
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 06, 2020 at 10:11 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00"... |
start transaction;
create user 'shipmee-user'@'%' identified by password <PASSWORD>';
create user 'shipmee-manager'@'%' identified by password '*<PASSWORD>';
# Privilegios para `shipmee-manager`@`%`
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, ... |
<reponame>nelsonssjunior/CURSO-ANALISTA-SQL-SERVER
CREATE TABLE empregados(
id_empregados int primary key,
nome varchar(30),
sobrenome varchar (50),
salario decimal(8,2),
email varchar,
data_admissao date,
cargo_id int,
id_departamento int
);
CREATE TABLE departamentos (
... |
update user_progress set display = display + 1, last_modif = CURRENT_DATE WHERE user_string = $1; |
--- requires ./router.sql
CREATE OR REPLACE FUNCTION app.MAIN (data json)
RETURNS json AS $$
SELECT row_to_json(
app.route(json_populate_record(null:: app.request, data)),
false
);
$$ LANGUAGE SQL;
|
<filename>db_skilltest.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 14, 2019 at 04:24 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 5.6.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET... |
<filename>db/seeds.sql
INSERT INTO burgers (name) VALUES
("Bacon Cheeseburger"),
("Veggie Burger"),
("Turkey Cheeseburger"),
("Boring Burger"),
("Exciting Burger"); |
<gh_stars>0
Declare @CatID as INT
, @ReportGroupID as INT
, @ReportID as INT
, @QueryID AS INT;
IF EXISTS(Select CatID FROM aa_Category WHERE Category = N'CDCCT_Report')
BEGIN
DELETE FROM dbo.aa_Category WHERE Category = 'CDCCT_Report'
DELETE FROM dbo.aa_XLMaps WHERE xlCatID = (Select CatID FROM aa_Category
... |
-- 1.1. Creazione della vista:
CREATE OR REPLACE VIEW stip_proposto (
cod, nome, attuale, proposto, capo
) AS SELECT i.cod, i.nome || ' ' || i.cognome, i.stipendio, CASE
WHEN EXTRACT(YEAR FROM i.data_assunto) <= '2012' THEN i.stipendio * 1.15
WHEN EXTRACT(YEAR FROM i.data_assunto) = '2013' THEN i.stipendio ... |
with
numbers as (
select
row_number() over(order by true) as n
from -- use any table that has ample rows
users
)
select
getdate() - n * interval '1 second'
from
numbers |
<filename>BotCodes/TwitterBoxBot.sql
CREATE TABLE `_bot_data` (
`_id` int(11) NOT NULL,
`_name` char(64) NOT NULL,
`_bd` int(11) NOT NULL,
`_api` int(11) NOT NULL,
`_insert` int(11) NOT NULL,
`_update` int(11) NOT NULL
);
CREATE TABLE `_tweet_data` (
`_id` int(11) NOT NULL,
`_tweet_id` char(128) NOT NU... |
<filename>migrations/2018-06-05-072750_add_description_to_services/down.sql<gh_stars>10-100
ALTER TABLE services DROP COLUMN description;
|
<filename>src/test/resources/trans2.test_1.sql<gh_stars>100-1000
-- trans2.test
--
-- execsql {
-- PRAGMA cache_size=100;
-- CREATE TABLE t1(
-- id INTEGER PRIMARY KEY,
-- u1 TEXT UNIQUE,
-- z BLOB NOT NULL,
-- u2 TEXT UNIQUE
-- );
-- }
PRAGMA cache_size=100;
CREATE TABLE t1(
id INT... |
<reponame>jdkoren/sqlite-parser<filename>src/test/resources/bind.test_51.sql
-- bind.test
--
-- execsql {
-- SELECT typeof(x), length(x), quote(x),
-- length(cast(x AS BLOB)), quote(cast(x AS BLOB)) FROM t3
-- }
SELECT typeof(x), length(x), quote(x),
length(cast(x AS BLOB)), quote(cast(x AS BLOB)) F... |
-- --------------------------------------------------------
--
-- Table structure for table `stops`
--
DROP TABLE IF EXISTS `stops`;
CREATE TABLE IF NOT EXISTS `stops` (
`StopName` varchar(20) NOT NULL,
`StopType` varchar(10) NOT NULL,
PRIMARY KEY (`StopName`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dum... |
<filename>models/incremental.sql<gh_stars>0
{{
config(
materialized='incremental',
unique_key='md5_value'
)
}}
select s.ST_CD,s.STATE_NAME,s.MD5_VALUE from "DEMO_DB"."PUBLIC"."STATE" s
left join "DEMO_DB"."PUBLIC"."INCREMENTAL" t
on s.md5_value = t.md5_value
{% if is_incremental() %... |
CREATE OR REPLACE VIEW pantry.guest_visits_count_all
AS SELECT guest_visits.date_visit, count(guest_visits.date_visit) AS date_counts
FROM pantry.guest_visits
GROUP BY guest_visits.date_visit
ORDER BY guest_visits.date_visit DESC;
|
<filename>jcms/sql/2007100201.sql
--
-- add settings descriptions, used on doc
--
UPDATE appinfo SET appinfo_value='2007100201' WHERE appinfo_name='db_version';
ALTER TABLE settings ADD COLUMN description varchar;
UPDATE settings SET description='Default mode of the content editor: HTML/WYSIWYG' WHERE setting_name='... |
<gh_stars>10-100
--
-- Table structure for table `google_statistics`
--
CREATE TABLE `google_statistics` (
`slug` varchar(512) DEFAULT NULL,
`key` varchar(512) DEFAULT NULL,
`group` varchar(255) DEFAULT NULL,
`data_source` varchar(255) DEFAULT NULL,
`page_views` int(11) DEFAULT NULL,
`unique_page_views` in... |
<reponame>guardian/facia-tool
# --- !Ups
ALTER TABLE fronts ADD COLUMN can_rename BOOLEAN NOT NULL DEFAULT FALSE;
# --- !Downs
ALTER TABLE fronts DROP COLUMN can_rename;
|
<reponame>SocialGouv/emjpm
CREATE OR REPLACE FUNCTION public.search_services(search text)
RETURNS SETOF services
LANGUAGE sql
STABLE
AS $function$
SELECT *
FROM services
WHERE
search IS NULL OR search <% CONCAT_WS(' ', etablissement, siret, code_postal, ville, adresse, nom, prenom, email, id)
O... |
<reponame>tuyravy/pos<filename>DB/RSK_Group_20191122.sql
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.35-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Version: 9.5.0... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 06-Ago-2020 às 02:00
-- Versão do servidor: 10.4.13-MariaDB
-- versão do PHP: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
WITH dates AS (
SELECT
dd::date as month
FROM generate_series(
'2020-10-01'::DATE
,NOW()
,'1 month'::interval
) dd
)
, products AS (
SELECT
sku,
description as name,
month
FROM
public.operations_product p
JOIN public.operations_... |
<filename>src/test/resources/db/associated/insert.sql
INSERT INTO ASSOCIATED (UID_ASSOCIATED, NAME, CPF, CREATED_AT)
VALUES(1, '<NAME>', '22191757073', '2020-04-26 18:47:52.69'); |
/*
Zadatak 2
Napisati upit koji prikazuje narudzbe obavljene u periodu od 01.07.2011 - 31.12.2011 god.
Uslov je da se prikazu narudzbe gdje ukupan iznos veci od 100.000
*/
USE AdventureWorks2014
SELECT [SalesOrderNumber], CONVERT(nvarchar, [OrderDate], 104) AS 'Datum prodaje', [TotalDue]
FROM Sales.SalesOrderHead... |
# 03. Find First Names of All Employes
#
# Write a SQL query to find the first names of all employees in the departments
# with ID 3 or 10 and whose hire year is between 1995 and 2005 inclusively.
# Order the information by id.
USE soft_uni;
SELECT e.first_name
FROM employees e
WHERE
e.department_id IN(3, 10)
AND
... |
SELECT C.NAME FROM CITY AS C WHERE COUNTRYCODE = "USA" AND POPULATION > 120000;
|
--------------------------------------------------------
-- File creato - giovedì-gennaio-15-2015
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Table DEGENTI
--------------------------------------------------------
CREATE TABLE "SCOT... |
-- file:drop_if_exists.sql ln:157 expect:true
DROP AGGREGATE test_aggregate_exists(*)
|
<filename>src/test/resources/sql/select/ca672e19.sql
-- file:uuid.sql ln:45 expect:true
SELECT COUNT(*) FROM guid1 WHERE guid_field < '22222222-2222-2222-2222-222222222222'
|
ALTER TABLE "public"."preregister_lifebank" ADD COLUMN "email_verified" boolean NOT NULL DEFAULT false;
|
<reponame>markpolyak/sqlfluff
--noqa: disable=L034
SELECT DISTINCT
TO_CHAR(a, 'YYYY-MM-dd HH:MM:ss') as the_date,
a AS b
FROM
table1;
SELECT
col_a a,
col_b b, --noqa: disable=L012
col_c c,
col_d d, --noqa: enable=L012
col_e e,
col_f f,
col_g g, --noqa
col_h h,
col_i i, ... |
CREATE TABLE IF NOT EXISTS "password_token" (
id SERIAL PRIMARY KEY NOT NULL,
user_id INTEGER REFERENCES public.user(id) NOT NULL,
token TEXT NOT NULL,
expiration DATE NOT NULL,
used BOOLEAN DEFAULT FALSE
);
|
<reponame>kellina/loja-slime-back
CREATE TYPE "order_status" AS ENUM (
'cart',
'ordered'
);
CREATE TABLE "users" (
"id" SERIAL PRIMARY KEY,
"uuid" varchar(40) UNIQUE NOT NULL,
"full_name" varchar(50),
"created_at" timestamp DEFAULT (now())
);
CREATE TABLE "products" (
"id" SERIAL PRIMARY KEY,
"name" v... |
<filename>exercises/Chapter-16.sql
--------------------------------------------------------------
-- Practical SQL: A Beginner's Guide to Storytelling with Data
-- by <NAME>
-- 1st Edition
-- Chapter 16 "Try It Yourself" Exercises
--------------------------------------------------------------
/*
The exercise is redo... |
<reponame>spiliti/boma
UPDATE EG_USER SET name='Citizen' where username='9999999999';
UPDATE EG_USER SET name='<NAME>' where username='8888888888';
|
<filename>BlogCFC/install/sqlserver.sql<gh_stars>0
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblBlogCategories]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblBlogCategories]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblBlogComments]') ... |
<reponame>skuzi/Paradigms-HW
pragma encoding = "utf-8";
drop table if exists Country;
create table Country (
Code varchar(3) primary key not null,
Name varchar(52) not null unique,
SurfaceArea real not null,
Population integer not null,
GovernmentForm varchar(45) not null
);
drop table if exists City;
creat... |
<reponame>yorch81/DicDb
/**
* Obtiene una tabla con los campos de una Tabla
*
* @category SQL/PSM Stored Procedures
* @package usp_Obtn_Campos
* @copyright Copyright 2014 <NAME>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @version 1.0.0, 2014-09-01
* @author <NAME> (<EMAIL>)
* @param string... |
<gh_stars>0
# Riceballs schema
# --- !Ups
CREATE SEQUENCE riceball_id_seq;
CREATE TABLE riceball (
id integer NOT NULL DEFAULT nextval('riceball_id_seq'),
name varchar(255),
store_id integer,
image_url varchar(255),
description varchar(255)
);
CREATE TABLE store (
id integer NOT NULL,
na... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.