sql stringlengths 6 1.05M |
|---|
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"email" TEXT NOT NULL,
"name" TEXT NOT NULL,
PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Restaurant" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"slug" TEXT NOT NULL,
"tag" TEXT[],
"averageCost" INTEGER NOT NULL,
"... |
CREATE DATABASE IF NOT EXISTS `springit`;
USE `springit`;
--
-- Table structure for table `comment`
--
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`created_by` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`modified_by` varchar(255) DEFAU... |
<filename>cobacrud.sql
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 13, 2018 at 11:20 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:... |
<gh_stars>0
-- ------------------------------------------------------------------------------
-- Sample SH query used for SQL Plan baselines
-- Ref: https://docs.oracle.com/database/121/TGSQL/tgsql_spm.htm#TGSQL94653
-- -----------------------------------------------------------------------------
SELECT /* q1_grou... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 31, 2021 at 07:37 AM
-- 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>victorwitkamp/PortalCMS
/*
* Copyright <NAME> (c) 2020.
*/
ALTER TABLE mail_schedule
ADD COLUMN sender_email varchar(254) AFTER id;
ALTER TABLE mail_schedule
ADD COLUMN member_id INT AFTER body;
ALTER TABLE mail_schedule
ADD COLUMN user_id INT AFTER member_id;
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th9 11, 2021 lúc 12:04 PM
-- Phiên bản máy phục vụ: 10.4.19-MariaDB
-- Phiên bản PHP: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
-- Script that creates a table called first_table in the current database in a MySQL server.
-- Create table
CREATE TABLE IF NOT EXISTS first_table
(
id INT,
name VARCHAR(256)
);
|
DROP TABLE IF EXISTS method_uses;
DROP TABLE IF EXISTS method_definition;
DROP TABLE IF EXISTS method_decl;
DROP TABLE IF EXISTS field_uses;
DROP TABLE IF EXISTS field_decl;
DROP TABLE IF EXISTS class_uses;
DROP TABLE IF EXISTS class_decl;
DROP TABLE IF EXISTS function_uses;
DROP TABLE IF EXISTS function_definition;... |
-- https://www.hackerrank.com/challenges/revising-the-select-query-2
SELECT Name
FROM City
WHERE Population > 120000
AND CountryCode = 'USA';
|
select * from empty_table; |
CREATE TABLE user_group
(
group_id UNIQUEIDENTIFIER NOT NULL
CONSTRAINT user_group_group_id_fk REFERENCES groups (group_id),
user_id UNIQUEIDENTIFIER NOT NULL
CONSTRAINT user_group_user_id_fk REFERENCES users (user_id),
create_datetime DATETIME2 NOT NULL DEFAULT CURRENT... |
<filename>schema/000002_init.up.sql
INSERT INTO rubric (id, name, parent_rubric_id) VALUES
(DEFAULT, 'Транспорт', NULL);
INSERT INTO rubric (id, name, parent_rubric_id) VALUES
(DEFAULT, 'Автомобили', (SELECT id FROM rubric WHERE name = 'Транспорт')),
(DEFAULT, 'Мотоциклы и мототехника', (SELECT id FROM rubric WHERE na... |
-- Your SQL goes here
ALTER TABLE record_notes
DROP CONSTRAINT record_notes_record_fkey,
ADD CONSTRAINT record_notes_record_fkey
FOREIGN KEY (record)
REFERENCES records(id)
ON DELETE CASCADE; |
USE Bank
--- 01.Create Table Logs ---
--CREATE TABLE Logs
--(
-- LogId INT PRIMARY KEY IDENTITY NOT NULL,
-- AccountId INT FOREIGN KEY REFERENCES Accounts(Id),
-- OldSum Money,
-- NewSum Money
--)
GO
CREATE TRIGGER tr_AccountChange
ON Accounts FOR UPDATE
AS
BEGIN
INSERT INTO Logs (AccountId, OldSum, NewSum)
SELE... |
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/insert/ce6e965d.sql
-- file:numeric.sql ln:345 expect:true
INSERT INTO num_exp_sub VALUES (8,0,'74881')
|
<gh_stars>0
INSERT INTO tb_usuario (login, senha, data_criacao)
VALUES ('<EMAIL>', <PASSWORD>', '2021-07-07');
INSERT INTO tb_categoria (nome)
VALUES ('Celulares');
INSERT INTO tb_categoria (nome, categoria_mae_id)
VALUES ('Smartphones', 1);
INSERT INTO tb_produto (nome, valor, quantidade_disponivel, descricao, data_... |
drop table if exists merge_dist_01223;
drop table if exists dist_01223;
drop table if exists dist_layer_01223;
drop table if exists data_01223;
create table data_01223 (key Int) Engine=Memory();
create table dist_layer_01223 as data_01223 Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01223);
crea... |
<filename>blog.sql
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50714
Source Host : localhost:3306
Source Database : blog
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2017-11-16 21:38:41
*/
SET FOREIGN_KEY... |
<gh_stars>1-10
INSERT INTO `system_patches` (`issue`, `created`) VALUES('POCOR-2879', NOW());
ALTER TABLE `institution_subjects`
DROP COLUMN `education_grade_id`;
|
<reponame>MCZbase/DDL
CREATE TABLE "CF_TEMP_PARTS_WITH_ATT"
( "CAT_NUM" VARCHAR2(10),
"PART_NAME_1" VARCHAR2(50),
"PRESERV_METHOD_1" VARCHAR2(50),
"PART_CONDITION_1" VARCHAR2(50),
"PART_LOT_COUNT_1" NUMBER(10,0),
"PART_DISPOSITION_1" VARCHAR2(50),
"PART_1_ATT_NAME_1" VARCHAR2(50),
"PART_1_ATT_VAL_1... |
<filename>quests/bq-optimize/02_partition_and_clustering/solution/sql/sample_benchmark.sql
-- start query 1 in stream 0 using template query96.tpl
select count(*)
from tpcds_2t_flat_part_clust.store_sales
,tpcds_2t_flat_part_clust.household_demographics
,tpcds_2t_flat_part_clust.time_dim, tpcds_2t_flat... |
<gh_stars>10-100
SET search_path = pg_catalog;
ALTER TABLE ONLY public.tbl
ALTER COLUMN c1 DROP DEFAULT;
ALTER TABLE public.tbl
ALTER COLUMN c1 TYPE text USING c1::text; /* TYPE change - table: public.tbl original: integer new: text */
ALTER TABLE ONLY public.tbl
ALTER COLUMN c1 SET DEFAULT USER;
|
CREATE TABLE `ProjectInfo` (
`pid` int(11) NOT NULL AUTO_INCREMENT,
`projectYear` int(11) NOT NULL,
`projectType` varchar(100) NOT NULL,
`projectName` varchar(100) NOT NULL,
`requester` varchar(100) NOT NULL,
`dbName` varchar(100) NOT NULL,
`hostIP` varchar(100) NOT NULL,
`portNumber` int(11) NOT NULL D... |
alter table "public"."ContentItemProgramPerson" rename column "groupId" to "itemId";
|
DROP TABLE IF EXISTS `audit_chat`;
CREATE TABLE `audit_chat` (
`lineID` INT(10) NOT NULL AUTO_INCREMENT,
`speaker` TINYTEXT NOT NULL,
`type` TINYTEXT NOT NULL,
`lsName` TINYTEXT NULL,
`recipient` TINYTEXT NULL,
`message` BLOB,
`datetime` DATETIME NOT NULL,
PRIMARY KEY (`lineID`)
)
ENGINE=MyISAM DEFAULT CHARSET... |
<filename>university/src/main/resources/db/sql/userDAOImpl/createUser.sql<gh_stars>0
insert into users (name)
values (?);
|
CREATE TABLE `Employee` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`role` varchar(20) DEFAULT NULL,
`insert_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
-- Create Transaction Table
CREATE TABLE `Transaction` (
... |
<filename>base proyecto tienda.sql<gh_stars>0
CREATE DATABASE IF NOT EXISTS `proyecto_lunes_noche` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `proyecto_lunes_noche`;
-- MySQL dump 10.13 Distrib 5.6.13, for osx10.6 (i386)
--
-- Host: 172.16.31.10 Database: proyecto_lunes_noche
-- ----------------------------------... |
INSERT INTO ListItem (ParentId, Name, Description, StatusId, LastUpdateTimestamp, LastUpdateAccountId, SortOrder)
values
((SELECT ListItemId FROM ListItem WHERE ParentId IS NULL AND NAME = 'Frequency'),
'Stat', 'Stat',
(SELECT lisa.ListItemId FROM ListItem lisa INNER JOIN ListItem lis ON (lisa.ParentId = lis.ListItem... |
-- MySQL dump 10.13 Distrib 8.0.17, for linux-glibc2.12 (x86_64)
--
-- Host: 127.0.0.1 Database: csv_integra_demo
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_... |
<reponame>jdkoren/sqlite-parser<gh_stars>100-1000
-- wal.test
--
-- execsql {
-- ATTACH 'test2.db' AS aux;
-- PRAGMA main.auto_vacuum = 0;
-- PRAGMA aux.auto_vacuum = 0;
-- PRAGMA main.journal_mode = WAL;
-- PRAGMA aux.journal_mode = WAL;
-- PRAGMA synchronous = NORMAL;
-- }
ATTACH ... |
DROP DATABASE IF EXISTS top_songsDB;
CREATE DATABASE top_songsDB;
USE top_songsDB;
CREATE TABLE top5000 (
position INT NOT NULL,
artist VARCHAR (100) NULL,
song VARCHAR (100) NULL,
year INT NULL,
raw_total DECIMAL (10, 4) NULL,
raw_usa DECIMAL (10, 4) NULL,
raw_uk DECIMAL (10, 4) NULL,
raw_eur... |
select
ch.id as id,
ch.code as code,
ch.name as name,
ch.cgr_sql as cgreport_sql,
ch.content as content,
ch.db_source
from jform_cgreport_head ch
where ch.code = '${id}' |
<filename>openGaussBase/testcase/SQL/DDL/interval/Opengauss_Function_DDL_Partition_Interval_Case0015.sql<gh_stars>0
-- @testpoint: interval分区,分区数据类型与分区键不一致,合理报错
-- partition key value must be const or const-evaluable expression
drop table if exists partition_table_001;
create table partition_table_001(
col_1 smallint... |
-- @testpoint:opengauss关键字superuser(非保留),作为外部数据源名
--关键字不带引号-成功
drop data source if exists superuser;
create data source superuser;
drop data source superuser;
--关键字带双引号-成功
drop data source if exists "superuser";
create data source "superuser";
drop data source "superuser";
--关键字带单引号-合理报错
drop data source if exists ... |
<filename>openGaussBase/testcase/KEYWORDS/natural/Opengauss_Function_Keyword_Natural_Case0027.sql
-- @testpoint:opengauss关键字natural(保留),作为序列名
--关键字不带引号-合理报错
drop sequence if exists natural;
create sequence natural start 100 cache 50;
--关键字带双引号-成功
drop sequence if exists "natural";
create sequence "natural" start 10... |
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: ebrochure
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.13-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... |
<reponame>drapperr/Databases-Basics---MS-SQL-Server
DELETE FROM AccountsTrips
WHERE AccountId IN (SELECT Id FROM Accounts
WHERE Id = 47)
DELETE FROM Accounts
WHERE Id = 47 |
<reponame>nbuuck/com_ocseatmap
-- A Section
INSERT INTO `acc_ocseatmap_seat` (`PositionX`, `PositionY`, `SeatMapID`, `SeatTypeName`) VALUES
(20, 13, 1, 'Player'),
(21, 13, 1, 'Player'),
(24, 13, 1, 'Player'),
(25, 13, 1, 'Player'),
(26, 13, 1, 'Player'),
(27, 13, 1, 'Player'),
(28, 13, 1, 'Player'),
(22, 13, 1, 'Player... |
INSERT INTO vendedores(nome) VALUES ('<NAME>');
INSERT INTO vendedores(nome) VALUES ('<NAME>');
INSERT INTO vendedores(nome) VALUES ('<NAME>');
INSERT INTO vendedores(nome) VALUES ('<NAME>');
INSERT INTO vendedores(nome) VALUES ('<NAME>');
INSERT INTO vendedores(nome) VALUES ('<NAME>');
INSERT INTO vendedores(nom... |
<gh_stars>0
select column_name, data_type
from columns
where lower(table_schema) = lower('{{ schema_name }}')
and lower(table_name) = lower('{{ table_name }}')
order by ordinal_position |
<reponame>kulauk/Oracle<filename>Error_Manager/qem/QEM_in_APEX.sql
set define off
set verify off
set serveroutput on size 1000000
set feedback off
WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
begin wwv_flow.g_import_in_progress := true; end;
/
--application/set_environment
prompt APPLICATION 49898777 - Q... |
INSERT INTO burgers (burger_name, devoured) VALUES ("Hamburger", false);
INSERT INTO burgers (burger_name, devoured) VALUES ("Cheeseburger", false);
INSERT INTO burgers (burger_name, devoured) VALUES ("Baconburger", false); |
<reponame>janitraalmalik/A0001<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 25, 2016 at 03:13 PM
-- Server version: 5.7.16-0ubuntu0.16.04.1
-- PHP Version: 7.0.8-0ubuntu0.16.04.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET... |
<filename>analytical-functions/example05.sql<gh_stars>1-10
--------------------------------------------------------------------------------
--Example #05: Create percent of weight off total weight within gender
--------------------------------------------------------------------------------
---------------------------... |
CREATE TABLE [dbo].[Account]
(
[Id] INT NOT NULL IDENTITY(1,1),
[Name] VARCHAR(64) NOT NULL,
[AddressLine] VARCHAR(64) NULL,
[CountryId] INT NOT NULL,
[Zip] VARCHAR(16) NULL,
[Phone] VARCHAR(64) NULL,
[Site] VARCHAR(128) NULL,
[CampaignId] INT NULL,
[Notes] VARCHAR(255) NULL,
CONSTRAINT [PK_Account] PRIMARY... |
-- -------------------------------------------------------------
-- TablePlus 3.6.2(323)
--
-- https://tableplus.com/
--
-- Database: dc-wallet
-- Generation Time: 2020-06-24 11:02:32.6600
-- -------------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
CREATE DATABASE /*!32312 IF NOT EXISTS*/`classicmodels` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `classicmodels`;
/*Table structure for table `customers` */
DROP TABLE IF EXISTS `customers`;
CREATE TABLE `customers` (
`customerNumber` int(11) NOT NULL,
`customerName` varchar(50) NOT NULL,
) ENGINE=InnoDB D... |
DROP TABLE IF EXISTS `%table_prefix%follows`;
CREATE TABLE `%table_prefix%follows` (
`follow_id` bigint(32) NOT NULL AUTO_INCREMENT,
`follow_date` datetime NOT NULL,
`follow_date_gmt` datetime NOT NULL,
`follow_user_id` bigint(32) NOT NULL,
`follow_followed_user_id` bigint(32) NOT NULL,
`follow_ip` v... |
<reponame>barrettotte/RPGLE-Twilio<filename>test/sql/twilio.sql
-- Test calling Twilio SMS API
-- URL encode test
values cast(SysTools.UrlEncode('To={{to}}&From={{from}}&Body=Hello World', 'UTF-8') as clob);
-- HTTP POST to Twilio SMS API and get basic response
select *
from table(
SysTools.HttpPos... |
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50527
Source Host : localhost
Source Database : mifan
Target Server Type : MySQL
Target Server Version : 50527
File Encoding : utf-8
Date: 01/02/2013 18:26:36 ... |
--power--
INSERT INTO osmaxx.utility_p
SELECT osm_id as osm_id,
osm_timestamp as lastchange ,
'N' AS geomtype, -- Node
way AS geom,
-- Combining Tags for different kinds of Power POIs --
case
when "power"='plant' then 'plant'
when "power"='tower' then 'tower'
when "power"='pole' the... |
-- file:create_index.sql ln:641 expect:true
SELECT * FROM array_index_op_test WHERE i @> '{32}' ORDER BY seqno
|
SET NAMES 'utf8';
/* PHP:image_shop1510(); */;
ALTER TABLE `PREFIX_image_shop` DROP PRIMARY KEY;
ALTER TABLE `PREFIX_image_shop` ADD INDEX (`id_image`, `id_shop`, `cover`);
UPDATE `PREFIX_image_shop` image_shop SET image_shop.`cover`=1 WHERE `id_image` IN (SELECT `id_image` FROM `PREFIX_image` i WHERE i.`cover`=1);
I... |
<gh_stars>100-1000
--
-- Upgrade from NIPAP database schema version 6 to 7
--
CREATE OR REPLACE FUNCTION tf_ip_net_plan__prefix_iu_before() RETURNS trigger AS $_$
DECLARE
new_parent RECORD;
child RECORD;
i_max_pref_len integer;
p RECORD;
num_used numeric(40);
BEGIN
-- this is a shortcut to avoid running the rest... |
<reponame>RaymondWaterlooLi/LeetCode-Solutions
# SQL query to display the records with three or more rows with consecutive id's, and the number of people is greater than or equal to 100 for each.
# Returned table is ordered by visit_date in ascending Order
select id, visit_date,people from (select
*
,lead(id,1) over(o... |
------------------------------------------------------------------
-- Test privilege on errorlog table. A user need to be granted the
-- DML privilege to the table and to the error log table to be able
-- to use this feature. Insert to the registration table is done
-- internally by superuser, to allow a user to create... |
-- 2017-12-20T15:22:55.105
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (MsgType,AD_Client_ID,IsActive,CreatedBy,Value,AD_Message_ID,MsgText,AD_Org_ID,EntityType,UpdatedBy,Created,Updated) VALUES ('I',0,'Y',100,'Event_ShipmentError',544614,'Cannot generate shipment for ''{0}'... |
DROP DATABASE IF EXISTS daVjncjDissonance_data;
CREATE DATABASE daVjncjDissonance_data; |
<filename>database/archive/30.snomed_concepts.sql
-- Filter the entries we're interested in
DROP TABLE IF EXISTS snomed_description_filtered;
CREATE TABLE snomed_description_filtered
SELECT d.conceptId, d.term
FROM snomed_description d
JOIN snomed_concept c ON c.id = d.conceptId AND c.active = 1
WHERE d.moduleId = 9000... |
### RUN THIS TO ALTER THE MeSHLIUM DtaBASE TO USABLE FORMAT FOR GATEWAY2
ALTER TABLE `SensorMeasurements`
MODIFY `MeasTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
CREATE TABLE `SensorTextObservations` (
`idSensorTextObservation` int(11) NOT NULL auto_increment PRIMARY KEY,
`MeasTime` timestamp NOT NULL defa... |
<gh_stars>0
drop table if exists member;
CREATE TABLE member(member_id INT(6), name VARCHAR(50), email VARCHAR(50)); |
DROP TABLE IF EXISTS pets;
CREATE TABLE pets
(
id int NOT NULL,
name varchar(250),
owner varchar(250),
veterinarian varchar(250),
clinic varchar(50)
);
INSERT INTO pets (id, name, owner, veterinarian, clinic) VALUES(1, 'fluffy', 'alice', 'alice', 'SOMA');
INSERT INTO pets (id, name, owner, veterina... |
<filename>sql.sql<gh_stars>0
/*
SQLyog Ultimate v10.00 Beta1
MySQL - 5.5.53-0ubuntu0.14.04.1 : Database - casino10
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS... |
<gh_stars>1-10
CREATE INDEX speech_bio_ix ON cr_speech (speaker_bioguide);
CREATE INDEX pageid_bills_ix ON cr_bills (pageid);
CREATE INDEX speech_txt_ix ON cr_speech USING gin(to_tsvector('english',text));
|
<filename>database.sql<gh_stars>0
-- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)
--
-- Host: 127.0.0.1 Database: escuela
-- ------------------------------------------------------
-- Server version 8.0.11
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_... |
<filename>Daves.DeepDateUpdater.IntegrationTests.Database/Data/Residents.data.sql<gh_stars>0
SET IDENTITY_INSERT [dbo].[Residents] ON
INSERT INTO [dbo].[Residents] ([ID], [Name], [ProvinceID], [NationalityNationID], [SpouseResidentID], [FavoriteProvinceID]) VALUES (1, N'Liam', 1, 1, NULL, 3)
INSERT INTO [dbo].[Residen... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 08 Sep 2021 pada 04.42
-- Versi server: 10.4.18-MariaDB
-- Versi PHP: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
<reponame>aghilsah/FP_UTS_Framework
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 05, 2021 at 09:12 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/... |
-----------------------------------------Script Header-------------------------------------
--Script Name : sqlblock5.sql
--Description : For testing Oracle SQL in Test runner with one bind Variable and Multiple value in passing criteria
--Author : <NAME>
--Bind Variabl... |
INSERT INTO media
(
title,
uri,
rating,
viewed_at,
created_at
)
VALUES
('Fifty Shades Darker', 'http://www.imdb.com/title/tt4465564/', 1000, '2017-05-10', now()),
('Criminal Activities', 'http://www.imdb.com/title/tt3687310/', 1000, '2017-05-10', now())
|
SELECT pfirstname AS "First Name", plastname AS "Last Name", pcity FROM people; |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 02, 2020 at 06:03 AM
-- Server version: 8.0.18
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... |
USE `420.5A5.a16_lanman`;
# Logins
#
# mrCookieMonster : 1234
# admin : admin
# malloc : 1234
# maxeber : 1234
# antoine : 1234
# francis : 1234
INSERT INTO Comptes
(nomUtilisateur, motDePasse, courriel, nom, prenom, estAdmin, dateCreation)
VALUES
('mrCookieMonster', '1000:+q7wsdeXfAzL74vgJz8ot7J43HZfqz... |
ALTER TABLE USERS ALTER COLUMN username SET NOT NULL;
alter table users add lastLoggedIn timestamp;
REORG TABLE USERS;
create unique index IDX_USER_USERNAME on users (username);
|
insert into users (first_name, last_name) values
('John', 'Doe'),
('Jane', 'Doe'),
('Joe', 'Doe');
insert into loans (user_id, name, interest_rate, outstanding_balance, contribution) values
(1, 'car loan', 1.005, 20000.00, 3000.00),
(1, 'house loan', 2.020, 15000.00, 2000.00); |
CREATE TABLE [dbo].[ReportCatalog]
(
[ReportCatalogPK] [int] NOT NULL IDENTITY(1, 1),
[CriteriaOptions] [varchar] (400) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CriteriaDefaults] [varchar] (400) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Creator] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT... |
CREATE OR REPLACE VIEW `vw_brand_index_sl` AS
SELECT ucsl.`id` AS `id`,
ucsl.`user_id` AS `user_id`,
u.`full_name` AS `full_name`,
ucsl.`term` AS `term`,
i.`title` AS `title`,
it.`title` AS `industry_title`,
ucsl.`created_at` AS `created_at`
... |
-- substr.test
--
-- execsql {
-- SELECT substr(t, i1, i2) FROM t1
-- }
SELECT substr(t, i1, i2) FROM t1
|
CREATE TABLE ts_users (
id INTEGER PRIMARY KEY,
name TEXT,
surname TEXT
);
INSERT INTO ts_users VALUES (1,'Walter','White');
INSERT INTO ts_users VALUES (2,'Sheldon','Cooper'); |
<filename>src/test/resources/sql/_unknown/56905aa6.sql
-- file:plpgsql.sql ln:1030 expect:false
retval := ''Phone line '' || trim(rec.phonenumber)
|
use payroll
execute p_add_time_entry @employee_id=48, @entry_date='2018-08-08 00:00:00', @hours_worked=3
execute p_add_time_entry @employee_id=61, @entry_date='2018-08-08 00:00:00', @hours_worked=3
execute p_add_time_entry @employee_id=12, @entry_date='2018-08-08 00:00:00', @hours_worked=8
execute p_add_time_entry @e... |
CREATE EXTERNAL TABLE [fhir].[Substance] (
[resourceType] NVARCHAR(4000),
[id] VARCHAR(64),
[meta.id] NVARCHAR(100),
[meta.extension] NVARCHAR(MAX),
[meta.versionId] VARCHAR(64),
[meta.lastUpdated] VARCHAR(64),
[meta.source] VARCHAR(256),
[meta.profile] VARCHAR(MAX),
[meta.security] ... |
<filename>preTest.sql
USE testdb;
INSERT INTO metadata_format(metadata_prefix,
metadata_schema,
metadata_namespace)
VALUES("oai_dc",
"http://www.openarchives.org/OAI/2.0/oai_dc.xsd",
"http://www.openarchives.org/OAI/2.0/... |
/*
################################################################################
Migration script to add unique key to publication pubmed ID column
author: <NAME>
date: 02 March 2020
version: 2.4.0.009
################################################################################
*/
alter table "GWAS"."PUBLICA... |
/*!cobar: select,4,ireport.dm_mdm_mem_prod_effect_sdt0.admin_member_seq=201152175*/
select product_id,
sum_prod_show_num,
sum_prod_click_num,
sum_prod_fb_num,
total_cnt
from (select product_id, ... |
<gh_stars>10-100
CREATE PROCEDURE SP209(OUT MYCOUNT INTEGER) SPECIFIC SP209_95470 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE66;SELECT COUNT(*)INTO MYCOUNT FROM TABLE207;SELECT COUNT(*)INTO MYCOUNT FROM TABLE375;SELECT COUNT(*)I... |
<reponame>gtoonstra/sqlineage<gh_stars>10-100
INSERT INTO subselects( a )
SELECT
foo.a
FROM (
SELECT DISTINCT
b.a
FROM foo.bar.tablename b
) foo;
|
DROP TABLE IF EXISTS cond.users;
CREATE TABLE cond.users (
id serial PRIMARY KEY,
username text NOT NULL UNIQUE,
email text NOT NULL UNIQUE,
bio text,
image_url text,
password_hash text NOT NULL,
salt text NOT NULL
);
ALTER TABLE cond.users OWNER TO conduit_all;
INSERT INTO cond.users (id... |
<filename>trade-orders-service/src/main/resources/import.sql<gh_stars>1-10
INSERT INTO stocksymbol values ('s:0','IBM');
INSERT INTO stocksymbol values ('s:1','GOOG');
INSERT INTO stocksymbol values ('s:2','AAPL');
INSERT INTO stocksymbol values ('s:3','AMZN');
INSERT INTO stocksymbol values ('s:4','MSFT'); |
CREATE TABLE DICTIONARY (
id BIGSERIAL,
type VARCHAR(100) NOT NULL,
param VARCHAR(100) NOT NULL,
title VARCHAR(100) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO DICTIONARY (type, pa... |
BEGIN;
DELETE FROM seguridad_rol_credenciales WHERE credencial_id IN
(
SELECT id FROM seguridad_credencial WHERE nombre LIKE 'reporte_%'
);
DELETE FROM seguridad_credencial WHERE nombre LIKE 'reporte_%';
INSERT INTO deltas_sql (numero, app, comentario) VALUES ('040', 'Seguridad', 'Ticket #163 y #164');
COMMIT... |
--[er]test incr function with types char, varchar, nchar
create class tb(
col0 int auto_increment primary key,
col1 char(8),
col2 varchar,
col3 nchar(8)
);
insert into tb (col1, col2, col3) values('char1', 'varchar1', n'nchar1');
insert into tb (col1, col2, col3) values('char2', 'varchar2', n'nchar2');
selec... |
-- @testpoint: opengauss关键字nvarchar(非保留),作为角色名 部分测试点合理报错
--step1:关键字不带引号;expect:成功
drop role if exists nvarchar;
create role nvarchar with password '<PASSWORD>' valid until '2020-12-31';
drop role nvarchar;
--step2:关键字带双引号;expect:成功
drop role if exists "nvarchar";
create role "nvarchar" with password '<PASSWORD>' va... |
<filename>LogShipping/ServiceBroker-LogWalk.sql
/* Step 01: Configure ServiceBroker (Enable, Create Message Type, Create Contract, Create Queue, Create Service)
Step 02: Create Procedure for Sending Message
Step 03: Create Function fn_IsJobRunning
Step 04: Create Procedure for Processing Message
Step 05: Create Job... |
<gh_stars>0
DROP TABLE `articles` IF EXISTS;
CREATE TABLE `articles` (
`id` INT(11) PRIMARY KEY AUTO_INCREMENT,
`title` VARCHAR(70) NOT NULL,
`body` TEXT(2000) NOT NULL,
`updated_at` TIMESTAMP,
`created_at` TIMESTAMP
);
CREATE TABLE `comments` (
`id` INT(11) PRIMARY KEY AUTO_INCREMENT,
`b... |
<reponame>ucdavis/Agribusiness
ALTER TABLE [dbo].[ApplicationXCommodity]
ADD CONSTRAINT [PK_ApplicationXCommodity] PRIMARY KEY CLUSTERED ([ApplicationId] ASC, [CommodityId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF);
|
<reponame>rahmat141/eprint<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 02, 2021 at 10:42 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
... |
/* DROP STAGING TABLE (ST) */
DROP TABLE IF EXISTS ST_IMDB_BASE_TITLE_PRINCIPALS;
/* CREATE ST TABLE */
CREATE TABLE ST_IMDB_BASE_TITLE_PRINCIPALS (
TCONST_NK TEXT -- alphanumeric unique identifier of the title
,ORDERING INT -- a number to uniquely identify rows for a given titleId
,NCONST TEXT --alphanumeric uniqu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.