Service Ticket Table(s) (1 Viewer)

As has been pointed out by others, the process of normalization is crucial to the design of tables in a relational database. To understand normalization it is firstly necessary to have a good understanding of the concept of functional determination, which is the basis of the principles on which normalization, as the term is most commonly used, is based. There are alternative normalization schemes which make no mention of functional determination, but I'm not concerning myself with those here.

Let's consider your original tblService table as an example. This includes the following columns:

ContactName
ContactPhone
ContactEmail

The ContactName table is functionally determined by the table's primary key, i.e. for each value of ServiceID the value of ContactName for the service in question is known. Moreover, it is known in this table only from the table's key. It is therefore functionally determined in this table solely by the whole of the key. On the basis of this column alone therefore the table would be normalized to Third Normal Form (3NF) whose formal definition is:

Third Normal Form: A relvar is in 3NF if and only if it is in 2NF and every non-key attribute is nontransitively dependent on the primary key.

The table would also be normalized to Boyce/Codd Normal Form (BCNF), whose formal definition is:

Boyce/Codd Normal Form: A relvar is in BCNF if and only if every nontrivial, left-irreducible FD has a candidate key as its determinant.

BCNF is a normal form which was introduced when it was found that, in certain circumstances, 3NF is deficient, particularly where a table has two overlapping two-column candidate keys. BCNF is a replacement for the first three normal, and unlike other normal forms does not require a table to be normalized to earlier normal forms, as with 3NF above. Informally the above definition for BCNF means that all determinants have to be candidate keys, so it's pretty easy to identify whether a table is in BCNF once the functional dependencies within the table have been identified.

I'll say more about the use of a personal name for the contact in this table below.

The ContactPhone and ContactEmail columns on the other hand would not be determined solely by the key, however, if only one email address and one phone number are stored for each contact. They would be determined by ContactName, so would be transitively determined by the key, and consequently the table would not be normalized to 3NF.

The ContactName column would be a foreign key referencing the primary key of a Contacts table. However, personal names can legitimately be duplicated, so cannot be used as keys. The column would have to be replaced by a numeric ContactID column referencing the numeric (probably an autonumber) primary key of Contacts.

What if, on the other hand, each contact could have multiple phone numbers, however, and each of those numbers could only apply to more than one contact? The numbers would be stored in a PhoneNumbers table with the PhoneNumber column as its primary key. The many-to-many relationship type between Contacts and PhoneNumbers would be modelled by a ContactPhoneNumbers table with two foreign key columns, PhoneNumber and ContactID, which would constitute the composite primary key of the table. The tblService table would then need to include a PhoneNumber, and the combination of ContactID and PhoneNumber would be a composite foreign key referencing the composite primary key of ContactPhoneNumbers. This would relate one valid phone number to each service record.

The table also includes the following column:

ContactLocationInfo

