Principles of database system practice questions after class (final review questions with answers)

You can use these questions as end-of-term review questions or after-class materials.

This is the relational database part of Chapter 1

judgment

1. A relational schema can only have one "primary key".

                                                                                                                                              ×

2. Entity integrity requirements: Any tuple in the relationship cannot take a "null value" on the attributes that make up the "primary key".

                                                                                                                                              √

3. A candidate key refers to a set of attributes that can uniquely identify a tuple in a relational schema.

                                                                                                                                                √

4. A relational schema can have multiple "candidate keys".

                                                                                                                                                √

5. Since the data in the database is constantly updated, the relational schema is relatively changing.

                                                                                                                                                 ×

6. The data model is used to describe the world, so the more professional the better.

                                                                                                                                                  ×

7. In the ER diagram, the graphic used to represent the attribute is an ellipse.

                                                                                                                                                  √

multiple choice

1. Regarding the description of the attributes of the relationship, the correct one is ________.

A. An attribute with the same name can appear in a relationship

B. The attributes of a relationship can be decomposed into smaller operational units

C. The attributes of the relationship cannot be divided

D. None of the above is correct

Answer: C

2. The following description about the relational model is wrong is ________.

A. A relational schema is a representation of a relational structure

B. The general form of schema representation is: relationship name (attribute 1, attribute 2, ..., attribute n)

C. In relational mode, the order of attributes can change

D. In the relational model, the order of attributes cannot be changed, otherwise it will not be the original relational model

Answer: D

3. The following description of the primary key of the relationship is wrong

A. There cannot be two primary keys in a relationship

B. There is one and only one primary key in a relationship

C. The primary key can be a collection of attributes

D. The primary key can only be one attribute

Answer: D

4. The following description about the relational external code is wrong

A. The outer code must be the main code

B. The outer code must be a candidate code

C. The outer code is not necessarily the candidate code or the main code

D. The corresponding column in the table referenced by the foreign key must be a candidate key or a primary key

Answer: C

5. According to the rules of entity integrity, the following description of the primary key in a relationship is correct

A. The value of the main code component cannot be repeated, but it can be empty

B. The value of the main code component cannot be repeated, nor can it be empty

C. The value of the main code component can be repeated, but it cannot be empty

D. None of the above is correct

Answer: B

6. The correct description of the tuples in the relation below is ______.

A. The order of the tuples cannot be reversed arbitrarily, and must be arranged in the order of input

B. The order of tuples can be reversed, but no duplicate tuples can appear

C. The order of the tuples cannot be reversed arbitrarily, and must be arranged in the order of the primary code

D. After the order of the tuples is reversed, it will affect the relationship between the data in the database

Answer: B

7. There are three relations S, R and T as follows, then the operation to get T from S and R is ( ).

A. Projection

B. hand over

C. Natural join

D. Cartesian product

Answer: C

8. A relationship is as follows, the primary key of the relationship is ()

A.a

B.(a,b)

C.(b,c)

D.(a,c)

Answer: B

9. There are 8 fields in the student table. To find all boys whose surname is Wang and who are less than 20 years old, and only display the two fields of student number and name, the relational operation that should be used is ( ).

A. to choose, to project

B. choose, and

C. join, projection

D. and, difference

Answer: A

10. There are three relations R, S and T as follows:

A. to choose

B. Projection

C. hand over

D. and

Answer: D

multiple choice

1. Which of the following options are functions of the database management system?

A. Data Definition

B. Data organization and storage

C. Data Manipulation

D. Database operation and maintenance

Answer: ABCD

2. What requirements should the data model meet?

A. Can more realistically simulate the real world

B. is easy to understand

C. Try to be as abstract and complex as possible

D. Easy to realize on the computer

Answer: ABD

3. The constraint conditions of the data, the correct description below is _______.

A. Data constraints are a set of integrity rules

B. Integrity rules are the constraints and storage rules of data and their relationships in a given data model

C. Integrity rules are used to limit the database status and status changes that conform to the data model, so as to ensure the correctness, validity and compatibility of the data

D. In the relational model, the relationship should satisfy the two conditions of entity integrity and referential integrity

Answer: ABCD

4. The relationship is known P={ a,b }, Q={ x,y }, then is the relationship from P to Q.

A.{ }

B.{ 〈 a,x 〉,〈 a,y 〉,〈 b,y 〉 }

C.{ 〈 a,x 〉,〈 a,y 〉,〈 b,x 〉,〈 b,y 〉 }

D.{ 〈 a,y 〉,〈 b,x 〉 }

Answer: ABCD

fill in the blank

1.

The student-course database consists of the following four relational schemas:

Student table (student number, name, gender, age, major), among them, student number char, 5; name char, 8;

Teaching information form (course number, teaching staff number, teaching hours)

Teacher table (teacher number, name, gender, title, major)

Course schedule (course number, course name, credits, hours)

Course selection information form (student number, course number, grades)

Use relational algebra to do the following:

1. Query the name, title and course number of the teacher who has the teaching task.

        ∏Name, title, course number (teacher table ∞ teaching information table)

2. Inquire about the names and grades of all students who have taken courses.

        ∏Name, Grade (Student Form ∞Course Selection Information Form)

2.

The following databases are set up: including parts table P, supplier table S and supply table SP:

P (PNO, PNAME, PADDR, PQTY), which respectively represent: part number, part name, part storage location and part inventory, PNO,char,5

S (SNO, SNAME, SADDR), which respectively represent: supplier number, supplier name and supplier address

SP (SNO, PNO, SPQTY), where SPQTY represents supply

Use relational algebra to do the following:

1. Ask for the name and address of the supplier whose name is "gear".

        ΠSNAME,SADDR(σPNAME='gear'P∞SP∞S)

2. Ask the supplier to use the part number not supplied by 'San Tin Company'.

        ΠPNO(P)-ΠPNO(σSNAME='San Tin Company'(SP∞S))

Guess you like

Origin blog.csdn.net/m0_50962679/article/details/124566517