39. (a) Write a Query to create a Table with the following structure
Table Product
Field Datatype
PID Char(4)
Pname Varchar(20)
Description Varchar(40)
Price Decimal
(b) Consider the following Vendor table and write the queries
Table Vendor
VendorID VName DateofRegistration Location
V001 Mother Dairy 20-01-2009 Delhi
V002 Havmor 01-04-2015 Gujrat
V003 Amul 12-05-2012 Kolkata
V004 Kwality Walls 15-10-2013 Mumbai
(2+3)
(i) Write a Query to display all records
(ii) Write a Query to add a new row with the following details
(‘V005’, ‘Vadilal’, ‘2010-03-20’, ‘Pune’)
(iii) Write a query to modify the location of V003 from Kolkata to Gujrat
Answers
Answered by
25
(a)
CREATE TABLE Product(
PID Char(4),
Pname Varchar(20),
Description Varchar(40),
Price Decimal
) ;
(b)
(i) SELECT * FROM Vendor;
(ii) INSERT INTO Vendor("VendorID", "VName, "Date of Registration", 'Location") VALUES
(‘V005’, ‘Vadilal’, ‘2010-03-20’, ‘Pune’);
(iii) UPDATE Vendor Location = " Gujurat" WHERE V003 ="Kolkata ";
Similar questions