老师这什么原因 和视频里一样操作 老师一下测试成功 我的却超时了
昨天正常运行的oracle数据库,今天打开登录,出现,
原因不明,百度结果要使用cmd中的
老师,select * from employees e;这种是只适合当前语句,每次都需要定义。而create synonym em for employees;起的别名,就不需要再定义了,可以直接用的意思吗
老师,为什么伪劣不用别名不可以查询11-20的数据。
sql语句1:
select * from (select rownum,e.*from employees e) em where rownum>=11 and rownum<=20;
sql语句2:
select * from (select rownum ru,e.*from employees e) em where ru>=11 and ru<=20;
sql语句1不能查询11-20,sql语句2可以,两者差别就只是取了别名
结果:
select EMPLOYEE_ID,CONCAT(LAST_NAME,FIRST_NAME)job_id, from length(Last_NAME), INSTR(LAST_NAME,'a') "Contains 'a'?"
from employees
where substr(job_id,4)='rep';
老师我这个运行不出来
from-->where-->group by-->select-->having-->order by
老师讲的是如上执行顺序,
如果
select deptno,avg(sal) from emp group by deptno having avg(sal)>2000;
那么查询到的只有满足avg(sal)>2000的才会被显示出来,不应该是先执行having再select么,这里不知道怎么理解.
老师 为什么说一个数据库对应一个实例 有的人又说一个数据库可以有N个实例
为什么我添加了外键约束,可是没报错?
我现在直接登陆不上去了,不知道什么原因。。。。。。。。。。。。。。。
老师,这个怎么解决?都是按照前面的课程一步一步设置的
这是我的url
这是我的sql
这是执行结果
出现乱码,为什么,我的dept表的字符集就是utf-8
老师数据库用的多吗
老师:为何加了个not之后,就一个都查不出来了。
//更新departments表中department_id为3的数据,将部门换成教学部,将location_id 换成6 public void updateDepartments(String department_name,int location_id,int department_id){ Connection conn=null; Statement state=null; try{ Class.forName("com.mysql.cj.jdbc.Driver"); conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/bjsxt?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT","root","mysql"); state=conn.createStatement(); String sql="update departments d set d.department_name='"+department_name+"',d.location_id="+location_id+"where d.department_id="+department_id; int flag=state.executeUpdate(sql); System.out.println(flag); }catch (Exception e){ e.printStackTrace(); }finally { if(state!=null){ try { state.close(); } catch (SQLException throwables) { throwables.printStackTrace(); } } if(conn!=null){ try { conn.close(); } catch (SQLException throwables) { throwables.printStackTrace(); } } } } public static void main(String[] args) { jdbcTest test=new jdbcTest(); //test.insertDepartments("研发部",8); test.updateDepartments("教学部",6,3); } }
老师您好,在更新数据库这节,拼接的更新语句的字符串检查了几遍,没有找到问题,报错
老师怎么ping通,老师怎么ping通,
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637