HSQLDB is a relational database management system (RDBMS) which is written in Java programming language. It has a JDBC driver and supports a large subset of SQL-92, SQL:2008, SQL:2011, and SQL:2016 standards.
HSQLDB MCQs: This section contains multiple-choice questions and answers on the various topics of HSQLDB. Practice these MCQs to test and enhance your skills on HSQLDB.
List of HSQLDB MCQs
1. HSQLDB is written in ____?
- Java
- Python
- C
- C++
- Erlang
Answer: A) Java
Explanation:
HSQLDB is written in Java.
2. HSQLDB is used for ____?
- Development of database application
- Testing of database application
- Deployment of database application
- All of the above
Answer: D) All of the above
Explanation:
HSQLDB is used for the development, testing, and deployment of database applications.
3. Is HSQLDB open-source?
- Yes
- No
Answer: A) Yes
Explanation:
HSQLDB is open-source.
4. Each HSQL database is referred to as a ____?
- Collection
- Catalog
- Table
- Directory
Answer: B) Catalog
Explanation:
Each HSQL database is referred to as a catalog.
5. How many types of the catalog are there depending upon how the data is stored?
- 5
- 4
- 2
- 3
Answer: D) 3
Explanation:
Depending on how the data is kept, there are three sorts of catalog:
- Mem
- File
- res
6. All databases running in different modes can be closed with which of the following command?
- CLOSE
- END
- SHUT
- SHUTDOWN
Answer: D) SHUTDOWN
Explanation:
All databases running in different modes can be closed with the SHUTDOWN command, issued as an SQL statement.
7. All ongoing transactions are ____ when SHUTDOWN is ordered?
- Deleted
- Rolled back
Answer: B) Rolled back
Explanation:
All ongoing transactions are rolled back when SHUTDOWN is ordered.
8. HSQL server support which of the following network addressing?
- IPv4
- IPv6
- Both
Answer: B) IPv6
Explanation:
Both IPv4 and IPv6 network addresses are supported by HyperSQL listeners (server).
9. The HSQL HTTP servlet mode can serve how many databases?
- Multiple
- More than One
- Only one
Answer: C) Only one
Explanation:
The Servlet mode can only serve one database.
10. How many server modes are there in HSQLDB?
- 3
- 4
- 5
- 6
Answer: A) 3
Explanation:
The three modes are:
- HSQLserver
- HSQL HTTP SERVER
- HSQL HTTP SERVLET
11. The Servlet Mode cannot be started independently from the servlet engine?
- True
- False
Answer: A) True
Explanation:
The Servlet Mode cannot be started independently from the servlet engine.
12. In HSQL how many types of tables can be created?
- 2
- 3
- 4
- 5
Answer: B) 3
Explanation:
In HSQLDB, three types of tables can be created:
- MEMORY
- CACHED
- TEXT
13. Which of the following tables are stored on the Disk?
- MEMORY
- CACHED
- TEXT
Answer: B) CACHED
Explanation:
The type of table that is stored on disk in HSQLDB is called a CACHED table.
14. Which of the following is known as a temporary table?
- MEMORY
- CACHED
- TEXT
Answer: A) MEMORY
Explanation:
MEMORY tables are known as a temporary tables, that are stored in memory.
15. Which of the following table is used for the small amount of data?
- Memory
- cached
Answer: A) Memory
Explanation:
A MEMORY table is used for a small amount of data.
16. HSQL support which of the following key constraints?
- PRIMARY KEY
- UNIQUE KEY
- FOREIGN KEY
- All of the above
Answer: D) All of the above
Explanation:
HyperSQL supports PRIMARY KEY, UNIQUE, and FOREIGN KEY constraints.
17. ____ are critical for query performance?
- Key
- Constraints
- Commands
- Indexes
Answer: D) Indexes
Explanation:
Indexes are critical for query performance.
18. Does HSQL ensures atomicity?
- Yes
- No
Answer: A) Yes
Explanation:
HSQL ensures atomicity, both during operations and in the event of a system crash.
19. Which ACID property in HSQL represents transactions that do not interfere with one another?
- Atomicity
- Consistency
- Isolation
- Durability
Answer: C) Isolation
Explanation:
Isolation means that transactions do not interfere with one another.
20. Does HyperSQL supports encrypted databases?
- Yes
- No
Answer: A) Yes
Explanation:
HyperSQL supports encrypted databases.
21. What is JAMon?
- Java access management
- Java access monitor
- Java application monitor
- Java application management
Answer: C) Java application monitor
Explanation:
HyperSQL is supported by the monitoring tool JAMon (Java Application Monitor).
22. Does HyperSQL supports log4J and JDK logging?
- Yes
- No
Answer: A) Yes
Explanation:
HyperSQL supports log4J and JDK logging.
23. ____ triggers are only permitted if the trigger is defined on a VIEW?
- BEFORE
- AFTER
- INSTEAD OF
Answer: C) INSTEAD OF
Explanation:
INSTEAD OF triggers are only permitted if the trigger is defined on a VIEW.
24. Access to schema objects is easily controlled by the ____ objects
- Role
- User
- Both
Answer: C) Both
Explanation:
Access to schema objects is easily controlled by the ROLE and USER objects.
25. What is the default field separator in Text tables?
- ,
- .
- !
- |
Answer: A) ,
Explanation:
The default field separator in Text tables is the comma(,).
26. Suppose you want to change the default field separator then which of the following statement would you use?
- SET TABLE SEPARATOR SOURCE
- SET TABLE SOURCE
- CHANGE TABLE SEPARATOR
Answer: B) SET TABLE SOURCE
Explanation:
SET TABLE SOURCE, the statement can change the field separator.
27. HSQLDB treats CHAR and VARCHAR strings the same.
- True
- False
Answer: A) True
Explanation:
HSQLDB treats CHAR and VARCHAR strings the same.
28. Does Text tables support transactions?
- Yes
- No
Answer: A) Yes
Explanation:
Text tables support transactions.
29. A ____ is a mechanism for arranging character strings in ordered sets as well as determining the equivalence of two character strings.
- INTEGRATION
- CONCAT
- COLLATION
Answer: C) COLLATION
Explanation:
A COLLATION is a mechanism for arranging character strings in ordered sets as well as determining the equivalence of two character strings.
30. A ____ is similar to a TABLE but it does not permanently contain rows of data.
- Collection
- Schema
- View
Answer: C) View
Explanation:
A VIEW is similar to a TABLE but it does not permanently contain rows of data.
31. A ____ index ensures that no two rows have the same index value.
- Exceptional
- Simple
- Creative
- Unique
Answer: D) Unique
Explanation:
A unique index ensures that no two rows have the same index value.
32. Does a Simple index allow duplicate values in a table?
- Yes
- No
Answer: A) Yes
Explanation:
Yes, a simple index allows duplicate values in a table.
33. The successful transaction should always be completed by issuing the ____ command.
- COMMIT
- ROLLBACK
- SAVEPOINT
Answer: A) COMMIT
Explanation:
The successful transaction should always be completed by issuing the COMMIT command.
34. If the transaction fails, the ____ command should be used to restore the prior state of all tables referenced in the transaction?
- COMMIT
- ROLLBACK
- SAVEPOINT
Answer: B) ROLLBACK
Explanation:
If the transaction fails, the ROLLBACK command should be used to restore the prior state of all tables referenced in the transaction.
35. ____ command creates a point inside the collection of transactions from which to rollback.
- COMMIT
- ROLLBACK
- SAVEPOINT
Answer: C) SAVEPOINT
Explanation:
SAVEPOINT command creates a point inside the collection of transactions from which to rollback.
36. Which of the following type of Join returns all rows from the left table even if no matches are found in the right table?
- LEFT JOIN
- INNER JOIN
- RIGHT JOIN
Answer: A) LEFT JOIN
Explanation:
LEFT JOIN returns all rows from the left table even if no matches are found in the right table.
37. Which of the following type of join returns all rows from the right table even if no matches are found in the left table?
- LEFT JOIN
- INNER JOIN
- RIGHT JOIN
Answer: C) RIGHT JOIN
Explanation:
RIGHT JOIN returns all rows from the right table even if no matches are found in the left table.
38. Which data type is used to store large text values?
- CLOB
- VARCHAR
- LONGVARCHAR
Answer: A) CLOB
Explanation:
CLOB is used to store large text values, also BLOB.
39. Which of the following companies are using HSQLDB?
- IBM
- JASPERSOFT
- OPENBRAVO
- All of the above
Answer: D) All of the above
Explanation:
Companies like IBM, JASPERSOFT, and OPENBRAVO are using HSQLDB.
40. What are the alternatives of HSQLDB?
- Oracle
- MySQL
- PostgreSQL
- All of the above
Answer: D) All of the above
Explanation:
Following are the alternatives of HSQLB:
- Oracle
- MySQL
- PostgreSQL