sql stringlengths 6 1.05M |
|---|
INSERT INTO
"user" (username, email, password, is_active, is_admin, created_from)
VALUES
(
'admin',
'<EMAIL>',
uuid_generate_v4(),
TRUE,
TRUE,
'DBMigration'
) |
ALTER TABLE `videos_reported`
CHANGE COLUMN `reported_users_id` `reported_users_id` INT(11) NULL DEFAULT NULL ; |
-- MySQL dump 10.13 Distrib 8.0.15, for Win64 (x86_64)
--
-- Host: localhost Database: timetable
-- ------------------------------------------------------
-- Server version 8.0.15
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... |
alter table "public"."facility"
add constraint "facility_hospital_category_fkey"
foreign key ("hospital_category")
references "public"."hospital_category"
("key") on update cascade on delete cascade;
|
<gh_stars>0
/* Example of a base schema. These are non-idempotent scripts. */
-- Store time-series json events from applications
CREATE TABLE [Events]
(
[DateTimeOffset] datetimeoffset(7) NOT NULL,
[Application] nvarchar(MAX) NOT NULL,
[EventId] nvarchar(MAX) NOT NULL,
[EventJson] nvarchar(MAX) NOT N... |
-- CreateTable
CREATE TABLE "Project" (
"name" TEXT NOT NULL,
CONSTRAINT "Project_pkey" PRIMARY KEY ("name")
);
-- CreateTable
CREATE TABLE "BladeUsageRecord" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"busy" INTEGER NOT NULL DEFAULT 0,
"free" INTEGER ... |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 22, 2017 at 08:21 PM
-- Server version: 5.5.54-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
-- Function: addtestvalue(integer, text, text, text, text, text)
-- DROP FUNCTION addtestvalue(integer, text, text, text, text, text);
CREATE OR REPLACE FUNCTION addtestvalue(
integer,
text,
text,
text,
text,
text
)
RETURNS integer AS
$BODY$
DECLARE
_entry_id ALIAS for $1;
_field_id ALIAS FOR... |
<gh_stars>1-10
INSERT INTO userProfiles(first_name, last_name, userName, passWord, address)
VALUES('Andrew', 'Murray', '<EMAIL>', 'icecream', '5212 Medlock Corners Dr.' );
INSERT INTO userProfiles(first_name, last_name, userName, passWord, address)
VALUES('Henry', 'Blanksman', '<EMAIL>', 'pizza', '1895 Peachtree Rd.')... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 22 Sep 2019 pada 15.46
-- Versi Server: 10.1.19-MariaDB
-- PHP Version: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... |
CREATE TABLE [Sales].[CustomerCategories_Archive] (
[CustomerCategoryID] INT NOT NULL,
[CustomerCategoryName] NVARCHAR (50) NOT NULL,
[LastEditedBy] INT NOT NULL,
[ValidFrom] DATETIME2 (7) NOT NULL,
[ValidTo] DATETIME2 (7) NOT NULL
);
GO
CREAT... |
<gh_stars>10-100
-- Copyright (c) 2021 Oracle and/or its affiliates.
-- Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
BEGIN
DBMS_AQADM.CREATE_QUEUE_TABLE (
queue_table => 'ORDERQUEUETABLE',
queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESS... |
ALTER TABLE [AATF].AATF ADD [RowVersion] TIMESTAMP NOT NULL
ALTER TABLE [AATF].AATFReturnReportOn ADD [RowVersion] TIMESTAMP NOT NULL
ALTER TABLE [AATF].AATFReturnScheme ADD [RowVersion] TIMESTAMP NOT NULL
ALTER TABLE [AATF].NonObligatedWeee ADD [RowVersion] TIMESTAMP NOT NULL
ALTER TABLE [AATF].Operator ADD [RowVersi... |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50720
Source Host : 127.0.0.1:3306
Source Database : userinfo
Target Server Type : MYSQL
Target Server Version : 50720
File Encoding : 65001
Date: 2020-06-26 10:48:04
*/
SET FOREIGN_KEY_CHECKS=0;... |
CREATE TABLE ALBUMS (
ALBUMID BIGINT NOT NULL,
DESCRIPTION VARCHAR(255),
NAME VARCHAR(50),
USERID VARCHAR(50) NOT NULL
);
--//@UNDO
DROP TABLE ALBUMS; |
use ftgo;
create table consumers
(
id bigint not null,
first_name varchar(255),
last_name varchar(255),
primary key (id)
) engine = InnoDB;
create table courier
(
id bigint not null auto_increment,
available bit,
first_name varchar(255),
last_name varchar(255),
street1... |
<reponame>PuneetGoel80/tessera<filename>ddls/create-table/postgresql-ddl.sql<gh_stars>100-1000
CREATE TABLE ENCRYPTED_TRANSACTION (ENCODED_PAYLOAD BYTEA NOT NULL, PAYLOAD_CODEC VARCHAR(50), HASH BYTEA NOT NULL, TIMESTAMP DECIMAL(19), PRIMARY KEY (HASH));
CREATE TABLE ENCRYPTED_RAW_TRANSACTION (ENCRYPTED_KEY BYTEA NOT N... |
USE CUSTOM_SYS;
-- See the last 10 compaction events
SELECT
`DATABASE`,
`TABLE`,
`PARTITION`,
`STATE`,
`TYPE`,
`START`,
`END`,
HADOOP_JOB_ID
FROM
`CUSTOM_SYS`.`COMPACTIONS`
ORDER BY
`START` DESC
LIMIT 10;
-- Show the last 10 failed compaction event
-- `state` options are 'SUCCE... |
CREATE PROCEDURE SP397(OUT MYCOUNT INTEGER) SPECIFIC SP397_117333 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE424;SELECT COUNT(*)INTO MYCOUNT FROM TABLE314;SELECT COUNT(*)INTO MYCOUNT FROM TABLE95;SELECT COUNT(*)INTO MYCOUNT FROM... |
-- ------
-- BGA framework: © <NAME> <<EMAIL>> &
-- <NAME> <<EMAIL>>
-- Texas 42 implementation : © <NAME> <<EMAIL>> &
-- <NAME> <<EMAIL>> &
-- <NAME> <<EMAIL>>
--
-- This code has been produced on the BGA studio platform for use on
-- http://boardgamearena.com.
-- See http://en.boardgamearena.com/#!doc/Studio for more... |
<gh_stars>0
-- @testpoint:opengauss关键字match(非保留),作为模式名
--关键字不带引号-成功
drop schema if exists match;
create schema match;
drop schema match;
--关键字带双引号-成功
drop schema if exists "match";
create schema "match";
drop schema "match";
--关键字带单引号-合理报错
drop schema if exists 'match';
create schema 'match';
--关键字带反引号-合理报错
drop ... |
<filename>openGaussBase/testcase/SQL/DDL/temporary_table/Opengauss_Function_DDL_Temporarytable_Case0059.sql
-- @testpoint: 创建本地临时表分区表,合理报错
-- @modify at: 2020-11-24
--建表
drop table if exists temp_table_059;
create temporary table temp_table_059
(
cd_demo_sk integer not null,
c... |
<gh_stars>0
/*
SQLyog Ultimate v10.42
MySQL - 5.5.5-10.2.30-MariaDB : Database - u5538790_greebel
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014... |
<reponame>camjm/beyond-earth-app<filename>src/BeyondEarthAppDb/Scripts/TechnologyData.sql
IF NOT EXISTS (SELECT * FROM dbo.Technology WHERE Name = 'Habitation')
INSERT INTO dbo.Technology(Name, Cost) VALUES ('Habitation', 0);
IF NOT EXISTS (SELECT * FROM dbo.Technology WHERE Name = 'Chemistry')
INSERT INTO dbo.Tech... |
<filename>Sql/SQL 101/9.ALTERAR TIPO DAS COLUNAS EM UMA TABELA.sql
USE sucos;
ALTER TABLE tbcliente ADD PRIMARY KEY (CPF);
ALTER TABLE tbcliente ADD COLUMN (DATA_NASCIMENTO DATE);
INSERT INTO tbcliente (
CPF, NOME, ENDERECO1, ENDERECO2, BAIRRO, CIDADE, ESTADO, CEP, IDADE, SEXO,
LIMITE_CREDITO, VOLUME_COMPRA, PRIME... |
<filename>database/DataMigration/11_ETL_MAP_NEARESTTOWN_V1_dml.sql
/*** Script to retrieve data from legacy tables
and map that data to the new CRT code lookup
tables.
-- retrieve values from Legacy table
SELECT ID, [Town Name]
FROM tblTowns
WHERE ID NOT IN (3, 121)
ORDER BY [Town Name]
--retrieve values from CRT... |
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
PRINT N'Creating [edfi].[SectionClassPeriod]'
CRE... |
DROP TABLE IF EXISTS ALIMY;
DROP TABLE IF EXISTS ALIMY_UNITS;
DROP TABLE IF EXISTS PRIVILEGE;
DROP TABLE IF EXISTS ROLES;
DROP TABLE IF EXISTS ROLES_PRIVILEGES;
DROP TABLE IF EXISTS USERS;
DROP TABLE IF EXISTS USERS_ROLES;
DROP TABLE IF EXISTS USERS_SOCIAL;
DROP TABLE IF EXISTS LOGS;
CREATE TABLE ALIMY (
`ID` int(11... |
<gh_stars>1-10
-- Add new notifications
insert into event_map(event_up_name, event_down_name) values('SYSTEM_DEACTIVATED_STORAGE_DOMAIN', '');
insert into event_map(event_up_name, event_down_name) values('VDS_SET_NONOPERATIONAL', '');
insert into event_map(event_up_name, event_down_name) values('VDS_SET_NONOPERATIONAL_... |
<gh_stars>1-10
CREATE TABLE stacoun AS (
SELECT stations.station_id,
stations.state,
counties.county AS county_name,
counties.sfips AS state_fips,
counties.cfips AS county_fips,
stations.name
FROM stations
JOIN counties
ON (ST_Contains(counties.geom, stations.geom) AND
stations.s... |
<gh_stars>10-100
DROP INDEX IF EXISTS instance_lbl_instance_id; |
<filename>src/postgres/contrib/pg_stat_monitor/sql/yb_pg_relations.sql
CREATE EXTENSION pg_stat_monitor;
SELECT pg_stat_monitor_reset();
CREATE TABLE foo1(a int);
CREATE TABLE foo2(b int);
CREATE TABLE foo3(c int);
CREATE TABLE foo4(d int);
-- test the simple table names
SELECT pg_stat_monitor_reset();
SELECT * FROM f... |
SELECT
*
FROM
view_beban_barang5_pertanian
UNION ALL
|
<reponame>kesavanvt/spark
--IMPORT explain.sql
--SET spark.sql.adaptive.enabled=true
--SET spark.sql.maxMetadataStringLength = 500
|
---- ALTER TABLE ... CHANGE COLUMN
-- class attribute
-- type change from double
-- to int, char has only digits
create table t1 class attribute (c_s varchar(10)) ( i integer ) ;
insert into t1 values (1),(2);
update t1 set class t1.c_s='123';
select class t1.c_s, i from t1 order by 1,2;
show columns in t1;
alt... |
<reponame>RailByte/Groundframe<filename>GroundFrame.SQL/Scripts/Post Deployment/Data Population/Script.Populate app.TUSER.sql
/******************************
** File: ~\GroundFrame\GroundFrame.SQL\Script\Post Deployment\Data Population\Script.Populate app.TUSER.sql
** Name: Script.Populate app.TUSER.sql
** Desc: Po... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 01, 2020 at 09:59 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
spark.sql("""select OPT_OUT_FLG, MDM_STATUS_CD, trim(MDM_PARTY_ID) MDM_PARTY_ID,OPT_OUT_DT,mdm_ins_dt,mdm_last_mod_dt,mdm_eff_end_dt from ALL_ALL_R_GBL_MDM.lnd_cdw_party_prof where mdm_party_id is not null
minus
select value, status, customer_id, date_of_consent,mdm_ins_date, mdm_last_mod_date, mdm_eff_end_date... |
<reponame>PierreLetter/sqlwatch<filename>SQLWATCHDB/dbo/Tables/sqlwatch_meta_sql_text.sql
CREATE TABLE [dbo].[sqlwatch_meta_sql_text]
(
[sql_instance] varchar(32) NOT NULL,
[sql_text_id] bigint identity(1,1) not null,
[sql_text] nvarchar(max),
[sql_text_hash] as HASHBYTES('MD5', [sql_text]) persisted,
[date_added... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Waktu pembuatan: 24 Nov 2020 pada 15.32
-- Versi server: 5.7.26
-- Versi PHP: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `olshop`
--
-- -----------------------... |
<gh_stars>0
-- reset types
IF TYPE_ID('ExhaustiveBit') IS NOT NULL DROP TYPE ExhaustiveBit;
IF TYPE_ID('ExhaustiveTinyInt') IS NOT NULL DROP TYPE ExhaustiveTinyInt;
IF TYPE_ID('ExhaustiveSmallInt') IS NOT NULL DROP TYPE ExhaustiveSmallInt;
IF TYPE_ID('ExhaustiveInt') IS NOT NULL DROP TYPE ExhaustiveInt;
IF TYPE_ID('Exh... |
<reponame>erinmarie84/Employee-Tracker
DROP DATA
USE employee_db;
INSERT INTO department (name) VALUES ('Administration');
INSERT INTO department (name) VALUES ('Production');
INSERT INTO department (name) VALUES ('Accounting');
INSERT INTO department (name) VALUES ('Marketing');
INSERT INTO department (name) VALUES (... |
UPDATE Tickets
SET Price *= 1.5
WHERE FlightID IN
(
SELECT f.FlightID
FROM Flights AS f
JOIN Airlines AS a
ON f.AirlineID = a.AirlineID
WHERE Rating = (SELECT MAX(Rating) AS MaxRating FROM Airlines)
) |
<filename>database.sql
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 19, 2018 at 09:50 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:0... |
<reponame>pavel-voinov/oracle-dba-workspace<filename>scripts/refresh_mviews_complete.sql
/*
*/
set serveroutput on size unlimited echo on timing on
define p_parallelism=16
@@compile_mviews
declare
l_failed boolean;
l_paralellism number := to_number('&p_parallelism');
table_does_not_exist exception;
pragma ex... |
<reponame>fetchq/fetchq-pg-extension<filename>tests/queue-drop-metrics.test.sql
-- declare test case
CREATE OR REPLACE FUNCTION fetchq_test.queue_drop_metrics_01(
OUT passed BOOLEAN
) AS $$
DECLARE
VAR_testName VARCHAR = 'IT SHOULD DROP METRICS GIVEN A JSON CONFIGURATION';
VAR_policy VARCHAR;
VAR_r RECO... |
<filename>plsql/if_then.sql<gh_stars>1-10
SET SERVEROUTPUT ON
DECLARE
a number(2) :=3;
BEGIN
if(a < 20) then
dbms_output.put_line('testing output print');
END IF;
dbms_output.put_line('value of a is : ' || a);
END;
/ |
<filename>database/db.sql<gh_stars>0
CREATE DATABASE Final;
use Final;
CREATE TABLE customer (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
address VARCHAR(100) NOT NULL,
phone VARCHAR(15)
);
CREATE TABLE enterprise (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(5... |
-- ************************************** `auth_providerconfig`
CREATE TABLE IF NOT EXISTS `{$NAMESPACE}`.`auth_providerconfig` (
`id` INT(10) unsigned NOT NULL AUTO_INCREMENT,
`sid` VARBINARY(64) NOT NULL,
`providerClass` VARCHAR(128) NOT NULL,
`providerType` ... |
<reponame>mhuntin1/CS-3810-Databases<filename>hw2.sql<gh_stars>0
CREATE TABLE Countries ( name VARCHAR(20), latitude VARCHAR(10), longitude VARCHAR(10), area INT, population INT, gdp VARCHAR(15), gdpYear INT );
-- 4a create borders
CREATE TABLE Borders (country1 VARCHAR(20), country2 VARCHAR(20) );
--4... |
<gh_stars>1-10
create or replace PACKAGE PO AS
PROCEDURE update_po(po_id PO_DETAIL.PO_NUMBER%TYPE);
END PO; |
{#- 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 by applicable law or agreed to in writing, software
distribute... |
<reponame>lunasaw/luna-linux-conf
/*
Navicat Premium Data Transfer
Source Server : luna-mysql-collage
Source Server Type : MySQL
Source Server Version : 50718
Source Host : cdb-5w1wgodg.bj.tencentcdb.com:10067
Source Schema : yttv-platform
Target Server Type : MySQL
Target Serv... |
ALTER TABLE accession_queue
ADD COLUMN IF NOT EXISTS instance_contributors TEXT,
ADD COLUMN IF NOT EXISTS publisher TEXT,
ADD COLUMN IF NOT EXISTS publish_year VARCHAR(100),
ADD COLUMN IF NOT EXISTS publish_place TEXT,
ADD COLUMN IF NOT EXISTS volume VARCHAR(100),
... |
ALTER TABLE namespaces ADD COLUMN firefly_contracts TEXT;
|
alter table "source_collector"."note_jot" rename column "Id" to "id";
|
-- Table `PARTITION_EVENTS` for classes [org.apache.hadoop.hive.metastore.model.MPartitionEvent]
SELECT '< HIVE-2215 Add api for marking querying set of partitions for events >' AS ' ';
CREATE TABLE IF NOT EXISTS `PARTITION_EVENTS`
(
`PART_NAME_ID` BIGINT NOT NULL,
`DB_NAME` VARCHAR(128) BINARY NULL,
`EVE... |
CREATE RULE computer_del AS ON DELETE TO computer
DO DELETE FROM software WHERE hostname = OLD.hostname;
|
<gh_stars>0
json是一个非常有用的数据类型,细微点比较多,所以这里记录。
--1 自己写json和使用 json_object 函数 , 自己写的values可以不带双引号, 而 json_object 函数会自动给你加上双引号。
hp=# create table js (s json ) ;
CREATE TABLE
hp=# insert into js values('{"a":100}');
INSERT 0 1
hp=# insert into js values(json_object('{a}','{100}'));
INSERT 0 1
hp=# select * from js;
... |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [RDF.Security].[Group](
[SecurityGroupID] [bigint] NOT NULL,
[Label] [varchar](255) NOT NULL,
[HasSpecialViewAccess] [bit] NULL,
[HasSpecialEditAccess] [bit] NULL,
[Description] [varchar](max) NULL,
PRIMARY KEY CLUSTERED
(
[Secu... |
-- phpMyAdmin SQL Dump
-- version 4.7.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 15, 2017 at 09:12 AM
-- Server version: 5.5.55-0+deb8u1
-- PHP Version: 7.0.20-1~dotdeb+8.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!... |
CREATE PROCEDURE [dbo].[usp_sqlwatch_internal_add_index]
as
create table ##DB61B2CD92324E4B89019FFA7BEF1010 (
index_name nvarchar(128),
index_id int,
index_type_desc nvarchar(128),
[table_name] nvarchar(128),
[database_name] nvarchar(128),
sqlwatch_database_id smallint null,
sqlwatch_table_id int null
)
crea... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 10, 2020 at 09:32 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
create database inputs;
use inputs;
create table inputs(
id INT Auto_Increment Primary Key,
input VARCHAR(50)
);
|
<gh_stars>0
SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH,
NUMERIC_PRECISION, DATETIME_PRECISION,
IS_NULLABLE, COLUMNPROPERTY(OBJECT_ID(TABLE_SCHEMA + '.' + TABLE_NAME), COLUMN_NAME, 'ColumnID') AS COLUMN_ID
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = ?; |
CREATE TABLE `forge`.`usuarios` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(255) NOT NULL,
`apellido` varchar(255) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=MyISAM D... |
-- drop table if exists teacher ;/
-- 创建表
create table teacher(
id int primary key auto_increment,
name varchar(20),
age int
);
|
<reponame>DeusMechanicus/Omnissiah<filename>db/mariadb/cfg_data.sql
INSERT INTO cfg_parameter (parameter, tablename, value) VALUES ('max_nnml_train_records', '', '10');
INSERT INTO cfg_parameter (parameter, tablename, value) VALUES ('max_nnml_model_records', '', '10');
INSERT INTO cfg_parameter (parameter, tablename, v... |
-- file:numeric_big.sql ln:783 expect:true
WITH t(b, p, bc_result) AS (VALUES
(0.06933247, -20.342987, 379149253615977128356318.39406340),
(0.06933247, -19.342987, 26287354251852125772450.59436685),
(0.06933247, -18.342987, 1822567200045909954554.65766042),
(0.06933247, -17.342987, 126363085720167050546.86216560),
(0.0... |
<gh_stars>1-10
create procedure ProcWithVariableThatIsWrittenToAndNotUsed
as
begin
declare @A int -- @A is set. This should NOT be flagged as a problem
set @A = 1
end |
<filename>taxonomy-manager-rest-server/src/main/resources/db/procedures/project/R__delete_project.sql
drop procedure IF EXISTS delete_project(_slug character varying);
create or replace procedure delete_project(_slug character varying)
LANGUAGE SQL AS
$$
UPDATE project SET deleted = true WHERE project.slug = _slug;... |
drop function f4();
drop language plpythonu CASCADE;
drop OPERATOR CLASS sva_special_ops USING btree;
drop OPERATOR <# (text,text) CASCADE;
drop FUNCTION si_same(text, text);
drop FUNCTION si_lt(text, text);
drop FUNCTION normalize_si(text);
DROP RESOURCE QUEUE myqueue;
drop table foo;
drop tablespace mytblspa... |
DROP DATABASE prueba2
create DATABASE prueba2
use prueba2
use persona
create table alumno(
codigo varchar(30) not null,,
nombre varchar(30),
apellidos varchar(30),
programa varchar(30),
correo varchar(30),
direccion varchar(60),
nota1 float,
nota2 float,
nota3 float,
nota_defini... |
<reponame>eduardo-gomez-i/checador<filename>sql/login.sql
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 22-12-2020 a las 18:28:11
-- Versión del servidor: 10.4.13-MariaDB
-- Versión de PHP: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START T... |
<filename>theory_exer/ex04/q1.sql<gh_stars>0
-- *** 1.
-- a.
select sname
from Suppliers natural join Catalog natural join Parts P
where P.colour='red' --natural join -> default is inner -> implicitly
-- use the common column
-- b.
select sid
from Catalog C natural join Parts P
where (... |
<filename>store.sql/store_database.sql
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3308
-- Generation Time: Dec 29, 2019 at 06:11 PM
-- Server version: 8.0.18
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_... |
<gh_stars>0
select child.id, child.left_mark, child.right_mark, child.depth, concat(repeat('-', count(parent.id)-1), child.hts_code) as hts_code, child.Title from chapter_73 as child, chapter_73 as parent where child.left_mark between parent.left_mark and parent.right_mark group by child.id order by child.left_mark;
#w... |
/*****************************************************************************************************
** File: changeownertosasid.sql
** Name: Change Database Owner to sa SID
** Desc: Loops through all databases filtering on a username, which then switches them to the sa sid.
** Auth: Noobinabox
** Date: Mar 1, 2016
*... |
<reponame>iafb/greatreadingadventure
CREATE TABLE [dbo].[SRPUserPermissions] (
[UID] INT NOT NULL,
[PermissionID] INT NOT NULL,
[AddedDate] DATETIME CONSTRAINT [DF_SRPUserPermissions_AddedDate] DEFAULT (getdate()) NULL,
[AddedUser] VARCHAR (50) CONSTRAINT [DF_SRPUse... |
--5. Salary Level Function
CREATE FUNCTION ufn_GetSalaryLevel (@salary DECIMAL(18,4))
RETURNS NVARCHAR(10)
AS
BEGIN
DECLARE @salaryLevel VARCHAR(10)
IF(@salary < 30000)
SET @salaryLevel = 'Low'
ELSE IF(@salary >= 30000 AND @salary <= 50000)
SET @salaryLevel = 'Average'
ELSE
SET @salaryLevel ... |
<reponame>liangzi4000/grab-share-info<gh_stars>0
EXEC [EST].[Proc_yjbb_Ins] @Code = N'603138',@CutoffDate = N'2017-09-30',@EPS = N'0.435',@EPSDeduct = N'0',@Revenue = N'3.78亿',@RevenueYoy = N'10.80',@RevenueQoq = N'-12.47',@Profit = N'4434.90万',@ProfitYoy = N'41.50',@ProfiltQoq = N'48.22',@NAVPerUnit = N'3.4604',@ROE =... |
<reponame>luizvaz/sql-paises-estados-cidades
update cidade set cod_tom = '1301' where uf = 6 and upper(trim(unaccent(nome))) like 'ABAIARA';
update cidade set cod_tom = '1231' where uf = 6 and upper(trim(unaccent(nome))) like 'ACARAPE';
update cidade set cod_tom = '1303' where uf = 6 and upper(trim(unaccent(nome))) l... |
<filename>Database Basic/Programmability and Transactions - Exercises/Programmability and Transactions - Exercises/01. Employees with Salary Above 35000.sql
CREATE PROCEDURE usp_GetEmployeesSalaryAbove35000
AS
SELECT FirstName, LastName
FROM Employees
WHERE Salary > 35000
GO
EXEC dbo.usp_GetEmployeesSalaryAbove350... |
<gh_stars>1-10
CREATE TABLE /*_*/site_identifiers_tmp (
-- Key on site.site_id
si_site INT UNSIGNED NOT NULL,
-- local key type, ie 'interwiki' or 'langlink'
si_type varbinary(32) NOT NULL,
-- local key value, ie 'en' or 'wiktionary'
si_key ... |
<gh_stars>1-10
-- Verify schemas/inflection/tables/inflection_rules/table on pg
BEGIN;
SELECT verify_table ('inflection.inflection_rules');
ROLLBACK;
|
/* Formatted on 12-19-2018 10:54:11 AM (QP5 v5.126.903.23003) */
CREATE OR REPLACE FUNCTION EPAY.GENERATE_AGENT_IDS_ALLTELCOS (
P_LISTLIMIT VARCHAR2,
P_TELCO VARCHAR2
)
RETURN NUMBER
AS
V_TELCO VARCHAR (200) := P_TELCO;
V_REGN_CODE VARCHAR (200) := '';
V_CITY_CODE ... |
<gh_stars>10-100
-- 1.Retrieve the birth date and address of the employee(s) whose name is
-- ‘<NAME>’. Retrieve the name and address of all employees who
-- work for the ‘Research’ department.
Select bdate, address from employee where fname='John' and minit='B' and lname='Smith';
Select fname, minit, lname, address ... |
<reponame>DavidWiseman/dba-dash
SELECT instance_id,
job_id,
step_id,
step_name,
sql_message_id,
sql_severity,
message,
run_status,
run_date,
run_time,
run_duration,
operator_id_emailed,
operator_id_netsent,
operator_id_paged,
retries_attempted,
server
FROM msdb.dbo.sysjobhistory
WHERE ins... |
<filename>DB/seed.sql
INSERT INTO department (department_id, name)
VALUES (1, "Engineering");
INSERT INTO department (department_id, name)
VALUES (2, "Sales");
INSERT INTO department (department_id, name)
VALUES (3, "Analyist");
INSERT INTO department (department_id, name)
VALUES (4, "Customer Service");
INSERT INT... |
-- 2019-03-02T14:35:46.475
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET InternalName='DataEntry_Field ',Updated=TO_TIMESTAMP('2019-03-02 14:35:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=540572
;
-- 2019-03-02T14:37:44.501
-- I forgot to set the DICTIONARY_ID... |
<reponame>z201/code-example
-- 创建数据库
CREATE DATABASE `docker_app` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
DROP TABLE IF EXISTS job_offers;
CREATE TABLE job_offers (
id SERIAL PRIMARY KEY,
job_title VARCHAR(255),
pub_date VARCHAR(255)
);
SELECT j.job_title, j.pub_date FROM job_offers AS j
ORDER BY j.pub_date DESC;
DELETE FROM job_offers; |
-- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: localhost Database: bookrecommend
-- ------------------------------------------------------
-- Server version 5.6.44-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... |
<reponame>toringerhartCAMM/czi2tiff
CREATE SCHEMA "Microscopy";
CREATE TABLE "Microscopy"."Species"
(
"ID" text PRIMARY KEY,
"Code" text NOT NULL
);
CREATE TABLE "Microscopy"."Age"
(
"ID" text PRIMARY KEY,
"Code" text NOT NULL
);
CREATE TABLE "Microscopy"."Tissue"
(
"ID" text PRIMARY ... |
CREATE TABLE cargo
(
codigo INT NOT NULL,
nome VARCHAR(50),
salario INT NOT NULL,
);
INSERT INTO cargo VALUES (01,'Advogado','3000,00')
INSERT INTO cargo VALUES (02,'Analista de Sistemas',4000,00)
INSERT INTO cargo VALUES (03,'Contador',1000,00)
INSERT INTO cargo VALUES (04,'Engenheiro',4000,00)
INSERT INTO cargo VA... |
CREATE TABLE INDEX_TEST2 (
INDEX_TEST2_ID BIGINT NOT NULL,
SUB_ID_1 BIGINT NOT NULL,
SUB_ID_2 BIGINT NOT NULL
);
COMMENT ON table INDEX_TEST2 is 'INDEX_TEST2';
COMMENT ON column INDEX_TEST2.INDEX_TEST2_ID is 'INDEX_TEST2_ID';
COMMENT ON column INDEX_TEST2.SUB_ID_1 is 'SUB_ID_1';
COMMENT ON column INDEX_TEST2.SUB_... |
<gh_stars>1-10
alter table analytics_invoice_items add usage_name varchar(255) default null after slug;
|
-- Table 'analysis_execution'
CREATE SEQUENCE ${ohdsiSchema}.analysis_execution_sequence;
GO
ALTER TABLE ${ohdsiSchema}.analysis_execution ADD id_tmp INT;
GO
UPDATE ${ohdsiSchema}.analysis_execution SET id_tmp = id;
GO
IF OBJECT_ID('${ohdsiSchema}.pk_analysis_exec', 'PK') IS NOT NULL
ALTER TABLE ${ohdsiSchema}.analy... |
<gh_stars>10-100
create table region2.sales_period_1
(
id uniqueidentifier default newid() not null
constraint sales_period_1_pk
primary key nonclustered,
amount money default 0,
location nvarchar(100),
stamp datetime default getdate()
) |
<filename>sql/_26_features_920/issue_9405_ro_locale/_03_string_func/cases/_007_mid.sql
--+ holdcas on;
set names utf8;
CREATE TABLE test_ro (
id int NOT NULL,
name VARCHAR(20) collate utf8_ro_cs);
insert into test_ro values (1, 'Scuzați-mă!');
insert into test_ro values (2, 'Cât costă?');
insert in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.