#为了分,我也是蛮拼的
#创建表开始
create table employee(
empid int primary key auto_increment,
name varchar(20) not null,
sex varchar(5) not null,
birth date not null,
level varchar(10) not null,
salary decimal(12,2) not null);
#表创建结束
#假设数据已插入
#查询开始 sel1 name 王% name,level
select empid,name,level from employee where name like '王%';
#sel2 每种level的avg salary假设level有 经理和职工两种
select sum(salary)/count(salary) as '平均工资' from employee where level='经理';
select sum(salary)/count(salary) as '平均工资' from employee where level='职工';
#sel3将empid=101的level update '经理';
#如果是这样,上面的表结构empid可以不为自动增量,楼主可以自己插入empid
update employee set level='经理' where empid=101;
员工入职登记表(职工登记表)不是劳动合同,也
不能代替
劳动合同。员工入职登记表是登记职工身份信息、教育经历和工作经历,家庭主要成员的表格,用于用人单位掌握职工的基本情况。劳动合同是用人单位与劳动者经过
平等协商
,订立的确立劳动关系,明确双方
权利与义务
的书面协议。二者本质不同。
1select ENO,ENAME,GENDER,DEPT,JOBS,DATE from E where Education ='本科' and date between ''2010-1-1" and " 2010-6-30"
2select aENO,aENAME,BSALfrom E as a,S as b where aENO=bENO and date between ''2010-12-1" and "2010-6-30" and aJOBS ='技术支持'
3select aENO,aENAME,aGENDER,aDEPT,aJOBS,aEducation,aDATE from E as a,S as b where aENO=bENO and bYEAR >=10 order by bYAER desc
4select sum(bSAL),aDEPT from from E as a,S as b where aENO=bENO group by aDEPT order by sum(bSAL)
这个是你要的语句还有,每种数据库对BETWEEN的判定是不一样的,我这个是ORACLE的。
给你一个简单的例子。
表格的 *** 作是靠DefaultTableModel,
你好象没有。
------------------------------------------------------------------------------------------------
import javaawteventActionEvent;
import javaawteventActionListener;
import javautilArrayList;
import javautilList;
import javaxswingJButton;
import javaxswingJFrame;
import javaxswingJScrollPane;
import javaxswingJTable;
import javaxswingtableDefaultTableColumnModel;
import javaxswingtableDefaultTableModel;
import javaxswingtableTableColumn;
public class TableAppDemo extends JFrame implements ActionListener {
private JTable table;
private DefaultTableModel model = null;
private String[] columns = { "no", "name", "age", "email" };
private DefaultTableColumnModel columnModel = new DefaultTableColumnModel();
private TableColumn column = null;
public TableAppDemo() {
getContentPane()setLayout(null);
JScrollPane scrollPane = new JScrollPane();
scrollPanesetBounds(12, 46, 418, 217);
getContentPane()add(scrollPane);
model = new DefaultTableModel(columns, 0);
table = new JTable(model);
scrollPanesetViewportView(table);
JButton btnNewButton = new JButton("New button");
btnNewButtonsetBounds(22, 13, 93, 23);
btnNewButtonaddActionListener(this);
getContentPane()add(btnNewButton);
// tablegetColumn(0)setWidth(80);
// tablegetColumn(1)setWidth(120);
// tablegetColumn(2)setWidth(60);
// tablegetColumn(3)setWidth(100);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(450, 300);
setVisible(true);
}
public static void main(String[] args) {
new TableAppDemo();
}
public void actionPerformed(ActionEvent actionevent) {
List<User> list = new ArrayList<User>();
for (int i = 1; i <= 20; i++) {
User user = new User();
userno = i;
username = "name" + i;
userage = i 2;
useremail = "name@163com";
listadd(user);
}
for (int i = 0; i < listsize(); i++) {
User user = listget(i);
modeladdRow(usertoArray());
}
}
}
class User {
public int no = 0;
public String name = null;
public int age = 0;
public String email = null;
public Object[] toArray() {
return new Object[] { no, name, age, email };
}
}
以上就是关于数据库有以下一张表:职工表:职工编号、姓名、性别、出生日期和职位,工资五个字段用SQL语句完成以下查询全部的内容,包括:数据库有以下一张表:职工表:职工编号、姓名、性别、出生日期和职位,工资五个字段用SQL语句完成以下查询、HR系统,数据库中员工表和劳动合同表是什么关系、2.设数据库中有如下两个关系表: 员工表E(ENO, ENAME,GENDER、 DEPT, TEL,DATE,JOBS,Education)等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)