Author Question: Explain the MySQL cursor statements. What will be an ideal ... (Read 31 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?

Side effects from substance abuse include nausea, dehydration, reduced productivitiy, and dependence. Though these effects usually worsen over time, the constant need for the substance often overcomes rational thinking.

Did you know?

The FDA recognizes 118 routes of administration.

Did you know?

Human kidneys will clean about 1 million gallons of blood in an average lifetime.

Did you know?

Pink eye is a term that refers to conjunctivitis, which is inflammation of the thin, clear membrane (conjunctiva) over the white part of the eye (sclera). It may be triggered by a virus, bacteria, or foreign body in the eye. Antibiotic eye drops alleviate bacterial conjunctivitis, and antihistamine allergy pills or eye drops help control allergic conjunctivitis symptoms.

Did you know?

Before a vaccine is licensed in the USA, the Food and Drug Administration (FDA) reviews it for safety and effectiveness. The CDC then reviews all studies again, as well as the American Academy of Pediatrics and the American Academy of Family Physicians. Every lot of vaccine is tested before administration to the public, and the FDA regularly inspects vaccine manufacturers' facilities.

For a complete list of videos, visit our video library