x.java, y.html, etc.
EAANILA1_7.zipAssignments dbxmlnml@acm.org
Create a function isPrime(n int) that returns true (1)
if n is a prime number, otherwise it returns false (0).
Demonstrate it's usage with some sql statements.
Create a function fibonacci(n int) that calculates
the n-th Fibonacci number.
Demonstrate it's usage with some sql statements.
Consider the following scenario. You have seen in in assignment 10.
Example 3.1. Blueprint for t3/t13 and t4/t14
mysql> describe t3// +---------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+-------------+------+-----+---------+-------+ | dist | int(11) | NO | PRI | NULL | | | repno | int(11) | NO | | NULL | | | repname | varchar(16) | NO | | NULL | | +---------+-------------+------+-----+---------+-------+ 3 rows in set (0.00 sec) mysql> describe t4// +----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------+-----+---------+----------------+ | cust | int(11) | NO | PRI | NULL | auto_increment | | custname | varchar(16) | NO | | NULL | | | district | int(11) | NO | MUL | NULL | | | revenue | float | NO | | NULL | | +----------+-------------+------+-----+---------+----------------+ 4 rows in set (0.00 sec)
Create a procedure doing:
t3.
It will contain sales districts, re example above
t4
for customers belonging to the sales districts of t3.
Re example of t4 above
Then create a procedure doing:
engine=myIsam table t13
it will contain sales districts. Use t3 as model.
engine=myIsam table t14
for customers belonging to the mentioned sales districts.
Use t4 as model.
Then create a procedure doing:
refIntChk that will
check for any insert into t14, whether the district exists in
table t13. This is basically doing referential integrity checking
by procedure instead of letting the innodb engine do it.
refIntChk to check
for referential integrity towards t13.
Hand in: