随笔分类 -  数据库 / Oracle

摘要:string ConnectionString = "Data Source=127.0.0.1/orcl;user id=scott;password=tiger;"; OracleConnection conn = new OracleConnection(ConnectionString); 阅读全文
posted @ 2024-04-09 22:50 困到很想醒 阅读(63) 评论(0) 推荐(0) 编辑
摘要:--创建表 create table disney( id number primary key, data varchar2(10)); --创建序列 create sequence id_seq; --创建触发器 create or replace trigger bifer_disney_id 阅读全文
posted @ 2024-04-09 22:48 困到很想醒 阅读(10) 评论(0) 推荐(0) 编辑
摘要:package text.coming; import java.sql.*; public class demo { public static void main(String[] args) { Connection ct=null; Statement statement=null; try 阅读全文
posted @ 2024-04-09 22:46 困到很想醒 阅读(34) 评论(0) 推荐(0) 编辑
摘要:--用Scott用户 conn scott/tiger --根据输入的员工编号统计该部门的员工人数 --oracle的存储过程 --创建或者修改存储过名字可以汉字,定义变量,exception异常处理no_date_found查无数据 create or replace procedure pro_ 阅读全文
posted @ 2024-04-09 22:44 困到很想醒 阅读(11) 评论(0) 推荐(0) 编辑
摘要:for循环 FOR ... in ... LOOP END LOOP; BEGIN FOR i IN 1..10 LOOP dbms_output.put_line(i); END LOOP; END; 问题 1 到 50 ? 3到40 ? while循环 WHILE ... LOOP END LO 阅读全文
posted @ 2024-04-09 22:43 困到很想醒 阅读(9) 评论(0) 推荐(0) 编辑
摘要:--问题输出 下面的内容:oracle世界我来了,一刀999 --declare用于定义变量dbms_output.put_line()是输出语句, --DECLARE --BEGIN --END DECLARE msg varchar2(20) := 'Hello'; BEGIN dbms_out 阅读全文
posted @ 2024-04-09 22:42 困到很想醒 阅读(10) 评论(0) 推荐(0) 编辑
摘要:一 语句查询 1, 在SCOTT模式下,检索emp表的指定列(empno,ename,job) 2, 检索emp表的sal列,把其值调整为原来的1.5 3, 在emp表中,使用like关键字匹配以字母s开头的员工名称 4, 查询emp表中没有奖金的员工信息 5, 在emp表中,查询既不是最高工资,也 阅读全文
posted @ 2024-04-09 22:38 困到很想醒 阅读(23) 评论(0) 推荐(0) 编辑
摘要:老王是食堂的采购员,每天买白菜50斤,土豆30斤,茄子30斤,豆角50斤,采购完都会记录到下面的Vegetable 表中,请你用学到的Oracle知识帮帮老王算算帐。 编号 白菜单价 土豆单价 茄子单价 豆角单价 日期 001 0.35 0.5 0.5 1.2 2017/11/10 002 0.4 阅读全文
posted @ 2024-04-09 22:34 困到很想醒 阅读(9) 评论(0) 推荐(0) 编辑
摘要:授权 120 Gaoshu 2 32 2 111 English 2 30 3 520 Tiyu 2 32 3 112 HTML 2 32 3 1 查询 高数的学分是多少? select * from kechengbiao; select XS from kechengbiao where KCM 阅读全文
posted @ 2024-04-09 22:22 困到很想醒 阅读(6) 评论(0) 推荐(0) 编辑
摘要:win +R 键 sqlplus 1 用户名:scott 密码 :tiger select * from emp; select * from dept; select ename,sal,comm from emp; select ename,sal+nvl(comm,0) from emp; s 阅读全文
posted @ 2024-04-09 22:13 困到很想醒 阅读(12) 评论(0) 推荐(0) 编辑
摘要:用户名 : scott 密码 : tiger 三种方法可以打开sqlplus 1 win+R 打开窗口 输入 sqlplus 2 快捷方式 3 在oracle 主菜单下打开 select * from emp; select * from dept; select 1+1 from dual; se 阅读全文
posted @ 2024-04-09 22:10 困到很想醒 阅读(7) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示