Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

for counting the total entries in a column with ptype(product type) paper

SELECT COUNT(sid) FROM orderdet WHERE ptype='Paper';

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 ;

FOR SELECTING ALL THINGS IN A TABLE


SELECT* FROM orderdet

for deleting all entries with ptype is Appliances


DELETE FROM orderdet where ptype ='Appliances';

You might also like