Knowee
Questions
Features
Study Tools

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:

Question

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:

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

Solution

Here is the SQL query you need:

SELECT member_id, member_name, date_register, membership_status
FROM lms_members
WHERE date_register < '2012-03-01' AND membership_status = 'Temporary'
ORDER BY member_id ASC;

This query works as follows:

  1. SELECT member_id, member_name, date_register, membership_status FROM lms_members: This part of the query selects the columns member_id, member_name, date_register, and membership_status from the lms_members table.

  2. WHERE date_register < '2012-03-01' AND membership_status = 'Temporary': This is the condition for the query. It only selects the rows where date_register is before March 2012 and membership_status is 'Temporary'.

  3. ORDER BY member_id ASC: This part of the query sorts the result in ascending order by member_id.

This problem has been solved

Similar Questions

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:

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 :

Write a query to display the coursename of the courses whose month of batch start date is between 'February' and 'July'. Display the records sorted in ascending order based on coursename.

Write a query to display the person_name and contact_number from the 'travel_card'.Display the records in ascending order based on the person_name.Note:1. Display only the column named person_name and contact_number present in the travel_card table.2. Order by is mandatorySample output: [Only few records are shown here]

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.

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.