SIC - Big Data - Chapter 4 - Workbook
SIC - Big Data - Chapter 4 - Workbook
SIC - Big Data - Chapter 4 - Workbook
1
Contents
Lab 1: AWS S3 Storage........................................................................................................................ 3
Lab 2: AWS S3 Glacier Storage.........................................................................................................21
Lab 3: Data Access with HBase........................................................................................................ 35
Lab 4: Data Accessing Using DML commands................................................................................42
Lab 5: Working with HBase...............................................................................................................47
Lab 6: Data Access with Cassandra.................................................................................................49
Lab 7: Working with Cassandra....................................................................................................... 62
Lab 1
2
Lab 1: AWS S3 Storage
In this lab, you will create AWS Account and explore the S3 Service. Then you will access
and manage S3 Storage using AWS CLI and Cyberduck.
1.1.1 Creating a free tier account will require a credit card. However, the services
that we will be using will all be within free tier eligibility.
1.2.2 Change the language to English or a language option of your choice. This
option is on the bottom left of your browser.
3
2.1.1 You can get to any Amazon AWS service in several ways.
Use the search bar on top and search for the service
2.1.2 Click on the Service icon next to the AWS logo to bring up a menu of all
services
4
No uppercase
Start with lowercase letter or number
2.2.4 Keep the checkmark on Block all public access. By default, Amazon S3
blocks public access to S3 buckets. You can modify this later, even after the
bucket has been created
2.2.5 Keep value for Bucket Versioning to Disable. If you enable this feature, S3
will keep multiple variants of an object in the bucket. This may be useful
against accidental deletes.
2.2.6 Keep value for Default encryption to Disable. Users can choose to encrypt
their data-at-rest by enabling this feature.
5
2.3 Uploading objects to a bucket
2.3.1 Go to the Amazon S3 console and select the bucket to which you wish to
upload object. Select from the list of buckets.
2.3.3 You can choose to upload files or folders. We will upload a file for now.
Choose Add Files icon.
2.3.5 Click on the Upload button on the bottom of the screen to complete. When
the upload is complete, you will get a success screen below.
2.4.1 Go to the Amazon S3 console and select the bucket you wish to upload from
the list of buckets
6
2.4.2 From the Objects tab, select an object that you would like to download. For
now, we will select the seoul.jpeg file that was uploaded.
2.4.3 From the object’s Properties tab, review the information for this object
2.4.4 Click on the Download icon on the top to download this object. The object
will be downloaded to your download directory on your local system.
2.5.1 Go to the Amazon S3 console and select the bucket you wish to upload from
the list of buckets
2.5.5 Click on Create Folder button on the buttom to create your new folder. You
should now have a new folder and the seoul.jpeg file you uploaded earlier
inside your bucket.
7
2.6 Copy objects in a S3 bucket
2.6.1 Go to the S3 bucket or folder that contains the object you want to copy. For
us, this will be in bucket that we first created and where we uploaded the
seoul.jpeg file
2.6.4 We now have to provide a destination to copy. We can do this in two ways.
One is to give the bucket or bucket/folder address. The other is to use the
Browse S3 option to open a GUI window and navigate to the desired bucket
or folder. If you choose the GUI method, the Destination address will be
automatically filled in for you
2.7.2 Create a new bucket but this time, allow public access to it by unchecking the
Block all public access. You must acknowledge that this might expose your
object to the public. Make sure that you provide a globally unique name for
the bucket.
8
2.7.3 Leave everything as is and click on Create bucket to create the bucket.
2.7.4 Copy seoul.jpeg file that you uploaded in step 2.3 to the newly created
bucket from above.
2.7.6 The bucket you copied to has allowed public access, however, you need to set
an object's access rights specifically. It does not have public access as of yet.
Click on object and go to the Permissions tab.
9
2.7.8 Allow read access to all persons (public access). You must also acknowledge
that you understand the consequences of this action.
2.7.10 From the Properties tab of the object, find the Object URL and click to test
public access
You incur charges while you have objects stored in S3. We will delete all the
buckets and all of its contents.
2.8.1 Go to your bucket list and select the bucket you would like to delete
10
2.8.3 Click on Empty button on the top menu to delete all objects and folders from
inside the bucket.
2.8.4 As a caution, you will have to type permanently delete in order to empty
the bucket. Finalize the operation by clicking on Empty.
2.8.5 Now that the bucket is empty, select it again from your bucket list and select
Delete from the top buttons. As a caution, you will have to enter the name of
the bucket in order to delete it. You will not get the icon to delete the bucket
until you correctly spell the name of the bucket.
2.8.6 In the same manner, delete the remaining bucket as well. When completed,
you should not have any buckets remaining in the s3 account.
AWS S3 have several storage classes with various performance and cost
specification. In simple terms, users can select different storage classes
depending on whether the data is hot, warm or cold.
You can use lifecycle rules to define what you want Amazon S3 to do during an
object's lifecycle, such as moving an object to a different storage class, retaining
the object, or deleting the object after a specified period of time has elapsed.
11
Before setting up your lifecycle configuration, keep the following in mind:
Propagation delay
If you disable or delete a lifecycle rule, there is a small delay before Amazon S3
stops scheduling deletion or transition for new objects. Any objects that have
already been reserved will be canceled and will not be deleted or converted.
When you add a lifecycle configuration to a bucket, the configuration rules apply
to existing objects as well as objects you add later. For example, if you add a
lifecycle configuration rule today that includes an expiration action that expires
30 days after creation of objects with a specific prefix, Amazon S3 queues all
existing objects older than 30 days for deletion. .
2.9.1 Make a new bucket and name it <some prefix>-lifecycle-archive. You have to
add some prefix to the beginning of the name to assure that you can create a
globally uniquely named bucket. You may choose to make it public or closed.
2.9.2 Select the bucket and open the Management tab. From there select Create
lifecycle rule.
2.9.3 In Lifecycle rule name, enter a name for the rule. However, make sure it has a
unique name within the bucket.
To apply this lifecycle rule to all objects with a specific prefix or tag, choose
Limit the scope of this rule using one or more filters.
12
To limit the range by prefix, enter a prefix in Prefix.
Objects in s3 can be given a tag. You enter a key and value pair to create the
tag. To limit the scope to tags, choose Add tag and enter the tag key and
value to which this rule should apply
To apply this lifecycle rule to all objects in the bucket, select This rule applies
to all objects in the bucket and confirm that this rule applies to all objects in
the bucket (I acknowledge that this rule applies to all objects in the bucket)
2.9.6 Set a Lifecycle rule actions. You can select more than one rule. Some of the
options only applies if versioning is enabled and there are previous versions.
In this lab, we will set rules for current versions since we are not versioning
and there are no previous versions. Select the Transition current versions of
objects between storage classes..
2.9.7 When the above option is selected, a new section will appear for you to enter
the transition policy. Here you enter the Days after object creation and the
Storage class transitions. To view the cost and storage classes, refer to
https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-
transition-general-considerations.html#glacier-pricing-considerations
2.9.8 Choose Glacier storage class and set to 1 day after object creation. You must
also acknowledge your understanding of this rule
13
2.9.9 Click the Create rule button on the bottom
14
3. Using AWS CLI to access and manage S3 storage
Git Bash is a nice Windows terminal program that provides many of the basic
functionalities of a Linux terminal. Many of the command we will execute below
can be easily accomplished from Git Bash without installing further programs. To
install Git Bash, go to https://git-scm.com/downloads and download the Windows
64 bit version. If you Windows environment is 32 bits, please upgrade your
operating system.
You will use Git Bash as the terminal program for the rest of the lab.
3.2.2 Follow the instructions. The recommended method is to install the latest
version from https://awscli.amazonaws.com/AWSCLIV2.msi
3.3.2 Follow the instructions. The recommended method is to install the latest
version from https://awscli.amazonaws.com/AWSCLIV2.pkg
3.4 Verify that AWS CLI was properly installed by opening up a terminal (Git Bash for
Windows and a terminal in Mac OS. Both environments will give same results.
The lab instructions will limit the screenshot to Git Bash for brevity) and executing
the following:
aws --version
15
3.5.1 From the AWS console, click on the account name and select My Security
Credentials from the drop-down menu
3.5.2 From the new page, select Access Keys and click on the Create New Access
Key button
3.5.4 Navigate to the download directory and open the downloaded access key
file. Depending on your environment, it might open as an Excel document or
as a Text document. In either case, there will be an AWS Access Key ID and
AWS Secret Access Key. You will need these two pieces of information in the
next step.
3.5.5 From Git Bash (terminal), run aws configure command and enter the AWS
Access Key ID and AWS Secret Access Key when prompted. For the default
region, enter the region name where you created your buckets in step 2.2.
Finally, enter json for the output format.
16
3.5.6 Test the connection by issuing the following command to get a listing of your
s3 buckets.
aws s3 ls
aws s3 help
aws s3 mb s3://student-cli-bucket
3.6.3 List your buckets to confirm a new bucket has been created.
3.6.4 Now, copy the seoul.jpeg file to the newly created bucket with the following
command. Notice that as we copy, we are also creating a folder named my-
folder.
17
3.6.6 Now add another file of your choice to the my-folder directory in the
<prefix>-cli-bucket bucket. Confirm that you have added the file by listing
the bucket and directory again. Notice that we can change the name of the
file at the destination.
3.6.7 We have already uploaded the seoul.jpeg file previously, so let’s delete it
from the new bucket and folder. Execute the following command:
aws s3 rm s3://student-cli-bucket/my-folder/seoul.jpeg
aws s3 ls s3://student-cli-bucket/my-folder/
18
4.3 Select Amazon S3 from the drop down menu and enter your Access Key ID and
Secret Access Key, if necessary, that was downloaded from step 3.5.1. Cyberduck
is smart and will read the AWS CLI setting for the Access Key ID and Secret Access
Key. If it was unable to read this information from your system, you will have to
enter it manually. Connect to your account.
4.4 Open each of the buckets by clicking on the arrow (>) next to the
bucket names. Check that the files we had placed are displayed
properly.
4.5 Because Cyberduck is a GUI based tool, all of the usage is very
intuitive. Click on the cogwheel to see a list of actions available.
19
4.6.3 Change the my-folder name to Q1-Sales and hit enter
4.6.4 You will be prompted if you want to move the selected files and will be given
an option to Rename. Click on the Rename
4.7.2 Select Upload from the cogwheel menu or from the top menu
4.7.3 Navigate to the directory containing the source file and select it.
4.7.4 Click Choose to begin uploading the file. A new pop up window will display
the progress of the upload.
4.7.5 Notice that Cyberduck displays different icons depending on the file type
4.8 Try renaming the student-cli-bucket. Will Cyberduck allow this operation?
20
4.9 Select the Q2 sales.csv file and drag it into the <prefix>-lifecycle-archive bucket.
Does it work as expected?
Yes, Cyberduck prompt you to verify that you want to move the file. When you
click on the move button, the file is moved to the destination bucket.
4.10 Now try creating a new folder on your own. Create the folder in student-cli-bucket
bucket.
4.11 Download the Q1 sales.csv file and then delete it from S3.
21
Lab 2: AWS S3 Glacier Storage
AWS S3 Glacier storage is a cost-effective alternative to S3 standard storage for files that are
cold and not expected to be accessed for a long time.
1.1 Login to the AWS Management Console and navigate to the Glacier service
1.1.1 You can get to any Amazon AWS service in several ways.
Use the search bar on top and search for the service
1.2 Select Create Vault from the splash page to create a S3 Glacier vault
22
1.3 Keep the setting to Do not enable notification and click continue
1.5 Your new vault is listed in the Amazon S3 Glacier Vault page
2.1 Check to see that the Glacier vault was properly created. From Git Bash (terminal)
issue the following command. You must include the hyphen at the end of the
command. This tells AWS CLI to use the account id associated with the
information we entered in step 3.5 as part of configuring AWS CLI.
This command will return the name of that vault in json format.
23
2.2 Uploading a large file using multi-upload to S3 Glacier using AWS CLI
This command initiates a multipart upload and requires the size of each part in bytes.
Our chunks are 1MiB each. We also have to give it a vault name and our account-id
information. We will need the uploadId information that is returned after running
this command
24
2.3 Setup an environmental variable named UPLOADID and set it to the uploadId
information returned above. Be careful that you don’t introduce any extra
characters or space within the command and especially the uploadId string.
2.4 Use the upload-multipart-part command to upload each part. These commands
can be run in parallel for faster throughput.
2.4.1 Make sure that files named 3 parts are in the current directory. If they are
not, either copy them to the current directory or move to the directory that
has the 3 files.
25
aws glacier upload-multipart-part --body chunkac \
--range 'bytes 2097152-3145727/*' \
--account-id - \
--vault-name tempvault \
--upload-id $UPLOADID
Amazon S3 Glacier requires a tree hash of the original file to ensure that all
uploaded fragments have reached AWS unchanged.
To compute the tree hash, split the file into 1 MiB parts and compute the binary
SHA-256 hash of each piece. Then split the hash list into pairs, combine the two
binary hashes into each pair, and get the hash of the result. Repeat this process
until only one hash remains. If there is an odd hash at any level, it is promoted to
the next level without modification.
The key to correctly calculating tree hashes when using command line utilities is
to store each hash in binary format and only convert it to hexadecimal in the last
26
step. Combining or hashing hashes of the hexadecimal version of the tree can
produce incorrect results.
2.5.2 Combine the first 2 hashes and get the binary hash of the result.
2.5.3 Combine the parent hashes of chunks aa and ab with the hashes of chunk ac
and hash the result again. At this time, the hexadecimal number is produced.
27
2.5.5 Finally, use the complete-multipart-upload command to complete the
upload. This command takes the size (in bytes) of the original file, the final
tree hash value (in hexadecimal), and the account ID and vault name.
2.5.6 You can also check the vault status using the describe-vault command.
Vault status is updated about once per day. You may not be able to see the files you
have uploaded yet.
28
aws glacier initiate-job \
--vault-name tempvault \
--account-id - \
--job-parameters '{"Type": "inventory-retrieval"}'
2.6.3 Use the describe-job command to check the status of a previous search job
29
2.6.4 Wait for the download operation to complete. You can rerun the above
command to keep checking on the completion status.
Job IDs don't expire for at least 24 hours after S3 Glacier completes the job
2.6.5 When finished, use the get-job-output command to download the status as
output.json file.
3.1 From the AWS Management Console, navigate to the S3 Glacier console
3.2 We have been working with the tempvault in the previous steps. Click and select
the tempvault. This will open up the following screen:
30
3.3 Select the Notifications tab from the top to configure the notification
3.3.3 Enter a topic name and display name and click Create topic
31
3.3.4 Select the notification job type. Select both options.
3.4.1 Navigate to the Amazon Simple Notification Service console by searching for
it from the AWS Management Console
3.4.4 Select the Topic ARN that we created in the previous step
32
3.4.5 Select Email as the Protocol
3.4.8 A Details page will display the details of the subscription. Select on the topic
that we created in the previous section.
33
3.4.9 You will see that there is now a pending subscription waiting for
confirmation. Check the email address entered in the subscription. There
should be an email requesting confirmation.
3.4.10 Confirm the subscription. A new pop-up window will confirm that you are
now subscribed.
4.1.1 Use the delete-vault command to remove a vault that does not have any
archives
34
The student-vault is now deleted, however, we will keep the tempvault until all the pending
jobs are completed. Since we have subscribed to a notification, wait for the confirmation
notification that the job is complete.
4.2.1 Create a vault using AWS CLI so that we can delete it from the console
4.2.2 Return to the console and refresh the screen to view all your vaults.
4.2.3 Select the to-delete-vault. This will enable the Delete Vault option on the
top menu
35
4.2.4 Click Delete Vault to delete the selected vault. Confirm the deletion.
Note: If the vault is not empty, you must first delete all archives. In order to delete the archive,
use aws cli to start an "inventory scan" job. You can get a list of archive IDs from there. Delete
all archives using aws glacier delete archive <archive id>.
36
Lab 3: Data Access with HBase
In this lab, you run to basic operation with creating, deleting, and altering a table in HBase
shell. And you will use the shell to put and get data in HBase.
1.1 Run the HBase shell. And execute the help command and view the basic usage
information for HBase Shell.
$hbase shell
hbase(main):001:0> help
hbase(main):001:0> version
hbase(main):001:0> status
You can check the Hbase version (2.3.5) and standalone execution (1 active master, 1 servers).
1.3 Use the create command to create a new table. You must specify the table name
and the column family name.
Note: Table names, rows, columns all must be enclosed in quote mark.
1.4 List table to verify table tbl_authors was created using list. You can either give the
List command alone or give the table name along with List .
37
hbase(main):002:0> list
hbase(main):003:0> list ‘tbl_authors’
1.5 Use the describe command to see details, including configuration defaults.
1.6 Delete the table you just created. And list all tables to verify table was successfully
deleted
38
1.7 Disable the tbl_authors table for drop.
1.8 Create a test table, and use the put command. Here, we insert three values, one at
a time.
39
1.9 Count the number of rows in the HBase temp table that you created in the
previous lab
1.10 What is the expected number of rows after running the following command?
1.10.1 Input data under the following conditions into temp table.
Column Family: cf1
RowKey:rk4, column descriptor : d and value: D
RowKey:rk1, column descriptor : b and value: 1B
RowKey:rk5, column descriptor : d and value: E
The following is the result of scanning the data in the TEMP table. The total list is 6, but the
actual number of rows is 5.
1.11 Change the version attribute of cf1 in the temp table to 3, and check whether the
change is reflected correctly.
40
hbase(main):003:0> alter ‘temp’, {NAME=>'cf1', VERSIONS=>3}
hbase(main):004:0> desc ‘temp’
1.12 Change the temp table to add the cf2 and cf3 column family using the ALTER
command.
1.13 Execute the command to check whether cf2 and cf3 have been added.
1.14 Remove the newly added cf3 and check the result.
1.15 Delete the temp table. And list all tables to verify table was successfully deleted.
41
1.16 Exit HBase shell with the quit command
hbase(main):004:0> quit
$vi rubyscript.rb
disable ‘temp’
drop ‘temp’
scan 'temp'
get 'temp', 'rk1'
count 'temp'
exit
1.18 You can enter HBase shell commands into a text file, one command per line, and
pass the file to the shell.
42
hbase(main):001:0> require ‘./rubyscript.rb’
Note: This is a rubyscript.rb execution result screen, and if there is no exit statement in the
script, it remains in the shell state.
1.19 You can also pass commands to the HBase Shell in non-interactive mode using the
echo command and the | (pipe) operator.
43
Lab 4: Data Accessing Using DML commands
In this lab, you will use command to inserting, retrieving, scanning, and removing rows.
1.1 If you have not finished lab1, run the ruby.rb script first and proceed with this lab2.
hbase shell
1.3 Enter data with the following conditions and display the results.
RowKey:rk1, column descriptor : b and value: F
1.4 Get the row with rowkey rk1 from temp table.
1.5 Get two values of the previous versions of the ‘b’ column with the rk1.
44
Hbase(main):003:0> get ‘temp’, ‘rk1’, {COLUMNS => ‘cf1:b’, VERSIONS=>2}
hbase(main):004:0> get ‘temp’, ‘rk1’, {COLUMNS => ‘cf1:b’}
Note: The first input 1B value and the last input F value are displayed. If the version is not
specified, only the final value is displayed.
1.6 View the all table, but only show the ‘a’, ‘b’, ‘c’ columns.
1.7 Delete the ‘b’ column from the temp table with the rowkey = rk1.
1.9 Delete the entire row form the temp table in rk1 rowkey.
1.10 Show the row with rk1 has been deleted from temp table.
45
2. Using MIN_VERSIONS and Time-To-Live
2.1 Describe the temp table and check the TTL value of cf2 column. The default
TTL(Time-To-Live) is FOREVER, meaning that versions of a cell never expire.
2.2 Change the value from FOREVER to 30 seconds. This means the version will be
deleted 30 seconds after inserting data into the table.
2.4 Insert a data with the following conditions and display the results.
46
RowKey:rk1, Column Family: cf2, column descriptor : ttl and value: Y
2.5 After waiting at least 30 seconds, run the scan command again to see if the
inserted row has expired and has been deleted.
Hbase(main):014:0> alter ‘temp’, NAME => ‘cf2’, TTL=> 10, MIN_VERSIONS => 1
Note: When a version expires with MIN_VERSION option, it will not be deleted if it is the only
remaining version of the cell.
2.8 Insert a data with the following conditions and display the results.
RowKey:rk5, Column Family: cf2, column descriptor : ttl_min and value: Z
47
hbase(main):016:0> put ‘temp’, ‘rk5’, ‘cf2:ttl_min’, ‘Z’
2.9 After waiting at least 10 seconds, run the scan command again to see if the
inserted row has expired and has been remained.
48
Lab 5: Working with HBase
In this lab, you will work with HBase.
1. Write a command for creating table that meets the following conditions
1.3 Show the number of rows in the movie and user tables you entered.
1.4 Use alter command to change the movie table to add the title column family.
1.5 Run the command to verify that the stitle column family has been added.
1.7 Check the movie table to ensure that the stitle column family has been removed.
1.8 Modify the media column family in the movie table to keep 4 versions.
2.1 Show the user table to check the column family names.
2.2 Get the row with row key 100 from the user table.
49
2.3 Add a row with the following properties.
2.4 Just show the row with row key 100 from the user table.
2.6 Show the row with row key 100 from the user table.
2.7 In the user table, get all the old columns of the age column version in the row with
row key 100.
2.8 Show the entire table with scan command, but only display the age column.
2.9 In the user table, delete the info:age column of the row with row key 100.
2.11 Delete the entire row with row key 100 from the user table.
2.12 Verify that the row with row key 100 has been removed from the user table.
50
51
Lab 6: Data Access with Cassandra
In this lab, you will start and use the Cassandra NoSQL for our labs.
sudo vi /etc/yum.repos.d/cassandra.repo
[cassandra]
name=Apache Cassandra
baseurl=https://downloads.apache.org/cassandra/redhat/40x/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://downloads.apache.org/cassandra/KEYS
52
2. Starting the CQL shell
cqlsh
2.5 This example shows how to create a keyspace with network topology in a single
node evaluation cluster.
53
};
54
3.1 Create tables with the following characteristics (create table including key space
without use command)
Column name: id uuid, l_name text, f_name text, country text, birth int, gender text
Partition Key: id
cqlsh> create table ks_work1.user_info (id uuid primary key, l_name text, f_name text,
country text, birth int, gender text);
Column name: id uuid, l_name text, f_name text, country text, birth int, gender text,
s text, num int
static column: s
55
primary key : country, birth, id
cqlsh> create table ks_work1.user_info2 (id int, l_name text, f_name text, country text,
birth text, gender text, s text, num int, primary key((country,birth), id));
csqsh> desc tables;
Column name: id int, l_name text, f_name text, country text, birth int, age int
cqlsh> create table ks_work1.user_info3 (id int, l_name text, f_name text, country text,
birth text, gender text, s text static, num int, primary key(country, id, birth));
Column name: id int, l_name text, f_name text, country text, birth int, age int
56
cqlsh> create table ks_work1.user_info33 (id int, l_name text, f_name text, country
text, birth text, gender text, s text static, age int, primary key(id, birth)) with clustering
order by (birth desc);
csqsh> desc tables;
3.2 Change the keyspace to ks_work1 and verify whether the tables user_info,
user_info2 and user_info3 were created successfully.
57
3.2.1 Verify the user_info
3.3 Add the following column to the user_info33 table. And verify the user_info33
table.
58
3.4 Delete the user_info33 table you just modified.
3.5 List all tables again to confirm that table user_inf33 was dropped successfully.
59
3.6 Enter data into the user_info2 and user_info3 tables, respectively, as shown in the
following figure.
3.6.1 User_info2
3.6.2 User_info3
4.1 Select statement that outputs Info2, info3 data and limit to 1 row per partition.
60
cqlsh:ks_work1> select * from user_info2 per partition limit 1;
cqlsh:ks_work1> select * from user_info3 per partition limit 1;
4.1.2 Verify the records for user_info2 and user_info3 with 1 row per partition.
61
4.2 List of persons included in KOR/JPN.
4.3 Find the total number of records in the user_info3 table and the sum, minimum,
and average values of num.
62
cqlsh:ks_work1> select count(id) as count, sum(num) as sum, min(num) as min,
avg(num) as avg from user_info3;
4.5 Find records where country Is KOR and number is greater than 30
cqlsh:ks_work1> select * from user_info3 where country='KOR' and num > 30 allow
filtering;
4.6 Modify the value of s in KOR to ‘value8’, and make it null after 30 seconds.
63
4.6.1 After 30 seconds, the values in 3 rows are deleted and become null.
4.7 Insert the value of s in KOR to ‘value8 and update ’ and update the value of the row
with id 4 with the following condition.
f_name:ann, l_name:kim, num:85
cqlsh:ks_work1> insert into user_info3 (id, f_name, l_name, num, country, birth)
values(4,'ann','kim', 85, 'JPN', '1974');
64
4.8 Change the value of f_name in the record with id 3 to "scott".
cqlsh:ks_work1> insert into user_info3 (id, l_name, f_name, country, birth, gender, s,
num) values (3,'jeong','scott','USA','1967', 'M', 'value3', 32) if not exists;
4.9 Change Scitt to scott in the 3rd row of the user_info3 table.
4.10 Delete the s column where the country is USA from the user_info3 table.
65
4.11 Delete the l_name column under the same conditions with 4.10
4.12 Delete the row where the country is CAN or JPN from the user_info3 table.››
66
Lab 7: Working with Cassandra
67
2.2.2 Name the country with the second largest population
END OF LAB
68