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 > Database Server Software > MySQL > user table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-07-07, 12:42
umarrana umarrana is offline
Registered User
 
Join Date: Sep 2007
Posts: 1
user table

hello dear friends i create a mysql database and a table i am new user of mysql so i create this database for user registration ...... but i want to know i create right table structure if not so please help me

this is my table structure



-- Table structure for table `user`
--

CREATE TABLE `user` (
`ID` int(56) NOT NULL auto_increment,
`UserName` varchar(35) NOT NULL,
`Password` varchar(35) NOT NULL,
`FullName` varchar(35) NOT NULL,
`HomeAddress` varchar(35) default NULL,
`City` varchar(35) NOT NULL,
`Birthdate` datetime NOT NULL,
`HomePhone` varchar(35) default NULL,
`MobilPhone` varchar(35) default NULL,
`Email` varchar(35) NOT NULL,
`Picture` varchar(56) NOT NULL,
`Designation` varchar(35) NOT NULL,
`DepartmentID` varchar(35) default NULL,
`Session` varchar(35) NOT NULL,
`ProgramName` varchar(35) NOT NULL,
`LifeAchivements` varchar(35) default NULL,
`ProfessionalLife` varchar(35) default NULL,
`Survey2` varchar(35) default NULL,
`Survey3` varchar(35) default NULL,
`Survey4` varchar(35) default NULL,
`Survey5` varchar(35) default NULL,
`Group_id` varchar(35) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

--
-- Dumping data for table `user`
Reply With Quote
  #2 (permalink)  
Old 09-08-07, 08:38
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Code:
...
`Survey2` varchar(35) default NULL,
`Survey3` varchar(35) default NULL,
`Survey4` varchar(35) default NULL,
`Survey5` varchar(35) default NULL,
...
This is incorrect.
You will want to create a second table for Surverys with a foreign key reference to the user table.
E.g.
Surveys(SurveyID, StudentID, OtherAttributes....)

More on normalization here
__________________
George
Twitter | Blog
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