An answer to your question is a big “YES”. You can execute queries against the tables either if you are using an ABAP program or also you can execute these queries from native SQL environment.
DATA: lt_TBL LIKE TABLE OF KNA1. SELECT * from KNA1 INTO lt_TBL up to 5 rows.
The snippet above lets you get the 5 rows from table KNA1 table and store in an internal table for further use.