Professional Documents
Culture Documents
Lab1 De180456 DBI
Lab1 De180456 DBI
Lab1 De180456 DBI
for the contact relationship schema that manages the customer ordering system at Da Nang city. write
expressions of relational algebra to answer the following queries.
Customer
Product
Discount
Order
OrderDetails
1. List Customers including Customer_name, Birthday with Birthday greater than 30/12/1995
Result:
∏
(Customername , Birthday)
(
(σ Birthday ≥
30
12
/1995 ,Customers ) )
Customer_nam Birthday
e
Tran Bich Ngoc 19/07/1997
Nguyen Thi 25/11/1996
Thanh Thuy
Doan Phuoc 10/04/2001
Trung
Nguyen Vu 21/21/2002
Thanh Tien
2. List Product_name, Prices, Origin, Quantity of Products with Prices < 2,000,000 and Quantity >
100.
Result:
∏ (σ ( Prices< 2000000˄ Quantityt >100 , Product ) )
(Produc t name , Prices ,Origin ,Quantity )
∏ ¿ ¿)
(ProductName )
7. List the CustomerId of all Customers whose District is “Hai Chau” and have placed orders
in 2022 or Customers whose District is “Lien Chieu” who have placed orders in 2023
10. List CustomerName of Customers who have placed orders 3 times or more
∏ ¿¿
( CustomerName )
-----------------------END---------------------------