SQL Queries

use pgm;


rename table persons to people;


truncate table people;


select * from people;


create table customers(

id int not null,

name varchar(20) not null,

age int not null,

address char(25),

salary int not null,

primary key(id));


insert into customers values

(1,'komal',32,'kota',2000),

(2,'koushik',45,'mumbai',6500),

(3,'hardik',34,'bhopal',4500),

(4,'rishi',50,'idore',7000),

(5,'chaithanya',46,'delhi',5500);


update customers set address='pune' where id=1;


select * from customers where id=1;


select * from customers;


update customers 

set age=age+5,salary=salary+3000 

where id=1;


select * from customers;


Comments

Popular posts from this blog

SQL Queries

SQL Queries

SQL Queries