Documents

Oracle NOTES

Description
Oracle NOTES
Categories
Published
of 23
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
  ORACLE BASIC DATABASE CONCEPTS It is a coherent collection of data with some inherent meaning, designed, built and populated with data for a specific purpose. A database stores data that is useful to us. This data is only a part of the entire data available in the world around us; Characteristics of a Database Management System:    It represents complex relationships between data.    Keeps a tight control of data redundancy.    Enforces user-defined rules to ensure the integrity of table.    Has a centralized data dictionary for the storage of information pertaining to data and its manipulation.    Ensures that data can be shared across applications.    Enforces data access authorization. CONCEPT OF RDBMS: He applied the principles of relationships in statistics to data management and came up with twelve laws. Using mathematics, he proved that if all these 12 laws were incorporated into database core technology, there would be a revolution in the speed of incorporated into database core technology, there would be a revolution in the speed of any DBMS system while managing data, even when used on network operating systems. All of a sudden new life was injected into software houses who had devoted large sums of money in developing DBMS system that programmers could use to manage data. These software houses took up the challenge and many products came into existence which propounded that they followed Codd’s laws; However, none of these products have been successful implementing all 12 laws into their DMBS core technology . The lesser the number of Codd’s laws implemented in a product’s core technology, greater are the overheads the product will place on the hardware used for running it. Characteristics of A Relational Database Model System:    The relational data management model eliminated all parent-child relationships and instead represented all data in the database as simple row/column tables of data values.    A relation is similar to a table with rows/columns of data values. The rows of a table are referred to as Tuples and the columns are referred to as Attributes. Several tuples of equal length .    Each table is an independent entity and there is no physical relationship between tables.    Most data management system based on the relational model have a built-in support for query language like ANSI SQl or QBE(Query by Example). These queries are simple English constructs that allow adhoc data manipulation from a table.    Relational model of data management is based on set theory. Built  – in query language is designed in the RDBMS, so that it can manipulate sets of data.    The user interface used with relational models is non-procedural because only what needs to be done is specified and not how it has to be done. Using any of the other methods, you have not only to specify what needs to be done but how it has to be done as well.  E. F. TED CODD’S LAWS FOR A FULLY FUNCTIONAL RELATIONAL DATABASE MANAGEMENT SYSTEM      Relational Database Management:- A relational database management system uses only its relational capabilities to manage the information stored in its database.    Information Representation:- All information stored in a relational database is represented only by data item values, which are stored in the tables that make up the database. Association between data items are not logically represented in any other way, such as, by the use of painters from one table to the other.      Logical Accessibility: - Every data item value stored in a relational database is accessible by stating the name of the table it is stored in, the name of the column under which it is stored and the values of the primary key that defines the row in which it is stored.      Representation of null values:-  The database management system has a consistent method for representing null values. For example, null values for numeric data must be distinct from zero or any other numeric value and for character data it must be different from a string of blanks or any other character value.      Catalog Facilities:- The logical description of al relational database is represented in the same manner as ordinary data. This is done so that the facilities of the relational database management system itself can be used to maintain database description.    Data Language:-  A relational database management system may support many types of languages for describing data and accessing the database. However, there must be at least one language that uses ordinary character strings to support the definition of data, the definition of views, the manipulation of data, constraints on data integrity, information concerning authorization and the boundaries for recovery of unuts.    View Updatability: -  Any view that can be defined using combinations of base tables, that are theoretically updatable, is capable of being updated by the relational database management system.      Insert, Update and Delete: -  Any operation that describes the results of a single retrieval operation is capable of being applied to an insert, update or delete operation as well.      Physical Data Independency: -  Changes made to physical storage representation or access methods do not require changes to be made to application programs.      Logical Data Independence: -  Changes made to tables, that do not modify any data stored in that table, do not require changes to be made to application program.      Integrity Constraints: -  Constraints that apply to entity integrity and referential integrity are specifiable by the data language implemented by the database management system and not by the statements coded into the applications program.    Database Distribution:-  The data language implemented by the relational database management system supports the ability to distribute the database without requiring changes to be made to application programs. This facility must be provided in the data language, whether or not the database management system itself supports distributed databases.  DATA TYPES    CHAR:  –  Values of this data type are fixed length character strings of maximum length 255 characters.    VARCHAR/VARCHAR2:-  Values of this data type are variable length character strings of maximum length 200 characters.    NUMBER : - The number data type is used to store numbers. Numbers of virtually any magnitude maybe stored up to 38 digits of precision. Numbers as large as 9.99*10 to the power 124, i.e. 1 followed by 125 zeros can be stored.    DATE:- The standard format is DD- MM-YY as in 12-MAR-91. To enter dates other than the standard format, use the appropriate functions. Data Time stores date in the 24-hour format. By default, the time in a data fields is 12:00:00 am, if no time portion is specified. The default data for a data field is the first day of the current month.    LONG:- Cell defined as LONG can be store variable length character strings containing upto 65,535 characters. Long data can be used to store arrays of binary data in ASCII format. CREATE TABLE COMMAND CREATE TABLE table name (Column name data type (size), column name data type (size)); Table Name: client_master Column Name Data Type Size Attributes Client_no Varchar2 6 Name Varchar2 20 Address1 Varchar2 30 Address2 Varchar2 30 City Varchar2 15 State Varchar2 15 Pincode Number 6 Remarks Varchar2 60 Bal_due Number 10,2 CREATE TABLE client_master (client_no varchar2(6) , name varchar2(20), address1 varchar2(30), address2 varchar2(30 ), city varchar2(15), state varchar2(15), pincode number(6), remarks varchar2(60), bal_due number(10,2)); Table Name: product_master Column Name Data Type Size Attributes Product_no Varchar2 6 Description Varchar2 5 Profit_percent Varchar2 2,2 Unit_measure Varchar2 10 Qty_on_hand Number 8 Reorder_lvl Number 8 Sell_price Number 8,2 Cost_price Number 8,2  CREATE TABLE product_master (product_no varchar2(6), description varchar2(5), profit_percent number(2,2), Unit_measure varchar2(10), qty_on_hand number(8), reorder_lvl number(8), Sell_price number(8,2), cost_price number(8,2)); Creating a table from a table: Syntax: CREATE TABLE tablename [(column name, column name)] AS SELECT column name, column name form table name; Note:  if the source table from which the target table is being created, has records in it then the target table is populated with these records as well. CREATE TABLE supplier_master (supplier_no, supplier_name, address1, address2, city, state, pincode, remarks) AS SELECT client_no, name, address1, address2, city, state, pincode, remarks form client_master; INSERTION OF DATA INTO TABLES Inserting a single row of data into a table: Syntax: INSERT INTO table name [(column name, column name)] VALUES (expression, expression); Example: INSERT INTO client_master (client_no, name, address1, address2, city, state, pincode) Values(‘C00001’,’Sumit Kumar’,’A - 7, Surya Apartment’, ’Ratu Raod ‘, ’Ranchi’,   ‘Jharkhand’,834001);   Note:  The Character expressions must be in single quotes. Inserting data into a table from another table: Syntax: INSERT INTO table name SELECT column name, column name From table mane; Example: Insert records in table supplier_master from table client_master INSERT INTO supplier_master SELECT client_no, name, address1, address2, city, state, pincode, remarks From client_master; Insertion of selected data into a table from another table: Syntax: INSERT INTO table name SELECT column name, column name From table name WHERE column name = expression; Example: INSERT INTO supplier_master SELECT client_no, name, address1, address2, city, pincode, state, remarks, From client_master

Jakansheet1

Jul 23, 2017
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks