0% found this document useful (0 votes)
40 views

MySQL Workbench

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

MySQL Workbench

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

MySQL Workbench

1)For creating database:-


Syntax:
create database student;
2)For creating table:-
Syntax:
create table student_details(rno int,sname
varchar(20));
MySQL Workbench
3) For inserting the table:-
Syntax:
insert into student_details values(1,'Divya');
4)For displaying table:-
Syntax:
select * from student_details;
MySQL Workbench
5)For adding colums:-
Syntax:
alter table student_details add course varchar(20);

6)For adding multiple columns:-


Syntax:
alter table student_details add address varchar(200),add fees
varchar(30);

7)For changing data types:-


Syntax:
ALTER TABLE student_details MODIFY contact varchar(20);
MySQL Workbench
8) For deleting the columns:-
Syntax:
alter table student_details drop column Email;
9)For update the columns:-
Syntax:
update student_details set
course='IMCA',Division='B',Email='kanishka@g
mail.com',contact='23423432432' where rno=2;
MySQL Workbench
10) For filter records:-
Syntax:
select * from student_details where
sname='Chandran';

11)For sortint the result-set in ascending or


descending order:-
Syntax:
select * from student_details order by sname;
MySQL Workbench
12) For descending order :-
Syntax:
select * from student_details order by sname
desc;
13)Order BY several columns :-
Syntax:
select * from student_details order by
sname,Blood_Group;

You might also like