Just a few comments on the conversation so far: I have a similar history to a couple of the people posting here. I got a D40 and kit 18-55 in 2007 and kept it till 2010, when I started looking for a pocketable camera. I went through several stages of compact to DSLR and back again, owning a D40x and two D5100s between 2012 and 2019. I eventually decided to see if my iPhone 13 Pro would do everything for me, camera-wise. It does a good job but I missed having a proper camera after 2 years and a review of my pictures from the D40 era prompted me to spend £45 on an absolutely mint D40 (the unfashionable silver finish, and only 800 shutter actuations!) from MPB in England, plus a 35mm f1.8 for a further £50. The D40 still produces pictures with that lovely CCD look. I was a bit concerned, though, that the 6mp D40 might not cut it in today’s multi-megapixel world so bought a D3300 with the 18-55AF-P (and only 900 shutter actuations) for not a huge sum from a lady who seemed to have inherited it. I had to update the firmware to make the AF-P lens function properly but it’s excellent now.
I’ve taken either the D40 or the D3300 out on several trips and have been very pleased with the results. The D3300 produces very high quality images but, as has been pointed out several times, the D40 is not far behind and the images do have that almost indefinable CCD quality. I also like that the D40 feels more solid than the D3300 and is a little bit easier to use, particularly with the three nice bright autofocus points in the viewfinder. I’ve returned to submitting occasional images to Shutterstock and use the D3300 for that but the D40 is used regularly, plus I’ve just found a 2005/6 18-55mm kit lens in the same unfashionable silver finish as the D40! I’m really comfortable in this inexpensive world of camera equipment and will probably get a 55-200mm VR zoom soon. I look at my pictures on my iPad or on a modest laptop screen so am never likely to need a Z9!