至少在公司名为‘C2’和‘C5’公司兼职的职工的职工号
select employee职工号 from employee, works, company
where employee职工号=works职工号
and works公司号=company公司号
and (company公司名='C2' or company公司名='C5')
写出在城市B1的公司的所有职工的工资。
select employee职工名, works工资, company公司名
from employee, works, company
where employee职工号=works职工号
and works公司号=company公司号
and company城市='B1'
package comtestdemo;
import javautilIterator;
import javautilSet;
import javautilTreeSet;
public class Employee implements Comparable {
private String name;
private int price;
public Employee(String name, int price){
thisname = name;
thisprice = price;
}
public String getName() {
return name;
}
public void setName(String name) {
thisname = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
thisprice = price;
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return thisprice - ((Employee)o)price;
}
public String toString(){
return "名字" + name + ",价格" + price;
}
public static void main(String[] args){
Set set = new TreeSet();
setadd(new Employee("张三",8000));
setadd(new Employee("李四",6000));
setadd(new Employee("王五",5600));
setadd(new Employee("马六",7500));
Iterator it = setiterator();
while(ithasNext()){
Systemoutprintln(itnext());
}
}
}
select cast(Rate as decimal(10, 2)) as 四舍五入, CEILING(Rate) as 大于等于员工工资最小整数,FLOOR(Rate) as 小于等于员工工资的最大整数,CONVERT(varchar(100), GETDATE(), 1) as 调整日期 from HumanResourcesEmployeePayHistory
2 不清楚你的意思
3 select top 1 EmployeeID from HumanResourcesEmployeePayHistory order by Rate desc
5 select aEmployeeID,aBirthDate,aManagerID,bFirstName,bLastName,bEmailAddress from (select ContactID,EmployeeID,BirthDate,ManagerID from HumanResourcesEmployee) as a
left join
(select ContactID,FirstName,LastName,EmailAddress from PersonContact) as b
on aContactID=bContactID
public abstract class Person {
public abstract int add();
}
public class Employee extends Person {
protected int num;
public Employee(){}
public Employee(int num){
thisnum=num;
}
public int add(){
num=(1+01);
return num;
}
}
public class ExcellentEmployee extends Employee{
public ExcellentEmployee(int num){
supernum=num;
}
public int add(){
num=(1+02);
return num;
}
}
public class test {
public static void main(String[] args) {
Person employee = new Employee(10);
Person excellentEmployee = new ExcellentEmployee(10);
Systemoutprintln("普通员工工资="+employeeadd());
Systemoutprintln("优秀员工工资="+excellentEmployeeadd());
}
}
数据库基础(面试常见题)
一、数据库基础
1数据抽象:物理抽象、概念抽象、视图级抽象,内模式、模式、外模式
2SQL语言包括数据定义、数据 *** 纵(Data),数据控制(DataControl)
数据定义:CreateTable,AlterTable,DropTable,Craete/DropIndex等
数据 *** 纵:Select,insert,update,delete,数据控制:grant,revoke
3SQL常用命令:
CREATETABLEStudent(
IDNUMBERPRIMARYKEY,NAMEVARCHAR2(50)NOTNULL);//建表
CREATEVIEWview_nameAS
SelectFROMTable_name;//建视图
CreateUNIQUEINDEXindex_nameONTableName(col_name);//建索引
INSERTINTOtablename{column1,column2,}values(exp1,exp2,);//插入
INSERTINTOViewname{column1,column2,}values(exp1,exp2,);//插入视图实际影响表
UPDATEtablenameSETname=’zang3’condition;//更新数据
DELETEFROMTablenameWHEREcondition;//删除
GRANT(Select,delete,)ON(对象)TOUSER_NAME[WITHGRANTOPTION];//授权
REVOKE(权限表)ON(对象)FROMUSER_NAME[WITHREVOKEOPTION]//撤权
列出工作人员及其领导的名字:
SelectENAME,SNAMEFROMEMPLOYEEES
WHEREESUPERName=SName
4视图:
5完整性约束:实体完整性、参照完整性、用户定义完整性
以上就是关于数据库设计题(高手近)全部的内容,包括:数据库设计题(高手近)、创建一个TreeSet对象,并自其中添加一些员工对象(Employee),其姓名和工资分别为:张三 8000,、SQL数据库问题,急求,可以只写出格式等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)