Google
 

Thursday, May 10, 2007

Difference Between DBMS and RDBMS

DBMS - Database Management System

A Database Management System (DBMS) is a computer program that can access data in a database.

The DBMS program enables you to extract, modify, or store information in a database.

Different DBMS programs provides different functions for querying data, reporting data, and modifying data.


RDBMS - Relational Database Management System

A Relational Database Management System (RDBMS) is a Database Management System (DBMS) where the database is organized and accessed according to the relationships between data.

RDBMS was invented by IBM in the early 1970's.

RDBMS is the basis for SQL, and for all modern database systems like Oracle, SQL Server, IBM DB2, Sybase, MySQL, and Microsoft Access.

Wednesday, April 25, 2007

What is COBOL ?

COBOL is a high-level programming language first developed by the CODASYL Committee (Conference on Data Systems Languages) in 1960. Since then, responsibility for developing new COBOL standards has been assumed by the American National Standards Institute (ANSI).

Three ANSI standards for COBOL have been produced: in 1968, 1974 and 1985. A new COBOL standard introducing object-oriented programming to COBOL, is due within the next few years.

The word COBOL is an acronym that stands for COmmon Business Oriented Language. As the the expanded acronym indicates, COBOL is designed for developing business, typically file-oriented, applications. It is not designed for writing systems programs. For instance you would not develop an operating system or a compiler using COBOL.

Tuesday, April 10, 2007

Basic PHP Tutorial

What?
Okay, so here's the general idea of what I'm going to do in this tutorial:
Teach you the basics of PHP.
Simple as that…nothing more, nothing less…well, maybe a little more…
------------------------------------------------------------------------------------------
Okay, let's get started!
If you have a server, then great! If not…well, get one! Ask a friend, look online, anything! If it has PHP installed on the server, then you're set!
Once you have a server and an FTP account to transfer the files, we can start by making our first PHP program! To make a program with PHP, there are a few things you need to understand first:
  • Every PHP program MUST start and end with , respectively. You will see examples of this later.
  • All expressions must end with a semicolon ( ; )
  • A PHP file (.php) with HTML scripts in it WILL be read as HTML, unless inside tags. (examples are explained further down)

So, now that you're confused with all of that, let me clear something up with an example script. First, open notepad, or anything that can save a .php, in need of a good one?

Quote
Check out a couple of my favorites:

Araneae
Notepad 2

Code:
( //<-- the "//" indicates a one-line comment, and only everything after and on the same line as the "//", will be counted as a comment. // Please note that the "echo "Hello World!"; //"echo" is a basic PHP function that displays data in the form of a string. If you notice, I added the ‘;' at the end, and I put my string (Hello World!), in quotes. This means that it will echo it as a string.
/* This is an example of a Multi Line comment. It will only stop with the break symbol -->*/
?>)

Okay, confused? Good. Go upload that file to the server (save it as test.php). Now, go you your server, and view the file. Notice how it displays "Hello World!"? Good, catching on? Nice!

Now, a little bit harder...

Code:(
= "This is a variable set as a string.";
$my_number = 0;
// Here, I set two variables. In PHP, a variable is defined with a $, then a string. IE: My two variables are called my_string, and my_number, because they each start with a $.

/* Now that the two variables are set, let's do something with them.
First, I'll make it easy and just display what they equal */
echo "$my_string = ".$my_string."
$my_number = "
.$my_number;
/* Notice how I used a ‘.' To append separate strings and variables together, this makes the echo function display multiple strings
and variables, with one execution…IE: Instead of doing this:
echo "$my_string = ";
echo $my_string;
echo "
";
echo "$my_number = ";
echo $my_number;
I just put it all in one echo. */
?>)

That's the basic overview of variables…they're simple once you get the hang of them. Now, to perform a function, such as add(+), multiply(*), divide(/), and subtract(-), you simply do this:

Code:(
//Set Initial Number
$num = 10;
//Make a new variable, and perform +
$add = $num+5;
//Make a new variable, and perform -
$sub = $num-5;
//Make a new variable, and perform *
$multiply = $num*5;
//Make a new variable, and perform /
$divide = $num/5;
//Echo all my variables
echo "$num =".$num;
echo
"
$sub ="
.$sub;
echo
"
$multiply ="
.$multiply;
echo
"
$divide ="
.$divide;
?>)


If you're noticing, it's a LOT like Flash (if you know flash). It's just a bit more work (because it's all through text, no drawing and such). You set your variables (with the $, to define a variable), add a ; at the end of a function, and display data. Simple.
Now, how about some if() statements? Let's make it easy:

Code:
(//set number variable
$num = 5;
//run if() statement
if ($num == 5){
//if the if() statement is true, echo string
echo "$num is = to 5.";
} else {
//else, echo another string
echo "$num does not = 5.";
}
?>)
Now, that example is pretty pointless, because I set $num to 5 to start, so it will echo "$num is = to 5.", however, if you change $num to anything else, it will echo "$num does not = 5.". Now, how about some user input? If you haven't noticed from above, I can put some HTML scripts in the echo function, and it will work (the
, made a line break) IE:

