Important of DBMS


        DBMS Notes

                                                                                                                                                    Date:-19/6/2019

(1) What is DBMS and advantage over the file system?
Database Management System is used for data storage.In  DBMS we can update file any time but it in file system it can not possible.

(2) Data models used in DBMS?
(1)Table
 (2)Document
    (3)Key Value
    (4)Graph

(3) 1,2 and 3 tier architecture?
In 1-tier architecture we can only insert data in database and in 2-tire it can connect with any  application and in the last 3-tier it can connect with any application and also we can send data.

(4) Data hiding:-
Data hiding is basically used for data hide in DBMS.As ex if we take election database in which user can see the basic information they can not see the voting numbers.

(5) Data Abstraction Model?
Data Abstraction give some of the information about   database not give 100%.It have 3 levels,
(1) Physical:- It Size of database.
(2) Logical:- It is logic according database.
(3) View :- and view is how user can see.

(6) Important Word:-
 (1) Attributes:-It means Columbus.
(2) Schema:- Std_details(ID,Name,Branch)
(3) Cardinality:- Number of Rows(Tuple/records)
(4) Arity:- Number of Attributes

(7) SQL(Structure Query Language):-
    
In DBMS 2 types of Language
(1) Procedure Language:- It’s know all things means                   how it happens and how it works.
(2) Non-Procedure Language:-It’s Know only result.it did not know how it works.

→ SQL parts:
(1) DDL(Data Definition Language)
(2) DML(Data Manipulate Language)
(3) DCL(Data Control Language)
(4) DQL(Data Query Language)
   
DQL(Data Query Language):- In which 3 main words
(1) SELECT___:-Attribute
(2) FROM___:- Table Name
(3) WHERE__:- Condition

                                                                             DATE:-20/6/2019
(8) SQL:-
DDL:-  (1)CREATE
 (2) ALTER
 (3) DROP
     DML:-  (1) INSERT
 (2) DELETE
 (3) UPDATE
     DLL:-   (1) COMMIT
   (2) ROLLBACK

(9) Disadvantage of FileSystem or Advantage of DBMS
→ (1) Data Redundancy(Data Overlapping)
     (2) Data Consistency(Data Updation)
     (3) Atomicity(Either whole or Null)
     (4) Integrity(Block while account balance is 0)
     (5) Data Isolation(Data process will be different)

(10) RULES for DBMS
→ (1) Information Rule
     (2) Guaranteed  Access Rule
     (3) Systematic treatment of Null values
     (4) Dynamic catalog based on the relational models
     (5) Comprehensive data sublanguage Rule
     (6) View Updating Rule
     (7) High level Insert,Update,Delete
     (8) Physical Data Independent  
     (9) Logical Data Independent
     (10)Integrity Data Independent
     (11)Distribution Data Independent
     (12)Non subversion Rule

(11) Applications of DBMS
→ Swiggy,Voting,Bank,Hospital etc.

(12) Design DataBase
→  (1) Conceptual Framework
        → Topic:-Election System
                        → In this database i have taken different attributes for election like details of candidate,voters etc..                 
   
     (2) Schema
       → party_details(PartyName,No.candidate,head office,city)
            candidate_details(Name,Id,Address,Mobilenumber)
    voter_details(Name,Age,Address,WardNo,city)
    city_details(CityName,Division,No.voters)
    pastcandidate_details(Name,PartyName,Age,Id,WardNo)

      (3) Design
      → party_details
PartyName
No.candidate
Head office
city
BJP
3
Madhapar
Rajkot
Congress
3
Raiya Circle
Rajkot
AAP
2
Hospital Chowk
Rajkot
SAPA
2
Trikon Baug
Rajkot
Other
1
Geenland
Rajkot

 → candidate_details
Name
Id
Address
Mobile Number
Harshal Faldu
BJ-28
Gondal Road, Rajkot, Gujarat 360002
9724567132
Ravi Patel
CO-23
Science City Rd, Sola, Ahmedabad, Gujarat 380061
8780653472
Nisarg Satani
AA-34
Rajkot, Gujarat
9944177842
Aman Makwana
SA-25
Powai, Mumbai, Maharashtra - 400076
9956376845
Param Teraiya
O-41
Gandhinagar, Gujarat
7096345925

 → voter_details
Name
Age
Address
Ward no
city
Jay Solanki
26
Main Road, Sadguru Nagar, Rajkot, Gujarat 360005
8
Rajkot
Jay Zalavadiya
29
Dhebar Road,, Rajkot, Gujarat 360001
3
Rajkot
Kishan Shingala
42
Jheelwas, Sadar, Rajkot, Gujarat 360001
6
Rajkot
Manan Patel
46
Ashram Road, Ahmedabad, Gujarat 380009
9
Ahmedabad
Jaydeep Sojitra
29
Bodakdev, Ahmedabad, Gujarat 380054
2
Ahmedabad

 → city_details
