sql stringlengths 6 1.05M |
|---|
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
-- Note on testing: need a couple wrappers that pg_sleep in a loop to wait for changes
-- to appear in pg_stat_activity.
-- Further Note:... |
CREATE TABLE gold (
date TIMESTAMP WITH TIME ZONE NOT NULL,
value DECIMAL NOT NULL,
PRIMARY KEY (date)
);
|
<gh_stars>10-100
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [Search.].[History.Phrase](
[SearchHistoryPhraseID] [int] IDENTITY(0,1) NOT NULL,
[SearchHistoryQueryID] [int] NULL,
[PhraseID] [int] NULL,
[ThesaurusMatch] [bit] NULL,
[Phrase] [varchar](max) NULL,
[EndDate] [da... |
<gh_stars>0
-- @testpoint: --对某一列建索引,重复列名:合理报错
--普通表
--行存表 btree索引
drop table if exists test_index_071;
create table test_index_071(id int);
drop index if exists index_01;
create index index_01 on test_index_071(id,id,id) local;
--行存表 btree索引
drop index if exists index_01;
create index index_01 on test_index_071(id,... |
-- @testpoint:opengauss关键字Go(非保留),作为角色名
--关键字不带引号-成功
drop role if exists Go;
create role Go with password '<PASSWORD>' valid until '2020-12-31';
drop role Go;
--关键字带双引号-成功
drop role if exists "Go";
create role "Go" with password '<PASSWORD>' valid until '2020-12-31';
drop role "Go";
--关键字带单引号-合理报错
drop role if exi... |
-- phpMyAdmin SQL Dump
-- version 2.11.9.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 29, 2013 at 04:32 AM
-- Server version: 5.0.67
-- PHP Version: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTE... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Feb 20, 2022 at 01:59 AM
-- Server version: 5.7.34
-- PHP Version: 7.4.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
<filename>database/scripts/drop_all.sql
DROP TABLE IF EXISTS arquivos;
DROP TABLE IF EXISTS associacao_cadastros;
DROP TABLE IF EXISTS associacao_materia;
DROP TABLE IF EXISTS associacao_materia_eleicao;
DROP TABLE IF EXISTS associacao_materia_radiotv_jornal;
DROP TABLE IF EXISTS atores;
DROP TABLE IF EXISTS autorizac... |
<filename>section 7/queries/table-time-tz.sql<gh_stars>0
-- TIMESTAMP & TIMESTAMPTZ data-type
/*
Allows to both date & time together
TIMESTAMP timestamp with out timezone
TIMESTAMPTZ timestamp with timezone
*/
CREATE TABLE table_time_tz (
ts TIMESTAMP,
ts_tz TIMESTAMPTZ
);
SELECT * FROM table_time_tz;
INSER... |
<reponame>skingori/ticketing_system
-- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 18, 2017 at 11:33 AM
-- Server version: 5.6.35
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
<gh_stars>0
/**********************************************************
****** Stored Programs FOR Assn.2, 2019 *******************
********** Student Name and Number ************************
******************* Date **********************************
** I DECLARE that the code provided below is my own work **
***... |
/*
TRUNCATE TABLE edw_data.advisor_cst_cntr_bes;
TRUNCATE TABLE edw_data.advisor_cst_cntr_l;
TRUNCATE TABLE edw_data.advisor_data_s;
TRUNCATE TABLE edw_data.advisor_h;
TRUNCATE TABLE edw_data.cost_centre_h;
*/
INSERT INTO edw_data.advisor_h
(hk_advisor_h
,ldt
,rsrc
,advisor)
SELECT a.hk_advisor_h
,MI... |
<gh_stars>1-10
CREATE TABLE gbif (
taxonID integer PRIMARY KEY,
datasetID varchar(300),
parentNameUsageID varchar(100),
acceptedNameUsageID varchar(100),
originalNameUsageID varchar(100),
scientificName varchar(300),
scientificNameAuthorship varchar(300),
canonicalName varchar(300),
... |
<reponame>shookster/free-food-finder<filename>schema.sql
DROP DATABASE IF EXISTS tc_foodshare_db;
CREATE DATABASE tc_foodshare_db; |
/* Formatted on 12-20-2018 1:38:29 PM (QP5 v5.126.903.23003) */
/*
"C:\Program Files (x86)\pgAdmin 4\v3\runtime\pg_dump" --host localhost --port 5432 --username postgres --verbose --table=WKF.WKF_ACTUAL_MSGS_ROUTNG --data-only --column-inserts psdc_live > WKF.WKF_ACTUAL_MSGS_ROUTNG.sql
*/
set define off;
TRUNCATE TABLE... |
-- Set Main URL
UPDATE sylius_channel SET hostname = '{{FORTRESS_HOST}}' WHERE code = '@TODO';
|
<reponame>SkillsFundingAgency/das-commitments
-- This Applies retrospective StandardUId and TrainingCourseVersion based on Startdate in Apprenticeship table
-- And sets TrainingCourseVersionConfirmed = 1 where there could only be one Standard version associated with that LARS code
-- otherwise will set TrainingCours... |
<gh_stars>0
INSERT INTO burgers (burger_name, devoured) VALUES ('Veggie Burgers', false);
INSERT INTO burgers (burger_name, devoured) VALUES ('Wild Salmon Burgers', false);
INSERT INTO burgers (burger_name, devoured) VALUES ('Angus Burgers', false);
INSERT INTO burgers (burger_name, devoured) VALUES ('Bacon Cheese Burg... |
CREATE OR REPLACE VIEW v_cm_curr_convert_rate (
src_curr_code,
dest_curr_code,
cnvt_rate,
multiple_flag,
src_inst_id,
dest_inst_id,
CNVT_DATE)
AS
WITH last_rates as (
SELECT MAX(CNVT_DATE) as RATE_DATE,SRC_CURR_CODE,DEST_CURR_CODE,SRC_INST_ID,DEST_INST_ID
FROM T_CM_CURR_CONVERT_RATE cr
... |
-- Manuel konvertering af continuous_blood_sugar_event.units
-- Find units som skal divideres med 100 -- (OBS: type er String, derfor lavpraktisk løsning - skal kun anvendes i test)
SELECT id, [units], insulin_type
FROM [dbo].[continuous_blood_sugar_event]
where [units] is not null;
-- Opdater units: OBS: TIlpas ... |
ALTER TABLE "identity_recovery_tokens" ALTER COLUMN "identity_recovery_address_id" SET NOT NULL; |
<reponame>McDusia/predictParcels<gh_stars>1-10
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <NAME>
-- Create date: 17.04.2020
-- Description: Procedure to get distance ( in foots) from object in table specified in parameters
-- ===========================... |
<gh_stars>0
SELECT disable_replication('"123'' junk"."root passwords"');
SELECT enable_replication('"123'' junk"."root passwords"', ARRAY[0]); |
ALTER TABLE account
ADD COLUMN registration_date TIMESTAMP NOT NULL DEFAULT now();
|
--
-- Table structure for table `styles`
--
ALTER TABLE `styles`
ADD COLUMN `sizeguideid` varchar(64) NOT NULL DEFAULT '' AFTER `supplierid`;
--
-- Table structure for table `sizeguides`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sizeg... |
<filename>openGaussBase/testcase/KEYWORDS/postfix/Opengauss_Function_Keyword_Postfix_Case0023.sql
-- @testpoint: opengauss关键字postfix非保留),作为索引名,部分测试点合理报错
--前置条件,创建一个表
drop table if exists postfix_test;
create table postfix_test(id int,name varchar(10));
--关键字不带引号-成功
drop index if exists postfix;
create index postfix o... |
INSERT INTO burgers (burger_name, devoured) VALUES ('cheeseburger', 0);
INSERT INTO burgers (burger_name, devoured) VALUES ('double double', 0);
INSERT INTO burgers (burger_name, devoured) VALUES ('hamburger', 0);
INSERT INTO burgers (burger_name, devoured) VALUES ('chicken burger', 0);
|
CREATE function dbo.CourseEmailToNotificate
(@courseId int) returns varchar(1024)
as begin
return (
select
COALESCE(notifikovany.Email, z.Email, '<EMAIL>') + ISNULL(';' + nad.Email, '') + ISNULL(';' + zod.Email, '') AS Email
FROM
dbo.[Courses] s
LEFT JOIN dbo.[Organizations] o
ON o.Id = s.[OrganizationId]
LEFT ... |
CREATE TABLE Employees(
Id INT IDENTITY PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
)
CREATE TABLE Projects (
Id INT IDENTITY PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
)
CREATE TABLE EmployeesProjects(
EmployeeId INT,
ProjectId INT,
CONSTRAINT PK_EmpProjects
PRIMARY KEY (EmployeeId,ProjectId),
CONSTRAINT FK_Empl... |
CREATE TABLE OFFICER
(
TRUST_PROVIDER_FLAG NUMBER not null
constraint TRUE_OR_FALSE69
check (TRUST_PROVIDER_FLAG IN (0, 1)),
STAFF_EMPLOYEE_ID NUMBER not null,
SURNAME VARCHAR2(35) not null,
FORENAME VARCHAR2(35) not null,
FORENAME2 VARCHAR2(35),
ROW_VERSION NUMBER default 0 not null,
TRAINING_S... |
SELECT
*
FROM information_schema.table_privileges
WHERE 1=1
/*if isNotEmpty(schemaName) */
AND table_schema IN /*schemaName*/('%')
/*end*/
/*if isNotEmpty(objectName) */
AND table_name IN /*objectName*/('%')
/*end*/
ORDER BY grantee, table_catalog, table_schema, table_name
|
DROP TABLE /*_*/slots;
DROP TABLE /*_*/content;
DROP TABLE /*_*/content_models;
DROP TABLE /*_*/slot_roles;
|
CREATE TABLE WorkshopHelpers (
LessonID TEXT,
WorkshopID TEXT,
PersonID TEXT,
FOREIGN KEY (WorkshopID, LessonID) REFERENCES WorkshopLessons,
FOREIGN KEY (PersonID) REFERENCES HelperPool
) |
-- -----------------------------------------------------------------------------
-- Scenario Establishment
-- ======================
--
-- ===> Run ONLY in a Crash and Burn Database <===
--
-- Run as SYS AS SYSDBA
--
-- This gives erroneous results when querying V$SESSION as a non-SYS user.
-- -------------------------... |
<filename>src/test/resources/sql/select/3e4910c6.sql<gh_stars>10-100
-- file:numeric.sql ln:910 expect:true
select exp(1.0)
|
<reponame>Shuttl-Tech/antlr_psql
-- file:plpgsql.sql ln:1281 expect:true
insert into PSlot values ('PS.first.c1', 'PF1_1', '', 'WS.105.1a')
|
<reponame>villeheikkila/maku
--! Previous: sha1:b734ab246bcaba73aadaa80a91d51734cabe36e0
--! Hash: sha1:6954279d4c92f3054390dd40f1cf19789070343d
--! split: 1-current.sql
-- Enter migration here
create domain app_public.name as text check (
(length(value) >= 2)
AND (length(value) <= 56)
);
|
-- MySQL dump 10.13 Distrib 8.0.22, for Linux (x86_64)
--
-- Host: localhost Database: paper_haxxj_com
-- ------------------------------------------------------
-- Server version 8.0.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS... |
/****** Object: View [dbo].[V_GetPipelineProcessors] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_GetPipelineProcessors]
AS
SELECT dbo.T_Analysis_Job_Processors.ID, dbo.T_Analysis_Job_Processors.Processor_Name, dbo.T_Analysis_Job_Processors.State,
C... |
<reponame>patrickfischer1/WebAPI<filename>src/main/resources/resources/cohortanalysis/heraclesanalyses/sql/4020_distributionOfGreaterThan0USDCostPerSubject.sql<gh_stars>10-100
-- 4020 Distribution of greater than 0 US$ cost per subject by period_id, by visit_concept_id, by visit_type_concept_id, by cost_concept_id, by ... |
<filename>shophp.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.6.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 01, 2016 at 11:38 PM
-- Server version: 10.1.14-MariaDB
-- PHP Version: 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
-- SQL script that imports table dump "temperatures.sql" into the database "hbtn_0c_0".
-- Display average temperature (Farhenheit) by city ordered by temperature.
SELECT city, AVG(value) AS 'avg_temp' FROM temperatures GROUP BY city ORDER BY avg_temp DESC;
|
CREATE TABLE db_pms3003.fct_pm
(
pm1 int NOT NULL,
pm25 int NOT NULL,
pm10 int NOT NULL,
dt datetime NOT NULL
);
CREATE USER 'sa' IDENTIFIED BY 'xxx';
GRANT ALL ON * TO 'sa';
CREATE USER 'shiny' IDENTIFIED BY 'xxx';
GRANT SELECT ON db_pms3003.fct_pm TO 'shiny';
CREATE USER 'rpi' IDENTIFIED BY 'xxx';
G... |
<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : LOCALHOST
Source Server Version : 50714
Source Host : localhost:3306
Source Database : laravel_dev
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2017-03-31 18:48:21
*/
SET FOREIGN_KEY... |
<gh_stars>0
SELECT d.godina , d.vrsta_dok , d.broj_dok , d.org_Deo , od.DODATNI_TIP , d.broj_dok1 , D.USER_ID ,
vd.za_godina , vd.za_vrsta_dok , vd.za_broj_dok
FROM dokument d , org_deo_osn_podaci od , vezni_dok vd
WHERE d.godina = 2008 and d.vrsta_dok = 3 And d.tip_dok = 10 And d.broj_Dok1 > 0 And Status ... |
<filename>database/table/table_post.sql
CREATE TABLE IF NOT EXISTS post(
post_id INT NOT NULL AUTO_INCREMENT,
user_id VARCHAR(20) NULL,
post_title VARCHAR(100) NOT NULL,
post_content MEDIUMTEXT NOT NULL,
post_view INT NOT NULL DEFAULT 0,
post_date DATETIME NOT NULL DEFAULT NOW(),
post_anony TINYINT NOT NULL DEFAULT 0,
... |
CREATE TABLE t (
id INT NOT NULL PRIMARY KEY,
str TEXT
);
|
<filename>application/data/vs_agent_visa_fee.sql
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 20, 2019 at 05:04 AM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 5.6.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACT... |
<filename>src/main/resources/migrations/2021.06.12.1.torrent_info_added_folder.sql<gh_stars>10-100
alter table torrent_info add column folder varchar(128); |
--------------------
-- ${table.full_table_name}
--------------------
--DROP TABLE ${table.full_table_name};
CREATE TABLE ${table.full_table_name}
(
% for c in table.columns:
${c},
% endfor
% for c in settings['append_columns']:
${c},
% endfor
% if len(table.pks) > 0:
PRIMARY KEY (${', '.join([i.col... |
<filename>Algo and DSA/LeetCode-Solutions-master/MySQL/find-the-quiet-students-in-all-exams.sql
# Time: O(m + nlogn)
# Space: O(m + n)
SELECT s.student_id,
s.student_name
FROM student s
INNER JOIN (SELECT a.student_id,
Count(a.exam_id) AS total_exam,
... |
# https://leetcode.com/problems/second-highest-salary/
# +----+--------+
# | Id | Salary |
# +----+--------+
# | 1 | 100 |
# | 2 | 200 |
# | 3 | 300 |
# +----+--------+
# +---------------------+
# | SecondHighestSalary |
# +---------------------+
# | 200 |
# +---------------------+
# ---... |
@oms-run ./oms-activate-batch.sql Mail/%
|
<reponame>plencovich/movistar-edificios<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.6.6deb1+deb.cihar.com~xenial.2
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 21-05-2018 a las 22:39:28
-- Versión del servidor: 10.0.34-MariaDB-0ubuntu0.16.04.1
-- Versión de PHP: 7.0.30-1+ubuntu16... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 11, 2017 at 03:43 PM
-- Server version: 5.7.18-0ubuntu0.16.04.1
-- PHP Version: 7.0.18-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... |
<filename>dump.sql
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
--
-- Host: localhost Database: temp
-- ------------------------------------------------------
-- Server version 5.7.28-0ubuntu0.16.04.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULT... |
<gh_stars>0
SELECT ROUND(LONG_W, 4)
FROM STATION
WHERE LAT_N > 38.7780
ORDER BY LAT_N
LIMIT 1; |
<gh_stars>1-10
/*
SQLyog v10.2
MySQL - 5.1.73-community : Database - doodle
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_... |
-- This file and its contents are licensed under the Timescale License.
-- Please see the included NOTICE for copyright information and
-- LICENSE-TIMESCALE for a copy of the license.
\c :TEST_DBNAME :ROLE_CLUSTER_SUPERUSER;
SET client_min_messages TO ERROR;
DROP DATABASE IF EXISTS data_node_1;
DROP DATABASE IF EXIST... |
<reponame>iamycx/Spring-learning
--秒杀存储执行过程
DELIMITER $$ --console ; 转换为 $$
--定义存储过程
--参数in输入参数,out输出参数
--row_count():返回上亿条修改类型sql(delete,insert,update)影响行数
--row_count:0未修改数据 >0表示修改的行数,<0代表sql错误或者未修改sql
CREATE PROCEDURE `seckill`.`execute_seckill` (IN v_seckill_id bigint,IN v_phone bigint, IN v_kill_time TIMESTAMP ,ou... |
<reponame>Skraye/plugin-jdbc
DROP TABLE IF EXISTS pgsql_types;
CREATE TABLE pgsql_types (
available boolean not null,
a CHAR(4) not null,
b VARCHAR(30) not null,
c TEXT not null,
d VARCHAR(10),
play_time smallint not null,
library_record BIGINT not null,
-- money_type money not null,
... |
<filename>umbra/queries/bi-9.sql
/* Q9. Top thread initiators
\set startDate '\'2011-10-01\''::timestamp
\set endDate '\'2011-10-15\''::timestamp
*/
SELECT Person.id AS "person.id"
, Person.firstName AS "person.firstName"
, Person.lastName AS "person.lastName"
, count(DISTINCT MessageThread.RootPostId) ... |
-- database: presto; groups: aggregate; tables: datatype
select variance(c_bigint), variance(c_double) from datatype
|
-- +migrate Up
CREATE TABLE integration_model AS TABLE platform_model;
CREATE SEQUENCE integration_model_id_seq;
ALTER TABLE integration_model ALTER COLUMN id SET NOT NULL;
ALTER TABLE integration_model ALTER COLUMN id SET DEFAULT nextval('integration_model_id_seq');
ALTER SEQUENCE integration_model_id_seq OWNED BY i... |
<filename>openGaussBase/testcase/KEYWORDS/Directory/Opengauss_Function_Keyword_Directory_Case0027.sql<gh_stars>0
-- @testpoint:opengauss关键字directory(非保留),作为序列名
--关键字不带引号-成功
drop sequence if exists directory;
create sequence directory start 100 cache 50;
drop sequence directory;
--关键字带双引号-成功
drop sequence if exists ... |
<gh_stars>0
-- @testpoint:opengauss关键字translate(非保留),作为数据库名
--关键字不带引号-成功
drop database if exists translate;
create database translate;
drop database translate;
--关键字带双引号-成功
drop database if exists "translate";
create database "translate";
drop database "translate";
--关键字带单引号-合理报错
drop database if exists 'translate'... |
select a + b from test1 where a + b > 1020 and b + c > 1;
select a - b from test1 where a - b > 1020 and b - c >= 0;
select a * b from test1 where a * b > 1020 and b * c < 10;
select a / b from test1 where a / b > 1020 and b * c = 1; |
<filename>database/scripts/firstTables.sql<gh_stars>0
use laravel;
drop table if exists users;
drop table if exists roles;
/* CREATE TABLE roles (
role_id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
libelle VARCHAR(30) NOT NULL
) ENGINE=INNODB;
insert into roles (libelle) values ('admin'),('user');
CREATE TABLE use... |
--
-- User table. Contains unique UIDs.
--
CREATE TABLE user_table
(
id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY,
uid VARCHAR(40) NOT NULL UNIQUE,
active BOOLEAN DEFAULT true
);
--
-- Valid roles that may be assigned to a user.
--
create table role_tab... |
<gh_stars>0
-- examples on casting
use hron;
-- explicit cast to char
select cast(12345.67 as char);
-- explicit cast to date
select cast('2022-01-01' as date);
-- bad format -> NULL
select cast('01-10-2021' as date);
-- explicit cast to datetime
select cast('2022-01-01' as datetime);
|
<reponame>DW-1405/TESIS
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 31-01-2022 a las 22:09:30
-- Versión del servidor: 10.4.14-MariaDB
-- Versión de PHP: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:... |
CREATE DATABASE OnlineStore
CREATE TABLE Cities
(
CityID INT PRIMARY KEY IDENTITY,
[Name] VARCHAR(50) NOT NULL
)
CREATE TABLE Customers
(
CustomerID INT PRIMARY KEY IDENTITY,
[Name] VARCHAR(50) NOT NULL,
Birthday DATE NOT NULL,
CityID INT
CONSTRAINT FK_Customers_City_ID
FOREIGN KEY (CityID)
REFERENCES Cities... |
<gh_stars>1-10
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.5.5-10.3.8-MariaDB)
# Database: pwldb
# Generation Time: 2018-12-07 07:11:29 +0000
# ********************... |
CREATE DATABASE `simchat`;
USE `simchat`;
DROP TABLE IF EXISTS `board`;
CREATE TABLE `board` (
`code` int(5) NOT NULL,
`username` char(100) NOT NULL,
`password` char(100) NOT NULL,
`contents` text NOT NULL,
`date` date NOT NULL,
`numlike` int(5) NOT NULL,
PRIMARY KEY (`code`)
) ENGINE=InnoDB DEFAULT CHA... |
<filename>db/migrate/000409_restaurant_payment_type_changes.sql<gh_stars>10-100
CREATE TABLE `restaurant_payment_type_change_set` (
`id_restaurant_payment_type_change_set` int(11) unsigned NOT NULL AUTO_INCREMENT,
`id_restaurant_payment_type` int(11) unsigned DEFAULT NULL,
`timestamp` timestamp NULL DEFAULT CURRE... |
DROP TABLE IF EXISTS a;
DROP TABLE IF EXISTS b;
DROP TABLE IF EXISTS c;
DROP TABLE IF EXISTS d;
DROP TABLE IF EXISTS e;
DROP TABLE IF EXISTS f;
DROP TABLE IF EXISTS testdeploymenthistory;
DROP TABLE IF EXISTS SchemaVersions;
DROP TABLE IF EXISTS testschema.a;
DROP TABLE IF EXISTS testschema.b;
DROP TABLE IF EXISTS tes... |
ALTER TABLE photos DROP COLUMN width;
ALTER TABLE photos DROP COLUMN height;
|
<filename>Log4TSql/Log4TSql_Common_Tests/CommonModuleTests/test log4.JournalWriter returns error number after handling exception.sql
create procedure [CommonModuleTests].[test log4.JournalWriter returns error number after handling exception]
as
begin
exec tSQLt.FakeTable @TableName = 'log4Private.Journal', @Identit... |
<reponame>danieldiamond/gitlab-analytics<filename>transform/snowflake-dbt/models/staging/google_analytics_360/xf/ga360_session_custom_dimension_xf.sql
WITH session_custom_dims AS (
SELECT *
FROM {{ ref('ga360_session_custom_dimension') }}
), ga_index_names AS (
SELECT *
FROM {{ ref('google_analytics_custom_dim... |
DROP TABLE IF EXISTS `playerbots_arena_team_names`;
CREATE TABLE `playerbots_arena_team_names` (
`name_id` mediumint(8) NOT NULL AUTO_INCREMENT UNIQUE,
`name` varchar(24) NOT NULL UNIQUE,
... |
TRUNCATE TABLE PROPOSAL_TYPE DROP STORAGE
/
INSERT INTO PROPOSAL_TYPE (PROPOSAL_TYPE_CODE,DESCRIPTION,UPDATE_USER,UPDATE_TIMESTAMP,OBJ_ID,VER_NBR)
VALUES ('1','New','admin',SYSDATE,SYS_GUID(),1)
/
INSERT INTO PROPOSAL_TYPE (PROPOSAL_TYPE_CODE,DESCRIPTION,UPDATE_USER,UPDATE_TIMESTAMP,OBJ_ID,VER_NBR)
VALUES ('2... |
set pagesize 600
set linesize 150
set head on
set echo off
SET feedback off
SET VERIFY off
COLUMN dr FORMAT A6
COLUMN segment_nm FORMAT A45
COLUMN used_size FORMAT A16
--Full child object verions
SELECT Dr,
Segment_Nm,
Segment_Type,
Lpad(CASE
WHEN Bytes < 1024 THEN
... |
<reponame>scaredofseagles/12-Homework<filename>db/schema.sql
## SCHEMA
CREATE DATABASE employee_manager;
USE employee_manager;
CREATE TABLE employee (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHAR(30),
role_id INTEGER,
manager_id INTEGER
)
CREATE TABLE `role` (
... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 1192.168.127.12
-- Generation Time: Jun 10, 2021 at 10:50 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SE... |
--add new column to emis org map
ALTER TABLE configuration.emis_organisation_map
ADD start_date date;
--remove non-null consraint from notification table
ALTER TABLE log.notification_message
ALTER COLUMN outbound DROP NOT NULL; |
CREATE TABLE label
(
id BIGINT PRIMARY KEY,
repository_id BIGINT REFERENCES repository(id),
name VARCHAR(100) NOT NULL
);
ALTER TABLE repository
ADD COLUMN createdAt TIMESTAMP,
ADD COLUMN updatedAt TIMESTAMP,
ADD COLUMN status VARCHAR(50);
UPDATE repository SET createdAt = local... |
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsq... |
----test pv_os_run_info view
select count(*)>=0 from gs_os_run_info;
----test pv_session_memory_detail view
select count(*)>=0 from gs_session_memory_detail;
----test pg_shared_memory_detail view
select count(*)>=0 from gs_shared_memory_detail;
----test pv_session_time view
select SCHEMANAME,VIEWNAME, DEFINITION fr... |
<gh_stars>0
prompt Importing table t_migraciones...
set feedback off
set define off
insert into t_migraciones (ID_MIGRACION, DESCRIPCION)
values ('mig_000010', 'Actualización de partido cada 1 minuto.');
prompt Done.
|
CREATE TABLE IF NOT EXISTS read_side.buc_param_recargo (
bpr_indice text,
bpr_tipo_indice text,
bpr_descripcion text,
bpr_fecha_desde date,
bpr_fecha_hasta date,
bpr_valor float,
bpr_concepto text,
bpr_impuesto text,
bpr_periodo text,
PRIMARY KEY (bpr_indice, bpr_tipo_indice, bpr... |
<reponame>1vaPetkova/JavaDB_MySQL
# 1. Table design
create schema 20201018_db;
use 20201018_db;
create table towns
(
id int primary key auto_increment,
name varchar(20) not null
);
create table addresses
(
id int primary key auto_increment,
name varchar(50) not null,
town_id int ... |
<gh_stars>0
CREATE TABLE persons (
`person_id` INT PRIMARY KEY AUTO_INCREMENT,
`first_name` VARCHAR(60) NOT NULL,
`salary` DECIMAL(10, 2) ,
`passport_id` INT UNIQUE
);
INSERT INTO `persons`(
`first_name`, `salary`, `passport_id`
) VALUES(
'Roberto', 43300.00, 102
);
INSERT INTO `persons`(
`first_name`, `salary`, `pas... |
<reponame>kunadawa/das-boot<filename>src/main/resources/db/migration/V2__create_database.sql
create table shipwreck (
id int auto_increment,
name varchar(255),
description varchar(255),
depth int,
latitude double,
longitude double,
year_discovered int
); |
<reponame>allblue-pl/php_espada_ecore
-- MySQL dump 10.13 Distrib 8.0.18, for Win64 (x86_64)
--
-- Host: localhost Database: rocko-routesetting
-- ------------------------------------------------------
-- Server version 5.7.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHAR... |
DROP DATABASE IF EXISTS towels_included;
CREATE DATABASE towels_included;
\c towels_included;
CREATE TABLE photos (
photo_id SERIAL PRIMARY KEY,
home_id INT,
photo_url VARCHAR,
photo_description VARCHAR
);
\copy photos(home_id,photo_url,photo_description) FROM '/Users/shelly/Desktop/SDC/picture-view... |
<reponame>bizmaercq/eda-reporting
select table_name from user_tables
alter table NEW_CIVIL_SERVANTS add (user_create varchar2(10),date_create date, user_update varchar2(10), date_update date);
alter table NEW_FONCTIONNAIRES add (user_create varchar2(10),date_create date, user_update varchar2(10), date_update date);... |
USE employee_db;
INSERT INTO department (dep_name)
VALUES ('Finance'),
('Operation'),
('Maintenance'),
('Sales'),
('Legal');
INSERT INTO role (title, salary, department_id)
VALUES ('Accountant', 3000, 1),
('Engineer', 3000, 2),
('Technician', 2000, 3),
('Marketer', 3000, 4),
('Lawyer', 3000, 5);
INSERT INTO employee... |
USE master
GO
-- Create the new database if it does not exist already
IF NOT EXISTS (
SELECT name
FROM sys.databases
WHERE name = N'Orleans'
)
CREATE DATABASE Orleans
GO
|
<gh_stars>1-10
---
name: upd_registered
description: Updates details for registered domain
templates:
- user.userlogin
returns: void
variables:
-
name: v_nameserver
type: dns.t_hostname
-
name: v_managed
type: commons.t_key
parameters:
-
name: p_domain
type: dns.t_hostname
-
name: p_admin_c
typ... |
CREATE PROCEDURE [Data_Load].[GetPaymentStatistics]
AS
SELECT count(*) as ProviderTotalPayments
FROM [Data_Load].[DAS_Payments] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.