SQL is a method for accessing a database. The tables in the database contain data. While it's true that you might
need to use SQL to get data out of a given database, it's not necessarily a requirement. A given database engine could support SQL, XQuery, and a C++ API. Think of this as similar to reading a text file which you could do in Python, C++, C# etc.
Adding or modifying data in a table is more like changing data in a flat file, than modifying your C++ code. When you update data in the database, you're doing just that. You read a row from the database and get the field "price" as 5.99. An update to the database is made and the next time you read the same row, the "price" field is 6.15.
Be aware that just because you describe a table as
CREATE TABLE mytable (
id integer PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHR(30)
birthday DATE,
address VARCHAR(100) );
does not mean that that's the order that the database will store the columns in the table. While almost every database does so, it's not a requirement and
some database out there mighr re-order the columns to optimize for space. So you're not guaranteed that doing
select(*)
will get you the columns in the expected order. In you code you should always specify the columns you want to retrieve in the order you want them.