1. Introduction to relational database
The basic concept of relational data (relational database) is very simple to understand. A relational database is a set of related information that has already been organized into a table structure. Each table contains many rows, which are further organized into columns. These tables are stored in the schema (schema) in the database. A pattern is where a database user can store a table. Each user can grant access to their own tables for other users.
2, Structured Query Language SQL introduction
SQL is a standard language designed to access relational data. SQL statements can be divided into 5 categories
Query statements are used to retrieve rows stored in a database table. Query statements can be written using the SQL SELECT statement
Data manipulation language (manipulation LANGUAGE,DML) statement is used to modify the contents of the table, that is, additions and deletions
The Data definition language (LANGUAGE,DDL) statement is used to define the data structure that constitutes the data, for example:
Create creates a table with a data table structure. Create user creates database users
Alter modifies the table structure by altering the table statement to alter
Drop Delete data table structure DROP TABLE statement is used to delete a sheet
RENAME changes indicate
TRUNCATE Delete all contents of a table
A transaction control (Transaction CONTROLLER,TC) statement that stores all modifications to a row permanently in a table, or cancels the operation of those rows.
COMMIT to permanently save changes to the row
ROLLBACK canceling changes to a row
SavePoint setting a savepoint, you can change the operation of the row to roll back here
Data Control Language (LANGUAGE,DCL) statements are used to modify the operation permissions of the database structure
3. Using Sql*plus
Using the command line: Sqlplus [user_name/password[@host_string]]
User_name: User name password: login password host_string Specify connected database
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 store mode
5.1 Start Sql*plus and log in to the database with the Create new user, table, and PL/SQL packages. Run the Store.sql script with the @ command
5.2 DDL statements to create the store mode
Creating username: Create user user_name identified by password;
Give this user permission: GRANT connect,resource to user_name;
6. Add, modify, 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. A where statement is generally used to limit the rows that you want to delete. Without throttling, 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
The required storage space is smaller binary_float and binary_double require 5 bytes and 9 bytes of storage space, while number may require 22 bytes of storage space
can represent a larger range of numbers
Perform operations faster. Binary is typically executed in hardware, so faster
Operation closure
Rounding transparent binary uses the binary to represent numbers, while number is represented by 10 binary.
8. Introduction to Oracle PL/SQL
PL/SQL is a process language for Oracle that can be used to add some SQL-based programming constructs. PL/SQL is primarily used to add procedures and functions to the database to implement business logic.
PL/SQL contains standard programming constructs such as variable declarations, conditional control (if-then-else), loops, procedures, and function definitions.
This article is from the "Ah Cool blog source" blog, please make sure to keep this source http://aku28907.blog.51cto.com/5668513/1783771
About Oracle DataBase