Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
* * * * * 1 votes

Who knows how to make a database engine in C?


  • Please log in to reply
22 replies to this topic

#1 wishheart

wishheart

    CC Lurker

  • Just Joined
  • Pip
  • 3 posts

Posted 11 March 2010 - 05:04 PM

The program can create and modify Database Structure, can add, update,delete data, can list data, can use basic SQL statements, can accomodate simple conditions, atleast 3 advanced statement can be used. Please help me, I dont have any idea.


Edited by Roger, 13 November 2013 - 10:37 AM.
Removed formatting

  • 0

#2 BlaineSch

BlaineSch

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1559 posts

Posted 11 March 2010 - 07:40 PM

Trying to figure out how to start? I'd just start with getting a few functions that save data in a csv or something... save and read it... then make a query function the would break the query up and try and figure out what the user wants.
  • 0

#3 wishheart

wishheart

    CC Lurker

  • Just Joined
  • Pip
  • 3 posts

Posted 12 March 2010 - 06:22 AM

Trying to figure out how to start? I'd just start with getting a few functions that save data in a csv or something... save and read it... then make a query function the would break the query up and try and figure out what the user wants.




thanks for answering Blaine! :) Can you explain to me what 'csv' is? Your idea is good, but I dont know how what syntax to use.. :crying: thanks so much!
  • 0

#4 BlaineSch

BlaineSch

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1559 posts

Posted 12 March 2010 - 06:28 AM

thanks for answering Blaine! :) Can you explain to me what 'csv' is? Your idea is good, but I dont know how what syntax to use.. :crying: thanks so much!

CSV is just a file format... Comma separated value click HERE! That's just my suggestion. I've never made anything like that before but CSV's seem easy to parse through.
  • 0

#5 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 12 March 2010 - 08:24 AM

You may want to check out the source code for SQLite.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#6 wholegrain

wholegrain

    CC Regular

  • Member
  • PipPipPip
  • 29 posts

Posted 10 November 2013 - 02:52 PM

and what would you do after that?

 

do you know any tutorials that may be helpful even though it may not be directly related?


  • 0

#7 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 12 November 2013 - 03:58 PM

First thing you need to do is have a clear idea of the scope of what you want to do, and what do you want to use it for, and then an assessment of your skill level; so we can start defining the frame of the project.

 

If you are really interested in the matter I can recommend you two reads:

 

Architecture of a database system

 

Foundations of databases

 

Be aware that this is not a child's game, it takes dedication, knowledge, and some skill, and the bigger the project the bigger amounts of those three you will need.


  • 0

#8 wholegrain

wholegrain

    CC Regular

  • Member
  • PipPipPip
  • 29 posts

Posted 20 December 2013 - 11:01 AM

Ok, thanks, I suspected as much...

 

I don't think it will be possible for me to make one, but is there something remotely similar a novice could do? Also, could you suggest me a bunch of other projects I should consider doing before even attempting to make something as difficult as a database engine? Thanks for your time.


  • 0

#9 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 20 December 2013 - 11:49 AM

For a "basic" database, you could work with CSV files, where each file represents a table. You could have a special file(s) that stores data about table structures of other files.


  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#10 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 20 December 2013 - 12:40 PM

Create something like a old DBase III file.  They were essentially fixed position text files.


  • 0
My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

#11 gonerogue

gonerogue

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 197 posts

Posted 20 December 2013 - 01:00 PM

Create a CDB database library (http://cr.yp.to/cdb.htm).

An implementation I like is this one: TinyCDB (http://www.corpit.ru/mjt/tinycdb.html).

Look over the source code, understand the algorithm and try to make your own implementation. Is not that hard.

Another idea is to look over the source of GNU dbm (http://www.gnu.org.ua/software/gdbm/). Also fairly easy to understand and a good example of a well written C library.


Edited by xyv123, 20 December 2013 - 01:03 PM.

  • 1

#12 wholegrain

wholegrain

    CC Regular

  • Member
  • PipPipPip
  • 29 posts

Posted 09 January 2014 - 05:32 PM

Will any of these books help me write a database engine (storage engine + query engine)? If so, which one seems the best one and the easiest to understand?

 

http://www.amazon.ca...ywords=SimpleDB

 

http://www.amazon.ca...ql query engine

 

http://www.amazon.ca...ql query engine

 

http://www.amazon.ca...Storage Manager


Edited by wholegrain, 09 January 2014 - 05:33 PM.

  • 0




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download