Importing and Populating a Database

11 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€46.73
List Price:  €65.43
You save:  €18.69
£39.55
List Price:  £55.38
You save:  £15.82
CA$68.39
List Price:  CA$95.75
You save:  CA$27.36
A$76.50
List Price:  A$107.11
You save:  A$30.60
S$68.11
List Price:  S$95.36
You save:  S$27.25
HK$391.33
List Price:  HK$547.90
You save:  HK$156.56
CHF 45.19
List Price:  CHF 63.27
You save:  CHF 18.08
NOK kr551.82
List Price:  NOK kr772.60
You save:  NOK kr220.77
DKK kr348.47
List Price:  DKK kr487.88
You save:  DKK kr139.41
NZ$84.17
List Price:  NZ$117.84
You save:  NZ$33.67
د.إ183.60
List Price:  د.إ257.06
You save:  د.إ73.45
৳5,499.99
List Price:  ৳7,700.43
You save:  ৳2,200.43
₹4,169.28
List Price:  ₹5,837.33
You save:  ₹1,668.04
RM238.32
List Price:  RM333.67
You save:  RM95.35
₦66,060.50
List Price:  ₦92,489.99
You save:  ₦26,429.48
₨13,951.51
List Price:  ₨19,533.24
You save:  ₨5,581.72
฿1,848.80
List Price:  ฿2,588.46
You save:  ฿739.66
₺1,625.07
List Price:  ₺2,275.23
You save:  ₺650.15
B$255.76
List Price:  B$358.08
You save:  B$102.32
R938.81
List Price:  R1,314.42
You save:  R375.60
Лв91.38
List Price:  Лв127.95
You save:  Лв36.56
₩68,890.62
List Price:  ₩96,452.39
You save:  ₩27,561.76
₪190.87
List Price:  ₪267.23
You save:  ₪76.36
₱2,881.72
List Price:  ₱4,034.64
You save:  ₱1,152.92
¥7,903.16
List Price:  ¥11,065.06
You save:  ¥3,161.90
MX$857.83
List Price:  MX$1,201.03
You save:  MX$343.20
QR182.72
List Price:  QR255.83
You save:  QR73.10
P689.81
List Price:  P965.79
You save:  P275.98
KSh6,639.79
List Price:  KSh9,296.24
You save:  KSh2,656.45
E£2,392.59
List Price:  E£3,349.82
You save:  E£957.23
ብር2,876.01
List Price:  ብር4,026.64
You save:  ብር1,150.63
Kz41,694.65
List Price:  Kz58,375.85
You save:  Kz16,681.20
CLP$47,588.94
List Price:  CLP$66,628.33
You save:  CLP$19,039.38
CN¥362.20
List Price:  CN¥507.11
You save:  CN¥144.91
RD$2,937.78
List Price:  RD$4,113.13
You save:  RD$1,175.34
DA6,709.29
List Price:  DA9,393.54
You save:  DA2,684.25
FJ$113.10
List Price:  FJ$158.35
You save:  FJ$45.25
Q389.77
List Price:  Q545.71
You save:  Q155.94
GY$10,484.28
List Price:  GY$14,678.83
You save:  GY$4,194.55
ISK kr7,005.56
List Price:  ISK kr9,808.34
You save:  ISK kr2,802.78
DH506.20
List Price:  DH708.72
You save:  DH202.52
L888.32
List Price:  L1,243.72
You save:  L355.39
ден2,874.95
List Price:  ден4,025.16
You save:  ден1,150.21
MOP$404.09
List Price:  MOP$565.76
You save:  MOP$161.67
N$945.52
List Price:  N$1,323.80
You save:  N$378.28
C$1,844.23
List Price:  C$2,582.07
You save:  C$737.84
रु6,681.04
List Price:  रु9,353.99
You save:  रु2,672.95
S/188.25
List Price:  S/263.57
You save:  S/75.31
K193.43
List Price:  K270.82
You save:  K77.39
SAR187.48
List Price:  SAR262.49
You save:  SAR75
ZK1,328
List Price:  ZK1,859.31
You save:  ZK531.30
L232.80
List Price:  L325.94
You save:  L93.14
Kč1,174.50
List Price:  Kč1,644.39
You save:  Kč469.89
Ft18,330.20
List Price:  Ft25,663.75
You save:  Ft7,333.54
SEK kr544.35
List Price:  SEK kr762.14
You save:  SEK kr217.78
ARS$43,786.41
List Price:  ARS$61,304.48
You save:  ARS$17,518.06
Bs347.54
List Price:  Bs486.59
You save:  Bs139.04
COP$198,222.27
List Price:  COP$277,527.04
You save:  COP$79,304.77
₡25,463.28
List Price:  ₡35,650.64
You save:  ₡10,187.35
L1,237.47
List Price:  L1,732.56
You save:  L495.08
₲373,144.52
List Price:  ₲522,432.19
You save:  ₲149,287.66
$U1,931.55
List Price:  $U2,704.33
You save:  $U772.77
zł201.47
List Price:  zł282.07
You save:  zł80.60
Already have an account? Log In

