It depends on what you want to know first. If you are a novice and not from CS background, it takes two to three weeks to learn SQL basics I recommend starting with online courses because instructors will explain the basic principles which help you learn SQL faster. There are many SQL tutorials to understand the SQL Basics. After that, you can easily learn the advanced SQL topics.
If you want to learn SQL, check out this SQL Course by Intellipaat.