Here's a C++ program that demonstrates how to read a CSV file containing user information and store the data in an SQLite database. The program also provides functionality to query the database for users based on their age or email address.

```cpp
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <sqlite3.h>

struct User {
    std::string name;
    int age;
    std::string email;
};

std::vector<User> read_csv(const std::string& filename) {
    std::ifstream file(filename);
    std::vector<User> users;

    if (!file.is_open()) {
        std::cerr << "Error opening file: " << filename << std::endl;
        return users;
    }

    std::string line;
    while (std::getline(file, line)) {
        std::stringstream ss(line);
        User user;
        std::string age_str;

        std::getline(ss, user.name, ',');
        std::getline(ss, age_str, ',');
        user.age = std::stoi(age_str);
        std::getline(ss, user.email, ',');

        users.push_back(user);
    }

    return users;
}

static int callback(void* not_used, int argc, char** argv, char** col_name) {
    for (int i = 0; i < argc; ++i) {
        std::cout << col_name[i] << ": " << (argv[i] ? argv[i] : "NULL") << std::endl;
    }
    std::cout << std::endl;
    return 0;
}

void create_table(sqlite3* db) {
    const char* sql =
        "CREATE TABLE IF NOT EXISTS users("
        "name TEXT,"
        "age INTEGER,"
        "email TEXT);";

    char* err_msg = nullptr;
    int rc = sqlite3_exec(db, sql, nullptr, nullptr, &err_msg);

    if (rc != SQLITE_OK) {
        std::cerr << "Error creating table: " << err_msg << std::endl;
        sqlite3_free(err_msg);
    }
}

void insert_users(sqlite3* db, const std::vector<User>& users) {
    for (const auto& user : users) {
        std::stringstream ss;
        ss << "INSERT INTO users(name, age, email) VALUES("
           << "'" << user.name << "',"
           << user.age << ","
           << "'" << user.email << "');";

        char* err_msg = nullptr;
        int rc = sqlite3_exec(db, ss.str().c_str(), nullptr, nullptr, &err_msg);

        if (rc != SQLITE_OK) {
            std::cerr << "Error inserting data: " << err_msg << std::endl;
            sqlite3_free(err_msg);
        }
    }
}

void query_users_by_age(sqlite3* db, int age) {
    std::stringstream ss;
    ss << "SELECT * FROM users WHERE age=" << age << ";";

    char* err_msg = nullptr;
    int rc = sqlite3_exec(db, ss.str().c_str(), callback, nullptr, &err_msg);

    if (rc != SQLITE_OK) {
        std::cerr << "Error querying data by age: " << err_msg << std::endl;
        sqlite3_free(err_msg);
    }
}

void query_users_by_email(sqlite3* db, const std::string& email) {
    std::stringstream ss;
    ss << "SELECT * FROM users WHERE email='" << email << "';";

    char* err_msg = nullptr;
    int rc = sqlite3_exec(db, ss.str().c_str(), callback, nullptr, &err_msg);

    if (rc != SQLITE_OK) {
        std::cerr << "Error querying data by email: " << err_msg << std::endl;
        sqlite3_free(err_msg);
    }
}

int main() {
    const std::string filename = "users.csv";
    std::vector<User> users = read_csv(filename);

    sqlite3* db;
    int rc = sqlite3_open("user_data.db", &db);

    if (rc) {
        std::cerr << "Error opening database: " << sqlite3_errmsg(db) << std::endl;
        return rc;
    }

    create_table(db);
    insert_users(db, users);

    // Query users by age
    query_users_by_age(db, 25);

    // Query users by email
    query_users_by_email(db, "johndoe@example.com");

    sqlite3_close(db);

    return 0;
}
```

To compile and run the program, you need to have SQLite installed on your system. You can install it using a package manager like `apt` or `brew`. Then, use the following command to compile:

```sh
g++ -std=c++11 -o user_db user_db.cpp -lsqlite3
```

And run the compiled binary with:

```sh
./user_db
```

This example assumes that there is a CSV file named `users.csv` in the same directory as the source code file. The contents of the CSV file should be formatted like this:

```
John Doe,25,johndoe@example.com
Jane Smith,30,janesmith@example.com
...
```
다음은 사용자 정보가 포함된 CSV 파일을 읽고 SQLite 데이터베이스에 데이터를 저장하는 방법을 보여주는 C++ 프로그램입니다. 이 프로그램은 나이 또는 이메일 주소를 기준으로 데이터베이스에서 사용자를 쿼리하는 기능도 제공합니다.

