简体   繁体   中英

Database designing

Table        Column Name             Datatype   Allow Null
---------------------------------------------------------
LOGIN Table   LOGIN NAME             Varchar        No                                        
              PASSWORD               Varchar        No                                          
View Table    id                     int            No                                                
             About                   Varchar        No                                         
             From                    Varchar        No                                             
             Date                    Varchar        No                                          
             Rating                  int            yes                     
             message                 Varchar(max)   No                                       
             Delete status           Boolean        yes                                           
             Public/private          Boolean        No                                                                                     
             Anonymous               Boolean        yes                           
             Employee                Boolean        No                  
             Manager                 Boolean        No
             sent tag  status        Boolean        No                              
TagSetting 
  table      tags                    varchar        No                                 
             number of received Tag  Boolean        no                          
             number of sent Tag      Boolean        no                    

the above is the database i have created for mobile application.screen shots of mobile app has been shared in

link

<https://drive.google.com/file/d/0B3rwx3ewVuDJd2xFVHFZNGpFb21RZ1VleWhFbWhLV0tnblhN/view? usp=sharing>? 

explanation :This app is mainly to keep track of employee and his remarks.there is a login screen in which user as to enter username and password.if valid it is routed to home screen.in home screen there is tag tab,sent tab and write tab.in sent and tag tab there is dropdown menu when preesed there are 2 options all message and my message.in write tab when preesed my journal entry dropdown three list displayed.in send a tag list (slide 7)we have send to option in that 2 checkbox given for indicating manager and employee in this user can check both option.and in sender option check is given to anonymous to indicate that name of employee is not revealed.last slide show settings of tag .those indicates number of tags should be shown to user.as i am new to database i dont know it is correct way to store details.let me know if there is any wrong.please help me..

Does "from" connect to a login id? That would seem the logical way to do this. If so, some of the information in View is about the user and not about the specific message. For example, whether a user is an employee or a manger would, I think, be the same for all his messages. If that's the case, then this information should be in the Login table and not the View table. Also, are employees classified as being either "employees" or "managers", so that these two are mutually exclusive? If so, then you don't need two separate flags for this idea. Or are there three categories of people here: non-employees, employees who are managers, and employees who are not managers? If so, having two Booleans creates the possibility of the nonsensical combination "manager=true, employee=false". If that's the case I'd have one field with 3 possible values.

Side note: "view" is an odd name for this table. It seems to be a table of "messages" or "posts", not of "views". Presumably users will "view" all the information in the database.

Why is "anonymous" allowed to be null? Wouldn't every message be anonymous or not? "Unspecified" would not seem to be a meaningful value. You have to either reveal the id of the sender or not, so if the user doesn't specify, it has to default to yes or no.

"Date" should not be a varchar but a "date" field. You say you're using sql-server. Sql-server has a date data type.

I'm not sure what you're trying to do with the "tags". If tags are text that can be attached to a message -- like the tags on this web site -- then somewhere you need a table that links tags to messages. And what are "number of received tag" and "number of sent tag"? You say these are Booleans. But if they are the "number of" something, should they be integers? Well, I'm not sure what the tags are all about so maybe I'm missing the point here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM