tag:blogger.com,1999:blog-58390525781902868332024-03-12T18:58:01.104-07:00Software Developer's BlogAnonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-5839052578190286833.post-76915188555070020002013-11-04T07:47:00.000-08:002013-11-04T07:47:57.167-08:00Learning SQL Everyday: Day 3<div dir="ltr" style="text-align: left;" trbidi="on">
<div align="center" class="MsoNormal" style="text-align: center;">
<b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt;">Introduction to the ALTER, INSERT INTO,
UPDATE & DELETE Statements:<o:p></o:p></span></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbzCZEHQInmNqojeHWMWLgggD6LXBlXgbja04x-2Ep7QKSlA4UNjewhy7KCrIQHlAz7Y7PD_c7IO0B5JVNgZzCluqciLn6G8YpSEkCmSzQIWkZviprOpsQLShEOV0dVdYk0Vg0rrzJlG0/s1600/sql.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbzCZEHQInmNqojeHWMWLgggD6LXBlXgbja04x-2Ep7QKSlA4UNjewhy7KCrIQHlAz7Y7PD_c7IO0B5JVNgZzCluqciLn6G8YpSEkCmSzQIWkZviprOpsQLShEOV0dVdYk0Vg0rrzJlG0/s1600/sql.jpeg" /></a></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt;"><br /></span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Today, we will try to see the:<o:p></o:p></div>
<div class="MsoNormal">
ALTER, INSERT, UPDATE and DELETE SQL keywords and we will
try to illustrate their use with example.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt; mso-bidi-font-family: Cambria; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Cambria; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span></b><!--[endif]--><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt;">The ALTER
keyword:<o:p></o:p></span></b></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: justify; text-justify: inter-ideograph;">
This key word is one of the DDL (Data Definition Languages).
We can use the ALTER keyword to change the basic structure of a database table.
When we use the ALTER keyword with a table, it can be used to add, delete, or
modify columns of the selected table.<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle">
<br /></div>
<div class="MsoListParagraphCxSpMiddle">
The syntax is:<o:p></o:p></div>
<div class="MsoListParagraphCxSpLast">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">ALTER TABLE table_name</span><span style="color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">ADD column_name datatype</span></span><span style="font-family: Times; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: justify; text-justify: inter-ideograph;">
If you want to delete/remove a column from an existing table,
you can use the ALTER keyword as follows:<o:p></o:p></div>
<div class="MsoListParagraphCxSpLast">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">ALTER TABLE table_name</span><span style="color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">DROP COLUMN column_name<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
If you want to change/modify the data-type of a column of an
existing table, you can use the ALTER key word as follows:<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">ALTER TABLE table_name</span><span style="color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">MODIFY COLUMN column_name datatype<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
Now let us see the above syntax in use with an example. Assume
you just created a table called ‘tbl_student’ using the following CREATE TABLE
statement…<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="font-family: Times; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">CREATE TABLE tbl_student(<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="font-family: Times; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="mso-tab-count: 1;"> </span>id int
auto_increment,<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="font-family: Times; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="mso-tab-count: 1;"> </span>name varchar(50)
not null,<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="font-family: Times; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="mso-tab-count: 1;"> </span>id_number
varchar(20) not null,<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="font-family: Times; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="mso-tab-count: 1;"> </span>city
varchar(30) not null,<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="font-family: Times; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="mso-tab-count: 1;"> </span>primary
key(id)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="font-family: Times; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
Then you realize that you forgot to add one column called
‘CGPA’ to the table. So to add a new column to the existing table ‘tbl_student’
you can use:<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">ALTER TABLE tbl_student</span><span style="color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">ADD cgpa int;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
When you execute this statement,
the table will have a new column ‘cgpa’ appended to it. But then you again saw
one error. A student CGPA is a floating number. E.g student can have 3.45 as a
cgpa. But the data type of cgpa in tbl_student is int. So to change the ‘int’
to a ‘float’ data type, you need to do the following<span style="font-family: Times; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">ALTER TABLE tbl_student</span><span style="color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">ALTER COLUMN cgpa float<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
If you want to change and decide that you don’t want to store
the cgpa column in tbl_student, you need to only drop/delete the ‘cgpa’ column
with out affecting the rest of the columns in the table. To do this, you need
to use the DROP key word with ALTER. See the example given below:<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">ALTER TABLE tbl_student</span><span style="color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">DROP COLUMN cgpa</span></span><span style="font-family: Times; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
Executing the above statement will
eliminate the ‘cgpa’ column and leave the rest of the table intact.<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt; mso-bidi-font-family: Cambria; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Cambria; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span></b><!--[endif]--><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt;">INSERT INTO
Keyword:<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
This key word is one of the DML (Data Manipulation Languages).
It strictly deals with the content of a table and not with the underlying table
structure. This key word is used to add/insert a new record to the table
specified in the statement. The INSERT INTO SQL statement has two forms (syntax).
These are given below:<o:p></o:p></div>
<div class="MsoListParagraph">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
<b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;">Version One</i></b><i style="mso-bidi-font-style: normal;">: (Here you
don’t have to specify the order of the columns of the table. You just give the
name of the table where the new record is supposed to be added followed by the
actual data values to be inserted.)<o:p></o:p></i></div>
<div class="MsoListParagraph">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">INSERT INTO <i>table_name</i></span><span style="color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">VALUES (<i>value1</i>,<i>value2</i>,<i>value3</i>,...);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
<b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;">Version Two</i></b><i style="mso-bidi-font-style: normal;">: (In the
second version, you need to specify the order of the columns followed by the
actual data values you want to add to the table.)<o:p></o:p></i></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">INSERT INTO <i>table_name</i> (<i>column1</i>,<i>column2</i>,<i>column3</i>,...)</span><span style="color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">VALUES (<i>value1</i>,<i>value2</i>,<i>value3</i>,...);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
Let us assume the example table we have created in the ALTER
TABLE section. We will use the tbl_student schema (table structure) to insert
data to it. In the beginning, the table contains no data, hence the table is
empty.<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
First we will try to use the version one approach, and next we
will use the version two approaches to insert new record to the table.<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
Version One:<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">INSERT INTO tbl_student<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">VALUES(0,’Alemu
Teshome’,’STD/1234/02’,’Addis Ababa’);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
Version Two:<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">INSERT INTO tbl_student
(Name, Id_Number, City)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">VALUES(‘Aster Degu’,
‘STD/2345/02’,’Jimma’);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
As you can see from the above two examples, we are adding two
new records to tbl_student but using two different versions of the INSERT INTO
statement.<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
The first version always assumes to insert data to all columns
of the table. Hence you need to pass a value to all columns of the table (full
record value). You might have seen we have used 0 as the id value for the
table. This column is defined as auto increment, so the value you pass will not
be saved to the table. Rather, an automatically generated PK will be saved. All
you need to do in such cases is to use a data value that has the same data type
as the auto incremented value. In this case we are using int data type.<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
The second version of the INSERT INTO statement is used to
specifically determine the columns you want to add data to. If you see the example
again, we have left the id (auto incremented) value out and we have started
from the ‘Name’ of the student table. Hence, data insertion will begin from the
specified column name.<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
Therefore, you need to understand when to use the two
different versions of the INSERT INTO statement. (N.B: You need to check if you
have specified the columns as NOT NULL when creating them. In such cases,
executing such an insert statement might generate an error.)<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt; mso-bidi-font-family: Cambria; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Cambria; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span></b><!--[endif]--><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt;">The UPDATE
Statement.<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
This key word is one of the DML (Data Manipulation Languages).
It strictly deals with the content of a table and not with the underlying table
structure. This statement is used to manipulate the content of a table (data
only). You should remember that UPDATE is only used to modify an existing
record. If there is no record, update statement will <b style="mso-bidi-font-weight: normal;">NOT</b> insert a new record. The syntax of the update statement is
given below:<o:p></o:p></div>
<div class="MsoListParagraph">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">UPDATE <i>table_name</i></span><span style="color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">SET <i>column1</i>=<i>value1</i>,<i>column2</i>=<i>value2</i>,...</span><br />
<span style="background: #F6F4F0;">WHERE <i>some_column</i>=<i>some_value</i>;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
In the SET clause, you are expected to specify which column’s
content you would like to modify in the WHERE clause, you are expected to
specify the condition that will identify which records from the table to
update. If you leave out the WHERE clause, all the records of the table will be
updated regardless of any condition. Let us see an example here:<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">UPDATE tbl_student<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">SET Name = ‘Solomon Teka’<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">WHERE Id_Number =
‘STD/1234/02’<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
Here only a record with Id_Number = ‘STD/1234/02’ will be
modified. That is, the name value will be replaced with the new data value
‘Solomon Teka’. Executing this statement will not have any effect to the rest
of the records of tbl_student. But if you leave out the WHERE Id_Number =
‘STD/1234/02’ part, then all records of tbl_student will have same name. i.e,
‘Solomon Teka’.<o:p></o:p></div>
<div class="MsoListParagraphCxSpFirst">
<br /></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt; mso-bidi-font-family: Cambria; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Cambria; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span></b><!--[endif]--><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt;">The DELETE
Statement.<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
This key word is one of the DML (Data Manipulation Languages).
It strictly deals with the content of a table and not with the underlying table
structure. The DELETE statement is used to delete rows in a table. The syntax
of the delete statement is given below:<o:p></o:p></div>
<div class="MsoListParagraph">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">DELETE FROM <i>table_name</i></span><span style="color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">WHERE <i>some_column</i>=<i>some_value</i>;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
Just like the UPDATE statement, if you leave the WHERE clause,
all the records of the specified table will be deleted. Let us see an example
where we try to remove the record with Id_Number ‘STD/2345/02’ from
tbl_student.<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">DELETE FROM tbl_student<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">WHERE Id_Number =
‘STD/2345/02’<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
Executing the above statement will remove the record with a
student Id_Number ‘STD/2345/02’. Only this record is expected to be deleted. If
there is no student record with the given Id_Number, then the delete will not
affect the other records of the table. But if you omit the WHERE condition, all
the records of the table will be deleted. So you need to always be extra
careful when dealing with DELETE statements.<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-justify: inter-ideograph;">
<br /></div>
<div class="MsoListParagraph">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br /></div>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Revision>0</o:Revision>
<o:TotalTime>0</o:TotalTime>
<o:Pages>1</o:Pages>
<o:Words>1084</o:Words>
<o:Characters>6181</o:Characters>
<o:Company>Echo Origin</o:Company>
<o:Lines>51</o:Lines>
<o:Paragraphs>14</o:Paragraphs>
<o:CharactersWithSpaces>7251</o:CharactersWithSpaces>
<o:Version>14.0</o:Version>
</o:DocumentProperties>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>JA</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
<w:UseFELayout/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="276">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]-->
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}
</style>
<![endif]-->
<!--StartFragment-->
<!--EndFragment--><br />
<div class="MsoListParagraph">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com1tag:blogger.com,1999:blog-5839052578190286833.post-59506356727028494662013-10-31T14:17:00.001-07:002013-10-31T14:17:05.246-07:00Software Developer's Blog: Learning SQL Everyday: Day 2<a href="http://mahderjava.blogspot.com/2013/10/learning-sql-everyday-day2.html?spref=bl">Software Developer's Blog: Learning SQL Everyday: Day 2</a>: Introduction to the CREATE SQL statement: The CREATE statement is one of the DDL (Data Definition Language) in that it i...Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-41230386185893012172013-10-31T12:25:00.000-07:002013-11-04T07:50:02.335-08:00Learning SQL Everyday: Day 2<div dir="ltr" style="text-align: left;" trbidi="on">
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Revision>0</o:Revision>
<o:TotalTime>0</o:TotalTime>
<o:Pages>1</o:Pages>
<o:Words>1228</o:Words>
<o:Characters>7000</o:Characters>
<o:Company>Echo Origin</o:Company>
<o:Lines>58</o:Lines>
<o:Paragraphs>16</o:Paragraphs>
<o:CharactersWithSpaces>8212</o:CharactersWithSpaces>
<o:Version>14.0</o:Version>
</o:DocumentProperties>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>JA</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
<w:UseFELayout/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="276">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]-->
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}
table.MsoTableGrid
{mso-style-name:"Table Grid";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-priority:59;
mso-style-unhide:no;
border:solid windowtext 1.0pt;
mso-border-alt:solid windowtext .5pt;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-border-insideh:.5pt solid windowtext;
mso-border-insidev:.5pt solid windowtext;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}
</style>
<![endif]-->
<!--StartFragment-->
<br />
<div class="MsoNormal">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6R5sX6YHSkDSHJFicCdzBmUrv1JiX6VBNLFBgPSq8rGF01MLZfMZN3BLDtqK7dg4iXe6uq6G1DxOYIArNA4QX7GYOqOEWfsuEndrbyRaNtQf8nBtQKPFFPdayGOYce3klISgysFf8Ay0/s1600/sql.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6R5sX6YHSkDSHJFicCdzBmUrv1JiX6VBNLFBgPSq8rGF01MLZfMZN3BLDtqK7dg4iXe6uq6G1DxOYIArNA4QX7GYOqOEWfsuEndrbyRaNtQf8nBtQKPFFPdayGOYce3klISgysFf8Ay0/s1600/sql.jpeg" /></a></div>
<b><span style="font-size: 20pt;"><br /></span></b>
<b><span style="font-size: 20pt;">Introduction
to the CREATE SQL statement:<o:p></o:p></span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">The
CREATE statement is one of the DDL (Data Definition Language) in that it is
used to define/create database objects like, database, table, user etc.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">We will use the CREATE statement to do the
following things:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; mso-pagination: none; tab-stops: 11.0pt .5in; text-autospace: none; text-indent: -.5in;">
<!--[if !supportLists]--><span style="font-size: 16pt;">•<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 16pt;">To create a database<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; mso-pagination: none; tab-stops: 11.0pt .5in; text-autospace: none; text-indent: -.5in;">
<!--[if !supportLists]--><span style="font-size: 16pt;">•<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 16pt;">To create a table structure<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; mso-pagination: none; tab-stops: 11.0pt .5in; text-autospace: none; text-indent: -.5in;">
<!--[if !supportLists]--><span style="font-size: 16pt;">•<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 16pt;">To create a database user<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">Today, We will see the how the CREATE statement is
used to achieve above points in MySQL.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="font-size: 18pt;">The
CREATE DATABASE Statement:<o:p></o:p></span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="margin-left: 0in; mso-add-space: auto; mso-layout-grid-align: none; mso-pagination: none; tab-stops: 0in 11.0pt; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">Before
creating a database, we need to understand what a database is. A database is a
collection of related tables and serves as a repository. For instance you can
think of a school as a database and the teachers, students, courses etc as a
table. The interaction among the entity (objects) teacher, student and course etc.
is what we call relationship among them. You know that a student takes a course
and a course is tutored (given) by a teacher. So when you want to know who is
teaching who? Who is taking what course etc, you have to trace the bits and pieces
of information across each related table. Hence you will get full information
when you combine the related records across each related tables. As you can
see, the database contains a full information by keeping the data across
related tables.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast">
<br /></div>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">The
CREATE DATABASE statement is used to create a database in a DBMS. As you we
have discussed in Day 1, a DBMS can have a number of databases in it. So if you
want to create a new database in your DBMS, you will have to use the CREATE
DATABASE statement. The syntax is given as follows:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="background: #F6F4F0; font-family: "Courier New"; font-size: 16.0pt; mso-fareast-font-family: "Times New Roman";">CREATE
DATABASE <i>dbname</i>;</span><span style="font-size: 16pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">N.B:
dbname is the name of your database. Remember that you need to end the
statement with a semi-colon (;). This is important when you are writing
statements in a MySQL console window.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">Eg.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">CREATE DATABASE db_school;<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">This
statement will create a blank database (no tables in it) named db_school in
your DBMS. Unless you select the newly created database and execute a CREATE
TABLE statement, the database will contain no tables in it.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="font-size: 18pt;">The
CREATE TABLE Statement:<o:p></o:p></span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">The CREATE TABLE Statement is used to create table
in the selected database. This statement is also one of the DDL of SQL in that
we use the CREATE TABLE statement to create a new database structure, in this
case a TABLE.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">A database table is a collection of rows/tuples.
Each row represents a record/an entity we are persisting (saving) to the
database. In turn, a row is a collection of fields/columns. Continuing from our
first example, if you take the object/instance Student, you know that a student
object should have name, id_number, sex, department etc.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">Each attributes we have listed as name, id_number,
sex etc. are known as fields/columns. When you actually merge this together,
they will form a row/record. A record is one instance/object of the table Student
in our example.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">If you consider this example:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">STUDENT<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">Name<o:p></o:p></span></div>
</td>
<td style="border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">Id_Number<o:p></o:p></span></div>
</td>
<td style="border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">Sex<o:p></o:p></span></div>
</td>
<td style="border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">Department<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">Selam Alemu<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">SC/2345/00<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">Female<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">Math<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">Abebe Kebede<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">SC/1234/00<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal">
<span style="font-size: 16pt;">Male<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;" valign="top" width="111"><div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; page-break-after: avoid; tab-stops: 11.0pt .5in; text-autospace: none;">
<span style="font-size: 16pt;">Physics<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoCaption">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">As you can see from the above table each column
represents fields of the object student.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">If you view horizontally (records/tuples) it
represents a single student object.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">It might be note worthy to remember this
relationship:<o:p></o:p></span></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">Table = Class = File<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">Tuple/Record = Object<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">Column = Field/attribute<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">These points will be used when we do mapping later
on in our journey.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">The CREATE TABLE Syntax:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 16.0pt; mso-fareast-font-family: "Times New Roman";">CREATE
TABLE <i>table_name</i></span><span style="color: #444444; font-family: "Courier New"; font-size: 16.0pt; mso-fareast-font-family: "Times New Roman";"><br />
<span style="background: #F6F4F0;">(</span><br />
<i><span style="background: #F6F4F0;">column_name1 data_type</span></i><span style="background: #F6F4F0;">(<i>size</i>),</span><br />
<i><span style="background: #F6F4F0;">column_name2 data_type</span></i><span style="background: #F6F4F0;">(<i>size</i>),</span><br />
<i><span style="background: #F6F4F0;">column_name3 data_type</span></i><span style="background: #F6F4F0;">(<i>size</i>),</span><br />
<span style="background: #F6F4F0;">....</span><br />
<span style="background: #F6F4F0;">);</span></span><span style="font-size: 16pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div style="background: white; mso-line-height-alt: 12.0pt; text-align: justify; text-justify: inter-ideograph;">
<span style="font-size: 16.0pt; mso-bidi-font-family: Times;">The column name parameters specify the names of the columns of the
table.<o:p></o:p></span></div>
<div style="background: white; mso-line-height-alt: 12.0pt; text-align: justify; text-justify: inter-ideograph;">
<span style="font-size: 16.0pt; mso-bidi-font-family: Times;">The data_type parameter specifies what type of data the column can hold
(e.g. varchar, integer, decimal, date, etc.).<o:p></o:p></span></div>
<div style="background: white; mso-line-height-alt: 12.0pt; text-align: justify; text-justify: inter-ideograph;">
<span style="font-size: 16.0pt; mso-bidi-font-family: Times;">The size parameter specifies the maximum length of the column of the
table.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">Example:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">CRATE DATABASE db_school;<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">USE db_school;<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">CREATE TABLE tbl_student(<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;"> Name
varchar(50) not null,<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;"> Id_Number
varchar(20) not null,<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;"> Sex
varchar(10) not null,<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;"> Department
varchar(50) not null,<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;"> PRIMARY
KEY(Id_Number)<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">);<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">Assuming you created the database db_school, you
need to select the specific database you wanted the new table to reside upon.
Remember we have said a DBMS can contain many databases. For selecting which
database to use, we use the ‘USE’ statement as listed in the example.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">The above SQL code creates a table named
‘tbl_student’. The table has four columns with their data type and size
specified. For eg. You can see that name is given only 50 characters. If you
try to give a name value exceeding this size, the data value will be truncated.
The ‘Not Null’ value in each column shows that empty value /null value for that
filed/column is not allowed and will have to always contain a data value.
Finally we have added the PRIMARY KEY information in the table. <o:p></o:p></span></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">It is not a must that a table shall have a primary
key. But it is always a good idea to have a primary key defined for your tables
because that is the only way you can create relationship b/n tables. Of course
you can have flat table (a table with no relationship at all). <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">So how do you determine which column of a table
should be a PK (Primary key)? The following are the criteria you should check:<o:p></o:p></span></div>
<div class="MsoNormal" style="mso-layout-grid-align: none; mso-pagination: none; tab-stops: 11.0pt .5in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="mso-layout-grid-align: none; mso-list: l1 level1 lfo2; mso-pagination: none; tab-stops: 11.0pt .5in; text-autospace: none; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 16pt;">The field/attribute MUST NOT be NULL<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-layout-grid-align: none; mso-list: l1 level1 lfo2; mso-pagination: none; tab-stops: 11.0pt .5in; text-autospace: none; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 16pt;">It must be UNIQUE for a single record in the table<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto; mso-layout-grid-align: none; mso-pagination: none; tab-stops: 0in 11.0pt; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">If your
attribute (Candidate key) happens to fulfill the above two points, then it can
be taken as a Primary key, and hence you let your DBMS know that this
particular column is a primary key. To do that you can use the PRIMARY KEY
statement as used in the example.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast">
<br /></div>
<div class="MsoNormal">
<b><span style="font-size: 18pt;">The
CREATE USER Statement:<o:p></o:p></span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">Since we
are using MySQL DBMS, we will see how to create and grant a privilege to a
user. By default MySQL has a user called ‘root’. This user has all the privilege
so you can consider this as a super user.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">Using this account, we can create our own users with different level of
privilege.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">The syntax for creating a user is:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="background: whitesmoke; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt; mso-line-height-alt: 12.0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; word-break: break-all;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 16.0pt; mso-fareast-font-family: "Times New Roman";">CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';<o:p></o:p></span></div>
<div class="MsoNormal" style="background: whitesmoke; line-height: 12.0pt; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; word-break: break-all;">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">N.B:<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">‘newuser’ is the username that
you want it to be. It should be a valid variable name.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">‘password’ is the password of the new user you are just creating.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">Sadly, at
this point newuser has no permissions to do anything with the databases. In
fact, if newuser even tries to login (with the password, password), they will
not be able to reach the MySQL shell. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">Therefore, the first thing to do is to provide the user with access to
the information they will need.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<pre style="background: whitesmoke; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt; mso-line-height-alt: 12.0pt; word-break: break-all;"><span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 16.0pt; mso-fareast-font-family: "Times New Roman";">GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';<o:p></o:p></span></pre>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">The
asterisks in this command refer to the database and table (respectively) that
they can access—this specific command allows to the user to read, edit, execute
and perform all tasks across all the databases and tables in the DBMS.<br />
<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--><o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<br /></div>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<br /></div>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">Once you
have finalized the permissions that you want to set up for your new users,
always be sure to reload all the privileges.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<pre style="background: whitesmoke; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt; mso-line-height-alt: 12.0pt; word-break: break-all;"><span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 16.0pt; mso-fareast-font-family: "Times New Roman";">FLUSH PRIVILEGES;<o:p></o:p></span></pre>
<div class="MsoNormal" style="line-height: 24.0pt; margin-bottom: 1.5pt; margin-left: 0in; margin-right: 0in; margin-top: 22.5pt; mso-outline-level: 2;">
<b><span style="font-size: 18pt;">How To Grant Different User Permissions<o:p></o:p></span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">Here is a short list of other common possible permissions<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: 18.75pt; mso-line-height-alt: 12.0pt; mso-list: l2 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.75pt;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 16.0pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 16pt;">ALL PRIVILEGES- as we saw previously, this would
allow a MySQL user all access to a
designated database (or if no database is selected, across the system)<o:p></o:p></span></div>
<ul type="disc">
<li class="MsoNormal"><span style="font-size: 16pt;">CREATE-
allows them to create new tables or databases<o:p></o:p></span></li>
<li class="MsoNormal"><span style="font-size: 16pt;">DROP-
allows them to them to delete tables or databases<o:p></o:p></span></li>
<li class="MsoNormal"><span style="font-size: 16pt;">DELETE-
allows them to delete rows from tables<o:p></o:p></span></li>
<li class="MsoNormal"><span style="font-size: 16pt;">INSERT-
allows them to insert rows into tables<o:p></o:p></span></li>
<li class="MsoNormal"><span style="font-size: 16pt;">SELECT-
allows them to use the Select command to read through databases<o:p></o:p></span></li>
<li class="MsoNormal"><span style="font-size: 16pt;">UPDATE-
allow them to update table rows<o:p></o:p></span></li>
<li class="MsoNormal"><span style="font-size: 16pt;">GRANT
OPTION- allows them to grant or remove other users' privileges<o:p></o:p></span></li>
</ul>
<div class="MsoNormal" style="margin-left: .25in;">
<br /></div>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">To
provide a specific user with a permission, you can use this syntax:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .25in;">
<br /></div>
<div class="MsoNormal" style="background: whitesmoke; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt; mso-line-height-alt: 12.0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; word-break: break-all;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 16.0pt; mso-fareast-font-family: "Times New Roman";">GRANT [type of permission] ON [database name].[table name]
TO ‘[username]’@'localhost’;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .25in;">
<br /></div>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span style="font-size: 16pt;">If you
want to give them access to any database or to any table, make sure to put an
asterisk (*) in the place of the database name or table name and each time you
update or change a permission be sure to use the Flush Privileges command to
make the changes.</span><span style="background: white; color: #111111; font-family: "Helvetica Neue"; font-size: 13.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: #111111; font-family: "Helvetica Neue"; font-size: 13.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
</span><span style="font-size: 16pt;">If you need to revoke permission, the structure is almost identical to
granting it:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .25in;">
<br /></div>
<div class="MsoNormal" style="background: whitesmoke; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt; mso-line-height-alt: 12.0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; word-break: break-all;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 16.0pt; mso-fareast-font-family: "Times New Roman";">REVOKE [type of permission] ON [database name].[table name]
FROM ‘[username]’@‘localhost’;<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16pt;">Just as you can delete databases with DROP, you can use DROP to delete a
user altogether:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .25in;">
<br /></div>
<div class="MsoNormal" style="background: whitesmoke; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt; mso-line-height-alt: 12.0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; word-break: break-all;">
<span style="background: #F6F4F0; color: #444444; font-family: "Courier New"; font-size: 16.0pt; mso-fareast-font-family: "Times New Roman";">DROP USER ‘newuser@‘localhost’;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .25in;">
<br /></div>
<!--EndFragment--><br />
<br />
<br />
<div class="column">
</div>
</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com1tag:blogger.com,1999:blog-5839052578190286833.post-54867296781014485162013-10-27T09:16:00.001-07:002013-11-04T07:58:18.341-08:00Software Developer's Blog: Tagging Pictures! Complete Example Explained with ...<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://mahderjava.blogspot.com/2013/10/tagging-pictures-complete-example.html?spref=bl">Software Developer's Blog: Tagging Pictures! Complete Example Explained with ...</a>: Recently I have been getting many questions from my readers and former students asking me to develop and show how a picture tagging works ...</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com1tag:blogger.com,1999:blog-5839052578190286833.post-81450652222115057712013-10-27T09:14:00.004-07:002013-11-04T07:58:55.478-08:00Tagging Pictures! Complete Example Explained with jQuery and PHP<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
Recently I have been getting many questions from my readers and former students asking me to develop and show how a picture tagging works using jQuery and php. I have been using this functionality in one of my projects. Hence I decided to grab the codes and develop a quick app showing exactly how to tag a picture using jquery and php.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In this post, I will try to show how we can use jQuery and php to store tag values from a picture in to a database and show the tagged values to the page when the user hovers the mouse pointer to the picture that was tagged.</div>
<div style="text-align: justify;">
<br /></div>
For this case, I have use the following:<br />
<br />
1. php<br />
2. mysql<br />
3. jquery (you can grab the latest version from http://jquery.com/download/)<br />
4. netbeans IDE (you can use any compatible text editor)<br />
<br />
<div style="text-align: justify;">
I will try to provide different screen captures to show how the whole project is structured and developed.</div>
<div style="text-align: justify;">
<br /></div>
<b><span style="font-size: large;">Project Structure:</span></b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSJOX9rR9qU_F-b8nTkDVT7pWOpEv4EFQusvXWBXe1SwPRXdFH2QFmJSmz5lMsu71W_DofEg2IBiCdnysd-0tmk3wzIUZeqKZ6vCijVtedHth60-fw42B99N_cUAgQ-Luqjc8SODNvon8/s1600/Screen+Shot+2013-10-26+at+11.23.38+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSJOX9rR9qU_F-b8nTkDVT7pWOpEv4EFQusvXWBXe1SwPRXdFH2QFmJSmz5lMsu71W_DofEg2IBiCdnysd-0tmk3wzIUZeqKZ6vCijVtedHth60-fw42B99N_cUAgQ-Luqjc8SODNvon8/s1600/Screen+Shot+2013-10-26+at+11.23.38+PM.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: justify;">
As you can see from the above picture, I have categorized the different files under the appropriate folders.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In this project we have two classes and the class files are stored under a folder named "<b>Classes</b>".</div>
<div style="text-align: justify;">
<br /></div>
<b>classes</b> folder:<br />
<div style="text-align: justify;">
A. DBConnection.php: This class is used to establish a database connection and handles also writing and reading data to and from the table.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
B. NameTag.php: This class encapsulate the attributes that we are interested in saving to the database. This class is used to create instance of the NameTag class and then we can save data to the database table or read data from the table. This class in turn will communicate with DBConnection.php class to get its instances saved to the database or to get all name tag records saved for a particular image.</div>
<br />
<b>css</b> folder:<br />
<div style="text-align: justify;">
This folder is dedicated to containing any css related files. In our case the 'tag_style.css' which is an external css file is defined under this folder.</div>
<div style="text-align: justify;">
<br /></div>
<b>db_script</b> folder:<br />
<div style="text-align: justify;">
This folder is dedicated to store any .SQL file which you may have used in creating database, table and stored-procedures or other database related activities.</div>
<div style="text-align: justify;">
<br /></div>
<b>images</b> folder:<br />
<div style="text-align: justify;">
This folder should contain any image that the web app/site is using. In our case, I have grabbed a random picture from the internet for tagging purpose.</div>
<div style="text-align: justify;">
<br /></div>
<b>js</b> folder:<br />
<div style="text-align: justify;">
If you have any external .js (javascript) files you need to store them in a folder dedicated to hold all javascript files under such a folder. In this example, our jQuery library is saved under this folder.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The .php filers (index.php and savetag.php) are stored under the root folder. so if you type www.tagphoto.com then you will be redirected to www.tagphoto.com/index.php. You can modify this project structure as you wish. But you should always remember to organize your files under a self descriptive folders so when you come back later to maintain the application you don't waste a lot of time where each file is under.</div>
<div style="text-align: justify;">
<br /></div>
Now let us step by step see how the name tagging could be developed.<br />
<br />
<b>STEP 1: Database And Table Creation:</b><br />
The following picture shows the script I have used in creating the database and the table:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSVGmcyWUj2Bspc_cKSkrYp_Egg86mrVQ2FQ9i3W0KTk0n97Frd5nV0_q39vwsUwzXYJgNUaJdL3AnBVLNnzyZh0WbghYYDVrcVKmrTQW-j4uZwiiNO9v1mOP8tWd5eDBhzm0Ue1KAgtA/s1600/Screen+Shot+2013-10-27+at+11.41.24+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSVGmcyWUj2Bspc_cKSkrYp_Egg86mrVQ2FQ9i3W0KTk0n97Frd5nV0_q39vwsUwzXYJgNUaJdL3AnBVLNnzyZh0WbghYYDVrcVKmrTQW-j4uZwiiNO9v1mOP8tWd5eDBhzm0Ue1KAgtA/s400/Screen+Shot+2013-10-27+at+11.41.24+AM.png" width="400" /></a></div>
<br />
<div style="text-align: justify;">
<b>N.B</b>: I have made the person_name and image id columns to be unique for every record in table tbl_name_tag. The reason for this is, to avoid any identical name tagging in the same picture. For example if you develop this application and try to give the same name for more than one person in the example image, it will not be saved. If you want to have name duplicates in the same image, just simply ignore the line # 11.</div>
<div style="text-align: justify;">
<br /></div>
<b>STEP 2: Create the DBConnection File Under 'classes' folder:</b><br />
<br />
The content of this file is given as follows:<br />
<br />
<?php<br />
/**<br />
* Description of DBConnection<br />
*<br />
* @author Mahder<br />
*/<br />
class DBConnection {<br />
private static $DATABASE_NAME = 'db_photo_tagging';<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
/**<br />
* This method is used to establish a connection to the database<br />
* @return db connection<br />
*/<br />
public static function connect()<br />
{ <br />
$server = "localhost"; <br />
$username = "root";<br />
$password="root";<br />
$connection = mysql_pconnect($server, $username, $password);<br />
return $connection;<br />
}<br />
<br />
/**<br />
* This method is used to write data to the database (do action)<br />
* A wrapper method around the build in mysql_query() function.<br />
* @param type $query : SQL values passed from the caller methods<br />
* @return type: $result,<br />
*/<br />
public static function writeToDatabase($query)<br />
{<br />
$dbConnection = DBConnection::connect(); <br />
mysql_select_db(DBConnection::$DATABASE_NAME); <br />
$result = mysql_query($query); <br />
return $result;<br />
}<br />
<br />
/**<br />
*<br />
* @param type $query - Basically SQL SELECT statements from the caller<br />
* methods. This method in turn will call the writeToDatabase method. I<br />
* know the name does not make sense but basically we are using mysql_query...<br />
* @return type<br />
*/<br />
public static function readFromDatabase($query)<br />
{ <span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span> <br />
$result = DBConnection::writeToDatabase($query); <br />
return $result;<br />
}<br />
<br />
}//end class<br />
?><br />
<br />
<div style="text-align: justify;">
I have tried to add comments under each method. The only modification you need to do if you want to use this DBConnection class is, to just change the $username and $password values under the connect() method.</div>
<div style="text-align: justify;">
<br /></div>
<b>STEP 3: Create the Entity Class NameTag.php</b><br />
<b><br /></b>
<br />
<div style="text-align: justify;">
This is the representation of the underlying database table tbl_name_tag. Using this class we can save or read what ever values are stored in this table. The content of this file is given below:</div>
<div style="text-align: justify;">
<br /></div>
<?php<br />
<br />
/*<br />
* To change this template, choose Tools | Templates<br />
* and open the template in the editor.<br />
*/<br />
<br />
/**<br />
* Description of NameTag<br />
*<br />
* @author Mahder<br />
*/<br />
require_once 'DBConnection.php';<br />
class NameTag {<br />
private $id;<br />
private $personName;<br />
private $imageId;<br />
private $posTop;<br />
private $posLeft;<br />
<br />
function __construct($personName,$imageId, $posTop, $posLeft) {<br />
$this->personName = $personName;<br />
$this->imageId = $imageId;<br />
$this->posTop = $posTop;<br />
$this->posLeft = $posLeft;<br />
}<br />
<br />
public function getId() {<br />
return $this->id;<br />
}<br />
<br />
public function setId($id) {<br />
$this->id = $id;<br />
}<br />
<br />
public function getPersonName() {<br />
return $this->personName;<br />
}<br />
<br />
public function setPersonName($personName) {<br />
$this->personName = $personName;<br />
}<br />
<br />
public function getPosTop() {<br />
return $this->posTop;<br />
}<br />
<br />
public function setPosTop($posTop) {<br />
$this->posTop = $posTop;<br />
}<br />
<br />
public function getPosLeft() {<br />
return $this->posLeft;<br />
}<br />
<br />
public function setPosLeft($posLeft) {<br />
$this->posLeft = $posLeft;<br />
}<br />
<br />
public function getImageId() {<br />
return $this->imageId;<br />
}<br />
<br />
public function setImageId($imageId) {<br />
$this->imageId = $imageId;<br />
}<br />
<br />
<br />
public function saveNameTag(){<br />
try{<br />
$query = "insert into tbl_name_tag values(0,'$this->personName',<br />
'$this->imageId',$this->posTop,$this->posLeft)"; <br />
DBConnection::writeToDatabase($query);<br />
}catch(Exception $e){<br />
$e->__toString();<br />
}<br />
}<br />
<br />
public static function getAllNameTagsForImage($imageId){<br />
$nameTags = null;<br />
try{<br />
$query = "select * from tbl_name_tag where image_id = '$imageId'";<br />
$result = DBConnection::readFromDatabase($query);<br />
if($result != null){ <br />
$nameTags = $result;<br />
}<br />
}catch(Exception $e){<br />
$e->__toString();<br />
} <br />
return $nameTags;<br />
}<br />
<br />
}//end class<br />
<br />
?><br />
<div>
<br /></div>
<div>
<b>STEP 4: Add the Appropriate Files Under Their Respective Folders.</b></div>
<div>
<b><br /></b></div>
<div style="text-align: justify;">
As described under the project structure section, you are supposed to put the different files the project uses in the folder created for holding them. Please download the latest jquery library from the internet. You can use any picture you can get from the internet that can be used for tagging. e.g group of people, animals, objects etc.</div>
<div style="text-align: justify;">
<br /></div>
<div>
The following picture shows the content of the CSS file I have used for this project.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9QRQuSq3c-DXeMboi-GdMGxEwGKciFNnnO9JqKJTriEe2sIwEi4FuC8lFS_M_9iscAx6LgQMDYfGHd7m1s7YG3ghv9qJcfhH4wskJwcoDSe-s0a1uz9a2QRKVhGIXVvW2q7O3gDCrY5E/s1600/Screen+Shot+2013-10-27+at+11.53.47+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9QRQuSq3c-DXeMboi-GdMGxEwGKciFNnnO9JqKJTriEe2sIwEi4FuC8lFS_M_9iscAx6LgQMDYfGHd7m1s7YG3ghv9qJcfhH4wskJwcoDSe-s0a1uz9a2QRKVhGIXVvW2q7O3gDCrY5E/s400/Screen+Shot+2013-10-27+at+11.53.47+AM.png" width="367" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<br /></div>
<div>
<b>STEP 5: Create the index.php and savetag.php Files</b></div>
<div>
<b><br /></b></div>
<div>
The two files are important and I will try to show the contents of each file here with.</div>
<div>
<br /></div>
<div>
<div>
<!--import the jQuery lib from the js folder--></div>
<div>
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script></div>
<div>
<!--link the document with the css file (external css)--></div>
<div>
<link href="css/tag_style.css" rel="stylesheet" type="text/css"/></div>
<div>
<html></div>
<div>
<head></div>
<div>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></div>
<div>
<title></title></div>
<div>
</head></div>
<div>
<body></div>
<div>
<?php</div>
<div>
require_once 'classes/NameTag.php';</div>
<div>
//you can have more than one image in a page, so bring all the tagas</div>
<div>
//for a particular image only.</div>
<div>
$nameTags = NameTag::getAllNameTagsForImage('imgtag');</div>
<div>
</div>
<div>
while($nameTagsRow = mysql_fetch_object($nameTags)){</div>
<div>
$personName = $nameTagsRow->person_name;</div>
<div>
$posTop = $nameTagsRow->pos_top;</div>
<div>
$posLeft = $nameTagsRow->pos_left;</div>
<div>
?></div>
<div>
<!--Position the div according to the value in the database--></div>
<div>
<div id='taggedPic' style="top:<?php echo $posTop;?>;left:<?php echo $posLeft;?>"></div>
<div>
<?php</div>
<div>
echo $personName;</div>
<div>
?></div>
<div>
</div></div>
<div>
<?php</div>
<div>
}//end while...loop</div>
<div>
</div>
<div>
?></div>
<div>
<img src='images/tagpicture.png' border='0'name='imgtag' id='imgtag'/></div>
<div>
<!--the hidden text field is used to hold the clicked pic id value--></div>
<div>
<input type="hidden" name="hiddenimageid" id="hiddenimageid"/></div>
<div>
<div></div>
<div>
<input type='text' name='txtname' id='txtname'/></div>
<div>
</div></div>
<div>
</body></div>
<div>
</html></div>
<div>
<br /></div>
<div>
<script type="text/javascript"></div>
<div>
$(document).ready(function(){</div>
<div>
</div>
<div>
$('#imgtag').click(function(e){</div>
<div>
//get the x and y coordinates of the click on the image</div>
<div>
var posTop = e.clientY;</div>
<div>
var posLeft = e.clientX;</div>
<div>
//get the id value of the clicked image</div>
<div>
var imageId = $(this).attr('id');</div>
<div>
//store the imageId in the hidden text field component</div>
<div>
$('#hiddenimageid').val(imageId);</div>
<div>
//adjust the location (css attribute) of text field via jquery</div>
<div>
$('#txtname').css('top',posTop-10).css('left',posLeft-20);</div>
<div>
//after adjusting show and put the cursor inside the text field</div>
<div>
$('#txtname').show().focus();</div>
<div>
});//end imgtag click</div>
<div>
</div>
<div>
$('#txtname').keyup(function(e){</div>
<div>
//check if the pressed and release key is 'Enter' key</div>
<div>
if(e.keyCode === 13){</div>
<div>
//get the values of txtname content, top left point x and y coordinate</div>
<div>
var personName = $(this).val();</div>
<div>
var posTop = $(this).position().top;</div>
<div>
var posLeft = $(this).position().left;</div>
<div>
//contains the hidden image id of the image you are tagging</div>
<div>
var imageId = $('#hiddenimageid').val();</div>
<div>
var dataString = "personName="+personName+"&posTop="+</div>
<div>
posTop+"&posLeft="+posLeft+"&imageId="+imageId;</div>
<div>
//when enter key is released save data to database...</div>
<div>
$.ajax({</div>
<div>
type:'POST',</div>
<div>
data:dataString,</div>
<div>
url:'savetag.php',<span class="Apple-tab-span" style="white-space: pre;"> </span> </div>
<div>
success:function(data) {</div>
<div>
//after saving refresh the page </div>
<div>
location.reload();</div>
<div>
}</div>
<div>
}); </div>
<div>
</div>
<div>
}//end if</div>
<div>
});//end keyup function</div>
<div>
</div>
<div>
});//end document.ready</div>
<div>
</script></div>
</div>
<div>
<br /></div>
<div>
The content of savetag.php is shown below in the figure:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9K405kK9Xj-d4ZFhiY6LugSvyJVX332EiNyTXr25UZ5CPm9z2blN-pYDJ2oI3qfz18xIZzD6mF7QhGMCDfsrhuDSJFnoDyMkfEdZmmwqFRk9RvhCDumLUL2jQ_dUEIzaQgYwHS44CFHQ/s1600/Screen+Shot+2013-10-27+at+11.58.19+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="144" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9K405kK9Xj-d4ZFhiY6LugSvyJVX332EiNyTXr25UZ5CPm9z2blN-pYDJ2oI3qfz18xIZzD6mF7QhGMCDfsrhuDSJFnoDyMkfEdZmmwqFRk9RvhCDumLUL2jQ_dUEIzaQgYwHS44CFHQ/s640/Screen+Shot+2013-10-27+at+11.58.19+AM.png" width="640" /></a></div>
<div>
<br /></div>
<div style="text-align: justify;">
As you can see from the picture, this file gets the values sent from the jQuery.ajax call and stores them in a variable. ($personName,$posTop,$posLeft and $imageId).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Then using these variables, it creates an object from NameTag class and calls the saveNameTag() method to save the values to the database.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
If you combine the above files in the order described in this post, you should be able to see the following out put window.</div>
<div style="text-align: justify;">
<br /></div>
<div>
1. When you run the project, you will see the index page showing the sample picture</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFb1zabaNZCqiIRB3KGDQ9uE9fIPqX3dxD-aLTTN5-7itnKiIouHLbqkxeDMnlPnId_ybcCcVbi6ymxeZM7-jPiCikiJ9h0iifvBkiRfga879AeuYispQ6zQ5YVFtiQNOcbZ3PkazXeHo/s1600/Screen+Shot+2013-10-27+at+12.01.22+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="392" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFb1zabaNZCqiIRB3KGDQ9uE9fIPqX3dxD-aLTTN5-7itnKiIouHLbqkxeDMnlPnId_ybcCcVbi6ymxeZM7-jPiCikiJ9h0iifvBkiRfga879AeuYispQ6zQ5YVFtiQNOcbZ3PkazXeHo/s640/Screen+Shot+2013-10-27+at+12.01.22+PM.png" width="640" /></a></div>
<div>
<br /></div>
<div>
2. Try clicking on one person:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyegJKvtycbsr7stc91-LzL5y2Hx1_52b4-h-Zr4e6CqsDVId9NPV3oYbYnZZqbsWLX6Cpfk_xApMsFvAd97_H-qnisYerX2fGH_oLB30HqkLvJ4jT_iWLLsE20iXAB0DhY3GCNclqof4/s1600/Screen+Shot+2013-10-27+at+12.03.52+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="328" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyegJKvtycbsr7stc91-LzL5y2Hx1_52b4-h-Zr4e6CqsDVId9NPV3oYbYnZZqbsWLX6Cpfk_xApMsFvAd97_H-qnisYerX2fGH_oLB30HqkLvJ4jT_iWLLsE20iXAB0DhY3GCNclqof4/s640/Screen+Shot+2013-10-27+at+12.03.52+PM.png" width="640" /></a></div>
<div>
As you can see I have clicked on the first person (left extreme) and the text box is showing ready to take the name of the person. Try typing name value and press the enter key. You should get the next picture when you hover the mouse on the exact location you have tagged the person.</div>
<div>
<br /></div>
<div>
3. Types a Name on the Picture and After saving Moved mouse pointer to tag location:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYpDtVGT-Z8AXoL28Dji9HMxQqzTt7Y1vlZjB2hQprKXtXYUf3q0Gec7NC4zognnmTGVi1W-uSO6ngSrJf6WX02DE6l_Xkf0_22Vu8dGSO_dB-wjYQbAcH7YWgtRgfhF6kk9_L7xuzOD0/s1600/Screen+Shot+2013-10-27+at+12.07.04+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYpDtVGT-Z8AXoL28Dji9HMxQqzTt7Y1vlZjB2hQprKXtXYUf3q0Gec7NC4zognnmTGVi1W-uSO6ngSrJf6WX02DE6l_Xkf0_22Vu8dGSO_dB-wjYQbAcH7YWgtRgfhF6kk9_L7xuzOD0/s640/Screen+Shot+2013-10-27+at+12.07.04+PM.png" width="640" /></a></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL5TLXkaoMdYvw1cQ83w_D6YIFZOAywklqKmO7dS1vunOTlfGaWM2vbOGhlCOwo2NQPVPNlxekQyh3ALfW56-Y4COYvGhD6I6Fcpo0UWCtsmR0nffB0p3okpxbLqDEm27f9QNdKklHxKk/s1600/Screen+Shot+2013-10-27+at+12.08.13+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="334" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL5TLXkaoMdYvw1cQ83w_D6YIFZOAywklqKmO7dS1vunOTlfGaWM2vbOGhlCOwo2NQPVPNlxekQyh3ALfW56-Y4COYvGhD6I6Fcpo0UWCtsmR0nffB0p3okpxbLqDEm27f9QNdKklHxKk/s640/Screen+Shot+2013-10-27+at+12.08.13+PM.png" width="640" /></a></div>
<div style="text-align: justify;">
This is how you can simple use jQuery and PHP to create your own tagging app. Feel free to customize the code in whatever way you would like to use. You might also want to modify this code if</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1. You have more than one taggable image in a single page or</div>
<div>
2. If the user uploads the picture and wants to tag the uploaded picture.</div>
<div>
<br /></div>
<div style="text-align: justify;">
The basic is very similar and I am sure if you have made it this far, you can do your own imagination and creativity to this code.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I hope this will be of importance to some one out there. If you have any question or comment about this post, plz add your comments below or use my email <i>mahderalem@gmail.com</i>. </div>
<div style="text-align: justify;">
<br /></div>
<div>
Thanks,</div>
<div>
Mahder</div>
</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com1tag:blogger.com,1999:blog-5839052578190286833.post-87511398505688948982013-10-25T12:39:00.000-07:002015-02-04T06:01:59.542-08:00Learning SQL Everyday: Day 1<div dir="ltr" style="text-align: left;" trbidi="on">
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Revision>0</o:Revision>
<o:TotalTime>0</o:TotalTime>
<o:Pages>1</o:Pages>
<o:Words>651</o:Words>
<o:Characters>3716</o:Characters>
<o:Company>Echo Origin</o:Company>
<o:Lines>30</o:Lines>
<o:Paragraphs>8</o:Paragraphs>
<o:CharactersWithSpaces>4359</o:CharactersWithSpaces>
<o:Version>14.0</o:Version>
</o:DocumentProperties>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>JA</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
<w:UseFELayout/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="276">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]-->
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}
</style>
<![endif]-->
<!--StartFragment-->
<br />
<div class="MsoNormal">
<span style="font-family: Verdana; font-size: 20.0pt; mso-bidi-font-family: Verdana;">What is SQL?<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">SQL is a standard language for accessing databases. SQL lets you
access and manipulate databases<o:p></o:p></span><br />
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKnv8Wp-XgrHGh2_jSAik9DYI47H0h3r5UM-hVspI7CpRRugWgu_MX5BXQ3UKjG1rA98BqO8VBxqp4wN0TXYaWyhe0cIgE7MSsy2kSkcpQ8Lz89IUVHLXpxu8PYOqao4tfI2ZQZaByEso/s1600/sql.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKnv8Wp-XgrHGh2_jSAik9DYI47H0h3r5UM-hVspI7CpRRugWgu_MX5BXQ3UKjG1rA98BqO8VBxqp4wN0TXYaWyhe0cIgE7MSsy2kSkcpQ8Lz89IUVHLXpxu8PYOqao4tfI2ZQZaByEso/s1600/sql.jpeg" /></a></div>
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">SQL is the de facto standard language used to manipulate
and retrieve data from these relational databases. SQL enables a programmer or
database administrator to do the following:<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-layout-grid-align: none; mso-list: l0 level1 lfo1; mso-pagination: none; text-autospace: none; text-indent: -.25in;">
<br />
<ul style="text-align: left;">
<li><span style="color: #313131; font-family: Symbol; font-size: 13pt; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="color: #313131; font-family: Verdana; font-size: 13pt; text-indent: -0.25in;">Modify a database's structure</span></li>
<li><span style="color: #313131; font-family: Symbol; font-size: 13pt; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="color: #313131; font-family: Verdana; font-size: 13pt; text-indent: -0.25in;">Change system security settings</span></li>
<li><span style="color: #313131; font-family: Symbol; font-size: 13pt; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="color: #313131; font-family: Verdana; font-size: 13pt; text-indent: -0.25in;">Add user permissions on databases or tables</span></li>
<li><span style="color: #313131; font-family: Symbol; font-size: 13pt; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="color: #313131; font-family: Verdana; font-size: 13pt; text-indent: -0.25in;">Query a database for information</span></li>
<li><span style="color: #313131; font-family: Symbol; font-size: 13pt; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="color: #313131; font-family: Verdana; font-size: 13pt; text-indent: -0.25in;">Update the contents of a database</span></li>
</ul>
<!--[if !supportLists]--></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Verdana; font-size: 18.0pt; mso-bidi-font-family: Verdana;">RDBMS<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 13.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">RDBMS stands for Relational Database Management System.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 13.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">RDBMS is the basis for SQL, and for all modern database
systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 13.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">The data in RDBMS is stored in database objects called
tables.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">A table is a collection of related data entries and it
consists of columns and rows.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Verdana; font-size: 18.0pt; mso-bidi-font-family: Verdana;">Popular SQL Implementations<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">This section introduces some of the more popular
implementations of SQL, each of which has its own strengths and weaknesses.
Where some implementations of SQL have been developed for PC use and easy user
interactivity, others have been developed to accommodate very large databases
(VLDB).<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Verdana; font-size: 18.0pt; mso-bidi-font-family: Verdana;">Microsoft Access<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">We use Microsoft Access, a PC-based DBMS, to illustrate
some of the examples in this text. Access is very easy to use. You can use GUI
tools or manually enter your SQL</span> <span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">statements.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Verdana; font-size: 18.0pt; mso-bidi-font-family: Verdana;">Oracle<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">We use Oracle, which represents the larger corporate
database world, to demonstrate command-line SQL and database management
techniques. (These techniques are important because the days of the standalone
machine are drawing to an end, as are the days when knowing one database or one
operating system was enough.) In command-line RE l, simple stand+[cedilla] one
SQL statements are entered into Oracle's SQL*Plus tool. This tool then returns
data to the screen for the user</span> <span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">to see, or it performs the
appropriate action on the database.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">Most examples are directed toward the beginning
programmer or first-time user of SQL. We begin with the simplest of SQL
statements and advance to the topics of transaction management and stored
procedure programming. The Oracle RDBMS is distributed with a full complement
of development tools. It includes a C++ and Visual Basic language library
(Oracle Objects for OLE) that can link an application to a Personal Oracle
database. It also comes with graphical tools for database, user, and object
administration, as well as the SQL*Loader utility, which is used to import and
export data to and from Oracle.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">MySQL<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 10.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">MySQL, the most popular Open Source SQL database
management system, is developed, distributed, and supported by Oracle
Corporation.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">The MySQL Web site (http://www.mysql.com/) provides the
latest information about MySQL software.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">And all the examples we will have in each coming posts
will be using MySQL DBMS.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Verdana; font-size: 18.0pt; mso-bidi-font-family: Verdana;">Q&A<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;">
<span style="color: red; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">Q</span><span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">: Why should I
be concerned about SQL?<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: green; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">A</span><span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">: Until recently, if you weren't
working on a large database system, you probably had only a passing knowledge
of SQL. With the advent of client/server development tools (such as Visual
Basic, Visual C++, ODBC, Borland's Delphi, and Powersoft's PowerBuilder) and
the movement of several large databases (Oracle and Sybase) to the PC platform,
most business applications being developed today require a working knowledge of
SQL.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: red; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">Q</span><span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">: Why do I need to know anything
about relational database theory to use SQL? <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: green; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">A</span><span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">: SQL was developed to service
relational databases. Without a minimal understanding of relational database
theory, you will not be able to use SQL effectively except in the most trivial
cases.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: red; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">Q</span><span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">: All the new GUI tools enable me
to click a button to write SQL. Why should I spend time learning to write SQL
manually?<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: green; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">A</span><span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">: GUI tools have their place, and
manually writing SQL has its place. Manually written SQL is generally more
efficient than GUI-written SQL. Also, a GUI SQL statement is not as easy to
read as a manually written SQL statement. Finally, knowing what is going on
behind the scenes when you use GUI tools</span> <span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">will help you get the most
out of them.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: red; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">Q</span><span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">: So, if SQL is standardized,
should I be able to program with SQL on any databases?<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;">
<span style="color: green; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">A</span><span style="color: #313131; font-family: Verdana; font-size: 13.0pt; mso-bidi-font-family: Verdana;">: No, you will be able to program
with SQL only on RDBMS databases that support SQL, such as MS-Access, Oracle,
Sybase, and Informix. Although each vendor's implementation will differ
slightly from the others, you should be able to use SQL with very few
adjustments.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 12.0pt; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<!--EndFragment--></div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-60797298260684606572013-10-25T08:56:00.001-07:002013-11-04T08:00:15.047-08:00Debugging Made Easy for PHP Developers<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjPbozUewPoD66ej9TW_AWc0oV3T_MKqXkDACxPGmG8CgZu8W7zhsPxmVy2E2dUtEioJn3ZrPLDK3Q9HC6TahARk8ya52Py7fRT6CmRIZzpGk1g8XXENGXz4EzyowfgK0cFN1QhGK6-t4/s1600/php1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="208" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjPbozUewPoD66ej9TW_AWc0oV3T_MKqXkDACxPGmG8CgZu8W7zhsPxmVy2E2dUtEioJn3ZrPLDK3Q9HC6TahARk8ya52Py7fRT6CmRIZzpGk1g8XXENGXz4EzyowfgK0cFN1QhGK6-t4/s320/php1.png" width="320" /></a></div>
<br />
For someone, with Java background it is quite irritating to notice that you cant display values to console while using PHP. Debugging in php is usually done using the built in php function error_log. This built in function assumes the following parameters.<br />
<br />
error_log(error, type, destination);<br />
<br />
The parameters are discussed as follows:<br />
<br />
1. error: The error message to log<br />
2. type: Specifies the error log type. The type assumes one of the following values:<br />
0: error is sent to the server error logging system.<br />
1: the error is sent via email specified in the destination parameter.<br />
2: the error is sent through the PHP debugging connections. (only available in PHP3)<br />
3. the error is sent to the file specified in the destination parameter.<br />
<br />
Recently I have been getting many questions about how to log (program output/errors) locally. Hence I have decided to prepare a short code showing how to and add it in this blog.<br />
<br />
Basically what I have done is create a small wrapper class that uses the built in php error_log function.<br />
Assume we have the following folder structure:<br />
<br />
project-root/lib/PHPDebug.php<br />
<br />
N.B. project-root is the folder of your project. For instance, if you are creating a payrolapp then the project-roo will be something like<br />
<br />
payrolapp/lib/PHPDebug.php<br />
<br />
And if you have a /pages folder where you put your php page file<br />
<br />
payrolapp/pages/....<br />
<br />
So what we are trying to do here is, we are trying to access the PHPDebug class from one of the pages we have under the /pages folder.<br />
<br />
Assume we have just created a ShowAllPayrolDataForEmployees.php page under the pages folder, and we opened that file, the code's content will look something like<br />
<br />
<?php<br />
.....<br />
.....<br />
require_once('../lib/PHPDebug.php');//go up one step and look for a file called PHPDebug.php in the //lib folder<br />
<br />
$netIncome = $grossPymt - $deductions;<br />
.....<br />
//now to print out the value of $netIncome variable, you could use something like<br />
PHPDebug::printLogText("Net Income : ".$netIncome,"../lib/debug.txt");<br />
//here we are calling the static method printLogText of class PHPDebug. The //printLogText(String,String) takes two parameters.<br />
//parameter 1. Is the error message you want to be printed in the error log file<br />
//parameter 2. Is the location and name of the file<br />
?><br />
<br />
And the content of the PHPDebug.php looks like:<br />
<br />
<br />
<?php<br />
class PHPDebug{<br />
public static function printLogText($text,$fileName){ <br />
if (file_exists($fileName)){<br />
error_log($text,3,$fileName);<br />
}else{<br />
error_log("Error locating the file [$fileName]",3,$fileName);<br />
}<br />
}<br />
}//end class<br />
?><br />
<br />
Before using the printLogText(string,string) method, make sure you have created the file in the location you want it to be.<br />
<br />
In the above example, we assume we have created the file 'debug.txt' under the /lib folder. So when calling the method, we always pass the file where the log is going to be stored.<br />
<br />
N.B. You can have multiple files in different folders and by just passing the exact file location and name, you can re-use the same method over and over aging to print out the log values.<br />
<br />
This method will make sure if the file exist in the specified location and will open and save some values to it if only it exists. Otherwise, it should not break your code even if the file does not exist.<br />
<br />
This is a very simple and local remedy to help you while debugging in php. Hope it will be of some help for some one out there.</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-50401955353796164752013-08-04T11:18:00.001-07:002013-08-04T11:18:05.095-07:00Steve Jobs building NeXT<iframe allowfullscreen="" frameborder="0" height="344" src="//www.youtube.com/embed/WHsHKzYOV2E" width="459"></iframe>Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-43128475810971807622013-04-26T09:09:00.001-07:002013-11-04T08:00:44.165-08:00Software Developer's Blog: Wordpress Security<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://www.rasfasil.com/" target="_blank">Source blog address:</a><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyCFU_zdV7-DX5Dk9G9QP9Ww78_9gGyxoZfJSMy8wy2oETQCCwnvu_6tz_BSlW-PfxuOpowUxJXf66vKK3TQ0qZUl1UEkQZdQJ2YXKDkbpee2rs0WCTJGFJECIewoB85kH1nQp5aeNmOE/s1600/wordpress.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyCFU_zdV7-DX5Dk9G9QP9Ww78_9gGyxoZfJSMy8wy2oETQCCwnvu_6tz_BSlW-PfxuOpowUxJXf66vKK3TQ0qZUl1UEkQZdQJ2YXKDkbpee2rs0WCTJGFJECIewoB85kH1nQp5aeNmOE/s1600/wordpress.jpg" /></a></div>
<br />
<a href="http://mahderjava.blogspot.com/2013/04/wordpress-security.html?spref=bl">Software Developer's Blog: Wordpress Security</a>: Here is a post which i have found very important and a must to read. The post was made by one of my dear friend Fasil Girma. I hope you wi...</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-71177030864608454772013-04-26T09:08:00.004-07:002018-02-14T12:59:16.367-08:00Wordpress Security<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">Here is a post which i have found very important and a must to read. The post was made by one of my dear friend Fasil Girma. I hope you will enjoy his advise about wordpress site security.</span></div>
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<br />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">In this post I am basically going to focus on securing a WordPress website </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">and what to do if you get hacked. But the tips included are also useful </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">for any non WordPress website. So I encourage you to keep on reading even </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">if you don't know anything about WordPress <</span><a href="http://www.wordpress.org/" style="background-color: white; color: #1155cc; font-family: arial, sans-serif;" target="_blank">http://www.wordpress.org/</a><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">> .</span></div>
<div style="text-align: justify;">
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">WordPress isn't to blame!</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">In my very early days of web designing one of my client's website got </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">hacked and I had to explain to my client that it was due to WordPress' </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">weak security. I now feel very ashamed of that incident. But I am not </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">alone when it comes to such generalizations on WordPress' security. Most </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">beginning developers don't go further down the road securing their website </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">after setting it up and uploading it onto the "world wild web". They just </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">expect WordPress to be an angel and magically guard their site against all </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">evil on the web. Yes, they don't even pray. But WordPress isn't to blame.</span></div>
<div style="text-align: justify;">
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"></span><br />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">Below I will show you five simple tips how you can lock your WordPress website against most possible threats on the web.</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">
</span><br />
<div style="text-align: justify;">
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">1. Look for hosts with experience hosting WordPress website.</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">This can be your first step towards securing your website. All the coming </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">security measures that we're going to discuss below won't do you good if </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">you don't have a reliable hosting company. It's like ordering the best </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">meal of the poorest restaurant in town. You worry about the food after </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">choosing the restaurant. Some good qualities you should look in a </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">potential hosting company are: solid support, transparency and </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">communication, regular backups and runs the latest technology.</span></div>
<div style="text-align: justify;">
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">I recommend Dreamhost <</span><a href="http://dreamhost.com/" style="background-color: white; color: #1155cc; font-family: arial, sans-serif; text-align: -webkit-auto;" target="_blank">http://dreamhost.com/</a><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">> for the above reasons and </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">from my own experience.</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">2. Update WordPress, themes, and plugins. </span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">Most hackers use the advantage of security flaws in different themes and </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">plugins so make sure you don't include these in your site before checking </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">how widely they are used and their reputation. Also make sure they are </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">continuously updated by their authors. WordPress gets updated regularly; </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">hence, your website should as well. But always backup before you update </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">anything. In case anything goes wrong you can restore your old website </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">till you figure out what went wrong.</span></div>
<div style="text-align: justify;">
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">always backup before you update anything!</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">3. Grant users the minimum privilege they need to do their job.</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">Take care when you give your website's users the "Administrator" privilege </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">because that will make them access every part of the website. You might </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">think a well-trained user wouldn't do much damage. That might be true but</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"></span><br />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">what if that user's password has been compromised? So if you decide to give an Administrator privilege make sure you use a different username other than the default "Admin" username. When you use the "Admin"</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">
</span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"><div style="text-align: justify;">
username, hackers are half way through to break your site. Now they only have to guess your password. Also make sure you use a strong password that includes alphabets (both lower and uppercase), numbers and characters. Use different and strong password for every site login. And you're encouraged to change your password once a month.</div>
</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">4. Lock down the WordPress admin dashboard (/wp-admin) using an </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">.htaccess.</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">This will make your admin dashboard invisible to the whole world. You can </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">make you dashboard accessible from a certain IP address, say for example, </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">your office computer. And all other devices trying to access this admin</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"></span><br />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">area won't be able to access it, since they'll have a different IP address. Just create an .htaccess file in your /wp-admin folder and add the following lines to it:</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">
</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">AuthUserFile /dev/null</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">AuthGroupFile /dev/null</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">AuthName "Access Control"</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">AuthType Basic</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">order deny,allow</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">deny from all</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">#IP address to Whitelist</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">allow from 149.149.149.149</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">This will make </span><a href="http://your-site.com/wp-admin" style="background-color: white; color: #1155cc; font-family: arial, sans-serif; text-align: -webkit-auto;" target="_blank">http://your-site.com/wp-admin</a><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"> only accessible from the IP </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">address 149.149.149.149 and other requests to access this page from other </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">IP addresses will not be served by the web server.</span></div>
<div style="text-align: justify;">
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"></span><br />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">5. Ensure that the permissins on wp-config.php are not world readable especially in a shared hosting environment.</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">
</span><br />
<div style="text-align: justify;">
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">WordPress' wp-config.php file contains key configuration information about </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">your website, like: database connection, authentication, and path to </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">WordPress. And you don't want to tempt hackers by giving them everything </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">they need to have to hack into your website in just one file, </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">wp-config.php. So changing the file permission of this special file, </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">wp-config.php, is not an option. Each server configuration requires</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"></span><br />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">different file permissions but most of the time 600 should work for the wp-config.php. You can use your ftp client to change the file permission of any file on your server.</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">
</span><br />
<div style="text-align: justify;">
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">What to do when you get hacked?</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<div style="text-align: justify;">
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"></span><br />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Take the site offline. Now. That way you avoid getting a bad rap from search engines and antivirus programs.</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">
</span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"><div style="text-align: justify;">
* Let your web host know what happened. </div>
</span><br />
<div>
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Make a full backup of the infected site. It's helpful for </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">reviewing what happened and in case you mess up something during the </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">repair.</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"></span><br />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Change all of your passwords and the authentication keys in the wp-config.php.</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">
</span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"><div style="text-align: justify;">
* Remove any old themes, plugins, and unused code from your server.</div>
</span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"><div style="text-align: justify;">
* Update all code on your server. Re-install WordPress so all of the</div>
</span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"><div style="text-align: justify;">
Word-Press files are overwritten with fresh copies. </div>
</span></div>
<div>
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Reinstall themes or plugins with fresh copies to make sure no </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">malicious code was inserted.</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"></span><br />
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Check that the file permissions on your files are correct, especially wp-config.php and uploads.</span></div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">
</span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"><div style="text-align: justify;">
* Remove the rogue code and make sure you check all sites on your hosting account. There are tools that can help scan and clean the infection such as VaultPress <<a href="http://vaultpress.com/" style="color: #1155cc;" target="_blank">http://vaultpress.com/</a>> . Exploit Scanner</div>
</span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"><div style="text-align: justify;">
also scans for certain exploits.</div>
</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* If you don't have the ability to fix the infected files the best </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">thing to do is restore from a recent clean backup.</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Check your server access logs. Search for any bad file names that </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">you found on your server, patterns passed as query strings, or dates/times </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">that may clue you in to when the attack happened.</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">Conclusion</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">To Secure your WordPress website:</span><br />
<br style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;" />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Look for hosts with experience hosting WordPress website.</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Update WordPress, themes, and plugins.</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Grant users the minimum privilege they need to do their job.</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Lock down the WordPress admin dashboard (/wp-admin) using an </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">.htaccess.</span><br />
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">* Ensure that the permissins on wp-config.php are not world readable </span><span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">especially in a shared hosting environment.</span></div>
<div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">Thank you fasil for such a wonderful read! Hope for so many more to come soon!</span></div>
<div>
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="background-color: white; color: #222222; font-family: "arial" , sans-serif;">If you would like further information, may be ask the author or read other similar posts by this author, you could visit his blog at </span>http://rasfasil.com/wordpress-website-security/</div>
</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com4tag:blogger.com,1999:blog-5839052578190286833.post-3102748850369986812013-04-19T17:24:00.001-07:002013-11-04T08:01:17.119-08:00Software Developer's Blog: What is Multithreading in Java?<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://mahderjava.blogspot.com/2013/04/what-is-multithreading-in-java.html?spref=bl">Software Developer's Blog: What is Multithreading in Java?</a>: Multithreading is a process of executing multiple threads simultaneously. So at this point we will ask our selves what a thread i...</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-20274320235324818302013-04-18T19:30:00.001-07:002013-04-18T21:06:13.419-07:00Software Developer's Blog: What is so Special About HTML5?<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://mahderjava.blogspot.com/2013/04/what-is-so-special-about-html.html?spref=bl">Software Developer's Blog: What is so Special About HTML?</a>: HTML5 is a markup language for structuring and presenting content for the World Wide Web and a core technology of the Internet ...</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-65938186228765005612013-04-18T19:29:00.000-07:002013-04-18T21:09:42.358-07:00What is so Special About HTML5?<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="line-height: 0.17in; margin-bottom: 0in; text-align: justify;">
<a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="cite_ref-HTML5-20110405_2-0"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="cite_ref-3"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="cite_ref-HTML5-20110405_2-1"></a>
<span style="color: black;"><span style="font-family: sans-serif;"><b>HTML5</b></span></span><span style="color: black;"> </span><span style="color: black;"><span style="font-family: sans-serif;">is
a </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">markup
language</span></span></span></span><span style="color: black;"> </span><span style="color: black;"><span style="font-family: sans-serif;">for
structuring and presenting content for the </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">World
Wide Web</span></span></span></span><span style="color: black;"> </span><span style="color: black;"><span style="font-family: sans-serif;">and
a core technology of the </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">Internet</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;">.
It is the fifth revision of the </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">HTML</span></span></span></span><span style="color: black;"> </span><span style="color: black;"><span style="font-family: sans-serif;">standard
(created in 1990 and standardized as HTML 4 as of 1997)</span></span><span style="color: black;"> </span><span style="color: black;"><span style="font-family: sans-serif;">and,
as of December 2012, is a </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">W3C
Candidate Recommendation</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;">.</span></span><span style="color: black;"> </span><span style="color: black;"><span style="font-family: sans-serif;">Its
core aims have been to improve the language with support for the
latest multimedia while keeping it easily readable by humans and
consistently understood by computers and devices (</span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">web
browsers</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;">, </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">parsers</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;">,
etc.). HTML5 is intended to subsume not only </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">HTML 4</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;">,
but also </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">XHTML</span></span></span></span><span style="color: black;"> </span><span style="color: black;"><span style="font-family: sans-serif;">1
and </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">DOM
Level 2 HTML</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;">.</span></span><br />
<span style="color: black;"><span style="font-family: sans-serif;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4lAjQyjGlUW2luGYBTGqqFzMon2vkaVqfPk8t2H887mwHONG8CFfkjf41p7vI4S5imY6VBOwB4_g2GuQSGhtbgAdxaE_jAT3TZK3Bhb1UkXse13KEd7tA9o6ykOym-tpdLeSosVXefWM/s1600/html5.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4lAjQyjGlUW2luGYBTGqqFzMon2vkaVqfPk8t2H887mwHONG8CFfkjf41p7vI4S5imY6VBOwB4_g2GuQSGhtbgAdxaE_jAT3TZK3Bhb1UkXse13KEd7tA9o6ykOym-tpdLeSosVXefWM/s1600/html5.jpeg" /></a></div>
<span style="color: black;"><span style="font-family: sans-serif;"><br /></span></span></div>
<div style="line-height: 0.17in; margin-bottom: 0in; text-align: justify;">
<span style="color: black;"><span style="font-family: sans-serif;"><br /></span></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: inherit;"><b>Five Things You Should Know About HTML
5</b></span></div>
<ol>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"><b><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="one"></a><span style="color: black;"><span style="font-size: medium;">It’s
not one big thing</span></span></b></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><span style="color: black;"> </span><span style="color: black;">is
not one big thing; it is a collection of individual features. So you
can’t detect “ support,” because that doesn’t make any
sense. But you </span><em><span style="color: black;"><span style="font-style: normal;">can</span></span></em><span style="color: black;"> detect
support for individual features, like canvas, video, or geolocation. </span><span style="color: black; line-height: 0.25in;">You
may think of as tags and angle brackets. That’s an
important part of it, but it’s not the whole story.
The specification also defines how those angle brackets
interact with JavaScript, through the Document Object Model
(). doesn’t just define a </span><code style="line-height: 0.25in;"><span style="color: black;"><video></span></code><span style="color: black; line-height: 0.25in;"> tag;
there is also a corresponding for video objects in
the . You can use this to detect support for
different video formats, play a video, pause, mute audio, track how
much of the video has been downloaded, and everything else you need
to build a rich user experience around the </span><code style="line-height: 0.25in;"><span style="color: black;"><video></span></code><span style="color: black; line-height: 0.25in;"> tag
itself.</span></span></div>
</li>
</ol>
<ol>
<div style="margin-bottom: 0in;">
</div>
</ol>
<ol start="2">
<li><div style="margin-bottom: 0in; text-align: justify;">
<span style="font-family: inherit;"><b><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="two"></a><span style="color: black;"><span style="font-size: medium;">You
don’t need to throw anything away</span></span></b></span></div>
</li>
</ol>
<div style="margin-bottom: 0in; text-align: justify;">
<span style="color: black;"><span style="font-family: inherit; font-size: medium;"> Love
it or hate it, you can’t deny that 4 is the most
successful markup format ever. builds on that success. You don’t
need to throw away your existing markup. You don’t need to relearn
things you already know. If your web application worked yesterday
in 4, it will still work today in . Period. </span></span><span style="color: black; font-family: inherit; line-height: 0.25in;">Now,
if you want to </span><em style="font-family: inherit; line-height: 0.25in;"><span style="color: black;"><span style="font-style: normal;">improve</span></span></em><span style="color: black; font-family: inherit; line-height: 0.25in;"> your
web applications, you’ve come to the right place. Here’s a
concrete example: supports all the form controls from 4,
but it also includes new input controls. Some of these are
long-overdue additions like sliders and date pickers; others are more
subtle. For example, the </span><code style="line-height: 0.25in;"><span style="color: black;">email</span></code><span style="color: black; font-family: inherit; line-height: 0.25in;"> input
type looks just like a text box, but mobile browsers will customize
their onscreen keyboard to make it easier to type email addresses.
Older browsers that don’t support the </span><code style="line-height: 0.25in;"><span style="color: black;">email</span></code><span style="color: black; font-family: inherit; line-height: 0.25in;"> input
type will treat it as a regular text field, and the form still works
with no markup changes or scripting hacks. This means you can start
improving your web forms </span><em style="font-family: inherit; line-height: 0.25in;"><span style="color: black;"><span style="font-style: normal;">today</span></span></em><span style="color: black; font-family: inherit; line-height: 0.25in;">,
even if some of your visitors are stuck on IE 6.</span></div>
<ol start="3">
<li><div style="margin-bottom: 0in; text-align: justify;">
<span style="font-family: inherit;"><b><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="three"></a><span style="color: black;"><span style="font-size: medium;">It’s
easy to get started</span></span></b></span></div>
<div style="text-align: justify;">
<span style="color: black; font-family: inherit;">“Upgrading”
to can be as simple as changing your <i>doctype</i>.
The doctype should already be on the first line of every page.
Previous versions of defined a lot of doctypes, and
choosing the right one could be tricky. In , there is only one
doctype: </span><span style="font-family: inherit; line-height: 0.25in;"><!DOCTYPE
html> </span><span style="color: black; font-family: inherit; line-height: 0.25in;">Upgrading
to the doctype won’t break your existing markup,
because </span><span style="color: rosybrown;"><span style="text-decoration: none;">obsolete
elements</span></span><span style="color: black; font-family: inherit; line-height: 0.25in;"> previously
defined in HTML 4 will still render in . But it will allow you
to use — and validate — new semantic elements
like </span><code style="line-height: 0.25in;"><span style="color: black;"><article></span></code><span style="color: black; font-family: inherit; line-height: 0.25in;">, </span><code style="line-height: 0.25in;"><span style="color: black;"><section></span></code><span style="color: black; font-family: inherit; line-height: 0.25in;">, </span><code style="line-height: 0.25in;"><span style="color: black;"><header></span></code><span style="color: black; font-family: inherit; line-height: 0.25in;">,
and </span><code style="line-height: 0.25in;"><span style="color: black;"><footer></span></code><span style="color: black; font-family: inherit; line-height: 0.25in;">. </span></div>
</li>
</ol>
<ol start="3">
<div style="margin-bottom: 0in;">
</div>
</ol>
<ol start="4">
<li><div style="margin-bottom: 0in; text-align: justify;">
<span style="font-family: inherit;"><b><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="four"></a><span style="color: black;"><span style="font-size: medium;">It
already works</span></span></b></span></div>
<div style="margin-bottom: 0in; text-align: justify;">
<span style="color: black; font-family: inherit;">Whether
you want to draw on a canvas, play video, design better forms, or
build web applications that work offline, you’ll find that </span><span style="color: black; font-family: inherit;"> </span><span style="color: black; font-family: inherit;">is
already well-supported. Firefox, Safari, Chrome, Opera, and mobile
browsers already support canvas, video, geolocation, local storage,
and more. Google already supports micro-data annotations. Even
Microsoft — rarely known for blazing the trail of standards
support most HTML5 features.</span></div>
</li>
</ol>
<ol start="5">
<li><div style="margin-bottom: 0in; text-align: justify;">
<span style="font-family: inherit;"><b><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="five"></a><span style="color: black;"><span style="font-size: medium;">It’s
here to stay</span></span></b></span></div>
<div style="text-align: justify;">
<span style="color: black;"><span style="font-size: large;"><span style="font-family: inherit; font-size: medium;">Tim
Berners-Lee invented the world wide web in the early 1990s. He later
founded the to act as a steward of web standards, which
the organization has done for more than 15 years. Here is what
the had to say about the future of web standards, in July
2009:</span></span></span></div>
</li>
</ol>
<blockquote style="line-height: 0.25in; text-align: justify;">
<span style="color: black;"><span style="font-family: inherit;">Today
the Director announces that when the 2 Working Group
charter expires as scheduled at the end of 2009, the charter will not
be renewed. By doing so, and by increasing resources in the Working
Group, hopes to accelerate the progress of and
clarify ’s position regarding the future of .</span></span></blockquote>
<div style="line-height: 0.25in;">
<span style="color: black; font-family: inherit;"> HTML5 is
here to stay!</span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Essays 1743, Palatino, Palatino Linotype, Book Antiqua, Georgia, Times New Roman, serif;"><span style="font-size: medium;"><b>sources</b></span></span></span></div>
<div style="margin-bottom: 0in;">
<a href="http://diveintohtml5.info/introduction.html"><span style="color: black;"><span style="font-family: Essays 1743, Palatino, Palatino Linotype, Book Antiqua, Georgia, Times New Roman, serif;"><span style="font-size: medium;">http://diveintohtml5.info/introduction.html</span></span></span></a></div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Essays 1743, Palatino, Palatino Linotype, Book Antiqua, Georgia, Times New Roman, serif;"><span style="font-size: medium;">http://www.html5rocks.com/en/</span></span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-51255153625447825632013-04-15T18:19:00.001-07:002013-04-15T18:19:40.009-07:00Software Developer's Blog: Is Service Oriented Programming (SOP) Just Another...<a href="http://mahderjava.blogspot.com/2013/04/is-service-oriented-programming-sop.html?spref=bl">Software Developer's Blog: Is Service Oriented Programming (SOP) Just Another...</a>: Object-oriented programming ( OOP ) is a programming paradigm that represents concepts as " objects " that have data fiel...Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-41196641240901944812013-04-15T18:12:00.001-07:002013-04-15T18:17:05.667-07:00Is Service Oriented Programming (SOP) Just Another Name of Object Oriented Programming (OOP) ?<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="margin-bottom: 0in; text-align: justify;">
<span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;"><b>Object-oriented
programming</b></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;">(</span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;"><b>OOP</b></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;">)
is a </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">programming
paradigm</span></span></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;">that
represents concepts as "</span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">objects</span></span></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;">"
that have </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">data
fields</span></span></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;">(attributes
that describe the object) and associated procedures known as </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">methods</span></span></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;">.
Objects, which are usually </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">instances</span></span></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;">of </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">classes</span></span></span></span><span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;">,
are used to interact with one another to design applications and
computer programs.</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc2PFQyqmO-2RmzAKoT0pi_lhjXigZWwg8GVABe0DpFcgrjnfPnaWvduSlbSoy41Fog2OQYbxmpuQczDA6OY9L_02KqLrhU4no0uuhAGfyS6SKYrHFK7BdG04sfzJbwRHPwHFDV7r_FEc/s1600/ooppic.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="208" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc2PFQyqmO-2RmzAKoT0pi_lhjXigZWwg8GVABe0DpFcgrjnfPnaWvduSlbSoy41Fog2OQYbxmpuQczDA6OY9L_02KqLrhU4no0uuhAGfyS6SKYrHFK7BdG04sfzJbwRHPwHFDV7r_FEc/s320/ooppic.png" width="320" /></a></div>
<span style="color: black; line-height: 0.17in;"><span style="font-family: sans-serif;"><br /></span></span></div>
<div style="line-height: 0.17in; margin-bottom: 0in; text-align: justify;">
<br /></div>
<div style="line-height: 0.17in; margin-bottom: 0in; text-align: justify;">
<span style="color: black;"><span style="font-family: sans-serif;">An
object-oriented program may be viewed as a collection of
interacting </span></span><span style="color: black;"><span style="font-family: sans-serif;"><i>objects</i></span></span><span style="color: black;"><span style="font-family: sans-serif;">,
as opposed to the conventional model, in which a program is seen as a
list of tasks (</span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">subroutines</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;">)
to perform. In OOP, each object is capable of receiving messages,
processing data, and sending messages to other objects. Each object
can be viewed as an independent "machine" with a distinct
role or responsibility. Actions (or "</span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">methods</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;">")
on these objects are closely associated with the object. For example,
OOP </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">data
structures</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: black;"><span style="font-family: sans-serif;">tend
to "carry their own operators around with them" (or at
least "</span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">inherit</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;">"
them from a similar object or class)—except when they must be
serialized.</span></span></div>
<div style="line-height: 0.17in; margin-bottom: 0in; text-align: justify;">
<br /></div>
<div style="line-height: 0.17in; margin-bottom: 0in; text-align: justify;">
<span style="color: black;"><span style="font-family: sans-serif;">Objects
can be thought of as </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">encapsulating</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: black;"><span style="font-family: sans-serif;">their
data within a set of functions designed to ensure that the data are
used appropriately, and to assist in that use. The object's methods
typically include checks and safeguards specific to the data types
the object contains. An object can also offer simple-to-use,
standardized methods for performing particular operations on its
data, while concealing the specifics of how those tasks are
accomplished. In this way alterations can be made to the internal
structure or methods of an object without requiring that the rest of
the program be modified. This approach can also be used to offer
standardized methods across different types of objects. As an
example, several different types of objects might offer print
methods. Each type of object might implement that print method in a
different way, reflecting the different kinds of data each contains,
but all the different print methods might be called in the same
standardized manner from elsewhere in the program. These features
become especially useful when more than one programmer is
contributing code to a project or when the goal is to reuse code
between projects.</span></span></div>
<div style="line-height: 0.17in; margin-bottom: 0in; text-align: justify;">
<br /></div>
<div style="line-height: 0.17in; margin-bottom: 0in; text-align: justify;">
<span style="color: black;"><span style="font-family: sans-serif;"><b>Service-oriented
programming</b></span></span><span style="color: black;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: black;"><span style="font-family: sans-serif;">(SOP)
is a </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">programming
paradigm</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: black;"><span style="font-family: sans-serif;">that
uses "services" as the unit of computer work, to design and
implement integrated business applications and </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">mission
critical</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: black;"><span style="font-family: sans-serif;">software
programs. Services can represent steps of </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;"><span style="background: #ffffff;">business
processes</span></span></span></span><span style="color: black;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: black;"><span style="font-family: sans-serif;">and
thus one of the main applications of this paradigm is the
cost-effective delivery of standalone or composite business
applications that can "integrate from the inside-out"</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtZKgK5H5bp4fQ696qhCYR6EoVbDpVXWbA1mCy6XK1tA0DpvfSJVAYDUCCZhfbkQPi6Tadj-xKTreY52d5XvY87tjy6ug5gpUbHiK61E-CKCYfj8bg8wJnLsZmZIfIWtNtjol0hh43jbw/s1600/servicepic.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtZKgK5H5bp4fQ696qhCYR6EoVbDpVXWbA1mCy6XK1tA0DpvfSJVAYDUCCZhfbkQPi6Tadj-xKTreY52d5XvY87tjy6ug5gpUbHiK61E-CKCYfj8bg8wJnLsZmZIfIWtNtjol0hh43jbw/s320/servicepic.png" width="320" /></a></div>
<span style="color: black;"><span style="font-family: sans-serif;"><br /></span></span></div>
<div style="line-height: 0.17in; margin-bottom: 0in; text-align: justify;">
<br /></div>
<div style="line-height: 0.17in; text-align: justify;">
<span style="color: black;"><span style="font-family: sans-serif;">SOP
concepts provide a robust base for a semantic approach to programming
integration and application logic. There are three significant
benefits to this approach:</span></span></div>
<ul>
<li><div style="border: none; line-height: 0.17in; margin-bottom: 0in; padding: 0in; text-align: justify;">
<span style="color: black;"><span style="font-family: sans-serif;">Semantically,
it can raise the level of abstraction for creating composite
business applications and thus significantly increase responsiveness
to change (i.e. </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;">business
agility</span></span></span><span style="color: black;"><span style="font-family: sans-serif;">)</span></span></div>
</li>
<li><div style="border: none; line-height: 0.17in; margin-bottom: 0in; padding: 0in; text-align: justify;">
<span style="color: black;"><span style="font-family: sans-serif;">Gives
rise to the unification of integration and software component
development techniques under a single concept and thus significantly
reduces the complexity of integration. This unified approach enables
"inside-out integration" without the need to replicate
data, therefore, significantly reducing the cost and complexity of
the overall solution</span></span></div>
</li>
<li><div style="border: none; line-height: 0.17in; margin-bottom: 0in; padding: 0in; text-align: justify;">
<span style="color: black;"><span style="font-family: sans-serif;">Automate
multi-threading and </span></span><span style="color: #0b0080;"><span style="text-decoration: none;"><span style="font-family: sans-serif;">virtualization</span></span></span><span style="color: black;"><span style="font-family: sans-serif;"> of
applications at the granular (unit-of-work) level.</span></span></div>
</li>
</ul>
<br />
<span style="color: black;"><span style="font-family: sans-serif;"><i>Having
said all this, let us compare the two approaches now:</i></span></span><br />
<div style="text-align: justify;">
<span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;">OOP
is a fine way to create applications that perform specific tasks.
However, it is a </span></span><span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><i><b>terrible</b></i></span></span><span style="color: #666666;"><span style="font-family: sans-serif;"><i> </i></span></span><span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;">architecture
for creating robust network applications. Every OOP-based
architecture for distributed applications (using CORBA, DCOM, or EJB)
has failed to deliver on its promises... and made network programming
vastly more difficult than it needed to be.</span></span></div>
<br />
<br />
<div style="text-align: justify;">
<span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="color: black;"><span style="font-family: sans-serif;">A
service-oriented approach, on the other hand, gives the developers
and architects an easy way to integrate systems. They are far less
complex, faster, more robust, more scalable, more easily maintained,
and they are much easier to for designers to conceptualize.</span></span></span></span></div>
<div style="border: none; margin-bottom: 0.09in; margin-top: 0.09in; padding: 0in; text-align: justify;">
<span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;">Does
this mean an end to OOP? No. We still need OOP -- or at least
significant chunks of it -- to create these systems. However, we
should stay as far away from OOP as possible when creating interfaces
to distributed applications.</span></span></div>
<div style="border: none; margin-bottom: 0.09in; margin-top: 0.09in; padding: 0in; text-align: justify;">
<span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;">May
be providing a simple illustration on how service-oriented
programming appaoach works is best here: in simple terms
service-oriented programming is like the following two points.</span></span></div>
<div style="border: none; margin-bottom: 0.09in; margin-top: 0.09in; padding: 0in; text-align: justify;">
<span style="color: #282828; font-family: helvetica, arial, sans-serif;">write
programs that are designed to run as services. </span></div>
<ol style="text-align: left;">
<li><span style="color: #282828; font-family: helvetica, arial, sans-serif; text-align: justify;">For example, most
databases run as a service on a server. It listens for connections,
and then listens for requests and provides responses to those
requests</span></li>
<li><div style="border: none; margin-bottom: 0.09in; margin-top: 0.09in; padding: 0in;">
</div>
<div style="text-align: justify;">
<span style="color: #282828; font-family: helvetica, arial, sans-serif; text-align: left;">Design those programs to establish connections with each other, and
use message passing as the key to performing work. For example, you
might have the MySQL service running, and the Apache service
running. A request is sent to the Apache service from over the
internet. It, in turn, connects to the MySQL service (via a PHP
script) and sends a sequence of messages. The result of processing
those messages is then sent back to the requestor as an HTML page. </span></div>
</li>
</ol>
<div style="border: none; margin-bottom: 0.09in; margin-top: 0.09in; padding: 0in;">
<span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="color: #282828;"><span style="font-family: helvetica, arial, sans-serif;">Source:</span></span></span></span></div>
<div style="border: none; margin-bottom: 0.09in; margin-top: 0.09in; padding: 0in;">
<span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><a href="http://en.wikipedia.org/wiki/Object-oriented_programming"><span style="color: #282828;"><span style="font-family: helvetica, arial, sans-serif;">http://en.wikipedia.org/wiki/Object-oriented_programming</span></span></a></span></span></div>
<div style="border: none; margin-bottom: 0.09in; margin-top: 0.09in; padding: 0in;">
<span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><a href="http://en.wikipedia.org/wiki/Service-oriented_programming"><span style="color: #282828;"><span style="font-family: helvetica, arial, sans-serif;">http://en.wikipedia.org/wiki/Service-oriented_programming</span></span></a></span></span></div>
<div style="border: none; margin-bottom: 0.09in; margin-top: 0.09in; padding: 0in;">
<span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="color: #282828;"><span style="font-family: helvetica, arial, sans-serif;"><a href="http://bexhuff.com/so-vs-oop">http://bexhuff.com/so-vs-oop</a>
and some pdf books I have.</span></span></span></span></div>
<div style="border: none; margin-bottom: 0.09in; margin-top: 0.09in; padding: 0in;">
<span style="color: #666666;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="color: #282828;"><span style="font-family: helvetica, arial, sans-serif;">If
you want to read more about it, I am happy to share my books. Till
the next topic, later!</span></span></span></span></div>
<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com1tag:blogger.com,1999:blog-5839052578190286833.post-10058547781029647092013-04-12T14:04:00.001-07:002013-04-12T14:04:00.634-07:00Software Developer's Blog: Android Programming and Its Potentials...<a href="http://mahderjava.blogspot.com/2013/04/android-programming-and-its-potentials.html?spref=bl">Software Developer's Blog: Android Programming and Its Potentials...</a>: What is Android? Android is a Linux-based mobile phone operating system developed by Google. Android is unique because Google is acti...Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-17748506830526982492013-04-12T13:37:00.001-07:002013-04-12T14:01:06.004-07:00Android Programming and Its Potentials...<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;"><b>What is Android?</b></span></span></h2>
<div style="line-height: 0.17in; text-align: justify;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">Android</span></span><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;"> is
a Linux-based mobile phone operating system developed by
Google. </span></span><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">Android</span></span><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;"> is
unique because Google is actively developing the platform but giving
it away for free to hardware manufacturers and phone carriers who
want to use Android on their devices.</span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwsflsa2S0hXFuSMfTwQTDmJSakc1xHAj8VRWpG85AAal-2XyzC7kJaT5EC5Feo0anOObxTstO6FXjo8rh7dJ5NNuVHpVV4QUELBDSjlVNxd0yy9NJwNJen7fDhZwVGHjF1Stx51EOaYk/s1600/android-survey.gif" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: justify;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwsflsa2S0hXFuSMfTwQTDmJSakc1xHAj8VRWpG85AAal-2XyzC7kJaT5EC5Feo0anOObxTstO6FXjo8rh7dJ5NNuVHpVV4QUELBDSjlVNxd0yy9NJwNJen7fDhZwVGHjF1Stx51EOaYk/s200/android-survey.gif" width="200" /></a></div>
<div style="line-height: 0.17in; text-align: justify;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div>
<br />
<br />
<h2 style="text-align: left;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;"><b>How Did it Start?</b></span></span></h2>
<div style="line-height: 0.17in; text-align: justify;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">Android,
Inc. was founded in Palo Alto, California in October 2003 by </span></span><span style="color: #333333;"><span style="text-decoration: none;"><span style="font-family: Arial, Helvetica, sans-serif;">Andy
Rubin</span></span></span><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">,
Rich Miner, Nick Sears and Chris White.</span></span></div>
<div style="line-height: 0.17in; text-align: justify;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">The
first android phone was HTC G1. Andy Rubin and his team were very
excited about the first prototype of phone by Motorola and when it
was brought in front of them this was their reaction: </span></span><em><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-style: normal;">“It
looked like a weapon. It was so sharp and jagged and full of hard
lines. It looked like you could cut yourself on the edges”</span></span></span></em><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">.
Clearly, they were expecting something else.</span></span></div>
<div style="line-height: 0.17in;">
<br /></div>
<div style="line-height: 0.17in; text-align: justify;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">Google
acquired Android Inc. on August 17, 2005, making it a wholly owned
subsidiary. As the development advanced, </span></span><strong><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-weight: normal;">Google
marketed the platform to handset makers, promising them a smarter,
more flexible and customizable system.</span></span></span></strong></div>
<div style="line-height: 0.17in; text-align: justify;">
<strong><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-weight: normal;"><br /></span></span></span></strong></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBbpE_qy9EVRm7uQWKZDX0sCynQwcNlmMOAK6RpcEk-KCwfoV22A-izmPvryUCfrgwp3hebQJN9Cz9lwv9vCjEBRrFOiFg2rR8Ra6THpfxk_GXOKfHYv_igEmTB_YrKI3fZDXQznbTR68/s1600/google-android-chrome1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBbpE_qy9EVRm7uQWKZDX0sCynQwcNlmMOAK6RpcEk-KCwfoV22A-izmPvryUCfrgwp3hebQJN9Cz9lwv9vCjEBRrFOiFg2rR8Ra6THpfxk_GXOKfHYv_igEmTB_YrKI3fZDXQznbTR68/s200/google-android-chrome1.png" width="200" /></a></div>
<div style="line-height: 0.17in; text-align: justify;">
<strong><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-weight: normal;"><br /></span></span></span></strong></div>
<div style="line-height: 0.17in;">
<br /></div>
<div style="line-height: 0.17in; text-align: justify;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">Because
Google developed Android, it comes with a lot of Google services
installed right out of the box. Gmail, Google Calendar, Google Maps,
and Google Web search are all pre-installed, and Google is also the
default Web page for the Web browser. However, because Android can be
modified, carriers can choose to change this. Verizon Wireless, for
instance, has modified some Android phones to use Bing as the default
search engine.</span></span></div>
<div style="line-height: 0.17in;">
<br /></div>
<div style="line-height: 0.17in; text-align: justify;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">Android
software development is the process by which new applications
are created for the </span></span><span style="color: #333333;"><span style="text-decoration: none;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="background: #ffffff;">Android
operating system</span></span></span></span><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">.
Applications are usually developed in the </span></span><span style="color: #333333;"><span style="text-decoration: none;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="background: #ffffff;">Java</span></span></span></span><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;"> programming
language using the Android </span></span><span style="color: #333333;"><span style="text-decoration: none;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="background: #ffffff;">Software
Development Kit</span></span></span></span><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">,
but other development tools are available.</span></span></div>
<div style="line-height: 0.17in;">
<br /></div>
<div style="line-height: 0.17in;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">I
have found this video clip really simple to set up Android SDK and
most important its fun... check it out</span></span></div>
<div style="line-height: 0.17in;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/31cxmLN09ss?feature=player_embedded' frameborder='0'></iframe></div>
<div style="line-height: 0.17in;">
<br />
<br /></div>
<div style="text-align: justify;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 0.17in;">Hope
the time you invest to study Android pays back big time very soon. I
have known best Android programmers my self and I had the </span><span style="line-height: 16.3125px;">privilege</span><span style="line-height: 0.17in;"> of working with them. And sure there are many android programmers out
there and would just get the time share their expirence here.</span></span></span></div>
<br />
<div style="text-align: justify;">
<span style="line-height: 16.3125px;"><br /></span></div>
<br />
<br />
<div style="line-height: 0.17in;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">These
are some good starting points:</span></span></div>
<ol>
<li><div style="line-height: 0.17in;">
<a href="http://www.coreservlets.com/android-tutorial/"><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">http://www.coreservlets.com/android-tutorial/</span></span></a></div>
</li>
<li><div style="line-height: 0.17in;">
<a href="http://www.edureka.in/blog/what-is-android/"><span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">http://www.edureka.in/blog/what-is-android/</span></span></a></div>
</li>
<li><div style="line-height: 0.17in;">
<span style="color: #333333;"><span style="font-family: Arial, Helvetica, sans-serif;">http://www.xda-developers.com</span></span></div>
</li>
</ol>
<br /></div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com1tag:blogger.com,1999:blog-5839052578190286833.post-43072127370393737982013-04-11T12:21:00.001-07:002013-04-11T12:21:18.251-07:00Software Developer's Blog: What is jQuery? What Benefits Do I get by Using it...<a href="http://mahderjava.blogspot.com/2013/04/what-is-jquery-what-benefits-do-i-get.html?spref=bl">Software Developer's Blog: What is jQuery? What Benefits Do I get by Using it...</a>: jQuery is free, open source software , licensed under the MIT License. jQuery's syntax is designed to make it easier to navig...Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com3tag:blogger.com,1999:blog-5839052578190286833.post-63988734879165210902013-04-11T11:51:00.003-07:002013-04-11T11:51:44.285-07:00Software Developer's Blog: Basic Aim of this Blog & Welcome!<a href="http://mahderjava.blogspot.com/2013/04/basic-aim-of-this-blog-welcome.html?spref=bl">Software Developer's Blog: Basic Aim of this Blog & Welcome!</a>: Basic Aim of this blog & Welcome! This blog is created in the hope that many computer science and other interested individuals can ...Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com1tag:blogger.com,1999:blog-5839052578190286833.post-29607630988915131822013-04-11T11:51:00.001-07:002013-04-11T11:51:25.104-07:00Software Developer's Blog: 10 effective ways to become a good programmer!!<a href="http://mahderjava.blogspot.com/2013/04/10-effective-ways-to-become-good.html?spref=bl">Software Developer's Blog: 10 effective ways to become a good programmer!!</a>: I have come across this interesting post to help new programmers really become "good programmers". The post is taken from "h...Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-53149880300123623572013-04-11T11:18:00.001-07:002013-04-11T11:18:03.046-07:00Software Developer's Blog: Java?? Why You Shall Dedicate Time to Learn More A...<a href="http://mahderjava.blogspot.com/2013/04/java-why-you-shall-dedicate-time-to.html?spref=bl">Software Developer's Blog: Java?? Why You Shall Dedicate Time to Learn More A...</a>: By: Mahder Alemayehu, mahderalem@gmail.com Why use Java at all? Is it worth learning a new language and a new platform? This section expl...Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-56965568203642213182013-04-11T11:17:00.001-07:002013-04-11T11:17:35.783-07:00Software Developer's Blog: What is jQuery? What Benefits Do I get by Using it...<a href="http://mahderjava.blogspot.com/2013/04/what-is-jquery-what-benefits-do-i-get.html?spref=bl">Software Developer's Blog: What is jQuery? What Benefits Do I get by Using it...</a>: jQuery is free, open source software , licensed under the MIT License. jQuery's syntax is designed to make it easier to navig...Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-35824377768517511702013-04-11T11:11:00.004-07:002013-04-12T13:49:14.313-07:00What is jQuery? What Benefits Do I get by Using it?<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
<div style="text-align: justify;">
<span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">jQuery
is </span></span><span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">free,
open source software</span></span><span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">,
licensed under the MIT
License. jQuery's syntax is designed to make it easier to
navigate a document, select DOM
elements, create </span></span><span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">animations</span></span><span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">,
handle events,
and develop Ajax
applications. jQuery also provides capabilities for developers to
create plug-ins
on top of the JavaScript library. This enables developers to create
abstractions
for low-level interaction and animation, advanced effects and
high-level, theme-able widgets. The modular approach to the jQuery
library allows the creation of powerful dynamic
web pages and web applications.</span></span></div>
</div>
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
<div style="text-align: justify;">
<span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">The
purpose of jQuery is to make it much easier to use JavaScript on your
website.</span></span></div>
</div>
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
<div style="text-align: justify;">
<span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">Before
you start studying jQuery, you should have a basic knowledge of:</span></span></div>
</div>
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
</div>
<ul style="text-align: left;">
<li style="text-align: justify;"><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">HTML</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">CSS</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">JavaScript</span></li>
</ul>
<br />
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
<span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">The
jQuery library contains the following features:</span></span></div>
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
</div>
<ul style="text-align: left;">
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">HTML/DOM
manipulation</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">CSS
manipulation</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">HTML
event methods</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">Effects
and animations</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">AJAX</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">Utilities</span></li>
</ul>
<br />
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
<div style="text-align: justify;">
<span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">jQuery
is very compact and well written JavaScript code that increases the
productivity of the developer by enabling them to achieve critical UI
functionality by writing very small amount of code. The following are some of its widely known and used features/functionalities</span></span></div>
</div>
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
</div>
<ul style="text-align: left;">
<li style="text-align: justify;"><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">It
helps to improve the performance of the application</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">It
helps to develop most browser compatible web page</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">It
helps to implement UI related critical functionality without writing
hundreds of lines of codes</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">It
is fast</span></li>
<li><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">It
is extensible – jQuery can be extended to implement customized
behavior</span></li>
</ul>
<br />
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
<span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">Other
advantages of jQuery are:</span></span></div>
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
</div>
<ul style="text-align: left;">
<li style="text-align: justify;"><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">No
need to learn fresh new syntaxes to use jQuery, knowing simple
JavaScript syntax is enough</span></li>
<li style="text-align: justify;"><span style="color: #313131; font-family: Verdana, sans-serif; line-height: 0.26in;">Simple
and cleaner code, no need to write several lines of codes to achieve
complex functionality</span></li>
</ul>
<br />
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
<span style="color: #313131;"><span style="font-family: Verdana, sans-serif;">Where
to begin learning jQuery???</span></span></div>
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
<span style="color: #0e0e0e; font-family: ArialMT, sans-serif;">I
have found the following sources very good for beginning jQuery:</span></div>
<div style="margin-bottom: 0in;">
<span style="color: #0e0e0e;"><span style="font-family: ArialMT, sans-serif;">1.
<a href="http://www.1stwebdesigner.com/tutorials/jquery-beginners-1/">http://www.1stwebdesigner.com/tutorials/jquery-beginners-1/</a></span></span></div>
<div style="margin-bottom: 0in;">
<span style="color: #0e0e0e;"><span style="font-family: ArialMT, sans-serif;">2.
<a href="http://www.noupe.com/design/getting-started-with-jquery-a-beginners-resource-guide.html">http://www.noupe.com/design/getting-started-with-jquery-a-beginners-resource-guide.html</a></span></span></div>
<div style="margin-bottom: 0in;">
<span style="color: #0e0e0e;"><span style="font-family: ArialMT, sans-serif;">3.
<a href="http://net.tutsplus.com/articles/web-roundups/jquery-for-absolute-beginners-video-series/">http://net.tutsplus.com/articles/web-roundups/jquery-for-absolute-beginners-video-series/</a></span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="color: #0e0e0e;"><span style="font-family: ArialMT, sans-serif;">I
hope you will find this post helpful and please add more to it!</span></span></div>
<div style="line-height: 0.22in; margin-bottom: 0in;">
<br /></div>
<div style="line-height: 0.26in; margin-bottom: 0.19in;">
<br />
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com2tag:blogger.com,1999:blog-5839052578190286833.post-46171739334294243262013-04-10T11:50:00.000-07:002013-04-10T11:50:48.855-07:00Java?? Why You Shall Dedicate Time to Learn More About It!<div dir="ltr" style="text-align: left;" trbidi="on">
By: Mahder Alemayehu, mahderalem@gmail.com<br />
<div align="JUSTIFY">
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">Why
use Java at all? Is it worth learning a new language and a new
platform? This section explores some of the key benefits of Java.
Here is a little something I have collected from books and my own
experience. Of course I may be biased for java is my first choice as
a programming language. But, you can see that its true after a little
while.</span></span></span></div>
<h3 class="western">
<span style="color: black;"><span style="font-family: Times;">A.
Write Once, Run Anywhere</span></span></h3>
<div align="JUSTIFY">
<a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-47"></a><span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">Sun
identifies "Write once, run anywhere" as the core value
proposition of the Java platform. Translated from business jargon,
this means that the most important promise of Java technology is that
you only have to write your application once--for the Java
platform--and then you'll be able to run it </span></span></span><em><span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;"><span style="font-style: normal;">anywhere</span></span></span></span></em><span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">.</span></span></span></div>
<div align="JUSTIFY">
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">Anywhere,
that is, that supports the Java platform. Fortunately, Java support
is becoming ubiquitous. It is integrated, or being integrated, into
practically all major operating systems. It is built into the popular
web browsers, which places it on virtually every Internet-connected
PC in the world. It is even being built into consumer electronic
devices, such as television set-top boxes, PDAs, and cell phones.</span></span></span></div>
<h3 class="western">
<span style="color: black;"><span style="font-family: Times;">B.
Security</span></span></h3>
<div align="JUSTIFY">
<a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-48"></a>
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">Another key
benefit of Java is its security features. Both the language and the
platform were designed from the ground up with security in mind. The
Java platform allows users to download untrusted code over a network
and run it in a secure environment in which it cannot do any harm: it
cannot infect the host system with a virus, cannot read or write
files from the hard drive, and so forth. This capability alone makes
the Java platform unique.</span></span></span></div>
<div align="JUSTIFY">
<a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-50"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-49"></a>
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">The Java 2
Platform takes the security model a step further. It makes security
levels and restrictions highly configurable and extends them beyond
applets. As of Java 1.2, any Java code, whether it is an applet, a
servlet, a JavaBeans component, or a complete Java application, can
be run with restricted permissions that prevent it from doing harm to
the host system.</span></span></span></div>
<div align="JUSTIFY">
<a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-51"></a>
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">The security
features of the Java language and platform have been subjected to
intense scrutiny by security experts around the world.
Security-related bugs, some of them potentially serious, have been
found and promptly fixed. Because of the security promises Java
makes, it is big news when a new security bug is found. Remember,
however, that no other mainstream platform can make security
guarantees nearly as strong as those Java makes. If Java's security
is not yet perfect, it has been proven strong enough for practical
day-to-day use and is certainly better than any of the alternatives.</span></span></span></div>
<h3 class="western">
<span style="color: black;"><span style="font-family: Times;">C.
Network-centric Programming</span></span></h3>
<div align="JUSTIFY">
<a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-53"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-52"></a>
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">Sun's corporate
motto has always been "The network is the computer." The
designers of the Java platform believed in the importance of
networking and designed the Java platform to be network-centric. From
a programmer's point of view, Java makes it unbelievably easy to work
with resources across a network and to create network-based
applications using client/server or multitier architectures. This
means that Java programmers have a serious head start in the emerging
network economy.</span></span></span></div>
<h3 class="western">
<span style="color: black;"><span style="font-family: Times;">D.
Dynamic, Extensible Programs</span></span></h3>
<div align="JUSTIFY">
<a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-54"></a><span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">Java
is both dynamic and extensible. Java code is organized in modular
object-oriented units called </span></span></span><em><span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;"><span style="font-style: normal;">classes</span></span></span></span></em><span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">.
Classes are stored in separate files and are loaded into the Java
interpreter only when needed. This means that an application can
decide as it is running what classes it needs and can load them when
it needs them. It also means that a program can dynamically extend
itself by loading the classes it needs to expand its functionality.</span></span></span></div>
<div align="JUSTIFY">
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">The
network-centric design of the Java platform means that a Java
application can dynamically extend itself by loading new classes over
a network. An application that takes advantage of these features
ceases to be a monolithic block of code. Instead, it becomes an
interacting collection of independent software components. Thus, Java
enables a powerful new metaphor of application design and
development.</span></span></span></div>
<h3 class="western">
<span style="color: black;"><span style="font-family: Times;">E.
Internationalization</span></span></h3>
<div align="JUSTIFY">
<a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-57"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-56"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-55"></a>
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">The Java
language and the Java platform were designed from the start with the
rest of the world in mind. Java is the only commonly used programming
language that has internationalization features at its very core,
rather than tacked on as an afterthought. While most programming
languages use 8-bit characters that represent only the alphabets of
English and Western European languages, Java uses 16-bit Unicode
characters that represent the phonetic alphabets and ideographic
character sets of the entire world. Java's internationalization
features are not restricted to just low-level character
representation, however. The features permeate the Java platform,
making it easier to write internationalized programs with Java than
it is with any other environment.</span></span></span></div>
<h3 class="western">
<span style="color: black;"><span style="font-family: Times;">F.
Performance</span></span></h3>
<div align="JUSTIFY">
<a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-64"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-63"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-62"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-61"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-60"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-59"></a><a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-58"></a>
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">As I described
earlier, Java programs are compiled to a portable intermediate form
known as byte codes, rather than to native machine-language
instructions. The Java Virtual Machine runs a Java program by
interpreting these portable byte-code instructions. This architecture
means that Java programs are faster than programs or scripts written
in purely interpreted languages, but they are typically slower than C
and C++ programs compiled to native machine language. Keep in mind,
however, that although Java programs are compiled to byte code, not
all of the Java platform is implemented with interpreted byte codes.
For efficiency, computationally intensive portions of the Java
platform--such as the string-manipulation methods--are implemented
using native machine code.</span></span></span></div>
<div align="JUSTIFY">
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">Although
early releases of Java suffered from performance problems, the speed
of the Java VM has improved dramatically with each new release. The
VM has been highly tuned and optimized in many significant ways.
Furthermore, many implementations include a just-in-time compiler,
which converts Java byte codes to native machine instructions on the
fly. Using sophisticated JIT compilers, Java programs can execute at
speeds comparable to the speeds of native C and C++ applications.</span></span></span></div>
<div align="JUSTIFY">
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">Java
is a portable, interpreted language; Java programs run almost as fast
as native, non-portable C and C++ programs. Performance used to be an
issue that made some programmers avoid using Java. Now, with the
improvements made in Java 1.2, performance issues should no longer
keep anyone away. In fact, the winning combination of performance
plus portability is a unique feature no other language can offer.</span></span></span></div>
<h3 class="western">
<span style="color: black;"><span style="font-family: Times;">G.
Programmer Efficiency and Time-to-Market</span></span></h3>
<div align="JUSTIFY">
<a href="http://www.blogger.com/blogger.g?blogID=5839052578190286833" name="INDEX-65"></a>
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">The final, and
perhaps most important, reason to use Java is that programmers like
it. Java is an elegant language combined with a powerful and
well-designed set of APIs. Programmers enjoy programming in Java and
are usually amazed at how quickly they can get results with it.
Studies have consistently shown that switching to Java increases
programmer efficiency. Because Java is a simple and elegant language
with a well-designed, intuitive set of APIs, programmers write better
code with fewer bugs than for other platforms, again reducing
development time.</span></span></span></div>
<div align="JUSTIFY">
<br />
<br /></div>
<div align="JUSTIFY">
<span style="color: black;"><span style="font-family: Times;"><span style="font-size: medium;">Feel
free to add your comments and suggestions to this post. Hope to see
you in another post soon.</span></span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com0tag:blogger.com,1999:blog-5839052578190286833.post-8281914563719837212013-04-09T17:18:00.001-07:002013-04-09T17:18:35.984-07:0010 effective ways to become a good programmer!!<div dir="ltr" style="text-align: left;" trbidi="on">
I have come across this interesting post to help new programmers really become "good programmers". The post is taken from "http://ashisharya2003.blogspot.com/2010/12/10-effective-ways-to-become-good.html" By: <span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 20px;"> </span><span class="fn" itemprop="author" itemscope="itemscope" itemtype="http://schema.org/Person" style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 20px;"><span itemprop="name" style="color: #015782; text-decoration: none;"><a href="http://www.blogger.com/profile/08987521868116278001" rel="author" style="color: #015782; text-decoration: none;" title="author profile">Ashish Arya</a>.</span></span><br />
<br />
<br />
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 10pt; text-align: justify;">
<b><i>A good programmer is someone who always looks both ways before crossing a one-way street. ~Doug Linder<o:p></o:p></i></b></div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 10pt; text-align: justify;">
Working as a software programmer in IT industry, one thing that drives us daily to the work place; is that fun and passion lies in programming. But to make that programming a fun and to get an eternal elation out of it, one needs to learn and adhere to some basics which make you a good programmer.</div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 10pt; text-align: justify;">
I am not writing mantras which you can follow to become a good programmer, but the intention is to collate a list of helping tips which I learned and implemented in the industry to get good results. There is no definition of a good programmer, but here we are referring to the category of programmer who have developed excellent IT solutions and helped in overall growth of this industry. </div>
<div class="MsoListParagraphCxSpFirst" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;">
<b>1.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-weight: normal; line-height: normal;"> </span></b><b>Work on Basics<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
As it is true for any industry and any job, the conceptual understanding is the key for success. Unless one has strong conceptual foundation, he/she can never be a good programmer. The core conceptual understanding helps you in designing and implementing the best solutions in the best possible way. If still you feel gap in core computer science and your programming language specific concepts, it’s never too late to go back and review the basics. </div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
</div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;">
<b>2.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-weight: normal; line-height: normal;"> </span></b><b>Start putting question tags (how, what) with every set of code you write<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
One thing that I realized creating a clear separating line between good programmer and rest is that zeal to know what and how it is happening. There is small group of people who can never leave a code without knowing exactly what is happening when it executes. I understand that in tight deadlines, we don’t get this liberty always and hence have to leave the code just knowing that it’s doing its job. Although this is a bit different topic of how to handle such situations, but as a programmer one can always try the level best to dig into as much as one can. And believe me, this becomes a habit with time and then you do it unknowingly every time. </div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;">
<b>3.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-weight: normal; line-height: normal;"> </span></b><b>You learn more by helping others<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
Most of us have a common tendency of turning our heads towards forums or groups only when we need help. And again a clear separation between the good programmer and rest that the formers visit these places more often to help others. This makes them learn more then they learn getting their problem solved by someone else. Within a team as well, help others to solve their problems. Believe me, understanding others’ problem in their context, investigating on that and providing solutions; will leave you much more learned than before. </div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;">
<b>4.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-weight: normal; line-height: normal;"> </span></b><b>Write simple, understandable but logical code<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
As in almost every aspect of life, the formula of KISS (Keep it simple and short) works in programming as well. Write more logical code and avoid complexity. Sometimes people do write complex code just to prove their capability to write such codes. My experience says that simple but logical codes always works well, resulted in fewer issues and are more extendable. I remember an excellent quote</div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<b><i>Good code is its own best documentation. As you're about to add a comment, ask yourself, "How can I improve the code so that this comment isn't needed?" ~Steve McConnell </i></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<br /><b><i><o:p></o:p></i></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<b><i><o:p></o:p></i></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;">
<b>5.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-weight: normal; line-height: normal;"> </span></b><b>Spend more time in analyzing the problem, you’ll need less time to fix it<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
Spend more time in understanding and analyzing the problem and designing solutions for it. You will find the rest of the things quite easily doable. Designing not always mean using modeling languages and tools, it can be as simple as looking at sky and thinking solution in your mind. Those who have habits of pressing keyboard (for coding) the moment get the problem, usually ended us something different than the requirement.</div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<b><i>If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it. ~Richard Pattis</i></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<br /><b><i><o:p></o:p></i></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<b><i><o:p></o:p></i></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;">
<b>6.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-weight: normal; line-height: normal;"> </span></b><b>Be the first to analyze and review your code<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
Although a bit difficult, but try to break your own code before others can and with the time you will learn to write close-to-bug-free code. Always do a close and unbiased review of your code. Also never hesitate to take others view on your code. Working with good programmers and taking their feedbacks will surely help you become a good programmer. </div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;">
<b>7.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-weight: normal; line-height: normal;"> </span></b><b>Don’t dismay yourself by looking at changing technology world<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
Over these periods in IT industry, I met with many people who are either disappointed by their work or even left it to search new job saying they want to learn and work in latest technologies. I don’t see any problem with this aspiration but the very first incorrect word is the ‘latest technologies’. What we are hearing everyday and mean here is new tools, APIs, frameworks and others means coming up everyday to make the programming easier and quicker. This anyway will continue in technology world. But what needs to be understood is that the core and basic technologies changes with much lesser pace than frameworks, tools and APIs around it. This is like the sea where the surface water moves very rapidly but the deep water is relatively calm and concentrated and most of the aqua lives survive here. So, feel yourself in that deep water and close to core technologies. For e. g. in Java enterprise world, lots of web frameworks exist and new ones coming every other week. But the core concepts of request based client-server communication, MVS pattern, filters/servlets/JSP, resource bundling, XML parsing etc remains same. So spend more time in learning these core concepts rather than worrying about ever changing frameworks and tools around it. Believe me, with the foundation of core concepts, you will always find easier to learn new frameworks, tools and APIs. </div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;">
<b>8.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-weight: normal; line-height: normal;"> </span></b><b>Work-around don’t work for longer time<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
Many times software programmers implement work around solutions (may be because of lack of time, lack of problem understanding or lack of technology experience). But over the period these work around solutions always resulted in corrupting the code, making it less extendible and maintainable and lot of wastage of time later on. Always prefer to implement when you know the in-out of the solution. I understand that it becomes unavoidable in some circumstances, but it’s like, one should speak truth always but you tell lie in some circumstances. </div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;">
<b>9.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-weight: normal; line-height: normal;"> </span></b><b>Read documentation<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
One of the essential habits of good programmer is that they read lots of documentation. May it be specifications, JSR, API documents, tutorials etc. Reading documents helps you creating that essential foundation based on which you program in best of the way. </div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;">
<b>10.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-weight: normal; line-height: normal;"> </span></b><b>You can learn from others code as well<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
I interacted with some excellent programmers who actually have java source project inside their IDE all the time and read/refer that in daily work. They do it not only to fulfill their appetite of knowing the basics but also to learn ways of writing good programs. Reading and referring reliable and known open source code or your senior’s code, can also help you making your programming better. </div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<br /></div>
<div class="MsoListParagraphCxSpLast" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 10pt 0.5in; text-align: justify;">
<o:p></o:p></div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 10pt; text-align: justify;">
<b>And the last, not listed above: Don’t compare yourself with others<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpFirst" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
Your comparison of yourself with others will only result in evolution of negative feelings and un-healthy competition. Everyone has got his or her strengths and weaknesses. It is more important that we understand ours and work on it. I have seen many times that so called ‘fundoo-programmers’ (fundamentally strong programmer) also make silly mistakes. So, analyze yourself, list down your areas of improvement and work on it. Programming is a real fun, enjoy it.</div>
<div class="MsoListParagraphCxSpMiddle" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 0.0001pt 0.5in; text-align: justify;">
<o:p></o:p></div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px; margin: 0in 0in 10pt; text-align: justify;">
<b><i>Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ~Martin Fowler</i></b></div>
</div>
Anonymoushttp://www.blogger.com/profile/15195473531615901707noreply@blogger.com3