[Tutor] Sorting Data in Databases

Ken G. beachkid at insightbb.com
Mon Nov 23 02:27:29 CET 2009


Greeting: Can someone give me a brief outline of sorting data in 
databases?  I have five databases with numeric values for each item.  To 
be more precise, they are sorted by date and if necessary, by time.  
Currently, I am using Ubuntu 9.04 in the language of Linux and Python is 
my choice of programming language.

The way I use to do it in another programming language (Liberty Basic in 
Windows) was:

1. Count number of data entry in database.

2. Dimension or create an array to equal the maximum number of entry.

3. Copy data entry from database into array.

4. Use the SORT command on array, ascending or descending sequence.

5. Copy sorted data from array into database.

 From what I know of Python so far, is it possible to sort the database 
as it or do I have to copy data into either a list, tuple or dictionary 
and sort there and then, after sorting copy sorted entry back into the 
database.

An outline of what needed to be done will be fine so I can study and 
learn the proper way of doing this in Python.  FWIW, I just finished 
Alan's tutorial on list, tuple and dictionary.  Whew!!!  Quite 
comprehensive.

Again, TIA,

Ken

Thanks, gentleman.

Ken




More information about the Tutor mailing list