Code:
(echo "This is an example of an HTML line break:
Top
Bottom"
;
?>

So, we know we can run HTML scripts, let's make HTML interact with PHP…yes, that's it! Here we go:
Code:
= $_POST['name'];
if (!
$name){
echo "Please enter a name: ";
?>)






(
} else {
echo "Hello ".$name.", welcome!";
}
?>)


About PHP

PHP is a powerful server-side scripting language for creating dynamic and interactive websites.

PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. PHP is perfectly suited for Web development and can be embedded directly into the HTML code.

The PHP syntax is very similar to Perl and C. PHP is often used together with Apache (web server) on various operating systems. It also supports ISAPI and can be used with Microsoft's IIS on Windows.

Friday, April 6, 2007

A Word About the Java Platform

The Java platform consists of the Java application programming interfaces (APIs) and the Java1 virtual machine (JVM).

Java APIs are libraries of compiled code that you can use in your programs. They let you add ready-made and customizable functionality to save you programming time.

The simple program in this lesson uses a Java API to print a line of text to the console. The console printing capability is provided in the API ready for you to use; you supply the text to be printed.

Java programs are run (or interpreted) by another program called the Java VM. If you are familiar with Visual Basic or another interpreted language, this concept is probably familiar to you. Rather than running directly on the native operating system, the program is interpreted by the Java VM for the native operating system. This means that any computer system with the Java VM installed can run Java programs regardless of the computer system on which the applications were originally developed.

For example, a Java program developed on a Personal Computer (PC) with the Windows NT operating system should run equally well without modification on a Sun Ultra workstation with the Solaris operating system, and vice versa.

Friday, March 30, 2007

SQL WHERE Clause

The WHERE Clause

To conditionally select data from a table, a WHERE clause can be added to the SELECT statement.

Syntax

SELECT column FROM table
WHERE column operator value

With the WHERE clause, the following operators can be used:

Operator Description
= Equal
<> Not equal
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
BETWEEN Between an inclusive range
LIKE

Search for a pattern

IN If you know the exact value you want to return for at least one of the columns

Note: In some versions of SQL the <> operator may be written as !=


Using the WHERE Clause

To select only the persons living in the city "Sandnes", we add a WHERE clause to the SELECT statement:

SELECT * FROM Persons
WHERE City='Sandnes'

"Persons" table

LastName FirstName Address City Year
Hansen Ola Timoteivn 10 Sandnes 1951
Svendson Tove Borgvn 23 Sandnes 1978
Svendson Stale Kaivn 18 Sandnes 1980
Pettersen Kari Storgt 20 Stavanger 1960

Result

LastName FirstName Address City Year
Hansen Ola Timoteivn 10 Sandnes 1951
Svendson Tove Borgvn 23 Sandnes 1978
Svendson Stale Kaivn 18 Sandnes 1980


Using Quotes

Note that we have used single quotes around the conditional values in the examples.

SQL uses single quotes around text values (most database systems will also accept double quotes). Numeric values should not be enclosed in quotes.

For text values:

This is correct:
SELECT * FROM Persons WHERE FirstName='Tove'
This is wrong:
SELECT * FROM Persons WHERE FirstName=Tove

For numeric values:

This is correct:
SELECT * FROM Persons WHERE Year>1965
This is wrong:
SELECT * FROM Persons WHERE Year>'1965'


The LIKE Condition

The LIKE condition is used to specify a search for a pattern in a column.

Syntax

SELECT column FROM table
WHERE column LIKE pattern

A "%" sign can be used to define wildcards (missing letters in the pattern) both before and after the pattern.


Using LIKE

The following SQL statement will return persons with first names that start with an 'O':

SELECT * FROM Persons
WHERE FirstName LIKE 'O%'

The following SQL statement will return persons with first names that end with an 'a':

SELECT * FROM Persons
WHERE FirstName LIKE '%a'

The following SQL statement will return persons with first names that contain the pattern 'la':

SELECT * FROM Persons
WHERE FirstName LIKE '%la%'

Thursday, March 22, 2007

Select Statement (last part)

Semicolon after SQL Statements?

Semicolon is the standard way to separate each SQL statement in database systems that allow more than one SQL statement to be executed in the same call to the server.

Some SQL tutorials end each SQL statement with a semicolon. Is this necessary? We are using MS Access and SQL Server 2000 and we do not have to put a semicolon after each SQL statement, but some database programs force you to use it.


The SELECT DISTINCT Statement

The DISTINCT keyword is used to return only distinct (different) values.

The SELECT statement returns information from table columns. But what if we only want to select distinct elements?

With SQL, all we need to do is to add a DISTINCT keyword to the SELECT statement:

Syntax

SELECT DISTINCT column_name(s)
FROM table_name


Using the DISTINCT keyword

To select ALL values from the column named "Company" we use a SELECT statement like this:

SELECT Company FROM Orders

"Orders" table

Company OrderNumber
Sega 3412
W3Schools 2312
Trio 4678
W3Schools 6798

Result

Company
Sega
W3Schools
Trio
W3Schools

Note that "W3Schools" is listed twice in the result-set.

To select only DIFFERENT values from the column named "Company" we use a SELECT DISTINCT statement like this:

SELECT DISTINCT Company FROM Orders

Result:

Company
Sega
W3Schools
Trio

Now "W3Schools" is listed only once in the result-set.