Showing posts with label BBA Guide 2nd Semester :: Database Management System. Show all posts
Showing posts with label BBA Guide 2nd Semester :: Database Management System. Show all posts

Friday, July 25, 2014

Overview of OODBS.doc

Overview of OODBS
When database capabilities are combined with object-oriented programming language capabilities, the result is an object-oriented database management system (OODBMS). OODBMS allow object-oriented programmers to develop the product, store them as objects, and replicate or modify existing objects to make new objects within the OODBMS. Because the database is integrated with the programming language, the programmer can maintain consistency within one environment, in that both the OODBMS and the programming language will use the same model of representation. Relational DBMS projects, by way of contrast, maintain a clearer division between the database model and the application. As the usage of web-based technology increases with the implementation of Intranets and extranets, companies have a vested interest in OODBMS to display their complex data. Using a DBMS that has been specifically designed to store data as objects gives an advantage to those companies that are geared towards multimedia presentation or organizations that utilize computer-aided design

ODBMS Characteristics
The characteristics of ODBMS are separated into three groups as follows:
Mandatory, these are the characteristics which system satisfies in order to be an object database. This includes the characteristics like, encapsulation, types or classes, inheritance, complex objects,objectidentity,extensibility,persistence,overriding,computational,completeness, persistence, secondary storage management, concurrency, and recovery.
o    Encapsulation : Encapsulation has two views, programming language view and the database adaptation of that view .Encapsulation is the representation of the data object by its attributes and the various methods specified to manipulate those data objects. In this operations performed on the data objects are visible but the data and the implementation are hidden in those objects.
o    Types and ClassesType refers to the particular set of Objects in the system ,which has two parts, interface and the implementations. Generally interfaces are visible to the user and the implementations are hidden Class is a template for creating the objects of a particular types having their own implementations. The new objects can be created by performing new operation on the class.
o    Inheritance: It is most important feature of the object database, it gives the hierarchical relationships between different objects at different levels and  gives code reusability. It helps in factoring and out shared the implementations and specifications in system. There are different types of inheritance like substitution inheritance, constraint inheritance, inclusion inheritance and specialization inheritance.
o    Complex Objects: Complex objects are built by using the basic data objects like, integer, string, real, Booleans. There are various complex data objects such as array,list,indices,tuples,etc.We can define methods to manipulate these new complex types.
o    Object Identity: It is a very important issue in database, each object is uniquely identified from the whole database or similar kinds of objects. Each object has a unique identity and we can access and edit the object by using the same. It can be variable name or from a physical address space in memory.
o    Extensibility: Database system has its own predefined set of data types, which we can use to write new types and there is no usage difference between the one which system has and the one we written, but there may be strong difference in the way two are supported.
o    Persistence: It is the ability of the system data to preserve or survive during execution so that it can be further used by another process. Persistency provides the reusability.
o    Overriding, overloading: We can use the same name for implementation of the object methods or operations to represent the same data in different ways, is overriding or overloading.
o    computational completeness: This property says that we can define or implement any kind of computable function for the ODB, using DML of database system. Computational complete system almost gives all the operation implementation.
o    Secondary storage management: The data in system is managed, so as to get the quick and easier access. It is supported using different techniques, including data clustering, indexing, query optimization, data buffering and access path selection. These all are invisible to user. It has two levels of management, logical and physical.
o    Concurrency: A good system must have concurrency techniques. When number of users interacting with the user ,the database system must provide same level of service to all the users. It should avoid the system failure, incomplete transactions.
o    Recovery: This feature also provides same level of service and should recover itself to original state if system suffers from the hardware or software failures
·         Optional, the one which are not mandatory but can be added to make ODB more efficient to achieve more functionalities. Like, multiple inheritance, type checking and inferencing, distribution, design transactions and versions.
·         Open, they deals with programming issues, and system representation. Along with the mandatory and non-mandatory features of the ODMBS designing such systems we still have a lot of design choices to improve our modeling to built a good system. Some of these are type system, programming paradigm, representation system and uniformity.

