Professional Documents
Culture Documents
1. Write the correct SQL commands for the following on the basis of table Supplier.
a. List all Name and Price with price between 3000 and 7000
Code:
Output:
b. To set the price to 1200 for ‘Keyboard’
Code:
UPDATE Supplier
SET Price = 1200
WHERE Name = 'Keyboard';
Output:
e. To display Name, Price, stock of all suppliers whose name starts with 'S'.
Code:
SELECT Name, Price, Stock
FROM Supplier
WHERE Name LIKE 'S%';
Output:
f. To display supplier without duplication
Code:
SELECT DISTINCT Supplier
FROM Supplier;
Output:
No row is Displayed because in question c we deleted the rows with Stock between 20 and
40.
j. To display name, supplier, stock for name as keyboard or mouse.
Code:
SELECT Name, Supplier, Stock
FROM Supplier
WHERE Name IN ('Keyboard', 'Mouse');
Output:
Create the above mentioned tables and insert the records to solve the following queries.
Code: