This set of Javascript Multiple Choice Questions & Answers (MCQs) focuses on “Client-Side Databases”.
1. The Client-Side Databases are stored in the ____________
a) The JavaScript code
b) User’s computer
c) Both JavaScript code and User’s computer
d) In the server
View Answer
Explanation: The actual client-side databases are stored on the user’s computer and are directly accessed by JavaScript code in the browser.
2. Which of the following use the Web SQL Database?
a) Chrome
b) Firefox
c) IE
d) Firefox & IE
View Answer
Explanation: Chrome, Safari, and Opera implemented the Web SQL Database API, but Firefox and IE have not, and likely never will.
3. Which of the following are objective database and not a relational database?
a) Web SQL Database
b) FileSystem API
c) IndexedDB
d) User data
View Answer
Explanation: IndexedDB is an object database, not a relational database, and it is much simpler than databases that support SQL queries. It is more powerful, efficient, and robust than the key/value storage provided by the Web Storage API, however.
4. In the IndexedDB database, database is defined as _____________
a) A collection of objects
b) A collection of named object stores
c) Objects collection
d) Data collection
View Answer
Explanation: In the IndexedDB API, a database is simply a collection of named object stores.
5. A key path is defined as ______________
a) A url that directs to the value
b) A value that is similar to hash table
c) A value that tells the database how to extract an object’s key from the object
d) A url that redirects
View Answer
Explanation: A key path is defined as a value that tells the database how to extract an object’s key from the object.
6. How does IndexedDB provide atomicity?
a) Grouping among the data
b) Grouping within a transaction
c) Grouping the data
d) Interlinking data
View Answer
Explanation: IndexedDB provides atomicity guarantees: queries and updates to the database are grouped within a transaction so that they all succeed together or all fail together and never leave the database in an undefined partially updated state.
7. Which of the following is a feature of the IndexedDB API?
a) Simplifies the transaction management
b) Need not manage the transaction at all
c) Enhances the storage
d) Creates a link between data
View Answer
Explanation: One of the convenient feature of the IndexedDB API is that it simplifies the transaction management.
8. What is the alternate way to search in an IndexedDB API?
a) Key
b) Address
c) Indexes
d) Values
View Answer
Explanation: In addition to retrieving objects from an object store by their primary key value, you may want to be able to search based on the value of other properties in the object. In order to be able to do this, you can define any number of indexes on the object store.
9. Which is the function used to look up an object?
a) put()
b) set()
c) get()
d) look()
View Answer
Explanation: You look up an object by calling the get() method of the object store or store a new object by calling put().
10. Which is the method to look up the objects for a range of keys?
a) lookRange()
b) openCursor()
c) lookall()
d) look()
View Answer
Explanation: If you want to look up the objects for a range of keys, you create an IDBRange object and pass it to the openCursor() method of the object store.
Sanfoundry Global Education & Learning Series – Javascript Programming.
- Check Programming Books
- Practice Programming MCQs
- Apply for Computer Science Internship
- Practice Information Science MCQs
- Practice MCA MCQs