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
Adapting the Design to mSQL

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

As mSQL is a scaled-down database manager (indeed, some may question whether MySQL and mSQL are database-management systems at all), it has jettisoned most of SQL's functionality and accepts only a very restricted subset of SQL. Thus, mSQL's script looks a lot different:

DROP TABLE BOOK
CREATE TABLE BOOK (
    ARTICLE_NO            INTEGER    NOT NULL,
	AUTHOR_FIRST_NAMES    CHARACTER(30),
	AUTHOR_LAST_NAMES     CHARACTER(30),
	TITLE                 CHARACTER(30),
	ISBN                  CHARACTER(13), 
	WHOLESALE_PRICE       MONEY,
	RETAIL_PRICE          MONEY,
	COPIES_AVAILABLE      INTEGER
)

DROP TABLE CUSTOMER
CREATE TABLE CUSTOMER (
    CUSTOMER_NO           INTEGER    NOT NULL,
	FIRST_NAMES           CHARACTER(30),
	LAST_NAMES            CHARACTER(30),
	STREET                CHARACTER(30),
	HOUSE_NO              SMALLINT,
	POSTCODE              CHARACTER(7),
	TOWN                  CHARACTER(30),
	ISO_COUNTRY_CODE      CHARACTER(2)
)

DROP TABLE BOOKORDER
CREATE TABLE BOOKORDER (
    ORDER_NO              INTEGER    NOT NULL,
	CUSTOMER_NO           INTEGER    NOT NULL,
	ORDERED               DATE,
	DELIVERY              DATE,
	STATUS                CHARACTER(1)
)

DROP TABLE ORDER_POSITION
CREATE TABLE ORDER_POSITION (
    POSITION_NO           INTEGER    NOT NULL,
    ORDER_NO              INTEGER    NOT NULL,
	ARTICLE_NO            INTEGER    NOT NULL,
	NUMBER                SMALLINT
)

DROP TABLE RATING
CREATE TABLE RATING (
    RATING_NO             INTEGER    NOT NULL,
    ARTICLE_NO            INTEGER    NOT NULL,
	SCORE                 SMALLINT,
	COMMENT               TEXT(255)
)

Nearly all of the constraints have disappeared, and NUMERIC and CHARACTER VARYING have been replaced by MONEY and TEXT, respectively.

There is an annoying deficiency in mSQL's monitor program: it doesn't seem to accept SQL scripts fed into it from standard input. Thus, one needs to cut and paste the code. mSQL will complain about semicolons, too; I ended up feeding the commands into it one by one and terminating each with \g (the "go" 'slash command').

Next: Implementing the Test Client »

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