Apache Derby MCQs and Answers With Explanation | Apache Derby Quiz

Apache Derby MCQ's
Join Telegram Join Telegram
Join Whatsapp Groups Join Whatsapp

Apache Derby MCQs and Answers With Explanation – Apache Derby is a Java-based relational database management system that provides a lightweight, flexible, and highly scalable solution for managing data. As an open-source software, Apache Derby is widely used by developers and organizations across various industries to store, access, and analyze data. With its fast performance, robust security features, and easy-to-use interface, Apache Derby has become a popular choice for applications that require efficient data management.

Apache Derby MCQs

This set of Apache Derby Multiple Choice Questions aims to test your knowledge of Apache Derby and help you gain a deeper understanding of its architecture, functionality, and syntax. We would like to assure the aspirants that this article, Apache Derby Questions and Answers helps those who are going to appear for interviews or any competitive exams.

Apache Derby Multiple Choice Questions and Answers

Quiz Name Apache Derby
Exam Type MCQ (Multiple Choice Questions)
Category Technical Quiz
Mode of Quiz Online

Top 50 Apache Derby MCQs | Practice Online Quiz

1. What is Apache Derby?

A) A database management system
B) A web server
C) A programming language
D) A mobile application

Answer: A

Explanation: Apache Derby is a database management system that is based on Java programming language.

2. What is the maximum size of a database that can be managed by Apache Derby?

A) 2 GB
B) 10 GB
C) 100 GB
D) No limit

Answer: D

Explanation: Apache Derby can manage databases of any size, there is no limit to the size of the database that can be managed.

3. Which programming languages can be used to access Apache Derby?

A) Java, Python and Ruby
B) C++, Python and PHP
C) Java and .NET
D) Java only

Answer: D

Explanation: Java programming language is the primary language used to access Apache Derby. However, .NET can also be used with the help of a JDBC driver.

4. What is the default port number for Apache Derby?

A) 1521
B) 3306
C) 5432
D) 1527

Answer: D

Explanation: The default port number for Apache Derby is 1527.

5. Which of the following is not a feature of Apache Derby?

A) In-memory database support
B) Replication support
C) Encryption support
D) None

Answer: D

Explanation: All of the given options are features of Apache Derby.

6. Which SQL statement is used to create a new table in Apache Derby?

A) INSERT
B) UPDATE
C) CREATE
D) DELETE

Answer: C

Explanation: The CREATE statement is used to create a new table in Apache Derby.

7. What is the syntax for creating a view in Apache Derby?

A) CREATE VIEW view_name AS SELECT column1, column2, …, columnN FROM table_name WHERE condition
B) CREATE VIEW view_name (column1, column2, …, columnN) AS SELECT * FROM table_name
C) CREATE VIEW view_name (column1, column2, …, columnN) AS SELECT column1, column2, …, columnN FROM table_name
D) CREATE VIEW view_name AS SELECT * FROM table_name

Answer: A

Explanation: The correct syntax for creating a view in Apache Derby is option A.

8. What is the syntax for inserting data into a table in Apache Derby?

A) INSERT INTO table_name (column1, column2, …) VALUES (value1, value2, …)
B) UPDATE table_name SET column1=value1, column2=value2 WHERE condition
C) CREATE TABLE table_name (column1 datatype1, column2 datatype2, …)
D) DELETE FROM table_name WHERE condition

Answer: A

Explanation: The correct syntax for inserting data into a table in Apache Derby is option A.

9. Which SQL statement is used to retrieve data from a table in Apache Derby?

A) SELECT
B) INSERT
C) UPDATE
D) DELETE

Answer: A

Explanation: The SELECT statement is used to retrieve data from a table in Apache Derby.

10. Which of the following is not a type of join in Apache Derby?

A) INNER JOIN
B) OUTER JOIN
C) CROSS JOIN
D) DIVIDE JOIN

Answer: D

Explanation: DIVIDE JOIN is not a type of join in Apache Derby.

11. What is the default isolation level for Apache Derby?

