Java, SQL, and JUnit Fundamentals

Comprehensive quiz covering Java programming concepts, SQL database operations, and JUnit testing framework fundamentals

60 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Denormalization is

  1. The process of adding redundancy to a database
  2. Using triggers to automate tasks
  3. Abstracting data
  4. Putting the database in an exceptional state that prevents public access
Question 2 Multiple Choice (Single Answer)

Data Definition Language (DDL) statements are used to define database structure or schema

  1. True
  2. False
Question 3 Multiple Choice (Single Answer)

DML stands for

  1. Data Manipulated Language
  2. Defined Manipulation Language
  3. data Morphed Language
  4. Data Manipulation Language
Question 4 Multiple Choice (Single Answer)

DDL stands for

  1. Data Definition Language
  2. Data Directed Language
  3. Data Defined Language
  4. Derived Data Language
Question 5 Multiple Choice (Single Answer)

Which SQL statement is used to insert new data in a database?

  1. insert into
  2. insert new
  3. add new
  4. add record
Question 6 Multiple Choice (Single Answer)

What is SQL Injection?

  1. Using inline queries in a SqlCommand object
  2. Using Parameters to take inputs from users
  3. Injecting a SQL Statement as user input
  4. Installing a plugin to SQL Server Management Studio
Question 7 Multiple Choice (Single Answer)

The SQL UPDATE statement can...

  1. Update only one row at a time
  2. Update multiple rows at a time
  3. Delete a row based on a where clause
  4. Update the current system time of the database
Question 8 Multiple Choice (Single Answer)

Which of the following are typical commands of DML?

  1. CREATE
  2. ALTER
  3. DROP
  4. UPDATE
Question 9 Multiple Choice (Single Answer)

SQL stands for:

  1. Shorthand Query Language
  2. Structured Query Lines
  3. Structured Query Language
  4. Structured Query Lambda
Question 10 Multiple Choice (Single Answer)

A constraint is applied to a row and not a column

  1. True
  2. False
Question 11 Multiple Choice (Single Answer)

A primary key is used to uniquely identify a particular entry or row in a table.

  1. True
  2. False
Question 12 Multiple Choice (Single Answer)

In a one-to-one relationship, you typically use a third table as an association or join table.

  1. True
  2. False
Question 13 Multiple Choice (Single Answer)

DDL Statements include commands like INSERT, UPDATE, and DELETE?

  1. True
  2. False
Question 14 Multiple Choice (Single Answer)

Which command is used to remove a table from memory?

  1. DELETE
  2. DROP
  3. TRUNCATE
  4. REMOVE
Question 15 Multiple Choice (Single Answer)

A subquery is a SQL query that inserts a record into a table.

  1. True
  2. False
Question 16 Multiple Choice (Single Answer)

Which of the following returns the number of records in the result from a SELECT query?

  1. ADD()
  2. SUM()
  3. COUNT()
  4. TOTAL()
Question 17 Multiple Choice (Single Answer)

Which of the following retrieves all columns and all rows from the Customers table?

  1. SELECT * FROM Customers
  2. SELECT % FROM Customers
  3. SELECT all FROM Customers
  4. SELECT all columns FROM Customers
Question 18 Multiple Choice (Single Answer)

CRUD stands for:

  1. Create, Retrieve, Update, Derive
  2. Create, Retrieve, Undo, Delete
  3. Create, Read, Update, Delete
  4. Control, Read, Undo, Delete
Question 19 Multiple Choice (Single Answer)

Use the AS keyword to specify an alias

  1. True
  2. False
Question 20 Multiple Choice (Single Answer)

A join can be used to combine information from two separate tables

  1. True
  2. False
Question 21 Multiple Choice (Multiple Answers)

What is required of a primary key? (Select all that apply)

  1. Unique Value
  2. Integer Data Type
  3. Not Null
  4. Foreign
Question 22 Multiple Choice (Single Answer)

What do we call a field that references a field in another table?

  1. Connection Key
  2. Primary Key
  3. Candidate Key
  4. Foreign Key
Question 23 Multiple Choice (Single Answer)

Insert is a part of this sublanguage

  1. DQL
  2. DML
  3. TCL
  4. DDL
Question 24 Multiple Choice (Single Answer)

UPPER(), ABS(), CONCAT() are examples of

  1. Aggregate Functions
  2. Constraints
  3. Scalar functions
  4. Filters
Question 25 Multiple Choice (Single Answer)

MAX(), SUM(), and COUNT() are examples of

  1. Aggregate functions
  2. Scalar functions
  3. Operators
  4. Sequences
Question 26 Multiple Choice (Single Answer)

Referential integrity stipulates

  1. Every table must have a primary key
  2. Foreign keys must always reference a valid unique key
  3. Joins should only be used with foreign and primary keys
  4. Columns should be atomic
Question 27 Multiple Choice (Single Answer)

In SQL, NULL values

  1. May throw NullPointerExceptions
  2. Have undefined behavior in logical expressions
  3. Represent the lack of a value for a column
  4. Are only valid in columns with the NULLABLE constraint
Question 28 Multiple Choice (Single Answer)

The UNIQUE constraint requires that values must be

  1. Unique in the table
  2. Uniquely reference a primary key
  3. Unique in the row
  4. Unique in the column
Question 29 Multiple Choice (Single Answer)

A sequence is

  1. Operations meant to encapsulate a task and must maintain ACID properties
  2. Used to track sequence values
  3. A column data type used to represent arrays
  4. The set of valid values in a BETWEEN clause
Question 30 Multiple Choice (Single Answer)

