If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Problem writing Pseudocode

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-12-09, 15:39
osimini osimini is offline
Registered User
 
Join Date: Jun 2008
Posts: 23
Problem writing Pseudocode

How can I write a structured English Pseudocode for matching two – to extract matching data record from the table called “tblState” to update called tblCity. Below are the fields. I wan to extract NPI number from the tblState and update into tblCity. I am looking for Pseudocode for (a) matching, (b) validation, (c) update the record to tblCity table. Please really need somebody’s help.

tblState
NPI
Org_Name
Practice Address
Zip
State code
Identifer ID
Primary Taxanomy


tblCity
Org_Name
Practice Address
Zip
State code
Identifier_ID
Primary Taxanomy
Reply With Quote
  #2 (permalink)  
Old 05-12-09, 16:06
dportas dportas is offline
Registered User
 
Join Date: Dec 2007
Location: London, UK
Posts: 732
Are you familiar with relational algebra? If so you shouldn't find it too difficult to write an expression for this. Then you can transform that into plain English.
Reply With Quote
  #3 (permalink)  
Old 05-12-09, 16:53
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
I would suggest using a keyboard and computer, although purists seem to do all of their pseudo-code using paper and pencil. I prefer the neater appearance and the ease of editing offered by a computer.

Either way, the process of writing the pseudo-code is just to take the steps that you'd give your grandpa to do the task and write them so clearly that even your little siste would understand them. Break the process down into simple, repeatabe steps then write the words needed to describe those steps so that even someone with limited language skills could understand them.

Voila! It doesn't really matter whether you use a pencil or a keyboard, the logical process is exactly the same with minor differences in the physical details.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #4 (permalink)  
Old 05-14-09, 14:12
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
Here's the way I might start writing the pseudocode for matching:

Code:
Procedure Matching({{What are the inputs?}})
    {{Do I have to do anything with the inputs right away?}}
    PROBABLY START HERE: {{What steps do I do for matching?}}
    {{What are the outputs?}}
    {{Do I have to do any cleanup?}}
End Procedure
The trick to writing pseudocode is to start at a very high level and then fill in the details until your algorithm is complete.

If I were writing pseudocode for sorting, I might start with:

1. Sort some numbers.

Okay, what are my inputs and outputs?

1. Procedure SortNumbers(List of Integers unsortedList)
2. Sort unsortedList
3. Return unsortedList -- which is now sorted
4. End Procedure

Okay, maybe it's a bubble sort:

Code:
Procedure SortNumbers(List of Integers unsortedList)
  Count with Counter from 1 to Length of unsortedList
     Bubble Sort elements from Counter to end of unsortedList
  End Count
  Return unsortedList -- which is now sorted
End Procedure
And so forth until you've got it to the level of detail you need.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On