A) READ COMMITTED
B) READ UNCOMMITTED
C) REPEATABLE READ
D) SERIALIZABLE

Answer: A

Explanation: The default isolation level for Apache Derby is READ COMMITTED.

12. What is the syntax for creating an index in Apache Derby?

A) CREATE INDEX index_name ON table_name (column1, column2, …)
B) CREATE TABLE table_name (column1 datatype1, column2 datatype2, …)
C) CREATE TRIGGER trigger_name AFTER INSERT ON table_name …
D) CREATE VIEW view_name AS SELECT column1, column2, … FROM

Answer: A

Explanation: The correct syntax for creating an index in Apache Derby is option A.

13. Which SQL statement is used to update data in a table in Apache Derby?

A) UPDATE
B) INSERT
C) DELETE
D) SELECT

Answer: A

Explanation: The UPDATE statement is used to update data in a table in Apache Derby.

14. Which of the following is not a valid constraint in Apache Derby?

A) CHECK
B) FOREIGN KEY
C) UNIQUE
D) HASH

Answer: D

Explanation: HASH is not a valid constraint in Apache Derby.

15. What is the syntax for creating a foreign key constraint in Apache Derby?

A) FOREIGN KEY (column1, column2, …) REFERENCES table_name (column1, column2, …)
B) PRIMARY KEY (column1, column2, …)
C) UNIQUE (column1, column2, …)
D) CHECK (condition)

Answer: A

Explanation: The correct syntax for creating a foreign key constraint in Apache Derby is option A.

16. Which of the following is not a valid trigger type in Apache Derby?

A) BEFORE
B) AFTER
C) INSTEAD OF
D) AFTER LAST ROW

Answer: D

Explanation: AFTER LAST ROW is not a valid trigger type in Apache Derby.

17. What is the syntax for creating a trigger in Apache Derby?

A) CREATE TRIGGER trigger_name BEFORE INSERT ON table_name FOR EACH ROW …
B) CREATE INDEX index_name ON table_name (column1, column2, …)
C) CREATE TABLE table_name (column1 datatype1, column2 datatype2, …)
D) CREATE VIEW view_name AS SELECT column1, column2, … FROM table_name …

Answer: A

Explanation: The correct syntax for creating a trigger in Apache Derby is option A.

18. Which of the following is not a valid view type in Apache Derby?

A) READ ONLY
B) CHECK OPTION
C) UPDATABLE
D) DELETE ONLY

Answer: D

Explanation: DELETE ONLY is not a valid view type in Apache Derby.

19. What is the syntax for creating a view in Apache Derby?

A) CREATE VIEW view_name AS SELECT column1, column2, … FROM table_name …
B) CREATE INDEX index_name ON table_name (column1, column2, …)
C) CREATE TRIGGER trigger_name BEFORE INSERT ON table_name FOR EACH ROW …
D) CREATE TABLE table_name (column1 datatype1, column2 datatype2, …)

Answer: A

Explanation: The correct syntax for creating a view in Apache Derby is option A.

20. Which of the following is not a valid transaction control statement in Apache Derby?

A) COMMIT
B) ROLLBACK
C) SAVEPOINT
D) BEGIN WORK

Answer: D

Explanation: BEGIN WORK is not a valid transaction control statement in Apache Derby.

21. What is the syntax for starting a transaction in Apache Derby?

A) START TRANSACTION
B) BEGIN TRANSACTION
C) BEGIN WORK
D) TRANSACTION START

Answer: C

Explanation: The correct syntax for starting a transaction in Apache Derby is option C.

22. Which of the following is not a valid transaction isolation level in Apache Derby?

A) READ COMMITTED
B) READ UNCOMMITTED
C) REPEATABLE READ
D) SERIALIZABLE READ

Answer: D

Explanation: SERIALIZABLE READ is not a valid transaction isolation level in Apache Derby.

23. What is the syntax for setting the transaction isolation level in Apache Derby?

