sombarey Posted June 12, 2011 Report Posted June 12, 2011 doods.. koddiga clear gaa anni joins discriptive gaa easy ga artham ayye laa seppandi fleeezeeand primery key meeda kuda clarity ivvandi F%G_@
C Nation Posted June 12, 2011 Report Posted June 12, 2011 [quote author=HAPPYNESS link=topic=201842.msg2463826#msg2463826 date=1307853042] thankyou thankyou thankyou thankyouWhat is meant by Dynamic SQL??? sCo_^Y sCo_^Y sCo_^Y[/quote][url=http://www.sqlteam.com/article/introduction-to-dynamic-sql-part-1]http://www.sqlteam.com/article/introduction-to-dynamic-sql-part-1[/url]read this. u will get an idea about dynamic sql.
king420 Posted June 12, 2011 Author Report Posted June 12, 2011 [quote author=patriot link=topic=201842.msg2464858#msg2464858 date=1307895108]doods.. koddiga clear gaa anni joins discriptive gaa easy ga artham ayye laa seppandi fleeezeeand primery key meeda kuda clarity ivvandi F%G_@[/quote]ninan bhaaariga disco jarigindi baa neekosam chaala sepu vethikam H&*() H&*() H&*()
sombarey Posted June 12, 2011 Report Posted June 12, 2011 [quote author=HAPPYNESS link=topic=201842.msg2464865#msg2464865 date=1307895516]ninan bhaaariga disco jarigindi baa neekosam chaala sepu vethikam H&*() H&*() H&*()[/quote] sorry2 guys... nerchukovali disco veyali ani naaku vundi.. kaani ninna edo thokka lo prog oka daniki vella... no brain aravam gallu halbrain tellollu sava gottaaru sFun_duh sFun_duh vachi twaraga padukunna.. anyhow ee rooju vundi kada kummeddam
C Nation Posted June 12, 2011 Report Posted June 12, 2011 [quote author=patriot link=topic=201842.msg2464858#msg2464858 date=1307895108]doods.. koddiga clear gaa anni joins discriptive gaa easy ga artham ayye laa seppandi fleeezeeand primery key meeda kuda clarity ivvandi F%G_@[/quote]primary key meedha example.u r in a class of 50 people. every person had a roll number. there may be more than 1 person with the name patriot. but there will never be 2 persons with roll number 1. so in this case roll number column should be declared as Primary key.Primary key column lo NULL value undakoodadhu.Primary key is used to differentiate one row from other.same example lo Class teacher Patriot ani pilichindi anuko more than 1 person respond avvochu. kaani roll number 1 ani pilisthe okkadey respond avuthadu. ikkada roll number is differentiating one person from other.
sombarey Posted June 12, 2011 Report Posted June 12, 2011 [quote author=C Nation link=topic=201842.msg2464871#msg2464871 date=1307895714]primary key meedha example.u r in a class of 50 people. every person had a roll number. there may be more than 1 person with the name patriot. but there will never be 2 persons with roll number 1. so in this case roll number column should be declared as Primary key.[color=red] Primary key column lo NULL value undakoodadhu.Primary key is used to differentiate one row from other.same example lo Class teacher Patriot ani pilichindi anuko more than 1 person respond avvochu. kaani roll number 1 ani pilisthe okkadey respond avuthadu. ikkada roll number is differentiating one person from other.[/quote]ippudu complete ga eligindi ba CITI_$D# thankyou
king420 Posted June 12, 2011 Author Report Posted June 12, 2011 [quote author=C Nation link=topic=201842.msg2464871#msg2464871 date=1307895714]primary key meedha example.u r in a class of 50 people. every person had a roll number. there may be more than 1 person with the name patriot. but there will never be 2 persons with roll number 1. so in this case roll number column should be declared as Primary key.Primary key column lo NULL value undakoodadhu.Primary key is used to differentiate one row from other.same example lo Class teacher Patriot ani pilichindi anuko more than 1 person respond avvochu. kaani roll number 1 ani pilisthe okkadey respond avuthadu. ikkada roll number is differentiating one person from other.[/quote] Inner Join...Outer Join kiLeft Join..right Join ki difference enti? sCo_^Y sCo_^Y sCo_^Y
sombarey Posted June 12, 2011 Report Posted June 12, 2011 [quote author=HAPPYNESS link=topic=201842.msg2464875#msg2464875 date=1307895995] Inner Join...Outer Join kiLeft Join..right Join ki difference enti? sCo_^Y sCo_^Y sCo_^Y[/quote] @gr33d assalu aa join enduku eppudu chestaamujoin ki join ki difference enti adhyakshaa
C Nation Posted June 12, 2011 Report Posted June 12, 2011 [quote author=HAPPYNESS link=topic=201842.msg2464875#msg2464875 date=1307895995] Inner Join...Outer Join kiLeft Join..right Join ki difference enti? sCo_^Y sCo_^Y sCo_^Y[/quote]inner join ON table1.ID=Table2.ID ani rasavu anuko. two tables lo unna ID's mathrame vasthayi. in Short Common ID's mathramey vasthayi.Table1 left outer join Table2 on table1.ID=Table2.ID ani rasavu anuko. table 1 lo unna ID rows anni vasthayi. aa ID's ki table2 lo rows unte vaati values add avuthayi. lekhapothe NULL value untadhi table2 column ki. ninnati exampleinner join resultsID name salary hierarchy 1 Hangover 1000 legend2 Psychopk 900 legend3 Patriot 1100 legendouter join resultsID name salary hierarchy 1 Hangover 1000 legend2 Psychopk 900 legend3 Patriot 1100 legend4 Idli 4000 NULLIdli ane name first table lo undhi. second table lo ledhu. so inner join chesinappudu Idli Name unna row raledhu. left outer join chesinappudu Idli vachindi. bcoz Idli did not have a row in table2, left outer join cheinappudu hierarchy column ki IDLY name unna row lo NULL value vachindi.right outer join ante exactly opposite to left outer join.left outer join lo first table lo unna rows anni ela vasthayo, right outer join lo 2nd table lo unna rows anni vasthayi.
maaditenali Posted June 12, 2011 Report Posted June 12, 2011 [quote author=patriot link=topic=201842.msg2464858#msg2464858 date=1307895108]doods.. koddiga clear gaa anni joins discriptive gaa easy ga artham ayye laa seppandi fleeezeeand primery key meeda kuda clarity ivvandi F%G_@[/quote]simple baa.. [b]PRIMARY KEY[/b]: [b]UNIQUE + NOT NULL[/b]JOINS:Lets say there are two tables, TableA and TableB[b]Inner join[/b] produces only the set of records that match in both Table A and Table B.[code]SELECT * FROM TableAINNER JOIN TableBON TableA.field= TableB.field[/code][img]http://codinghorror.typepad.com/.a/6a0120a85dcdae970b012877702708970c-pi[/img][b]Full outer join[/b] produces the set of all records in Table A and Table B, with matching records from both sides where available. If there is no match, the missing side will contain null.[code]SELECT * FROM TableAFULL OUTER JOIN TableBON TableA.field= TableB.field[/code][img width=502 height=329]http://codinghorror.typepad.com/.a/6a0120a85dcdae970b012877702725970c-pi[/img][b]Left outer join[/b] produces a complete set of records from Table A, with the matching records (where available) in Table B. If there is no match, the right side will contain null.[code]SELECT * FROM TableALEFT OUTER JOIN TableBON TableA.field= TableB.field[/code][img width=502 height=329]http://codinghorror.typepad.com/.a/6a0120a85dcdae970b01287770273e970c-pi[/img]To produce the set of records only in Table A, but not in Table B, we perform the same left outer join, then exclude the records we don't want from the right side via a where clause.[code]SELECT * FROM TableALEFT OUTER JOIN TableBON TableA.field= TableB.fieldWHERE TableB.id IS null[/code][img width=502 height=329]http://codinghorror.typepad.com/.a/6a0120a85dcdae970b012877702754970c-pi[/img]To produce the set of records unique to Table A and Table B, we perform the same full outer join, then exclude the records we don't want from both sides via a where clause.[code]SELECT * FROM TableAFULL OUTER JOIN TableBON TableA.name = TableB.nameWHERE TableA.id IS null OR TableB.id IS null[/code][img width=502 height=329]http://codinghorror.typepad.com/.a/6a0120a85dcdae970b012877702769970c-pi[/img]There's also a cartesian product or cross join[code]SELECT * FROM TableA CROSS JOIN TableB[/code]This joins "everything to everything", resulting in 4 x 4 = 16 rows, far more than we had in the original sets. If you do the math, you can see why this is a very dangerous join to run against large tables.source: [url=http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html]http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html[/url]
king420 Posted June 12, 2011 Author Report Posted June 12, 2011 [quote author=C Nation link=topic=201842.msg2464883#msg2464883 date=1307896490]inner join ON table1.ID=Table2.ID ani rasavu anuko. two tables lo unna ID's mathrame vasthayi. in Short Common ID's mathramey vasthayi.Table1 left outer join Table2 on table1.ID=Table2.ID ani rasavu anuko. table 1 lo unna ID rows anni vasthayi. aa ID's ki table2 lo rows unte vaati values add avuthayi. lekhapothe NULL value untadhi table2 column ki. ninnati exampleinner join resultsID name salary hierarchy 1 Hangover 1000 legend2 Psychopk 900 legend3 Patriot 1100 legendouter join resultsID name salary hierarchy 1 Hangover 1000 legend2 Psychopk 900 legend3 Patriot 1100 legend4 Idli 4000 NULLIdli ane name first table lo undhi. second table lo ledhu. so inner join chesinappudu Idli Name unna row raledhu. left outer join chesinappudu Idli vachindi. bcoz Idli did not have a row in table2, left outer join cheinappudu hierarchy column ki IDLY name unna row lo NULL value vachindi.right outer join ante exactly opposite to left outer join.left outer join lo first table lo unna rows anni ela vasthayo, right outer join lo 2nd table lo unna rows anni vasthayi.[/quote] you rock you rock you rock you rock you rock thankyou H&*() H&*() H&*() S%Hi S%Hi
king420 Posted June 12, 2011 Author Report Posted June 12, 2011 [quote author=GAJADONGA GANGULU link=topic=201842.msg2464888#msg2464888 date=1307896619]simple baa.. [b]PRIMARY KEY[/b]: [b]UNIQUE + NOT NULL[/b]JOINS:Lets say there are two tables, TableA and TableB[b]Inner join[/b] produces only the set of records that match in both Table A and Table B.[code]SELECT * FROM TableAINNER JOIN TableBON TableA.field= TableB.field[/code][img]http://codinghorror.typepad.com/.a/6a0120a85dcdae970b012877702708970c-pi[/img][b]Full outer join[/b] produces the set of all records in Table A and Table B, with matching records from both sides where available. If there is no match, the missing side will contain null.[code]SELECT * FROM TableAFULL OUTER JOIN TableBON TableA.field= TableB.field[/code][img width=502 height=329]http://codinghorror.typepad.com/.a/6a0120a85dcdae970b012877702725970c-pi[/img][b]Left outer join[/b] produces a complete set of records from Table A, with the matching records (where available) in Table B. If there is no match, the right side will contain null.[code]SELECT * FROM TableALEFT OUTER JOIN TableBON TableA.field= TableB.field[/code][img width=502 height=329]http://codinghorror.typepad.com/.a/6a0120a85dcdae970b01287770273e970c-pi[/img]To produce the set of records only in Table A, but not in Table B, we perform the same left outer join, then exclude the records we don't want from the right side via a where clause.[code]SELECT * FROM TableALEFT OUTER JOIN TableBON TableA.field= TableB.fieldWHERE TableB.id IS null[/code][img width=502 height=329]http://codinghorror.typepad.com/.a/6a0120a85dcdae970b012877702754970c-pi[/img]To produce the set of records unique to Table A and Table B, we perform the same full outer join, then exclude the records we don't want from both sides via a where clause.[code]SELECT * FROM TableAFULL OUTER JOIN TableBON TableA.name = TableB.nameWHERE TableA.id IS null OR TableB.id IS null[/code][img width=502 height=329]http://codinghorror.typepad.com/.a/6a0120a85dcdae970b012877702769970c-pi[/img]There's also a cartesian product or cross join[code]SELECT * FROM TableA CROSS JOIN TableB[/code]This joins "everything to everything", resulting in 4 x 4 = 16 rows, far more than we had in the original sets. If you do the math, you can see why this is a very dangerous join to run against large tables.source: [url=http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html]http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html[/url][/quote] blast blast blast blast blast blast blast blast thankyou thankyou thankyou
C Nation Posted June 12, 2011 Report Posted June 12, 2011 [quote author=patriot link=topic=201842.msg2464881#msg2464881 date=1307896461] @gr33d assalu aa join enduku eppudu chestaamujoin ki join ki difference enti adhyakshaa[/quote]school data base undhi bhayya.every student ki tons of data untadhi. antha data okkatey table lo save cheyyamu kada.Students ane table lo STudentID,studentname.. inko 2 -3 columns untayi.Address ane table lo studentID, Add1,add2,city,state,zip etc.Classes ane table lo studentID,ClassID, marks etc.Parents ane table, STudentID,FatherName,MotherNAme etc.so when ur searching/displaying data of particular student we use joins and get data of that particular student from all the tables.
maaditenali Posted June 12, 2011 Report Posted June 12, 2011 [quote author=patriot link=topic=201842.msg2464881#msg2464881 date=1307896461] @gr33d assalu aa join enduku eppudu chestaamujoin ki join ki difference enti adhyakshaa[/quote]in simple words... joins are used to fetch data from two or more tables.
maaditenali Posted June 12, 2011 Report Posted June 12, 2011 [quote author=HAPPYNESS link=topic=201842.msg2464891#msg2464891 date=1307896671] blast blast blast blast blast blast blast blast thankyou thankyou thankyou[/quote] H&*() H&*() H&*() S%Hi S%Hi S%Hi S%Hi
Recommended Posts