sql stringlengths 6 1.05M |
|---|
<gh_stars>0
/*
Deployment script for AmountDB
This code was generated by a tool.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
*/
GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
... |
SELECT imeStud,prezStud
FROM stud
JOIN mjesto m1 on stud.pbrRod = m1.pbr
JOIN mjesto m2 on stud.pbrStan = m2.pbr
WHERE stud.pbrRod <> stud.pbrStan
AND m1.sifZupanija = m2.sifZupanija; |
<filename>framework/resources/Functional/subqueries/not_in/s3_c_time.sql<gh_stars>0
select count(*) from j2 where c_time not in ( select c_time from j3) ;
|
<filename>sql/updates/005-interaction.sql
BEGIN;
SELECT _v.register_patch('005-interaction', NULL, NULL);
ALTER TABLE account ADD COLUMN metadata JSONB NULL;
CREATE TABLE interaction_type
(interation_type_id VARCHAR NOT NULL PRIMARY KEY,
interaction_type VARCHAR NOT NULL);
INSERT INTO interaction_type VALUES ('EMA... |
create or replace package BOOKINGS
as
function ADD( i_memberid BOOKING.MEMBERID%type,
i_itemno BOOKINGDETAIL.ITEMNO%type,
i_auduser BOOKING.AUDUSER%type)
return number;
function REMOVE( i_documentno BOOKING.DOCUMENTNO%type,
i_itemno BOOKINGDETAIL.ITEMNO%type,
i_auduser BOOKING.AUDUSER%type)
return number;
... |
# --- !Ups
CREATE TABLE entities (
id BIGINT,
type INT NOT NULL,
name VARCHAR(255) NOT NULL,
date DATE NOT NULL,
useEntity Boolean NOT NULL DEFAULT 1,
dayFrequency INT NOT NULL DEFAULT 0,
CONSTRAINT entities_pkey PRIMARY KEY(id, date)
) ENGINE = MyISAM;
CREATE TABLE relationships (
id BIGINT,
entity... |
<reponame>naman98gupta/recipeStore
create table REVINFO (REV number(10,0) not null, REVTSTMP number(19,0), primary key (REV));
create table USER_ENTITY (ID number(19,0) not null, LOGIN_ID number(19,0) not null, LOGIN_TIME timestamp not null, MODIFICATION_ID number(19,0) not null, MODIFICATION_TIME timestamp not null, ... |
-- Deploy ggircs-portal:computed_columns/application_revision_ordered_form_results to pg
begin;
create or replace function ggircs_portal.application_revision_ordered_form_results(application_revision ggircs_portal.application_revision)
returns setof ggircs_portal.form_result
as
$$
select form_result.* from ggircs_p... |
-- -Clean up database droppings if the tests fail. This drops all of the tables
drop table apn cascade;
drop table collection cascade;
drop table device cascade;
drop table device_lookup cascade;
drop table downstream cascade;
drop table firmware cascade;
drop table firmware_image ca... |
CREATE TABLE `booking`
(
`id` int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
`cid` int(11) NOT NULL,
`status` ENUM ('PENDING', 'CONFIRMED', 'CANCELLED') DEFAULT 'PENDING',
`notes` varchar(500) DEFAULT NULL
);
CREATE TABLE `customer`
(
`cid` ... |
-- indexed operations.....
SET enable_indexscan=off;
select count(sp) from spoint_data where sp @ '<(0d,90d),1.0d>'::scircle;
select count(sp) from spoint_data where '<(0d,90d),1.0d>'::scircle ~ sp;
select count(sp) from spoint_data where sp @ '<(0d,90d),1.1d>'::scircle;
select count(sp) from spoint_data where '<(... |
CREATE TABLE addons_premium (
id int(11) unsigned AUTO_INCREMENT NOT NULL PRIMARY KEY,
created datetime NOT NULL,
modified datetime NOT NULL,
addon_id int(11) unsigned NOT NULL UNIQUE,
price_id int(11) NOT NULL,
paypal_permissions_token varchar(255) NOT NULL
) ENGINE=InnoDB CHARACTER SET utf8 CO... |
-- [er]create a class,add a method and method'f file for this class,change the method'file to a no existing file,the report file not found error
CREATE CLASS ddl_0001;
ALTER CLASS ddl_0001 add method method1(int) int function method1 file '$HOME/method' ;
ALTER CLASS ddl_0001 add method method2(varchar(100)) varchar(1... |
<filename>VirtualRadar.Database/BaseStation/Scripts/UpdateSchema.sql
--
-- Aircraft
--
CREATE TABLE IF NOT EXISTS [Aircraft]
(
[AircraftID] INTEGER PRIMARY KEY
,[FirstCreated] DATETIME NOT NULL
,[LastModified] DATETIME NOT NULL
,[ModeS] VARCHAR(6) NOT NULL UNIQUE
,... |
CREATE DATABASE car_rental;
USE car_rental;
CREATE TABLE categories (
id INT NOT NULL AUTO_INCREMENT,
category VARCHAR(30) NOT NULL,
daily_rate FLOAT,
weekly_rate FLOAT,
monthly_rate FLOAT,
weekend_rate FLOAT,
CONSTRAINT pk_categories PRIMARY KEY (id)
);
CREATE TABLE cars (
id INT NOT... |
<filename>res/db/update_event.sql
-- PREPARE update_event (state, uuid, text, text) AS
UPDATE events
SET state = $1
WHERE id = $2
AND key = $3
AND namespace = $4
AND state <> 'COMPLETED'
RETURNING *; |
INSERT INTO authority VALUES
('admin'),
('user'),
('guest');
|
ALTER TABLE `cuentacolaborador` ADD `comprobantePago` BLOB NULL DEFAULT NULL AFTER `tipoCuenta`; |
--SELECT * FROM Suites_Tests
SELECT Tests.TestID, Tests.TestName, Suites.SuiteID, Suites.SuiteName
FROM Suites_Tests
JOIN Tests
ON Suites_Tests.TestId = Tests.TestID
JOIN Suites
ON Suites_Tests.SuiteId = Suites.SuiteID
WHERE Tests.TestID = 107 -- get suites a test belongs to
--WHERE Suites.SuiteID = 26 -- get tests... |
<filename>db/seeds.sql
INSERT INTO departments (name)
VALUES ("Sales"),
("Finance"),
("Engineering"),
("Legal");
INSERT INTO employee_role (title, salary, departments_id)
VALUES ("Salesperson", 80000, 1),
("Sales Lead", 100000, 1),
("Lead Engineering", 150000, 3),
("Software Engineering", 120000, 3),
("A... |
CREATE DATABASE IF NOT EXISTS `expense` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `expense`;
-- MySQL dump 10.13 Distrib 5.6.13, for Win32 (x86)
--
-- Host: localhost Database: expense
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.10-MariaDB
/*!40101 SET @OLD_CHARACTER... |
SELECT DISTINCT CITY FROM STATION WHERE (ID%2) = 0; |
drop table if exists MB_PROD_TYPE;
/*==============================================================*/
/* Table: MB_PROD_TYPE */
/*==============================================================*/
create table MB_PROD_TYPE
(
PROD_TYPE varchar(50) not null comment '产品类型',
... |
<reponame>barbmarques/database-exercises<gh_stars>1-10
#1. Create a new file named group_by_exercises.sql
#2. In your script, use DISTINCT to find the unique titles in the titles table. How many unique titles have there ever been?
use employees;
select database();
SELECT DISTINCT title
FROM titles; #2. There ar... |
CREATE PROC [dbo].[h3giCheckRetailerOrdersForActivation]
@prepay INT = 0
AS
BEGIN
DECLARE @status INT
SET @status = 312
INSERT INTO
gmOrdersDispatched
SELECT TOP 25
oh.OrderRef,
@prepay
FROM
b4nOrderHeader oh
INNER JOIN h3giorderheader hoh ON
oh.or... |
CREATE TABLE [dbo].[CommunityServerBlogPosts]
(
[ContentItemID] [int] NOT NULL,
[CommunityServerBlogPostId] [int] NOT NULL,
[NumberOfComments] [int] NOT NULL CONSTRAINT [DF__Community__Numbe__00DF2177] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CommunityServerBlogPosts] ADD CONSTRAINT [PK__Communit__B851BC8C7C1... |
<reponame>jovitanrv/htmlcss
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 02, 2019 at 09:36 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = ... |
DROP DATABASE IF EXISTS tutor_app_db;
CREATE DATABASE tutor_app_db;
USE tutor_app_db;
|
-- Revert procedures/verify_domain from pg
BEGIN;
DROP FUNCTION public.verify_domain;
COMMIT;
|
<reponame>DjordjeVucinac82/crunchbutton
ALTER TABLE `driver_log` CHANGE `action` `action` ENUM('created-driver','created-cockpit','updated-cockpit','notified-setup','document-sent','account-setup', 'native-app-login', 'enabled-push', 'enabled-location') DEFAULT NULL;
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.6
-- Dumped by pg_dump version 11.7
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', fal... |
<gh_stars>100-1000
-- select4.test
--
-- execsql {
-- SELECT DISTINCT log FROM t1 ORDER BY +log LIMIT 3 OFFSET 20
-- }
SELECT DISTINCT log FROM t1 ORDER BY +log LIMIT 3 OFFSET 20 |
-- Metrics for basic intersection between LBSN and locations
SELECT
t1.id,
extensions.hll_intersection (hll_union_agg (t1.user_hll), hll_union_agg (t2.user_hll)) AS users,
extensions.hll_intersection (hll_union_agg (t1.post_hll), hll_union_agg (t2.post_hll)) AS posts,
extensions.hll_intersection (h... |
<reponame>faraquet/queue_classic
DO $$DECLARE r record;
BEGIN
BEGIN
ALTER TABLE queue_classic_jobs ADD COLUMN scheduled_at timestamptz DEFAULT now();
CREATE INDEX idx_qc_on_scheduled_at_only_unlocked ON queue_classic_jobs (scheduled_at, id) WHERE locked_at IS NULL;
EXCEPTION
WHEN duplicate_column THEN R... |
/*
-- Query:
-- Date: 2018-11-17 19:13
*/
INSERT INTO `Allergies` (`allergyID`,`camperID`,`ephinephrine_cd`,`allgergen`,`reaction`) VALUES ('A_1','C_1','N','Dust mites','Sometimes congested');
INSERT INTO `Allergies` (`allergyID`,`camperID`,`ephinephrine_cd`,`allgergen`,`reaction`) VALUES ('A_2','C_3','Y','Rasberries ... |
CREATE STREAM wikipedia
(
CREATEDAT bigint,
WIKIPAGE string,
CHANNEL string,
USERNAME string,
COMMITMESSAGE string,
BYTECHANGE integer,
DIFFURL string,
ISNEW boolean,
ISMINOR boolean,
ISBOT boolean,
ISUNPATROLLED boolean
)
WITH (kafka_topic='wikipedia.parsed', value_format='AVRO');
CREATE STREAM... |
<filename>python/sql/Tables/dbo.Community_AltName.sql<gh_stars>1-10
CREATE TABLE [dbo].[Community_AltName]
(
[CM_ID] [int] NOT NULL,
[LangID] [smallint] NOT NULL,
[AltName] [nvarchar] (200) COLLATE Latin1_General_100_CI_AI NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Community_AltName] ADD CONSTRAINT [PK_Community_Alt... |
select * from Database_Status
select * from SSIS_Errors
USE SQL_Overview
GO
CREATE TABLE [dbo].[SSIS_ServerList](
[Server] [varchar](128) NOT NULL,
[Usage] [char](10) NULL,
[Skip_SQL_Overview] [bit] NULL,
CONSTRAINT [PK_SSIS_ServerList] PRIMARY KEY NONCLUSTERED
(
[Server] ASC
)
)
------------------------... |
-- All lanes created up to this point should only display ebooks.
update lanes set media='{"Book"}';
|
<reponame>StratumORM/stratum-sql
print '
Generating template inheritance triggers...'
if object_id('[orm_meta].[inheritance_insert]', 'TR') is not null
drop trigger [orm_meta].[inheritance_insert]
go
create trigger [orm_meta].[inheritance_insert]
on [orm_meta].[inheritance]
instead of insert
as
begin
set nocou... |
CREATE TABLE IF NOT EXISTS {{keyspace}}.metrics (
metric_key blob,
data_timestamp_offset int,
data_value double,
PRIMARY KEY(metric_key, data_timestamp_offset)
) WITH COMPACT STORAGE;
|
<reponame>isabella232/gps_building_blocks
# Copyright 2021 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
-------------------------------------------------------------------------------
-- sku info
-------------------------------------------------------------------------------
CREATE TABLE SKU_INFO(
ID BIGINT NOT NULL,
CODE VARCHAR(100),
NAME VARCHAR(100),
STYLE VARCHAR(50),
MODEL VARCHAR... |
[% IF not table %][% table = '<Table>' %][% END -%]
-- Create the [% table %] table and initial contents
-- DROP TABLE [% table %];
CREATE TABLE [% table %] (
[% table %]_id SERIAL PRIMARY KEY,
[% table %]_created TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
[% table %]_type_id INTEGER REFERENCES [% ta... |
<gh_stars>0
CREATE FUNCTION get_userid(username text) RETURNS int
AS $$
#print_strict_params on
DECLARE
userid int;
BEGIN
SELECT users.userid INTO STRICT userid
FROM users WHERE users.username = get_userid.username;
RETURN userid;
END;
$$ LANGUAGE plpgsql;
|
<gh_stars>1-10
drop if exists t,x;
create table t as (select 1 as id, 1 as d
union all select 1, 2 as d
union all select 1, 3 as d
union all select 1, 4 as d
union all select 1, 5 as d
union all select 1, 6 as d
union all select 1, 7 as d
union all select 2, 1 as d
union all select 2, 2 as d
union all select 2, 3 as d... |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Sam 22 Octobre 2016 à 17:47
-- Version du serveur: 5.5.40-0ubuntu0.14.04.1
-- Version de PHP: 5.5.9-1ubuntu4.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER... |
<reponame>BlueDress/School<filename>Databases Basics MSSQL Server/Joins, Subqueries, CTE and Indices/Continents and Currencies.sql<gh_stars>0
select usage.ContinentCode, CurrenciesCount.CurrencyCode, usage.CurrencyUsage from
(select CurrenciesCount.ContinentCode, max(CurrenciesCount.CurrencyCount) as CurrencyUsage fro... |
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table category (
key bigint not null,
name varchar(255),
constraint pk_category primary key (key))
;
create table contacts (
key ... |
APP_NAME=Laravel
APP_ENV=local
APP_KEY=<KEY>
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=ibmi
#DB_HOST=192.168.3.11
DB_HOST=10.6.20.30
DB_PORT=446
DB_DATABASE=BEAMS
DB_USERNAME=QSECOFR
DB_PASSWORD=<PASSWORD>
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
... |
# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: localhost (MySQL 5.6.23)
# Database: awesome
# Generation Time: 2015-05-08 10:41:04 +0000
# *************************************************... |
Select * from [Order Details]
Select * from Suppliers
Select Count(*) from Suppliers
Select * From sys.columns Where Object_Id = $tableId
Select * From sys.tables where Name = '$tableName' or '$tableName' = '-'
SELECT COUNT(*) FROM [SqlQueryNotificationService-bfd887d4-d4f8-40e4-9eec-44c1d46d3d02] WHERE message_type_na... |
ALTER TABLE IF EXISTS board_sessions ALTER COLUMN show_hidden_columns SET DEFAULT true;
|
CREATE TABLE `sql_detail`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`s_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '主键',
`l_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '请求ID',
`query_id` int(10) unsigned ... |
<filename>code/babelfish-demo/sql/create-price-trade-fn.sql<gh_stars>1-10
DROP FUNCTION IF EXISTS price_trade_fn
GO
CREATE FUNCTION price_trade_fn (@trade_id int)
RETURNS decimal(10,2)
BEGIN
DECLARE @price decimal(10,2)
PRINT 'Start price_trade_fn...'
set @price = RAND()*500
PRINT 'End price_trade_fn...'
RETURN(@p... |
<filename>src/1_json_each_table.sql
.headers on
.mode column
select * from json_each('["A","B","C"]');
|
<filename>DataProcessingCore/tutorials/deployment/persitent.sql
select * from federation1.trn.v2.observation.hash.std:unique(id) output snapshot every 30 seconds |
select count(id)
from member
where id not in (select DISTINCT member_id from checkout_item); |
<reponame>petroud/DatabaseMS<filename>3/find_max_discount_rooms_of_hotels_3_3.sql<gh_stars>0
CREATE FUNCTION find_max_discount_rooms_of_hotels_3_3() returns table("Hotel Name" varchar, "Hotel ID" integer, "Room type" varchar,"Discount %" real)
AS
$$
BEGIN
RETURN QUERY
SELECT "hotel"."name", derTbl."idHotel", derT... |
SELECT
person_id_deid, date,
'03_NIV_treatment' as covid_phenotype,
'HES CC' as source
FROM
HES_CC
WHERE
BRESSUPDAYS > 0 |
create table post (
id int auto_increment primary key,
title varchar(200) not null,
content text
);
|
create or replace stage CREATE_MTI;
-- Get some good rows:
copy into @CREATE_MTI from (
select
L_ORDERKEY::string as L_ORDERKEY
,L_PARTKEY::string as L_PARTKEY
,L_SUPPKEY::string as L_SUPPKEY
,L_LINENUMBER::string as L_LINENUMBER
,L_QUANTITY::string as L_QUANTITY
,L_EXTENDEDPRICE::... |
-- Copyright (c) 2016-2018 Timescale, Inc. All Rights Reserved.
--
-- This file is licensed under the Apache License,
-- see LICENSE-APACHE at the top level directory.
--keep same order of tables as tables.sql
SELECT id, schema_name, table_name, associated_schema_name, associated_table_prefix, num_dimensions
FROM _ti... |
<reponame>arunma/course-dbt
{{ config (
materialized='table',
unique_key="user_id ||'-'||product_id"
)
}}
WITH order_items AS
(
SELECT order_id
,product_id
,quantity
FROM {{ ref('stg_order_items') }}
)
SELECT * FROM order_items
|
<gh_stars>0
DROP PROCEDURE updatePortfolioMarketValues;
DELIMITER //
CREATE PROCEDURE updatePortfolioMarketValues(stockTicker VARCHAR(5), stockSuffix VARCHAR(6), priceChange DECIMAL(10, 5))
BEGIN
DECLARE portfolioId CHAR(36);
DECLARE nbSharesFound INTEGER;
DECLARE sweep_complete integer DEFAULT FALSE;
... |
<gh_stars>0
/* SEED script for data validation descriptors
This file should be copied to: ..\Ed-Fi-ODS-Implementation\Application\EdFi.Ods.Extensions.DataValidation\Artifacts\MsSql\Data\Ods\0001_Descriptors.sql
*/
insert into edfi.descriptor(namespace, CodeValue, ShortDescription, Description) values ('uri://edfixv... |
ALTER TABLE operation_audit_record
ADD query_parameters VARCHAR(255) DEFAULT NULL;
ALTER TABLE auth_failure_audit_record
ADD query_parameters VARCHAR(255) DEFAULT NULL;
|
<reponame>Sitra-Isaacus/VSSHP-Kettle-ETL
DROP VIEW IF EXISTS static.ktp_jobs;
CREATE VIEW static.ktp_jobs AS (
SELECT pid, query
FROM (
SELECT
pid, substring(query from 1 for 65) AS query
FROM pg_stat_activity
WHERE state = 'active') AS T
WHERE query NOT LIKE '%ktp_jobs%');
-- Remember, jobs can be cancel... |
<filename>experiments/rust-prototype-v1/examples/formats/object_id/src/object_id.ddl
/// https://docs.mongodb.com/manual/reference/method/ObjectId/
ObjectId = struct {
epoch_time: i32be,
machine_id: u24be,
process_id: u16be,
counter: u24be,
};
|
autocommit off;
set names utf8;
create table tb (
dummy varchar(1)
) charset euckr;
insert into tb values ('X');
SELECT LTRIM('占쌍곤옙占쏙옙 ') FROM tb;
SELECT LTRIM(' 占쌍곤옙占쏙옙 ') FROM tb;
SELECT LTRIM('占쌍곤옙占쏙옙 ','占쏙옙') FROM tb;
SELECT LTRIM('占쏙옙 占쌍곤옙占쏙옙 ','占쏙옙') FROM tb;
SELECT LTRIM(' 占쏙옙 占쌍곤옙占쏙옙 ','占쏙옙') FROM tb;
SELEC... |
USE [Sandbox]
GO
/*
* Tests for dbo.fn_get_phone_from_string
* Tests pass if they return 1
* If they return a table, it shows that they havn'te returned the proper value, but shows
* the result, and what was expected.
*/
declare @debug as bit = 0 -- set to 1 to see all tests, not just failing ones
declare @r... |
<reponame>opengauss-mirror/Yat
-- @testpoint: opengauss关键字defaults(非保留),作为游标名,部分测试点合理报错
--前置条件
drop table if exists defaults_test cascade;
create table defaults_test(cid int,fid int);
--关键字不带引号-成功
start transaction;
cursor defaults for select * from defaults_test order by 1;
close defaults;
end;
--关键字带双引号-成功
start t... |
/*
Navicat Premium Data Transfer
Source Server : skd
Source Server Type : PostgreSQL
Source Server Version : 110003
Source Host : localhost:5432
Source Catalog : lbs_upload
Source Schema : public
Target Server Type : PostgreSQL
Target Server Version : 110003
File Encod... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50173
Source Host : localhost:3306
Source Database : gamedb
Target Server Type : MYSQL
Target Server Version : 50173
File Encoding : 65001
Date: 2019-07-05 10:34:16
*/
SET FOREIGN_KEY_C... |
<reponame>UTC1992/empresa_project
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 15-09-2017 a las 10:57:51
-- Versión del servidor: 10.1.9-MariaDB
-- Versión de PHP: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 17 Mar 2020 pada 11.52
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
<gh_stars>0
SELECT id, vreme FROM wstation.meteo_uslovi order by id desc limit 5 |
<filename>simple-php-shopping-cart/simple-php-shopping-cart/tblproduct.sql
CREATE TABLE `tblproduct` (
`id` int(8) PRIMARY KEY AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`code` varchar(255) NOT NULL,
`image` text NOT NULL,
`price` double(10,2) NOT NULL,
UNIQUE KEY `product_code` (`code`)
)
INSERT INTO `... |
Insert into EG_ACTION (ID,NAME,URL,QUERYPARAMS,PARENTMODULE,ORDERNUMBER,DISPLAYNAME,ENABLED,CONTEXTROOT,VERSION,CREATEDBY,CREATEDDATE,LASTMODIFIEDBY,LASTMODIFIEDDATE,APPLICATION) values (NEXTVAL('SEQ_EG_ACTION'),'WorksPackageAjaxEstimateList','/tender/ajaxWorksPackage-estimateList.action',null,(select id from EG_MODUL... |
CREATE INDEX IND_GenesBody ON Kitties(GenesBody);
CREATE INDEX IND_GenesPattern ON Kitties(GenesPattern);
CREATE INDEX IND_GenesEyeColor ON Kitties(GenesEyeColor);
CREATE INDEX IND_GenesEyeType ON Kitties(GenesEyeType);
CREATE INDEX IND_GenesBodyColor ON Kitties(GenesBodyColor);
CREATE INDEX IND_GenesPatternColor ON Ki... |
-- corruptD.test
--
-- execsql {
-- DELETE FROM t1 WHERE a = 10;
-- DELETE FROM t1 WHERE a = 20;
-- DELETE FROM t1 WHERE a = 30;
-- DELETE FROM t1 WHERE a = 40;
-- }
DELETE FROM t1 WHERE a = 10;
DELETE FROM t1 WHERE a = 20;
DELETE FROM t1 WHERE a = 30;
DELETE FROM t1 WHERE a = 40; |
-- like.test
--
-- execsql {
-- PRAGMA case_sensitive_like; -- no argument; does not change setting
-- SELECT x FROM t1 WHERE x LIKE 'abc' ORDER BY 1;
-- }
PRAGMA case_sensitive_like; -- no argument; does not change setting
SELECT x FROM t1 WHERE x LIKE 'abc' ORDER BY 1; |
<filename>09-SQL/1/Activities/05-Ins_AddingRows/Solved/AddingRows.sql
INSERT INTO people (name, has_pet, pet_name, pet_age)
VALUES ("Jacob", true, "Misty", 10);
INSERT INTO people (name, has_pet, pet_name, pet_age)
VALUES ("Ahmed", true, "Rockington", 100);
INSERT INTO people (name)
VALUES ("Peter");
UPDATE people
S... |
select sum(lo_revenue) as lo_revenue, d_year, p_brand1
from lineorder
left join dates on lo_orderdate = d_datekey
left join part on lo_partkey = p_partkey
left join supplier on lo_suppkey = s_suppkey
where p_category = 'MFGR#12' and s_region = 'AMERICA'
group by d_year, p_brand1
order by d_ye... |
select tx_item, tx_date,
avg(tx_sales) over
(order by tx_date rows between 3 preceding and 3 following)
as smooth_value
from Total_Sales
where tx_date between '2002-03-01' and '2002-03-31'
and tx_item = 'X22'; |
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.7.24-0ubuntu0.16.04.1 : Database - card
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FORE... |
<gh_stars>0
CREATE TABLE [dbo].[umbracoLanguage] (
[id] INT IDENTITY (2, 1) NOT NULL,
[languageISOCode] NVARCHAR (10) NULL,
[languageCultureName] NVARCHAR (100) NULL,
CONSTRAINT [PK_umbracoLanguage] PRIMARY KEY CLUSTERED ([id] ASC)
);
GO
CREATE UNIQUE NONCLUSTERED IND... |
alter table codebase
add column if not exists start_versioning_from text; |
--Changeset kumargautam:Default Privileges
INSERT INTO privilege JSON '{"id":"5bb71fc82ff9a91aa88ebee1_ADMIN_READ_WRITE","name":"ADMIN_READ_WRITE"}';
INSERT INTO privilege JSON '{"name":"ADMIN_READ","id":"5bb71fc82ff9a91aa88ebee1_ADMIN_READ"}';
INSERT INTO privilege JSON '{"name":"USER_READ_WRITE","id":"5bb71fc82ff9... |
-- Add up migration script here
ALTER TABLE courses
ADD COLUMN description TEXT;
|
-- migration to be applied
create table tokens (
id int auto_increment primary key,
ttype varchar(10),
client_id varchar(32) not null,
user_id varchar(50),
secret varchar(64) not null,
scope varchar(255),
login varchar(32),
expires_at datetime,
created_at datetime not null,
UNIQUE KEY tokens_unique... |
ALTER TABLE verifications ADD COLUMN IF NOT EXISTS test_type TEXT NOT NULL DEFAULT 'confirmed';
ALTER TABLE upload_tokens ADD COLUMN IF NOT EXISTS test_type TEXT NOT NULL DEFAULT 'confirmed';
ALTER TABLE exposures ADD COLUMN IF NOT EXISTS test_type TEXT NOT NULL DEFAULT 'confirmed';
|
UPDATE [ACT_CMMN_DATABASECHANGELOGLOCK] SET [LOCKED] = 1, [LOCKEDBY] = '192.168.1.5 (192.168.1.5)', [LOCKGRANTED] = '2019-03-13T21:41:20.512' WHERE [ID] = 1 AND [LOCKED] = 0
ALTER TABLE [ACT_CMMN_CASEDEF] ADD [DGRM_RESOURCE_NAME_] [varchar](4000)
ALTER TABLE [ACT_CMMN_CASEDEF] ADD [HAS_START_FORM_KEY_] [bit]
ALTER... |
CREATE TABLE Position (
id_position INTEGER PRIMARY KEY AUTOINCREMENT,
position text NOT NULL
);
|
select * from sys.dba_obj_audit_opts
where alt !='-/-' or aud !='-/-' or com !='-/-' or del !='-/-' or
gra !='-/-' or ind !='-/-' or ins !='-/-' or loc !='-/-' or
ren !='-/-' or sel !='-/-' or upd !='-/-' or ref !='-/-' or
exe !='-/-' |
--TEST: [Merge Statement] No error occurs when inserting into the source table in a merge statement.
create table target(a smallint, b char(10));
insert into target values(100, 'aaa');
create table source(a int, b char(10));
insert into source values(200, 'hhh');
--error expected
merge into target t
using source s
o... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint:修改OPTIONS中的字段,修改(SET)字段
--创建数据源对象
drop DATA SOURCE if exists ds_test9;
CREATE DATA SOURCE ds_test9 TYPE 'unknown' VERSION '11.2.3' OPTIONS (dsn 'openGauss',encoding 'utf_8');
--修改OPTIONS中的字段,添加set,修改dsn,其他值不变
ALTER DATA SOURCE ds_test9 OPTIONS (set dsn 'unknown')... |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50722
Source Host : localhost:3306
Source Database : ry
Target Server Type : MYSQL
Target Server Version : 50722
File Encoding : 65001
Date: 2019-11-11 11:40:01
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... |
<gh_stars>0
-- CreateTable
CREATE TABLE "Repo" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"adoId" TEXT,
"name" VARCHAR(255) NOT NULL,
"description" TEXT,
"url" TEXT,
"isDisabled" BOOLEAN NOT NULL,
CONSTRAIN... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.31.10
-- Generation Time: Apr 27, 2020 at 04:26 AM
-- Server version: 10.1.24-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.