New to databases, Please help

databases, vb.net what to use.

Page 1 of 1

6 Replies - 1848 Views - Last Post: 13 April 2006 - 01:36 PM Rate Topic: -----

#1 IainMackay85  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 07-May 05

New to databases, Please help

Posted 11 April 2006 - 11:44 AM

Hi there,

I normally don't bother with databases, i just store the info in a file, but this time i plan to have alot of info to store and its going to be of the upmost importance the information doesn't get lost. i plan to write the app using vb.net. I would like advice on what would be the simplest database to use with this. Also in my way of thinking about the database design i end up with a field that would require a list, ie. in a database called orders it would contain a field called products within that an arbutory number of codes would be held depending on the number of items ordered. how would i achieve a list or am i doing it the wrong way. your input is much appreciated.

Thanks

Iain

Is This A Good Question/Topic? 0
  • +

Replies To: New to databases, Please help

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: New to databases, Please help

Posted 11 April 2006 - 12:20 PM

Well, it really depends on what other information is available, or how you'll want to access the information you do have. If you are tracking orders, you can certainly have a field that contains a string that is a list of products for that order. to normalize even further, you could have a separate table that lists each ordered product separately, using the order number as a common identifier (but this is only really needed if you'll be digging further down on analysis or reporting). If you simply want to track which products have been ordered on a specific order, a concatenated string is fine (although you may have to split the string if any processing is required from another module of the application).

The .NET languages work quite well with most databases, but SQL Server or Access are developed by M$ as well, so the integrated support is fairly extensive. You can use Oravle, MySQL, PostgreSQL, or others as well.
Was This Post Helpful? 0
  • +
  • -

#3 IainMackay85  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 07-May 05

Re: New to databases, Please help

Posted 11 April 2006 - 12:38 PM

yes i would prefer to use a seperate table for it because i want it to be very open to allow calls from all aspects by the app. ie. might decide i want a list of every customer thats ever ordered item 1234. but in saying that if it is not worth the extra effort i won't and just use the very good concentrated string idea. but my problem is the number of products ordered is unknown so how do i make a table fitting? if you think i'm just digging too deep just tell me. Its just that i've never programmed properly before i just cross problems as i come to them.

thanks again

Iain
Was This Post Helpful? 0
  • +
  • -

#4 TomMcD  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 31-May 05

Re: New to databases, Please help

Posted 11 April 2006 - 01:56 PM

Have a table for Customers, billing address, shipping address

One for Products, id, description, weight(for shipping?)

One for Orders, order id, customer id, product id, qty, have separate line for each product bought, and order id ties order together.

just m2c

--tom
Was This Post Helpful? 0
  • +
  • -

#5 IainMackay85  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 07-May 05

Re: New to databases, Please help

Posted 11 April 2006 - 02:44 PM

my problem is if i make a table with say:
order ID, customer id,product1 ID, qty1, product2 ID, qty2, product3 ID.... where do i stop, and when i do stop is that going to be enough? i would like in an ideal world a list field where i could list the product ids, but i may just have to use the very good afore mentioned string idea.

thanks

iain
Was This Post Helpful? 0
  • +
  • -

#6 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1858
  • View blog
  • Posts: 20,275
  • Joined: 17-March 01

Re: New to databases, Please help

Posted 11 April 2006 - 03:08 PM

You should have the following table layout:

Customers
----------------------
id
first_name
last_name
phone
address
city
state
zip
.
.

Products
-------------------
id
name
price
description
.
.

Orders
-------------------
id
customer_id
order_date
shipping_address
status
.
.

Invoice
-------------------
id
order_id
product_id
qty


So, a CUSTOMER makes an ORDER which has an INVOICE. The INVOICE has the ORDER_ID, and the PRODUCT_ID, and the QTY. The items on the invoice are associated to the ORDER, which is associated to the CUSTOMER.

That isn't 100% normalized, but it's a good start.
Was This Post Helpful? 0
  • +
  • -

#7 IainMackay85  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 07-May 05

Re: New to databases, Please help

Posted 13 April 2006 - 01:36 PM

thats what i needed, now i can have multiple products for one order.

cheers,

Iain
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1