DBMS INTRODUCTION - Nandhini148/Cyber-security-placement-training- GitHub Wiki
- Install and setup SQL workbench to create a database.
-
Use the below command to create a database. create database <database_name>;
-
Use "show <database_name>; " , "use <database_name>;" to view and update the database
-
Now create a table under the database and input the informations.
eg: create table table_1( id int primary key auto_increment, email varchar(255) not null unique, bio text, country varchar(255) );
- Use the below command to input the data to the table.
eg : insert into table_1 (email,bio,cuntry) values('helo@123','jdhaklf','ind'),('ahd@334','ajhdk','ajhd');
- To view the datas inserted,
eg: select * from <table_name>;
- To select datas specifically,
I. select id,email from table_1; II. select id,email from table_1 order by asd; III. select id,email from table_1 order by desc;
- To use "where" condition,
select id,email from table_1 where id>1; select id,email from table_1 id<=4; select id,email from table_1 where countyr='xxx' and email like 'h%';