Question

Why are arrays important? Can you describe a situation during the design of a script where...

Why are arrays important? Can you describe a situation during the design of a script where an array can be helpful? When would arrays be more appropriate to use than a database? What situations would a database be more appropriate to use than an array? Do arrays have any advantages over using a database?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi! Hope my answer clears your concept regarding Arrays and Databases. Let me know in the comments section if you have any doubts. Please don't forget to give a positive rating :)

An array is used to store a collection of data having a similar data type. It is often more useful to think of an array as a collection of variables of the same type. An array is used to represent multiple data items of the same type by using only a single name.

So when you have a single data type in your script then you should go ahead with an array-for example an array of marks of students.

Arrays would be more appropriate to use than a database when you want to store the data temporarily. Array memory is volatile, which means you create arrays within programs for handling lists of data and after the program completes, the array disappears from memory.

Database means a collection of big and permanent data. You make a database when you need the data permanently or when you have loads of information in various data-types like a database of student information which contains their marks, age, hobbies, their subjects, etc. In this case, the marks will be an array of the floating type, subjects will be an array of strings and so on. The main reason one may want to use a database instead of an array is if the users enter data one day, and wants to retrieve it another day. Databases are extremely useful for holding data for long periods of time.

The case where you can use an array and not a database is when you don't want to save the data (if it just has temporary data that you don't mind losing), or you save it in some other way, like in a file system or when the data is of similar data-type.

Add a comment
Know the answer?
Add Answer to:
Why are arrays important? Can you describe a situation during the design of a script where...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT