SQL Queries - Assignment-4

 Assignment 4

--------------------------


Write SQL Queries for the following (based on the above data). You can use SQL Server Management Studio to run your queries:

Hint/Note : You will be using the features here. [1]. AND, OR  , SQL Functions

  1. Select (Display) all the residents who were born before 1970.
  2. Select (Display) all the flats belonging to block 'A' and area in square feet is less than 1300
  3. Select (Display) all residents who resides either in Block A or her/his names starts with 'A' ( No JOIN required)
  4. Select (Display) all residents who born between 1960 and 1970
  5. Select (Display) all residents who are not of block 'A'
  6. Select (Display) all flats belonging to block 'A' and not ground floor
  7. Select (Display) all residents whose phone number starts with 9 and having gmail account
  8. Select (Display) all the flat details which are more than 1200 sqft but less than 1350 sqft
  9. Select (Display) all the flats on second floor but not in block 'B'
  10. Select (Display) all the active users created in the year 2022
  11. Display all the employees whose name contains the word 'Kumar'
  12. Display the eployee name , dob and age form residents table. The age should be calculated based on DOB and today's date
  13. Display all the residents who are 30 years old today
  14. Display all the resident whose birthday falls in April 
  15. How many maids are there who work in block 'A'
  16. How many residents there belonging to block 'A'
  17. Display what is the average area in square feed of the flats in Block 'B'
  18. How many flats are there which measure between 1000 to 1200 SQFT.
  19. Find the average age of residents living in the society
  20. Display the list of maids who can do 'baby sitting'

Comments