Upload
sandipmishra049
View
3
Download
0
Embed Size (px)
DESCRIPTION
sql query
Citation preview
LBI - Microsoft
LBI - Microsoft
LBI - Microsoft
MYSQL1. 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 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 (columnname1,columnname2) values(value1,value2);Ex:- insert into Student (id,name) values(11,Gayatri);10. Multiple records at a time:insert into values(val1,val2),(val3,val4);Ex:- insert into Student values(12,Kandhei),(13,sima);11. See the table information: select * from tablemnameEx:- select * from Student;12. update the table information:update set=,= where =;ex:- update Student set id=12,name=Aurusmita;13. Delete in the table(Delete some information from table)delete from where delete from Student where id=13;
LBI - Microsoft
LBI - Microsoft
LBI - Microsoft