sql stringlengths 6 1.05M |
|---|
-- Problem 9. *Peaks in Rila
USE Geography
SELECT MountainRange, PeakName, Elevation
FROM Mountains AS m
JOIN Peaks AS p ON m.Id = p.MountainId
WHERE MountainRange = 'Rila'
ORDER BY Elevation DESC
|
--
-- Database: `assignment1`
--
-- --------------------------------------------------------
--
-- Table structure for table `COURSE`
--
CREATE TABLE `COURSE` (
`Course_name` varchar(50) NOT NULL,
`Course_number` varchar(20) NOT NULL,
`Credit_hours` int(11) NOT NULL,
`Department` varchar(10) NOT NULL
);
--
... |
<filename>database/init/cities/city.list042.sql
insert into city values
(2153567,"Peelwood","AU",149.433334,-34.116669),
(2147360,"Tarlo","AU",149.800003,-34.599998),
(2157060,"<NAME>","AU",153.152924,-30.20575),
(2159490,"Lowanna","AU",152.899994,-30.216669),
(2146798,"Thora","AU",152.783325,-30.433331),
(2144942,"Wal... |
-- takes all the tweets that contain TS in it, meaning their username usually follows it from my search
select user_id,tweet
from twitter_tweet
where to_tsvector('english',tweet) @@ plainto_tsquery('english','TS')
-- filter query for updating based on day!
select user_id,tweet,TO_DATE(created_at,'DY Mon Ye... |
USE sql_store;
|
CREATE OR REPLACE PROCEDURE refresh_HDB_snap (which_table IN varchar2)
IS
the_db_name VARCHAR2(30) := NULL;
my_mes VARCHAR2(2000);
PROCEDURE refresh_snapshot_table(the_table IN VARCHAR)
IS
-- Oracle Consulting: <NAME>, 7-JAN-1999
-- This will get the primary... |
INSERT INTO items(_id,dota_id,type,cost,dname) SELECT '1' as _id,'blink' as dota_id,'arcane' as type,'2250' as cost, 'Blink Dagger' as dname
UNION ALL SELECT '2','blades_of_attack','armaments','420','Blades of Attack'
UNION ALL SELECT '3','broadsword','armaments','1200','Broadsword'
UNION ALL SELECT '4','chainmail','ar... |
<reponame>Sir-Hedgehog/job4j
CREATE TABLE accounts (
name VARCHAR(100) NOT NULL,
phone VARCHAR(100) NOT NULL
); |
USE PeopleTracker;
GO
SET IDENTITY_INSERT GuardianType ON;
INSERT INTO GuardianType (GuardianTypeId, Description) VALUES(1, 'Parent');
INSERT INTO GuardianType (GuardianTypeId, Description) VALUES(2, 'Guardian');
INSERT INTO GuardianType (GuardianTypeId, Description) VALUES(3, 'Relative');
INSERT INTO GuardianType (Gu... |
<reponame>elboqueronpaco/cms<filename>scripts/comments.sql
--CREACiÓN DE LA TABLA DE LOS USUARIOS
CREATE TABLE comments(
id SERIAl NOT NULL,
comment TEXT NOT NULL,
author INT NOT NULL,
post_blog_id INT NOT NULL,
created_at timestamp DEFAULT now() NOT NULL,
updated_at timestamp,
CONSTRAINT comments_id_pk PRIMARY... |
/* leave this
l:see LICENSE file
g:utility
v:120123\s.zaglio: convert a nvarchar to base 64 code
t:select dbo.fn__base64encode('Test Data') -- VABlAHMAdAAgAEQAYQB0AGEA
*/
CREATE function dbo.fn__base64encode
(
@text nvarchar(max)
)
returns nvarchar(max)
as
begin
declare @bin varchar(max)
s... |
<reponame>bayoehidayah/simple_chatting
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 12 Jul 2019 pada 19.59
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zo... |
-- Create database for Demo
CREATE DATABASE BlockingDemo
GO
USE [BlockingDemo]
GO
-- Create table
CREATE TABLE dbo.tblBlckScenario
( ID INT IDENTITY(1,1) NOT NULL,
Name varchar(50) NOT NULL,
Salary INT NOT NULL
);
GO
-- Populate Data
INSERT dbo.tblBlckScenario
(Name, Salary)
SELECT 'Ajay', 30000
UNION
SELECT 'Vij... |
<gh_stars>0
create table cms_tag (id int not null auto_increment primary key, name varchar(255), value text);
create index cms_tag_n on cms_tag(name);
|
<reponame>sinotopia/sinotopia
--
-- Copyright 2010-2016 the original author or authors.
--
-- 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/licen... |
<filename>src/roles/curator.sql<gh_stars>0
CREATE ROLE steam_curator
LOGIN
PASSWORD '<PASSWORD>';
-- can select games and related tables
GRANT steam_visitor to steam_curator;
-- can edit game_genres to assign genres to games
GRANT INSERT, DELETE, UPDATE
ON game_genres
TO steam_curator;
-- can insert new genres
GRANT... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 23 Sep 2019 pada 10.30
-- Versi Server: 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=@@CHARACTE... |
<gh_stars>1-10
CREATE PROCEDURE [security].[Membership_UpdatePasswordFailure]
(
@Username varchar(max) = ''
)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Get the GUID for the user
DECLARE @UserGuid uniqueidenti... |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50713
Source Host : localhost:3306
Source Database : laravel_sentry_admin
Target Server Type : MYSQL
Target Server Version : 50713
File Encoding : 65001
Date: 2017-07-04 14:21:56
*/
SET FOREIGN_K... |
<gh_stars>10-100
CREATE TABLE maps
(
id SERIAL PRIMARY KEY,
name VARCHAR(64),
x_size INT, /* размер карты по Х */
y_size INT, /* размер карты по Y */
level INT, /* определяет основной уровень координат на карте еще он не перепределен конструктором */
speci... |
<filename>plugins/skriptor/sql/skriptor_install.sql
DROP TABLE IF EXISTS `XXX_plugin_skriptor`; ##b_dump##
CREATE TABLE `XXX_plugin_skriptor` (
`id` int(11) NOT NULL auto_increment ,
`js_active` TINYINT NULL,
`js_compress` TINYINT NULL,
`js_remove_comments` TINYINT NULL,
`css_active` TINY... |
ALTER TABLE team CHANGE COLUMN name name varchar(20) NOT NULL;
|
<reponame>jdkoren/sqlite-parser
-- selectA.test
--
-- execsql {
-- SELECT a,b,c FROM t1 EXCEPT SELECT a,b,c FROM t1 WHERE b<'d'
-- INTERSECT SELECT a,b,c FROM t3
-- EXCEPT SELECT b,c,a FROM t3
-- ORDER BY c DESC, a
-- }
SELECT a,b,c FROM t1 EXCEPT SELECT a,b,c FROM t1 WHERE b<'d'
INTERSECT SELECT a,b,c... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 06, 2018 at 05:41 PM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER... |
INSERT INTO
sso.token_table("id", "client_id", "user_id", "ttl", "value", "value_refresh", "name", "enable", "scope")
VALUES
($1, $2, $3, sso._ttl_timestamptz($4), sso._secret_generate(32), sso._secret_generate(32), $5, $6, $7)
RETURNING
sso._secret_encrypt($8, "value", "id"::VARCHAR) as "value",
sso._s... |
<reponame>ptrick/hdfs-hive-sql-playground
version https://git-lfs.github.com/spec/v1
oid sha256:c1d4e3821a3d682bdbd40110ba86dfc95a8d45537298013084f422db337c43f9
size 141
|
-- MySQL dump 10.13 Distrib 5.5.41, for debian-linux-gnu (i686)
--
-- Host: localhost Database: cms
-- ------------------------------------------------------
-- Server version 5.5.41-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACT... |
<reponame>sameeullahqazi/newcoupsmart
-- MySQL dump 10.13 Distrib 5.6.12, for osx10.7 (x86_64)
--
-- Host: localhost Database: newcoupsmart
-- ------------------------------------------------------
-- Server version 5.6.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTE... |
CREATE OR REPLACE FUNCTION "GETTAXA" (p_key_val in number,rank in varchar2 )
return varchar2
-- Given a collection_object_id and a taxonomic rank, return the higher taxon at that rank for
-- the taxon used in the current identification of the collection object.
-- @param p_key_val the collection_obj... |
<gh_stars>10-100
-- This file and its contents are licensed under the Timescale License.
-- Please see the included NOTICE and LICENSE for copyright and licensing information.
DROP VIEW IF EXISTS chunks_ts, chunks_tstz;
-- Show time range, hypertable, and tablespace for chunks belonging to
-- hypertables that have a ... |
--test cases from qa
--test: date type column with function as default value
--1. CURDATE()
drop table if exists t1;
create table t1(
a int primary key,
b int,
c date default CURDATE()
);
merge into t1 A
using db_root B on (A.a=1)
WHEN MATCHED THEN UPDATE SET c=default
WHEN NOT MATCHED THEN INSERT (A.a, A.b) VALUES(1... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 18, 2017 at 04:01 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 14, 2020 at 02:58 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
BEGIN;
DROP TABLE IF EXISTS query_product;
DROP TABLE IF EXISTS query;
DROP TABLE IF EXISTS product;
CREATE TABLE IF NOT EXISTS query (
id BIGINT(10) PRIMARY KEY AUTO_INCREMENT,
user_id VARCHAR(255) NOT NULL,
query VARCHAR(255) NOT NULL,
group_id SMALLINT NOT NULL DEFAULT 0,
KEY (group_id)
);
CRE... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 23, 2019 at 02:32 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40... |
SELECT "Rentabilidad_3"."Locación" AS "Locación" FROM "Rentabilidad_3" WHERE (("Rentabilidad_3"."Figura" = 'Preventa On Premise') AND ("Rentabilidad_3"."Sede Foraneo Sintec" = 'Sede') AND ("Rentabilidad_3"."Zona" = 'OC')) GROUP BY 1;
|
<gh_stars>1-10
SET DEFINE OFF;
ALTER TABLE AFW_12_GROUP_GADGT_UTILS ADD (
CONSTRAINT AFW_12_GROUP_GADGT_UTILS_FK3
FOREIGN KEY (REF_UTILS_DEMDR)
REFERENCES AFW_12_UTILS (SEQNC)
ON DELETE SET NULL
ENABLE VALIDATE)
/
|
<reponame>chadweimer/gomp
BEGIN;
DROP TABLE app_user_settings;
COMMIT; |
CREATE VIEW Puppy.ValidRangesConstraintsToGenerate
AS
SELECT Cols.ColTypeName
,ColumnName
,'
ALTER TABLE ' + Cols.TableFullName + '
ADD CONSTRAINT [' + Cols.ColTypeName + 'ValidRangeConstraint]
CHECK (' + ValidRange + ' )' AddConstraintSql
,'ALTER TABLE ' + Cols.TableFullName + ' DROP CONSTRAINT IF EXISTS [' + C... |
<filename>core-services/egov-common-masters/src/main/resources/db/migration/main/V20170810162522__collection_update_auditdetails_type.sql
ALTER TABLE eg_businesscategory DROP COLUMN createddate;
ALTER TABLE eg_businesscategory DROP COLUMN lastmodifieddate;
ALTER TABLE eg_businesscategory ADD COLUMN createddate BIGINT N... |
<reponame>arshiya2125/crowdsource-dataplatform
CREATE TABLE public.contributors
(
contributor_id integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
mother_tongue text COLLATE pg_catalog."default",
gender text COLLATE pg_catalog."default",
age_gr... |
<reponame>epachols/EmployeeRegisterDb<gh_stars>0
USE employee_db;
INSERT INTO department (department)
VALUES ("Sales"),("Marketing"),("Legal"),("Engineering");
INSERT INTO role (title, salary, department_id)
VALUES
("NEEDS NEW ROLE", 0, null),
("Sales Lead", 90000, 1),
("Sales Team", 70000, 1),
("Marketing Lead", 1... |
CREATE TABLE photo
(
photo_id int auto_increment
primary key,
photo longblob null,
visible tinyint(1) not null,
content_type varchar(50) not null,
name varchar(255) not null,
path varchar(255) null
);
CREATE TABLE profile
(
profile_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
first_name varchar(50) not null,... |
<reponame>smith750/kc
ALTER TABLE UNIT ADD ACTIVE_FLAG CHAR (1 BYTE) DEFAULT 'Y' NOT NULL
/
|
<filename>src/main/resources/data.sql
insert into client values(1,'VIVA', '<EMAIL>', 'Natalia','Adamchuk', '123-456-789');
insert into client values(2,'Group', '<EMAIL>', 'Oleksandr','Iaremii', '987-654-321');
insert into project values(1, 'some text', 'CRM', 2000);
insert into project values(2, 'some text', 'Java', 3... |
<gh_stars>0
create or replace
package bth_util
is
c_string_length CONSTANT INTEGER := 1900;
TYPE string_tbl_type IS TABLE OF VARCHAR2(1900) INDEX BY BINARY_INTEGER;
function clob_to_string_tbl_t
(p_clob in clob
) return string_tbl_t;
function clob_to_string_tbl
(p_clob in clob
) return string_tbl_type;
FUNCT... |
<reponame>HesionBlack/CarInsurancePageServer<filename>vhr/vhrserver/vhr-web/src/main/resources/db/migration/V1__vhr.sql
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 80018
Source Host : localhost:3306
Source Database : carins
Target Server Type : MYSQL
Tar... |
ALTER TABLE invitations
ADD team_id MEDIUMINT;
UPDATE invitations AS invitations
SET invitations.team_id = (SELECT teams.id
FROM teams
WHERE teams.urn = invitations.group_id);
ALTER TABLE invitations
MODIFY COLUMN team_id MEDIUMINT NOT NULL;
ALTER TABLE invitat... |
<gh_stars>0
CREATE DATABASE IF NOT EXISTS Auto;
USE Auto;
DROP TABLE IF EXISTS auto;
CREATE TABLE auto (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Make` varchar(45) DEFAULT NULL,
`Model` varchar(45) DEFAULT NULL,
`Colour` varchar(45) DEFAULT NULL,
`Power` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
)ENGI... |
<reponame>GYEISSON/MBDA2019
DROP TABLE Perfil;
DROP TABLE Opinion;
DROP TABLE Adjetivo;
DROP TABLE Consulta;
DROP TABLE Temporal;
DROP TABLE Etiqueta;
DROP TABLE Tema;
DROP TABLE Palabra;
DROP TABLE EsPrerrequisito;
DROP TABLE EsSubtema;
DROP TABLE Asignatura;
DROP TABLE Trata;
DROP TABLE Filtr... |
<reponame>razerx100/FaceLook
CREATE DATABASE University;
USE University;
CREATE TABLE Classroom (
building VARCHAR(15),
room_number VARCHAR(7),
capacity NUMERIC(4, 0),
PRIMARY KEY (building, room_number)
);
INSERT INTO Classroom VALUES('Packard', '101', 500);
INSERT INTO Classroom VALUES('Pain... |
--------------------------------------------------------------------------------
-- Initialization --------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------------------------------------------------------... |
CREATE TABLE `rfids` (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`code` TEXT NOT NULL,
`active` BOOLEAN NOT NULL DEFAULT 1,
`description` TEXT NOT NULL DEFAULT ""
);
|
<reponame>DecoWM/bitecm_store
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';
DELIMITER $$
USE `bitel_ecommerce`$$
DROP PROCEDURE IF EXISTS `PA_orderStatusHistory... |
DROP TABLE IF EXISTS Invoice;
GO
|
<reponame>AL137771/harman-cert<filename>jschart/schema.sql
CREATE TABLE IF NOT EXISTS `chart_sales` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` date NOT NULL,
`sales_order` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
/*============api_admin 0001=============================*/
BEGIN;
CREATE TABLE `api_admin_apiaccessrequest` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `created` datetime(6) NOT NULL, `modified` datetime(6) NOT NULL, `status` varchar(255) NOT NULL, `website` varchar(200) NOT NULL, `reason` longtext NOT NULL, `u... |
<filename>test/queries/users/find_by_status.sql
SELECT
username, first_name, last_name, email
FROM
users
WHERE
status = :status
|
<gh_stars>1-10
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2016/3/4 16:04:51 */
/*==============================================================*/
drop table if exists BOM;
drop tab... |
CREATE TABLE [dbo].[MessageCategory] (
[MessageCategoryId] INT IDENTITY (-1, -1) NOT FOR REPLICATION NOT NULL,
[CodeName] NVARCHAR (3) NOT NULL,
[ShortName] NVARCHAR (100) NOT NULL,
[FullName] NVARCHAR (200) NOT NULL,
CONSTRAINT [PK_MessageCategory] PRIMARY KE... |
<filename>sql/wonji/group-by/고양이와-개는-몇-마리-있을까.sql
SELECT animal_type, count(animal_type) as count
from animal_ins
group by animal_type
order by case animal_type when "cat" then 1 when "dog" then 2 end; |
<reponame>AjinkyaBangale2/Leetcode-SQL-Solutions
# https://leetcode.com/problems/rising-temperature/
SELECT
weather.id AS 'Id'
FROM
weather
JOIN
weather w ON DATEDIFF(weather.recordDate, w.recordDate) = 1
AND weather.Temperature > w.Temperature
; |
<filename>backend/sql/inspection_persons/select_persons_and_emails.sql
SELECT
p.id,
p.name,
p.type,
e.value AS email
FROM
inspection_person_junction ic
INNER JOIN person p ON p.id = ic.person_id
INNER JOIN email e ON e.person_id = p.id
WHERE
ic.inspection_id = $1
AND p.user_id = $2;
... |
<reponame>PhilippeBinggeli/Hands-On-Data-Science-with-SQL-Server-2017
INSERT Src.OrderLines (ProductId, UnitPrice, Quantity, TotalPrice)
VALUES (1, 100.0, 2, 100. * 2) |
<filename>sql/project.sql
CREATE DATABASE IF NOT EXISTS project;
CREATE OR REPLACE TABLE projects (
id int(11) PRIMARY KEY AUTO_INCREMENT,
name varchar(50),
description varchar(1000),
process varchar(50) NOT NULL,
current_iteration int(11) NOT NULL,
start_date date,
end_date date,
versi... |
<gh_stars>100-1000
-- misc1.test
--
-- execsql {SELECT sum(one), two, four FROM agger
-- GROUP BY two, four ORDER BY sum(one) desc}
SELECT sum(one), two, four FROM agger
GROUP BY two, four ORDER BY sum(one) desc |
CREATE TABLE log_op (
ID VARCHAR(64) NOT NULL,
TENANT_ID VARCHAR(64) ,
CLASS_NAME VARCHAR(255) ,
METHOD VARCHAR(255) ,
TAG VARCHAR(255) ,
OPERATION VARCHAR(255) ,
PATH VARCHAR(255) ,
PARAM TEXT,
RESULT TEXT,
CODE INTEGER,
MSG TEXT,
HANDLE_TIME BIGINT,
DURATION VARCHAR(30),
IP VARCHAR(255) ,... |
ALTER TABLE users ADD COLUMN watson_token text;
|
DROP DATABASE IF EXISTS employee_db;
CREATE DATABASE employee_db;
USE employee_db;
CREATE TABLE employee
(
id INT NOT NULL
AUTO_INCREMENT,
first_name VARCHAR
(30) NOT NULL,
last_name VARCHAR
(30) NOT NULL,
role_id INT NOT NULL,
manager_id INT,
PRIMARY KEY
(id)
);
CREATE TABLE role
... |
CREATE TABLE `fine_types_ambulance` (
`id` int(11) NOT NULL,
`label` varchar(255) DEFAULT NULL,
`amount` int(11) DEFAULT NULL,
`category` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `fine_types_ambulance` (`id`, `label`, `amount`, `category`) VALUES
(1, 'Care for a member of the ... |
<filename>1.32.0/var/www/html/indicia/modules/indicia_setup/db/version_0_2_3/201001122200_attribute_views.sql
DROP VIEW IF EXISTS detail_occurrences;
CREATE OR REPLACE VIEW detail_occurrences AS
SELECT o.id, o.confidential, o.comment, o.taxa_taxon_list_id, o.determiner_id, t.taxon, s.entered_sref, s.entered_sref_syst... |
CREATE TABLE `users` (
`id` INT(11) NOT NULL,
`roles` varchar(500) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`confirm_uuid` varchar(255) NOT NULL,
`confirmed` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
KEY `confirm_uuid` (`confirm_uuid`),
INDEX `email` (`email`)
) EN... |
-- -----------------------------
-- Table structure for `clt_ad`
-- -----------------------------
DROP TABLE IF EXISTS `clt_ad`;
CREATE TABLE `clt_ad` (
`ad_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '' COMMENT '广告名称',
`type_id` tinyint(5) NOT NULL COMMENT '所属位置',
`pic` varchar(20... |
ALTER TABLE ACT_RU_EVENT_SUBSCR
alter column ACTIVITY_ID_ varchar(255); |
<reponame>BOBO41/trifolia
SET NOCOUNT ON
GO
IF NOT EXISTS(SELECT * from app_securable WHERE name = 'PublishSettings')
BEGIN
DECLARE @PublishSettingsSecurable INT;
INSERT INTO app_securable (name, displayName) VALUES ('PublishSettings', 'Publish Settings');
SELECT @PublishSettingsSecurable = SCOPE_IDENTITY();
DECL... |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
ALTER TABLE rdm.system
DROP CONSTRAINT system_pkey,
ALTER COLUMN code SET NOT NULL,
ADD CONSTRAINT unique_system_code UNIQUE(code);
ALTER TABLE rdm.system
ADD COLUMN id UUID DEFAULT uuid_generate_v4() PRIMARY KEY,
ADD COLUMN is_deleted BOOLEAN;
ALTER TA... |
CREATE TABLE sales (
total DECIMAL(10,2) NOT NULL,
closed BOOLEAN NOT NULL DEFAULT FALSE,
year INT NOT NULL
);
INSERT INTO sales (total, closed, year)
VALUES
(21000.56, FALSE, 2017),
(2345.25, TRUE, 2018),
(10500.50, FALSE, 2016),
(6789.99, TRUE, 2017),
(4567.45, TRUE, 2017),
(1250.00, FALSE,... |
select create_hypertable(
'analytic-event-data', 'timestamp',
partitioning_column => 'transaction-id',
number_partitions => 1,
create_default_indexes => false,
associated_table_prefix => 'aed'
);
alter table "analytic-event-data"
set (
timescaledb.compress,
timescaledb.compress_orderby = '"server-id", ti... |
<reponame>anishasthana/trino
CREATE TABLE IF NOT EXISTS resource_groups (
resource_group_id BIGINT NOT NULL AUTO_INCREMENT,
name VARCHAR(250) NOT NULL,
soft_memory_limit VARCHAR(128) NOT NULL,
max_queued INT NOT NULL,
soft_concurrency_limit INT NULL,
hard_concurrency_limit INT NOT NULL,
sche... |
<reponame>bclennox/pg_partman<filename>sql/functions/create_sub_parent.sql
CREATE FUNCTION create_sub_parent(
p_top_parent text
, p_control text
, p_type text
, p_interval text
, p_native_check text DEFAULT NULL
, p_constraint_cols text[] DEFAULT NULL
, p_premake int DEFAULT 4
, p_start... |
<reponame>loujine/musicbrainz-server
\set ON_ERROR_STOP 1
BEGIN;
ALTER TABLE editor_collection_area ADD COLUMN position INTEGER NOT NULL DEFAULT 0 CHECK (position >= 0);
ALTER TABLE editor_collection_artist ADD COLUMN position INTEGER NOT NULL DEFAULT 0 CHECK (position >= 0);
ALTER TABLE editor_collection_event ADD CO... |
<filename>database_tutorias.sql
create table tipousuario
(
id bigserial not null,
nombre text,
PRIMARY KEY(id)
);
create table usuarios
(
id bigserial not null,
nombre text not null,
paterno text not null,
materno text,
genero text,
direccion text,
telefono text,
estado text,
ciudad text,
email text,
nu_usuario big... |
<filename>db/SimpleTest1_create_tables.sql
--
-- Database Schema: caeschema
-- Automatically generated sql script for the service SimpleTest1, created by the CAE.
-- --------------------------------------------------------
--
-- Table structure for table ta.
--
CREATE TABLE caeschema.ta (
co INTEGER ,
CONSTRAINT co... |
<gh_stars>0
DROP TEXT SEARCH CONFIGURATION my_english;
|
<reponame>opengauss-mirror/Yat
-- @testpoint: alter table 修改有空值的列为not null,合理报错
drop table if exists table_alter_001;
create table table_alter_001
(
c1 int,
c2 bigint,
c3 varchar(20)
);
insert into table_alter_001 values('11',null,'sss');
insert into table_alter_001 values('21','','sss');
insert into table_alter_001 va... |
CREATE TABLE Client
(
Id integer identity(1,1),
UniqueKey uniqueidentifier default newId() not null,
Name varchar(80) not null,
Lastname varchar(80) not null,
SocialNumber varchar(15) not null,
Active bit,
Password varchar(50)
Email varchar(120) not null,
Phone varchar(15),
RegisterDate datetime
);
ALTER TAB... |
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 24, 2018 at 12:01 PM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
<filename>public/newinternet.sql
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 21-Nov-2020 às 00:34
-- 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";
/... |
/* <Begin Comment>
<NAME>
CNIT 27200 Spring 2020
Lab Time: Monday 3:30PM-5:20PM
Duration: 1:50MIN
******************************************************
Question 1A
<End comment> */
Select Food.Supplier_ID, Supplier_Name, Description, Price
From Food
INNER JOIN Food_Supplier ON Food.Supplier_ID = Food_Supplie... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 19, 2019 at 04:54 AM
-- Server version: 5.7.28
-- PHP Version: 7.0.33-11+0~20190923.20+debian9~1.gbpd05c7e
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
DECLARE @image VARBINARY(MAX)
--- JPG 1x1 white background
SET @image = 0xFFD8FFE000104A46494600010101006000600000FFDB004300080606070605080707070909080A0C140D0C0B0B0C1912130F141D1A1F1E1D1A1C1C20242E2720222C231C1C2837292C30313434341F27393D38323C2E333432FFDB0043010909090C0B0C180D0D1832211C21323232323232323232323232323232... |
<reponame>aigt/cadpp-server
-- Database: cadpp
CREATE DATABASE cadpp
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
CONNECTION LIMIT = -1;
-- Table: departments
CREATE TABLE departments
(
id bigint NOT NULL,... |
<reponame>profjjk/the-office<gh_stars>0
-- Test departments --
INSERT INTO departments (department_name)
VALUES ("Administration");
INSERT INTO departments (department_name)
VALUES ("Accounting");
INSERT INTO departments (department_name)
VALUES ("Sales");
INSERT INTO departments (department_name)
VALUES ("Human Resour... |
<reponame>ellyasiml/prognet16
/*
SQLyog Ultimate v13.1.1 (64 bit)
MySQL - 10.4.13-MariaDB : Database - db_praktikum_prognet
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0... |
{{ config (
materialized="view"
)}}
with totalflow_weekday as (
select
weekday,
SUM(totalflow) as totalflow
from {{ source('richards', 'dimRichardStation') }}
group by weekday order by totalflow desc
)
select * from totalflow_weekday |
<filename>db_archive/sql_archive/5133__create_table_anteroapi_dw_api_muu_henkilosto_amk.sql
USE [AnteroAPI]
GO
DROP TABLE IF EXISTS [dw].[api_muu_henkilosto_amk]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dw].[api_muu_henkilosto_amk](
[defaultorder] [bigint] NOT NULL,
[tilastovuosi] [int] N... |
SET DEFINE OFF;
CREATE SEQUENCE AFW_13_MODL_EXCPT_DOCMN_SEQ
START WITH 1
MAXVALUE 9999999999999999999999999999
MINVALUE 1
NOCYCLE
CACHE 20
NOORDER
/
|
<filename>schema.sql
CREATE TABLE IF NOT EXISTS suggestions (
-- suggestion id
idx SERIAL PRIMARY KEY,
-- user that submitted the emoji
user_id BIGINT,
-- message id in the #council-queue
council_message_id BIGINT,
-- message id in the #approval-queue
public_message_id BIGINT,
-... |
<gh_stars>1-10
ALTER TABLE UserRoles DROP COLUMN Override;
|
<gh_stars>1-10
SELECT
t_ili_tid,
wkp,
int_stufe,
bemerkung,
gs_korr,
ngkid,
geometrie
FROM
afu_gefahrenkartierung.gefahrenkartirung_ik_rutsch_spontan
WHERE
int_stufe != 'keine'
;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.