APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2004/01/15 sql


© January 2004 Tony Lawrence

Structured (or Standard) Query Language

Most databases nowadays offer an SQL interface, and some offer nothing else. In theory, given the same table names and relationships, an SQL query should produce similar results no matter what database it is actually accessing.

But that's all SQL is: a way to add or extract data. The underlying database might not even really be relational: for example, the Filepro database that many of us used on SCO Unix systems (and Tandy before that) is not strictly relational, but it does have an SQL interface available.

I am often surprised to see people using databases where they aren't needed. For example, I recently had a conversation about maintaining a "database" of approximately 400 items. The client asked if he'd need Microsoft SQL Server. Well, no, for 400 records a flat file and a Perl script are fine. I might use a Perl .db file for convenience if no one needs the text for any other reason, but we certainly don't need a SQL database. If he had SQL programmers or needed to write custom reports that might be different, but this was just a very simple task, so I explained that we didn't need it. He countered with a statement that he wanted to "have room to grow". I explained that even ten times that number of records still wouldn't require SQL server, but I don't think he believed it. In fact, given the amount of memory available in modern machines and the overhead of "real" databases, the Perl script would probably be faster until we got up to many tens of thousand records (obviously dependent on record size and access needs).


Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> sql

3 comments


Inexpensive and informative Apple related e-books:

Take Control of Preview

El Capitan: A Take Control Crash Course

Take Control of Apple Mail, Third Edition

Take Control of iCloud

iOS 8: A Take Control Crash Course




More Articles by © Tony Lawrence


"The client asked if he'd need Microsoft SQL Server. Well, no, for 400 records a flat file and a Perl script are fine."

Heck, with so few records, simple shell commands would probably be more than adequate. <Smile>

--BigDumbDinosaur

Exactly. Though it's easier to handle the searching and sorting in Perl.

--TonyLawrence

I kind of like SQL better than flat files, and messing with shell scripts, or perl. Why? Standards. SQL is pretty much an open standard, and anyone who knows even a little SQL, can get at the data, and manipulate it. It also makes mass updates a cinch, and with MySQL being so fast, and affordable, why not? Perl works with it, and so does shell. Then, if you needed to get at it with a report writter, or something else, it is already in a format that most programs can recognize. Throw in ODBC, and just about any platform can read it, and modify it without much trouble.

For example, it would have been great if the system I was migrating today had their configuration stored in a relational database. There is about 90 records, but I have to hand modify each one, because of a propritary file format. I was hoping that at least it was a text file, so I could do some search and replace, but that's not the case - it's binary. If the config data were stored as part of the database, like the rest of this payroll system, I wouldn't have to modify each record by hand. Not to mention, if it was in some kind of normal form, I would really only have to modify about 5 records, since I am only changing the data location, of 5 different events. But, the application stores the time that each event executes as a seperate record, so I have to modify each one!

I could probably write until my fingers wear down about why I would prefer everything to be stored in a SQL db, with at least 3rd normal form for all the relationships.

I do store some things in flat text files, but I am actually getting ready to put them in a db, too. I just like how flexible you can be with SQL.

- Bruce Garlock





------------------------


Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us


Printer Friendly Version





On two occasions, I have been asked [by members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?"...I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. (Charles Babbage)




Linux posts

Troubleshooting posts


This post tagged:

SQL

UnixWords



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode





SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)
www.SCOsales.com