sql stringlengths 6 1.05M |
|---|
-- Extracting name, continent, population data from world table.
SELECT name, continent, population FROM world;
-- Querying countries that have a population of at least 200 million.
SELECT name FROM world
WHERE population >= 200000000;
-- per capita GDP for those countries with a population of at least 200 million.
S... |
<reponame>piougy/CzechIdMng
--
-- CzechIdM 10 Flyway script
-- BCV solutions s.r.o.
--
-- Enlarge properties for propjection and long running tasks.
-- empty on postgresql
|
<filename>Tickets DB/4/4/SQLQuery1.sql<gh_stars>1-10
DROP TABLE employee
GO
CREATE TABLE employee
(
employee_id char(6) NOT NULL PRIMARY KEY,
first_name varchar(20) NOT NULL,
last_name varchar(20) NOT NULL,
salary decimal(12,2) NOT NULL
)
GO
DROP TABLE employee_auditTrail
GO
CREATE TABLE employee_... |
<gh_stars>1-10
IF NOT EXISTS (select * from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='dbo' and TABLE_NAME='tabulardeploy') BEGIN
CREATE TABLE dbo.tabulardeploy(
id int IDENTITY(1,1) NOT NULL,
loadtime datetime NOT NULL,
username varchar(30) NOT NULL,
build int NULL, --jenkins build number for meta info, n... |
<reponame>danieldiamond/gitlab-analytics
{{ config({
"materialized": "view"
})
}}
{{ dbt_utils.union_relations(
relations=[ref('sheetload_ally_certificate'),
ref('sheetload_values_certificate'),
ref('sheetload_communication_certificate'),
ref('sheetload_ic_colla... |
set echo on
set autotrace on explain
set pagesize 50 linesize 250 trimspool on
--
-- Statement 1 : Create the Index
--
create index PO_DOCUMENT_INDEX
on %TABLE_NAME%(PO_DOCUMENT)
indextype is ctxsys.context
parameters('section group CTXSYS.JSON_SECTION_GROUP sync (on commit)')
/
--
-- Query 1 : Use... |
-- MySQL dump 10.13 Distrib 8.0.11, for Win64 (x86_64)
--
-- Host: localhost Database: stocktrading
-- ------------------------------------------------------
-- Server version 8.0.11
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... |
<gh_stars>100-1000
-- +up
ALTER TABLE `trades`
ADD COLUMN `order_id` BIGINT UNSIGNED NOT NULL;
-- +down
ALTER TABLE `trades`
DROP COLUMN `order_id`;
|
<reponame>rtmaggs/main-page
CREATE TABLE IF NOT EXISTS suspects (
suspect_id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
firstname VARCHAR(20) DEFAULT NULL,
lastname VARCHAR(20) DEFAULT NULL,
address VARCHAR(150) DEFAULT NULL,
dob VARCHAR(10) DEFAULT NULL,
eye_color VARCHA... |
---
--- Drop existing table
---
DROP TABLE IF EXISTS foo;
---
--- Create new table foo
---
CREATE TABLE foo(type INTEGER, prod VARCHAR, quantity NUMERIC);
---
--- Insert some value
---
INSERT INTO foo VALUES(1, 'Table', 100);
INSERT INTO foo VALUES(2, 'Chair', 250);
INSERT INTO foo VALUES(3, 'Bed', 300);
---
--- Sel... |
<filename>a01_PySpark/f01_Pyspark_Solution_to_SQL57ProblemsBook/resources/57-sql-problems/054.sql<gh_stars>0
with countries AS (
SELECT country FROM suppliers
UNION
SELECT country FROM customers
)
SELECT
c.country,
coalesce(count(sp.country),0) as totalsupliers,
coalesce(count(cp.country),0) as totalcustome... |
CREATE TABLE concept_relationship (
concept_id_1 INTEGER NOT NULL,
concept_id_2 INTEGER NOT NULL,
relationship_id VARCHAR(20) NOT NULL,
valid_start_date DATE NOT NULL,
valid_end_date DATE NOT NULL,
invalid_reason VARCHAR(1) NULL
)
;
GO
ALTER TABLE concept_relationship ADD CONSTRAINT fp... |
UPDATE BPM_CONF_NODE SET CONF_FORM=0 where id=2;
UPDATE BPM_CONF_NODE SET CONF_FORM=0 where id=12;
UPDATE BPM_CONF_NOTICE set template_code='arrival-assignee',notification_type='msg,email' where id=1;
UPDATE BPM_CONF_NOTICE set template_code='arrival-initiator',notification_type='msg,email' where id=2;
UPDATE BPM_CO... |
-- Inserting a UserVmManager permission on every PowerUser permission directly on a VM
INSERT INTO permissions (id, role_id, ad_element_id, object_id, object_type_id)
(SELECT uuid_generate_v1(),
'def00006-0000-0000-0000-def000000006',
ad_element_id,
object_id,
o... |
<reponame>samhanes/FSharp.Data.SqlClient<gh_stars>100-1000
--uncomment for design time testing
--DECLARE
-- @top AS BIGINT = 10,
-- @SellStartDate AS DATETIME = '2002-06-01'
SELECT TOP (@top) Name AS ProductName, SellStartDate
FROM Production.Product
WHERE SellStartDate > @SellStartDate |
DROP TABLE IF EXISTS `xcxmall_action_log`;
CREATE TABLE `xcxmall_action_log` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(45) NOT NULL DEFAULT '' COMMENT '操作记录描述',
`addtime` int(11) NOT NULL COMMENT '记录时间',
`admin_name` varchar(45) NOT NULL DEFAULT '' COMMENT '操作人姓名',
`admin_id` int(11)... |
<reponame>Ruslanuae/drillingauction.com
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 17, 2019 at 06:39 AM
-- Server version: 5.7.25
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `dril... |
<gh_stars>1-10
-- MODULE XTS717
-- SQL Test Suite, V6.0, Interactive SQL, xts717.sql
-- 59-byte ID
-- TEd Version #
-- AUTHORIZATION CTS1
SELECT USER FROM HU.ECCO;
-- RERUN if USER value does not match preceding AUTHORIZATION comment
ROLLBACK WORK;
-- date_time print
-- TEST:7017 SET SESSION ... |
--create sample database
USE [master]
GO
CREATE DATABASE Sales
GO
USE [SALES]
GO
CREATE TABLE CUSTOMER([CustomerID] [int] NOT NULL, [SalesAmount] [decimal] NOT NULL)
GO
INSERT INTO CUSTOMER (CustomerID, SalesAmount) VALUES (1,100),(2,200),(3,300)
--change recovery model and take full backup for db to meet requirement... |
<reponame>FDT2k/bia-manager
CREATE TABLE IF NOT EXISTS mesures (
id INTEGER PRIMARY KEY AUTOINCREMENT,
subject_id INTEGER,
mesure_id INTEGER,
date TEXT,
examinator TEXT,
height FLOAT,
weight FLOAT,
bmi FLOAT,
left_side INTEGER,
machine TEXT,
smoker INTEGER,
bmi_ref FLOAT,
... |
<gh_stars>0
-- Query the two cities in STATION with the shortest and longest CITY names,
-- as well as their respective lengths (i.e.: number of characters in the name).
-- If there is more than one smallest or largest city, choose the one that comes
-- first when ordered alphabetically.
SELECT CITY,
length(CIT... |
<filename>CPP/2017-09/task3.sql
CREATE TABLE classes(
class VARCHAR(64) NOT NULL,
type ENUM("bb", "bc") NOT NULL,
country VARCHAR(64) NOT NULL,
numguns INT,
bore INT,
displacement INT,
PRIMARY KEY (class)
);
CREATE TABLE ships(
name VARCHAR(64) NOT NULL,
class VARCHAR(64) NOT NULL,
... |
<filename>Database_Basics_MySQL_Exam_21_Oct_2018/Get_Colonists_Count_15.sql
CREATE FUNCTION udf_count_colonists_by_destination_planet (planet_name VARCHAR (30))
RETURNS INT
DETERMINISTIC
BEGIN
RETURN
(SELECT
COUNT(`c`.`id`)
FROM `planets` AS `p`
JOIN `spaceports` AS `sp` ON `p`.`id` = `sp`.`planet_id`
JOIN `journeys`... |
<filename>03. Built-in Functions/05.sql
SELECT Name FROM Towns
WHERE LEN(Name) IN (5,6)
ORDER BY Name ASC |
<reponame>Iogsothot/database<filename>ironalex/data.sql
insert into "event_priority" ("priority_name", "priority_description")
values ('global', 'Общесистемные уведомления')
, ('low', 'Уведомление низкого приоритета')
, ('medium', 'Уведомление среднего приоритета')
, ('high', 'Уведомление... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Gegenereerd op: 17 jul 2018 om 12:43
-- Serverversie: 10.1.26-MariaDB
-- PHP-versie: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
<reponame>etandinnerman/jct-discord-bot
SELECT DISTINCT people.id
FROM people
INNER JOIN person_category ON people.id = person_category.person
INNER JOIN categories ON person_category.category = categories.id
WHERE categories.channel = %(channel_id)s |
<reponame>marvinsteb/proyectoSFA
-- DROP TRIGGER vehiculoaduanerostatus;
DELIMITER |
CREATE TRIGGER vehiculoaduanerostatus BEFORE INSERT ON aduaneroe
FOR EACH ROW BEGIN
update vehiculo
set
vehiculo.estado = 4,
vehiculo.costo = vehiculo.costo + new.total
where vehiculo.idvehiculo = new.idvehiculo;... |
-- misc5.test
--
-- execsql {SELECT .4e+1}
SELECT .4e+1 |
SELECT * FROM checkins WHERE team_id = :team_id ORDER BY time DESC LIMIT 1
SELECT SUM(amount) FROM donations
SELECT * FROM donations WHERE team_id = :team_id AND time > :since_time
SELECT * FROM users WHERE email = :email
SELECT * FROM checkins WHERE team_id = :team_id ORDER BY time DESC
SELECT * FROM donations LIMIT 1... |
<gh_stars>100-1000
select b.book_id, b.name
from (select * from Orders where dispatch_date > date_add('2019-06-23', interval -1 year)) a
right join Books b
on a.book_id = b.book_id
where b.available_from < date_add('2019-06-23',interval -1 month)
group by b.book_id, b.name
having coalesce(sum(quantity), 0) < 10
order b... |
INSERT INTO HOUSE(DISTRICT, STREET, NUM, TYPE, NUM_OF_FLOORS, SERIES)
VALUES('Diamond District', '47th str.', 17, 'panel', 9, '9a815-91da');
INSERT INTO HOUSE(DISTRICT, STREET, NUM, TYPE, NUM_OF_FLOORS, SERIES)
VALUES('Brooklyn', 'Coney Island avn.', 42, 'panel', 5, '1fa15-67da');
INSERT INTO HOUSE(DISTRICT, ... |
:r ./InsertOrderStatuses.sql
:r ./InsertCatalogueItemTypes.sql
:r ./InsertCataloguePriceTypes.sql
:r ./InsertProvisioningTypes.sql
:r ./InsertTimeUnits.sql
|
{{
config(
materialized='incremental',
unique_key='snowflake_query_id'
)
}}
WITH source AS (
SELECT *
FROM {{ source('snowflake','query_history') }}
QUALIFY ROW_NUMBER() OVER (PARTITION BY query_id ORDER BY query_id) = 1
), renamed AS (
SELECT
query_id AS snowflake... |
SELECT (NEXT VALUE FOR sekwenzia); |
<reponame>inquisitive-stha/backpack-demo-own
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 26, 2017 at 01:10 PM
-- Server version: 10.1.24-MariaDB
-- PHP Version: 7.1.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
... |
#Criação de associaco entre palavra de origem producao
CREATE TABLE pg_fundo_setorial (
id int(11) NOT NULL AUTO_INCREMENT,
dsc_demanada varchar(600),
dsc_demanada_tag varchar(800),
dsc_grande_area varchar(255),
dsc_area varchar(255),
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=933377 DEFAULT CHARSE... |
PRINT 'ALERTS' FROM BEGINNING LIMIT 3;
|
<reponame>yurtseven/CinemaDatabase
use veritabani;
go
create procedure sp_subeye_gore_salon_ekle
@salon_sube_id int,
@salon_adi text
as
begin
insert into tbl_salonlar(salon_sube_id,salon_adi) values (@salon_sube_id, @salon_adi)
end
go
exec sp_subeye_gore_salon_ekle 1,'Salon 4' |
CREATE FUNCTION func465() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE265);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE217);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE449);val:=(SELECT COUNT(*)INTO MYCOU... |
/*
* Copyright (c) 2017 LabKey Corporation
*
* 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... |
Create or replace FUNCTION __temp_add_gluster_services_tables() returns void
AS $procedure$
BEGIN
-- Service Types
CREATE TABLE gluster_service_types
(
service_type VARCHAR(100) NOT NULL,
CONSTRAINT pk_gluster_service_types PRIMARY KEY(service_type)
) WITH OIDS;
-- Services ( There ... |
CREATE TABLE reserved_crate_names (
name TEXT PRIMARY KEY
);
CREATE UNIQUE INDEX ON reserved_crate_names (canon_crate_name(name));
INSERT INTO reserved_crate_names (name) VALUES
('alloc'), ('arena'), ('ast'), ('builtins'), ('collections'),
('compiler-builtins'), ('compiler-rt'), ('compiletest'), ('core'), (... |
<gh_stars>0
SELECT
oid as conoid, conname, contype,
BTRIM(substring(pg_get_constraintdef(oid, true) from '\(.+\)'), '()') as consrc,
connoinherit, convalidated, conislocal
FROM
pg_constraint
WHERE
conrelid={{foid}}::oid
ORDER by conname;
|
<filename>data/sql/tasks.sql
DROP TABLE IF EXISTS `tasks`;
CREATE TABLE `tasks` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`status` TEXT NOT NULL DEFAULT 'stop',
`name` TEXT DEFAULT NULL,
`date_start` DATETIME DEFAULT NULL,
`date_end` DATETIME DEFAULT NULL,
`external_value` TEXT DEFAULT NULL
);
|
<filename>openGaussBase/testcase/GUC/CLIENTCONNECTION/Opengauss_Function_Guc_ClientConnection_Case0117.sql
-- @testpoint: 使用set方法设置max_compile_functions参数值,合理报错
--查看默认
show max_compile_functions;
--设置,报错
set max_compile_functions to 1; |
-- Show the script for system_health: C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Install\u_tables.sql, Line 131
-- View the system_health information in the ring buffer using the GUI
-- View the system_health information in the XEL file using the GUI
-- Show the available targets
-- Query s... |
DROP TABLE IF EXISTS marketplace_images;
DROP TABLE IF EXISTS marketplace_items;
DROP TABLE IF EXISTS marketplace_categories;
DROP TABLE IF EXISTS marketplace_textbooks;
CREATE TABLE marketplace_textbooks (
textbook_id INT NOT NULL AUTO_INCREMENT,
textbook_title VARCHAR(191) NOT NULL,
textbook_author VARCHAR(191) N... |
select *
from "tech_stack"."dbt"."station_metadata"
where ID is null
|
<filename>fdb-sql-layer-core/src/test/resources/com/foundationdb/sql/optimizer/group/semi-1.sql
-- I know none of these are grouped, but
SELECT t1.c1, t1.c2 FROM t1 WHERE EXISTS (
SELECT 1 FROM t2, t3
WHERE t1.c1 = t2.c1 AND t3.c1 = t2.c3 AND t3.c2 = 'n3')
ORDER BY t1.c2;
|
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 22, 2018 at 06:28 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... |
DROP TABLE UserDLC;
DROP TABLE UserGame;
DROP TABLE GameTag;
DROP TABLE Tag;
DROP TABLE DLC;
DROP TABLE Game;
DROP TABLE Developer;
DROP TABLE [User];
select * from Developer;
CREATE TABLE [User](
UserName NVARCHAR(100),
FirstName NVARCHAR(100),
LastName NVARCHAR(100),
Password NVARCHAR(100) NOT NULL,
Wallet MO... |
<reponame>thomoncik/railway-management
IF OBJECT_ID('get_train_departure_station') IS NOT NULL DROP FUNCTION get_train_departure_station
GO
CREATE FUNCTION get_train_departure_station(
@train_id VARCHAR(16)
)
RETURNS INT
AS
BEGIN
DECLARE @departure_station_id INT;
SET @departure_station_id = CONVERT(IN... |
<filename>afu_geologie_pub/afu_geologie_pub_holoz.sql
SELECT * FROM (
SELECT
holoz.ogc_fid AS t_id,
holoz.wkb_geometry AS geometrie,
holoz.neuer_code,
holoz.layercode,
holoz.system,
holoz.system1,
codes_system1.code_text AS system_txt,
holoz.system2,
holoz.serie,
holoz.s... |
USE DATABASE hasettDev;
CREATE TABLE IF NOT EXISTS users(
u_id VARCHAR (100) NOT NULL,
first_name VARCHAR (100),
last_name VARCHAR (100),
email_address VARCHAR (255) NOT NULL UNIQUE,
username VARCHAR (255) NOT NULL UNIQUE,
profile_picture VARCHAR (255),
header_picture VARCHAR (255),
si... |
CREATE TABLE [dbo].[Node_ImpError] (
[NODE_ID] INT NULL,
[X] DECIMAL (9, 7) NULL,
[Y] DECIMAL (9, 7) NULL,
[Z] DECIMAL (10, 2) NULL,
[ErrorCode] INT NULL,
[ErrorColumn] INT NULL
);
|
<gh_stars>100-1000
-- pragma.test
--
-- db eval {CREATE TEMP TABLE IF NOT EXISTS a(b)}
CREATE TEMP TABLE IF NOT EXISTS a(b) |
-- file:money.sql ln:14 expect:true
SELECT 2 * m FROM money_data
|
<filename>src/test/resources/sql/select/2af5b867.sql
-- file:json.sql ln:462 expect:true
SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q
|
call _create_array(@array_id);
call _set_array_element(@array_id, 'name', 'shushu');
call _set_array_element(@array_id, 'age', '11');
call _get_array_element(@array_id, 'name', @name);
call _get_array_element(@array_id, 'age', @age);
SELECT @name = 'shushu' and @age = '11';
|
\i 0001/env/schema.sql
\i 0001/clean.sql
\i 0001/extensions.sql
\i 0001/test/schema.sql
\i 0001/mesh/schema.sql
\i 0001/social/schema.sql
\i 0001/security/schema.sql
|
<filename>5 - SUM and COUNT/q4.sql
SELECT COUNT(1)
FROM world
WHERE area >= 1000000
|
<filename>python/sql/Tables/dbo.UserAccount.sql
CREATE TABLE [dbo].[UserAccount]
(
[USER_ID] [int] NOT NULL IDENTITY(1, 1),
[Email] [varchar] (50) COLLATE Latin1_General_100_CI_AI NOT NULL,
[MEMBER_ID] [int] NULL,
[Agency] [char] (3) COLLATE Latin1_General_100_CI_AI NULL,
[OrgName] [varchar] (150) COLLATE Latin1_Genera... |
<filename>t/fixtures/foreign-key-field/pg.sql
DROP TABLE IF EXISTS address_types;
CREATE TABLE address_types (
address_type_id SERIAL PRIMARY KEY,
address_type VARCHAR(20) NOT NULL
);
DROP TABLE IF EXISTS cities;
CREATE TABLE cities (
city_id SERIAL PRIMARY KEY,
city_name VARCHAR(255) NOT NULL,
cit... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Дек 15 2020 г., 21:40
-- Версия сервера: 8.0.19
-- Версия PHP: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA... |
-- @testpoint: opengauss关键字value(非保留),作为游标名,部分测试点合理报错
--前置条件
drop table if exists explain_test cascade;
create table explain_test(cid int,fid int);
--关键字不带引号-成功
start transaction;
cursor value for select * from explain_test order by 1;
close value;
end;
--关键字带双引号-成功
start transaction;
cursor "value" for select * fro... |
elapsedtime on;
--./bin/snappy run -file=./experiment/example.sql --client-bind-address=en4119507l.cidse.dhcp.asu.edu
--connect client 'en4119507l.cidse.dhcp.asu.edu:1527';
--------------------------------------
--------------------------------------
--- CREATE SAMPLE TABLE ---
CREATE SAMPLE TABLE NYCTAXI_SAMPLE ON NYC... |
INSERT INTO `Dependency` (`employeeSIN`,`dependentSIN`) VALUES (1,2001);
INSERT INTO `Dependency` (`employeeSIN`,`dependentSIN`) VALUES (2,2002);
INSERT INTO `Dependency` (`employeeSIN`,`dependentSIN`) VALUES (3,2002);
INSERT INTO `Dependency` (`employeeSIN`,`dependentSIN`) VALUES (4,2004);
INSERT INTO `Dependency` (`e... |
<filename>db/seeds.sql
use employee_db;
INSERT INTO department
(name)
VALUES
('Sales'),
('Engineering'),
('Finance'),
('Legal');
INSERT INTO role
(title, salary, department_id)
VALUES
('Sales Lead', 100000, 1),
('Salesperson', 80000, 1),
('Lead Engineer', 150000, 2),
('Software... |
<filename>toko_buah.sql
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.58.3
-- Generation Time: 11 Feb 2019 pada 12.23
-- Versi Server: 10.1.25-MariaDB
-- PHP Version: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:0... |
<filename>PostgreSQL-Queries/Database Managment/custom_data_type-and_domain.sql<gh_stars>0
CREATE DOMAIN Rating SMALLINT CHECK (
VALUE > 0 AND VALUE <= 5
);
CREATE TYPE Feedback AS (
student_id UUID,
rating Rating,
feedback TEXT
); |
<reponame>aalmada1982/Microsoft-DAT201x-SQL-Server
-- Lab 9: Modifying Data
/*
Inserting Products (1)
Each AdventureWorks product is stored in the SalesLT.Product table, and each product has a unique ProductID identifier,
which is implemented as an IDENTITY column in the SalesLT.Product table.
Products are orga... |
create table if not exists recruitments(
id serial primary key not null,
created_at timestamp not null,
updated_at timestamp not null,
deleted_at timestamp,
organization_id integer not null,
job_name varchar (255) not null,
description varchar (255) not null,
start_date timestamp not nul... |
<reponame>chanthavong/ci-hmvc-rest-api-jwt
create table books(
id int auto_increment,
code varchar(40),
name varchar(20) no null,
description varchar(255),
tag varchar(60),
created_at datetime DEFAULT CURRENT_TIMESTAMP,
updated_at datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
primary key(id)... |
<filename>db_masjid.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 26, 2018 at 10:27 AM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
<reponame>geophile/sql-layer
SELECT * FROM customers WHERE cid = ? |
<reponame>vchkhr/card-game<filename>sql/mock_data.sql
INSERT INTO players(login, password, fullName, emailUser) VALUE
('User1', 1, 'User', '<EMAIL>'),
('User2', 1, 'User', '<EMAIL>'),
('User3', 1, 'User', '<EMAIL>'),
('User4', 1, 'User', '<EMAIL>'),
('User5', 1, 'User', '<EMAIL>'),
('User6', 1, ... |
<filename>edcr/service/egov/egov-commons/src/main/resources/db/migration/main/V20190318195428__common_dcr_sub_feature_colorcode_rename_ddl.sql
alter table egdcr_additional_feature_colorcodes rename to egdcr_sub_feature_colorcode;
alter sequence seq_egdcr_additional_feature_colorcodes rename to seq_egdcr_sub_feature_co... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 26, 2020 at 11:29 AM
-- Server version: 8.0.19
-- PHP Version: 7.3.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... |
CREATE INDEX IF NOT EXISTS index6 ON message_content_derivation_table (derives) |
-- TABLES
CREATE TABLE IF NOT EXISTS `bx_videos_favorites_lists` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`author_id` int(11) NOT NULL default '0',
`date` int(11) NOT NULL default '0',
`allow_view_favorite_list_to` varchar(16) NOT NULL DEFAULT '3',
PRIMARY KEY (`id`)
)... |
<reponame>dram/metasfresh<filename>backend/de.metas.dlm/base/src/main/sql/postgresql/ddl/dlm/functions/update_partition_size.sql
CREATE OR REPLACE FUNCTION dlm.update_partition_size(p_DLM_Partition_ID numeric(10,0))
RETURNS VOID AS
$BODY$
BEGIN
UPDATE DLM_Partition p
SET PartitionSize=v.Size
FROM dlm.DLM_Partitio... |
ALTER TABLE db_version CHANGE COLUMN required_12112_01_mangos_spell_template required_12113_01_mangos_spell_template bit;
DELETE FROM spell_template WHERE id IN (34810, 34817, 34818, 34819, 35153, 35904, 35905, 35906);
INSERT INTO spell_template VALUES
(34810, 0x00000000, 101, 21, 28, 42, 8, 0, 20083, 64, 0... |
USE sentigram;
insert into `stoplist_indo_`(`stopword_`) values ('ada');
insert into `stoplist_indo_`(`stopword_`) values ('adakala');
insert into `stoplist_indo_`(`stopword_`) values ('adakalanya');
insert into `stoplist_indo_`(`stopword_`) values ('adalah');
insert into `stoplist_indo_`(`stopword_`) values ('a... |
-- create schemas
CREATE SCHEMA production;
go
CREATE SCHEMA sales;
go
-- create tables
CREATE TABLE production.categories (
category_id INT IDENTITY (1, 1) PRIMARY KEY,
category_name VARCHAR (255) NOT NULL
);
CREATE TABLE production.brands (
brand_id INT IDENTITY (1, 1) PRIMARY KEY,
brand_name VARCHAR (255) NOT NUL... |
DROP TABLE IF EXISTS enrolment;
DROP TABLE IF EXISTS student;
DROP TABLE IF EXISTS course;
CREATE TABLE student
(
id INTEGER PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(50),
last_name VARCHAR(50),
year INTEGER
);
CREATE TABLE course
(
id INTEGER PRIMARY KEY AUTO_INCREMENT,
... |
<reponame>dunnock/tari<gh_stars>0
CREATE TABLE client_key_values (
key TEXT PRIMARY KEY NOT NULL,
value TEXT NOT NULL
); |
<reponame>GemsTracker/gemstracker-library
CREATE TABLE gems__comm_messengers (
gcm_id_messenger bigint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
gcm_id_order int unsigned NOT NULL,
gcm_type varchar(32) COLLATE 'utf8_general_ci' NOT NULL,
gcm_name ... |
<gh_stars>0
-- tron.sql
-- turn on tracing for all current sessions of a user
@clears
prompt
prompt Turn ON SQL Trace on for all sessions of a user
prompt includes bind vars
prompt
col cuser noprint new_value uuser
prompt USERNAME ?
set term off feed off
select '&1' cuser from dual;
set term on feed on
set serv... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 08, 2019 at 07:12 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
--@Autor(es): <NAME>, <NAME>
--@Fecha creación: 15/06/2020
--@Descripción: Trigger para validar la hora en la que se inserta un pase de abordar.
set serveroutput on;
create or replace trigger trg_pase_abordar
before insert or update of id_vuelo, id_pase_abordar on lista_pasajeros
for each row
declare
v_hora... |
-- +migrate Up
ALTER TABLE `history_groups` MODIFY COLUMN `sType` enum('Root','Class','Team','Club','Friends','Other','UserSelf','UserAdmin','RootSelf','RootAdmin', 'Base') NOT NULL;
UPDATE `history_groups` SET `sType` = 'Base' WHERE `sType` IN ('Root', 'RootSelf', 'RootAdmin');
ALTER TABLE `history_groups` MODIFY COLU... |
<filename>OracleDB/Extra/ExtraB.sql<gh_stars>0
-- 1
-- Stworzyć blok anonimowy, który przy użyciu kursora dla każdego pracownika z tabeli
-- pracownicy wypisuje na ekranie tekst:
-- '<NAME> pracuje na stanowisku STANOWISKO'
-- Gdze nazwisko oraz stanowisko pochodzą z tabeli pracownicy
-- 2
-- Stworzyć procedurę, która... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 14, 2020 at 05:52 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 06, 2021 at 05:07 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.3.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<gh_stars>1-10
-- Adding required indexes for case_action view.
CREATE INDEX idx_casegroup_collection_exercise_id
ON casesvc.casegroup USING btree (collection_exercise_id);
CREATE INDEX idx_case_active_enrolment
ON casesvc.case USING btree (active_enrolment);
-- Adding case_action_template table
CREATE TABLE casesvc.... |
#############################
# Clean up Location History #
#############################
#############################
# Option one, this is what I wanted for my environment:
# + Remove Empty Location History records
# + If the record was empty (not assigned any value, besides Building/Department)
# + Unless it... |
<gh_stars>1-10
# Para nosotros crear una tabla necesitamos saber:
# el nombre de la tabla
# el nombre y cuantos campos o atributos vamos a tener
# la definicion de cada campo
# un ejemplo
#create table nombre_tabla (
# nombre_columna tipo_columna,
# nombre2_columna tipo_columna
#);
# aparte de definir el nombre y t... |
CREATE OR REPLACE FUNCTION cbor.major_type_1(
cbor bytea,
encode_binary_format text,
additional_type integer,
length_bytes integer,
data_value numeric
)
RETURNS cbor.next_state
IMMUTABLE
LANGUAGE plpgsql
AS $$
BEGIN
IF additional_type <= 27 THEN
RETURN ROW(substring(cbor,2+length_bytes), pg_catalog.to_jsonb(-1-data_v... |
<gh_stars>1-10
DROP TABLE IF EXISTS product;
CREATE TABLE product (
id bigint primary key auto_increment,
name varchar(50) not null,
price decimal(8,2) not null,
score int not null,
image varchar(100) not null);
INSERT INTO product(name,price,score,image) values('<NAME>','197.88',100,'super-mario-odyssey.png');
INSERT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.