473,387 Members | 1,638 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to update data after normalising a database?

31
I have inherited a database for placing job seekers into jobs. The original table has 3 fields which contain job preferences using codes which had to be looked up in a book. There are around 5000 plus records in this table.

I have created two more tables, one for the Job Preferences and the other as a look up table with all the Job names (and codes).

My goal is for the table tblJobChoices to hold the job preferences and be linked to the main table instead of using the current three fields. The other table, tblJS_JobCategories will ensure consistent data entry.

Here are the tables with relevant fields.

Main Table: tblJobSeeker
Fields: JobSeekerID (Primary key), JC1, JC2, JC3 all of which holds the Job Preference codes.

Table to hold the Job Seeker’s Job Preferences: tblJobChoices
Fields: JobCode (text), Job Seeker (number – links to tblJobSeeker:JobSeekerID) There is no primary key

Lookup table for all the Job Names and codes. tblJS_JobCategories
Fields: Job Code (text – indexed no duplicates), Job Category (text), Job_Title (text – indexed duplicates allowed) There is no primary key. There is over 600 Jobs Names in this table.

My problem: How to create a query (update or append-not sure) to populate the tblJobChoices with the data that corresponds to the tblJobSeeker.JC1, JC2 and JC3 fields.

For example, if JC1, JC2 or JC3 for a particular Job Seeker = code RS11, then I want to create a record in the tblJobChoices table so that field JobCode = “Sales Assistant” which is the Job Title for the RS11 code.

I am prepared to ignore the tblJS_JobCategories table and process each code manually – it is still better than trying to update each Job Seeker record individually, but if someone can come up with a query that will populate the tblJobChoices by using the tblJS_JobCategories data then that is even better.
Aug 3 '07 #1
3 1616
OzNet
31
I have inherited a database for placing job seekers into jobs. The original table has 3 fields which contain job preferences using codes which had to be looked up in a book. There are around 5000 plus records in this table.

I have created two more tables, one for the Job Preferences and the other as a look up table with all the Job names (and codes).

My goal is for the table tblJobChoices to hold the job preferences and be linked to the main table instead of using the current three fields. The other table, tblJS_JobCategories will ensure consistent data entry.

Here are the tables with relevant fields.

Main Table: tblJobSeeker
Fields: JobSeekerID (Primary key), JC1, JC2, JC3 all of which holds the Job Preference codes.

Table to hold the Job Seeker’s Job Preferences: tblJobChoices
Fields: JobCode (text), Job Seeker (number – links to tblJobSeeker:JobSeekerID) There is no primary key

Lookup table for all the Job Names and codes. tblJS_JobCategories
Fields: Job Code (text – indexed no duplicates), Job Category (text), Job_Title (text – indexed duplicates allowed) There is no primary key. There is over 600 Jobs Names in this table.

My problem: How to create a query (update or append-not sure) to populate the tblJobChoices with the data that corresponds to the tblJobSeeker.JC1, JC2 and JC3 fields.

For example, if JC1, JC2 or JC3 for a particular Job Seeker = code RS11, then I want to create a record in the tblJobChoices table so that field JobCode = “Sales Assistant” which is the Job Title for the RS11 code.

I am prepared to ignore the tblJS_JobCategories table and process each code manually – it is still better than trying to update each Job Seeker record individually, but if someone can come up with a query that will populate the tblJobChoices by using the tblJS_JobCategories data then that is even better.
I have found a way around my problem.
I created an append query and ran it three times to append the JC1, JC2 and JC3 fields and the JobSeekerID field using a criteria "is not null" to the tblJobChoices table.

I then created an update query to update the tblJobChoices.JobCode field with the tblJS_JobCategories.Job_Title field using a criteria of tblJobChoices.Job Code = tblJS_JobCategories.Job Code.

I ended up with the result I wanted except for a few records which I think maybe due to incorrect data entry initially. I have to check that out next week.

Someone with more experience and skill may have a better solution but at least I got where I needed to go.
Aug 3 '07 #2
NeoPa
32,556 Expert Mod 16PB
A large question, but from what I could see well expressed. Always hard to answer nevertheless.
Thanks for posting your solution, and that you had one. It helps for other members to see an answer if any are researching similar problems :)
Aug 3 '07 #3
NeoPa
32,556 Expert Mod 16PB
Having read your question now (I was intrigued) it seems you came up with a pretty decent solution anyway. No need to improve on that one I think :)
Aug 3 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Niyazi | last post by:
Hi, I have not understand the problem. Before all the coding with few application everything worked perfectly. Now I am developing Cheque Writing application and when the cheque is clear the...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
5
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by...
2
by: Joe Fetters via .NET 247 | last post by:
Have googled and read the VS.NET documentation can't seem to getthe answer to the following. Environment: Framework 1.1 VB.NET WinForm Access database Using all automagic tools (DataAdapter...
0
by: Vijay Balki | last post by:
I am fetching data in DataSet - myDataSet, from a remote database using a Web Service in my VB.NET client..Once I fetch it I store the data in XML file (myXMLFile) using the WriteXML method of the...
8
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. ...
2
by: TJ | last post by:
Hi All, I am having some trouble. I have created a database via the new database option inside VWD2005. Then and table or two. I have been able to perform INSERT and SELECT operations on...
2
by: Miro | last post by:
I will ask the question first then fumble thru trying to explain myself so i dont waste too much of your time. Question / Statement - Every mdb table needs a PrimaryKey ( or maybe an index - i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.