User talk:Danialnazir

select * from INFORMATION_SCHEMA.TABLES where tables.TABLE_NAME like '%insurance%' order by TABLE_NAME

Set Transaction Isolation Level Read Uncomitted Go Select Distinct

\\database-014\Asad Mahmood\FCU Queries\Daily

Select * from Std_corner where Std_Class = 'BCE' AND Gender = 'F'

Select Avg(Std_Cgpa) As CgpaAverage from Std_corner

Select Std_Name, Std_Session, STD_Cgpa from Std_corner Where Std_Cgpa > (Select Avg(Std_Cgpa) from Std_corner)

Select COUNT(Std_Class) as class, Count (Gender) as gender from Std_corner Where Std_Class = 'BCE' AND Gender = 'M' Select Std_Name, LEN (std_city)CityLen from Std_corner Select Std_Name, ROUND (STD_CGPA, 0)as Cgpa from Std_corner

14/06/13 Fri

Insert into Reg_Branch values (15,'BCE', '50000', 'NULL', 'O+') Delete From Reg_Branch where std_id = 4 and std_class = 'BTE' update Std_Corner set Enter_Date = '2012.12.01' where Std_ID = '15' Inner Join Select sc. std_name, sc. std_class, rb. std_fee, rb. std_fine from std_corner sc inner join reg_branch rb on sc.std_id = rb.std_id

Left Join Select sc. std_name, sc. std_class, rb. std_fee, rb. std_fine from std_corner sc left join reg_branch rb on sc.std_id = rb.std_id order by sc.std_id desc Select std_class from std_corner where std_class like '%C%'

15/06/2013 Sat

Date Functions SELECT GETDATE select GETDATE-30 Select DATEPART(YEAR, enter_date)as Years, DATEPART(Month, enter_date)as Month, DATEPART(Day, enter_date)as Days from std_corner

select DATEADD(DAY,10,GETDATE) select DATEADD(DAY,10,enter_date) as enter_date from std_corner

select DATEDIFF (year, '2008.07.01', '2012.06.15') as YearDiff DATEDIFF (day, (max (cn.created_date)), getdate)

SELECT CONVERT (CHAR(10), enter_date, 101) FROM std_corner Select CONVERT(VARCHAR(19),GETDATE) Select CONVERT(VARCHAR(19),GETDATE, 102) Select CONVERT(VARCHAR(24),'2008-09-01')

17/06/2013

select top(10)*, datediff(year, Date_of_birth, getdate) as [Age] from Patient where datediff(year, Date_of_birth, getdate) BETWEEN '10' AND '20'

select top(10) first_name from patient where first_name like ('_st_')

18/06/2013 Sub-Queries SELECT * FROM reg_branch WHERE std_ID IN    (SELECT std_id      FROM reg_branch      WHERE std_fee < 45000)

20/06/2013 Duplicate Value: SELECT name, email, COUNT(*) FROM users GROUP BY   name, email HAVING COUNT(*) > 1 24/06/2013 Where clause with Dates Function: WHERE order_date between ('2003/01/01') AND ('2003/12/31')

WHERE order_date  >=  (‘2003-01-01’) AND <=  (‘2013-12-31’)

25/06/2013 Select Into: SELECT * INTO newtable FROM table1 WHERE 1=0;

Conversion: Dates, times : Convert Decimals, numerics : Cast convert(float, std_cgpa) SELECT CAST(10.3496847 AS money)

Without using joins:

select p.Patient_Account, c.Claim_No, p.Practice_Code from patient p, claims c where p.patient_account = c.patient_account and p.Practice_Code = 100

Select p.Patient_Account, c.Claim_No,  p.Practice_Code from patient p,  claims c where c.Patient_Account in (	select Patient_Account from patient 	where practice_code = 100 )

Insurance Aging:

and (c.PRI_STATUS in ('N','B','R') or c.SEC_STATUS in ('N','B','R') or c.OTH_STATUS in ('N','B','R')) and (c.PAT_STATUS not in ('N','B','R','C','D'))

11/07/2013

select top(50)* from providers

select distinct practice_code, count(provid_fname+''+provid_lname)

from providers where isnull(deleted,0)<>1

group by practice_code having count (provid_fname+''+provid_lname)>1

Last_Submission_Date:

Select (max (cs.Process_Date) From Claims_Submitted Where claim_no = c.claim_no) Last_Submission_Date and ISNULL (cs.deleted,0) <> 1

Last_Notes:

(Select top(1) cn.Note_Detail from Claim_Notes cn where claim_no = c.claim_no Order by cn.created_date desc) last_notes

Last_Note_Aging:

Select (Datediff (day, max (cn.created_date), getdate ) From Claim_Notes Where Claim_No = c.Claim_No) Last_Note_Aging and ISNULL (cn.deleted,0) <>1

IF OBJECT_ID ('tempdb..#a') IS NOT NULL BEGIN DROP TABLE #a END

Wikipedia talk:Articles for creation/SQL BSICS concern
Hi there, I'm HasteurBot. I just wanted to let you know that Wikipedia talk:Articles for creation/SQL BSICS, a page you created, has not been edited in 6 months. The Articles for Creation space is not an indefinite storage location for content that is not appropriate for articlespace.

If your submission is not edited soon, it could be nominated for deletion. If you would like to attempt to save it, you will need to improve it.

You may request Userfication of the content if it meets requirements.

If the deletion has already occured, instructions on how you may be able to retrieve it are available at WP:REFUND/G13.

Thank you for your attention. HasteurBot (talk) 02:05, 22 March 2014 (UTC)

Your draft article, Wikipedia talk:Articles for creation/SQL BSICS


Hello Danialnazir. It has been over six months since you last edited your WP:AFC draft article submission, entitled "SQL BSICS".

The page will shortly be deleted. If you plan on editing the page to address the issues raised when it was declined and resubmit it, simply and remove the  or  code. Please note that Articles for Creation is not for indefinite hosting of material deemed unsuitable for the encyclopedia mainspace.

If your submission has already been deleted by the time you get there, and you want to retrieve it, copy this code:, paste it in the edit box at this link , click "Save page", and an administrator will in most cases undelete the submission.

Thanks for your submission to Wikipedia, and happy editing. &mdash;Anne Delong (talk) 04:02, 16 April 2014 (UTC)