Hi there! I am wondering if there is a way of doing mulitple deletes with one si
ID: 3646657 • Letter: H
Question
Hi there! I am wondering if there is a way of doing mulitple deletes with one single select statement. here is my problem.1. Database: books; Write SQL statements to remove all the new records you added last week in Lab Assignment 6. Again the order of the statements is crucial. Save the statements you use in a notepad file in the order you run them.
So I did well on this assignment and now I Have to remove everything here is what i had last week.
use books
insert into publisher
(pubid,name,contact,phone)
values
(6,'Stark Industries','Iron Man','803-555-5555');
insert into author
(authorid,lname,fname)
values
('T100','T','Mr.');
insert into books
(Isbn,title,pubdate,pubid,cost,retail,category)
values
(1525697835,'I Pity the FOOL!','2012-07-13',5,50.00,65.00,'self help');
insert into bookauthor
(isbn,authorid)
values
(1525697835,'T100');
insert into customers
(customernum,lastname,firstname,address,city,state,zip,referred)
values
(1952,'Reynolds','Ryan','1407 Graymalkin Lane','North Salem','NY','49986',null);
insert into orders
(ordernum,customernum,orderdate,shipdate,shipstreet,shipcity,shipstate,shipzip)
values
(1928,1952,'2012-07-10',null,'1407 Graymalkin Lane','North Salem','NY','49986');
insert into orderitems
(ordernum,itemnum,isbn,quantity)
values
(1928,199,1525697835,1);
Do I need to do everything all individual again? or is there a shorter way to do this?
Thanks!
Explanation / Answer
As far as the assignment is concerned you need to do it for every one and save the statements. Group delete can be applied for any selection where you specify id range Delete From Values Where 1928Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.