Professional Documents
Culture Documents
Registration_cod
Earning_perda
Shop_holder Shop_location
Product_type
e
y
1011 Ahasan
Gazipur
10000 Toys
1111 Babu
Manikganj
10000 Mobile
1511 Tnmoy
Ashulia
2011 Anik
Manikganj
2511 Sani
Ashulia
7000 Mobile
3211 Zubi
Gazipur
3500 Furniture
2000 Furniture
10000 Toys
Product
Type_product
Product_Origin
Product_inventory
Toys
China
1600
Mobile
Singapore
2500
Furniture
China
1600
Loan
Registration
Loan_Status
Repayment_behavior
1011 Yes
Good
1111 Yes
Bad
1511 Yes
Good
2011 Yes
Bad
2511 No
Not Applicable
3211 No
Not Applicable
Query 1: Find out the product type are sold in Gazipur and have a inventory of 1600.
Query1
Product_type
Toys
Furniture
Query 2 : Find out the shopholders name and Product orgin who have shops in
Manikganj or whose product origin is Singapore.
Answer: SELECT Seller.Shop_holder, Product.Product_origin
From Seller,Product
Where Seller.Product_type=Product.Type_product
And (Seller.Shop_location="Manikganj"
or Product.Product_origin="Singapore");
Query2
Shop_holder
Product_origin
Anik
China
Sani
Singapore
Babu
Singapore
Query 3: Find out the Shop registration code and shop holders name those have
earnings of 10000 and taken loan.
Answer: SELECT Seller.Registration_code, Seller.Shop_holder
From Seller,Loan
Where Seller.Registration_code=Loan.Registration
And Seller.Earning_perday=10000
And Loan.Loan_status="Yes";
Query3
Registration_code
Shop_holder
1011 Ahasan
1111 Babu
2011 Anik
Query 4: Find out the shop registration code and shop holders name whose
products origin is in China and have shop in Gazipur or have not taken any loan.
Answer: SELECT Seller.Registration_code, Shop_holder
From Seller,Product, Loan
Where Seller.Product_type=Product.type_product
And Seller.Registration_code=Loan.Registration
And Product.Product_origin= "China"
and (Shop_location="Gazipur"
Or Loan.Loan_status="No");
Query4
Registration_code
Shop_holder
1011 Ahasan
3211 Zubi
Query 5: Find out the shop holders and loan status of sellers name who are selling
toys and repayment behavior is good and country of origin in not in Singapore.
Answer: SELECT Seller.Shop_holder,Loan.Loan_status
From Seller,Product,Loan
Where Seller.Product_type=Product.type_product
And Seller.Registration_code=Loan.Registration
And Seller.Product_type="Toys"
And (Loan.Repayment_behavior="Good"
or Product.Product_origin<> "Singapore");
Query5
Shop_holder
Loan_status
Anik
Yes
Ahasan
Yes
Query 6: Find out the product type and Country of origin that are not sold in
Singapore and repayment status is bad.
Answer: SELECT Seller.Product_type,Product.Product_origin
From Seller,Product,Loan
Where Seller.Product_type=Product.Type_product
And Seller.Registration_code=Loan.Registration
And Seller.Shop_location="Ashulia"
And (Product.Product_origin<> "Singapore"
or Loan.Repayment_behavior="Bad");
Query6
Product_type
Furniture
Product_origin
China