--- RDBMS Class ---
(Relational Database Management System)
1) SELCT STATEMENT
syntax : select *, fields name, from <tablename> where condition
Example : select * from customer
2) UPDATE STATEMENT
syntax : Update <tablename> SET <fieldname>=<fieldvalue> where condition
Example : UPDATE `customer` SET `mobile_no` = '9716410626',email="abtec@gmail.com" WHERE `customer`.`id` = 4;
3) DELETE STATEMENT
syntax : DELETE FROM <tablename> where condition
Example : Delete from `customer` where `customer`.`id` in (4,5,15,34,34,23,115);
4) LIMIT IN MYSQL
syntax : SELECT * FROM <tablename> limit x,y ;
Example : SELECT * FROM `orders` limit 10,20;
5) ORDER BY IN MYSQL
Syntax : SELECT * FROM <tablename> ORDER BY fieldname ASC / DESC ;
Example: SELECT * FROM `customer` ORDER BY `customer`.`email` DESC
6) WHERE Condition In MYSQL
syntax : select * from <tablename> where condtion ;
Example : select * from `customer` where (`customer`.`id` > 10) AND (`customer`.`id` < 20);
7) Create Table in MYSQL
syntax : Create table <tablename> ( fieldname1,fieldname2,etc... ) ;
Example : Create table customer (id int(11), name varchar(255), email varchar(255));
8) Group By In MYSQL
syntax : select fieldname1,fieldname2 from <tablename> group by <field_name> ;
Example : SELECT `customer_id` , count(*) as `total order` FROM `orders` group by customer_id;
No comments:
Post a Comment