sql stringlengths 6 1.05M |
|---|
DROP TABLE salesorder
DROP TABLE customer
DROP TABLE address
DROP TABLE item
DROP TABLE product_range
DROP TABLE employee
CREATE TABLE employee ( employee_id INTEGER PRIMARY KEY, firstname VARCHAR(256), lastname VARCHAR(256), address VARCHAR(256), city VARCHAR(256), postcode VARCHAR(256), salary NUMERIC(10,2), company_... |
#!default_db:schema1
#less important
use schema1;
create table if not exists sharding_4_t1(id int,name varchar(8)) partition by hash(id);
drop table sharding_4_t1;
create table sharding_4_t1(id int,name varchar(8)) partition by hash(id) partitions 3;
drop table sharding_4_t1;
create table sharding_4_t1(id int,name varc... |
<gh_stars>1-10
GO
DROP FUNCTION If EXISTS BS.OptionPrice
GO
CREATE FUNCTION BS.OptionPrice (@_CallPut int, @_S0 Decimal(15,5), @_q Decimal(15,5), @_t decimal(8,5), @_X Decimal(15,5), @_r Decimal(15,5), @_s Decimal(15,5))
RETURNS Decimal(15,5)
BEGIN
Declare @_p Decimal(15,5)
if @_CallPut = 0
set @_p = BS.Call... |
/** functions for dividing value ranges into chunks */
/**
Adds `compute_chunk` functions to a schema.
This is needed for building function indexes based on `compute_chunk`, because the index would be dropped if
the function gets dropped.
Example usage:
DROP SCHEMA IF EXISTS xx_dim_next;
CREATE SCHEMA xx_dim_n... |
USE [test_normalization];
execute('create view _airbyte_test_normalization."conflict_stream_name_conflict_stream_name_ab2__dbt_tmp" as
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
select
_airbyte_conflict_stream_name_hashid,
cast(conflict_stream_name as ... |
<filename>MMOCoreORB/sql/mantis.sql
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.1.36-community-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OL... |
-- in the future all index changes will be handled by simplepage.sql. However
-- some older changes do not include the drops. We're not quite sure we want to
-- insert these into simplepage.sql, because we're not sure of the state of
-- existing systems. So in upgrading to the 2.9 version (Lessons 1.4) from older versi... |
<reponame>mfooo/wow
-- Azjol-Nerub from MaxXx2021
UPDATE creature_template SET ScriptName = 'npc_watcher_gashra' WHERE entry = 28730;
UPDATE creature_template SET ScriptName = 'npc_watcher_narjil' WHERE entry = 28729;
UPDATE creature_template SET ScriptName = 'boss_krikthir' WHERE entry = 28684;
UPDATE creature_templat... |
CREATE TABLE TB_HEAD_TEACHER(
HT_ID INT PRIMARY KEY AUTO_INCREMENT,
HT_NAME VARCHAR(20),
HT_AGE INT);
INSERT INTO TB_HEAD_TEACHER(HT_NAME,HT_AGE) VALUES('ZHANGSAN',40);
create table tb_class(
c_id int primary key auto_increment,
c_name varchar(20),
c_ht_id int unique,
foreign key(c_ht_id) references tb_hea... |
-- Copyright (C) 2018 <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 Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is dis... |
/*D************************************************************/
/* project: MARCO POLO TO */
/* client: DEMONSTRATION */
/* */
/* DBMS: ORACLE ... |
<gh_stars>1-10
use RailWaySystemDB
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <NAME>
-- =============================================
CREATE PROCEDURE get_source
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SE... |
<reponame>labdsf/amusewiki<filename>dbicdh/PostgreSQL/upgrade/18-19/001-auto.sql
-- Convert schema '/home/melmoth/amw/AmuseWikiFarm/dbicdh/_source/deploy/18/001-auto.yml' to '/home/melmoth/amw/AmuseWikiFarm/dbicdh/_source/deploy/19/001-auto.yml':;
;
BEGIN;
;
ALTER TABLE title ADD COLUMN cover character varying(255) D... |
\set ECHO none
/*
* Note! This file must be named acl_type so that it's not the same as the top-level sql/acl.sql!
*
* http://www.postgresql.org/message-id/56899F36.<EMAIL>
*/
\set test_role "acl test role: really bad role that contains "" and spaces"
-- Do this before we're in the transaction to clean up anythi... |
\set VERBOSITY terse
-- Add to the search path the schema
SET search_path TO public,cartodb,cdb_dataservices_client;
-- Mock the server functions
CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot (username text, orgname text, geom geometry(Geometry, 4326), time_span text DEFAULT '2009 - ... |
<filename>files/queries.sql<gh_stars>0
CREATE DATABASE posts;
CREATE TABLE users (
id int(11) NOT NULL AUTO_INCREMENT,
firstname varchar(30) NOT NULL,
lastname varchar(30) NOT NULL,
email varchar(30) NOT NULL,
password varchar(50) NOT NULL,
usertype varchar(10) NOT NULL DEFAULT 'user',
PRIMARY KEY (id)
)... |
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 50724
Source Host : localhost:3306
Source Schema : vueapi
Target Server Type : MySQL
Target Server Version : 50724
File Encoding : 65001
Date: 10/04/2021 16:... |
CREATE VIEW members_approved_for_voucher AS
SELECT*
FROM
(
SELECT
members.id AS id,
members.name as name,
members.email as email,
sum(products.price) as total_spending
FROM
((sales
LEFT JOIN members
ON sales.member_id = members.id)
INNER JOIN products
ON sales.product_id = pr... |
<filename>blog.sql
-- phpMyAdmin SQL Dump
-- version 4.4.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 14, 2015 at 02:13 PM
-- Server version: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... |
<reponame>iagorubio/springboot-example
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`username` varchar(50) NOT NULL,
`password` text,
`enabled` varchar(50) DEFAULT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
LOCK TABLES `users` WRITE;
I... |
# Author: <NAME>
# Github: github.com/guptamadhur
# Project: Hacker Rank Practice SQL
SELECT CITY.NAME from CITY, COUNTRY
WHERE CITY.COUNTRYCODE = COUNTRY.CODE AND COUNTRY.CONTINENT='Africa' |
CREATE TABLE my_users (
id Int,
name Varchar
);
INSERT INTO my_users (id, name) values (1, 'hello');
|
<gh_stars>0
SET IDENTITY_INSERT [dbo].[Locacao] ON
INSERT INTO [dbo].[Locacao] ([Id], [Carro], [Cliente], [Devolucao], [Ativo], [UsuInc], [UsuAlt], [DataInc], [DataAlt]) VALUES (2, 4, 1, N'2019-07-23 00:00:00', 1, 1, 1, N'2019-07-22 14:27:27', N'2019-07-22 14:27:27')
INSERT INTO [dbo].[Locacao] ([Id], [Carro], [Cliente... |
--insert into posttasks (status, groupid, fbid, groupname) select distinct 0, g.id,g.fbid, g.Name from groupraws g
--inner join groupmanagersets gm on gm.GroupId = g.id
--where gm.GroupManagerId in (1)
--Select * from posttasks
--update p set p.contentid =1
--from posttasks p
--where contentid =0
--select... |
<reponame>Jonathanshaulis/DBA-Toolbox<filename>code - random generator.sql
DECLARE @min INT, @max INT, @rowCnt INT
SET @min = 1;
SET @max = 1000;
SET @rowCnt = 1000;
SELECT TOP (@rowCnt)
--ints
RandInt = ABS(CHECKSUM(NEWID())), -- Random integer
RandIntMinMaxInc = (ABS(CHECKSUM(NEWID())) % (@max - @min + ... |
DROP DATABASE IF EXISTS CRUD_Livros;
CREATE DATABASE CRUD_Livros;
USE CRUD_Livros;
CREATE TABLE tbl_Livro (
ID INT AUTO_INCREMENT PRIMARY KEY,
Nome VARCHAR(100) NOT NULL,
Preco FLOAT,
Data_Pub DATE,
Num_Paginas INT NOT NULL,
Sinopse TEXT,
Cod_Editora INT,
ID_Idioma INT NOT NULL,
ID_... |
select name from v$datafile;
select value from v$parameter where name = 'db_create_file_dest'
select * from dba_data_files;
--https://pt.stackoverflow.com/q/153045/101
|
<gh_stars>1-10
--==============================================================================
-- GPI - <NAME>
-- Desc: show the object count and size of a tablespace
-- Date: Januar 2015
--==============================================================================
set verify off
set linesize 130 pagesize 300 ... |
--Seperate columns with comas
/*
SELECT CustNo, CustFirstName, CustLastName, custstreet, custcity, custzip, custbal
FROM Customer
WHERE Custcity = 'Seattle'
AND CustLastName = 'Taylor';
*/
/*
SELECT CustNo, CustFirstName, CustLastName, custstreet, custcity, custzip, custbal
FROM Customer
Where CustCity = 'Seattle'
OR C... |
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 row_security = off;
CREATE SCHEMA conduit_db AUTHORIZATION db_user;
ALTER SCHEMA conduit_db OWNER TO db_user;
SET search_path ... |
<gh_stars>0
-- Table: public.familygroupmember
-- DROP TABLE public.familygroupmember;
CREATE TABLE IF NOT EXISTS public.familygroupmember
(
id uuid,
first_name character varying(40) COLLATE pg_catalog."default",
middle_name character varying(40) COLLATE pg_catalog."default",
last_name_1 character var... |
select distinct(hobby) from pres_hobby
join president on president.id = pres_hobby.pres_id
where president."name" not in (select distinct(president."name") from president
join election on president."name" = election.candidate
where election.winner_loser_indic = 'L')
order by hobby asc |
INSERT INTO ARTICLES(ARTICLEID,ARTICLEWORDCOUNT,headline,Category,PUBDATE,snippet,webURL) VALUES (2,2318,'6 Million Riders a Day, 1930s Technology','Metro','2017-01-05 04:01:00','New York’s subway is struggling with old infrastructure and overcrowding. The M.T.A.’s failure to modernize its signal system is a crucial ex... |
DROP TABLE IF EXISTS delta_table;
DROP TABLE IF EXISTS zstd_table;
DROP TABLE IF EXISTS lz4_table;
CREATE TABLE delta_table (`id` UInt64 CODEC(Delta(tuple()))) ENGINE = MergeTree() ORDER BY tuple(); --{serverError 433}
CREATE TABLE zstd_table (`id` UInt64 CODEC(ZSTD(tuple()))) ENGINE = MergeTree() ORDER BY tuple(); --... |
<filename>src/postgres/src/test/regress/sql/yb_gin.sql<gh_stars>1000+
--
-- Yugabyte-owned test for gin access method.
--
-- Disable sequential scan so that bitmap index scan is always chosen.
SET enable_seqscan = off;
--
-- Create temp tables because gin access method is only supported on temporary
-- tables.
--
CRE... |
-- @Description Out of order Update (MPP-21146)
--
-- scenario 1
drop table if exists uaocs_ooo_del_tab1;
create table uaocs_ooo_del_tab1 (i int, j int ) with (appendonly=true , orientation=column);
drop table if exists uaocs_ooo_del_tab2;
create table uaocs_ooo_del_tab2 (i int, j int ) with (appendonly=true , orie... |
-- @testpoint:opengauss关键字c(非保留),作为数据库名
--关键字不带引号-成功
drop database if exists c;
create database c;
--清理环境
drop database c;
--关键字带双引号-成功
drop database if exists "c";
create database "c";
--清理环境
drop database "c";
--关键字带单引号-合理报错
drop database if exists 'c';
create database 'c';
--关键字带反引号-合理报错
drop database if exist... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 05, 2020 at 04:57 AM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... |
<filename>SqlLabWeek2/SQLlab.sql
/*
* 2.0 SQL Queries
*/
--2.1 SELECT
SELECT * FROM EMPLOYEE;
SELECT * FROM EMPLOYEE WHERE LASTNAME='King';
SELECT * FROM EMPLOYEE WHERE FIRSTNAME='Andrew' AND REPORTSTO IS NULL;
--2.2 ORDER BY
SELECT * FROM ALBUM ORDER BY TITLE DESC;
SELECT FIRSTNAME FROM CUSTOMER ORDER BY CITY ASC;... |
--=============================================
-- Author :
-- Create date:
-- Description: demo sample records
--
--
--
-- Version Date Description(of Changes)
-- 1.0 Created
--=============================================
-- object table
INSERT INTO object
(
record_creation_date,
... |
<reponame>suhe/kreston-portal<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 11 Okt 2016 pada 11.24
-- Versi Server: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
<gh_stars>0
DROP DATABASE IF EXISTS passport_demo;
CREATE DATABASE passport_demo;
USE passport_demo;
CREATE TABLE passportDemo (
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id)
);
|
-- Author: <NAME>
-- Github: https://github.com/erruchirgupta
-- HackerRank: https://hackerrank.com/RuchirGupta
-- ORACLE SQL SOLUTION
SELECT
E.company_code,
C.founder,
COUNT(DISTINCT lead_manager_code),
COUNT(DISTINCT senior_manager_code),
COUNT(DISTINCT manager_code),
COUNT(DISTINCT ... |
<gh_stars>0
INSERT INTO tasks (title, contact, status, category, description)
VALUES('Feed Nova','Craig','Do everyday after walk','pets','Nova is hungry');
INSERT INTO tasks (title, contact, status, category, description)
VALUES('Feed Walter','Craig','Do everyday after walk','pets','Walter is hungry');
INSERT INTO ... |
<gh_stars>0
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.24 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 10.2.0.5599
-- -----------------------------------------------... |
CREATE TABLE IF NOT EXISTS
promise.task
(
category INT
DEFAULT NULL,
completed_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL
DEFAULT CURRENT_TIMESTAMP,
description VARCHAR(160),
id SERIAL NOT NULL,
name CITEXT NOT NULL,
profile INT NOT NULL,
PRIMARY KEY(id),
FOREIGN... |
<filename>BolaoNet.Database.SqlServer/build/0121.Create_StoredProcedure_sp_JogosUsuarios_ApostasAutomatica.sql
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'sp_JogosUsuarios_ApostasAutomatica')
BEGIN
DROP Procedure sp_JogosUsuarios_ApostasAutomatica
END
GO
CREATE PROCEDURE [dbo].[sp_JogosUsuario... |
/* Schema - Project 2*/
DROP DATABASE IF EXISTS fitness_journal_db;
CREATE DATABASE fitness_journal_db; |
<gh_stars>0
CREATE TABLE [billb].[progresses] (
[interval] INT NULL,
INDEX [GRAPH_UNIQUE_INDEX_3F40AFA7D36742E9B953A33A69847C82] UNIQUE NONCLUSTERED ($edge_id)
) AS EDGE;
|
<gh_stars>10-100
ALTER TABLE pins
ALTER COLUMN db_id SET NOT NULL;
|
<gh_stars>1-10
INSERT INTO WWS_COUNTRIES (ID, NAME, ISO3, ISO2, PHONECODE, CAPITAL, CURRENCY, CREATED_AT, UPDATED_AT, FLAG, WIKIDATAID) VALUES (129, 'Macedonia', 'MKD', 'MK', '389', 'Skopje', 'MKD', TO_TIMESTAMP('2018-07-20 16:41:03','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2019-08-02 21:38:23','YYYY-MM-DD HH24:MI:SS'),... |
<filename>src/test/resources/sql/copy/552df48d.sql
-- file:copy2.sql ln:149 expect:true
COPY testnl FROM stdin CSV
|
-- Bob's cci example to show frag and tuple movement
--
USE master
GO
DROP DATABASE IF EXISTS gocowboyscci
GO
CREATE DATABASE [gocowboyscci]
ON PRIMARY
( NAME = N'gocowboyscci', FILENAME = N'd:\data\gocowboyscci.mdf' , SIZE = 50Mb , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
LOG ON
( NAME = N'gocowboyscci_log', F... |
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5479850_sys_gh1752_AD_Element_WithColumnName_ValRule_In_AD_Column.sql
-- 2017-12-07T17:05:14.199
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Val_Rule_ID=540382,Upda... |
<gh_stars>1-10
ALTER TABLE db_version CHANGE COLUMN required_10217_03_mangos_spell_learn_spell required_10217_04_mangos_spell_chain bit;
-- 21084 replace of 20154 at learn judgements
DELETE FROM spell_chain WHERE first_spell = 20154;
INSERT INTO spell_chain VALUES
(20154,0,20154,1,0),
(21084,20154,20154,2,0);
|
ALTER TABLE sht.refund ADD COLUMN currency_code CHARACTER VARYING;
UPDATE sht.refund as s1 SET currency_code =
(select currency_code from sht.payment as s2 where s1.invoice_id = s2.invoice_id AND s1.payment_id = s2.payment_id);
ALTER TABLE sht.refund ALTER COLUMN currency_code SET NOT NULL; |
<filename>DMS5/GetDatasetPriority.sql
/****** Object: UserDefinedFunction [dbo].[GetDatasetPriority] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[GetDatasetPriority]
/****************************************************
**
** Desc:
** Determines if the dataset name... |
CREATE TABLE IF NOT EXISTS items
(
id SERIAL PRIMARY KEY,
name TEXT UNIQUE NOT NULL,
notes TEXT,
cost_per_kilogram DOUBLE PRECISION,
fats_per_kilogram DOUBLE PRECISION,
carbs_per_kilogram DOUBLE PRECISION,
protein_per_kilogram DOUBLE P... |
--Messaging Service without campaign and with phone number
--current problem with this ticket https://console.twilio.com/us1/support/tickets?frameUrl=%2Fconsole%2Fsupport%2Ftickets%2F7061439%3F__override_layout__%3Dembed%26bifrost%3Dtrue%26x-target-region%3Dus1
select ms.sid, ms.friendly_name,
--ms.inbound_metho... |
ALTER TABLE workspaces
ADD COLUMN diffs_count INTEGER;
|
<reponame>NarrativeApp/diesel
CREATE TRIGGER __diesel_manage_updated_at_{table_name}
AFTER UPDATE ON {table_name}
FOR EACH ROW WHEN
old.updated_at IS NULL AND
new.updated_at IS NULL OR
old.updated_at == new.updated_at
BEGIN
UPDATE {table_name}
SET updated_at = CURRENT_TIMESTAMP
WHERE ROWID = new.ROWID;
END
|
<filename>migrations/804-clean-reviewer-scores.sql<gh_stars>0
-- See: https://github.com/mozilla/zamboni/blob/master/apps/constants/base.py
DELETE FROM reviewer_scores
WHERE note_key IN (
10, -- REVIEWED_ADDON_FULL
11, -- REVIEWED_ADDON_PRELIM
12, -- REVIEWED_ADDON_UPDATE
20, -- REVIEWED_DICT_FULL
21, -- REVI... |
<filename>server/database/upgrade/upgrade_004.sql
begin;
do $$
begin
perform upgrade_to_version(4);
create function delete_order(delete_id int)
returns integer
as $func$
delete from past_household_order_item where order_id = delete_id;
delete from past_household_order where order_id = delete_id;
d... |
<filename>[SP09] 1 - Criar Banco de Dados/[SP09] 1 - Criar Banco de Dados.sql
CREATE DATABASE IF NOT EXISTS `escola`
DEFAULT CHARACTER SET utf8mb4
DEFAULT COLLATE utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS professores (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
matricula INT ,
nome VARCHAR(50),
sobr... |
<gh_stars>0
/*-----------Clear the Database first----------*/
DROP TABLE IF EXISTS 'Classes_Users_Bridge';
DROP TABLE IF EXISTS 'Users';
DROP TABLE IF EXISTS 'User_Type';
DROP TABLE IF EXISTS 'Subjects';
DROP TABLE IF EXISTS 'Classes';
DROP TABLE IF EXISTS 'Exports';
DROP TABLE IF EXISTS 'Filter_Classes_Bridge';
DROP ... |
<reponame>xela07ax/FK_DOCUMENT-DWH<filename>INSURER_ PENALTY_DELAY_SCHEDULE.sql
Скрипт для проверки а Аджинити Скрипт с заменами для джоба в Дата Стейдж
/* Modifikatciya iz INSURER_ PENALTY_DELAY_SCHEDULE to INSURER_PENALTY_BANKRUPT_RTK_RESPONSIBILITY
<NAME> 01.11.16 */
with
SRC_TOTAL as
(
select rr_3.*
, CAST(cas... |
<gh_stars>1-10
CREATE TABLE IF NOT EXISTS `[prefix]plupload_files` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user` int(10) unsigned NOT NULL,
`uploaded` bigint(20) unsigned NOT NULL,
`source` varchar(255) NOT NULL COMMENT 'Path locally on storage',
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQ... |
/*
* TEST DATABASE A
*/
USE SqlUtilsTests_A
GO
IF (object_id('AddressTypes', 'U') IS NOT NULL)
DROP TABLE AddressTypes
GO
CREATE TABLE AddressTypes (
AddressTypeID INT IDENTITY(1, 1),
AddressType NVARCHAR(50),
CONSTRAINT PK_AddressTypes PRIMARY KEY CLUSTERED (
AddressTypeID ASC
)
)
GO
IN... |
<gh_stars>10-100
SELECT
id,
group_type_id,
"name",
goal,
created_at,
updated_at,
city,
external_id,
state,
school_id
FROM {{ source('rogue', 'groups') }}
|
<reponame>FritzX6/slippi-db<gh_stars>10-100
-- Win rate against Falco on FD (a personal favorite).
-- Replace 'DJSwerve' with your tag unless your tag is DJSwerve.
with my_games as (
select me.*
from players me, players op, games
where op.id != me.id
and me.game_id = op.game_id
and me.game_id = gam... |
/* Works in
H2, MySQL, PostgreSQL
*/
DROP TABLE if exists MYTABLE;
--if NOT exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'MYTABLE')
CREATE TABLE IF NOT EXISTS MYTABLE (
id INT NOT NULL,
title VARCHAR(50) NOT NULL,
author VARCHAR(20) NOT NULL,
submission_date DATE,
price DECIMAL(20, 2)
)... |
-- file:bit.sql ln:113 expect:true
SELECT POSITION(B'1010' IN B'00000101')
|
SET MODE MySQL;
/*------------------------------------------- create alarm---------------------------------------------------------------------*/
DROP TABLE IF EXISTS alarm;
CREATE TABLE IF NOT EXISTS alarm
(
id BIGINT AUTO_INCREMENT PRIMARY KEY,
alarm_name VARCHAR(100) NOT NULL,
alarm_typ... |
select id_dep, &salariu_maxim_dep salariu_maxim_dep, id_ang, nume, salariu
from angajati
where id_dep = &nr_departament and salariu > (&salariu_maxim_dep / 2); |
ALTER TABLE content
ADD COLUMN editor VARCHAR(10);
|
/*
* Copyright 2017 <NAME> <<EMAIL>>
*
* 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 agree... |
<filename>src/main/resources/org/support/project/web/dao/sql/RolesDao/RolesDao_select_on_userkey.sql
SELECT
ROLES.*
FROM
ROLES
INNER JOIN USER_ROLES
ON USER_ROLES.ROLE_ID = ROLES.ROLE_ID INNER JOIN USERS
ON USERS.User_id = USER_ROLES.User_id
WHERE
USERS.US... |
select akas, title
from aws.aws_cloudwatch_log_stream
where name = '{{ resourceName }}'
|
select
-- Required Columns
network_acl_id as resource,
case
when jsonb_array_length(associations) >= 1 then 'ok'
else 'alarm'
end status,
case
when jsonb_array_length(associations) >= 1 then title || ' associated with subnet.'
else title || ' not associated with subnet.'
end reason,
-- Ad... |
<filename>src/server/db/sql/0004.sql
CREATE INDEX ON race (name);
CREATE INDEX ON race (distance);
|
UPDATE customers SET name = 'Murphy' WHERE FALSE |
create table ventas(
codpro constraint codpro_clave_externa_proveedor
references proveedor(codpro),
codpie constraint codpie_clave_externa_pieza
references pieza(codpie),
codpj constraint codpj_clave_externa_proyecto
references proyecto(codpj),
cantidad number(4),
constraint clave_primaria primary key (codpro, ... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 27, 2021 at 05:00 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.2.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<reponame>RafaelSSilva/book-mysql<gh_stars>0
/*Formatos de Datas
USA (YYYY-MM-DD)
EUR (DD.MM.YYYY)
*/
#curdate() => Retorna a data atual.
SELECT CURDATE();
#now() => Retorna a data e o horário atual.
SELECT NOW();
#sysdate() => Retorna a data e o horário atual.
SELECT SYSDATE();
#curtime() => Retorna somente o... |
CREATE DATABASE T_Ekips;
USE T_Ekips;
CREATE TABLE Usuarios(
IdUsuario INT PRIMARY KEY IDENTITY
,Email VARCHAR(250)NOT NULL
,Senha VARCHAR(30) NOT NULL
,Permissao VARCHAR (10) NOT NULL
);
CREATE TABLE Departamentos(
IdDepartamento INT PRIMARY KEY IDENTITY
,Nome VARCHAR (100) NOT NULL
);
CREATE TABLE Cargos(
I... |
<gh_stars>0
/*
Warnings:
- You are about to drop the column `user_id` on the `Action` table. All the data in the column will be lost.
- You are about to drop the column `user_id` on the `Comment` table. All the data in the column will be lost.
- You are about to drop the column `user_id` on the `Download` tabl... |
ALTER TABLE `event_types` ADD `img` VARCHAR(255) NOT NULL AFTER `name`;
ALTER TABLE `event_types` ADD `plural` VARCHAR(150) NOT NULL AFTER `name`;
ALTER TABLE `event_types` CHANGE `name` `name` VARCHAR(150) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
CREATE TABLE `user_notifications_config` (
`user_... |
<gh_stars>0
-- account taple
create table account (
account_id serial constraint account_id_pk primary key ,
first_name varchar(100) constraint account_first_name_nn not null ,
last_name varchar(100) constraint account_last_name_nn not null,
user_name varchar(100) constraint account_user_name_nn n... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 27 Bulan Mei 2020 pada 16.51
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.2.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
-- create users table
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
name TEXT,
password TEXT,
email TEXT,
location TEXT
);
--price of singular products
CREATE TABLE IF NOT EXISTS products (
id SERIAL PRIMARY KEY,
name TEXT,
image TEXT,
brand TEXT,
description TEXT,
price numeric
);
-... |
<reponame>nabeelkhan/Oracle-DBA-Life
REM FILE NAME: int_lock.sql
REM LOCATION: Database Tuning\Contention Reports
REM FUNCTION: Document current internal locks
REM TESTED ON: 7.3.3.5, 8.0.4.1, 8.1.5, 8.1.7, 9.0.1
REM PLATFORM: non-specific
REM REQUIRES: sys.dba_lock_internal, sys.v_$session
REM
REM This is a... |
<filename>sql/file.sql
create database `file` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
use `file`;
CREATE TABLE `file_0` (
`id` bigint(20) unsigned not null auto_increment,
`user_id` bigint(20) unsigned NOT NULL,
`url` varchar(255) not null default '',
`path` varchar(100) not null default '',
`creat... |
/*
Name: Problem 2737
Copyright: 2019 <NAME>
Author: <NAME>
Date: 07/30/2019
Comment language: en
Description:
The manager of Mangojata Lawyers requested a report on the current lawyers.
The manager wants you to show him the name of the lawyer with the most clients, the one with the
fewest and the client ... |
<filename>laravel-activitar (1).sql
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1
-- Время создания: Июн 27 2021 г., 20:28
-- Версия сервера: 10.3.16-MariaDB
-- Версия PHP: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zon... |
-- This file should undo anything in `up.sql`
ALTER SEQUENCE movies_id_seq RESTART WITH 1; |
/****** Object: StoredProcedure [AddF09Level11111ReChild] ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[AddF09Level11111ReChild]') AND type in (N'P', N'PC'))
DROP PROCEDURE [AddF09Level11111ReChild]
GO
CREATE PROCEDURE [AddF09Level11111ReChild]
@Level_1_1_1_1_ID int,
@... |
/*
Warnings:
- Added the required column `first_name` to the `Profile` table without a default value. This is not possible if the table is not empty.
- Added the required column `last_name` to the `Profile` table without a default value. This is not possible if the table is not empty.
- Added the required colu... |
-- in4.test
--
-- execsql {
-- SELECT a FROM t1 WHERE rowid IN (1, 3);
-- }
SELECT a FROM t1 WHERE rowid IN (1, 3); |
-- file:prepared_xacts.sql ln:28 expect:true
ROLLBACK PREPARED 'foo1'
|
<gh_stars>100-1000
CREATE TYPE [Hr].[udtEmergencyContactList] AS TABLE (
/*
* This is automatically generated; any changes will be lost.
*/
[EmergencyContactId] UNIQUEIDENTIFIER,
[FirstName] NVARCHAR(100) NULL,
[LastName] NVARCHAR(100) NULL,
[PhoneNo] NVARCHAR(50) NULL,
[RelationshipTypeCode] NVARCH... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.