sql stringlengths 6 1.05M |
|---|
<reponame>guihome-diaz/travel-history-generator
-- Specific Oracle PL/SQL code
-- Indexes (performances). Use "UPPER" or "LOWER" for items that must be unique no matter the case
CREATE INDEX LABELS_CODE_IDX ON LABELS (UPPER(CODE));
CREATE INDEX LABELS_ACTIVE_CODE_IDX ON LABELS (UPPER(CODE), IS_ACT... |
<reponame>axel80/mobileLaravelTest<filename>mobile-db.sql
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 21-02-2017 a las 21:21:04
-- Versión del servidor: 5.7.16-0ubuntu0.16.04.1
-- Versión de PHP: 7.1.1-1+deb.sury.org~xenial+1
SET ... |
-- Schema for eatdaburger db
create database if not exists burgers_db;
use burgers_db;
create table burgers (
id int not null auto_increment,
burger_name varchar(100) not null,
devoured bool default false,
time_stamp timestamp default current_timestamp,
primary key (id)
);
|
CREATE TABLE [dbo].[WebsiteDomains] (
[websiteId] INT NOT NULL,
[domain] NVARCHAR (50) NOT NULL,
[datecreated] DATETIME NOT NULL,
[googletoken] VARCHAR (MAX) NULL,
[googleprofileId] VARCHAR (20) NULL,
[googlewebpropertyId] VARCHAR (20) ... |
BEGIN;
CREATE TABLE IF NOT EXISTS user (
id VARCHAR(150) PRIMARY KEY,
full_name TEXT NOT NULL,
display_name TEXT NOT NULL,
member_since TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS user_token (
user_id VARCHAR(150) PRIMARY KEY,
access_token TEXT NOT NULL,
... |
-- phpMyAdmin SQL Dump
-- version 5.1.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 18, 2022 at 07:14 AM
-- Server version: 5.7.33
-- PHP Version: 7.4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
<reponame>JohnPKosh/IODataBlock
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, 2012 and Azure
-- --------------------------------------------------
-- Date Created: 08/30/2016 09:31:00
-- Generated from EDMX file: C:\Users\jkosh\Source\Repos\IODataBlock\I... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 21-12-2020 a las 16:03:54
-- Versión del servidor: 10.4.17-MariaDB
-- Versión de PHP: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
CREATE TABLE [ssas].[TMSCHEMA_EXTENDED_PROPERTIES] (
[databasename] NVARCHAR (128) CONSTRAINT [DF_TMSCHEMA_EXTENDED_PROPERTIES_databasename] DEFAULT (N'mydatabase') NOT NULL,
[ID] NUMERIC (20) NOT NULL,
[ObjectID] NUMERIC (20) NOT NULL,
[ObjectType] INT NOT NULL,
[Nam... |
CREATE IF NOT EXISTS DATABASE MercadosNL;
CREATE TABLE IF NOT EXISTS Nota_Fiscal (
codigo serial NOT NULL,
data_nota_fiscal DATE NOT NULL,
quantidade INTEGER NOT NULL,
nome_supermercado VARCHAR(40) NOT NULL,
PRIMARY KEY(codigo)
);
CREATE TABLE IF NOT EXISTS Funcionario (
idFuncionario serial NOT NULL,
N... |
-- GPI - <NAME>
-- Desc: overview over a container database
-- Date: 25.October 2018
-- => https://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13939
--==============================================================================
set linesize 130 pagesize 300
SHOW CON_NAME
-- check if CDB
... |
/* Replace with your SQL commands */
ALTER TABLE water_import.charge_agreements
ALTER COLUMN charge_agreement_id TYPE uuid USING charge_agreement_id::uuid;
ALTER TABLE water_import.charge_elements
ALTER COLUMN charge_element_id TYPE uuid USING charge_element_id::uuid;
ALTER TABLE water_import.charge_versions
ALTER CO... |
DROP TABLE IF EXISTS `pages`;
CREATE TABLE `pages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`subject_id` int(11) DEFAULT NULL,
`menu_name` varchar(255) DEFAULT NULL,
`position` int(3) DEFAULT NULL,
`visible` tinyint(1) DEFAULT NULL,
`content` text,
PRIMARY KEY (`id`),
KEY `fk_subject_id` (`subject_id`)
)... |
SET NOCOUNT ON
IF NOT EXISTS (SELECT AG.name AS [AvailabilityGroup]
FROM master.sys.availability_groups AS AG
LEFT OUTER JOIN master.sys.dm_hadr_availability_group_states as agstates
ON AG.group_id = agstates.group_id
INNER JOIN master.sys.availability_rep... |
ALTER ROLE [db_owner] ADD MEMBER [admin]
GO
|
:CONNECT <server_name, sysname, SQL_Server_Instance>
USE Finance
GO
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SELECT name AS index_name,
STATS_DATE(OBJECT_ID, index_id) AS StatsUpdated
FROM sys.indexes
WHERE OBJECT_ID = OBJECT_ID('GL.DailyGLAccruedInterest')
GO |
<filename>calaccess_processed_filings/sql/load_form496part2itemversion_model.sql
INSERT INTO calaccess_processed_filings_form496part2itemversion (
filing_version_id,
line_item,
expense_date,
amount,
transaction_id,
payment_description,
memo_code,
memo_reference_number
)
SELECT
filing... |
<filename>mysql/timesheet-migration.sql
INSERT INTO `finance-angular`.`timesheets`(
`id`,
`timesheetInsertedBy`,
`timesheetEmployer`,
`timesheetStartDate`,
`timesheetEndDate`,
`timesheetTimeIn`,
`timesheetTimeOut`,
`timesheetTimeBreak`,
`timesheetHourly`,
`timesheetTotal`,
`timesheetTotalHours`,
... |
UPDATE Payments
SET Taxrate-=0.3
SELECT Taxrate FROM Payments |
<reponame>TheHLW/ceshi
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50553
Source Host : localhost:3306
Source Database : yzncms
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2018-10-08 13:15:14
*/
SET ... |
CREATE OR REPLACE TRIGGER "CF_PW_CHANGE"
BEFORE update OR INSERT ON cf_users
FOR EACH ROW
BEGIN
IF :new.password != :<PASSWORD> THEN
:new.pw_change_date := SYSDATE;
END IF;
END;
ALTER TRIGGER "CF_PW_CHANGE" ENABLE |
<gh_stars>0
BEGIN;
CREATE FUNCTION check_password(uname TEXT, pass TEXT) ... SECURITY DEFINER;
REVOKE ALL ON FUNCTION check_password(uname TEXT, pass TEXT) FROM PUBLIC;
GRANT EXECUTE ON FUNCTION check_password(uname TEXT, pass TEXT) TO admins;
COMMIT;
|
<filename>test.sql
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3308
-- Généré le : mer. 23 sep. 2020 à 15:34
-- Version du serveur : 5.7.28
-- Version de PHP : 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00... |
<reponame>konstapascal/noroff-assignment-2
USE [SuperheroesDb];
ALTER TABLE [dbo].[Assistant]
ADD [SuperheroId] int
CONSTRAINT [SuperheroId]
FOREIGN KEY ([SuperheroId]) REFERENCES [dbo].[Superhero] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION; |
<filename>DB/Sql_files/stored procedures.sql
/*EDIT 1*/
/*extract_details to extract info*/
/*AuthenticateUser2 to authenticate user*/
/*Inscpt to insert captcha for registered user*/
/*Retriving User Details*/
DELIMITER $$
USE health_management_system $$
CREATE PROCEDURE extract_details(
IN id varchar(20) ,
OUT ... |
DROP TABLE IF EXISTS `test_147`; |
update drugcode set map = 0 where map not in (select id from sync_drug WHERE Active = 1)// |
<reponame>java-scott/PersonalPractice<gh_stars>0
CREATE TABLE `typecho_robots_logs` (
`lid` int(10) unsigned NOT NULL auto_increment,
`bot` varchar(16) default NULL,
`url` varchar(64) default NULL,
`ip` varchar(16) default NULL,
`ltime` int(10) unsigned default '0',
PRIMARY KEY (`lid`)
) ENGINE=MYISAM DEF... |
create table stock (
id int not null auto_increment primary key,
extra_data json
);
select * from stock;
insert into stock(extra_data) values
('{"name": "Apple", "total_price": 25, "details": {"quantity": 5, "discounted_price": 5}}'),
('{"name": "Orange", "total_price": 10, "details": {"quantity": 2, "old_price... |
DROP DATABASE lechuapp;
CREATE DATABASE lechuapp;
USE lechuapp;
CREATE TABLE client;
CREATE TABLE client_detail;
CREATE TABLE order;
CREATE TABLE product;
CREATE TABLE category; |
<reponame>adamribaudo-velir/dbt-ga4
{%- macro unpack_struct(column_to_unpack, fields) -%}
{% for field in fields %}
{{column_to_unpack}}.{{field}} as {{column_to_unpack}}_{{field}} {% if not loop.last %},{% endif %}
{% endfor %}
{%- endmacro -%} |
<filename>database/scripts/updates/fase_3/16_NuevoDisenoOrdenVenta/1_altert_tbl_order.sql<gh_stars>0
USE `bitel_ecommerce`;
ALTER TABLE tbl_order DROP FOREIGN KEY fk_tbl_order_tbl_district_billing;
ALTER TABLE tbl_order DROP INDEX fk_tbl_order_tbl_district01_idx;
ALTER TABLE tbl_order MODIFY COLUMN billing_phone VARCH... |
<filename>amcol.sql
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 24, 2021 at 03:55 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";
/*!40101 SET @OLD... |
-- file:opr_sanity.sql ln:1009 expect:true
SELECT a.aggfnoid, p.proname
FROM pg_aggregate as a, pg_proc as p
WHERE a.aggserialfn = p.oid AND
(p.prorettype != 'bytea'::regtype OR p.pronargs != 1 OR
p.proargtypes[0] != 'internal'::regtype OR
NOT p.proisstrict)
|
-- 2017-06-07T16:08:27.672
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-06-07 16:08:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542479
;
-- 2017-06-07T16:08:27.674
-- I forgot to set the DICT... |
-- Create temp table to reload into the subawards table without dropping the destination table
DROP TABLE IF EXISTS public.temporary_restock_subaward;
CREATE TABLE public.temporary_restock_subaward AS (
SELECT
to_tsvector(CONCAT_WS(' ', broker_subawards.recipient_name, psc.description, broker_subawards.de... |
-- /packages/intranet-helpdesk/sql/postgresql/intranet-helpdesk-callbacks.sql
--
-- Copyright (c) 2003-2008 ]project-open[
--
-- All rights reserved. Please check
-- http://www.project-open.com/license/ for details.
--
-- @author <EMAIL>
-- Set the queue for the given ticket
--
create or replace function im_ticket__s... |
CREATE TABLE grp_user (
id integer NOT NULL PRIMARY KEY auto_increment,
userid text NOT NULL,
password text NOT NULL,
password_default text NOT NULL,
realname text NOT NULL,
authority text NOT NULL,
user_group integer,
user_groupname text,
user_email text,
user_code text,
user_skype text,
user_ruby text,
user_postcode... |
<gh_stars>0
-- DB structure
CREATE DATABASE IF NOT EXISTS ${artifactId} CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
USE ${artifactId};
-- ----------------------------
-- Table structure for sys_t_app_info
-- ----------------------------
CREATE TABLE IF NOT EXISTS `sys_t_app_info` (
`APP_ID` bigint(20) NOT NULL AUTO_INCRE... |
<reponame>GeorgeKirev/OpenOLAT
-- grading
alter table o_grad_time_record add g_metadata_time number(20) default 0 not null;
|
CREATE TABLE customer (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR NOT NULL,
status INTEGER NOT NULL,
segment INTEGER NOT NULL,
birth_no VARCHAR,
reg_no VARCHAR,
tax_no VARCHAR,
create_date DATETIME,
modify_date DATETIME,
FOREIGN KEY (status) REFERENCES lov_status(id),
FOREIGN KEY (segment... |
ALTER TABLE user_profile DROP COLUMN account_administered;
ALTER TABLE group_profile DROP COLUMN paid_for;
DROP TABLE paid_account;
DROP TABLE paid_group; |
<reponame>Zhaojia2019/cubrid-testcases
--test numeric data type by comparing operators like '=','>','<' in where clause and plus(+) symbol in select clause
create class func_01 ( a smallint, b int, c numeric(38,10), d float, e monetary, f double );
insert into func_01 values ( 0,0,0,0,0,0);
insert into func_01(a) val... |
select
restaurants.id,restaurants.name,restaurants.detail,restaurants.img,restaurants.lat,restaurants.ing,locations.name as location,genres.name as genre
from
restaurants
inner join locations on restaurants.location_id = locations.id
inner join genres on restaurants.genre_id = genres.id
where
restaurants.id = |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 28, 2020 at 10:35 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... |
CREATE TABLE clientes (
client_id serial PRIMARY KEY,
best_city_name1 varchar(255) ,
best_city_name2 varchar(255) ,
years integer ,
email varchar(255) ,
idioma varchar(255) ,
enviromental_score integer ,
transport varchar(50) ,
work_preference varchar(50) ,
place_score varchar(50... |
-- 12.31 storage engines
-- it determines how data is stored, features available to us
-- they are used at table levels, same db can have different storage engines
-- it's expensive, bcz table need be rebuilt
show engines;
alter table customers
engine = InnoDB;
|
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 05-04-2019 a las 07:42:01
-- Versión del servidor: 10.1.38-MariaDB
-- Versión de PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
<filename>municipal-services/firenoc-calculator/migration/ddl/V20190613105655__firenoc_calc_alter_drop_notnull.sql
ALTER TABLE eg_firenoc_billingslab ALTER COLUMN fromuom DROP NOT NULL;
ALTER TABLE eg_firenoc_billingslab ALTER COLUMN touom DROP NOT NULL;
ALTER TABLE eg_firenoc_billingslab ALTER COLUMN fromdate DROP NOT... |
<filename>db/schema.sql
CREATE TABLE schema_migrations (version text primary key);
CREATE TABLE account (
id integer primary key,
email text,
access_token text not null,
created_at integer not null default(strftime('%s', 'now')),
updated_at integer
, login text not null default '');
CREATE TABLE package (
i... |
<gh_stars>100-1000
IF db_id('soci_test') IS NULL BEGIN CREATE DATABASE [soci_test] END;
|
<filename>@api/db/migrations/committed/000069.sql
--! Previous: sha1:e697823e3c8178ed1aa4095792b331704066e97f
--! Hash: sha1:a4794b16db9f0b1c90958487d4867b95950e0f6b
--! split: 1-current.sql
-- Enter migration here
CREATE OR REPLACE VIEW public_check_ins AS
SELECT
id,
rating,
review,
item_id,
autho... |
<reponame>afermon/TuBus
CREATE TABLE [dbo].[TBL_TRANSACCION](
[TRANSACCION_ID] [int] IDENTITY(1,1) NOT NULL,
[MONTO] [int] NOT NULL,
[TIPO] [nvarchar](45) NOT NULL,
[CONCEPTO] [nvarchar](45) NOT NULL,
[ESTADO] [nvarchar](45) NOT NULL,
[TARJETA_ID] [nvarchar](50) NULL DEFAULT (NULL),
[LINEA_ID] [int] NULL DEFAUL... |
INSERT INTO library_mapping (
id, library_id,
ir_location_id, central_server_id)
VALUES ('07f97157-9cf9-44f2-b7aa-82e1f649cc83', '7c244444-ae7c-11eb-8529-0242ac130004',
'26f7c8c5-f090-4742-b7c7-e08ed1cc4e67', 'edab6baf-c696-42b1-89bb-1bbb8759b0d2'),
('2d57c159-8b05-4c3b-97d9-7ddf0ead17a3', '7f588... |
insert into customer(email) values('<EMAIL>');
insert into customer(email) values('<EMAIL>');
insert into customer(email) values('<EMAIL>');
insert into customer(email) values('<EMAIL>');
insert into customer(email) values('<EMAIL>');
insert into customer(email) values('<EMAIL>');
insert into customer(email) values('<E... |
<gh_stars>0
CREATE DATABASE IF NOT EXISTS `lambda` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `lambda`;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: lambda
-- ------------------------------------------------------
-- Server version 5.7.21-log
/*!40101 SET @OLD_CHARACTER_... |
CREATE INDEX IF NOT EXISTS idx_user_id_state ON shared.propertyproposal (user_id, state) |
-- 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.
-- We drop the telemetry function here since we have a non-telemetry
-- build and the function might exist.
DROP FUNCTION IF EXISTS @exts... |
<reponame>buzden/jirm
SELECT * from test_bean
WHERE stringProp like '%Adam%' -- {name}
LIMIT 1 -- {limit} |
CREATE TABLE {$NAMESPACE}_drydock.drydock_command (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
authorPHID VARBINARY(64) NOT NULL,
targetPHID VARBINARY(64) NOT NULL,
command VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT},
isConsumed BOOL NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT... |
<reponame>yinyuecheng1/code-org<filename>aws/redshift/functions/miles_from_lat_lng.sql<gh_stars>100-1000
-- takes two pairs of latitude/longitude and returns distance in miles between them.
CREATE FUNCTION miles_from_lat_lng (orig_lat float, orig_long float, dest_lat float, dest_long float)
RETURNS float
STABLE
AS ... |
-- migrations/1623858428-gateway_mode_rename.sql
-- :up
alter table gateways
drop column mode;
alter table gateway_inventory
drop column mode;
drop type if exists gateway_mode;
create type gateway_mode as enum (
'full',
'light',
'dataonly'
);
alter table gateways
add column mode gateway_mod... |
<reponame>Komzpa/postgrespro
\set VERBOSITY terse
CREATE EXTENSION pg_pathman;
CREATE SCHEMA fkeys;
/* Check primary keys generation */
CREATE TABLE fkeys.test_ref(comment TEXT UNIQUE);
INSERT INTO fkeys.test_ref VALUES('test');
CREATE TABLE fkeys.test_fkey(
id INT NOT NULL,
comment TEXT,
FOREIGN KEY (comment)... |
<gh_stars>1-10
-- COLUMN: msec -> when_msec
CREATE TABLE `{table}` (
`id` integer unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
`when` timestamp NOT NULL,
`when_msec` smallint NOT NULL DEFAULT 0,
`events` integer unsigned NULL,
`server` integer unsigned NULL,
`application` varchar(64) NOT NULL,
`context` ... |
<reponame>Nate-Wessel/modal-hierarchy
ALTER TABLE oxford_nodes ADD COLUMN geom geometry(POINT,4326);
UPDATE oxford_nodes SET geom = ST_SetSRID(
ST_MakePoint(lon/10000000.0,lat/10000000.0),
4326
); |
<filename>data-raw/sql/relationship.sql
CREATE TABLE relationship (
relationship_id VARCHAR(20) NOT NULL,
relationship_name VARCHAR(255) NOT NULL,
is_hierarchical VARCHAR(1) NOT NULL,
defines_ancestry VARCHAR(1) NOT NULL,
reverse_relationship_id VARCHAR(20) NOT NULL,
relationship_concept_id INTE... |
CREATE OR REPLACE TRIGGER DELETE_EMRPRESA
BEFORE DELETE ON EMPRESA_TRANSPORTES
FOR EACH ROW
BEGIN
INSERT INTO LOG_DELETE(DELETE_VALUES, TYPE, INSERT_AT)VALUES(''||
:old.ID||','||
:old.NOMBRE||','||
:old.TELEFONO||','||
:old.DIRECCION||','||
:old.CREATED_AT||','||
:old.UPDATED_AT, 'Empresa de Tansportes', ... |
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50726
Source Host : localhost:3306
Source Schema : admin_base
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 17/02/2021... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 15-Fev-2021 às 08:06
-- Versão do servidor: 10.4.11-MariaDB
-- versão do PHP: 7.3.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
<filename>exps/news_seed_popularity/create_tbl.sql
-- The sql creates tables used for the analysis in this folder.
CREATE TABLE news_source (
site_name varchar(50),
url varchar(50),
twitter_handle PRIMARY KEY,
follower_number integer,
leaning varchar(10),
sort integer
twitter_id varc... |
-- Query for: 2. Spaced Used
SELECT DB_NAME() AS DbName,
name AS FileName,
type_desc,
size/128.0 AS CurrentSizeMB,
size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS INT)/128.0 AS FreeSpaceMB
FROM sys.database_files
WHERE type IN (0,1);
|
<gh_stars>10-100
-- file:btree_index.sql ln:77 expect:true
insert into btree_tall_tbl
select g, g::text || '_' ||
(select string_agg(md5(i::text), '_') from generate_series(1, 50) i)
from generate_series(1, 100) g
|
<gh_stars>0
/*
Warnings:
- You are about to drop the column `workspaceId` on the `Membership` table. All the data in the column will be lost.
- A unique constraint covering the columns `[workspaceSlug,userId]` on the table `Membership` will be added. If there are existing duplicate values, this will fail.
- Ad... |
<filename>docs/2014/snippets/tsql/SQL15/replication/howto/tsql/createmergepubdynamic3.sql<gh_stars>1-10
:setvar Login N'REDMOND\glenga'
:setvar Password N'<PASSWORD>'
--<snippetsp_MergeDynamicPubPartitionManual>
-- To avoid storing the login and password in the script file, the value
-- is passed into SQLCMD as ... |
select * from person;
select * from person where email = '<EMAIL>';
insert into donation(donationid, personid, amount, date)
values
(1,10,125.00, '10-14-2020')
insert into donation(donationid, personid, amount, date)
values
(2,11,200.00,'10-15-2020'),
(3,12,15.00,'10-15-2020'),
(4,13,135.00,'10-16-2020');
select * f... |
-- phpMyAdmin SQL Dump
-- version 4.7.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2017-12-04 12:17:06
-- 服务器版本: 5.7.18-log
-- PHP Version: 7.1.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<gh_stars>0
CREATE TABLE if not exists seller (id BIGINT auto_increment,fullName VARCHAR(500),username VARCHAR(500),password VARCHAR(500),address VARCHAR(500),age INT,email VARCHAR(500),phoneNumber VARCHAR(500)
,constraint seller_pk
primary key (id));... |
-----------------------------------------------------
-- UPLOADS TABLE
-----------------------------------------------------
CREATE TABLE upload
(
domain_id UUID NOT NULL,
event_UUID UUID NOT NULL,
event_type VARCHAR(200) NOT NULL,
event_time BIGINT NOT NULL,
event_body JSON,
... |
CREATE OR REPLACE PROCEDURE VER_TRABAJADOR IS
CURSOR CUR_TRABAJADOR IS
SELECT APELLIDO1, FECHANAC
FROM TRABAJADORES
ORDER BY APELLIDO1; --No puede ir en el begin porque devuelve mas de una fila
REG_TRABAJADOR CUR_TRABAJADOR%ROWTYPE;
... |
<reponame>michaelcw02/PrograIV<filename>II/Examen II/Sugerencias.sql
CREATE DATABASE Sugerencias;
USE Sugerencias;
create table usuario (
id varchar(20) not null primary key,
clave varchar(20) not null,
tipo integer
);
create table sugerencia(
id integer auto_increment not null primary key,
usuario varchar(2... |
<filename>mis001pg.session.sql
SELECT * FROM doc LIMIT 11;
|
<filename>src/benchmark/postgres/q13.sql
SELECT SUM(lo_revenue) AS revenue
FROM lineorder, ddate
WHERE lo_orderdate = d_datekey
AND d_weeknuminyear = 6
AND d_year = 1994
AND lo_discount BETWEEN 5 AND 7
AND lo_quantity BETWEEN 36 AND 40; |
<reponame>Edraak/code-dot-or
drop table if exists analysis.csf_plugged_stage_counts;
create table analysis.csf_plugged_stage_counts (
script_id int,
plugged_stage_counts int
);
insert into analysis.csf_plugged_stage_counts values
(1,9),
(17,11),
(18,11),
(19,14),
(23,12),
(236,5),
(237,6),
(238,9),
(239,12),
(240,8)... |
<gh_stars>0
-- //
--
-- Adiciona campo cdd e estante, na tabela acervo.
-- @author <NAME> <<EMAIL>>
-- @license @@license@@
-- @version $Id$
ALTER TABLE pmieducar.acervo ADD COLUMN cdd character varying(20);
ALTER TABLE pmieducar.acervo ADD COLUMN estante character varying(20);
-- //@UNDO
ALTE... |
517,153,0
539,10,0
562,811,0
575,144,0
628,95,0
638,342,0
650,7,0
664,44,0
681,42,0
475,1020,0
2505,1050,0
750,83,0
825,39,0
937,74,0
927,300,0
5055,32,0
951,46,0
491,540,0
497,260,0
511,1190,0
536,50,0
523,5,0
565,25,0
549,36,0
572,9,0
486,230,0
5060,15,0
499,16,0
525,250,0
535,39,0
584,35,0
560,15,0
5144,16,0
520,67,... |
DROP TABLE "reporting".symbol;
DROP TABLE "reporting".item;
DROP TABLE "reporting".item_type;
DROP TABLE "reporting".item_subtype;
DROP TABLE "reporting".item_child;
DROP TABLE "reporting".item_symbol;
-- Table: "reporting".item
CREATE TABLE "reporting".item
(
id bigserial,
name character varying(75),
tags ... |
CREATE OR REPLACE procedure NUCLEIC_ACID_SEQUENCE_13_LD as
BEGIN
INSERT INTO NUCLEIC_ACID_SEQUENCE(ID, ACCESSION_NUMBER, VERSION, SEQUENCE_TYPE, CLONE_ID, VALUE, LENGTH)
SELECT SEQUENCE_ID, ACCESSION_NUMBER, VERSION, SEQUENCE_TYPE, CLONE_ID, TO_LOB(ASCII_STRING), LENGTH from sequence
WHERE Sequence_ID > 600000... |
bitdata Bar where
b1 = 63 : uint 8 -- decimal values have to have a type if it isn't inferrable from the context
b2 = 64
bitdata Foo where
A = 0x42 -- unless otherwise noted, hex and binary literals have their natural width (i.e. 8 here)
B = { 0b11; x : uint 6 }
C = { b : Bar } -- other bitdata can... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint: opengauss关键字outer(保留),作为索引名,部分测试点合理报错
--前置条件,创建一个表
drop table if exists outer_test;
create table outer_test(id int,name varchar(10));
--关键字不带引号-合理报错
drop index if exists outer;
create index outer on outer_test(id);
--关键字带双引号-成功
drop index if exists "outer";
c... |
<filename>config/scripts/schema/migrations/2013-03-11 meetingrecord.sql
-- TAB-358
CREATE TABLE meetingrecord (
ID NVARCHAR2(255) NOT NULL,
RELATIONSHIP_ID NVARCHAR2(255) NOT NULL,
CREATION_DATE TIMESTAMP NOT NULL,
LAST_UPDATED_DATE TIMESTAMP NOT NULL,
CREATOR_ID NVARCHAR2(255) NOT NULL,
MEETING_DATE TIMESTAMP... |
-- 12.10 1NF first normal form
-- each cell should have a single value and we can't have repeted columns
-- course.tags column vilotes this rule, so we create seperate table for tags
|
<reponame>GaliFirmansyah/SIGLahanTuban
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 21, 2021 at 02:02 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 8.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";... |
<reponame>statisticspoland/VTL-Processing
CREATE SCHEMA [Analytic_invocation] |
<reponame>Terria028/SQLICTProg<filename>03-30-2022/scripts/color_script.sql
DECLARE
color CHAR(1) := 'r';
BEGIN
IF (color = 'r' OR color = 'R') THEN
DBMS_OUTPUT.PUT_LINE('Color is Red');
ELSIF (color = 'g' OR color = 'G') THEN
DBMS_OUTPUT.PUT_LINE('Color is Green');
ELSIF (color =... |
create table contatos (
id BIGINT NOT NULL AUTO_INCREMENT,
nome VARCHAR(255),
email VARCHAR(255),
endereco VARCHAR(255),
dataNascimento DATE,
primary key (id)
);
|
<filename>test/app/Config/Schema/schema.sql
-- phpMyAdmin SQL Dump
-- version 3.4.11.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 25, 2013 at 11:51 AM
-- Server version: 5.5.31
-- PHP Version: 5.4.6-1ubuntu1.2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Da... |
CREATE VIEW [dbo].[SexTypeScores] AS
SELECT TOP 100000
T.ZnoYear
,T.SexTypeName
,N
,AvgScore
,MedScore
,Exams
,FailedExams
,PassRate
FROM
(SELECT ZnoYear, SexTypeName
,COUNT(DISTINCT OutID) AS N
,AVG([Score]) AvgScore
,COUNT([Score]) AS Exams
,SUM(CAST([IsFailed] AS tinyint)) FailedE... |
<reponame>chaunceyau/nestjs-relay-demo<gh_stars>1-10
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL NOT NULL,
"email" TEXT NOT NULL,
"company_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Company" (
"id" SERIAL NOT NULL,
"title" TEXT NOT NULL,
PRIMARY KEY ("id... |
<reponame>jermiy/services-core
-- test_login_user_01
insert into core.core_settings(name, value)
values ('jwt_secret', '<KEY>'),
('subscription_interval', '1 month');
insert into platform_service.users(id, name, email, password)
values ('<PASSWORD>', 'test login user 01', '<EMAIL>', crypt('123456', gen... |
<gh_stars>0
connect SYS/change_on_install as SYSDBA
set echo on
spool C:\oracle\ora920\assistants\dbca\logs\interMedia.log
@C:\oracle\ora920\ord\im\admin\iminst.sql;
spool off
exit;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.