Introduction to Database Systems SQL DML Statements. Help please Provide working
ID: 3728707 • Letter: I
Question
Introduction to Database Systems SQL DML Statements. Help please
Provide working SQL DML statements for the following database schema and queries EXERCISE CUSTOMER , Type, Firstname, Lastname, Address, City) INVENTORY (ID, ItemName, Type, MadeInStore, SupplierName ORDERS (ID, Customer_FK, Item FK, Quantity, DeliveryDate) 1. Add the following customers to table CUSTOMERS DailyAverageSold, Price) 150, Individual John, Doe, Main Street, Old City Create a duplicate of table CUSTOMER Populate the new table with all the customer (using a single SQL - 151, Restaurant, Jane Eod, Crossroads, Newtown 2. . Name the new table CUSTOMER BACKUP statement)Explanation / Answer
Lets first create a table
create table CUSTOMER(ID int(10),type varchar(100),FirstName varchar(100),LastName varchar(100), Address varchar(100), City varchar(100));
create table CUSTOMER(ID int(10),type varchar(100),FirstName varchar(100),LastName varchar(100), Address varchar(100), City varchar(100));
create table orders (ID int(10),customer_fk varchar(100),item_fk varchar(100),quantity int(10),data varchar(100));
create table inventory(ID int(10),itemname varchar(100),type varchar(100), madeinstore varchar(100),
suppliername varchar(100), dailyavg varchar(100),
price int(10));
Lets look at query
1.
insert into customer values (150,"individuals","john","doe","Main street","old city");
insert into customer values (151,"resturant","john","eod","cross roads","New town");
2.create table customer_backup as( Select * from customer);
3. update customer set type="Business" where type="Resturant";
4. update customer set type="Corporate" where type="office";
5. update customer set type="Southern" where type="Resturant" and city="San Diego";
7.delete from customer where FirstName like "S%";
8. drop table customer_backup.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.