diff --git a/Practical/Practical Exam/SQL/S1 - SQL Queries.md b/Practical/Practical Exam/SQL/S1 - SQL Queries.md index dd94542..65e45a7 100644 --- a/Practical/Practical Exam/SQL/S1 - SQL Queries.md +++ b/Practical/Practical Exam/SQL/S1 - SQL Queries.md @@ -129,12 +129,13 @@ INSERT INTO Borrower VALUES 1. Find the names of all branches in loan relation. ```sql -SELECT branch_name FROM Loan WHERE amount > 12000; +SELECT DISTINCT branch_name FROM Loan; ``` 2. Find all loan numbers for loans made at ‘Wadia College’ Branch with loan amount > 12000. ```sql +SELECT loan_no FROM Loan WHERE branch_name = 'Wadia College' AND amount > 12000; ``` @@ -155,5 +156,3 @@ SELECT cust_name FROM Borrower INNER JOIN Loan on Borrower.loan_no = Loan.loan_n SELECT DISTINCT branch_city FROM Branch; ``` - ----