SQL Foundations I Module 1

Write 3 update and delete statements

Only editable by group admins

  • Last updated August 24, 2016 at 1:07 PM
  • Evidence visible to public
Write 3 update and delete statements to manipulate the data in each table. Submit a URL for SQLFiddle or other location where your work can be publicly viewed.

All posted evidence

Update and Delete Statements They all passed!

Update teacher Set                 Salary = 66000 Where teach_id = 13; Update teacher Set                 name = 'Victor B. Dalko' Where teach_id = 13; Update teacher Set                 salary = salary * 1.2 Where teach_id = 11;   Update grade Set                 status = 'done' Where subject_id = 13; Update grade Set                 term_id = '201704' Where grade_varchar = 'does not meet expectations'; Update grade Set                 term_id = 201702 Where subject_id = 11;   Update student Set                 student_name = 'Pablo Gomez III' Where student_id = 13; Update student Set                 creditsearned = '9.0' Where student_id = 14; Update student Set                 dob = '1992-09-09' Where student_id = 13;   Delete from 'teacher' WHERE name = 'Sara Sikes' ; Delete from teacher where salary < 30000 ; Delete from teacher where teach_id < 11 ; Delete from grade where term_id < 201702 ; Delete from grade where student_id > 19 ; Delete from grade where subject_id > 14 ; Delete from student where student_name = 'Mike Miller' ; Delete from student where creditsearned < 1 ; Delete from student where creditsearned = 8 ;    
 

Found at https://parkland1-my.sharepoint.com/:w:/r/personal/sdow3_stu_parkland_edu/_layouts/15/Doc.aspx?sourcedoc=%7B9ADBB784-B847-4BF0-BE34-1D06976E186B%7D&file=Module%201_%20CSC176%20Data%20Systems_Sharon%20Dow%20102318.docx&action=default&mobileredirect=true
sdow3 About 6 years ago

Update and delete statements

UPDATE DISCIPLINE
SET NUM_CREDITS = 120
WHERE CODE = ‘S0060’;
UPDATE STUDENT
SET STUDENT_LNAME = ‘Ferguson’
WHERE STUDENT_NUMBER = ‘S4’;
UPDATE STUDENT
SET STUDENT_NUMBER = ‘S14’
WHERE STUDENT_FNAME=’Arnold’;

DELETE FROM STUDENT
WHERE STUDENT_LNAME=’Perez’;
DELETE FROM DISCIPLINE
WHERE CODE = ‘S0120’;
DELETE FROM STUDENT
WHERE STUDENT_NUMBER = ‘S9’;
mangai Over 6 years ago

Update and Delete statements for Module I Task IV

UPDATE University
SET University_Name = "Parkland Community College"
WHERE University_ID = 1492059;
UPDATE Course
SET Section = 1
WHERE Section = 3;
UPDATE Student
SET ID = 4726197
WHERE Username = "mpurnell1";

DELETE FROM Student WHERE University_ID = 7452956;
DELETE FROM Course WHERE University_ID = 7452956;
DELETE FROM University WHERE University_ID = 7452956;
mpurnell1 Almost 7 years ago

Update and Delete statements

UPDATE Class
SET Biology='Ap_Biology'
UPDATE Student
SET Bobby Boston='Bobby Simmons'
UPDATE Classroom
SET 101='102'


DELETE FROM Class
WHERE Spanish=‘ ‘;
DELETE FROM Student
WHERE Natasha Nashville=‘ ’;
DELETE FROM Classroom
WHERE 225=‘ ‘;
rvargas8 About 7 years ago

I updated the names of the students from nicknames to real names.

UPDATE students SET name “James” WHERE “jimbo”;
UPDATE students SET  name “Robert” WHERE “Bobby”;
UPDATE students  SET name “Clarus” WHERE “Claire”;


DELETE FROM names WHERE name=“James”;
DELETE FROM names WHERE name=“Bob”;
DELETE FROM names WHERE name=“Clarus”;
rvargas8 About 7 years ago

Updated names of the materials to more end-user friendly rather than codes. Deleted LOTAC and Scrim(no longer offer) and row 1 from Signs.

UPDATE Materials SET name = "Standard Polymatte WR/TR" WHERE mat_id= 1;
UPDATE Materials SET name = "Heavy Fabric" WHERE mat_id= 2;
UPDATE Materials SET name = "Scrim" WHERE mat_id= 3;
UPDATE Materials SET name = "Backlit" WHERE mat_id= 4;
UPDATE Materials SET name = "Perforated Window Mesh" WHERE mat_id= 5;
UPDATE Materials SET name = "Cooler Wrap" WHERE mat_id= 6;

DELETE FROM Materials WHERE name="LOTAC";
DELETE FROM Materials WHERE name="Scrim";

DELETE FROM Signs WHERE id = 1;
jmfisher About 7 years ago

Someone got into the college's database and things have gone awry - they reset the course section, reassigned student ID, and renamed a dept

UPDATE  `Student` SET  `ID_#`=2046207;

UPDATE  `Course` SET  `Section`=0;

UPDATE  `College` SET  `Major`='Industrial Engineering';

DELETE FROM `Student`
WHERE `ID_#`=2046207;

DELETE FROM `Course`
WHERE `Section`=0;
 
DELETE FROM `College`
WHERE `Department`='Industrial Engineering';
vbecu1 Almost 8 years ago

Primary Key + Foreign Key

randyiv About 8 years ago

Three Update & Delete Statements

UPDATE Soccer_players 
SET name= 'Mario Goetze'
WHERE name= 'Mario G';

UPDATE SOCCER_players
SET name= 'Neymar'
Where name= 'Neymar da Silva';

UPDATE Soccer_players
SET team= 'Borussia Dortmund'
Where name= 'Mario Goetze';

DELETE From Soccer_Players
Where name= 'Cristiano Ronaldo';

Delete From Soccer_Players
Where name= 'Mats Hummels';

Delete From Soccer_Players
Where name= 'Luis Suarez';

franciscocruz11 About 8 years ago

code

dustinninja About 8 years ago

Excerpt from the complete ddl: http://sqlfiddle.com/#!9/2047e0

UPDATE `pets` SET `name`='Bigby' WHERE `name`='BigBertha';
UPDATE `pets` SET `sex`='m' WHERE `name`='Bigby';
UPDATE `pets` SET `sex`='f' WHERE `name`='Screech';
UPDATE `pets` SET `sex`='m' WHERE `name`='Mini';
UPDATE `pets` SET `name`='Mickey' WHERE `name`='Mini';
UPDATE `food` SET `quantity`='2' WHERE `name`='catChow';
DELETE FROM `species` WHERE `name`='barnMouse';
DELETE FROM `species` WHERE `name`='shedMouse';
DELETE FROM `food` WHERE `name`='whoKnows';

It was difficult to determine sexes of the cats when they were kittens, hence the updates.
The mice are presumably gone, hence the deletion.
jaco About 8 years ago

Task 4

randyiv About 8 years ago