Question 58: You have been given two separate csv file as below.
course.csv : with following sample data
62c36092-82a1-3a00-93d1-46196ee77204, cassandra,{nosql,bigdata},
subscriber.csv (All the subscriber of the training course, it is possible a single company can have multiple user)
62c36092-82a1-3a00-93d1-46196ee77204, {This email address is being protected from spambots. You need JavaScript enabled to view it., This email address is being protected from spambots. You need JavaScript enabled to view it.} , Amit Jain
Which of the following is correct way to accommodate these data in Cassandra table?
A.
CREATE TABLE HADOOPEXAM {
course_id timeuuid,
title text,
Category set<text>
}
CREATE TYPE SUBSCRIBER_TYPE {
course_id timeuuid,
emails set<text>,
name text
}
ALTER TABLE HADOOPEXAM add SUBSCRIBER frozen<SUBSCRIBER_TYPE>;
B.
CREATE TYPE SUBSCRIBER_TYPE {
course_id timeuuid,
emails set<text>,
name text
}
CREATE TABLE HADOOPEXAM {
course_id timeuuid,
title text,
Category set<text>,
SUBSCRIBER SUBSCRIBER_TYPE
}
C.
CREATE TABLE SUBSCRIBER_TYPE {
course_id timeuuid,
emails set<text>,
name text
}
CREATE TABLE HADOOPEXAM {
course_id timeuuid,
title text,
Category set<text>,
SUBSCRIBER SUBSCRIBER_TYPE
}
D.
CREATE TABLE SUBSCRIBER_TYPE {
course_id timeuuid,
emails map<text>,
name text
}
CREATE TABLE HADOOPEXAM {
course_id timeuuid,
title text,
Category map<text>,
SUBSCRIBER SUBSCRIBER_TYPE
}
- A,B
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering Python Certification Material
Correct Answer: 1
Explanation: Both option 1 and 2 are correct. As you know, for unique text values we can use set<text> type. We can use map type only if there are keys and values.
You can access to full explanation to question and answer from this page.