0

databases Online Quiz - 207

Description: databases Online Quiz - 207
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0

What is the use of reuse storage clause when used with truncate table statement?

  1. specifies that the empty space created by deleting the records must be retained for this table and should not be used by other tables

  2. specifies that the empty space created by deleting the records, can be used by other tables.

  3. specifies that this transaction can be rolled back later

  4. This clause cannot be used with truncate statement


Correct Option: A

Which of the following are valid pseudocolumns in oracle?

  1. rowid

  2. row_num

  3. sl_no

  4. rownum

  5. sid


Correct Option: A,D

For which of these constraints, an unique index is automatically created while creating constraints?

  1. Primary Key

  2. Check

  3. Unique

  4. Not Null

  5. Foreign Key


Correct Option: A,C

1.Which statements about JDBC are true? (2 answers)

  1. JDBC is an API to connect to relational-, object- and XML data sources

  2. JDBC stands for Java DataBase Connectivity

  3. JDBC is an API to access relational databases, spreadsheets and flat files

  4. JDBC is an API to bridge the object-relational mismatch between OO programs and relational


Correct Option: B,C
  1. Which packages contain the JDBC classes?
  1. java.jdbc and javax.jdbc

  2. java.jdbc and java.jdbc.sql

  3. java.sql and javax.sql

  4. java.rdb and javax.rdb


Correct Option: C

AI Explanation

To answer this question, you need to understand the Java Database Connectivity (JDBC) API and the packages that contain the JDBC classes.

The correct answer is C) java.sql and javax.sql.

Explanation for each option:

Option A) java.jdbc and javax.jdbc - This option is incorrect because there is no package named java.jdbc or javax.jdbc that contains the JDBC classes.

Option B) java.jdbc and java.jdbc.sql - This option is incorrect because there is no package named java.jdbc.sql that contains the JDBC classes.

Option C) java.sql and javax.sql - This option is correct. The JDBC classes are contained in the java.sql and javax.sql packages. These packages provide the necessary classes and interfaces for connecting to and interacting with databases using Java.

Option D) java.rdb and javax.rdb - This option is incorrect because there is no package named java.rdb or javax.rdb that contains the JDBC classes.

In conclusion, the correct answer is C) java.sql and javax.sql because these packages contain the JDBC classes.

  1. Which type of driver provides JDBC access via one or more ODBC drivers?
  1. Type 1 driver

  2. Type 2 driver

  3. Type 3 driver

  4. Type 4 driver


Correct Option: A

4.Which type of driver converts JDBC calls into the network protocol used by the database management system directly?

  1. Type 1 driver

  2. Type 2 driver

  3. Type 3 driver

  4. Type 4 driver


Correct Option: D

5.Which type of Statements can execute parameterized queries?

  1. PreparedStatement

  2. ParameterizedStatement

  3. ParameterizedStatement and CallableStatement

  4. All kinds of Statements (i.e. which implement a sub interface of Statement)


Correct Option: A

AI Explanation

To answer this question, you need to understand the concept of parameterized queries and the different types of statements in Java.

A parameterized query is a SQL statement that allows you to pass parameters dynamically at runtime. This is useful when you want to execute the same query multiple times with different parameter values.

In Java, there are different types of statements that can be used to execute SQL queries. The options provided are:

A. PreparedStatement - This option is correct because a PreparedStatement is specifically designed to execute parameterized queries. It allows you to define placeholders (parameters) in the SQL statement and then set their values at runtime using methods like setString, setInt, etc.

B. ParameterizedStatement - This option is incorrect because there is no built-in interface or class in Java named ParameterizedStatement.

C. ParameterizedStatement and CallableStatement - This option is incorrect because while a CallableStatement can execute stored procedures with parameters, it is not specifically designed for executing parameterized queries. Therefore, only the PreparedStatement is the correct option.

D. All kinds of Statements (i.e. which implement a sub interface of Statement) - This option is incorrect because not all types of statements in Java can execute parameterized queries. Only the PreparedStatement is designed for this purpose.

Therefore, the correct answer is A) PreparedStatement.

6.What is, in terms of JDBC, a DataSource?

  1. A DataSource is the basic service for managing a set of JDBC drivers

  2. A DataSource is the Java representation of a physical data source

  3. A DataSource is a registry point for JNDI-services

  4. A DataSource is a factory of connections to a physical data source


Correct Option: D

To ensure proper data conversion between databases with different character sets, you must ensure that

  1. ASCII characters are capitalized

  2. INT data consists of non-negative numbers

  3. CHAR data consists of well-formed strings.

  4. CHAR data consists of at least a nil string

  5. None of the choices.


Correct Option: C

Which of the following correctly describe the LONG columns (choose all that apply):

  1. You can use them to store long text strings

  2. They have many of the characteristics of VARCHAR2 columns

  3. They store variable-length character strings containing up to 2 gigabytes

  4. None of the choices.


Correct Option: A,B,C

Which of the following are the valid datetime datatypes in Oracle (choose all that apply):

  1. TIMESTAMP WITH LOCAL TIME ZONE

  2. TIMESTAMP

  3. TIMESTAMP WITH TIME ZONE

  4. DATE


Correct Option: A,B,C,D

Which of the following are the restrictions of creating bitmap indexes (choose all that apply):

  1. You cannot specify BITMAP for a domain index

  2. You cannot specify both UNIQUE and BITMAP

  3. You cannot specify BITMAP when creating a local index.

  4. You cannot specify BITMAP when creating a global partitioned index


Correct Option: A,B,D

Text literals have properties of which of the following datatypes (choose all that apply):

  1. CHAR

  2. CLOB

  3. VARCHAR2

  4. Float


Correct Option: A,C

A sequence generates values that are often used for (choose all that apply):

  1. primary keys

  2. sales figures

  3. foreign keys

  4. unique keys


Correct Option: A,D

What's command to start DBCONSOLE service on database installed on Linux?

  1. emctl start dbconsole

  2. start dbconsole

  3. dbconsole start

  4. emctl dbconsole start


Correct Option: A

In Oracle, the result of comparison conditions can be (choose all that apply):

  1. TRUE

  2. UNKNOWN

  3. ERROR

  4. NULL

  5. FALSE


Correct Option: A,B,E

What is default location for portlist.ini file?

  1. $ORACLE_HOME/sysman/install

  2. $ORACLE_HOME/install

  3. $ORACLE_HOME/rdbms/admin/install

  4. $ORACLE_HOME/dbs/install


Correct Option: B

What command is used to reclaim unused space for table TABLE1?

  1. ALTER TABLE TABLE1 SHRINK;

  2. ALTER TABLE TABLE1 SHRINK SPACE;

  3. ALTER TABLE TABLE1 SHRINK UNUSED;

  4. ALTER TABLE TABLE1 SHRINK ROWs;


Correct Option: B

Single-row functions can appear in which of the following (choose all that apply):

  1. WHERE clauses

  2. START WITH and CONNECT BY clauses

  3. select lists

  4. HAVING clauses


Correct Option: A,B,C,D
- Hide questions