Data structure to show postal code on selecting city - ajax

I have a table with three fields-
Postal code
City
Suburb
Each row has a unique combination of these three columns. On the front-end I have an address form where I want to show the list of postal codes when the user is typing the city name. Something like this-
The table has around 30,000 entries so I can't hit the database everytime the user adds an alphabet. I want to store the entire table in a data structure when the form page loads and then retrieve the relevant rows everytime an alphabet is added in the city box.
What is the data structure that I should use to save the entire table in the JVM when the page loads?

Why not a Hash Map with keys as city names, and values as a string concatenating all the three fields (which is ultimately what has to be sent to the browser)
This map can be pre populated at startup

Related

How to optimize the Search Filter which returns paginated result but the intermediate table can return millions for records but actual results is few

Example
I have 3 entities Users, Address & County
The User is having one to one Relation with Address Entity and Country has one to many Relation with Address. I want to display users details with filter parameter on country code.
The one of the possible flow is I will fetch the corresponding Object of Country from Country code. Then we find Country in all in address entity. Then we will be getting list of addresses of that country code. Then we will find all the address corresponding with users using in Query 'in' SQL. But the issue arise when the data set is very large.
Lets say we a Country Code IN corresponds to 1 Million Address then I will 1st fetch the all 1 Million records then map it with the Users. Then I am performing pagination. It will be very slow.
I am thinking of an idea to paginate the address entity from the response somehow ?
Please help

Replacing data entries based on ID and date from data set

I'm a teacher who manages a caseload of students who have yearly meetings. Each year their services, hours, supports, etc. change. We complete a survey on each student to record all this data on a single spreadsheet. I want to pull data from those submissions to replace the students' information with the most recently dated information in our caseload master report (Tab one). If no data is entered yet I want it to remain the same.
The first tab is what we use for reporting to our team and the IEP completion tab is where the survey data is imported. I tried some solutions such as VLOOKUP with some IF statements but I don't think that is the correct route to go.
I scrubbed the linked Google spreadsheet for confidentiality.
Assuming Student ID#/ID Number is a reliable unique index in a third sheet create a VLOOKUP of the ID Number's associated fields from Tab1. Fields not found will error, so wrap your VLOOKUP with IFERROR and an INDEX/MATCH (because the ID there is not in ColumnA) of the fields in Tab2.

Google Forms: Autofill fields based on data from external database

Basically what I'm trying to do is create a form with fields that are autofilled (such as name, address, email etc) based on info in the first field of the form (social security number). All data is stored in an external MySQL database.
So when I manually enter a SSN in the form, I need some kind of script to run and check the database for the corresponding values associated with the SSN, and autofill these values into the corresponding fields in the form, and if the SSN is not found in the database it should let me fill out the fields manually.
not possible with google forms which does not support running code at form fill time.
instead write a webapp with appscript or appmaker.

How to create a validation rule which restricts data entry from specific table

I am creating a data entry form and report on MS Access and I would like to create validation rules for some input text boxes that restricts data based on the data contained in another table.
For example: For the subdivision input field, data that can be entered must be equal to one of the items which is contained in the Subdivision table which contains a list of subdivisions such as:
Los Angeles Sub
San Bernardino Sub
Riverside Sub
Etc
How would I go about doing this?
If your form data is directly bound to the table that holds it, then you would use the Before Update event of each text box to perform any validation you wish using VBA. If your form is not bound directly to the table you can either use the On Lost Focus event to validate each text box individually or whatever process you use to push the data to the table and validate the entire form input.

How to store different type and number of fields in one database table?

Hello everybody I'm making a "Bulletin board", like this: http://stena.kg/ad/post, I'm using Laravel 5.0, and don't know how to store different fields in database table, for example if I choose "Cars" category I should to fill Mark, Model, Fuel (etc fields for cars category), If I choose Flats category I should fill fields like Area, Number of rooms etc...How to organize all of this? I tried some ideas but nothing helped me(
Try to save data as json in table. Parse json format to string and save it in db, but it will cause many problems in future, so not recommend that solution. I recommend to store data in separate tabels, each one for category. For optimise process it is possible to create catregory table, and category_item table with fields like name, description and so on. Different category demands sp=ecific fields, so best solution is to create table per category.

Resources