Author Question: Explain the MySQL cursor statements. What will be an ideal ... (Read 32 times)

codyclark

  • Hero Member
  • *****
  • Posts: 538
Explain the MySQL cursor statements.
 
  What will be an ideal response?

Question 2

What is the multivalue, multicolumn problem, and why is it a problem? Include an example.
 
  What will be an ideal response?



aburgess

  • Sr. Member
  • ****
  • Posts: 361
Answer to Question 1

The MySQL cursor statements include DECLARE CURSOR CursorName to define a cursor, OPEN CursorName to actually start the use of the cursor, and CLOSE CursorName to end the use of a cursor. While the cursor is running, the FETCH keyword is used to retrieve row data. A cursor is used with a looping structure of some sort, which can be created using the REPEAT and WHILE keywords.

Answer to Question 2

The multivalue, multicolumn problem occurs when a table uses multiple columns to store multiple values of an attribute. For example, a database of dog owners might have a table with the structure:

DOG_OWNER (OwnerID, LastName, FirstName, DogName01, DogName02, DogName03 )

This is a problem because (1 ) the number of DogNames is fixed, and (2 ) this structure creates query problems. In fact, this structure is another form of the multivalued dependency, and requires a similar solution: a DOG table should be created to store the DogNames and with a foreign key to link the dogs to their owner.



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
 

Did you know?

Eating carrots will improve your eyesight. Carrots are high in vitamin A (retinol), which is essential for good vision. It can also be found in milk, cheese, egg yolks, and liver.

Did you know?

There are actually 60 minerals, 16 vitamins, 12 essential amino acids, and three essential fatty acids that your body needs every day.

Did you know?

Adult head lice are gray, about ? inch long, and often have a tiny dot on their backs. A female can lay between 50 and 150 eggs within the several weeks that she is alive. They feed on human blood.

Did you know?

Though the United States has largely rejected the metric system, it is used for currency, as in 100 pennies = 1 dollar. Previously, the British currency system was used, with measurements such as 12 pence to the shilling, and 20 shillings to the pound.

Did you know?

More than 30% of American adults, and about 12% of children utilize health care approaches that were developed outside of conventional medicine.

For a complete list of videos, visit our video library