Tag: databases

Questions Related to databases

  1. A single row subquery can retrieve data from only one table.

  2. A SQL query statement cannot display data from table B that is referred to in its subquery,unless table B is included in the main query's FROM clause.

  3. A SQL query statement can display data from table B that is referred to in its subquery, without including table B in its own FROM clause

  4. A single row subquery can retrieve data from more than one table.


Correct Option: B,D
  1. You can join a maximum of two tables through an equijoin.

  2. You can join a maximum of two columns through an equijoin.

  3. You can join n tables (all having single column primary keys) in a SQL statement by specifying a minimum of n-1 join conditions.

  4. To join two tables through an equijoin, the columns in the join condition must be primary key and foreign key columns.

  5. You specify an equijoin condition in the SELECT or FROM clauses of a SELECT statement.


Correct Option: C
Explanation:

To solve this question, the user needs to have knowledge of SQL and database concepts related to joining tables.

A. This option is incorrect because you can join any number of tables through an equijoin, not just a maximum of two.

B. This option is incorrect because you can join any number of columns through an equijoin, not just a maximum of two.

C. This option is correct. In a SQL statement, you can join n tables (all having single column primary keys) by specifying a minimum of n-1 join conditions.

D. This option is incorrect because while it is true that you can join two tables through an equijoin, the columns in the join condition do not have to be primary key and foreign key columns. They just need to have matching values.

E. This option is incorrect because you specify an equijoin condition in the WHERE clause of a SELECT statement.

Therefore, the correct answer is:

The Answer is: C. You can join n tables (all having single column primary keys) in a SQL statement by specifying a minimum of n-1 join conditions.

  1. DELETE, INSERT,SELECT

  2. DELETE, INSERT, SELECT, UPDATE

  3. ALTER, DELETE, INSERT, SELECT

  4. NONE


Correct Option: B
  1. You have too many tables.

  2. You have too many columns in your tables.

  3. You want to work on your own tables.

  4. You want to use another schema's tables.

  5. Your tables have difficult names.

  6. Your tables are too long.


Correct Option: D,E
  1. You want all unmatched data from both tables.

  2. One of the tables has more data than the other.

  3. You want all matched data from both tables.

  4. You want all matched and unmatched data from only one table.


Correct Option: A
  1. A WHERE clause can be used to restrict rows only.

  2. A WHERE clause CANNOT be used in a query if the query uses a HAVING clause.

  3. WHERE clause can be used to restrict both rows and groups.

  4. WHere clause filters the columns from the output


Correct Option: A
  1. It is faster than the Delete operation.

  2. You can roll back the deletion of rows after the statement executes.

  3. You must be the owner of the table or have DELETE ANY TABLE system privileges

  4. It releases the storage space used by the table.


Correct Option: A,C,D
  1. A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.

  2. The UNIQUE constraint does not permit a null value for the column

  3. The NOT NULL constraint ensures that null values are not permitted for the column

  4. The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index


Correct Option: B,D
  1. It is automatically used in all INSERT and UPDATE

  2. It is linked to a specific table.

  3. It belongs to a specific schema.

  4. It is automatically available to all users.


Correct Option: C