Database Final Exam review question second?

Source: Internet
Author: User

Author: Dolphin

Original address: http://blog.csdn.net/qingdujun/article/details/27821271


First, the choice question

1. In the following operations, B is not a basic operation of relational algebra.

A Cartesian product B. Natural Join C. Projection D. And

2. The set of attributes that uniquely identify a tuple in a relationship is called a of the relational model.

A Primary key B. Super Key C. Candidate Key D. FOREIGN key

3. After the projection operation of the relationship R, the relationship s is obtained, then D .

A The number of tuples of the relationship R equals the number of tuples of the relationship s

B The number of tuples of the relationship R is less than the tuple number of the relationship s

C The number of tuples of relationship R is greater than that of relation s

D The number of tuples of a relationship r greater than or equal to the number of tuples of the relationship s

4. Relationship R and relationship s have only one public property, T1 is the result of R and S equivalent join, and T2 is the result of R and S equivalent natural joins, then C .

A The number of attributes of T1 equals the number of attributes of T2

B The number of attributes for T1 is less than the number of T2 properties

C The number of attributes of the T1 is greater than the number of T2

D Number of attributes of T1 greater than or equal to T2

5. In the relational Algebra expression optimization strategy, you should run the C operation as early as possible.

A Projection B. Join C. Select D. Cartesian product

6. The query language of a relational database is a B language.

A Procedural B. Non-procedural C. Third generation D. Advanced Programming

7. Clauses in SQL that set primary and foreign keys belong to the a range of DBS.

A Integrity Control B. Security Control C. concurrency control control d. Recovery control

Two, fill in the blanks questions

8. A relational schema is defined in the form R (u,d,dom,f) .

9. The definition of a relational schema consists primarily of the ① relationship name , the ② attribute name , the ③ domain name , the ④ attribute to the domain image , and the keyword.

10. The smallest unit of data that can be named in a relational database is the field name .

11. In the information represented by an entity, a group of attributes is said to uniquely identify a tuple as keyword.

Iii. Jiang/Comprehensive questions

1. Describe the differences and linkages between equivalence connections and natural connections.

A: 1) Difference: The natural connection is to remove the repeated attribute columns.

2) Contact: All the tuples from the generalized Cartesian product that have the same attribute values selected.

2. Illustrate the meaning of the completeness of the relationship? answer: a little.

3. The five basic operations in relational algebra are represented by a tuple-relational calculus expression.

1) and: R∪s = {T|t∈rνt∈s}

2) Poor: R-s = {t|t∈rλt////}

3) Select 4) projection 5) Cartesian product: The symbol is too hard to beat.

See: P47,P53

4. For example, with the three relationships you see, S, C, and SC, try a relational algebra expression to represent the following query

S

s#

Snmae

Age

SEX

1

Li Qiang

23

Man

2

Liu Li

22

Woman

5

Zhang You

22

Man

C

C#

Cnmae

TEACHER

K1

C language

Simon

K5

Database principles

Cheng June

K8

Compilation principle

Cheng June

Sc

s#

C#

GRADE

1

K1

83

2

K1

85

5

K1

92

2

K5

90

5

K5

84

5

K8

80

(1) Search for the course number (C #) and course name (CNAME) of the course taught by the "Cheng June" teacher.

(2) to retrieve the male student number (s#) and name (SNAME) with age greater than 21.

(3) to retrieve the names (SNA) of at least the students who have taken all the courses taught by the Cheng June teacher. E).

(4) Search "Li Qiang" students do not learn the course number (C #).

(5) Retrieve the student number (C #) with at least two elective courses.

(6) To retrieve the course number (C #) and course name (CNAME) of the courses that all students are enrolled in.

(7) The search elective course includes the student number (s#) of one of the courses taught by the "Cheng June" teacher.

(8) To retrieve the student number (s#) of the elective course number K1 and K5.

(9) The name of the student taking all the courses (SNAME) is searched.

(10) The search elective course includes student number (s#) of the course of the student number 2.

(11) To retrieve the student number (s#) and name (SNAME) of the elective course entitled "C Language".

5. For the relationship S, C, and SC, the trial tuple calculus expression represents the following query statement.

(1) Search the student number and grade of the elective course number K5.

(2) Search for the student number and name of the elective course number K8.

(3) to retrieve the student number and name of the elective course entitled "C Language".

(4) Search the student number of the elective course number K1 or K5.

(5) Search the student number for elective course number K1 and K5.

(6) Search for names and ages of students who do not take the K8 course.

(7) Search for the names of all students taking all courses.

(8) The search for the selected course includes student number of the course selected by Student No. 1th.

6. For the relationship of the previous problem S, C, and SC, the trial domain calculus expression represents the following query statement.

(1) Search the student number and grade of the elective course number K5.

(2) Search for the student number and name of the elective course number K8.

References: Wang Shan, Shaman Xuan Munsu. Introduction to Database Systems (4th edition) [M]. Beijing: Higher Education Press, 2006.43-73.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.