You are proposing to store multiple values in this column, so I assume that it is a Long Text data type. However, the attributes you are proposing to list in this are data. The column is therefore being used as a data structure. This is not a good use of a Long Text column, which is more suited to storing unstructured information. I and my American partner (she's an archivist) recently did this in a database of enslaved persons on the estates of a certain family in the USA, using the column to contain a free-text biographical narrative. In your case I would expect this sort of data to be recorded as values in columns of a set of related tables, one of which would be a Locations table whose primary key would be referenced by a LocationID foreign key column in tblService.

Using this one of your original tables as an example, I hope the above has given you an outline of the principles you need to apply when identifying the functional dependencies within a table, and from these determining whether the table is normalized. There are other normal forms beyond BCNF, but at this stage I would not concern yourself with these too much. Concentrate on the first three normal forms to start with. Most tables normalised to 3NF will be normalised to the higher normal forms.
 
Yes, while it would be easier to give him the working database, that's not part of the sale, he only gets some of the data as written into the purchase agreement.

What I posted was the start of the tables in a new database. I have to start moving data into those tables that he's allowed to have.
Did you add a Status Yes/No field so you can select which data you're going to give the new owner? In your other thread I suggested you not remove any data and use the Status field to filter the data you want the new owner to see.
 
Currently, we use two categories.
1 Business
2 Housing

It's possible the new owner may make changes to this system.
Hi
Can you explain the use of "tblPayRangeAssignment" ?
 
Did you add a Status Yes/No field so you can select which data you're going to give the new owner? In your other thread I suggested you not remove any data and use the Status field to filter the data you want the new owner to see.
Some data he will not get anything, other tables he only gets some of the information, so I've added the yes/no column and I'm working on that.
 
Hi
Can you explain the use of "tblPayRangeAssignment" ?
It's a device that sits inside of a vending machine to allow for cashless payments. We need the assignment table because the device can be moved from one machine to another. Example, if a machine is removed from one property we can install it at another location. I need to track where the device used to be vs where it is now. Or a machine gets destroyed due to vandalism, I can reuse that device at a different location in the future.
 
As has been pointed out by others, the process of normalization is crucial to the design of tables in a relational database. To understand normalization it is firstly necessary to have a good understanding of the concept of functional determination, which is the basis of the principles on which normalization, as the term is most commonly used, is based. There are alternative normalization schemes which make no mention of functional determination, but I'm not concerning myself with those here.

Let's consider your original tblService table as an example. This includes the following columns:

ContactName
ContactPhone
ContactEmail

The ContactName table is functionally determined by the table's primary key, i.e. for each value of ServiceID the value of ContactName for the service in question is known. Moreover, it is known in this table only from the table's key. It is therefore functionally determined in this table solely by the whole of the key. On the basis of this column alone therefore the table would be normalized to Third Normal Form (3NF) whose formal definition is:

Third Normal Form: A relvar is in 3NF if and only if it is in 2NF and every non-key attribute is nontransitively dependent on the primary key.

The table would also be normalized to Boyce/Codd Normal Form (BCNF), whose formal definition is:

Boyce/Codd Normal Form: A relvar is in BCNF if and only if every nontrivial, left-irreducible FD has a candidate key as its determinant.

BCNF is a normal form which was introduced when it was found that, in certain circumstances, 3NF is deficient, particularly where a table has two overlapping two-column candidate keys. BCNF is a replacement for the first three normal, and unlike other normal forms does not require a table to be normalized to earlier normal forms, as with 3NF above. Informally the above definition for BCNF means that all determinants have to be candidate keys, so it's pretty easy to identify whether a table is in BCNF once the functional dependencies within the table have been identified.

I'll say more about the use of a personal name for the contact in this table below.

The ContactPhone and ContactEmail columns on the other hand would not be determined solely by the key, however, if only one email address and one phone number are stored for each contact. They would be determined by ContactName, so would be transitively determined by the key, and consequently the table would not be normalized to 3NF.

The ContactName column would be a foreign key referencing the primary key of a Contacts table. However, personal names can legitimately be duplicated, so cannot be used as keys. The column would have to be replaced by a numeric ContactID column referencing the numeric (probably an autonumber) primary key of Contacts.

What if, on the other hand, each contact could have multiple phone numbers, however, and each of those numbers could only apply to more than one contact? The numbers would be stored in a PhoneNumbers table with the PhoneNumber column as its primary key. The many-to-many relationship type between Contacts and PhoneNumbers would be modelled by a ContactPhoneNumbers table with two foreign key columns, PhoneNumber and ContactID, which would constitute the composite primary key of the table. The tblService table would then need to include a PhoneNumber, and the combination of ContactID and PhoneNumber would be a composite foreign key referencing the composite primary key of ContactPhoneNumbers. This would relate one valid phone number to each service record.

The table also includes the following column:

ContactLocationInfo

You are proposing to store multiple values in this column, so I assume that it is a Long Text data type. However, the attributes you are proposing to list in this are data. The column is therefore being used as a data structure. This is not a good use of a Long Text column, which is more suited to storing unstructured information. I and my American partner (she's an archivist) recently did this in a database of enslaved persons on the estates of a certain family in the USA, using the column to contain a free-text biographical narrative. In your case I would expect this sort of data to be recorded as values in columns of a set of related tables, one of which would be a Locations table whose primary key would be referenced by a LocationID foreign key column in tblService.

Using this one of your original tables as an example, I hope the above has given you an outline of the principles you need to apply when identifying the functional dependencies within a table, and from these determining whether the table is normalized. There are other normal forms beyond BCNF, but at this stage I would not concern yourself with these too much. Concentrate on the first three normal forms to start with. Most tables normalised to 3NF will be normalised to the higher normal forms.
Thank you. I'm trying really hard to wrap my head around cleaning this up and normalizing the tables before a new owner takes over.

When the original database started it was because the owner had 90% of the info in his head or on paper. He used Excel to track some few things but overall, it was just what he remembered. I came from a different industry completely where we tracked everything. Every single time the phone would ring we tracked details so for me coming into this business I was at a loss as to how he functioned. So, I started keeping a notebook and quickly found that didn't work, thus the creation of the Access database.

I am all self-taught on Access and it's been painful, but I've been able to get to a functional enough point that we can operate and track things that previously were in his head or not tracked at all.
 
Can you give us a list of Machine Types you install ?
We use these categories:
Drink - Bottle
Drink - Can
Drink - Coffee
Combo - Drink and Snacks
Snack (chips, candy, etc.)
Food (soup, pasta, etc.)
Frozen (ice cream treats and frozen foods)
Changer (dollars in coins out)
 
We use these categories:
Drink - Bottle
Drink - Can
Drink - Coffee
Combo - Drink and Snacks
Snack (chips, candy, etc.)
Food (soup, pasta, etc.)
Frozen (ice cream treats and frozen foods)
Changer (dollars in coins out)
Thanks for that.
Are there specific Locations you install Machines in a Property?
 
We use these categories:
Drink - Bottle
Drink - Can
Drink - Coffee
Combo - Drink and Snacks
Snack (chips, candy, etc.)
Food (soup, pasta, etc.)
Frozen (ice cream treats and frozen foods)
Changer (dollars in coins out)
Hi
What specific details do you record about a Machine?
Do you have specific Serial Numbers or other details other than a MachineID ?
 
Thanks for that.
Are there specific Locations you install Machines in a Property?
No, they go all over the place. I have a table where I track the machine's placement/location.
Examples of ones we have:
Laundry Room - 2nd floor
Clubhouse outside the fitness center
Main Entrance, Under Stairs
Employee break room 3rd floor
Garage Lobby level 2
Garage Lobby level 6
Luxor Room across from Main Elevator
 
Hi
What specific details do you record about a Machine?
Do you have specific Serial Numbers or other details other than a MachineID ?
Yes, we track a lot of information about each individual machine. The machines do have serial numbers, currently the owner does not track that, so I use the InventoryID to track the machines. The new owner may want to use a serial number, so I'll have to add that field to the Machine Inventory table. Some of the machines have been refurbished and the serial numbers are really hard to read, so it's possible that field could remain blank, so I wouldn't be able to use that as an ID.
 
Yes, we track a lot of information about each individual machine. The machines do have serial numbers, currently the owner does not track that, so I use the InventoryID to track the machines. The new owner may want to use a serial number, so I'll have to add that field to the Machine Inventory table. Some of the machines have been refurbished and the serial numbers are really hard to read, so it's possible that field could remain blank, so I wouldn't be able to use that as an ID.
OK but your current tblMachineInventory does not even have a field for MachineID ?
 
Yes, we track a lot of information about each individual machine. The machines do have serial numbers, currently the owner does not track that, so I use the InventoryID to track the machines. The new owner may want to use a serial number, so I'll have to add that field to the Machine Inventory table. Some of the machines have been refurbished and the serial numbers are really hard to read, so it's possible that field could remain blank, so I wouldn't be able to use that as an ID.
Hi
Can you give me an example list of the "PayRangePin" you use ?
 
Hi
Can you give me an example list of the "PayRangePin" you use ?
It's a code that's on each device. We need that PIN to make changes remotely. So the PayRange Device ID (Serial #) and the PIN are two things we have to track. It's typically a 4 to 5 digit code we have to enter.
 
I tried my best to normalize your data and establish relationships where appropriate. Some fields I moved to other tables, and I removed some tables that were no longer needed. I still don't know what some tables are supposed to do, but maybe you can make the proper relationships. Just open the file and view the Relationship window. Maybe you can build on it. All of the FK's are named after their respective PK's so I could keep track of what tables relate to others. That just made it easier for my own purposes.
 

Attachments

It's a code that's on each device. We need that PIN to make changes remotely. So the PayRange Device ID (Serial #) and the PIN are two things we have to track. It's typically a 4 to 5 digit code we have to enter.
Hi
You must have a specific List of PayRangeDevices which are installed into a specific Machine.

Then depending on circumstances the Device has to be removed from 1 machine and placed into another.

Can you give me an example list of current PayRangeDevices?
 
Hi
You must have a specific List of PayRangeDevices which are installed into a specific Machine.

Then depending on circumstances the Device has to be removed from 1 machine and placed into another.

Can you give me an example list of current PayRangeDevices?
Hi Mike,
Yes, every time we buy a new batch of devices (10 to a box) we record the device information into a table, tblPayRange. Then when we add the device to a vending machine we add the information to tblPayRangeAssignment and it's associated with a MachineID.

It just happened today. Device ID 10076330 PIN 8012 was removed from MachineID 312 on 7/24/2025 and installed into MachineID 1046 on 8/21/2025.

Every Monday we download two different reports from PayRange with details on sales and refunds. The information comes in different formats, so I download the data (it's all DeviceID centric) and put it into either tblCollectionPayRange or tblCollectionPayRangeRefunds.

I use the tblPayRangeAssignment to make sure that the proper sales and refunds are associated with the proper machine based on date range since that table has an install date and a removal date for the DeviceID.

Hope I'm explaining this in a way that is not too confusing.
 
I tried my best to normalize your data and establish relationships where appropriate. Some fields I moved to other tables, and I removed some tables that were no longer needed. I still don't know what some tables are supposed to do, but maybe you can make the proper relationships. Just open the file and view the Relationship window. Maybe you can build on it. All of the FK's are named after their respective PK's so I could keep track of what tables relate to others. That just made it easier for my own purposes.
Thank you, Larry, I'll take a look at this. I appreciate everyone's help trying to get this cleaned up so we can move forward with a cleaner/normalized database.
 

Users who are viewing this thread

Back
Top Bottom