DBMS INTRODUCTION - Nandhini148/Cyber-security-placement-training- GitHub Wiki

DAY 10

SQL BASIC COMMANDS

Commands used to create, update and manage database.

  1. Install and setup SQL workbench to create a database.

Untitled-3

  1. Use the below command to create a database. create database <database_name>;

  2. Use "show <database_name>; " , "use <database_name>;" to view and update the database

  3. 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) );

Untitled-3

  1. 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');

Untitled-3

Untitled-3

  1. To view the datas inserted,

eg: select * from <table_name>;

Untitled-3

  1. 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;

Untitled-3

Untitled-3

  1. 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%';

Untitled-3

Untitled-3

Untitled-3

⚠️ **GitHub.com Fallback** ⚠️