A Windows XP help forum. PCbanter

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   Home » PCbanter forum » Windows 10 » Windows 10 Help Forum
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Two data types in the one field?



 
 
Thread Tools Rate Thread Display Modes
  #1  
Old June 20th 19, 05:29 AM posted to alt.comp.os.windows-10
Peter Jason
external usenet poster
 
Posts: 2,310
Default Two data types in the one field?

In a database is it possible to have two data types in the one field?

For a currency field, can a small text identifier be included in this
field to differentiate between several identical sums.?

Ads
  #2  
Old June 20th 19, 08:51 AM posted to alt.comp.os.windows-10
Chris
external usenet poster
 
Posts: 832
Default Two data types in the one field?

Peter Jason wrote:
In a database is it possible to have two data types in the one field?

For a currency field, can a small text identifier be included in this
field to differentiate between several identical sums.?


Only if the field is defined as a string I.e. VARCHAR. But then that's not
very useful as then you can't do queries based on value comparison like
give me all rows 100.

You're best to add an additional column with the descriptor.

  #3  
Old June 20th 19, 11:27 AM posted to alt.comp.os.windows-10
Philip Herlihy
external usenet poster
 
Posts: 208
Default Two data types in the one field?

In article ,
says...

In a database is it possible to have two data types in the one field?

For a currency field, can a small text identifier be included in this
field to differentiate between several identical sums.?


I'd guess you're starting to develop a database, or maybe this is a
college-related question?

You need to know about the existence of the topic of "normalisation".
Generally, it's the process of analysing what you want to store in such
a way as to give the maximum flexibility in manipulating and querying
that data. It tends to lead to more columns, and more rows, than a
newcomer might expect. If you get the table design right then
everything that follows is an order of magnitude easier. You'd only
deviate from the basic rules ("normal forms") if performance is an issue
in a very large database.

So if, for example, you wanted to store a currency value but for more
than one currency (dollar, euro, etc) you'd normally have a separate
field for the currency type.

Normalisation is one of those things that can be initially baffling, but
once you "get it", it suddenly seems obvious!

I've cast about for a good introduction - this might be of interest:
https://www.youtube.com/watch?v=vIsO34Ei1-4

--

Phil, London
 




Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off






All times are GMT +1. The time now is 06:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.