Home | Hardware | Internet News |Web Hosting |IT Management |Network Storage
LinuxPlanet
Search 
  Power Search | Tips 

 Front Door
 Discussion
 LinuxEngine
 Opinions
 Reports
 Reviews
 Tutorials
 News
 Technology Jobs

 Browse by subject.
Free Newsletter

Linux Planet
Linux Today
More Free Newsletters

Be a Commerce Partner


















internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Print this article
Email this article
Related Items

•  Apples and Oranges: A Linux DBMS Comparison


   LinuxPlanet / Tutorials



Apples and Oranges, Part II: A Linux DBMS Comparison
Implementing the Test Client

Matthias Warkus
Thursday, November 18, 1999 01:25:46 PM

To compare the three database managers, I decided to write a test client in C for the purpose of performing transactions on the bookstore database. As a result, I implemented a couple of actions to be able to compare the APIs. For the performance comparisons, I then implemented them fully and added a noninteractive mode to the client so it could run on its own, generating random data and randomly executing transactions.

I decided to implement the following actions on the sample database:

  • Adding a new book: INSERT INTO BOOK (...) VALUES (...);
  • Deleting an existing book: DELETE FROM BOOK WHERE ARTICLE_NO=...;
  • Adding a customer: INSERT INTO CUSTOMER (...) VALUES (...);
  • Deleting a customer: DELETE FROM CUSTOMER WHERE CUSTOMER_NO=...;
  • A customer ordering books: INSERT INTO BOOKORDER (...) VALUES (...); INSERT INTO ORDER_POSITION (...) VALUES (...);;
  • A customer rating a book: INSERT INTO RATING (...) VALUES (...);
  • Changing an order's status: UPDATE BOOKORDER SET STATUS=... WHERE ORDER_NO=...;

Then, the following reports can be generated:

  • List of books: SELECT * FROM BOOK;
  • List of customers: SELECT * FROM CUSTOMER;
  • List of deliveries underway, sorted by status: SELECT * FROM BOOKORDER ORDER BY STATUS;
  • Profit margin for the books, with final average: SELECT RETAIL_PRICE-WHOLESALE_PRICE FROM BOOK; SELECT AVG(RETAIL_PRICE-WHOLESALE_PRICE) FROM BOOK;
  • Comments, ratings and average rating for a book: SELECT * FROM RATING WHERE ARTICLE_NO=...; SELECT AVG(SCORE) FROM RATING WHERE ARTICLE_NO=...;

Next: Bringing the Client to Life on PostgreSQL »

Skip Ahead

1 The Database Design
2 Adapting the Design to PostgreSQL
3 Adapting the Design to MySQL
4 Adapting the Design to mSQL
5 Implementing the Test Client
6 Bringing the Client to Life on PostgreSQL
7 Bringing the Client to Life on MySQL
8 Bringing the Client to Life on mSQL
9 Some Early Conclusions





Linux is a trademark of Linus Torvalds.


internet.com home | search | help! | about us

Jupiter Online Media

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers