Posts

Showing posts from April, 2024

SQL Queries

use sql_hr; select * from employees; select * from employees where first_name regexp 'y$'; select * from employees where job_title regexp '^s|t$'; select * from employees where job_title regexp '^s|t$' order by salary; select * from employees where job_title regexp '^s|t$' and last_name regexp 'n$' order by salary; select count(distinct employee_id) as employee_id_count from employees; select avg(salary) as avg_salary from employees; select max(salary) as max_salary from employees; select min(salary) as min_salary from employees; select * from employees as e left join offices as o using(office_id) union select * from employees as e right join offices as o using(office_id); select * from employees as e left join offices as o using(office_id) union select * from employees as e right join offices as o using(office_id); select count(*) as row_count from(select * from employees as e left join offices as o using(office_id) union select * from employees...

SQL Queries

use sql_store; select * from customers; select * from orders; select * from customers as c inner join orders as o on c.customer_id=o.customer_id; select * from customers as c inner join orders as o on c.customer_id=o.customer_id order by c.customer_id; select * from customers as c inner join orders as o using(customer_id); select customer_id,order_id,status from customers as c inner join orders as o using(customer_id); select customer_id,order_id,status from customers as c inner join orders as o using(customer_id) order by customer_id;

SQL Queries

use sql_store; select * from orders; select * from orders where shipper_id is null; select * from orders where shipper_id and comments is null; select *  from orders order by status; select *  from orders order by shipper_id and status; select *  from orders order by shipper_id,status; select *  from orders order by shipper_id,order_date; select * from customers; select * from customers order by 2; select * from customers order by 4; select first_name, 10 as points from customers order by points; select * from order_items; select * from order_items where order_id=2; select * from order_items where order_id=2 order by quantity*unit_price desc; select *,quantity* unit_price as totalprice from order_items where order_id=2 order by quantity*unit_price desc; select * from customers; select * from customers order by points desc; select * from customers order by points limit 5; select * from customers limit 2,3; select * from customers limit 5,3;

SQL Queries

use sql_store; select * from customers; select address from customers where address like '%Trail%' or        address like '%Avenue%'; select phone from customers where phone like '%9'; select last_name from customers where last_name like '%y%'; select last_name from customers where last_name regexp 'y'; select last_name from customers where last_name regexp '^b'; select last_name from customers where last_name regexp 'field$'; select last_name from customers where last_name regexp 'dell$'; select last_name from customers where last_name regexp '^rose'; select last_name from customers where last_name regexp 'rose|field|dell'; select last_name from customers where last_name regexp '^rose|^field|dell'; select last_name from customers where last_name regexp 'rose$|field$|dell'; select last_name from customers where last_name regexp 'y'; select last_name from customers where last_name reg...

Words

Wrapped- overjoyed; delighted. Endeavor-try hard to do or achieve something. Moralist-a person who tries to force or teach other people to behave in ways he or she considers to be most correct and honest.  Despite-without being affected by; in spite of. Captivated-to hold the attention of someone by being extremely interesting, exciting, pleasant, or attractive Opulence-great wealth or luxuriousness. Concoct-put together, assemble relish-great enjoyment. glorification-the act of making something seem better or more important than it really assimilate-accommodate, adapt, blend in, to become, or cause somebody to become, a part of a country or community rather than remaining in a separate group.