PLEASE WRITE THIS IN SQL QUERY. 2.5s Insert Records into Manufacturer Table The
ID: 3755205 • Letter: P
Question
PLEASE WRITE THIS IN SQL QUERY.
2.5s Insert Records into Manufacturer Table
The Select queries that you have executed previously to the Redcat database only require "read" permissions. However, to execute updates to the database "write" permissions are required.
In order to allow you to update the database, and to have write permission, a separate database schema has been created for each student. Initially this database schema is completely empty. You must add (Create table) the Manufacturer table into this schema before you add the data required for this problem. Your Student Database Schema is completely under your control. You get to add and delete tables and data as required to complete you assignments.
Before completing the Insert statements for this assignment, use the following code to create the Manufacturer Table. You can copy and paste it into the work area. You will receive feedback when it executes correctly. If you create it incorreclty and need to create it again, you must first remove the incorrect version with the Drop table Manufacturer SQL statement.
Once you have your schema created with the necessary table, you can clear the work area and enter only the statements for this assignment. After you are sure they are working correctly, then you can submit them. Remember only submit the specific SQL statements required by the problem definition.
Here are the SQL statements to set up your schema.
Drop table Manufacturer;
Create table Manufacturer (
ManufacturerID Integer Primary Key Not Null,
ManufacturerName Varchar (30) Not Null,
Address Varchar (100) Not Null,
City Varchar (50) Not Null,
State Char (2) Not Null,
PostalCode Char (10) Not Null,
Phone Char (15));
2.5s Question: Insert the following records into the Manufacturer table.
2.6s Insert records into Products table
The Select queries that you have executed previously to the Redcat database only require "read" permissions. However, to execute updates to the database "write" permissions are required.
In order to allow you to update the database, and to have write permission, a separate database schema has been created for each student. Initially this database schema is completely empty. You must add (Create table) the Product table into this schema before you add the data required for this problem. Your Student Database Schema is completely under your control. You get to add and delete tables and data as required to complete you assignments.
Before completing the Insert statements for this assignment, use the following code to create the Product Table. You can copy and paste it into the work area. You will receive feedback when it executes correctly. If you create it incorreclty and need to create it again, you must first remove the incorrect version with the Drop table Product SQL statement.
Once you have your schema created with the necessary table, you can clear the work area and enter only the statements for this assignment. After you are sure they are working correctly, then you can submit them. Remember only submit the specific SQL statements required by the problem definition.
Here are the SQL statements to set up your schema.
Drop table Product;
Create table Product (
ProductID Integer Primary Key Not Null,
ProductName Varchar (30) Not Null,
ManufacturerID Integer Not Null,
Category Char (20),
Color Char (15),
Price Decimal (8,2) Not Null,
Description VarChar(100));
2.6s Question : Insert the following records into the Product table.
2.7s Update data in the database
This problem is based on the previous problem where you added five records to the Product table in your private database schema. When you were testing out your insert statements, you should have added records to your private schema. Do not delete them. They will remain in your database and can be used for this problem.
You can verify that your database is correct by executing a "Select * from Product" SQL statement in the work area.
2.7s Question: Enter your entire script below in the work area. You may use select statements to view your results, but do not include any select statements as part of your submitted answer. Remember to be careful when updating data in a database because there is no UNDO function. Increase the list price of all sneakers that you previously added to the database by 5%.
2.8s Delete data from database
This problem builds on the two previous problems where you (1) inserted five records in the database, and then (2) updated the price of sneakers. Grading is based on the cummulative changes to your database.
You can verify the database with the SQL statement "Select * from Product".
2.8s Question: Enter your entire script below. Do not inlcude statements to drop objects as your script will be executed against a clean schema. You may include select statements in sub queries in your insert statements, but do not include select queries that return records for display. Delete all products from the Product table that are manufactured by Manufacturer 100.
ManufacturerID ManufacturerName Address City State PostalCode Phone 100 Classic Shoes Inc 521 Schaefer Ave Chino CA 91710 714-276-1180 101 All About Boots 80 Enterprise Avenue South Secaucus NJ 17094 102 Sports Footwear 22500 S. Vermont Ave Torrence CA 90502 310-783-1900 103 Fancy Feet LLC 910 S Los Angeles Street # 704 Los Angeles CA 90015 877-740-7732Explanation / Answer
If you have any doubts, please give me comment...
2.5)
INSERT INTO Manufacturer VALUES
(100,'Classic Shoes Inc','521 Schaefer Ave','Chino','CA', '91710', '714-276-1180'),
(101,'All About Boots','80 Enterprise Avenue South','Secaucus','NJ','17094', NULL),
(102,'Sports Footwear', '22500 S. Vermont Ave','Torrence','CA','90502','310-783-1900'),
(103,'Fancy Feet LLC','910 S Los Angeles Street # 704', 'Los Angeles', 'CA','90015', '877-740-7732');
2.6)
INSERT INTO Products VALUES(1500, 'Leather Sneakers',100, 'sneakers','White',65.00,'Real leather uppers'),
(1502, 'Jogging Sneakers', 100,'sneakers', 'Black',80.00, NULL),
(1504, 'High Profile Runners',103, 'sneakers','White',45.99, 'Running with extra cushion'),
(1505,'Sport Boots',103,'boots','Black',32.99, 'Easy hiking boot'),
(1506,'Knee Boots',100, 'boots',NULL,28.99, 'Walking, low heel, leather');
2.7)
UPDATE Products SET Price = Price+Price*0.05 WHERE Category = 'sneakers';
2.8)
DELETE FROM Products WHERE mantufacturerID = 100;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.