Oracle Constraints By Blue Blaze

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By S_rajalakshmi8
S
S_rajalakshmi8
Community Contributor
Quizzes Created: 1 | Total Attempts: 120
Questions: 20 | Attempts: 120

SettingsSettingsSettings
Oracle Constraints By Blue Blaze - Quiz


Questions and Answers
  • 1. 

    WHERE  clauses allows alias names.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    WHERE clauses in SQL do not allow alias names. Alias names can only be used in SELECT statements to give columns or tables alternative names. The WHERE clause is used to filter rows based on specific conditions, and it does not support the use of alias names.

    Rate this question:

  • 2. 

    _________  constraint is used to limit the value range that can be placed in a column.

    Correct Answer
    Check
    Explanation
    The "Check" constraint is used to limit the value range that can be placed in a column. This constraint allows you to specify a condition that must be met in order for a value to be inserted or updated in the column. If the condition is not met, the database will throw an error and the operation will be rejected. This constraint is commonly used to enforce data integrity by ensuring that only valid values are stored in the column.

    Rate this question:

  • 3. 

    Select the statement which is collectively known as TCL?

    • A.

      Commit

    • B.

      Savepoint

    • C.

      Rollback

    • D.

      Grant

    Correct Answer(s)
    A. Commit
    B. Savepoint
    C. Rollback
    Explanation
    Commit, Savepoint, and Rollback are collectively known as Transaction Control Language (TCL) statements in database management systems.

    Commit is used to permanently save the changes made in a transaction, making them a permanent part of the database. Savepoint allows for creating a point in a transaction where you can roll back to if needed. Rollback is used to undo the changes made in a transaction and restore the database to its previous state. Grant, on the other hand, is a Data Control Language (DCL) statement used to grant privileges to users in a database.

    Rate this question:

  • 4. 

    Constraints are classified into _________ and __________ constraints.

    • A.

      Column level

    • B.

      Table level

    • C.

      Row level

    Correct Answer(s)
    A. Column level
    B. Table level
    Explanation
    Constraints in a database are rules or conditions that are applied to the data to ensure its integrity and consistency. In this context, column level constraints are rules that are applied to individual columns in a table, such as data type, nullability, and uniqueness constraints. On the other hand, table level constraints are rules that are applied to the entire table, such as primary key, foreign key, and check constraints. Therefore, constraints are classified into column level and table level constraints based on the scope of their application.

    Rate this question:

  • 5. 

    You can drop a column in a table with a simple ALTER TABLE DROP COLUMN statement, even if the column is referenced in a constraint.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given statement is false. If a column is referenced in a constraint, you cannot drop that column directly using the ALTER TABLE DROP COLUMN statement. You would need to first drop or modify the constraint that references the column before being able to drop the column itself.

    Rate this question:

  • 6. 

    All of a user's constraints can be viewed in the Oracle Data Dictionary view called: 

    • A.

      USER_TABLES

    • B.

      USER_CONSTRAINTS (*)

    • C.

      CONSTRAINTS

    • D.

      TABLE_CONSTRAINTS

    Correct Answer
    B. USER_CONSTRAINTS (*)
    Explanation
    The correct answer is USER_CONSTRAINTS. The Oracle Data Dictionary view called USER_CONSTRAINTS allows users to view all of their constraints. This view provides information about the constraints defined on tables owned by the current user. It includes details such as constraint name, type, table name, and the columns involved in the constraint. By querying this view, users can easily access and manage their constraints in the Oracle database.

    Rate this question:

  • 7. 

    What mechamisn does Oracle use in the background to enforce uniqueness in Primary and Unique key constraints? 

    • A.

      Unique indexes are created in the background by Oracle when Primary and Unique constraints are created or enabled (*)

    • B.

      Nothing extra is created when Primary Keys and Unique Keys are created

    • C.

      Internal Pointers

    • D.

      Ordered Lists

    Correct Answer
    A. Unique indexes are created in the background by Oracle when Primary and Unique constraints are created or enabled (*)
    Explanation
    Oracle uses unique indexes in the background to enforce uniqueness in Primary and Unique key constraints. When Primary and Unique constraints are created or enabled, Oracle automatically creates unique indexes to ensure that the values in the specified columns are unique. These indexes help Oracle enforce the uniqueness constraint efficiently by providing a fast lookup mechanism for duplicate values.

    Rate this question:

  • 8. 

    The command to 'switch off' a constraint is: 

    • A.

      ALTER TABLE STOP CHECKING

    • B.

      ALTER TABLE DISABLE CONSTRAINT (*)

    • C.

      ALTER TABLE STOP CONSTRAINTS

    • D.

      ALTER TABLE PAUSE CONSTRAINT

    Correct Answer
    B. ALTER TABLE DISABLE CONSTRAINT (*)
    Explanation
    The correct answer is "ALTER TABLE DISABLE CONSTRAINT (*)". This command is used to disable a constraint in a table. The asterisk (*) represents the name of the constraint that needs to be disabled. By using this command, the constraint will no longer be enforced, allowing for modifications to be made to the table without the constraint being checked.

    Rate this question:

  • 9. 

    Once constraints have been created on a table you will have to live with them as they are unless you drop and re-create the table.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Constraints on a table can be altered or dropped using the ALTER TABLE statement in SQL. This allows for modifications to the existing constraints without having to drop and recreate the entire table. Therefore, the statement that once constraints have been created on a table, they cannot be changed or modified is false.

    Rate this question:

  • 10. 

    The SQL WHERE clause:

    • A.

      limits the column data that are returned.

    • B.

      Limits the row data are returned.

    • C.

      Both A and B are correct.

    • D.

      Neither A nor B are correct.

    Correct Answer
    B. Limits the row data are returned.
    Explanation
    The SQL WHERE clause is used to filter rows based on a specified condition. It allows you to specify a condition that must be met for a row to be included in the result set. Therefore, it limits the row data that is returned, not the column data. So, the correct answer is "limits the row data are returned."

    Rate this question:

  • 11. 

     Which of the following is valid SQL for an Index?

    • A.

      CREATE INDEX ID;

    • B.

      CHANGE INDEX ID;

    • C.

      ADD INDEX ID;

    • D.

      REMOVE INDEX ID;

    Correct Answer
    A. CREATE INDEX ID;
    Explanation
    The correct answer is "CREATE INDEX ID;". This is valid SQL syntax for creating an index in a database. The other options, "CHANGE INDEX ID;", "ADD INDEX ID;", and "REMOVE INDEX ID;", do not exist in SQL syntax and are therefore not valid.

    Rate this question:

  • 12. 

    To remove duplicate rows from the results of an SQL SELECT statement, the ________ qualifier specified must be included.

    • A.

      ONLY

    • B.

      UNIQUE

    • C.

      DISTINCT

    • D.

      NULL

    Correct Answer
    C. DISTINCT
    Explanation
    To remove duplicate rows from the results of an SQL SELECT statement, the "DISTINCT" qualifier must be included. This qualifier ensures that only unique values are returned, eliminating any duplicate rows in the result set.

    Rate this question:

  • 13. 

    There is a possibility to create more  than one primary key on a single table

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    It is not possible to create more than one primary key on a single table. A primary key is a unique identifier for each record in a table, and by definition, there can only be one primary key. However, it is possible to have a composite primary key, which consists of multiple columns that together form a unique identifier. This is different from having multiple primary keys.

    Rate this question:

  • 14. 

    Check constraint can be used for self refential integrity

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    A check constraint is a rule that is applied to a column or a set of columns in a table to enforce the data integrity. It allows you to specify a condition that must be met for the data to be inserted or updated in the table. In the context of self-referential integrity, a check constraint can be used to ensure that a column referencing another column in the same table is valid. This means that the value in the referencing column must exist in the referenced column. Therefore, the statement "Check constraint can be used for self-referential integrity" is true.

    Rate this question:

  • 15. 

    Syntax for Referential integrity?

    • A.

      Foreign key(field_name)references table_name(field_name)

    • B.

      Foreign key(field_name)references(field_name) on delete cascade

    • C.

      Foreign key(field_name)references table_name(field_name) on delete cascade

    • D.

      Foreign key(field_name)references table_name(field_name) ondelete cascade

    Correct Answer(s)
    A. Foreign key(field_name)references table_name(field_name)
    C. Foreign key(field_name)references table_name(field_name) on delete cascade
    Explanation
    The correct answer is "foreign key(field_name)references table_name(field_name),foreign key(field_name)references table_name(field_name) on delete cascade". This is because the syntax for referential integrity includes the "foreign key" keyword followed by the name of the field, then the "references" keyword followed by the name of the table and the name of the field that the foreign key references. The second part of the answer includes the "on delete cascade" clause, which means that if a record in the referenced table is deleted, all the records in the table with the foreign key will also be deleted.

    Rate this question:

  • 16. 

    An automatic COMMIT occurs when:

    • A.

      DDL statement is issued

    • B.

      DCL statement is issued

    • C.

      Normal exit from SQL*PLUS without issuing explicit COMMIT or ROLLBACK

    • D.

      None of the above

    Correct Answer(s)
    A. DDL statement is issued
    B. DCL statement is issued
    C. Normal exit from SQL*PLUS without issuing explicit COMMIT or ROLLBACK
    Explanation
    An automatic COMMIT occurs when a DDL statement is issued, a DCL statement is issued, or there is a normal exit from SQL*PLUS without issuing an explicit COMMIT or ROLLBACK.

    Rate this question:

  • 17. 

    Zero is equivalent to null?

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Zero is not equivalent to null. Zero is a numerical value that represents the absence of quantity or value, while null is a special value that represents the absence of any object or reference. They are different concepts and cannot be considered equivalent.

    Rate this question:

  • 18. 

    When two users access the same table's specific row simultaneously , it is possible to update the data before one commits

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    When two users access the same table's specific row simultaneously, it is not possible to update the data before one commits. This is because most database systems implement locking mechanisms to ensure that only one user can modify a specific row at a time. This prevents conflicts and maintains data integrity. Therefore, the statement is false.

    Rate this question:

  • 19. 

    Which statement cannot be rolled back and committed automatically

    • A.

      DDL

    • B.

      DML

    • C.

      TCL

    • D.

      NONE OF THE ABOVE

    Correct Answer
    A. DDL
    Explanation
    DDL stands for Data Definition Language and is used to define and manage the structure of a database. It includes commands like CREATE, ALTER, and DROP. These commands are used to create, modify, or delete database objects like tables, indexes, and views. Unlike DML (Data Manipulation Language) and TCL (Transaction Control Language), DDL statements cannot be rolled back and committed automatically. Once a DDL statement is executed, the changes made to the database structure are permanent and cannot be undone using a rollback operation.

    Rate this question:

  • 20. 

    Which are the types of locks?

    • A.

      Automatic

    • B.

      Manual

    • C.

      Automatic and manual

    • D.

      None of the above

    Correct Answer
    C. Automatic and manual
    Explanation
    The types of locks can be categorized as either automatic or manual. Automatic locks are those that operate electronically or automatically, such as keyless entry systems or smart locks. On the other hand, manual locks require physical manipulation, such as turning a key or sliding a bolt, to lock or unlock a door. Therefore, the correct answer is "automatic and manual" as it includes both types of locks.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 04, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 11, 2011
    Quiz Created by
    S_rajalakshmi8
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.