摘要: -- 日期和时间函数 -- 获取当前日期 select curdate(),current_date() from dual -- 返回服务器当前的日期和时间 select NOW(),SYSDATE() from dual -- 返回当前时间 select CURTIME() from dual -- 返回世界标准日期时间 select UTC_DATE(),UTC_TIME() from d... 阅读全文
posted @ 2018-08-01 20:07 MKN 阅读(250) 评论(0) 推荐(0) 编辑
摘要: -- 流程控制函数 -- 1、查询员工部门号,并赋予部门名 select empno,ename,deptno,case deptno when 10 then '10部门' when 2... 阅读全文
posted @ 2018-08-01 20:07 MKN 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 连接连接是在多个表之间通过一定的连接条件,使表之间发生关联,进而能从多个表之间获取数据。在 WHERE子句中书写连接条件。 如果在多个表中出现相同的列名,则需要使用表名作为来自该表的列名的前缀。 N个表相连时,至少需要N-1个连接条件。 第七天(2018/8/1) 日期时间函数 CURDATE()和 阅读全文
posted @ 2018-08-01 20:05 MKN 阅读(194) 评论(0) 推荐(0) 编辑
摘要: -- 1、绝对值 select abs(-1)from dual -- 2、求平方根select sqrt(6)from dual -- 3、圆周率select pi()from dual -- 4、余数select 3%2,3%-2,-3%2,-3%-2from dualselect mod(3, 阅读全文
posted @ 2018-07-31 21:03 MKN 阅读(204) 评论(0) 推荐(0) 编辑
摘要: emp、dept表 DROP TABLE IF EXISTS `dept`; CREATE TABLE `dept` ( `DEPTNO` int(2) NOT NULL, `DNAME` varchar(14) DEFAULT NULL, `LOC` varchar(13) DEFAULT NUL 阅读全文
posted @ 2018-07-30 18:59 MKN 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 数据(data)是事实或观察的结果,是对客观事物的逻辑归纳,是用于表示客观事物的未经加工的的原始素材。 数据可以是连续的值,比如声音、图像,称为模拟数据。也可以是离散的,如符号、文字,称为数字数据。 数据库(DB)是一种专门存储信息和维护信息的容器,严格地说数据库是“按照数据结构来组织、存储和管理信 阅读全文
posted @ 2018-07-30 18:50 MKN 阅读(138) 评论(1) 推荐(0) 编辑
摘要: 运行结果: 阅读全文
posted @ 2018-07-29 21:00 MKN 阅读(604) 评论(0) 推荐(0) 编辑
摘要: package com.neusoft.test; import java.util.Scanner; public class Test05{ public static void main(String[] args) { int i; int j = 0; int year;//年 int month;//月 int day = 0; int y;//初始化年... 阅读全文
posted @ 2018-07-28 14:44 MKN 阅读(286) 评论(1) 推荐(0) 编辑
摘要: --1、查询在1981年入职的员工信息select * from emp where hiredate between '01-1月-1981'and '31-12月-1981'; select * from empwhere hiredate >= '01-1月-1981'and hiredate 阅读全文
posted @ 2018-07-27 18:58 MKN 阅读(204) 评论(0) 推荐(0) 编辑
摘要: if: switch: while: do while: 正三角,倒三角: 运行结果: *** ** * * ** *** 九九乘法: 运行结果: 1*1=1 1*2=2 2*2=4 1*3=3 2*3=6 3*3=9 1*4=4 2*4=8 3*4=12 4*4=16 1*5=5 2*5=10 3 阅读全文
posted @ 2018-07-27 18:56 MKN 阅读(164) 评论(0) 推荐(0) 编辑