Question

In: Computer Science

Consider the following data.    STUDENT StudentID SName Gender Age ClubID 3234 Alfred Smith Male 20...

Consider the following data.   

STUDENT

StudentID

SName

Gender

Age

ClubID

3234

Alfred Smith

Male

20

BSK

2244

McJohnson Robert

Male

22

2389

Jessica Low

Female

20

JPA

4211

Roland Devingo

Male

24

4383

Jane Usa Khan

Female

21

BKY

4450

Elaine Fong

Female

20

JPA

CLUB

ClubID

CName

Founded

Budget

BKY

Bakery Club

2010

2546

PDC

Photomedia and Design

2005

1345

JPA

Japanese Anime

2009

3453

BSK

Basketball

2011

6744

If the database administrator in the University has turned off auto-commit, consider the following:

Student 4211 has joined the Photomedia and Design club. When the system admin wanted to update the database, she wrote the following statement:

UPDATE STUDENT

SET CLUBID = “PDC”

Answer the following:

  1. How does the above SQL statement produce false information in the Student table?

Solutions

Expert Solution

Given statement:

UPDATE STUDENT

SET CLUBID = “PDC”

a.How does the above SQL statement produce false information in the Student table?

Answer:

  • This statement will update all the records in the "STUDENT" table with the CLUBID = "PDC"
  • for example: Above statement will generate the below result:

               STUDENT TABLE:

StudentID ClubID
3234 PDC
2244 PDC

2389

PDC
4211 PDC
4383 PDC
4450 PDC

Correct statement:

UPDATE STUDENT

SET CLUBID = “PDC”

WHERE StudentID = "4211";

  • Above sql statement will only update the CLUBID of student with ID :4211.
    • Above statement will generate the below result:
  •                STUDENT TABLE:

    StudentID ClubID
    3234 BSK
    2244

    2389

    JPA
    4211 PDC
    4383 BKY
    4450 JPA

Note:

  • To update only one record , a unique identification of that record should be used as a constraint to identify that specific record.

Related Solutions

Consider the following data.    STUDENT StudentID SName Gender Age ClubID 3234 Alfred Smith Male 20...
Consider the following data.    STUDENT StudentID SName Gender Age ClubID 3234 Alfred Smith Male 20 BSK 2244 McJohnson Robert Male 22 2389 Jessica Low Female 20 JPA 4211 Roland Devingo Male 24 4383 Jane Usa Khan Female 21 BKY 4450 Elaine Fong Female 20 JPA CLUB ClubID CName Founded Budget BKY Bakery Club 2010 2546 PDC Photomedia and Design 2005 1345 JPA Japanese Anime 2009 3453 BSK Basketball 2011 6744 What is the value returned by this SQL statement?...
Question (3) Consider the following relations: Student(snum: integer, sname: string, major: string, level: string, age: integer)...
Question (3) Consider the following relations: Student(snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets at: string, room: string, fid: integer) Enrolled(snum: integer, cname: string) Faculty(fid: integer, fname: string, deptid: integer) The meaning of these relations is straightforward; for example, Enrolled has one record per student-class pair such that the student is enrolled in the class. Write the following queries in Oracle SQL. No duplicates should be printed in any of the answers. i) (2 points)...
Female Student # Gender Height Shoe Age Hand 1 F 68 8.5 20 R 2 F...
Female Student # Gender Height Shoe Age Hand 1 F 68 8.5 20 R 2 F 60 5.5 27 R 3 F 64 7 31 R 4 F 67 7.5 19 R 5 F 65 8 20 R 6 F 66 9 29 R 7 F 62 9.5 30 L 8 F 63 8.5 18 R 9 F 60 5 19 L 10 F 63 7.5 42 R 11 F 61 7 20 R 12 F 64 7.5 17 R...
Student # Gender Height Shoe Age Hand 1 F 68 8.5 20 R 2 F 60...
Student # Gender Height Shoe Age Hand 1 F 68 8.5 20 R 2 F 60 5.5 27 R 3 F 64 7 31 R 4 F 67 7.5 19 R 5 F 65 8 20 R 6 F 66 9 29 R 7 F 62 9.5 30 L 8 F 63 8.5 18 R 9 F 60 5 19 L 10 F 63 7.5 42 R 11 F 61 7 20 R 12 F 64 7.5 17 R 13...
SUPPLIER Sno Sname Status City s1 Smith 20 London s2 Jones 10 Paris s3 Blake 30...
SUPPLIER Sno Sname Status City s1 Smith 20 London s2 Jones 10 Paris s3 Blake 30 Paris s4 Clark 20 London s5 Adams 30 NULL PART Pno Pname Color Weight City p1 Nut Red 12 London p2 Bolt Green 17 Paris p3 Screw NULL 17 Rome p4 Screw Red 14 London p5 Cam Blue 12 Paris p6 Cog Red 19 London SHIPMENT Sno Pno Qty Price s1 p1 300 .005 s1 p2 200 .009 s1 p3 400 .004 s1 p4...
Demographics: Client Name: Charles Jones            Gender: Male                    Race: Black Age: 68  
Demographics: Client Name: Charles Jones            Gender: Male                    Race: Black Age: 68               Weight: 180 lbs               Height: 183 cm (72 in)                    Location: SIM 319 Physician: Dr. Carl Smith                              Client Information: Mr. Jones is a newly diagnosed hypertensive patient that started having problems with CHF. He works as a school maintenance supervisor and states that he is too busy to go to the bathroom. Unfortunately, he has omitted take his fluid pills. Dr. Smith initially admitted Mr. Jones...
A study of working actors looked at age and gender. One sample of 50 male actors...
A study of working actors looked at age and gender. One sample of 50 male actors had a mean age of 23 and a standard deviation of 2. The other sample included 50 female actors with a mean age of 24 and a standard deviation of 3. Estimate with 87% confidence the difference between the average ages of working male (μ1) and female (μ2) actors. Round answers to the nearest hundredth. < μ1 − μ2<
A study of working actors looked at age and gender. One sample of 55 male actors...
A study of working actors looked at age and gender. One sample of 55 male actors had a mean age of 25 and a standard deviation of 4. The other sample included 55 female actors with a mean age of 28 and a standard deviation of 2. Estimate with 91% confidence the difference between the average ages of working male (μ1μ1) and female (μ2μ2) actors. Round answers to the nearest hundredth. < μ1−μ2μ1-μ2 <
Harry Smith, 70 years of age, is a male patient who is admitted to the medical-surgical...
Harry Smith, 70 years of age, is a male patient who is admitted to the medical-surgical unit with acute community-acquired pneumonia. He was diagnosed with paraseptal emphysema 3 years ago. The patient smoked cigarettes one pack per day for 55 years and quit 3 years ago. The patient has a history of hypertension, and diabetes controlled with oral diabetic agents. The patient presents with confusion as to time and place. The family stated that this is a new change for...
Adam Smith, 77 years of age, is a male patient who was admitted from a nursing...
Adam Smith, 77 years of age, is a male patient who was admitted from a nursing home to the intensive care unit with septic shock secondary to urosepsis. The patient has a Foley catheter in place from the nursing home with cloudy greenish, yellow-colored urine with sediments. The nurse removes the catheter after obtaining a urine culture and replaces it with a condom catheter attached to a drainage bag since the patient has a history of urinary and bowel incontinence....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT