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

Write the SQL statements to complete the following action on the Persons table.

ID: 3724102 • Letter: W

Question

Write the SQL statements to complete the following action on the Persons table. The Persons table contains two attributes FirstName and LastName.

(a) Select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"

(b) Select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jacke son"

(c) Insert a new record into the "Persons" table for Jimmy Jones

(d) deletes the record where the "FirstName" is "Peter" in the Persons Table.

Explanation / Answer

(a) Select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"
Answer:
select * from persons where firstname = 'Peter';

(b) Select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jacke son"
Answer:
select * from persons where firstname = 'Peter' and lastname='Jacke son';

(c) Insert a new record into the "Persons" table for Jimmy Jones
Answer
insert into persons values('Jimmy','Jones');

(d) deletes the record where the "FirstName" is "Peter" in the Persons Table.
Answer:
delete from persons where firstname = 'Peter';

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote