随笔分类 - Oracle基础
摘要:1 package hanqi; 2 import java.sql.*; 3 import java.util.*; 4 public class Student 5 { 6 public static void main(String[] args) 7 { 8 Scanner s=new Scanner(System.in); 9 ...
阅读全文
摘要:1 package hanqi; 2 3 import java.sql.*; 4 5 public class JdbcTest 6 { 7 8 public static void main(String[] args) 9 { 10 // 测试JDBC 11 // 1.加载注册驱动 12 Connect...
阅读全文
摘要:1 insert into score t values('111','3-105',88)--插入一行数据 2 insert into score(sno,cno) values('111','3-105')--指定插入某一行的哪一列数据 3 insert into score_1 select * from score --把表score中的全部数据复制到score_1表中,前提条件表的数据...
阅读全文
摘要:1 --数值函数 2 select abs(-123) from dual--求绝对值 3 select mod(13,3) from dual--取模 4 select ceil(123.3) from dual--向上取整 5 select floor(123.3) from dual--向下取整 6 7 select round(123.65) from dual--四舍五...
阅读全文
摘要:1 select t.sno,s.sname,t.degree,c.cname from SCORE t,STUDENT s,COURSE c where t.sno=s.sno and t.cno=c.cno/*查询多个表,表表之间的字段列名进行比较,进行表与表之间的内连接,内连接缺点当关联条件有不成立的数据,会被隐藏,不会显示*/ 2 select t.sno,s.sname,t.degre...
阅读全文
摘要:1 select * from SCORE t where t.degree=(select max(t.degree) from SCORE t)/*用max()函数查询某列的最大值,min()则代表最小值*/ 2 select sum(t.degree) from SCORE t/*用max()函数查询某列的合计总和*/ 3 select avg(t.degree) from SCORE t...
阅读全文
摘要:1 select sname,ssex from STUDENT t/*从表中查询sname和ssex两个列的数据*/ 2 select t.sname,t.ssex from STUDENT t/*用表别名点出字段名查询两个列的数据*/ 3 select t.sname as 姓名,t.ssex as 性别 from STUDENT t/*查询数据的同时,可以用as关键字给列起个临时的别...
阅读全文
摘要:查询Student表中的所有记录的Sname、Ssex和Class列。 查询教师所有的单位即不重复的Depart列。 查询Student表的所有记录。 查询Score表中成绩在60到80之间的所有记录。 查询Score表中成绩为85,86或88的记录。 查询Student表中“95031”班或性别为
阅读全文
摘要:全局唯一标识符(GUID,Globally Unique Identifier)是一种由算法生成的二进制长度为128位的数字标识符。GUID主要用于在拥有多个节点、多台计算机的网络或系统中。在理想情况下,任何计算机和计算机集群都不会生成两个相同的GUID。GUID 的总数达到了2^128(3.4×1
阅读全文

浙公网安备 33010602011771号