Please Comment your reviews... (1 Viewer)

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 17:41
Joined
Mar 22, 2009
Messages
785
Relationships.jpg
 

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 17:41
Joined
Mar 22, 2009
Messages
785
Booking, Trip and Closing are Single Entity only. But has been seperated as the processes are happening on different date/time intervals...
 

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 17:41
Joined
Mar 22, 2009
Messages
785
Anyways... TRIP.BookingID and Closing.TripNo has been set to indexed(No Dpulicates)
 

plog

Banishment Pending
Local time
Today, 07:11
Joined
May 11, 2011
Messages
11,653
1. Give us some words. We know nothing of your database nor organization. Tell us what your organization does, then tell us how this database will assist you in that.

2. Circular relationship. There should only be one way to travel between 2 tables in a relationship. Driver, Expenditure and Trip form a loop--one of those relationships should go. Can a driver have an expenditure for a trip that he's not part of? Driver should only be linked to one of those tables.

3. Better field names.
3A--as others have said you are using reserved words.
3B--overly generic names. DateVal tells me nothing about what that date represents, just that it is a date of some sort for some reason.
3C--Only use alphanumeric and underscores in names. That means no spaces or special characters. It will make coding an querying easier in the future.

4. A Booking can have multiple trips? Explain that with an example please.
 

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 17:41
Joined
Mar 22, 2009
Messages
785
1. Give us some words. We know nothing of your database nor organization. Tell us what your organization does, then tell us how this database will assist you in that.

2. Circular relationship. There should only be one way to travel between 2 tables in a relationship. Driver, Expenditure and Trip form a loop--one of those relationships should go. Can a driver have an expenditure for a trip that he's not part of? Driver should only be linked to one of those tables.

3. Better field names.
3A--as others have said you are using reserved words.
3B--overly generic names. DateVal tells me nothing about what that date represents, just that it is a date of some sort for some reason.
3C--Only use alphanumeric and underscores in names. That means no spaces or special characters. It will make coding an querying easier in the future.

4. A Booking can have multiple trips? Explain that with an example please.
1. Building a Tool for a Cab-Hiring Agency.
2. A Driver can drive multiple trips irrespective of incurring expenditures for him like Tea-Fare, Snacks and Health Expenses.
3A. Corrected
3B. As there is only one Date is involved has to be understood Booking_Date in Booking and Expenditure_Date in Expenditure Table respectively.
3C. Model_Name (Ignoring for Name. Will correct in the Future)
4.Set to Indexed (No Duplicates)

Thanks...
 

sonic8

AWF VIP
Local time
Today, 14:11
Joined
Oct 27, 2015
Messages
998
Booking, Trip and Closing are Single Entity only. But has been seperated as the processes are happening on different date/time intervals...
Anyways... TRIP.BookingID and Closing.TripNo has been set to indexed(No Dpulicates)
As proven by the comments in this threat, this is confusing and thus not a good idea.
Get rid of the artificial Ids in the Trip and Closing tables, and make Booking.Id their primary key. Then the relations will be clearly shown as 1:1 and it will allow you create queries without the requirement to use the intermediary tables to retrieve the artificial keys.
 

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 17:41
Joined
Mar 22, 2009
Messages
785
As proven by the comments in this threat, this is confusing and thus not a good idea.
Get rid of the artificial Ids in the Trip and Closing tables, and make Booking.Id their primary key. Then the relations will be clearly shown as 1:1 and it will allow you create queries without the requirement to use the intermediary tables to retrieve the artificial keys.
Excellent piece of Advice. Thanks Sonic...
 

plog

Banishment Pending
Local time
Today, 07:11
Joined
May 11, 2011
Messages
11,653
Your last post makes it seem that you have gone in the wrong direction and further complicated the relationship among Trip, Expenditure and Driver. Where you had 3 relationships initially (1 from each table to each of the other tables), I now count 4 relationships among those 3 tables. You should have but 2 relationships among them.

Also, you now have a 1-1 relationship between Trip and Closing. That is incorrect as well. There is no need for a 1-1 relationship in a database--simply put the Closing information in the Trip table.
 
Last edited:

Thales750

Formerly Jsanders
Local time
Today, 08:11
Joined
Dec 20, 2007
Messages
2,149
Your naming convention is going to plague you until finally you will start all over from scratch.
 

plog

Banishment Pending
Local time
Today, 07:11
Joined
May 11, 2011
Messages
11,653
Without copy and pasting from my post on January 16th, please tell me what my main point of that post was. Then tell me how your latest screenshot took that advice into consideration.
 

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 17:41
Joined
Mar 22, 2009
Messages
785
Without copy and pasting from my post on January 16th, please tell me what my main point of that post was. Then tell me how your latest screenshot took that advice into consideration.
Latest.jpg
 

Users who are viewing this thread

Top Bottom