Comparison with RDBMSs
Potential advantages:
  • Objects don't require assembly and disassembly saving coding time and execution time to assemble or      disassemble objects.
  • Reduced paging.
  • Easier navigation.
  • Better concurrency control - a hierarchy of objects may be locked.
  • Data model is based on the real world.
  • Works well for distributed architectures.
  • Less code required when applications are object oriented.
Potential disadvantages:
  • Lower efficiency when data is simple and relationships are simple.
  • Relational tables are simpler.
  • Late binding may slow access speed.
  • More user tools exist for RDBMS.
  • Standards for RDBMS are more stable.
  • Support for RDBMS is more certain and change is less likely to be required.

Wednesday, June 4, 2014

MySQL Queries Part 1 :: Create database and tables !


Welcome! In this part, you will learn the basics of database. I.e. To create own database, use database, create tables and insert values ..
  • First, get access to MySQL server...

Create a database :

To create a database, first see weather database you are going to create already exist or not. If it exists then you cannot create the database with same name..
To see the list of database, simply type show databases;


To create a new database, type create database [database_name]
Example : Create database bba;
Above code will create a database bba in MySQL server...

Create a table inside database :
To create a table or work inside a database, first u need to enter inside a database you want to interact.. To use the database type use [database_name];
Example : use bba;
To create a table in database, see the example below :

Create table students (id integer primary key auto_increment, name varchar(100), address varchar(200), roll integer unique));
Above code will :
1. Create a table in database with name students !
2. Add a column [id] .. Integer means only numbers are accepted, primary key means main index key on database, auto_increment means that you dont need to insert values in id column everytime. Database will automatically update upcoming records..
3. Add a column [name] with varchar(100) .. varchar means character. It accepts almost everything . (100) means that only 100 words will be accepted in this column.
4. Add a column [address]
5. Add a column roll.. Unique means that values wont be repeated
To see the table you have created, type desc [table_name] 
Example : desc students;

Tuesday, June 3, 2014

How to Install MySQL database

We are sorry to say you that we are unable to provide you direct link of MySQL installer, because MySQL databases are often updated and links are changed. Dont worry you can download MySQL from Google.. Just type MySQL .rar file and search on Google. I personally recommend you to download Extractable file(.rar) file instead of direct installer file (.exe) because you will get a low minimized file and virus will also not affect your file..
Steps :
1. After you have downloaded the file, extract it using WINRAR [Winrar is a extractor/compressor available on web]
2. Extract the files and Copy the extracted folder to local disk c: [Make sure that you rename the folder to [mysql], There should be [bin] folder inside the mysql folder]
3. After you have completed the above two steps, it finally time to install mysql using Command Prompt .
4. Open Command Prompt as administrator .
 [Command prompt is commonly known as CMD or DOS]
6. Type cd c:/mysql/bin and hit enter [This means you have entered at Local Disc C> MySQL> bin.. If you saw any error message then please follow up step 1 and 2 carefully]
7. After you have entered at the directory, type mysqld -install [If you faced any error then either you have not opened cmd as administrator or you have made some mistakes.. Fix it]
8. After Success message, Type sc start mysql .. [This means you have started mysql service on your computer... If you faced any error then either you have not opened cmd as administrator or you have made some mistakes.. Fix it]
+++++++++++++++++++++++++++++++++++++
If you have completed all steps, i would like to Congrats you for your success on Installing MySQL.. Try typing 
mysql -u root -p and hit enter, if you are asked to enter password, hit enter.. If everything is fine, you will see long text on MySQL granting you access !! This is how you install MySQL server... Comment below if you still face problems..
 

Basics of Database

If database management system is not included at your course at second semester then don't worry it will be included later.. So, lets see what is database first !
Database :
A database is a collection of information that is organised so that it can easily be accessed, managed, and updated. In one view, databases can be classified according to types of content : Bibliographic, full-text, numeric and images.

To understand, simply assume that database is place where data are kept..

Queries you are going to learn here is globally accepted codes. It works fine on PHP too.. If you are planning to learn php then MySQL database will be a very good base to you.. So, we will now close the basic and head directly towards the coding section. First, you need to install database on your computer... Get an offline copy of MySQL database..
For more information, You can read this section below :
## How to Install MySQL database