```cpp
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <sqlite3.h>

struct User {
    std::string name;
    int age;
    std::string email;
};

std::vector<User> read_csv(const std::string& filename) {
    std::ifstream file(filename);
    std::vector<User> users;

    if (!file.is_open()) {
        std::cerr << "Error opening file: " << filename << std::endl;
        return users;
    }

    std::string line;
    while (std::getline(file, line)) {
        std::stringstream ss(line);
        User user;
        std::string age_str;

        std::getline(ss, user.name, ',');
        std::getline(ss, age_str, ',');
        user.age = std::stoi(age_str);
        std::getline(ss, user.email, ',');

        users.push_back(user);
    }

    return users;
}

static int callback(void* not_used, int argc, char** argv, char** col_name) {
    for (int i = 0; i < argc; ++i) {
        std::cout << col_name[i] << ": " << (argv[i] ? argv[i] : "NULL") << std::endl;
    }
    std::cout << std::endl;
    return 0;
}

void create_table(sqlite3* db) {
    const char* sql =
        "CREATE TABLE IF NOT EXISTS users("
        "name TEXT,"
        "age INTEGER,"
        "email TEXT);";

    char* err_msg = nullptr;
    int rc = sqlite3_exec(db, sql, nullptr, nullptr, &err_msg);

    if (rc != SQLITE_OK) {
        std::cerr << "Error creating table: " << err_msg << std::endl;
        sqlite3_free(err_msg);
    }
}

void insert_users(sqlite3* db, const std::vector<User>& users) {
    for (const auto& user : users) {
        std::stringstream ss;
        ss << "INSERT INTO users(name, age, email) VALUES("
           << "'" << user.name << "',"
           << user.age << ","
           << "'" << user.email << "');";

        char* err_msg = nullptr;
        int rc = sqlite3_exec(db, ss.str().c_str(), nullptr, nullptr, &err_msg);

        if (rc != SQLITE_OK) {
            std::cerr << "Error inserting data: " << err_msg << std::endl;
            sqlite3_free(err_msg);
        }
    }
}

void query_users_by_age(sqlite3* db, int age) {
    std::stringstream ss;
    ss << "SELECT * FROM users WHERE age=" << age << ";";

    char* err_msg = nullptr;
    int rc = sqlite3_exec(db, ss.str().c_str(), callback, nullptr, &err_msg);

    if (rc != SQLITE_OK) {
        std::cerr << "Error querying data by age: " << err_msg << std::endl;
        sqlite3_free(err_msg);
    }
}

void query_users_by_email(sqlite3* db, const std::string& email) {
    std::stringstream ss;
    ss << "SELECT * FROM users WHERE email='" << email << "';";

    char* err_msg = nullptr;
    int rc = sqlite3_exec(db, ss.str().c_str(), callback, nullptr, &err_msg);

    if (rc != SQLITE_OK) {
        std::cerr << "Error querying data by email: " << err_msg << std::endl;
        sqlite3_free(err_msg);
    }
}

int main() {
    const std::string filename = "users.csv";
    std::vector<User> users = read_csv(filename);

    sqlite3* db;
    int rc = sqlite3_open("user_data.db", &db);

    if (rc) {
        std::cerr << "Error opening database: " << sqlite3_errmsg(db) << std::endl;
        return rc;
    }

    create_table(db);
    insert_users(db, users);

    // Query users by age
    query_users_by_age(db, 25);

    // Query users by email
    query_users_by_email(db, "johndoe@example.com");

    sqlite3_close(db);

    return 0;
}
```

To compile and run the program, you need to have SQLite installed on your system. You can install it using a package manager like `apt` or `brew`. Then, use the following command to compile:

```sh
g++ -std=c++11 -o user_db user_db.cpp -lsqlite3
```

And run the compiled binary with:

```sh
./user_db
```

이 예제에서는 소스 코드 파일과 같은 디렉터리에 `users.csv`라는 이름의 CSV 파일이 있다고 가정합니다. CSV 파일의 내용은 다음과 같은 형식이어야 합니다:

```
John Doe,25,johndoe@example.com
Jane Smith,30,janesmith@example.com
...
```