0

Say I have the following CF with compound Primary Key

CREATE TABLE dpt (
     empID int,
     deptID int,
     PRIMARY KEY (deptID, empID));

Because of the compound PK, cassandra will create one row for each dept, and the employee IDs that are members of the department will be stored as columns on that row with the :empID as the column name.

Quesiton #1: can I set a value to that column (e.g the employ name) with CQL3? if so, how?

Question #2: can I see the value of <individual_employ_ID>:empID column - if exists - with CQL3?

thanks

Nix
  • 57,072
  • 29
  • 149
  • 198
balafi
  • 2,143
  • 3
  • 17
  • 20

1 Answers1

0

Question #1: CREATE TABLE dpt ( empID int, deptID int, empName text, PRIMARY KEY (deptID, empID));

Question #2: Please take a look at the examples: http://www.datastax.com/docs/1.1/references/cql/INSERT http://www.datastax.com/docs/1.1/references/cql/UPDATE

Efu
  • 1
  • 1
  • #1: empName then becomes a new column. I was wondering if I can do something like INSERT INTO dpr (:empID) VALUES ('employname'); but that's mostly a theoritical question. I just want to know if that's possible and not really having a use case – balafi Jan 30 '13 at 10:47