Team Webpers

Team Webpers

after long break i think i need to start writing. so many topics pops in my mind; specially on Digital marketing and its growth in Bangladesh. Last 3+ years Webpers try to educate in our industry about social media marketing with the help of apps development, creative content development, online advertisement, Query Management and lot of elementary task.

thinking to write next : online advertisement aspect, usages & impact in Bangladesh Business Market.

How does SQL JOIN clause works: Part –I (a little bit theoretical?)

A SQL JOIN clause is important issues in database operation. Actually one of my friend asked me – what are the different types of joining and how those joining are working. And what is the basic difference between them? Well in our daily life 😀 we are using different types of database like DB2, MS SQL Server, Oracle, mysql etc. I like mysql because it is an open source database. But the entire database use same SQL command. SQL – structure query language; it is a slandered query language for all database. Currently I am using mysql for all of my development that’s why all I am talking about in the context of mysql.

A SQL JOIN clause works on more than one table. In our practical life we used 3rd normal relational database(RDBMS). That’s why only one table can’t represent any meaning full data or entity. So JOIN clause combines record from two or more relational table and create a new temporary table that is “join table”.
Well in our daily life (those who are live with development 🙂 ) we are using two types of JOIN clause.

  1. INNER JOIN
  2. OUTER JOIN

INNER JOIN:
An inner join essentially combines the records from two tables (A and B) based on a given join-predicate. The SQL-engine computes the Cartesian product of all records in the tables. Thus, processing combines each record in table A with every record in table B. Only those records in the joined table that satisfy the join predicate remain. This type of join occurs the most commonly in applications, and represents the default join-type.
And also there are two different syntactical ways to express joins. One is “explicit join notation” where we used JOIN keywords and another is “implicit join notation”.
Example of an explicit inner join:

SELECT *
FROM table_1
INNER JOIN table_2
ON table_1.field = table_2.field

Example of an implicit inner join:

SELECT *
FROM table_1, table_2
WHERE table_1.field = table_2.field

There are three types of inner joins

Equi-join
An equi-join is a specific type of comparator-based join, or theta join, uses only equality comparisons in the join-predicate.

SELECT *
FROM table_1
INNER JOIN table_2
ON table_1.feild_1 = table_2.feild_1

The resulting joined table contains two columns named field_1, one from table table_1 and one from table table_2.

Natural join
A natural join offers a further specialization of equi-joins. The join predicate arises implicitly by comparing all columns in both tables that have the same column-name in the joined tables. The resulting joined table contains only one column for each pair of equally-named columns.

SELECT *
FROM table_1 NATURAL JOIN table_2

Using the NATURAL JOIN keyword to express joins can suffer from ambiguity at best, and leaves systems open to problems if schema changes occur in the database. For example, the removal, addition, or renaming of columns changes the semantics of a natural join. Thus, the safer approach involves explicitly coding the join-condition using a regular inner join.

Cross join
A cross join or cartesian join provides the foundation upon which all types of inner joins operate. A cross join returns the cartesian product of the sets of records from the two joined tables. Thus, it equates to an inner join where the join-condition always evaluates to True.
If A and B are two sets, then cross join = A X B.
Example of an explicit cross join:

SELECT *
FROM table_1 CROSS JOIN table_2

Example of an implicit cross join:

SELECT *
FROM table_1, table_2;

The cross join does not apply any predicate to filter records from the joined table. some times we can further filter the results of a cross join by using a WHERE clause.

OUTER JOIN
An outer join does not require each record in the two joined tables to have a matching record in the other table. The joined table retains each record—even if no other matching record exists. Outer joins subdivide further into left outer joins, right outer joins, and full outer joins, depending on which table(s) one retains the rows from (left, right, or both).
(For a table to qualify as left or right its name has to appear after the FROM or JOIN keyword, respectively.)

