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

Mysql: LBI - Microsoft

The document provides instructions for using MySQL to manage databases and tables. It includes commands for: 1. Viewing existing databases and creating new databases. 2. Selecting a database to use. 3. Creating tables within databases and viewing table structure. 4. Inserting data into tables through different syntaxes. 5. Viewing all data in a table through select queries. 6. Updating and deleting existing table data through update and delete commands.

Uploaded by

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

Mysql: LBI - Microsoft

The document provides instructions for using MySQL to manage databases and tables. It includes commands for: 1. Viewing existing databases and creating new databases. 2. Selecting a database to use. 3. Creating tables within databases and viewing table structure. 4. Inserting data into tables through different syntaxes. 5. Viewing all data in a table through select queries. 6. Updating and deleting existing table data through update and delete commands.

Uploaded by

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

LBI - Microsoft

MYSQL
1. To see the database:
show databases;
2. To create new database:
create database databasename;
ex:- create database DB1;
3. To use the database:
use databasename;
ex:- use DB1;
4. To delete the database:
Drop database databasename;
Ex:- drop database db2;
5. To create a table in used database:
create table tablename(columnname datatype,columnname1
datatype);
ex: create table Student(id int,name varchar(10));
6. To see the table information:
describe tablename
or des tablename;
describe Student;
or des Student;
7. To see all the table present in a database:
show tables;
8. Inserting the values into table:
insert into <tablename> values(value1,value2,value3);
Note:- The value should exact count with the table column.
ex:- insert into Student values(10,sandip);
9. 2nd syntax for inserting into table:
insert into <tablename> (columnname1,columnname2)
values(value1,value2);
Ex:- insert into Student (id,name) values(11,Gayatri);
10.Multiple records at a time:
insert into <tablename> values(val1,val2),(val3,val4);
Ex:- insert into Student values(12,Kandhei),(13,sima);
11.See the table information:
select * from tablemname
Ex:- select * from Student;
12.update the table information:
update <tablename>
set<columnname>=<value>,<columnname>=<value> where
<columnname>=<value>;
ex:- update Student set id=12,name=Aurusmita;
13.Delete in the table(Delete some information from table)
delete from <tablename> where <condition>
delete from Student where id=13;

LBI - Microsoft

LBI - Microsoft

LBI - Microsoft

You might also like