In this tutorial , we wish to import the following data from RegionData.xlsx:
Region
Population Size
Couva–Tabaquite–Talparo
178,410
Diego Martin
102,957
Mayaro–Rio Claro
35,650
Penal–Debe
89,392
Princes Town
102,375
San Juan–Laventille
157,258
Sangre Grande
75,766
Siparia
86,949
Tunapuna–Piarco
215,119
NOTE: If you don’t have the provided excel file, you can always copy and paste the table above into a new excel document, save it, and use it for this tutorial.
Add a new table named Region. The design View Is shown Below:
Close the table after creation.
2. “RegionData.xlsx” contains data formatted to match the region and population size of our Region table. The column names are the same in both tables. Start the process to Import the data from “RegionData.xlsx”:
a) Select the “External Data” tab
b) Choose “New Data Source”
c) Hover over “From File”
d) Choose Excel
3. Use the wizard:
a) Browse to and select “RegionData.xlsx”
b) Choose “Append a copy…”
c) Select the region table from the dropdown
4. Choose Next:
5. Choose Finish
6. Choose Close:
7. Done! Open your table to verify that the data was imported:
In this post, we observe our first database created in our last tutorial and learn the terminology associated with it. See the video below and the notes that follow:
A single row in a database table. (also known as tuple). A record consists of 2 or more fields.
Field
A single item of data in a record. It can be thought of as a column in a table. (also known as an attribute)
Data type
The type of data that can be saved in a field. The database management system (DBMS) only allows the specified datatype for each field. For example, The DBMS would not allow text data to be saved in a field that has a data type of “Date/Time”.
Primary Key
A field that uniquely identifies each row in a table or entity. It is always present for each row, i.e. It is never allowed to be blank or empty.
Foreign key
This is a field used to store primary key data from another table. This allows for tables to be related.
Key (or Key field)
Either a primary key or foreign key. Primary keys and foreign keys are called keys because they can be used to represent a record in a table.
Composite Key
when two or more keys are combined to form another.
Composite Primary Key
When 2 Keys are combined to form a primary key.
Candidate Key
A key or composite key that can be reasonably assumed to uniquely identify a row in a table.
Terminology With examples and explanation
Record – A single row in a database table. (also known as tuple). A record consists of 2 or more fields. E.g, a single row in our subject table.
Field – A single item of data in a record. It can be thought of as a column in a table . (also known as an attribute) E.g “First Name” in our student Table
Data type – The type of data that is allowed to be saved in a field. The database management system (DBMS) only allows the specified datatype for each field. For example, The DBMS would not allow text data to be saved in a field that has a data type of “Date/Time”.
Primary Key – A field that uniquely identifies each row in a table or entity. It is always present for each row, i.e It is never allowed to be blank or empty. E.g Student ID
Foreign key – This is a field used to store primary key data from another table. This allows for tables to be related. E.g Student ID in our enrolment table.
Key (or Key field) – Either a primary key or foreign key. Primary keys and foreign keys are called keys because they can be used to represent a record in a table. E.g any primary or secondary key found in the database tutorial.
Composite Key – when two or more keys are combined to form another. E.g (Student ID, Subject Code) from our Enrolment Table.
Composite Primary Key – When 2 Keys are combined to form a primary key. For example, in our student table, we could use a students last name, first name and DOB combined to be the primary key for our table .(This is assuming that we never encounter two students with the same names and date of birth!)
Candidate Key – A key or composite key that can be reasonably assumed to uniquely identify a row in a table. E.g (First Name, Last Name, DOB) in the student table.