question archive In-class Exercise W13 Write CQL Statements for the following: submit (script in
Subject:Computer SciencePrice: Bought3
In-class Exercise W13
Write CQL Statements for the following:
submit (script in .txt + screenshot of the results for each test case in a .pdf or .docx format)
Use keyspace created in previous lab or create a keyspace called: "Week13_Lab_studentname"
Question 1 (50 points)
pname varchar,
startdate (timestamp),
emps map<text, text>, here the key for emps is ename, and value is dname
pname, startdate, emps
'UMBC Library','2019-01-11',{'Jeff':'IT','Emma':'IT'});
'UMBC Student Record','2019-03-01',{'Jeff':'IT','Bob':'IT'});
dname varchar,
ename varchar,
hiredate timestamp,
salary varint,
proj list<text>
Ename, Dname, Hiredate, Salary, proj
'Jeff', 'IT', '2019-02-03', 60000, ['UMBC Library', 'UMBC Student Record']
Susan', 'HR', '2016-01-03', 70000
'Emma', 'IT', '2017-11-03', 80000, ['UMBC Library']
'Bob', 'IT', '2018-01-03', 70000, 'UMBC Student Record']
Question 2 ( 50 points)
cust: cid (int), cname (varchar)
prod: pid(int), pname(varchar), price(float)
transaction: cid(int), pid(int), tdate(timestamp)
Users want to return names of products and transaction date given cname
Or return names of customers and tdate given pname
Row1:
cid = 1, cname = Jeff, 2 transactions
Pid = 1, pname = iPhone 10, price = 1000, tdate = '2019-02-01'
Pid = 2, pname = Harry Potter, price = 100, tdate = '2019-03-01'
Row 2:
cid = 2, cname = Alice, 2 transactions:
Pid = 1, pname = iphone 10, price = 1000, tdate = '2019-01-01'
Pid = 5, pname = Levi Jeans, price = 60, tdate = '2019-03-01'
-Return names of products and transaction date for customer 'Jeff'
-Return names of customers and the date they bought the product Harry Potter