Implementing Database in Sybase
Implementing Database in Sybase – Part 1
Division 4
Forward: This part of the series is an introductory tutorial on implementing database in software package, called Sybase.
By: Chrysanthus Date Published: 26 Aug 2012
Introduction
In the previous divisions, we learned how to design a database. After designing a database, you have to implement it. Implementing means you have to code it for a particular Database management System. There are many database management systems in the market.
Note: If you cannot see the code or if you think anything is missing (broken link, image absent), just contact me at forchatrans@yahoo.com. That is, contact me for the slightest problem you have about what you are reading.
Sybase
Sybase is a company that manufactures database implementation packages. Sybase as a database implementation package today is very big. It exists in different forms. A non-commercialized form is called SQL Anywhere 12. This is version 12 of the SQL Anywhere package. You can download it free from the Internet. Search the web to download it; the actual installation file to download is SQLAnywhere12_Full.exe. The site will ask you to register freely before you can download. They will send you a key (short text) to use in your installation process, to your email box. SQL Anywhere 12 is for relational databases.
The rest of this series is written for the Windows Operating System (Windows XP SP2 and higher). However, almost all the features in this division are applicable to other operating systems.
Installation
To install SQL Anywhere 12, just double click the file SQLAnywhere12_Full.exe and allow the default settings. SQL Anywhere 12 has different Database Management Systems (DBMS), but the one we shall use is called, SQL Anywhere 12. In fact, SQL Anywhere 12 is actually a package having its particular DBMS. When you finished installing the package, it would be a good idea to restart your computer before you use the package. You need a large disk space for this installation.
The SQL Anywhere DBMS Server
A database server is software that is used to create and run a database. Remember, a database is a collection of related tables. To this effect, SQL Anywhere 12 has two servers called, the Personal Server and the Network Server. In this series we shall work with the Personal Server. I assume that this is your first time to learn how to implement a database. So, let us make things simple; let us learn with the personal server.
SQL
SQL stands for Structured Query Language. It is a computer language that is used to create a database and its tables. It is also used to retrieve information from the database. Each software manufacturer such as Sybase has a slightly modified version of the standard language. In this series we shall learn SQL of Sybase. Most of the things, learned in this series under SQL are applicable to other manufacturers such a Microsoft. SQL consists of a set of statements, collectively called the SQL Statements.
Command Prompt
We shall use the command prompt (DOS window) to start and stop the server (see below), and also to create a database. SQL Anywhere 12 has other ways to start and stop the server, but I believe that a serious beginner should start with the command prompt. In that way he would have a better understanding of what is going on. You access the command prompt in Windows XP as follows: Start>>All Programs>>Accessories>>Command Prompt.
SQL Anywhere 12 allows you to start more than one server, but we shall not go into that detail. When you start a server, you have to give it a name.
To start the server following what I have said above, you have to open the command prompt window using Start>>All Programs>>Accessories>>Command Prompt. After that go to the root directory by typing the following and pressing the Enter key on the keyboard:
cd c:\
The SQL Anywhere 12 command (or tool) to start a personal server, in simple terms, is (do not type it),
dbeng12 –n serverName
Here, 12 means version 12. You have the command prompt window and the command prompt itself. The command prompt window is the black and white window into which you type in commands. These commands are actually short programs (or tools) and each has its syntax. They work directly with the operating system. So, dbeng12 is a command. The command prompt itself can be called the DOS prompt. It is the flashing underscore with the preceding directory path that you see in the command prompt window.
To start a personal server, you can type the command, dbeng12 –n serverName, at the command prompt and press Enter. serverName is a name of your choice you give to the server. -n is an example of what is called a switch. You type it as indicated above. If everything goes well, you should see a new command prompt in the command prompt window. The server has a window; it may appear and disappear. However, the icon of the server window will appear in the system tray. To see the server window, just double-click this icon. You can use the server window to stop (or shut down) the server. To send back the server window to the system tray without stopping the server, just click the minimize button of the server window.
dbeng12 means DataBase ENGine version 12.
To stop the personal server at the commend prompt, you type the following command and press Enter:
dbstop serverName
I have not used a switch here. You type the command, dbstop, followed by the name of the personal server you started; then you press the Enter key. Everything being equal, the server will display something like,
SQL Anywhere Stop Server Utility Version 12.0.0.2483
and then you see a new command prompt. The server icon in the system tray should disappear (when you stop the server).
Remember, a server is what allows you to create and use a database. Whenever you finish using a server, stop it; unless the server is for something like the Internet that has to be on all the time.
That is it for this part of the series. We stop here and continue in the next part.
Chrys
Related Courses
C++ CourseRelational Database and Sybase
Windows User Interface
Computer Programmer – A Jack of all Trade – Poem
NEXT