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

Introduction to Oracle DataBase

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1. Brief introduction of relational database.

The basic concepts of relational data (relational database) are very easy to understand. A relational database is a collection of related information that has been organized into a table structure. Each table contains many rows, which are further organized into columns. These tables are stored in the schema in the database. The so-called schema is the place where database users can store tables. Each user can authorize access to its own table for other users.

2. Brief introduction of structured query language SQL

SQL is a standard language designed to access relational data. SQL statements can be divided into five categories

Query statements are used to retrieve rows stored in a database table. You can use the SELECT statement of SQL to write query statements

Data manipulation language (Data Manipulation Language,DML) statements are used to modify the contents of a table, that is, to add, delete and modify.

Data definition language (Data Definition Language,DDL) statements are used to define the data structures that make up the data, such as:

CREATE creates the data table structure and CREATE TABLE creates the table. CREATE USER creates a database user

ALTER modify table structure ALTER TABLE statement is used to modify a table

DROP delete data table structure DROP TABLE statement is used to delete a table

RENAME changes indicate

TRUNCATE deletes all the contents of the table

Transaction control (Transaction Controller,TC) statements that are used to permanently store all changes to rows in a table or to cancel operations on those rows.

COMMIT permanently saves changes made to the row

ROLLBACK cancels changes made to the line

SAVEPOINT sets a SavePoint where you can roll back changes to the row.

Data Control language (Data Control Language,DCL) statements are used to modify the operation permissions of the database structure

GRANT grants other users access to the database structure

REVOKE prevents other users from accessing the database structure

3. Use SQL*Plus

Use the command line: sqlplus [user_name/password [@ host_string]]

User_name: user name password: login password host_string specifies the database to which to connect

After starting sqlpuls, you can edit the last SQL statement of SQL*Plus by entering the edit command.

4. SQL Devleloper, using graphical tools

5. Create a store schema

Launch sql*plus and log in to the database that creates new users, tables, and PL/SQL packages. Run the store.sql script with the @ command

5.2 DDL statements used to create store schemas

Create user name: CREATE USER user_name IDENTIFIED BY password

Give this user permission: GRANT connect,resource TO user_name

6. Add, modify and delete rows

The INSERT statement is used to add rows to the table, INSERT INTO table_name (column1,column2,...) values (value1,value2,...)

The UPDATE statement is used to modify existing rows in the table. UPDATE table_name SET column1 = value1,column2 = value2,... WHERE table_PK = PK_id

The DELETE statement is used to delete rows from the table. You typically use the where sub-statement to restrict the rows you want to delete. If there is no limit, all rows in the table are deleted. DELETE FROM table_name WHERE table_PK = PK_id

7. Advantages of BINARY_FLOAT and BINARY_DOUBLE data types

Less storage space required BINARY_FLOAT and BINARY_DOUBLE need 5 bytes and 9 bytes of storage respectively, while NUMBER may need up to 22 bytes

A larger range of numbers can be represented.

It is faster to perform operations. BINARY is usually executed in hardware, so it is faster

Operational closure

Rounding transparent BINARY uses binary to represent numbers, while NUMBER is represented in decimal.

8. Introduction to Oracle PL/SQL

PL/SQL is a process language of Oracle that can be used to add some SQL-based programming structures. PL/SQL is mainly used to add procedures and functions to the database to implement business logic.

PL/SQL contains some standard programming structures, such as variable declarations, conditional control (IF-THEN-ELSE), loops, procedures and function definitions.

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

Database

Wechat

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

12
Report