Sunteți pe pagina 1din 19

Report

Queries

Query 1

select V_Code, V_Name, V_Contact, V_Areacode, V_Phone, V_State, V_


Order from vendor where v_state is null;
Query 2

select Cus_Code, Cus_Lname, Cus_Fname, Cus_Initial, Cus_Areacode, C


us_Phone, Cus_Balance
from customer where cus_balance>250 and cus_balance<400;
Query 3

alter table invoice


add column INC_INV_TAX float DEFAULT NULL;

SET SQL_SAFE_UPDATES=0;
update invoice set INC_INV_TAX=INV_TAX+((INV_TAX*15)/100);
Query 4

select distinct cus_fname, cus_lname from customer inner join Invoice


on Customer.cus_code=Invoice.cus_code;
Query 5

select cus_code from customer where cus_code not in


(select cus_code from invoice);
Query 6

select distinct concat(cus_fname,' ' , cus_lname) 'Customer Name' from


customer
where cus_code not in (select cus_code from invoice);
Query 7

select count(*) as 'Invoices_generated' from invoice;


Query 8

select distinct concat(cus_fname,' ' , cus_lname) 'Customer Name',


count(invoice.cus_code) 'N_Of_Invoices' from customer
inner join invoice on customer.cus_code=invoice.cus_codegroup
by cus_fname, cus_lname;
Query 9

select Cus_Code, Cus_Lname, Cus_Fname, Cus_Initial, Cus_Areacode, C


us_Phone, Cus_Balance from customer
where (cus_lname='Dunne' or cus_lname='Orlando' or cus_lname='Brown')
and Cus_Areacode=615
order by cus_lname;
Query 10

alter table Emp


add column email_address varchar(20);
Query 11

insert into customer(CUS_CODE, CUS_LNAME, CUS_FNAME,


CUS_INITIAL, CUS_AREACODE, CUS_PHONE, CUS_BALANCE)
values(11608585,'Irfanuddin','Mohammed','K',713,'894-1773',0);
Query 12

delete from vendor where V_State='FL';


1 | Page

S-ar putea să vă placă și