How can i make a data base using C give an example and also give list of software required

6 Years
Discussion Span
Last Post by N1GHTS

You haven't given enough info to answer that question - there are many different ways to make a database.

For the simplest - a "flat file", you have one or more data files, that are accessed by your program, as needed. If the amount of data is quite small, it may be loaded into memory, but probably, at least parts of it, will be accessed through files.

Any way you go, you'll need to have functions to search, sort, display, add and delete (usually just a zero out of a name or ID number and name), or re-size (compress), the data. The search and sort need to handle multiple and single entries, (group searches), and sort by multiple keys. (via pointer or index arrays, no data is really sorted, it just looks that way).

Some types might include:
1) "roll your own". ;)
2) MS Access (full or just a helper) for Access
3) MySql lite
4) MySql
5) Oracle
6) IBM

I'm sure there are others. In C, you usually use structs to group the different characteristics (members and fields), of the record. Data is handled via binary mode reads and writes, of those records and/or fields.

BEFORE you post back for further info, post up YOUR program and let's talk specifics about that. Databases are a BIG topic, and unsuited for long forum posts. There is a lot of info available on the net.


I am interpreting your question in one of two ways:

(A) You are a genius, way beyond learning how to use existing database architecture. Still, given the C genius that you are, you need some advice on how to construct a database engine from scratch.

(B) You are a flat out beginner and don't know the first thing to databases but know enough to realize that you need to use one in C.

If (A), study this code:


Its open source and small enough for your genius mind to study in a few hours.

If (B), Do you know SQL language? Do you know how databases work?

If you need to know how databases work:


If you need to learn SQL, the language to work with databases:


If you need a free database IDE and interface to practice on:


Don't need practice? Just something simple to plug into C and store data with SQL language?


I hope this was helpful enough. Ambiguous questions lead to complex answers.

Outstanding post!
This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.