DataStax
Studio
Schema
default localhost
Connection
Schema
  • real_estateCQL Keyspace
    • Tables
    • User Defined Types
    • User Defined Functions
    • User Defined Aggregates
    • Materialized Views
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
CREATE KEYSPACE IF NOT EXISTS real_estate
WITH REPLICATION = { 'class': 'SimpleStrategy',
'replication_factor': 1 }
AND DURABLE_WRITES = true;
/*-----------------*/
CREATE TYPE IF NOT EXISTS real_estate.address(
street text,
city text,
state text,
postal_code text
);
CREATE TYPE IF NOT EXISTS real_estate.listing(
street text,
postal_code text,
asking_price int,
listing_id UUID
);
USE real_estate;
CREATE TABLE IF NOT EXISTS listings_by_realtor_no_uniqueness(
listing_detail set<frozen<listing>>,
realtor_co_name text,
realtor_co_address address STATIC,
city_id UUID,
city_name text,
city_population int,
city_rating float,
state_name text,
state_energy_drink text,
state_region text,
PRIMARY KEY ( (realtor_co_name), state_name, city_name )
);
SELECT *
FROM listings_by_realtor_no_uniqueness
where realtor_co_name = 'Stratus' and
state_name = 'California' and
city_name = 'Los Angeles';
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
indexrealtor_co_name state_name city_name city_id city_population city_rating listing_detail realtor_co_address state_energy_drink state_region
0
Stratus
California
Los Angeles
73bb50fa-d507-457c-8bc1-8789e09a71cd
4000000
4.2
[{"street":"17513 Raddish Road","zip_code":"90077","asking_price":"1100000","listing_id":"8120ba5...
{"street":"75164 Modem","city":"Los Angeles","state":"California","zip_code":"90016"}
Rockstar
Pacific
1
Displaying 1 - 1 of 1 results for the last statement
Success. 1 element returned. Duration: 0.009 s.