Professional Documents
Culture Documents
country_name
2. In an Application Workflow diagram, Q2 and Q3 both require data collected by a top Q1. Q3 can be
split up into Q31 and Q32.
Q1 and Q2
Only Q1
Q1 and Q3
Q1 and Q31
3. How many rows will be in the table after the following sequence?
1. CREATE TABLE countries (
2. country text,
3. state text,
4. pop int,
5. PRIMARY KEY (country, state)
6. );
7.
8. INSERT INTO countries (country, state, pop) VALUES ('USA', 'Oregon', 4200000);
9. INSERT INTO countries (country, state, pop) VALUES ('USA', 'Idaho', -1);
10. INSERT INTO countries (country, state, pop) VALUES ('USA', 'Idaho', 1700000);
1. PRIMARY KEY (network, date, hour, sensor)
2. WITH CLUSTERING ORDER BY (date DESC, hour DESC, sensor ASC)
1. PRIMARY KEY (network, date, hour, sensor)
2. WITH CLUSTERING ORDER BY (date ASC, hour ASC, sensor DESC)
1. PRIMARY KEY (network, date, hour, sensor)
2. WITH CLUSTERING ORDER BY (network, date DESC, hour DESC, sensor ASC)
INSERT INTO Countries (country, state) VALUES ('USA', 'Oregon') IF NOT EXISTS;
1. BEGIN BATCH
2. INSERT INTO Countries (country, state) VALUES ('USA', 'Oregon');
3. UPDATE Countries SET state='Idaho' WHERE country='USA';
4. APPLY BATCH;
6. Primary keys:
You filtered data from a table and returned the number of rows.
· We need all accounts of some user, with their cash balance.
1. PRIMARY KEY (username, account_number)
2. WITH CLUSTERING ORDER BY (account_number ASC)
PRIMARY KEY (username, account_number)
conditional updates
batches
materialized views
lightweight transactions
Cassandra in two inter-connected on-premise data centers.
atomicity
consistency
Isolation
durability
15. What is the smallest replication factor that can ensure availability when two nodes fail?
5
16. Static columns are used to store values that are:
UPDATE
INSERT
UPSERT
"-k"
"-t"
"-m"
any subset of partition key columns, as long as the primary key definition order is respected
num_tokens
num_nodes
num_vnodes
set numnodes
27. Which of the following are benefits from compaction? Check all that apply.
Faster reads
TRUE
FALSE
SimpleSnitch
PropertyFileSnitch
DynamicSnitch
CassandraSnitch
operation.log
positions.txt
mapping-errors.log
gc.log
34. What two row values are returned by the last SELECT query?
1. CREATE TABLE Countries (
2. country text,
3. state text,
4. info text STATIC,
5. PRIMARY KEY (country, state)
6. );
7.
8. INSERT INTO Countries (country, state, info) VALUES ('USA', 'Oregon', 'nice country');
9. INSERT INTO Countries (country, state, info) VALUES ('USA', 'Idaho', 'lovely country');
10.
11. SELECT info FROM Countries WHERE country='USA';
More than 2
· We need to list all orders by user, with most recent first.
1. PRIMARY KEY (user_id, order_date, order_id)
2. WITH CLUSTERING ORDER BY (order_date DESC, order_id ASC)
1. PRIMARY KEY (user_id, order_date, order_id)
2. WITH CLUSTERING ORDER BY (order_date DESC)
transactions.log
debug.log
system.log
gc.log
1
40. What is the role of the HEADER option in a CQL COPY command? (check all that apply)
It tells if the first line in the CSV input file contains column names.
It tells to write column names in the first line of the CSV output file.
1
4200000
1700000
42. How can you say if a node will trigger a hinted handoff?
nodetool statushandoff
nodetool enablehandoff
DESCRIBE HINTS
cassandra.yaml
logback.xml
JConsole
nodetool setlogginglevel
New inserts.
Multiple rows from multiple partitions, with one row from each.
Multiple rows from multiple partitions, with multiple rows from each.
For rows with the same primary key, only the most recent change is kept.
Multiple rows from multiple partitions, with one row from each.
Multiple rows from multiple partitions, with multiple rows from each.
50. You have three data centers with 5 nodes each, replication factors 1, 2, 3, and one node down in
each data center. In the worst case scenario, how many nodes are still up with your data?
5
51. How many rows exist in the table after the following sequence?
1. CREATE TABLE countries (
2. country text,
3. state text,
4. pop int,
5. PRIMARY KEY (country, state)
6. );
7.
8. BEGIN BATCH
9. UPDATE countries SET pop=4200000 WHERE country='USA' AND state='Oregon';
10. INSERT INTO countries (country, state, pop) values ('USA', 'Idaho', 1700000);
11. INSERT INTO countries (country, state) values ('USA', 'Oregon');
12. APPLY BATCH;
You filtered data from a table and returned the number of rows.
country text,
state text,
created timestamp,
);
Which of the following queries is valid?
54. How many rows will be in the table after the following sequence?
CREATE TABLE countries (
country text,
state text,
pop int,
);
INSERT INTO countries (country, state, pop) VALUES ('USA', 'Idaho', 1700000);
One row.
country text,
state text,
city text,
);
INSERT INTO Countries (country, state, city) VALUES ('USA', 'Oregon', 'Portland');
USA-Oregon-Portland
USA-Oregon-Vancouver
Canada-Idaho-Vancouver
USA-Idaho-Vancouver
56. How many email entries can have for the same attachment?
one or more
zero or more
always one
one or zero
1. PRIMARY KEY (name)
2. WITH CLUSTERING ORDER BY (name ASC)
1. CREATE TABLE positions_by_account (
2. account text,
3. symbol text,
4. quantity int,
5. PRIMARY KEY ((account, symbol))
6. );
1. CREATE TABLE positions_by_account (
2. account text,
3. symbol text,
4. quantity int,
5. PRIMARY KEY (account, symbol)
6. ) WITH CLUSTERING ORDER BY (symbol ASC);
1. CREATE TABLE positions_by_account (
2. account text PRIMARY KEY,
3. symbol text,
4. quantity int
5. ) WITH CLUSTERING ORDER BY (account ASC, symbol ASC);
1. CREATE TABLE positions_by_account (
2. account text,
3. symbol text,
4. quantity int,
5. PRIMARY KEY (account, symbol ASC)
6. );
PRIMARY KEY (id, timestamp DESC, album_title ASC, album_year ASC, number ASC)
1. PRIMARY KEY (id, timestamp, album_title, album_year, number)
2. WITH CLUSTERING ORDER BY (timestamp DESC, album_title ASC, album_year
ASC, number ASC)