Irid demo scripts updated

This commit is contained in:
nelgson
2017-11-09 14:29:13 -08:00
parent f7e8e838a3
commit 48dd84f358
5 changed files with 88 additions and 128 deletions
@@ -0,0 +1,32 @@
CREATE DATABASE sqlr;
GO
USE sqlr;
GO
/* Step 1: Setup schema */
drop table if exists iris_data, iris_models;
go
create table iris_data (
id int not null identity primary key
, "Sepal.Length" float not null, "Sepal.Width" float not null
, "Petal.Length" float not null, "Petal.Width" float not null
, "Species" varchar(100) null
);
create table iris_models (
model_name varchar(30) not null primary key,
model varbinary(max) not null,
native_model varbinary(max) not null
);
go
/* Step 2: Populate test data from iris dataset in R */
insert into iris_data
("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width", "Species")
execute sp_execute_external_script
@language = N'R'
, @script = N'iris_data <- iris;'
, @input_data_1 = N''
, @output_data_1_name = N'iris_data';
go