What do we call a primary key that consists of multiple columns in a table?

  1. composite key
  2. double-primary key
  3. consisting key
  4. foreign key
Question 31 Multiple Choice (Single Answer)

Which of the following statements are correct about JUnit?

  1. It is an open source framework.
  2. All of the above.
  3. It provides Annotation to identify the test methods.
  4. It provides Assertions for testing expected results.
Question 32 Multiple Choice (Single Answer)

Which of the following annotation causes that method to be run before each Test method?

  1. @Test
  2. @After
  3. @BeforeClass
  4. @Before
Question 33 Multiple Choice (Multiple Answers)

Which of the following classes implement the Map interface? (Choose all that apply)

  1. HashMap
  2. ArrayMap
  3. Hashtable
  4. TreeMap
Question 34 Multiple Choice (Single Answer)

What is garbage collection?

  1. The process of negating methods from a super class.
  2. The process of restoring orphaned objects.
  3. The process of de-allocating memory automatically.
  4. The process of creating a new object.
Question 35 Multiple Choice (Single Answer)

What is test-driven development?

  1. Process of writing tests first, then ensuring the tests pass
  2. The process of writing tests at the end of development
  3. The process of having end users test out the application and report bugs
  4. The process of automating deployment of the application and then testing
Question 36 Multiple Choice (Single Answer)

What is unit testing?

  1. Manually testing your application through the GUI or the command line
  2. Testing the smallest components of the application in isolation.
  3. A way of testing the integration of many different components
  4. Having the end users of the application try it out and report bugs
Question 37 Multiple Choice (Single Answer)

What is JUnit?

  1. An integration testing framework for Java
  2. A unit test framework for any programming language
  3. A unit testing framework for Java
  4. A testing library which provides a few helper methods
Question 38 Multiple Choice (Single Answer)

A mock is used to

  1. Provide stand-in objects for dependencies to isolate tested code.
  2. Modify the tested class state at runtime.
  3. Assert values to ensure they meet expectations.
  4. Fake unit tests so that they pass regardless of code stability.
Question 39 Multiple Choice (Single Answer)

What language does Gradle use for declaring the project configuration

  1. XML
  2. HTML
  3. JSON
  4. Groovy
Question 40 Multiple Choice (Single Answer)

Which interface does not extend the Collection interface?

  1. List
  2. Map
  3. Set
  4. Queue
Question 41 Multiple Choice (Single Answer)

A class can be abstract, even if all of its methods are concrete.

  1. True
  2. False
Question 42 Multiple Choice (Single Answer)

The equals() method is equivalent to the == operator, unless overridden

  1. True
  2. False
Question 43 Multiple Choice (Single Answer)

Java can be run on any machine that has a JVM

  1. True
  2. False
Question 44 Multiple Choice (Single Answer)

What is the standard signature for the main method?

  1. public void main(String args[])
  2. public void static main(String args[])
  3. public static void main(String args[])
  4. public static void main()
Question 45 Multiple Choice (Single Answer)

An unchecked exception must be dealt with in a try/catch block.

  1. True
  2. False
Question 46 Multiple Choice (Single Answer)

A sub class can access private members of the super class.

  1. True
  2. False
Question 47 Multiple Choice (Single Answer)

Method overriding is

  1. Method with different number or type of parameters
  2. When the JVM overrides your calls for Garbage Collection.
  3. None of the Above
  4. Same method signature but different implementation
Question 48 Multiple Choice (Single Answer)

How do you get the size of an array?

  1. myArray.size
  2. myArray.size()
  3. myArray.length
  4. myArray.length()
Question 49 Multiple Choice (Multiple Answers)

Which of the following are Short-Circuit?

  1. |
  2. ||
  3. &
  4. &&
Question 50 Multiple Choice (Single Answer)

Serializable interface methods must be implemented in the class it extends.

  1. True
  2. False
Question 51 Multiple Choice (Single Answer)

Under what situation do you obtain a default constructor?

  1. When the class has no other constructors
  2. When you define at least one constructor with at least one parameter
  3. When you define at least one constructor
  4. none of the above
Question 52 Multiple Choice (Single Answer)

The changes to the instance variables of one object also have an effect on the instance variables of the other object.

  1. True
  2. False
Question 53 Multiple Choice (Single Answer)

A try-finally block is legal and does not require a catch block.

  1. True
  2. False
Question 54 Multiple Choice (Single Answer)

What is the root interface of the Collections API?

  1. Collections
  2. Throwable
  3. List
  4. Collection
Question 55 Multiple Choice (Single Answer)

Which one of these is NOT a benefit provided by an IDE?

  1. They provide a GUI for writing code
  2. They can compile your code for you
  3. They automatically download 3rd-party libraries from the internet
  4. They make it easy to manage your project structure
Question 56 Multiple Choice (Single Answer)

What is the purpose of the Java compiler?

  1. To transform Java code into instructions usable by a web browser
  2. To transform Java code into instructions usable by the JVM
  3. To transform Java code into instructions usable by the operating system
Question 57 Multiple Choice (Single Answer)

What is the proper format for assigning a value to a variable?

  1. int 5 = x;
  2. 5 = x int;
  3. int x = 5;
  4. x = 5 int;
Question 58 Multiple Choice (Single Answer)

What is the difference between the = and == operators?

  1. The = operator is assignment, the == operator tests equality
  2. The == operator is assignment, the = operator tests equality
Question 59 Multiple Choice (Single Answer)

If one class can be described as a "specific example" of another, that relationship can be described through inheritance

  1. True
  2. False