Calculating Database Size

112 views 10:26 am 0 Comments August 8, 2023

Calculating Database Size, Sample Data and Queries

Based on the Orderform table structure:

 

Database size:

Depending on your data dictionary (ies), you could add a column for the size of one data entry for each field.

Then make an initial rough estimate of the number of records for each table, and add this number to each row of that table in the next field.

Then add a third column where you multiply the values in the first 2 of these new columns.

Then sum the total of the third column.

(See example: DatabaseSizeCalculationExample.xls.)

You could look up the equivalent size (Bytes) for the various data types – int, date, etc.  (VarChar(20) would be 20 Btyes, for instance.)

Info for MS Access (https://support.microsoft.com/en-us/office/data-types-for-access-desktop-databases-df2b83ba-cef6-436d-b679-3418f622e482)

Sample numbers of records might be:

Clients = 50, Orders = 200, OrderLines = 800, Products = 40

Making up Sample data:

You could add one or two customers. (Customer names could be (for instance): First and Second, or Customer 1 and Customer 2)

You could then add one or two products. (Product names could be: Product 1 and Product 2)

You could add 2 sample entries in the next table – Orders – (joined one-to-many from Customers).

And then you could add 4 sample entries in the next table – OrderLines – (joined one-to-many from both Orders and Products).

Sample queries:

For AT2, 3 queries and associated reports are required from the list of reports in the original scenario.

You could copy the SQL code or take a screen image of each query and add to your ICTDBS506 assignment report.

After each query, you could add a screen image of each of the associated reports.

Note: in LibreOffice Base (and MS Access) you can create each query and then use a report wizard to generate each report.

The sample data will provide the detail to fill out (populate) your reports.

Example query and report for the Orderform sample database:

SELECT Orders.OrderID, Orders.CustomerID, Orders.OrderDate, Orders.ShippingDate, Customers.Surname, Customers.GivenName, Customers.Street, Customers.Suburb, Customers.State, Customers.PostZipCode, Customers.Phone

FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID

WHERE (((Orders.OrderID)=[Forms]![OrdersMF]![txtOrderID]));

 

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,