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

The Food and Drug Administration has approved Risperdal, an adult antipsychotic drug, for the symptomatic treatment of irritability in children and adolescents with autism. The approval is the first for the use of a drug to treat behaviors associated with autism in children. These behaviors are included under the general heading of irritability and include aggression, deliberate self-injury, and temper tantrums.

Did you know?

Opium has influenced much of the world's most popular literature. The following authors were all opium users, of varying degrees: Lewis Carroll, Charles, Dickens, Arthur Conan Doyle, and Oscar Wilde.

Did you know?

The word drug comes from the Dutch word droog (meaning "dry"). For centuries, most drugs came from dried plants, hence the name.

Did you know?

Approximately 25% of all reported medication errors result from some kind of name confusion.

Did you know?

If you use artificial sweeteners, such as cyclamates, your eyes may be more sensitive to light. Other factors that will make your eyes more sensitive to light include use of antibiotics, oral contraceptives, hypertension medications, diuretics, and antidiabetic medications.

For a complete list of videos, visit our video library