Database Principles and Applications Chapter 5 Homework

1. Multiple choice questions (26 questions in total, 78 points)

  1. (Single-choice question, 3 points) The prevention object of integrity check and control is ( ), to prevent them from entering the database.
    A. Unsemantic data, incorrect data
    B. Illegal user
    C. Illegal authorization
    D. Illegal operation

  2. (Single-choice question, 3 points) Among the following SQL commands, when users define a new relationship, it is ( ) to refer to the primary key of other relationships as the foreign key.
    A. INSERT
    B. DELETE
    C. REFERENCES
    D. SELECT

  3. (Single-choice question, 3 points)
    In the database system, the function to ensure correct and effective data and semantics is ( )
    A. Concurrency control
    B. Access control
    C. Security control
    D. Integrity Control

  4. (Single-choice question, 3 points) Which of the following statements about primary key constraints is wrong ( )
    A. Only one primary key constraint can be set in a table
    B. Primary key constraints cannot be defined on fields that allow null values
    C. Primary key constraints can be defined on fields that allow null values
    D. A combination of fields containing multiple fields can be set as the primary key

  5. (Single-choice question, 3 points) Among the phrases of the following SQL commands, the one that cannot define constraints on attributes is ( ).
    A. NOT NULL phrase
    B. UNIQUE phrase
    C. CHECK phrase
    D. HAVING Phrases

  6. (Single-choice question, 3 points) The "assertion" mechanism in SQL belongs to DBS ( )
    A. Integrity measures
    B. Security measures
    C. Physical security measures
    D. Recovery measures

  7. (Single-choice question, 3 points) SQL global constraints refer to tuple-based check clauses and ( )
    A. Non-null value constraints
    B. Domain constraint clauses
    C. Assertion
    D. Foreign key clause

  8. (Multiple choice, 3 points) The following incorrect statement about the integrity mechanism of SQL Server is ( ).
    A. "Relationship Diagram" is used to create foreign key constraints between tables.
    B. Check constraint (CHECK) is to limit the format and range of field values.
    C. Any field can be set as a primary key constraint.
    D. The primary key does not allow null values.

  9. (Single-choice question, 3 points) The event that cannot activate the trigger execution is ( )
    A. SELECT
    B. UPDATE
    C. INSERT
    D. DELETE

  10. (Multiple choice, 3 points) The ( ) of the database refers to the correctness and compatibility of the data.
    a. Security
    B. Integrity
    C. Concurrency control
    D. Recovery

  11. (Single-choice question, 3 points) The establishment of database integrity constraints needs to use the ( ) provided by the DBMS
    A. Data Definition Language
    B. Data Manipulation Language
    C. Data Query Language
    D. Data Control Language

  12. (Single-choice question, 3 points) In order to make the value of the attribute unique on each tuple, the reserved word ( ) should be used when creating the basic table
    A. UNIQUE
    B. COUNT
    C. DISTINCT
    D. UNION

  13. (Single-choice question, 3 points) In order to make the value of the index key unique in the basic table, the reserved word ( ) should be used in the index creation statement
    A. UNIQUE
    B. COUNT
    C. DISDINCT
    D. UNION

  14. (Single-choice question, 3 points) Use ( ) to delete a trigger in SQL Server
    A. ROLLBACK
    B. DROP
    C. DELALLOCATE
    D. DELETE

  15. (Single-choice question, 3 points) In a relational database, it is required that all primary attributes in the basic relationship must not have null values, and the constraint rules to be followed are ( ) A. Data dependency integrity
    rules
    B. User-defined integrity rules;
    C. Entity Integrity Rules
    D. None of the above is correct.

  16. (Single-choice question, 3 points) In the database system, the function to ensure correct and effective data and semantics is ( )
    A. Concurrency control
    B. Access control
    C. Security control
    D. Integrity Control

  17. (Single-choice question, 3 points) Which of the following statements about primary key constraints is wrong ( )
    A. Only one primary key constraint can be set in a table
    B. Primary key constraints cannot be defined on fields that allow null values
    C. Primary key constraints can be defined on fields that allow null values
    D. A combination of fields containing multiple fields can be set as the primary key

  18. (Multiple choice, 3 points) Executing statements other than ( ) on tables or views can activate triggers.
    A. Insert
    B. Delete
    C. Update
    D. Create

  19. (Single-choice question, 3 points) In the table definition of the database, restrict the value of the grade attribute column to be within the range of 0 to 100, which belongs to the ( ) constraint of the data.
    A. Entity integrity
    B. Referential integrity
    C. User-defined
    D. User Actions

  20. (Multiple choice, 3 points) Referential integrity can be achieved by establishing ( ).
    A. Primary key constraints and unique constraints
    B. Primary key constraints and foreign key constraints
    C. Unique constraints and foreign key constraints
    D. None of the above

  21. (Single-choice question, 3 points) In a relational database, the connection between tables is realized through ( ).
    A. Entity integrity rules
    B. User-defined integrity rules
    C. Referential Integrity Rules
    D. primary key

  22. (Single-choice question, 3 points) The integrity of database data generally refers to ( ).
    A. Data independence and consistency
    B. Data portability and reliability
    C. Data correctness and compatibility
    D. Controllability and availability of data

  23. (Single-choice question, 3 points) The correct statement about constraints is ( )
    A. None of the above is correct
    B. Each constraint can act on multiple columns, but it must be in one table
    C. Each constraint can only act on one column
    D. Each constraint can act on multiple columns of multiple tables

  24. (Single-choice question, 3 points) When defining the primary key, the phrase that will be used in create table is ().
    A. trigger
    B. check
    C. foreign key
    D. Primary key

  25. (Single-choice question, 3 points) If column m in table A refers to column n in table B, which of the following statements is correct ().
    A. The nth column can be any column
    B. The nth column must not be the main code
    C. The nth column must have the same name as the mth column
    D. The nth column must be the primary code

  26. (Single-choice question, 3 points) If there is a reference relationship between the two student number columns of the elective (student number, course number, grade) and student (student number, name, gender, age), insert a new one into the elective table If there is a violation of referential integrity during recording, the processing strategy that can be adopted is ().
    A. Cascading updates
    B. Cascading deletes
    C. Refusal to enforce
    D. Set to null

2. Multiple choice questions (3 questions in total, 12 points)

  1. (Multiple choice, 4 points) When performing the following ( ) operations, the RDBMS will automatically check according to the entity integrity rules.
    A. Insert a record in the table
    B. Update the primary code column

    C. Delete records in the table
    D. Update non-primary key columns

  2. (Multiple choice, 4 points) In the student course selection database S_T, there is a student table student (sno, sname, ssex, sage, sdept), sno is the primary key; course table course (cno, cname, cpno, credit), cno is Primary key; student course selection table sc(sno,cno,grade), the primary key is sno+cno. The foreign key sno of the sc table refers to the primary key sno of the student table, and the foreign key cno of the sc table refers to the primary key cno of the course table. The following ( ) operations may violate referential integrity constraints.
    A. Delete a record in the student table
    B. Modify the sno value of a record in the student table
    C. Insert a record into the sc table
    D. Modify the sno value of a record in the sc table

  3. (Multiple choice, 4 points) In order to maintain the integrity of the database, the DBMS must provide ( ).
    A. Mechanisms for defining integrity constraints
    B. Mechanisms for checking integrity constraints
    C. Breach handling

    D. Authorization mechanism

3. Short answer questions (1 question in total, 10 points)

  1. (Short answer question, 10 points) What is the difference and connection between the concept of database integrity and the concept of database security?

Correct answer:
Data integrity and security are two different concepts, but there is a certain connection. The former is to prevent the existence of non-semantic data in the database, and to prevent the input and output of wrong information. The latter is to protect the database from malicious damage and illegal access. That is to say, the prevention objects of security measures are illegal users and illegal operations, and the prevention objects of integrity measures are unsemantic data.

Guess you like

Origin blog.csdn.net/qq_46373141/article/details/131246034