Reply to Re: Learning php Sql -EDITED- ignore other post from today

Your name:

Reply:


Posted by strawberry on 06/14/06 17:23

Well, it's definitely a 'Pass'. I'm not sure I'm qualified to give you
a grade though!

A couple of things. Apologies if they've been covered before...

I think I'd have separate tables for things like Cities and States -
just like you do for ZipCodes, that way they can be selected from drop
down lists - so less chance of typos. In fact, as you go along you
might find ways of constructing context sensitive select boxes, thereby
speeding up data entry (although this might not be such a big deal).

I'd have separate fields for first and last name. You can concatenate
these items when presenting them to the viewer if you like. It just
makes searching by both first name and last name a little neater.

Also, unless you deal with properties on Lake
Chargogagogmanchargogagogcharbunagungamog, MA - or insist on referring
to LA by it's (alleged) full proper name - VARCHAR (45) is probably a
little over the top. I suspect VARCHAR(20) would suffice.

Conversely VARCHAR(50) might not be sufficient for websites. This page,
for instance, is listed in my browser as being 185 characters long. I'd
make websites VARCHAR(200) or
VARCHAR(255).

I'm still not sure that the images bit is flexible enough, but I guess
it's a start.

I love that they do pets by weight. Only in America.

Anyway, a great start.

Frankly wrote:
> --
>
> Frank
> PHPmySQL1@yahoo.com
> "Frankly" <PHPmySQL1@yahoo.com> wrote in message
> news:jPVjg.5322$891.5296@trndny01...
> >
> >
> > "Frankly" <PHPmySQL1@yahoo.com> wrote in message news:...
> >>
> >>
> >>>> "J.O. Aho" <user@example.net> wrote in message
> >>>
> >>> Seattle WA98108,WA98109,...
> >>>
> >>> will be slower to search than
> >>>
> >>> Seattle WA98108
> >>> Seattle WA98109
> >>>
> >>> and the fist one makes you can't have real relations between the
> >>> ZipTable and other tables (JOIN won't work), so the later is always a
> >>> better one.
> >>>
> >>>
> >>>
> >>> //Aho
> >>
> >
>
> That is how I will do it.
> I remember a while back when we talked about the RelationManagementBuildings
> table.
> I wasnt sure if i should put a primary key there and you replied something
> like.
> it is a good idea to have "A" primary key in that table. Some of the stuff
> I
> read says that in some cases it might be better to have both ManagementID
> and BuildingsID set as primaries. However you said "A" primary key. I
> want to build this database according to what you think is best. do you
> think it is better to only use A primary key or should i set both.
>
> in the begining i felt it was better to explore my choices and build tables
> from within the Admin. however at this point you are so right. I just
> created the tables and here goes.
> I am not sure if Management and buildings table should hold the primary keys
> or
> the relations building should hold both.
>
> time to hold my nose and jump in - now the fun starts. i am a bit nervous
> about what I have already forgotten to do
> in the tables below. if you feel something looks like i didnt put enough
> effort into it please tell me the terms I should look up.
>
> Management Table
>
> ManID - Int Auto unless relations table holds both primary keys.
> Name - varchar (45)
> Contact - varchar (45)
> Phone - Varchar (45)
> Address - Varchar (45)
> City - varchar (45) default New York
> State varchar (2) default NY
> ZipCode - Varchar (10)
> Website - Varchar (50)
>
> Buildings Table
>
> BuildingID INT Auto
> Name - Varchar (45)
> Address - varchar ( 50 )
> Cross streetA - Varchar 50
> Cross StreetB - Varchar 50
> WebSite - Varchar 50
> Picture - Varchar 50
> Elevator- varchar 1
> Laundry - varchar 1
> Pets - varchar 1 - sometimes they do allow pets that are smaller than 12lbs.
> so i am thinking pets comments feild.
> pets comments if pets = 1
> Gym -varchar 1
> video intercome varchar 1
> contact varchar 45
> contact phone varchar 45
> Area varchar 45
> Zip Code Varchar 45
>
> RelationManagementBuilding table
>
> ManagementID INT
> BuildingID INT
>
> Apartments Table
>
> ApartmentID - int
> BuildingID - int
> Rent - dec
> AptNumber - varchar 6
> Bedroom - dec 3
> bathroom - dec 3
> WebSite varchar 50
> Picture varchar 50
> Notes - text - there will be 4 picture fields and 1 note field for each
> picture.
> MoveInDate - Date 0000-00-00
> Still Available Varchar 2
>
> ZipArea table
> ZipCode varchar 10
> Area varchar 45
>
> i feel like i am handing in a very important test and this is the easy part.
> how bad did i do.
> i know i have forgotten alot of what i read.
> after this I am going to look into creating relations using the admin tool.
>
> I started this a couple of days ago and have been away since.
> Thank you
> Frank

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация