Think you can survive a Black Friday inventory stampede? This expert-level Access quiz covers five practical topics: proper inventory table design, calculated sale prices, totals queries, date/time criteria, and finding products that need to be reordered. Keep score as you go, and try not to let the Turbo Man figures disappear from the database.
Each question has four choices. Give yourself a few seconds before reading the answer. If you need longer, pause the embedded video and work it out. The important part is not just getting the right answer, but understanding why the other choices can lead to trouble.
Question 1: Turbo Man figures are stocked at many stores, and each store stocks many products. Which table design best tracks quantity on hand by store?
A. StoreInventoryT with StoreID, ProductID, and QtyOnHand
B. Add Store1Qty, Store2Qty, and Store3Qty fields to ProductT
C. Put every store's inventory in one Long Text field in ProductT
D. Create a separate ProductT for every store
Answer: A. Use a StoreInventoryT table containing StoreID, ProductID, and QtyOnHand. This is a junction table. Each record represents one particular product at one particular store.
That design handles the many-to-many relationship properly. One store can stock many products, and one product can be stocked in many stores. More importantly, you can add a new store or product without redesigning the database. Fields like Store1Qty and Store2Qty are a big red flag. Stores are records, not fields. And please do not put inventory data in one giant text field unless you enjoy making queries impossible for no good reason.
Question 2: ProductT stores RegularPrice and DiscountRate. The discount rate is stored as a decimal, so 25% is stored as 0.25. Which calculated query field returns the Black Friday sale price?
A. SalePrice: [RegularPrice] - [DiscountRate]
B. SalePrice: [RegularPrice] * (1 - [DiscountRate])
C. SalePrice: [RegularPrice] / [DiscountRate]
D. SalePrice: [RegularPrice] + [DiscountRate]
Answer: B. The calculated field is SalePrice: [RegularPrice] * (1 - [DiscountRate]).
A discount rate tells you how much is removed, but the customer pays the amount that remains. A 25% discount means the customer pays 75% of the original price. So Access first calculates 1 minus 0.25, which gives you 0.75, and then multiplies the regular price by that value.
For example, a $49.99 action figure with a 25% discount comes out to about $37.49. The parentheses matter because you want Access to calculate the remaining percentage first. Otherwise, your sale pricing may become more chaotic than the checkout line.
Question 3: OrderDetailT contains ProductID and Quantity. What query approach finds the single best-selling product by total units sold?
A. Sort OrderDetailT by ProductID and use First(ProductID)
B. Count ProductID and sort the count descending
C. Group by ProductID, sum Quantity, sort the sum descending, and return Top 1
D. Use DLookup to retrieve the last product entered
Answer: C. Group the records by ProductID, calculate Sum on the Quantity field, sort that total descending, and set the query's Top Values property to return one record.
The key word here is units. Counting order-detail records only tells you how many order lines contain a product. It does not tell you how many units were sold. One shopper might buy six Laser Yodeling Elves on one order line. That should count as six units, not one.
Once the query totals Quantity for each product, sorting the total from highest to lowest puts the best seller at the top. Top 1 then keeps only that winning product. DLookup and First have their uses, but neither one magically finds the best-selling item.
Question 4: SaleT has a SaleDateTime field. A doorbuster runs from 6:00 AM up to, but not including, 10:00 AM on November 27, 2026. Which criteria is correct?
A. Between #11/27/2026 6:00 AM# And #11/27/2026 10:00 AM#
B. DateValue([SaleDateTime]) = #11/27/2026#
C. [SaleDateTime] > #11/27/2026 6:00 AM# And [SaleDateTime] <= #11/27/2026 10:00 AM#
D. [SaleDateTime] >= #11/27/2026 6:00 AM# And [SaleDateTime] < #11/27/2026 10:00 AM#
Answer: D. Use [SaleDateTime] >= #11/27/2026 6:00 AM# And [SaleDateTime] < #11/27/2026 10:00 AM#.
This is a very useful date/time pattern. The promotion includes its exact starting time, but excludes its ending time. A transaction at exactly 6:00 AM belongs in the doorbuster promotion. A transaction at exactly 10:00 AM does not.
Why not use Between? Because Between includes both endpoints. That would include a sale at exactly 10:00 AM, which can become a problem if the next promotion starts at 10:00 AM too. Using greater-than-or-equal for the start and less-than for the ending time gives each transaction one clean home.
Question 5: ProductT has ProductID and ReorderLevel. StoreInventoryT has ProductID, StoreID, and QtyOnHand. Some products have no inventory records yet. Which query design finds every product whose total stock is at or below its reorder level?
A. Left join ProductT to StoreInventoryT, group by product, and use HAVING Nz(Sum([QtyOnHand]),0) <= [ReorderLevel]
B. Inner join ProductT to StoreInventoryT, group by product, and use HAVING Sum([QtyOnHand]) <= [ReorderLevel]
C. Left join ProductT to StoreInventoryT and use WHERE [QtyOnHand] <= [ReorderLevel]
D. Group StoreInventoryT by StoreID and compare each store's quantity to the reorder level
Answer: A. Start with ProductT, left join it to StoreInventoryT, group by product, and use HAVING Nz(Sum([QtyOnHand]),0) <= [ReorderLevel].
This question has several important pieces. First, the left join keeps every product from ProductT, including products that have no inventory records yet. An inner join would leave those products out entirely, which is not great when a product has zero stock and is obviously a reorder candidate.
Second, inventory must be totaled across all stores. You are not looking for a store that is low. You are looking for products whose combined inventory is at or below their reorder level.
Third, the Nz function converts a Null total into zero. If a product has no StoreInventoryT rows, Sum([QtyOnHand]) produces Null. Nz turns that into 0 so Access can compare it properly to the reorder level.
Finally, remember the difference between WHERE and HAVING. WHERE filters individual records before grouping and totals happen. HAVING filters grouped results after the aggregate calculation. Since this comparison depends on the summed quantity across stores, HAVING is the correct place for it.
How did you do? Five out of five means you are officially a doorbuster database legend, with every Turbo Man figure accounted for. If you missed a few, no worries. These are exactly the kinds of Access details that make the difference between a database that behaves nicely and one that collapses under holiday-shopping-level pressure.
Watch the embedded video if you want to play along with the timed quiz, and keep these patterns in mind the next time you are designing inventory tables or building totals queries.
Live long and prosper,
RR
No comments:
Post a Comment