You are here: Re: Learning php Sql - « PHP SQL « IT news, forums, messages
Re: Learning php Sql -

Posted by Frankly on 09/28/62 11:50

>> I am thinking it would be better to hardcode the path. I tried to do the
>> 2 foreign key, primary key thing.
>
> Should be
>
> CREATE TABLE tablename( id1 INT, id2 INT, PRIMARY KEY(id1,id2));

i dont know what code was created within the admin. now that I think my
tables are stable enough
its time to try this 2 primary key thing. ok ok I know its not ready yet.
that new ImageApartmentsBuildings table got me not knowing again.


> You could make a relation table with ImageID, ApartmentID and BuildingID,
> this way you don't have to make as many joins if you want to show pictures
> from all apartments in a building. The ImageID could be the name of the
> picture.
>
>
> //Aho

I have been looking at other database relationships trying to figure out how
I can use it to create my relations. I don't know if this is right at all.



Management Table



ManID - Key, Int Auto

Name - varchar (45)

FirstName - Varchar (20)

LastName - varchar (20)

Phone - Varchar (20)

Address - Varchar (45)

City - varchar (20) default New York

State varchar (2) default NY

ZipCode - Varchar (10)

Website - Varchar (255)



Buildings Table - for the yes/no fields I would like to create a default
that isn't yes or no.

One that lets me know that information isn't known yet. I am thinking a
default of 2 for unknown.



BuildingID - Key - INT - Auto

Name - Varchar (20)

Address - varchar ( 45 )

Cross streetA - Varchar 50

Cross StreetB - Varchar 50

WebSite - Varchar 255

Picture - Varchar 25

Elevator- varchar 1 default 2

Laundry - varchar 1 default 2

Dogs - varchar 1

Cats - varchar 1.

pets comments if pets = 1 - if empty dont show.

Gym -varchar 1

video intercome varchar 1

contact varchar 45

contact phone varchar 45

Area varchar 20

Zip Code Varchar 10



RelationManagementBuilding table



ManagementID INT

BuildingID INT



Apartments Table



ApartmentID - PK auto - int to image table?

BuildingID - int

Rent - dec

AptNumber - varchar 6

Bedroom - dec 3

bathroom - dec 3

WebSite varchar 255

Picture varchar 25

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 20





RelationPictureApartmentBuilding Table\

ImageID Auto

ApartmentID F, int to apartments table

BuildingID int



I have been looking at other database relationships trying to figure out how
I can use it to create my relations. I don't know if this is right at all.

 

Navigation:

[Reply to this 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

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