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

Recommended Answers

All 2 Replies

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:

http://www.sqlite.org/

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:

http://www.geekgirls.com/menu_databases.htm

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

http://www.w3schools.com/sql/default.asp

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

http://mysql.com/
http://www.postgresql.org/

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

http://www.sqlite.org/

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

commented: Outstanding post! +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.