Importing data
Let's get the ball rolling now.
We have had Teradata Studio Express and SQLA up and running for a while now. It is time to load data into the Teradata Database.
Now, there are many ways to do this, but, for simplicity, I will be importing data via Excel using the GUI option in Teradata Studio Express. You can copy the table data from Teradata to a data lab just by dragging the source table from the data lab view. The datalab copy wizard helps you through step by step.
Note
A data lab is a separate dedicated work space, also known as a sandbox, sandpit or a test area.
You can get the dataset from various websites; there are tons of websites giving free datasets for analysis.
Getting started
The following are the prerequisites to import the data:
- Create a new user, for example,
Mike
. - Create a new database, for example,
TestDb
. - Allocate space to the new database.
- Grant appropriate access rights to the new database for the new user.
- Create a table DDL under this database with the same column layout as the import file:

How to do it...
Let's begin with importing data using Studio first and then we will move on to SQLA. The following DDL was used to create the table in the new database. Now load the data from the external file. The following steps allow you to do so:
- Go to data explorer.
- Search for the database under which the required table is located:

- Explore the database.
- Right-click on the table,
Name
|Data
|Load Data
:

- The Wizard will come up; select the source as External File:
- On the next screen, just browse to the CSV file you need to load the data from.
- Once the data is loaded, you will get a success message.
- To verify the data, right-click on the table,
Name
|Data
|Sample Data
; a few rows will pop up, showing that the data has been loaded.
In Express
This one is also as easy as Studio Express. The prerequisites are the same as Studio:
- Select the Import data option from the File tab.
- You need to write SQL to start importing the data.
ins into AP.countries (?,?)
?
here defines the number of columns in your file.- Turn off the import function and execute
Sel *
from the table name to verify the data:

Note
Use different formats to import files from Tools
| Options |
Export/Import
.
To use the CSV file, select Options, as shown in the following screenshot:

Data transfer is a two-way street. We sometimes also have requirements to export the data to a file.
Teradata Studio Express and SQL Assistant both can be used to export data as well.