sql stringlengths 6 1.05M |
|---|
<gh_stars>1-10
CREATE TABLE lbcat.sqltest (id INT NULL)
insert into sqltest (id) values (1)
insert into sqltest (id) values (2)
insert into sqltest (id) values (3) |
<gh_stars>1000+
CREATE TABLE `engine_model_conf` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`model_id` bigint(20) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`path` var... |
EXEC SQL DEFINE HAVE_FEATURE;
|
--update table with with primary key
create table uoo(
col1 int primary key,
col2 char(10),
col3 date,
col4 numeric
);
insert into uoo values
(1, 'fff', '2008-10-04', 25),
(4, 'ccc', '05/30/2010', 101),
(3, 'aaa', '04/21/1993', 13),
(5, 'ddd', '2012-12-12', 33),
(2, 'bbb', '03/23/1878', 11);
select * fro... |
create database if not exists `webflux`;
use `webflux`;
create table if not exists `users`(
`id` integer primary key auto_increment,
`username` varchar(100) not null,
`email` varchar(100) not null,
`tenant` varchar(20) not null,
`created_at` datetime not null defa... |
<reponame>CGGTeam/GGFlix
CREATE TABLE sys.partition_functions
(
name sysname NOT NULL,
function_id int NOT NULL,
type char(2) NOT NULL,
type_desc nvarchar(60),
fanout int NOT NULL,
boundary_value_on_right bit NOT NULL,
create_date datetime NOT NULL,
modify_date datetime NOT NULL
); |
SELECT *
FROM UserGameItems
WHERE UserGameId = 235
|
--------------------------------------------------------
-- DDL for Table SOK_PRODUCT_PRICE_LU
--------------------------------------------------------
CREATE TABLE "SOK_PRODUCT_PRICE_LU"
( "PRODUCT_PRICE_ID" NUMBER(*,0),
"PRODUCT_PRICE_AMOUNT" FLOAT(126),
"PRODUCT_ID" NUMBER(*,0),
"CREATED_DATE" DATE,
... |
<reponame>ingeniamos/laravelferco<filename>public/FERCO/1_pruebas/comparar_ferco_local.sql
/*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50505
Source Host : localhost:3306
Source Database : ferco_local
Target Server Type : MYSQL
Target Server Version : 50505
F... |
<filename>sql/createtables.sql
DROP TABLE IF EXISTS todo;
CREATE TABLE todo (
id SERIAL PRIMARY KEY,
note text,
dueDate timestamp,
repeat boolean DEFAULT false,
completed boolean DEFAULT false
);
|
--------------------------------------------------------
-- DDL for Type SEAT_ROW_LIST
--------------------------------------------------------
CREATE OR REPLACE EDITIONABLE TYPE "CS669"."SEAT_ROW_LIST" IS TABLE OF VARCHAR2(200)
/
--------------------------------------------------------
-- DDL for Type SEAT_ROW_L... |
<reponame>cyw0ng/enigma<gh_stars>0
CREATE TABLE `capeclist`
(
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(225) NOT NULL,
`prerequisites` varchar(2048) DEFAULT NULL,
`related_weakness` varchar(225) DEFAULT NULL,
`description` varcha... |
<reponame>razsilev/TelerikAcademy_Homework
USE [Company]
GO
SELECT d.Name AS [Departmant name],
COUNT(*) AS [Number of employees]
FROM [Departments] d
INNER JOIN [Employees] e
ON d.DepartmentID = e.DepartmentID
GROUP BY d.Name
ORDER BY COUNT(*) DESC |
-- Table structure for table `company`
CREATE TABLE `company`
(
`CompanyId` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(100) NOT NULL,
PRIMARY KEY (`CompanyId`)
) ENGINE = InnoDB; |
CREATE OR REPLACE PROCEDURE XML_Comsumptions()
Language plpgsql
AS
$$
BEGIN
SELECT xmlelement(
name value,
xmlattributes(comsumption_cod as comsumption),
xmlelement( name nif, nif),
xmlelement( name comsumption_date, comsumption_date)
)
FROM Comsumptions;
END
$$
|
<filename>question.sql
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 26, 2019 at 07:12 AM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:0... |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 27-03-2015 a las 19:35:56
-- Versión del servidor: 5.5.41-0ubuntu0.14.04.1
-- Versión de PHP: 5.5.9-1ubuntu4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @O... |
SELECT Name
FROM STUDENTS
WHERE ( Marks > 75 )
ORDER BY RIGHT (Name, 3), Id ASC
;
|
-- Clean up airports_bulk
SELECT * FROM airports_bulk ab ;
ALTER TABLE airports_bulk
DROP COLUMN rec_type,
DROP COLUMN site_num,
DROP COLUMN eff_date,
DROP COLUMN field_office_code,
DROP COLUMN state_post_office_code,
DROP COLUMN county_post_office_code,
DROP COLUMN owner_type,
DROP COLUMN fac_use,
... |
-- !Ups
ALTER TABLE report_data
DROP CONSTRAINT report_data_report_id_fkey,
ADD CONSTRAINT report_data_report_id_fkey
FOREIGN KEY (report_id)
REFERENCES reports(id)
ON DELETE CASCADE;
-- !Downs
|
merge `{{params.destination_dataset_project_id}}.{{params.destination_dataset_name}}.traces` dest
using {{params.dataset_name_temp}}.{{params.source_table}} source
on false
when not matched and date(block_timestamp) = '{{ds}}' then
insert (
transaction_hash,
transaction_index,
from_address,
to_address,
... |
<gh_stars>0
--db creating:
create database tracker_system;
-------------------------------------
-- tables creating:
create table roles
(
role_id serial primary key,
role_name VARCHAR (100) UNIQUE NOT NULL
);
create table role_rights
(
right_id serial primary key,
role_id integer NOT NULL REFERENCES roles(role_id),
r... |
<filename>src/main/resources/db/changelog/changes/v1.0.0/sql/2021-07-09-12__create-contribution-criteria-table.sql<gh_stars>0
CREATE TABLE contribution_criteria_configuration
(
id UUID NOT NULL,
contribute_but_suppress_code_id UUID,
contribute_as_system_owned_cod... |
CREATE TABLE [dbo].[Tags](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Tree] [nvarchar](100) NOT NULL,
[Branch] [nvarchar](100) NULL,
[Nodes] [nvarchar](max) NULL,
CONSTRAINT [PK_Tags] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLO... |
<filename>modules/core/db/update/hsql/17/170311-2-createCruisesampleRoutePortLink.sql
alter table CRUISESAMPLE_ROUTE_PORT_LINK add constraint FK_CRPL_ROUTE foreign key (ROUTE_ID) references CRUISESAMPLE_ROUTE(ID);
alter table CRUISESAMPLE_ROUTE_PORT_LINK add constraint FK_CRPL_PORT foreign key (PORT_ID) references CRUI... |
<gh_stars>100-1000
/*!40101 SET NAMES binary*/;
INSERT INTO `pk_case_1` VALUES
(0,10),
(1,9),
(2,8),
(3,7),
(4,6),
(5,5),
(6,4),
(7,3),
(8,2),
(9,1),
(10,0);
|
<reponame>ngalaiko/sturdy<filename>api/pkg/db/migrate/schema/migrations/000033_github_app_installations_uninstalled_at.up.sql
ALTER TABLE github_app_installations ADD COLUMN uninstalled_at timestamp; |
-- @Description Ensures that drop database during reindex operations does not work
--
1: @db_name reindexdb:DELETE FROM reindex_alter_ao_btree WHERE a < 128;
2: @db_name reindexdb:BEGIN;
2: REINDEX index idx_reindex_alter_ao_btree;
3: @db_name template1: alter database reindexdb rename to reindexdb2;
2: COMMIT;
|
<gh_stars>100-1000
-- char check
CREATE TABLE chartmp (a char(32));
\copy chartmp from 'data/char.data'
SET enable_seqscan=on;
SELECT count(*) FROM chartmp WHERE a < '31b0'::char(32);
SELECT count(*) FROM chartmp WHERE a <= '31b0'::char(32);
SELECT count(*) FROM chartmp WHERE a = '31b0'::char(32);
SELECT co... |
<gh_stars>0
SELECT * FROM inventory_item c ORDER BY c;
SELECT * FROM inventory_item c ORDER BY c.*;
SELECT * FROM inventory_item c ORDER BY ROW(c.*);
|
CREATE TABLE users (
id serial PRIMARY KEY,
external_id VARCHAR (255) NOT NULL,
source VARCHAR(40) NOT NULL,
UNIQUE (external_id, source)
);
|
<reponame>almevik/todo_app<filename>tests/_data/dump.sql<gh_stars>0
-- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия сервера: 5.6.37 - MySQL Community Server (GPL)
-- Операционная система: Win64
-- HeidiSQL Версия: 9.5.0.... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 15 Jul 2019 pada 07.26
-- Versi server: 10.1.31-MariaDB
-- Versi PHP: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
<filename>spring_security/src/main/resources/data.sql
insert into SYS_USER (id,username,password) values (1,'<PASSWORD>','<PASSWORD>');
insert into SYS_USER (id,username,password) values (2,'dream','<PASSWORD>');
insert into SYS_ROLE (id,name) values (1,'ROLE_ADMIN');
insert into SYS_ROLE (id,name) values (2,'ROLE_USER... |
<filename>dbachecksToDatabase/PSCustomObjectToDatabase.sql
USE [__DBA];
GO
IF OBJECT_ID(N'dbo.dbachecksStaging', N'U') IS NULL BEGIN
CREATE TABLE dbo.dbachecksStaging (
ServerName varchar(50) NOT NULL,
TestName varchar(128) NOT NULL,
TestDescription ... |
<gh_stars>0
--
-- Dumping data for table `etnicidades`
--
INSERT INTO `etnicidades` (`id`, `name`, `description`) VALUES
(1, 'Otro', NULL),
(2, 'Negro/mulato/afrocolombiano', NULL);
|
<filename>prueba_factura.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 28-09-2017 a las 10:37:43
-- Versión del servidor: 5.7.14
-- Versión de PHP: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40... |
ALTER TABLE `users` ADD `referred_by` BIGINT NULL AFTER `user_type`;
ALTER TABLE `users` ADD `referral_comission` INT(1) NOT NULL DEFAULT '0' AFTER `balance`;
ALTER TABLE `wallets` ADD `referral_user` BIGINT NULL AFTER `reciept`;
INSERT INTO `settings` (`id`, `type`, `value`, `created_at`, `updated_at`, `deleted_at`)... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 11, 2018 at 07:38 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
<filename>src/db/database.sql
-- This file is not necessary
-- but it shows what we did in terms of creating db
CREATE DATABASE pernUserTodo;
-- Serial is for incrementing it each time
-- Primary key is for making it unique
-- Max character in 255
CREATE TABLE todo (
todo_id SERIAL PRIMARY KEY,
descrip... |
<filename>master-php/aprendiendo-sql/05-agrupamiento/insert.sql
#INSERTS PARA CATEGORIAS#
INSERT INTO categorias VALUES(null, 'Acción');
INSERT INTO categorias VALUES(null, 'Rol');
INSERT INTO categorias VALUES(null, 'Deportes');
#INSERTS PARA ENTRADAS#
INSERT INTO entradas VALUES(null, 1, 1, 'Novedades de GTA 5 Onlin... |
<reponame>tmori/postgres-tutorial<filename>db/sql/select-distinct.sql
SELECT DISTINCT city_id
FROM weather
ORDER BY city_id;
|
create or replace PACKAGE "BLOG_LOG"
AUTHID DEFINER
AS
-------------------------------------------------------------------------------
FUNCTION apex_error_handler(
p_error IN apex_error.t_error
) RETURN apex_error.t_error_result;
--------------------------------------------------------------------------------... |
<filename>src/main/database/bridges/BR_USER_HOSTNAME.sql<gh_stars>1-10
CREATE TABLE `BR_USERS_HOSTNAME` (
`USERS_ID` INT(11) NOT NULL,
`HOSTNAME_ID` INT(11) NOT NULL,
PRIMARY KEY (`USERS_ID`, `HOSTNAME_ID`),
INDEX `BR_USERS_HOSTNAME_HOSTNAME_ID` (`HOSTNAME_ID`),
CONSTRAINT `BR_USERS_HOSTNAME_USERS_ID` FOREIGN KEY ... |
<gh_stars>10-100
-- file:alter_generic.sql ln:80 expect:true
ALTER AGGREGATE alt_agg2(int) SET SCHEMA alt_nsp2
|
-- file:strings.sql ln:235 expect:true
SELECT 'hawkeye' NOT LIKE 'h%eye' AS "false"
|
ALTER TABLE creature_template
ADD COLUMN `spell5` mediumint(8) unsigned NOT NULL default '0' AFTER `spell4`,
ADD COLUMN `spell6` mediumint(8) unsigned NOT NULL default '0' AFTER `spell5`,
ADD COLUMN `spell7` mediumint(8) unsigned NOT NULL default '0' AFTER `spell6`,
ADD COLUMN `spell8` mediumint(8) unsigned NOT... |
CREATE TABLE public.activity
(
id bigint NOT NULL,
CONSTRAINT activity_pkey PRIMARY KEY (id)
)WITH (
OIDS=FALSE
);
CREATE TABLE public.company
(
id bigint NOT NULL,
CONSTRAINT company_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
CREATE TABLE public.company_history
(
id b... |
<gh_stars>1-10
create or replace package ut_event_manager authid current_user as
/*
utPLSQL - Version 3
Copyright 2016 - 2018 utPLSQL Project
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... |
<gh_stars>10-100
BEGIN;
ALTER TABLE brokers ADD CONSTRAINT unique_broker_url UNIQUE (broker_url);
COMMIT; |
-- start_ignore
drop database if exists gpsd_db_with_hll;
-- end_ignore
create database gpsd_db_with_hll;
\c gpsd_db_with_hll
create table minirepro_foo(a int, b int[]);
insert into minirepro_foo values(1, '{10000, 10000, 10000, 10000}');
insert into minirepro_foo values(1, '{10000, 10000, 10000, 10000}');
insert into... |
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字node(非保留),作为视图名
--关键字explain作为视图名,不带引号,创建成功
CREATE or replace VIEW node AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
drop view node;
--关键字explain作为视图名,加双引号,创建成功
CREATE or replace VIEW "node" AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_... |
<reponame>0347778774/PTPMPT-20211-1<filename>database/webshop.sql
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th6 29, 2021 lúc 10:13 AM
-- Phiên bản máy phục vụ: 10.4.17-MariaDB
-- Phiên bản PHP: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
STA... |
oradebug setmypid
oradebug unlimit
oradebug dump ashdump 10
oradebug tracefile_name
|
<reponame>ElenMik/blogbuster
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 15-10-2021 a las 10:29:15
-- Versión del servidor: 8.0.21
-- Versión de PHP: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00... |
<gh_stars>0
create table trackscrobbles
(
id serial not null
constraint trackscrobbles_pkey
primary key,
date timestamp not null,
name text,
artist text,
album text,
tick text not null
)
;
create unique index trackscrobbles_id_uindex
on trackscrobbles (id)
;
create unique index trackscrobbles_date_uindex
... |
ALTER TABLE users ADD COLUMN refresh_token VARCHAR(32);
UPDATE users SET (refresh_token) =
(SELECT refresh_token FROM sessions
WHERE sessions.user_id = users.id);
DROP TABLE sessions;
|
<gh_stars>0
CREATE TABLE `test_products` (
id INT NOT NULL,
title VARCHAR(100),
description VARCHAR(100),
price FLOAT,
location VARCHAR(100),
PRIMARY KEY (id)
);
-- dummy records used to test deletion
INSERT INTO `test_products` (`id`, `title`, `description`, `price`, `location`) VALUES ('1', 'test_pr... |
-- Sep 18, 2017 12:37:19 PM GMT+08:00
-- 1008477 List on Position field in Lead window is blank even if there are position options configured.
UPDATE AD_Val_Rule SET Code='((C_Job.IsEmployee=(SELECT IsEmployee FROM C_BPartner WHERE C_BPartner_ID=@C_BPartner_ID:0@)) OR (C_Job.IsEmployee=''N'' AND @C_BPartner_ID:0@=0))',... |
CREATE TABLE IF NOT EXISTS messages (
messageid bigint UNIQUE NOT NULL PRIMARY KEY,
userid bigint NOT NULL,
content text NOT NULL
); |
# Window settings
window-title RePyCraft
# GUI
text-default-font gfx/Minecraftia.ttf
# Misc
bounds-type box
background-color 0.5294 0.8078 0.9215
|
CREATE UNIQUE INDEX IF NOT EXISTS pk_egcl_bankaccountservicemapping ON public.egcl_bankaccountservicemapping USING btree (id);
CREATE INDEX IF NOT EXISTS idx_ins_transactionnumber_v1 ON public.egcl_instrumentheader_v1 USING btree (transactionnumber);
CREATE UNIQUE INDEX IF NOT EXISTS pk_egcl_instrumenthead_v1 ON pub... |
alter table eg_userrole add column lastmodifieddate TIMESTAMP default now(); |
CREATE PROCEDURE [dbo].[sproc_GetAlbum]
AS
SELECT CAST((SELECT * FROM Album FOR JSON PATH) AS VARCHAR(MAX)) AS JSONDATA |
<filename>db/postgresql/go/20210817133001-create-pali_words/up.sql
-- Your SQL goes here
CREATE TABLE pali_words (
id SERIAL PRIMARY KEY,
book_id INTEGER NOT NULL,
paragraph INTEGER NOT NULL,
pali_word_index_id INTEGER NOT NULL,
is_base BOOL NOT NULL,
weight ... |
<filename>src/test/resources/sql/alter_operator_family/8ca3db7c.sql
-- file:alter_generic.sql ln:323 expect:true
ALTER OPERATOR FAMILY alt_nsp6.alt_opf6 USING btree ADD OPERATOR 1 < (int4, int2)
|
CREATE TABLE table_Role (
role_Id SERIAL PRIMARY KEY,
role_Name VARCHAR(100)
);
CREATE TABLE table_user (
user_Id SERIAL PRIMARY KEY,
user_Login varchar(50) not null,
user_Pasword varchar(50),
role_Id integer references table_Role(role_Id)
);
CREATE TABLE table_Rules (
rules_Id SERIAL PRIMARY KEY,
rules_Name VAR... |
<reponame>pupamanyu/cicd<filename>etls/evaluation/lor/load_scripts/game_event_inserttable.sql
/*
Copyright 2020 Google LLC.
This software is provided as-is, without warranty or representation
for any use or purpose. Your use of it is subject to your agreement with Google.
SQL Script(This one): game_event_inserttable
... |
--
-- SPDX-License-Identifier: Apache-2.0
--
\c fabricexplorer;
--TODO research the prev_blockhash for the genesis block??
ALTER TABLE Blocks ADD COLUMN prev_blockhash character varying(256) DEFAULT NULL;
ALTER TABLE Blocks ADD COLUMN blockhash character varying(256) DEFAULT NULL;
ALTER TABLE Blocks ADD COLUMN gene... |
<filename>src/cloud/vzmgr/schema/000012_add_deployment_keys.up.sql
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- This table contains keys that can be used to deploy a new vizier.
CREATE TABLE vizier_deployment_keys (
-- The ID to use for this cluster.
id UUID UNIQUE DEFAULT uuid_generate_v4(),
-- org_id is the ... |
ALTER TABLE job ADD COLUMN job_updated timestamp null;
|
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: image; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA image;
ALTER SCHEMA image OWNER TO pos... |
BEGIN;
ALTER TABLE land ADD COLUMN OtherCleanTime INTEGER NOT NULL default 0;
ALTER TABLE land ADD COLUMN Dwell INTEGER NOT NULL default 0;
COMMIT;
|
<reponame>opengauss-mirror/Yat
-- @testpoint: opengauss关键字table(保留),作为游标名,部分测试点合理报错
--前置条件
drop table if exists table_test cascade;
create table table_test(cid int,fid int);
--关键字不带引号-失败
start transaction;
cursor table for select * from table_test order by 1;
close table;
end;
--关键字带双引号-成功
start transaction;
cursor ... |
INSERT INTO departments(department_name)
VALUES("Digital"),
("HR"),
("Accounting"); |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 09, 2017 at 03:06 PM
-- Server version: 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_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
update categoria_ebay set interesante = true;
update categoria_ebay set interesante = false where id in (7, 14, 35, 54, 320, 357, 370, 387, 413, 416, 461, 510, 525, 764, 790, 802, 896, 955, 998, 1004, 1044, 1196, 1208, 1222, 1304, 1313, 1441, 1449, 1450, 1475, 1476, 1478, 1479, 1481, 1482, 1484, 1485, 1486, 1487, 1488,... |
SELECT C.*, O.order_num, O.order_date, OI.prod_id, OI.quantity, OI.item_price
FROM Customers AS C, Orders AS O, OrderItems AS OI
WHERE C.cust_id = O.cust_id
AND OI.order_num = O.order_num
AND prod_id = 'RGAN01';
SELECT *
FROM Customers AS C, Orders AS O, OrderItems AS OI
WHERE C.cust_id = O.cust_id
AND OI.order_num... |
CREATE VIEW view_email_address AS
SELECT email_address.id AS id, CONCAT(email_address.local, '@', email_domain.value) AS email_address
FROM email_address JOIN email_domain ON email_address.domain_id = email_domain.id
;
|
<gh_stars>0
create or replace view DEMO_DB.PUBLIC.my_second_dbt_model as (
-- Use the `ref` function to select from other models
select *
from DEMO_DB.PUBLIC.my_first_dbt_model
where id = 1
);
|
<filename>skkm_v3.sql
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 06 Apr 2016 pada 18.56
-- Versi Server: 5.6.21
-- PHP Version: 5.5.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
<reponame>AlainD-/storefront-api
CREATE TABLE users (
id SERIAL PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(100) NOT NULL,
password VARCHAR(60) NOT NULL
);
|
<gh_stars>0
$table_id BIGINT REFERENCES $table(id) DEFERRABLE INITIALLY DEFERRED, |
<reponame>christophanneser/Bao-for-Presto
SELECT COUNT(*)
FROM
tag as t,
site as s,
question as q,
tag_question as tq
WHERE
t.site_id = s.site_id
AND q.site_id = s.site_id
AND tq.site_id = s.site_id
AND tq.question_id = q.id
AND tq.tag_id = t.id
AND (s.site_name in ('stackoverflow'))
AND (t.name in ('android-styles','f... |
<reponame>TjDMC/dictci
DROP DATABASE DICT;
CREATE DATABASE DICT;
CREATE TABLE EMPLOYEE(
EMP_NO CHAR(7) NOT NULL UNIQUE,
EMP_FIRSTNAME VARCHAR(20) NOT NULL,
EMP_LASTNAME VARCHAR(20) NOT NULL,
EMP_MIDDLE VARCHAR(20) NOT NULL,
EMP_POSITION VARCHAR(50) NOT NULL,
EMP_SALARY DECIMAL(2) NOT NULL,
EMP_VACLEAVE_BAL INT... |
--=================================================================================================
-- Grant SELECT, INSERT, UPDATE, DELETE and EXECUTE permissions.
-- Assumes the login name is '<DatabaseName>_User'
--=================================================================================================
DE... |
<gh_stars>0
CREATE TABLE [dbo].[sqlwatch_stage_table_stats]
(
table_name nvarchar(512),
[database_name] sysname,
database_create_date datetime2(3),
row_count real,
total_pages real,
used_pages real,
[data_compression] bit,
snapshot_time datetime2(0),
snapshot_type_id tinyint,
sql_instance varchar(32),
cons... |
create or alter procedure scheduler.ExecuteTask
@taskUid uniqueidentifier = null
as
begin
set xact_abort on;
set nocount on;
if (@taskUid is null)
begin
;throw 50000, '@taskUid must be specified', 1;
end
if not exists (
select 1
from scheduler.Task as t
where t.TaskUid = @taskUid
)
b... |
CREATE DATABASE IF NOT EXISTS `IDF` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `IDF`;
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
--
-- Host: localhost Database: IDF
-- ------------------------------------------------------
-- Server version 5.7.28-0ubuntu0.18.04.4
/*!40101 SET @OLD_CHARACTER_SET_CL... |
ALTER FUNCTION IF EXISTS function1(number) RENAME TO function2;
ALTER FUNCTION IF EXISTS function2(number) SET SECURE;
ALTER FUNCTION function3() UNSET COMMENT;
|
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 03, 2017 at 05:12 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
select t_name, count(*)
from tag, message, message_tag recent, knows
where
m_messageid = mt_messageid and
mt_tagid = t_tagid and
m_creatorid = k_person2id and
m_c_replyof IS NULL and -- post, not comment
k_person1id = 21990232556256 and
m_creationdate >= '2011-07-21T22:00:00' and m_creationdate... |
CREATE TABLE `dashboard_metadata` (
`dashboard_id` VARCHAR(255) NOT NULL PRIMARY KEY,
`grafana_id` INT NOT NULL,
`dashboard_version` INT NOT NULL,
`dashboard_schema_version` INT DEFAULT NULL
) DEFAULT CHARACTER SET 'utf8';
|
-- Deploy scribly:user_story_view to pg
BEGIN;
CREATE
OR REPLACE VIEW user_stories AS
SELECT
users.id AS user_id,
stories.id AS story_id,
(
CASE
WHEN user_story_hides.hidden_status = 'hidden' THEN true
ELSE false
END
) AS hidden
FROM
stories
LEFT JOIN sto... |
-- in4.test
--
-- execsql { SELECT b FROM t2 WHERE a IN (1.0, 2.1) }
SELECT b FROM t2 WHERE a IN (1.0, 2.1) |
<reponame>ACassiusD/LoveXperts<filename>sql/ethnicity.sql
-- Author: <NAME>
-- File name ethnicity.sql
-- Date: 2015-10-08
-- Description: -- Creates the table for ethnicity
DROP TABLE IF EXISTS ethnicity;
CREATE TABLE ethnicity(
value SMALLINT PRIMARY KEY,
property VARCHAR(100)
);
INSERT INTO ethnicity(valu... |
DROP TABLE IF EXISTS Results;
DROP TABLE IF EXISTS Submissions;
DROP TABLE IF EXISTS Invites;
DROP TABLE IF EXISTS ClassMembers;
DROP TABLE IF EXISTS Assignments;
DROP TABLE IF EXISTS Courses;
DROP TABLE IF EXISTS Accounts;
|
<filename>src/main/resources/db/migration/V0006__Add_seen_video_to_user.sql
ALTER TABLE sic_user ADD seen_video BOOLEAN DEFAULT FALSE NOT NULL;
|
CREATE TABLE team
(
name VARCHAR(40) PRIMARY KEY,
note VARCHAR(500) NOT NULL
);
CREATE TABLE clients
(
fio VARCHAR(100) NOT NULL,
ticket INTEGER PRIMARY KEY,
team_name VARCHAR(40) NOT NULL,
birthday DATE NOT NULL,
gender CHAR(1) NOT NULL CHECK ( gender I... |
<filename>jjche-boot/jjche-boot-web-demo/src/main/resources/liquibase/changelog/1.0.0/xml/sql/20200923_001_add_menu_role_rollback.sql
BEGIN;
-- 删除菜单--回滚
DELETE FROM `sys_roles_menus` WHERE
(menu_id = (SELECT id FROM sys_menu WHERE `permission` = 'student:list')
OR
menu_id = (SELECT id FROM sys_menu WHERE `permiss... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.