Basic Select - 1

use Chinook;
select * from Album;
select * from Album limit 10;
select * from Album where Title = 'Facelift';
select * from Album where AlbumId  >= 5;
select * from Album where title like 'c%';
select * from Album where title like 'b%' and ArtistId  >=30;
select * from Customer;
select * from Customer order by firstName;
select * from Customer order by lastName desc;
select * from Customer order by firstName, lastName desc;
select concat(firstName, ' ' , lastName) from Customer;
select concat(firstName, ' ' , lastName) as customerName from Customer;
select concat_ws(' ',firstName, lastName) as customerName from Customer;
select * from Murach.customers;
select * FROM Murach.invoices where invoice_id = 19;
select * FROM Murach.invoices where invoice_id = 19 or invoice_id = 29;
select * FROM Murach.invoices where invoice_id in (19,29);
select * FROM Murach.invoices where invoice_id between 19 and 59;
select * FROM Murach.invoices where invoice_id Not in (19,29);

Last updated