Your SQL Query is in the wrong database. You are trying to select from the AdventureWorksLT2012 database, but you're connected to the Master database.
If you look at the top left of your window, you will see a bar at the bottom of the ribbon that contains a drop-down list. In it, you can see "master" is the current database.
There are three ways to resolve this in your queries. After you do so, the red lines under your table and column names should all vanish, as they're warning you that the tables and columns don't exist in the current selected database.
- Change the drop-down to the correct database. This will fix your query window for that window and that window only, but is the most common solution.
- Change your queries to reference the database. This would be queries like
Select * from AdventureWorksLT2012.SalesLT.SalesOrderDetailfor example. Setting the DB name in your query means it will no longer matter which database your current context is.
- Start the query off with a
USE [AdventureWorksLT2012]; Go;statement. This will switch your context to the correct database. After running the query, the screen will show this database in the drop down list I mentioned in option 1.
You say you're new to SQL, well you'll find that there's A LOT to learn and mistakes like being in the wrong DB will soon become second nature. Other contributors will have pointed you in the right direction in this instance but I'd say stick with it. It can be a rewarding and challenging career, but you won't become an expert overnight!