Tuesday, August 5, 2014

Rough guide to write Oracle / SQL queries


          Guide to write Oracle / SQL queries:

          *-*-* IS NOT operator *-*-*
SELECT CUSTOMER_ID, is_default from TABLEcustchannelacct where is_default <> '0';
                                               
*-*-* Query update (DATE, TIME) & Sysdate *-*-*
Login from root
>root
>Password
 (Format: date MONTH DD HH MM YYYY) that is
date Month Date Hour Minute Year
date  07        03       10      53        2014
Select sysdate from dual;
-UPDATE TABLEcfgchannelstatus
SET code=03
WHERE code=02
-UPDATE TABLEaccount
SET TITLE='NASIB GUL', BranchID = '9991', Last_Updated = '23-AUG-12'
WHERE account_id= '3110575202275';

*-*-* Renew Database User password *-*-*
alter user user identified by password;

                             *-*-* (Creation of table and insertion of data from other table) *-*-*
Create table ARBAB as select *from TABLEACCOUNT;
Insert into ARBAB select *from TABLEACCOUNT; table1.cnic != table2.cnic
Commit
CREATE TABLE Sort1
(
CNICIB varchar(255),
CNICUSER varchar(255)
)
                                                *-*-* Aggregate functions {COUNT, AV} *-*-*
                                                                               
1-      SELECT COUNT(*)FROM TABLECUSTOMER;
2-      SELECT AVG(channelid) FROM TABLECFGCHANNEL;
                                                                                               
                                                                *-*-* DISTINCT or UNIQUE*-*-*
Select DISTINCT institutionid from TABLEguirole;
Select UNIQUE institutionid from TABLEguirole;

 *-*-* IN Operator *-*-*
SELECT * FROM TABLEcustchannelacct
WHERE channel_id IN ('0105','0107')
                                                 *-*-* WHERE *-*-*