Left outer join
The result of a left outer join for tables A and B always contains all records of the “left” table (A), even if the join-condition does not find any matching record in the “right” table (B). This means that if the ON clause matches 0 (zero) records in B, the join will still return a row in the result—but with NULL in each column from B. This means that a left outer join returns all the values from the left table, plus matched values from the right table (or NULL in case of no matching join predicate).
Example of a left outer join:

SELECT *
FROM table_1
LEFT OUTER JOIN table_2
ON table_1.feild_1 = table_2.feild_1

Right outer join
A right outer join closely resembles a left outer join, except with the tables reversed. Every record from the “right” table (B) will appear in the joined table at least once. If no matching row from the “left” table (A) exists, NULL will appear in columns from A for those records that have no match in A.
Example right outer join:

SELECT *
FROM table_1
RIGHT OUTER JOIN table_2
ON table_1.feild_1 = table_2.feild_1

Full outer join
A full outer join combines the results of both left and right outer joins. The joined table will contain all records from both tables, and fill in NULLs for missing matches on either side.
Example full outer join:

SELECT *
FROM table_1
FULL OUTER JOIN table_2
ON table_1.field_1= table_2.field_1

mysql database systems do not support this functionality directly, but they can emulate it through the use of left and right outer joins and unions. The same example can appear as follows:

SELECT *
FROM table_1
LEFT JOIN table_2
ON table_1.field_1 = table_2.field_1
UNION
SELECT *
FROM table_1
RIGHT JOIN table_2
ON table_1.field_1 = table_2.field_1
WHERE table_1.field_1 IS NULL

or as follows:

SELECT *
FROM table_1
LEFT JOIN table_2
ON table_1.field_1 = table_2.field_1
UNION
SELECT *
FROM table_2
LEFT JOIN table_1
ON table_1.field_1 = table_2.field_1
WHERE table_1.field_1 IS NULL

or as follows:

SELECT *
FROM table_2
RIGHT JOIN table_1
ON table_1.field_1 = table_2.field_1
UNION
SELECT *
FROM table_1
RIGHT JOIN table_2
ON table_1.field_1 = table_2.field_1
WHERE table_1.field_1 IS NULL

there are some algorithm for implement this JOIN clause. you could study more on this topic. and if you want to study about SQL JOIN clause then there are lots of site. but i can give you some they are really help full to understand how the SQL JOIN clause working specially for newbie 😀 .

hopefully all the above information will help you to understand SQL JOIN clause 🙂 and i am also hope full to manage my times and post Part – II (the total practical of mysql JOIN) so see you soon here 😀

My first project with CakePHP and Scriptaculous framework

Recently I completed a project named “MSc Online Application”. I got freedom to choose tools for that project. Last six months I did some project using raw PHP. In this time I thought I have to do some R&D with PHP framework and also JS framework. So 🙂 I selected CakePHP and Scriptaculos for my “Msc Online Application” project. An interesting thing is that I assigned that project after press advertisement is waiting for release. Means our management sent advertisement to print media and they fixed the publishing Date. At that time I didn’t know any thing about CakePHP and Scriptaculous Lib.  So think how much brave I am!!  🙂  I had only 7 days to implement that project skeleton and add functionality on user module. I was take that challenge and decided that I have to use those frame work. Honestly speaking I love this type of pressure but unfortunately I didn’t have it frequently. Thanks to Anwar sir for gave me that.  😀 

I just gave you a screen shot of that project “MSc Online Application“.

MSc Online Application

for demo user of this application : you can use the given information for login to the systems E-mail : “demo” password : “demo”

In brief how this application is working : This is a web based application for MSc prospective student of IUB (SECS). Using this website they could apply for masters program in their interested subject. In the manual process they had been coming at IUB more than 3 times and now instead of manual process, if he/she applies using website they will came at IUB only once. I think this is the first time any university introduces such things in Bangladesh. he he he actually I don’t know is that statement true or not. 😀 that’s why IUB is always one step ahead from others. Truly after we had got some phone calls from outside of Dhaka we felt the necessity of this sort of web application. So from now we can also expect a student from abroad  🙂 though at present we have some.

