Hai, Good Evening Dudes,
I need to store phone numbers in DB like this,
I have one Emp table in that i have to store mobile numbers ,like this
Emp Tab:
-----------------
EmpId EmpName EmpPhoneNum
1 Siva 9123456789
Suppose one Employee have 2 or more mobile numbers means how to store it ? ? ?
EmpId EmpName EmpPhoneNum
1 Siva 9123456789,9212345678,............
like this and same time i want to update nums and also i want to delete particular number only...
Thanks In Advance :)
Loading


Christopher Loyd4 reputationPosted Jun 16, 2013, 9:08 AM EDT
Riyaz AkhtarRank #2,275 · 619 reputationPosted Jun 16, 2013, 10:08 AM EDT
You create columns in same table if you know the max limit of phone numbers. Generally employee phone number can be either mobile number, work Phone, home Phone, alternative number.
But if you dont know the limit then I suggest you to create a new table to store employee's phone number, it will be easy to maintain the data future. Your new table will store data like below:
Table: [your new table]
EmployeeID PhoneNumber
101 3434343434
101 4324243244
suren v112 reputationPosted Jun 16, 2013, 8:03 PM EDT
Yes i try this , add new columns into the Emp table? Like EmpPhoneNum1, EmpPhoneNum2, etc. And same time i dono how many mobile nums per person having ? like this 1 person having 3 nums means suppose another person having 5 that time how we ll create an columns ? ? ?
Thanks For Your Reply :)
suren v112 reputationPosted Jun 16, 2013, 8:13 PM EDT
Ok Dude, Suppose i create a table for phone nums means ...
PhoneNum Tab:
--------------------
EmpId EmpNum1 Epnum2 Empnum3
1 Ph1 Ph2 Ph3
main thing i dono per person how many nums having suppose they have 2 , 3 , 4 r 5 ..... Like this
That time how we ll create a columns ? for this ? ? ?
Thanks For Reply :)
Kiresh Gangariya52 reputationPosted Jun 16, 2013, 9:02 PM EDT
you should go with Riyaz way and its good way to fullfill your scenario .