Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Learning databases is no trivial matter, despite what you may hear around.

There are three basic steps:

  • Learning database theory.
  • Learning SQL
  • Learning database interface in your language of choice.

Database theory

There are several ways to learn database theory well. The best way is to attend a university course or a good course of comparable quality.

I see some hands rising, with predictable objections. "University courses are boring and full of negligible details that I would never need in real life."

Not so. Even if you perceive the course as abstract and unrelated to real life experience, database theory is one of the subjects that can have strict applicability to real cases. The problem is that it isn't easy to see the theory usefulness when examining small cases.

If you get acquainted with relational theory, and especially if you become used to apply relational concepts to real cases, then you'll see that you can understand the problems and find a solution.

Another method of learning database theory is through a good textbook. It depends on your attitude towards learning. There are people who can't grasp a concept from a book and need a good teacher in front of them, and there are people who can get the most complicated ideas from a book only.

Either way, here are a few titles that I can recommend:

Authors Title Publisher ISBN
Elmasri, Navathe Fundamentals of Database Systems Addison Wesley 0321204484
Atzeni, Ceri, Paraboschi, Torlone Database Systems: Concepts, Languages, Architectures McGraw-Hill 0077095006

As an alternative, there are several articles online. Check this address: http://www.palslib.com/Fundamentals/Fundamentals.html.

I don't mean to discourage you. What you need to know to get yourself started is not that much. It would be enough to grasp the basic relational concepts of data separation, relations between entities, operations on data sets, and transactions.

The other important concepts ( referential integrity and normalization) are really needed only if you are designing your own database.

SQL

Once you understand enough database theory to know what you need to do with your data, then you must learn some Structured Query Language to communicate with your database.

There are several ANSI standards, but not all the database engine are fully compliant to the most recent ones. You can assume that if a DBMS claims that its SQL is ANSI-92 or ANSI-99 compliant they are worth a try.

Try to learn a neutral SQL first, before getting involved in a specific dialect. Some tutorials are available here and here.

Be careful of specific implementations from a database. Advanced features such as triggers, constraints, cursors, and stored procedures may differ substantially between different engines. Don't get dependent on a given features without checking that other engines support it as well.

Database interface

Finally, once you are confident that you can talk to a database and can get what you want, it's time to work on the programming interface.

For Perl, this means mostly learning the DBI. The original book is a bit outdated, but it is still a great source, which you can integrate with the current documentation. Our Tutorials can give you a good start, but only if you know the basics first.

Update
A last piece of advice that maybe is the most important one. Whatever you decide to do, don't use any feature blindly, just because you've seen someone using it or because someone said it is "the right way." Try to understand WHY it's used, and only then add the feature to your bag of tricks.

HTH

_ _ _ _ (_|| | |(_|>< _|

In reply to Re: Getting started with databases by gmax
in thread Getting started with databases by katgirl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (10)
    As of 2014-08-23 15:46 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (174 votes), past polls