DataStax
Studio
Schema
default localhost
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
CREATE KEYSPACE IF NOT EXISTS clinic
WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 1 };
use clinic;
drop table if exists surgeon_surgery_by_center_week;
drop table if exists surgeon_surgery_by_center_weekII;
CREATE TABLE IF NOT EXISTS surgeon_surgery_by_center_week(
surgery_center varchar,
year smallint,
week tinyint,
surgery_details
frozen<
set<
tuple<
varchar, // lead surgeon
set< // surgeries for week
tuple<
timestamp, // surgery start
// CPT I procedure code
frozen<set<int>>>>>>>,
PRIMARY KEY( (surgery_center, year), week ) );
/*-----*/
CREATE TABLE IF NOT EXISTS surgeon_surgery_by_center_weekII(
surgery_center varchar,
year smallint,
week tinyint,
lead_surgeon varchar,
surgery_details
frozen<
set< // surgeries for week
tuple<
timestamp, // surgery start
// CPT I procedure code
frozen<set<int>>>>>,
PRIMARY KEY( (surgery_center, year), week, lead_surgeon ) );
/* POPULATE */
INSERT INTO surgeon_surgery_by_center_week( surgery_center, year, week, surgery_details )
VALUES
( 'Briggs', 2020, 3,
{
( 'Jimmy Connors', {
( '2020-01-15 02:15-0800',
{60000, 61005}
)
}
),
( 'Jimmy Connors', {
( '2020-01-16 01:45:00-0800',
{60004}
)
}
),
( 'Patrick McEnroe', {
( '2020-01-13 00:00:00.00-0800',
{27763}
)
}
)
}
);
/* POPULATE II */
INSERT INTO surgeon_surgery_by_center_weekII( surgery_center, year, week, lead_surgeon, surgery_details )
VALUES
( 'Briggs', 2020, 3, 'Jimmy Connors', { ( '2020-01-15 02:15-0800',{60000, 61005} ), ( '2020-01-16 01:45:00-0800',{60004} ) } );
INSERT INTO surgeon_surgery_by_center_weekII( surgery_center, year, week, lead_surgeon, surgery_details )
VALUES
( 'Briggs', 2020, 3, 'Patrick McEnroe', { ( '2020-01-13 00:00:00.00-0800',{27763} ) } );
/* TEST */
select * from surgeon_surgery_by_center_week;
select * from surgeon_surgery_by_center_weekII;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
indexsurgery_center year week lead_surgeon surgery_details
0
Briggs
2020
3
Jimmy Connors
[["2020-01-15T10:15:00.000+0000",["60000","61005"]],["2020-01-16T09:45:00.000+0000",["60004"]]]
1
Briggs
2020
3
Patrick McEnroe
["2020-01-13T08:00:00.000+0000",["27763"]]
1
Displaying 1 - 2 of 2 results for the last statement
Success. 2 elements returned. Duration: 8.835 s.