City_Name
Division
No_voters
Rajkot
17
1236735
Morbi
12
732312
Ahmedabad
21
2536748
Bhavnagar
15
844356
Botad
8
123452

→ Pastcandidate_details
Name
Age
PartyName
Id
Ward_no
Sushma Swaraj
38
BJP
BJ-534
      9
Narendra Patel
34
Congress
CO-45
      4
Kumar Anand
41
AAP
AA-324
     12
Barrack Obama
46
SAPA
SA-87
      6
Ravindra Jadeja
35
Other
O-657
     10

(13) Superkey:
→  In SupperKey we find closure of attributes and if it in range than it’s call SuperKey.
(1) x→y
     y→ z
     xy→ z
→ R=[X Y Z]
    [X]+=[X Y Z]
    [Y]+=[Y Z]
    [XY]+=[X Y Z]
(2) AB→ D
     D→ E
     E→ F
     CE→ F
     B→ C
     C→ D
R=[A B C D E F G]
→ [AB]+=[A B C D E F]
     [D]+=[D E F]
     [E]+=[E F]
     [CE]+=[C E D F]
     [B]+=[B C D E]
     [C]+=[C D E F]
(3) A→ C
     C→ D
     DE→ F
     B→ C
R=[A B C D E F]
→ [A]+=[A C D]
     [C]+=[C D]
     [DE]+=[D E F]
     [B]+=[B C D]
(4) AB→ C
      C→ X
      X→ Y
      YZ→ A
R=[A B C X Y Z]
→ [AB]+=[A B C X Y]
     [C]+=[C X Y]
     [X]+=[X Y]
     [YZ]+=[Y Z A]
(14) CandidateKey:
→  If XY attribute is SupperKey and individual X and Y is also SuperKey than XY call CandidateKey.

(15) ForeignKey:
If we access A Table PrimaryKey into another B Table than A  Table PrimaryKey if foreignkey for B Table.

(16) PrimaryKey:
Is a unique thing in table or database that are never be change and PrimaryKey more than one can possible.

(17)Schema Diagram:


              DATE:-4/7/2019
(18) SQL DataTypes:-
→ (1) CHAR(size)=To define strings,numbers,combination of both these datatype is used the range of
     (2)VARCHAR(size)=This datatypes is also used to define numbers,string and combination of both it has range between 1 to 65535.
     (3)NUMBER=To define only numbers,integer this data types is used
     (4)NUMBER(ps)=To define decimal numbers,float numbers this data types is used hear p means total number of digits and s means number after decimal points.
      (5)DATE=This data type is used to define date if we want to change the format of date it shou;ld be done by specific function the default date will be the first day of the current month.
      (6)TIMESTAMP=This data type is used to define 24 hours time format it also includes date.

(19)Rules of SQL:-
→ (1)The name of attributes should not be any kind of data type
     (2) space and dot are not allowed in SQL table creation syntax.
     (3) Each query of DDL,DML,DCl,DQL should be ended with a semicolon.
     (4) SQL is not a case sensitive language but in general practice keywords should be return in uppercase.

              DATE:-5/7/2019
(20)Trivial functional dependency
→ If an attribute is subset of/super set of dependent attribute than functional dependency defined by those attributes is known as trivial functional dependency.

(21)Non-trivial functional dependency
→ If an attribute is totally different than dependent attribute than function dependency defined by those attributes is known as non trivial functional dependency.

(22)Semi-trivial functional dependency
→ This dependency is combination of both trivial and non-trivial fd.

(23)MemberShip Set
→ If given function dependency included, defined new membership fd than new fd is known as member of given fd’s to find membership for fd the attribute closure of new fd should be measured

(24)Entity-Relationship Diagram:-


1-8-2019(Thu)
(25) Normalization:-
Normalization is procedure to clean your database it goes through the 4 steps of procedure each one is known as normalform
1. One NF:- In first normal form database will be clean by removing multi value available in particular attributes generally RDBMS is already in One NF that means it doesn’t contain any multivalue attributes.

2. Two NF:-In second normal form their should not be any prime →  non-prime dependency.
     → If an attribute is part of any candidate,superkey then it is known as prime attributes. To remove this dependency we have to decompose our table in which this dependency not be preserved.

3. Three NF:- If any database is having transitive relationship it creates redundancy so to remove redundancy we have to recompose or remove transitive relationship.

4. BCNF(Boyce codd normal form AB):-In BCNF if a table is containing to candidate keys and dependency between subset of of one candidate key to the subset of another candidate key is there then it should be removed.
→ In database all the dependency should be FFD after the normalization procedure.

Comments

Popular posts from this blog

Sudoku solving using CV and AI with an Image of Sudoku as Input!

I AM PATHO

We'll Make AatmanirbharBharat!