Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle series: (4) Oracle preparatory knowledge 2

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Ordinary users change their passwords

Use the password command to change the new password for the scott username, starting with a letter, but tiger is recommended

Password old password: tiger new password: abc123 enter the new password again: abc123

2. Exit the sqlplus tool

Exit

3. Query who the current user is

Show user

4. Query all objects under scott users

Using the tab table, each user has the tab table.

Select * from tab

5. Set the width of the displayed column

(1) set the displayed column width (character type varchar2, date type date), 10 width bits, a for character type, case or lowercase.

Column ename format a12

Column hiredate format a10

(2) set the displayed column width (numeric number). 9 represents digital, one 9 represents one digit, and four Nines represent four digits. Only 9 can be used.

Column empno format 9999

Column mgr format 9999

Column sal format 9999

Column comm format 9999

Column deptno format 9999

6. Set the height of 80 records displayed on one page

Set pagesize 80

7. Use the / bar to execute the most recent SQL statement

/

8. Clear the screen, which belongs to the command in the SQL*PLUS tool

Host cls

9. Query the structure of emp table

Desc emp

10. Create a new table from an existing table

-- create a new table new_emp and copy the structure and data from the emp table to the new_ emptable (note: don't omit as)

Create table copy_emp as select * from emp

11. Output SQL statements to and read SQL from files

Using the spool command, save the SQL statement to the hard disk file e:/oracle-day01.sql, and create the sql file

Spool e:/oracle-day01.sql

Use the spool off command to save the SQL statement to the hard disk file e:/oracle-day01.sql, and create the sql file to end the statement

Spool off

It outputs both SQL statements and query results to a file

Use the @ command to read the hard disk file e:/crm.sql into the orcl instance and execute the sql statement in the file

@ e:/crm.sql

12. Notes

Use the-- symbol to set a single-line comment

-- select * from emp

Use the / * / symbol to set multiline comments

/ * select*from emp;*/

Summary: of all the techniques learned, the symbols for annotations

Htmlcss/* comments * / js

/ /

/ * Notes * /

Xmljspmysql

#

--

/ * Notes * /

Reference: http://www.cnblogs.com/end/archive/2011/03/31/2001109.html

Oracle

--

/ * /

Java

/ /

/ * /

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report