A) SET TRANSACTION ISOLATION LEVEL level
B) SET TRANSACTION LEVEL level
C) SET ISOLATION LEVEL level
D) SET LEVEL level

Answer: A

Explanation: The correct syntax for setting the transaction

24. Which of the following is not a valid backup command in Apache Derby?

A) CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE
B) CALL SYSCS_UTIL.SYSCS_BACKUP_TABLE
C) CALL SYSCS_UTIL.SYSCS_BACKUP_LOG
D) CALL SYSCS_UTIL.SYSCS_BACKUP_SCHEMA

Answer: B

Explanation: CALL SYSCS_UTIL.SYSCS_BACKUP_TABLE is not a valid backup command in Apache Derby.

25. What is the syntax for backing up a database in Apache Derby?

A) CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE(‘backup_directory’)
B) CALL SYSCS_UTIL.SYSCS_BACKUP_TABLE(‘table_name’, ‘backup_directory’)
C) CALL SYSCS_UTIL.SYSCS_BACKUP_LOG(‘backup_directory’)
D) CALL SYSCS_UTIL.SYSCS_BACKUP_SCHEMA(‘schema_name’, ‘backup_directory’)

Answer: A

Explanation: The correct syntax for backing up a database in Apache Derby is option A.

26. Which of the following is not a valid restore command in Apache Derby?

A) CALL SYSCS_UTIL.SYSCS_RESTORE_DATABASE
B) CALL SYSCS_UTIL.SYSCS_RESTORE_FROM
C) CALL SYSCS_UTIL.SYSCS_RESTORE_TABLE
D) CALL SYSCS_UTIL.SYSCS_RESTORE_SCHEMA

Answer: D

Explanation: CALL SYSCS_UTIL.SYSCS_RESTORE_SCHEMA is not a valid restore command in Apache Derby.

27. What is the syntax for restoring a database in Apache Derby?

A) CALL SYSCS_UTIL.SYSCS_RESTORE_DATABASE(‘restore_directory’, null, null, ‘overwrite=true’)
B) CALL SYSCS_UTIL.SYSCS_RESTORE_FROM(‘backup_directory’, ‘restore_directory’, null, ‘overwrite=true’)
C) CALL SYSCS_UTIL.SYSCS_RESTORE_TABLE(‘table_name’, ‘backup_directory’, ‘restore_directory’, null, ‘overwrite=true’)
D) CALL SYSCS_UTIL.SYSCS_RESTORE_SCHEMA(‘schema_name’, ‘backup_directory’, ‘restore_directory’, null, ‘overwrite=true’)

Answer: A

Explanation: The correct syntax for restoring a database in Apache Derby is option A.

28. Which of the following is not a valid system procedure in Apache Derby?

A) SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY
B) SYSCS_UTIL.SYSCS_CREATE_USER
C) SYSCS_UTIL.SYSCS_COMPRESS_TABLE
D) SYSCS_UTIL.SYSCS_FREEZE_DATABASE

Answer: D

Explanation: SYSCS_UTIL.SYSCS_FREEZE_DATABASE is not a valid system procedure in Apache Derby.

29. What is the syntax for setting a database property in Apache Derby?

A) CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(‘property_name’, ‘property_value’)
B) CALL SYSCS_UTIL.SYSCS_SET_SCHEMA_PROPERTY(‘schema_name’, ‘property_name’, ‘property_value’)
C) CALL SYSCS_UTIL.SYSCS_SET_TABLE_PROPERTY(‘table_name’, ‘property_name’, ‘property_value’)
D) CALL SYSCS_UTIL.SYSCS_SET_INDEX_PROPERTY(‘index_name’, ‘property_name’, ‘property_value’)

Answer: A

Explanation: The correct syntax for setting a database property in Apache Derby is option A.

30. Which of the following is not a valid function in Apache Derby?

A) CHAR
B) CONCAT
C) TO_NUMBER
D) RANDOM

Answer: C

Explanation: TO_NUMBER is not a valid function in Apache Derby.

