0

databases Online Quiz - 35

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

What is a candidate key?

  1. Used to uniquely identify a row

  2. Alias for primary key

  3. Used to identify a column

  4. Alias for foreign key


Correct Option: A

Can I call a trigger directly called from an application?

  1. True

  2. False


Correct Option: B

A view is nothing but a ________ table or a stored query

  1. Dymanic

  2. Real

  3. Virtual

  4. Static


Correct Option: C
Explanation:

To solve this question, the user needs to know about views in database management systems. A view is a virtual table that does not store any data but only displays data from one or more tables in the database.

Based on this information, the correct answer is:

The Answer is: C. Virtual

How can we get the number of records or rows in a table?

  1. Using COUNT

  2. Using NUM

  3. Using NUMBER

  4. Both a and c above


Correct Option: A

An outer join requires each record in the two joined tables to have a matching record.

  1. True

  2. False


Correct Option: B

How do I find out all databases starting with ‘test to which I have access to?

  1. SHOW DATABASES LIKE ‘%tech%’;

  2. SHOW DATABASES LIKE ‘%tech;

  3. SHOW DATABASES LIKE ‘'tech'%’;

  4. SHOW DATABASES LIKE ‘tech%’;


Correct Option: D

Can I define multiple unique constraints on a table?

  1. True

  2. False


Correct Option: A

When do we use a HAVING clause?

  1. To limit the output of a query

  2. To limit the output of a query using an aggregate function only

  3. When GROUP by is used

  4. both b and c above


Correct Option: B

USE keyword is used to select a ___________ .

  1. Table

  2. Column

  3. Database

  4. All the above


Correct Option: C

AI Explanation

To answer this question, you need to understand the purpose of the SQL keyword "USE".

The "USE" keyword in SQL is used to select a specific database. It allows you to switch between databases in a multi-database environment. Once a database is selected using the "USE" keyword, all subsequent SQL statements will be executed in the context of that database.

Let's go through each option to understand why it is correct or incorrect:

Option A) Table - This option is incorrect. The "USE" keyword is not used to select a table. Instead, the "SELECT" statement is used to retrieve data from a table.

Option B) Column - This option is incorrect. The "USE" keyword is not used to select a column. Columns are selected using the "SELECT" statement.

Option C) Database - This option is correct. The "USE" keyword is used to select a specific database in SQL. It allows you to switch between databases.

Option D) All the above - This option is incorrect. The "USE" keyword is not used to select tables or columns. It is specifically used to select databases.

The correct answer is option C. This option is correct because the "USE" keyword is used to select a specific database.

Enum values are stored accodring to their index numbers?

  1. True

  2. False


Correct Option: B

The execution plan of the SQL statement is stored in

  1. A flat file called "plan_table.txt"

  2. Oracle Table called "plan_table"

  3. Oracle Table called "plan table"

  4. A flat file called "plan_table.tbl"


Correct Option: B

What is TRUE about driving table?

  1. It's advisable to choose the driving table with maximum number of records

  2. Number of records is NOT the criteria while selecting driving table

  3. It's advisable to choose the driving table with less number of records

  4. Driving table is always the last table accessed by the Optimizer


Correct Option: C

Why one should NOT use expressions on the columns in the predicate?

  1. Optimizer will return parse error if expressions are used on columns in the predicate

  2. Optimizer does not use index if expressions are used on the columns in the predicate, even if one exists

  3. It makes no difference with / without expressions on the columns in the predicate

  4. Using expressions on the columns in the predicate won't get benefits of using Table Alias


Correct Option: B

What will be the output of- "Select 1 from dual UNION Select 'A' from dual"

  1. 1,A

  2. A

  3. Error

  4. 1


Correct Option: C
  1. 10th row

  2. 1st row

  3. no rows returned

  4. First 10 rows


Correct Option: C
Explanation:

To solve this question, the user needs to have basic knowledge of SQL and the concept of the rownum keyword in SQL.

The rownum keyword is used to assign a unique number to each row returned by a query in Oracle. It is often used to limit the number of rows returned by a query.

Now, let's go through each option and explain why it is right or wrong:

A. 10th row: This option is incorrect. The rownum keyword assigns a unique number to each row returned by a query. However, the where clause in the given SQL limits the result set to only the row where rownum equals 10. This means that the SQL query will only return one row, and that row will be the 10th row in the result set.

B. 1st row: This option is incorrect. The where clause in the given SQL limits the result set to only the row where rownum equals 10. This means that the SQL query will only return one row, and that row will be the 10th row in the result set.

C. no rows returned: This option is incorrect. The SQL query will return one row, which is the 10th row in the result set.

D. First 10 rows: This option is incorrect. The where clause in the given SQL limits the result set to only the row where rownum equals 10. This means that the SQL query will only return one row, and that row will be the 10th row in the result set.

The Answer is: C

When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?

  1. System tablespace

  2. Default tablespace for the user

  3. Users tablespace

  4. Oracle will give an error


Correct Option: B

Which of the following SQL functions can operate on any datatype?

  1. TO_CHAR

  2. LOWER

  3. MAX

  4. CEIL

  5. LPAD


Correct Option: C

Assuming today is Monday, 10 July 2000, what is returned by this statement: SELECT to_char(NEXT_DAY(sysdate, 'MONDAY'), 'DD-MON-RR') FROM dual?

  1. 10-JUL-00

  2. 12-JUL-00

  3. 11-JUL-00

  4. 14-JUL-00

  5. 17-JUL-00


Correct Option: E
- Hide questions