1-      Select *from TABLEguirole where institutionid = '0002';
2-      Delete from TABLECUSTOMER where CUSTOMERID < '00012277';
3-      Select *from TABLECUSTCHANNELACCT where channel_id = '0120'; (To have the whole ROW of channel_id of 0120)
4-      Select channel_id from TABLECUSTCHANNELACCT where channel_id = '0120'; (To have only the column of channel_id 0120)
*-*-* AND/OR *-*-*
The AND operator displays a record if both the first condition and the second condition is true.
p             q             p AND q
T              T                 T
T              F                 F
F              T                 F
F              F                 F
The OR operator displays a record if either the first condition or the second condition is true.
p             q             p OR q
T              T                 T
T              F                 T
F              T                 T
F              F                 F
1-Select *from TABLEguirole where institutionid = '0002' AND role_id = 'full access';
2-SELECT CUSTOMERID
FROM TABLEcustomer
WHERE customerid > 6110148910985
OR (customerid <  8 AND customerid > 6)
*-*-* IN *-*-*
SELECT *
FROM TABLECUSTCHANNELACCT
WHERE Channel_ID IN ('0007', '9999')
Multiple values in a WHERE clause; Used for equals to 0007 OR 9999
Gives exactly the value of the returned values we want to see.
The ‘In’ has to be inside the Where clause (it's not an order statement, is a select statement).

                                                                *-*-* BETWEEN *-*-*
SELECT *
FROM TABLECUSTOMER
WHERE DATEOFBIRTH BETWEEN '19820419' AND '19650329';
SELECT *
FROM TABLEeodtracelog
WHERE "DATE" between '20140108' and '20140108';

                                                                *-*-* LIKE (Wildcards)*-*-*
                               
SELECT *
FROM TABLEguirolepermission
WHERE ROLE_ID LIKE '%institution2%'
                                                                *-*-* ORDER BY ASC/DSC *-*-*
                SELECT ROLE_ID,NAME,INSTITUTIONID
FROM TABLEGUIROLE
ORDER BY INSTITUTIONID  ASC
1-      Select Error_Code, ERROR_NAME,ERROR_DESCRIPTION,IMAGE_FILE,ERROR_CATEGORY
from TABLEcfgerrorcodes ORDER BY Error_CODE ASC;
2-       SELECT * FROM TABLECUSTCHANNELACCT
WHERE Channel_ID IN ('0007', '9999','0001')
ORDER BY Channel_ID ASC;
4- Select PAN, date_sett from TABLEtransactionlog
where date_sett is not null
order by date_sett asc
                                                         *-*-* FUNCTIONS (Aggregate, Scalar)*-*-*
SELECT AVG (CUSTOMERID)
FROM TABLECUSTOMER
For Scalar Functions
1-SELECT LENGTH(RELATIONSHIP_ID)
FROM TABLECUSTCHANNELACCT
2-SELECT LENGTH ('This sentence''s length will be calculated') "Length of characters"
FROM dual;                                        
Note: Here 1 extra apostrophe shows that sentence did not end there it continues.
http://oreilly.com/catalog/sqlnut/chapter/ch04.html
Oracle/PLSQL: Dealing with apostrophes/single quotes in strings
http://www.techonthenet.com/oracle/questions/quotes.php

*-*-* GROUP BY *-*-*
SELECT Channel_ID, SUM(Account_ID)
FROM TABLEcustchannelacct
GROUP BY Channel_ID
Note: 'Now this way individually sums of Account_ID for all channel_ID will show.'
                                                                *-*-* HAVING, GROUP *-*-*

1-SELECT SUM(ACCOUNT_TYPE)
FROM TABLECUSTCHANNELACCT
HAVING SUM(ACCOUNT_TYPE) >10
2-SELECT IS_DEFAULT, SUM(ACCOUNT_TYPE)
FROM TABLECUSTCHANNELACCT
GROUP BY IS_DEFAULT
HAVING SUM(ACCOUNT_TYPE) > 10
3-SELECT CUS_SHO_NAME, avg (cus_num)
FROM customer_acct_type
GROUP BY CUS_SHO_NAME
HAVING AVG(CUS_NUM) > 0
*HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions.
*-*-* Alias, without As & JOINS *-*-*
                                                                                (Table alias)
1-      SELECT CHANNEL_ID, IS_DEFAULT from TABLEcustchannelacct ImTbAlias WHERE ImTbAlias.IS_DEFAULT = 1;

2-      SELECT CHANNEL_ID, IS_DEFAULT from TABLEcustchannelacct ImTbAlias WHERE IS_DEFAULT = 1;

(This will also run even without table alias before the column as there is no other table’s column which has the same name)

                                                                                (Column alias)
3-      Select channel_id ImClAlias from TABLEcustchannelacct;
(Alias, with As but not using JOINS)
1-      Select Is_Default, channel_id AS ClAlias from TABLEcustchannelacct TbAlias where IS_DEFAULT=1;
&
2-      Select Is_Default, channel_id AS "ClAlias" from TABLEcustchannelacct TbAlias where IS_DEFAULT=1; (Col. Alias with inverted commas)
&
3-      Select Is_Default, channel_id AS ClAlias from TABLEcustchannelacct TbAlias where TbAlias.IS_DEFAULT = 1; (Col. after where with table alias)
&
4-      Select TbAlias.Is_Default, TbAlias.channel_id AS ClAlias from TABLEcustchannelacct TbAlias where TbAlias.IS_DEFAULT = 1; (Col. before and after with table alias)
               
5-      Select * from TABLEaccount, TABLEcustchannelacct where
TABLEaccount.account_id = TABLEcustchannelacct.account_id;


6-      Select TABLEaccount.account_id, TABLEcustchannelacct.account_id from TABLEaccount, TABLEcustchannelacct where TABLEaccount.account_id = TABLEcustchannelacct.account_id;

*-*-* AS, GROUP BY *-*-*
1- Select count(*) as Total, error_category from TABLEcfgerrorcodes group by error_category order by total desc
2- Select * from TABLEguiuserrole where user_id='arbab';
3-SELECT * from TABLEregioninstitution where regionid='1900';

*-*-*-* Inner Joins (Implicit) *-*-*-* Equi-join
1-Select A1.Account_type,A1.Title, A2.Channel_id,A2.Account_type
from TABLEaccount A1, TABLEcustchannelacct A2
where A1.Account_type = A2.Account_type;
2-Select a1.CUSTOMERID, b1.customer_id
from TABLEdebitcard a1, TABLECUSTOMERBENEFICIARY b1
where a1.CUSTOMERID = b1.customer_id
               *-*-*-* Inner joins (Explicit) of the same query above*-*-*-*
Select A1.Account_type,A1.Title, A2.Channel_id,A2.Account_type
from TABLEaccount A1
INNER JOIN TABLEcustchannelacct A2
on A1.Account_type = A2.Account_type;
*-*-*-* Inner Joins (Implicit) with group by*-*-*-*
Select A1.TITLE (You may write Column alias here), SUM (A2.Account_ID) (You may write Column alias here)
from TABLEaccount A1, TABLEcustchannelacct A2
where a1.account_type = a2.account_type
group by a1.TITLE


*-*-*-* Outer Joins *-*-*-*
Outer join. With an outer join, you get all the records from one table and only those records from the other table that have matching values from the first table.
        *-*-*-*-* Concatenation *-*-*-*-*
1-Select concat (RELATIONSHIP_ID,TRAN_PERM)
from TABLEcustchannelacct
where account_type = '20';
(Note: The Oracle CONCAT() function only allows two arguments -- only two strings can be put together at a time using this function. However, it is possible to concatenate more than two strings at a time in Oracle using '||'.)
2-Select RELATIONSHIP_ID || ' ' || ACCOUNT_TYPE || ' ' || TRAN_PERM
from TABLECUSTCHANNELACCT
where account_type = '20';
*-*-*-*-* Subquery *-*-*-*-*
You know account_id but not the Title of the account,
Select Title from TABLEaccount where ACCOUNT_ID  in (select ACCOUNT_ID
from TABLEcustchannelacct
where ACCOUNT_ID like '477900783901%')
Ans. Imran Ahmed

Select Title,account_id from TABLEaccount where ACCOUNT_ID  in (select ACCOUNT_ID
from TABLEcustchannelacct
where customer_id='000000015432');
Ans.       Irfan Bin Ilm       20100043149        
Irfan Bin Ilm       20200030032        
Irfan Bin Ilm       20300030032        
Irfan Bin Ilm       20400030032        
Irfan Bin Ilm       20500030032        

Select * from TABLEhosttrail where trxlogid in (select trxlogid from TABLEtransactionlog where product_id in ('4290','4291','4292'));
Select * from TABLEhosttrail where trxlogid in (select trxlogid from TABLEhosttrail where trxlogid in (select trxlogid from TABLEtransactionlog where product_id in ('4290','4291','4292')));
Select customerid,firstname from TABLEcustomer where customerid in
(Select customer_id from TABLEcustchannelacct where account_id like '%70000000234         %');
Ans.
Customerid        Firstname
000000000212    SyedQaim

Select  relationship_id,tracking_id,expirydate from TABLEdebitcard where ISCUSTOMERLINKED='1' and
cardnumber not in ( select cardnumber from TABLEnipushsms);
Select * from TABLErelationshipauth
where relationshipauth_id in (Select relationshipauth_id from TABLEcustchannelacct
where (substr(RELATIONSHIP_ID, 0, 16) in ('6369620030000415','6369620030000506')) and channel_id= 0001);

*-*-*-* Substring *-*-*-*
1-SUBSTR (Columns, Starting position, length)
Select SUBSTR (RELATIONSHIP_ID ,3)
From TABLECUSTCHANNELACCT
where RELATIONSHIP_ID = '1400001001000100=1602';
2-SELECT SUBSTR (RELATIONSHIP_ID,1,10)   --Start from 1 and end the result on 10th
FROM TABLECUSTCHANNELACCT
WHERE RELATIONSHIP_ID = '1400001001000100=1602';
3-SELECT SUBSTR('ABCDEFGhijklmno',3,6) "Substring"
FROM DUAL;
Ans.: CDEFGh
4- SELECT SUBSTR('ABCDEFGhijklmno',-5,6) "Substring" -- Oracle counts backward from the end
     FROM DUAL;
Ans.: klmno
5- Select * from TABLEcustchannelacct
where (substr(RELATIONSHIP_ID, 0, 16) in ('6369620030000415','6369620030000506')) and channel_id= 0001;
*-*-*-* Trim & Length *-*-*-*
1-SELECT RTRIM(RELATIONSHIP_ID)from TABLEcustchannelacct;
2-Select length (RELATIONSHIP_ID) from TABLEcustchannelacct;
select * from TABLEaccount where trim (account_id) = '00630021156001'

Both RTRIM and Length functions:
3-SELECT RTRIM(Account_id) || ' -- '|| length (RTRIM(Account_id)), length (Account_id)  from TABLEACCOUNT;
4-select log_feedback_id from TABLEimplogcustomer where Trim(cnic) like '%33100288099991%'
5-where trim(mgr_branch_migration.NEWACCOUNT) in (
select trim(Account_id) from TABLEcustchannelacct Where substr(trim(Account_id),1,4) = substr(trim(mgr_branch_migration.NEWACCOUNT),1,4)


*-*-*-* Replace *-*-*-*
Region_name = Column, replace wherever it finds ‘ast’ with ‘astern’
1-SELECT REPLACE (region_name, 'ast', 'astern')
FROM Geography;
2-Select replace (TSN,'23',00)
FROM arch
*-*-*-* Creating table *-*-*-*
CREATE TABLE customer
(First_Name char(50),
Last_Name char(50),
Address char(50),
City char(50),
Country char(25),
Birth_Date date)
         *-*-*-*Add Column Syntax *-*-*-*
ALTER TABLE arbab ADD age char(10);
*-*-*-* Change the data type of a column *-*-*-*
1-ALTER TABLE arbab MODIFY age char(100);
2-ALTER TABLE arbab MODIFY age varchar(100);
 *-*-*-* Rename Column *-*-*-*
ALTER TABLE arbab RENAME COLUMN age TO Address;
      *-*-*-* Drop Column *-*-*-*
ALTER TABLE arbab drop column age;

*-*-*-* Add Constraint Syntax *-*-*-*
ALTER TABLE arbab ADD CONSTRAINT constraint_name UNIQUE (IDs);


*-*-*-* Drop Constraint Syntax *-*-*-*
ALTER TABLE arbab DROP CONSTRAINT constraint_name

*-*-*-* CHECK Constraint *-*-*-*
1-Alter table arbab
ADD CONSTRAINT Con_Name CHECK(GENDER='Male' OR GENDER='Female')
2-(Better query): What if you have to check the values in the column in a lsit of 10 or more values. How many times you will write OR OR OR ....?
That is the reason the values are check with IN (.,.,...) operator.
Alter table arbab
add constraint ck_abc
check (gender in ('MALE', 'FEMALE'));
Insert into arbab values ('abc','34343','99','');
Insert into arbab values ('abc','34343','99','Male');
Note: Insert value only work for either Male or Female or it enters a null.
*-*-*-* DROP COLUMN *-*-*-*
ALTER TABLE table_name
DROP COLUMN column_name;
*-*-*-* RENAME COLUMN *-*-*-*

ALTER TABLE table_name
 RENAME COLUMN old_name to new_name;

*-*-*-* To find which table has ‘TRAILID’ column ( WAQAS )*-*-*-*
Select table_name from user_tab_cols where column_name like '%TRAILID%';
                                
 *-*-*-* To find packages of tables (Yousuf )*-*-*-*
select * from user_source where upper(text) like '%TABLEREGION%'
*-*-*-* To find which table has ‘TRIGGER’ column (AFTAB )*-*-*-*
   CREATE OR REPLACE TRIGGER TABLEdebitcard_after_insert
    AFTER INSERT
        ON TABLEdebitcard
        FOR EACH ROW
    DECLARE
        v_username varchar2(10);
    BEGIN
       INSERT INTO TABLEDEBITCARDTRAIL
         (cARDNUMBER,
TIME
           )
        VALUES
         ( :new.CARDNUMBER,
           TO_CHAR(sysdate,'YYYYMMDDHH24MISS')
         );
    END;
*-*-*-**-*-*-**-*-*-*
select * from all_all_tables where owner like '%USER%' and table_name like 'MV%'
delete from all_all_tables where owner like '%USER%' and table_name like 'MVTRANSACTIONLOG'
*-*-*-**-*-*-**-*-*-*

 

A trigger is an event within the DBMS that can cause some code to execute automatically.

SQL>
SQL>
SQL> create table company(
  2     product_id        number(4)    not null,
  3     company_id          NUMBER(8)    not null,
  4     company_short_name  varchar2(30) not null,
  5     company_long_name   varchar2(60)
  6  );

Table created.

SQL> insert into company values(1,1001,'A Inc.','Long Name A Inc.');

row created.

SQL> insert into company values(1,1002,'B Inc.','Long Name B Inc.');

row created.

SQL> insert into company values(1,1003,'C Inc.','Long Name C Inc.');

row created.

SQL> insert into company values(2,1004,'D Inc.','Long Name D Inc.');

row created.

SQL> insert into company values(2,1005,'E Inc.','Long Name E Inc.');

row created.

SQL> insert into company values(2,1006,'F Inc.','Long Name F Inc.');

row created.

SQL>
SQL> create table product_audit(
  2     product_id number(4) not null,
  3     num_rows number(8) not null
  4  );

Table created.

SQL>
SQL>
SQL> CREATE OR REPLACE TRIGGER myTrigger
  2  AFTER INSERT ON company
  3  FOR EACH ROW
  4  BEGIN
  5    UPDATE product_audit
  6    SET num_rows =num_rows+1
  7    WHERE product_id =:NEW.product_id;
  8    IF (SQL%NOTFOUND) THEN
  9      INSERT INTO product_audit VALUES (:NEW.product_id,1);
 10    END IF;
 11  END;
 12  /

Thursday, November 14, 2013

The only way Pakistan can improve its Batting, Fielding, Bowling & save their Cricket...(My opinion)




Batting:
These days everyone laughs at our batting, once Steyn could not control it in an international match, He Laughed at Mohammad Hafeez (then Captain) After Taking His Wicket which he did for countless of times, watch video:
http://bit.ly/1fDZ0bG

After watching and suffering from continuous and consistent batting failures of Pakistani cricket team, the only way Pakistani batting can improve is by continuous coaching sessions and sittings from ex Pakistani great batsmen like Hanif Muhammad, Zaheer Abbas, Javed Miandad, Inzamam ul Haq, Saeed Anwar and it must be regular; and 
-After every month check the progress of players, did they improve on their weakness?
-This should continue for at least 1 year for final report and then next batch comes
-It'll be even better if above mentioned players have their coached junior teams play against each -Other, let see who produce better batsmen and players.

This should be the practice for Under 15, 17, 19 teams, as they have more tendencies to learn than those players who are already playing for Pakistan.

And if PCB wants a foreign coach who is a batsman then bring a big name like Steve Waugh he might ask big amount but nobody can make fun of him, he was a great batsman, great captain, strict, disciplined, it will be better to appoint him to young teams of under 15, 17, 19
PCB authorities must work on this otherwise there is no hope of improvement and our cricket will be finished like our Squash and Field Hockey.

Fielding:
Pakistan needs fielding emergency, PCB must bring foreign proven good fielding coaches for Under-17 / 19 level and to PCB Cricket academies and have lectures to domestic team at least, so the fielding culture starts at the grass root level otherwise Pakistan will remains a worst fielding side.


Bowling:
PCB must give money to former greats like Wasim, Waqar, Shoaib, Mushtaq Ahmed, Saqlain Mushtaq, Abdul Qadir, Aqib Javed (who knows about bio-mechanics as well) to work with
Under-17 / 19 level and to PCB Cricket academies and have lectures to domestic team at least so Pakistan will regain their status of aggressive bowling lineup. 


My other related blog:

Suggestion to regain PRIDE in sport of Pakistan

My views on 2011 Cricket World Cup & on losing again to India in world cup

Sunday, April 21, 2013

-پاکستان میں الیکشن اور ووٹ کی طاقت Election in Pakistan & the power of Vote.











There is a Hadith:

“A believer is not bitten twice from the same hole.” (A believer is not mistaken twice with the same fault).
[Bukharee, adab (Manners), 83; Muslim, Dhuhd (Adherence to Devotions), 63]

                                                                       ---  ***** ---



 


                                                                          --- *** ---




Vote dayna lazm hai?
Aanay walay elections main vote dyna hm pr lazm hai, kyon k vote k zaryae hee hm, boray hukumranon say nijaat aur sahi-o-muklis logon ko apna hukumraan muntakhib kr sktay hain.
Poranay logon ko vote daynay walon ko haq nahi k wo Shikayat krain k kyon bijli nahi, halaat kharab hain, naukri nahi, jan-o-maal mehfoz nahi etc... kyon k inhee logon ko phelay bhi vote dia tha, aur aisay halaat ka saamna krna pra, phr unhee logon ko dobara muntakhib krwanay ka kia mtlab hai?, un hee logon ko vote dae kr tbdeeli ko aiheeni hathon say kyon rokna chahtay hain? Tou phr aisay log rotay kyon hain? 'Inko ronay ka koi haq nahi, sirf wo log masayal pr bol sktay hain jo iss mahool say nijaat k liae vote dynay ka irada rkhtay hain'.

Tassub pr mbnee vote:
Allah k vaastay merit pr vote dain na k tassub, zaat aur bradree pr, agr aap aisay logon ko vote daingay jo merit pr hain tou hr faisla sirf aur sirf merit pr hee kray ga na k tassub, zaat aur bradree pr.Tassub, zaat aur bradree pr vote dyna bhi hamary mulk k sb say bara almiyon main say aik hai.

Election main dhandlee:
Election main dhandlee k khilaaf hm sbko apnay tour pr tayyaree krni hogee, kyon k aisee parties jinhain apnee salahiton pr bharosa nahi, haar k drr aur loot khasoot k shauq k liae yae phr js qadr ho sakayga dhandlee krain gee, main yae nahi kehta k hm ghundon aur badmashon say aamnay saamnay laraee krain, bl k technology ka shara lain, kahin dhandlee dekhain tou internet pr NEWS Channels ko foran email krain anchor persons ko email krain, apnay mobile say sound record krain, agr moqa milay tou video bnain risk kbhi na lain, Twitter aur Facebook pr bhi ehtiyaat krain kyon k bdmashon ka koi deen eemain nahi hota,in logon ko baynaqaab kiae baghair aisay logon, kamoon aur borayyon say chotkara mumkin nahi.

Vote kee taqat ko smjhain:
Vote daynay say km az km hm khud aur siasat daan vote kee taqat ko pehchaan skain gay, k agr tm sahi hukumranee nahi karo gay tou phr jeetnay kee ummed na lgana, hm dosray mulkon ko dekhain jaisay America,Turkey,Iran aur jahan bhi vote k zaryae musalsl hukumatain bntee aur grtee hain,tou in mulkon k hukumaron k sron pr hr waqt tlwarain ltkee rehtee hain k inko awam k kaam krnay hongay wrna phr awamaee rddaeamal aur hukumat khonay aur phr na milnay ka khauf lga rehta hai, hm apnay riwaetee hareef Bharat hee ko dekhain, wahan bhi yae sb borayan hain, un k hukumraan bhi mulk ko loot tay hain, mgr kuch mulk pr bhi inko kch lgana prta hai, jis kee wajah say hm dekhain k Bharat ab ktnee taraqee kr raha hai,kyon un k sron pr bhi na muntakhib honay kee tlwarain ltkee rehtee hain, jis wajah say unhain awaam k liae kaam krna prta hai.

Hm kyon nahi:
In mulkon main awaam apnay vote kee taqat ko jaan chokay hain tou hm kyon nahi, aur yaehi wajah hai k in hukumranon ko apnay mulk k liae kaama krna prta hai aur mulk taraqee kr raha hai.

1 din kee zara c tkleef ya 5 saal kee bari tkleefain?
Aik din kee thori tkleef uthaa kr aanay walay paanch saalon k kee baree tkleef say bchnay k liae apnay vote ka sahi istimaal krain.

                                   ****************** Attention *******************

Check Your Polling Station Name in 3 Easy Steps:

Send your CNIC (without Dashes) to 8300 (e.g .. 123456789098 --> 8300)

and in reply you'll get the name of your polling station with NA number

Check Your Polling Station Name, NA and PS visit http://whereismyballot.com/index.php

Sunday, April 14, 2013

Review on 'Sony Xperia Sola' mobile phone

I have purchase 'Sony Xperia Sola' on 24th December 2012, so I am sharing my experience and observation with you, for clarity in three headings:

Vantages:

1- Hardly hangs in any of the operations
2- Amazingly reactive touch screen
3- Great themes, especially its main picture
4- Good provided ringtones
5- Wow, picture quality
6- SmartTags are a good thought, but for those who have to open few things at the same time


Minuses:

1- No front camera, alasss.......
2- Speakers are not that powerful, and also they are behind the mobile but has 3D surround sound enhancement which is even Sony Xperia's prime mobile Xperia Z lacks
3- It hurts when your friend's Samsung having good WIFI signals, and you're Xperia Sola is disconnecting off and on (It happened only once, but Sony has a very high standards, so I am writing it as a minus even it happened only once)
4- Android version is 2.3.7 (Gingerbread), you may find information that its upgradable to Android 4.0 (Ice cream sandwich) but when you try to update software through 'Sony PC Companion 2.1' it says that softwares are already updated, so you may have to find another way
5- Setting Alarm, you can easily understand from one example, i.e. if the time is set 2:30 and you want to set it to 3:00, then you have to scroll minute section 6 times.

Neither good nor bad:

1-Its new technology of  'Magic Touch or Floating Touch', after the enhancement of this technology this can be the future delight but not now, you need hours and hours practice to touch the icons, all you can do easily with this is to play with the theme's main picture but the wallpaper which animate with magic touch its phenomenal 
2- Battery life is neither great nor very bad but somewhere in between

Conclusion:

All in all a very good mobile for those who wants to purchase a good Android mobile which is not very expensive.

For more about this phone:
http://www.sonymobile.com/global-en/products/phones/xperia-sola/
and
http://www.gsmarena.com/sony_xperia_sola-4408.php 



My related blog:
Review on 'Sony Ericsson Xperia X10 Mini Pro', Nokia 101 & Samsung C160 Mobile Phones, its Vantages and Minuses
http://bit.ly/w3es4S