SB101 - C2
SB101 - C2
1.
--------------------------------------------------
create table person
+-----------+----------+---------------+----------+
| firstName | lastName | City | state |
+-----------+----------+---------------+----------+
| Allen | wang | NULL | NULL |
| Bob | Allice | New York City | New York |
+-----------+----------+---------------+----------+
===================================================================================
==========================================================
2.Briefly explain what a transaction is along with the ACID properties.
Ans - Transaction is small unit of program which may contains several low level
task.
Transaction in a database system must maintain Atomicity, Consistency,
Isolation, and Durability , which is commonly
known as ACID properties.
===================================================================================
==============================================================
4.a) What is normalization and why is it needed?
Ans -
Normalization is a database design technique that reduce data redundancy and
eliminates undesirable
characteristics like insertion, updation,and Deletion Anomalies. Normalization
rules divies larger tables
into smaller tables and link them using relationships.The purpose the
normalization in SQL is to eliminate
repetative data and ensure data is stored logically.
It is needed because it ensure that the table only contains data directly
related to the primary key,each data
field contains only one data elements, and remove repetative data.
b) What is the 2NF? Explain with an example. You don�t need to draw the
tables or write the queries. Just mention the schema before and after the
third normal form.
Example-
1. The baby is partially dependent on her father , and similarly
partially dependent on her mother.
2. if there is three data candId, subject_NO, Subject_Fee , then
subject_fee can't determine the values of the CandNo, or
Subject_No;subjec_fees with subject_No still cant determine the CandId. conclusion
subject_fee is non-prime doesn't
belong to candidate key.