31. What is the syntax for concatenating two strings in Apache Derby?

A) ‘string1’ || ‘string2’
B) CONCAT(‘string1’, ‘string2’)
C) ‘string1’ + ‘string2’
D) STRINGCONCAT(‘string1’, ‘string2’)

Answer: A

Explanation: The correct syntax for concatenating two strings in Apache Derby is option A.

32. Which of the following is not a valid date format in Apache Derby?

A) ‘yyyy-mm-dd’
B) ‘mm/dd/yyyy’
C) ‘dd.mm.yyyy’
D) ‘yyyy/mm/dd’

Answer: C

Explanation: ‘dd.mm.yyyy’ is not a valid date format in Apache Derby.

33. What is the syntax for selecting all columns from a table in Apache Derby?

A) SELECT * FROM table_name
B) SELECT columns FROM table_name
C) SELECT ALL columns FROM table_name
D) SELECT ALL FROM table_name

Answer: A

Explanation: The correct syntax for selecting all columns from a table in Apache Derby is option A.

34. Which of the following is not a valid join type in Apache Derby?

A) INNER JOIN
B) OUTER JOIN
C) CROSS JOIN
D) UNION JOIN

Answer: D

Explanation: UNION JOIN is not a valid join type in Apache Derby.

35. What is the syntax for creating a view in Apache Derby?

A) CREATE VIEW view_name AS SELECT columns FROM table_name WHERE conditions
B) CREATE TABLE view_name AS SELECT columns FROM table_name WHERE conditions
C) CREATE INDEX view_name ON table_name (columns)
D) CREATE SCHEMA view_name AS SELECT columns FROM table_name WHERE conditions

Answer: A

Explanation: The correct syntax for creating a view in Apache Derby is option A.

36. Which of the following is not a valid trigger type in Apache Derby?

A) BEFORE INSERT
B) AFTER INSERT
C) BEFORE UPDATE
D) AFTER DELETE

Answer: D

Explanation: AFTER DELETE is not a valid trigger type in Apache Derby.

37. What is the syntax for creating a trigger in Apache Derby?

A) CREATE TRIGGER trigger_name BEFORE INSERT ON table_name REFERENCING NEW AS new_row FOR EACH ROW INSERT INTO audit_table VALUES (new_row.id, new_row.name)
B) CREATE TRIGGER trigger_name AFTER INSERT ON table_name REFERENCING NEW AS new_row FOR EACH ROW INSERT INTO audit_table VALUES (new_row.id, new_row.name)
C) CREATE TRIGGER trigger_name BEFORE UPDATE ON table_name REFERENCING NEW AS new_row FOR EACH ROW INSERT INTO audit_table VALUES (new_row.id, new_row.name)
D) CREATE TRIGGER trigger_name BEFORE DELETE ON table_name REFERENCING OLD AS old_row FOR EACH ROW INSERT INTO audit_table VALUES (old_row.id, old_row.name)

Answer: A

Explanation: The correct syntax for creating a trigger in Apache Derby is option A.

38. Which of the following is not a valid sequence option in Apache Derby?

A) START WITH
B) INCREMENT BY
C) MAXVALUE
D) CYCLE

Answer: D

Explanation: CYCLE is not a valid sequence option in Apache Derby.

39. What is the default isolation level in Apache Derby?

A) READ UNCOMMITTED
B) READ COMMITTED
C) REPEATABLE READ
D) SERIALIZABLE

Answer: B

Explanation: The default isolation level in Apache Derby is READ COMMITTED.

40. What is the syntax for setting the isolation level for a transaction in Apache Derby?

A) SET ISOLATION LEVEL level_name
B) SET TRANSACTION ISOLATION LEVEL level_name
C) SET LEVEL ISOLATION level_name
D) SET ISOLATION level_name

Answer: B

Explanation: The correct syntax for setting the isolation level for a transaction in Apache Derby is option B.

41. Which of the following is not a valid transaction control statement in Apache Derby?

