Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Current content of the database COMPANY MySQL EMPLOrtE Frame Mind Lane B Sma 123

ID: 3582170 • Letter: C

Question

Current content of the database COMPANY MySQL EMPLOrtE Frame Mind Lane B Sma 1234547es 19esol-r731Fon-Houston, TX+M-30000 B-Latch-11234557-1965-01-09e731foew,muston, 963-01-09 1701 Forere, Houston, TX-e30000-3334405551 5 fadn T were 333445555 11055-12-03 |638 wes, Houston, TX teaton, TX M :40000 eaesssso5I 5 120000 }947u543di Zelaya a7777-1950-01-19-21 Castle, Sora entur s i wKae | 987US4321. 1941-06-20 | 201 Ben, Belarn. TX F 43000 esseassss 103 445855 Joyce A English e4E34534531t non31|s631 Nce, Haaton, TX | F | 25000 .333445555 Armade V aaar -g07amer 196e.cs 29-seo DaaHuer, TX M 25000 9875543211 4 E | Borg | SUasesses (1033-11-10 iaso sane, Halla, TKIMS 00 ULL DEPT-LOCATIONS DEPARTMENT 456SS 1988-C8-22 1995-O1-O1 eesessess | 198106-19 WORKS-ON PROJECT 1 234557e9 1234 zs 000034444-3 : 4a0 Houston 453453463 10 Stafford Stator 453453453 i 2 20 Houston 333445555 10.0 30 CuaNord 10 1 10.3 DEPENDENT 333448855 | 20 10. s990em7 30 i3ao 3334455ES Aloe F 108604 aughter i333445385 Theodore 19a3-1 7087987 330445555 Joy 19500040 Spouse 1987054321 | Abner M 194202201 Souse -30 1200 123454799 t Michael M ttaa 0104 Son 987954321 | 20 | s5.0 123456709 | Ace 1988-12-30 | Daghar 888885555 20 | NULL 123456789 Eleabeth 1957-0 Soane 1-13-10-20-30

Explanation / Answer

5

//Procedure

CREATE PROCEDURE GetCount( IN input INT(20), OUT result INT(20) )

BEGIN

SELECT count(*) into result from DEPENDENT where Essn=input;

END

CALL GetCount('e1',@output_value);

SELECT @OUTPUT_VALUE;

****************************************

a) The above procedure takes input for Integer as Essn. So, it was taken as

IN parameter mode. And to store the count of dependants, result is a parameter

took in OUT parameter mode. The statement "Select count(*)" count the number of rows that match input as Essn and stores the count in result paramter.

b) To Execute the above procedure, we nedd to call the Procedure using CALL.

CALL GetCount(input, @output)

@output is OUTPUT parameter, so it holds the output value.

To get the output value, we need to Select the value.

CALL GetCount('e1',@output_value);

SELECT @OUTPUT_VALUE;

c) When we run using above statements,

SELECT @output_value;

will print the count of the dependants whose Essn number is equal to input.

Eg if we give input = 123456789, then it returns 3 Rows

Because 123456789, matches three rows into which the Essn number found.

7. (a) Is this table in 1st normal form?

Answer: ‘YES’, the dependent table is in First Normal form(1NF) because attributes that allow atomic values. First normal based on attributes only.

First normal form satisfy the following rules:

1. Attributes must allow atomic values.

2. Column names must be unique.

3. No two rows they have same values.

4. Disallow multivalued and nested relations.

  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote