ࡱ>	574	
bjbj	>}}||9t$O!l:2,@&AS?^
	09h.!:!&!@9!|	:	ANSWERS TO HOMEWORK # 7		(148)


Create a PL/SQL block that will produce a random multiplication table using:
Generates 2 random numbers from 1 to 10 called max_row and max_column. 
Generate a multiplication table from 1 to max_row and from 1 to max_column.Use 2 different looping mechanisms (your choice). 
Output the entire multiplication table using the DBMS_OUTPUT package. 
In addition, output the multiplication table into the output table in your schema. 

------------------------------------------------------------------------------------
-- This example creates a multiplication table of a random size 
------------------------------------------------------------------------------------

DECLARE 
      row	int := 1;
      max_row	int;
      max_col	int;
      mult	int;
      line		varchar2(100);
--
BEGIN
      max_row := trunc( DBMS_RANDOM.value(1,11) ); 	-- random number 1 to 10
      max_col  := trunc( DBMS_RANDOM.value(1,11) );

      WHILE row <= max_row LOOP				-- loop through the rows
	line := null;
--
	FOR  col  IN 1..max_col LOOP			-- loop through the columns
	      mult  :=  row * col;
	      line  :=  line || mult || '  ';
	END LOOP;
--
	insert into output values(line);
	DBMS_OUTPUT.put_line(line);

	row := row+1;

      END LOOP;

END;

													
 !		KLcdg

ƾ	h"Y>>*	hw>*h:hzTh-HhO2hwh(\CJaJhwChwCCJaJhwC5CJaJh(\5CJaJh]hw5CJaJ !n5	|			&
g





+.4j]jgdzTgdO2
&Fhdd[$\$^hgdgdgdw$a$gdw@\
j]jgd%I9j]jgdzT<	0
0&P1:pu5/ =!"#$%^2 0@P`p2( 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p8XV~_HmH	nH	sH	tH	@`@NormalCJ_HaJmH	sH	tH	DA DDefault Paragraph FontRiRTable Normal4
l4a(k (No ListPK![Content_Types].xmlj0Eжr(΢Iw},-j4	wP-t#bΙ{UTU^hd}㨫)*1P'	^W0)T9<l#$yi};~@(Hu*Dנz/0ǰ$X3aZ,D0j~3߶b~i>3\`?/[G\!-Rk.sԻ..a濭?PK!֧6_rels/.relsj0}Q%v/C/}(h"O
= C?hv=Ʌ%[xp{۵_Pѣ<1H0OR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/.relsPK-!kytheme/theme/themeManager.xmlPK-!Ptheme/theme/theme1.xmlPK-!
ѐ'	theme/theme/_rels/themeManager.xml.relsPK]
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:clrMap xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/>

	8@0(	
B
S	?
:AEJL]GKuy
>C
GKcg33333333333333!!\^2>q^`CJOJQJo(^`CJOJQJo(opp^p`CJOJQJo(@@^@`CJOJQJo(^`CJOJQJo(^`CJOJQJo(^`CJOJQJo(^`CJOJQJo(PP^P`CJOJQJo(h^`OJQJo(hHh^`OJQJ^Jo(hHohp^p`OJQJo(hHh@^@`OJQJo(hHh^`OJQJ^Jo(hHoh^`OJQJo(hHh^`OJQJo(hHh^`OJQJ^Jo(hHohP^P`OJQJo(hH\^2									D,%/9U43-Hn}
I]~$4x
cw!$}U*z,P"/%I9:!:"Y>wCvRcSzTW(\5]s_HdXh2jlspJ$q8w;{2k@yG8qu5J,w]]j`IO2C@``(``X@UnknownG*Ax	Times New Roman5Symbol3.*Cx	Arial?=	*Cx	Courier New;WingdingsA$BCambria Math"qh5PSgG	G	!d24d3QHX	?w2!xxANSWERS TO HOMEWORK # 2ssultansamOh+'0	 
@LX
dpxANSWERS TO HOMEWORK # 2ssultanNormal.dotmsam11Microsoft Office Word@J6@lTW@*;@p1S?G՜.+,0hp
Home Box Office	ANSWERS TO HOMEWORK # 2Title	

 !"#%&'()*+-./01236Root Entry	F@&AS?8Data
1Table!WordDocument>SummaryInformation($DocumentSummaryInformation8,CompObjy
	F'Microsoft Office Word 97-2003 Document
MSWordDocWord.Document.89q