Create Tables in the Data Store
Next, let’s create a table in the Data Store of the NewsApp project. We will be creating seven tables to store news of various news categories. Let’s begin by creating the first table.
To create a table:
Navigate to the Cloud Scale service from the Catalyst console, and click Start Exploring.
Navigate to Data Store under STORAGE. Click Create a new Table.
Enter the table’s name as ‘HEADLINES’ and click Create.
This table will store the general headlines of the news items obtained through NewsAPI.
The table is now created and displayed in the Data Store page.
Now click New Table in the Data Store page each time to create the other tables in the same way.
Create 6 other tables and name them as follows: ‘BUSINESS’, ‘ENTERTAINMENT’, ‘HEALTH’, ‘SCIENCE’, ‘SPORTS’, ‘TECHNOLOGY’.
The tables will be displayed on the left in the Data Store page.
Now, let’s create columns in all the tables. We will create two columns in each table:
- title: To store the title of the news article
- url: To store the original URL of the news article’s source
To create a column in a table:
Click New Column in the Schema View section for the table.
Enter the column’s name as ‘title’. Select the data type as Var Char and enter the max length as ‘255’.
You can learn about the various data types supported by Catalyst and the other properties of a column from the Data Store help page.
- Click Create.
Now create the ‘url’ column in the same way. Provide the same values.
The columns are now created for the table and will be listed in the Schema View section.
Now create the same columns with the same values in each of the other six tables.
We have now configured the Data Store. We will work on coding the application from our local system. We will configure the Cron component at the end.
Last Updated 2023-12-14 16:25:23 +0530 +0530