Você está na página 1de 11

BHARATHIYAR COLLEGE OF ENGINEERING AND TECHNOLOGY

DEPARTMENT OF INFORMATION TECHNOLOGY

DATABASE MANAGEMENT SYSTEM


SUBMITTED BY
R.SUGANYAA FINAL YEAR

INTRODUCTION:
Database is a collection of information in a structured way. We can say that it is a collection of a group of facts. A database management system is a set of software programs that allows users to create, edit and update data in database files, and store and retrieve data from those database files. Data in a database can be added, deleted, changed, sorted or searched all using a DBMS. PURPOSE OF DATABASE MANAGEMENT SYSTEM: In the early days, database applications were built directly on top of file systems Drawbacks of using file systems to store data: Data redundancy and inconsistency Multiple file formats, duplication of information in different files Difficulty in accessing data Need to write a new program to carry out each new task Data isolation multiple files and formats Integrity problems Integrity constraints (e.g. account balance > 0) become buried in program code rather than being stated explicitly. Hard to add new constraints or change existing ones. Atomicity of updates Failures may leave database in an inconsistent state with partial updates carried out

Example: Transfer of funds from one account to another should either complete or not happen at all Concurrent access by multiple users Concurrent accessed needed for performance. Uncontrolled concurrent accesses can lead to inconsistencies. Example: Two people reading a balance and updating it at the same time.

Database systems offer solutions to all the above problems.

DATA DEFINITION LANGUAGE(DDL):


Data Definition Language is one of the components of SQL. This is used to do the following operation on the database objects. They are, CREATE ALTER DROP CREATE: This statement is used to create a table. SYNTAX: CREATE TABLE <table-name> (column1 datatype,column2 datatype,..,column n datatype);

EXAMPLE: CREATE TABLE Students (sid CHAR(9), name VARCHAR(20), login CHAR(8), age INTEGER, gpa REAL);

ALTER: This command is used to change the structure of the table. SYNTAX: i. ALTER TABLE <table-name> MODIFY(column-name datatype); ii. ALTER TABLE <table-name> ADD(column-name datatype); EXAMPLE: ALTER TABLE Students ADD phone CHAR(7);

DROP: This command used to remove the table from the database. SYNTAX: DROP TABLE <table-name>;

EXAMPLE: DROP TABLE Students;

DATA MANIPULATION LANGUAGE(DML):


Data Manipulation Language is one of the components of SQL. This is used to do the following operations on the database objects. They are, INSERT UPDATE DELETE

INSERT: Insert command is used to add rows of value in the created table. They are three types of insert commands. Inserting values for all the columns defined in a table Inserting values only for some particular columns Inserting more than one row values SYNTAX: INSERT INTO <table-name> VALUES(list of values); EXAMPLE: INSERT INTO Students VALUES (53688,Mark,mark2345,23,3.9);

UPDATE: Update command is used to change values in one or more columns in a row of a table. SYNTAX: UPDATE <table-name> SET column1=expression, column2=expression WHERE search condition; EXAMPLE: UPDATE Students S SET S.age=S.age+1, S.gpa=S.gpa-1 WHERE S.sid = 53688;

DELETE: Delete command is used to delete rows from the table. SYNTAX: DELETE FROM <table-name> WHERE search condition; EXAMPLE: DELETE FROM Students S WHERE S.name = Smith;

DATA CONTROL LANGUAGE(DCL):


Data Control Language is used to do the operations in the database. COMMIT ROLLBACK SAVE POINT GRANT REVOKE

COMMIT: A Commit statement does what it says, and commits all the changes made to data that have been made during the current transaction. If a Commit statement does not take place at the end of a transaction and the computer crashes, then all data will be updated in its previous state. Another important point to remember is that if Commit has been written, it then becomes impossible to Rollback to the original data.

ROLLBACK: A Rollback statement, again does what its name implies, and rolls back, or rescinds, all changes to the current transaction. The ROLLBACK statement is the inverse of the COMMIT statement. It undoes some or all database changes made during the current transaction. SAVEPOINT: The SAVEPOINT statement names and marks the current point in the processing of a transaction. With the ROLLBACK TO statement, savepoints undo parts of a transaction instead of the whole transaction. GRANT: SQL GRANT is a command used to provide access or privileges on the database objects to the users. REVOKE: The REVOKE command removes user access rights or privileges to the database objects.

ADVANTAGES OF DATABASE MANAGEMENT SYSTEM:


Improved availability: One of the principle advantages of a DBMS is that the same information can be made available to different users. Minimized redundancy: The data in a DBMS is more concise because, as a general rule, the information in it appears just once. This reduces data redundancy, or in other words, the need to repeat the same data over

and over again. Minimizing redundancy can therefore significantly reduce the cost of storing information on hard drives and other storage devices. In contrast, data fields are commonly repeated in multiple files when a file management system is used. Accuracy: Accurate, consistent, and up-to-date data is a sign of data integrity. DBMSs foster data integrity because updates and changes to the data only have to be made in one place. The chances of making a mistake are higher if you are required to change the same data in several different places than if you only have to make the change in one place. Program and file consistency: Using a database management system, file formats and system programs are standardized. This makes the data files easier to maintain because the same rules and guidelines apply across all types of data. The level of consistency across files and programs also makes it easier to manage data when multiple programmers are involved. User-friendly: Data is easier to access and manipulate with a DBMS than without it. In most cases, DBMSs also reduce the reliance of individual users on computer specialists to meet their data needs. Improved security: As stated earlier, DBMSs allow multiple users to access the same data resources. This capability is generally viewed as a benefit, but there are potential risks for the organization. Some sources of information should be protected or secured and only viewed by select individuals. Through the use of passwords, database management systems can be used to restrict data access to only those who should see it.

DISADVANTAGES OF DATABASE MANAGEMENT SYSTEM:


There are basically two major downsides to using DBMSs. One of these is cost, and the other the threat to data security. Cost: Implementing a DBMS system can be expensive and timeconsuming, especially in large organizations. Training requirements alone can be quite costly. Security: Even with safeguards in place, it may be possible for some unauthorized users to access the database. In general, database access is an all or nothing proposition. Once an unauthorized user gets into the database, they have access to all the files, not just a few. Depending on the nature of the data involved, these breaches in security can also pose a threat to individual privacy. Steps should also be taken to regularly make backup copies of the database files and store them because of the possibility of fires and earthquakes that might destroy the system.

APPLICATIONS OF DATABASE MANAGEMENT SYSTEM:


Universities: For student information, course details, and grades. Airlines: For reservations and schedule information. Credit card transactions: For purchase on credit cards and generations of monthly statements. Human resources: For information about employees, salaries, payroll taxes, benefits and for generations of paychecks. Banking: For customer information, accounts, and banking transactions.

COSTS AND RISKS OF THE DATABASE APPROACH:


As with any business decision, the database approach entails some additional costs and risks that must be recognized and managed when implementing this approach. New, Specialized Personal: Frequently, organizations that adopt the database approach need to hire or train individuals to design and implement databases, provide database administration services, and manage a staff of new people. Further, because of the rapid changes in technology these new people will have to be retrained or upgraded on a regular basis. This personnel increase may be more than offset by other productivity gains, but an organization should not minimize the need for these specialized skills, which are required to obtain the most from the potential benefits. Installation and Management Cost and Complexity: A multi-user database management system is a large and complex suit of software that has a high initial cost, requires a staff of trained personnel to install and operate, and also has substantial annual maintenance and support costs. Installing such a system may also require upgrades to the hardware and data communications systems in the organization. Substantial training is normally require on an ongoing basis to keep up with new releases and upgrades. Additional or more sophisticated and costly database software may be needed to provide security and to ensure proper concurrent updating of shared data. Conversion Costs: The term Legacy systems is widely used to refer to older applications in an organization that are based on file processing and/or older database technology. The cost of converting these older

systems to modern database technology measured in terms of dollars, time, and organizational commitment may prohibitive to an organization. Need for Explicit Backup and Recovery: A shared corporate database must be accurate and available at all times. This requires that comprehensive procedures be developed and used for providing backup copies of data and for restoring a database when damage occurs. A modern database management system normally automates many more of the backup and recovery tasks than a file system. Organizational Conflict: A shared database requires a consensus on data definitions and ownership as well as responsibilities for accurate data maintenance. Experience has shown that conflicts on data definitions, data formats and coding, rights to update shared data, and associated issues are frequent and often difficult to resolve. Handling these issues requires organizational commitment to the database approach, organizationally astute database administrators, and a sound evolutionary approach to database development. If strong top management support of and commitment to the database approach is lacking, end-user development of stand-alone databases is likely to proliferate. often seem

Você também pode gostar