Now come to the administrative view. Actually this time we are testing our application after that we are complete our systems process so I didn’t think a lot about admin user. They just monitor how many used is registered in this systems and how many of them applied for MSC program. Lastly I integrated a dynamic PDF in that project by which admin user could process an application for an online user.

if you interested enough to work with frameworks then i think  following links can help you a lot.

I think I learnt a lot to complete that project. I am looking forward for my next project but I don’t know when I get it. 😀

Visit at trippert Labs

Last Friday I went to trippert Lab’s. Actually I went there to meet Junal , but surprisingly i met hasin bhai. I think, I need not to introduce who is Hasin bhai, you know him better than me 😀 . i have been hearing about him from Junal , Anupom, Ahsan Bhai as well as from others people’s blog. all i heard how he is a great. And last Friday I felt it personally. truely I never saw as gentle as he is. That was a great moment when junal introduced me with him. He came out from his chair, gave me a smile with a handshake. And again did the same when I was leaving the office…

well you might want to know about Trippert’s environment… Well I like there environment. They can play some game there like TT,DART, even cricket also 😀 . They have a green room when you need to relax then you can go there and have some sweet dreams. Actually to me programmers are different from others means when my head is jammed you can not expect a good output from me. doesn’t matter how much “jhari” you give me. May be others do a routine job like 9-5 fix eight hours .

this is a good beginning by Trippert to change the Traditional office roles and regulations…..

Advantage of using open source Database:: MySql

There are lots of advantages of using open source product. It’s an ever true dialog and I felt it personally few days ago. I am very new user of PHP, MySql and others open source staff though till now i knew very little compare to others but i wanted to share some experience here. Recently, one senior of my organization gave me a problem on mysql actually on PMA [‘PHP My Admin’]. And I came with his solution less then a minute. I know it was very very childish problem but it was possible to came out a solution with in a minute because of it is an open source product.

Most of the time we are using a package of PHP,MySql, PHPMyAdmin for  windows OS. Like WAMP, XAMPP, APPSERV etc. whom I am talking about means that senior who gave me this problem, is very good developer in oracle and all its stuff. But he is just started his journey with open source product like mysql, php etc. so to using those entire thing first he installed WAMP in his OS.  Most of the time we don’t set a password for database “root” user. Now he wanted to set a password for “root” user. Actually he wanted to secure his database. For doing this he went to “localhost/phpmyadmin”  after that going to “Privileges” Tab and there he just set a password for “root”. So far all things went smoothly.

Just after changing root’s password, When he tried to login again he  just lost all access on phpmyadmin !!! as a result, he got the following screen. 

Access deny of mysql

What he could do now? He put him self in a trouble by setting a password on root user. At that moment he did lots of task like …uninstall WAMP, again install it,… trying with some other package ……and so on… all the time he got same error. Actually I never  tried to change “root’s” password…  what I did create a new user ….set a password and give an access that user on particular DB. So when he asked me “is it possible to change root’s password”.. I said  “obviously why not” and after that he told  “but I can’t use mysql” “what can I do”.   

I am also not used to this type of scenario. I installed WAMP … did same what he wanted… and kept same error. I read the error message and there I found “You should check the host, username and password in config.inc.php” and got the solution immediately. To solve his trouble I went to “\wamp\phpmyadmin” location and checked out “config.inc.php” open it in editor. And line number 73 ….i wrote root’s password.

$cfg[‘Servers’][$i][‘password’]      = ‘my_password’;          // MySQL password (only needed

🙂  I think this is only possible because mysql is an open source software.

Close to nature to get some Energy

I am tired with my monotonous regular life. Went to office, work there, took some foods, came back to home, took dinner and go to sleep. There was nothing dynamic in our life. Now I have got a change to refresh my self because we have got three days holiday 14-16 December. Today we decided to going to nature as close as possible. This time we are going to Tetulia; last end of north of Bangladesh. I heard, from that place I will able to see kanchonjonga Hills and also heard, that will be a really beautiful scenery. So I am on the way to view that natural beauty.

