imp ans
imp ans
ALTER :-
1)alter table is used to modify structure of a table
2) we can add,delete or modify column
Syntax:- Alter table tablename
ADD column_name datatype(size);
(write example of alter table)
UPDATE:-
1)Sometimes change in database become necessary
2) To make change in database update command is used
Syntax:- UPDATE table_name set column_name=new_value[where condition];
(write example of update values in table)
DELETE:- the records from exisiting table can be removed using delete command
Syntax:- DELETE from table_name;
(write example of delete values in table)
Strong entity:-
1) if an entity having its own key attribute specified then it is a strong entity
2) Key attribute is ued to identify that entity among set of entities in entity -set
3) Strong entity is denoted by single rectangle
Weak entity:-
1) The entity which does not have any key attribute is known as weak entity
2) Weak entity depends on strong entity
3) It is denoted is double rectangle
Domain:-
1) Every attribute has some pre-defined values scope known as attribute domain
2) This attribute domain decides which types of values are premitted in the attribute
Attribute:-
1) An attribute is a characteristics of an entity
2) It is column of a table
3) Every attribute is attached with specific data type which decides that which type of value can be
inserted in those attributes
4) Attributes are also known as fields
Database:-
1) collection of related data is called as database
2) Database is considered as collection of tables
Hierarchical model:-
1) A data model in which data is organized into a tree structure is known as hierarchical model
2) It is a top bottom approach
3) The data is stored in form of records . These records are connected to each others
4) It contains parent child relationship where parent is root of tree which then branches into the
children
(draw diagram for example)
Primary Key:-
1) Primary key uniquely identified each entity in the entity set
2) It must have unique values and cannot hold null values
3) Example:- in student table s_id is considered as primary key because it cannot hold same values
Candidate Key:-
1) Candidate key is formed by collection of attributes which hold unique value
2) The attribute which do not contain duplicate values may be a candidate key
3) It is a combination of two key attributes
4) Example:- in student data base with attribute s_regid ,s_rollno , s_name,address
The candidate keys are:-
{s_regid}
{s_rollno}
{s_regid,s_rollno}
Foreign Key:-
1) The foreign key is called as reference key
2) In this constraint one field is common in between two tables
3) Foreign key represent relationship between tables
2) Sharing of data
A) In file processing system there is limit to share the data
B) In DBMS data can be easliy shared by different application
C) Database administrator manages the data and gives right to user to access the data
3) Data Independence
A) In file processing system the file is dependent on particular semicolon,format
B) In DBMS there is no need of particular format
C) If changes are made in structure of database then there is no need to make changes in the program
D) This is called as data independence
4) Security:-
A) In DBMS the different user can have different level of access of data based on their roles
B) We can provide password to database
Data abstraction:- Extracting the important data and ignoring the irrelevant data is called as data
abstraction
Three level of data abstraction
1) Physical level:-
A) In data abstraction physical level is the lowest level
B) It describes how the the data is actually stored in the physical memory
C) The data is stored in the hard disk
2) Logical level:-
A) This is the next higher level of data abstraction
B) The data is abstracted from the physical level
C) Database administrators use the logical level of abstraction to decide what information to keep
in database
3) View level:-
A) It is the highest level of data abstraction
B) This level describes the user interaction with database system
C) We can view the database we cannot make any changes in database
D) Multiple views can be created for same database for multiple user
Relational model:-
1) Tables are used to represent the data and their relationship
2) Tables is a collection of rows and columns
3) Tables are also known as relations
4) Record are known as tuples and fields are known as attribute
5) (draw table and explain the table)
Normalization:-
1) Normalization is a database design technique which is used to organize the table in such manner
that it should reduce redundancy and dependency of data
2) It divides larger tables to smaller table and links these smaller table using their relationship
3) Normalization is a multi step process
2NF:-
1) Prime attribute:-
A) An attribute which is a part of the prime key is known as prime attribute
2) Non Prime attribute:-
A) An attribute which is not a part of the prime key is said to be a non prime attribute
3) As per the rule of Second Normal Form every non prime attribute must be dependent upon the
prime attribute
PROJECT
PROJ_ID PROJ_NAME
P1 Banking System
P2 Library Management
P3 Speech to Text converter
P4 ATM
5) Atomicity Problem
A) Failure in a computer system may occur any time
B) When failure occurs if any transaction is in its midway than it may lead to some incorrect data
updation in system
E_id E_name
1 xyz
2 Pqr
2 Pqr
3 Abc
In UNION ALL we combine two table tables and duplicate rows is also combined