Knowee
Questions
Features
Study Tools

Write a query to display the book_code, book_title of the books which are issued on the date "01-04-2012". Display the records sorted in ascending order based on book_code.Note:1. Display only the book_code, book_title of the books which are issued on the date "01-04-2012" from lms_book_issue and lms_book_details table.2. Use Joins. Tables involved are lms_book_issue and lms_book_details.3. Order by is mandatory.Sample Output:

Question

Write a query to display the book_code, book_title of the books which are issued on the date "01-04-2012". Display the records sorted in ascending order based on book_code.Note:1. Display only the book_code, book_title of the books which are issued on the date "01-04-2012" from lms_book_issue and lms_book_details table.2. Use Joins. Tables involved are lms_book_issue and lms_book_details.3. Order by is mandatory.Sample Output:

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Here is the SQL query you need:

SELECT lms_book_details.book_code, lms_book_details.book_title
FROM lms_book_issue
JOIN lms_book_details ON lms_book_issue.book_code = lms_book_details.book_code
WHERE lms_book_issue.issue_date = '2012-04-01'
ORDER BY lms_book_details.book_code ASC;

Here's the step by step explanation:

  1. SELECT lms_book_details.book_code, lms_book_details.book_title: This line is selecting the columns we want to display in our result, which are book_code and book_title from the lms_book_details table.

  2. FROM lms_book_issue: This line is specifying the table that we are selecting from, which is the lms_book_issue table.

  3. JOIN lms_book_details ON lms_book_issue.book_code = lms_book_details.book_code: This line is joining the lms_book_issue table with the lms_book_details table where the book_code in both tables are the same.

  4. WHERE lms_book_issue.issue_date = '2012-04-01': This line is filtering the results to only include records where the issue_date is '2012-04-01'.

  5. ORDER BY lms_book_details.book_code ASC: This line is ordering the results in ascending order based on the book_code from the lms_book_details table.

This problem has been solved

Similar Questions

Write a query to display the member_id, member_name, date_register, membership_status of the members who registered before "March 2012" and membership status is "Temporary". Display the records sorted in ascending order based on member_id.Note:1. Display the member_id, member_name, date_register, membership_status from lms_members table whose date_register is before March 2012 and membership_status as ‘Temporary’.2. Order by is mandatory.Sample Output:

Write a query to display the coursename, coursecategory, coursefees and courseduration of the courses whose batch strength is greater than or equal to 10 and month of batch start date is 'February'. Display the records sorted in ascending order based on coursename.Note:1. Display only the coursename, coursecategory, coursefees and courseduration of the courses whose batch strength is greater than or equal to 10 and month of batch start date is 'February'2. Tables involved are course and batch3. Order by is mandatory.Sample Output :

Directions: Write X when the syntax is CORRECT and Z whenthe syntax is INCORRECT. NO ERASURES!DB NAME: books_db   Table Name: books_tblAssume all column names are correct3. SELECT author_lname FROM books_tbl ORDER author_lname;Your answer7. SELECT title, released_year FROM books_tbl ORDER BY released_year DESC LIMIT 14; Your answer8. SELECT author_lname, title FROM books_tbl ORDER BY 2; Your answer5. SELECT author_lname FROM books_tbl ORDER BY author_lname BESC; Your answer10. SELECT title FROM books_tbl WHRE  title LIKE “the”;Your answer1. SELECT DISTINCTS CONCAT(author_fname,” “, author_lname) FROM books_tbl;Your answer6. SELECT title FROM books_tbl LIMIT 10;Your answer11. SELECT title, released_year FROM books_tbl WHERE released_year <= 2000;Your answer4. SELECT title FROM books ORDER BY title;Your answer15. SELECT title, released_year FROM books_tbl WHERE released_year NOT BETWEEN 2004 AND 2015;Your answer12. SELECT -10 < -9;Your answer2. SELECT DISTINCT author_fname, author_lname FROM books;Your answer9. SELECT title, stock_quantity FROM books_db;Your answer14. SELECT -10 > -20 && 0 <= 0;Your answer13. SELECT title, author_lname, released_year FROM books_tbl WHERE author_lname=”Eggers” AND released_year > 2010;

Write a query to display the subject_name and subject_code of the subjects handled by the staff named 'Lakshmi'. Display the records sorted in ascending order based on subject_name.Note:1. Display only the subject_name and subject_code of the subjects handled by the staff named 'Lakshmi'.2. Use Joins. Tables involved are subject and staff3. Order by is mandatory.

Write a query to display the coursename of the courses having the coursefees above average fees of all the courses. Display the records sorted in ascending order based on coursename.Note:1. Display only the coursename of the courses having the coursefees above average fees of all the courses.2. Order by is mandatory.Sample Output:

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.