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

SQL

KOCBK,KOCBH,KOCMR
For dropping a table
• Drop table tablename;
For Multiple entries in one row
• insert all into kocbh(rollno, name, subject)
values(6, 'mohsin', 'cloud computing') into
kocbh(rollno, name, subject)values(7,'sahil',
'data structures') select * from dual;

• Insert all into tablename(col1,col2,…) values


(val1, val2,…) into tablename(col1, col2,…)
values(val1, val2,…) select * from dual;
“Where” condition
• Select * from tablename where condition;
• Select columnname from table where
condition;
Distinct : for eliminating duplicates

• select distinct attributename from


tablename;
ORDER BY
• SELECT pname, price, manufacturer
FROM Product
WHERE category=‘gizmo’ AND price > 50
ORDER BY price, pname;
• Gives result in ascending order.
Update
• update tablename set colunmname1
=‘value' , columnname2=‘value' where
condition;

You might also like