Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I think there is an easier way to visualize it. Tables don't contain other tables. A table is like a piece of paper. If you were to manually write out what a relational database does, you would be looking at three pieces of college ruled paper side by side.
band_members ############################################################# ID First Name Last Name ############################################################ 1. Paul McCartney 2. Ringo Starr 3. George Harrison 4. John Lennon band_members_and_Bands_linking_table ########################################################### band_members_id bands_id ########################################################### 1 1 2 1 3 1 4 1 3 2 4 3 1 4 1 5 4 5 3 5 Bands ######################################################### ID Band Name ######################################################## 1. Beatles 2. Traveling Wilburys 3. Plastic Ono Band 4. Wings 5. Solo
That is pretty much it. If this example is any good, you are already visualizing and tracing the relationships between the data.

SQL is fun to learn, because there are only three commands. select, delete, and insert. There is 'update' if you really want to get fancy and combine delete and insert into a single statement. I would not try to Perl and SQL at the same time. I recommend the Head First SQL book, that will probably teach you all you want to know, if you want to go further, I like the MySQL certification book. You could combine those three tables into one, but this style is preferred, because it makes it harder to learn and raises the barrier to entry for Database Administrators. enhances performance


In reply to Re: OT: SQL and me by trippledubs
in thread OT: SQL and me by Lady_Aleena

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-18 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found