SQL Queries

create table cars(

ID int not null,

name varchar(20) not null,

price int not null,

primary key(ID));


insert into cars values

(1,'Maruti Swift',450000),

(2,'Volvo',2250000),

(3,'Toyato',2400000),

(4,'Tesla',3000000),

(5,'BMW',2500000);


select * from cars;


select * from cars

where name in('BMW','Tesla');


select * from cars

where price<500000;


select count(name) as count_names

from cars

where price<500000;


create view cars_view as 

select * from cars;


select * from cars_view;

Comments

Popular posts from this blog

SQL Queries

SQL Queries

SQL Queries