we decided, first we will going to Dinajpur on Friday morning, we will visit Ram Sagor and Kantajir Mondir after that we will going to Tetulia that day evening, stay there one night and one day. So we take decision that we will going to Dinajpur by train. But when we went to komlapur to get our ticket we found there was no ticket. 😦 So what are we doing now? We took a decision we have go Dinajpur tonight. So we bought tickets upto Pabna. God know’s what will happened with us tonight??? Please pray for us. 🙂

So hope for the best. I will start my journey within 10min. 🙂 We will try to go as close as possible into nature and take long breath, try to store all the beauty in my mind …….actually try to get some energy for next few months.

SMS Push-Pull technology for M-learning and Information Services

  Actually I finished my undergrad last December [2006]. I was doing my internship at Datasoft from September’06 to December ’06. In the mean time I got an offer from my university to join there as an information systems analyst. It’s a great pleasure to get like this offer. I had taken a decision to join there. The responsibility of an information systems analyst is to making all the necessary development & maintances of web application and all kinds of network supports. At that time i didn’t know anything about PHP. Usually in university life, we were doing lots of programming with C/C++, Java, ASP etc but except PHP which is widely used scripting language for web application development. I remembered, in my senior project, I was working on parallel programming using JAVA RMI. It’s a huge work, I think but after finishing my senior project, I didn’t get any scope to use one line of code from that project. Okay I think may be I am going irrelevant to my topics. I will write those at later in some other head.

Now, come to the title, actually this was my third project after joining IUB. In the end of July, we took a plan that we [khalid bhai, sujan bhai & me] were working on distance learning issues. We were trying to establish some ingredient for e-learning in Bangladesh. Then we were doing some study work on that topic and finally we found our self that cell phone is most useable media for establish e-learning in Bangladesh. At present, Bangladesh has approximately 15 million 30 million cellular phone subscribers. then we were in big trouble?? How can we integrate cell phones in our educational systems? We decided to use cell phone to improve feedback process in our educational systems. How was it? Students can appear their exam using cell phone. On exam date they had to come to exam hall and they just get question paper nothing else. He or she must have a cell phone which is very common in our country. And they are submitting their answer through SMS (Short Message Service). Within a few seconds he or she gets their result via reply message. This is most instant feedback process ever done in educational systems in Bangladesh. We are proud to implement such a process in our university. It is not easy to developed but explain. So far IUB walks one step ahead from others. For pilot project we had taken one of the sections of MAT211 course in last autumn semester[2007]. We have also web based feed backing systems. for visit cilck here. It is keep all the record which delivered to the student.

When we took a decision to use sms for taking exam, we were study hard to implement this. We were very excited to develop such systems. We found we have to use a SMS GETWAY for broadcasting SMS. How we gonna manage this GETWAY.  🙂 At that time we got a strong help from one content provider company named “SSD-TECK“. They gave us a share of their SMS GETWAY and we were assigning a number i.e 2580 which is working for any operator in Bangladesh. I want to say, it was really an interesting one that I did in my short development life. You can try it now.

Goto your message option write “iub hello world” and sent to 2580 number from any cellular connection in Bangladesh.

And let’s see how much smart it is. at the end this semester[Autumn 2007] we can say that it is very good ingredient for establish e-learning in Bangladesh.

i believe it’s a pretty easy and cost effective to implementing automation in your organization through SMS. Currently we are thinking about this. From this semester we will publish our school’s course grade through SMS. It is very common; we have lots of students who are living outside Dhaka. After finishing their final exam they are not staying anymore at Dhaka. When grade will publishing they can not get it directly, they try to find out a friend who is staying in Dhaka and over the phone they try to get it. So isn’t it good system that he or she just sent a SMS like “IUB MYGRADE” and sent to 2580 and reply message it shows like “MAT211 – A, CSC405 – A+” etc. we can also manage notice board systems via SMS.