Database
A single logical
file which is used to store our data in the form of rows and columns called
tables. Management system is set of rules and regulations. Which are required
to keep check on incoming data.
There are 5 types of keys in DBMS. These keys are used to enforce some rules and regulations to enter data in a required, specified way. These keys are Primary Key, Unique Key, Not Null, Check constraint, Foreign Key.
Primary key is the combination of 2 keys. These keys are unique key and not null key. Primary key is used to make all the values in a column un-identical and prevent the data column from duplication. This key is also used to make relationship with other columns of some other table to develop parent and child relationship.
Unique key is such a key that is used to make all the values of the column un-identical. We use this key where we want to have different values in a column.
Not null is used to prevent the column from null values. Null is a value and such values that are unassigned or unavailable. So data values are not accessible. To get avoid from this situation we apply not null key. The values can be duplicated and cannot be null.
This constraint is used to apply upper and lower bounds of the columns so that only those values can be entered that are with in the start and end range of the constraint. This key is used to avoid from undesirable values. For example marks assigned in any subject must be larger then or equal to zero. As well as maximum marks of the subject is 100 so the value entered must be equal to or less than zero.
Foreign key is a key that is used to make relationship between master tables and child tables. When primary key of one table is enforced on another column of another table to make relationship then this primary key in other table will become as foreign key. Foreign key values of the table will be within the range of the values from the primary key values. Primary key table will call parent table and foreign key values table will call child table.
SQL is a standard tool that is used to make communication with database tables. SQL is used to insert, delete, update or search/retrieve required values from the tables. It has 3 parts. DML, DDL, DCL.
DML is used to communicate database tables for insertion of new record, deletion of unwanted data, updating existing records which requires changes or correction in the database tables and selection of records for providing information to the clients, customers or higher management. DML is normally used to insert, delete, update and select.
Data definition language is used to make changes in the tables and their structures. We use DDL to create new tables, adding columns in the tables, dropping columns from the tables, renaming tables.
Create Table, Alter Table, Drop Table are commonly used commands of DDL.
DCL is used to grant and revoke rights for insertion, selection, updating and deletion of records from the tables of other users.
4 Comments
Introduction to database
ReplyDeleteVery brief and worth appreciation
ReplyDeleteVery helpful information
ReplyDeleteinteresting stuff
ReplyDelete