SQL数据库问题,急求,可以只写出格式
2、用以下格式显示所有信用卡的ID,类型,编号和到期年限。 Credit Card ID, Credit Card Type, Credit Card Number, Expire Year (Sales.CreditCard)
3、使用HumanResources.EmployeePayHistory表,查询工资(Rate)最高的员工的编号(EmployeeID)
4、公司经理想看一下所有销售人员编号以及他们所属的区域名称(Sales.SalesTerritory, Sales.SalesPerson)
5、编写一个查询来显示所有职工的的EmployeeID、BirthDate、ManagerID、FirstName、LastName和EmailAddress。 EmployeeID、BirthDate、ManagerID来自于HumanResources.Employee表,FirstName、LastName和EmailAddress来自于Person.Contact表。 HumanResources.Employee 和 Person.Contact 通过外键ContactID进行联接
6、员工求脱单,于是老板想看下是否有单身的员工,有的话就查出所有单身的员工,组织一个相亲活动,否则就不组织活动(HumanResources.Employee) 展开
select cast(Rate as decimal(10, 2)) as 四舍五入, CEILING(Rate) as 大于等于员工工资最小整数,FLOOR(Rate) as 小于等于员工工资的最大整数,CONVERT(varchar(100), GETDATE(), 1) as 调整日期 from HumanResources.EmployeePayHistory
2. 不清楚你的意思
3. select top 1 EmployeeID from HumanResources.EmployeePayHistory order by Rate desc
5. select a.EmployeeID,a.BirthDate,a.ManagerID,b.FirstName,b.LastName,b.EmailAddress from (select ContactID,EmployeeID,BirthDate,ManagerID from HumanResources.Employee) as a
left join
(select ContactID,FirstName,LastName,EmailAddress from Person.Contact) as b
on a.ContactID=b.ContactID