Using hibernate to develop rental systems

Source: Internet
Author: User
Tags one table
Using hibernate to develop rental systems
Oracle is a data management system that, like SQL Server, is a relational database with high security and better support for large databases.
Key features of Oracle databases:
1. Support the transaction processing of the multi-user event volume
2. Superior performance in saving database security and integrity
3. Support Distributed data processing to connect databases distributed in different physical locations with communication networks, under the control of distributed database management system , and compose a logically unified database to complete the data Processing task.
4. Portability, Oracle can be used in Windows, Linux and other operating system platforms, and SQL Server can only be used under Windows Physical Concept: a real entity, such as a certain document Logical Concepts: logical names, such as databases, table spaces Oracle's Basic concepts: 1: Database, He's a collection of data stored on disk. -----" 2: Global database name
A flag used to differentiate a database, consisting of a database name and a domain name 3: a database instance
Each database corresponds to a database instance, which is a set of server background processes running through the memory share4: Table Space

We know that the Oarcle database really holds the data file (data files), Oarcle table Space (tablespaces) is actually a logical concept, he does not exist in physics, then a group of data files into a table space.

Table Space Properties:

A database can contain multiple tablespaces, and a tablespace can only belong to one database

A table space contains multiple data files, and a data file can belong to only one table space

Table This space can be divided into finer logical storage units



----"Each Oracle database is made up of several table spaces, and the table space here (as I understand it is a folder, there are multiple tables under the file, multiple tables are a data file, such as a data file for every two tables) A data file may store many tables of data, and a table's data may be stored in multiple data files, that is, there is no one-to-one relationship between database tables and data files .5: Control Files:
----"the extension is. ctl, a binary file. Control files store a lot of information, including data files andthe name and location of the log file. The control file is the necessary file for the database to start and run 6: Patterns and Pattern objects: ----Mode is a collection of database objects, such as tables, indexes, etc. Oracle's 3 most common services: 1:oracleservicesid Service: is an Oracle database service that is created by a database instance that corresponds to the SID (System identifier), where the SID is the name of the database that was entered when Oracle 11g was installed, and the service is default-initiated. The database can be started automatically, and the service must be started. The 2:oracleoradb11g_home1tnslistener Service is the listener service and is an Oracle server-side listener
This service is required only when the database requires remote access. 3:ORACLEDBCONSOLESID is the database console service: A program for Enterprise Manager
character data type: char data type: used when a fixed-length string is required, the length can be 1~2000 byte, or if the size is not indicated, the default is 1 bytes, if the user entered a value less than the specified length, the database is padded with space to the specified length, and if the length is greater than the specified error VARCHAR2 Data type: When a variable-length string is supported, the length can be 1~4000 bytes and can save space
For example, define VARCHAR2 (30), and if the user enters 10 bytes, it shrinks to 10 bytes instead of 30 bytes. the only difference between nchar () and char () is that nchar () uses to store the Unicode character set type (2 bytes) Note: If you want to specify a few characters to store instead of the bytes available varchar2 (ten char) numeric data type: When number (the specified maximum digit p, the number of digits to the decimal point s)
Number of significant digits: From the left, the first Non-zero number, that is, scientific notation, decimal points and symbols do not count, if the exact value of a valid bit <=p correct, otherwise error: such as: 123.89 number (4,2) after the exact value of 123.89, the effective bit is 5 greater than 4, error 12.897 Number (4,2) The exact value is 12.90 significant digits 4 equals 4, correct