A) BEGIN TRANSACTION
B) COMMIT
C) ROLLBACK
D) END TRANSACTION

Answer: D

Explanation: END TRANSACTION is not a valid transaction control statement in Apache Derby.

42. What is the syntax for starting a transaction in Apache Derby?

A) BEGIN TRANSACTION
B) START TRANSACTION
C) OPEN TRANSACTION
D) INITIATE TRANSACTION

Answer: A

Explanation: The correct syntax for starting a transaction in Apache Derby is option A.

43. Which of the following is not a valid function in Apache Derby?

A) SUBSTRING
B) TRIM
C) REPLACE
D) CONCATENATE

Answer: D

Explanation: CONCATENATE is not a valid function in Apache Derby. The correct function name is CONCAT.

44. What is the syntax for using the SUBSTRING function in Apache Derby?

A) SUBSTRING(string FROM start_position FOR length)
B) SUBSTR(string, start_position, length)
C) STRING_SUBSTR(string, start_position, length)
D) SUBSTR(string FROM start_position FOR length)

Answer: A

Explanation: The correct syntax for using the SUBSTRING function in Apache Derby is option A.

45. Which of the following is not a valid data type in Apache Derby?

A) BOOLEAN
B) FLOAT
C) DOUBLE
D) DECIMAL

Answer: B

Explanation: FLOAT is not a valid data type in Apache Derby. The correct data type is DOUBLE.

46. What is the syntax for creating a table in Apache Derby?

A) CREATE TABLE table_name (column1 datatype1, column2 datatype2, …, columnN datatypeN)
B) CREATE table_name (column1 datatype1, column2 datatype2, …, columnN datatypeN)
C) TABLE CREATE table_name (column1 datatype1, column2 datatype2, …, columnN datatypeN)
D) CREATE table_name AS (column1 datatype1, column2 datatype2, …, columnN datatypeN)

Answer: A

Explanation: The correct syntax for creating a table in Apache Derby is option A.

47. Which of the following is not a valid constraint type in Apache Derby?

A) PRIMARY KEY
B) FOREIGN KEY
C) CHECK
D) UNIQUE CONSTRAINT

Answer: D

Explanation: UNIQUE CONSTRAINT is not a valid constraint type in Apache Derby. The correct syntax is simply UNIQUE.

48. What is the syntax for adding a foreign key constraint to a table in Apache Derby?

A) ALTER TABLE table_name ADD CONSTRAINT constraint_name FOREIGN KEY (column1) REFERENCES referenced_table (referenced_column)
B) ALTER TABLE table_name ADD FOREIGN KEY CONSTRAINT constraint_name (column1) REFERENCES referenced_table (referenced_column)
C) ALTER TABLE table_name ADD FOREIGN KEY (column1) REFERENCES referenced_table (referenced_column)
D) ADD FOREIGN KEY CONSTRAINT constraint_name TO table_name (column1) REFERENCES referenced_table (referenced_column)

Answer: A

Explanation: The correct syntax for adding a foreign key constraint to a table in Apache Derby

49. What is the syntax for inserting data into a table in Apache Derby?

A) INSERT INTO table_name (column1, column2, …, columnN) VALUES (value1, value2, …, valueN)
B) INSERT table_name (column1, column2, …, columnN) VALUES (value1, value2, …, valueN)
C) INSERT table_name VALUES (value1, value2, …, valueN)
D) INSERT INTO table_name VALUES (value1, value2, …, valueN)

Answer: A

Explanation: The correct syntax for inserting data into a table in Apache Derby is option A.

50. Which of the following is not a valid keyword in Apache Derby?

A) UNION
B) EXCEPT
C) INTERSECT
D) DIVIDE

Answer: D

Explanation: DIVIDE is not a valid keyword in Apache Derby. The correct keyword is CROSS JOIN.

These Apache Derby Multiple Choice Questions covered a wide range of topics related to Apache Derby, including its architecture, syntax, and functionality. Follow our Freshersnow portal regularly to get more technical quizzes.