You are on page 1of 6

Câu 1: Cho mô hình thực thể liên kết (mô hình E-R) sau đây:

Topic

Yêu cầu: Hãy chuyển mô hình trên sang lược đồ quan hệ.

Câu 2. Với trường hợp quan hệ n - n

Topic

Câu 3: Chuyển đổi E-R sang lược đồ quan hệ.

Topic
Câu 4: Chuyển mô hình E-R sau sang lược đồ quan hệ:

Bài 5. Giải thích các câu lệnh đại số quan hệ sau đây:

Bài 6. Cho các lược đồ CSDL quan hệ sau:

Sử dụng Đại số quan hệ thực hiện:


a) Find the names of all employees who live in city “Miami”.
b) Find the names of all employees whose salary is greater than $100,000.
c) Find the names of all employees who live in “Miami” and whose salary is greater than
$100,000.
Bài 7. Cho các lược đồ CSDL quan hệ sau:

Sử dụng Đại số quan hệ thực hiện:


a) Find the names of all employees who work for “First Bank Corpora tion”.
b) Find the names and cities of residence of all employees who work for “First Bank
Corporation”.
c) Find the names, street address, and cities of residence of all employees who work for
“First Bank Corporation” and earn more than $10,000.
Bài 8. . Cho các lược đồ CSDL quan hệ sau:

Sử dụng Đại số quan hệ thực hiện:


a) Find the names of all branches located in “Chicago”.
b) Find the names of all borrowers who have a loan in branch “Down town”.
Bài 9.
a) Liệt kê các khách hàng có địa chỉ ở Hà Nội
b) Liệt kê tên các sản phẩm đã bán có đơn giá lớn hơn 100000
c) Liệt kê các khách hàng mua “Máy tính” có số lượng lớn hơn 100
Bài 10. Sử dụng SQL:

Write the following queries in SQL, using the university schema.


a) Find the titles of courses in the Comp. Sci. department that have 3 credits.
b) Findthe IDs of all students who were taught by an instructor named Einstein; make sure
there are no duplicates in the result.
c) Find the highest salary of any instructor.
Bài 11. Sử dụng SQL:
Write the following queries in SQL, using the university schema.
a) Find all instructors earning the highest salary (there may be more than one with the
same salary).
b) Find the enrollment of each section that was offered in Autumn 2009.
Bài 12.

Write the following queries in SQL, using the university schema.


a) Find the maximum enrollment, across all sections, in Autumn 2009.
b) Find the sections that had the maximum enrollment in Autumn2009.

Bài 13.
Bài 14.

You might also like