pseudo-Columns in Oracle: Equivalent to a column, but not stored in a table, can be found but not added or deleted rowID: Return this row address The fastest way to access a row in a table can show how rows of a table are stored can be uniquely identified as a row in a table rownum: is a pseudo column that always starts with 1, <n is OK, but >=n is not. Data Definition language: ddl:create, ALTER, truncate (truncated), drop truncate TABLEA Delete only the records in the table without deleting the structure in the table Data Manipulation Language: DML: Change and delete Transaction Control Language: Tcl:commit, savepoint, rollback Data Control Language: Dcl:grant (authorized) to, REVOKE (revoke authorization) from if the column alias has a special character Furu: space, enclose in double quotes Set Operator: Union: Union query:--Statistics by wage segment--Using federated queries: Merging the results of two queries, resulting in a new table, and deleting duplicate rows--Salary level staff number--1000 2--Salary level employee number-----Repeat line, kill--1 000-2000 6 SELECT * FROM (SELECT ' 1000 ' as salary level, count (1) as employee number from EMP where sal<1000 Union SELECT ' 200  0-3000 ' as salary level, count (1) as number of employees from EMP where Sal between and 3000 union SELECT ' 1000-2000 ' as wage level, count (1) As number of employees from EMP where Sal between 1000 and union SELECT ' more than 3000 ' as wage level, count (1) as employee number from EMP where SAL&GT ; 3000)

You can sort the results of a union query using the order by must be placed after the last SELECT statementUNION ALL: Federated query: Means not to kill duplicate rows
intersect: intersection operator find the number of employees who have retired but are still employed by the company to continue working select empno from empIntersect select Rempno from remp minus: subtraction set operator

The intersect and minus operators are not supported in SQL Server. but you can use exists and not exists to achieve the same effect SELECT * from emp e where don't exists (SELECT * from Remp R where C.empno=r.rempno)Take C.empno to remp table match, if no match succeeds, not exists return true, find

If you look for a student who has not participated in a test, you can use this method--sql a statement with a variety of ways

"||" 操作符为连接操作符 相当于SQL server 的 “+”   在Oracle 里头,字符串相加用 || 数字相加+
ALTER TABLE Dept Add (deptid Number (5));
ALTER TABLE Dept Drop (DeptID);
--Sometimes missing closing parenthesis: Possible causes: 1: True missing right parenthesis 2 is: There is a syntax error, may be a function name write wrong
--Job create tablespace tp_hr  datafile   ' e:orcl_datas\a_hr.dbf '--this folder will exist size 10m  autoextend on next 32m  maxsize 2048m; create tablespace tp_orders  datafile   ' e:orcl_datas\a_oe.dbf ' size 10m  Autoextend on next 32m  maxsize 2048m; Alter user a_oe default tablespace tp_orders; Create sequence dept_seq start with 60 increment by 10  maxvalue 10000; drop sequence dept_seq; select * from dept; Insert into dept values (Dept_seq.nextval, ' zz ', ' Guangdong '); Insert into dept values (dept_seq.nextval, ' BB ', ' Hunan '); drop sequence dept_seq; create table deptbak as select * from dept; drop table deptbak; select * from deptbak; Insert into deptbak values (Dept_seq.nextval, ' cc ', ' Hunan '); Insert into deptbak values (Dept_seq.nextval, ' dd ', ' Hunan '); --Create a Reverse key index for the customer number  create index index_reverse_customer_id on customers (customer_id)   reverse;  -Create a bitmap index for a region Create bitmap index index_bitmap_nls_territory  on  customers (nls_territory); --  creates a composite index create index indx_t on customers for first and last names (Customer_last_name,customer_first_name ); --Create a range partition table based on the order table create table rangeorder  (  order_id     number (a)  not null,   order_date   date not null,   ORDER_MODE &NBSP;&NBSP;&NBSP;VARCHAR2 (8),   customer_id  number (6)  not null,    Order_status number (2),   order_total  number (8,2),   SALE_REP_ID   Number (6),   promotion_id number (6)) Partition by range (order_date) (   partition p1 values less than  (to_date (' 2005/01/01 ', ' yyyy/mm/dd ')),     partition p2 values less than  (to_date (' 2006/01/01 ', ' yyyy/mm/dd ')),     partition p3 values less than  (to_date (' 2007/01/01 ', ' yyyy/mm/dd ')),     partition p4 values less than  (to_date (' 2008/01/01 ', ' yyyy/mm/dd ')),     partition p5 values less than  (to_date (' 2009/01/01 ', ' yyyy/mm/dd ')),     partition p6 values less than  (MaxValue));  select * from rangeOrder partition  (P6);  delete from rangeOrder partition  (P6);


Oracle Database appears "error occurred in batch: OR

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.