Transcript

This lecture will provide two solutions for the Orders table question. There are two ways of adding a table to an existing database, one by importing an existing spreadsheet, or two, using the access GUI and entering the field name and data type for each record. Let us now attempt the first way. As Seen on the screen, I've already created an Excel spreadsheet, I called it orders, you can do the same, that is create your own spreadsheet. Assuming you did this, we will now import the spreadsheet into our database. First, you'll need to know where the spreadsheet was stored to access it later.

Mine was saved in OneDrive documents. I'll elaborate on this further. So let us now go to the Access database We're going to import this table this Orders table. So this is usually, this should be your entry point. We have now got the customer table already created. And we want to add a second table called the order table.

And how are we going to access this? Well, external data, we're going to look for a new source. And the new source is going to be an Excel spreadsheet. And what pops up is a dialog box, asking us first of all, the file name of where the spreadsheet that we're going to import is located. As I mentioned, mine is located on OneDrive documents, but you will have to browse and locate this. So I will find mine which is in the location of OneDrive documents.

And let me try to find the Orders table. And here it is. So I'll double click that. And the Browse button has found the location. And I'm going to import the source data into a new table. Click ok.

This comes up dialog saying that the first row contains some data. Let's see what happens if we click OK. Yes, the first row does include some column headings, and not particularly data, the data follows after the column heading. So I've ticked off the first row contains column headings. Click Next. And it's identified the first field as an ID field and whether or not we want to index our order table on that index of ID.

However, I want to identify that this is The field does but no duplicates around. don't want any duplication on the ID field. And I'll choose my own primary key, which is going to be the ID. And I'm going to call this table, the order table, the front the finished product. Finish. Now, this information box says an index, our primary key cannot contain a null value.

I purposely put in some extraneous data to see what would happen if we want to filter out some of the rows or some of the columns that we don't need. So wait and I'll show you what happened. Okay. We'll save the import steps. And what has happened in the objects pane the left hand side is an order table has been created. Let's have a look at this order table though by double clicking on it.

And here it is. So it seems as if everything is fine, except it has created some data that we don't need to repeat the process by holding down the Shift key clicking on the first row, right clicking and cutting that out. So we want to delete 39 Records. And again, it's just cleaning up our final table which is the order table, so it's always worthwhile once the table has been downloaded to review it and any extraneous data just remove it or modified where it's necessary. So let's complete the process of bringing in the import and from an existing spreadsheet. And downloaded into auditable.

Now let us attempt to create a new table using the access GUI. The first step we will need to do is to go into the table design and enter all of the field names and the data types. Then once we've completed that, we will have to go into the datasheet view and enter some records in other words, populating the database. So let's go through step one. Let us first of all go to the table design form and creating the field names of our audit table. So the field name for the first column eventually is going to be ID and the data type is going to be numeric.

And this is going to be a primary key. So let me just identify this by right clicking and choosing this as a primary key. The second field I need is a foreign key, which is the customer ID, again will be numeric. And let me just add a description by identifying this to be a foreign key. And if we check, the third field is going to be paid. And if you recall, this is a choice is either going to be false or true.

So let us do a lookup wizard on this one. And I will type the values that I want And there's going to be two columns which the first column is going to be true. And the second one will be false as my selection. Next. Next, and we will limit it to list and finish. The third field name is notes.

And the data type is going to be short text certainly sufficient for the notes. We'll be making 255 characters down here and we will enter the date so let's call this The order date short checks and letters entered in as say, day, month, year, something like that. Okay, so those are the five fields that we want entered. So we'll do a Ctrl S and save this as the order table finished. What we want to do now is populate a database populate this particular table. So we'll go into the datasheet view and add sub records.

So the fields have been identified in column markers, and we will enter the ID, customer ID, etc. If we look back on our spreadsheet, we'll see that the first field that we entered was five for the ID And the customer ID was 44. And the selection for this particular order ID was true. And the notes, let's just make up some for a party. And the order date, we said we would enter it as month day year. So all four, and we'll choose this 2017.

Let's tab to the next one, and I'm checking my spreadsheet. The next entry was six for order 135. And this was true also. No notes. However, the date on this one was old 912 2017. And let's just add one more.

Thank you. Getting the idea. We certainly don't have the convenience of all the records in the spreadsheet and downloading them. And we're putting them in manually a record at a time. And this third one is a customer id 131. We'll tab over.

And again, now let's change it, make it false. For holiday and make up a date let's call this the 2012 and again 2017 Okay. So certainly that is sufficient to populate in this particular case three records is so what we have done is provide a second way of creating a table. First of all, of course, we went into the table design and added the fields and all of the columns customer ID paid On order date, and we've entered the actual values by going into the datasheet view, and we can add all of the records. We've only entered three of them. So that completes the second alternative in populating the database.

First one, of course is by using an existing spreadsheet. And in this particular case, we took advantage of Microsoft Access GUI

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.