摘要: --分组函数 select avg(salary),max(salary),min(salary),sum(salary) from employees 运行结果 --判断大小 select max(last_name),min(last_name),max(hire_date),min(hire_ 阅读全文
posted @ 2022-08-13 21:29 前端导师歌谣 阅读(46) 评论(0) 推荐(0)
摘要: 33. 查询 employees 表中有多少个部门 select count(distinct department_id) from employees 34. 查询全公司奖金基数的平均值(没有奖金的人按 0 计算) select avg(nvl(commission_pct, 0)) from 阅读全文
posted @ 2022-08-13 21:29 前端导师歌谣 阅读(43) 评论(0) 推荐(0)
摘要: 提示:在导入sql和dmp文件之前,先建立用户,指明表空间。其中要注意用户名和表空间最好跟sql文件中的一样。 方法一:.sql文件的导出与导入 导出步骤 使用PL/SQL Developer登录你需要备份的数据库; 选择工具->导出用户对象; 在对象列表中选择需要备份的对象,再选择一个sql类型的 阅读全文
posted @ 2022-08-13 21:29 前端导师歌谣 阅读(1538) 评论(0) 推荐(0)
摘要: 查看表有哪些列 desc employees; 运行结果 基本sql语句 查询全部列 查询特定列 注意事项 算数运算符 阅读全文
posted @ 2022-08-13 21:29 前端导师歌谣 阅读(45) 评论(0) 推荐(0)
摘要: SQL*PLUS命令可以控制数据库吗? 否! 下面的语句是否可以执行成功 可以 select last_name , job_id , salary as sal from employees; 下面的语句是否可以执行成功 可以 select * from employees; 找出下面语句中的错误 阅读全文
posted @ 2022-08-13 21:29 前端导师歌谣 阅读(48) 评论(0) 推荐(0)
摘要: --查询对应的列 大于5000 select employee_id,last_name,salary from employees where salary>5000 运行结果 --查询对应的日期 select last_name,hire_date from employees where hi 阅读全文
posted @ 2022-08-13 21:29 前端导师歌谣 阅读(46) 评论(0) 推荐(0)
摘要: 7. WHERE 子句紧随 FROM 子句 8. 查询 last_name 为 'King' 的员工信息 错误1: King 没有加上 单引号 select first_name, last_name from employees where last_name = King 错误2: 在单引号中的 阅读全文
posted @ 2022-08-13 21:29 前端导师歌谣 阅读(32) 评论(0) 推荐(0)
摘要: --全部小写 全部大写 全部首字母大写 select lower('ATGUIGUJAVA'),UPPER('ATGUIGU Java'),initcap('ATGUIGU Java') from dual -- --转换为小写查询 select * from employees where low 阅读全文
posted @ 2022-08-13 21:29 前端导师歌谣 阅读(32) 评论(0) 推荐(0)
摘要: --通用函数 --求公司员工的年薪 nvl 没有值代替 select employee_id,last_name,salary*12*(1+nvl(commission_pct,0)) "annnal salary" from employees 运行结果 --输出department_id为空时候 阅读全文
posted @ 2022-08-13 21:29 前端导师歌谣 阅读(27) 评论(0) 推荐(0)
摘要: 18. 打印出 "2009年10月14日 9:25:40" 格式的当前系统的日期和时间. select to_char(sysdate, 'YYYY"年"MM"月"DD"日" HH:MI:SS') from dual 注意: 使用双引号向日期中添加字符 19. 格式化数字: 1234567.89 为 阅读全文
posted @ 2022-08-13 21:29 前端导师歌谣 阅读(74) 评论(0) 推荐(0)