select cust_id from Customers;
select distinct prod_id from OrderItems;
select * from Customers;
select cust_name from Customers order by cust_name desc;
select cust_id,order_num from Orders order by cust_id,order_date desc;
select quantity,item_price from OrderItems order by quantity desc,item_price desc;
select vend_name from Vendors order by vend_name desc;
select prod_id,prod_name from Products where prod_price = 9.49;
select prod_id,prod_name from Products where prod_price >= 9;
两种都行
select prod_name,prod_price from Products where prod_price between 3 and 6;
select prod_name,prod_price from Products where prod_price >=3 and prod_price <=6;
select distinct order_num from OrderItems where quantity >=100;
select vend_name from Vendors where vend_country = 'USA' and vend_state = 'CA';
select order_num,prod_id,quantity from OrderItems where quantity>=100 and (prod_id = 'BR01' | prod_id = 'BR01'|prod_id = 'BR01');
select order_num,prod_id,quantity from OrderItems where quantity>=100 and prod_id in ( 'BR01' ,'BR02','BR03');
select prod_name,prod_price from Products where prod_price >=3 and prod_price <=6 order by prod_price;
SELECT vend_name
FROM Vendors
WHERE vend_country = 'USA' AND vend_state = 'CA' ORDER BY vend_name ;
select prod_name,prod_desc from Products where prod_desc like '%toy';
select prod_name,prod_desc
from Products
where prod_desc not like '%toy';
select prod_name,prod_desc
from Products prod_desc
where prod_desc like '%toy' and prod_desc like '%carrots%';
select prod_name,prod_desc
from Products prod_desc
where prod_desc like '%toy%carrots%';
select
vend_id,
vend_name as vname,
vend_address as vaddress,
vend_city as vcity
from Vendors
order by vend_name ;
select prod_id,prod_price,prod_price * 0.9 as sale_price from Products;
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务