You are on page 1of 4

Class-1: Theory

---------------
student(SID, S_Name, S_Age, S_Address, S_Contact, S_Gender)
1, abc, 10, india, 123, M
2, lily, 20, US, 456, F

RegisteredCourse(C_ID, C_Name, S_Name)


100, SQL, abc
200, AE, xyz

integrity -- xyz/ lily

a1 --> b1
a1 --> b2

a1 --> b1/b2

person(ID, Name, Age)


1, Priya, 25
2, Trimala, 26
3, Mahesh, 26

ID --> Age
2 --> 25/26/27 = 26
3 --> 25/26/27 = 26

create
alter
drop

insert --> add data in the table


update --> modify the existing data from the table
delete --> remove data from the table

user1 can access the table student --> grant


user2 can not access the table student --> revoke

-- what is stale data?


-- What is client server architecture?
-- What is data consistency?
-- how to recover data?
-- What is SSMS(SQL Server Management Studio) and its role?
-- What is RDBMS?

-- Command types:
DQL, DDL, DML, DCL

-- Higherarchy
DBMS
Database
Table
Data
(1, CSE301) --> A
(1, CSE306) --> C
Facebook_User(UserName, Password, FirstName, Lastname, MobileNumber, emailaddress,
Age)
(FB_Usr1, 123, Debabrata, Ghosh, 12345, dg@gmail, 35)
(FB_Usr2, a123b, Risha, Halder, 94321, rh@gmail, 24)
(FB_xyz, abcd, Edmund, Anazodo, 98765, ea@yahoo, 28)

Facebook_User(F_UserName, Password, FirstName, Lastname, MobileNumber,


emailaddress, Age)
(abc, 123, Debu, Ghosh, 99999, debughosh@gmail.com, 36)

personaldetails(ID, firstname, lastname, age, country, gender, DOB, Language,


Interest, hobby, emailaddress)
(1, Debu, Ghosh, 36, India, Male, 21-09-1987, English, CS, Music,
debughosh@gmail.com)

(firstname, lastname, age, country, gender, DOB)


(firstname, lastname, age, country, gender, DOB, Language)
(firstname, lastname, age, country, gender, DOB, Language, Interest)
(firstname, lastname, age, country, gender, DOB, Language, Interest, hobby)

userID --> Age


abc --> 25
xyz --> 25, 26,27

LMS(books, subjects, members, admins, booklocations, reports, pentalty, infra,


etc.)

Order(oid, cid, cName, item, quantity, price)


(1, 1, Debabrata Ghosh, rice, 1, 100)

Customer(cid, cname, address, age, mobile)


(1, Debabrata Ghosh, Kolkata, 35, 12345)

problem --> design database --> design tables --> designing procedures -->
designing features --> (Populating data into database)

(roll_number, course_id) --> non-prime attribute


(Roll_number, Course_id, Name) --> non-prime attribute

abc --> d
a --> d
Customer(cid, cname, address, age, mobile)

cid --> cname, address, age, mobile (FFD)


cid, cname --> address, age, mobile (PFD)
cid, cname, address --> age, mobile
cid, cname, address, age --> mobile

-- Funtional dependency:
A cell value in a row can uniquely determine the other cell values of the same row

-- Super Key: A superkey is a combination of columns that uniquely identifies any


row within a table.
-- Candidate Key: A Candidate key is a subset of Super key without any unnecessary
attributes for uniquely identifying rows.
-- Prime attribute: An attribute that is a part of one of the candidate keys is
known as prime attribute.
-- Non Prime attribute: An attribute that is not part of the candidate keys is
known as non prime attribute.

-- Partial Functional dependency:


When a non prime attribute is functionally dependent on part of candidate key.

-- Full Funtional dependency:


When a non prime attribute is functionally dependent only on the candidate key.

-- Transative Functional Depedency: (Special case)


A functional dependency is transative if it is formed by two funtional depedency.
A-->B
B-->C
TFD: A-->C

-- Multivalued Functional Depedency: (Special case)


When there are more than one independent multivalued attribute in a table.
Example:
Model --> --> Year

why normalization?
anomalies without nornalization?
Dependencies

(E_ID, Certification, Hobby)


1, java, books
1, SQL, books
1, Python, books
1, C#, books
1, ML, books

2, SQL, books
2, SQL, cricket
2, SQL, Football
2, SQL, Planting
2, SQL, Dogs

E_ID --> --> Hobby


E_ID --> --> Certification

T1(E_ID, Certification)
T2(E_ID, Hobby)
1, Java
1, SQL
1, Python
1, C#
1, ML
2, SQL

1, books
2, books
2, cricket
2, Football
2, Planting
2, Dogs

Roll --> Name, Pin, State, City, District

Roll --> State, City, District

Roll --> Pin


Pin --> State, City, District

You might also like