--查询northwind数据库中products表中的数据。要求: --返回前5条记录 --返回前5%的记录 select top 5* from products go select top 5percent* from products go --查询northwind数据库中employees表中的employeeid列的数据 --要求为列格式化显示:如:员工编号为:1 SELECT FirstName+'.'+LastName AS '姓名' FROM Employees SELECT '姓名' = FirstName+'.'+LastName FROM Employees SELECT '员工编号:'+ cast(employeeid as nvarchar(20)) FROM employees select employeeid from employees go --查询northwind数据库中suppliers表中的country列的数据,要求: --值不允许重复 --按country排序 select distinct country from suppliers order by country go select country from suppliers --查询northwind数据库中products表中的数据 --要求:按照categoryid升序和unitprice降序排序 select categoryid,unitprice from products order by categoryid ASC,unitprice DESC --查询northwind数据库中products表中的数据 --要求一:unitprice大于16 --要求二:productname以字母T开头,或者productid为16 select * from products where unitprice>16 and produ
NORTHWIND例子学SQL
最新推荐文章于 2020-03-04 15:51:06 发布