Question: Execute the following queries on database that you created and give the screenshots of query and the result. Note: Use JOIN keyword wherever applicable. Do

    Execute the following queries on database that you created and give the screenshots of query and the result. 

    Note: Use JOIN keyword wherever applicable. Do not Use cross product or Multi Table Select. It will not earn you any marks in that particular query. 

    1. Name all the borrowers who have a phone number and live in ‘Lahore’ (Note: Address field has data in which Lahore is somewhere in the string. Example ’24 A Khayaban-e-Jinnah Lahore, Pakistan’)
    2. Show names of all the book which have less than 10 copies in any branch. 
    3. Show branch names with the book names they have along with the number of copies. 
    4. Show borrower names who have borrowed some book named as ‘The Kite Runner’.
    5. Show borrower names who have borrowed some books from a library branch which is located in ‘Karachi’. (Note: Address field has data in which Lahore is somewhere in the string. Example ’24 A Khayaban-e-Jinnah Lahore, Pakistan’). 
    6. Show book names along with their author names for those books which are published by ‘Rehman Publishers’.
    7. Show all publisher names who do not have a phone number but they have published a book named ‘Alchemist’.
    8.  For each book that is loaned out from the ‘Iqbal Town branch’ and whose Due_date is today, retrieve the book title, the borrower’s name, and the borrower’s address (Use Date Function)
    9. Show all the book names which are loaned out and due date is in September. 
    10. Show branch names from which a book has been loaned out by a borrower named ‘Ali Ahsan Khan’. 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Name all the borrowers who have a phone number and live in Lahore SELECT Name FROM borrowers WHERE Phone IS NOT NULL AND Address LIKE Lahore Show name... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!