sql stringlengths 6 1.05M |
|---|
select veh.registration, concat(left(mtc.number,4), ' ', substring(mtc.number,5,4), ' ', right(mtc.number,4)) as testno, adr.address_line_1, adr.address_line_2, dvla.recent_v5_document_number
from vehicle veh, address adr, contact_detail cd, site_contact_detail_map scdm, site s, mot_test_current mtc, dvla_vehicle dvla
... |
CREATE TABLE `yidian`.`yidian_present` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '产品id',
`name` VARCHAR(200) NOT NULL COMMENT '名称',
`img` VARCHAR(10000) NOT NULL COMMENT '图片',
`price` DOUBLE NOT NULL COMMENT '价格',
`status` INT NULL DEFAULT 1 COMMENT '状态',
`created_date` DATETIME NULL COMMENT '创建时间',
`upd... |
<reponame>ucdavis/Anlab<gh_stars>1-10
CREATE TABLE [dbo].[Orders] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[AdditionalEmails] NVARCHAR (MAX) NULL,
[ApprovedPaymentTransaction_Id] NVARCHAR (450) NULL,
[ClientId] NVARCHAR (16) ... |
<reponame>Shuttl-Tech/antlr_psql
-- file:window.sql ln:261 expect:true
SELECT generate_series(1, 100) OVER () FROM empsalary
|
<gh_stars>1-10
prompt --application/shared_components/plugins/process_type/com_flows4apex_manage_ins_vars_process
begin
-- Manifest
-- PLUGIN: COM.FLOWS4APEX.MANAGE_INS_VARS.PROCESS
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2020.03.31'
,p_release=>'20.1.0.00.13'
,p_default_workspace... |
BEGIN;
DROP TABLE u_polygon2used_layer;
COMMIT;
|
<reponame>smith750/kc<gh_stars>0
INSERT INTO KRCR_CMPNT_T (NMSPC_CD, CMPNT_CD, NM, ACTV_IND, OBJ_ID, VER_NBR)
values ('KC-S2S', 'All', 'All', 'Y', sys_guid(), 1)
/
|
<filename>src/Resonance.Data.Storage.SQLite/Scripts/GenreCounts_Select.sql<gh_stars>1-10
SELECT
g.Name AS [Genre],
COUNT(gtt.TrackId) AS [SongCount],
COUNT(DISTINCT tta.AlbumId) AS [AlbumCount]
FROM [Genre] g
LEFT JOIN [GenreToTrack] gtt ON gtt.GenreId = g.Id
LEFT JOIN [TrackToAlbum] tta ON tta.TrackId = gtt.TrackI... |
<filename>src/DatabaseScripts/PostgreSQL/02 - DATA.sql
Insert into REGIONS (REGION_ID,REGION_NAME, REGION_ALTERNATE_NAMES) values (1,'Europe', '{"Europa"}');
Insert into REGIONS (REGION_ID,REGION_NAME) values (2,'Americas');
Insert into REGIONS (REGION_ID,REGION_NAME) values (3,'Asia');
Insert into REGIONS (REGION_... |
\timing off
-- Issue #738. Up to you if you want to set it back to, say, "warning"
set client_min_messages = error;
--------------------------------------------------------------------------------
-- PREAMBLE.
-- This script assumes that the data, and the code, is already installed.
--
-- Doing only these two ... |
SELECT
user_role_id
, ur.user_id
, r.role_key
, r.role_name
, p.permission_key
, p.permission_name
, ur.version
FROM
user_roles ur
LEFT JOIN roles r
ON ur.role_key = r.role_key
AND r.deleted_at IS NULL
LEFT JOIN permissions p
ON r.permission_id = p.permission_id
AND p.deleted_at IS N... |
DROP DATABASE IF EXISTS `retry_cancel`;
CREATE DATABASE `retry_cancel`;
USE `retry_cancel`;
CREATE TABLE t1 (id BIGINT PRIMARY KEY, uid BIGINT) DEFAULT CHARSET=utf8mb4;
INSERT INTO t1 (id, uid) VALUES (1, 101), (2, 102);
INSERT INTO t1 (id, uid) VALUES (3, 103), (4, 104);
|
<filename>src/migrations/13to14-sqlite-migration-progress-pkey.sql<gh_stars>1-10
ALTER TABLE sqlite_migration_progress
DROP COLUMN enforce_single_row,
ADD COLUMN enforce_single_row bool PRIMARY KEY DEFAULT true CHECK(enforce_single_row);
|
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
--
-- RESYNC CO TABLE 1
--
create table resync_co_alter_part_split_partlist1 (i int) with ( appendonly='true', orientation='column') partition by list(i) (partition a values(1, 2, 3, 4),
partition b values(5, 6, 7, 8), default partition... |
/* primaries */
insert into pgwatch2.monitored_db (md_unique_name, md_preset_config_name, md_config, md_hostname, md_port, md_dbname, md_user, md_password, md_is_superuser)
select 'pg'||pgver, 'exhaustive', null, 'localhost', '543'||pgver, 'postgres', 'postgres', 'postgres', true
from unnest(array[90,91,92,93,94,95,96,... |
CREATE TABLE tescases_suites (
testcase_id INTEGER REFERENCES testcases (Test_Case_ID),
testsuite_id INTEGER REFERENCES tescases_suites (testcase_id)
);
CREATE TABLE testcase_priority_enum (
priority_id INTEGER PRIMARY KEY,
priority_name VARCHAR (255)
);
CREATE TABLE testcase_suite_enum (
... |
SELECT
o.poll_id,
o.poll_anonymity,
o.question_order_priority,
o.order_priority,
o.option_text,
COALESCE(SUM(r.poll_priority), 0) AS vote_count
FROM
closed_option o LEFT JOIN anonymous_closed_response r
ON o.poll_id = r.poll_id
AND o.poll_anonymity = r.poll_anonymity
... |
<filename>judges/uri/sql/2602.sql
SELECT name FROM custumers WHERE state = 'RS';
|
<reponame>sergeyyarkov/node-docker-example<gh_stars>0
CREATE TABLE IF NOT EXISTS "articles"(
"id" INTEGER PRIMARY KEY NOT NULL,
"title" VARCHAR(255) NOT NULL,
"description" VARCHAR(1000),
"body" TEXT NOT NULL,
"created_at" TIMESTAMP(0) WITH TIME zone NOT NULL,
"updated_at" TIMESTAMP(0) WITH TIME... |
<reponame>Koulinn/aux-backend
CREATE TABLE IF NOT EXISTS "job_advert_techs" (
"job_advert_id" uuid REFERENCES job_adverts("job_advert_id") NOT NULL,
"tech" VARCHAR(40) REFERENCES techs("tech") NOT NULL,
"seniority_level" VARCHAR(40) REFERENCES seniority_levels("seniority_level"),
"required" BOOL NOT NULL DEFAULT fa... |
CREATE TABLE 'users'(
`id` INT NOT NULL AUTO_INCREMENT,
`username` VARCHAR(45) NULL,
`password` VARCHAR(45) NULL,
`first_name` VARCHAR(45) NULL,
`last_name` VARCHAR(45) NULL,
`email` VARCHAR(45) NULL,
PRIMARY KEY (`id`)
);
INSERT INTO permissions (name, slug, description, created_at, updat... |
Table Create Table
user CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pswd_hash` binary(60) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`trashed_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8
|
<reponame>ComputeCanada/druid-dashboard<filename>tests/data-20210721.sql
-- cluster data
INSERT INTO clusters (id, name) VALUES ('testcluster', 'Test Cluster');
-- component data
INSERT INTO components (id, name, cluster, service) VALUES ('testcluster_detector', 'Detector', 'testcluster', 'detector');
INSERT INTO comp... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 19, 2022 at 06:03 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 8.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
<gh_stars>0
-- remove old procrastinate_finish_job functions
-- https://github.com/peopledoc/procrastinate/pull/336
DROP FUNCTION IF EXISTS procrastinate_finish_job(integer, procrastinate_job_status, timestamp with time zone);
-- https://github.com/peopledoc/procrastinate/pull/354
DROP FUNCTION IF EXISTS procrastinate_... |
<reponame>kousen/shopping_sncorp<filename>src/main/resources/schema.sql
drop table if exists products;
create table products
(
id int not null auto_increment,
name varchar(50) not null,
price decimal not null,
primary key (id)
) |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 06, 2021 at 08:01 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SE... |
<filename>mailrecall.sql
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 27, 2017 at 03:35 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@... |
<filename>qcm-infra-db/src/main/resources/db/migration/V2__tag.sql
CREATE SEQUENCE IF NOT EXISTS tag_q_seq START WITH 1 INCREMENT BY 1;
CREATE SEQUENCE IF NOT EXISTS tag_qcm_seq START WITH 1 INCREMENT BY 1;
CREATE TABLE tag_question
(
id BIGINT NOT NULL,
created_by VARCHAR(255)... |
<reponame>MM-SalvoDragotta/mvc-tech-blog<filename>db/schema.sql
DROP DATABASE IF EXISTS sd_tech_blog_db;
CREATE DATABASE sd_tech_blog_db; |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 23, 2019 at 04:41 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<filename>chapter07/src/main/resources/create-mapping-tables.sql
drop table if exists partner_mapping;
create table partner_mapping ( partner_id character varying ( 9 ) , partner_product_id character varying ( 9 ) , store_product_id character varying ( 9 ) ); |
<filename>bboss-persistent/test/preparedandbatchtest.sql
create table td_reg_bank_acc_bak(
id number(10) primary key,
create_acc_time date,
starttime date,
endtime date
)
/
alter table td_reg_bank_acc_bak add clob1 clob;
alter table td_reg_bank_acc_bak add clob2 clob;
alter table td_reg_bank_acc_ba... |
insert into memento (
prefix
, name
, value
/*%if entity.sortOrder != null *//*# ", sort_order" *//*%end */
/*%if entity.version != null *//*# ", version" *//*%end */
/*%if entity.created != null *//*# ", created" *//*%end */
/*%if entity.modified != null *//*# ", modified" *//*%end */
) values (
/* entity.prefix *... |
<reponame>aravi5/drill-test-framework
select
SUM(
CASE WHEN j1.c_integer IS NULL THEN 0
WHEN j1.c_integer >= 0 THEN 100
WHEN j1.c_integer < 0 THEN -1
END
)
from
`j_empty.parquet` RIGHT OUTER JOIN j1 ON
(j1.c_varchar = `j_empty.parquet`.c_varchar)
RIGHT OUTER JOIN j3 ON
(j1.c... |
ALTER TABLE `addressbook` ADD `middlename` varchar(255) default NULL AFTER `firstname`;
ALTER TABLE `users` ADD `created` DATETIME NULL after `trials`;
ALTER TABLE `users` ADD `modified` DATETIME NULL after `created` ;
ALTER TABLE `users` ADD `deprecated` DATETIME NULL after `modified` ;
UPDATE `users` set creat... |
<filename>webapps/app-core/WEB-INF/db/50-gestion-actividades/init/hsql/10.create-db.sql
-- begin GESTIONACTIVIDADES_RESPONSABLE
create table GESTIONACTIVIDADES_RESPONSABLE (
ID varchar(36) not null,
CREATE_TS timestamp,
CREATED_BY varchar(50),
VERSION integer,
UPDATE_TS timestamp,
UPDATED_BY var... |
<filename>inst/sql/sql_server/GetIncidenceAnalysisResults.sql
select
database_name,
target_cohort_definition_id,
target_name,
time_at_risk_id,
time_at_risk_start_offset,
time_at_risk_start_index,
time_at_risk_end_offset,
time_at_risk_end_index,
subgroup_cohort_definition_id,
subgroup_name,
outcom... |
# Count the number of variants by type in BRCA1.
SELECT
vt AS variant_type,
COUNT(vt) AS num_variants_of_type,
FROM
[genomics-public-data:1000_genomes.variants]
WHERE
reference_name = '17'
AND start BETWEEN 41196311
AND 41277499
GROUP BY
variant_type |
ALTER TABLE users
DROP COLUMN otp; |
<gh_stars>1-10
SELECT datname, xact_commit, xact_rollback,
CASE WHEN xact_commit = 0 THEN 0 ELSE round((( xact_rollback::decimal / (xact_commit + xact_rollback)::decimal) * 100.0 )::decimal, 3) END as ratio
FROM pg_stat_database
ORDER BY xact_rollback DESC;
|
<gh_stars>0
drop table if exists public.personas cascade;
create table public.personas (
id bigint constraint pk_personas primary key,
nombre varchar(100) not null
);
insert into public.personas (id, nombre)
values (1, '<NAME>'),
(2, '<NAME>'),
(3, '<NAME>'),
(4,... |
--+ holdcas on;
--test mod function with a decimal
set system parameters 'compat_mode=cubrid';
create class func_08 ( a int , b string );
create serial func_08_s;
insert into func_08 values ( func_08_s.next_value, 'test');
insert into func_08 values ( func_08_s.next_value, 'test');
insert into func_08 values ( func_08_... |
<reponame>opengauss-mirror/Yat
-- @testpoint: 测试索引名存在与否对重建哈希索引的影响,部分step合理报错
--创建普通行存表
drop table if exists t_hash_index_0045;
create table t_hash_index_0045(id01 int,id02 int) with(orientation=row);
--创建哈希索引
create index i_hash_index_0045_01 on t_hash_index_0045 using hash(id01);
--重建(索引名存在)
reindex index i_hash_in... |
-- @testpoint: 获取参数列表来确定一个函数
select pg_get_function_identity_arguments(a.oid) from PG_PROC a where a.proname = 'age' order by a.oid desc;
select pg_get_function_identity_arguments(a.oid) from PG_PROC a where a.proname = 'to_char' order by a.oid desc;
select pg_get_function_identity_arguments(a.oid) from PG_PROC a wher... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 09, 2021 at 11:26 AM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.4.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<gh_stars>0
# 04. Adding Constraints
#
# Create the connection via foreign key between the “products” and “categories”
# tables that you’ve createdearlier. Make “category_id” foreign key linked to “id”
# in the “categories” table.
USE gamebar;
ALTER TABLE products
ADD CONSTRAINT fk_category_id FOREIGN KEY(category_id... |
<gh_stars>0
--Name:
--CWID:
select cp.*, tavg.THE_AVG, pavg.OTHER_PROD_AVG, cavg.OTHER_CUST_AVG
from (select cust as CUSTOMER,prod as PRODUCT
from sales
group by cust,prod)
as cp
left join
(select cust,prod ,round(avg(quant),0) as THE_AVG
from sales
group by cust,prod)
as tavg
on cp... |
-- Procedure WebPartControl_Del
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[WebPartControl_Del]
(
@PartControlId int
)
AS
SET NOCOUNT ON
IF(@PartControlId > 0)
DELETE FROM WebPartControl
WHERE PartControlId=@PartControlId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIE... |
INSERT INTO WWS_COUNTRIES (ID, NAME, ISO3, ISO2, PHONECODE, CAPITAL, CURRENCY, CREATED_AT, UPDATED_AT, FLAG, WIKIDATAID) VALUES (3, 'Albania', 'ALB', 'AL', '355', 'Tirana', 'ALL', 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'), 1, 'Q222');
INS... |
<filename>db/schema.sql
DROP DATABASE IF EXISTS peer_2_paws;
CREATE DATABASE peer_2_paws;
USE peer_2_paws;
DROP TABLE IF EXISTS Animals;
CREATE TABLE Animals (
id INT AUTO_INCREMENT PRIMARY KEY,
TypeName VARCHAR (64) NOT NULL,
OwnerName VARCHAR (64) NOT NULL,
OwnerEmail VARCHAR (128) NOT NULL,
AnimalName VARC... |
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 13, 2020 at 06:45 PM
-- Server version: 10.3.13-MariaDB
-- PHP Version: 7.3.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
/* 605. Deposits Sum */
USE gringotts;
SELECT deposit_group, SUM(deposit_amount) AS total_sum
FROM wizzard_deposits
GROUP BY deposit_group
ORDER BY total_sum;
|
-- 1. Elimine la tabla:
DROP TABLE IF EXISTS libros;
-- 2. Créela con los siguientes campos: titulo (cadena de 20 caracteres de longitud),
-- autor (cadena de 30), editorial (cadena de 15) y precio (float).
CREATE TABLE libros (
titulo VARCHAR(20),
autor VARCHAR(30),
editorial VARCHAR(15),
precio FLOA... |
CREATE TABLE "[prefix]config" (
"domain" text NOT NULL,
"core" text NOT NULL,
"db" text NOT NULL,
"storage" text NOT NULL,
"components" text NOT NULL
);
COMMENT ON TABLE "[prefix]config" IS 'Settings';
CREATE TABLE "[prefix]groups" (
"id" smallserial,
"title" text NOT NULL,
"descriptio... |
<filename>sql-scripts/create-dimensions.sql
set autocommit=on;
CREATE TABLE customer (
c_custkey integer not null sortkey,
c_name varchar(25) not null,
c_address varchar(25) not null,
c_city varchar(10) not null,
c_nation varchar(15) not null,
c_region ... |
create function atd_txdot_locations_updates_crash_locations() returns trigger
language plpgsql
as
$$
BEGIN
UPDATE atd_txdot_crash_locations
SET location_id = NEW.location_id
WHERE crash_id IN (SELECT crash_id FROM search_atd_location_crashes(NEW.location_id));
RETURN NEW;
END;
$$;
alter functi... |
-- -----------------------------
-- SentCMS MySQL Data Transfer
--
-- Host : 127.0.0.1
-- Port :
-- Database : blt_test
--
-- Part : #20971520
-- Date : 2016-12-23 15:47:04
-- -----------------------------
SET FOREIGN_KEY_CHECKS = 0;
-- -----------------------------
-- Table structure for `onethink_addon... |
--The population of a country
SELECT
name AS 'country',
population
FROM country
WHERE name = 'France'; |
DROP TABLE IF EXISTS /*TABLE_PREFIX*/t_advantages; |
DROP DATABASE IF EXISTS restaurant;
CREATE DATABASE IF NOT EXISTS restaurant;
use restaurant;
CREATE TABLE departments (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(100) NOT NULL
);
CREATE TABLE employees (
id INT PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
d... |
<gh_stars>0
/*
* Copyright (c) 2017 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
SELECT
r.room,
count(DISTINCT c.cage) as TotalCages,
max(cbr.availableCages) as AvailableCages,
count(DISTINCT h.cage) as CagesUsed,
max(cbr.availableCag... |
ALTER TABLE C_TABLE ADD
PRIMARY KEY PK_B_TABLE1
(
C_ID
);
ALTER TABLE C_TABLE CHANGE C_ID C_ID BIGINT NOT NULL COMMENT 'C_ID' AUTO_INCREMENT;
|
<reponame>ChristophBerg/pgweb<gh_stars>1-10
--
-- tables created for compatibility with migration from old system.
-- Once we drop migration support they can be removed, but for now
-- dummies are required for functions to work.
--
CREATE TABLE users_old (
userid character varying(16),
fullname character varyin... |
<reponame>lintzc/GPDB
-- @Description Tests delete on compressed ao tables
--
INSERT INTO FOO VALUES (1, 1, 'c');
SELECT * FROM foo;
DELETE FROM foo;
SELECT * FROM foo;
|
<reponame>digitalsatori/narrows<gh_stars>100-1000
ALTER TABLE characters DROP FOREIGN KEY characters_ibfk_2;
ALTER TABLE characters ADD CONSTRAINT characters_ibfk_2 FOREIGN KEY (player_id) REFERENCES users(id) ON DELETE SET NULL;
|
INSERT INTO `dict_provinces` VALUES ('11', '北京市');
INSERT INTO `dict_provinces` VALUES ('12', '天津市');
INSERT INTO `dict_provinces` VALUES ('13', '河北省');
INSERT INTO `dict_provinces` VALUES ('14', '山西省');
INSERT INTO `dict_provinces` VALUES ('15', '内蒙古自治区');
INSERT INTO `dict_provinces` VALUES ('21', '辽宁省');
INSERT INTO... |
<filename>prisma/migrations/20220320160220_add_website_auth_fields/migration.sql
/*
Warnings:
- A unique constraint covering the columns `[email]` on the table `Website` will be added. If there are existing duplicate values, this will fail.
- Added the required column `email` to the `Website` table without a def... |
CREATE TABLE [dbo].[AuthenticationSource] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (64) NOT NULL,
CONSTRAINT [PK_AuthenticationSource_Id] PRIMARY KEY NONCLUSTERED ([Id] ASC)
);
|
--@Author: <NAME>
--@Fecha de creacion: 18/01/2021
--@Descripcion: Creacion de sinonimos en rfpbd_s2
-- Pais (2)
create or replace synonym pais_f1 for pais_f1_rfp_s1@rfpbd_s1;
create or replace synonym pais_f2 for pais_f2_rfp_s2;
-- Sucursal (3)
create or replace synonym sucursal_f1 for sucurs... |
INSERT INTO ConferenceRooms(RoomID,Name,Capacity)
VALUES(101,'Auditorium',250);
INSERT INTO ConferenceRooms(RoomID,Name,Capacity)
VALUES(220,'2nd Floor Big room',30);
INSERT INTO ConferenceRooms(RoomID,Name,Capacity)
VALUES(225,'2nd Floor Small room',10);
INSERT INTO ConferenceRooms(RoomID,Name,Capacity)
VALUES(300... |
<reponame>tiaherdi/PBL_Sistem_Akademik
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 28, 2018 at 05:24 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";
/*!40101 SET @O... |
CREATE DATABASE dbproven;
USE dbproven;
CREATE TABLE `bookings` (
`idBooking` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`userName` varchar(32) NOT NULL,
`userEmail` varchar(32) NOT NULL,
`className` varchar(32) NOT NULL,
`day` varchar(32) NOT NULL,
`hours` varchar(32) NOT NULL
) ENGINE=InnoDB;
INSER... |
-- phpMyAdmin SQL Dump
-- version 4.9.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jul 28, 2021 at 04:51 PM
-- Server version: 10.3.30-MariaDB-cll-lve
-- PHP Version: 7.3.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!... |
UPDATE Survey set title = :title, description = :description where id=:id |
<gh_stars>1-10
DELETE FROM Interview_Answer WHERE idinterview NOT IN (SELECT idinterview FROM Interview);
DELETE FROM Interview_Question WHERE idinterview NOT IN (SELECT idinterview FROM Interview);
DELETE FROM Interview WHERE idinterview NOT IN (SELECT distinct idinterview FROM Interview_Question);
DELETE FROM Partici... |
<gh_stars>1-10
ALTER TABLE public.search_courtcontact
ADD COLUMN sort_order integer NULL;
UPDATE public.search_courtcontact cc
SET sort_order = c.sort_order
FROM (SELECT id, sort_order FROM search_contact) as c
WHERE cc.contact_id = c.id;
ALTER TABLE public.search_contact
DROP COLUMN IF EXISTS sort_order;
|
<reponame>dimitarminchev/ITCareer
/* 12. Служителите от San Francisco */
USE soft_uni;
SELECT e.first_name, e.last_name
FROM employees e
WHERE e.address_id in
(
SELECT address_id
FROM addresses
WHERE town_id =
(
SELECT town_id
FROM towns
WHERE name = "San Francisco"
)
)
ORDER BY ... |
<filename>pgsmo/objects/view/materialized_view_templates/ppas/9.3_plus/delete.sql
{# =================== Drop/Cascade materialized view by name ====================#}
{% if vid %}
SELECT
c.relname As name,
nsp.nspname
FROM
pg_class c
LEFT JOIN pg_namespace nsp ON c.relnamespace = nsp.oid
WHERE
c.relfile... |
# 创建数据库;
create database userinfo;
# 创建数据库表 user;
create table user(
userid int(255) primary key auto_increment,
mail varchar(255) not null unique,
uploadtime datetime not null,
filename varchar(255) not null,
banned varchar(2) not null
) ENGINE=INNODB AUTO_INCREMENT=1;
# 创建数据库表 task;
create table task(
taski... |
<reponame>Tagar/dremio-oss
--
-- Copyright (C) 2017-2018 Dremio Corporation
--
-- 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
--... |
<filename>_src/ch9/listing_9_10.sql
CONN /as sysdba
GRANT EXECUTE ON dbms_crypto TO xmlusr;
CONN xmlusr/xmlusr;
CREATE OR REPLACE PROCEDURE checkCred (xmldoc XMLType, pswd VARCHAR2)
IS
billName VARCHAR2(30);
hashName VARCHAR2(40);
BEGIN
SELECT extractValue(xmldoc, '/purchaseOrder/billTo/name'... |
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- होस्ट: localhost
-- समय पर बनाया: 02 नवम्बर, 2010 को 10:15 AM
-- Server version: 5.1.36
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTE... |
-- DROP TRIGGER enforce_guests_gender_trgr ON guests;
create
trigger enforce_guests_gender_trgr before insert
or update
on
pantry.guests for each row execute procedure pantry.enforce_guests_gender();;
|
<gh_stars>0
# Identify genomes whose reported gender does not match the calculated gender. The
# calculated gender is determined by the frequency of heterozygous calls on the X
# chromosome.
SELECT
sample_id,
gender,
perct_het_alt_in_snvs,
FROM (
SELECT
data.sample_id AS sample_id,
data.perct_het_alt_in_s... |
select Name as Customers
from Customers c
left join Orders o
on c.Id=o.CustomerId
where o.CustomerId is null;
select Name as Customers from Customers where Id not in(
select Customers.Id from Customers , Orders where Customers.Id = Orders.CustomerId
group by CustomerId);
|
<reponame>cuishaowen/wordAssault2<filename>db/data.sql
-- 课程状态
INSERT INTO engweb.sys_dict (id, value, label, type, description, sort, parent_id, create_by, create_date, update_by, update_date, remarks, del_flag)
VALUES ('120', '0', '体验', 'course_status', '课程状态', 10, '0', '1', now() , '1', now(), null, '0');
INSERT INT... |
insert into fact VALUES(45, 'facts.ansible', 'LIST');
insert into fact VALUES(46, 'facts.ansible.tower_version', 'STRING');
insert into fact VALUES(47, 'facts.ansible.hub_version', 'STRING');
insert into fact VALUES(48, 'facts.ansible.catalog_worker_version', 'STRING');
insert into fact VALUES(49, 'facts.ansible.contro... |
<filename>modules/domain/src/main/resources/tables/company.sql
-- Table: company
DROP TABLE IF EXISTS company CASCADE;
CREATE TABLE company(
id bigserial NOT NULL,
code character varying(50) NOT NULL, -- COMPANY code
name character varying(255) NOT NULL, -- COMPANY name
address1 text, -- COMPANY address 1
... |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE IF NOT EXISTS `credentials` (
`username` varchar(500) NOT NULL,
`password` varchar(500) NOT NULL,
`status` varchar(10) NOT NULL DEFAULT 'active',
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NOT ... |
--DROPING EXISTING PEPYS.COMMENTS_FOR FUNCTION
DROP FUNCTION IF EXISTS PEPYS.COMMENTS_FOR;
--CREATING PEPYS.COMMENTS_FOR FUNCTION
CREATE FUNCTION PEPYS.COMMENTS_FOR(
INP_START_TIME TEXT,
INP_END_TIME TEXT,
INP_COMMENT_SEARCH_STRING TEXT,
INP_SOURCE_ID TEXT[],
INP_PLATFORM_ID TEXT[],
INP_PAGE_NO... |
<reponame>Torvaney/pugsql
-- :name username_for_id
-- :result :1
select username from users where user_id = :user_id
|
<gh_stars>0
pay_by_quarter integer ARRAY[4],
|
<reponame>salspaugh/queryutils<filename>scripts/schemas/sqlite/parsetrees.sql
DROP TABLE IF EXISTS parsetrees;
CREATE TABLE parsetrees (
id INTEGER PRIMARY KEY AUTOINCREMENT,
parsetree TEXT NOT NULL,
query_id INTEGER REFERENCES queries(id),
CONSTRAINT query FOREIGN KEY (query_id) REFERENCES queries(id)
... |
SELECT d.Name Department, e.Name Employee, e.Salary Salary
FROM Employee e
JOIN Department d ON e.DepartmentId = d.Id
JOIN (SELECT e.DepartmentId DepartmentId, MAX(Salary) Salary
FROM (Employee e
JOIN Department d ON e.DepartmentId = d.Id)
GROUP BY... |
<gh_stars>10-100
CREATE OR REPLACE FUNCTION bitemporal_internal.ll_bitemporal_delete_select(
p_table text,
p_search_fields text,
p_values_selected_search text,
p_asserted temporal_relationships.timeperiod)
RETURNS integer
LANGUAGE 'plpgsql'
COST 100
VOLATILE
AS $BODY$
DECLARE
v_rowcount INTEGER:=0... |
DROP TABLE IF EXISTS test_ao_types_polygon;
CREATE TABLE test_ao_types_polygon (c0 polygon) with (appendonly=true, orientation=row, compresstype=none, blocksize=32768, checksum=false, compresslevel=0);
INSERT INTO test_ao_types_polygon values ('((1,1),(3,2),(4,5))'),
('((100,123),(5,10),(7,2),(4,5))'),
(null); |
<filename>code/sql/gmall.dws_user_retention.sql
-- 每日留存用户明细表
-- 1)建表语句
drop table if exists dws_user_retention_day;
create external table dws_user_retention_day
(
`mid_id` string COMMENT '设备唯一标识',
`user_id` string COMMENT '用户标识',
`version_code` string COMMENT '程序版本号',
`version_name` strin... |
SELECT
t.id_talhao id,
t.id_fazenda,
t.descr AS talhao,
tb.descr AS bloco,
i.nome AS insumo,
vpsrt. id_cultura,
vpsrt.dt_inicial,
vpsrt.dt_final,
vpsrt.peso_armazem,
vpsrt.peso_silobag,
vpsrt.peso_silosweep,
vpsrt.peso_limpo,
vpsrt.area_total,
vpsrt.area_plantada,
vpsrt.area_colhida,
vpsrt.idade,
vpsrt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.