In oracle 9i/10g, if the database instance does not have the scott mode, you can manually create it as follows:Log on to the databaseCreate scott userAssign permissions to scott usersUse scott to log on to www.2cto.com1. Execute the following SQL statementDrop table emp; drop table dept; drop table bonus; drop table salgrade; drop table dummy; create table emp (empno number (4) not null, ENAME VARCHAR2 (10 ), JOB VARCHAR2 (9), mgr number (4), hiredate date, sal number (7, 2), comm number (7, 2),
Oracle analysis function PERCENTILE_CONT
Query the salaries of people with the salary distribution of 25%, 50%, and 75% in each department. percent_rank () is the relative position in the ranking.
Create table EMP (empno number (4) not null, ENAME VARCHAR2 (10), JOB VARCHAR2 (9), mgr number (4), hiredate date, sal number (7, 2 ), comm number (7369), deptno number (2); insert into emp (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values, 'Smith ', 'cler', 7902, to_date ('17-12-1980', 'dd-
) | '@' | substr (global_name, 1, decode (dot, 0, length (global_name), dot-1) global_namefrom (select global_name, instr (global_name ,'. ') dot from global_name); set sqlprompt' gname> 'set termout on
After using the scott user to log on
[oracle@RHEL65 ~]$ sqlplus scott/oracleSQL*Plus: Release 11.2.0.1.0 Production on Sat Jan 23 00:11:26 2016Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the
In oracle9i10g, if the database instance does not have the scott mode, you can manually create it as follows:
In oracle 9i/10g, if the database instance does not have the scott mode, you can manually create it as follows:
In Oracle 9i/10g, if the database instance does not have the scott mode, you can manually create it as follows:
Log on to the database
Create scott user
Assign permissions to scott users
Log On with scott user
1. Execute the following SQL statement
Drop table emp;Dro
How to set up Scott/tiger demo mode correctlyExecute script(1) CD [Oracle_home]/sqlplus/demo.(2) Run Demobld.sql after connecting as any user.Note: The location and name of the script file are different versions.If my Oracle version is 10G and runs in Windows operating system mode, the location and name of the script is: D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlsampl.sqlTo create a pattern without using a scriptCREATE TABLE EMP(EMPNO number (4),Ename VARCHAR2 (10),JOB VARCHAR2 (9),MGR Number
TABLE salgrade ( grade NUMBER,losal NUMBER,hisal NUMBER );
8. Insert test data -- dept
INSERT INTO dept VALUES (10,'ACCOUNTING','NEW YORK');INSERT INTO dept VALUES (20,'RESEARCH','DALLAS');INSERT INTO dept VALUES (30,'SALES','CHICAGO');INSERT INTO dept VALUES (40,'OPERATIONS','BOSTON');
9. Insert test data -- emp
INSERT INTO emp VALUES(7369,'SMITH','CLERK',7902,to_date('17-12-1980','dd-mm-yyyy'),800,NULL,20);INSERT INTO emp VALUES(7499,'ALLEN','SALESMAN',7698,to_date('20-2-
Oracle uses a single cursor to insert data. For example, oracle cursor
Original works, from "Deep Blue blog" blog, deep blue blog: http://blog.csdn.net/huangyanlong/article/details/47143731Background
Recently, some friends asked me how to insert multiple pieces of data into the target table in a single way. To solve this problem, let's make a small experiment.
The communication process is as follows:
The following is an example of Using cursor to accomplish this goal.(1) Prepare the experiment
Oracle analysis function PERCENTILE_CONT, percentile Function
Query the salaries of people with the salary distribution of 25%, 50%, and 75% in each department. percent_rank () is the relative position in the ranking.
Create table EMP(Empno number (4) not null,ENAME VARCHAR2 (10 ),JOB VARCHAR2 (9 ),Mgr number (4 ),Hiredate date,Sal number (7,2 ),Comm number (7, 2 ),Deptno number (2));Insert into emp (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)Values (7369, 'Smith ', 'cler', 7902, to_dat
Table creation statement under the name of Oracle Scott
We often use data for testing when learning Oracle, so it is necessary to create tables and data.
Create table EMP(Empno number (4) primary key,ENAME VARCHAR2 (10 ),JOB VARCHAR2 (9 ),Mgr number (4 ),Hiredate date,Sal number (7,2 ),Comm number (7, 2 ),Depno number (4));
Create table Depth (Deptno number (4 ),DNAME VARCHAR2 (14 ),LOC VARCHAR2 (13));Create table Salgrade(Grade number,Losal number,HISAL NUMBER);Create table Bonus(Ename varchar
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.