sql stringlengths 6 1.05M |
|---|
/*** Feedback_UpdateFeedback ***/
CREATE PROCEDURE [dbo].[dnn_Feedback_UpdateFeedback]
@ModuleID int,
@FeedbackID int,
@Subject nvarchar(200),
@Message nvarchar(1000),
@UserId int
AS
UPDATE dbo.[dnn_Feedback]
SET
[Subject] = @Subject,
[Message] = @Message,
LastModifiedByUserID = @UserId,
LastModifiedOnD... |
ALTER TABLE [dbo].[Tags]
ADD CONSTRAINT [UK_Tags_TagName]
UNIQUE (TagName)
GO
|
-- sqlite3 -init fips6-4_county_codes.sql usps-actual.db
create table fipscodes ( st char(2), fips char(2) not null, fipc char(3) not null, county char(35), primary key (fips,fipc) on conflict abort );
--.separator "\t"
.mode tabs
.import "fips6-4_county_codes.txt" fipscodes
vacuum analyze;
|
<reponame>fangshirui/quik-nav-back-end
create table website
(
id int auto_increment
primary key,
name varchar(30) null,
url varchar(200) null,
tagId int null,
`order` int null,
dateTime datetime not null
)
comment '网站';
INSERT INTO website (... |
-- https://duneanalytics.com/queries/60094
-- ETH2x-FLI Supply Breakdown
----------------------------------------------------------
-- Uniswap v3
----------------------------------------------------------
WITH fli_uniswap_v3_supply AS (
WITH pool as (
select
pool,
token0,... |
-- file:rules.sql ln:372 expect:true
insert into rtest_nothn1 values (39, 'don''t want this')
|
-- These must be run together to avoid errors --
ALTER TABLE PROTOCOL
DROP CONSTRAINT FK_PROTOCOL_DOCUMENT;
ALTER TABLE PROTOCOL MODIFY (DOCUMENT_NUMBER VARCHAR2(40));
ALTER TABLE PROTOCOL_DOCUMENT MODIFY (DOCUMENT_NUMBER VARCHAR2(40));
ALTER TABLE PROTOCOL
ADD CONSTRAINT FK_PROTOCOL_DOCUMENT FOREIGN KEY (DOCUMENT... |
<gh_stars>1-10
GO
PRINT N'Altering [PCS].[Scheme]...';
GO
ALTER TABLE [PCS].[Scheme]
ADD [SchemeName] NVARCHAR (16) NULL,
[IbisCustomerReference] NVARCHAR (10) NULL,
[ObligationType] INT NULL,
[CompetentAuthorityId] UNIQUEIDENTIFIER NULL;
GO
PRINT N... |
<reponame>dubdabasoduba/estatio<filename>estatioapp/dom/src/main/resources/scripts/EST-536/EST-536--040-drop-columns.sql
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
---------------------------
ALTER TABLE [dbo].[CommunicationChannel] DROP COLUMN [ownerPartyId]
GO
----------------------... |
-- Add isRequired for questions in the preference elicitation section
insert into preferences_options
(lu_options_id, value, questions_id)
select 42,'true',q.id
from forms as f
inner join sections as s
inner join questions as q
inner join preferences_text as pt
inner join preferences_types as ptypes
where f.id = 3
a... |
<gh_stars>10-100
CREATE TABLE pictures (
id INTEGER PRIMARY KEY AUTOINCREMENT,
digest CHAR(32) NOT NULL
);
CREATE TABLE sentpictures (
id INTEGER PRIMARY KEY AUTOINCREMENT,
url VARCHAR(255) NOT NULL,
sender VARCHAR(100) NOT NULL,
picture_id INTEGER NOT NULL
);
CREATE TABLE signatures (
id INTEGER PRIMAR... |
<reponame>tburdett/goci<filename>goci-core/goci-db-binding/src/main/resources/db/migration/V1.9.9_041__Remove_haplotype_descr_proxy_snps.sql
/*
################################################################################
Migration script to change the locus description to the migrated description
for haplotypes
D... |
<gh_stars>0
/*
Warnings:
- You are about to drop the column `username` on the `Auth` table. All the data in the column will be lost.
- Added the required column `email` to the `Auth` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREA... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 16, 2020 at 07:47 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th9 02, 2020 lúc 08:32 AM
-- Phiên bản máy phục vụ: 10.4.13-MariaDB
-- Phiên bản PHP: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 24-09-2018 a las 17:46:02
-- Versión del servidor: 10.1.32-MariaDB
-- Versión de PHP: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
<reponame>yuting1214/Leetcode_Database
# Table
CREATE TABLE Employee
(
employee_id int,
team_id int
);
INSERT INTO Employee ( employee_id , team_id )
VALUES
(1, 8),
(2, 8),
(3, 8),
(4, 7),
(5, 9),
(6, 9);
# Solution 1 (self, correct)
SELECT Employee.employee_id, count_table... |
/*
08-27-2021 - Refactored views, removing any views using the old names
*/
-- delete ActiveSites View
IF OBJECT_ID('dbo.ActiveSites', 'V') IS NOT NULL
DROP VIEW dbo.ActiveSites
GO
-- delete DeletedSites View
IF OBJECT_ID('dbo.DeletedSites', 'V') IS NOT NULL
DROP VIEW dbo.DeletedSites
GO
-- delete AllGrou... |
CREATE SYNONYM [dbo].[SaleDetail]
FOR [External].[SaleDetail];
|
<reponame>codepopular/clippingpath
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 15, 2019 at 06:26 AM
-- Server version: 10.1.37-MariaDB-cll-lve
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTI... |
<reponame>edigonzales/oereb-gretljobs
SELECT t_id AS t_id, -1::int8 AS t_basket, 'dm01vch24lv95dnomenklatur_nknachfuehrung'::varchar(60) AS t_type, NULL::varchar(200) AS t_ili_tid,
nbident, identifikator, beschreibung, perimeter, gueltigereintrag, datum1
FROM agi_dm01avso24.nomenklatur_nknachfuehrung;
|
<filename>ufnStr_SubstringFromLastOccurrence.sql
IF OBJECT_ID(N'dbo.ufnStr_SubstringFromLastOccurrence', N'TF') IS NOT NULL
DROP FUNCTION [dbo].[ufnStr_SubstringFromLastOccurrence];
GO
/********************************************************
* Description: Returns string from the last occurrence of the given char... |
/* View for selecting data to be displayed on samples page */
CREATE OR REPLACE VIEW view_samples_display AS
SELECT
samples.sample_id AS sample_id,
samples.sample_name AS sample_name,
samples.sample_comment AS sample_comment,
collection.collection_date AS collection_date,
collection.author_group_name AS... |
create table "HR".ADMIN
(
EMAIL VARCHAR(50),
PASSWORD VARCHAR(50)
);
create table "HR".BOOK
(
ID VARCHAR(50) not null primary key,
NAME VARCHAR(100),
LANGUAGE VARCHAR(100),
AUTHOR VARCHAR(200),
FLAG VARCHAR(10)
);
create table "HR".CONTACTREQUEST
(
ID VARCHAR(20) not null primary key,
FIRSTNAME VARCHAR(50)... |
<gh_stars>0
-- https://www.sqlshack.com/using-memory-optimized-tables-to-replace-sql-server-temp-tables-and-table-variables/ |
<gh_stars>1-10
CREATE TABLE [dbo].[dnn_EasyDNNfieldsTemplateItems] (
[FieldsTemplateID] INT NOT NULL,
[CustomFieldID] INT NOT NULL,
[Position] INT NOT NULL,
CONSTRAINT [PK_dnn_EasyDNNfieldsTemplateItems] PRIMARY KEY CLUSTERED ([FieldsTemplateID] ASC, [CustomFieldID] ASC),
CONSTRAINT [FK_... |
SELECT TOP 10
FirstName,
LastName,
DepartmentID
FROM Employees AS e1
WHERE Salary > (
SELECT
AVG(Salary)
FROM Employees AS e2
WHERE e1.DepartmentID = e2.DepartmentID
)
ORDER BY DepartmentID |
CREATE OR REPLACE FUNCTION udf.parse_url(url STRING)
RETURNS STRUCT<
scheme STRING,
authority STRING,
domain STRING,
username STRING,
password STRING,
port STRING,
path STRING,
query STRING,
fragment STRING
>
LANGUAGE js
AS
"""%s
const result = rollup.parse(url, true);
return {
scheme: result.prot... |
-- =============================================
-- Author: <NAME>
-- Create date: 11/07/2013
-- Description: Deletes an insurance policy
-- =============================================
CREATE PROCEDURE [dbo].[h3giInsuranceDeletePolicy]
@policyId INT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra re... |
-- DropForeignKey
ALTER TABLE "laboratoryExam" DROP CONSTRAINT "laboratoryExam_examId_fkey";
-- DropForeignKey
ALTER TABLE "laboratoryExam" DROP CONSTRAINT "laboratoryExam_laboratoryId_fkey";
-- AlterTable
ALTER TABLE "laboratoryExam" ALTER COLUMN "laboratoryId" DROP NOT NULL,
ALTER COLUMN "examId" DROP NOT NULL;
--... |
/**
* Author: robson.costa
* Created: 23/06/2020
*/
-- INSERINDO as Operacões que tem no DB AutoGeral, no banco "emissorfiscal";
-- Será preciso mudar o codigo da operacao venda, na procedure de cadastros de tributacoes
ALTER TABLE emissorfiscal.oper MODIFY dscr VARCHAR(250) NOT NULL;
INSERT INTO emissorfisca... |
--
-- Contenu de la table `smileys`
--
INSERT INTO CB_TABLE_PREFIXsmileys VALUES (1, ':D', 'biggrin.gif', 'oui');
INSERT INTO CB_TABLE_PREFIXsmileys VALUES (2, ':pinch:', 'pinch.gif', 'oui');
INSERT INTO CB_TABLE_PREFIXsmileys VALUES (3, ':blink:', 'blink.gif', 'oui');
INSERT INTO CB_TABLE_PREFIXsmileys VALUES (18, ... |
use config;
insert into config (app_id, config_id, config_data)
values ('user-manager','application',
'{ "appUrl" : "http://localhost:8080" }'
);
insert into config (app_id, config_id, config_data)
values ('user-manager','database',
'{
"url" : "jdbc:mysql://localhost:3306/user_manager",
"usern... |
CREATE TABLE `xmock`.`xmock_user_info` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键',
`realname` VARCHAR(45) NULL COMMENT '真实名字',
`nickname` VARCHAR(45) NULL COMMENT '别名',
`email` VARCHAR(200) NULL COMMENT '邮件地址',
`mobile` INT(11) NULL COMMENT '手机',
`sex` VARCHAR(45) NULL COMMENT '性别',
`country` VARCHAR... |
<gh_stars>0
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.6 (Ubuntu 10.6-0ubuntu0.18.04.1)
-- Dumped by pg_dump version 10.6 (Ubuntu 10.6-0ubuntu0.18.04.1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_co... |
DROP TABLE IF EXISTS `pre__luser_config`;
CREATE TABLE `pre__luser_config` (
`name` varchar(30) NOT NULL DEFAULT '' COMMENT '配置名称',
`value` text COMMENT '配置值',
`tip` text COMMENT '配置说明',
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='配置';
DROP TABLE IF EX... |
<reponame>bcgov/cas-ciip-portal<filename>test_helper_schema/deploy/truncate_function.sql<gh_stars>1-10
-- Deploy test_helpers:truncate_function to pg
-- requires: schema_test_helper
BEGIN;
create or replace function test_helper.clean_ggircs_portal_schema()
returns void as
$function$
begin
execute (select 'TRUN... |
INSERT INTO `m_code` (`code_name`, `is_system_defined`) values
("Constitution", true);
INSERT INTO `m_code` (`code_name`, `is_system_defined`) values
("Main Business Line", true);
ALTER TABLE `m_client` ADD `legal_form_enum` INT(5);
CREATE TABLE `m_client_non_person` (
`id` BIGINT(20) NOT NULL AUTO_INCREMEN... |
-- Name: GetSeriesListByDciodvyScanInstance
-- Schema: posda_phi_simple
-- Columns: ['series_instance_uid']
-- Args: ['dciodvfy_scan_instance_id', 'repeat_scan_instance_id']
-- Tags: ['tag_usage', 'dciodvfy']
-- Description: Show all the dciodvfy scans
select distinct(unit_uid) as series_instance_uid from dciodvfy_uni... |
CREATE DATABASE htest;
|
<reponame>rahul0218/Technophileregion.com
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 24, 2020 at 01:14 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.3.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:0... |
<reponame>Globson/TP-II-Banco-de-dados
/*1*/
SELECT DISTINCT nomeplat
FROM (plataforma AS P NATURAL JOIN compativel_midia) NATURAL JOIN midia AS M
WHERE velocidade_leitura > 100;
/*2*/
SELECT nomeplat, ano_lancamento
FROM plataforma NATURAL JOIN fabricante
WHERE ano_fundacao > 1970;
/*3*/
SELECT nomemid, velocidade_l... |
--Run this script after every merge, pull or rebase
--It will reset the database back to it's original state
drop table UserCredentials;
drop table Admin;
drop table Chat;
drop table Task;
drop table Branch;
drop table Award;
drop table Student;
drop table Project;
drop table ProjectStatus;
drop table Teacher;
drop tab... |
INSERT INTO member (
email,
location,
name,
education,
profession,
member_type_id,
expiration_date,
chapter_id,
employer,
year_of_birth
)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
RETURNING id
|
<reponame>danieldaw17/SportStore
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 17, 2019 at 11:27 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;
SET time_zo... |
SELECT id, BIT_LENGTH(name) AS name, birthday, BIT_LENGTH(race) AS race FROM demographics |
CREATE TABLE [dbo].[MainMenuItem]
(
[Id] INT IDENTITY(1, 1) NOT NULL,
[Text] NVARCHAR(256) NOT NULL,
[Url] NVARCHAR(256) NOT NULL,
[Order] INT NOT NULL,
[CreationDate] DATETIME2(7) NOT NULL,
[LastModifiedDate] DATETIME2(7) NOT NULL,
CONSTRAINT [PK_dbo.MainMenuItem_Id] PRIMARY KEY CLUSTERED ([Id] ASC)
); |
drop table if EXISTS myRecords ;
create table myRecords (
id serial PRIMARY KEY,
country text,
total_confirmed_cases text,
total_deaths_cases text,
total_recovered_cases text,
the_date text
) |
<filename>dbscript/accountledgerbeginninglist.sql
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Mar 19, 2019 at 12:01 PM
-- Server version: 5.7.21
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Datab... |
<filename>protected/data/schema.knowyourmp.dump.sql
-- MySQL dump 10.13 Distrib 5.5.31, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: hotornot
-- ------------------------------------------------------
-- Server version 5.5.31-0ubuntu0.12.04.2-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_S... |
-- Drops the flare db if it exists currently --
DROP DATABASE IF EXISTS flare;
-- Creates the "flare" database --
CREATE DATABASE flare;
-- Use the "flare" database --
USE flare;
-- Create sessions table --
CREATE TABLE `sessions` (
`session_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`exp... |
<reponame>jeffersonfantasia/SQL_Scripts
SELECT DTMOV,
CODCLI,
CODPROD,
SUM (QTCONT) AS QT_TOTAL
FROM (
SELECT M.DTMOV,
E.CODFORNEC AS CODCLI,
M.CODPROD,
M.QTCONT
FROM PCMOV M
INNER JOIN PCNFENT E ON M.NUMTRANSENT = E.NUMTRANSENT
LEFT JOIN VIEW... |
<filename>VIEWS/api/user_role_memberships.sql
CREATE OR REPLACE VIEW api.user_role_memberships AS
SELECT
roles.role_name
FROM role_memberships
JOIN roles
ON roles.role_id = role_memberships.role_id
WHERE role_memberships.user_id = user_id();
|
create or replace function app.duplicate_meal_plan(mealplan_id bigint, p_id bigint) returns app.meal_plan as $$
declare
m app.meal_plan;
entry_ids bigint[];
begin
--create a duplicate meal plan with a different meal plan id and person id p_id but the same contents
INSERT INTO app.meal_plan (name_en, name_fr, person_id... |
<filename>db/sql/3353__alter_proc_vipunentk_dw_p_lataa_OPE.sql
USE [VipunenTK_DW]
GO
/****** Object: StoredProcedure [dbo].[p_lataa_OPE] Script Date: 6.3.2020 12:51:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[p_lataa_OPE] AS
--7.1
truncate table vipunentk.[dbo].[f_Opettaja... |
USE %s;
LOAD DATA LOCAL INFILE '%s'
INTO TABLE timeZones
CHARACTER SET 'UTF8MB4'
IGNORE 1 LINES
(countryCode, timeZoneId, GMT_offset, DST_offset, rawOffset);
|
<reponame>kalintsenkov/SoftUni-Software-Engineering
SELECT s.FirstName,
s.LastName,
COUNT(TeacherId) AS [TeachersCount]
FROM StudentsTeachers AS st
JOIN Students AS s
ON s.Id = st.StudentId
GROUP BY s.FirstName, s.LastName
|
DROP TABLE IF EXISTS people;
CREATE TABLE people (
person_id BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
first_name VARCHAR(20),
last_name VARCHAR(20)
); |
# 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
CREATE TABLE 'user_profile' ('id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 'name' 'VARCHAR(100)' NOT NULL, 'picture' 'VARCHAR(200)', 'address' TEXT);
CREATE TABLE sqlite_sequence(name,seq);
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 27, 2017 at 09:15 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 time_zone = "+00:00";
/*!4... |
INSERT INTO `elements` SET `name` = 'Hydrogen', `symbol` = 'H', `atomic_number` = '1', `atomic_mass` = '1.00794', `group` = '1', `period` = '1';
INSERT INTO `elements` SET `name` = 'Helium', `symbol` = 'He', `atomic_number` = '2', `atomic_mass` = '4.002602', `group` = '18', `period` = '1';
INSERT INTO `elements` SET `n... |
<gh_stars>0
EXEC [EST].[Proc_yjbb_Ins] @Code = N'600841',@CutoffDate = N'2017-09-30',@EPS = N'0.11',@EPSDeduct = N'0',@Revenue = N'26.87亿',@RevenueYoy = N'40.63',@RevenueQoq = N'-11.30',@Profit = N'9609.59万',@ProfitYoy = N'42.09',@ProfiltQoq = N'-13.33',@NAVPerUnit = N'4.1511',@ROE = N'2.70',@CashPerUnit = N'-0.0842',@... |
<reponame>zhoufei9/python<filename>shares.sql
/*
Navicat MySQL Data Transfer
Source Server : 192.168.10.10
Source Server Version : 80021
Source Host : 192.168.10.10:3306
Source Database : homestead
Target Server Type : MYSQL
Target Server Version : 80021
File Encoding : 65... |
<filename>task_system.sql
-- MySQL dump 10.13 Distrib 5.7.29, for Linux (x86_64)
--
-- Host: localhost Database: task_system
-- ------------------------------------------------------
-- Server version 5.7.29-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARAC... |
<reponame>Mark33Mark/newsfeed-python-server
DROP DATABASE IF EXISTS newsfeed_python_db;
CREATE DATABASE newsfeed_python_db; |
<reponame>sanzol-tech/core-app-v2
INSERT INTO `se_email_templates` (`EMAIL_TEMPLATE_ID`,`NAME`,`TAGS`,`SUBJECT`,`PLAIN_BODY`,`HTML_BODY`) VALUES (1,'USER WELCOME','{name};{username};{password}','USER WELCOME','Welcome {name},\r Your user has been created !\r \r Username: {username}\r Password: {password}','Welcome {nam... |
<filename>migrations/sqls/20220316084230-orders-table-up.sql<gh_stars>0
CREATE TABLE orders (
id SERIAL PRIMARY KEY,
user_id INTEGER,
user_info JSON NOT NULL DEFAULT '{}',
qty_count INTEGER NOT NULL DEFAULT 1,
total NUMERIC(18,3) NOT NULL DEFAULT 0,
status INTEGER NOT NULL DEFAULT 1,
confirmed_by INTEGER NOT NUL... |
<reponame>dwiky/SimNotes<filename>simple_notes(1).sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 17, 2016 at 03:12 PM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 7.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!4... |
<reponame>joaolsouzajr/labs<filename>tcchbase/apps/hbcs-comparison/resources/scripts/cassandra/create-table-query3.cql
CREATE KEYSPACE IF NOT EXISTS query
WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
CREATE TABLE IF NOT EXISTS query.q3_posts_by_posthistorytypeid (
posts_Id text,
... |
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pr_MessageExportProtoEntomo]') AND type in (N'P', N'PC'))
DROP PROCEDURE pr_MessageExportProtoEntomo
GO
CREATE PROCEDURE pr_MessageExportProtoEntomo
(
@ProtocoleID INT = NULL
)
AS
BEGIN
BEGIN TRY
BEGIN TRAN
IF OBJECT_... |
<filename>Chapter 9/B05651_CH9_R1_003 - openquery.sql
SELECT * FROM
OPENQUERY(MetadataExcel, 'SELECT * FROM [Report_Items$]') |
<reponame>VasiyaKrishnan/sqlsourabh
use tempdb
go
create table ParamSnif (a int IDENTITY(1,1), b varchar(10))
go
create index NC1 on ParamSnif(b)
SET NOCOUNT ON
Go
declare @i int =0
while @i < 100
begin
insert into ParamSnif values ('Male')
set @i =@i+1
end
Go
declare @i int =0
while @i < 100000
begin
insert into P... |
-- Basic Select
-- https://www.beecrowd.com.br/judge/en/problems/view/2602
SELECT name FROM customers WHERE state = 'RS';
|
CREATE TABLE IF NOT EXISTS `user` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`email` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL,
`first_name` VARCHAR(255) NOT NULL,
`last_name` VARCHAR(255) NOT NULL,
`admission_year` INT UNSIGNED NOT NULL,
`role_id` INT UNSIGNED NOT NULL,
`created_at` DAT... |
<gh_stars>1-10
CREATE TABLE TUser_audits(
nChangeId INT IDENTITY PRIMARY KEY,
Old_UserId INT,
New_UserId INT,
Old_Username VARCHAR(16),
New_Username VARCHAR(16),
Old_Password VARCHAR(16),
New_Password VARCHAR(16),
Old_Name VARCHAR(255),
New_Name VARCHAR(255),
Old_Surname VARCHAR(255... |
<gh_stars>1-10
DROP DATABASE IF EXISTS nc_tutorials_db;
CREATE DATABASE nc_tutorials_db;
\c nc_tutorials_db
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 default_tablespace ... |
/*
Warnings:
- You are about to drop the column `profile` on the `Bookmark` table. All the data in the column will be lost.
- Added the required column `avatar` to the `Bookmark` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `Bookmark` DROP COLUMN `p... |
<reponame>aleilson/launchbase
DROP DATABASE IF EXISTS foodfy
CREATE DATABASE foodfy;
-- recipes
CREATE TABLE "receipts" (
"id" SERIAL PRIMARY KEY,
"chef_id" INT NOT NULL,
"title" TEXT NOT NULL,
"ingredients" text[],
"preparation" text[],
"information" text,
"created_at" timestamp DEFAULT (NOW())
"upd... |
<gh_stars>1-10
#standardSQL
# % mobile pages with sufficient text color contrast with its background
SELECT
COUNTIF(color_contrast_score IS NOT NULL) AS total_applicable,
COUNTIF(CAST(color_contrast_score AS NUMERIC) = 1) AS total_sufficient,
COUNTIF(CAST(color_contrast_score AS NUMERIC) = 1) / COUNTIF(color_cont... |
----------------------------
-- Copyright (C) 2021 CARTO
----------------------------
CREATE OR REPLACE FUNCTION @@RS_PREFIX@@transformations.ST_CENTEROFMASS
(GEOMETRY)
-- (geom)
RETURNS GEOMETRY
IMMUTABLE
AS $$
SELECT @@RS_PREFIX@@transformations.ST_CENTROID($1)
$$ LANGUAGE sql; |
<gh_stars>1-10
-- This file is automatically generated by LogicalPlanToSQLSuite.
SELECT COUNT(a.value), b.KEY, a.KEY
FROM parquet_t1 a, parquet_t1 b
GROUP BY a.KEY, b.KEY
HAVING MAX(a.KEY) > 0
--------------------------------------------------------------------------------
SELECT `gen_attr` AS `count(value)`, `gen_attr... |
drop database if exists pydropbox_test;
create database pydropbox_test;
\connect pydropbox_test
set client_min_messages to debug;
drop extension if exists multicorn cascade;
create extension multicorn;
CREATE SERVER pydropbox_fdw
FOREIGN DATA WRAPPER multicorn
OPTIONS (
wrapper 'pydropbox_fdw.PydropboxFDW'
);
... |
IF NOT EXISTS(SELECT 1 FROM sys.tables WHERE [name] = '{{MigrationTable}}')
CREATE TABLE dbo.[{{MigrationTable}}] (
ScriptsVersion [int] NOT NULL
)
INSERT INTO dbo.[{{MigrationTable}}] (ScriptsVersion)
SELECT 0
WHERE NOT EXISTS(SELECT 1 FROM dbo.[{{MigrationTable}}]) |
USE TableRelations Database
(01)
CREATE TABLE Persons(
PersonID INT PRIMARY KEY,
FirstName VARCHAR(50),
Salary decimal,
PassportID INT UNIQUE
)
CREATE TABLE Passports(
PassportID INT PRIMARY KEY,
PassportNumber NVARCHAR(255)
)
INSERT INTO Passports VALUES
(101, 'N34FG21B'),
(102, 'K65LO4R7'), ... |
-- Question 8
-- Query the customer_number from the orders table for the customer who has placed the largest number of orders.
-- It is guaranteed that exactly one customer will have placed more orders than any other customer.
-- The orders table is defined as follows:
-- | Column | Type |
-- |------... |
<filename>sql/post-table.sql
CREATE TABLE IF NOT EXISTS posts (
id serial PRIMARY KEY,
title VARCHAR(100) NOT NULL,
content TEXT NOT NULL
);
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 27, 2021 at 09:15 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 8.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
select apex_web_service.make_rest_request(
p_url => 'https://us18.api.mailchimp.com/3.0/'
, p_http_method => 'GET'
, p_wallet_path => 'file:/home/oracle/wallets/orapki_wallet'
, p_https_host => 'wildcardsan2.mailchimp.com'
) from dual;
|
<reponame>com6056/starrs
/* api_dns_utility.sql
1) get_reverse_domain
2) validate_domain
3) validate_srv
*/
/* API - dns_resolve */
CREATE OR REPLACE FUNCTION "api"."dns_resolve"(input_hostname text, input_zone text, input_family integer) RETURNS INET AS $$
BEGIN
IF input_family IS NULL THEN
RETURN (SELECT ... |
DECLARE @sourceDB NVARCHAR(128);
DECLARE @viewsDB NVARCHAR(128);
SET @sourceDB = 'RCSQL';
SET @viewsDB = 'RCSQL_Views';
SELECT *
FROM RCSQL.sys.all_objects AS O1
INNER JOIN RCSQL_Views.sys.schemas AS S1 ON O1.schema_id = S1.schema_id
FULL OUTER JOIN RCSQL_Views.sys.all_objects O2 ON O1.name = O2.name
WHERE S1... |
ALTER TABLE ways_nodes ADD COLUMN node_order SMALLINT NOT NULL;
|
<gh_stars>1-10
--##############################################################################
--
-- SAMPLE SCRIPTS TO ACCOMPANY "SQL SERVER 2017 ADMINISTRATION INSIDE OUT"
--
-- © 2018 <NAME>
--
--##############################################################################
--
-- CHAPTER 14: AUTOMATING SQL SERVER AD... |
<reponame>Kahiko/Growthware
ALTER TABLE [dbo].[ZFC_SECURITY_GRPS_SE]
ADD CONSTRAINT [FK_ZFC_SECURITY_GRPS_SE_ZFC_SECURITY_GRPS] FOREIGN KEY ([GROUP_SEQ_ID]) REFERENCES [dbo].[ZFC_SECURITY_GRPS] ([GROUP_SEQ_ID]) ON DELETE CASCADE ON UPDATE CASCADE;
|
use fudgebank
go
if exists(select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where CONSTRAINT_NAME = 'fk_accounts_account_type')
alter table accounts drop fk_accounts_account_type
drop table if exists accounts
drop table if exists account_types
GO
create table account_types (
account_type varchar(50) not null,
... |
--==============================================================================
-- GPI - <NAME>
-- Desc: get the tablespaces of all the users
-- Date: November 2013
--==============================================================================
set verify off
set linesize 130 pagesize 300
column tablespace_nam... |
DROP VIEW IF EXISTS m_material_balance_view;
DROP VIEW IF EXISTS report.c_bpartner_inoutline_v;
CREATE OR REPLACE VIEW report.c_bpartner_inoutline_v AS
SELECT
mbd.C_BPartner_ID,
mbd.MovementDate,
CASE
WHEN iol.IsInvoiced = 'Y' THEN true
ELSE false
END AS IsInvoiced,
p.M_Product_Category_ID = ((
... |
/*
********************************************************************************************************
Вывод списка АРМ с МНИ для ЦИТСиЗИ
********************************************************************************************************
*/
COPY (
SELECT
public.computers_isod.comp_reg_num ... |
CREATE DATABASE ${migration.database};
|
<gh_stars>0
select
e.repo_name as repo_name,
count(pr.id) as merge_count
from
gha_pull_requests pr,
gha_events e
where
pr.event_id = e.id
and pr.merged_at >= now() - interval 1 year
group by
repo_name
order by
merge_count desc
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.