Southwest Jiaotong University 2017 Computer Re-examination Written Questions (Database)

statement

The following notes are all my personal opinions after reviewing the information. If there is any error, please correct me in the comment area, thank you very much! !

database

It is recommended to watch the "Database System" course video of Harbin Institute of Technology at station b first, it is very clear!


1. Multiple choice questions

1. Among the following four items, the one that is not the main feature of the database system is ()

A. Data structured B. Data redundancy is small

C. Higher data independence D. Standardization of procedures

The main features of the database system:

1. Data structure

2. High data sharing, low redundancy and easy to expand

3. High data independence

4. Data is managed and controlled by DBMS

Answer: D

2. The description of the data view used by a single user is called () 

A, external mode B, conceptual mode C, internal mode D, storage mode

The internal architecture of the database system is a three-level model structure, including:

1. External mode, also known as user mode and sub mode. Corresponding to the user level, it is the data view of the database seen by one or several users.

2. Mode, also known as conceptual mode and logical mode. Corresponds to the conceptual level.

3. Internal mode, also known as storage mode. Corresponds to the physical level.

Answer: A

3. The deletion exception in relationship standardization refers to ()

A. Data that should not be deleted is deleted B. Data that should not be inserted is inserted

C. The data that should be deleted has not been deleted D. The data that should be inserted has not been inserted

Operation exception in relation normalization:

1. Insertion failure: the data that should be inserted has not been inserted

2. Insertion exception: data that should not be inserted is inserted

3. Deletion failed: the data that should be deleted has not been deleted

4. Abnormal deletion: data that should not be deleted is deleted

Answer: A

4. The logical independence of data refers to ()

A. The internal mode changes, but the mode does not change. B. The mode changes, but the internal mode does not change.

C. When the mode changes, the external mode and application program remain unchanged. D. When the internal mode changes, the external mode and application program are not

Data independence includes:

1. Logic independence: When the mode is changed, the database administrator will make corresponding changes to the image of each external mode/mode to keep the external mode unchanged. The application program is written according to the external mode of the data, so that the application program does not need to be modified, which ensures the logic independence of the data and the program, referred to as data logic independence.

2. Physical independence: When the storage structure of the database is changed, the database administrator will make corresponding changes to the schema/internal schema image, which can keep the schema unchanged, so that the application program does not need to be changed, ensuring the physics of data and programs Independence, referred to as physical independence of data. 

Answer: C

5. Which of the following clauses in the SELECT statement corresponds to the operator in relational algebra?

A、SELECT                  B、FROM              C、WHERE               D、GROUP BY

Answer: A

6. There is a relationship: students (student ID, name, department), the value range of the student ID is a string of 8 numbers, this rule belongs to ()

A, entity integrity B, referential integrity C, user-defined integrity constraints D, keyword integrity constraints

Data integrity includes:

1. Entity integrity: The value of the main code cannot be empty or partly empty.

2. Referential integrity: The foreign key in the relationship must be a valid value of the primary key of another relationship, or NULL.

3. User-defined integrity: put forward binding conditions for the data involved in a specific application

Answer: C

7. How to construct a suitable data logic structure is the main problem to be solved by ().

A, relational system query optimization B, data dictionary C, relational database standardization theory D, relational database query

1. Relational system query optimization:

2. Data dictionary: Data dictionary refers to the definition and description of data items, data structure, data flow, data storage, processing logic, etc., its purpose is to make a detailed description of each element in the data flow chart, use The data dictionary is a simple modeling project.

3. Relational database standardization theory: In order to make database design reasonable, reliable, simple and practical, for a long time, the theory of relational database design-standardization theory has been formed.

4. Relational database query:

Answer: C

8. Convert the ER model into a relational model, which belongs to the database ()

A, demand analysis B, conceptual design C, logical design D, physical design

The database design includes:

1. Demand analysis: demand collection and analysis, the result is the data demand described by the data dictionary (the processing demand described by the knowledge and data flow diagram).

2. Conceptual design: through the integration, induction and abstraction of user needs, a conceptual model independent of the specific DBMS can be formed, which can be represented by an ER diagram.

3. Logical design: Convert the conceptual structure into a data model (such as a relational model) supported by a DBMS and optimize it.

4. Physical design: Select a physical structure (including storage structure and access method) that is most suitable for the application environment for the logical data model .

5. Database implementation: use the data language (such as SQL) provided by the DBMS and its host language (such as C) to establish a database according to the results of logical design and physical design, compile and debug application programs, organize data storage, and conduct trial operation .

6. Database operation and maintenance: The database application system can be put into formal operation after trial operation. During the operation of the database system, it must be continuously evaluated, adjusted and modified.

Answer: C

9, SQL language has the function of ()

A. Relationship standardization, data manipulation, data control B, data definition, data manipulation, data control

C. Data definition, relationship standardization, data control D, data definition, relationship standardization, data manipulation

The main functions of SQL language:

1. Data query 2. Data definition 3. Data manipulation 4. Data control

Answer: B

10. The relationship between DB, DBMS and DBS is ()

A, DB includes DBMS and DBS B, DBS includes DB and DBMS

C. DBMS includes DB and DBS D, cannot include each other

DB is the database, DBMS is the database management system, DBS is the database system

Database system includes database, database management system, database administrator, database application and basic computer system

Answer: B

11. The T-SQL statement that grants the right to modify the attribute GRADE of the relationship SC to the sub-user ZHAO is ()

A、GRANT GRADE ON SC TO ZHAO

B、GRANT UPDATE ON SC TO ZHAO

C、GRANT UPDATE(GRADE)ON SC TO ZHAO

D、GRANT UPDATE ON SC(GRADE)TO ZHAO

 GRANT operation name (field name) ON table name TO user name

Answer: C

12. The database language of the database management system that can realize the query, insertion, modification and deletion of data in the database is called ()

A. Data definition language (DDL) B. Data management language

C, data manipulation language (DML) D, data control language

SQL language is divided into data definition language, data manipulation language, data control language, and data query language

Data definition language: CREATE, ALTER, DROP

Data manipulation languages: SELECT, INSERT, UPDATE, DELETE

Data control language: GRANT, REVOKE

Data query language: FROM, WHERE, LIKE, DISTINCT

Answer: C

13. Let attribute A be the main attribute of the relationship, then attribute A cannot take the null value (NULL), which is ()

A. Entity integrity rules B. Referential integrity rules

C. User-defined integrity rules D. Domain integrity rules

Refer to question 6

Answer: A

14. In SQL language, the command to delete a table is ()

A、DELETE                       B、DROP                   C、CLEAR                   D、REMOVE

1, DELETE FROM table name WHERE column name = value DELETE can only delete rows

2, DROP table table name delete the entire table

3. TRUNCATE table table name Clear the table, only delete the data of the table

Answer: B

15. Which stage of database design is the ER model used for ()

A. Demand analysis B. Conceptual structure design

C. Logical structure design D. Physical structure design

Refer to question 8

Answer: B

16. When merging sub-ER diagrams, the inconsistencies in each sub-map must be eliminated. There are three main types of conflicts between the sub-ER diagrams, namely, attribute conflicts, naming conflicts, and structural conflicts. The naming conflict refers to ()

A. The name is too long or too short B. The same name is different or the same name is different

C. Attribute type conflict D. Attribute value unit conflict

1. Attribute conflicts: including conflicts of type, value range, and value unit;

2. Structural conflicts: For example, the same object is used as an entity in one partial ER diagram, and as an attribute in another partial ER diagram, and the number and types of attributes of the same entity in different ER diagrams are different, etc.;

3. Naming conflicts: including entity type names and contact type names that have different names with the same meaning, or the same name with different meanings, etc.

C and D are attribute conflicts. B is a naming conflict.

Answer: B

17, SQL language has the function of ()

A. Relationship standardization, data manipulation, data control B, data definition, data manipulation, data control

C. Data definition, relationship standardization, data control D, data definition, relationship standardization, data manipulation

Reference 9 questions

Answer: B

18. Knowing the relationship R (A, B, C, D) and the functional dependency set F on R = {A→CD, C→B}, then R∈()NF.

A、1                     B、2                      C、3                       D、BC

First normal form (1NF): If the domain of all attributes of the relational pattern R is atomic, then R is said to belong to the first normal form.

Second normal form (2NF): Meet the first normal form and each non-primary attribute completely depends on the candidate key.

Third Normal Form (3NF): Satisfy the second normal form without transitive dependence.

BC paradigm: it satisfies the third paradigm and eliminates the partial dependence of the primary attribute on the candidate key.

In the question, A→CD, C→B, representing A→B, there is transitive dependence, so it does not satisfy the third normal form and is the second normal form.

Answer: B

19. There are two transactions T1 and T2, and their concurrent operations are shown in the figure below. The correct evaluation below is ()

A. There is no problem with the operation B. The operation is lost and modified

C. This operation cannot be read repeatedly D. This operation reads "dirty" data

T1                              T2

read(A)

read(B)

sum=A+B

                                read(A)

                                A=A*2

                                write(A)

read(A)

read(B)

sum=A+B

write(A+B)

Three typical inconsistencies:

1. Lost modification. eg: modified twice but actually modified once

2. It cannot be read repeatedly. eg: Two readings are different

3. Dirty reading. eg: reading failure

In the question, A was rewritten, but it was read again, the situation is that it cannot be read repeatedly

Answer: C

20. What is the syntax error in the following SQL Server statement ()

A、DECLARE@Myvar INT                        B、SELECT * FROM [AAA]

C、CREATE DATABASE AAA                   D、DELETE * FROM AAA

Only this way of expression: DELETE FROM table name WHERE...

Answer: D

Two, application questions

The educational administration system of a university has the following regulations:

1. One student can take multiple courses, and one course can be taken by multiple students.

2. One teacher can teach multiple courses, but each course can only be taught by one teacher.

3. Each student can only belong to one department, and one department has multiple students.

4. Each teacher can only be managed by one department, and each department has multiple teachers.

5. A student chooses one course and has only one grade.

6. A course taught by a teacher has only one teaching time and teaching credit.

The attributes of students include student ID, student gender, and student name. The attributes of the course include course number and course name. The attributes of teachers include teacher job number, teacher gender, teacher name, and department attributes include department name.

(1) Draw an ER diagram based on the above semantics. It is required to draw the attributes of the entity and indicate the type of connection in the diagram.

 1. Student ( student number , student gender, student name, department number) 

2. Elective ( student number , course number , grade) 3. Course ( course number , course name) 4. Teaching ( teacher ID , course number , teaching time, teaching credits) 

5. Teacher ( teacher job number , teacher gender, teacher name, department number) 6. Department ( department number , department name )

Answer: as shown below

(2) Try to write the teacher's relationship model and indicate its primary key and foreign key.

Answer: Teacher list ( work ID , gender, name, course ID , department name )

The primary key is the job number, and the foreign key is the course number and department name

 

Guess you like

Origin blog.csdn.net/qq_33514421/article/details/106040903