Tag: databases

Questions Related to databases

  1. Atomicity,Consistency,Isolation and Durability

  2. Atomicity,Concurrently,Isolation,Durability

  3. Atomicity,Consistency,Incremental,Durability

  4. Atomicity,Concurrently,Incremental,Durability


Correct Option: A
  1. The indexed column is declared as NOT NULL

  2. The indexed columns are used in the FROM clause

  3. The indexed columns are part of an expression

  4. The indexed column contains a wide range of values


Correct Option: D
Explanation:

To answer this question, the user needs to know what an index is and how it works.

An index is a data structure that improves the speed of data retrieval operations on a database table. It does this by providing a quick lookup mechanism for finding rows that match certain column values in the table. Indexes are most useful when searching large tables for a specific value or set of values.

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

A. The indexed column is declared as NOT NULL: This option is not necessarily the most useful scenario for an index. Declaring a column as NOT NULL simply means that the column cannot contain NULL values. While this may improve data integrity, it does not necessarily make an index more useful.

B. The indexed columns are used in the FROM clause: This option is not necessarily the most useful scenario for an index, either. Using indexed columns in the FROM clause can help improve query performance by allowing the database to retrieve only the necessary rows. However, it does not necessarily make the index more useful than other scenarios.

C. The indexed columns are part of an expression: This option can be useful for an index. When indexed columns are part of an expression, the database can still use the index to search for values that match the expression. This can help improve query performance.

D. The indexed column contains a wide range of values: This option is the most useful scenario for an index. When a column contains a wide range of values, it can be difficult for the database to search through all the values to find the ones that match a specific criteria. However, if the column is indexed, the database can use the index to quickly find the values that match the criteria, which can greatly improve query performance.

Therefore, the correct answer is:

The Answer is: D

  1. ORDER BY SALARY > 5000

  2. GROUP BY SALARY > 5000

  3. HAVING SALARY > 5000

  4. WHERE SALARY > 5000


Correct Option: D
Explanation:

To solve this question, the user needs to know the basic syntax of a SELECT statement in SQL, including the purpose of each clause.

The WHERE clause is used to filter the rows returned by a query based on specified conditions. In this case, we want to limit the display to only those employees whose salary is greater than 5000. Therefore, the correct answer is:

The Answer is: D. WHERE SALARY > 5000

Option A, ORDER BY SALARY > 5000 is incorrect because the ORDER BY clause is used to sort the rows returned by a query in ascending or descending order based on a specified column. It is not used to filter rows based on specific conditions.

Option B, GROUP BY SALARY > 5000 is incorrect because the GROUP BY clause is used to group the rows returned by a query based on one or more columns. It is not used to filter rows based on specific conditions.

Option C, HAVING SALARY > 5000 is incorrect because the HAVING clause is used to filter the rows returned by a query based on conditions that involve aggregate functions, such as SUM, COUNT, AVG, MAX, and MIN. It is not used to filter rows based on specific conditions.

  1. To simplify the process of creating new users using the CREATE USER xxx IDENTIFIED by yyy statement

  2. To grant a group of related privileges to a user

  3. When the number of people using the database is very high

  4. To simplify the process of granting and revoking privileges


Correct Option: C,D
  1. Must begin with either a number or a letter

  2. Must be 1-30 characters long

  3. Should not be an Oracle Server reserved word

  4. Must contain only A-Z, a-z, 0-+, _, *, and #.

  5. Must contain only A-Z, a-z, 0-9, _, $, and #.

  6. Must begin with a letter


Correct Option: B,C,E,F
  1. Use the DESCRIBE command in the EMP_DEPT VU view

  2. Use the DEFINE VIEW command on the EMP_DEPT VU view

  3. Use the DESCRIBE VIEW command on the EMP_DEPT VU view

  4. Query the USER_VIEWS data dictionary view to search for the EMP_DEPT_VU view

  5. Query the USER_SOURCE data dictionary view to search for the EMP_DEPT_VU view

  6. Query the USER_OBJECTS data dictionary view to search for the EMP_DEPT_VU view


Correct Option: D
  1. Constraints provide data independence

  2. Constraints make complex queries easy

  3. Constraints enforce rules at the view level

  4. Constraints enforce rules at the table level

  5. Constraints prevent the deletion of a table if there are dependencies

  6. Constraints prevent the deletion of an index if there are dependencies


Correct Option: C,D,E
  1. The main query executes with the first value returned by the subquery

  2. The main query executes with the last value returned by the subquery

  3. The main query executes with all the values returned by the subquery

  4. The main query fails because the multiple-row subquery cannot be used with the comparison operator

  5. You cannot define a multiple-row subquery in the WHERE clause of a SQL query


Correct Option: D