360 likes | 606 Views
sellers. sellers. insert into sellers (seller_id,seller_name,seller_userid, seller_password,seller_address,seller_phon,seller_fax,seller_dob,seller_status,seller_email) values ('302','saad','saad','1111','makah',213211,222,'01-11-11','locked ',' aa ');
E N D
sellers insert into sellers (seller_id,seller_name,seller_userid, seller_password,seller_address,seller_phon,seller_fax,seller_dob,seller_status,seller_email) values ('302','saad','saad','1111','makah',213211,222,'01-11-11','locked ','aa'); insert into sellers (seller_id,seller_name,seller_userid, seller_password,seller_address,seller_phon,seller_fax,seller_dob,seller_status,seller_email) values ('121','sarah','sarah','2222','damam',222212,233,'12-12-12','locked ',null); insert into sellers (seller_id,seller_name,seller_userid, seller_password,seller_address,seller_phon,seller_fax,seller_dob,seller_status,seller_email) values ('111','anfal','anfal','3333','damam', 222212,null,'03-05-11','locked ','ac');
List all sellers (by SELLER_ID and SELLER_NAME)that names not starting with M? 8
Select seller_id,seller_name from sellers where seller_name not like 'M%';
List all sellers addresses.Avoid repetition of sellers addresses. 12
categories insert into categories (cat_id,cat_name,created_date)values ('1','math','11/03/12'); insert into categories (cat_id,cat_name,created_date)values ('2','computer','11/03/12'); insert into categories (cat_id,cat_name,created_date)values ('3','health','11/03/12');
List all categories that names are 'MATH' or 'COMPUTER' or 'HEALTH’? 7
Select * from categories wherecat_name='math' or cat_name='computer' or cat_name='health';OrSelect * from categories where cat_name in('math','computer','health');
book insert into book (book_id,cat_id,seller_id, book_name,book_isbn,book_author,book_price,shipment_cost,book_status)values ('102','1','302','b1','2221','a1',100,322.00,'sold‘,null); insert into book (book_id,cat_id,seller_id, book_name,book_isbn,book_author,book_price,shipment_cost,book_status)values ('103','2','121','b2','2111','a2',99,88,'sold‘, null); insert into book (book_id,cat_id,seller_id, book_name,book_isbn,book_author,book_price,shipment_cost,book_status)values ('105','3','111','b3','3333','a3',205,20,'sold‘, null);
1 List all data in the BOOKS table?
List all books (by BOOK_ID and BOOK_NAME) in computer category? 2
Select book_name from book where book_price<150 or book_price>200;
Findthe books (book_id and book_name) priced between 200and 300? 6
Select book_id,book_name from book where book_price between 200 and 300;
Find the names and prices of the books, arranged according their prices (the most expensive comes first) 13
Select book_name,book_price from book order by book_price desc;
buyer insert into buyer (buyer_id,buyer_name,buyer_userid,buyer_password,buyer_address,buyer_phon, buyer_fax,buyer_dob,buyer_status,buyer_email)values ('1','gadah','gadah','1111','jedah',4352136,1231,'01/03/11','unlocked','@qq'); insert into buyer (buyer_id,buyer_name,buyer_userid,buyer_password,buyer_address,buyer_phon, buyer_fax,buyer_dob,buyer_status,buyer_email)values ('2','arwa','arwa','2222','makah',2314567,2223,'22/10/12','unlocked','@ss'); insert into buyer (buyer_id,buyer_name,buyer_userid,buyer_password,buyer_address,buyer_phon, buyer_fax,buyer_dob,buyer_status,buyer_email)values ('3','ali','ali','3333','damam',3425657,4433,'04/03/11','unlocked','aa@');
sales insert into sales (invoice_id,invoice_date,buyer_id,sal_tax_rate,ship_address,ship_phon,ship_fax,ship_deliver,ship_note)values ('111','22/10/11','2',20,'makah',2132213546,1232134,'yes ',null); insert into sales (invoice_id,invoice_date,buyer_id,sal_tax_rate,ship_address,ship_phon,ship_fax,ship_deliver,ship_note)values ('112','02/03/11','1',40,'abah',8345754984,3456543,'no',null); insert into sales (invoice_id,invoice_date,buyer_id,sal_tax_rate,ship_address,ship_phon,ship_fax,ship_deliver,ship_note)values ('113','11/12/11','3',50,'damam',3451287645,1234564,'yes ',null);
Find all invoices (by invoices_id) of sales before 01/11/11? 4