Professional Documents
Culture Documents
Code File 15 Dec
Code File 15 Dec
for separating the product types and counting how many times it is entered in a
table
SELECT ptype, COUNT (sid) FROM orderdet GROUP BY ptype;
for selecting sales in october and total sales AND GROUPED by specific ptype
SELECT ptype, SUM (salesoct) FROM orderdet GROUP BY ptype;
for selecting sales in october and total sales AND GROUPED by specific ptype WITH
ALPHABETICAL ORDER
SELECT ptype, SUM(salesoct) FROM orderdet GROUP BY ptype ORDER BY ptype;
FOR DELETING A ROW WITH SID 2 (IF AFTER EQUAL TO THERE IS A VARCHAR I.E. ALPHABET
OR ALPHANUMERIC THEN USE INVERTED COMMA'S)
DELETE FROM orderdet WHERE sid = 2 ;